PCJ API
Version 1.2

bak.pcj.set
Class BooleanDirectSet

java.lang.Object
  extended bybak.pcj.AbstractBooleanCollection
      extended bybak.pcj.set.AbstractBooleanSet
          extended bybak.pcj.set.BooleanDirectSet
All Implemented Interfaces:
BooleanCollection, BooleanSet

public class BooleanDirectSet
extends AbstractBooleanSet

This class represents sets of boolean values. The elements of the set are represented by a single state variable: 0 -> {}, 1 -> {F}, 2 -> {T}, and 3 -> {F, T}.

Since:
1.0

Constructor Summary
BooleanDirectSet()
          Creates a new empty set.
BooleanDirectSet(BooleanCollection c)
          Creates a new set with the same values as a specified collection.
 
Method Summary
 boolean add(boolean v)
          Adds an element to this collection.
 void clear()
          Clears this collection.
 boolean contains(boolean v)
          Indicates whether this collection contains a specified element.
 boolean isEmpty()
          Indicates whether this collection is empty.
 BooleanIterator iterator()
          Returns an iterator over this collection.
 boolean remove(boolean v)
          Removes a specified element from this collection.
 int size()
          Returns the number of elements in this collection.
 
Methods inherited from class bak.pcj.set.AbstractBooleanSet
equals, hashCode
 
Methods inherited from class bak.pcj.AbstractBooleanCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bak.pcj.BooleanCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray, trimToSize
 

Constructor Detail

BooleanDirectSet

public BooleanDirectSet()
Creates a new empty set.


BooleanDirectSet

public BooleanDirectSet(BooleanCollection c)
Creates a new set with the same values as a specified collection.

Parameters:
c - the collection whose elements to add to the new set.
Throws:
NullPointerException - if c is null.
Method Detail

contains

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

Specified by:
contains in interface BooleanCollection
Overrides:
contains in class AbstractBooleanCollection

add

public boolean add(boolean v)
Description copied from interface: BooleanCollection
Adds an element to this collection.

Specified by:
add in interface BooleanCollection
Overrides:
add in class AbstractBooleanCollection

remove

public boolean remove(boolean v)
Description copied from interface: BooleanCollection
Removes a specified element from this collection.

Specified by:
remove in interface BooleanCollection
Overrides:
remove in class AbstractBooleanCollection

size

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

Specified by:
size in interface BooleanCollection
Overrides:
size in class AbstractBooleanCollection

isEmpty

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

Specified by:
isEmpty in interface BooleanCollection
Overrides:
isEmpty in class AbstractBooleanCollection

clear

public void clear()
Description copied from interface: BooleanCollection
Clears this collection.

Specified by:
clear in interface BooleanCollection
Overrides:
clear in class AbstractBooleanCollection

iterator

public BooleanIterator iterator()
Description copied from interface: BooleanCollection
Returns an iterator over this collection.

Returns:
an iterator over this collection.

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