public class AreaVector extends AbstractDoubleVectorRel<AreaUnit,AreaVector,MutableAreaVector,Area>
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
data
Constructor and Description |
---|
AreaVector(Area[] values,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
AreaVector(double[] values,
AreaUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
AreaVector(DoubleVectorData data,
AreaUnit unit) |
AreaVector(List<Area> values,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
AreaVector(List<Double> values,
AreaUnit unit,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
AreaVector(SortedMap<Integer,Area> values,
int length,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
AreaVector(SortedMap<Integer,Double> values,
AreaUnit unit,
int length,
StorageType storageType)
Construct a new Relative Immutable Double AreaVector.
|
Modifier and Type | Method and Description |
---|---|
protected MutableAreaVector |
instantiateMutableType(DoubleVectorData dvd,
AreaUnit unit)
Construct a new Relative Mutable DoubleVector of the right type.
|
protected Area |
instantiateScalar(double value,
AreaUnit unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected AreaVector |
instantiateType(DoubleVectorData dvd,
AreaUnit unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
AreaVector |
toDense()
return a dense version of this vector.
|
AreaVector |
toSparse()
return a sparse version of this vector.
|
checkUnit, checkUnit, checkUnit, divide, get, 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
public AreaVector(double[] values, AreaUnit unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Relative Immutable Double AreaVectorunit
- U; the unit of the new Relative Immutable Double AreaVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic AreaVector(List<Double> values, AreaUnit unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Double AreaVectorunit
- U; the unit of the new Relative Immutable Double AreaVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullpublic AreaVector(Area[] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Immutable Double AreaVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic AreaVector(List<Area> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable Double AreaVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic AreaVector(SortedMap<Integer,Area> values, int length, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable Double AreaVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriespublic AreaVector(SortedMap<Integer,Double> values, AreaUnit unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable Double AreaVectorunit
- U; the unit of the new Relative Sparse Mutable Double AreaVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAreaVector(DoubleVectorData data, AreaUnit unit)
data
- an internal data objectunit
- the unitprotected final AreaVector instantiateType(DoubleVectorData dvd, AreaUnit unit)
instantiateType
in class AbstractDoubleVectorRel<AreaUnit,AreaVector,MutableAreaVector,Area>
dvd
- an internal data objectunit
- the unitprotected final MutableAreaVector instantiateMutableType(DoubleVectorData dvd, AreaUnit unit)
instantiateMutableType
in class AbstractDoubleVectorRel<AreaUnit,AreaVector,MutableAreaVector,Area>
dvd
- an internal data objectunit
- the unitprotected final Area instantiateScalar(double value, AreaUnit unit)
instantiateScalar
in class AbstractDoubleVectorRel<AreaUnit,AreaVector,MutableAreaVector,Area>
value
- the valueunit
- the unitpublic final AreaVector toDense()
public final AreaVector toSparse()
Copyright © 2015–2017 Delft University of Technology. All rights reserved.