it.unimi.dsi.fastutil.chars
Class AbstractCharList.CharSubList

java.lang.Object
  extended byit.unimi.dsi.fastutil.chars.AbstractCharCollection
      extended byit.unimi.dsi.fastutil.chars.AbstractCharList
          extended byit.unimi.dsi.fastutil.chars.AbstractCharList.CharSubList
All Implemented Interfaces:
CharCollection, CharList, CharStack, Collection, Comparable, List, Serializable, Stack
Enclosing class:
AbstractCharList

public static class AbstractCharList.CharSubList
extends AbstractCharList
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.chars.AbstractCharList
AbstractCharList.CharSubList
 
Constructor Summary
AbstractCharList.CharSubList(CharList l, int from, int to)
           
 
Method Summary
 boolean add(char k)
           
 void add(int index, char k)
           
 boolean addAll(int index, CharCollection c)
          Delegates to a more generic method.
 boolean addAll(int index, CharList l)
          Delegates to a more generic method.
 boolean addAll(int index, Collection c)
           
 void addElements(int index, char[] a, int offset, int length)
          Adds elements to this type-specific list one-by-one.
 CharListIterator charListIterator(int index)
          Returns a type-specific list iterator on the list starting at a given index.
 CharList charSubList(int from, int to)
           
 void clear()
           
 char getChar(int index)
           
 void getElements(int from, char[] a, int offset, int length)
          Copies element of this type-specific list into the given array one-by-one.
 boolean rem(char k)
          Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name.
 char removeChar(int index)
           
 void removeElements(int from, int to)
          Removes elements of this type-specific list one-by-one.
 char set(int index, char k)
           
 int size()
           
 
Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharList
add, addAll, addAll, addAll, addElements, charIterator, charListIterator, compareTo, contains, equals, get, hashCode, indexOf, indexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekChar, pop, popChar, push, push, remove, set, size, subList, top, topChar, toString
 
Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharCollection
add, contains, containsAll, containsAll, isEmpty, iterator, rem, remove, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toCharArray, toCharArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
containsAll, removeAll, retainAll, toArray, toCharArray, toCharArray
 
Methods inherited from interface it.unimi.dsi.fastutil.Stack
isEmpty
 

Constructor Detail

AbstractCharList.CharSubList

public AbstractCharList.CharSubList(CharList l,
                                    int from,
                                    int to)
Method Detail

add

public boolean add(char k)
Specified by:
add in interface CharCollection
Overrides:
add in class AbstractCharList

add

public void add(int index,
                char k)
Specified by:
add in interface CharList
Overrides:
add in class AbstractCharList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractCharList

addAll

public boolean addAll(int index,
                      CharCollection c)
Description copied from class: AbstractCharList
Delegates to a more generic method.

Specified by:
addAll in interface CharList
Overrides:
addAll in class AbstractCharList

addAll

public boolean addAll(int index,
                      CharList l)
Description copied from class: AbstractCharList
Delegates to a more generic method.

Specified by:
addAll in interface CharList
Overrides:
addAll in class AbstractCharList

getChar

public char getChar(int index)
Specified by:
getChar in interface CharList
See Also:
List.get(int)

removeChar

public char removeChar(int index)
Specified by:
removeChar in interface CharList
Overrides:
removeChar in class AbstractCharList

rem

public boolean rem(char k)
Description copied from interface: CharCollection
Note that this method should be called remove(), but the clash with the similarly named index-based method in the List interface forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().

Specified by:
rem in interface CharCollection
Overrides:
rem in class AbstractCharList

set

public char set(int index,
                char k)
Specified by:
set in interface CharList
Overrides:
set in class AbstractCharList

clear

public void clear()
Specified by:
clear in interface List
Overrides:
clear in class AbstractCharCollection

size

public int size()
Specified by:
size in interface List

getElements

public void getElements(int from,
                        char[] a,
                        int offset,
                        int length)
Description copied from class: AbstractCharList
Copies element of this type-specific list into the given array one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
getElements in interface CharList
Overrides:
getElements in class AbstractCharList
Parameters:
from - the start index (inclusive).
a - the destination array.
offset - the offset into the destination array where to store the first element copied.
length - the number of elements to be copied.

removeElements

public void removeElements(int from,
                           int to)
Description copied from class: AbstractCharList
Removes elements of this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
removeElements in interface CharList
Overrides:
removeElements in class AbstractCharList
Parameters:
from - the start index (inclusive).
to - the end index (exclusive).

addElements

public void addElements(int index,
                        char[] a,
                        int offset,
                        int length)
Description copied from class: AbstractCharList
Adds elements to this type-specific list one-by-one.

This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.

Specified by:
addElements in interface CharList
Overrides:
addElements in class AbstractCharList
Parameters:
index - the index at which to add elements.
a - the array containing the elements.
offset - the offset of the first element to add.
length - the number of elements to add.

charListIterator

public CharListIterator charListIterator(int index)
Description copied from interface: CharList
Returns a type-specific list iterator on the list starting at a given index.

The iterator returned by the List.listIterator() method and by this method are identical; however, using this method you can save a type casting.

Specified by:
charListIterator in interface CharList
Overrides:
charListIterator in class AbstractCharList

charSubList

public CharList charSubList(int from,
                            int to)
Specified by:
charSubList in interface CharList
Overrides:
charSubList in class AbstractCharList