|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unh.sdb.common.TypeTable
public class TypeTable
The TypeTable class keeps track of user defined types in an internal data structure. Types may be retrieved by name or by typecode, an int greater than zero. Typecodes are assigned when a new user defined type is inserted into the typetable.
Field Summary | |
---|---|
static int |
invalidTypeCode
Returned by insert when an error occurs. |
protected java.util.HashMap |
nameHash
|
protected int |
nextTypeNumber
|
protected java.util.ArrayList |
numberList
|
Constructor Summary | |
---|---|
TypeTable()
Default constructor. |
|
TypeTable(int capacity)
This constructor allows an initial capacity to be specified. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int invalidTypeCode
protected java.util.HashMap nameHash
protected java.util.ArrayList numberList
protected int nextTypeNumber
Constructor Detail |
---|
public TypeTable()
public TypeTable(int capacity)
Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |