io.sarl.lang.typesystem
Class PureOperationNameValidator
All Superinterfaces:
IPureOperationNameValidator
@javax.inject.Singleton
class PureOperationNameValidator
extends java.lang.Object
implements IPureOperationNameValidator
Test if names are for pure or not pure operations.

This implementation assumes that any function with a name starting with "get", "is", "has" is a pure function. It also assumes that "equals", "hashCode", "clone" and "toString" are also pure functions.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.6
Field Summary
Modifier and type Field and description
public static val java.lang.String SPECIAL_NOTPURE_FUNCTION_NAME_PATTERNS
Regular expression patterns that matches the names of functions usually considered as not pure.
public static val java.lang.String SPECIAL_PURE_FUNCTION_NAME_PATTERNS
Regular expression patterns that matches the names of functions usually considered as pure.
Constructor Summary
Constructor and description
new
Construct the helper.
new(String*)
Construct the helper.
Action Summary
Modifier and type Action and description
boolean isNamePatternForNotPureOperation(String)
boolean isNamePatternForPureOperation(String)
Field Details
SPECIAL_NOTPURE_FUNCTION_NAME_PATTERNS
public static val SPECIAL_NOTPURE_FUNCTION_NAME_PATTERNS : java.lang.String
Regular expression patterns that matches the names of functions usually considered as not pure.
SPECIAL_PURE_FUNCTION_NAME_PATTERNS
public static val SPECIAL_PURE_FUNCTION_NAME_PATTERNS : java.lang.String
Regular expression patterns that matches the names of functions usually considered as pure.
Constructor Details
new
new
Construct the helper.
See:
SPECIAL_PURE_FUNCTION_NAME_PATTERNS , SPECIAL_NOTPURE_FUNCTION_NAME_PATTERNS
new(String*)
new(String*)
Construct the helper.
Parameters:
additionalSpecialPureFunctionNamePatterns - the patterns for the functions that are considered as pure functions.
See:
SPECIAL_PURE_FUNCTION_NAME_PATTERNS , SPECIAL_NOTPURE_FUNCTION_NAME_PATTERNS
Action Details
isNamePatternForNotPureOperation(String)
def isNamePatternForNotPureOperation(String) : boolean
isNamePatternForPureOperation(String)
def isNamePatternForPureOperation(String) : boolean