public abstract class AbstractTerm extends Object implements PrologTerm
PrologTerm interface.| Modifier and Type | Field and Description |
|---|---|
protected PrologProvider |
provider |
protected int |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTerm(int type,
PrologProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
<T extends PrologTerm> |
cast()
Casts the current PrologTerm to the class or interface represented by this
Class object. |
protected <T extends PrologTerm> |
cast(PrologTerm term)
Casts a PrologTerm to the class or interface represented by this
Class object. |
protected <T extends PrologTerm> |
cast(PrologTerm term,
Class<T> type)
Casts a PrologTerm to the class or interface represented by this
Class object. |
protected void |
checkIndex(int index) |
protected void |
checkIndex(int index,
int max) |
protected <K> K |
fromTerm(PrologTerm term,
Class<K> to) |
protected <K> K[] |
fromTermArray(PrologTerm[] terms,
Class<K[]> to) |
PrologTerm |
getArgument(int index)
Term located at some given index position in the current term arguments if
current term is a compound term.
|
String |
getIndicator()
Gets the term indicator represented by one string with the format
functor/arity.
|
protected PrologLogger |
getLogger() |
Object |
getObject()
For references terms return the referenced object.
|
PrologProvider |
getProvider()
Prolog provider associated to the current term.
|
PrologTerm |
getTerm()
Return current term instance if current term is not a variable or is a free
variable term.
|
int |
getType()
Get the term type.
|
boolean |
hasIndicator(String functor,
int arity)
True if term has an indicator with the format functor/arity that match with
the given functor and arity.
|
boolean |
isClass()
True if this Term is a Class, false in other case
|
boolean |
isClause()
True if this element is a clause
|
boolean |
isEntry()
True if this Term is a Entry, false in other case
|
boolean |
isField()
True if this Term is a Field, false in other case
|
boolean |
isMap()
True if this Term is a Map, false in other case
|
boolean |
isMixin()
True if this Term is a Mixin, false in other case
|
boolean |
isParameter()
True if this Term is a Parameter, false in other case
|
boolean |
isResult()
True if this Term is a Result, false in other case
|
boolean |
isTerm()
True if this term is a term
|
boolean |
isVariableBound()
True if this Term is a instanced variable, false in other case
|
boolean |
isVariableNotBound()
True if this Term is a not instanced variable, false in other case
|
Map<String,PrologTerm> |
match(PrologTerm term)
Match to other term returning list of substitutions.
|
protected String |
removeQuoted(String functor) |
protected <K extends PrologTerm> |
toTerm(Object o,
Class<K> from) |
protected <K extends PrologTerm> |
toTermArray(Object[] os,
Class<K[]> from) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetArguments, getArity, getFunctor, isAtom, isAtomic, isCompound, isDouble, isEmptyList, isEvaluable, isFalseType, isFloat, isInteger, isList, isLong, isNil, isNullType, isNumber, isObjectType, isReference, isStructure, isTrueType, isVariable, isVoidType, unifycompareToprotected int type
protected final PrologProvider provider
protected AbstractTerm(int type,
PrologProvider provider)
protected final void checkIndex(int index)
protected final void checkIndex(int index,
int max)
protected final <K extends PrologTerm> K toTerm(Object o, Class<K> from)
protected final <K extends PrologTerm> K[] toTermArray(Object[] os, Class<K[]> from)
protected final <K> K fromTerm(PrologTerm term, Class<K> to)
protected final <K> K[] fromTermArray(PrologTerm[] terms, Class<K[]> to)
protected final PrologLogger getLogger()
public PrologTerm getArgument(int index)
PrologTermArrayIndexOutOfBoundsException exception is raised.getArgument in interface PrologTermindex - position to retrieve the correspondent term.public final String getIndicator()
PrologTermPrologTerm.getFunctor() and PrologTerm.getArity() separated by
slash.getIndicator in interface PrologTermpublic final boolean hasIndicator(String functor, int arity)
PrologTermhasIndicator in interface PrologTermfunctor - term functorarity - term aritypublic PrologTerm getTerm()
PrologTermgetTerm in interface PrologTermpublic final int getType()
PrologTermgetType in interface PrologTermpublic final PrologProvider getProvider()
PrologTermgetProvider in interface PrologTermprotected final <T extends PrologTerm> T cast(PrologTerm term, Class<T> type)
Class object.term - the object to be casttype - the class or interface to be castedClassCastException - if the object is not null and is not assignable to
the type T.protected final <T extends PrologTerm> T cast(PrologTerm term)
Class object.term - the object to be castClassCastException - if the object is not null and is not assignable to
the type T.public final <T extends PrologTerm> T cast()
PrologTermClass object.cast in interface PrologTermpublic Object getObject()
PrologTermgetObject in interface PrologTermpublic final boolean isEntry()
PrologTermisEntry in interface PrologTermpublic final boolean isMap()
PrologTermisMap in interface PrologTermpublic boolean isField()
PrologTermisField in interface PrologTermpublic boolean isResult()
PrologTermisResult in interface PrologTermpublic boolean isParameter()
PrologTermisParameter in interface PrologTermpublic final boolean isMixin()
PrologTermisMixin in interface PrologTermpublic final boolean isClass()
PrologTermisClass in interface PrologTermpublic boolean isVariableBound()
PrologTermisVariableBound in interface PrologTermpublic boolean isVariableNotBound()
PrologTermisVariableNotBound in interface PrologTermpublic final boolean isClause()
PrologElementisClause in interface PrologElementpublic final boolean isTerm()
PrologElementisTerm in interface PrologElementpublic final Map<String,PrologTerm> match(PrologTerm term)
match in interface PrologTermterm - - term to match checkCopyright © 2020–2024 Prolobjectlink Project. All rights reserved.