aminePlatform.util.cg
Class Relation

java.lang.Object
  extended byaminePlatform.util.cg.Relation
All Implemented Interfaces:
AmineConstants, AmineObject, Edge, Matching, java.io.Serializable, ToString

public class Relation
extends java.lang.Object
implements java.io.Serializable, AmineObject, Matching, AmineConstants, Edge

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface aminePlatform.util.AmineConstants
ANALOGY, B_ASSIGN, B_DSPLY_WT_DELAY, B_DSPLY_WTT_DELAY, B_TRIGGER, B_WTT_DSPLY, BLOCK_BACKWARD_PROPAGATION, BLOCK_FORWARD_PROPAGATION, CANON, CGIF, CGRAPHIC, CHECK_PRECONDITIONS, COMPARE, COMPOSED_GOAL, CONCEPT_TYPE_IDENT, CONTEXT, COVERED_BY, CPLTE_CONTRACT, DEFINITION, EQ_OR_MORE_SPCFQ, EQUAL, EXPAND, FALSE_FOCUS_LIST, FUNCTIONAL, GENERALISE, GENERALIZE, HAVE_AN_INTERSECTION, ID_ADD, ID_DIV, ID_EQ, ID_INF, ID_IS, ID_MESSAGE, ID_MUL, ID_NOT, ID_NULL, ID_OPER_AND, ID_OPER_OR, ID_SUB, ID_SUP, IN_ACTIVATION, IN_MODE, IN_MODE2, INDIVIDUAL, INDIVIDUAL_IDENT, INTEGRATED, IS_CANONIC, KEY_GLOBAL_RULE, LC_ADD, LC_AMINE_BOOLEAN, LC_AMINE_DOUBLE, LC_AMINE_INTEGER, LC_AND, LC_BOOLEAN, LC_CG, LC_CLOSE_BRKT, LC_CLOSE_PARENT, LC_CLOSE_SET, LC_COMMA, LC_COMMA_SEMI, LC_CONCEPT, LC_CONSTRUCTOR, LC_CS, LC_CUT, LC_DIFF, LC_DIV, LC_DOUBLE, LC_DSBL_BKWRD_PRPGTN, LC_DSBL_FRWRD_PRPGTN, LC_EOF, LC_EQ, LC_FOUR_POINTS, LC_IDENTIFIER, LC_IF, LC_INF, LC_INTEGER, LC_INTEROG, LC_IS, LC_JAVA_OBJECT, LC_LEFT_ARROW, LC_LIST, LC_NULL, LC_OPEN_BRKT, LC_OPEN_PARENT, LC_OPEN_SET, LC_OPER_AND, LC_OPER_OR, LC_POINT, LC_RELATION, LC_RGHT_ARROW, LC_SEMI_COMMA, LC_SET, LC_STAR, LC_STATE, LC_STRING, LC_SUB, LC_SUP, LC_TERM, LC_TWO_POINTS, LC_VAR_LIST_CONSTRUCTOR, LC_VARIABLE, LF, MAXIMAL_JOIN, MORE_GENERAL, MORE_SPECIFIC, NOTHING_TO_INTEGRATE, OPERS_WITH_RSLT, OUT_MODE, OUT_MODE2, PARTIAL_CONTRACT, PARTIAL_SUBSUME, PRJCT_OPERS, PROJECT, READ, READ_SENTENCE, RELATION_TYPE_IDENT, S_AND, S_BOOLEAN, S_CG, S_CLOSE_BRKT, S_CLOSE_PARENT, S_CLOSE_SET, S_COMMA, S_CONCEPT, S_CONSTRUCTOR, S_CUT, S_DIFF, S_DOUBLE, S_EOF, S_EQUAL, S_EXPAND, S_FALSE, S_FOUR_POINTS, S_GENERALISE, S_GENERALIZE, S_IDENTIFIER, S_IF, S_INTEGER, S_INTEROG, S_IS, S_IS_CANONIC, S_LEFT_ARROW, S_LIST, S_MAXIMAL_JOIN, S_OPEN_BRKT, S_OPEN_PARENT, S_OPEN_SET, S_POINT, S_RGHT_ARROW, S_SEMI_COMMA, S_SOURCE, S_SPECIALIZE, S_STATE, S_STRING, S_SUBSUME, S_SUBSUME_WITH_RESULT, S_SUPER, S_TARGET, S_TERM, S_THIS, S_TRUE, S_TWO_POINTS, S_UNIFY, S_VARIABLE, SITUATION, SPECIALIZE, STEADY, SUBSUME, SUBSUME_WITH_RSLT, TRIGGER, UNCOMPARABLE, UNIFY, VAR_SUPER, WAIT_ASSIGNMENT, WAIT_END_OF_ASSIGNMENT, WAIT_PRECONDITIONS, WAIT_VALUE
 
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

Relation

public Relation(java.lang.Object relationType,
                Concept sourceConcept,
                Concept targetConcept,
                java.awt.Point posRelName,
                java.util.ArrayList sgmtPoints)
         throws RelationException
The complete specification of the Constructor.

Parameters:
relationType - The relation type of the new relation
sourceConcept - The source concept of the new relation
targetConcept - The target concept of the new relation
posRelName - The point for the location of the relation name. It can be null
sgmtPoints - The segment points of the new relation. It can be null

Relation

public Relation()
This constructor should be used with care.


Relation

public Relation(java.lang.Object relationType,
                Concept sourceConcept,
                Concept targetConcept)
         throws RelationException
Construct a relation given its relation type, its source concept, and its target concept.

Parameters:
relationType - The relation type of the new relation
sourceConcept - The source concept of the new relation
targetConcept - The target concept of the new relation
Method Detail

parse

public static Relation parse(java.lang.String relInString,
                             Lexicon lexicon)
                      throws ParsingException
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.

Parameters:
relInString - A textual formulation of a Relation that could be in a LF or in CGIF
lexicon - The lexicon in use during the parsing
Returns:
the internal representation (Java Object) of the Relation
Throws:
ParsingException

getType

public java.lang.Object getType()
Get the type of the current relation

Returns:
the type of the current relation

getName

public java.lang.String getName(Lexicon lexicon)
Get the name of the relation type. In this version, if the relation type is a variable, the name of the variable is returned, no attempt is done to consider the value of the variable.

Specified by:
getName in interface Edge
Parameters:
lexicon - A Lexicon
Returns:
the name of the relation type

getName

public java.lang.String getName(BindingContext bindContext,
                                java.lang.Object bindInf,
                                Lexicon lexicon)
Get the name of the relation type. In this version, if the relation type is a variable, the name of the value of the variable is returned.

Parameters:
bindContext - The Binding Context
bindInf - The Binding Information associated to this object
lexicon - The Lexicon
Returns:
the name of the relation type.

canBeRelationType

public 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.

Parameters:
type - An Object
Returns:
true if the type is not null and it is a RelationType CS, a Type CS or a variable.

eqSuffix

public static boolean eqSuffix(java.lang.String suffix1,
                               java.lang.String suffix2)

haveRange

public static boolean haveRange(java.lang.String suffix)

setType

public boolean setType(java.lang.Object type)
Set the specified type as the type of the current relation.

Parameters:
type - The type for the current relation. This parameter can not be null.
Returns:
true if type is not null.

setName

public void setName(java.lang.String srel,
                    Lexicon lexicon)
             throws java.lang.Exception
Specified by:
setName in interface Edge
Throws:
java.lang.Exception

getSuffix

public java.lang.String getSuffix()
Get the suffix of the relation. This method is used especially in the context of Synergy language.

Returns:
A String that contains all the suffix of the relation

setSuffix

public void setSuffix(java.lang.String suffix)
Set the suffix of the relation. This method is used especially in the context of Synergy language.

Parameters:
suffix - A String that contains all the suffix of the relation

getSourceConcept

public Concept getSourceConcept()
Get the source concept of the current relation

Returns:
the source concept of the current relation

getSourceNode

public java.lang.Object getSourceNode()
Specified by:
getSourceNode in interface Edge

setSourceConcept

public boolean setSourceConcept(Concept concept)
Set the specified concept as the source concept for the current relation

Parameters:
concept - A Concept. It can not be null; a relation must have a source concept
Returns:
true if concept is not null.

setSourceNode

public void setSourceNode(Node node)
Specified by:
setSourceNode in interface Edge

getTargetConcept

public Concept getTargetConcept()
Get the target concept of the current relation

Returns:
the target concept of the current relation

getTargetNode

public java.lang.Object getTargetNode()
Specified by:
getTargetNode in interface Edge

setTargetConcept

public boolean setTargetConcept(Concept concept)
Set the specified concept as the target concept for the current relation

Parameters:
concept - A Concept. It can not be null; relation must have a target concept
Returns:
true if concept is not null.

setTargetNode

public void setTargetNode(Node node)
Specified by:
setTargetNode in interface Edge

getSegmentPoints

public java.util.Enumeration getSegmentPoints()
Get an Enumeration over the segment points of the current relation

Returns:
an Enumeration over the segment points of the current relation

getArraySegmentPoints

public java.util.ArrayList getArraySegmentPoints(Lexicon lexicon)
Specified by:
getArraySegmentPoints in interface Edge

createArraySegmentPoints

public java.util.ArrayList createArraySegmentPoints(java.lang.Object g,
                                                    Lexicon lexicon)
Specified by:
createArraySegmentPoints in interface Edge

setSegmentPoints

public boolean setSegmentPoints(java.util.ArrayList points)
Set the specified ArrayList points as the value for the attribute segmentPoints of the current relation. This method cheks first that all the elements of points are Point indeed. It also destroys the old value of attribute segmentPoints (if it had), then it assigns points to segmentPoints of the current relation.

Specified by:
setSegmentPoints in interface Edge
Parameters:
points - An ArrayList of Point
Returns:
true if all the elements of points are Point.

copyPosRelName

public java.awt.Point copyPosRelName()

copySegmentPoints

public java.util.ArrayList copySegmentPoints()
Get a copy of the segmentPoints ArrayList of the current relation.

Returns:
an ArrayList of Point that corresponds to a copy of the segmentPoints of the current relation. The method returns null if the relation has no segments points.

createPosEdgeNameOnSegments

public java.awt.Point createPosEdgeNameOnSegments(java.lang.Object g,
                                                  Lexicon lexicon)
Specified by:
createPosEdgeNameOnSegments in interface Edge

getPosEdgeNameOnSegments

public java.awt.Point getPosEdgeNameOnSegments(Lexicon lexicon)
Get the position of the relation name of the current relation, on the segments of the relation

Specified by:
getPosEdgeNameOnSegments in interface Edge
Returns:
the position of the relation name of the current relation

setPosEdgeNameOnSegments

public 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

Specified by:
setPosEdgeNameOnSegments in interface Edge

isRelation

public static boolean isRelation(java.lang.Object relation)
Check that the specified object is a relation

Parameters:
relation - An object
Returns:
true if the specified object is a relation

areRelations

public static boolean areRelations(java.util.ArrayList relations)
Check that all the elements of relations are Relation

Parameters:
relations - An ArrayList
Returns:
true if all the elements of relations are Relation

remove

public boolean remove()
remove the current relation from the outcomeRelations of its source concept and from the incomeRelations of its target. The relation itself is not destroyed by this method.

Returns:
true if the remove has been done

finalize

public void finalize()
Finalize() calls the method clear()

Specified by:
finalize in interface AmineObject

clear

public void clear()
Clear the content of the current relation.

Specified by:
clear in interface AmineObject

clone

public java.lang.Object clone()
Return a deep copy of the current relation.

Specified by:
clone in interface AmineObject
Returns:
a deep copy of the current relation

copy

public 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. This version does not consider however variable binding.

Returns:
a copy of the current relation with copies of the source and target concepts

copyEdge

public Edge copyEdge()
Specified by:
copyEdge in interface Edge

copy

public 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. This version considers variable binding.

Returns:
a copy of the current relation with copies of the source and target concepts

copyRelationType

public 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.

Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and the current relation
Returns:
the concept relation type

copyRelationType

public 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).

Parameters:
bindContext - The Binding context
type - a relation type which could be a RelationType CS, a Type CS or a Variable
bindInf - The binding information related to the binding context and type
Returns:
a relation Type

clone

public java.lang.Object clone(BindingContext bindContext,
                              java.lang.Object bindInf)
This method is equivalent to copy(bindContext, bindInf). Also, this definition considers the presence of variables and their binding.

Specified by:
clone in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current Relation
Returns:
a clone of the current Relation

toCG

public CG toCG()
Create a CG that wraps the current relation. If the relation is not part of a CG, then the wrap is simply the creation of a new CG with the source and target concepts of the current relation. Else, the new CG will contain a copy of the current relation, since their source and target concepts could be related to other concepts of the CG.

