Package org.apache.sis.math
Class ArrayVector.Decimal
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<Number>
org.apache.sis.math.Vector
org.apache.sis.math.ArrayVector<Float>
org.apache.sis.math.ArrayVector.Floats
org.apache.sis.math.ArrayVector.Decimal
- All Implemented Interfaces:
Serializable
,Iterable<Number>
,Collection<Number>
,List<Number>
,RandomAccess
,CheckedContainer<Float>
- Enclosing class:
- ArrayVector<E extends Number>
A vector backed by an array of type
float[]
to be converted to double
in a way that minimizes
the errors when represented in base 10. This implementation should be used only when there is good reasons to
believe that the float
data where encoded in base 10 in the first place (for example in an ASCII file).-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.math.ArrayVector
ArrayVector.Decimal, ArrayVector.Doubles
-
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) NumberRange<?>
createRange
(float min, float max) Creates a range from the given minimum and maximum values.double
doubleValue
(int index) Returns the value at the given index.get
(int index) Returns the value at the given index.int
hashCode()
Applies hash code contract specifiedVector.hashCode()
.boolean
Returns whether values are convertible tofloat
type.Methods inherited from class org.apache.sis.math.ArrayVector.Floats
buffer, equals, fill, floatValue, floatValues, getElementType, indexOf, isEmptyOrNaN, isNaN, range, set, size, stringValue
Methods inherited from class org.apache.sis.math.ArrayVector
compress, compress, newInstance, verifyType
Methods inherited from class org.apache.sis.math.Vector
backingVector, byteValue, compress, concatenate, copy, create, create, createConcatenate, createForDecimal, createSequence, createSequence, createSubSampling, createTransform, doubleValues, equals, increment, intValue, isInteger, isUnsigned, longValue, pick, range, repeat, repetitions, reverse, shortValue, 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, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Decimal
Decimal(float[] array) Creates a new vector for the given array.
-
-
Method Details
-
isSinglePrecision
public boolean isSinglePrecision()Returns whether values are convertible tofloat
type.- Overrides:
isSinglePrecision
in classArrayVector.Floats
- Returns:
- whether values in this vector can be casted to
float
primitive type. - See Also:
-
doubleValue
public double doubleValue(int index) Returns the value at the given index.- Overrides:
doubleValue
in classArrayVector.Floats
- Parameters:
index
- the index in the [0 … size-1] range.- Returns:
- the value at the given index.
- See Also:
-
get
Returns the value at the given index. -
createRange
Creates a range from the given minimum and maximum values.- Overrides:
createRange
in classArrayVector.Floats
-
hashCode
public int hashCode()Applies hash code contract specifiedVector.hashCode()
.- Specified by:
hashCode
in interfaceCollection<Number>
- Specified by:
hashCode
in interfaceList<Number>
- Overrides:
hashCode
in classArrayVector.Floats
- Returns:
- a hash code value for the values in this vector.
-