jopt.csp.util
Class FloatSparseSet

java.lang.Object
  extended byjopt.csp.util.FloatSet
      extended byjopt.csp.util.FloatSparseSet
All Implemented Interfaces:
NumSet

public class FloatSparseSet
extends FloatSet

A sorted set of individual float values


Constructor Summary
FloatSparseSet()
          Creates a new set
 
Method Summary
 void add(float val)
          Adds a value to set
 void add(float start, float end)
          Adds a range of values to set
 void clear()
          Removes all values from the set
 java.lang.Object clone()
          Creates a duplicate of this set
 boolean contains(float val)
          Returns true if value is contained in set
 FloatSparseSetListener getListener()
          Returns listener that is currently assigned to set
 float getMax()
          Returns maximum value for set
 float getMin()
          Returns minimum value for set
 float getNextHigher(float val)
          Returns the next higher value in the domain or current value if none exists
 float getNextLower(float val)
          Returns the next lower value in the domain or current value if none exists
 void remove(float val)
          Removes a value from the set
 void remove(float start, float end)
          Removes a range of values from the set
 void removeEndingAt(float val)
          Removes all values below and including given value
 void removeEndingBefore(float val)
          Removes all values below given value
 void removeStartingAfter(float val)
          Removes all values above given value
 void removeStartingFrom(float val)
          Removes all values above and including given value
 void setListener(FloatSparseSetListener listener, int callback)
          Sets listener for set to be notified of changes
 int size()
          Returns the size of the set
 java.lang.String toString()
           
 NumberIterator values()
          returns an iterator containing all numbers in the set
 
Methods inherited from class jopt.csp.util.FloatSet
addAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FloatSparseSet

public FloatSparseSet()
Creates a new set

Method Detail

size

public final int size()
Returns the size of the set


clear

public void clear()
Removes all values from the set

Specified by:
clear in interface NumSet
Specified by:
clear in class FloatSet

getMin

public float getMin()
Returns minimum value for set

Specified by:
getMin in class FloatSet

getMax

public float getMax()
Returns maximum value for set

Specified by:
getMax in class FloatSet

contains

public boolean contains(float val)
Returns true if value is contained in set

Specified by:
contains in class FloatSet

add

public void add(float val)
Adds a value to set

Specified by:
add in class FloatSet

add

public void add(float start,
                float end)
Adds a range of values to set

Specified by:
add in class FloatSet

remove

public void remove(float val)
Removes a value from the set

Specified by:
remove in class FloatSet

remove

public void remove(float start,
                   float end)
Removes a range of values from the set

Specified by:
remove in class FloatSet

removeStartingFrom

public void removeStartingFrom(float val)
Removes all values above and including given value

Specified by:
removeStartingFrom in class FloatSet

removeStartingAfter

public void removeStartingAfter(float val)
Description copied from class: FloatSet
Removes all values above given value

Specified by:
removeStartingAfter in class FloatSet

removeEndingAt

public void removeEndingAt(float val)
Removes all values below and including given value

Specified by:
removeEndingAt in class FloatSet

removeEndingBefore

public void removeEndingBefore(float val)
Description copied from class: FloatSet
Removes all values below given value

Specified by:
removeEndingBefore in class FloatSet

getNextHigher

public float getNextHigher(float val)
Returns the next higher value in the domain or current value if none exists

Specified by:
getNextHigher in class FloatSet

getNextLower

public float getNextLower(float val)
Returns the next lower value in the domain or current value if none exists

Specified by:
getNextLower in class FloatSet

clone

public java.lang.Object clone()
Creates a duplicate of this set

Specified by:
clone in interface NumSet
Specified by:
clone in class FloatSet

setListener

public void setListener(FloatSparseSetListener listener,
                        int callback)
Sets listener for set to be notified of changes


getListener

public FloatSparseSetListener getListener()
Returns listener that is currently assigned to set


values

public NumberIterator values()
returns an iterator containing all numbers in the set


toString

public java.lang.String toString()