public class SortedIntsArray extends IntsArray implements SortedIntsModifiable
Constructor and Description |
---|
SortedIntsArray() |
SortedIntsArray(int n) |
SortedIntsArray(int[] a)
If the values of
a are not in ascending order, the behavior of
this instance is undefined. |
SortedIntsArray(int[] a,
int n)
If the values of
a are not in ascending order, the behavior of
this instance is undefined. |
SortedIntsArray(Ints 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(int v) |
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 |
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 |
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)
|
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 SortedIntsArray(int[] a)
a
are not in ascending order, the behavior of
this instance is undefined.
For efficiency, does not clone the array arg.public SortedIntsArray(int n)
public SortedIntsArray()
public SortedIntsArray(int[] 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 SortedIntsArray(Ints xs)
xs
are not in ascending order, the behavior of
this instance is undefined.
Clones the sequence arg.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 indexAfter(int x)
SortedInts
indexAfter
in interface SortedInts
public int indexAtOrAfter(int x)
SortedInts
indexAtOrAfter
in interface SortedInts
public int indexBefore(int x)
SortedInts
indexBefore
in interface SortedInts
public int indexAtOrBefore(int x)
SortedInts
indexAtOrBefore
in interface SortedInts
public void continuousIndexOf(int x, ContinuousIndex result)
SortedInts
continuousIndexOf
in interface SortedInts
RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public ContinuousIndex continuousIndexOf(int x)
SortedInts
continuousIndexOf
in interface SortedInts
RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public void continuousIndicesOf(Ints xs, ContinuousIndexArray result)
SortedInts
continuousIndicesOf
in interface SortedInts
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Ints xs)
SortedInts
continuousIndicesOf
in interface SortedInts
RuntimeException
- if n is less than 2com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedInts xs, ContinuousIndexArray result)
SortedInts
SortedInts.continuousIndicesOf(Ints, ContinuousIndexArray)
in some implementations.continuousIndicesOf
in interface SortedInts
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedInts xs)
SortedInts
SortedInts.continuousIndicesOf(Ints)
in some implementations.continuousIndicesOf
in interface SortedInts
RuntimeException
- if n is less than 2ContinuousIndexArray
public int add(int v)
add
in interface SortedIntsModifiable
Copyright © 2016 Metron, Inc.. All rights reserved.