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.- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic AbsoluteOrRelativeIntfromSpecification(INode<?> specification) intIContainer<INode<?>> doubleintgetValueRelativeToHundredPercentValue(int hundredPercentValue) booleanbooleanbooleanstatic AbsoluteOrRelativeIntwithIntValue(int intValue) static AbsoluteOrRelativeIntwithPercentage(double percentage) Von Klasse geerbte Methoden AbstractElement
equals, getSpecification, hashCode, toStringVon Schnittstelle geerbte Methoden 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, false otherwise.
-
isPositive
public boolean isPositive()- Angegeben von:
isPositivein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- true if the current
IAbsoluteOrRelativeIntis positive, false otherwise.
-
isRelative
public boolean isRelative()- Angegeben von:
isRelativein SchnittstelleIAbsoluteOrRelativeInt- Gibt zurück:
- true if the current
IAbsoluteOrRelativeIntis relative, false otherwise.
-