|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--notio.Node | +--notio.Relation
The conceptual relation node class. This class encapsulates all available information about a conceptual relation within a graph. It consists of a type and/or arguments (concepts connected to the arcs of the relation). The arguments can be divided into input and output arguments as desired, though the default is that the last (and possibly only) argument is the sole output arc.
Constructor Summary | |
Relation()
Constructs a new relation that has no type and no arguments. |
|
Relation(Concept[] newArguments)
Constructs a relation with no type and the specified arguments. |
|
Relation(Concept[] newArguments,
int newOutputStartIndex)
Constructs a relation with no type and the specified arguments with output arguments starting at the specified index. |
|
Relation(RelationType newType)
Constructs a relation with the given type. |
|
Relation(RelationType newType,
Concept[] newArguments)
Constructs a relation with the given type and arguments. |
|
Relation(RelationType newType,
Concept[] newInputArguments,
Concept[] newOutputArguments)
Constructs a relation with the given type and the specified input and output arguments. |
|
Relation(RelationType newType,
Concept[] newArguments,
int newOutputStartIndex)
Constructs a relation with the given type and arguments and output argument start index. |
Method Summary | |
Relation |
copy(CopyingScheme copyScheme)
Performs a copy operation on this relation according to the the specified CopyingScheme. |
Relation |
copy(CopyingScheme copyScheme,
java.util.Hashtable substitutionTable)
Performs a copy operation on this relation according to the the specified CopyingScheme. |
Concept[] |
getArguments()
Returns all of the concepts related by this relation. |
Concept[] |
getInputArguments()
Returns the input arguments for this relation. |
Concept[] |
getOutputArguments()
Returns the output arguments for this relation. |
int |
getOutputStartIndex()
Returns the index of the first output argument within the array returned by getArguments(). |
RelationType |
getType()
Returns this relation's type. |
int |
getValence()
This method returns the valence (number of arguments) that this relation has defined. |
boolean |
isComplete()
Returns true if this relation's arguments are completely specified (are all non-null). |
static boolean |
matchRelations(Relation first,
Relation second,
MatchingScheme matchingScheme)
Compares two relations to decide if they match. |
boolean |
relatesConcept(Concept concept)
Returns true if the specified concept is an argument of this relation. |
void |
replaceArgument(Concept oldConcept,
Concept newConcept)
Replaces all occurances of the specified argument with a new one regardless of whether it is an input or output arc. |
void |
replaceInputArgument(Concept oldConcept,
Concept newConcept)
Replaces all occurances of the specified input arc with a new one. |
void |
replaceOutputArc(Concept oldConcept,
Concept newConcept)
Replaces all occurances of the specified output arc with a new one. |
Relation |
restrictTo(RelationType subType)
Returns a new node identical to this but restricted to the new type. |
void |
setArgument(int index,
Concept newConcept)
Sets the specified argument to the specified concept. |
void |
setArguments(Concept[] newConcepts)
Sets the arguments according to the specified array of concepts. |
void |
setInputArgument(int index,
Concept newConcept)
Sets the specified argument to the specified concept. |
void |
setOutputArgument(int index,
Concept newConcept)
Sets the specified argument to the specified concept. |
void |
setOutputStartIndex(int newOutputStartIndex)
Sets the index of the first output argument within the array returned by getArguments(). |
Methods inherited from class notio.Node |
getComment,
getEnclosingGraph,
setComment |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Relation(RelationType newType, Concept[] newArguments)
newType
- the type for this relation.newArguments
- the concepts related by this relation.public Relation(RelationType newType, Concept[] newArguments, int newOutputStartIndex)
newType
- the type for this relation.newArguments
- the concepts related by this relation.newOutputStartIndex
- the index into the newArguments array at which the
output arcs start.public Relation(RelationType newType, Concept[] newInputArguments, Concept[] newOutputArguments)
newType
- the type for this relation.newInputArguments
- the input concepts related by this relation.newOutputArguments
- the output concepts related by this relation.public Relation(RelationType newType)
newType
- the type for this relation.public Relation(Concept[] newArguments, int newOutputStartIndex)
newArguments
- the concepts related by this relation.newOutputStartIndex
- the index into the newArguments array at which the
output arcs start.public Relation(Concept[] newArguments)
newArguments
- the concepts related by this relation.public Relation()
Method Detail |
public RelationType getType()
public Concept[] getArguments()
public Concept[] getInputArguments()
public Concept[] getOutputArguments()
public boolean relatesConcept(Concept concept)
concept
- the concept being checked for.public void replaceArgument(Concept oldConcept, Concept newConcept)
oldConcept
- the concept being replaced.newConcept
- the replacement concept.public void replaceInputArgument(Concept oldConcept, Concept newConcept)
oldConcept
- the input arc being replaced.newConcept
- the replacement arc.public void replaceOutputArc(Concept oldConcept, Concept newConcept)
oldConcept
- the output arc being replaced.newConcept
- the replacement arc.public void setArgument(int index, Concept newConcept)
index
- the index of the argument being set.newConcept
- the concept to be used as an argument.public void setArguments(Concept[] newConcepts)
newConcepts
- the array of concepts to be used as arguments.setArgument(int, notio.Concept)
public void setInputArgument(int index, Concept newConcept)
index
- the index of the input argument being set (the nth input argument).newConcept
- the concept to be used as an argument.public void setOutputArgument(int index, Concept newConcept)
index
- the index of the output argument being set (the nth input argument).newConcept
- the concept to be used as an argument.public int getOutputStartIndex()
getArguments()
public void setOutputStartIndex(int newOutputStartIndex)
newOutputStartIndex
- the index of the first output argument within the array
returned by getArguments().getArguments()
public int getValence()
public boolean isComplete()
public Relation copy(CopyingScheme copyScheme)
copyScheme
- the copying scheme used to control the copy operation.public Relation copy(CopyingScheme copyScheme, java.util.Hashtable substitutionTable)
copyScheme
- the copying scheme used to control the copy operation.substitutionTable
- a hashtable containing copied objects available due to
earlier copy operations.public Relation restrictTo(RelationType subType) throws RestrictionException
subType
- the type to be restricted to.public static boolean matchRelations(Relation first, Relation second, MatchingScheme matchingScheme)
first
- the first relation being matched.second
- the second relation being matched.matchingScheme
- the matching scheme that determines how the match is performed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |