proper.imp
Class Indexer

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.imp.Indexer
All Implemented Interfaces:
ProperInterface

public class Indexer
extends ProperObject

This class interpretes the "verbal" indexes for files, e.g. "first" or "last", and provides methods for checking indexes etc.

Version:
$Revision: 1.2 $
Author:
FracPete

Field Summary
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
Indexer()
          initializes the object
 
Method Summary
 void addSplitIndexId(Data d, int index)
          sets for the given predicate the index where a split-id was inserted (necessary for the Namer!)
 int getIndex(Data d, java.lang.String indexStr)
          determines the index for the given predicate and index-String
 int getIndexCount(java.lang.String name)
          returns the number of indexes the given predicate/list has
 java.lang.String getIndexes()
          returns the "verbal" indexes used for determining indexes (this is the original set string!)
 java.util.Vector getIndexes(java.lang.String name)
          returns the "processed" indexes for the given predicate/list
 java.util.Vector getIndexNames()
          returns all names where there are indexes stored
 java.util.Vector getListsWithIndex()
          returns a vector with names of lists that contain an index
 java.lang.String getProcessedIndexes()
          returns the processed "verbal" indexes
 java.lang.String getProcessedIndexes(java.lang.String name)
          returns the processed "verbal" indexes for the given predicate/list
 Traverser getTraverser()
          returns the currently used traverser
 boolean isIndex(Data d, int index)
          checks whether the given index is an id index of the given predicate
 boolean isSplitIndexId(Data d, int index)
          checks whether the given index contains an id from a predicate split
 boolean keyIsInt()
          checks whether the key used in the predicates is an Integer
 void removeNullIndexes()
          removes predicates that have a NULL in an index
 void setAddClassLabel(boolean addClassLabel, boolean onlyForSingles)
          whether the class label was added for the current predicates (necessary for the calculation of the index!)
 void setIndexes(java.lang.String indexes)
          sets the "verbal" indexes and does the initialization
 void setTraverser(Traverser traverser)
          sets the traverser to access the current predicates and initializes
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Indexer

public Indexer()
initializes the object

See Also:
Import
Method Detail

setIndexes

public void setIndexes(java.lang.String indexes)
sets the "verbal" indexes and does the initialization


getIndexes

public java.lang.String getIndexes()
returns the "verbal" indexes used for determining indexes (this is the original set string!)


getIndexes

public java.util.Vector getIndexes(java.lang.String name)
returns the "processed" indexes for the given predicate/list


getProcessedIndexes

public java.lang.String getProcessedIndexes()
returns the processed "verbal" indexes


getProcessedIndexes

public java.lang.String getProcessedIndexes(java.lang.String name)
returns the processed "verbal" indexes for the given predicate/list


getIndexCount

public int getIndexCount(java.lang.String name)
returns the number of indexes the given predicate/list has


getIndexNames

public java.util.Vector getIndexNames()
returns all names where there are indexes stored


setTraverser

public void setTraverser(Traverser traverser)
sets the traverser to access the current predicates and initializes


getTraverser

public Traverser getTraverser()
returns the currently used traverser


setAddClassLabel

public void setAddClassLabel(boolean addClassLabel,
                             boolean onlyForSingles)
whether the class label was added for the current predicates (necessary for the calculation of the index!)

Parameters:
addClassLabel - whether the class label was added
onlyForSingles - if TRUE the the class label was only added in predicates that had only one argument

isIndex

public boolean isIndex(Data d,
                       int index)
checks whether the given index is an id index of the given predicate


getIndex

public int getIndex(Data d,
                    java.lang.String indexStr)
determines the index for the given predicate and index-String


removeNullIndexes

public void removeNullIndexes()
removes predicates that have a NULL in an index


keyIsInt

public boolean keyIsInt()
                 throws java.lang.Exception
checks whether the key used in the predicates is an Integer

Throws:
java.lang.Exception - throws an exception if there are no predicates with indexes

getListsWithIndex

public java.util.Vector getListsWithIndex()
returns a vector with names of lists that contain an index


addSplitIndexId

public void addSplitIndexId(Data d,
                            int index)
sets for the given predicate the index where a split-id was inserted (necessary for the Namer!)


isSplitIndexId

public boolean isSplitIndexId(Data d,
                              int index)
checks whether the given index contains an id from a predicate split