cgp.runtime
Class ListType
java.lang.Object
|
+--cgp.runtime.Type
|
+--cgp.runtime.ListType
- public class ListType
- extends Type
Field Summary |
private java.util.LinkedList |
theList
|
Methods inherited from class cgp.runtime.Type |
addOp,
andOp,
divideOp,
geOp,
getAttr,
getKBStack,
getScopeStack,
getType,
gtOp,
invokeMemberFunc,
isOp,
leOp,
ltOp,
modulusOp,
multiplyOp,
negateOp,
notOp,
operationError,
orOp,
setAttr,
setKBStack,
setScopeStack,
setType,
subtractOp |
Methods inherited from class java.lang.Object |
,
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
theList
private java.util.LinkedList theList
ListType
public ListType()
ListType
public ListType(java.util.LinkedList list)
ListType
public ListType(Type[] values)
getValue
public java.util.LinkedList getValue()
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
equals
public boolean equals(java.lang.Object other)
- Overrides:
- equals in class java.lang.Object
eqOp
public Type eqOp(Type other)
- Overrides:
- eqOp in class Type
neOp
public Type neOp(Type other)
- Overrides:
- neOp in class Type
getNthOp
public Type getNthOp(Type n)
- Return the Nth element of this list.
The first valid index is 1 and the last is the list's length.
- Overrides:
- getNthOp in class Type
setNthOp
public void setNthOp(Type n,
Type value)
- Set the Nth element of this list.
The first valid index is 1 and the last is the list's length.
- Overrides:
- setNthOp in class Type
getLength
public NumberType getLength()
- Getter and setter methods for attributes.
hasMember
public BooleanType hasMember(Type x)
- Is x a member of this list?
Note that this is a shallow test.
member
public Type member(Type x)
- Is x a member of this list, or of a sub-list of this list?
If so, return the sub-list within which it is embedded.
Note that this may be the outermost list.
prepend
public ListType prepend(Type x)
- Prepend a value to this list and return the mutated list.
append
public ListType append(Type x)
- Append a value to this list and return the mutated list.
merge
public ListType merge(Type x)
- Merge another list with this list, appending the former's
members to the latter's, and returning the mutated list.