Returns:
a new CG that wraps the current relation

toString

public java.lang.String toString(Lexicon lexicon)
                          throws ToStringException
Return the textualization of a relation in a CGIF format. This version of toString() ignores variable binding.

Specified by:
toString in interface ToString
Parameters:
lexicon - The lexicon to use during the textual formulation of the current relation
Returns:
a String that represents the linear form of the current relation.
Throws:
ToStringException - if an error occurs during the textualization

toString

public java.lang.String toString(BindingContext bindContext,
                                 java.lang.Object bindInf,
                                 Lexicon lexicon)
                          throws ToStringException
Return the textualization of a relation in a CGIF format. This version considers variable binding.

Specified by:
toString in interface AmineObject
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and the current concept
lexicon - The lexicon to use during the textual formulation of the current concept
Returns:
a String that represents the linear form of the current concept.
Throws:
ToStringException - if an error occurs during the textualization

getVariables

public 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. This method is used for instance by the Prolog+CG interpreter. Nothing is done if the parameter varsIdent is null.

Specified by:
getVariables in interface AmineObject
Parameters:
varsIdent - : an ArrayList of Variable objects

match

public 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. This version of matching does not consider the binding context and resolution. Atually, these values are defined in AmineConstants interface and are: EQUAL, UNIFY, SUBSUME, SUBSUME_WITH_RSLT, MAXIMAL_JOIN, and GENERALIZE.

Specified by:
match in interface Matching
Parameters:
matchOperation - A byte value that specifies which kind of matching to apply
obj - The object to match with the current object
Returns:
an object which is the result of the match operation

match

public 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. The matching considers the binding context and the binding information for the two objects.

Specified by:
match in interface Matching
Parameters:
matchOperation - A byte value that specifies which kind of matching to apply
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to match with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the match operation

matchType

public boolean matchType(byte matchOperation,
                         BindingContext bindContext,
                         java.lang.Object bindInf,
                         java.lang.Object type2,
                         java.lang.Object bindInf2)

equal

public 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. The equality is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
equal in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check the equality with the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects are equal and false otherwise

equal

public boolean equal(java.lang.Object obj)
Check that the current object is equal with the specified object obj. The equality is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Specified by:
equal in interface Matching
Parameters:
obj - The object to check the equality with the current object
Returns:
true if the two objects are equal and false otherwise

unify

public 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.

Specified by:
unify in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to unify with the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the two objects can be unified and false otherwise

subsume

public 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. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
subsume in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
true if the current object subsumes the specified object obj

subsume

public boolean subsume(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
subsume in interface Matching
Parameters:
obj - The object to check its subsumption by the current object
Returns:
true if the current object subsumes the specified object obj

subsumeWithResult

public 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. Subsumption is a kind of matching and this version considers the binding context and the binding information for the two objects.

Specified by:
subsumeWithResult in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to check its subsumption by the current object
bindInfObj - The binding information for the parameter obj
Returns:
the image, in obj, of the current object

subsumeWithResult

public java.lang.Object subsumeWithResult(java.lang.Object obj)
Check that the current object subsumes (is more general than) the specified object obj. Subsumption is a kind of matching and this version does not considers the binding context and the binding information for the two objects.

Specified by:
subsumeWithResult in interface Matching
Parameters:
obj - The object to check its subsumption by the current object
Returns:
the image, in obj, of the current object

maximalJoin

public 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. The join considers the binding context and the binding information for the two objects.

Specified by:
maximalJoin in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to join with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the join operation

maximalJoin

public java.lang.Object maximalJoin(java.lang.Object obj)
Perform a maximal join of the current object with the specified object obj. This version of join does not considers the binding context and the binding information for the two objects.

Specified by:
maximalJoin in interface Matching
Parameters:
obj - The object to join with the current object
Returns:
an object which is the result of the join operation

generalize

public 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. The generalize operation considers the binding context and the binding information for the two objects.

Specified by:
generalize in interface Matching
Parameters:
bindContext - The binding context
bindInf - The binding information for the current object
obj - The object to generalize with the current object
bindInfObj - The binding information for the parameter obj
Returns:
an object which is the result of the generalization operation

generalize

public 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. This version of generalize operation does not considers the binding context and the binding information for the two objects.

Specified by:
generalize in interface Matching
Parameters:
obj - The object to generalize with the current object
Returns:
an object which is the result of the generalization operation