MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.datamodel
Class DeweyIdentifier

java.lang.Object
  extended by ch.ethz.mxquery.datamodel.DeweyIdentifier
All Implemented Interfaces:
Identifier

public class DeweyIdentifier
extends java.lang.Object
implements Identifier


Constructor Summary
DeweyIdentifier(Identifier lastID, int level, Source source)
           
DeweyIdentifier(int[] dewey_id2, int level, Source store2)
           
 
Method Summary
 int compare(Identifier toCompare)
          Compares this token identifier with an other one.
 int comparePosition(Identifier toCompare)
           
static Identifier createIdentifier(Identifier last_identifier, int level, Source store)
          Creates an identifier for a particular store at a level starting from a previous identifier
static Identifier[] createInsertIdentifiers(Identifier leftBoundId, Identifier rightBoundId, int number, Source source, int[] levels)
          Creates Identifiers for Tokens that are between the ids leftBoundId and rightBoundId.
 void dumpID()
           
 int[] getDeweyId()
          returns the Dewey Id of this
 int getDeweyLevel()
          returns the length (level) of this
 Source getStore()
          returns the source of the identifier
 boolean isAncestorOf(DeweyIdentifier did)
          returns true if this is ancestor of did
 boolean isChildOf(DeweyIdentifier did)
          returns true if this is child (direct descendant) of did
 boolean isDescendantOf(DeweyIdentifier did)
          returns true if this is descendant of did
 boolean isParentOf(DeweyIdentifier did)
          returns true if this is parent (direct ancestor) of did
 boolean isSmallerThan(DeweyIdentifier did)
          returns true if this is smaller than did (order)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeweyIdentifier

public DeweyIdentifier(Identifier lastID,
                       int level,
                       Source source)

DeweyIdentifier

public DeweyIdentifier(int[] dewey_id2,
                       int level,
                       Source store2)
Method Detail

compare

public int compare(Identifier toCompare)
Compares this token identifier with an other one.

Specified by:
compare in interface Identifier
Parameters:
toCompare - another Identifier to compare
Returns:
0 if equal, -1 if identifier is smaller, 1 if identifier is bigger, and -2 if the two Identifier do not belong to the same data source.

comparePosition

public int comparePosition(Identifier toCompare)

getStore

public Source getStore()
returns the source of the identifier

Specified by:
getStore in interface Identifier
Returns:
the Source/Store for this identifier

isAncestorOf

public boolean isAncestorOf(DeweyIdentifier did)
returns true if this is ancestor of did


isParentOf

public boolean isParentOf(DeweyIdentifier did)
returns true if this is parent (direct ancestor) of did


isDescendantOf

public boolean isDescendantOf(DeweyIdentifier did)
returns true if this is descendant of did


isChildOf

public boolean isChildOf(DeweyIdentifier did)
returns true if this is child (direct descendant) of did


isSmallerThan

public boolean isSmallerThan(DeweyIdentifier did)
returns true if this is smaller than did (order)


getDeweyId

public int[] getDeweyId()
returns the Dewey Id of this


getDeweyLevel

public int getDeweyLevel()
returns the length (level) of this


createIdentifier

public static Identifier createIdentifier(Identifier last_identifier,
                                          int level,
                                          Source store)
Creates an identifier for a particular store at a level starting from a previous identifier

Parameters:
last_identifier -
level -
store -
Returns:
a new Dewey Identifier

createInsertIdentifiers

public static Identifier[] createInsertIdentifiers(Identifier leftBoundId,
                                                   Identifier rightBoundId,
                                                   int number,
                                                   Source source,
                                                   int[] levels)
                                            throws MXQueryException
Creates Identifiers for Tokens that are between the ids leftBoundId and rightBoundId.

Parameters:
leftBoundId - left bound
rightBoundId - right bound
number - number of ids that the method must produce
source - data source of the newly created ids
Returns:
array of identifiers
Throws:
MXQueryException

dumpID

public void dumpID()

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich