|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.util.primitives.sorted.SortedLongsArithmetic
public class SortedLongsArithmetic
Field Summary | |
---|---|
int |
n
|
double |
oneOverVStep
|
long |
v0
|
long |
vStep
|
Constructor Summary | |
---|---|
SortedLongsArithmetic(long v0,
long vStep,
int n)
|
Method Summary | |
---|---|
static java.math.BigInteger |
big(int x)
|
static java.math.BigInteger |
big(long x)
|
ContinuousIndex |
continuousIndexOf(long x)
The continuous index at which x falls in this sequence. |
void |
continuousIndexOf(long x,
ContinuousIndex result)
The continuous index at which x falls in this sequence. |
ContinuousIndexArray |
continuousIndicesIn(SortedLongs xs)
Like continuousIndicesOf, but in reverse: for each v in this sequence, the continuous index at which v falls in xs. |
ContinuousIndexArray |
continuousIndicesOf(Longs xs)
For each x in xs, the continuous index at which x falls in this sequence. |
void |
continuousIndicesOf(Longs xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this sequence. |
ContinuousIndexArray |
continuousIndicesOf(SortedLongs xs)
For each x in xs, the continuous index at which x falls in this sequence. |
void |
continuousIndicesOf(SortedLongs xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this sequence. |
long[] |
copyOf()
|
long[] |
copyOf(int i,
int c)
|
void |
copyTo(int i,
long[] dest,
int iDest,
int c)
|
long |
first()
|
int |
indexAfter(long x)
Smallest index whose value is greater than x |
int |
indexAtOrAfter(long x)
Smallest index whose value is greater than or equal to x |
int |
indexAtOrBefore(long x)
Largest index whose value is less than or equal to x |
int |
indexBefore(long x)
Largest index whose value is less than x |
int |
indexNearest(long x)
Index of the value closest to x. |
int |
indexOf(long x)
Follows the convention of Arrays.binarySearch(long[], long) :
If x is contained in this sequence, returns the index of x
Otherwise, returns (-insertionPoint - 1)
|
boolean |
isEmpty()
|
long |
last()
|
int |
n()
Length of the sequence |
long |
v(int i)
Value at index i |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final long v0
public final long vStep
public final int n
public final double oneOverVStep
Constructor Detail |
---|
public SortedLongsArithmetic(long v0, long vStep, int n)
java.lang.IllegalArgumentException
- if
vStep
is non-positive, or
n
is negative, or
(v0 + (n-1)*vStep)
is greater than Long.MAX_VALUE
Method Detail |
---|
public static java.math.BigInteger big(long x)
public static java.math.BigInteger big(int x)
public long v(int i)
Longs
v
in interface Longs
public int n()
Longs
n
in interface Longs
public void copyTo(int i, long[] dest, int iDest, int c)
copyTo
in interface Longs
public long[] copyOf(int i, int c)
copyOf
in interface Longs
public long[] copyOf()
copyOf
in interface Longs
public boolean isEmpty()
isEmpty
in interface Longs
public long first()
first
in interface Longs
public long last()
last
in interface Longs
public int indexOf(long x)
SortedLongs
Arrays.binarySearch(long[], long)
:
x
is contained in this sequence, returns the index of x
indexOf
in interface SortedLongs
Arrays.binarySearch(long[], long)
public int indexNearest(long x)
SortedLongs
indexNearest
in interface SortedLongs
public int indexBefore(long x)
SortedLongs
indexBefore
in interface SortedLongs
public int indexAfter(long x)
SortedLongs
indexAfter
in interface SortedLongs
public int indexAtOrBefore(long x)
SortedLongs
indexAtOrBefore
in interface SortedLongs
public int indexAtOrAfter(long x)
SortedLongs
indexAtOrAfter
in interface SortedLongs
public void continuousIndexOf(long x, ContinuousIndex result)
SortedLongs
continuousIndexOf
in interface SortedLongs
ContinuousIndex
public ContinuousIndex continuousIndexOf(long x)
SortedLongs
continuousIndexOf
in interface SortedLongs
ContinuousIndex
public void continuousIndicesOf(Longs xs, ContinuousIndexArray result)
SortedLongs
continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Longs xs)
SortedLongs
continuousIndicesOf
in interface SortedLongs
com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedLongs xs, ContinuousIndexArray result)
SortedLongs
SortedLongs.continuousIndicesOf(Longs, ContinuousIndexArray)
in some implementations.
continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedLongs xs)
SortedLongs
SortedLongs.continuousIndicesOf(Longs)
in some implementations.
continuousIndicesOf
in interface SortedLongs
ContinuousIndexArray
public ContinuousIndexArray continuousIndicesIn(SortedLongs xs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |