Class IntervalPartition

java.lang.Object
org.esa.snap.core.util.math.IntervalPartition

public class IntervalPartition extends Object
The class IntervalPartition is a representation of an interval partition, i.e. a strictly monotonous sequence of real numbers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntervalPartition(double... sequence)
    Constructs an interval partition from a sequence of real numbers.
    IntervalPartition(float... sequence)
    Constructs an interval partition from a sequence of real numbers.
  • Method Summary

    Modifier and Type
    Method
    Description
    createArray(double[]... sequences)
    Creates an array of interval partitions from an array of sequences.
    createArray(float[]... sequences)
    Creates an array of interval partitions from an array of sequences.
    final double
    get(int i)
    Returns the ith number in the interval partition.
    final int
    Returns the cardinal number of the interval partition.
    final double
    Returns the maximum (i.e.
    final double
    Returns the mesh of the interval partition, i.e.
    final double
    Returns the minimum (i.e.
    final int
    Returns the monotonicity of the interval partition.
    final double[]
    Returns the sequence of all numbers in the interval partition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IntervalPartition

      public IntervalPartition(double... sequence)
      Constructs an interval partition from a sequence of real numbers.
      Parameters:
      sequence - the sequence. The sequence must increase or decrease strictly and consist of at least two real numbers.
      Throws:
      IllegalArgumentException - if the sequence is not strictly monotonous or consists of less than two real numbers.
      NullPointerException - if the sequence is null.
    • IntervalPartition

      public IntervalPartition(float... sequence)
      Constructs an interval partition from a sequence of real numbers.
      Parameters:
      sequence - the sequence. The sequence must increase or decrease strictly and consist of at least two real numbers.
      Throws:
      IllegalArgumentException - if the sequence is not strictly monotonous or consists of less than two real numbers.
      NullPointerException - if the sequence is null.
  • Method Details

    • createArray

      public static IntervalPartition[] createArray(double[]... sequences)
      Creates an array of interval partitions from an array of sequences.
      Parameters:
      sequences - the array of sequences. Each sequence must increase or decrease strictly and consist of at least two real numbers.
      Returns:
      the created array of interval partitions.
      Throws:
      IllegalArgumentException - if the length of the sequence array is zero or any sequence is not strictly monotonous or consists of less than two real numbers.
      NullPointerException - if the array of sequences or any sequence is null.
    • createArray

      public static IntervalPartition[] createArray(float[]... sequences)
      Creates an array of interval partitions from an array of sequences.
      Parameters:
      sequences - the array of sequences. Each sequence must increase or decrease strictly and consist of at least two real numbers.
      Returns:
      the created array of interval partitions.
      Throws:
      IllegalArgumentException - if the length of the sequence array is zero or any sequence is not strictly monotonous or consists of less than two real numbers.
      NullPointerException - if the array of sequences or any sequence is null.
    • getCardinal

      public final int getCardinal()
      Returns the cardinal number of the interval partition.
      Returns:
      the cardinal number.
    • get

      public final double get(int i)
      Returns the ith number in the interval partition.
      Parameters:
      i - the index number of the real number of interest.
      Returns:
      the ith real number.
    • getSequence

      public final double[] getSequence()
      Returns the sequence of all numbers in the interval partition.
      Returns:
      the sequence of all numbers.
    • getMax

      public final double getMax()
      Returns the maximum (i.e. final) number in the partition.
      Returns:
      the maximum number in the partition.
    • getMin

      public final double getMin()
      Returns the minimum (i.e. first) number in the partition.
      Returns:
      the minimum number in the partition.
    • getMesh

      public final double getMesh()
      Returns the mesh of the interval partition, i.e. the maximum distance between two adjacent real numbers in the partition.
      Returns:
      the mesh.
    • getMonotonicity

      public final int getMonotonicity()
      Returns the monotonicity of the interval partition. A positive (negative) value indicates a strictly increasing (decreasing) partition.
      Returns:
      the monotonicity.