|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspice.basic.SpiceWindow
public class SpiceWindow
Class SpiceWindow represents unions of disjoint intervals on the real line. SpiceWindows are frequently used to represent time periods, for example periods when a specified geometric condition occurs.
SpiceWindows are used in JNISpice where the abstract data type Window is used in SPICELIB, or where the SpiceCell structure is used to represent windows in CSPICE.
Each SpiceWindow instance contains a one-dimensional array of interval endpoints; the endpoints are arranged in increasing order. Unlike windows in SPICELIB and CSPICE, SpiceWindow objects don't have separate cardinality and size values: all of the elements of the array of endpoints are considered to be valid data.
Constructor Summary | |
---|---|
SpiceWindow()
Default constructor. |
|
SpiceWindow(double[] endpoints)
Construct a SpiceWindow from a one-dimensional array of double precision endpoints. |
|
SpiceWindow(double[][] intervals)
Construct a SpiceWindow from an array of double precision endpoint intervals. |
|
SpiceWindow(SpiceWindow s)
Copy constructor. |
Method Summary | |
---|---|
int |
card()
Get the cardinality (number of intervals) of a SpiceWindow. |
SpiceWindow |
complement(double left,
double right)
Complement a SpiceWindow with respect to a specified interval. |
void |
contract(double left,
double right)
Contract a SpiceWindow using specified inset values. |
void |
expand(double left,
double right)
Expand a SpiceWindow using specified inset values. |
void |
fill(double small)
Fill in gaps shorter than a specified in from a SpiceWindow. |
void |
filter(double small)
Filter intervals shorter than a specified length from a SpiceWindow. |
double[] |
getInterval(int index)
Fetch an interval, specified by index, from a SpiceWindow. |
double |
getMeasure()
Get the measure of this SpiceWindow. |
SpiceWindow |
insert(double left,
double right)
Insert an interval into a SpiceWindow. |
SpiceWindow |
intersect(SpiceWindow b)
Compute the intersection of two SpiceWindows. |
SpiceWindow |
sub(SpiceWindow b)
Compute the difference of two SpiceWindows: subtract a specified SpiceWindow from another. |
double[] |
toArray()
Get an array of endpoints from a SpiceWindow. |
java.lang.String |
toString()
Override Object's toString method. |
SpiceWindow |
union(SpiceWindow b)
Compute the union of two SpiceWindows. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpiceWindow()
public SpiceWindow(SpiceWindow s)
public SpiceWindow(double[] endpoints) throws SpiceErrorException
All of the elements of the array are considered to be valid data. The cardinality of the SpiceWindow is one half of the array length.
SpiceErrorException
public SpiceWindow(double[][] intervals) throws SpiceErrorException
All of the elements of the array are considered to be valid data. The cardinality of the SpiceWindow is the length of the array `intervals'.
SpiceErrorException
Method Detail |
---|
public int card()
public double[] toArray()
public double[] getInterval(int index) throws SpiceErrorException
SpiceErrorException
public SpiceWindow union(SpiceWindow b) throws SpiceErrorException
SpiceErrorException
public SpiceWindow intersect(SpiceWindow b) throws SpiceErrorException
SpiceErrorException
public SpiceWindow sub(SpiceWindow b) throws SpiceErrorException
SpiceErrorException
public SpiceWindow insert(double left, double right) throws SpiceErrorException
Unlike windows in SPICELIB and CSPICE, SpiceWindows don't need to contain empty space to accommodate inserted intervals; in fact they don't contain empty space at all. The data array of a SpiceWindow is re-allocated as necessary to accommodate insertions. Thus the following code fragment is valid:
SpiceWindow w = new SpiceWindow(); w.insert( 1.0, 2.0 );
This method updates the SpiceWindow's endpoint array and returns a reference to the window.
SpiceErrorException
public SpiceWindow complement(double left, double right) throws SpiceErrorException
SpiceErrorException
public void contract(double left, double right) throws SpiceErrorException
SpiceErrorException
public void expand(double left, double right) throws SpiceErrorException
SpiceErrorException
public void fill(double small) throws SpiceErrorException
SpiceErrorException
public void filter(double small) throws SpiceErrorException
SpiceErrorException
public double getMeasure()
public java.lang.String toString()
toString
in class java.lang.Object
|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |