jopt.csp.util
Class LongSet

java.lang.Object
  extended byjopt.csp.util.LongSet
All Implemented Interfaces:
NumSet
Direct Known Subclasses:
LongIntervalSet, LongSparseSet

public abstract class LongSet
extends java.lang.Object
implements NumSet

Base class for long sets


Constructor Summary
LongSet()
          Creates a new set
 
Method Summary
abstract  void add(long val)
          Adds a value to set
abstract  void add(long start, long end)
          Adds a range of values to set
 void addAll(NumSet set)
          Adds all values to set
abstract  void clear()
          Removes all values from the set
abstract  java.lang.Object clone()
          Creates a duplicate of this set
abstract  boolean contains(long val)
          Returns true if value is contained in set
abstract  long getMax()
          Returns maximum value for set
abstract  long getMin()
          Returns minimum value for set
abstract  long getNextHigher(long val)
          Returns the next higher value in the domain or current value if none exists
abstract  long getNextLower(long val)
          Returns the next lower value in the domain or current value if none exists
abstract  void remove(long val)
          Removes a value from the set
abstract  void remove(long start, long end)
          Removes a range of values from the set
 void removeAll(NumSet set)
          Removes all values in a given set
abstract  void removeEndingAt(long val)
          Removes all values below and including given value
 void removeEndingBefore(long val)
          Removes all values below and including given value
 void removeStartingAfter(long val)
          Removes all values above and including given value
abstract  void removeStartingFrom(long val)
          Removes all values above and including given value
 void retainAll(NumSet set)
          Retains only given values in a given set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jopt.csp.util.NumSet
size, values
 

Constructor Detail

LongSet

public LongSet()
Creates a new set

Method Detail

clear

public abstract void clear()
Removes all values from the set

Specified by:
clear in interface NumSet

getMin

public abstract long getMin()
Returns minimum value for set


getMax

public abstract long getMax()
Returns maximum value for set


contains

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


add

public abstract void add(long val)
Adds a value to set


add

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


addAll

public final void addAll(NumSet set)
Adds all values to set

Specified by:
addAll in interface NumSet

remove

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


remove

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


removeStartingAfter

public final void removeStartingAfter(long val)
Removes all values above and including given value


removeStartingFrom

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


removeEndingBefore

public final void removeEndingBefore(long val)
Removes all values below and including given value


removeEndingAt

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


removeAll

public final void removeAll(NumSet set)
Removes all values in a given set

Specified by:
removeAll in interface NumSet

retainAll

public final void retainAll(NumSet set)
Retains only given values in a given set

Specified by:
retainAll in interface NumSet

getNextHigher

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


getNextLower

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


clone

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

Specified by:
clone in interface NumSet