public class DirectionVector extends AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
Copyright (c) 2013-2019 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
AbstractDoubleVectorAbs.Itr
data
Constructor and Description |
---|
DirectionVector(Direction[] values,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(double[] values,
DirectionUnit unit,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(DoubleVectorData data,
DirectionUnit unit)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(List<Direction> values,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(List<Double> values,
DirectionUnit unit,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(SortedMap<Integer,Direction> values,
int length,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
DirectionVector(SortedMap<Integer,Double> values,
DirectionUnit unit,
int length,
StorageType storageType)
Construct a new Absolute Immutable Double DirectionVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableDirectionVector |
instantiateMutableType(DoubleVectorData dvd,
DirectionUnit unit)
Construct a new Absolute Mutable DoubleVector of the right type.
|
protected Direction |
instantiateScalar(double value,
DirectionUnit unit)
Construct a new Absolute Immutable DoubleScalar of the right type.
|
protected DirectionVector |
instantiateTypeAbs(DoubleVectorData dvd,
DirectionUnit unit)
Construct a new Absolute Immutable DoubleVector of the right type.
|
protected AngleVector |
instantiateTypeRel(DoubleVectorData dvd,
AngleUnit unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
Direction[] |
toArray()
Return an array of Direction Scalars from this vector.
|
DirectionVector |
toDense()
return a dense version of this vector.
|
DirectionVector |
toSparse()
return a sparse version of this vector.
|
checkUnit, checkUnit, checkUnit, get, iterator, minus, minus, mutable, plus
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 DirectionVector(double[] values, DirectionUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Absolute Immutable Double DirectionVectorunit
- DirectionUnit; the unit of the new Absolute Immutable Double DirectionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DirectionVector(List<Double> values, DirectionUnit unit, StorageType storageType) throws ValueException
values
- List<Double>; the values of the entries in the new Absolute Immutable Double DirectionVectorunit
- DirectionUnit; the unit of the new Absolute Immutable Double DirectionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DirectionVector(Direction[] values, StorageType storageType) throws ValueException
values
- Direction[]; the values of the entries in the new Absolute Immutable Double DirectionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DirectionVector(List<Direction> values, StorageType storageType) throws ValueException
values
- List<Direction>; the values of the entries in the new Absolute Immutable Double DirectionVectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DirectionVector(SortedMap<Integer,Direction> values, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Direction>; the values of the entries in the new Absolute Sparse Mutable Double
DirectionVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic DirectionVector(SortedMap<Integer,Double> values, DirectionUnit unit, int length, StorageType storageType) throws ValueException
values
- SortedMap<Integer, Double>; the map of indexes to values of the Absolute Sparse Mutable Double
DirectionVectorunit
- DirectionUnit; the unit of the new Absolute Sparse Mutable Double DirectionVectorlength
- int; the size of the vectorstorageType
- StorageType; the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullDirectionVector(DoubleVectorData data, DirectionUnit unit)
data
- DoubleVectorData; an internal data objectunit
- DirectionUnit; the unitprotected final DirectionVector instantiateTypeAbs(DoubleVectorData dvd, DirectionUnit unit)
instantiateTypeAbs
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- DoubleVectorData; an internal data objectunit
- AU; the unitprotected final AngleVector instantiateTypeRel(DoubleVectorData dvd, AngleUnit unit)
instantiateTypeRel
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- DoubleVectorData; an internal data objectunit
- RU; the unitprotected final MutableDirectionVector instantiateMutableType(DoubleVectorData dvd, DirectionUnit unit)
instantiateMutableType
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- DoubleVectorData; an internal data objectunit
- AU; the unitprotected final Direction instantiateScalar(double value, DirectionUnit unit)
instantiateScalar
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
value
- double; the valueunit
- AU; the unitpublic final DirectionVector toDense()
public final DirectionVector toSparse()
public Direction[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2019 Delft University of Technology. All rights reserved.