All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.utils.TokenList

java.lang.Object
   |
   +----org.xmlmiddleware.utils.TokenList

public class TokenList
extends Object
Manages a list of tokens.

Version:
2.0
Author:
Ronald Bourret, 1998-9, 2001
See Also:
InvertedTokenList

Constructor Index

 o TokenList(String[], int[])
Construct a TokenList without a default.
 o TokenList(String[], int[], int)
Construct a TokenList with a default.

Method Index

 o getToken(String)
Get the token value for a particular name.
 o getToken(String, int)
Get the token value for a particular name, overriding the default value if necessary.

Constructors

 o TokenList
 public TokenList(String names[],
                  int tokens[])
Construct a TokenList without a default.

Parameters:
names - Token names.
tokens - Token values.
 o TokenList
 public TokenList(String names[],
                  int tokens[],
                  int defaultToken)
Construct a TokenList with a default.

Parameters:
names - Token names.
tokens - Token values.
defaultToken - Default value (returned when a name is not found).

Methods

 o getToken
 public int getToken(String name,
                     int overrideDefault)
Get the token value for a particular name, overriding the default value if necessary.

Parameters:
name - Token name.
overrideDefault - The temporary default value.
Returns:
The token value or overrideDefault if the name is not found.
 o getToken
 public int getToken(String name)
Get the token value for a particular name.

Parameters:
name - Token name.
Returns:
The token value or the list default if the name is not found. If no list default has been set, 0 is returned.

All Packages  Class Hierarchy  This Package  Previous  Next  Index