Package mondrian.util
Class UnsupportedList<T>
java.lang.Object
mondrian.util.UnsupportedList<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
- Direct Known Subclasses:
TraversalList
Implementation of
List
where all methods throw
an UnsupportedOperationException exception except for the
isEmpty
method. The iterator
and
listIterator
methods can be easily implemented in
derived classes by using the helper inner classes:
Itr
and ListItr
.
These iterators are all read only,
their remove
, add
and set
methods throw the
UnsupportedOperationException exception.
This class can be used for List implementations that only implement a subset of all the methods.
- Since:
- Jan 16, 2007
- Author:
- Richard Emberson
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
Iterator for arrays of a priori unknown size.protected class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends T> c) boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
get
(int index) int
hashCode()
int
boolean
isEmpty()
iterator()
int
listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
subList
(int fromIndex, int toIndex) Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
UnsupportedList
protected UnsupportedList()
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
size
public int size() -
get
-
set
-
toArray
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
-
subList
-
contains
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
iterator
-