CDMA engine API  3.1.0
CDMA core library
org.gumtree.data.interfaces.IRange Interface Reference

The IRange interface describes a dimension of a IIndex. More...

List of all members.

Public Member Functions

IRange compose (IRange r) throws InvalidRangeException
IRange compact () throws InvalidRangeException
IRange shiftOrigin (int origin) throws InvalidRangeException
IRange intersect (IRange r) throws InvalidRangeException
boolean intersects (IRange r)
IRange union (IRange r) throws InvalidRangeException
int length ()
int element (long i) throws InvalidRangeException
long index (int elem) throws InvalidRangeException
boolean contains (int i)
long first ()
long last ()
long stride ()
String getName ()
int getFirstInInterval (int start)

Detailed Description

The IRange interface describes a dimension of a IIndex.

Represents a set of integers that compound a particular dimension of a array. It defines for a that specific dimension:

  • its length (number of elements)
  • its first element offset
  • the offset to between two consecutive elements
    The IRange interface is a canonical element that will do index calculation to access a particular cell in an array.
Author:
nxi

Member Function Documentation

Create a new Range by compacting this Range by removing the stride. first = first/stride, last=last/stride, stride=1.

Returns:
compacted Range
Exceptions:
InvalidRangeExceptionelements must be nonnegative, 0 <= first <= last

Create a new Range by composing a Range that is relative to this Range.

Parameters:
rrange relative to base
Returns:
combined Range, may be EMPTY
Exceptions:
InvalidRangeExceptionelements must be nonnegative, 0 <= first <= last

Is the ith element contained in this Range?

Parameters:
iindex in the original Range
Returns:
true if the ith element would be returned by the Range iterator

Get i-th element.

Parameters:
iindex of the element
Returns:
the i-th element of a range.
Exceptions:
InvalidRangeExceptioni must be: 0 <= i < length
Returns:
first element's index in range

Find the smallest element k in the Range, such that

  • k >= first
  • k >= start
  • k <= last
  • k = first + i * stride for some integer i.
Parameters:
startstarting index
Returns:
first in interval, else -1 if there is no such element.

Get name.

Returns:
name, or null if none

Get the index for this element: inverse of element.

Parameters:
elemthe element of the range
Returns:
index
Exceptions:
InvalidRangeExceptionif illegal element

Create a new Range by intersecting with a Range using same interval as this Range. NOTE: intersections when both Ranges have strides are not supported.

Parameters:
rrange to intersect
Returns:
intersected Range, may be EMPTY
Exceptions:
InvalidRangeExceptionelements must be nonnegative

Determine if a given Range intersects this one. NOTE: we dont yet support intersection when both Ranges have strides

Parameters:
rrange to intersect
Returns:
true if they intersect
Returns:
last element's index in range, inclusive

Get the number of elements in the range.

Returns:
the number of elements in the range.

Create a new Range shifting this range by a constant factor.

Parameters:
originsubtract this from first, last
Returns:
shift range
Exceptions:
InvalidRangeExceptionelements must be nonnegative, 0 <= first <= last
Returns:
stride, must be >= 1

Create a new Range by making the union with a Range using same interval as this Range. NOTE: no strides.

Parameters:
rrange to add
Returns:
intersected Range, may be EMPTY
Exceptions:
InvalidRangeExceptionelements must be nonnegative

The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables