public class MutableDirectionVector extends AbstractMutableDoubleVectorAbs<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 |
---|
MutableDirectionVector(Direction[] values,
StorageType storageType)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(double[] values,
DirectionUnit unit,
StorageType storageType)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(DoubleVectorData data,
DirectionUnit unit)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(List<Direction> values,
StorageType storageType)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(List<Double> values,
DirectionUnit unit,
StorageType storageType)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(SortedMap<Integer,Direction> values,
int length,
StorageType storageType)
Construct a new Absolute Mutable Double DirectionVector.
|
MutableDirectionVector(SortedMap<Integer,Double> values,
DirectionUnit unit,
int length,
StorageType storageType)
Construct a new Absolute Mutable 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.
|
MutableDirectionVector |
toDense()
return a dense version of this vector.
|
MutableDirectionVector |
toSparse()
return a sparse version of this vector.
|
assign, ceil, checkCopyOnWrite, copy, decrementBy, decrementBy, decrementBy, divideBy, floor, immutable, incrementBy, incrementBy, incrementBy, multiplyBy, multiplyBy, mutable, normalize, rint, round, set, setCopyOnWrite, setInUnit, setSI
checkUnit, checkUnit, checkUnit, get, iterator, minus, minus, 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
DIV, MULT, POW
cardinality, get, getInUnit, getInUnit, getSI, getValuesInUnit, getValuesInUnit, getValuesSI, size, toString, toString, toString, toString, zSum
forEach, spliterator
public MutableDirectionVector(double[] values, DirectionUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Absolute Mutable Double DirectionVectorunit
- U; the unit of the new Absolute Mutable Double DirectionVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutableDirectionVector(List<Double> values, DirectionUnit unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Absolute Mutable Double DirectionVectorunit
- U; the unit of the new Absolute Mutable Double DirectionVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic MutableDirectionVector(Direction[] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Absolute Mutable Double DirectionVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutableDirectionVector(List<Direction> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Absolute Mutable Double DirectionVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic MutableDirectionVector(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 MutableDirectionVector(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 nullMutableDirectionVector(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 MutableDirectionVector toDense()
public final MutableDirectionVector toSparse()
public Direction[] toArray()
RuntimeException
- wrapping a ValueException on error getting one of the valuesCopyright © 2015–2018 Delft University of Technology. All rights reserved.