public class SortedIntsArithmetic extends Object implements SortedInts
Modifier and Type | Field and Description |
---|---|
int |
n |
double |
oneOverVStep |
int |
v0 |
int |
vStep |
Constructor and Description |
---|
SortedIntsArithmetic(int v0,
int vStep,
int n) |
Modifier and Type | Method and Description |
---|---|
static BigInteger |
big(int x) |
ContinuousIndex |
continuousIndexOf(int x)
The continuous index at which x falls in this sequence.
|
void |
continuousIndexOf(int x,
ContinuousIndex result)
The continuous index at which x falls in this sequence.
|
ContinuousIndexArray |
continuousIndicesIn(SortedInts xs)
Like continuousIndicesOf, but in reverse: for each v in this sequence,
the continuous index at which v falls in xs.
|
ContinuousIndexArray |
continuousIndicesOf(Ints xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(Ints xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
ContinuousIndexArray |
continuousIndicesOf(SortedInts xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(SortedInts xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
int[] |
copyOf() |
int[] |
copyOf(int i,
int c) |
void |
copyTo(int i,
int[] dest,
int iDest,
int c) |
int |
first() |
int |
indexAfter(int x)
Smallest index whose value is greater than x
|
int |
indexAtOrAfter(int x)
Smallest index whose value is greater than or equal to x
|
int |
indexAtOrBefore(int x)
Largest index whose value is less than or equal to x
|
int |
indexBefore(int x)
Largest index whose value is less than x
|
int |
indexNearest(int x)
Index of the value closest to x.
|
int |
indexOf(int x)
Follows the convention of
Arrays.binarySearch(int[], int) :
If x is contained in this sequence, returns the index of x
Otherwise, returns (-insertionPoint - 1)
|
boolean |
isEmpty() |
int |
last() |
int |
n()
Length of the sequence
|
int |
v(int i)
Value at index i
|
public final int v0
public final int vStep
public final int n
public final double oneOverVStep
public SortedIntsArithmetic(int v0, int vStep, int n)
IllegalArgumentException
- if
vStep
is non-positive, or
n
is negative, or
(v0 + (n-1)*vStep)
is greater than Integer.MAX_VALUE
public static BigInteger big(int x)
public int v(int i)
Ints
public int n()
Ints
public void copyTo(int i, int[] dest, int iDest, int c)
public int indexOf(int x)
SortedInts
Arrays.binarySearch(int[], int)
:
x
is contained in this sequence, returns the index of x
indexOf
in interface SortedInts
Arrays.binarySearch(int[], int)
public int indexNearest(int x)
SortedInts
indexNearest
in interface SortedInts
public int indexBefore(int x)
SortedInts
indexBefore
in interface SortedInts
public int indexAfter(int x)
SortedInts
indexAfter
in interface SortedInts
public int indexAtOrBefore(int x)
SortedInts
indexAtOrBefore
in interface SortedInts
public int indexAtOrAfter(int x)
SortedInts
indexAtOrAfter
in interface SortedInts
public void continuousIndexOf(int x, ContinuousIndex result)
SortedInts
continuousIndexOf
in interface SortedInts
ContinuousIndex
public ContinuousIndex continuousIndexOf(int x)
SortedInts
continuousIndexOf
in interface SortedInts
ContinuousIndex
public void continuousIndicesOf(Ints xs, ContinuousIndexArray result)
SortedInts
continuousIndicesOf
in interface SortedInts
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Ints xs)
SortedInts
continuousIndicesOf
in interface SortedInts
com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedInts xs, ContinuousIndexArray result)
SortedInts
SortedInts.continuousIndicesOf(Ints, ContinuousIndexArray)
in some implementations.continuousIndicesOf
in interface SortedInts
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedInts xs)
SortedInts
SortedInts.continuousIndicesOf(Ints)
in some implementations.continuousIndicesOf
in interface SortedInts
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesIn(SortedInts xs)
Copyright © 2013 Metron, Inc.. All rights reserved.