|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.commons.util.list.AbstractIList<V>
org.millscript.commons.util.list.IDynamicList<V>
public class IDynamicList<V>
This class implements an immutable dynamic list whose values are calculated on demand.
| Nested Class Summary | |
|---|---|
static class |
IDynamicList.DynamicListIterator<V>
This class implements a list iterator which is backed by a dynamic linked list. |
static class |
IDynamicList.ISharedDynamicList<V>
This class implements a list which is backed by a shared slice of a dynamic linked list. |
static class |
IDynamicList.ListEntry<V>
This class represents an entry in a dynamic list. |
static class |
IDynamicList.SharedDynamicListIterator<V>
This class implements a iterator which is backed by a shared slice of a dynamic linked list, but has a fixed number of values rather than all of them. |
| Nested classes/interfaces inherited from class org.millscript.commons.util.list.AbstractIList |
|---|
AbstractIList.ListMapletIterator<V>, AbstractIList.ListMapletList<V> |
| Constructor Summary | |
|---|---|
IDynamicList(IDynamicList.ListEntry<V> first)
Constructs a new |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
boolean |
contains(int key,
V value)
Returns true if this list contains the specified value at
the specified position(one based) in the list. |
boolean |
containsKey(int pos)
Returns true if the specified position(one based) is valid
in this list. |
boolean |
containsSlice(int first,
int last)
Returns true if the specified slice is within the bounds
of the list. |
protected V |
doGet(int pos)
Returns the value at the specified position(one based) in the list. |
protected IList<V> |
doSlice(int first,
int last,
boolean share)
Returns a list containing a slice of the elements in this list, starting at first(one based, inclusive) and continuing
last(one based, inclusive). |
V |
first()
Returns the first item from this list. |
V |
get(int pos)
Returns the element at the specified position(one based) in this list. |
IDynamicList.ListEntry<V> |
getEntry(int pos)
Returns the list entry for the specified index(one based). |
int |
indexOf(V value)
Returns the index(one based) of the first occurance of the specified object in this list. |
boolean |
isEmtpy()
Returns true if this map has no mappings. |
ListIterator<V> |
iterator(boolean share)
Returns an iterator over the values in this list and their respective position. |
V |
last()
Returns the last item from this list. |
int |
size()
Returns the number of mappings defined in this map. |
IList<V> |
slice(int first,
int last,
boolean share)
Returns a list containing a slice of the elements in this list, starting at first(one based, inclusive) and continuing
last(one based, inclusive). |
| Methods inherited from class org.millscript.commons.util.list.AbstractIList |
|---|
allButFirst, allButLast, allFirst, allLast, contains, contains, contains0, contains0, contains0, containsAll, containsKey, containsKey0, containsKey0, containsSlice0, containsValue, decorate, equals, get, get0, get0, getDefault, hashCode, indexOf0, keyList, mapletList, setDefault, setDefault, sharedMapletList, sharedValueList, slice0, toArray, toArray, toString, valueList |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IDynamicList(IDynamicList.ListEntry<V> first)
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()
public boolean contains(int key,
V value)
IListtrue if this list contains the specified value at
the specified position(one based) in the list.
contains in interface IList<V>contains in class AbstractIList<V>key - the index(one based) of the object whose presence to testvalue - the value which must match that stored at the specified
position(one based) in the list
true if this list contains the specified value at
the specified position(one based)IList.contains(int, java.lang.Object)public boolean containsKey(int pos)
IListtrue if the specified position(one based) is valid
in this list. The position would be valid if it is suchthat
1 <= pos <= size().
containsKey in interface IList<V>containsKey in class AbstractIList<V>true if the specified position(one based) is valid
in this listIList.containsKey(int)
public boolean containsSlice(int first,
int last)
IListtrue if the specified slice is within the bounds
of the list.
containsSlice in interface IList<V>containsSlice in class AbstractIList<V>first - the index(one based) of the first element in the slicelast - the index(one based) of the last element in the slice
true if the specified slice indicies are within
the bounds of this list and false otherwiseIList.containsSlice(int, int)protected V doGet(int pos)
AbstractIListAbstractIList.get(int) method after the index
has been validated. Hence this method should generally not need to
perform any further validation.
doGet in class AbstractIList<V>pos - the index(one based) of the value to return
AbstractIList.doGet(int)
protected IList<V> doSlice(int first,
int last,
boolean share)
AbstractIListfirst(one based, inclusive) and continuing
last(one based, inclusive). This method is called by the
generic #slice(int, int) method after the indices have been
validated. Hence, this method assumes that the specified indices are
within the bounds of the list and that the first index is less than or
equal to the last index. The case where the first index is greater than
the last is handled elsewhere.
doSlice in class AbstractIList<V>first - the index(one based) of the first element in the slicelast - the index(one based) of the last element in the sliceshare - if true the specified object array will be
shared otherwise the array will be copied.
AbstractIList.doSlice(int, int, boolean)public V first()
IList
first in interface IList<V>first in class AbstractIList<V>IList.first()public V get(int pos)
IList
get in interface IList<V>get in class AbstractIList<V>pos - index of the element to return(one based)
IList.get(int)public IDynamicList.ListEntry<V> getEntry(int pos)
pos - the index(one based) of the required list entry
public int indexOf(V value)
IList
indexOf in interface IList<V>value - the value to find
IList.indexOf(java.lang.Object)public boolean isEmtpy()
IMaptrue if this map has no mappings.
isEmtpy in interface IMap<java.lang.Integer,V>isEmtpy in class AbstractIList<V>true if this map contains no mappingsIMap.isEmtpy()public ListIterator<V> iterator(boolean share)
IList
iterator in interface IList<V>iterator in interface IMap<java.lang.Integer,V>share - if true this instances backing store should be
shared with the returned list, otherwise any backing store will be copied.
IMap.iterator(boolean)public V last()
IList
last in interface IList<V>last in class AbstractIList<V>IList.last()public int size()
IMap
size in interface IMap<java.lang.Integer,V>IMap.size()
public IList<V> slice(int first,
int last,
boolean share)
IListfirst(one based, inclusive) and continuing
last(one based, inclusive).
slice in interface IList<V>slice in class AbstractIList<V>first - the index(one based) of the first element in the slicelast - the index(one based) of the last element in the sliceshare - if true this instances backing store should be
shared with the returned list, otherwise any backing store will be copied.
IList.slice(int, int, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||