public class TypeTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
invalidTypeCode
Returned by insert when an error occurs.
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
nameHash |
protected int |
nextTypeNumber |
protected java.util.ArrayList<Type> |
numberList |
Constructor and Description |
---|
TypeTable()
Default constructor.
|
TypeTable(int capacity)
This constructor allows an initial capacity to be specified.
|
Modifier and Type | Method and Description |
---|---|
Type |
get(int typeCode)
Return the Type corresponding to the typeCode.
|
Type |
get(java.lang.String name)
Return the Type corresponding to the name.
|
int |
getTypeCode(java.lang.String name)
Return the typecode corresponding to the type name.
|
java.lang.String |
getTypeName(int typeCode)
Return the type name corresponding to the typecode.
|
int |
insert(UserType d)
Adds a user defined type to the typetable.
|
static void |
main(java.lang.String[] args)
For testing and debugging.
|
int |
size()
Return the number of types stored in the TypeTable.
|
java.lang.String |
toString()
Return a representation of this object as a nicely formatted String.
|
public static final int invalidTypeCode
protected java.util.HashMap<java.lang.String,java.lang.Integer> nameHash
protected java.util.ArrayList<Type> numberList
protected int nextTypeNumber
public TypeTable()
public TypeTable(int capacity)
public int insert(UserType d)
public final Type get(java.lang.String name)
public final Type get(int typeCode)
public final int getTypeCode(java.lang.String name)
public final java.lang.String getTypeName(int typeCode)
public final int size()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)