public class SortedLongsArray extends LongsArray implements SortedLongsModifiable
a, n
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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)
|
append, append, append, append, append, append, append, clear, compact, copyOf, copyOf, copyTo, copyTo, 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, removeIndex, removeRange, set, set, set, v
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append, append, append, append, append, append, append, clear, compact, ensureCapacity, insert, insert, insert, insert, insert, insert, insert, prepend, prepend, prepend, prepend, prepend, prepend, prepend, remove, removeIndex, removeRange, set, set, set
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.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
RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public ContinuousIndex continuousIndexOf(long x)
SortedLongs
continuousIndexOf
in interface SortedLongs
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
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Longs xs)
SortedLongs
continuousIndicesOf
in interface SortedLongs
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
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedLongs xs)
SortedLongs
SortedLongs.continuousIndicesOf(Longs)
in some implementations.continuousIndicesOf
in interface SortedLongs
RuntimeException
- if n is less than 2ContinuousIndexArray
public int add(long v)
add
in interface SortedLongsModifiable
Copyright © 2016 Metron, Inc.. All rights reserved.