Class IntervalRange

java.lang.Object
org.jblas.ranges.IntervalRange
All Implemented Interfaces:
Range

public class IntervalRange extends Object implements Range
Range which varies from a given interval. Endpoint is exclusive! "new IntervalRange(0, 3)" enumerates 0, 1, 2.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
     
    private int
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntervalRange(int a, int b)
    Construct new interval range.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    More indices available?
    int
    Consecutive numbering of current index.
    void
    init(int lower, int upper)
    Initialize Range to available indices
    int
    Total number of indices.
    void
    Increase counter.
     
    int
    Get current index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • start

      private int start
    • end

      private int end
    • value

      private int value
  • Constructor Details

    • IntervalRange

      public IntervalRange(int a, int b)
      Construct new interval range. Endpoints are inclusive.
  • Method Details

    • init

      public void init(int lower, int upper)
      Description copied from interface: Range
      Initialize Range to available indices
      Specified by:
      init in interface Range
    • length

      public int length()
      Description copied from interface: Range
      Total number of indices.
      Specified by:
      length in interface Range
    • next

      public void next()
      Description copied from interface: Range
      Increase counter.
      Specified by:
      next in interface Range
    • index

      public int index()
      Description copied from interface: Range
      Consecutive numbering of current index.
      Specified by:
      index in interface Range
    • value

      public int value()
      Description copied from interface: Range
      Get current index.
      Specified by:
      value in interface Range
    • hasMore

      public boolean hasMore()
      Description copied from interface: Range
      More indices available?
      Specified by:
      hasMore in interface Range
    • toString

      public String toString()
      Overrides:
      toString in class Object