|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectaminePlatform.util.cg.Relation
Title: util.cg.Relation Class
Description: Relation is composed of a type, a source concept, a target concept and an ArrayList of Points (if graphic information is considered). relation type can be a RelationType (a RelationType CS in the ontology), a Type or a Variable. All the components of a relation, except the ArrayList of Points, are mandatory. Relation can be used in the context of a CG or it can be used as an Amine Object like any other Amine Object !
Copyright : Copyright (c) Adil KABBAJ 2004-2009
Field Summary |
Constructor Summary | |
Relation()
This constructor should be used with care. |
|
Relation(java.lang.Object relationType,
Concept sourceConcept,
Concept targetConcept)
Construct a relation given its relation type, its source concept, and its target concept. |
|
Relation(java.lang.Object relationType,
Concept sourceConcept,
Concept targetConcept,
java.awt.Point posRelName,
java.util.ArrayList sgmtPoints)
The complete specification of the Constructor. |
Method Summary | |
static boolean |
areRelations(java.util.ArrayList relations)
Check that all the elements of relations are Relation |
static boolean |
canBeRelationType(java.lang.Object type)
Check if type can be a relation type for a concept : it should be either a RelationType CS, a Type CS or a variable. |
void |
clear()
Clear the content of the current relation. |
java.lang.Object |
clone()
Return a deep copy of the current relation. |
java.lang.Object |
clone(BindingContext bindContext,
java.lang.Object bindInf)
This method is equivalent to copy(bindContext, bindInf). |
Relation |
copy()
Performs a deep copy of the current relation : it create copies of the source and target concepts of the relation as well as the segments points. |
Relation |
copy(BindingContext bindContext,
java.lang.Object bindInf)
Performs a deep copy of the current relation : it creates copies of the source and target concepts of the relation as well as the segments points. |
Edge |
copyEdge()
|
java.awt.Point |
copyPosRelName()
|
java.lang.Object |
copyRelationType(BindingContext bindContext,
java.lang.Object bindInf)
Return the type of the current relation (or its value if the type is a variable and variable binding is considered) which is a (Relation) Type CS. |
static java.lang.Object |
copyRelationType(BindingContext bindContext,
java.lang.Object type,
java.lang.Object bindInf)
This method is the static variant of the method copyRelationType(bindContext, bindInf). |
java.util.ArrayList |
copySegmentPoints()
Get a copy of the segmentPoints ArrayList of the current relation. |
java.util.ArrayList |
createArraySegmentPoints(java.lang.Object g,
Lexicon lexicon)
|
java.awt.Point |
createPosEdgeNameOnSegments(java.lang.Object g,
Lexicon lexicon)
|
static boolean |
eqSuffix(java.lang.String suffix1,
java.lang.String suffix2)
|
boolean |
equal(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Check that the current object is equal with the specified object obj. |
boolean |
equal(java.lang.Object obj)
Check that the current object is equal with the specified object obj. |
void |
finalize()
Finalize() calls the method clear() |
java.lang.Object |
generalize(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. |
java.lang.Object |
generalize(java.lang.Object obj)
Perform a generalization of the current object with the specified object obj, to determine what is common to the two objects. |
java.util.ArrayList |
getArraySegmentPoints(Lexicon lexicon)
|
java.lang.String |
getName(BindingContext bindContext,
java.lang.Object bindInf,
Lexicon lexicon)
Get the name of the relation type. |
java.lang.String |
getName(Lexicon lexicon)
Get the name of the relation type. |
java.awt.Point |
getPosEdgeNameOnSegments(Lexicon lexicon)
Get the position of the relation name of the current relation, on the segments of the relation |
java.util.Enumeration |
getSegmentPoints()
Get an Enumeration over the segment points of the current relation |
Concept |
getSourceConcept()
Get the source concept of the current relation |
java.lang.Object |
getSourceNode()
|
java.lang.String |
getSuffix()
Get the suffix of the relation. |
Concept |
getTargetConcept()
Get the target concept of the current relation |
java.lang.Object |
getTargetNode()
|
java.lang.Object |
getType()
Get the type of the current relation |
void |
getVariables(java.util.ArrayList varsIdent)
This method adds in the specified varsIdent all the variables used in source and target concepts of the current relation. |
static boolean |
haveRange(java.lang.String suffix)
|
static boolean |
isRelation(java.lang.Object relation)
Check that the specified object is a relation |
java.lang.Object |
match(byte matchOperation,
BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Match the current object with the specified object obj, according to the value of the parameter matchOperation. |
java.lang.Object |
match(byte matchOperation,
java.lang.Object obj)
Match the current object with the specified object obj, according to the value of the parameter matchOperation. |
boolean |
matchType(byte matchOperation,
BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object type2,
java.lang.Object bindInf2)
|
java.lang.Object |
maximalJoin(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Perform a maximal join of the current object with the specified object obj. |
java.lang.Object |
maximalJoin(java.lang.Object obj)
Perform a maximal join of the current object with the specified object obj. |
static Relation |
parse(java.lang.String relInString,
Lexicon lexicon)
Parse the textual formulation of a Relation (parameter relInString) using the specified lexicon and produce its internal representation. relInString could be in a Linear Form (LF) or in CGIF form. |
boolean |
remove()
remove the current relation from the outcomeRelations of its source concept and from the incomeRelations of its target. |
void |
setName(java.lang.String srel,
Lexicon lexicon)
|
void |
setPosEdgeNameOnSegments(java.awt.Point pos)
Set the specified point as the position of the relation name of the current relation, on the segments of the relation |
boolean |
setSegmentPoints(java.util.ArrayList points)
Set the specified ArrayList points as the value for the attribute segmentPoints of the current relation. |
boolean |
setSourceConcept(Concept concept)
Set the specified concept as the source concept for the current relation |
void |
setSourceNode(Node node)
|
void |
setSuffix(java.lang.String suffix)
Set the suffix of the relation. |
boolean |
setTargetConcept(Concept concept)
Set the specified concept as the target concept for the current relation |
void |
setTargetNode(Node node)
|
boolean |
setType(java.lang.Object type)
Set the specified type as the type of the current relation. |
boolean |
subsume(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Check that the current object subsumes (is more general than) the specified object obj. |
boolean |
subsume(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. |
java.lang.Object |
subsumeWithResult(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Check that the current object subsumes (is more general than) the specified object obj. |
java.lang.Object |
subsumeWithResult(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. |
CG |
toCG()
Create a CG that wraps the current relation. |
java.lang.String |
toString(BindingContext bindContext,
java.lang.Object bindInf,
Lexicon lexicon)
Return the textualization of a relation in a CGIF format. |
java.lang.String |
toString(Lexicon lexicon)
Return the textualization of a relation in a CGIF format. |
boolean |
unify(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Unify the current object with the specified object obj. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Relation(java.lang.Object relationType, Concept sourceConcept, Concept targetConcept, java.awt.Point posRelName, java.util.ArrayList sgmtPoints) throws RelationException
relationType
- The relation type of the new relationsourceConcept
- The source concept of the new relationtargetConcept
- The target concept of the new relationposRelName
- The point for the location of the relation name. It can be nullsgmtPoints
- The segment points of the new relation. It can be nullpublic Relation()
public Relation(java.lang.Object relationType, Concept sourceConcept, Concept targetConcept) throws RelationException
relationType
- The relation type of the new relationsourceConcept
- The source concept of the new relationtargetConcept
- The target concept of the new relationMethod Detail |
public static Relation parse(java.lang.String relInString, Lexicon lexicon) throws ParsingException
relInString
- A textual formulation of a Relation that could be in a LF or in CGIFlexicon
- The lexicon in use during the parsing
ParsingException
public java.lang.Object getType()
public java.lang.String getName(Lexicon lexicon)
getName
in interface Edge
lexicon
- A Lexicon
public java.lang.String getName(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
bindContext
- The Binding ContextbindInf
- The Binding Information associated to this objectlexicon
- The Lexicon
public static boolean canBeRelationType(java.lang.Object type)
type
- An Object
public static boolean eqSuffix(java.lang.String suffix1, java.lang.String suffix2)
public static boolean haveRange(java.lang.String suffix)
public boolean setType(java.lang.Object type)
type
- The type for the current relation. This parameter can not be null.
public void setName(java.lang.String srel, Lexicon lexicon) throws java.lang.Exception
setName
in interface Edge
java.lang.Exception
public java.lang.String getSuffix()
public void setSuffix(java.lang.String suffix)
suffix
- A String that contains all the suffix of the relationpublic Concept getSourceConcept()
public java.lang.Object getSourceNode()
getSourceNode
in interface Edge
public boolean setSourceConcept(Concept concept)
concept
- A Concept. It can not be null; a relation must have a source concept
public void setSourceNode(Node node)
setSourceNode
in interface Edge
public Concept getTargetConcept()
public java.lang.Object getTargetNode()
getTargetNode
in interface Edge
public boolean setTargetConcept(Concept concept)
concept
- A Concept. It can not be null; relation must have a target concept
public void setTargetNode(Node node)
setTargetNode
in interface Edge
public java.util.Enumeration getSegmentPoints()
public java.util.ArrayList getArraySegmentPoints(Lexicon lexicon)
getArraySegmentPoints
in interface Edge
public java.util.ArrayList createArraySegmentPoints(java.lang.Object g, Lexicon lexicon)
createArraySegmentPoints
in interface Edge
public boolean setSegmentPoints(java.util.ArrayList points)
setSegmentPoints
in interface Edge
points
- An ArrayList of Point
public java.awt.Point copyPosRelName()
public java.util.ArrayList copySegmentPoints()
public java.awt.Point createPosEdgeNameOnSegments(java.lang.Object g, Lexicon lexicon)
createPosEdgeNameOnSegments
in interface Edge
public java.awt.Point getPosEdgeNameOnSegments(Lexicon lexicon)
getPosEdgeNameOnSegments
in interface Edge
public void setPosEdgeNameOnSegments(java.awt.Point pos)
setPosEdgeNameOnSegments
in interface Edge
public static boolean isRelation(java.lang.Object relation)
relation
- An object
public static boolean areRelations(java.util.ArrayList relations)
relations
- An ArrayList
public boolean remove()
public void finalize()
finalize
in interface AmineObject
public void clear()
clear
in interface AmineObject
public java.lang.Object clone()
clone
in interface AmineObject
public Relation copy()
public Edge copyEdge()
copyEdge
in interface Edge
public Relation copy(BindingContext bindContext, java.lang.Object bindInf)
public java.lang.Object copyRelationType(BindingContext bindContext, java.lang.Object bindInf)
bindContext
- The Binding contextbindInf
- The binding information related to the binding context and the current relation
public static java.lang.Object copyRelationType(BindingContext bindContext, java.lang.Object type, java.lang.Object bindInf)
bindContext
- The Binding contexttype
- a relation type which could be a RelationType CS, a Type CS or a VariablebindInf
- The binding information related to the binding context and type
public java.lang.Object clone(BindingContext bindContext, java.lang.Object bindInf)
clone
in interface AmineObject
bindContext
- The Binding contextbindInf
- The binding information related to the binding context and to the current Relation
public CG toCG()
public java.lang.String toString(Lexicon lexicon) throws ToStringException
toString
in interface ToString
lexicon
- The lexicon to use during the textual formulation of the current relation
ToStringException
- if an error occurs during the textualizationpublic java.lang.String toString(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon) throws ToStringException
toString
in interface AmineObject
bindContext
- The Binding contextbindInf
- The binding information related to the binding context and the current conceptlexicon
- The lexicon to use during the textual formulation of the current concept
ToStringException
- if an error occurs during the textualizationpublic void getVariables(java.util.ArrayList varsIdent)
getVariables
in interface AmineObject
varsIdent
- : an ArrayList of Variable objectspublic java.lang.Object match(byte matchOperation, java.lang.Object obj)
match
in interface Matching
matchOperation
- A byte value that specifies which kind of matching to applyobj
- The object to match with the current object
public java.lang.Object match(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
match
in interface Matching
matchOperation
- A byte value that specifies which kind of matching to applybindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to match with the current objectbindInfObj
- The binding information for the parameter obj
public boolean matchType(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object type2, java.lang.Object bindInf2)
public boolean equal(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
equal
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to check the equality with the current objectbindInfObj
- The binding information for the parameter obj
public boolean equal(java.lang.Object obj)
equal
in interface Matching
obj
- The object to check the equality with the current object
public boolean unify(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
unify
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to unify with the current objectbindInfObj
- The binding information for the parameter obj
public boolean subsume(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
subsume
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to check its subsumption by the current objectbindInfObj
- The binding information for the parameter obj
public boolean subsume(java.lang.Object obj)
subsume
in interface Matching
obj
- The object to check its subsumption by the current object
public java.lang.Object subsumeWithResult(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
subsumeWithResult
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to check its subsumption by the current objectbindInfObj
- The binding information for the parameter obj
public java.lang.Object subsumeWithResult(java.lang.Object obj)
subsumeWithResult
in interface Matching
obj
- The object to check its subsumption by the current object
public java.lang.Object maximalJoin(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
maximalJoin
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to join with the current objectbindInfObj
- The binding information for the parameter obj
public java.lang.Object maximalJoin(java.lang.Object obj)
maximalJoin
in interface Matching
obj
- The object to join with the current object
public java.lang.Object generalize(BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
generalize
in interface Matching
bindContext
- The binding contextbindInf
- The binding information for the current objectobj
- The object to generalize with the current objectbindInfObj
- The binding information for the parameter obj
public java.lang.Object generalize(java.lang.Object obj)
generalize
in interface Matching
obj
- The object to generalize with the current object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |