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 TypeMethodDescriptionvoidclose()voidemit()findLiteral(Object value) voidflush()intCalculate hash code of a key.protected booleanCompare two keys for equivalence.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String v) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteObject(Object obj) voidwriteShort(int v) voidMethods inherited from class gnu.kawa.util.GeneralHashTable
allocEntries, getEntryHashCode, getEntryNext, getNode, makeEntry, setEntryNextMethods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, get, getOrDefault, hashToIndex, matches, put, put, rehash, remove, sizeMethods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:AbstractHashTableCalculate hash code of a key. -
matches
Description copied from class:AbstractHashTableCompare 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:
flushin interfaceObjectOutput
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceObjectOutput
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean v) - Specified by:
writeBooleanin interfaceDataOutput
-
writeChar
public void writeChar(int v) - Specified by:
writeCharin interfaceDataOutput
-
writeByte
public void writeByte(int v) - Specified by:
writeBytein interfaceDataOutput
-
writeShort
public void writeShort(int v) - Specified by:
writeShortin interfaceDataOutput
-
writeInt
public void writeInt(int v) - Specified by:
writeIntin interfaceDataOutput
-
writeLong
public void writeLong(long v) - Specified by:
writeLongin interfaceDataOutput
-
writeFloat
public void writeFloat(float v) - Specified by:
writeFloatin interfaceDataOutput
-
writeDouble
public void writeDouble(double v) - Specified by:
writeDoublein interfaceDataOutput
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
findLiteral
-