Package org.apache.sis.math
Class SequenceVector
- All Implemented Interfaces:
Serializable,Iterable<Number>,Collection<Number>,List<Number>,RandomAccess
- 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 classA vector which is a sequence of increasing or decreasingdoublevalues.(package private) static final classA vector which is a sequence of increasing or decreasingfloatvalues.(package private) static final classA vector which is a sequence of increasing or decreasinglongvalues. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final intThe length of this vector.private static final longFor 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 Vectorcompress(double tolerance) Returnsthissince Apache SIS cannot create a more compact vector than thisSequenceVector.(package private) final VectorcreateTransform(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 booleanReturnstrueif this vector is empty or contains onlyNaNvalues.final NumberUnsupported operation since this vector is not modifiable.final intsize()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, warningMethods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRangeMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, 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 ofDoubletype, regardless the type of elements in this vector.- Overrides:
createTransformin classVector
-
getElementType
Returns the type of elements.- Specified by:
getElementTypein 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()Returnstrueif this vector is empty or contains onlyNaNvalues.- Overrides:
isEmptyOrNaNin classVector- Returns:
- whether this vector is empty or contains only
NaNvalues.
-
set
Unsupported operation since this vector is not modifiable. -
compress
Returnsthissince Apache SIS cannot create a more compact vector than thisSequenceVector. -
doubleValues
public double[] doubleValues()Creates the sequence as a floating point array.- Overrides:
doubleValuesin 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:
floatValuesin classVector- Returns:
- a copy of all floating point values in this vector.
- See Also:
-