Klasse DoubleMediator
java.lang.Object
ch.nolix.core.errorcontrol.validator.DoubleMediator
- Bekannte direkte Unterklassen:
ExtendedDoubleMediator
A double mediator is a mediator for a double. A double mediator is not
mutable.
- Version:
- 2017-01-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedDoubleMediator(double argument) Creates a newDoubleMediatorfor the given argument.protectedDoubleMediator(String argumentName, double argument) Creates a newDoubleMediatorfor the given argument, which has has the given argumentName. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic DoubleMediatorforArgument(double argument) protected doubleprotected final StringvoidisBetween(double min, double max) voidisBiggerThan(double value) voidisEqualTo(double value) voidvoidisNotBiggerThan(double value) voidisNotEqualTo(double value) voidvoidvoidisNotSmallerThan(double value) voidvoidisSmallerThan(double value) withMaxDeviation(double maxDeviation)
-
Felddetails
-
DEFAULT_ARGUMENT_NAME
- Siehe auch:
-
-
Konstruktordetails
-
DoubleMediator
protected DoubleMediator(double argument) Creates a newDoubleMediatorfor the given argument.- Parameter:
argument-
-
DoubleMediator
Creates a newDoubleMediatorfor the given argument, which has has the given argumentName.- Parameter:
argumentName-argument-- Löst aus:
ArgumentIsNullException- if the given argumentName is null.InvalidArgumentException- if the given argumentName is blank.
-
-
Methodendetails
-
forArgument
- Parameter:
argument-- Gibt zurück:
- a new
DoubleMediatorfor the given argument.
-
isBetween
public void isBetween(double min, double max) - Parameter:
min-max-- Löst aus:
ArgumentIsOutOfRangeException- if the argument of this double mediator is not between the given min and max.
-
isBiggerThan
public void isBiggerThan(double value) - Parameter:
value-- Löst aus:
InvalidArgumentException- if the argument of this double mediator is not bigger than the given value.
-
isEqualTo
public void isEqualTo(double value) - Parameter:
value-- Löst aus:
UnequalArgumentException- if the argument of this double mediator does not equal the given value.
-
isNegative
public void isNegative()- Löst aus:
NonNegativeArgumentException- if the argument of this double mediator is not negative.
-
isNotBiggerThan
public void isNotBiggerThan(double value) - Parameter:
value-- Löst aus:
BiggerArgumentException- if the argument of this double mediator is bigger than the given value.
-
isNotEqualTo
public void isNotEqualTo(double value) - Parameter:
value-- Löst aus:
EqualArgumentException- if the argument of this double mediator equals the given value.
-
isNotNegative
public void isNotNegative()- Löst aus:
NegativeArgumentException- if the argument of this double mediator is negative.
-
isNotPositive
public void isNotPositive()- Löst aus:
NonPositiveArgumentException- if the argument of this double mediator is positive.
-
isNotSmallerThan
public void isNotSmallerThan(double value) - Parameter:
value-- Löst aus:
SmallerArgumentException- if the argument of this double mediator is smaller than the given value.
-
isPositive
public void isPositive()- Löst aus:
NonPositiveArgumentException- if the argument of this double mediator is not positive.
-
isSmallerThan
public void isSmallerThan(double value) - Parameter:
value-- Löst aus:
InvalidArgumentException- if the argument of this double mediator is not smaller than the given value.
-
withMaxDeviation
-
getArgument
protected double getArgument()- Gibt zurück:
- the argument of htis double mediator.
-
getArgumentName
- Gibt zurück:
- the argument name of the current
Mediator.
-