Package gnu.expr
Class LitTable
- All Implemented Interfaces:
DataOutput
,ObjectOutput
,AutoCloseable
,Map<Object,
Object>
Manages the literals of a Compilation.
Implements ObjectOutput, because we use externalization to determine
how literals get compiled into code that re-creates the literal.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
emit()
findLiteral
(Object value) void
flush()
int
Calculate hash code of a key.protected boolean
Compare two keys for equivalence.void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) void
writeBoolean
(boolean v) void
writeByte
(int v) void
writeBytes
(String s) void
writeChar
(int v) void
writeChars
(String v) void
writeDouble
(double v) void
writeFloat
(float v) void
writeInt
(int v) void
writeLong
(long v) void
writeObject
(Object obj) void
writeShort
(int v) void
Methods inherited from class gnu.kawa.util.GeneralHashTable
allocEntries, getEntryHashCode, getEntryNext, getNode, makeEntry, setEntryNext
Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, get, getOrDefault, hashToIndex, matches, put, put, rehash, remove, size
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
LitTable
-
-
Method Details
-
hash
Description copied from class:AbstractHashTable
Calculate hash code of a key. -
matches
Description copied from class:AbstractHashTable
Compare two keys for equivalence. Override this and theAbstractHashTable.hash(Object)
method if you want a different equivalence relation. -
emit
- Throws:
IOException
-
flush
public void flush()- Specified by:
flush
in interfaceObjectOutput
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceObjectOutput
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) - Specified by:
writeBoolean
in interfaceDataOutput
-
writeChar
public void writeChar(int v) - Specified by:
writeChar
in interfaceDataOutput
-
writeByte
public void writeByte(int v) - Specified by:
writeByte
in interfaceDataOutput
-
writeShort
public void writeShort(int v) - Specified by:
writeShort
in interfaceDataOutput
-
writeInt
public void writeInt(int v) - Specified by:
writeInt
in interfaceDataOutput
-
writeLong
public void writeLong(long v) - Specified by:
writeLong
in interfaceDataOutput
-
writeFloat
public void writeFloat(float v) - Specified by:
writeFloat
in interfaceDataOutput
-
writeDouble
public void writeDouble(double v) - Specified by:
writeDouble
in interfaceDataOutput
-
writeUTF
- Specified by:
writeUTF
in interfaceDataOutput
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
-
writeObject
- Specified by:
writeObject
in interfaceObjectOutput
- Throws:
IOException
-
findLiteral
-