org.activemath.content.mediator.rewriter
Class Pattern

java.lang.Object
  extended by org.activemath.content.mediator.rewriter.Pattern

public class Pattern
extends Object


Field Summary
protected static boolean DEBUG
           
 
Constructor Summary
Pattern(Set classRestrictions, Set relationRestrictions, Set propertyRestrictions)
           
 
Method Summary
 int compare(Pattern p)
          Compares this pattern with pattern p.
 Set getClassRestrictions()
           
 ArrayList getPlaceholderPropertyRestriction()
           
 Set getPropertyRestrictions()
           
 Set getPurePropertyRestrictions()
           
 Set getRelationRestrictions()
           
 boolean hasPlaceholderPropertyRestriction()
           
 boolean isLessSpecialThan(Pattern p)
           
 boolean isMoreSpecialThan(Pattern p)
           
 boolean matches(KBQuery kbQuery)
          Checks whether the pattern matches a KBQuery.
 void setHasPlaceholderPropertyRestriction(boolean hasPlaceholderPropertyRestriction)
           
 String toLatexString()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

protected static final boolean DEBUG
Constructor Detail

Pattern

public Pattern(Set classRestrictions,
               Set relationRestrictions,
               Set propertyRestrictions)
Method Detail

matches

public boolean matches(KBQuery kbQuery)
Checks whether the pattern matches a KBQuery. This is the case, if the queries classcontraints contains all classes of the patterns class restriction _and_ the same with relation- and property-constraints.

Parameters:
kbQuery -
Returns:

toString

public String toString()
Overrides:
toString in class Object

toLatexString

public String toLatexString()

getClassRestrictions

public Set getClassRestrictions()

getPropertyRestrictions

public Set getPropertyRestrictions()

getRelationRestrictions

public Set getRelationRestrictions()

compare

public int compare(Pattern p)
Compares this pattern with pattern p. If this is more special than p, -1 is returned, 1 if not and 0 if both are not compareable.

Parameters:
p -
Returns:

isMoreSpecialThan

public boolean isMoreSpecialThan(Pattern p)

isLessSpecialThan

public boolean isLessSpecialThan(Pattern p)

hasPlaceholderPropertyRestriction

public boolean hasPlaceholderPropertyRestriction()

setHasPlaceholderPropertyRestriction

public void setHasPlaceholderPropertyRestriction(boolean hasPlaceholderPropertyRestriction)

getPurePropertyRestrictions

public Set getPurePropertyRestrictions()

getPlaceholderPropertyRestriction

public ArrayList getPlaceholderPropertyRestriction()