|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.isi.stella.Stella_Object edu.isi.stella.StandardObject edu.isi.stella.AbstractCollection edu.isi.stella.Collection edu.isi.stella.Sequence edu.isi.stella.List
public class List
Field Summary | |
---|---|
Cons |
theConsList
|
Constructor Summary | |
---|---|
List()
|
Method Summary | |
---|---|
static Stella_Object |
accessListSlotValue(List self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
Iterator |
allocateDestructiveListIterator()
|
AbstractIterator |
allocateIterator()
|
Iterator |
butLast()
Generate all but the last element of the list self . |
void |
clear()
Make self an empty list. |
static void |
clOutputSystemClStructsFile(List classunits)
|
static Module |
computeFileUnitsModule(List fileunits)
|
List |
concatenate(List list2,
Cons otherlists)
Copy list2 and all otherlists onto the end of list1 . |
Cons |
consify()
Return a list of elements in self . |
List |
copy()
Return a copy of the list self . |
static List |
cppSortUnitsForHeaderFile(List fileunits)
|
static List |
createDerivedList(List self)
Create a new list object with the same type as self . |
static boolean |
definedListP(List self)
Return TRUE unless self is NULL or the NIL_LIST . |
List |
difference(List otherlist)
Return the set difference of self and otherlist (i.e., all elements
that are in self but not in otherSet ). |
static List |
ejectDemon(List demonlist,
Demon demon)
|
boolean |
emptyP()
Return TRUE if the list self has no members. |
int |
equalHashCode()
Return an equalP hash code for self . |
boolean |
equivalentSetsP(List otherlist)
Return true if every element of self occurs in otherlist and vice versa. |
static void |
extractStartupFunctionUnits(List startupunits,
Symbol startupfnname)
|
Stella_Object |
fifth()
Return the fifth item in the list self , or NULL if empty. |
Stella_Object |
fifthSetter(Stella_Object value)
|
Stella_Object |
first()
Return the first item in the list self , or NULL if empty. |
Stella_Object |
firstSetter(Stella_Object value)
|
Stella_Object |
fourth()
Return the fourth item in the list self , or NULL if empty. |
Stella_Object |
fourthSetter(Stella_Object value)
|
static void |
helpPrintContextTree(List list,
int level)
|
static List |
injectDemon(List demonlist,
Demon demon)
|
void |
insert(Stella_Object value)
Add value to the front of the list self . |
void |
insertLast(Stella_Object value)
Insert value as the last entry in the list self . |
void |
insertNew(Stella_Object value)
Add value to the front of the list self unless its
already a member. |
List |
intersection(List otherlist)
Return the set intersection of self and otherlist . |
Stella_Object |
last()
Return the last element of self . |
int |
lastPosition(Stella_Object renamed_Object,
int end)
Return the position of renamed_Object within the list
self (counting from zero); or return NULL if renamed_Object does not occur within
self (uses an eqlP test). |
int |
length()
|
static List |
list(Cons values)
Return a list containing values , in order. |
List |
listify()
Return self . |
static List |
mapNullToNilList(List self)
Return NIL-LIST iff self is NULL or self otherwise. |
boolean |
memberP(Stella_Object renamed_Object)
Return TRUE iff renamed_Object is a member of the list
self (uses an eqlP test). |
boolean |
membP(Stella_Object renamed_Object)
Return TRUE iff renamed_Object is a member of the cons list
self (uses an 'eq?' test). |
static List |
newList()
|
boolean |
nonEmptyP()
Return TRUE if the list self has at least one member. |
Stella_Object |
nth(int position)
Return the nth item in the list self , or NULL if empty. |
Stella_Object |
nthSetter(Stella_Object value,
int position)
|
static boolean |
nullListP(List self)
Return TRUE iff self is NULL or the NIL_LIST . |
boolean |
objectEqualP(Stella_Object y)
Return TRUE iff the lists x and y are structurally
equivalent. |
Stella_Object |
pop()
Remove and return the first element in the list self . |
int |
position(Stella_Object renamed_Object,
int start)
Return the position of renamed_Object within the list
self (counting from zero); or return NULL if renamed_Object does not occur within
self (uses an eqlP test). |
List |
prepend(List list2)
Copy list2 onto the front of the list self . |
Surrogate |
primaryType()
Returns the primary type of self . |
void |
printObject(java.io.PrintStream stream)
|
void |
push(Stella_Object value)
Add value to the front of the list self . |
AbstractCollection |
remove(Stella_Object value)
Destructively remove all entries in self that match value . |
List |
removeDeletedMembers()
|
Collection |
removeDuplicates()
Destructively remove duplicates from self and return the result. |
List |
removeDuplicatesEqual()
removeDuplicates (which see) using an equalP test. |
List |
removeIf(java.lang.reflect.Method testP)
Destructively remove all members of the list self for which
'test?' evaluates to TRUE. |
Cons |
rest()
Return a cons list of all but the first item in the list self . |
List |
reverse()
Reverse the members of self (in place). |
Stella_Object |
second()
Return the second item in the list self , or NULL if empty. |
Stella_Object |
secondSetter(Stella_Object value)
|
List |
sort(java.lang.reflect.Method predicate)
Perform a stable, destructive sort of self according to
predicate , and return the result. |
static List |
sortClStructClasses(List unsortedclasses)
|
boolean |
subsetP(List otherlist)
Return true if every element of self also occurs in otherlist . |
List |
substitute(Stella_Object invalue,
Stella_Object outvalue)
Destructively replace each appearance of outvalue by
invalue in the list self . |
List |
subtract(List otherlist)
Return the set difference of self and otherlist by destructively
removing elements from self that also occur in otherlist . |
static boolean |
terminateListP(List self)
|
Stella_Object |
third()
Return the third item in the list self , or NULL if empty. |
Stella_Object |
thirdSetter(Stella_Object value)
|
List |
union(List otherlist)
Return the set union of self and otherlist . |
Methods inherited from class edu.isi.stella.Sequence |
---|
orderedP, sequence, yieldConsListFromSequence |
Methods inherited from class edu.isi.stella.Collection |
---|
noDuplicatesP |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Cons theConsList
Constructor Detail |
---|
public List()
Method Detail |
---|
public static List list(Cons values)
values
, in order.
values
-
public static List newList()
public static List cppSortUnitsForHeaderFile(List fileunits)
public static Module computeFileUnitsModule(List fileunits)
public static List ejectDemon(List demonlist, Demon demon)
public static List injectDemon(List demonlist, Demon demon)
public static void helpPrintContextTree(List list, int level)
public static void clOutputSystemClStructsFile(List classunits)
public static List sortClStructClasses(List unsortedclasses)
public static void extractStartupFunctionUnits(List startupunits, Symbol startupfnname)
public Iterator allocateDestructiveListIterator()
public List listify()
self
.
public List subtract(List otherlist)
self
and otherlist
by destructively
removing elements from self
that also occur in otherlist
. Uses an eqlP
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if self
is a set.
otherlist
-
public List difference(List otherlist)
self
and otherlist
(i.e., all elements
that are in self
but not in otherSet
). Uses an eqlP
test and a simple
quadratic-time algorithm. Note that the result is only guaranteed to be a
set if both self
and otherlist
are sets.
otherlist
-
public List union(List otherlist)
self
and otherlist
. Uses an eqlP
test
and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self
and otherlist
are sets.
otherlist
-
public List intersection(List otherlist)
self
and otherlist
. Uses an eqlP
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self
and otherlist
are sets.
otherlist
-
public boolean equivalentSetsP(List otherlist)
self
occurs in otherlist
and vice versa.
Uses an eqlP
test and a simple quadratic-time algorithm. Note that
this does not check whether self
and otherlist
actually are sets.
otherlist
-
public boolean subsetP(List otherlist)
self
also occurs in otherlist
.
Uses an eqlP
test and a simple quadratic-time algorithm. Note that
this does not check whether self
and otherlist
actually are sets.
otherlist
-
public List removeDeletedMembers()
public Iterator butLast()
self
.
public AbstractIterator allocateIterator()
allocateIterator
in class Sequence
public int equalHashCode()
equalP
hash code for self
. Note that this
is O(N) in the number of elements of self
.
equalHashCode
in class Stella_Object
public boolean objectEqualP(Stella_Object y)
x
and y
are structurally
equivalent. Uses equalP
to test equality of elements.
objectEqualP
in class Stella_Object
y
-
public static List mapNullToNilList(List self)
self
is NULL or self
otherwise.
self
-
public List sort(java.lang.reflect.Method predicate)
self
according to
predicate
, and return the result. If predicate
has a '<' semantics, the
result will be in ascending order. If predicate
is NULL, a suitable
'<' predicate is chosen depending on the first element of self
, and it
is assumed that all elements of self
have the same type (supported
element types are GENERALIZED-SYMBOL, STRING, INTEGER, and FLOAT).
predicate
-
public void clear()
self
an empty list.
public List copy()
self
. The conses in the copy are
freshly allocated.
public static List createDerivedList(List self)
self
.
self
-
public List prepend(List list2)
list2
onto the front of the list self
.
The operation is destructive wrt self
, but leaves list2
intact.
list2
-
public List concatenate(List list2, Cons otherlists)
list2
and all otherlists
onto the end of list1
.
The operation is destructive wrt list1
, but leaves all other lists intact.
The two mandatory parameters allow us to optimize the common binary case by
not relying on the somewhat less efficient variable arguments mechanism.
list2
- otherlists
-
public List substitute(Stella_Object invalue, Stella_Object outvalue)
outvalue
by
invalue
in the list self
.
invalue
- outvalue
-
public List reverse()
self
(in place).
public Stella_Object pop()
self
.
Return NULL if the list is empty.
public List removeDuplicatesEqual()
removeDuplicates
(which see) using an equalP
test.
public Collection removeDuplicates()
self
and return the result.
Preserves the original order of the remaining members.
public List removeIf(java.lang.reflect.Method testP)
self
for which
'test?' evaluates to TRUE. test
takes a single argument of type OBJECT and
returns TRUE or FALSE. Returns self
.
testP
-
public AbstractCollection remove(Stella_Object value)
self
that match value
.
remove
in class Collection
value
-
public void insertLast(Stella_Object value)
value
as the last entry in the list self
.
value
- public void insertNew(Stella_Object value)
value
to the front of the list self
unless its
already a member.
value
- public void push(Stella_Object value)
value
to the front of the list self
.
value
- public void insert(Stella_Object value)
value
to the front of the list self
.
insert
in class Collection
value
- public int lastPosition(Stella_Object renamed_Object, int end)
renamed_Object
within the list
self
(counting from zero); or return NULL if renamed_Object
does not occur within
self
(uses an eqlP
test). If end
was supplied as non-NULL, only
consider the sublist ending at end
, however, the returned position
will always be relative to the entire list.
renamed_Object
- end
-
public int position(Stella_Object renamed_Object, int start)
renamed_Object
within the list
self
(counting from zero); or return NULL if renamed_Object
does not occur within
self
(uses an eqlP
test). If start
was supplied as non-NULL, only
consider the sublist starting at start
, however, the returned position
will always be relative to the entire list.
renamed_Object
- start
-
public int length()
length
in class Sequence
public Stella_Object nthSetter(Stella_Object value, int position)
public Stella_Object fifthSetter(Stella_Object value)
public Stella_Object fourthSetter(Stella_Object value)
public Stella_Object thirdSetter(Stella_Object value)
public Stella_Object secondSetter(Stella_Object value)
public Stella_Object firstSetter(Stella_Object value)
public Cons rest()
self
.
public Stella_Object last()
self
.
public Stella_Object nth(int position)
self
, or NULL if empty.
position
-
public Stella_Object fifth()
self
, or NULL if empty.
public Stella_Object fourth()
self
, or NULL if empty.
public Stella_Object third()
self
, or NULL if empty.
public Stella_Object second()
self
, or NULL if empty.
public Stella_Object first()
self
, or NULL if empty.
public boolean membP(Stella_Object renamed_Object)
renamed_Object
is a member of the cons list
self
(uses an 'eq?' test).
renamed_Object
-
public boolean memberP(Stella_Object renamed_Object)
renamed_Object
is a member of the list
self
(uses an eqlP
test).
memberP
in class Sequence
renamed_Object
-
public static boolean terminateListP(List self)
public boolean nonEmptyP()
self
has at least one member.
public boolean emptyP()
self
has no members.
public static boolean nullListP(List self)
self
is NULL or the NIL_LIST
.
self
-
public static boolean definedListP(List self)
self
is NULL or the NIL_LIST
.
self
-
public Cons consify()
self
.
consify
in class Stella_Object
public void printObject(java.io.PrintStream stream)
printObject
in class Stella_Object
public static Stella_Object accessListSlotValue(List self, Symbol slotname, Stella_Object value, boolean setvalueP)
public Surrogate primaryType()
Stella_Object
self
.
Gets defined automatically for every non-abstract subclass of OBJECT.
primaryType
in class Stella_Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |