aminePlatform.util
Class Term

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byaminePlatform.util.AmineList
                  extended byaminePlatform.util.Term
All Implemented Interfaces:
AmineConstants, AmineObject, java.lang.Cloneable, java.util.Collection, java.util.List, Matching, java.util.RandomAccess, java.io.Serializable, ToString

public class Term
extends AmineList
implements java.io.Serializable, Matching, AmineObject

Title : util.Term Class

Description : Term extends AmineList and implements the Term structure. The arguments of a Term can be any Amine object, any Java Object that implements AmineObject and Matching interfaces or even any Java object. A term can be a descriptor (or contained in a descriptor) of a concept in a CG.

Copyright: Copyright (c) Adil KABBAJ, 2004-2009

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
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
Term()
           
Term(int i)
           
 
Method Summary
 AmineList copy(BindingContext bindContext, java.lang.Object bindInf)
          This method overrides the method defined in AmineList to construct a term, not an AmineList.
static boolean isTerm(java.lang.Object obj)
          Check if the specified Object obj is a Term.
 java.lang.Object match(byte matchOperation, BindingContext bindContext, java.lang.Object bindInf, java.lang.Object obj, java.lang.Object bindInfObj)
          Match the current term with the specified object, according to the value of the parameter matchOperation.
 AmineList toAmineList()
           
 java.lang.String toString(BindingContext bindContext, java.lang.Object bindInf, Lexicon lexicon)
          Override the method defined in AmineList; this definition returns the textual formulation of the current Term.
 
Methods inherited from class aminePlatform.util.AmineList
clear, clone, copy, equal, equal, finalize, generalize, generalize, getVariables, isAmineList, isMember, isMember, match, match, maximalJoin, maximalJoin, parse, parse, subsume, subsume, subsumeWithResult, subsumeWithResult, toAmineSet, toString, toString, toTerm, unify
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface aminePlatform.util.Matching
equal, equal, generalize, generalize, match, maximalJoin, maximalJoin, subsume, subsume, subsumeWithResult, subsumeWithResult, unify
 
Methods inherited from interface aminePlatform.util.AmineObject
clear, clone, clone, finalize, getVariables
 
Methods inherited from interface aminePlatform.kernel.lexicons.ToString
toString
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

Term

public Term()

Term

public Term(int i)
Method Detail

toString

public java.lang.String toString(BindingContext bindContext,
                                 java.lang.Object bindInf,
                                 Lexicon lexicon)
                          throws ToStringException
Override the method defined in AmineList; this definition returns the textual formulation of the current Term. If variable binding is considered, the values of the variables will be textualized too.

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

isTerm

public static boolean isTerm(java.lang.Object obj)
Check if the specified Object obj is a Term.

Parameters:
obj - : an object
Returns:
true if obj is a Term and false otherwise

copy

public AmineList copy(BindingContext bindContext,
                      java.lang.Object bindInf)
This method overrides the method defined in AmineList to construct a term, not an AmineList. However, the overriden method in Java should have the same returned type, thus the returned type of copy() is AmineList, so user should cast the result to Term.

Overrides:
copy in class AmineList
Parameters:
bindContext - The Binding context
bindInf - The binding information related to the binding context and to the current Term
Returns:
a copy of the current Term, the user should cast the result to Term.

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 term with the specified object, according to the value of the parameter matchOperation. This definition overrides the definition provided in AmineList (Term is a specialization of AmineList).

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

toAmineList

public AmineList toAmineList()