|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.analysis.IntervalsList
public class IntervalsList
This class represents an intervals list.
An interval list represent a list of contiguous regions on the real line. All intervals of the list are disjoints to each other, they are stored in ascending order. Empty intervals are discarted. All intervals in the list must use the same ComparableNumber class. The class supports the main set operations like union and intersection.
Interval| Constructor Summary | |
|---|---|
IntervalsList()
Build an empty intervals list. |
|
IntervalsList(Interval i)
Build an intervals list containing only one interval. |
|
IntervalsList(Interval i1,
Interval i2)
Build an intervals list containing two intervals. |
|
IntervalsList(IntervalsList list)
Copy constructor. |
|
| Method Summary | |
|---|---|
int |
cardinality()
Returns the cardinality (the number of elements). |
boolean |
contains(ComparableNumber x)
Check if the list contains a point. |
boolean |
contains(Interval i)
Check if the list contains an interval. |
boolean |
contains(java.lang.Object o)
Check if contains the specified element in this set. |
boolean |
equals(java.lang.Object o)
DOCUMENT ME! |
java.lang.Class |
getDomain()
|
Interval |
getInterval(int i)
Get an interval from the list. |
java.util.List |
getIntervals()
Get the ordered list of disjoints intervals. |
int |
getSize()
Get the number of intervals of the list. |
int |
hashCode()
Returns the hash code value for this set. |
IntervalsList |
insert(ComparableNumber c)
DOCUMENT ME! |
IntervalsList |
insert(Interval i)
Add an interval to the instance. |
IntervalsList |
insert(IntervalsList list)
Add an intervals list to the instance. |
boolean |
insert(java.lang.Object o)
Inserts the specified element in this set if it is present. |
IntervalsList |
intersect(Interval i)
Intersects the instance and an interval. |
IntervalsList |
intersect(IntervalsList list)
Intersect the instance and another intervals list. |
Set |
intersection(Set set)
DOCUMENT ME! |
boolean |
intersects(Interval i)
Check if an interval intersects the instance. |
boolean |
isConnex()
Check if the instance is connected. |
boolean |
isEmpty()
Check if the instance is empty. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this set. |
IntervalsList |
remove(ComparableNumber c)
DOCUMENT ME! |
IntervalsList |
remove(Interval i)
Remove an interval from the list. |
IntervalsList |
remove(IntervalsList list)
Remove an intervals list from the instance. |
boolean |
remove(java.lang.Object o)
Removes the specified element from this set if it is present (optional operation). |
Set |
subtraction(Set set)
DOCUMENT ME! |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this set. |
java.lang.String |
toString()
Returns a string representing this set. |
Set |
union(Set set)
DOCUMENT ME! |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IntervalsList()
public IntervalsList(Interval i)
i - interval
public IntervalsList(Interval i1,
Interval i2)
i1 - first intervali2 - second interval
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList(IntervalsList list)
list - intervals list to copy| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface Setpublic java.lang.Class getDomain()
public boolean isConnex()
public int getSize()
public Interval getInterval(int i)
i - index of the interval
public java.util.List getIntervals()
public int cardinality()
cardinality in interface Setpublic boolean contains(java.lang.Object o)
contains in interface Seto - - object to be checked.
public boolean contains(ComparableNumber x)
x - point to check
java.lang.IllegalArgumentException - DOCUMENT ME!public boolean contains(Interval i)
i - interval to check
java.lang.IllegalArgumentException - DOCUMENT ME!public boolean intersects(Interval i)
i - interval to check
java.lang.IllegalArgumentException - DOCUMENT ME!public boolean insert(java.lang.Object o)
o - - object to be inserted from this set, if present.
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList insert(ComparableNumber c)
c - DOCUMENT ME!
public IntervalsList insert(Interval i)
i - interval to add to the instance
java.lang.IllegalArgumentException - DOCUMENT ME!public boolean remove(java.lang.Object o)
remove in interface Seto - - object to be removed from this set, if present.
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList remove(ComparableNumber c)
c - DOCUMENT ME!
public IntervalsList remove(Interval i)
i - interval to remove
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList intersect(Interval i)
i - interval
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList insert(IntervalsList list)
list - intervals list to add to the instance
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList remove(IntervalsList list)
list - intervals list to remove
java.lang.IllegalArgumentException - DOCUMENT ME!public IntervalsList intersect(IntervalsList list)
list - list to intersect with the instance
java.lang.IllegalArgumentException - DOCUMENT ME!public Set intersection(Set set)
intersection in interface Setset - DOCUMENT ME!
public Set union(Set set)
union in interface Setset - DOCUMENT ME!
public Set subtraction(Set set)
set - DOCUMENT ME!
public boolean equals(java.lang.Object o)
equals in interface Setequals in class java.lang.Objecto - DOCUMENT ME!
public int hashCode()
hashCode in interface SethashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator iterator()
iterator in interface Setpublic java.lang.Object[] toArray()
toArray in interface Set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||