Jalog 1.4
java.lang.Objectio.github.JalogTeam.jalog.Pro_TermData
io.github.JalogTeam.jalog.Pro_TermData_List
public class Pro_TermData_List
Pro_Term objects containing Prolog list data store the data as Pro_TermData_List objects.
EMPTY for the empty list.
| Field Summary | |
|---|---|
Pro_Term |
t1
Head of the list |
Pro_Term |
t2
Tail of the list |
static final Pro_TermData_List |
EMPTY
Empty list data |
String |
typename
Type of the term |
| Constructor Summary | |
|---|---|
Pro_TermData_List(Pro_Term head, Pro_Term tail)
Constructs a Pro_TermData_List object. |
|
| Method Summary | |
|---|---|
Pro_TermData
|
copy(Hashtable variable_map)
Returns an independent copy this of term using variable_map.
|
String
|
image()
Returns human readable string representation of this term. |
static Pro_TermData_List
|
make(Pro_Term[] iniVal, Pro_Term tail)
Constructs list data from an array of Pro_Term objects.
|
String
|
toString()
Returns Jalog syntax representation of this term. |
String[]
|
toStringList()
Returns human readable images of the members of the list as a String array.
|
| Field Detail |
|---|
public Pro_Term t1
null (except in the constant EMPTY).
public Pro_Term t2
Pro_Term.EMPTY_LIST if there are no more elements. Must not be null (except in the constant EMPTY).
public static final Pro_TermData_List EMPTY
Pro_Term.EMPTY_LIST.
public String typename
Jalog.LIST. Do not change!
| Constructor Detail |
|---|
public Pro_TermData_List(Pro_Term head, Pro_Term tail)
Pro_TermData_List object.
head becomes the first element of the new list. tail becomes the rest of the list. If the list contains only one element, head, Pro_Term.EMPTY_LIST is used as tail.
Both head and tail must be non-null.
head - the first element of the list.
tail - a list containing the rest of the list. head, Pro_Term.EMPTY_LIST if no more elements.
| Method Detail |
|---|
public Pro_TermData copy(Hashtable variable_map)
variable_map. Hashtable is used to map repeated open terms to repeated open terms. Hashtable is updated for new open terms. Used in database asserting and fetching.
This method copies t1 (the head) and t2 (the tail) using the Pro_Term.
The copy method of Pro_Term may return the original object. If this happens for both t1 and t2 the original Pro_TermData_List object then this is returned. Otherwise a new Pro_TermData_List object is created and returned.
variable_map - contains open variable mapping for this term.
variable_map.
public String image()
write.
public static Pro_TermData_List make(Pro_Term[] iniVal, Pro_Term tail)
Pro_Term objects.
If the first element is an empty array, data of tail is returned. If tail is Pro_Term.EMPTY_LIST then the constructed list contains only the elements of iniVal. Otherwise tail is concatenated to the end of the constructed list.
iniVal and all elements of iniVal and also tail must be non-null.
iniVal - the first elements to the list.
tail - the last elements to the list.
public String toString()
public String[] toStringList()
String array. The empty list results an empty array.