public interface PrologVariable extends PrologTerm
PrologProvider.newVariable(int) for anonymous variables and
 PrologProvider.newVariable(String, int) for named variables. The
 Prolog variables can be used and reused because they remain in java heap. You
 can instantiate a prolog variable and used it any times in the same clause
 because refer to same variable every time.
 
 
 
 PrologVariable x = provider.newVariable("X");
 PrologVariable y = provider.newVariable("Y");
 PrologVariable z = provider.newVariable("Z");
 engine.assertz(provider.newStructure(grandparent, x, z), provider.newStructure(parent, x, y),
                provider.newStructure(parent, y, z));
 
 | Modifier and Type | Method and Description | 
|---|---|
String | 
getName()
Name that identify this variable 
 | 
int | 
getPosition()
Non negative integer that represent the variable position of the Structure
 where the variable is first time declared. 
 | 
boolean | 
isAnonymous()
Check that current variable be an anonymous variable 
 | 
void | 
setName(String name)
Set the name for current prolog variable term. 
 | 
cast, getArgument, getArguments, getArity, getFunctor, getIndicator, getObject, getProvider, getTerm, getType, hasIndicator, isAtom, isAtomic, isClass, isCompound, isDouble, isEmptyList, isEntry, isEvaluable, isFalseType, isField, isFloat, isInteger, isList, isLong, isMap, isMixin, isNil, isNullType, isNumber, isObjectType, isParameter, isReference, isResult, isStructure, isTrueType, isVariable, isVariableBound, isVariableNotBound, isVoidType, match, unifycompareToisClause, isTermboolean isAnonymous()
String getName()
void setName(String name)
name - name to be set to the current variable.int getPosition()
Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.