- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<BaseType>
-
- org.scijava.collections.AbstractPrimitiveArray<char[],Character>
-
- org.scijava.collections.CharArray
-
- All Implemented Interfaces:
Iterable<Character>,Collection<Character>,List<Character>,PrimitiveArray<char[],Character>
public class CharArray extends AbstractPrimitiveArray<char[],Character>
An extensible array ofcharelements.- Author:
- Mark Hiner, Johannes Schindelin, Curtis Rueden
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Character element)booleanaddAll(int index, Collection<? extends Character> c)voidaddValue(char value)voidaddValue(int index, char value)booleancontains(char value)booleancontains(Object o)booleancontainsAll(Collection<?> c)CharacterdefaultValue()Characterget(int index)char[]getArray()Gets the fixed-size array backing this instance.chargetValue(int index)intindexOf(char value)intindexOf(Object o)intlastIndexOf(char value)intlastIndexOf(Object o)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoveValue(char value)Characterset(int index, Character element)voidsetArray(char[] array)Sets the fixed-size array backing this instance.charsetValue(int index, char value)-
Methods inherited from class org.scijava.collections.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.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, addAll, equals, hashCode, isEmpty, iterator, listIterator, listIterator, replaceAll, retainAll, sort, spliterator, 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:PrimitiveArrayGets the fixed-size array backing this instance.- Returns:
- the backing array
-
setArray
public void setArray(char[] array)
Description copied from interface:PrimitiveArraySets the fixed-size array backing this instance.- Parameters:
array- the new backing array
-
get
public Character get(int index)
-
add
public void add(int index, Character element)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Character>- Overrides:
lastIndexOfin classAbstractList<Character>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Character>- Specified by:
containsin interfaceList<Character>- Overrides:
containsin classAbstractCollection<Character>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Character>- Specified by:
removein interfaceList<Character>- Overrides:
removein classAbstractCollection<Character>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Character>- Specified by:
containsAllin interfaceList<Character>- Overrides:
containsAllin classAbstractCollection<Character>
-
addAll
public boolean addAll(int index, Collection<? extends Character> c)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Character>- Specified by:
removeAllin interfaceList<Character>- Overrides:
removeAllin classAbstractCollection<Character>
-
defaultValue
public Character defaultValue()
-
-