|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.util.primitives.LongsArray
com.metsci.glimpse.util.primitives.sorted.SortedLongsArray
public class SortedLongsArray
Field Summary |
---|
Fields inherited from class com.metsci.glimpse.util.primitives.LongsArray |
---|
a, n |
Constructor Summary | |
---|---|
SortedLongsArray()
|
|
SortedLongsArray(int n)
|
|
SortedLongsArray(long[] a)
If the values of a are not in ascending order, the behavior of
this instance is undefined. |
|
SortedLongsArray(long[] a,
int n)
If the values of a are not in ascending order, the behavior of
this instance is undefined. |
|
SortedLongsArray(Longs xs)
If the values of xs are not in ascending order, the behavior of
this instance is undefined. |
Method Summary | |
---|---|
int |
add(long v)
|
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 |
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. |
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)
|
Methods inherited from class com.metsci.glimpse.util.primitives.LongsArray |
---|
append, append, append, append, append, append, append, compact, copyOf, copyOf, copyTo, ensureCapacity, first, insert, insert, insert, insert, insert, insert, insert, isEmpty, last, n, newArray, prepend, prepend, prepend, prepend, prepend, prepend, prepend, prepForAppend, prepForInsert, prepForPrepend, remove, set, v |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.metsci.glimpse.util.primitives.sorted.SortedLongsModifiable |
---|
ensureCapacity |
Methods inherited from interface com.metsci.glimpse.util.primitives.LongsModifiable |
---|
append, append, append, append, append, append, append, compact, insert, insert, insert, insert, insert, insert, insert, prepend, prepend, prepend, prepend, prepend, prepend, prepend, remove, set |
Methods inherited from interface com.metsci.glimpse.util.primitives.Longs |
---|
copyOf, copyOf, copyTo, first, isEmpty, last, n, v |
Constructor Detail |
---|
public SortedLongsArray(long[] a)
a
are not in ascending order, the behavior of
this instance is undefined.
For efficiency, does not clone the array arg.
public SortedLongsArray(int n)
public SortedLongsArray()
public SortedLongsArray(long[] a, int n)
a
are not in ascending order, the behavior of
this instance is undefined.
For efficiency, does not clone the array arg.
public SortedLongsArray(Longs xs)
xs
are not in ascending order, the behavior of
this instance is undefined.
Clones the sequence arg.
Method Detail |
---|
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 indexAfter(long x)
SortedLongs
indexAfter
in interface SortedLongs
public int indexAtOrAfter(long x)
SortedLongs
indexAtOrAfter
in interface SortedLongs
public int indexBefore(long x)
SortedLongs
indexBefore
in interface SortedLongs
public int indexAtOrBefore(long x)
SortedLongs
indexAtOrBefore
in interface SortedLongs
public void continuousIndexOf(long x, ContinuousIndex result)
SortedLongs
continuousIndexOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public ContinuousIndex continuousIndexOf(long x)
SortedLongs
continuousIndexOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public void continuousIndicesOf(Longs xs, ContinuousIndexArray result)
SortedLongs
continuousIndicesOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Longs xs)
SortedLongs
continuousIndicesOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedLongs xs, ContinuousIndexArray result)
SortedLongs
SortedLongs.continuousIndicesOf(Longs, ContinuousIndexArray)
in some implementations.
continuousIndicesOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedLongs xs)
SortedLongs
SortedLongs.continuousIndicesOf(Longs)
in some implementations.
continuousIndicesOf
in interface SortedLongs
java.lang.RuntimeException
- if n is less than 2ContinuousIndexArray
public int add(long v)
add
in interface SortedLongsModifiable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |