Klasse AbsoluteOrRelativeInt
java.lang.Object
ch.nolix.system.element.base.AbstractElement
ch.nolix.system.element.relativevalue.AbsoluteOrRelativeInt
- Alle implementierten Schnittstellen:
IElement,IAbsoluteOrRelativeInt
A
AbsoluteOrRelativeInt stores either an integer or a percentage. A
AbsoluteOrRelativeInt is not mutable.- Version:
- 2022-10-15
- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic AbsoluteOrRelativeIntfromSpecification(INode<?> specification) intIContainer<INode<?>> doubleintgetValueRelativeToHundredPercentValue(int hundredPercentValue) booleanbooleanbooleanstatic AbsoluteOrRelativeIntwithIntValue(int intValue) static AbsoluteOrRelativeIntwithPercentage(double percentage) Von Klasse geerbte Methoden ch.nolix.system.element.base.AbstractElement
equals, getSpecification, hashCode, toStringVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.nolix.systemapi.element.base.IElement
getSpecification, toFormatedString, toXml
-
Methodendetails
-
fromSpecification
- Parameter:
specification-- Gibt zurück:
- a new
AbsoluteOrRelativeIntfrom the given specification. - Löst aus:
InvalidArgumentException- if the given specification is not valid.
-
withIntValue
- Parameter:
intValue-- Gibt zurück:
- a new
AbsoluteOrRelativeIntwith the given intValue.
-
withPercentage
- Parameter:
percentage-- Gibt zurück:
- a new
AbsoluteOrRelativeIntwith the given percentage. - Löst aus:
NegativeArgumentException- if the given percentage is negative.
-
getAttributes
- Angegeben von:
getAttributesin SchnittstelleIElement- Gibt zurück:
- the attributes of the current
IElement.
-
getAbsoluteValue
public int getAbsoluteValue()- Angegeben von:
getAbsoluteValuein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- the absolute value of the current
IAbsoluteOrRelativeInt.
-
getPercentage
public double getPercentage()- Angegeben von:
getPercentagein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- the percentage of the current
IAbsoluteOrRelativeInt.
-
getValueRelativeToHundredPercentValue
public int getValueRelativeToHundredPercentValue(int hundredPercentValue) - Angegeben von:
getValueRelativeToHundredPercentValuein SchnittstelleIAbsoluteOrRelativeInt- Parameter:
hundredPercentValue-- Gibt zurück:
- the value of the current
IAbsoluteOrRelativeIntrelative to the given hundredPercentValue.
-
isAbsolute
public boolean isAbsolute()- Angegeben von:
isAbsolutein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- true if the current
IAbsoluteOrRelativeIntis absolute.
-
isPositive
public boolean isPositive()- Angegeben von:
isPositivein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- true if the current
IAbsoluteOrRelativeIntis positive.
-
isRelative
public boolean isRelative()- Angegeben von:
isRelativein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- true if the current
IAbsoluteOrRelativeIntis relative.
-