|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectaminePlatform.kernel.lexicons.Identifier
aminePlatform.util.Variable
Title : util.Variable Class
Description : a Variable is an identifier that represents a variable. A variable identifier should start with a letter followed optionally by a digit or underscore. After the digit or the underscore, a variable can have any sequence of characters. A variable identifier can begin also with an underscore followed optionally by any sequence of characters. There is also special cases of identifiers "super", "this", "x_source", and "y_target" that are considered as variables.
Variable is explicitly defined to avoid the check, at each time, of the identifier in order to infer if it is a variable identifier or a constant identifier.
It is only in a programming context, like PROLOG+CG, SYNERGY or other programming contexts that the binding relation concerning a variable is considered; that the associated value is looked for and the substitution is done.
Note also that the value of a variable, once the association is considered, is not specified directly as an attribute of the class Variable. The association is specified and treated in the context of each programming context (PROLOG+CG, SYNERGY or any other context).
Subclasses : VarListConstructor.
Implements : AmineObject and Matching interfaces
Copyright: Copyright (c) Adil KABBAJ, 2004-2009
Field Summary | |
static Variable |
SUPER
|
static Variable |
THIS
|
Fields inherited from class aminePlatform.kernel.lexicons.Identifier |
id, ignoreCase, name |
Constructor Summary | |
Variable(java.lang.String s)
|
Method Summary | |
void |
clear()
Method from the interface AmineObject. |
java.lang.Object |
clone()
Return a clone of the object without considering binding context and resolution. |
java.lang.Object |
clone(BindingContext bindContext,
java.lang.Object bindInf)
This method is equivalent to copy(bindContext, bindInf). |
java.lang.Object |
copy(BindingContext bindContext,
java.lang.Object bindInf)
Perform a copy of the current variable, taking into account the variable binding; the copy will concern the variable's value instead. |
boolean |
equal(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Check that the current variable 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. |
boolean |
equals(java.lang.Object obj)
Override the method equals(). |
void |
finalize()
Method from the interface AmineObject. |
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. |
static Variable |
generateNewVariable()
Generate a new variable identifier. |
java.lang.String |
getDefinitionalBoundForm()
If the variable is a refered bound label (i.e. it starts with '?') |
java.lang.String |
getReferedBoundForm()
If the variable is a definitional label (i.e. it starts with '*'), then returns the bound form; the same label but the char '*' is replaced by '?' |
void |
getVariables(java.util.ArrayList varsIdent)
This method adds the current variable in the specified varsIdent if it is not already in the ArrayList varsIdent. |
static boolean |
isAnonymousVariable(java.lang.Object obj)
Check if the specified obj is an anonymous variable; represented by an underscore |
boolean |
isBoundCoreferent()
This method returns true if the variable starts with "?" |
boolean |
isDefinitionalCoreferent()
This method returns true if the variable starts with "*" (i.e. a definitional bound label) |
static boolean |
isVariable(java.lang.Object obj)
Check if the specified Object obj is a Variable (and so, a VarListConstructor which is a subclass of Variable). |
static boolean |
isVariableName(java.lang.String name)
|
java.lang.Object |
match(byte matchOperation,
BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Match two variables by looking to their values and then matching these values. |
java.lang.Object |
match(byte matchOperation,
java.lang.Object obj)
Match two variables. |
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 int |
nextCount()
Increment a counter that is used for the generation of variable identifiers |
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. |
java.lang.String |
toString(BindingContext bindContext,
java.lang.Object bindInf,
Lexicon lexicon)
Return the textual formulation of the variable, taking into account the variable binding: if the binding is not null, the method will consider the textual formulation of the variable's value, not the variable itself. |
java.lang.String |
toString(Lexicon lexicon)
Return the textual formulation of the variable (the name of the variable). |
boolean |
unify(BindingContext bindContext,
java.lang.Object bindInf,
java.lang.Object obj,
java.lang.Object bindInfObj)
Unify the current CG with the specified object obj. |
Methods inherited from class aminePlatform.kernel.lexicons.Identifier |
compareTo, copy, getIgnoreCase, getName, hashCode, isCorrectIdentName, isIdentifier, isIgnoreCase, setIgnoreCase, setName, toString, wrap |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static Variable SUPER
public static Variable THIS
Constructor Detail |
public Variable(java.lang.String s)
Method Detail |
public boolean equals(java.lang.Object obj)
Identifier
equals
in class Identifier
obj
- An Object
public static boolean isVariable(java.lang.Object obj)
obj
- : an object
public static boolean isVariableName(java.lang.String name)
public static boolean isAnonymousVariable(java.lang.Object obj)
obj
- A Variable
public static int nextCount()
public static Variable generateNewVariable()
public boolean isDefinitionalCoreferent()
public boolean isBoundCoreferent()
public java.lang.String getReferedBoundForm()
public java.lang.String getDefinitionalBoundForm()
public void clear()
clear
in interface AmineObject
public void finalize()
finalize
in interface AmineObject
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 concept
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 variablelexicon
- The lexicon to use during the textual formulation of the current variable
ToStringException
- if an error occurs during the textualizationpublic java.lang.Object clone()
AmineObject
clone
in interface AmineObject
clone
in class Identifier
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 variable
public java.lang.Object copy(BindingContext bindContext, java.lang.Object bindInf)
bindContext
- The Binding contextbindInf
- The binding information related to the binding context and to the current variable
public 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 CG
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 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 | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |