|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.sri.oaa2.icl.IclTerm
|
+--com.sri.oaa2.icl.IclComposite
|
+--com.sri.oaa2.icl.IclStruct
Represents an IclTerm of the form a(b).
| Field Summary | |
protected java.lang.String |
functor
|
| Fields inherited from class com.sri.oaa2.icl.IclTerm |
children, readOnly, type |
| Fields inherited from interface com.sri.oaa2.icl.OaaPrologVocabTokenTypes |
BACKSLASH, BANG, COLON, COMMA, DBL_COLON, DBLQUOTE, DBLQUOTED, DIV, DOT, ENDPAREN_LITERAL, EOF, EQUAL, EXPONENT, FLOAT, GROUP, ICLDATAQ, ICLDATAQ_LITERAL, IDENT, INT, LBRACE, LBRACK, LIST, LPAREN, MINUS, NULL_TREE_LOOKAHEAD, NUM_FLOAT, NUM_INT, PIPE, PLUS, RBRACE, RBRACK, RPAREN, SEMI, SIGNED_EXPONENT, SPECIAL_CHAR_LITERAL, STAR, STR, STRING_LITERAL, STRUCT, TERM_LITERAL, TILDE, TURNSTILE, VAR, VARIABLE, WS |
| Constructor Summary | |
IclStruct(java.lang.String inFunctor)
Construct with functor, no children |
|
IclStruct(java.lang.String inFunctor,
IclTerm first)
Functor + one term |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth,
IclTerm seventh)
etc |
|
IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth,
IclTerm seventh,
IclTerm eighth)
etc |
|
IclStruct(java.lang.String inFunctor,
java.util.List args)
Construct with functor, and given children |
|
IclStruct(java.lang.String inFunctor,
java.util.Vector inVector)
Deprecated. |
|
| Method Summary | |
protected java.lang.Object |
accept(OaaPrologVisitor visitor,
java.lang.Object data)
Accept the visitor. |
void |
add(IclTerm n)
Add a child to the end of the list of children. |
void |
add(int index,
IclTerm n)
Add a child to this term at the given index |
void |
addAll(IclTerm l)
Add all the children of the given term to this term. |
void |
clearTerms()
Remove all children of this node. |
boolean |
equals(java.lang.Object o)
|
protected IclTerm |
getChild(int i)
Get the child at the given Index. |
java.lang.String |
getFunctor()
Get the functor |
int |
getNumChildren()
Get the number of children of this node. |
IclTerm |
getTerm(int i)
Get the term at the given index. |
int |
hashCode()
|
java.lang.String |
iclStr()
Deprecated. use getFunctor |
boolean |
isAtomic()
Check if this term is atomic--can never have children. |
boolean |
isComposite()
Check if this term is composite--can have children. |
java.util.Iterator |
iterator()
Get an iterator for the children of this term. |
java.util.ListIterator |
listIterator()
Get an iterator for the children of this term. |
void |
removeAllUnifying(IclTerm n)
Remove all terms from this term's children for which the given term unifies. |
void |
removeElement(int i)
Remove the child at the given index. |
IclTerm |
removeUnifying(IclTerm n)
Remove the first child found that unifies with the given one. |
void |
replaceElement(int target,
IclTerm replacement)
Replace the term at the given index. |
void |
replaceUnifying(IclTerm target,
IclTerm replacement)
Replace all terms that unify with target with replacement. |
protected void |
setFunctor(java.lang.String s)
Set the functor from a String |
int |
size()
Get the number of children of this node. |
java.util.ArrayList |
toArrayList()
Get the children of this node as an ArrayList. |
java.lang.String |
toIdentifyingString()
Returns the functor. |
| Methods inherited from class com.sri.oaa2.icl.IclTerm |
checkWritable, childrenAccept, clone, dump, fromString, fromString, getChildren, getType, iclAddToList, iclAddToList, iclAppend, iclArguments, iclArgumentsIterator, iclClone, iclDelete, iclDerefTerm, iclFloat, iclFunctor, iclInt, iclListIterator, iclListLen, iclNthTerm, iclNumTerms, iclRemoveElement, iclRemoveFromList, iclReplaceElement, iclReplaceNthTerm, iclRetractAll, iclStarter, iclUnify, iclUnify, iclUnify, isEmptyList, isFloat, isGroup, isIclDataQ, isInt, isList, isOfType, isReadOnly, isStr, isStruct, isVar, setReadOnly, setType, toString, toString, toVector |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String functor
| Constructor Detail |
public IclStruct(java.lang.String inFunctor)
public IclStruct(java.lang.String inFunctor,
java.util.List args)
public IclStruct(java.lang.String inFunctor,
java.util.Vector inVector)
inFunctor - the functor for the structinVector - the args for the struct
public IclStruct(java.lang.String inFunctor,
IclTerm first)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth,
IclTerm seventh)
public IclStruct(java.lang.String inFunctor,
IclTerm first,
IclTerm second,
IclTerm third,
IclTerm fourth,
IclTerm fifth,
IclTerm sixth,
IclTerm seventh,
IclTerm eighth)
| Method Detail |
protected void setFunctor(java.lang.String s)
public java.lang.String getFunctor()
protected java.lang.Object accept(OaaPrologVisitor visitor,
java.lang.Object data)
accept in class IclTermvisitor - the visitordata - generic data for the visitor
for an alternativepublic java.lang.String toIdentifyingString()
toIdentifyingString in class IclTermpublic java.lang.String iclStr()
iclStr in class IclTermpublic final boolean isAtomic()
IclTerm
isAtomic in class IclTermpublic final boolean isComposite()
IclTerm
isComposite in class IclTermpublic final java.util.ArrayList toArrayList()
IclTerm
toArrayList in class IclTermpublic final int getNumChildren()
IclTerm
getNumChildren in class IclTerm
public void add(IclTerm n)
throws java.lang.UnsupportedOperationException
IclTerm
add in class IclTermn - the term to add.
java.lang.UnsupportedOperationException
public void add(int index,
IclTerm n)
throws java.lang.UnsupportedOperationException
IclTerm
add in class IclTermjava.lang.UnsupportedOperationException - if term cannot have children
public void addAll(IclTerm l)
throws java.lang.UnsupportedOperationException
IclTerm
addAll in class IclTerml - the IclTerm containing the children to add.
java.lang.UnsupportedOperationException - if term cannot have children
public final void clearTerms()
throws java.lang.UnsupportedOperationException
IclTerm
clearTerms in class IclTermjava.lang.UnsupportedOperationException - if term cannot have children
protected final IclTerm getChild(int i)
throws java.lang.UnsupportedOperationException
IclTerm
getChild in class IclTermjava.lang.UnsupportedOperationException - if term cannot have children
public final IclTerm getTerm(int i)
throws java.lang.UnsupportedOperationException
IclTerm
getTerm in class IclTermi - index of term (first term has index 0, and last has
index (size() -1)
java.lang.UnsupportedOperationExceptionpublic final int size()
IclTerm
size in class IclTerm
public final void removeAllUnifying(IclTerm n)
throws java.lang.UnsupportedOperationException
IclTerm
removeAllUnifying in class IclTermn - the term against which children must unify to be removed
java.lang.UnsupportedOperationException - if term cannot have children
public final IclTerm removeUnifying(IclTerm n)
throws java.lang.UnsupportedOperationException
IclTerm
removeUnifying in class IclTermn - the term against which to unify
java.lang.UnsupportedOperationException - if term cannot have children
public final void removeElement(int i)
throws java.lang.UnsupportedOperationException
IclTerm
removeElement in class IclTermi - the index
java.lang.UnsupportedOperationException - if term cannot have children
public final void replaceUnifying(IclTerm target,
IclTerm replacement)
throws java.lang.UnsupportedOperationException
IclTerm
replaceUnifying in class IclTermtarget - the target against which to unifyreplacement - the replacement
java.lang.UnsupportedOperationException - if term cannot have children
public final void replaceElement(int target,
IclTerm replacement)
throws java.lang.IndexOutOfBoundsException,
java.lang.UnsupportedOperationException
IclTerm
replaceElement in class IclTermtarget - the index to replacereplacement - the replacement
java.lang.IndexOutOfBoundsException - if target is out of bounds
java.lang.UnsupportedOperationException
public final java.util.Iterator iterator()
throws java.lang.UnsupportedOperationException
IclTerm
iterator in class IclTermjava.lang.UnsupportedOperationExceptionIclTerm.isAtomic(),
IclTerm.isComposite()
public final java.util.ListIterator listIterator()
throws java.lang.UnsupportedOperationException
IclTerm
listIterator in class IclTermjava.lang.UnsupportedOperationExceptionIclTerm.isAtomic(),
IclTerm.isComposite()public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||