|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.graph.TokenSet
public abstract class TokenSet
This abstract class is the parent of the token set hierarchy. These containers keep track of valid tokens for a CATEGORICAL attribute type.
AttributeCategorical
Field Summary | |
---|---|
protected java.util.ArrayList<java.lang.String> |
tokenList
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
tokenMap
|
Constructor Summary | |
---|---|
TokenSet()
|
Method Summary | |
---|---|
protected void |
add(java.lang.String token)
Adds the supplied token to this set; duplicates are not allowed. |
boolean |
contains(java.lang.String token)
Determines if a token is valid for this container. |
java.lang.String |
getToken(int i)
Gets the i'th element from the array of valid tokens. |
java.lang.String[] |
getTokens()
Get a String array of valid tokens. |
int |
getValue(java.lang.String token)
Gets the integer value associated with the supplied token. |
int |
size()
Gets the size of the categorical token list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Map<java.lang.String,java.lang.Integer> tokenMap
protected final java.util.ArrayList<java.lang.String> tokenList
Constructor Detail |
---|
public TokenSet()
Method Detail |
---|
protected void add(java.lang.String token)
token
- a String token to add to this container.
java.lang.RuntimeException
- if the token already exists in this
container.public boolean contains(java.lang.String token)
token
- a String representation of a value for this Set.
public java.lang.String[] getTokens()
public java.lang.String getToken(int i)
i
- the index to get the token from.
java.lang.IndexOutOfBoundsException
- if the supplied index is not
within the range of valid token indexes.public int size()
public int getValue(java.lang.String token)
token
- a String representing the token to be converted
into a numeric value.
java.lang.RuntimeException
- if the supplied token isn't found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |