Package org.apache.sis.math
Class ConcatenatedVector
- All Implemented Interfaces:
Serializable,Iterable<Number>,Collection<Number>,List<Number>,RandomAccess
A vector which is the concatenation of two other vectors.
- Since:
- 0.8
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final VectorThe vectors to concatenate.private final intThe length of the first vector.private final VectorThe vectors to concatenate.private static final longFor cross-version compatibility.Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConcatenatedVector(Vector first, Vector second) Creates a concatenated vector. -
Method Summary
Modifier and TypeMethodDescriptionbytebyteValue(int index) Returns the value at the given index.(package private) VectorcreateConcatenate(Vector toAppend) Delegates to the backing vectors since there is a chance that they override theirconcatenatemethod with a more efficient implementation.(package private) VectorcreateSubSampling(int first, int step, int length) Delegates to the backing vectors if possible.(package private) VectorcreateTransform(double scale, double offset) Delegates to the backing vectors since there is a chance that they override theirtransformmethod with a more efficient implementation.doubledoubleValue(int index) Returns the value at the given index.voidSets a range of elements to the given number.floatfloatValue(int index) Returns the value at the given index.get(int index) Returns the value at the given index.Returns the parent type of the two vectors.increment(double tolerance) Returns the increment between all consecutive values if this increment is constant, ornullotherwise.intintValue(int index) Returns the value at the given index.booleanReturnstrueif this vector is empty or contains onlyNaNvalues.booleanReturnstrueif this vector contains only integer values.booleanisNaN(int index) Returnstrueif the value at the given index isNaN.booleanReturnstrueonly if both vectors are unsigned.longlongValue(int index) Returns the value at the given index.NumberRange<?>range()Computes the minimal and maximal values in this vector.Sets the value at the given index.shortshortValue(int index) Returns the value at the given index.intsize()Returns the length of this vector.stringValue(int index) Returns the string representation at the given index.Methods inherited from class org.apache.sis.math.Vector
backingVector, buffer, compress, concatenate, copy, create, create, createForDecimal, createSequence, createSequence, doubleValues, equals, equals, floatValues, hashCode, indexOf, isSinglePrecision, pick, range, repeat, repetitions, reverse, 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:
-
first
The vectors to concatenate. -
second
The vectors to concatenate. -
limit
private final int limitThe length of the first vector.
-
-
Constructor Details
-
ConcatenatedVector
Creates a concatenated vector.- Parameters:
first- the vector for the lower indices.second- the vector for the higher indices.
-
-
Method Details
-
getElementType
Returns the parent type of the two vectors.- Specified by:
getElementTypein classVector- Returns:
- the type of elements in this vector.
- See Also:
-
isInteger
public boolean isInteger()Returnstrueif this vector contains only integer values. -
isUnsigned
public boolean isUnsigned()Returnstrueonly if both vectors are unsigned.- Overrides:
isUnsignedin classVector- Returns:
trueif the integer values shall be interpreted as unsigned values.
-
size
public int size()Returns the length of this vector. -
isEmptyOrNaN
public boolean isEmptyOrNaN()Returnstrueif this vector is empty or contains onlyNaNvalues.- Overrides:
isEmptyOrNaNin classVector- Returns:
- whether this vector is empty or contains only
NaNvalues.
-
isNaN
Returnstrueif the value at the given index isNaN.- Specified by:
isNaNin classVector- Parameters:
index- the index in the [0 … size-1] range.- Returns:
trueif the value at the given index isNaN.- Throws:
IndexOutOfBoundsException- if the given index is out of bounds.
-
doubleValue
public double doubleValue(int index) Returns the value at the given index.- Specified by:
doubleValuein classVector- Parameters:
index- the index in the [0 … size-1] range.- Returns:
- the value at the given index.
- See Also:
-
floatValue
public float floatValue(int index) Returns the value at the given index.- Overrides:
floatValuein classVector- Parameters:
index- the index in the [0 … size-1] range.- Returns:
- the value at the given index.
- See Also:
-
longValue
public long longValue(int index) Returns the value at the given index. -
intValue
public int intValue(int index) Returns the value at the given index. -
shortValue
public short shortValue(int index) Returns the value at the given index.- Overrides:
shortValuein classVector- Parameters:
index- the index in the [0 … size-1] range.- Returns:
- the value at the given index.
-
byteValue
public byte byteValue(int index) Returns the value at the given index. -
stringValue
Returns the string representation at the given index.- Specified by:
stringValuein classVector- Parameters:
index- the index in the [0 … size-1] range.- Returns:
- a string representation of the value at the given index (may be
null). - See Also:
-
get
Returns the value at the given index. -
set
Sets the value at the given index. -
fill
Sets a range of elements to the given number. -
increment
Returns the increment between all consecutive values if this increment is constant, ornullotherwise. -
range
Computes the minimal and maximal values in this vector. This is the union of the range of the two concatenated vectors. -
createSubSampling
Delegates to the backing vectors if possible.- Overrides:
createSubSamplingin classVector
-
createConcatenate
Delegates to the backing vectors since there is a chance that they override theirconcatenatemethod with a more efficient implementation.- Overrides:
createConcatenatein classVector
-
createTransform
Delegates to the backing vectors since there is a chance that they override theirtransformmethod with a more efficient implementation.- Overrides:
createTransformin classVector
-