Package org.apache.sis.math
Class ArrayVector<E extends Number>
- Type Parameters:
E
- the base type of elements in the vector.
- All Implemented Interfaces:
Serializable
,Iterable<Number>
,Collection<Number>
,List<Number>
,RandomAccess
,SequencedCollection<Number>
,CheckedContainer<E>
- Direct Known Subclasses:
ArrayVector.ASCII
,ArrayVector.Bytes
,ArrayVector.Doubles
,ArrayVector.Floats
,ArrayVector.Integers
,ArrayVector.Longs
,ArrayVector.Raw
,ArrayVector.Shorts
,PackedVector
abstract class ArrayVector<E extends Number>
extends Vector
implements CheckedContainer<E>, Serializable
A vector backed by an array of a primitive type. This class does not copy the array,
so changes in the underlying array is reflected in this vector and vice-versa.
- Since:
- 0.8
- Version:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
A vector backed by an array of typeString[]
.private static class
A vector backed by an array of typebyte[]
.(package private) static final class
A vector backed by an array of typefloat[]
to be converted todouble
in a way that minimizes the errors when represented in base 10.(package private) static final class
A vector backed by an array of typedouble[]
.private static class
A vector backed by an array of typefloat[]
.private static class
A vector backed by an array of typeint[]
.private static class
A vector backed by an array of typelong[]
.private static final class
A vector backed by an array of typeNumber[]
.private static class
A vector backed by an array of typeshort[]
.private static final class
A vector backed by an array of typebyte[]
to be interpreted as unsigned values.private static final class
A vector backed by an array of typeint[]
to be interpreted as unsigned values.private static final class
A vector backed by an array of typelong[]
to be interpreted as unsigned values.private static final class
A vector backed by an array of typeshort[]
to be interpreted as unsigned values. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static Vector
Returns a vector with the same data than the given vector but encoded in a more compact way, ornull
if this method cannot do better than the givenVector
instance.(package private) static Vector
Returns a vector with the same data than the given vector but encoded in a more compact way, ornull
if this method cannot do better than the givenVector
instance.boolean
isNaN
(int index) Default implementation for the convenience of wrapper of integer types.(package private) static Vector
newInstance
(Object array, boolean isUnsigned) Creates a new instance.(package private) void
verifyType
(Number value, byte expected) Verifies that the given value can be casted to the expected type.Methods inherited from class org.apache.sis.math.Vector
backingVector, buffer, byteValue, compress, concatenate, copy, create, create, createConcatenate, createForDecimal, createSequence, createSequence, createSubSampling, createTransform, doubleValue, doubleValues, equals, equals, fill, floatValue, floatValues, get, getElementType, hashCode, increment, indexOf, intValue, isEmptyOrNaN, isInteger, isSinglePrecision, isUnsigned, longValue, pick, range, range, repeat, repetitions, reverse, set, shortValue, size, 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 org.apache.sis.util.collection.CheckedContainer
getElementType
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:
-
-
Constructor Details
-
ArrayVector
ArrayVector()For sub-classes constructor.
-
-
Method Details
-
newInstance
Creates a new instance.- Throws:
IllegalArgumentException
- if the type of the given object is not recognized by the method.
-
compress
Returns a vector with the same data than the given vector but encoded in a more compact way, ornull
if this method cannot do better than the givenVector
instance. This method shall be invoked only for vector of integer values (this is not verified). -
compress
Returns a vector with the same data than the given vector but encoded in a more compact way, ornull
if this method cannot do better than the givenVector
instance. This method shall be invoked only for vector of floating point values (this is not verified). -
isNaN
public boolean isNaN(int index) Default implementation for the convenience of wrapper of integer types. -
verifyType
Verifies that the given value can be casted to the expected type. The expected type must be one of theNumbers
constants.
-