Class 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.
    • 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 features
        theStr - the script source
    • Method Detail

      • compareTo

        public int compareTo​(Source s)
        Specified by:
        compareTo in interface java.lang.Comparable<Source>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getFeatures

        public JexlFeatures getFeatures()
        Returns:
        the features associated with the source
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • length

        int length()
        Returns:
        the length of the script source
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object