org.kit.furia.fragment
Class MTDFragmentAST

java.lang.Object
  extended by antlr.BaseAST
      extended by org.kit.furia.fragment.FragmentAST
          extended by org.kit.furia.fragment.MTDFragmentAST
All Implemented Interfaces:
antlr.collections.AST, java.io.Serializable

public class MTDFragmentAST
extends FragmentAST

MTDFragmentAST A tree that holds an internal id for each unique complete subtree and a hash code computed on the string representation of this complete subtree. Additionally, the number of repetitions is included. This helps to make this algorithm O(n) for equal complete subtrees of two different trees. Once we found that two complete subtrees m,j belonging to different trees T1 T2, we can compute their intersection in linear time.

Author:
Arnoldo Jose Muller Molina
See Also:
Serialized Form

Field Summary
 int id
           
 IntegerHolder repetitions
           
 
Fields inherited from class org.kit.furia.fragment.FragmentAST
decendants, text
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
MTDFragmentAST()
           
 
Method Summary
 boolean equals(antlr.collections.AST x)
           
 boolean equals(java.lang.Object o)
           
 MTDFragmentAST getLeft()
           
 MTDFragmentAST getSibbling()
           
 int hashCode()
           
 void update()
           
 
Methods inherited from class org.kit.furia.fragment.FragmentAST
depthFirst, depthFirstAux, getDescendants, getFirstChild, getLeftmostChild, getNextSibling, getSize, getText, getType, initialize, initialize, initialize, prettyPrint, setText, setType, toFuriaChanTree, updateDecendantInformation, updateDecendantInformationAux
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getColumn, getLine, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id

repetitions

public IntegerHolder repetitions
Constructor Detail

MTDFragmentAST

public MTDFragmentAST()
Method Detail

update

public void update()

equals

public boolean equals(antlr.collections.AST x)
Specified by:
equals in interface antlr.collections.AST
Overrides:
equals in class antlr.BaseAST

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getLeft

public MTDFragmentAST getLeft()

getSibbling

public MTDFragmentAST getSibbling()


Copyright © 2008 Arnoldo Jose Muller Molina. All Rights Reserved.