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 JexlFeatures
features
The set of features.private int
hashCode
The hash code, pre-computed for fast op.private java.lang.String
str
The actual source script/expression.
-
Constructor Summary
Constructors Constructor Description Source(JexlFeatures theFeatures, java.lang.String theStr)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Source s)
boolean
equals(java.lang.Object obj)
JexlFeatures
getFeatures()
int
hashCode()
(package private) int
length()
java.lang.String
toString()
-
-
-
Field Detail
-
hashCode
private final int hashCode
The hash code, pre-computed for fast op.
-
features
private final JexlFeatures features
The set of features.
-
str
private final java.lang.String str
The actual source script/expression.
-
-
Constructor Detail
-
Source
Source(JexlFeatures theFeatures, java.lang.String theStr)
Default constructor.- Parameters:
theFeatures
- the featurestheStr
- the script source
-
-
Method Detail
-
compareTo
public int compareTo(Source s)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Source>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getFeatures
public JexlFeatures getFeatures()
- Returns:
- the features associated with the source
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
length
int length()
- Returns:
- the length of the script source
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-