|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.commons.util.list.AbstractIList<java.lang.Character>
org.millscript.commons.util.list.IStringList
public class IStringList
This class provides an immutable List implementation which is
backed by a String(i.e. a list of characters).
| Nested Class Summary | |
|---|---|
static class |
IStringList.StringListIterator
This class provides a map interator implementation which iterates over the characters in a string and their position in the string. |
| Nested classes/interfaces inherited from class org.millscript.commons.util.list.AbstractIList |
|---|
AbstractIList.ListMapletIterator<V>, AbstractIList.ListMapletList<V> |
| Constructor Summary | |
|---|---|
IStringList()
Constructs a new empty immutable string list. |
|
IStringList(java.lang.String string)
Constructs a new immutable string list with the specified backing string. |
|
IStringList(java.lang.String string,
int start,
int end)
Constructs a new immutable string list with a copy of the specified backing string, starting and ending at the specified indices. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
protected java.lang.Character |
doGet(int pos)
Returns the value at the specified position(one based) in the list. |
protected IList<java.lang.Character> |
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). |
int |
indexOf(java.lang.Character value)
Returns the index(one based) of the first occurance of the specified object in this list. |
ListIterator<java.lang.Character> |
iterator(boolean share)
Returns an iterator over the values in this list and their respective position. |
int |
size()
Returns the number of mappings defined in this 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, 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 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IStringList()
public IStringList(java.lang.String string)
objects - the backing string
public IStringList(java.lang.String string,
int start,
int end)
objects - the backing string to copystart - the index of the first element in the sliceend - the index of the last element in the slice. If end <
start, the new list will be empty| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()protected java.lang.Character 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<java.lang.Character>pos - the index(one based) of the value to return
AbstractIList.doGet(int)
protected IList<java.lang.Character> 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<java.lang.Character>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 int indexOf(java.lang.Character value)
IList
indexOf in interface IList<java.lang.Character>value - the value to find
IList.indexOf(java.lang.Object)public ListIterator<java.lang.Character> iterator(boolean share)
IList
iterator in interface IList<java.lang.Character>iterator in interface IMap<java.lang.Integer,java.lang.Character>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 int size()
IMap
size in interface IMap<java.lang.Integer,java.lang.Character>IMap.size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||