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
public abstract class UnsupportedList<T> extends Object implements List<T>
Implementation ofList
where all methods throw an UnsupportedOperationException exception except for theisEmpty
method. Theiterator
andlistIterator
methods can be easily implemented in derived classes by using the helper inner classes:Itr
andListItr
. These iterators are all read only, theirremove
,add
andset
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
Nested Classes Modifier and Type Class Description protected class
UnsupportedList.Itr
protected class
UnsupportedList.ItrUnknownSize
Iterator for arrays of a priori unknown size.protected class
UnsupportedList.ListItr
-
Constructor Summary
Constructors Modifier Constructor Description protected
UnsupportedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
boolean
add(T o)
boolean
addAll(int index, Collection<? extends T> c)
boolean
addAll(Collection<? extends T> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object o)
T
get(int index)
int
hashCode()
int
indexOf(Object o)
boolean
isEmpty()
Iterator<T>
iterator()
int
lastIndexOf(Object o)
ListIterator<T>
listIterator()
ListIterator<T>
listIterator(int index)
T
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
T
set(int index, T element)
int
size()
List<T>
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
-
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
toArray
public Object[] toArray()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<T>
-
contains
public boolean contains(Object o)
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(T o)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
clear
public void clear()
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
listIterator
public ListIterator<T> listIterator()
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
public ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in interfaceList<T>
-
-