|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kit.furia.fragment.OBFragment
public final class OBFragment
Implementation of the mtd algorithm. This algorithm exploits hash codes from string representation of the tree and its complete subtrees. Additionally, it exploits the fact that once two complete subtrees j and m that belong respectively to trees T1 and T2, the intersection of j and m and all their complete subtrees can be calculated in linear time. This requires to have a value of multiplicity in each node of T1 and T2. So the expected running time is around O(|T1|) (where |T1| the size of the smallest tree)
Constructor Summary | |
---|---|
OBFragment()
|
|
OBFragment(java.lang.String x)
|
Method Summary | |
---|---|
short |
distance(org.ajmm.obsearch.ob.OBShort other)
|
int |
dn(OBFragment other)
|
int |
ds(OBFragment other)
|
boolean |
equals(java.lang.Object obj)
Returns true of this.tree.equals(obj.tree). |
MTDFragmentAST |
getTree()
|
int |
hashCode()
A hashCode based on the string representation of the tree. |
void |
load(com.sleepycat.bind.tuple.TupleInput in)
Re-creates this object from the given byte stream |
short |
mtd(OBFragment other)
|
static MTDFragmentAST |
parseTree(java.lang.String x)
|
void |
setTree(MTDFragmentAST tree)
|
int |
size()
Returns the size (in nodes) of the tree. |
void |
store(com.sleepycat.bind.tuple.TupleOutput out)
Stores this object into the given byte stream. |
java.lang.String |
toString()
|
protected void |
updateTree(java.lang.String x)
Internal method that updates the Tree from the String |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OBFragment()
public OBFragment(java.lang.String x) throws org.ajmm.obsearch.exception.OBException
org.ajmm.obsearch.exception.OBException
Method Detail |
---|
protected final void updateTree(java.lang.String x) throws org.ajmm.obsearch.exception.OBException
org.ajmm.obsearch.exception.OBException
public static final MTDFragmentAST parseTree(java.lang.String x) throws FragmentParseException
FragmentParseException
public final int size() throws org.ajmm.obsearch.exception.OBException
org.ajmm.obsearch.exception.OBException
- If something goes wrong.public final java.lang.String toString()
toString
in class java.lang.Object
public final void load(com.sleepycat.bind.tuple.TupleInput in) throws org.ajmm.obsearch.exception.OBException
load
in interface org.ajmm.obsearch.Storable
in
- A byte stream with the data that must be loaded.
org.ajmm.obsearch.exception.OBException
Storable.load(com.sleepycat.bind.tuple.TupleInput)
public final void store(com.sleepycat.bind.tuple.TupleOutput out)
store
in interface org.ajmm.obsearch.Storable
out
- The byte stream to be usedStorable.store(com.sleepycat.bind.tuple.TupleOutput)
public final short distance(org.ajmm.obsearch.ob.OBShort other)
distance
in interface org.ajmm.obsearch.ob.OBShort
public final short mtd(OBFragment other)
public int ds(OBFragment other)
public int dn(OBFragment other)
public MTDFragmentAST getTree()
public void setTree(MTDFragmentAST tree)
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare.
public final int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |