Package mondrian.util
Class UnsupportedList<T>
- java.lang.Object
-
- mondrian.util.UnsupportedList<T>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
- Direct Known Subclasses:
TraversalList
public abstract class UnsupportedList<T> extends java.lang.Object implements java.util.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, java.util.Collection<? extends T> c)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object o)
T
get(int index)
int
hashCode()
int
indexOf(java.lang.Object o)
boolean
isEmpty()
java.util.Iterator<T>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<T>
listIterator()
java.util.ListIterator<T>
listIterator(int index)
T
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
T
set(int index, T element)
int
size()
java.util.List<T>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
toArray
public java.lang.Object[] toArray()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<T>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<T>
-
subList
public java.util.List<T> subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfacejava.util.List<T>
-
contains
public boolean contains(java.lang.Object o)
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(T o)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.List<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
clear
public void clear()
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<T>
-
-