All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.utils.InvertedTokenList

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

public class InvertedTokenList
extends Object
An inverted token list is used to find the name associated with a token.

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

Constructor Index

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

Method Index

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

Constructors

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

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

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

Methods

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

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

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index