org.orekit.utils
Class GenericInterval<T>

java.lang.Object
  extended by org.orekit.utils.GenericInterval<T>
Type Parameters:
T - the nature of ending points.
It is HIGHLY recommended this class be immutable!
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComparableInterval

public class GenericInterval<T>
extends Object
implements Serializable

- Generic class to describe an interval.

- The generic element is the nature of the data defining the upper and lower boundaries.

- This class can be extended ; toString may be overriden.

Since:
3.0
Version:
$Id: GenericInterval.java 17602 2017-05-18 08:25:23Z bignon $
Author:
Pierre Cardoso
See Also:
Serialized Form
Use sample :

An interval of Doubles ] 1.0 ; 2.0 [ is created this way :

Interval interval = new Interval(IntervalEndpointType.OPEN, 1.0, 2.0, IntervalEndpointType.OPEN);

Concurrency :
matches the concurrency of the parameter type : using an immutable type is HIGHLY recommended

Constructor Summary
GenericInterval(IntervalEndpointType lowerEndpointIn, T lowerDataIn, T upperDataIn, IntervalEndpointType upperEndpointIn)
          Constructor.
The input parameters have to be not null.
Otherwise a MathIllegalArgumentException is thrown.
 
Method Summary
 T getLowerData()
           
 IntervalEndpointType getLowerEndpoint()
           
 T getUpperData()
           
 IntervalEndpointType getUpperEndpoint()
           
 String toString()
          This method returns a String representing the interval, with boundaries as brackets and the lower/upper values.
Example : "] 0.0 , 1.2534 [" for an open interval with doubles.
toString is called on the values.
Warning : this representation is subject to change.
This method may be overriden if convenient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericInterval

public GenericInterval(IntervalEndpointType lowerEndpointIn,
                       T lowerDataIn,
                       T upperDataIn,
                       IntervalEndpointType upperEndpointIn)
Constructor.
The input parameters have to be not null.
Otherwise a MathIllegalArgumentException is thrown.

Parameters:
lowerDataIn - lower end data value
upperDataIn - upper end data value
lowerEndpointIn - lower end point state
upperEndpointIn - upper end point state
Throws:
MathIllegalArgumentException - when the interval is invalid (unchecked exception)
Method Detail

getLowerEndpoint

public final IntervalEndpointType getLowerEndpoint()
Returns:
the lowerEndpoint

getLowerData

public final T getLowerData()
Returns:
the lowerData

getUpperData

public final T getUpperData()
Returns:
the upperData

getUpperEndpoint

public final IntervalEndpointType getUpperEndpoint()
Returns:
the upperEndpoint

toString

public final String toString()
This method returns a String representing the interval, with boundaries as brackets and the lower/upper values.
Example : "] 0.0 , 1.2534 [" for an open interval with doubles.
toString is called on the values.
Warning : this representation is subject to change.
This method may be overriden if convenient.

Overrides:
toString in class Object
Returns:
a String with boundary brackets and values.
See Also:
Object.toString()


Copyright © 2017 CNES. All Rights Reserved.