U
- the unitR
- the relative vector typeMR
- the mutable relative vector typeS
- the relative scalar typeabstract class AbstractDoubleVectorRel<U extends Unit<U>,R extends AbstractDoubleVectorRel<U,R,MR,S>,MR extends AbstractMutableDoubleVectorRel<U,R,MR,S>,S extends AbstractDoubleScalarRel<U,S>> extends AbstractDoubleVector<U,R> implements Relative, Serializable, Iterable<S>
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
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractDoubleVectorRel.Itr
The iterator class is loosely based in AbstractList.Itr.
|
data
Constructor and Description |
---|
AbstractDoubleVectorRel(double[] values,
U unit,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(DoubleVectorData data,
U unit)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(List<Double> values,
U unit,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(List<S> values,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(S[] values,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(SortedMap<Integer,Double> values,
U unit,
int length,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
AbstractDoubleVectorRel(SortedMap<Integer,S> values,
int length,
StorageType storageType)
Construct a new Relative Immutable DoubleVector.
|
Modifier and Type | Method and Description |
---|---|
(package private) static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> |
checkUnit(AbstractDoubleScalarRel<U,S>[] dsArray)
Check that a provided array can be used to create some descendant of a DoubleVector, and return the Unit.
|
(package private) static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> |
checkUnit(List<S> dsList)
Check that a provided list can be used to create some descendant of a DoubleVector, and return the Unit.
|
(package private) static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> |
checkUnit(SortedMap<Integer,S> dsMap)
Check that a provided Map can be used to create some descendant of a DoubleVector.
|
R |
divide(R rel)
Divide this Relative value by a Relative value for a vector or matrix.
|
S |
get(int index)
Retrieve a value from the vector.
|
protected abstract MR |
instantiateMutableType(DoubleVectorData dvd,
U unit)
Construct a new Relative Mutable DoubleVector of the right type.
|
protected abstract S |
instantiateScalar(double value,
U unit)
Construct a new Relative Immutable DoubleScalar of the right type.
|
protected abstract R |
instantiateType(DoubleVectorData dvd,
U unit)
Construct a new Relative Immutable DoubleVector of the right type.
|
Iterator<S> |
iterator()
Returns an iterator over the scalars in this vector in proper sequence.
|
R |
minus(R rel)
Subtract a Relative value from this Relative value for a vector or matrix.
|
MR |
mutable()
Create a mutable version of this DoubleVector.
|
R |
plus(R rel)
Add a Relative value to this Relative value for a vector or matrix.
|
R |
times(R rel)
Multiply a Relative value with this Relative value for a vector or matrix.
|
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
toDense, toSparse
AbstractDoubleVectorRel(double[] values, U unit, StorageType storageType) throws ValueException
values
- double[]; the values of the entries in the new Relative Immutable DoubleVectorunit
- U; the unit of the new Relative Immutable DoubleVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractDoubleVectorRel(List<Double> values, U unit, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable DoubleVectorunit
- U; the unit of the new Relative Immutable DoubleVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractDoubleVectorRel(S[] values, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Immutable DoubleVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractDoubleVectorRel(List<S> values, StorageType storageType) throws ValueException
values
- List; the values of the entries in the new Relative Immutable DoubleVectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractDoubleVectorRel(SortedMap<Integer,S> values, int length, StorageType storageType) throws ValueException
values
- DoubleScalar.Rel<U>[]; the values of the entries in the new Relative Sparse Mutable DoubleVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values has zero entriesAbstractDoubleVectorRel(SortedMap<Integer,Double> values, U unit, int length, StorageType storageType) throws ValueException
values
- Map; the map of indexes to values of the Relative Sparse Mutable DoubleVectorunit
- U; the unit of the new Relative Sparse Mutable DoubleVectorlength
- the size of the vectorstorageType
- the data type to use (e.g., DENSE or SPARSE)ValueException
- when values is nullAbstractDoubleVectorRel(DoubleVectorData data, U unit)
data
- an internal data objectunit
- the unitpublic MR mutable()
mutable
in interface DoubleVectorInterface<U extends Unit<U>>
protected abstract R instantiateType(DoubleVectorData dvd, U unit)
dvd
- an internal data objectunit
- the unitprotected abstract MR instantiateMutableType(DoubleVectorData dvd, U unit)
dvd
- an internal data objectunit
- the unitprotected abstract S instantiateScalar(double value, U unit)
value
- the valueunit
- the unitpublic final S get(int index) throws ValueException
get
in interface DoubleVectorInterface<U extends Unit<U>>
index
- the index to retrieve the value atValueException
- in case index is out of boundspublic final R plus(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R minus(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R times(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizepublic final R divide(R rel) throws ValueException
rel
- the right operandValueException
- in case this vector or matrix and the operand have a different sizestatic <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> U checkUnit(AbstractDoubleScalarRel<U,S>[] dsArray) throws ValueException
U
- the unitS
- the scalar typedsArray
- the array to check and get the unit forValueException
- when the array has length equal to 0static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> U checkUnit(List<S> dsList) throws ValueException
U
- the unitS
- the scalar in the listdsList
- the list to check and get the unit forValueException
- when the array has length equal to 0static <U extends Unit<U>,S extends AbstractDoubleScalarRel<U,S>> U checkUnit(SortedMap<Integer,S> dsMap) throws ValueException
U
- Unit; the unit of the DoubleScalar listS
- the scalar in the listdsMap
- the provided mapValueException
- when the list has size equal to 0Copyright © 2015–2018 Delft University of Technology. All rights reserved.