PCJ API
Version 1.2

bak.pcj.list
Class UnmodifiableLongList

java.lang.Object
  extended bybak.pcj.UnmodifiableLongCollection
      extended bybak.pcj.list.UnmodifiableLongList
All Implemented Interfaces:
LongCollection, LongList

public class UnmodifiableLongList
extends UnmodifiableLongCollection
implements LongList

This class represents unmodifiable lists of long values.

Since:
1.0
See Also:
Collections.unmodifiableList(java.util.List)

Field Summary
 
Fields inherited from class bak.pcj.UnmodifiableLongCollection
collection
 
Constructor Summary
UnmodifiableLongList(LongList l)
          Creates a new unmodifiable list on an existing list.
 
Method Summary
 void add(int index, long v)
          Throws UnsupportedOperationException.
 boolean addAll(int index, LongCollection c)
          Throws UnsupportedOperationException.
 long get(int index)
          Returns the element at a specified position in this list.
 int indexOf(int index, long c)
          Returns the index of the first occurance of a specified element in this list after or at a specified index.
 int indexOf(long c)
          Returns the index of the first occurance of a specified element in this list.
 int lastIndexOf(int index, long c)
          Returns the index of the last occurance of a specified element in this list before a specified index.
 int lastIndexOf(long c)
          Returns the index of the last occurance of a specified element in this list.
 LongListIterator listIterator()
          Returns a list iterator over this list.
 LongListIterator listIterator(int index)
          Returns a list iterator over this list, starting from a specified index.
 long removeElementAt(int index)
          Throws UnsupportedOperationException.
 long set(int index, long v)
          Throws UnsupportedOperationException.
 
Methods inherited from class bak.pcj.UnmodifiableLongCollection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, trimToSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bak.pcj.LongCollection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, trimToSize
 

Constructor Detail

UnmodifiableLongList

public UnmodifiableLongList(LongList l)
Creates a new unmodifiable list on an existing list. The result is a list whose elements and behaviour is the same as the existing list's except that the new list cannot be modified.

Parameters:
l - the existing list to make unmodifiable.
Throws:
NullPointerException - if l is null.
Method Detail

add

public void add(int index,
                long v)
Throws UnsupportedOperationException.

Specified by:
add in interface LongList
Parameters:
index - the index at which to add the element. If index == size() the element is appended to this list.
v - the long value to add to this list.
Throws:
UnsupportedOperationException - unconditionally.
See Also:
LongCollection.add(long), LongCollection.addAll(LongCollection), LongList.addAll(int,LongCollection)

addAll

public boolean addAll(int index,
                      LongCollection c)
Throws UnsupportedOperationException.

Specified by:
addAll in interface LongList
Parameters:
index - the index at which to insert the elements of the specified collection. If index == size() the elements are appended to this list.
c - the collection whose elements to add to this list.
Returns:
true if this list was modified as a result of adding the elements of c; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.
See Also:
LongCollection.add(long), LongList.add(int, long), LongCollection.addAll(LongCollection)

get

public long get(int index)
Description copied from interface: LongList
Returns the element at a specified position in this list.

Specified by:
get in interface LongList
Parameters:
index - the position of the element to return.
Returns:
the element at the specified position.

indexOf

public int indexOf(long c)
Description copied from interface: LongList
Returns the index of the first occurance of a specified element in this list.

Specified by:
indexOf in interface LongList
Parameters:
c - the element to find.
Returns:
the index of the first occurance of the specified element in this list; returns -1, if the element is not contained in this list.

indexOf

public int indexOf(int index,
                   long c)
Description copied from interface: LongList
Returns the index of the first occurance of a specified element in this list after or at a specified index.

Specified by:
indexOf in interface LongList
Parameters:
c - the element to find.
index - the index at which to start the search.
Returns:
the index of the first occurance of the specified element in this list; returns -1, if the element is not contained in this list.
Since:
1.2

lastIndexOf

public int lastIndexOf(long c)
Description copied from interface: LongList
Returns the index of the last occurance of a specified element in this list.

Specified by:
lastIndexOf in interface LongList
Parameters:
c - the element to find.
Returns:
the index of the last occurance of the specified element in this list; returns -1, if the element is not contained in this list.

lastIndexOf

public int lastIndexOf(int index,
                       long c)
Description copied from interface: LongList
Returns the index of the last occurance of a specified element in this list before a specified index.

Specified by:
lastIndexOf in interface LongList
Parameters:
c - the element to find.
index - the index at which to start the search. Note that the element at index is not included in the search.
Returns:
the index of the last occurance of the specified element in this list; returns -1, if the element is not contained in this list.
Since:
1.2

listIterator

public LongListIterator listIterator()
Description copied from interface: LongList
Returns a list iterator over this list.

Specified by:
listIterator in interface LongList
Returns:
a list iterator over this list.

listIterator

public LongListIterator listIterator(int index)
Description copied from interface: LongList
Returns a list iterator over this list, starting from a specified index.

Specified by:
listIterator in interface LongList
Parameters:
index - the index at which to begin the iteration.
Returns:
a list iterator over this list.

removeElementAt

public long removeElementAt(int index)
Throws UnsupportedOperationException.

Specified by:
removeElementAt in interface LongList
Parameters:
index - the index of the element to remove.
Returns:
the value of the element removed.
Throws:
UnsupportedOperationException - unconditionally.

set

public long set(int index,
                long v)
Throws UnsupportedOperationException.

Specified by:
set in interface LongList
Parameters:
index - the index of the element whose value to set.
v - the new value of the specified element.
Returns:
the previous value of the element.
Throws:
UnsupportedOperationException - unconditionally.

PCJ API
Version 1.2

Report a bug or request a feature.
Further information on the development and latest release of PCJ can be found at the project homepage.

Primitive Collections for Java is released under the GNU Lesser General Public License.
Copyright © 2002, 2003 Søren Bak. All Rights Reserved.

Hosted by SourceForge.net
SourceForge.net Logo