org.scijava.util
Class CharArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<BaseType>
          extended by org.scijava.util.AbstractPrimitiveArray<char[],Character>
              extended by org.scijava.util.CharArray
All Implemented Interfaces:
Iterable<Character>, Collection<Character>, List<Character>, PrimitiveArray<char[],Character>, Sizable

public class CharArray
extends AbstractPrimitiveArray<char[],Character>

An extensible array of char elements.

Author:
Mark Hiner, Johannes Schindelin, Curtis Rueden

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CharArray()
          Constructs an extensible array of chars, backed by a fixed-size array.
CharArray(char[] array)
          Constructs an extensible array of chars, backed by the given fixed-size array.
CharArray(int size)
          Constructs an extensible array of chars, backed by a fixed-size array.
 
Method Summary
 void add(int index, Character element)
           
 boolean addAll(int index, Collection<? extends Character> c)
           
 void addValue(char value)
           
 void addValue(int index, char value)
           
 boolean contains(char value)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Character defaultValue()
           
 Character get(int index)
           
 char[] getArray()
          Gets the fixed-size array backing this instance.
 char getValue(int index)
           
 int indexOf(char value)
           
 int indexOf(Object o)
           
 int lastIndexOf(char value)
           
 int lastIndexOf(Object o)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean removeValue(char value)
           
 Character set(int index, Character element)
           
 void setArray(char[] array)
          Sets the fixed-size array backing this instance.
 char setValue(int index, char value)
           
 
Methods inherited from class org.scijava.util.AbstractPrimitiveArray
capacity, checkBounds, clear, copyArray, delete, ensureCapacity, getMaximumGrowth, insert, remove, setMaximumGrowth, setSize, size
 
Methods inherited from class java.util.AbstractList
add, equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, retainAll, subList, toArray, toArray
 

Constructor Detail

CharArray

public CharArray()
Constructs an extensible array of chars, backed by a fixed-size array.


CharArray

public CharArray(int size)
Constructs an extensible array of chars, backed by a fixed-size array.

Parameters:
size - the initial size

CharArray

public CharArray(char[] array)
Constructs an extensible array of chars, backed by the given fixed-size array.

Parameters:
array - the array to wrap
Method Detail

addValue

public void addValue(char value)

removeValue

public boolean removeValue(char value)

getValue

public char getValue(int index)

setValue

public char setValue(int index,
                     char value)

addValue

public void addValue(int index,
                     char value)

indexOf

public int indexOf(char value)

lastIndexOf

public int lastIndexOf(char value)

contains

public boolean contains(char value)

getArray

public char[] getArray()
Description copied from interface: PrimitiveArray
Gets the fixed-size array backing this instance.

Returns:
the backing array

setArray

public void setArray(char[] array)
Description copied from interface: PrimitiveArray
Sets the fixed-size array backing this instance.

Parameters:
array - the new backing array

get

public Character get(int index)
Specified by:
get in interface List<Character>
Specified by:
get in class AbstractList<Character>

set

public Character set(int index,
                     Character element)
Specified by:
set in interface List<Character>
Specified by:
set in class AbstractPrimitiveArray<char[],Character>

add

public void add(int index,
                Character element)
Specified by:
add in interface List<Character>
Specified by:
add in class AbstractPrimitiveArray<char[],Character>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Character>
Overrides:
indexOf in class AbstractList<Character>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Character>
Overrides:
lastIndexOf in class AbstractList<Character>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Character>
Specified by:
contains in interface List<Character>
Overrides:
contains in class AbstractCollection<Character>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Character>
Specified by:
remove in interface List<Character>
Overrides:
remove in class AbstractCollection<Character>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Character>
Specified by:
containsAll in interface List<Character>
Overrides:
containsAll in class AbstractCollection<Character>

addAll

public boolean addAll(int index,
                      Collection<? extends Character> c)
Specified by:
addAll in interface List<Character>
Overrides:
addAll in class AbstractList<Character>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Character>
Specified by:
removeAll in interface List<Character>
Overrides:
removeAll in class AbstractCollection<Character>

defaultValue

public Character defaultValue()


Copyright © 2009–2014 SciJava. All rights reserved.