inpro.irmrsc.rmrs
Class Relation

java.lang.Object
  extended by inpro.irmrsc.rmrs.Relation
All Implemented Interfaces:
VariableIDsInterpretable

public class Relation
extends java.lang.Object
implements VariableIDsInterpretable

A relation in a RMRS Formula.

All relations have an anchor variable, as well as a relation name and a type. Lexical relations (representing lexemes) and nonlexical relations (introduced by the grammar) also have a label and usually have an argument. Argument relations (expressing predicate argument structure) have no label but always an argument.

Author:
Andreas Peldszus

Nested Class Summary
static class Relation.Type
           
 
Field Summary
private  int mAnchor
           
private  int mArgument
           
private  boolean mArgumentGiven
           
private  int mLabel
           
private  java.lang.String mName
           
private  Relation.Type mType
           
 
Constructor Summary
Relation()
          default constructor, only used for xml loading
Relation(int Label, int Anchor, int Argument, java.lang.String Name, Relation.Type Type)
           
Relation(int Label, int Anchor, java.lang.String Name, Relation.Type Type)
           
Relation(Relation r)
           
 
Method Summary
 int getAnchor()
           
 int getArgument()
           
 int getLabel()
           
 java.lang.String getName()
           
 Relation.Type getType()
           
 java.util.Set<java.lang.Integer> getVariableIDs()
           
 boolean hasArgument()
           
 boolean isAbout(int variableID)
           
 boolean isAnchoredAs(int variableID)
           
 void parseXML(org.jdom.Element e)
          initializes this relation object from XML element variable definition <rel>
 void replaceVariableID(int oldID, int newID)
          replace all variables IDs matching a specifid old ID with a new ID
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mLabel

private int mLabel

mAnchor

private int mAnchor

mArgument

private int mArgument

mName

private java.lang.String mName

mType

private Relation.Type mType

mArgumentGiven

private boolean mArgumentGiven
Constructor Detail

Relation

public Relation(int Label,
                int Anchor,
                int Argument,
                java.lang.String Name,
                Relation.Type Type)

Relation

public Relation(int Label,
                int Anchor,
                java.lang.String Name,
                Relation.Type Type)

Relation

public Relation(Relation r)

Relation

public Relation()
default constructor, only used for xml loading

Method Detail

getLabel

public int getLabel()

getAnchor

public int getAnchor()

hasArgument

public boolean hasArgument()

getArgument

public int getArgument()

getName

public java.lang.String getName()

getType

public Relation.Type getType()

isAbout

public boolean isAbout(int variableID)

isAnchoredAs

public boolean isAnchoredAs(int variableID)

getVariableIDs

public java.util.Set<java.lang.Integer> getVariableIDs()
Specified by:
getVariableIDs in interface VariableIDsInterpretable
Returns:
the set of IDs of all variables in that expression

replaceVariableID

public void replaceVariableID(int oldID,
                              int newID)
Description copied from interface: VariableIDsInterpretable
replace all variables IDs matching a specifid old ID with a new ID

Specified by:
replaceVariableID in interface VariableIDsInterpretable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

parseXML

public void parseXML(org.jdom.Element e)
initializes this relation object from XML element variable definition <rel>

Parameters:
e - the element