public class DirectionVector extends AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
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
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
- U; the unit of the new Absolute Immutable Double DirectionVectorstorageType
- 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; the values of the entries in the new Absolute Immutable Double DirectionVectorunit
- U; the unit of the new Absolute Immutable Double DirectionVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic DirectionVector(Direction[] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Absolute Immutable Double DirectionVectorstorageType
- 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; the values of the entries in the new Absolute Immutable Double DirectionVectorstorageType
- 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
- DoubleScalar.Rel<U>[]; the values of the entries in the new Absolute Sparse Mutable Double
DirectionVectorlength
- the size of the vectorstorageType
- 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
- Map; the map of indexes to values of the Absolute Sparse Mutable Double DirectionVectorunit
- U; the unit of the new Absolute Sparse Mutable Double DirectionVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullDirectionVector(DoubleVectorData data, DirectionUnit unit)
data
- an internal data objectunit
- the unitprotected final DirectionVector instantiateTypeAbs(DoubleVectorData dvd, DirectionUnit unit)
instantiateTypeAbs
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- an internal data objectunit
- the unitprotected final AngleVector instantiateTypeRel(DoubleVectorData dvd, AngleUnit unit)
instantiateTypeRel
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- an internal data objectunit
- the unitprotected final MutableDirectionVector instantiateMutableType(DoubleVectorData dvd, DirectionUnit unit)
instantiateMutableType
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
dvd
- an internal data objectunit
- the unitprotected final Direction instantiateScalar(double value, DirectionUnit unit)
instantiateScalar
in class AbstractDoubleVectorAbs<DirectionUnit,AngleUnit,DirectionVector,AngleVector,MutableDirectionVector,Direction>
value
- the valueunit
- the unitpublic final DirectionVector toDense()
public final DirectionVector toSparse()
public Direction[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2018 Delft University of Technology. All rights reserved.