Package org.projog.core.term
Class ListFactory
java.lang.Object
org.projog.core.term.ListFactory
Static factory methods for creating new instances of
List.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA "." is the functor name for all lists in Prolog. -
Method Summary
Modifier and TypeMethodDescriptionstatic TermcreateList(Collection<? extends Term> terms) Returns a newListwith the specified terms and a empty list as the final tail element.static TermcreateList(Term[] terms) Returns a newListwith the specified terms and a empty list as the final tail element.static TermcreateList(Term[] terms, Term tail) Returns a newListwith the specified terms and the second parameter as the tail element.static ListcreateList(Term head, Term tail) Returns a newListwith specified head and tail.static TermcreateListOfLength(int length) Returns a new list of the specified length where is each element is a variable.
-
Field Details
-
LIST_PREDICATE_NAME
A "." is the functor name for all lists in Prolog.- See Also:
-
-
Method Details
-
createList
Returns a newListwith specified head and tail.- Parameters:
head- the first argument in the listtail- the second argument in the list- Returns:
- a new
Listwith specified head and tail
-
createList
Returns a newListwith the specified terms and a empty list as the final tail element.- Parameters:
terms- contents of the list- Returns:
- a new
Listwith the specified terms and a empty list as the final tail element
-
createList
Returns a newListwith the specified terms and a empty list as the final tail element.By having a
Listwith aListas its tail it is possible to represent an ordered sequence of the specified terms.- Parameters:
terms- contents of the list- Returns:
- a new
Listwith the specified terms and a empty list as the final tail element
-
createList
Returns a newListwith the specified terms and the second parameter as the tail element.By having a
Listwith aListas its tail it is possible to represent an ordered sequence of the specified terms.- Parameters:
terms- contents of the list- Returns:
- a new
Listwith the specified terms and the second parameter as the tail element
-
createListOfLength
Returns a new list of the specified length where is each element is a variable.
-