PCJ API
Version 1.2

bak.pcj
Class UnmodifiableDoubleCollection

java.lang.Object
  extended bybak.pcj.UnmodifiableDoubleCollection
All Implemented Interfaces:
DoubleCollection
Direct Known Subclasses:
UnmodifiableDoubleList, UnmodifiableDoubleSet

public class UnmodifiableDoubleCollection
extends Object
implements DoubleCollection

This class represents unmodifiable collections of double values.

Since:
1.0
See Also:
Collections.unmodifiableCollection(java.util.Collection)

Field Summary
protected  DoubleCollection collection
          The collection underlying this unmodifiable collection.
 
Constructor Summary
UnmodifiableDoubleCollection(DoubleCollection c)
          Creates a new unmodifiable collection on an existing collection.
 
Method Summary
 boolean add(double v)
          Throws UnsupportedOperationException.
 boolean addAll(DoubleCollection c)
          Throws UnsupportedOperationException.
 void clear()
          Throws UnsupportedOperationException.
 boolean contains(double v)
          Indicates whether this collection contains a specified element.
 boolean containsAll(DoubleCollection c)
          Indicates whether all elements of a specified collection is contained in this collection.
 boolean equals(Object obj)
          Indicates whether this collection is equal to some object.
 int hashCode()
          Returns a hash code value for this collection.
 boolean isEmpty()
          Indicates whether this collection is empty.
 DoubleIterator iterator()
          Returns an iterator over this collection.
 boolean remove(double v)
          Throws UnsupportedOperationException.
 boolean removeAll(DoubleCollection c)
          Throws UnsupportedOperationException.
 boolean retainAll(DoubleCollection c)
          Throws UnsupportedOperationException.
 int size()
          Returns the number of elements in this collection.
 double[] toArray()
          Returns the elements of this collection as an array.
 double[] toArray(double[] a)
          Returns the elements of this collection as an array.
 void trimToSize()
          Minimizes the memory used by this collection.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

protected DoubleCollection collection
The collection underlying this unmodifiable collection.

Constructor Detail

UnmodifiableDoubleCollection

public UnmodifiableDoubleCollection(DoubleCollection c)
Creates a new unmodifiable collection on an existing collection. The result is a collection whose elements and behaviour is the same as the existing collection's except that the new collection cannot be modified.

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

add

public boolean add(double v)
Throws UnsupportedOperationException.

Specified by:
add in interface DoubleCollection
Parameters:
v - the element to add to this collection.
Returns:
true if this collection was modified as a result of adding v; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.
See Also:
DoubleCollection.addAll(DoubleCollection)

addAll

public boolean addAll(DoubleCollection c)
Throws UnsupportedOperationException.

Specified by:
addAll in interface DoubleCollection
Parameters:
c - the collection whose elements to add to this collection.
Returns:
true if this collection was modified as a result of adding the elements of c; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.
See Also:
DoubleCollection.add(double)

clear

public void clear()
Throws UnsupportedOperationException.

Specified by:
clear in interface DoubleCollection
Throws:
UnsupportedOperationException - unconditionally.

contains

public boolean contains(double v)
Description copied from interface: DoubleCollection
Indicates whether this collection contains a specified element.

Specified by:
contains in interface DoubleCollection
Parameters:
v - the element to test for containment.
Returns:
true if v is contained in this collection; returns false otherwise.
See Also:
DoubleCollection.containsAll(DoubleCollection)

containsAll

public boolean containsAll(DoubleCollection c)
Description copied from interface: DoubleCollection
Indicates whether all elements of a specified collection is contained in this collection.

Specified by:
containsAll in interface DoubleCollection
Parameters:
c - the collection whose elements to test for containment.
Returns:
true if all the elements of c are contained in this collection; returns false otherwise.
See Also:
DoubleCollection.contains(double)

equals

public boolean equals(Object obj)
Description copied from interface: DoubleCollection
Indicates whether this collection is equal to some object.

Specified by:
equals in interface DoubleCollection

hashCode

public int hashCode()
Description copied from interface: DoubleCollection
Returns a hash code value for this collection.

Specified by:
hashCode in interface DoubleCollection

isEmpty

public boolean isEmpty()
Description copied from interface: DoubleCollection
Indicates whether this collection is empty.

Specified by:
isEmpty in interface DoubleCollection
Returns:
true if this collection is empty; returns false otherwise.

iterator

public DoubleIterator iterator()
Description copied from interface: DoubleCollection
Returns an iterator over this collection.

Specified by:
iterator in interface DoubleCollection
Returns:
an iterator over this collection.

remove

public boolean remove(double v)
Throws UnsupportedOperationException.

Specified by:
remove in interface DoubleCollection
Parameters:
v - the double value to remove from this collection.
Returns:
true if this collection was modified as a result of removing v; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.

removeAll

public boolean removeAll(DoubleCollection c)
Throws UnsupportedOperationException.

Specified by:
removeAll in interface DoubleCollection
Parameters:
c - the collection whose elements to remove from this collection.
Returns:
true if this collection was modified as a result of removing the elements of c; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.

retainAll

public boolean retainAll(DoubleCollection c)
Throws UnsupportedOperationException.

Specified by:
retainAll in interface DoubleCollection
Parameters:
c - the collection whose elements to retain in this collection.
Returns:
true if this collection was modified as a result of removing the elements not contained in c; returns false otherwise.
Throws:
UnsupportedOperationException - unconditionally.

size

public int size()
Description copied from interface: DoubleCollection
Returns the number of elements in this collection.

Specified by:
size in interface DoubleCollection
Returns:
the number of elements in this collection.

toArray

public double[] toArray()
Description copied from interface: DoubleCollection
Returns the elements of this collection as an array.

Specified by:
toArray in interface DoubleCollection
Returns:
a new array containing the elements of this collection.

toArray

public double[] toArray(double[] a)
Description copied from interface: DoubleCollection
Returns the elements of this collection as an array.

Specified by:
toArray in interface DoubleCollection
Parameters:
a - an array to fill with the elements of this collection; if a is null or not big enough to contain all the elements of this collection, an new array is allocated, and a is not changed.
Returns:
a, if a has room for all the elements of this collection; otherwise a new array is allocated, filled with the elements of this collection, and returned.

trimToSize

public void trimToSize()
Description copied from interface: DoubleCollection
Minimizes the memory used by this collection. The exact operation of this method depends on the class implementing it. Implementors may choose to ignore it completely.

Specified by:
trimToSize in interface DoubleCollection

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