hep.aida.ref.function
Class RangeSet

java.lang.Object
  extended by hep.aida.ref.function.RangeSet
All Implemented Interfaces:
IRangeSet

public class RangeSet
extends Object
implements IRangeSet

This class handles multiple ranges along one axis. Overlapping ranges are merged in one bigger range.


Constructor Summary
RangeSet()
          Creates RangeSet with (-infinity, +infinity) valid interval, borders excluded
RangeSet(double[] xMin, double[] xMax)
           
RangeSet(double xMin, double xMax)
           
RangeSet(String range)
          Create a RangeSet from a String.
 
Method Summary
 void exclude(double xMin, double xMax)
          Exclude [xMin, xMax] interval from the existing set of valid ranges
 void excludeAll()
          Set empty range in all axes.
 double generatePoint()
           
 void include(double xMin, double xMax)
          Additive include/exclude of the range in given axis.
 void includeAll()
          Set full range in all axes.
 boolean isInRange(double point)
           
 double length()
           
 double[] lowerBounds()
          Return array of lower or upper Bounds for the current set of ranges
 double MINUS_INF()
           
 double PLUS_INF()
           
 int size()
          Returns current number of disjoint ranges (non-overlapping intervals)
 double[] upperBounds()
          Return array of upper Bounds for the current set of ranges
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeSet

public RangeSet()
Creates RangeSet with (-infinity, +infinity) valid interval, borders excluded


RangeSet

public RangeSet(double xMin,
                double xMax)

RangeSet

public RangeSet(double[] xMin,
                double[] xMax)

RangeSet

public RangeSet(String range)
Create a RangeSet from a String. Ranges can be specified as: (,-9),(-1.,0.),(2.,3.),(5,)

Method Detail

PLUS_INF

public double PLUS_INF()
Specified by:
PLUS_INF in interface IRangeSet

MINUS_INF

public double MINUS_INF()
Specified by:
MINUS_INF in interface IRangeSet

size

public int size()
Returns current number of disjoint ranges (non-overlapping intervals)

Specified by:
size in interface IRangeSet
Returns:
Number of disjoint ranges

length

public double length()

generatePoint

public double generatePoint()

lowerBounds

public double[] lowerBounds()
Return array of lower or upper Bounds for the current set of ranges

Specified by:
lowerBounds in interface IRangeSet
Returns:
Array of lower bounds for all valid ranges

upperBounds

public double[] upperBounds()
Description copied from interface: IRangeSet
Return array of upper Bounds for the current set of ranges

Specified by:
upperBounds in interface IRangeSet
Returns:
Array of upper bounds for all valid ranges

include

public void include(double xMin,
                    double xMax)
Additive include/exclude of the range in given axis.

Specified by:
include in interface IRangeSet
Parameters:
xMin - - lower bound of a new valid range
xMax - - upper bound of a new valid range

exclude

public void exclude(double xMin,
                    double xMax)
Description copied from interface: IRangeSet
Exclude [xMin, xMax] interval from the existing set of valid ranges

Specified by:
exclude in interface IRangeSet
Parameters:
xMin - - lower bound of range to be excluded
xMax - - upper bound of range to be excluded

includeAll

public void includeAll()
Set full range in all axes.

Specified by:
includeAll in interface IRangeSet

excludeAll

public void excludeAll()
Set empty range in all axes.

Specified by:
excludeAll in interface IRangeSet

isInRange

public boolean isInRange(double point)
Specified by:
isInRange in interface IRangeSet


jHepWork 3.2 © jWork.org