Term.TermIterator
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEANLITERAL
The numberic code for a boolean literal
|
static int |
DOUBLELITERAL
The numberic code for a double literal
|
static int |
FLOATLITERAL
The numberic code for a float literal
|
static int |
INTEGERLITERAL
The numberic code for a integer literal
|
static int |
LONGLITERAL
The numberic code for a long literal
|
static int |
NULLLITERAL
The numberic code for a boolean literal
|
static int |
SHORTLITERAL
The numberic code for a symbol literal
|
static int |
STRINGLITERAL
The numberic code for a string literal
|
static int |
SYMBOLLITERAL
The numberic code for a symbol literal
|
Constructor and Description |
---|
AtomicTerm(String sValue,
int nType)
Construct a new AtomicTerm with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TermWalker walker)
Do a dispatch back to the given walker.
|
Term[] |
children()
Obtain the childern Terms
|
static AtomicTerm |
createBoolean(String value)
Create new AtomicTerm representing a Boolean with given value
|
static AtomicTerm |
createDouble(String value)
Create new AtomicTerm representing a Double with given value
|
static AtomicTerm |
createFloat(String value)
Create new AtomicTerm representing a float with given value
|
static AtomicTerm |
createInteger(String value)
Create new AtomicTerm representing a Integer with given value
|
static AtomicTerm |
createLong(String value)
Create new AtomicTerm representing a Long with given value
|
static AtomicTerm |
createNull()
Create new AtomicTerm representing a null.
|
static AtomicTerm |
createNull(String value)
Create new AtomicTerm representing a null with given value
|
static AtomicTerm |
createShort(String value)
Create new AtomicTerm representing a Short with given value
|
static AtomicTerm |
createString(String value)
Create new AtomicTerm representing a String with given value
|
static AtomicTerm |
createSymbol(String value)
Create new AtomicTerm representing a Symbol with given value
|
Term |
findChild(String fn)
Find the Term amoungst the children whose functor equals the
given functor.
|
String |
fullFormString()
Answer a String representation of the Term that is allowed to
show more internal details than toString()
which does not compress information.
|
String |
getFunctor()
Obtain the functor representation of the Term.
|
Number |
getNumber()
Obtain the Number representation of the node.
|
Object |
getObject()
Obtain the Object representation of the node.
|
int |
getTypeCode()
Obtain the typecode for the node.
|
String |
getValue()
Obtain the string value for the node.
|
boolean |
isNumber()
Answer whether the receiver is an Atomic Term representing a Number.
|
boolean |
isValidNumber()
Test whether the value is of a valid number format.
|
void |
negate()
Make negavite the representation of this node.
|
Number |
negativeNumber(Number num)
Make negative the given number that supposedly came from this node.
|
Term |
termAt(int index)
Obtain the child term at the given index.
|
boolean |
termEqual(Term t)
Answer whether the receiver is equal to the given Term.
|
String |
toString()
Return a human-readable description for this Node.
|
Term |
withChild(Term t)
Join the receiver with the given child Term.
|
childrenTermEqual, findAttribute, headChildrenTermEqual, isAtom, isLeaf, iterator, length
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final int STRINGLITERAL
public static final int INTEGERLITERAL
public static final int LONGLITERAL
public static final int FLOATLITERAL
public static final int DOUBLELITERAL
public static final int BOOLEANLITERAL
public static final int NULLLITERAL
public static final int SHORTLITERAL
public static final int SYMBOLLITERAL
public AtomicTerm(String sValue, int nType)
sValue
- the String representation of the literalnType
- the type code for the given literalpublic int getTypeCode()
public String getValue()
public String getFunctor()
getFunctor
in class Term
public String fullFormString()
fullFormString
in class Term
public boolean isNumber()
public Term withChild(Term t)
public Term[] children()
public Term termAt(int index)
public Term findChild(String fn)
public boolean termEqual(Term t)
public Object getObject()
public Number getNumber()
public Number negativeNumber(Number num)
num
- a Number that was created by this nodepublic void negate()
public boolean isValidNumber()
public void accept(TermWalker walker)
Term
public String toString()
public static AtomicTerm createString(String value)
value
- the text of the literalpublic static AtomicTerm createShort(String value)
value
- the text of the literalpublic static AtomicTerm createInteger(String value)
value
- the text of the literalpublic static AtomicTerm createLong(String value)
value
- the text of the literalpublic static AtomicTerm createFloat(String value)
value
- the text of the literalpublic static AtomicTerm createDouble(String value)
value
- the text of the literalpublic static AtomicTerm createBoolean(String value)
value
- the text of the literalpublic static AtomicTerm createNull(String value)
value
- the text of the literalpublic static AtomicTerm createNull()
public static AtomicTerm createSymbol(String value)
value
- the text of the literal