Package org.djunits.value.base
Interface Vector<U extends Unit<U>,S extends Scalar<U,S>,V extends Vector<U,S,V>>
-
- Type Parameters:
U
- the unitS
- the scalar type belonging to the vector typeV
- the vector type with the given unit
- All Superinterfaces:
Cloneable
,IndexedValue<U,S,V>
,Iterable<S>
,Serializable
,Value<U,V>
,ValueFunctions<U,V>
- All Known Subinterfaces:
DoubleVectorInterface<U,S,V>
,FloatVectorInterface<U,S,V>
,Vector.Abs<AU,A,AV,RU,R,RV>
,Vector.Rel<U,S,RV>
,Vector.RelWithAbs<AU,A,AV,RU,R,RV>
- All Known Implementing Classes:
AbsoluteTemperatureVector
,AbsorbedDoseVector
,AbstractDoubleVector
,AbstractDoubleVectorAbs
,AbstractDoubleVectorRel
,AbstractDoubleVectorRelWithAbs
,AbstractFloatVector
,AbstractFloatVectorAbs
,AbstractFloatVectorRel
,AbstractFloatVectorRelWithAbs
,AccelerationVector
,AmountOfSubstanceVector
,AngleVector
,AngularAccelerationVector
,AngularVelocityVector
,AreaVector
,CatalyticActivityVector
,DensityVector
,DimensionlessVector
,DirectionVector
,DurationVector
,ElectricalCapacitanceVector
,ElectricalChargeVector
,ElectricalConductanceVector
,ElectricalCurrentVector
,ElectricalInductanceVector
,ElectricalPotentialVector
,ElectricalResistanceVector
,EnergyVector
,EquivalentDoseVector
,FloatAbsoluteTemperatureVector
,FloatAbsorbedDoseVector
,FloatAccelerationVector
,FloatAmountOfSubstanceVector
,FloatAngleVector
,FloatAngularAccelerationVector
,FloatAngularVelocityVector
,FloatAreaVector
,FloatCatalyticActivityVector
,FloatDensityVector
,FloatDimensionlessVector
,FloatDirectionVector
,FloatDurationVector
,FloatElectricalCapacitanceVector
,FloatElectricalChargeVector
,FloatElectricalConductanceVector
,FloatElectricalCurrentVector
,FloatElectricalInductanceVector
,FloatElectricalPotentialVector
,FloatElectricalResistanceVector
,FloatEnergyVector
,FloatEquivalentDoseVector
,FloatFlowMassVector
,FloatFlowVolumeVector
,FloatForceVector
,FloatFrequencyVector
,FloatIlluminanceVector
,FloatLengthVector
,FloatLinearDensityVector
,FloatLuminousFluxVector
,FloatLuminousIntensityVector
,FloatMagneticFluxDensityVector
,FloatMagneticFluxVector
,FloatMassVector
,FloatMomentumVector
,FloatPositionVector
,FloatPowerVector
,FloatPressureVector
,FloatRadioActivityVector
,FloatSIVector
,FloatSolidAngleVector
,FloatSpeedVector
,FloatTemperatureVector
,FloatTimeVector
,FloatTorqueVector
,FloatVolumeVector
,FlowMassVector
,FlowVolumeVector
,ForceVector
,FrequencyVector
,IlluminanceVector
,LengthVector
,LinearDensityVector
,LuminousFluxVector
,LuminousIntensityVector
,MagneticFluxDensityVector
,MagneticFluxVector
,MassVector
,MomentumVector
,PositionVector
,PowerVector
,PressureVector
,RadioActivityVector
,SIVector
,SolidAngleVector
,SpeedVector
,TemperatureVector
,TimeVector
,TorqueVector
,VolumeVector
public interface Vector<U extends Unit<U>,S extends Scalar<U,S>,V extends Vector<U,S,V>> extends IndexedValue<U,S,V>, Iterable<S>
Vector to distinguish a vector from vectors and matrices. A possible way to implement this interface is:class LengthVector implements Vector<LengthUnit, Length, LengthVector>
Copyright (c) 2019-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.- Author:
- Alexander Verbraeck
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Vector.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>
Methods for Absolute Vector.static interface
Vector.Rel<U extends Unit<U>,S extends Scalar<U,S>,RV extends Vector.Rel<U,S,RV>>
Methods for Relative Vector.static interface
Vector.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar<AU,A>,AV extends Vector.Abs<AU,A,AV,RU,R,RV>,RU extends Unit<RU>,R extends Scalar<RU,R>,RV extends Vector.RelWithAbs<AU,A,AV,RU,R,RV>>
Additional methods for Relative Vector that has a corresponding Absolute Vector.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description S
get(int index)
Retrieve a value from the vector.S[]
getScalars()
Return the vector as an array of scalars.Iterator<S>
iterator()
Create and return an iterator over the scalars in this vector in proper sequence.int
size()
Retrieve the size of the vector.-
Methods inherited from interface org.djunits.value.IndexedValue
cardinality, getScalarClass, getStorageType, immutable, isDense, isMutable, isSparse, mutable, toDense, toSparse
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
-
-
-
Method Detail
-
size
int size()
Retrieve the size of the vector.- Returns:
- int; the size of the vector
-
get
S get(int index) throws ValueRuntimeException
Retrieve a value from the vector.- Parameters:
index
- int; the index to retrieve the value at- Returns:
- S; the value as a Scalar
- Throws:
ValueRuntimeException
- in case index is out of bounds
-
getScalars
S[] getScalars()
Return the vector as an array of scalars.- Returns:
- S[]; the vector as an array of scalars
-
-