|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjopt.csp.util.LongSet
jopt.csp.util.LongIntervalSet
A sorted set of long intervals
Constructor Summary | |
LongIntervalSet()
Creates a new set |
Method Summary | |
void |
add(long val)
Adds a value to set |
void |
add(LongIntervalSet set)
Adds a value to set |
void |
add(long start,
long end)
Adds a range of values to set |
void |
add(long start,
long end,
boolean notify)
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(long val)
Returns true if value is contained in set |
boolean |
equals(LongIntervalSet set)
An equals method for comparing if two set objects are equivalent |
int |
getFirstIntervalIndex()
Returns first interval index in list |
LongIntervalSet |
getFreeIntervalsBetween(long start,
long end)
Returns a long interval set of all the intervals that are free between the specified start and end |
long |
getIntervalEnd(int idx)
Returns end value for interval at a given index |
long |
getIntervalStart(int idx)
Returns start value for interval at a given index |
int |
getLastIntervalIndex()
Returns the last index in list |
LongIntervalSetListener |
getListener()
Returns listener that is currently assigned to set |
long |
getMax()
Returns maximum value for set |
long |
getMax(int intervalIdx)
Returns the end of the interval at the specified index |
long |
getMin()
Returns minimum value for set |
long |
getMin(int intervalIdx)
Returns the start of the interval at the specified index |
long |
getNextHigher(long val)
Returns the next higher value in the domain or current value if none exists |
int |
getNextIntervalIndex(int idx)
Returns next interval index in list |
long |
getNextLower(long val)
Returns the next lower value in the domain or current value if none exists |
int |
getPreviousIntervalIndex(int idx)
Returns previous interval index in list |
int |
indexOfValue(long val)
Returns index of a value in the list |
void |
intersect(LongIntervalSet intersector)
Removes any parts that both do not have in common from this. |
IntervalIterator |
intervals()
Returns an iterator for intervals contained in set |
boolean |
isEmpty()
|
boolean |
isIntervalContained(long start,
long end)
|
boolean |
isIntervalEmpty(long start,
long end)
|
void |
remove(long val)
Removes a value from the set |
void |
remove(long start,
long end)
Removes a range of values from the set |
void |
remove(long start,
long end,
boolean notify)
Removes a range of values from the set |
void |
removeEndingAt(long val)
Removes all values below and including given value |
void |
removeStartingFrom(long val)
Removes all values above and including given value |
void |
setListener(LongIntervalSetListener 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 values in the set |
Methods inherited from class jopt.csp.util.LongSet |
addAll, removeAll, removeEndingBefore, removeStartingAfter, retainAll |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LongIntervalSet()
Method Detail |
public int size()
size
in interface NumSet
public void clear()
clear
in interface NumSet
clear
in class LongSet
public int getFirstIntervalIndex()
public int getLastIntervalIndex()
public int getNextIntervalIndex(int idx)
idx
- Index preceding index that is to be foundpublic int getPreviousIntervalIndex(int idx)
idx
- Index following index that is to be foundpublic long getIntervalStart(int idx)
public long getIntervalEnd(int idx)
public long getMin()
getMin
in class LongSet
public long getMin(int intervalIdx)
public long getMax()
getMax
in class LongSet
public long getMax(int intervalIdx)
public boolean isIntervalContained(long start, long end)
public boolean isIntervalEmpty(long start, long end)
public boolean isEmpty()
public LongIntervalSet getFreeIntervalsBetween(long start, long end)
start
- start of the intervalend
- end of the interval
public int indexOfValue(long val)
public boolean contains(long val)
contains
in class LongSet
public void add(long val)
add
in class LongSet
public void add(LongIntervalSet set)
public void add(long start, long end)
add
in class LongSet
public void add(long start, long end, boolean notify)
public void intersect(LongIntervalSet intersector)
public void remove(long val)
remove
in class LongSet
public void remove(long start, long end)
remove
in class LongSet
public void remove(long start, long end, boolean notify)
public void removeStartingFrom(long val)
removeStartingFrom
in class LongSet
public void removeEndingAt(long val)
removeEndingAt
in class LongSet
public long getNextHigher(long val)
getNextHigher
in class LongSet
public long getNextLower(long val)
getNextLower
in class LongSet
public IntervalIterator intervals()
IntervalSet
intervals
in interface IntervalSet
public NumberIterator values()
NumSet
values
in interface NumSet
public java.lang.Object clone()
clone
in interface NumSet
clone
in class LongSet
public void setListener(LongIntervalSetListener listener, int callback)
public LongIntervalSetListener getListener()
public java.lang.String toString()
public boolean equals(LongIntervalSet set)
set
- LongIntervalSet to compare this to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |