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 booleanadd(K o)Always throws an UnsupportedOperationExceptionbooleanaddAll(Collection<? extends K> c)Always throws an UnsupportedOperationException.voidclear()booleancontains(Object o)Delegates to the corresponding type-specific method.booleancontainsAll(Collection<?> c)Checks whether this collection contains all elements from the given type-specific collection.booleanequals(Object o)Kfirst()Kget(int index)booleanisEmpty()MultiArrangement.KeyIteratoriterator()Klast()booleanremove(Object ok)Always throws an UnsupportedOperationExceptionbooleanremoveAll(Collection<?> c)Remove from this collection all elements in the given type-specific collection.booleanretainAll(Collection<?> c)Retains in this collection only elements from the given type-specific collection.intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()intunwrap(MultiArrangement.KeyIterator i, Object[] array)Unwraps an iterator into an array.intunwrap(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:
sizein interfaceCollection<K>- Specified by:
sizein interfaceList<K>- Specified by:
sizein classAbstractCollection<K>
-
clear
- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceList<K>- Overrides:
clearin classAbstractList<K>
-
first
-
last
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Specified by:
toArrayin interfaceList<K>- Overrides:
toArrayin classAbstractCollection<K>
-
remove
Always throws an UnsupportedOperationException- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceList<K>- Overrides:
removein classAbstractCollection<K>
-
add
Always throws an UnsupportedOperationException- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceList<K>- Overrides:
addin classAbstractList<K>
-
get
- Specified by:
getin interfaceList<K>- Specified by:
getin classAbstractList<K>- Parameters:
index-- Throws:
IndexOutOfBoundsException
-
contains
Delegates to the corresponding type-specific method.- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceList<K>- Overrides:
containsin classAbstractCollection<K>
-
containsAll
Checks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceCollection<K>- Specified by:
containsAllin interfaceList<K>- Overrides:
containsAllin classAbstractCollection<K>- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.
-
retainAll
Retains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceCollection<K>- Specified by:
retainAllin interfaceList<K>- Overrides:
retainAllin classAbstractCollection<K>- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.
-
removeAll
Remove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceCollection<K>- Specified by:
removeAllin interfaceList<K>- Overrides:
removeAllin classAbstractCollection<K>- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Specified by:
toArrayin interfaceList<K>- Overrides:
toArrayin classAbstractCollection<K>
-
addAll
Always throws an UnsupportedOperationException.- Specified by:
addAllin interfaceCollection<K>- Specified by:
addAllin interfaceList<K>- Overrides:
addAllin classAbstractCollection<K>- Parameters:
c- disregarded; always throws Exception- Returns:
- nothing; always throws Exception
-
equals
- Specified by:
equalsin interfaceCollection<K>- Specified by:
equalsin interfaceList<K>- Overrides:
equalsin 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 thanmaxif the iterator emits less thanmaxelements).- 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:
isEmptyin interfaceCollection<K>- Specified by:
isEmptyin interfaceList<K>- Overrides:
isEmptyin classAbstractCollection<K>
-
toString
- Overrides:
toStringin classAbstractCollection<K>
-