U
- the unitR
- the relative vector typeMR
- the mutable relative vector typeS
- the relative scalar typeabstract class AbstractFloatVectorRel<U extends Unit<U>,R extends AbstractFloatVectorRel<U,R,MR,S>,MR extends AbstractMutableFloatVectorRel<U,R,MR,S>,S extends AbstractFloatScalarRel<U,S>> extends AbstractFloatVector<U,R> implements Relative, Serializable, Iterable<S>
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2015-09-29 14:14:28 +0200 (Tue, 29 Sep 2015) $, @version $Revision: 73 $, by $Author: pknoppers $, initial
version Sep 5, 2015
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractFloatVectorRel.Itr
The iterator class is loosely based in AbstractList.Itr.
|
data
Constructor and Description |
---|
AbstractFloatVectorRel(float[] values,
U unit,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(FloatVectorData data,
U unit)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(List<Float> values,
U unit,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(List<S> values,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(S[] values,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(SortedMap<Integer,Float> values,
U unit,
int length,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
AbstractFloatVectorRel(SortedMap<Integer,S> values,
int length,
StorageType storageType)
Construct a new Relative Immutable FloatVector.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> |
checkUnit(AbstractFloatScalarRel<U,S>[] dsArray)
Check that a provided array can be used to create some descendant of a FloatVector, and return the Unit.
|
(package private) static <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> |
checkUnit(List<S> dsList)
Check that a provided list can be used to create some descendant of a FloatVector, and return the Unit.
|
(package private) static <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> |
checkUnit(SortedMap<Integer,S> dsMap)
Check that a provided Map can be used to create some descendant of a FloatVector.
|
R |
divide(R rel)
Divide this Relative value by a Relative value for a vector or matrix.
|
S |
get(int index)
Retrieve a value from the vector.
|
protected abstract MR |
instantiateMutableType(FloatVectorData dvd,
U unit)
Construct a new Relative Mutable FloatVector of the right type.
|
protected abstract S |
instantiateScalar(float value,
U unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
protected abstract R |
instantiateType(FloatVectorData dvd,
U unit)
Construct a new Relative Immutable FloatVector of the right type.
|
Iterator<S> |
iterator()
Returns an iterator over the scalars in this vector in proper sequence.
|
R |
minus(R rel)
Subtract a Relative value from this Relative value for a vector or matrix.
|
MR |
mutable()
Create a mutable version of this FloatVector.
|
R |
plus(R rel)
Add a Relative value to this Relative value for a vector or matrix.
|
R |
times(R rel)
Multiply a Relative value with this Relative value for a vector or matrix.
|
cardinality, checkIndex, checkSize, checkSize, equals, getData, getInUnit, getInUnit, getSI, getStorageType, getValuesInUnit, getValuesInUnit, getValuesSI, hashCode, size, toString, toString, toString, toString, zSum
expressAsSIUnit, expressAsSpecifiedUnit, getUnit, isAbsolute, isRelative, setDisplayUnit
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
toDense, toSparse
AbstractFloatVectorRel(float[] values, U unit, StorageType storageType) throws ValueException
values
- float[]; the values of the entries in the new Relative Immutable FloatVectorunit
- U; the unit of the new Relative Immutable FloatVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractFloatVectorRel(List<Float> values, U unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable FloatVectorunit
- U; the unit of the new Relative Immutable FloatVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractFloatVectorRel(S[] values, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Immutable FloatVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractFloatVectorRel(List<S> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable FloatVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractFloatVectorRel(SortedMap<Integer,S> values, int length, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable FloatVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractFloatVectorRel(SortedMap<Integer,Float> values, U unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable FloatVectorunit
- U; the unit of the new Relative Sparse Mutable FloatVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractFloatVectorRel(FloatVectorData data, U unit)
data
- an internal data objectunit
- the unitpublic MR mutable()
mutable
in interface FloatVectorInterface<U extends Unit<U>>
protected abstract R instantiateType(FloatVectorData dvd, U unit)
dvd
- an internal data objectunit
- the unitprotected abstract MR instantiateMutableType(FloatVectorData dvd, U unit)
dvd
- an internal data objectunit
- the unitprotected abstract S instantiateScalar(float value, U unit)
value
- the valueunit
- the unitpublic S get(int index) throws ValueException
get
in class AbstractFloatVector<U extends Unit<U>,R extends AbstractFloatVectorRel<U,R,MR,S>>
index
- the index to retrieve the value atValueException
- in case index is out of boundspublic final R plus(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R minus(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R times(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R divide(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizestatic <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> U checkUnit(AbstractFloatScalarRel<U,S>[] dsArray) throws ValueException
U
- the unitS
- the scalar typedsArray
- the array to check and get the unit forValueException
- when the array has length equal to 0static <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> U checkUnit(List<S> dsList) throws ValueException
U
- the unitS
- the scalar in the listdsList
- the list to check and get the unit forValueException
- when the array has length equal to 0static <U extends Unit<U>,S extends AbstractFloatScalarRel<U,S>> U checkUnit(SortedMap<Integer,S> dsMap) throws ValueException
U
- Unit; the unit of the FloatScalar listS
- the scalar in the listdsMap
- the provided mapValueException
- when the list has size equal to 0Copyright © 2015–2018 Delft University of Technology. All rights reserved.