Package org.apache.sis.math
Class SequenceVector
- All Implemented Interfaces:
Serializable
,Iterable<Number>
,Collection<Number>
,List<Number>
,RandomAccess
,SequencedCollection<Number>
- Direct Known Subclasses:
SequenceVector.Doubles
,SequenceVector.Longs
A vector which is a sequence of increasing or decreasing values.
Values may be
long
or double
types.- Since:
- 0.8
- Version:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
A vector which is a sequence of increasing or decreasingdouble
values.(package private) static final class
A vector which is a sequence of increasing or decreasingfloat
values.(package private) static final class
A vector which is a sequence of increasing or decreasinglong
values. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
The length of this vector.private static final long
For cross-version compatibility.The type of values in the vector.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionSequenceVector
(Class<? extends Number> type, int length) Creates a sequence of numbers of the given length. -
Method Summary
Modifier and TypeMethodDescriptionfinal Vector
compress
(double tolerance) Returnsthis
since Apache SIS cannot create a more compact vector than thisSequenceVector
.(package private) final Vector
createTransform
(double scale, double offset) Transforms the sequence.double[]
Creates the sequence as a floating point array.float[]
Creates the sequence as a floating point array.Returns the type of elements.final boolean
Returnstrue
if this vector is empty or contains onlyNaN
values.final Number
Unsupported operation since this vector is not modifiable.final int
size()
Returns the vector size.Methods inherited from class org.apache.sis.math.Vector
backingVector, buffer, byteValue, concatenate, copy, create, create, createConcatenate, createForDecimal, createSequence, createSequence, createSubSampling, doubleValue, equals, equals, fill, floatValue, get, hashCode, increment, indexOf, intValue, isInteger, isNaN, isSinglePrecision, isUnsigned, longValue, pick, range, range, repeat, repetitions, reverse, shortValue, stringValue, subList, subSampling, subtract, toBacking, toString, transform, warning
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
type
The type of values in the vector. -
length
final int lengthThe length of this vector.
-
-
Constructor Details
-
SequenceVector
Creates a sequence of numbers of the given length.
-
-
Method Details
-
createTransform
Transforms the sequence. The result is always ofDouble
type, regardless the type of elements in this vector.- Overrides:
createTransform
in classVector
-
getElementType
Returns the type of elements.- Specified by:
getElementType
in classVector
- Returns:
- the type of elements in this vector.
- See Also:
-
size
public final int size()Returns the vector size. -
isEmptyOrNaN
public final boolean isEmptyOrNaN()Returnstrue
if this vector is empty or contains onlyNaN
values.- Overrides:
isEmptyOrNaN
in classVector
- Returns:
- whether this vector is empty or contains only
NaN
values.
-
set
Unsupported operation since this vector is not modifiable. -
compress
Returnsthis
since Apache SIS cannot create a more compact vector than thisSequenceVector
. -
doubleValues
public double[] doubleValues()Creates the sequence as a floating point array.- Overrides:
doubleValues
in classVector
- Returns:
- a copy of all floating point values in this vector.
- See Also:
-
floatValues
public float[] floatValues()Creates the sequence as a floating point array.- Overrides:
floatValues
in classVector
- Returns:
- a copy of all floating point values in this vector.
- See Also:
-