Package com.singularsys.jep.functions
Interface ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI
- All Superinterfaces:
Serializable,ZeroLengthBehaviourI
- All Known Implementing Classes:
Get
- Enclosing interface:
ZeroLengthBehaviourI
public static interface ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI
extends ZeroLengthBehaviourI
Interface for classes which implement
ZeroLengthBehaviourI by delegating to a helper class.- Since:
- Jep 4.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.singularsys.jep.functions.ZeroLengthBehaviourI
ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI, ZeroLengthBehaviourI.ZeroLengthErrorBehaviour, ZeroLengthBehaviourI.ZeroLengthHelper -
Method Summary
Modifier and TypeMethodDescriptionGets how to respond to arguments with zero length arrays.Gets the helper class which implements the zero length behaviour.default ObjectGets the value to be returned when a zero length array is passed as an argument and the zero length error behaviour is set to VALUE.default voidsetZeroLengthErrorBehaviour(ZeroLengthBehaviourI.ZeroLengthErrorBehaviour zeroLengthErrorBehaviour) Sets how to respond to arguments with zero length arrays.default voidsetZeroLengthValue(Object zeroLengthValue) Sets the value to be returned when a zero length array is passed and the zero length error behaviour is set to VALUE.Methods inherited from interface com.singularsys.jep.functions.ZeroLengthBehaviourI
getErrorMessage, getValueOrException, zeroLengthResultOrException
-
Method Details
-
getZeroLengthHelper
ZeroLengthBehaviourI getZeroLengthHelper()Gets the helper class which implements the zero length behaviour. The standard implementation is:ZeroLengthHelper zeroLengthHelper = new ZeroLengthHelper(); @Override public ZeroLengthBehaviourI getZeroLengthHelper() { return zeroLengthHelper; }- Returns:
- the helper class
-
getZeroLengthErrorBehaviour
Description copied from interface:ZeroLengthBehaviourIGets how to respond to arguments with zero length arrays.- Specified by:
getZeroLengthErrorBehaviourin interfaceZeroLengthBehaviourI- Returns:
- either EXCEPTION, NAN or VALUE
-
setZeroLengthErrorBehaviour
default void setZeroLengthErrorBehaviour(ZeroLengthBehaviourI.ZeroLengthErrorBehaviour zeroLengthErrorBehaviour) Description copied from interface:ZeroLengthBehaviourISets how to respond to arguments with zero length arrays. Either an Exception is thrown or NaN is returned.- Specified by:
setZeroLengthErrorBehaviourin interfaceZeroLengthBehaviourI- Parameters:
zeroLengthErrorBehaviour- either EXCEPTION, NAN or VALUE
-
getZeroLengthValue
Description copied from interface:ZeroLengthBehaviourIGets the value to be returned when a zero length array is passed as an argument and the zero length error behaviour is set to VALUE.- Specified by:
getZeroLengthValuein interfaceZeroLengthBehaviourI- Returns:
- the value, null by default
-
setZeroLengthValue
Description copied from interface:ZeroLengthBehaviourISets the value to be returned when a zero length array is passed and the zero length error behaviour is set to VALUE. TheZeroLengthBehaviourI.setZeroLengthErrorBehaviour(ZeroLengthErrorBehaviour)method should be used to set the zero length error behaviour to VALUE.- Specified by:
setZeroLengthValuein interfaceZeroLengthBehaviourI- Parameters:
zeroLengthValue- the value to return when a zero length array is passed
-