public class TupleArgument
extends java.lang.Object
implements java.io.Serializable
LogicTuple
,
Value
,
Var
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected alice.tuprolog.Term |
value
the internal representation of the argument is a (tu)Prolog term
|
Constructor and Description |
---|
TupleArgument() |
TupleArgument(alice.tuprolog.Term t)
Contructs a tuple argument copying a tuProlog term
|
Modifier and Type | Method and Description |
---|---|
double |
doubleValue()
Gets the double value of this argument
|
float |
floatValue()
Gets the float value of this argument
|
TupleArgument |
getArg(int index)
Gets an argument of this argument supposed to be a compound
|
TupleArgument |
getArg(java.lang.String name)
Gets an argument of this argument supposed to be a compound
|
int |
getArity()
Gets the number of arguments of this argument supposed to be a structure
|
java.lang.String |
getName()
Gets the name of this argument, supposed to be a structure (including
atoms) or a variable
|
java.lang.String |
getPredicateIndicator() |
TupleArgument |
getVarValue(java.lang.String varName)
Gets the argument linked to a variable inside the tuple argument
|
int |
intValue()
Gets the integer value of this argument
|
boolean |
isAtom()
Tests if the argument is an atom
|
boolean |
isAtomic()
Tests if the argument is an atomic argument
|
boolean |
isDouble()
Tests if the argument is a double
|
boolean |
isFloat()
Tests if the argument is a float
|
boolean |
isInt()
Tests if the argument is an integer
|
boolean |
isInteger()
Tests if the argument is an integer number
|
boolean |
isList()
Tests if the argument is a logic list
|
boolean |
isLong()
Tests if the argument is an long
|
boolean |
isNumber()
Tests if the argument is a number
|
boolean |
isReal()
Tests if the argument is a real number
|
boolean |
isStruct()
Tests if the argument is a structured argument
|
boolean |
isValue()
Tests if the argument is a value
|
boolean |
isVar()
Tests if the argument is a variable
|
java.util.Iterator<? extends alice.tuprolog.Term> |
listIterator()
Gets an iterator on the elements of this structure supposed to be a list.
|
long |
longValue()
Gets the long value of this argument
|
boolean |
match(TupleArgument t)
Specifies if this tuple argument matches with a specified tuple argument
|
static TupleArgument |
parse(java.lang.String st)
Static service to get a Tuple Argument from a textual representation
|
boolean |
propagate(alice.tuprolog.Prolog p,
TupleArgument t)
Tries to unify this tuple argument with another one
|
TupleArgument[] |
toArray()
Converts this argument (which is supposed to be a Prolog list) into an
array of values
|
java.util.List<alice.tuprolog.Term> |
toList()
Converts this argument (which is supposed to be a Prolog list) into a
list of values
|
java.lang.String |
toString()
Gets the string representation of the argument
|
alice.tuprolog.Term |
toTerm()
Gets the prolog term representation of the argument
|
protected alice.tuprolog.Term value
public TupleArgument()
public TupleArgument(alice.tuprolog.Term t)
t
- the Prolog term whose content is used to build the argumentpublic static TupleArgument parse(java.lang.String st) throws InvalidTupleArgumentException
st
- the text representing the tuple argumentInvalidTupleArgumentException
- if the text does not represent a valid tuple argumentpublic double doubleValue()
public float floatValue()
public TupleArgument getArg(int index)
index
- the index of the argumentpublic TupleArgument getArg(java.lang.String name)
name
- of the argumentpublic int getArity()
public java.lang.String getName()
public java.lang.String getPredicateIndicator()
public TupleArgument getVarValue(java.lang.String varName)
varName
- is the name of the variablepublic int intValue()
public boolean isAtom()
true
if this argument is an atompublic boolean isAtomic()
true
if this argument is atomicpublic boolean isDouble()
true
if this argument is a doublepublic boolean isFloat()
true
if this argument is a floatpublic boolean isInt()
true
if this argument is an intpublic boolean isInteger()
true
if this argument is an integerpublic boolean isList()
true
if this argument is a listpublic boolean isLong()
true
if this argument is a longpublic boolean isNumber()
true
if this argument is a numberpublic boolean isReal()
true
if this argument is a realpublic boolean isStruct()
true
if this argument is a structpublic boolean isValue()
true
if this argument is a valuepublic boolean isVar()
true
if this argument is a varpublic java.util.Iterator<? extends alice.tuprolog.Term> listIterator()
public long longValue()
public boolean match(TupleArgument t)
t
- a tuple argumenttrue
if there is matching, false
otherwisepublic boolean propagate(alice.tuprolog.Prolog p, TupleArgument t)
t
- a tuple argumentp
- the Prolog engine in charge of propagationtrue
if the propagation was successfull,
false
otherwisepublic TupleArgument[] toArray()
public java.util.List<alice.tuprolog.Term> toList()
public java.lang.String toString()
toString
in class java.lang.Object
public alice.tuprolog.Term toTerm()