org.inria.ns.reflex.util
Class CollectionsHelper.TokenSet

java.lang.Object
  extended by org.inria.ns.reflex.util.CollectionsHelper.TokenSet
Enclosing class:
CollectionsHelper

public static class CollectionsHelper.TokenSet
extends Object

Stores a set of tokens in a hashtable for fast index retrieval.


Constructor Summary
CollectionsHelper.TokenSet(Object[] tokens)
          Create a new token set.
 
Method Summary
 int getIndex(Object token)
          Return the position of the token in its original list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionsHelper.TokenSet

public CollectionsHelper.TokenSet(Object[] tokens)
Create a new token set.

Parameters:
tokens - The list of tokens.
Method Detail

getIndex

public int getIndex(Object token)
Return the position of the token in its original list.

Parameters:
token - The token to retrieve.
Returns:
The token's index in its original list (first item is at index 0). -1 if not found.