org.millscript.commons.util
Interface EList<V>

All Superinterfaces:
IList<V>, IMap<java.lang.Integer,V>, UList<V>, UMap<java.lang.Integer,V>
All Known Implementing Classes:
AbstractEList, EArrayList, ELinkedList

public interface EList<V>
extends UList<V>

This interface describes an extensible list, one which can have values inserted, removed and changed. TODO - Should the remove methods throw an ListIndexOutOfBounds alert if the specified index is out of bounds, or just silently ignore it as the item was never in the list in the first place? -> Yes they should, this is a StrictMap which requires that you use an key that is present in the mapping.


Method Summary
 void addFirst(V value)
          Adds the specified value to the begining of this list.
 void addLast(V value)
          Adds the specified value to the end of this list.
 void append(IList<? extends V> list)
          Appends the specified list to this list.
 void delete(java.lang.Integer pos, V value)
          Removes the value at the specified position(one based) in the list, but only if it matches the specified one.
 void delete(int pos, V value)
          Removes the value at the specified position(one based) in the list, but only if it matches the specified one.
 void delete(Maplet<? extends java.lang.Integer,? extends V> entry)
          Removes the specified mapping from this list, shifting any subsequent elements to an index one lower than before.
 void delete0(java.lang.Integer pos, V value)
          Removes the value at the specified position(zero based) in the list, but only if it matches the specified one.
 void delete0(int pos, V value)
          Removes the value at the specified position(zero based) in the list, but only if it matches the specified one.
 void delete0(Maplet<? extends java.lang.Integer,? extends V> entry)
          Removes the specified mapping from this list, shifting any subsequent elements to an index one lower than before.
 void deleteAll()
          Removes all the mappings from this list.
 void deleteAll(IList<? extends V> list)
          Removes all the values in the specified list from this one, for each deletion shifting any subsequent elements to an index one lower than before.
 void deleteFirst()
          Removes the first element from the list.
 void deleteKey(int key)
          Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.
 void deleteKey(java.lang.Integer key)
          Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.
 void deleteKey0(int key)
          Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.
 void deleteKey0(java.lang.Integer key)
          Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.
 void deleteLast()
          Removes the last element from the list.
 void deleteSlice(int first, int last)
          Removes the specified slice of elements in this list, starting at first(one based, inclusive) and continuing last(one based, inclusive), shifting any subsequent elements to a lowest available index.
 void deleteSlice0(int first, int last)
          Removes the specified slice of elements in this list, starting at first(zero based, inclusive) and continuing last(zero based, inclusive), shifting any subsequent elements to a lowest available index.
 void deleteValue(V value)
          Removes all elements from this list which are equal to the specified value.
 void insert(java.lang.Integer pos, V value)
          Inserts the specified value at the given position(one based) in this list.
 void insert(int pos, V value)
          Inserts the specified value at the given position(one based) in this list.
 void insert(Maplet<? extends java.lang.Integer,? extends V> entry)
          Inserts the specified maplet into this list.
 void insert0(java.lang.Integer pos, V value)
          Inserts the specified value at the given position(zero based) in this list.
 void insert0(int pos, V value)
          Inserts the specified value at the given position(zero based) in this list.
 void insert0(Maplet<? extends java.lang.Integer,? extends V> entry)
          Inserts the specified maplet into this list.
 void prefix(IList<? extends V> list)
          Prefixes this list with the specified one.
 
Methods inherited from interface org.millscript.commons.util.UList
update, update, update, update0, update0, update0
 
Methods inherited from interface org.millscript.commons.util.IList
allButFirst, allButLast, allFirst, allLast, contains, contains, contains0, contains0, contains0, containsKey, containsKey, containsKey0, containsKey0, containsSlice, containsSlice0, first, get, get, get0, get0, getDefault, indexOf, indexOf0, iterator, last, setDefault, slice, slice0, toArray, toArray
 
Methods inherited from interface org.millscript.commons.util.IMap
contains, containsAll, containsValue, equals, hashCode, isEmtpy, keyList, mapletList, setDefault, size, valueList
 
Methods inherited from interface org.millscript.commons.util.UMap
updateAll
 
Methods inherited from interface org.millscript.commons.util.IMap
contains, containsAll, containsValue, equals, hashCode, isEmtpy, keyList, mapletList, setDefault, size, valueList
 

Method Detail

addFirst

void addFirst(V value)
Adds the specified value to the begining of this list.

Parameters:
value - the value to add to the begining of the list

addLast

void addLast(V value)
Adds the specified value to the end of this list.

Parameters:
value - the value to add to the end of the list

append

void append(IList<? extends V> list)
Appends the specified list to this list. TODO - Should this return a new list of a similar immutable or mutable type? e.g. is it an IList or EList operation and does it modify this list if it can?

Parameters:
list - the list to append to this one

delete

void delete(int pos,
            V value)
Removes the value at the specified position(one based) in the list, but only if it matches the specified one. If the element is sucessfully deleted, any subsequent elements are shifted to an index one lower than before.

Parameters:
pos - the index(one based) of the object to remove
value - the value which must match that stored at the specified position(one based) in the list

delete

void delete(java.lang.Integer pos,
            V value)
