public class SortedDoublesArray extends DoublesArray implements SortedDoublesModifiable
a, n
Constructor and Description |
---|
SortedDoublesArray() |
SortedDoublesArray(double[] a)
If the values of
a are not in ascending order, the behavior of
this instance is undefined. |
SortedDoublesArray(double[] a,
int n)
If the values of
a are not in ascending order, the behavior of
this instance is undefined. |
SortedDoublesArray(Doubles xs)
If the values of
xs are not in ascending order, the behavior of
this instance is undefined. |
SortedDoublesArray(int n) |
Modifier and Type | Method and Description |
---|---|
int |
add(double v) |
ContinuousIndex |
continuousIndexOf(double x)
The continuous index at which x falls in this sequence.
|
void |
continuousIndexOf(double x,
ContinuousIndex result)
The continuous index at which x falls in this sequence.
|
ContinuousIndexArray |
continuousIndicesOf(Doubles xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(Doubles xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
ContinuousIndexArray |
continuousIndicesOf(SortedDoubles xs)
For each x in xs, the continuous index at which x falls in this
sequence.
|
void |
continuousIndicesOf(SortedDoubles xs,
ContinuousIndexArray result)
For each x in xs, the continuous index at which x falls in this
sequence.
|
int |
indexAfter(double x)
Smallest index whose value is greater than x
|
int |
indexAtOrAfter(double x)
Smallest index whose value is greater than or equal to x
|
int |
indexAtOrBefore(double x)
Largest index whose value is less than or equal to x
|
int |
indexBefore(double x)
Largest index whose value is less than x
|
int |
indexNearest(double x)
Index of the value closest to x.
|
int |
indexOf(double x)
Follows the convention of
Arrays.binarySearch(double[], double) :
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 SortedDoublesArray(double[] a)
a
are not in ascending order, the behavior of
this instance is undefined.
For efficiency, does not clone the array arg.public SortedDoublesArray(int n)
public SortedDoublesArray()
public SortedDoublesArray(double[] 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 SortedDoublesArray(Doubles xs)
xs
are not in ascending order, the behavior of
this instance is undefined.
Clones the sequence arg.public int indexOf(double x)
SortedDoubles
Arrays.binarySearch(double[], double)
:
x
is contained in this sequence, returns the index of x
indexOf
in interface SortedDoubles
Arrays.binarySearch(double[], double)
public int indexNearest(double x)
SortedDoubles
indexNearest
in interface SortedDoubles
public int indexAfter(double x)
SortedDoubles
indexAfter
in interface SortedDoubles
public int indexAtOrAfter(double x)
SortedDoubles
indexAtOrAfter
in interface SortedDoubles
public int indexBefore(double x)
SortedDoubles
indexBefore
in interface SortedDoubles
public int indexAtOrBefore(double x)
SortedDoubles
indexAtOrBefore
in interface SortedDoubles
public void continuousIndexOf(double x, ContinuousIndex result)
SortedDoubles
continuousIndexOf
in interface SortedDoubles
RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public ContinuousIndex continuousIndexOf(double x)
SortedDoubles
continuousIndexOf
in interface SortedDoubles
RuntimeException
- if n is less than 2 and the exact value is not foundContinuousIndex
public void continuousIndicesOf(Doubles xs, ContinuousIndexArray result)
SortedDoubles
continuousIndicesOf
in interface SortedDoubles
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(Doubles xs)
SortedDoubles
continuousIndicesOf
in interface SortedDoubles
RuntimeException
- if n is less than 2com.metsci.tracks.ContinuousIndexArray
public void continuousIndicesOf(SortedDoubles xs, ContinuousIndexArray result)
SortedDoubles
SortedDoubles.continuousIndicesOf(Doubles, ContinuousIndexArray)
in some implementations.continuousIndicesOf
in interface SortedDoubles
RuntimeException
- if n is less than 2ContinuousIndexArray
public ContinuousIndexArray continuousIndicesOf(SortedDoubles xs)
SortedDoubles
SortedDoubles.continuousIndicesOf(Doubles)
in some implementations.continuousIndicesOf
in interface SortedDoubles
RuntimeException
- if n is less than 2ContinuousIndexArray
public int add(double v)
add
in interface SortedDoublesModifiable
Copyright © 2016 Metron, Inc.. All rights reserved.