|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.util.TagList
A TagList stores a list of Tags (a positive integer tag value associated with an Object value) using arrays of integers and object references instead of arrays of Tag objects.
A TagList only allows the storage of one Object value for each distinct Tag value. That is, if you call set(int tag, Object value) and a value already exists for that integer tag value, then this new value will overwrite the old one.
| Field Summary | |
static int |
EmptyTag
|
int |
expandSize
|
protected int |
num
|
| Constructor Summary | |
TagList()
|
|
| Method Summary | |
void |
clear(int tag)
Remove a tag value. |
void |
defaultTo(int tag,
Object value)
Set a value for a tag if it has not already been set. |
Tag |
get(int tag,
Tag dest)
Get the tag Object for the specified tag integer value. |
Tag |
getAtIndex(int index,
Tag dest)
Get the tag at the specified index. |
protected int |
getEmptyIndex()
|
protected int |
getTagIndex(int tag)
|
Object |
getValue(int tag,
Object defaultValue)
|
boolean |
hasTag(int tag)
Check if the specified tag has a value set for it. |
void |
set(int tag,
Object value)
Set the Object value for a tag. |
void |
set(TagList tl)
Set all the tag values from the other TagList. |
int |
size()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected int num
public int expandSize
public static final int EmptyTag
| Constructor Detail |
public TagList()
| Method Detail |
public int size()
protected int getTagIndex(int tag)
protected int getEmptyIndex()
public Tag getAtIndex(int index,
Tag dest)
public Tag get(int tag,
Tag dest)
tag - The integer tag value to look for.dest - An optional destination tag object.
public Object getValue(int tag,
Object defaultValue)
tag - The integer tag value to look for.defaultValue - a default Object value to return if the tag is not found
public void set(int tag,
Object value)
tag - The integer tag value to set.value - The Object value to set.public void set(TagList tl)
tl - Another TagList to copy values from.public void clear(int tag)
tag - The integer tag value to remove.
public void defaultTo(int tag,
Object value)
tag - The integer tag value.value - The object tag value.public boolean hasTag(int tag)
tag - The integer tag value to check for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||