org.kahina.core.breakpoint
Class TreeNodePattern

java.lang.Object
  extended by org.kahina.core.breakpoint.TreeNodePattern
All Implemented Interfaces:
Serializable

public class TreeNodePattern
extends Object
implements Serializable

TreeNodePatterns are a means of defining which nodes are accepted for use within TreeAutomatonRules as part of the Kahina breakpoint mechanism. Some basic functionality is predefined, allowing the user to exploit Kahina's predefined tree node properties such as For more complex breakpoint patterns based on associated step data, it is possible to use one of the specialized TreeNodePattern classes (such as SourceCodePattern) or to directly inherit from this class and overwrite or overload the decision methods. It is not recommended to use this for child pattern matching, because this breaks the tree automaton logic. For such patterns, use the TreeAutomaton mechanism of node annotations.

See Also:
Serialized Form

Field Summary
static int CAPTION
           
static int CONJUNCTION
           
static int CONTAINS
           
static int DISJUNCTION
           
static int EDGE_LABEL
           
static int ENDS_WITH
           
static int EQUALITY
           
static int GREATER
           
static int GREATER_OR_EQUAL
           
static int ID
           
static int IDENTITY
           
static int IMPLICATION
           
static int LESS
           
static int LESS_OR_EQUAL
           
static int MATCHING
           
static int NEGATION
           
static int STARTS_WITH
           
static int STATUS
           
 
Constructor Summary
TreeNodePattern()
           
TreeNodePattern(int type, int rel, int value)
           
TreeNodePattern(int type, int rel, String value)
           
TreeNodePattern(int type, TreeNodePattern leftArg)
           
TreeNodePattern(int type, TreeNodePattern leftArg, TreeNodePattern rightArg)
           
 
Method Summary
 String exportXML(boolean asFile)
           
 TreeNodePattern getLeftArgument()
           
 int getRel()
           
 String getRelAsString()
           
 String getRelAsXMLString()
           
 TreeNodePattern getRightArgument()
           
 int getType()
           
 String getTypeAsString()
           
 String getTypeAsXMLString()
           
 String getTypeString()
          defines a very short symbolic representation of the type for an atomic pattern
is the empty string for complex nodes or non-standard types
inheriting classes should reimplement this if they add more types, relying on this version for the standard types
 String getValueAsString()
           
 String getValueString()
          defines a representation of the relation and the value
is the empty string for complex nodes or non-standard relations
inheriting classes should reimplement this if they add more relations or value types, relying on this version for the standard types
static TreeNodePattern importXML(Element treeNodePatternNode)
           
 boolean matches(KahinaTree m, int nodeID)
           
 void parseValue(String value)
           
 void setLeftArgument(TreeNodePattern left)
           
 void setRel(int rel)
           
 void setRelation(String relString)
           
 void setRightArgument(TreeNodePattern right)
           
 void setType(int type)
           
 void setType(String typeString)
           
 void setXMLRelation(String relString)
           
 void setXMLType(String typeString)
           
 void switchArguments()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CAPTION

public static final int CAPTION
See Also:
Constant Field Values

EDGE_LABEL

public static final int EDGE_LABEL
See Also:
Constant Field Values

STATUS

public static final int STATUS
See Also:
Constant Field Values

ID

public static final int ID
See Also:
Constant Field Values

NEGATION

public static final int NEGATION
See Also:
Constant Field Values

CONJUNCTION

public static final int CONJUNCTION
See Also:
Constant Field Values

DISJUNCTION

public static final int DISJUNCTION
See Also:
Constant Field Values

IMPLICATION

public static final int IMPLICATION
See Also:
Constant Field Values

IDENTITY

public static final int IDENTITY
See Also:
Constant Field Values

LESS

public static final int LESS
See Also:
Constant Field Values

GREATER

public static final int GREATER
See Also:
Constant Field Values

LESS_OR_EQUAL

public static final int LESS_OR_EQUAL
See Also:
Constant Field Values

GREATER_OR_EQUAL

public static final int GREATER_OR_EQUAL
See Also:
Constant Field Values

EQUALITY

public static final int EQUALITY
See Also:
Constant Field Values

MATCHING

public static final int MATCHING
See Also:
Constant Field Values

STARTS_WITH

public static final int STARTS_WITH
See Also:
Constant Field Values

CONTAINS

public static final int CONTAINS
See Also:
Constant Field Values

ENDS_WITH

public static final int ENDS_WITH
See Also:
Constant Field Values
Constructor Detail

TreeNodePattern

public TreeNodePattern()

TreeNodePattern

public TreeNodePattern(int type,
                       int rel,
                       int value)

TreeNodePattern

public TreeNodePattern(int type,
                       int rel,
                       String value)

TreeNodePattern

public TreeNodePattern(int type,
                       TreeNodePattern leftArg)

TreeNodePattern

public TreeNodePattern(int type,
                       TreeNodePattern leftArg,
                       TreeNodePattern rightArg)
Method Detail

parseValue

public void parseValue(String value)
                throws PatternFormatException
Throws:
PatternFormatException

getType

public int getType()

setType

public void setType(int type)

getRel

public int getRel()

setRel

public void setRel(int rel)

setLeftArgument

public void setLeftArgument(TreeNodePattern left)

setRightArgument

public void setRightArgument(TreeNodePattern right)

switchArguments

public void switchArguments()

getLeftArgument

public TreeNodePattern getLeftArgument()

getRightArgument

public TreeNodePattern getRightArgument()

matches

public boolean matches(KahinaTree m,
                       int nodeID)

toString

public String toString()
Overrides:
toString in class Object

getTypeString

public String getTypeString()
defines a very short symbolic representation of the type for an atomic pattern
is the empty string for complex nodes or non-standard types
inheriting classes should reimplement this if they add more types, relying on this version for the standard types

Returns:
a short symbolic representation of the type

getValueString

public String getValueString()
defines a representation of the relation and the value
is the empty string for complex nodes or non-standard relations
inheriting classes should reimplement this if they add more relations or value types, relying on this version for the standard types

Returns:
a representation of the relation and the value

getTypeAsString

public String getTypeAsString()

getRelAsString

public String getRelAsString()

getValueAsString

public String getValueAsString()

setType

public void setType(String typeString)

setXMLType

public void setXMLType(String typeString)

setRelation

public void setRelation(String relString)

setXMLRelation

public void setXMLRelation(String relString)

getTypeAsXMLString

public String getTypeAsXMLString()

getRelAsXMLString

public String getRelAsXMLString()

exportXML

public String exportXML(boolean asFile)

importXML

public static TreeNodePattern importXML(Element treeNodePatternNode)