Package squidpony.squidmath
Class MultiArrangement.KeyList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<K>
squidpony.squidmath.MultiArrangement.KeyList
- All Implemented Interfaces:
Serializable
,Iterable<K>
,Collection<K>
,List<K>
- Enclosing class:
- MultiArrangement<K>
public final class MultiArrangement.KeyList extends AbstractList<K> implements Serializable
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description KeyList()
-
Method Summary
Modifier and Type Method Description boolean
add(K o)
Always throws an UnsupportedOperationExceptionboolean
addAll(Collection<? extends K> c)
Always throws an UnsupportedOperationException.void
clear()
boolean
contains(Object o)
Delegates to the corresponding type-specific method.boolean
containsAll(Collection<?> c)
Checks whether this collection contains all elements from the given type-specific collection.boolean
equals(Object o)
K
first()
K
get(int index)
boolean
isEmpty()
MultiArrangement.KeyIterator
iterator()
K
last()
boolean
remove(Object ok)
Always throws an UnsupportedOperationExceptionboolean
removeAll(Collection<?> c)
Remove from this collection all elements in the given type-specific collection.boolean
retainAll(Collection<?> c)
Retains in this collection only elements from the given type-specific collection.int
size()
Object[]
toArray()
<T> T[]
toArray(T[] a)
String
toString()
int
unwrap(MultiArrangement.KeyIterator i, Object[] array)
Unwraps an iterator into an array.int
unwrap(MultiArrangement.KeyIterator i, Object[] array, int offset, int max)
Unwraps an iterator into an array starting at a given offset for a given number of elements.Methods inherited from class java.util.AbstractList
add, addAll, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Constructor Details
-
Method Details
-
iterator
-
size
- Specified by:
size
in interfaceCollection<K>
- Specified by:
size
in interfaceList<K>
- Specified by:
size
in classAbstractCollection<K>
-
clear
- Specified by:
clear
in interfaceCollection<K>
- Specified by:
clear
in interfaceList<K>
- Overrides:
clear
in classAbstractList<K>
-
first
-
last
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
- Specified by:
toArray
in interfaceList<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
remove
Always throws an UnsupportedOperationException- Specified by:
remove
in interfaceCollection<K>
- Specified by:
remove
in interfaceList<K>
- Overrides:
remove
in classAbstractCollection<K>
-
add
Always throws an UnsupportedOperationException- Specified by:
add
in interfaceCollection<K>
- Specified by:
add
in interfaceList<K>
- Overrides:
add
in classAbstractList<K>
-
get
- Specified by:
get
in interfaceList<K>
- Specified by:
get
in classAbstractList<K>
- Parameters:
index
-- Throws:
IndexOutOfBoundsException
-
contains
Delegates to the corresponding type-specific method.- Specified by:
contains
in interfaceCollection<K>
- Specified by:
contains
in interfaceList<K>
- Overrides:
contains
in classAbstractCollection<K>
-
containsAll
Checks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAll
in interfaceCollection<K>
- Specified by:
containsAll
in interfaceList<K>
- Overrides:
containsAll
in classAbstractCollection<K>
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection contains all elements of the argument.
-
retainAll
Retains in this collection only elements from the given type-specific collection.- Specified by:
retainAll
in interfaceCollection<K>
- Specified by:
retainAll
in interfaceList<K>
- Overrides:
retainAll
in classAbstractCollection<K>
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection changed as a result of the call.
-
removeAll
Remove from this collection all elements in the given type-specific collection.- Specified by:
removeAll
in interfaceCollection<K>
- Specified by:
removeAll
in interfaceList<K>
- Overrides:
removeAll
in classAbstractCollection<K>
- Parameters:
c
- a type-specific collection.- Returns:
true
if this collection changed as a result of the call.
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
- Specified by:
toArray
in interfaceList<K>
- Overrides:
toArray
in classAbstractCollection<K>
-
addAll
Always throws an UnsupportedOperationException.- Specified by:
addAll
in interfaceCollection<K>
- Specified by:
addAll
in interfaceList<K>
- Overrides:
addAll
in classAbstractCollection<K>
- Parameters:
c
- disregarded; always throws Exception- Returns:
- nothing; always throws Exception
-
equals
- Specified by:
equals
in interfaceCollection<K>
- Specified by:
equals
in interfaceList<K>
- Overrides:
equals
in classAbstractList<K>
-
unwrap
Unwraps an iterator into an array starting at a given offset for a given number of elements.This method iterates over the given type-specific iterator and stores the elements returned, up to a maximum of
length
, in the given array starting atoffset
. The number of actually unwrapped elements is returned (it may be less thanmax
if the iterator emits less thanmax
elements).- Parameters:
i
- a type-specific iterator.array
- an array to contain the output of the iterator.offset
- the first element of the array to be returned.max
- the maximum number of elements to unwrap.- Returns:
- the number of elements unwrapped.
-
unwrap
Unwraps an iterator into an array.This method iterates over the given type-specific iterator and stores the elements returned in the given array. The iteration will stop when the iterator has no more elements or when the end of the array has been reached.
- Parameters:
i
- a type-specific iterator.array
- an array to contain the output of the iterator.- Returns:
- the number of elements unwrapped.
-
isEmpty
- Specified by:
isEmpty
in interfaceCollection<K>
- Specified by:
isEmpty
in interfaceList<K>
- Overrides:
isEmpty
in classAbstractCollection<K>
-
toString
- Overrides:
toString
in classAbstractCollection<K>
-