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

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

public abstract class AbstractUList<V>
extends AbstractIList<V>
implements UList<V>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.millscript.commons.util.list.AbstractIList
AbstractIList.ListMapletIterator<V>, AbstractIList.ListMapletList<V>
 
Constructor Summary
AbstractUList()
           
 
Method Summary
protected abstract  void doUpdate(int key, V value)
          Updates the value at the specified index(one based) with that specified.
 void update(java.lang.Integer key, V value)
          Updates the value at the specified index(one based) with that specified.
 void update(int key, V value)
          Updates the value at the specified index(one based) with that specified.
 void update(Maplet<? extends java.lang.Integer,? extends V> entry)
          Updates this list using the specified mapping, changing the value at the index represeted by the maplets key(one based) to the maplets value.
 void update0(java.lang.Integer key, V value)
          Updates the value at the specified index(zero based) with that specified.
 void update0(int key, V value)
          Updates the value at the specified index(zero based) with that specified.
 void update0(Maplet<? extends java.lang.Integer,? extends V> entry)
          Updates this list using the specified mapping, changing the value at the index represeted by the maplets key(zero based) to the maplets value.
 void updateAll(IMap<? extends java.lang.Integer,? extends V> map)
          Updates all the mappings in this map with those in the specified map.
 
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.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.IMap
contains, containsAll, containsValue, equals, hashCode, isEmtpy, keyList, mapletList, setDefault, size, valueList
 

Constructor Detail

AbstractUList

public AbstractUList()
Method Detail

doUpdate

protected abstract void doUpdate(int key,
                                 V value)
Updates the value at the specified index(one based) with that specified. This method is called by the generic update(int, Object) 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 update
value - the new value for the specified index

update

public void update(int key,
                   V value)
Description copied from interface: UList
Updates the value at the specified index(one based) with that specified.

Specified by:
update in interface UList<V>
Parameters:
key - the index(one based) of the value to update
value - the new value for the element
See Also:
UList.update(int, java.lang.Object)

update

public void update(java.lang.Integer key,
                   V value)
Description copied from interface: UList
Updates the value at the specified index(one based) with that specified.

Specified by:
update in interface UList<V>
Specified by:
update in interface UMap<java.lang.Integer,V>
Parameters:
key - the index(one based) of the value to update
value - the new value for the element
See Also:
UList.update(java.lang.Integer, java.lang.Object)

update

public void update(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: UList
Updates this list using the specified mapping, changing the value at the index represeted by the maplets key(one based) to the maplets value. The map implementation may retain a reference to the given maplet as necessary.

This is generally equivalent to the following code, but may be more efficient in some implementations:


 someUMap.update( entry.getKey(), entry.getValue() );
 

Specified by:
update in interface UList<V>
Specified by:
update in interface UMap<java.lang.Integer,V>
Parameters:
entry - the maplet to update this list with
See Also:
UMap.update(org.millscript.commons.util.Maplet)

update0

public void update0(int key,
                    V value)
Description copied from interface: UList
Updates the value at the specified index(zero based) with that specified.

Specified by:
update0 in interface UList<V>
Parameters:
key - the index(zero based) of the value to update
value - the new value for the element
See Also:
UList.update0(int, java.lang.Object)

update0

public void update0(java.lang.Integer key,
                    V value)
Description copied from interface: UList
Updates the value at the specified index(zero based) with that specified.

Specified by:
update0 in interface UList<V>
Parameters:
key - the index(zero based) of the value to update
value - the new value for the element
See Also:
UList.update0(java.lang.Integer, java.lang.Object)

update0

public void update0(Maplet<? extends java.lang.Integer,? extends V> entry)
Description copied from interface: UList
Updates this list using the specified mapping, changing the value at the index represeted by the maplets key(zero based) to the maplets value. The map implementation may retain a reference to the given maplet as necessary.

This is generally equivalent to the following code, but may be more efficient in some implementations:


 someUMap.update0( entry.getKey(), entry.getValue() );
 

Specified by:
update0 in interface UList<V>
Parameters:
entry - the maplet to update this list with
See Also:
UList.update0(org.millscript.commons.util.Maplet)

updateAll

public void updateAll(IMap<? extends java.lang.Integer,? extends V> map)
Description copied from interface: UMap
Updates all the mappings in this map with those in the specified map.

Specified by:
updateAll in interface UMap<java.lang.Integer,V>
Parameters:
map - the map to copy all mappings from
See Also:
UMap.updateAll(org.millscript.commons.util.IMap)


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