Enum Feature

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Feature>

    public enum Feature
    extends java.lang.Enum<Feature>
    Syntax features.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Assignment
      variable assignment
      ExceptionHandle
      try..catch..finally and throw statement to handle exceptions.
      Fn
      fn to define named function
      ForLoop
      for loop statement
      If
      if/elsif/else statement
      InternalVars
      Internal vars such as __env__, __instance__
      Lambda
      lambda to define function
      Let
      let statement
      LexicalScope
      Lexical scope
      Module
      module system such as exports/require/load function supporting.
      NewInstance
      new Class(arguments) to create an instance of special class with arguments.
      Return
      return statement
      StaticFields
      Access java class's static fields by Class.FIELD
      StaticMethods
      Invoke java class's static methods by Class.method(..args)
      StringInterpolation
      String interpolation.For example, "a = 'aviator'; 'hello #{a}'" to generate a string 'hello aviator'
      Use
      use package.class to import java classes into current context.
      WhileLoop
      while statement
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<AviatorFunction> functions
      Functions to support the feature.
      private java.util.Set<Feature> prequires
      Require feature sets for this feature.
    • Enum Constant Detail

      • Assignment

        public static final Feature Assignment
        variable assignment
      • Return

        public static final Feature Return
        return statement
      • If

        public static final Feature If
        if/elsif/else statement
      • ForLoop

        public static final Feature ForLoop
        for loop statement
      • WhileLoop

        public static final Feature WhileLoop
        while statement
      • Let

        public static final Feature Let
        let statement
      • LexicalScope

        public static final Feature LexicalScope
        Lexical scope
      • Lambda

        public static final Feature Lambda
        lambda to define function
      • Fn

        public static final Feature Fn
        fn to define named function
      • InternalVars

        public static final Feature InternalVars
        Internal vars such as __env__, __instance__
      • Module

        public static final Feature Module
        module system such as exports/require/load function supporting.
      • ExceptionHandle

        public static final Feature ExceptionHandle
        try..catch..finally and throw statement to handle exceptions.
      • NewInstance

        public static final Feature NewInstance
        new Class(arguments) to create an instance of special class with arguments.
      • StringInterpolation

        public static final Feature StringInterpolation
        String interpolation.For example, "a = 'aviator'; 'hello #{a}'" to generate a string 'hello aviator'
      • Use

        public static final Feature Use
        use package.class to import java classes into current context.
        Since:
        5.2.0
      • StaticFields

        public static final Feature StaticFields
        Access java class's static fields by Class.FIELD
        Since:
        5.2.2
      • StaticMethods

        public static final Feature StaticMethods
        Invoke java class's static methods by Class.method(..args)
        Since:
        5.2.2
    • Field Detail

      • prequires

        private java.util.Set<Feature> prequires
        Require feature sets for this feature.
      • functions

        private java.util.List<AviatorFunction> functions
        Functions to support the feature.
    • Constructor Detail

      • Feature

        private Feature()
      • Feature

        private Feature​(java.util.Set<Feature> prequires)
    • Method Detail

      • values

        public static Feature[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Feature c : Feature.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Feature valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • asSet

        public static java.util.Set<Feature> asSet​(Feature... args)
        Create a feature set from arguments.
        Parameters:
        args -
        Returns:
        feature set
      • getPrequires

        public java.util.Set<Feature> getPrequires()
      • getFullFeatures

        public static java.util.Set<Feature> getFullFeatures()
        Returns the full feature set.
        Returns:
      • getCompatibleFeatures

        public static java.util.Set<Feature> getCompatibleFeatures()
        Returns the feature set that is compatible with aviator early versions(before 5.0).
        Returns: