Package org.djunits.value.base
Interface Scalar<U extends Unit<U>,S extends Scalar<U,S>>
- Type Parameters:
U
- the unitS
- the scalar type with the given unit
- All Superinterfaces:
Cloneable
,Comparable<S>
,Serializable
,Value<U,S>
,ValueFunctions<U,S>
- All Known Subinterfaces:
DoubleScalarInterface<U,S>
,DoubleScalarInterface.Abs<AU,A,RU,R>
,DoubleScalarInterface.Rel<U,R>
,DoubleScalarInterface.RelWithAbs<AU,A,RU,R>
,FloatScalarInterface<U,S>
,FloatScalarInterface.Abs<AU,A,RU,R>
,FloatScalarInterface.Rel<U,R>
,FloatScalarInterface.RelWithAbs<AU,A,RU,R>
,Scalar.Abs<AU,A,RU,R>
,Scalar.Rel<U,R>
,Scalar.RelWithAbs<AU,A,RU,R>
- All Known Implementing Classes:
AbsoluteTemperature
,AbsorbedDose
,AbstractDoubleScalar
,AbstractDoubleScalarAbs
,AbstractDoubleScalarRel
,AbstractDoubleScalarRelWithAbs
,AbstractFloatScalar
,AbstractFloatScalarAbs
,AbstractFloatScalarRel
,AbstractFloatScalarRelWithAbs
,AbstractScalar
,Acceleration
,AmountOfSubstance
,Angle
,AngularAcceleration
,AngularVelocity
,Area
,CatalyticActivity
,Density
,Dimensionless
,Direction
,Duration
,ElectricalCapacitance
,ElectricalCharge
,ElectricalConductance
,ElectricalCurrent
,ElectricalInductance
,ElectricalPotential
,ElectricalResistance
,Energy
,EquivalentDose
,FloatAbsoluteTemperature
,FloatAbsorbedDose
,FloatAcceleration
,FloatAmountOfSubstance
,FloatAngle
,FloatAngularAcceleration
,FloatAngularVelocity
,FloatArea
,FloatCatalyticActivity
,FloatDensity
,FloatDimensionless
,FloatDirection
,FloatDuration
,FloatElectricalCapacitance
,FloatElectricalCharge
,FloatElectricalConductance
,FloatElectricalCurrent
,FloatElectricalInductance
,FloatElectricalPotential
,FloatElectricalResistance
,FloatEnergy
,FloatEquivalentDose
,FloatFlowMass
,FloatFlowVolume
,FloatForce
,FloatFrequency
,FloatIlluminance
,FloatLength
,FloatLinearDensity
,FloatLuminousFlux
,FloatLuminousIntensity
,FloatMagneticFlux
,FloatMagneticFluxDensity
,FloatMass
,FloatMomentum
,FloatPosition
,FloatPower
,FloatPressure
,FloatRadioActivity
,FloatSIScalar
,FloatSolidAngle
,FloatSpeed
,FloatTemperature
,FloatTime
,FloatTorque
,FloatVolume
,FlowMass
,FlowVolume
,Force
,Frequency
,Illuminance
,Length
,LinearDensity
,LuminousFlux
,LuminousIntensity
,MagneticFlux
,MagneticFluxDensity
,Mass
,Momentum
,Position
,Power
,Pressure
,RadioActivity
,SIScalar
,SolidAngle
,Speed
,Temperature
,Time
,Torque
,Volume
public interface Scalar<U extends Unit<U>,S extends Scalar<U,S>> extends Value<U,S>, Comparable<S>
Scalar to distinguish a scalar from vectors and matrices.
Copyright (c) 2019-2020 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
Scalar.Abs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends Scalar.RelWithAbs<AU,A,RU,R>>
Methods for Absolute Scalar.static interface
Scalar.Rel<U extends Unit<U>,R extends Scalar.Rel<U,R>>
Methods for Relative Scalar.static interface
Scalar.RelWithAbs<AU extends AbsoluteLinearUnit<AU,RU>,A extends Scalar.Abs<AU,A,RU,R>,RU extends Unit<RU>,R extends Scalar.RelWithAbs<AU,A,RU,R>>
Additional methods for Relative Scalar that has a corresponding Absolute Scalar. -
Method Summary
Modifier and Type Method Description boolean
eq(S o)
Test if this DoubleScalar is equal to a DoubleScalar.boolean
eq0()
Test if this DoubleScalar is equal to 0.0.boolean
ge(S o)
Test if this DoubleScalar is greater than a DoubleScalar.boolean
ge0()
Test if this DoubleScalar is greater than 0.0.boolean
gt(S o)
Test if this DoubleScalar is greater than or equal to a DoubleScalar.boolean
gt0()
Test if this DoubleScalar is greater than or equal to 0.0.boolean
le(S o)
Test if this DoubleScalar is less than or equal to another DoubleScalar.boolean
le0()
Test if this DoubleScalar is less than or equal to 0.0.boolean
lt(S o)
Test if this DoubleScalar is less than another DoubleScalar.boolean
lt0()
Test if this DoubleScalar is less than 0.0.boolean
ne(S o)
Test if this DoubleScalar is not equal to a DoubleScalar.boolean
ne0()
Test if this DoubleScalar is not equal to 0.0.String
toDisplayString()
Concise display description of this value, without the engineering formatting, so without trailing zeroes.String
toDisplayString(U displayUnit)
Concise display description of this value, without the engineering formatting, so without trailing zeroes.String
toTextualString()
Concise textual representation of this value, without the engineering formatting, so without trailing zeroes.String
toTextualString(U displayUnit)
Concise textual representation of this value, without the engineering formatting, so without trailing zeroes.Methods inherited from interface org.djunits.value.Value
getDisplayUnit, isAbsolute, isRelative, setDisplayUnit, toString, toString, toString, toString
-
Method Details
-
lt
Test if this DoubleScalar is less than another DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean; true if this is less than other; false if this is not less than other
-
le
Test if this DoubleScalar is less than or equal to another DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean
-
gt
Test if this DoubleScalar is greater than or equal to a DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean; true if this is greater than or equal to other; false if this is not greater than or equal to other
-
ge
Test if this DoubleScalar is greater than a DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean; true if this is greater than other; false if this is not greater than other
-
eq
Test if this DoubleScalar is equal to a DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean; true if this is equal to other; false if this is not equal to other
-
ne
Test if this DoubleScalar is not equal to a DoubleScalar.- Parameters:
o
- T, a relative typed DoubleScalar; the right hand side operand of the comparison- Returns:
- boolean; true if this is not equal to other; false if this is equal to other
-
lt0
boolean lt0()Test if this DoubleScalar is less than 0.0.- Returns:
- boolean; true if this is less than 0.0; false if this is not less than 0.0
-
le0
boolean le0()Test if this DoubleScalar is less than or equal to 0.0.- Returns:
- boolean; true if this is less than or equal to 0.0; false if this is not less than or equal to 0.0
-
gt0
boolean gt0()Test if this DoubleScalar is greater than or equal to 0.0.- Returns:
- boolean; true if this is greater than or equal to 0.0; false if this is not greater than or equal to 0.0
-
ge0
boolean ge0()Test if this DoubleScalar is greater than 0.0.- Returns:
- boolean; true if this is greater than 0.0; false if this is not greater than 0.0
-
eq0
boolean eq0()Test if this DoubleScalar is equal to 0.0.- Returns:
- boolean; true if this is equal to 0.0; false if this is not equal to 0.0
-
ne0
boolean ne0()Test if this DoubleScalar is not equal to 0.0.- Returns:
- boolean; true if this is not equal to 0.0; false if this is equal to 0.0
-
toTextualString
String toTextualString()Concise textual representation of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.- Returns:
- a String with the value with the default textual representation of the unit attached.
-
toTextualString
Concise textual representation of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.- Parameters:
displayUnit
- U; the display unit for the value- Returns:
- a String with the value with the default textual representation of the provided unit attached.
-
toDisplayString
String toDisplayString()Concise display description of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.- Returns:
- a String with the value with the default display representation of the unit attached.
-
toDisplayString
Concise display description of this value, without the engineering formatting, so without trailing zeroes. A space is added between the number and the unit.- Parameters:
displayUnit
- U; the display unit for the value- Returns:
- a String with the value with the default display representation of the provided unit attached.
-