Class Source
- java.lang.Object
-
- org.apache.commons.jexl3.internal.Source
-
- All Implemented Interfaces:
java.lang.Comparable<Source>
public final class Source extends java.lang.Object implements java.lang.Comparable<Source>
Maintains the set of allowed features associated with a script/expression source.This is meant for caching scripts using their 'source' as key but still distinguishing scripts with different features and prevent false sharing.
-
-
Field Summary
Fields Modifier and Type Field Description private JexlFeaturesfeaturesThe set of features.private inthashCodeThe hash code, pre-computed for fast op.private java.lang.StringstrThe actual source script/expression.private java.util.Map<java.lang.String,java.lang.Integer>symbolsThe local symbols, if any.
-
Constructor Summary
Constructors Constructor Description Source(JexlFeatures theFeatures, java.util.Map<java.lang.String,java.lang.Integer> theSymbols, java.lang.String theStr)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Source s)booleanequals(java.lang.Object obj)JexlFeaturesgetFeatures()inthashCode()(package private) intlength()java.lang.StringtoString()
-
-
-
Field Detail
-
hashCode
private final int hashCode
The hash code, pre-computed for fast op.
-
features
private final JexlFeatures features
The set of features.
-
symbols
private final java.util.Map<java.lang.String,java.lang.Integer> symbols
The local symbols, if any.
-
str
private final java.lang.String str
The actual source script/expression.
-
-
Constructor Detail
-
Source
Source(JexlFeatures theFeatures, java.util.Map<java.lang.String,java.lang.Integer> theSymbols, java.lang.String theStr)
Default constructor.- Parameters:
theFeatures- the featurestheSymbols- the map of variable name to symbol offset in evaluation frametheStr- the script source
-
-
Method Detail
-
compareTo
public int compareTo(Source s)
- Specified by:
compareToin interfacejava.lang.Comparable<Source>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getFeatures
public JexlFeatures getFeatures()
- Returns:
- the features associated with the source
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
length
int length()
- Returns:
- the length of the script source
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-