org.millscript.commons.util.list
Class AbstractEList<V>

java.lang.Object
  extended by org.millscript.commons.util.list.AbstractIList<V>
      extended by org.millscript.commons.util.list.AbstractUList<V>
          extended by org.millscript.commons.util.list.AbstractEList<V>
All Implemented Interfaces:
EList<V>, IList<V>, IMap<java.lang.Integer,V>, UList<V>, UMap<java.lang.Integer,V>
Direct Known Subclasses:
EArrayList, ELinkedList

public abstract class AbstractEList<V>
extends AbstractUList<V>
implements EList<V>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.millscript.commons.util.list.AbstractIList
AbstractIList.ListMapletIterator<V>, AbstractIList.ListMapletList<V>
 
Constructor Summary
AbstractEList()
           
 
Method Summary
 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(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 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 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.
protected abstract  void doDelete(int key, V value)
          Removes the value at the specified position(one based) in the list, but only if it matches the specified one.
protected abstract  void doDeleteKey(int key)
          Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.
protected abstract  void doRemoveSlice(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).
 void insert(java.lang.Integer 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 class org.millscript.commons.util.list.AbstractUList
doUpdate, update, update, update, update0, update0, update0, updateAll
 
Methods inherited from class org.millscript.commons.util.list.AbstractIList
allButFirst, allButLast, allFirst, allLast, contains, contains, contains, contains0, contains0, contains0, containsAll, containsKey, containsKey, containsKey0, containsKey0, containsSlice, containsSlice0, containsValue, decorate, doGet, doSlice, equals, first, get, get, get0, get0, getDefault, hashCode, indexOf0, isEmtpy, keyList, last, mapletList, setDefault, setDefault, sharedMapletList, sharedValueList, slice, slice0, toArray, toArray, toString, valueList
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.millscript.commons.util.EList
addFirst, addLast, deleteAll, deleteFirst, deleteLast, deleteValue, insert
 
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
 

Constructor Detail

AbstractEList

public AbstractEList()
Method Detail

append

public void append(IList<? extends V> list)
Description copied from interface: EList
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?

Specified by:
append in interface EList<V>
Parameters:
list - the list to append to this one
See Also:
EList.append(org.millscript.commons.util.IList)

delete

public void delete(int pos,
                   V value)
Description copied from interface: EList
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.

Specified by:
delete in interface EList<V>
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
See Also:
org.millscript.commons.util.EList#delete(int, V)

delete

public void delete(java.lang.Integer pos,
                   V value)
Description copied from interface: EList
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.

Specified by:
delete in interface EList<V>
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
See Also:
EList.delete(java.lang.Integer, java.lang.Object)

delete

public void delete(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: EList
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.

Specified by:
delete in interface EList<V>
Parameters:
entry - the maplet(one-based indexing) to remove from this list
See Also:
EList.delete(org.millscript.commons.util.Maplet)

delete0

public void delete0(int pos,
                    V value)
Description copied from interface: EList
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.

Specified by:
delete0 in interface EList<V>
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
See Also:
EList.delete0(int, java.lang.Object)

delete0

public void delete0(java.lang.Integer pos,
                    V value)
Description copied from interface: EList
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.

Specified by:
delete0 in interface EList<V>
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
See Also:
EList.delete0(java.lang.Integer, java.lang.Object)

delete0

public void delete0(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: EList
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.

Specified by:
delete0 in interface EList<V>
Parameters:
entry - the maplet(zero-based indexing) to remove from this list
See Also:
EList.delete0(org.millscript.commons.util.Maplet)

deleteAll

public void deleteAll(IList<? extends V> list)
Description copied from interface: EList
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.

Specified by:
deleteAll in interface EList<V>
Parameters:
list - the list whose values to remove from this list
See Also:
EList.deleteAll(org.millscript.commons.util.IList)

deleteKey

public void deleteKey(int key)
Description copied from interface: EList
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Specified by:
deleteKey in interface EList<V>
Parameters:
key - the index(one based) of the value to remove
See Also:
EList.deleteKey(int)

deleteKey

public void deleteKey(java.lang.Integer key)
Description copied from interface: EList
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Specified by:
deleteKey in interface EList<V>
Parameters:
key - the index(one based) of the value to remove
See Also:
EList.deleteKey(java.lang.Integer)

deleteKey0

public void deleteKey0(int key)
Description copied from interface: EList
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Specified by:
deleteKey0 in interface EList<V>
Parameters:
key - the index(one based) of the value to remove
See Also:
EList.deleteKey0(int)

deleteKey0

public void deleteKey0(java.lang.Integer key)
Description copied from interface: EList
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before.

Specified by:
deleteKey0 in interface EList<V>
Parameters:
key - the index(one based) of the value to remove
See Also:
EList.deleteKey0(java.lang.Integer)

deleteSlice

public void deleteSlice(int first,
                        int last)
Description copied from interface: EList
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.

Specified by:
deleteSlice in interface EList<V>
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
See Also:
EList.deleteSlice(int, int)

deleteSlice0

public void deleteSlice0(int first,
                         int last)
Description copied from interface: EList
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.

Specified by:
deleteSlice0 in interface EList<V>
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
See Also:
EList.deleteSlice0(int, int)

doDelete

protected abstract void doDelete(int key,
                                 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. This method is called by the generic doDelete(int, Object) method after the index has been validated. Hence this method should generally not need to perform any further validation.

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

doDeleteKey

protected abstract void doDeleteKey(int key)
Removes the value at the specified index(one based), shifting any subsequent elements to an index one lower than before. This method is called by the generic doDeleteKey(int) method after the index has been validated. Hence this method should generally not need to perform any further validation.

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

doRemoveSlice

protected abstract void doRemoveSlice(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). This method is called by the generic deleteSlice(int, int) method after the index has been validated. Hence this method should generally not need to perform any further validation.

Parameters:
first - the index(one based) of the first element in the slice
last - the index(one based) of the last element in the slice

insert

public void insert(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: EList
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.

Specified by:
insert in interface EList<V>
Parameters:
entry - the maplet to insert into this list
See Also:
EList.insert(org.millscript.commons.util.Maplet)

insert

public void insert(java.lang.Integer pos,
                   V value)
Description copied from interface: EList
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.

Specified by:
insert in interface EList<V>
Parameters:
pos - the position(one based) at which to insert the value
value - the value to insert
See Also:
EList.insert(java.lang.Integer, java.lang.Object)

insert0

public void insert0(int pos,
                    V value)
Description copied from interface: EList
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.

Specified by:
insert0 in interface EList<V>
Parameters:
pos - the position(zero based) at which to insert the value
value - the value to insert
See Also:
EList.insert0(int, java.lang.Object)

insert0

public void insert0(java.lang.Integer pos,
                    V value)
Description copied from interface: EList
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.

Specified by:
insert0 in interface EList<V>
Parameters:
pos - the position(zero based) at which to insert the value
value - the value to insert
See Also:
EList.insert0(java.lang.Integer, java.lang.Object)

insert0

public void insert0(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: EList
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.

Specified by:
insert0 in interface EList<V>
Parameters:
entry - the maplet to insert into this list
See Also:
EList.insert0(org.millscript.commons.util.Maplet)

prefix

public void prefix(IList<? extends V> list)
Description copied from interface: EList
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?

Specified by:
prefix in interface EList<V>
Parameters:
list - the list to prefix to this one
See Also:
EList.prefix(org.millscript.commons.util.IList)


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