uk.co.mullsoft.jean
Class Indexer

java.lang.Object
  extended by uk.co.mullsoft.jean.Indexer
All Implemented Interfaces:
java.util.Comparator
Direct Known Subclasses:
AlphaIndexer, DiscreteIndexer, RangeIndexer, SetIndexer, UserDefinedIndexer

public abstract class Indexer
extends java.lang.Object
implements java.util.Comparator


Field Summary
static int ALPHA
           
protected  JEANAPI api
           
protected  java.lang.String attributeName
           
protected  AttributeType attributeType
           
static int DISCRETE
           
static java.lang.String indexSeparator
           
static java.lang.String JEANVALUE
           
protected  NodeType nodeType
           
static int RANGE
           
static int SET
           
static int USERDEFINED
           
 
Constructor Summary
protected Indexer(JEANAPI api, NodeType nodeType, java.lang.String attributeName)
          the name in the attribute describes the range from that point to the next.
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          compare values of the attributes used in the index using default dictionary order alphabetic comparison
 java.lang.String getAttributeName()
           
 AttributeType getAttributeType()
           
abstract  int getIndexerType()
           
 NodeType getNodeType()
           
abstract  java.lang.String[] index(Node node)
           
static Indexer newIndexer(JEANAPI api, NodeType nodeType, java.lang.String attributeName, int indexType)
           
static Indexer newIndexer(java.lang.String indexerString)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

indexSeparator

public static final java.lang.String indexSeparator
See Also:
Constant Field Values

DISCRETE

public static final int DISCRETE
See Also:
Constant Field Values

RANGE

public static final int RANGE
See Also:
Constant Field Values

ALPHA

public static final int ALPHA
See Also:
Constant Field Values

SET

public static final int SET
See Also:
Constant Field Values

USERDEFINED

public static final int USERDEFINED
See Also:
Constant Field Values

JEANVALUE

public static final java.lang.String JEANVALUE
See Also:
Constant Field Values

attributeType

protected AttributeType attributeType

nodeType

protected NodeType nodeType

attributeName

protected java.lang.String attributeName

api

protected JEANAPI api
Constructor Detail

Indexer

protected Indexer(JEANAPI api,
                  NodeType nodeType,
                  java.lang.String attributeName)
the name in the attribute describes the range from that point to the next. If a range is needed before the first value then its name must be given in the first element with either a minimum value (e.g. Integer.MIN_VALUE) or null; if null then the comparison will simply be before the next value rather than between two values. If a name is required after the last value it should be either the last or penultimate value in points, if it is the last value then the corresponding value may be null to indicate a simple comparison with the previous value, if there is another value its name must be null or empty and the comparison will be between.

Method Detail

newIndexer

public static Indexer newIndexer(java.lang.String indexerString)

newIndexer

public static Indexer newIndexer(JEANAPI api,
                                 NodeType nodeType,
                                 java.lang.String attributeName,
                                 int indexType)

getAttributeType

public AttributeType getAttributeType()

getNodeType

public NodeType getNodeType()

getAttributeName

public java.lang.String getAttributeName()

index

public abstract java.lang.String[] index(Node node)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getIndexerType

public abstract int getIndexerType()

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
compare values of the attributes used in the index using default dictionary order alphabetic comparison

Specified by:
compare in interface java.util.Comparator