public class FloatSpeedVector extends AbstractFloatVectorRel<SpeedUnit,FloatSpeedVector,MutableFloatSpeedVector,FloatSpeed>
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
AbstractFloatVectorRel.Itr
data
Constructor and Description |
---|
FloatSpeedVector(float[] values,
SpeedUnit unit,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
FloatSpeedVector(FloatSpeed[] values,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
FloatSpeedVector(FloatVectorData data,
SpeedUnit unit) |
FloatSpeedVector(List<Float> values,
SpeedUnit unit,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
FloatSpeedVector(List<FloatSpeed> values,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
FloatSpeedVector(SortedMap<Integer,Float> values,
SpeedUnit unit,
int length,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
FloatSpeedVector(SortedMap<Integer,FloatSpeed> values,
int length,
StorageType storageType)
Construct a new Relative Immutable Float FloatSpeedVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableFloatSpeedVector |
instantiateMutableType(FloatVectorData dvd,
SpeedUnit unit)
Construct a new Relative Mutable FloatVector of the right type.
|
protected FloatSpeed |
instantiateScalar(float value,
SpeedUnit unit)
Construct a new Relative Immutable FloatScalar of the right type.
|
protected FloatSpeedVector |
instantiateType(FloatVectorData dvd,
SpeedUnit unit)
Construct a new Relative Immutable FloatVector of the right type.
|
FloatSpeed[] |
toArray()
Return an array of FloatSpeed Scalars from this vector.
|
FloatSpeedVector |
toDense()
return a dense version of this vector.
|
FloatSpeedVector |
toSparse()
return a sparse version of this vector.
|
checkUnit, checkUnit, checkUnit, divide, get, iterator, minus, mutable, plus, times
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
public FloatSpeedVector(float[] values, SpeedUnit unit, StorageType storageType) throws ValueException
values
- float[]; the values of the entries in the new Relative Immutable Float FloatSpeedVectorunit
- U; the unit of the new Relative Immutable Float FloatSpeedVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic FloatSpeedVector(List<Float> values, SpeedUnit unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Float FloatSpeedVectorunit
- U; the unit of the new Relative Immutable Float FloatSpeedVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic FloatSpeedVector(FloatSpeed[] values, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Immutable Float FloatSpeedVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatSpeedVector(List<FloatSpeed> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Float FloatSpeedVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatSpeedVector(SortedMap<Integer,FloatSpeed> values, int length, StorageType storageType) throws ValueException
values
- FloatScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable Float
FloatSpeedVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic FloatSpeedVector(SortedMap<Integer,Float> values, SpeedUnit unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable Float FloatSpeedVectorunit
- U; the unit of the new Relative Sparse Mutable Float FloatSpeedVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullFloatSpeedVector(FloatVectorData data, SpeedUnit unit)
data
- an internal data objectunit
- the unitprotected final FloatSpeedVector instantiateType(FloatVectorData dvd, SpeedUnit unit)
instantiateType
in class AbstractFloatVectorRel<SpeedUnit,FloatSpeedVector,MutableFloatSpeedVector,FloatSpeed>
dvd
- an internal data objectunit
- the unitprotected final MutableFloatSpeedVector instantiateMutableType(FloatVectorData dvd, SpeedUnit unit)
instantiateMutableType
in class AbstractFloatVectorRel<SpeedUnit,FloatSpeedVector,MutableFloatSpeedVector,FloatSpeed>
dvd
- an internal data objectunit
- the unitprotected final FloatSpeed instantiateScalar(float value, SpeedUnit unit)
instantiateScalar
in class AbstractFloatVectorRel<SpeedUnit,FloatSpeedVector,MutableFloatSpeedVector,FloatSpeed>
value
- the valueunit
- the unitpublic final FloatSpeedVector toDense()
public final FloatSpeedVector toSparse()
public FloatSpeed[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2018 Delft University of Technology. All rights reserved.