Removes the value at the specified position(one based) in the list, but only if it matches the specified one. If the element is sucessfully deleted, any subsequent elements are shifted to an index one lower than before.

Parameters:
pos - the index(one based) of the object to remove
value - the value which must match that stored at the specified position(one based) in the list

delete

void delete(Maplet<? extends java.lang.Integer,? extends V> entry)
Removes the specified mapping from this list, shifting any subsequent elements to an index one lower than before. For this removal to be successful the specified mapping must exist in this list, i.e. it the key-value pair must match an index-value pair in this list.

Parameters:
entry - the maplet(one-based indexing) to remove from this list

delete0

void delete0(int pos,
             V value)
Removes the value at the specified position(zero based) in the list, but only if it matches the specified one. If the element is sucessfully deleted, any subsequent elements are shifted to an index one lower than before.

Parameters:
pos - the index(zero based) of the object to remove
value - the value which must match that stored at the specified position(zero based) in the list

delete0

void delete0(java.lang.Integer pos,
             V value)
Removes the value at the specified position(zero based) in the list, but only if it matches the specified one. If the element is sucessfully deleted, any subsequent elements are shifted to an index one lower than before.

Parameters:
pos - the index(zero based) of the object to remove
value - the value which must match that stored at the specified position(zero based) in the list

delete0

void delete0(Maplet<? extends java.lang.Integer,? extends V> entry)
Removes the specified mapping from this list, shifting any subsequent elements to an index one lower than before. For this removal to be successful the specified mapping must exist in this list, i.e. it the key-value pair must match an index-value pair in this list.

Parameters:
entry - the maplet(zero-based indexing) to remove from this list

deleteAll

void deleteAll()
Removes all the mappings from this list.


deleteAll

void deleteAll(IList<? extends V> list)
Removes all the values in the specified list from this one, for each deletion shifting any subsequent elements to an index one lower than before. i.e. the ordering of the list is preserved.

Parameters:
list - the list whose values to remove from this list

deleteFirst

void deleteFirst()
Removes the first element from the list.


deleteKey

void deleteKey(int key)
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Parameters:
key - the index(one based) of the value to remove

deleteKey

void deleteKey(java.lang.Integer key)
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Parameters:
key - the index(one based) of the value to remove

deleteKey0

void deleteKey0(int key)
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Parameters:
key - the index(one based) of the value to remove

deleteKey0

void deleteKey0(java.lang.Integer key)
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Parameters:
key - the index(one based) of the value to remove

deleteLast

void deleteLast()
Removes the last element from the list.


deleteSlice

void deleteSlice(int first,
                 int last)
Removes the specified slice of elements in this list, starting at first(one based, inclusive) and continuing last(one based, inclusive), shifting any subsequent elements to a lowest available index.

If the last index is less than the first, nothing will be removed.

Parameters:
first - the index(one based, inclusive) of the first element in the slice
last - the index(one based, inclusive) of the last element in the slice, must be equal to or greater than first for anything to be removed

deleteSlice0

void deleteSlice0(int first,
                  int last)
Removes the specified slice of elements in this list, starting at first(zero based, inclusive) and continuing last(zero based, inclusive), shifting any subsequent elements to a lowest available index.

If the last index is less than the first, nothing will be removed.

Parameters:
first - the index(zero based, inclusive) of the first element in the slice
last - the index(zero based, inclusive) of the last element in the slice, must be equal to or greater than first for anything to be removed

deleteValue

void deleteValue(V value)
Removes all elements from this list which are equal to the specified value.

Parameters:
value - the value to remove from this list

insert

void insert(int pos,
            V value)
Inserts the specified value at the given position(one based) in this list. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
pos - the position(one based) at which to insert the value
value - the value to insert

insert

void insert(java.lang.Integer pos,
            V value)
Inserts the specified value at the given position(one based) in this list. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
pos - the position(one based) at which to insert the value
value - the value to insert

insert

void insert(Maplet<? extends java.lang.Integer,? extends V> entry)
Inserts the specified maplet into this list. The maplet key is the position(one based) to insert in this list and the maplet value is the value to insert at that position. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
entry - the maplet to insert into this list
value - the value to insert

insert0

void insert0(int pos,
             V value)
Inserts the specified value at the given position(zero based) in this list. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
pos - the position(zero based) at which to insert the value
value - the value to insert

insert0

void insert0(java.lang.Integer pos,
             V value)
Inserts the specified value at the given position(zero based) in this list. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
pos - the position(zero based) at which to insert the value
value - the value to insert

insert0

void insert0(Maplet<? extends java.lang.Integer,? extends V> entry)
Inserts the specified maplet into this list. The maplet key is the position(zero based) to insert in this list and the maplet value is the value to insert at that position. Any subsequent values will be shifted to an index one higher than they were before this operation.

Parameters:
entry - the maplet to insert into this list
value - the value to insert

prefix

void prefix(IList<? extends V> list)
Prefixes this list with the specified one. TODO - Should this return a new list of a similar immutable or mutable type? e.g. is it an IList or EList operation and does it modify this list if it can?

Parameters:
list - the list to prefix to this one


Copyright © 2005-2007 Open World Ltd. All Rights Reserved.