"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/docs/painless/index.asciidoc" (29 Dec 2021, 244 Bytes) of package /linux/www/elasticsearch-6.8.23-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming AsciiDoc format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Unresolved directive in ../Versions.asciidoc - include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]

Unresolved directive in ../Versions.asciidoc - include::{asciidoc-dir}/../../shared/attributes.asciidoc[]

Getting Started with Painless

Painless is a simple, secure scripting language designed specifically for use with Elasticsearch. It is the default scripting language for Elasticsearch and can safely be used for inline and stored scripts. For a detailed description of the Painless syntax and language features, see the {painless}/painless-lang-spec.html[Painless Language Specification].

You can use Painless anywhere scripts can be used in Elasticsearch. Painless provides:

  • Fast performance: Painless scripts run several times faster than the alternatives.

  • Safety: Fine-grained whitelist with method call/field granularity. See the {painless}/painless-api-reference.html[Painless API Reference] for a complete list of available classes and methods.

  • Optional typing: Variables and parameters can use explicit types or the dynamic def type.

  • Syntax: Extends Java’s syntax to provide Groovy-style scripting language features that make scripts easier to write.

  • Optimizations: Designed specifically for Elasticsearch scripting.

Painless Examples

To illustrate how Painless works, let’s load some hockey stats into an Elasticsearch index:

PUT hockey/player/_bulk?refresh
{"index":{"_id":1}}
{"first":"johnny","last":"gaudreau","goals":[9,27,1],"assists":[17,46,0],"gp":[26,82,1],"born":"1993/08/13"}
{"index":{"_id":2}}
{"first":"sean","last":"monohan","goals":[7,54,26],"assists":[11,26,13],"gp":[26,82,82],"born":"1994/10/12"}
{"index":{"_id":3}}
{"first":"jiri","last":"hudler","goals":[5,34,36],"assists":[11,62,42],"gp":[24,80,79],"born":"1984/01/04"}
{"index":{"_id":4}}
{"first":"micheal","last":"frolik","goals":[4,6,15],"assists":[8,23,15],"gp":[26,82,82],"born":"1988/02/17"}
{"index":{"_id":5}}
{"first":"sam","last":"bennett","goals":[5,0,0],"assists":[8,1,0],"gp":[26,1,0],"born":"1996/06/20"}
{"index":{"_id":6}}
{"first":"dennis","last":"wideman","goals":[0,26,15],"assists":[11,30,24],"gp":[26,81,82],"born":"1983/03/20"}
{"index":{"_id":7}}
{"first":"david","last":"jones","goals":[7,19,5],"assists":[3,17,4],"gp":[26,45,34],"born":"1984/08/10"}
{"index":{"_id":8}}
{"first":"tj","last":"brodie","goals":[2,14,7],"assists":[8,42,30],"gp":[26,82,82],"born":"1990/06/07"}
{"index":{"_id":39}}
{"first":"mark","last":"giordano","goals":[6,30,15],"assists":[3,30,24],"gp":[26,60,63],"born":"1983/10/03"}
{"index":{"_id":10}}
{"first":"mikael","last":"backlund","goals":[3,15,13],"assists":[6,24,18],"gp":[26,82,82],"born":"1989/03/17"}
{"index":{"_id":11}}
{"first":"joe","last":"colborne","goals":[3,18,13],"assists":[6,20,24],"gp":[26,67,82],"born":"1990/01/30"}

Accessing Doc Values from Painless

Document values can be accessed from a Map named doc.

For example, the following script calculates a player’s total goals. This example uses a strongly typed int and a for loop.

GET hockey/_search
{
  "query": {
    "function_score": {
      "script_score": {
        "script": {
          "lang": "painless",
          "source": """
            int total = 0;
            for (int i = 0; i < doc['goals'].length; ++i) {
              total += doc['goals'][i];
            }
            return total;
          """
        }
      }
    }
  }
}

Alternatively, you could do the same thing using a script field instead of a function score:

GET hockey/_search
{
  "query": {
    "match_all": {}
  },
  "script_fields": {
    "total_goals": {
      "script": {
        "lang": "painless",
        "source": """
          int total = 0;
          for (int i = 0; i < doc['goals'].length; ++i) {
            total += doc['goals'][i];
          }
          return total;
        """
      }
    }
  }
}

The following example uses a Painless script to sort the players by their combined first and last names. The names are accessed using doc['first'].value and doc['last'].value.

GET hockey/_search
{
  "query": {
    "match_all": {}
  },
  "sort": {
    "_script": {
      "type": "string",
      "order": "asc",
      "script": {
        "lang": "painless",
        "source": "doc['first.keyword'].value + ' ' + doc['last.keyword'].value"
      }
    }
  }
}
Missing values

If you request the value from a field field that isn’t in the document, doc['field'].value for this document returns:

  • 0 if a field has a numeric datatype (long, double etc.)

  • false is a field has a boolean datatype

  • epoch date if a field has a date datatype

  • null if a field has a string datatype

  • null if a field has a geo datatype

  • "" if a field has a binary datatype

Important
Starting in 7.0, doc['field'].value throws an exception if the field is missing in a document. To enable this behavior now, set a {ref}/jvm-options.html[jvm.option] -Des.scripting.exception_for_missing_value=true on a node. If you do not enable this behavior, a deprecation warning may be logged when painless processes a missing value.

To check if a document is missing a value, you can call doc['field'].size() == 0.

Updating Fields with Painless

You can also easily update fields. You access the original source for a field as ctx._source.<field-name>.

First, let’s look at the source data for a player by submitting the following request:

GET hockey/_search
{
  "query": {
    "term": {
      "_id": 1
    }
  }
}

To change player 1’s last name to hockey, simply set ctx._source.last to the new value:

POST hockey/player/1/_update
{
  "script": {
    "lang": "painless",
    "source": "ctx._source.last = params.last",
    "params": {
      "last": "hockey"
    }
  }
}

You can also add fields to a document. For example, this script adds a new field that contains the player’s nickname, hockey.

POST hockey/player/1/_update
{
  "script": {
    "lang": "painless",
    "source": """
      ctx._source.last = params.last;
      ctx._source.nick = params.nick
    """,
    "params": {
      "last": "gaudreau",
      "nick": "hockey"
    }
  }
}

Dates

Date fields are exposed as ReadableDateTime, so they support methods like getYear, getDayOfWeek or e.g. getting milliseconds since epoch with getMillis. To use these in a script, leave out the get prefix and continue with lowercasing the rest of the method name. For example, the following returns every hockey player’s birth year:

GET hockey/_search
{
  "script_fields": {
    "birth_year": {
      "script": {
        "source": "doc.born.value.year"
      }
    }
  }
}

Regular expressions

Note
Regexes are disabled by default because they circumvent Painless’s protection against long running and memory hungry scripts. To make matters worse even innocuous looking regexes can have staggering performance and stack depth behavior. They remain an amazing powerful tool but are too scary to enable by default. To enable them yourself set script.painless.regex.enabled: true in elasticsearch.yml. We’d like very much to have a safe alternative implementation that can be enabled by default so check this space for later developments!

Painless’s native support for regular expressions has syntax constructs:

  • /pattern/: Pattern literals create patterns. This is the only way to create a pattern in painless. The pattern inside the /'s are just Java regular expressions. See Pattern flags for more.

  • =~: The find operator return a boolean, true if a subsequence of the text matches, false otherwise.

  • ==~: The match operator returns a boolean, true if the text matches, false if it doesn’t.

Using the find operator (=~) you can update all hockey players with "b" in their last name:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": """
      if (ctx._source.last =~ /b/) {
        ctx._source.last += "matched";
      } else {
        ctx.op = "noop";
      }
    """
  }
}

Using the match operator (==~) you can update all the hockey players whose names start with a consonant and end with a vowel:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": """
      if (ctx._source.last ==~ /[^aeiou].*[aeiou]/) {
        ctx._source.last += "matched";
      } else {
        ctx.op = "noop";
      }
    """
  }
}

You can use the Pattern.matcher directly to get a Matcher instance and remove all of the vowels in all of their last names:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": "ctx._source.last = /[aeiou]/.matcher(ctx._source.last).replaceAll('')"
  }
}

Matcher.replaceAll is just a call to Java’s Matcher’s replaceAll method so it supports `$1 and \1 for replacements:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": "ctx._source.last = /n([aeiou])/.matcher(ctx._source.last).replaceAll('$1')"
  }
}

If you need more control over replacements you can call replaceAll on a CharSequence with a Function<Matcher, String> that builds the replacement. This does not support $1 or \1 to access replacements because you already have a reference to the matcher and can get them with m.group(1).

Important
Calling Matcher.find inside of the function that builds the replacement is rude and will likely break the replacement process.

This will make all of the vowels in the hockey player’s last names upper case:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": """
      ctx._source.last = ctx._source.last.replaceAll(/[aeiou]/, m ->
        m.group().toUpperCase(Locale.ROOT))
    """
  }
}

Or you can use the CharSequence.replaceFirst to make the first vowel in their last names upper case:

POST hockey/player/_update_by_query
{
  "script": {
    "lang": "painless",
    "source": """
      ctx._source.last = ctx._source.last.replaceFirst(/[aeiou]/, m ->
        m.group().toUpperCase(Locale.ROOT))
    """
  }
}

Note: all of the _update_by_query examples above could really do with a query to limit the data that they pull back. While you could use a {ref}/query-dsl-script-query.html[script query] it wouldn’t be as efficient as using any other query because script queries aren’t able to use the inverted index to limit the documents that they have to check.

How painless dispatches functions

Painless uses receiver, name, and arity for method dispatch. For example, s.foo(a, b) is resolved by first getting the class of s and then looking up the method foo with two parameters. This is different from Groovy which uses the runtime types of the parameters and Java which uses the compile time types of the parameters.

The consequence of this that Painless doesn’t support overloaded methods like Java, leading to some trouble when it whitelists classes from the Java standard library. For example, in Java and Groovy, Matcher has two methods: group(int) and group(String). Painless can’t whitelist both of these methods because they have the same name and the same number of parameters. So instead it has group(int) and namedGroup(String).

We have a few justifications for this different way of dispatching methods:

  1. It makes operating on def types simpler and, presumably, faster. Using receiver, name, and arity means that when Painless sees a call on a def object it can dispatch the appropriate method without having to do expensive comparisons of the types of the parameters. The same is true for invocations with def typed parameters.

  2. It keeps things consistent. It would be genuinely weird for Painless to behave like Groovy if any def typed parameters were involved and Java otherwise. It’d be slow for it to behave like Groovy all the time.

  3. It keeps Painless maintainable. Adding the Java or Groovy like method dispatch feels like it’d add a ton of complexity which’d make maintenance and other improvements much more difficult.

Painless Debugging

Debug.Explain

Painless doesn’t have a REPL and while it’d be nice for it to have one day, it wouldn’t tell you the whole story around debugging painless scripts embedded in Elasticsearch because the data that the scripts have access to or "context" is so important. For now the best way to debug embedded scripts is by throwing exceptions at choice places. While you can throw your own exceptions (throw new Exception('whatever')), Painless’s sandbox prevents you from accessing useful information like the type of an object. So Painless has a utility method, Debug.explain which throws the exception for you. For example, you can use {ref}/search-explain.html[_explain] to explore the context available to a {ref}/query-dsl-script-query.html[script query].

PUT /hockey/player/1?refresh
{"first":"johnny","last":"gaudreau","goals":[9,27,1],"assists":[17,46,0],"gp":[26,82,1]}

POST /hockey/player/1/_explain
{
  "query": {
    "script": {
      "script": "Debug.explain(doc.goals)"
    }
  }
}

Which shows that the class of doc.first is org.elasticsearch.index.fielddata.ScriptDocValues.Longs by responding with:

{
   "error": {
      "type": "script_exception",
      "to_string": "[1, 9, 27]",
      "painless_class": "org.elasticsearch.index.fielddata.ScriptDocValues.Longs",
      "java_class": "org.elasticsearch.index.fielddata.ScriptDocValues$Longs",
      ...
   },
   "status": 500
}

You can use the same trick to see that _source is a LinkedHashMap in the _update API:

POST /hockey/player/1/_update
{
  "script": "Debug.explain(ctx._source)"
}

The response looks like:

{
  "error" : {
    "root_cause": ...,
    "type": "illegal_argument_exception",
    "reason": "failed to execute script",
    "caused_by": {
      "type": "script_exception",
      "to_string": "{gp=[26, 82, 1], last=gaudreau, assists=[17, 46, 0], first=johnny, goals=[9, 27, 1]}",
      "painless_class": "java.util.LinkedHashMap",
      "java_class": "java.util.LinkedHashMap",
      ...
    }
  },
  "status": 400
}

Once you have a class you can go to Painless API Reference to see a list of available methods.

Painless execute API

experimental[The painless execute api is new and the request / response format may change in a breaking way in the future]

The Painless execute API allows an arbitrary script to be executed and a result to be returned.

Table 1. Parameters
Name Required Default Description

script

yes

-

The script to execute

context

no

painless_test

The context the script should be executed in.

context_setup

no

-

Additional parameters to the context.

Contexts

Contexts control how scripts are executed, what variables are available at runtime and what the return type is.

Painless test context

The painless_test context executes scripts as is and do not add any special parameters. The only variable that is available is params, which can be used to access user defined values. The result of the script is always converted to a string. If no context is specified then this context is used by default.

Example

Request:

POST /_scripts/painless/_execute
{
  "script": {
    "source": "params.count / params.total",
    "params": {
      "count": 100.0,
      "total": 1000.0
    }
  }
}

Response:

{
  "result": "0.1"
}
Filter context

The filter context executes scripts as if they were executed inside a script query. For testing purposes a document must be provided that will be indexed temporarily in-memory and is accessible to the script being tested. Because of this the _source, stored fields and doc values are available in the script being tested.

The following parameters may be specified in context_setup for a filter context:

document

Contains the document that will be temporarily indexed in-memory and is accessible from the script.

index

The name of an index containing a mapping that is compatible with the document being indexed.

Example
PUT /my-index
{
  "mappings": {
    "_doc": {
      "properties": {
        "field": {
          "type": "keyword"
        }
      }
    }
  }
}

POST /_scripts/painless/_execute
{
  "script": {
    "source": "doc['field'].value.length() <= params.max_length",
    "params": {
      "max_length": 4
    }
  },
  "context": "filter",
  "context_setup": {
    "index": "my-index",
    "document": {
      "field": "four"
    }
  }
}

Response:

{
  "result": true
}
Score context

The score context executes scripts as if they were executed inside a script_score function in function_score query.

The following parameters may be specified in context_setup for a score context:

document

Contains the document that will be temporarily indexed in-memory and is accessible from the script.

index

The name of an index containing a mapping that is compatible with the document being indexed.

query

If _score is used in the script then a query can specified that will be used to compute a score.

Example
PUT /my-index
{
  "mappings": {
    "_doc": {
      "properties": {
        "field": {
          "type": "keyword"
        },
        "rank": {
          "type": "long"
        }
      }
    }
  }
}


POST /_scripts/painless/_execute
{
  "script": {
    "source": "doc['rank'].value / params.max_rank",
    "params": {
      "max_rank": 5.0
    }
  },
  "context": "score",
  "context_setup": {
    "index": "my-index",
    "document": {
      "rank": 4
    }
  }
}

Response:

{
  "result": 0.8
}

Painless Language Specification

Painless is a scripting language designed for security and performance. Painless syntax is similar to Java syntax along with some additional features such as dynamic typing, Map and List accessor shortcuts, and array initializers. As a direct comparison to Java, there are some important differences, especially related to the casting model. For more detailed conceptual information about the basic constructs that Painless and Java share, refer to the corresponding topics in the Java Language Specification.

Painless scripts are parsed and compiled using the ANTLR4 and ASM libraries. Scripts are compiled directly into Java Virtual Machine (JVM) byte code and executed against a standard JVM. This specification uses ANTLR4 grammar notation to describe the allowed syntax. However, the actual Painless grammar is more compact than what is shown here.

Comments

Use a comment to annotate or explain code within a script. Use the // token anywhere on a line to specify a single-line comment. All characters from the // token to the end of the line are ignored. Use an opening / token and a closing / token to specify a multi-line comment. Multi-line comments can start anywhere on a line, and all characters in between the / token and / token are ignored. A comment is included anywhere within a script.

Grammar

SINGLE_LINE_COMMENT: '//' .*? [\n\r];
MULTI_LINE_COMMENT: '/*' .*? '*/';

Examples

  • Single-line comments.

    // single-line comment
    
    int value; // single-line comment
  • Multi-line comments.

    /* multi-
       line
       comment */
    
    int value; /* multi-
                  line
                  comment */ value = 0;
    
    int value; /* multi-line
                  comment */
    
    /* multi-line
       comment */ int value;
    
    int value; /* multi-line
                  comment */ value = 0;
    
    int value; /* multi-line comment */ value = 0;

Keywords

Keywords are reserved tokens for built-in language features.

Errors

Keywords

if

else

while

do

for

in

continue

break

return

new

try

catch

throw

this

instanceof

Literals

Use a literal to specify a value directly in an operation.

Integers

Use an integer literal to specify an integer type value in decimal, octal, or hex notation of a primitive type int, long, float, or double. Use the following single letter designations to specify the primitive type: l or L for long, f or F for float, and d or D for double. If not specified, the type defaults to int. Use 0 as a prefix to specify an integer literal as octal, and use 0x or 0X as a prefix to specify an integer literal as hex.

Grammar

INTEGER: '-'? ( '0' | [1-9] [0-9]* ) [lLfFdD]?;
OCTAL:   '-'? '0' [0-7]+ [lL]?;
HEX:     '-'? '0' [xX] [0-9a-fA-F]+ [lL]?;

Examples

  • Integer literals.

    0     (1)
    0D    (2)
    1234L (3)
    -90f  (4)
    -022  (5)
    0xF2A (6)
    1. int 0

    2. double 0.0

    3. long 1234

    4. float -90.0

    5. int -18 in octal

    6. int 3882 in hex

Floats

Use a floating point literal to specify a floating point type value of a primitive type float or double. Use the following single letter designations to specify the primitive type: f or F for float and d or D for double. If not specified, the type defaults to double.

Grammar

DECIMAL: '-'? ( '0' | [1-9] [0-9]* ) (DOT [0-9]+)? EXPONENT? [fFdD]?;
EXPONENT: ( [eE] [+\-]? [0-9]+ );

Examples

  • Floating point literals.

    0.0      (1)
    1E6      (2)
    0.977777 (3)
    -126.34  (4)
    89.9F    (5)
    1. double 0.0

    2. double 1000000.0 in exponent notation

    3. double 0.977777

    4. double -126.34

    5. float 89.9

Strings

Use a string literal to specify a String type value with either single-quotes or double-quotes. Use a \" token to include a double-quote as part of a double-quoted string literal. Use a \' token to include a single-quote as part of a single-quoted string literal. Use a \\ token to include a backslash as part of any string literal.

Grammar

STRING: ( '"'  ( '\\"'  | '\\\\' | ~[\\"] )*? '"'  )
      | ( '\'' ( '\\\'' | '\\\\' | ~[\\'] )*? '\'' );

Examples

  • String literals using single-quotes.

    'single-quoted string literal'
    '\'single-quoted with escaped single-quotes\' and backslash \\'
    'single-quoted with non-escaped "double-quotes"'
  • String literals using double-quotes.

    "double-quoted string literal"
    "\"double-quoted with escaped double-quotes\" and backslash: \\"
    "double-quoted with non-escaped 'single-quotes'"

Characters

Character literals are not specified directly. Instead, use the cast operator to convert a String type value into a char type value.

Identifiers

Use an identifier as a named token to specify a variable, type, field, method, or function.

Errors

If a keyword is used as an identifier.

Grammar

ID: [_a-zA-Z] [_a-zA-Z-0-9]*;

Examples

  • Variations of identifiers.

    a
    Z
    id
    list
    list0
    MAP25
    _map25
    Map_25

Variables

A variable loads and stores a value for evaluation during operations.

Declaration

Declare a variable before use with the format of type followed by identifier. Declare an array type variable using an opening [ token and a closing ] token for each dimension directly after the identifier. Specify a comma-separated list of identifiers following the type to declare multiple variables in a single statement. Use an assignment operator combined with a declaration to immediately assign a value to a variable. A variable not immediately assigned a value will have a default value assigned implicitly based on the type.

Errors

  • If a variable is used prior to or without declaration.

Grammar

declaration : type ID assignment? (',' ID assignment?)*;
type: ID ('.' ID)* ('[' ']')*;
assignment: '=' expression;

Examples

  • Different variations of variable declaration.

    int x;           (1)
    List y;          (2)
    int x, y = 5, z; (3)
    def d;           (4)
    int i = 10;      (5)
    float[] f;       (6)
    Map[][] m;       (7)
    1. declare int x; store default null to x

    2. declare List y; store default null to y

    3. declare int x; store default int 0 to x; declare int y; store int 5 to y; declare int z; store default int 0 to z;

    4. declare def d; store default null to d

    5. declare int i; store int 10 to i

    6. declare float[] f; store default null to f

    7. declare Map[][] m; store default null to m

Assignment

Use the assignment operator '=' to store a value in a variable for use in subsequent operations. Any operation that produces a value can be assigned to any variable as long as the types are the same or the resultant type can be implicitly cast to the variable type.

Errors

  • If the type of value is unable to match the type of variable.

Grammar

assignment: ID '=' expression

Examples

  • Variable assignment with an integer literal.

    int i;  (1)
    i = 10; (2)
    1. declare int i; store default int 0 to i

    2. store int 10 to i

  • Declaration combined with immediate assignment.

    int i = 10;     (1)
    double j = 2.0; (2)
    1. declare int i; store int 10 to i

    2. declare double j; store double 2.0 to j

  • Assignment of one variable to another using primitive type values.

    int i = 10; (1)
    int j = i;  (2)
    1. declare int i; store int 10 to i

    2. declare int j; load from iint 10; store int 10 to j

  • Assignment with reference types using the new instance operator.

    ArrayList l = new ArrayList(); (1)
    Map m = new HashMap();         (2)
    1. declare ArrayList l; allocate ArrayList instance → ArrayList reference; store ArrayList reference to l

    2. declare Map m; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map referenceMap reference; store Map reference to m

  • Assignment of one variable to another using reference type values.

    List l = new ArrayList(); (1)
    List k = l;               (2)
    List m;                   (3)
    m = k;                    (4)
    1. declare List l; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to l

    2. declare List k; load from lList reference; store List reference to k; (note l and k refer to the same instance known as a shallow-copy)

    3. declare List m; store default null to m

    4. load from kList reference; store List reference to m; (note l, k, and m refer to the same instance)

  • Assignment with array type variables using the new array operator.

    int[] ia1;                   (1)
    ia1 = new int[2];            (2)
    ia1[0] = 1;                  (3)
    int[] ib1 = ia1;             (4)
    int[][] ic2 = new int[2][5]; (5)
    ic2[1][3] = 2;               (6)
    ic2[0] = ia1;                (7)
    1. declare int[] ia1; store default null to ia1

    2. allocate 1-d int array instance with length [2]1-d int array reference; store 1-d int array reference to ia1

    3. load from ia11-d int array reference; store int 1 to index [0] of 1-d int array reference

    4. declare int[] ib1; load from ia11-d int array reference; store 1-d int array reference to ib1; (note ia1 and ib1 refer to the same instance known as a shallow copy)

    5. declare int[][] ic2; allocate 2-d int array instance with length [2, 5]2-d int array reference; store 2-d int array reference to ic2

    6. load from ic22-d int array reference; store int 2 to index [1, 3] of 2-d int array reference

    7. load from ia11-d int array reference; load from ic22-d int array reference; store 1-d int array reference to index [0] of 2-d int array reference; (note ia1, ib1, and index [0] of ia2 refer to the same instance)

Types

A type is a classification of data used to define the properties of a value. These properties specify what data a value represents and the rules for how a value is evaluated during an operation. Each type belongs to one of the following categories: primitive, reference, or dynamic.

Primitive Types

A primitive type represents basic data built natively into the JVM and is allocated to non-heap memory. Declare a primitive type variable or access a primitive type member field (from a reference type instance), and assign it a primitive type value for evaluation during later operations. The default value for a newly-declared primitive type variable is listed as part of the definitions below. A primitive type value is copied during an assignment or as an argument for a method/function call.

A primitive type has a corresponding reference type (also known as a boxed type). Use the field access operator or method call operator on a primitive type value to force evaluation as its corresponding reference type value.

The following primitive types are available:

byte

8-bit, signed, two’s complement integer

  • range: [-128, 127]

  • default value: 0

  • reference type: Byte

short

16-bit, signed, two’s complement integer

  • range: [-32768, 32767]

  • default value: 0

  • reference type: Short

char

16-bit, unsigned, Unicode character

  • range: [0, 65535]

  • default value: 0 or \u0000

  • reference type: Character

int

32-bit, signed, two’s complement integer

  • range: [-2^32, 2^32-1]

  • default value: 0

  • reference type: Integer

long

64-bit, signed, two’s complement integer

  • range: [-2^64, 2^64-1]

  • default value: 0

  • reference type: Long

float

32-bit, signed, single-precision, IEEE 754 floating point number

  • default value: 0.0

  • reference type: Float

double

64-bit, signed, double-precision, IEEE 754 floating point number

  • default value: 0.0

  • reference type: Double

boolean

logical quantity with two possible values of true and false

  • default value: false

  • reference type: Boolean

Examples

  • Primitive types used in declaration, declaration and assignment.

    int i = 1;        (1)
    double d;         (2)
    boolean b = true; (3)
    1. declare int i; store int 1 to i

    2. declare double d; store default double 0.0 to d

    3. declare boolean b; store boolean true to b

  • Method call on a primitive type using the corresponding reference type.

    int i = 1;    (1)
    i.toString(); (2)
    1. declare int i; store int 1 to i

    2. load from iint 1; box int 1Integer 1 reference; call toString on Integer 1 referenceString '1'

Reference Types

A reference type is a named construct (object), potentially representing multiple pieces of data (member fields) and logic to manipulate that data (member methods), defined as part of the application programming interface (API) for scripts.

A reference type instance is a single set of data for one reference type object allocated to the heap. Use the new instance operator to allocate a reference type instance. Use a reference type instance to load from, store to, and manipulate complex data.

A reference type value refers to a reference type instance, and multiple reference type values may refer to the same reference type instance. A change to a reference type instance will affect all reference type values referring to that specific instance.

Declare a reference type variable or access a reference type member field (from a reference type instance), and assign it a reference type value for evaluation during later operations. The default value for a newly-declared reference type variable is null. A reference type value is shallow-copied during an assignment or as an argument for a method/function call. Assign null to a reference type variable to indicate the reference type value refers to no reference type instance. The JVM will garbage collect a reference type instance when it is no longer referred to by any reference type values. Pass null as an argument to a method/function call to indicate the argument refers to no reference type instance.

A reference type object defines zero-to-many of each of the following:

static member field

A static member field is a named and typed piece of data. Each reference type object contains one set of data representative of its static member fields. Use the field access operator in correspondence with the reference type object name to access a static member field for loading and storing to a specific reference type object. No reference type instance allocation is necessary to use a static member field.

non-static member field

A non-static member field is a named and typed piece of data. Each reference type instance contains one set of data representative of its reference type object’s non-static member fields. Use the field access operator for loading and storing to a non-static member field of a specific reference type instance. An allocated reference type instance is required to use a non-static member field.

static member method

A static member method is a function called on a reference type object. Use the method call operator in correspondence with the reference type object name to call a static member method. No reference type instance allocation is necessary to use a static member method.

non-static member method

A non-static member method is a function called on a reference type instance. A non-static member method called on a reference type instance can load from and store to non-static member fields of that specific reference type instance. Use the method call operator in correspondence with a specific reference type instance to call a non-static member method. An allocated reference type instance is required to use a non-static member method.

constructor

A constructor is a special type of function used to allocate a reference type instance defined by a specific reference type object. Use the new instance operator to allocate a reference type instance.

A reference type object follows a basic inheritance model. Consider types A and B. Type A is considered to be a parent of B, and B a child of A, if B inherits (is able to access as its own) all of A’s non-static members. Type B is considered a descendant of A if there exists a recursive parent-child relationship from B to A with none to many types in between. In this case, B inherits all of A’s non-static members along with all of the non-static members of the types in between. Type B is also considered to be a type A in both relationships.

Examples

  • Reference types evaluated in several different operations.

    List l = new ArrayList(); (1)
    l.add(1);                 (2)
    int i = l.get(0) + 2;     (3)
    1. declare List l; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to l

    2. load from lList reference; implicit cast int 1 to defdef call add on List reference with arguments (def)

    3. declare int i; load from lList reference; call get on List reference with arguments (int 0) → def; implicit cast def to int 1int 1; add int 1 and int 2int 3; store int 3 to i

  • Sharing a reference type instance.

    List l0 = new ArrayList();     (1)
    List l1 = l0;                  (2)
    l0.add(1);                     (3)
    l1.add(2);                     (4)
    int i = l1.get(0) + l0.get(1); (5)
    1. declare List l0; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to l0

    2. declare List l1; load from l0List reference; store List reference to l1 (note l0 and l1 refer to the same instance known as a shallow-copy)

    3. load from l0List reference; implicit cast int 1 to defdef call add on List reference with arguments (def)

    4. load from l1List reference; implicit cast int 2 to defdef call add on List reference with arguments (def)

    5. declare int i; load from l0List reference; call get on List reference with arguments (int 0) → def @0; implicit cast def @0 to int 1int 1; load from l1List reference; call get on List reference with arguments (int 1) → def @1; implicit cast def @1 to int 2int 2; add int 1 and int 2int 3; store int 3 to i;

  • Using the static members of a reference type.

    int i = Integer.MAX_VALUE;       (1)
    long l = Long.parseLong("123L"); (2)
    1. declare int i; load from MAX_VALUE on Integerint 2147483647; store int 2147483647 to i

    2. declare long l; call parseLong on Long with arguments (long 123) → long 123; store long 123 to l

Dynamic Types

A dynamic type value can represent the value of any primitive type or reference type using a single type name def. A def type value mimics the behavior of whatever value it represents at run-time and will always represent the child-most descendant type value of any type value when evaluated during operations.

Declare a def type variable or access a def type member field (from a reference type instance), and assign it any type of value for evaluation during later operations. The default value for a newly-declared def type variable is null. A def type variable or method/function parameter can change the type it represents during the compilation and evaluation of a script.

Using the def type can have a slight impact on performance. Use only primitive types and reference types directly when performance is critical.

Errors

  • If a def type value represents an inappropriate type for evaluation of an operation at run-time.

Examples

  • General uses of the def type.

    def dp = 1;               (1)
    def dr = new ArrayList(); (2)
    dr = dp;                  (3)
    1. declare def dp; implicit cast int 1 to defdef; store def to dp

    2. declare def dr; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef; store def to dr

    3. load from dpdef; store def to dr; (note the switch in the type dr represents from ArrayList to int)

  • A def type value representing the child-most descendant of a value.

    Object l = new ArrayList(); (1)
    def d = l;                  (2)
    d.ensureCapacity(10);       (3)
    1. declare Object l; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to Object referenceObject reference; store Object reference to l

    2. declare def d; load from lObject reference; implicit cast Object reference to defdef; store def to d;

    3. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call ensureCapacity on ArrayList reference with arguments (int 10); (note def was implicit cast to ArrayList reference since ArrayList` is the child-most descendant type value that the def type value represents)

String Type

The String type is a specialized reference type that does not require explicit allocation. Use a string literal to directly evaluate a String type value. While not required, the new instance operator can allocate String type instances.

Examples

  • General use of the String type.

    String r = "some text";             (1)
    String s = 'some text';             (2)
    String t = new String("some text"); (3)
    String u;                           (4)
    1. declare String r; store String "some text" to r

    2. declare String s; store String 'some text' to s

    3. declare String t; allocate String instance with arguments (String "some text") → String "some text"; store String "some text" to t

    4. declare String u; store default null to u

void Type

The void type represents the concept of a lack of type. Use the void type to indicate a function returns no value.

Examples

  • Use of the void type in a function.

    void addToList(List l, def d) {
        l.add(d);
    }

Array Type

An array type is a specialized reference type where an array type instance contains a series of values allocated to the heap. Each value in an array type instance is defined as an element. All elements in an array type instance are of the same type (element type) specified as part of declaration. Each element is assigned an index within the range [0, length) where length is the total number of elements allocated for an array type instance.

Use the new array operator or the array initialization operator to allocate an array type instance. Declare an array type variable or access an array type member field (from a reference type instance), and assign it an array type value for evaluation during later operations. The default value for a newly-declared array type variable is null. An array type value is shallow-copied during an assignment or as an argument for a method/function call. Assign null to an array type variable to indicate the array type value refers to no array type instance. The JVM will garbage collect an array type instance when it is no longer referred to by any array type values. Pass null as an argument to a method/function call to indicate the argument refers to no array type instance.

Use the array length operator to retrieve the length of an array type value as an int type value. Use the array access operator to load from and store to an individual element within an array type instance.

When an array type instance is allocated with multiple dimensions using the range [2, d] where d >= 2, each element within each dimension in the range [1, d-1] is also an array type. The element type of each dimension, n, is an array type with the number of dimensions equal to d-n. For example, consider int[][][] with 3 dimensions. Each element in the 3rd dimension, d-3, is the primitive type int. Each element in the 2nd dimension, d-2, is the array type int[]. And each element in the 1st dimension, d-1 is the array type int[][].

Examples

  • General use of single-dimensional arrays.

    int[] x;                   (1)
    float[] y = new float[10]; (2)
    def z = new float[5];      (3)
    y[9] = 1.0F;               (4)
    z[0] = y[9];               (5)
    1. declare int[] x; store default null to x

    2. declare float[] y; allocate 1-d float array instance with length [10]1-d float array reference; store 1-d float array reference to y

    3. declare def z; allocate 1-d float array instance with length [5]1-d float array reference; implicit cast 1-d float array reference to defdef; store def to z

    4. load from y1-d float array reference; store float 1.0 to index [9] of 1-d float array reference

    5. load from y1-d float array reference @0; load from index [9] of 1-d float array reference @0float 1.0; load from zdef; implicit cast def to 1-d float array reference @11-d float array reference @1; store float 1.0 to index [0] of 1-d float array reference @1

  • General use of a multi-dimensional array.

    int[][][] ia3 = new int[2][3][4]; (1)
    ia3[1][2][3] = 99;                (2)
    int i = ia3[1][2][3];             (3)
    1. declare int[][][] ia; allocate 3-d int array instance with length [2, 3, 4]3-d int array reference; store 3-d int array reference to ia3

    2. load from ia33-d int array reference; store int 99 to index [1, 2, 3] of 3-d int array reference

    3. declare int i; load from ia33-d int array reference; load from index [1, 2, 3] of 3-d int array referenceint 99; store int 99 to i

Casting

A cast converts the value of an original type to the equivalent value of a target type. An implicit cast infers the target type and automatically occurs during certain operations. An explicit cast specifies the target type and forcefully occurs as its own operation. Use the cast operator '()' to specify an explicit cast.

Refer to the cast table for a quick reference on all allowed casts.

Errors

  • If during a cast there exists no equivalent value for the target type.

  • If an implicit cast is given, but an explicit cast is required.

Grammar

cast: '(' TYPE ')' expression

Examples

  • Valid casts.

    int i = (int)5L;         (1)
    Map m = new HashMap();   (2)
    HashMap hm = (HashMap)m; (3)
    1. declare int i; explicit cast long 5 to int 5int 5; store int 5 to i

    2. declare Map m; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map referenceMap reference; store Map reference to m

    3. declare HashMap hm; load from mMap reference; explicit cast Map reference to HashMap referenceHashMap reference; store HashMap reference to hm

Numeric Type Casting

A numeric type cast converts the value of an original numeric type to the equivalent value of a target numeric type. A cast between two numeric type values results in data loss when the value of the original numeric type is larger than the target numeric type can accommodate. A cast between an integer type value and a floating point type value can result in precision loss.

The allowed casts for values of each numeric type are shown as a row in the following table:

byte

short

char

int

long

float

double

byte

implicit

implicit

implicit

implicit

implicit

implicit

short

explicit

explicit

implicit

implicit

implicit

implicit

char

explicit

explicit

implicit

implicit

implicit

implicit

int

explicit

explicit

explicit

implicit

implicit

implicit

long

explicit

explicit

explicit

explicit

implicit

implicit

float

explicit

explicit

explicit

explicit

explicit

implicit

double

explicit

explicit

explicit

explicit

explicit

explicit

Examples

  • Valid numeric type casts.

    int a = 1;            (1)
    long b = a;           (2)
    short c = (short)b;   (3)
    double e = (double)a; (4)
    1. declare int a; store int 1 to a

    2. declare long b; load from aint 1; implicit cast int 1 to long 1long 1; store long 1 to b

    3. declare short c; load from blong 1; explicit cast long 1 to short 1short 1; store short 1 value to c

    4. declare double e; load from aint 1; explicit cast int 1 to double 1.0; store double 1.0 to e; (note the explicit cast is extraneous since an implicit cast is valid)

  • Invalid numeric type casts resulting in errors.

    int a = 1.0; // error (1)
    int b = 2;            (2)
    byte c = b;  // error (3)
    1. declare int i; error → cannot implicit cast double 1.0 to int 1; (note an explicit cast is valid)

    2. declare int b; store int 2 to b

    3. declare byte c; load from bint 2; error → cannot implicit cast int 2 to byte 2; (note an explicit cast is valid)

Reference Type Casting

A reference type cast converts the value of an original reference type to the equivalent value of a target reference type. An implicit cast between two reference type values is allowed when the original reference type is a descendant of the target type. An explicit cast between two reference type values is allowed when the original type is a descendant of the target type or the target type is a descendant of the original type.

Examples

  • Valid reference type casts.

    List x;                        (1)
    ArrayList y = new ArrayList(); (2)
    x = y;                         (3)
    y = (ArrayList)x;              (4)
    x = (List)y;                   (5)
    1. declare List x; store default value null to x

    2. declare ArrayList y; allocate ArrayList instance → ArrayList reference; store ArrayList reference to y;

    3. load from yArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to x; (note ArrayList is a descendant of List)

    4. load from xList reference; explicit cast List reference to ArrayList referenceArrayList reference; store ArrayList reference to y;

    5. load from yArrayList reference; explicit cast ArrayList reference to List referenceList reference; store List reference to x; (note the explicit cast is extraneous, and an implicit cast is valid)

  • Invalid reference type casts resulting in errors.

    List x = new ArrayList();          (1)
    ArrayList y = x;          // error (2)
    Map m = (Map)x;           // error (3)
    1. declare List x; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to x

    2. declare ArrayList y; load from xList reference; error → cannot implicit cast List reference to ArrayList reference; (note an explicit cast is valid since ArrayList is a descendant of List)

    3. declare ArrayList y; load from xList reference; error → cannot explicit cast List reference to Map reference; (note no cast is valid since neither List nor Map is a descendant of the other)

Dynamic Type Casting

A dynamic (def) type cast converts the value of an original def type to the equivalent value of any target type or converts the value of any original type to the equivalent value of a target def type.

An implicit cast from any original type value to a def type value is always allowed. An explicit cast from any original type value to a def type value is always allowed but never necessary.

An implicit or explicit cast from an original def type value to any target type value is allowed if and only if the cast is normally allowed based on the current type value the def type value represents.

Examples

  • Valid dynamic type casts with any original type to a target def type.

    def d0 = 3;               (1)
    d0 = new ArrayList();     (2)
    Object o = new HashMap(); (3)
    def d1 = o;               (4)
    int i = d1.size();        (5)
    1. declare def d0; implicit cast int 3 to def; store int 3 to d0

    2. allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef; store def to d0

    3. declare Object o; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Object referenceObject reference; store Object reference to o

    4. declare def d1; load from oObject reference; implicit cast Object reference to defdef; store def to d1

    5. declare int i; load from d1def; implicit cast def to HashMap reference → HashMap reference`; call size on HashMap referenceint 0; store int 0 to i; (note def was implicit cast to HashMap reference since HashMap is the child-most descendant type value that the def type value represents)

  • Valid dynamic type casts with an original def type to any target type.

    def d = 1.0;         (1)
    int i = (int)d;      (2)
    d = 1;               (3)
    float f = d;         (4)
    d = new ArrayList(); (5)
    List l = d;          (6)
    1. declare def d; implicit cast double 1.0 to defdef; store def to d

    2. declare int i; load from ddef; implicit cast def to double 1.0double 1.0; explicit cast double 1.0 to int 1int 1; store int 1 to i; (note the explicit cast is necessary since a double type value is not converted to an int type value implicitly)

    3. store int 1 to d; (note the switch in the type d represents from double to int)

    4. declare float i; load from ddef; implicit cast def to int 1int 1; implicit cast int 1 to float 1.0float 1.0; store float 1.0 to f

    5. allocate ArrayList instance → ArrayList reference; store ArrayList reference to d; (note the switch in the type d represents from int to ArrayList)

    6. declare List l; load from ddef; implicit cast def to ArrayList referenceArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to l

  • Invalid dynamic type casts resulting in errors.

    def d = 1;                  (1)
    short s = d;       // error (2)
    d = new HashMap();          (3)
    List l = d;        // error (4)
    1. declare def d; implicit cast int 1 to defdef; store def to d

    2. declare short s; load from ddef; implicit cast def to int 1int 1; error → cannot implicit cast int 1 to short 1; (note an explicit cast is valid)

    3. allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef; store def to d

    4. declare List l; load from ddef; implicit cast def to HashMap reference; error → cannot implicit cast HashMap reference to List reference; (note no cast is valid since neither HashMap nor List is a descendant of the other)

String to Character Casting

Use the cast operator to convert a String type value into a char type value.

Errors

  • If the String type value isn’t one character in length.

  • If the String type value is null.

Examples

  • Casting string literals into char type values.

    char c = (char)"C"; (1)
    c = (char)'c';      (2)
    1. declare char c; explicit cast String "C" to char Cchar C; store char C to c

    2. explicit cast String 'c' to char cchar c; store char c to c

  • Casting a String reference into a char type value.

    String s = "s";   (1)
    char c = (char)s; (2)
    1. declare String s; store String "s" to s;

    2. declare char c load from sString "s"; explicit cast String "s" to char schar s; store char s to c

Boxing and Unboxing

Boxing is a special type of cast used to convert a primitive type to its corresponding reference type. Unboxing is the reverse used to convert a reference type to its corresponding primitive type.

Implicit boxing/unboxing occurs during the following operations:

  • Conversions between a def type and a primitive type are implicitly boxed/unboxed as necessary, though this is referred to as an implicit cast throughout the documentation.

  • Method/function call arguments are implicitly boxed/unboxed as necessary.

  • A primitive type value is implicitly boxed when a reference type method is called on it.

Explicit boxing/unboxing is not allowed. Use the reference type API to explicitly convert a primitive type value to its respective reference type value and vice versa.

Errors

  • If an explicit cast is made to box/unbox a primitive type.

Examples

  • Uses of implicit boxing/unboxing.

    List l = new ArrayList();       (1)
    l.add(1);                       (2)
    Integer I = Integer.valueOf(0); (3)
    int i = l.get(i);               (4)
    1. declare List l; allocate ArrayList instance → ArrayList reference; store ArrayList reference to l;

    2. load from lList reference; implicit cast int 1 to defdef; call add on List reference with arguments (def); (note internally int 1 is boxed to Integer 1 to store as a def type value)

    3. declare Integer I; call valueOf on Integer with arguments of (int 0) → Integer 0; store Integer 0 to I;

    4. declare int i; load from IInteger 0; unbox Integer 0int 0; load from lList reference; call get on List reference with arguments (int 0) → def; implicit cast def to int 1int 1; store int 1 to i; (note internally int 1 is unboxed from Integer 1 when loaded from a def type value)

  • Uses of invalid boxing/unboxing resulting in errors.

    Integer x = 1;                   // error (1)
    Integer y = (Integer)1;          // error (2)
    int a = Integer.valueOf(1);      // error (3)
    int b = (int)Integer.valueOf(1); // error (4)
    1. declare Integer x; error → cannot implicit box int 1 to Integer 1 during assignment

    2. declare Integer y; error → cannot explicit box int 1 to Integer 1 during assignment

    3. declare int a; call valueOf on Integer with arguments of (int 1) → Integer 1; error → cannot implicit unbox Integer 1 to int 1 during assignment

    4. declare int a; call valueOf on Integer with arguments of (int 1) → Integer 1; error → cannot explicit unbox Integer 1 to int 1 during assignment

Promotion

Promotion is when a single value is implicitly cast to a certain type or multiple values are implicitly cast to the same type as required for evaluation by certain operations. Each operation that requires promotion has a promotion table that shows all required implicit casts based on the type(s) of value(s). A value promoted to a def type at compile-time is promoted again at run-time based on the type the def value represents.

Errors

  • If a specific operation cannot find an allowed promotion type for the type(s) of value(s) given.

Examples

  • Uses of promotion.

    double d = 2 + 2.0; (1)
    def x = 1;          (2)
    float f = x + 2.0F; (3)
    1. declare double d; promote int 2 and double 2.0 @0: result double; implicit cast int 2 to double 2.0 @1double 2.0 @1; add double 2.0 @1 and double 2.0 @0double 4.0; store double 4.0 to d

    2. declare def x; implicit cast int 1 to defdef; store def to x;

    3. declare float f; load from xdef; implicit cast def to int 1int 1; promote int 1 and float 2.0: result float; implicit cast int 1 to float 1.0float `1.0; add float 1.0 and float 2.0float 3.0; store float 3.0 to f; (note this example illustrates promotion done at run-time as promotion done at compile-time would have resolved to a def type value)

Allowed Casts

The following tables show all allowed casts. Read the tables row by row, where the original type is shown in the first column, and each subsequent column indicates whether a cast to the specified target type is implicit (I), explicit (E), or is not allowed (-).

Primitive/Reference Types

o

b

s

c

i

j

f

d

O

B

S

C

I

L

F

D

T

R

def

boolean ( o )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

byte ( b )

-

I

I

I

I

I

I

-

-

-

-

-

-

-

-

-

-

I

short ( s )

-

E

E

I

I

I

I

-

-

-

-

-

-

-

-

-

-

I

char ( c )

-

E

E

I

I

I

I

-

-

-

-

-

-

-

-

E

-

I

int ( i )

-

E

E

E

I

I

I

-

-

-

-

-

-

-

-

-

-

I

long ( j )

-

E

E

E

E

I

I

-

-

-

-

-

-

-

-

-

-

I

float ( f )

-

E

E

E

E

E

I

-

-

-

-

-

-

-

-

-

-

I

double ( d )

-

E

E

E

E

E

E

-

-

-

-

-

-

-

-

-

-

I

Boolean ( O )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Byte ( B )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Short ( S )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Character ( C )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Integer ( I )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Long ( L )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Float ( F )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Double ( D )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

I

String ( T )

-

-

-

E

-

-

-

-

-

-

-

-

-

-

-

-

-

I

Reference ( R )

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

@

I

@ See reference type casting for allowed reference type casts.

def Type

o

b

s

c

i

j

f

d

O

B

S

C

I

L

F

D

T

R

def

def as boolean

I

-

-

-

-

-

-

-

I

-

-

-

-

-

-

-

-

-

def as byte

-

I

I

I

I

I

I

I

-

I

I

I

I

I

I

I

-

-

def as short

-

E

I

E

I

I

I

I

-

E

I

E

I

I

I

I

-

-

def as char

-

E

E

I

I

I

I

I

-

E

E

I

I

I

I

I

E

-

def as int

-

E

E

E

I

I

I

I

-

E

E

E

I

I

I

I

-

-

def as long

-

E

E

E

E

I

I

I

-

E

E

E

E

I

I

I

-

-

def as float

-

E

E

E

E

E

I

I

-

E

E

E

E

E

I

I

-

-

def as double

-

E

E

E

E

E

E

I

-

E

E

E

E

E

E

I

-

-

def as Boolean

I

-

-

-

-

-

-

-

I

-

-

-

-

-

-

-

-

def as Byte

-

I

I

I

I

I

I

I

-

I

I

I

I

I

I

I

-

-

def as Short

-

E

I

E

I

I

I

I

-

E

I

E

I

I

I

I

-

-

def as Character

-

E

E

I

I

I

I

I

-

E

E

I

I

I

I

I

-

-

def as Integer

-

E

E

E

I

I

I

I

-

E

E

E

I

I

I

I

-

-

def as Long

-

E

E

E

E

I

I

I

-

E

E

E

E

I

I

I

-

-

def as Float

-

E

E

E

E

E

I

I

-

E

E

E

E

E

I

I

-

-

def as Double

-

E

E

E

E

E

E

I

-

E

E

E

E

E

E

I

-

-

def as String

-

-

-

E

-

-

-

-

-

-

-

-

-

-

-

-

I

-

def as Reference

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

@

@ See reference type casting for allowed reference type casts.

Operators

An operator is the most basic action that can be taken to evaluate values in a script. An expression is one-to-many consecutive operations. Precedence is the order in which an operator will be evaluated relative to another operator. Associativity is the direction within an expression in which a specific operator is evaluated. The following table lists all available operators:

Operator

Category

Symbol(s)

Precedence

Associativity

Precedence

General

()

0

left → right

Method Call

Reference

. ()

1

left → right

Field Access

Reference

.

1

left → right

Null Safe

Reference

?.

1

left → right

Function Call

General

()

1

left → right

Array Initialization

Array

[] {}

1

left → right

Array Access

Array

[]

1

left → right

Array Length

Array

.

1

left → right

List Initialization

Reference

[]

1

left → right

List Access

Reference

[]

1

left → right

Map Initialization

Reference

[:]

1

left → right

Map Access

Reference

[]

1

left → right

Post Increment

Numeric

++

1

left → right

Post Decrement

Numeric

 — 

1

left → right

Pre Increment

Numeric

++

2

right → left

Pre Decrement

Numeric

 — 

2

right → left

Unary Positive

Numeric

+

2

right → left

Unary Negative

Numeric

-

2

right → left

Boolean Not

Boolean

!

2

right → left

Bitwise Not

Numeric

~

2

right → left

Cast

General

()

3

right → left

New Instance

Reference

new ()

3

right → left

New Array

Array

new []

3

right → left

Multiplication

Numeric

*

4

left → right

Division

Numeric

/

4

left → right

Remainder

Numeric

%

4

left → right

String Concatenation

Reference

+

5

left → right

Addition

Numeric

+

5

left → right

Subtraction

Numeric

-

5

left → right

Left Shift

Numeric

<<

6

left → right

Right Shift

Numeric

>>

6

left → right

Unsigned Right Shift

Numeric

>>>

6

left → right

Greater Than

Boolean

>

7

left → right

Greater Than Or Equal

Boolean

>=

7

left → right

Less Than

Boolean

<

7

left → right

Less Than Or Equal

Boolean

7

left → right

Instanceof

Boolean

instanceof

8

left → right

Equality Equals

Boolean

==

9

left → right

Equality Not Equals

Boolean

!=

9

left → right

Identity Equals

Boolean

===

9

left → right

Identity Not Equals

Boolean

!==

9

left → right

Bitwise And

Numeric

&

10

left → right

Boolean Xor

Boolean

^

11

left → right

Bitwise Xor

Numeric

^

11

left → right

Bitwise Or

Numeric

|

12

left → right

Boolean And

Boolean

&&

13

left → right

Boolean Or

Boolean

||

14

left → right

Conditional

General

? :

15

right → left

Elvis

General

?:

16

right → left

Assignment

General

=

17

right → left

Compound Assignment

General

$=

17

right → left

Operators: General

Precedence

Use the precedence operator '()' to guarantee the order of evaluation for an expression. An expression encapsulated by the precedence operator (enclosed in parentheses) overrides existing precedence relationships between operators and is evaluated prior to other expressions in inward-to-outward order.

Grammar

precedence: '(' expression ')';

Examples

  • Precedence with numeric operators.

    int x = (5+4)*6;   (1)
    int y = 12/(x-50); (2)
    1. declare int x; add int 5 and int 4int 9; multiply int 9 and int 6int 54; store int 54 to x; (note the add is evaluated before the multiply due to the precedence operator)

    2. declare int y; load from xint 54; subtract int 50 from int 54int 4; divide int 12 by int 4int 3; store int 3 to y; (note the subtract is evaluated before the divide due to the precedence operator)

Function Call

Use the function call operator () to call an existing function. A function call is defined within a script.

Grammar

function_call: ID '(' ( expression (',' expression)* )? ')'';

Examples

  • A function call.

    int add(int x, int y) { (1)
          return x + y;
      }
    
    int z = add(1, 2); (2)
    1. define function add that returns int and has parameters (int x, int y)

    2. declare int z; call add with arguments (int 1, int 2) → int 3; store int 3 to z

Cast

An explicit cast converts the value of an original type to the equivalent value of a target type forcefully as an operation. Use the cast operator '()' to specify an explicit cast. Refer to casting for more information.

Conditional

A conditional consists of three expressions. The first expression is evaluated with an expected boolean result type. If the first expression evaluates to true then the second expression will be evaluated. If the first expression evaluates to false then the third expression will be evaluated. The second and third expressions will be promoted if the evaluated values are not the same type. Use the conditional operator '? :' as a shortcut to avoid the need for a full if/else branch in certain expressions.

Errors

  • If the first expression does not evaluate to a boolean type value.

  • If the values for the second and third expressions cannot be promoted.

Grammar

conditional: expression '?' expression ':' expression;

Promotion

byte

short

char

int

long

float

double

Reference

def

byte

int

int

int

int

long

float

double

-

def

short

int

int

int

int

long

float

double

-

def

char

int

int

int

int

long

float

double

-

def

int

int

int

int

int

long

float

double

-

def

long

long

long

long

long

long

float

double

-

def

float

float

float

float

float

float

float

double

-

def

double

double

double

double

double

double

double

double

-

def

Reference

-

-

-

-

-

-

-

Object @

def

def

def

def

def

def

def

def

def

def

def

@ If the two reference type values are the same then this promotion will not occur.

Examples

  • Evaluation of conditionals.

    boolean b = true;        (1)
    int x = b ? 1 : 2;       (2)
    List y = x > 1 ? new ArrayList() : null; (3)
    def z = x < 2 ? x : 2.0; (4)
    1. declare boolean b; store boolean true to b

    2. declare int x; load from bboolean true evaluate 1st expression: int 1int 1; store int 1 to x

    3. declare List y; load from xint 1; int 1 greater than int 1boolean false; evaluate 2nd expression: nullnull; store null to y;

    4. declare def z; load from xint 1; int 1 less than int 2boolean true; evaluate 1st expression: load from xint 1; promote int 1 and double 2.0: result double; implicit cast int 1 to double 1.0double 1.0; implicit cast double 1.0 to defdef; store def to z;

Assignment

Use the assignment operator '=' to store a value in a variable or reference type member field for use in subsequent operations. Any operation that produces a value can be assigned to any variable/field as long as the types are the same or the resultant type can be implicitly cast to the variable/field type.

See variable assignment for examples using variables.

Errors

  • If the type of value is unable to match the type of variable or field.

Grammar

assignment: field '=' expression

Examples

The examples use the following reference type definition:

name:
  Example

non-static member fields:
  * int x
  * def y
  * List z
  • Field assignments of different type values.

    Example example = new Example(); (1)
    example.x = 1;                   (2)
    example.y = 2.0;                 (3)
    example.z = new ArrayList();     (4)
    1. declare Example example; allocate Example instance → Example reference; store Example reference to example

    2. load from exampleExample reference; store int 1 to x of Example reference

    3. load from exampleExample reference; implicit cast double 2.0 to defdef; store def to y of Example reference

    4. load from exampleExample reference; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to z of Example reference

  • A field assignment from a field access.

    Example example = new Example(); (1)
    example.x = 1;                   (2)
    example.y = example.x;           (3)
    1. declare Example example; allocate Example instance → Example reference; store Example reference to example

    2. load from exampleExample reference; store int 1 to x of Example reference

    3. load from exampleExample reference @0; load from exampleExample reference @1; load from x of Example reference @1int 1; implicit cast int 1 to defdef; store def to y of Example reference @0; (note Example reference @0 and Example reference @1 are the same)

Compound Assignment

Use the compound assignment operator '$=' as a shortcut for an assignment where a binary operation would occur between the variable/field as the left-hand side expression and a separate right-hand side expression.

A compound assignment is equivalent to the expression below where V is the variable/field and T is the type of variable/member.

V = (T)(V op expression);

Operators

The table below shows the available operators for use in a compound assignment. Each operator follows the casting/promotion rules according to their regular definition. For numeric operations there is an extra implicit cast when necessary to return the promoted numeric type value to the original numeric type value of the variable/field and can result in data loss.

Operator

Compound Symbol

Multiplication

*=

Division

/=

Remainder

%=

Addition

+=

Subtraction

-=

Left Shift

<⇐

Right Shift

>>=

Unsigned Right Shift

>>>=

Bitwise And

&=

Boolean And

&=

Bitwise Xor

^=

Boolean Xor

^=

Bitwise Or

|=

Boolean Or

|=

String Concatenation

+=

Errors

  • If the type of value is unable to match the type of variable or field.

Grammar

compound_assignment: ( ID | field ) '$=' expression;

Note the use of the $= represents the use of any of the possible binary operators.

Examples

  • Compound assignment for each numeric operator.

    int i = 10; (1)
    i *= 2;     (2)
    i /= 5;     (3)
    i %= 3;     (4)
    i += 5;     (5)
    i -= 5;     (6)
    i <<= 2;    (7)
    i >>= 1;    (8)
    i >>>= 1;   (9)
    i &= 15;    (10)
    i ^= 12;    (11)
    i |= 2;     (12)
    1. declare int i; store int 10 to i

    2. load from iint 10; multiply int 10 and int 2int 20; store int 20 to i; (note this is equivalent to i = i*2)

    3. load from iint 20; divide int 20 by int 5int 4; store int 4 to i; (note this is equivalent to i = i/5)

    4. load from iint 4; remainder int 4 by int 3int 1; store int 1 to i; (note this is equivalent to i = i%3)

    5. load from iint 1; add int 1 and int 5int 6; store int 6 to i; (note this is equivalent to i = i+5)

    6. load from iint 6; subtract int 5 from int 6int 1; store int 1 to i; (note this is equivalent to i = i-5)

    7. load from iint 1; left shift int 1 by int 2int 4; store int 4 to i; (note this is equivalent to i = i<<2)

    8. load from iint 4; right shift int 4 by int 1int 2; store int 2 to i; (note this is equivalent to i = i>>1)

    9. load from iint 2; unsigned right shift int 2 by int 1int 1; store int 1 to i; (note this is equivalent to i = i>>>1)

    10. load from iint 1; bitwise and int 1 and int 15int 1; store int 1 to i; (note this is equivalent to i = i&2)

    11. load from iint 1; bitwise xor int 1 and int 12int 13; store int 13 to i; (note this is equivalent to i = i^2)

    12. load from iint 13; bitwise or int 13 and int 2int 15; store int 15 to i; (note this is equivalent to i = i|2)

  • Compound assignment for each boolean operator.

    boolean b = true; (1)
    b &= false;       (2)
    b ^= false;       (3)
    b |= true;        (4)
    1. declare boolean b; store boolean true in b;

    2. load from bboolean true; boolean and boolean true and boolean falseboolean false; store boolean false to b; (note this is equivalent to b = b && false)

    3. load from bboolean false; boolean xor boolean false and boolean falseboolean false; store boolean false to b; (note this is equivalent to b = b ^ false)

    4. load from bboolean true; boolean or boolean false and boolean trueboolean true; store boolean true to b; (note this is equivalent to b = b || true)

  • A compound assignment with the string concatenation operator.

    String s = 'compound'; (1)
    s += ' assignment';    (2)
    1. declare String s; store String 'compound' to s;

    2. load from sString 'compound'; string concat String 'compound' and String ' assignment''String 'compound assignment'; store String 'compound assignment' to s; (note this is equivalent to s = s + ' assignment')

  • A compound assignment with the def type.

    def x = 1; (1)
    x += 2;    (2)
    1. declare def x; implicit cast int 1 to def; store def to x;

    2. load from xdef; implicit cast def to int 1int 1; add int 1 and int 2int 3; implicit cast int 3 to defdef; store def to x; (note this is equivalent to x = x+2)

  • A compound assignment with an extra implicit cast.

    byte b = 1; (1)
    b += 2;     (2)
    1. declare byte b; store byte 1 to x;

    2. load from xbyte 1; implicit cast byte 1 to `int 1int 1; add int 1 and int 2int 3; implicit cast int 3 to byte 3byte 3; store byte 3 to b; (note this is equivalent to b = b+2)

Operators: Numeric

Post Increment

Use the post increment operator '++' to INCREASE the value of a numeric type variable/field by 1. An extra implicit cast is necessary to return the promoted numeric type value to the original numeric type value of the variable/field for the following types: byte, short, and char. If a variable/field is read as part of an expression the value is loaded prior to the increment.

Errors

  • If the variable/field is a non-numeric type.

Grammar

post_increment: ( variable | field ) '++';

Promotion

original promoted implicit

byte

int

byte

short

int

short

char

int

char

int

int

long

long

float

float

double

double

def

def

Examples

  • Post increment with different numeric types.

    short i = 0; (1)
    i++;         (2)
    long j = 1;  (3)
    long k;      (4)
    k = j++;     (5)
    1. declare short i; store short 0 to i

    2. load from ishort 0; promote short 0: result int; add int 0 and int 1int 1; implicit cast int 1 to short 1; store short 1 to i

    3. declare long j; implicit cast int 1 to long 1long 1; store long 1 to j

    4. declare long k; store default long 0 to k

    5. load from jlong 1; store long 1 to k; add long 1 and long 1long 2; store long 2 to j

  • Post increment with the def type.

    def x = 1; (1)
    x++;       (2)
    1. declare def x; implicit cast int 1 to defdef; store def to x

    2. load from xdef; implicit cast def to int 1; add int 1 and int 1int 2; implicit cast int 2 to def; store def to x

Post Decrement

Use the post decrement operator '--' to DECREASE the value of a numeric type variable/field by 1. An extra implicit cast is necessary to return the promoted numeric type value to the original numeric type value of the variable/field for the following types: byte, short, and char. If a variable/field is read as part of an expression the value is loaded prior to the decrement.

Errors

  • If the variable/field is a non-numeric type.

Grammar

post_decrement: ( variable | field ) '--';

Promotion

original promoted implicit

byte

int

byte

short

int

short

char

int

char

int

int

long

long

float

float

double

double

def

def

Examples

  • Post decrement with different numeric types.

    short i = 0; (1)
    i--;         (2)
    long j = 1;  (3)
    long k;      (4)
    k = j--;     (5)
    1. declare short i; store short 0 to i

    2. load from ishort 0; promote short 0: result int; subtract int 1 from int 0int -1; implicit cast int -1 to short -1; store short -1 to i

    3. declare long j; implicit cast int 1 to long 1long 1; store long 1 to j

    4. declare long k; store default long 0 to k

    5. load from jlong 1; store long 1 to k; subtract long 1 from long 1long 0; store long 0 to j

  • Post decrement with the def type.

    def x = 1; (1)
    x--;       (2)
    1. declare def x; implicit cast int 1 to defdef; store def to x

    2. load from xdef; implicit cast def to int 1; subtract int 1 from int 1int 0; implicit cast int 0 to def; store def to x

Pre Increment

Use the pre increment operator '++' to INCREASE the value of a numeric type variable/field by 1. An extra implicit cast is necessary to return the promoted numeric type value to the original numeric type value of the variable/field for the following types: byte, short, and char. If a variable/field is read as part of an expression the value is loaded after the increment.

Errors

  • If the variable/field is a non-numeric type.

Grammar

pre_increment: '++' ( variable | field );

Promotion

original promoted implicit

byte

int

byte

short

int

short

char

int

char

int

int

long

long

float

float

double

double

def

def

Examples

  • Pre increment with different numeric types.

    short i = 0; (1)
    ++i;         (2)
    long j = 1;  (3)
    long k;      (4)
    k = ++j;     (5)
    1. declare short i; store short 0 to i

    2. load from ishort 0; promote short 0: result int; add int 0 and int 1int 1; implicit cast int 1 to short 1; store short 1 to i

    3. declare long j; implicit cast int 1 to long 1long 1; store long 1 to j

    4. declare long k; store default long 0 to k

    5. load from jlong 1; add long 1 and long 1long 2; store long 2 to j; store long 2 to k

  • Pre increment with the def type.

    def x = 1; (1)
    ++x;       (2)
    1. declare def x; implicit cast int 1 to defdef; store def to x

    2. load from xdef; implicit cast def to int 1; add int 1 and int 1int 2; implicit cast int 2 to def; store def to x

Pre Decrement

Use the pre decrement operator '--' to DECREASE the value of a numeric type variable/field by 1. An extra implicit cast is necessary to return the promoted numeric type value to the original numeric type value of the variable/field for the following types: byte, short, and char. If a variable/field is read as part of an expression the value is loaded after the decrement.

Errors

  • If the variable/field is a non-numeric type.

Grammar

pre_increment: '--' ( variable | field );

Promotion

original promoted implicit

byte

int

byte

short

int

short

char

int

char

int

int

long

long

float

float

double

double

def

def

Examples

  • Pre decrement with different numeric types.

    short i = 0; (1)
    --i;         (2)
    long j = 1;  (3)
    long k;      (4)
    k = --j;     (5)
    1. declare short i; store short 0 to i

    2. load from ishort 0; promote short 0: result int; subtract int 1 from int 0int -1; implicit cast int -1 to short -1; store short -1 to i

    3. declare long j; implicit cast int 1 to long 1long 1; store long 1 to j

    4. declare long k; store default long 0 to k

    5. load from jlong 1; subtract long 1 from long 1long 0; store long 0 to j store long 0 to k;

  • Pre decrement operator with the def type.

    def x = 1; (1)
    --x;       (2)
    1. declare def x; implicit cast int 1 to defdef; store def to x

    2. load from xdef; implicit cast def to int 1; subtract int 1 from int 1int 0; implicit cast int 0 to def; store def to x

Unary Positive

Use the unary positive operator '+' to the preserve the IDENTITY of a numeric type value.

Errors

  • If the value is a non-numeric type.

Grammar

unary_positive: '+' expression;

Examples

  • Unary positive with different numeric types.

    int x = +1;  (1)
    long y = +x; (2)
    1. declare int x; identity int 1int 1; store int 1 to x

    2. declare long y; load from xint 1; identity int 1int 1; implicit cast int 1 to long 1long 1; store long 1 to y

  • Unary positive with the def type.

    def z = +1; (1)
    int i = +z; (2)
    1. declare def z; identity int 1int 1; implicit cast int 1 to def; store def to z

    2. declare int i; load from zdef; implicit cast def to int 1; identity int 1int 1; store int 1 to i;

Unary Negative

Use the unary negative operator '-' to NEGATE a numeric type value.

Errors

  • If the value is a non-numeric type.

Grammar

unary_negative: '-' expression;

Examples

  • Unary negative with different numeric types.

    int x = -1;  (1)
    long y = -x; (2)
    1. declare int x; negate int 1int -1; store int -1 to x

    2. declare long y; load from xint 1; negate int -1int 1; implicit cast int 1 to long 1long 1; store long 1 to y

  • Unary negative with the def type.

    def z = -1; (1)
    int i = -z; (2)
    1. declare def z; negate int 1int -1; implicit cast int -1 to def; store def to z

    2. declare int i; load from zdef; implicit cast def to int -1; negate int -1int 1; store int 1 to i;

Bitwise Not

Use the bitwise not operator '~' to NOT each bit in an integer type value where a 1-bit is flipped to a resultant 0-bit and a 0-bit is flipped to a resultant 1-bit.

Errors

  • If the value is a non-integer type.

Bits

original result

1

0

0

1

Grammar

bitwise_not: '~' expression;

Promotion

original promoted

byte

int

short

int

char

int

int

int

long

long

def

def

Examples

  • Bitwise not with different numeric types.

    byte b = 1;  (1)
    int i = ~b;  (2)
    long l = ~i; (3)
    1. declare byte x; store byte 1 to b

    2. declare int i; load from bbyte 1; implicit cast byte 1 to int 1int 1; bitwise not int 1int -2; store int -2 to i

    3. declare long l; load from iint -2; implicit cast int -2 to long -2long -2; bitwise not long -2long 1; store long 1 to l

  • Bitwise not with the def type.

    def d = 1;  (1)
    def e = ~d; (2)
    1. declare def d; implicit cast int 1 to defdef; store def to d;

    2. declare def e; load from ddef; implicit cast def to int 1int 1; bitwise not int 1int -2; implicit cast int 1 to defdef; store def to e

Multiplication

Use the multiplication operator '*' to MULTIPLY together two numeric type values. Rules for resultant overflow and NaN values follow the JVM specification.

Errors

  • If either of the values is a non-numeric type.

Grammar

multiplication: expression '*' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Multiplication with different numeric types.

    int i = 5*4;      (1)
    double d = i*7.0; (2)
    1. declare int i; multiply int 4 by int 5int 20; store int 20 in i

    2. declare double d; load from int iint 20; promote int 20 and double 7.0: result double; implicit cast int 20 to double 20.0double 20.0; multiply double 20.0 by double 7.0double 140.0; store double 140.0 to d

  • Multiplication with the def type.

    def x = 5*4; (1)
    def y = x*2; (2)
    1. declare def x; multiply int 5 by int 4int 20; implicit cast int 20 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 20; multiply int 20 by int 2int 40; implicit cast int 40 to defdef; store def to y

Division

Use the division operator '/' to DIVIDE one numeric type value by another. Rules for NaN values and division by zero follow the JVM specification. Division with integer values drops the remainder of the resultant value.

Errors

  • If either of the values is a non-numeric type.

  • If a left-hand side integer type value is divided by a right-hand side integer type value of 0.

Grammar

division: expression '/' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Division with different numeric types.

    int i = 29/4;     (1)
    double d = i/7.0; (2)
    1. declare int i; divide int 29 by int 4int 7; store int 7 in i

    2. declare double d; load from int iint 7; promote int 7 and double 7.0: result double; implicit cast int 7 to double 7.0double 7.0; divide double 7.0 by double 7.0double 1.0; store double 1.0 to d

  • Division with the def type.

    def x = 5/4; (1)
    def y = x/2; (2)
    1. declare def x; divide int 5 by int 4int 1; implicit cast int 1 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 1; divide int 1 by int 2int 0; implicit cast int 0 to defdef; store def to y

Remainder

Use the remainder operator '%' to calculate the REMAINDER for division between two numeric type values. Rules for NaN values and division by zero follow the JVM specification.

Errors

  • If either of the values is a non-numeric type.

Grammar

remainder: expression '%' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Remainder with different numeric types.

    int i = 29%4;     (1)
    double d = i%7.0; (2)
    1. declare int i; remainder int 29 by int 4int 1; store int 7 in i

    2. declare double d; load from int iint 1; promote int 1 and double 7.0: result double; implicit cast int 1 to double 1.0double 1.0; remainder double 1.0 by double 7.0double 1.0; store double 1.0 to d

  • Remainder with the def type.

    def x = 5%4; (1)
    def y = x%2; (2)
    1. declare def x; remainder int 5 by int 4int 1; implicit cast int 1 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 1; remainder int 1 by int 2int 1; implicit cast int 1 to defdef; store def to y

Addition

Use the addition operator '+' to ADD together two numeric type values. Rules for resultant overflow and NaN values follow the JVM specification.

Errors

  • If either of the values is a non-numeric type.

Grammar

addition: expression '+' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Addition operator with different numeric types.

    int i = 29+4;     (1)
    double d = i+7.0; (2)
    1. declare int i; add int 29 and int 4int 33; store int 33 in i

    2. declare double d; load from int iint 33; promote int 33 and double 7.0: result double; implicit cast int 33 to double 33.0double 33.0; add double 33.0 and double 7.0double 40.0; store double 40.0 to d

  • Addition with the def type.

    def x = 5+4; (1)
    def y = x+2; (2)
    1. declare def x; add int 5 and int 4int 9; implicit cast int 9 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 9; add int 9 and int 2int 11; implicit cast int 11 to defdef; store def to y

Subtraction

Use the subtraction operator '-' to SUBTRACT a right-hand side numeric type value from a left-hand side numeric type value. Rules for resultant overflow and NaN values follow the JVM specification.

Errors

  • If either of the values is a non-numeric type.

Grammar

subtraction: expression '-' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Subtraction with different numeric types.

    int i = 29-4;     (1)
    double d = i-7.5; (2)
    1. declare int i; subtract int 4 from int 29int 25; store int 25 in i

    2. declare double d load from int iint 25; promote int 25 and double 7.5: result double; implicit cast int 25 to double 25.0double 25.0; subtract double 33.0 by double 7.5double 25.5; store double 25.5 to d

  • Subtraction with the def type.

    def x = 5-4; (1)
    def y = x-2; (2)
    1. declare def x; subtract int 4 and int 5int 1; implicit cast int 1 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 1; subtract int 2 from int 1int -1; implicit cast int -1 to defdef; store def to y

Left Shift

Use the left shift operator '<<' to SHIFT lower order bits to higher order bits in a left-hand side integer type value by the distance specified in a right-hand side integer type value.

Errors

  • If either of the values is a non-integer type.

  • If the right-hand side value cannot be cast to an int type.

Grammar

left_shift: expression '<<' expression;

Promotion

The left-hand side integer type value is promoted as specified in the table below. The right-hand side integer type value is always implicitly cast to an int type value and truncated to the number of bits of the promoted type value.

original promoted

byte

int

short

int

char

int

int

int

long

long

def

def

Examples

  • Left shift with different integer types.

    int i = 4 << 1;   (1)
    long l = i << 2L; (2)
    1. declare int i; left shift int 4 by int 1int 8; store int 8 in i

    2. declare long l load from int iint 8; implicit cast long 2 to int 2int 2; left shift int 8 by int 2int 32; implicit cast int 32 to long 32long 32; store long 32 to l

  • Left shift with the def type.

    def x = 4 << 2; (1)
    def y = x << 1; (2)
    1. declare def x; left shift int 4 by int 2int 16; implicit cast int 16 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 16; left shift int 16 by int 1int 32; implicit cast int 32 to defdef; store def to y

Right Shift

Use the right shift operator '>>' to SHIFT higher order bits to lower order bits in a left-hand side integer type value by the distance specified in a right-hand side integer type value. The highest order bit of the left-hand side integer type value is preserved.

Errors

  • If either of the values is a non-integer type.

  • If the right-hand side value cannot be cast to an int type.

Grammar

right_shift: expression '>>' expression;

Promotion

The left-hand side integer type value is promoted as specified in the table below. The right-hand side integer type value is always implicitly cast to an int type value and truncated to the number of bits of the promoted type value.

original promoted

byte

int

short

int

char

int

int

int

long

long

def

def

Examples

  • Right shift with different integer types.

    int i = 32 >> 1;  (1)
    long l = i >> 2L; (2)
    1. declare int i; right shift int 32 by int 1int 16; store int 16 in i

    2. declare long l load from int iint 16; implicit cast long 2 to int 2int 2; right shift int 16 by int 2int 4; implicit cast int 4 to long 4long 4; store long 4 to l

  • Right shift with the def type.

    def x = 16 >> 2; (1)
    def y = x >> 1;  (2)
    1. declare def x; right shift int 16 by int 2int 4; implicit cast int 4 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 4; right shift int 4 by int 1int 2; implicit cast int 2 to defdef; store def to y

Unsigned Right Shift

Use the unsigned right shift operator '>>>' to SHIFT higher order bits to lower order bits in a left-hand side integer type value by the distance specified in a right-hand side type integer value. The highest order bit of the left-hand side integer type value is not preserved.

Errors

  • If either of the values is a non-integer type.

  • If the right-hand side value cannot be cast to an int type.

Grammar

unsigned_right_shift: expression '>>>' expression;

Promotion

The left-hand side integer type value is promoted as specified in the table below. The right-hand side integer type value is always implicitly cast to an int type value and truncated to the number of bits of the promoted type value.

original promoted

byte

int

short

int

char

int

int

int

long

long

def

def

Examples

  • Unsigned right shift with different integer types.

    int i = -1 >>> 29; (1)
    long l = i >>> 2L; (2)
    1. declare int i; unsigned right shift int -1 by int 29int 7; store int 7 in i

    2. declare long l load from int iint 7; implicit cast long 2 to int 2int 2; unsigned right shift int 7 by int 2int 3; implicit cast int 3 to long 3long 3; store long 3 to l

  • Unsigned right shift with the def type.

    def x = 16 >>> 2; (1)
    def y = x >>> 1;  (2)
    1. declare def x; unsigned right shift int 16 by int 2int 4; implicit cast int 4 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 4; unsigned right shift int 4 by int 1int 2; implicit cast int 2 to defdef; store def to y

Bitwise And

Use the bitwise and operator '&' to AND together each bit within two integer type values where if both bits at the same index are 1 the resultant bit is 1 and 0 otherwise.

Errors

  • If either of the values is a non-integer type.

Bits

1

0

1

1

0

0

0

0

Grammar

bitwise_and: expression '&' expression;

Promotion

byte

short

char

int

long

def

byte

int

int

int

int

long

def

short

int

int

int

int

long

def

char

int

int

int

int

long

def

int

int

int

int

int

long

def

long

long

long

long

long

long

def

def

def

def

def

def

def

def

Examples

  • Bitwise and with different integer types.

    int i = 5 & 6;   (1)
    long l = i & 5L; (2)
    1. declare int i; bitwise and int 5 and int 6int 4; store int 4 in i

    2. declare long l load from int iint 4; promote int 4 and long 5: result long; implicit cast int 4 to long 4long 4; bitwise and long 4 and long 5long 4; store long 4 to l

  • Bitwise and with the def type.

    def x = 15 & 6; (1)
    def y = x & 5;  (2)
    1. declare def x; bitwise and int 15 and int 6int 6; implicit cast int 6 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 6; bitwise and int 6 and int 5int 4; implicit cast int 4 to defdef; store def to y

Bitwise Xor

Use the bitwise xor operator '^' to XOR together each bit within two integer type values where if one bit is a 1 and the other bit is a 0 at the same index the resultant bit is 1 otherwise the resultant bit is 0.

Errors

  • If either of the values is a non-integer type.

Bits

The following table illustrates the resultant bit from the xoring of two bits.

1

0

1

0

1

0

1

0

Grammar

bitwise_xor: expression '^' expression;

Promotion

byte

short

char

int

long

def

byte

int

int

int

int

long

def

short

int

int

int

int

long

def

char

int

int

int

int

long

def

int

int

int

int

int

long

def

long

long

long

long

long

long

def

def

def

def

def

def

def

def

Examples

  • Bitwise xor with different integer types.

    int i = 5 ^ 6;   (1)
    long l = i ^ 5L; (2)
    1. declare int i; bitwise xor int 5 and int 6int 3; store int 3 in i

    2. declare long l load from int iint 4; promote int 3 and long 5: result long; implicit cast int 3 to long 3long 3; bitwise xor long 3 and long 5long 6; store long 6 to l

  • Bitwise xor with the def type.

    def x = 15 ^ 6; (1)
    def y = x ^ 5;  (2)
    1. declare def x; bitwise xor int 15 and int 6int 9; implicit cast int 9 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 9; bitwise xor int 9 and int 5int 12; implicit cast int 12 to defdef; store def to y

Bitwise Or

Use the bitwise or operator '|' to OR together each bit within two integer type values where if at least one bit is a 1 at the same index the resultant bit is 1 otherwise the resultant bit is 0.

Errors

  • If either of the values is a non-integer type.

Bits

The following table illustrates the resultant bit from the oring of two bits.

1

0

1

1

1

0

1

0

Grammar

bitwise_or: expression '|' expression;

Promotion

byte

short

char

int

long

def

byte

int

int

int

int

long

def

short

int

int

int

int

long

def

char

int

int

int

int

long

def

int

int

int

int

int

long

def

long

long

long

long

long

long

def

def

def

def

def

def

def

def

Examples

  • Bitwise or with different integer types.

    int i = 5 | 6;   (1)
    long l = i | 8L; (2)
    1. declare int i; bitwise or int 5 and int 6int 7; store int 7 in i

    2. declare long l load from int iint 7; promote int 7 and long 8: result long; implicit cast int 7 to long 7long 7; bitwise or long 7 and long 8long 15; store long 15 to l

  • Bitwise or with the def type.

    def x = 5 ^ 6; (1)
    def y = x ^ 8; (2)
    1. declare def x; bitwise or int 5 and int 6int 7; implicit cast int 7 to defdef; store def in x

    2. declare def y; load from xdef; implicit cast def to int 7; bitwise or int 7 and int 8int 15; implicit cast int 15 to defdef; store def to y

Operators: Boolean

Boolean Not

Use the boolean not operator '!' to NOT a boolean type value where true is flipped to false and false is flipped to true.

Errors

  • If a value other than a boolean type value or a value that is castable to a boolean type value is given.

Truth

original result

true

false

false

true

Grammar

boolean_not: '!' expression;

Examples

  • Boolean not with the boolean type.

    boolean x = !false; (1)
    boolean y = !x;     (2)
    1. declare boolean x; boolean not boolean falseboolean true; store boolean true to x

    2. declare boolean y; load from xboolean true; boolean not boolean trueboolean false; store boolean false to y

  • Boolean not with the def type.

    def y = true; (1)
    def z = !y;   (2)
    1. declare def y; implicit cast boolean true to defdef; store true to y

    2. declare def z; load from ydef; implicit cast def to boolean true → boolean true; boolean not boolean trueboolean false; implicit cast boolean false to defdef; store def to z

Greater Than

Use the greater than operator '>' to COMPARE two numeric type values where a resultant boolean type value is true if the left-hand side value is greater than to the right-hand side value and false otherwise.

Errors

  • If either the evaluated left-hand side or the evaluated right-hand side is a non-numeric value.

Grammar

greater_than: expression '>' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Greater than with different numeric types.

    boolean x = 5 > 4; (1)
    double y = 6.0;    (2)
    x = 6 > y;         (3)
    1. declare boolean x; greater than int 5 and int 4boolean true; store boolean true to x;

    2. declare double y; store double 6.0 to y;

    3. load from ydouble 6.0 @0; promote int 6 and double 6.0: result double; implicit cast int 6 to double 6.0 @1double 6.0 @1; greater than double 6.0 @1 and double 6.0 @0boolean false; store boolean false to x

  • Greater than with def type.

    int x = 5;       (1)
    def y = 7.0;     (2)
    def z = y > 6.5; (3)
    def a = x > y;   (4)
    1. declare int x; store int 5 to x

    2. declare def y; implicit cast double 7.0 to defdef; store def to y

    3. declare def z; load from ydef; implicit cast def to double 7.0double 7.0; greater than double 7.0 and double 6.5boolean true; implicit cast boolean true to defdef; store def to z

    4. declare def a; load from ydef; implicit cast def to double 7.0double 7.0; load from xint 5; promote int 5 and double 7.0: result double; implicit cast int 5 to double 5.0double 5.0; greater than double 5.0 and double 7.0boolean false; implicit cast boolean false to defdef; store def to z

Greater Than Or Equal

Use the greater than or equal operator '>=' to COMPARE two numeric type values where a resultant boolean type value is true if the left-hand side value is greater than or equal to the right-hand side value and false otherwise.

Errors

  • If either the evaluated left-hand side or the evaluated right-hand side is a non-numeric value.

Grammar

greater_than_or_equal: expression '>=' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Greater than or equal with different numeric types.

    boolean x = 5 >= 4; (1)
    double y = 6.0;     (2)
    x = 6 >= y;         (3)
    1. declare boolean x; greater than or equal int 5 and int 4boolean true; store boolean true to x

    2. declare double y; store double 6.0 to y

    3. load from ydouble 6.0 @0; promote int 6 and double 6.0: result double; implicit cast int 6 to double 6.0 @1double 6.0 @1; greater than or equal double 6.0 @1 and double 6.0 @0boolean true; store boolean true to x

  • Greater than or equal with the def type.

    int x = 5;        (1)
    def y = 7.0;      (2)
    def z = y >= 7.0; (3)
    def a = x >= y;   (4)
    1. declare int x; store int 5 to x;

    2. declare def y implicit cast double 7.0 to defdef; store def to y

    3. declare def z; load from ydef; implicit cast def to double 7.0 @0double 7.0 @0; greater than or equal double 7.0 @0 and double 7.0 @1boolean true; implicit cast boolean true to defdef; store def to z

    4. declare def a; load from ydef; implicit cast def to double 7.0double 7.0; load from xint 5; promote int 5 and double 7.0: result double; implicit cast int 5 to double 5.0double 5.0; greater than or equal double 5.0 and double 7.0boolean false; implicit cast boolean false to defdef; store def to z

Less Than

Use the less than operator '<' to COMPARE two numeric type values where a resultant boolean type value is true if the left-hand side value is less than to the right-hand side value and false otherwise.

Errors

  • If either the evaluated left-hand side or the evaluated right-hand side is a non-numeric value.

Grammar

less_than: expression '<' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Less than with different numeric types.

    boolean x = 5 < 4; (1)
    double y = 6.0;    (2)
    x = 6 < y;         (3)
    1. declare boolean x; less than int 5 and int 4boolean false; store boolean false to x

    2. declare double y; store double 6.0 to y

    3. load from ydouble 6.0 @0; promote int 6 and double 6.0: result double; implicit cast int 6 to double 6.0 @1double 6.0 @1; less than double 6.0 @1 and double 6.0 @0boolean false; store boolean false to x

  • Less than with the def type.

    int x = 5;       (1)
    def y = 7.0;     (2)
    def z = y < 6.5; (3)
    def a = x < y;   (4)
    1. declare int x; store int 5 to x

    2. declare def y; implicit cast double 7.0 to defdef; store def to y

    3. declare def z; load from ydef; implicit cast def to double 7.0double 7.0; less than double 7.0 and double 6.5boolean false; implicit cast boolean false to defdef; store def to z

    4. declare def a; load from ydef; implicit cast def to double 7.0double 7.0; load from xint 5; promote int 5 and double 7.0: result double; implicit cast int 5 to double 5.0double 5.0; less than double 5.0 and double 7.0boolean true; implicit cast boolean true to defdef; store def to z

Less Than Or Equal

Use the less than or equal operator '⇐' to COMPARE two numeric type values where a resultant boolean type value is true if the left-hand side value is less than or equal to the right-hand side value and false otherwise.

Errors

  • If either the evaluated left-hand side or the evaluated right-hand side is a non-numeric value.

Grammar

greater_than_or_equal: expression '<=' expression;

Promotion

byte

short

char

int

long

float

double

def

byte

int

int

int

int

long

float

double

def

short

int

int

int

int

long

float

double

def

char

int

int

int

int

long

float

double

def

int

int

int

int

int

long

float

double

def

long

long

long

long

long

long

float

double

def

float

float

float

float

float

float

float

double

def

double

double

double

double

double

double

double

double

def

def

def

def

def

def

def

def

def

def

Examples

  • Less than or equal with different numeric types.

    boolean x = 5 <= 4; (1)
    double y = 6.0;     (2)
    x = 6 <= y;         (3)
    1. declare boolean x; less than or equal int 5 and int 4boolean false; store boolean true to x

    2. declare double y; store double 6.0 to y

    3. load from ydouble 6.0 @0; promote int 6 and double 6.0: result double; implicit cast int 6 to double 6.0 @1double 6.0 @1; less than or equal double 6.0 @1 and double 6.0 @0boolean true; store boolean true to x

  • Less than or equal with the def type.

    int x = 5;        (1)
    def y = 7.0;      (2)
    def z = y <= 7.0; (3)
    def a = x <= y;   (4)
    1. declare int x; store int 5 to x;

    2. declare def y; implicit cast double 7.0 to defdef; store def to y;

    3. declare def z; load from ydef; implicit cast def to double 7.0 @0double 7.0 @0; less than or equal double 7.0 @0 and double 7.0 @1boolean true; implicit cast boolean true to defdef; store def to z

    4. declare def a; load from ydef; implicit cast def to double 7.0double 7.0; load from xint 5; promote int 5 and double 7.0: result double; implicit cast int 5 to double 5.0double 5.0; less than or equal double 5.0 and double 7.0boolean true; implicit cast boolean true to defdef; store def to z

Instanceof

Use the instanceof operator to COMPARE the variable/field type to a specified reference type using the reference type name where a resultant boolean type value is true if the variable/field type is the same as or a descendant of the specified reference type and false otherwise.

Errors

  • If the reference type name doesn’t exist as specified by the right-hand side.

Grammar

instance_of: ID 'instanceof' TYPE;

Examples

  • Instance of with different reference types.

    Map m = new HashMap();            (1)
    boolean a = m instanceof HashMap; (2)
    boolean b = m instanceof Map;     (3)
    1. declare Map m; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map reference; store Map reference to m

    2. declare boolean a; load from mMap reference; implicit cast Map reference to HashMap referenceHashMap reference; instanceof HashMap reference and HashMapboolean true; store boolean true to a

    3. declare boolean b; load from mMap reference; implicit cast Map reference to HashMap referenceHashMap reference; instanceof HashMap reference and Mapboolean true; store true to b; (note HashMap is a descendant of Map)

  • Instance of with the def type.

    def d = new ArrayList();       (1)
    boolean a = d instanceof List; (2)
    boolean b = d instanceof Map;  (3)
    1. declare def d; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef; store def to d

    2. declare boolean a; load from ddef; implicit cast def to ArrayList referenceArrayList reference; instanceof ArrayList reference and Listboolean true; store boolean true to a; (note ArrayList is a descendant of List)

    3. declare boolean b; load from ddef; implicit cast def to ArrayList referenceArrayList reference; instanceof ArrayList reference and Mapboolean false; store boolean false to a; (note ArrayList is not a descendant of Map)

Equality Equals

Use the equality equals operator '==' to COMPARE two values where a resultant boolean type value is true if the two values are equal and false otherwise. The member method, equals, is implicitly called when the values are reference type values where the first value is the target of the call and the second value is the argument. This operation is null-safe where if both values are null the resultant boolean type value is true, and if only one value is null the resultant boolean type value is false. A valid comparison is between boolean type values, numeric type values, or reference type values.

Errors

  • If a comparison is made between a boolean type value and numeric type value.

  • If a comparison is made between a primitive type value and a reference type value.

Grammar

equality_equals: expression '==' expression;

Promotion

boolean

byte

short

char

int

long

float

double

Reference

def

boolean

boolean

-

-

-

-

-

-

-

-

def

byte

-

int

int

int

int

long

float

double

-

def

short

-

int

int

int

int

long

float

double

-

def

char

-

int

int

int

int

long

float

double

-

def

int

-

int

int

int

int

long

float

double

-

def

long

-

long

long

long

long

long

float

double

-

def

float

-

float

float

float

float

float

float

double

-

def

double

-

double

double

double

double

double

double

double

-

def

Reference

-

-

-

-

-

-

-

-

Object

def

def

def

def

def

def

def

def

def

def

def

def

Examples

  • Equality equals with the boolean type.

    boolean a = true;  (1)
    boolean b = false; (2)
    a = a == false;    (3)
    b = a == b;        (4)
    1. declare boolean a; store boolean true to a

    2. declare boolean b; store boolean false to b

    3. load from aboolean true; equality equals boolean true and boolean falseboolean false; store boolean false to a

    4. load from aboolean false @0; load from bboolean false @1; equality equals boolean false @0 and boolean false @1boolean false; store boolean false to b

  • Equality equals with primitive types.

    int a = 1;          (1)
    double b = 2.0;     (2)
    boolean c = a == b; (3)
    c = 1 == a;         (4)
    1. declare int a; store int 1 to a

    2. declare double b; store double 1.0 to b

    3. declare boolean c; load from aint 1; load from bdouble 2.0; promote int 1 and double 2.0: result double; implicit cast int 1 to double 1.0double `1.0; equality equals double 1.0 and double 2.0boolean false; store boolean false to c

    4. load from aint 1 @1; equality equals int 1 @0 and int 1 @1boolean true; store boolean true to c

  • Equal equals with reference types.

    List a = new ArrayList(); (1)
    List b = new ArrayList(); (2)
    a.add(1);                 (3)
    boolean c = a == b;       (4)
    b.add(1);                 (5)
    c = a == b;               (6)
    1. declare List a; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to a

    2. declare List b; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to b

    3. load from aList reference; call add on List reference with arguments (int 1)

    4. declare boolean c; load from aList reference @0; load from bList reference @1; call equals on List reference @0 with arguments (List reference @1) → boolean false; store boolean false to c

    5. load from bList reference; call add on List reference with arguments (int 1)

    6. load from aList reference @0; load from bList reference @1; call equals on List reference @0 with arguments (List reference @1) → boolean true; store boolean true to c

  • Equality equals with null.

    Object a = null;       (1)
    Object b = null;       (2)
    boolean c = a == null; (3)
    c = a == b;            (4)
    b = new Object();      (5)
    c = a == b;            (6)
    1. declare Object a; store null to a

    2. declare Object b; store null to b

    3. declare boolean c; load from anull @0; equality equals null @0 and null @1boolean true; store boolean true to c

    4. load from anull @0; load from bnull @1; equality equals null @0 and null @1boolean true; store boolean true to c

    5. allocate Object instance → Object reference; store Object reference to b

    6. load from aObject reference; load from bnull; call equals on Object reference with arguments (null) → boolean false; store boolean false to c

  • Equality equals with the def type.

    def a = 0;               (1)
    def b = 1;               (2)
    boolean c = a == b;      (3)
    def d = new HashMap();   (4)
    def e = new ArrayList(); (5)
    c = d == e;              (6)
    1. declare def a; implicit cast int 0 to defdef; store def to a;

    2. declare def b; implicit cast int 1 to defdef; store def to b;

    3. declare boolean c; load from adef; implicit cast a to int 0int 0; load from bdef; implicit cast b to int 1int 1; equality equals int 0 and int 1boolean false; store boolean false to c

    4. declare def d; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef store def to d;

    5. declare def e; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef store def to d;

    6. load from ddef; implicit cast def to HashMap referenceHashMap reference; load from edef; implicit cast def to ArrayList referenceArrayList reference; call equals on HashMap reference with arguments (ArrayList reference) → boolean false; store boolean false to c

Equality Not Equals

Use the equality not equals operator '!=' to COMPARE two values where a resultant boolean type value is true if the two values are NOT equal and false otherwise. The member method, equals, is implicitly called when the values are reference type values where the first value is the target of the call and the second value is the argument with the resultant boolean type value flipped. This operation is null-safe where if both values are null the resultant boolean type value is false, and if only one value is null the resultant boolean type value is true. A valid comparison is between boolean type values, numeric type values, or reference type values.

Errors

  • If a comparison is made between a boolean type value and numeric type value.

  • If a comparison is made between a primitive type value and a reference type value.

Grammar

equality_not_equals: expression '!=' expression;

Promotion

boolean

byte

short

char

int

long

float

double

Reference

def

boolean

boolean

-

-

-

-

-

-

-

-

def

byte

-

int

int

int

int

long

float

double

-

def

short

-

int

int

int

int

long

float

double

-

def

char

-

int

int

int

int

long

float

double

-

def

int

-

int

int

int

int

long

float

double

-

def

long

-

long

long

long

long

long

float

double

-

def

float

-

float

float

float

float

float

float

double

-

def

double

-

double

double

double

double

double

double

double

-

def

Reference

-

-

-

-

-

-

-

-

Object

def

def

def

def

def

def

def

def

def

def

def

def

Examples

  • Equality not equals with the boolean type.

    boolean a = true;  (1)
    boolean b = false; (2)
    a = a != false;    (3)
    b = a != b;        (4)
    1. declare boolean a; store boolean true to a

    2. declare boolean b; store boolean false to b

    3. load from aboolean true; equality not equals boolean true and boolean falseboolean true; store boolean true to a

    4. load from aboolean true; load from bboolean false; equality not equals boolean true and boolean falseboolean true; store boolean true to b

  • Equality not equals with primitive types.

    int a = 1;          (1)
    double b = 2.0;     (2)
    boolean c = a != b; (3)
    c = 1 != a;         (4)
    1. declare int a; store int 1 to a

    2. declare double b; store double 1.0 to b

    3. declare boolean c; load from aint 1; load from bdouble 2.0; promote int 1 and double 2.0: result double; implicit cast int 1 to double 1.0double `1.0; equality not equals double 1.0 and double 2.0boolean true; store boolean true to c

    4. load from aint 1 @1; equality not equals int 1 @0 and int 1 @1boolean false; store boolean false to c

  • Equality not equals with reference types.

    List a = new ArrayList(); (1)
    List b = new ArrayList(); (2)
    a.add(1);                 (3)
    boolean c = a == b;       (4)
    b.add(1);                 (5)
    c = a == b;               (6)
    1. declare List a; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to a

    2. declare List b; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to b

    3. load from aList reference; call add on List reference with arguments (int 1)

    4. declare boolean c; load from aList reference @0; load from bList reference @1; call equals on List reference @0 with arguments (List reference @1) → boolean false; boolean not boolean falseboolean true store boolean true to c

    5. load from bList reference; call add on List reference with arguments (int 1)

    6. load from aList reference @0; load from bList reference @1; call equals on List reference @0 with arguments (List reference @1) → boolean true; boolean not boolean trueboolean false; store boolean false to c

  • Equality not equals with null.

    Object a = null;       (1)
    Object b = null;       (2)
    boolean c = a == null; (3)
    c = a == b;            (4)
    b = new Object();      (5)
    c = a == b;            (6)
    1. declare Object a; store null to a

    2. declare Object b; store null to b

    3. declare boolean c; load from anull @0; equality not equals null @0 and null @1boolean false; store boolean false to c

    4. load from anull @0; load from bnull @1; equality not equals null @0 and null @1boolean false; store boolean false to c

    5. allocate Object instance → Object reference; store Object reference to b

    6. load from aObject reference; load from bnull; call equals on Object reference with arguments (null) → boolean false; boolean not boolean falseboolean true; store boolean true to c

  • Equality not equals with the def type.

    def a = 0;               (1)
    def b = 1;               (2)
    boolean c = a == b;      (3)
    def d = new HashMap();   (4)
    def e = new ArrayList(); (5)
    c = d == e;              (6)
    1. declare def a; implicit cast int 0 to defdef; store def to a;

    2. declare def b; implicit cast int 1 to defdef; store def to b;

    3. declare boolean c; load from adef; implicit cast a to int 0int 0; load from bdef; implicit cast b to int 1int 1; equality equals int 0 and int 1boolean false; store boolean false to c

    4. declare def d; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef store def to d;

    5. declare def e; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef store def to d;

    6. load from ddef; implicit cast def to HashMap referenceHashMap reference; load from edef; implicit cast def to ArrayList referenceArrayList reference; call equals on HashMap reference with arguments (ArrayList reference) → boolean false; store boolean false to c

Identity Equals

Use the identity equals operator '===' to COMPARE two values where a resultant boolean type value is true if the two values are equal and false otherwise. A reference type value is equal to another reference type value if both values refer to same instance on the heap or if both values are null. A valid comparison is between boolean type values, numeric type values, or reference type values.

Errors

  • If a comparison is made between a boolean type value and numeric type value.

  • If a comparison is made between a primitive type value and a reference type value.

Grammar

identity_equals: expression '===' expression;

Promotion

boolean

byte

short

char

int

long

float

double

Reference

def

boolean

boolean

-

-

-

-

-

-

-

-

def

byte

-

int

int

int

int

long

float

double

-

def

short

-

int

int

int

int

long

float

double

-

def

char

-

int

int

int

int

long

float

double

-

def

int

-

int

int

int

int

long

float

double

-

def

long

-

long

long

long

long

long

float

double

-

def

float

-

float

float

float

float

float

float

double

-

def

double

-

double

double

double

double

double

double

double

-

def

Reference

-

-

-

-

-

-

-

-

Object

def

def

def

def

def

def

def

def

def

def

def

def

Examples

  • Identity equals with reference types.

    List a = new ArrayList(); (1)
    List b = new ArrayList(); (2)
    List c = a;               (3)
    boolean c = a === b;      (4)
    c = a === c;              (5)
    1. declare List a; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to a

    2. declare List b; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to b

    3. load from aList reference; store List reference to c

    4. declare boolean c; load from aList reference @0; load from bList reference @1; identity equals List reference @0 and List reference @1boolean false store boolean false to c

    5. load from aList reference @0; load from cList reference @1; identity equals List reference @0 and List reference @1boolean true store boolean true to c (note List reference @0 and List reference @1 refer to the same instance)

  • Identity equals with null.

    Object a = null;        (1)
    Object b = null;        (2)
    boolean c = a === null; (3)
    c = a === b;            (4)
    b = new Object();       (5)
    c = a === b;            (6)
    1. declare Object a; store null to a

    2. declare Object b; store null to b

    3. declare boolean c; load from anull @0; identity equals null @0 and null @1boolean true; store boolean true to c

    4. load from anull @0; load from bnull @1; identity equals null @0 and null @1boolean true; store boolean true to c

    5. allocate Object instance → Object reference; store Object reference to b

    6. load from aObject reference; load from bnull; identity equals Object reference and nullboolean false; store boolean false to c

  • Identity equals with the def type.

    def a = new HashMap();   (1)
    def b = new ArrayList(); (2)
    boolean c = a === b;     (3)
    b = a;                   (4)
    c = a === b;             (5)
    1. declare def d; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef store def to d

    2. declare def e; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef store def to d

    3. declare boolean c; load from adef; implicit cast def to HashMap referenceHashMap reference; load from bdef; implicit cast def to ArrayList referenceArrayList reference; identity equals HashMap reference and ArrayList referenceboolean false; store boolean false to c

    4. load from adef; store def to b

    5. load from adef; implicit cast def to HashMap reference @0HashMap reference @0; load from bdef; implicit cast def to HashMap reference @1HashMap reference @1; identity equals HashMap reference @0 and HashMap reference @1boolean true; store boolean true to b; (note HashMap reference @0 and HashMap reference @1 refer to the same instance)

Identity Not Equals

Use the identity not equals operator '!==' to COMPARE two values where a resultant boolean type value is true if the two values are NOT equal and false otherwise. A reference type value is not equal to another reference type value if both values refer to different instances on the heap or if one value is null and the other is not. A valid comparison is between boolean type values, numeric type values, or reference type values.

Errors

  • If a comparison is made between a boolean type value and numeric type value.

  • If a comparison is made between a primitive type value and a reference type value.

Grammar

identity_not_equals: expression '!==' expression;

Promotion

boolean

byte

short

char

int

long

float

double

Reference

def

boolean

boolean

-

-

-

-

-

-

-

-

def

byte

-

int

int

int

int

long

float

double

-

def

short

-

int

int

int

int

long

float

double

-

def

char

-

int

int

int

int

long

float

double

-

def

int

-

int

int

int

int

long

float

double

-

def

long

-

long

long

long

long

long

float

double

-

def

float

-

float

float

float

float

float

float

double

-

def

double

-

double

double

double

double

double

double

double

-

def

Reference

-

-

-

-

-

-

-

-

Object

def

def

def

def

def

def

def

def

def

def

def

def

Examples

  • Identity not equals with reference type values.

    List a = new ArrayList(); (1)
    List b = new ArrayList(); (2)
    List c = a;               (3)
    boolean c = a !== b;      (4)
    c = a !== c;              (5)
    1. declare List a; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to a

    2. declare List b; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to b

    3. load from aList reference; store List reference to c

    4. declare boolean c; load from aList reference @0; load from bList reference @1; identity not equals List reference @0 and List reference @1boolean true store boolean true to c

    5. load from aList reference @0; load from cList reference @1; identity not equals List reference @0 and List reference @1boolean false store boolean false to c (note List reference @0 and List reference @1 refer to the same instance)

  • Identity not equals with null.

    Object a = null;        (1)
    Object b = null;        (2)
    boolean c = a !== null; (3)
    c = a !== b;            (4)
    b = new Object();       (5)
    c = a !== b;            (6)
    1. declare Object a; store null to a

    2. declare Object b; store null to b

    3. declare boolean c; load from anull @0; identity not equals null @0 and null @1boolean false; store boolean false to c

    4. load from anull @0; load from bnull @1; identity not equals null @0 and null @1boolean false; store boolean false to c

    5. allocate Object instance → Object reference; store Object reference to b

    6. load from aObject reference; load from bnull; identity not equals Object reference and nullboolean true; store boolean true to c

  • Identity not equals with the def type.

    def a = new HashMap();   (1)
    def b = new ArrayList(); (2)
    boolean c = a !== b;     (3)
    b = a;                   (4)
    c = a !== b;             (5)
    1. declare def d; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef store def to d

    2. declare def e; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef store def to d

    3. declare boolean c; load from adef; implicit cast def to HashMap referenceHashMap reference; load from bdef; implicit cast def to ArrayList referenceArrayList reference; identity not equals HashMap reference and ArrayList referenceboolean true; store boolean true to c

    4. load from adef; store def to b

    5. load from adef; implicit cast def to HashMap reference @0HashMap reference @0; load from bdef; implicit cast def to HashMap reference @1HashMap reference @1; identity not equals HashMap reference @0 and HashMap reference @1boolean false; store boolean false to b; (note HashMap reference @0 and HashMap reference @1 refer to the same instance)

Boolean Xor

Use the boolean xor operator '^' to XOR together two boolean type values where if one boolean type value is true and the other is false the resultant boolean type value is true and false otherwise.

Errors

  • If either evaluated value is a value other than a boolean type value or a value that is castable to a boolean type value.

Truth

true

false

true

false

true

false

true

false

Grammar

boolean_xor: expression '^' expression;

Examples

  • Boolean xor with the boolean type.

    boolean x = false;    (1)
    boolean y = x ^ true; (2)
    y = y ^ x;            (3)
    1. declare boolean x; store boolean false to x

    2. declare boolean y; load from xboolean false boolean xor boolean false and boolean trueboolean true; store boolean true to y

    3. load from yboolean true @0; load from xboolean true @1; boolean xor boolean true @0 and boolean true @1boolean false; store boolean false to y

  • Boolean xor with the def type.

    def x = false;    (1)
    def y = x ^ true; (2)
    y = y ^ x;        (3)
    1. declare def x; implicit cast boolean false to defdef; store def to x

    2. declare def y; load from xdef; implicit cast def to boolean falseboolean false; boolean xor boolean false and boolean trueboolean true; implicit cast boolean true to defdef; store def to y

    3. load from ydef; implicit cast def to boolean true @0boolean true @0; load from xdef; implicit cast def to boolean true @1boolean true @1; boolean xor boolean true @0 and boolean true @1boolean false; implicit cast boolean falsedef; store def to y

Boolean And

Use the boolean and operator '&&' to AND together two boolean type values where if both boolean type values are true the resultant boolean type value is true and false otherwise.

Errors

  • If either evaluated value is a value other than a boolean type value or a value that is castable to a boolean type value.

Truth

true

false

true

true

false

false

false

false

Grammar

boolean_and: expression '&&' expression;

Examples

  • Boolean and with the boolean type.

    boolean x = true;      (1)
    boolean y = x && true; (2)
    x = false;             (3)
    y = y && x;            (4)
    1. declare boolean x; store boolean true to x

    2. declare boolean y; load from xboolean true @0; boolean and boolean true @0 and boolean true @1boolean true; store boolean true to y

    3. store boolean false to x

    4. load from yboolean true; load from xboolean false; boolean and boolean true and boolean falseboolean false; store boolean false to y

  • Boolean and with the def type.

    def x = true;      (1)
    def y = x && true; (2)
    x = false;         (3)
    y = y && x;        (4)
    1. declare def x; implicit cast boolean true to defdef; store def to x

    2. declare def y; load from xdef; implicit cast def to boolean true @0boolean true @0; boolean and boolean true @0 and boolean true @1boolean true; implicit cast boolean true to defdef; store def to y

    3. implicit cast boolean false to defdef; store def to x;

    4. load from ydef; implicit cast def to boolean trueboolean true; load from xdef; implicit cast def to boolean falseboolean false; boolean and boolean true and boolean falseboolean false; implicit cast boolean falsedef; store def to y

Boolean Or

Use the boolean or operator '||' to OR together two boolean type values where if either one of the boolean type values is true the resultant boolean type value is true and false otherwise.

Errors

  • If either evaluated value is a value other than a boolean type value or a value that is castable to a boolean type value.

Truth

true

false

true

true

true

false

true

false

Grammar:

boolean_and: expression '||' expression;

Examples

  • Boolean or with the boolean type.

    boolean x = false;     (1)
    boolean y = x || true; (2)
    y = false;             (3)
    y = y || x;            (4)
    1. declare boolean x; store boolean false to x

    2. declare boolean y; load from xboolean false; boolean or boolean false and boolean trueboolean true; store boolean true to y

    3. store boolean false to y

    4. load from yboolean false @0; load from xboolean false @1; boolean or boolean false @0 and boolean false @1boolean false; store boolean false to y

  • Boolean or with the def type.

    def x = false;     (1)
    def y = x || true; (2)
    y = false;         (3)
    y = y || x;        (4)
    1. declare def x; implicit cast boolean false to defdef; store def to x

    2. declare def y; load from xdef; implicit cast def to boolean falseboolean true; boolean or boolean false and boolean trueboolean true; implicit cast boolean true to defdef; store def to y

    3. implicit cast boolean false to defdef; store def to y;

    4. load from ydef; implicit cast def to boolean false @0boolean false @0; load from xdef; implicit cast def to boolean false @1boolean false @1; boolean or boolean false @0 and boolean false @1boolean false; implicit cast boolean falsedef; store def to y

Operators: Reference

Method Call

Use the method call operator '()' to call a member method on a reference type value. Implicit boxing/unboxing is evaluated as necessary per argument during the method call. When a method call is made on a target def type value, the parameters and return type value are considered to also be of the def type and are evaluated at run-time.

An overloaded method is one that shares the same name with two or more methods. A method is overloaded based on arity where the same name is re-used for multiple methods as long as the number of parameters differs.

Errors

  • If the reference type value is null.

  • If the member method name doesn’t exist for a given reference type value.

  • If the number of arguments passed in is different from the number of specified parameters.

  • If the arguments cannot be implicitly cast or implicitly boxed/unboxed to the correct type values for the parameters.

Grammar

method_call: '.' ID arguments;
arguments: '(' (expression (',' expression)*)? ')';

Examples

  • Method calls on different reference types.

    Map m = new HashMap();                         (1)
    m.put(1, 2);                                   (2)
    int z = m.get(1);                              (3)
    def d = new ArrayList();                       (4)
    d.add(1);                                      (5)
    int i = Integer.parseInt(d.get(0).toString()); (6)
    1. declare Map m; allocate HashMap instance → HashMap reference; store HashMap reference to m

    2. load from mMap reference; implicit cast int 1 to defdef; implicit cast int 2 to defdef; call put on Map reference with arguments (int 1, int 2)

    3. declare int z; load from mMap reference; call get on Map reference with arguments (int 1) → def; implicit cast def to int 2int 2; store int 2 to z

    4. declare def d; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList to defdef; store def to d

    5. load from ddef; implicit cast def to ArrayList referenceArrayList reference call add on ArrayList reference with arguments (int 1);

    6. declare int i; load from ddef; implicit cast def to ArrayList referenceArrayList reference call get on ArrayList reference with arguments (int 1) → def; implicit cast def to Integer 1 referenceInteger 1 reference; call toString on Integer 1 referenceString '1'; call parseInt on Integer with arguments (String '1') → int 1; store int 1 in i;

Field Access

Use the field access operator '.' to store a value to or load a value from a reference type member field.

Errors

  • If the reference type value is null.

  • If the member field name doesn’t exist for a given reference type value.

Grammar

field_access: '.' ID;

Examples

The examples use the following reference type definition:

name:
  Example

non-static member fields:
  * int x
  * def y
  * List z
  • Field access with the Example type.

    Example example = new Example(); (1)
    example.x = 1;                   (2)
    example.y = example.x;           (3)
    example.z = new ArrayList();     (4)
    example.z.add(1);                (5)
    example.x = example.z.get(0);    (6)
    1. declare Example example; allocate Example instance → Example reference; store Example reference to example

    2. load from exampleExample reference; store int 1 to x of Example reference

    3. load from exampleExample reference @0; load from exampleExample reference @1; load from x of Example reference @1int 1; implicit cast int 1 to defdef; store def to y of Example reference @0; (note Example reference @0 and Example reference @1 are the same)

    4. load from exampleExample reference; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to z of Example reference

    5. load from exampleExample reference; load from z of Example referenceList reference; call add on List reference with arguments (int 1)

    6. load from exampleExample reference @0; load from exampleExample reference @1; load from z of Example reference @1List reference; call get on List reference with arguments (int 0) → int 1; store int 1 in x of List reference @0; (note Example reference @0 and Example reference @1 are the same)

Null Safe

Use the null safe operator '?.' instead of the method call operator or field access operator to ensure a reference type value is non-null before a method call or field access. A null value will be returned if the reference type value is null, otherwise the method call or field access is evaluated.

Errors

  • If the method call return type value or the field access type value is not a reference type value and is not implicitly castable to a reference type value.

Grammar

null_safe: null_safe_method_call
         | null_safe_field_access
         ;

null_safe_method_call: '?.' ID arguments;
arguments: '(' (expression (',' expression)*)? ')';

null_safe_field_access: '?.' ID;

Examples

The examples use the following reference type definition:

name:
  Example

non-static member methods:
  * List factory()

non-static member fields:
  * List x
  • Null safe without a null value.

    Example example = new Example(); (1)
    List x = example?.factory();     (2)
    1. declare Example example; allocate Example instance → Example reference; store Example reference to example

    2. declare List x; load from exampleExample reference; null safe call factory on Example referenceList reference; store List reference to x;

  • Null safe with a null value;

    Example example = null; (1)
    List x = example?.x;    (2)
    1. declare Example example; store null to example

    2. declare List x; load from exampleExample reference; null safe access x on Example referencenull; store null to x; (note the null safe operator returned null because example is null)

List Initialization

Use the list initialization operator '[]' to allocate an List type instance to the heap with a set of pre-defined values. Each value used to initialize the List type instance is cast to a def type value upon insertion into the List type instance using the add method. The order of the specified values is maintained.

Grammar

list_initialization: '[' expression (',' expression)* ']'
                   | '[' ']';

Examples

  • List initialization of an empty List type value.

    List empty = []; (1)
    1. declare List empty; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to empty

  • List initialization with static values.

    List list = [1, 2, 3]; (1)
    1. declare List list; allocate ArrayList instance → ArrayList reference; call add on ArrayList reference with arguments(int 1); call add on ArrayList reference with arguments(int 2); call add on ArrayList reference with arguments(int 3); implicit cast ArrayList reference to List referenceList reference; store List reference to list

  • List initialization with non-static values.

    int i = 1;                  (1)
    long l = 2L;                (2)
    float f = 3.0F;             (3)
    double d = 4.0;             (4)
    String s = "5";             (5)
    List list = [i, l, f*d, s]; (6)
    1. declare int i; store int 1 to i

    2. declare long l; store long 2 to l

    3. declare float f; store float 3.0 to f

    4. declare double d; store double 4.0 to d

    5. declare String s; store String "5" to s

    6. declare List list; allocate ArrayList instance → ArrayList reference; load from iint 1; call add on ArrayList reference with arguments(int 1); load from llong 2; call add on ArrayList reference with arguments(long 2); load from ffloat 3.0; load from ddouble 4.0; promote float 3.0 and double 4.0: result double; implicit cast float 3.0 to double 3.0double 3.0; multiply double 3.0 and double 4.0double 12.0; call add on ArrayList reference with arguments(double 12.0); load from sString "5"; call add on ArrayList reference with arguments(String "5"); implicit cast ArrayList reference to List referenceList reference; store List reference to list

List Access

Use the list access operator '[]' as a shortcut for a set method call or get method call made on a List type value.

Errors

  • If a value other than a List type value is accessed.

  • If a non-integer type value is used as an index for a set method call or get method call.

Grammar

list_access: '[' expression ']'

Examples

  • List access with the List type.

    List list = new ArrayList(); (1)
    list.add(1);                 (2)
    list.add(2);                 (3)
    list.add(3);                 (4)
    list[0] = 2;                 (5)
    list[1] = 5;                 (6)
    int x = list[0] + list[1];   (7)
    int y = 1;                   (8)
    int z = list[y];             (9)
    1. declare List list; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to list

    2. load from listList reference; call add on List reference with arguments(int 1)

    3. load from listList reference; call add on List reference with arguments(int 2)

    4. load from listList reference; call add on List reference with arguments(int 3)

    5. load from listList reference; call set on List reference with arguments(int 0, int 2)

    6. load from listList reference; call set on List reference with arguments(int 1, int 5)

    7. declare int x; load from listList reference; call get on List reference with arguments(int 0) → def; implicit cast def to int 2int 2; load from listList reference; call get on List reference with arguments(int 1) → def; implicit cast def to int 5int 5; add int 2 and int 5int 7; store int 7 to x

    8. declare int y; store int 1 int y

    9. declare int z; load from listList reference; load from yint 1; call get on List reference with arguments(int 1) → def; implicit cast def to int 5int 5; store int 5 to z

  • List access with the def type.

    def d = new ArrayList(); (1)
    d.add(1);                (2)
    d.add(2);                (3)
    d.add(3);                (4)
    d[0] = 2;                (5)
    d[1] = 5;                (6)
    def x = d[0] + d[1];     (7)
    def y = 1;               (8)
    def z = d[y];            (9)
    1. declare List d; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef; store def to d

    2. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call add on ArrayList reference with arguments(int 1)

    3. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call add on ArrayList reference with arguments(int 2)

    4. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call add on ArrayList reference with arguments(int 3)

    5. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call set on ArrayList reference with arguments(int 0, int 2)

    6. load from ddef; implicit cast def to ArrayList referenceArrayList reference; call set on ArrayList reference with arguments(int 1, int 5)

    7. declare def x; load from ddef; implicit cast def to ArrayList referenceArrayList reference; call get on ArrayList reference with arguments(int 0) → def; implicit cast def to int 2int 2; load from ddef; implicit cast def to ArrayList referenceArrayList reference; call get on ArrayList reference with arguments(int 1) → def; implicit cast def to int 2int 2; add int 2 and int 5int 7; store int 7 to x

    8. declare int y; store int 1 int y

    9. declare int z; load from dArrayList reference; load from ydef; implicit cast def to int 1int 1; call get on ArrayList reference with arguments(int 1) → def; store def to z

Map Initialization

Use the map initialization operator '[:]' to allocate a Map type instance to the heap with a set of pre-defined values. Each pair of values used to initialize the Map type instance are cast to def type values upon insertion into the Map type instance using the put method.

Grammar

map_initialization: '[' key_pair (',' key_pair)* ']'
                  | '[' ':' ']';
key_pair: expression ':' expression

Examples

  • Map initialization of an empty Map type value.

    Map empty = [:]; (1)
    1. declare Map empty; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map referenceMap reference; store Map reference to empty

  • Map initialization with static values.

    Map map = [1:2, 3:4, 5:6]; (1)
    1. declare Map map; allocate HashMap instance → HashMap reference; call put on HashMap reference with arguments(int 1, int 2); call put on HashMap reference with arguments(int 3, int 4); call put on HashMap reference with arguments(int 5, int 6); implicit cast HashMap reference to Map referenceMap reference; store Map reference to map

  • Map initialization with non-static values.

    byte b = 0;                  (1)
    int i = 1;                   (2)
    long l = 2L;                 (3)
    float f = 3.0F;              (4)
    double d = 4.0;              (5)
    String s = "5";              (6)
    Map map = [b:i, l:f*d, d:s]; (7)
    1. declare byte b; store byte 0 to b

    2. declare int i; store int 1 to i

    3. declare long l; store long 2 to l

    4. declare float f; store float 3.0 to f

    5. declare double d; store double 4.0 to d

    6. declare String s; store String "5" to s

    7. declare Map map; allocate HashMap instance → HashMap reference; load from bbyte 0; load from iint 1; call put on HashMap reference with arguments(byte 0, int 1); load from llong 2; load from ffloat 3.0; load from ddouble 4.0; promote float 3.0 and double 4.0: result double; implicit cast float 3.0 to double 3.0double 3.0; multiply double 3.0 and double 4.0double 12.0; call put on HashMap reference with arguments(long 2, double 12.0); load from ddouble 4.0; load from sString "5"; call put on HashMap reference with arguments(double 4.0, String "5"); implicit cast HashMap reference to Map referenceMap reference; store Map reference to map

Map Access

Use the map access operator '[]' as a shortcut for a put method call or get method call made on a Map type value.

Errors

  • If a value other than a Map type value is accessed.

Grammar

map_access: '[' expression ']'

Examples

  • Map access with the Map type.

    Map map = new HashMap();               (1)
    map['value2'] = 2;                     (2)
    map['value5'] = 5;                     (3)
    int x = map['value2'] + map['value5']; (4)
    String y = 'value5';                   (5)
    int z = x[z];                          (6)
    1. declare Map map; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map referenceMap reference; store Map reference to map

    2. load from mapMap reference; call put on Map reference with arguments(String 'value2', int 2)

    3. load from mapMap reference; call put on Map reference with arguments(String 'value5', int 5)

    4. declare int x; load from mapMap reference; call get on Map reference with arguments(String 'value2') → def; implicit cast def to int 2int 2; load from mapMap reference; call get on Map reference with arguments(String 'value5') → def; implicit cast def to int 5int 5; add int 2 and int 5int 7; store int 7 to x

    5. declare String y; store String 'value5' to y

    6. declare int z; load from mapMap reference; load from yString 'value5'; call get on Map reference with arguments(String 'value5') → def; implicit cast def to int 5int 5; store int 5 to z

  • Map access with the def type.

    def d = new HashMap();             (1)
    d['value2'] = 2;                   (2)
    d['value5'] = 5;                   (3)
    int x = d['value2'] + d['value5']; (4)
    String y = 'value5';               (5)
    def z = d[y];                      (6)
    1. declare def d; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to defdef; store def to d

    2. load from ddef; implicit cast def to HashMap referenceHashMap reference; call put on HashMap reference with arguments(String 'value2', int 2)

    3. load from ddef; implicit cast def to HashMap referenceHashMap reference; call put on HashMap reference with arguments(String 'value5', int 5)

    4. declare int x; load from ddef; implicit cast def to HashMap referenceHashMap reference; call get on HashMap reference with arguments(String 'value2') → def; implicit cast def to int 2int 2; load from ddef; call get on HashMap reference with arguments(String 'value5') → def; implicit cast def to int 5int 5; add int 2 and int 5int 7; store int 7 to x

    5. declare String y; store String 'value5' to y

    6. declare def z; load from ddef; load from yString 'value5'; call get on HashMap reference with arguments(String 'value5') → def; store def to z

New Instance

Use the new instance operator 'new ()' to allocate a reference type instance to the heap and call a specified constructor. Implicit boxing/unboxing is evaluated as necessary per argument during the constructor call.

An overloaded constructor is one that shares the same name with two or more constructors. A constructor is overloaded based on arity where the same reference type name is re-used for multiple constructors as long as the number of parameters differs.

Errors

  • If the reference type name doesn’t exist for instance allocation.

  • If the number of arguments passed in is different from the number of specified parameters.

  • If the arguments cannot be implicitly cast or implicitly boxed/unboxed to the correct type values for the parameters.

Grammar

new_instance: 'new' TYPE '(' (expression (',' expression)*)? ')';

Examples

  • Allocation of new instances with different types.

Map m = new HashMap();   (1)
def d = new ArrayList(); (2)
def e = new HashMap(m);  (3)
  1. declare Map m; allocate HashMap instance → HashMap reference; implicit cast HashMap reference to Map referenceMap reference; store Map reference to m;

  2. declare def d; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to defdef; store def to d;

  3. declare def e; load from mMap reference; allocate HashMap instance with arguments (Map reference) → HashMap reference; implicit cast HashMap reference to defdef; store def to e;

String Concatenation

Use the string concatenation operator '+' to concatenate two values together where at least one of the values is a String type.

Grammar

concatenate: expression '+' expression;

Examples

  • String concatenation with different primitive types.

    String x = "con";     (1)
    String y = x + "cat"; (2)
    String z = 4 + 5 + x; (3)
    1. declare String x; store String "con" to x;

    2. declare String y; load from xString "con"; concat String "con" and String "cat"String "concat"; store String "concat" to y

    3. declare String z; add int 4 and int 5int 9; concat int 9 and String "9concat"; store String "9concat" to z; (note the addition is done prior to the concatenation due to precedence and associativity of the specific operations)

  • String concatenation with the def type.

    def d = 2;             (1)
    d = "con" + d + "cat"; (2)
    1. declare def; implicit cast int 2 to defdef; store def in d;

    2. concat String "con" and int 9String "con9"; concat String "con9" and String "con"String "con9cat" implicit cast String "con9cat" to defdef; store def to d; (note the switch in type of d from int to String)

Elvis

An elvis consists of two expressions. The first expression is evaluated with to check for a null value. If the first expression evaluates to null then the second expression is evaluated and its value used. If the first expression evaluates to non-null then the resultant value of the first expression is used. Use the elvis operator '?:' as a shortcut for the conditional operator.

Errors

  • If the first expression or second expression cannot produce a null value.

Grammar

elvis: expression '?:' expression;

Examples

  • Elvis with different reference types.

    List x = new ArrayList();      (1)
    List y = x ?: new ArrayList(); (2)
    y = null;                      (3)
    List z = y ?: new ArrayList(); (4)
    1. declare List x; allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to x;

    2. declare List y; load xList reference; List reference equals nullfalse; evaluate 1st expression: List referenceList reference; store List reference to y

    3. store null to y;

    4. declare List z; load yList reference; List reference equals nulltrue; evaluate 2nd expression: allocate ArrayList instance → ArrayList reference; implicit cast ArrayList reference to List referenceList reference; store List reference to z;

Operators: Array

Array Initialization

Use the array initialization operator '[] {}' to allocate a single-dimensional array type instance to the heap with a set of pre-defined elements. Each value used to initialize an element in the array type instance is cast to the specified element type value upon insertion. The order of specified values is maintained.

Errors

  • If a value is not castable to the specified type value.

Grammar

array_initialization: 'new' TYPE '[' ']' '{' expression_list '}'
                    | 'new' TYPE '[' ']' '{' '}';
expression_list: expression (',' expression);

Example:

  • Array initialization with static values.

    int[] x = new int[] {1, 2, 3}; (1)
    1. declare int[] x; allocate 1-d int array instance with length [3]1-d int array reference; store int 1 to index [0] of 1-d int array reference; store int 2 to index [1] of 1-d int array reference; store int 3 to index [2] of 1-d int array reference; store 1-d int array reference to x;

  • Array initialization with non-static values.

    int i = 1;      (1)
    long l = 2L;    (2)
    float f = 3.0F; (3)
    double d = 4.0; (4)
    String s = "5"; (5)
    def array = new def[] {i, l, f*d, s}; (6)
    1. declare int i; store int 1 to i

    2. declare long l; store long 2 to l

    3. declare float f; store float 3.0 to f

    4. declare double d; store double 4.0 to d

    5. declare String s; store String "5" to s

    6. declare def array; allocate 1-d def array instance with length [4]1-d def array reference; load from iint 1; implicit cast int 1 to defdef; store def to index [0] of 1-d def array reference; load from llong 2; implicit cast long 2 to defdef; store def to index [1] of 1-d def array reference; load from ffloat 3.0; load from ddouble 4.0; promote float 3.0 and double 4.0: result double; implicit cast float 3.0 to double 3.0double 3.0; multiply double 3.0 and double 4.0double 12.0; implicit cast double 12.0 to defdef; store def to index [2] of 1-d def array reference; load from sString "5"; implicit cast String "5" to defdef; store def to index [3] of 1-d def array reference; implicit cast 1-d int array reference to defdef; store def to array

Array Access

Use the array access operator '[]' to store a value to or load a value from an array type value. Each element of an array type value is accessed with an int type value to specify the index to store/load. The range of elements within an array that are accessible is [0, size) where size is the number of elements specified at the time of allocation. Use a negative int type value as an index to access an element in reverse from the end of an array type value within a range of [-size, -1].

Errors

  • If a value other than an int type value or a value that is castable to an int type value is provided as an index.

  • If an element is accessed outside of the valid ranges.

Grammar

brace_access: '[' expression ']'

Examples

  • Array access with a single-dimensional array.

    int[] x = new int[2]; (1)
    x[0] = 2;             (2)
    x[1] = 5;             (3)
    int y = x[0] + x[1];  (4)
    int z = 1;            (5)
    int i = x[z];         (6)
    1. declare int[] x; allocate 1-d int array instance with length [2]1-d int array reference; store 1-d int array reference to x

    2. load from x1-d int array reference; store int 2 to index [0] of 1-d int array reference;

    3. load from x1-d int array reference; store int 5 to index [1] of 1-d int array reference;

    4. declare int y; load from x1-d int array reference; load from index [0] of 1-d int array referenceint 2; load from x1-d int array reference; load from index [1] of 1-d int array referenceint 5; add int 2 and int 5int 7; store int 7 to y

    5. declare int z; store int 1 to z;

    6. declare int i; load from x1-d int array reference; load from zint 1; load from index [1] of 1-d int array referenceint 5; store int 5 to i;

  • Array access with the def type.

    def d = new int[2];  (1)
    d[0] = 2;            (2)
    d[1] = 5;            (3)
    def x = d[0] + d[1]; (4)
    def y = 1;           (5)
    def z = d[y];        (6)
    1. declare def d; allocate 1-d int array instance with length [2]1-d int array reference; implicit cast 1-d int array reference to defdef; store def to d

    2. load from ddef implicit cast def to 1-d int array reference1-d int array reference; store int 2 to index [0] of 1-d int array reference;

    3. load from ddef implicit cast def to 1-d int array reference1-d int array reference; store int 5 to index [1] of 1-d int array reference;

    4. declare int x; load from ddef implicit cast def to 1-d int array reference1-d int array reference; load from index [0] of 1-d int array referenceint 2; load from ddef implicit cast def to 1-d int array reference1-d int array reference; load from index [1] of 1-d int array referenceint 5; add int 2 and int 5int 7; implicit cast int 7 to defdef; store def to x

    5. declare def y; implicit cast int 1 to defdef; store def to y;

    6. declare int i; load from ddef implicit cast def to 1-d int array reference1-d int array reference; load from ydef; implicit cast def to int 1int 1; load from index [1] of 1-d int array referenceint 5; implicit cast int 5 to def; store def to z;

  • Array access with a multi-dimensional array.

    int[][][] ia3 = new int[2][3][4]; (1)
    ia3[1][2][3] = 99;                (2)
    int i = ia3[1][2][3];             (3)
    1. declare int[][][] ia; allocate 3-d int array instance with length [2, 3, 4]3-d int array reference; store 3-d int array reference to ia3

    2. load from ia33-d int array reference; store int 99 to index [1, 2, 3] of 3-d int array reference

    3. declare int i; load from ia33-d int array reference; load from index [1, 2, 3] of 3-d int array referenceint 99; store int 99 to i

Array Length

An array type value contains a read-only member field named length. The length field stores the size of the array as an int type value where size is the number of elements specified at the time of allocation. Use the field access operator to load the field length from an array type value.

Examples

  • Access the length field.

    int[] x = new int[10]; (1)
    int l = x.length;      (2)
    1. declare int[] x; allocate 1-d int array instance with length [2]1-d int array reference; store 1-d int array reference to x

    2. declare int l; load x1-d int array reference; load length from 1-d int array referenceint 10; store int 10 to l;

New Array

Use the new array operator 'new []' to allocate an array type instance to the heap. Specify the element type following the new token. Specify each dimension with the [ and ] tokens following the element type name. The size of each dimension is specified by an int type value in between each set of [ and ] tokens.

Errors

  • If a value other than an int type value or a value that is castable to an int type value is specified for a dimension’s size.

Grammar

new_array: 'new' TYPE ('[' expression ']')+;

Examples

  • Allocation of different array types.

    int[] x = new int[5];    (1)
    x = new int[10];         (2)
    int y = 2;               (3)
    def z = new def[y][y*2]; (4)
    1. declare int[] x; allocate 1-d int array instance with length [5]1-d int array reference; store 1-d int array reference to x

    2. allocate 1-d int array instance with length [10]1-d int array reference; store 1-d int array reference to x

    3. declare int y; store int 2 to y;

    4. declare def z; load from yint 2 @0; load from yint 2 @1; multiply int 2 @1 by int 2 @2int 4; allocate 2-d int array instance with length [2, 4]2-d int array reference; implicit cast 2-d int array reference to defdef; store def to z;

Statements

Painless supports all of Java’s control flow statements except the switch statement.

Conditional statements

If / Else
if (doc[item].size() == 0) {
  // do something if "item" is missing
} else {
  // do something else
}

Loop statements

For

Painless also supports the for in syntax from Groovy:

for (def item : list) {
  ...
}

Scripts

Scripts are composed of one-to-many statements and are run in a sandbox that determines what local variables are immediately available along with what APIs are whitelisted for use.

Functions

A function is a named piece of code comprised of one-to-many statements to perform a specific task. A function is called multiple times in a single script to repeat its specific task. A parameter is a named type value available as a variable within the statement(s) of a function. A function specifies zero-to-many parameters, and when a function is called a value is specified per parameter. An argument is a value passed into a function at the point of call. A function specifies a return type value, though if the type is void then no value is returned. Any non-void type return value is available for use within an operation or is discarded otherwise.

You can declare functions at the beginning of a Painless script, for example:

boolean isNegative(def x) { x < 0 }
...
if (isNegative(someVar)) {
  ...
}

Lambdas

Lambda expressions and method references work the same as in Java.

list.removeIf(item -> item == 2);
list.removeIf((int item) -> item == 2);
list.removeIf((int item) -> { item == 2 });
list.sort((x, y) -> x - y);
list.sort(Integer::compare);

You can make method references to functions within the script with this, for example list.sort(this::mycompare).

Regexes

Regular expression constants are directly supported. To ensure fast performance, this is the only mechanism for creating patterns. Regular expressions are always constants and compiled efficiently a single time.

Pattern p = /[aeiou]/

Pattern flags

You can define flags on patterns in Painless by adding characters after the trailing / like /foo/i or /foo \w #comment/iUx. Painless exposes all of the flags from Java’s Pattern class using these characters:

Character Java Constant Example

c

CANON_EQ

'å' ==~ /å/c (open in hex editor to see)

i

CASE_INSENSITIVE

'A' ==~ /a/i

l

LITERAL

'[a]' ==~ /[a]/l

m

MULTILINE

'a\nb\nc' =~ /^b$/m

s

DOTALL (aka single line)

'a\nb\nc' =~ /.b./s

U

UNICODE_CHARACTER_CLASS

'Ɛ' ==~ /\\w/U

u

UNICODE_CASE

'Ɛ' ==~ /ɛ/iu

x

COMMENTS (aka extended)

'a' ==~ /a #comment/x

Painless contexts

A Painless script is evaluated within a context. Each context has values that are available as local variables, a whitelist that controls the available classes, and the methods and fields within those classes (API), and if and what type of value is returned.

A Painless script is typically executed within one of the contexts in the table below. Note this is not necessarily a comprehensive list as custom plugins and specialized code may define new ways to use a Painless script.

Name Painless Documentation Elasticsearch Documentation

Ingest processor

Painless Documentation

{ref}/script-processor.html[Elasticsearch Documentation]

Update

Painless Documentation

{ref}/docs-update.html[Elasticsearch Documentation]

Update by query

Painless Documentation

{ref}/docs-update-by-query.html[Elasticsearch Documentation]

Reindex

Painless Documentation

{ref}/docs-reindex.html[Elasticsearch Documentation]

Sort

Painless Documentation

{ref}/search-request-sort.html[Elasticsearch Documentation]

Similarity

Painless Documentation

{ref}/index-modules-similarity.html[Elasticsearch Documentation]

Weight

Painless Documentation

{ref}/index-modules-similarity.html[Elasticsearch Documentation]

Score

Painless Documentation

{ref}/query-dsl-function-score-query.html[Elasticsearch Documentation]

Field

Painless Documentation

{ref}/search-request-script-fields.html[Elasticsearch Documentation]

Filter

Painless Documentation

{ref}/query-dsl-script-query.html[Elasticsearch Documentation]

Minimum should match

Painless Documentation

{ref}/query-dsl-terms-set-query.html[Elasticsearch Documentation]

Metric aggregation initialization

Painless Documentation

{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]

Metric aggregation map

Painless Documentation

{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]

Metric aggregation combine

Painless Documentation

{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]

Metric aggregation reduce

Painless Documentation

{ref}/search-aggregations-metrics-scripted-metric-aggregation.html[Elasticsearch Documentation]

Bucket script aggregation

Painless Documentation

{ref}/search-aggregations-pipeline-bucket-script-aggregation.html[Elasticsearch Documentation]

Bucket selector aggregation

Painless Documentation

{ref}/search-aggregations-pipeline-bucket-selector-aggregation.html[Elasticsearch Documentation]

Watcher condition

Painless Documentation

{ref}/condition-script.html[Elasticsearch Documentation]

Watcher transform

Painless Documentation

{ref}/transform-script.html[Elasticsearch Documentation]

Context examples

To run the examples, index the sample seat data into Elasticsearch. The examples must be run sequentially to work correctly.

  1. Download the seat data. This data set contains booking information for a collection of plays. Each document represents a single seat for a play at a particular theater on a specific date and time.

    Each document contains the following fields:

    theatre ({ref}/keyword.html[keyword])

    The name of the theater the play is in.

    play ({ref}/text.html[text])

    The name of the play.

    actors ({ref}/text.html[text])

    A list of actors in the play.

    row ({ref}/number.html[integer])

    The row of the seat.

    number ({ref}/number.html[integer])

    The number of the seat within a row.

    cost ({ref}/number.html[double])

    The cost of the ticket for the seat.

    sold ({ref}/boolean.html[boolean])

    Whether or not the seat is sold.

    datetime ({ref}/date.html[date])

    The date and time of the play as a date object.

    date ({ref}/keyword.html[keyword])

    The date of the play as a keyword.

    time ({ref}/keyword.html[keyword])

    The time of the play as a keyword.

  2. {defguide}/running-elasticsearch.html[Start] Elasticsearch. Note these examples assume Elasticsearch and Kibana are running locally. To use the Console editor with a remote Kibana instance, click the settings icon and enter the Console URL. To submit a cURL request to a remote Elasticsearch instance, edit the request URL.

  3. Create {ref}/mapping.html[mappings] for the sample data:

    PUT /seats
    {
      "mappings": {
        "seat": {
          "properties": {
            "theatre":  { "type": "keyword" },
            "play":     { "type": "text"    },
            "actors":   { "type": "text"    },
            "row":      { "type": "integer" },
            "number":   { "type": "integer" },
            "cost":     { "type": "double"  },
            "sold":     { "type": "boolean" },
            "datetime": { "type": "date"    },
            "date":     { "type": "keyword" },
            "time":     { "type": "keyword" }
          }
        }
      }
    }
  4. Run the ingest processor context example. This sets up a script ingest processor used on each document as the seat data is indexed.

  5. Index the seat data:

    curl -XPOST localhost:9200/seats/seat/_bulk?pipeline=seats -H "Content-Type: application/x-ndjson" --data-binary "@/<local-file-path>/seats-init.json"

Ingest processor context

Use a Painless script in an {ref}/script-processor.html[ingest processor] to modify documents upon insertion.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

{ref}/mapping-index-field.html[ctx['_index']] (String)

The name of the index.

{ref}/mapping-type-field.html[ctx['_type']] (String)

The type of document within an index.

ctx (Map)

Contains extracted JSON in a Map and List structure for the fields that are part of the document.

Side Effects

{ref}/mapping-index-field.html[ctx['_index']]

Modify this to change the destination index for the current document.

{ref}/mapping-type-field.html[ctx['_type']]

Modify this to change the type for the current document.

ctx (Map)

Modify the values in the Map/List structure to add, modify, or delete the fields of a document.

Return

void

No expected return value.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

The seat data contains:

  • A date in the format YYYY-MM-DD where the second digit of both month and day is optional.

  • A time in the format HH:MM* where the second digit of both hours and minutes is optional. The star (*) represents either the String AM or PM.

The following ingest script processes the date and time Strings and stores the result in a datetime field.

String[] split(String s, char d) {                                   (1)
    int count = 0;

    for (char c : s.toCharArray()) {                                 (2)
        if (c == d) {
            ++count;
        }
    }

    if (count == 0) {
        return new String[] {s};                                     (3)
    }

    String[] r = new String[count + 1];                              (4)
    int i0 = 0, i1 = 0;
    count = 0;

    for (char c : s.toCharArray()) {                                 (5)
        if (c == d) {
            r[count++] = s.substring(i0, i1);
            i0 = i1 + 1;
        }

        ++i1;
    }

    r[count] = s.substring(i0, i1);                                  (6)

    return r;
}

String[] dateSplit = split(ctx.date, (char)"-");                     (7)
String year = dateSplit[0].trim();
String month = dateSplit[1].trim();

if (month.length() == 1) {                                           (8)
    month = "0" + month;
}

String day = dateSplit[2].trim();

if (day.length() == 1) {                                             (9)
    day = "0" + day;
}

boolean pm = ctx.time.substring(ctx.time.length() - 2).equals("PM"); (10)
String[] timeSplit = split(
        ctx.time.substring(0, ctx.time.length() - 2), (char)":");    (11)
int hours = Integer.parseInt(timeSplit[0].trim());
int minutes = Integer.parseInt(timeSplit[1].trim());

if (pm) {                                                            (12)
    hours += 12;
}

String dts = year + "-" + month + "-" + day + "T" +
        (hours < 10 ? "0" + hours : "" + hours) + ":" +
        (minutes < 10 ? "0" + minutes : "" + minutes) +
        ":00+08:00";                                                 (13)

ZonedDateTime dt = ZonedDateTime.parse(
         dts, DateTimeFormatter.ISO_OFFSET_DATE_TIME);               (14)
ctx.datetime = dt.getLong(ChronoField.INSTANT_SECONDS)*1000L;        (15)
  1. Creates a split function to split a String type value using a char type value as the delimiter. This is useful for handling the necessity of pulling out the individual pieces of the date and time Strings from the original seat data.

  2. The first pass through each char in the String collects how many new Strings the original is split into.

  3. Returns the original String if there are no instances of the delimiting char.

  4. Creates an array type value to collect the split Strings into based on the number of char delimiters found in the first pass.

  5. The second pass through each char in the String collects each split substring into an array type value of Strings.

  6. Collects the last substring into the array type value of Strings.

  7. Uses the split function to separate the date String from the seat data into year, month, and day Strings.

    Note
    • The use of a String type value to char type value cast as part of the second argument since character literals do not exist.

    • The use of the ctx ingest processor context variable to retrieve the data from the date field.

  8. Appends the string literal "0" value to a single digit month since the format of the seat data allows for this case.

  9. Appends the string literal "0" value to a single digit day since the format of the seat data allows for this case.

  10. Sets the boolean type variable to true if the time String is a time in the afternoon or evening.

    Note
    • The use of the ctx ingest processor context variable to retrieve the data from the time field.

  11. Uses the split function to separate the time String from the seat data into hours and minutes Strings.

    Note
    • The use of the substring method to remove the AM or PM portion of the time String.

    • The use of a String type value to char type value cast as part of the second argument since character literals do not exist.

    • The use of the ctx ingest processor context variable to retrieve the data from the date field.

  12. If the time String is an afternoon or evening value adds the integer literal 12 to the existing hours to move to a 24-hour based time.

  13. Builds a new time String that is parsable using existing API methods.

  14. Creates a ZonedDateTime reference type value by using the API method parse to parse the new time String.

  15. Sets the datetime field datetime to the number of milliseconds retrieved from the API method getLong.

    Note
    • The use of the ctx ingest processor context variable to set the field datetime. Manipulate each document’s fields with the ctx variable as each document is indexed.

Submit the following request:

PUT /_ingest/pipeline/seats
{
    "description": "update datetime for seats",
    "processors": [
      {
        "script": {
          "source": "String[] split(String s, char d) { int count = 0; for (char c : s.toCharArray()) { if (c == d) { ++count; } } if (count == 0) { return new String[] {s}; } String[] r = new String[count + 1]; int i0 = 0, i1 = 0; count = 0; for (char c : s.toCharArray()) { if (c == d) { r[count++] = s.substring(i0, i1); i0 = i1 + 1; } ++i1; } r[count] = s.substring(i0, i1); return r; } String[] dateSplit = split(ctx.date, (char)\"-\"); String year = dateSplit[0].trim(); String month = dateSplit[1].trim(); if (month.length() == 1) { month = \"0\" + month; } String day = dateSplit[2].trim(); if (day.length() == 1) { day = \"0\" + day; } boolean pm = ctx.time.substring(ctx.time.length() - 2).equals(\"PM\"); String[] timeSplit = split(ctx.time.substring(0, ctx.time.length() - 2), (char)\":\"); int hours = Integer.parseInt(timeSplit[0].trim()); int minutes = Integer.parseInt(timeSplit[1].trim()); if (pm) { hours += 12; } String dts = year + \"-\" + month + \"-\" + day + \"T\" + (hours < 10 ? \"0\" + hours : \"\" + hours) + \":\" + (minutes < 10 ? \"0\" + minutes : \"\" + minutes) + \":00+08:00\"; ZonedDateTime dt = ZonedDateTime.parse(dts, DateTimeFormatter.ISO_OFFSET_DATE_TIME); ctx.datetime = dt.getLong(ChronoField.INSTANT_SECONDS)*1000L;"
        }
      }
    ]
}

Update context

Use a Painless script in an {ref}/docs-update.html[update] operation to add, modify, or delete fields within a single document.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

ctx['op'] (String)

The name of the operation.

{ref}/mapping-routing-field.html[ctx['_routing']] (String, read-only)

The value used to select a shard for document storage.

{ref}/mapping-index-field.html[ctx['_index']] (String, read-only)

The name of the index.

{ref}/mapping-type-field.html[ctx['_type']] (String, read-only)

The type of document within an index.

{ref}/mapping-id-field.html[ctx['_id']] (int, read-only)

The unique document id.

ctx['_version'] (int, read-only)

The current version of the document.

ctx['_now'] (long, read-only)

The current timestamp in milliseconds.

{ref}/mapping-source-field.html[ctx['_source']] (Map)

Contains extracted JSON in a Map and List structure for the fields existing in a stored document.

Side Effects

ctx['op']

Use the default of index to update a document. Set to none to specify no operation or delete to delete the current document from the index.

{ref}/mapping-source-field.html[ctx['_source']]

Modify the values in the Map/List structure to add, modify, or delete the fields of a document.

Return

void

No expected return value.

API

The standard Painless API is available.

Update by query context

Use a Painless script in an {ref}/docs-update-by-query.html[update by query] operation to add, modify, or delete fields within each of a set of documents collected as the result of query.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

ctx['op'] (String)

The name of the operation.

{ref}/mapping-routing-field.html[ctx['_routing']] (String, read-only)

The value used to select a shard for document storage.

{ref}/mapping-index-field.html[ctx['_index']] (String, read-only)

The name of the index.

{ref}/mapping-type-field.html[ctx['_type']] (String, read-only)

The type of document within an index.

{ref}/mapping-id-field.html[ctx['_id']] (int, read-only)

The unique document id.

ctx['_version'] (int, read-only)

The current version of the document.

{ref}/mapping-source-field.html[ctx['_source']] (Map)

Contains extracted JSON in a Map and List structure for the fields existing in a stored document.

Side Effects

ctx['op']

Use the default of index to update a document. Set to none to specify no operation or delete to delete the current document from the index.

{ref}/mapping-source-field.html[ctx['_source']]

Modify the values in the Map/List structure to add, modify, or delete the fields of a document.

Return

void

No expected return value.

API

The standard Painless API is available.

Reindex context

Use a Painless script in a {ref}/docs-reindex.html[reindex] operation to add, modify, or delete fields within each document in an original index as its reindexed into a target index.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

ctx['op'] (String)

The name of the operation.

{ref}/mapping-routing-field.html[ctx['_routing']] (String)

The value used to select a shard for document storage.

{ref}/mapping-index-field.html[ctx['_index']] (String)

The name of the index.

{ref}/mapping-type-field.html[ctx['_type']] (String)

The type of document within an index.

{ref}/mapping-id-field.html[ctx['_id']] (int, read-only)

The unique document id.

ctx['_version'] (int)

The current version of the document.

{ref}/mapping-source-field.html[ctx['_source']] (Map)

Contains extracted JSON in a Map and List structure for the fields existing in a stored document.

Side Effects

ctx['op']

Use the default of index to update a document. Set to none to specify no operation or delete to delete the current document from the index.

{ref}/mapping-routing-field.html[ctx['_routing']]

Modify this to change the routing value for the current document.

{ref}/mapping-index-field.html[ctx['_index']]

Modify this to change the destination index for the current document.

{ref}/mapping-type-field.html[ctx['_type']]

Modify this to change the type for the current document.

{ref}/mapping-id-field.html[ctx['_id']]

Modify this to change the id for the current document.

ctx['_version'] (int)

Modify this to modify the version for the current document.

{ref}/mapping-source-field.html[ctx['_source']]

Modify the values in the Map/List structure to add, modify, or delete the fields of a document.

Return

void

No expected return value.

API

The standard Painless API is available.

Sort context

Use a Painless script to {ref}/search-request-sort.html[sort] the documents in a query.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

doc (Map, read-only)

Contains the fields of the current document. For single-valued fields, the value can be accessed via doc['fieldname'].value. For multi-valued fields, this returns the first value; other values can be accessed via doc['fieldname'].get(index)

_score (double read-only)

The similarity score of the current document.

Return

double

The score for the specified document.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

To sort results by the length of the theatre field, submit the following query:

GET /_search
{
    "query" : {
        "term" : { "sold" : "true" }
    },
    "sort" : {
        "_script" : {
            "type" : "number",
            "script" : {
                "lang": "painless",
                "source": "doc['theatre'].value.length() * params.factor",
                "params" : {
                    "factor" : 1.1
                }
            },
            "order" : "asc"
        }
    }
}

Similarity context

Use a Painless script to create a {ref}/index-modules-similarity.html[similarity] equation for scoring documents in a query.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

Variables

params (Map, read-only)

User-defined parameters passed in at query-time.

weight (float, read-only)

The weight as calculated by a weight script

query.boost (float, read-only)

The boost value if provided by the query. If this is not provided the value is 1.0f.

field.docCount (long, read-only)

The number of documents that have a value for the current field.

field.sumDocFreq (long, read-only)

The sum of all terms that exist for the current field. If this is not available the value is -1.

field.sumTotalTermFreq (long, read-only)

The sum of occurrences in the index for all the terms that exist in the current field. If this is not available the value is -1.

term.docFreq (long, read-only)

The number of documents that contain the current term in the index.

term.totalTermFreq (long, read-only)

The total occurrences of the current term in the index.

doc.length (long, read-only)

The number of tokens the current document has in the current field. This is decoded from the stored {ref}/norms.html[norms] and may be approximate for long fields

doc.freq (long, read-only)

The number of occurrences of the current term in the current document for the current field.

Note that the query, field, and term variables are also available to the weight context. They are more efficiently used there, as they are constant for all documents.

For queries that contain multiple terms, the script is called once for each term with that term’s calculated weight, and the results are summed. Note that some terms might have a doc.freq value of 0 on a document, for example if a query uses synonyms.

Return

double

The similarity score for the current document.

API

The standard Painless API is available.

Weight context

Use a Painless script to create a {ref}/index-modules-similarity.html[weight] for use in a similarity script. The weight makes up the part of the similarity calculation that is independent of the document being scored, and so can be built up front and cached.

Queries that contain multiple terms calculate a separate weight for each term.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

query.boost (float, read-only)

The boost value if provided by the query. If this is not provided the value is 1.0f.

field.docCount (long, read-only)

The number of documents that have a value for the current field.

field.sumDocFreq (long, read-only)

The sum of all terms that exist for the current field. If this is not available the value is -1.

field.sumTotalTermFreq (long, read-only)

The sum of occurrences in the index for all the terms that exist in the current field. If this is not available the value is -1.

term.docFreq (long, read-only)

The number of documents that contain the current term in the index.

term.totalTermFreq (long, read-only)

The total occurrences of the current term in the index.

Return

double

A scoring factor used across all documents.

API

The standard Painless API is available.

Score context

Use a Painless script in a {ref}/query-dsl-function-score-query.html[function score] to apply a new score to documents returned from a query.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

doc (Map, read-only)

Contains the fields of the current document. For single-valued fields, the value can be accessed via doc['fieldname'].value. For multi-valued fields, this returns the first value; other values can be accessed via doc['fieldname'].get(index)

_score (double read-only)

The similarity score of the current document.

Return

double

The score for the current document.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

The following query finds all unsold seats, with lower 'row' values scored higher.

GET /seats/_search
{
    "query": {
        "function_score": {
            "query": {
                "match": { "sold": "false" }
            },
            "script_score" : {
                "script" : {
                  "source": "1.0 / doc['row'].value"
                }
            }
        }
    }
}

Field context

Use a Painless script to create a {ref}/search-request-script-fields.html[script field] to return a customized value for each document in the results of a query.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

doc (Map, read-only)

Contains the fields of the specified document where each field is a List of values.

{ref}/mapping-source-field.html[ctx['_source']] (Map)

Contains extracted JSON in a Map and List structure for the fields existing in a stored document.

_score (double read-only)

The original score of the specified document.

Return

Object

The customized value for each document.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

You can then use these two example scripts to compute custom information for each search hit and output it to two new fields.

The first script gets the doc value for the datetime field and calls the getDayOfWeek function to determine the corresponding day of the week.

doc['datetime'].value.getDayOfWeek();

The second script calculates the number of actors. Actors' names are stored as a text array in the actors field.

params['_source']['actors'].length;                        (1)
  1. By default, doc values are not available for text fields. However, you can still calculate the number of actors by extracting actors from _source. Note that params['_source']['actors'] is a list.

Submit the following request:

GET seats/_search
{
    "query" : {
        "match_all": {}
    },
    "script_fields" : {
        "day-of-week" : {
            "script" : {
                "source": "doc['datetime'].value.getDayOfWeek()"
            }
        },
        "number-of-actors" : {
            "script" : {
                "source": "params['_source']['actors'].length"
            }
        }
    }
}

Filter context

Use a Painless script as a {ref}/query-dsl-script-query.html[filter] in a query to include and exclude documents.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

doc (Map, read-only)

Contains the fields of the current document where each field is a List of values.

Return

boolean

Return true if the current document should be returned as a result of the query, and false otherwise.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

This script finds all unsold documents that cost less than $18.

doc['sold'].value == false && doc['cost'].value < 18

Defining cost as a script parameter enables the cost to be configured in the script query request. For example, the following request finds all available theatre seats for evening performances that are under $18.

GET evening/_search
{
    "query": {
        "bool" : {
            "filter" : {
                "script" : {
                    "script" : {
                        "source" : "doc['sold'].value == false && doc['cost'].value < params.cost",
                        "params" : {
                            "cost" : 18
                        }
                    }
                }
            }
        }
    }
}

Minimum should match context

Use a Painless script to specify the {ref}/query-dsl-terms-set-query.html[minimum] number of terms that a specified field needs to match with for a document to be part of the query results.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

params['num_terms'] (int, read-only)

The number of terms specified to match with.

doc (Map, read-only)

Contains the fields of the current document where each field is a List of values.

Return

int

The minimum number of terms required to match the current document.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

Imagine that you want to find seats to performances by your favorite actors. You have a list of favorite actors in mind, and you want to find performances where the cast includes at least a certain number of them. terms_set query with minimum_should_match_script is a way to accomplish this. To make the query request more configurable, you can define min_actors_to_see as a script parameter.

To ensure that the parameter min_actors_to_see doesn’t exceed the number of favorite actors, you can use num_term`s to get the number of actors in the list and `Math.min to get the lesser of the two.

Math.min(params['num_terms'], params['min_actors_to_see'])

The following request finds seats to performances with at least two of the three specified actors.

GET seats/_search
{
    "query" : {
        "terms_set": {
            "actors" : {
                "terms" : ["smith", "earns", "black"],
                "minimum_should_match_script": {
                    "source": "Math.min(params['num_terms'], params['min_actors_to_see'])",
                    "params" : {
                        "min_actors_to_see" : 2
                    }
                }
            }
        }
    }
}

Metric aggregation initialization context

Use a Painless script to {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[initialize] values for use in a scripted metric aggregation. An initialization script is run prior to document collection once per shard and is optional as part of the full metric aggregation.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

state (Map)

Empty Map used to add values for use in a map script.

Side Effects

state (Map)

Add values to this Map to for use in a map. Additional values must be of the type Map, List, String or primitive.

Return

void

No expected return value.

API

The standard Painless API is available.

Metric aggregation map context

Use a Painless script to {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[map] values for use in a scripted metric aggregation. A map script is run once per collected document following an optional initialization script and is required as part of a full metric aggregation.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

state (Map)

Map used to add values for processing in a combine script or to be returned from the aggregation.

doc (Map, read-only)

Contains the fields of the current document where each field is a List of values.

_score (double read-only)

The similarity score of the current document.

Side Effects

state (Map)

Use this Map to add values for processing in a combine script. Additional values must be of the type Map, List, String or primitive. The same state Map is shared between all aggregated documents on a given shard. If an initialization script is provided as part of the aggregation then values added from the initialization script are available. If no combine script is specified, values must be directly stored in state in a usable form. If no combine script and no reduce script are specified, the state values are used as the result.

Return

void

No expected return value.

API

The standard Painless API is available.

Metric aggregation combine context

Use a Painless script to {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[combine] values for use in a scripted metric aggregation. A combine script is run once per shard following a map script and is optional as part of a full metric aggregation.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

state (Map)

Map with values available from the prior map script.

Return

List, Map, String, or primitive

A value collected for use in a reduce script. If no reduce script is specified, the value is used as part of the result.

API

The standard Painless API is available.

Metric aggregation reduce context

Use a Painless script to {ref}/search-aggregations-metrics-scripted-metric-aggregation.html[reduce] values to produce the result of a scripted metric aggregation. A reduce script is run once on the coordinating node following a combine script (or a map script if no combine script is specified) and is optional as part of a full metric aggregation.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

states (Map)

Map with values available from the prior combine script (or a map script if no combine script is specified).

Return

List, Map, String, or primitive

A value used as the result.

API

The standard Painless API is available.

Bucket script aggregation context

Use a Painless script in an {ref}/search-aggregations-pipeline-bucket-script-aggregation.html[bucket_script pipeline aggregation] to calculate a value as a result in a bucket.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query. The parameters include values defined as part of the buckets_path.

Return

numeric

The calculated value as the result.

API

The standard Painless API is available.

Example

To run this example, first follow the steps in context examples.

The painless context in a bucket_script aggregation provides a params map. This map contains both user-specified custom values, as well as the values from other aggregations specified in the buckets_path property.

This example takes the values from a min and max aggregation, calculates the difference, and adds the user-specified base_cost to the result:

(params.max - params.min) + params.base_cost

Note that the values are extracted from the params map. In context, the aggregation looks like this:

GET /seats/_search
{
  "size": 0,
  "aggs": {
    "theatres": {
      "terms": {
        "field": "theatre",
        "size": 10
      },
      "aggs": {
        "min_cost": {
          "min": {
            "field": "cost"
          }
        },
        "max_cost": {
          "max": {
            "field": "cost"
          }
        },
        "spread_plus_base": {
          "bucket_script": {
            "buckets_path": { (1)
              "min": "min_cost",
              "max": "max_cost"
            },
            "script": {
              "params": {
                "base_cost": 5 (2)
              },
              "source": "(params.max - params.min) + params.base_cost"
            }
          }
        }
      }
    }
  }
}
  1. The buckets_path points to two aggregations (min_cost, max_cost) and adds min/max variables to the params map

  2. The user-specified base_cost is also added to the script’s params map

Bucket selector aggregation context

Use a Painless script in an {ref}/search-aggregations-pipeline-bucket-selector-aggregation.html[bucket_selector aggregation] to determine if a bucket should be retained or filtered out.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query. The parameters include values defined as part of the buckets_path.

Return

boolean

True if the the bucket should be retained, false if the bucket should be filtered out.

API

To run this example, first follow the steps in context examples.

The painless context in a bucket_selector aggregation provides a params map. This map contains both user-specified custom values, as well as the values from other aggregations specified in the buckets_path property.

Unlike some other aggregation contexts, the bucket_selector context must return a boolean true or false.

This example finds the max of each bucket, adds a user-specified base_cost, and retains all of the buckets that are greater than 10.

params.max + params.base_cost > 10

Note that the values are extracted from the params map. The script is in the form of an expression that returns true or false. In context, the aggregation looks like this:

GET /seats/_search
{
  "size": 0,
  "aggs": {
    "theatres": {
      "terms": {
        "field": "theatre",
        "size": 10
      },
      "aggs": {
        "max_cost": {
          "max": {
            "field": "cost"
          }
        },
        "filtering_agg": {
          "bucket_selector": {
            "buckets_path": { (1)
              "max": "max_cost"
            },
            "script": {
              "params": {
                "base_cost": 5 (2)
              },
              "source": "params.max + params.base_cost > 10"
            }
          }
        }
      }
    }
  }
}
  1. The buckets_path points to the max aggregations (max_cost) and adds max variables to the params map

  2. The user-specified base_cost is also added to the params map

Analysis Predicate Context

Use a painless script to determine whether or not the current token in an analysis chain matches a predicate.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

token.term (CharSequence, read-only)

The characters of the current token

token.position (int, read-only)

The position of the current token

token.positionIncrement (int, read-only)

The position increment of the current token

token.positionLength (int, read-only)

The position length of the current token

token.startOffset (int, read-only)

The start offset of the current token

token.endOffset (int, read-only)

The end offset of the current token

token.type (String, read-only)

The type of the current token

token.keyword ('boolean`, read-only)

Whether or not the current token is marked as a keyword

Return

boolean

Whether or not the current token matches the predicate

API

The standard Painless API is available.

Watcher condition context

Use a Painless script as a {ref}/condition-script.html[watch condition] that determines whether to execute a watch or a particular action within a watch. Condition scripts return a Boolean value to indicate the status of the condition.

The following variables are available in all watcher contexts.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

ctx['watch_id'] (String, read-only)

The id of the watch.

ctx['id'] (String, read-only)

The server generated unique identifer for the run watch.

ctx['metadata'] (Map, read-only)

Metadata can be added to the top level of the watch definition. This is user defined and is typically used to consolidate duplicate values in a watch.

ctx['execution_time'] (ZonedDateTime, read-only)

The time the watch began execution.

ctx['trigger']['scheduled_time'] (ZonedDateTime, read-only)

The scheduled trigger time for the watch. This is the time the watch should be executed.

ctx['trigger']['triggered_time'] (ZonedDateTime, read-only)

The actual trigger time for the watch. This is the time the watch was triggered for execution.

ctx['payload'] (Map, read-only)

The accessible watch data based upon the {ref}/input.html[watch input].

API

The standard Painless API is available.

To run this example, first follow the steps in context examples.

Return

boolean

Expects true if the condition is met, and false if it is not.

API

The standard Painless API is available.

Example

POST _watcher/watch/_execute
{
  "watch" : {
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition" : {
      "script" :
      """
        return ctx.payload.aggregations.theatres.buckets.stream()       (1)
          .filter(theatre -> theatre.money.value < 15000 ||
                             theatre.money.value > 50000)               (2)
          .count() > 0                                                  (3)
      """
    },
    "actions" : {
      "my_log" : {
        "logging" : {
          "text" : "The output of the search was : {{ctx.payload.aggregations.theatres.buckets}}"
        }
      }
    }
  }
}
  1. The Java Stream API is used in the condition. This API allows manipulation of the elements of the list in a pipeline.

  2. The stream filter removes items that do not meet the filter criteria.

  3. If there is at least one item in the list, the condition evaluates to true and the watch is executed.

The following action condition script controls execution of the my_log action based on the value of the seats sold for the plays in the data set. The script aggregates the total sold seats for each play and returns true if there is at least one play that has sold over $50,000.

POST _watcher/watch/_execute
{
  "watch" : {
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "actions" : {
      "my_log" : {
        "condition": {                                                (1)
          "script" :
          """
            return ctx.payload.aggregations.theatres.buckets.stream()
              .anyMatch(theatre -> theatre.money.value > 50000)       (2)
          """
        },
        "logging" : {
          "text" : "At least one play has grossed over $50,000: {{ctx.payload.aggregations.theatres.buckets}}"
        }
      }
    }
  }
}

This example uses a nearly identical condition as the previous example. The differences below are subtle and are worth calling out.

  1. The location of the condition is no longer at the top level, but is within an individual action.

  2. Instead of a filter, anyMatch is used to return a boolean value

The following example shows scripted watch and action conditions within the context of a complete watch. This watch also uses a scripted transform.

POST _watcher/watch/_execute
{
  "watch" : {
    "metadata" : { "high_threshold": 50000, "low_threshold": 15000 },
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition" : {
      "script" :
      """
        return ctx.payload.aggregations.theatres.buckets.stream()
          .anyMatch(theatre -> theatre.money.value < ctx.metadata.low_threshold ||
                               theatre.money.value > ctx.metadata.high_threshold)
      """
    },
    "transform" : {
      "script":
      """
        return [
          'money_makers': ctx.payload.aggregations.theatres.buckets.stream()
            .filter(t -> {
                return t.money.value > ctx.metadata.high_threshold
            })
            .map(t -> {
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList()),
          'duds' : ctx.payload.aggregations.theatres.buckets.stream()
            .filter(t -> {
                return t.money.value < ctx.metadata.low_threshold
            })
            .map(t -> {
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList())
          ]
      """
    },
    "actions" : {
      "log_money_makers" : {
        "condition": {
          "script" : "return ctx.payload.money_makers.size() > 0"
        },
        "transform": {
          "script" :
          """
          def formatter = NumberFormat.getCurrencyInstance();
          return [
            'plays_value': ctx.payload.money_makers.stream()
              .map(t-> formatter.format(t.total_value) + ' for the play ' + t.play)
              .collect(Collectors.joining(", "))
          ]
          """
        },
        "logging" : {
          "text" : "The following plays contain the highest grossing total income: {{ctx.payload.plays_value}}"
        }
      },
      "log_duds" : {
        "condition": {
          "script" : "return ctx.payload.duds.size() > 0"
        },
        "transform": {
          "script" :
          """
          def formatter = NumberFormat.getCurrencyInstance();
          return [
            'plays_value': ctx.payload.duds.stream()
              .map(t-> formatter.format(t.total_value) + ' for the play ' + t.play)
              .collect(Collectors.joining(", "))
          ]
          """
        },
        "logging" : {
          "text" : "The following plays need more advertising due to their low total income: {{ctx.payload.plays_value}}"
        }
      }
    }
  }
}

The following example shows the use of metadata and transforming dates into a readable format.

POST _watcher/watch/_execute
{
  "watch" : {
    "metadata" : { "min_hits": 10000 },
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition" : {
      "script" :
      """
        return ctx.payload.hits.total > ctx.metadata.min_hits
      """
    },
    "transform" : {
      "script" :
      """
        def theDate = ZonedDateTime.ofInstant(ctx.execution_time.toInstant(), ctx.execution_time.getZone());
        return ['human_date': DateTimeFormatter.RFC_1123_DATE_TIME.format(theDate),
                'aggregations': ctx.payload.aggregations]
      """
    },
    "actions" : {
      "my_log" : {
        "logging" : {
          "text" : "The watch was successfully executed on {{ctx.payload.human_date}} and contained {{ctx.payload.aggregations.theatres.buckets.size}} buckets"
        }
      }
    }
  }
}

Watcher transform context

Use a Painless script as a {ref}/transform-script.html[watch transform] to transform a payload into a new payload for further use in the watch. Transform scripts return an Object value of the new payload.

The following variables are available in all watcher contexts.

Variables

params (Map, read-only)

User-defined parameters passed in as part of the query.

ctx['watch_id'] (String, read-only)

The id of the watch.

ctx['id'] (String, read-only)

The server generated unique identifer for the run watch.

ctx['metadata'] (Map, read-only)

Metadata can be added to the top level of the watch definition. This is user defined and is typically used to consolidate duplicate values in a watch.

ctx['execution_time'] (ZonedDateTime, read-only)

The time the watch began execution.

ctx['trigger']['scheduled_time'] (ZonedDateTime, read-only)

The scheduled trigger time for the watch. This is the time the watch should be executed.

ctx['trigger']['triggered_time'] (ZonedDateTime, read-only)

The actual trigger time for the watch. This is the time the watch was triggered for execution.

ctx['payload'] (Map, read-only)

The accessible watch data based upon the {ref}/input.html[watch input].

API

The standard Painless API is available.

To run this example, first follow the steps in context examples.

Return

Object

The new payload.

API

The standard Painless API is available.

Example

POST _watcher/watch/_execute
{
  "watch" : {
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : { "term": { "sold": "true"} },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "transform" : {
      "script":
      """
        return [
          'money_makers': ctx.payload.aggregations.theatres.buckets.stream()  (1)
            .filter(t -> {                                                    (2)
                return t.money.value > 50000
            })
            .map(t -> {                                                       (3)
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList()),                                  (4)
          'duds' : ctx.payload.aggregations.theatres.buckets.stream()         (5)
            .filter(t -> {
                return t.money.value < 15000
            })
            .map(t -> {
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList())
          ]
      """
    },
    "actions" : {
      "my_log" : {
        "logging" : {
          "text" : "The output of the payload was transformed to {{ctx.payload}}"
        }
      }
    }
  }
}
  1. The Java Stream API is used in the transform. This API allows manipulation of the elements of the list in a pipeline.

  2. The stream filter removes items that do not meet the filter criteria.

  3. The stream map transforms each element into a new object.

  4. The collector reduces the stream to a java.util.List.

  5. This is done again for the second set of values in the transform.

The following action transform changes each value in the mod_log action into a String. This transform does not change the values in the unmod_log action.

POST _watcher/watch/_execute
{
  "watch" : {
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "actions" : {
      "mod_log" : {
        "transform": {                                                                (1)
          "script" :
          """
          def formatter = NumberFormat.getCurrencyInstance();
          return [
            'msg': ctx.payload.aggregations.theatres.buckets.stream()
              .map(t-> formatter.format(t.money.value) + ' for the play ' + t.key)
              .collect(Collectors.joining(", "))
          ]
          """
        },
        "logging" : {
          "text" : "The output of the payload was transformed to: {{ctx.payload.msg}}"
        }
      },
      "unmod_log" : {                                                                 (2)
        "logging" : {
          "text" : "The output of the payload was not transformed and this value should not exist: {{ctx.payload.msg}}"
        }
      }
    }
  }
}

This example uses the streaming API in a very similar manner. The differences below are subtle and worth calling out.

  1. The location of the transform is no longer at the top level, but is within an individual action.

  2. A second action that does not transform the payload is given for reference.

The following example shows scripted watch and action transforms within the context of a complete watch. This watch also uses a scripted condition.

POST _watcher/watch/_execute
{
  "watch" : {
    "metadata" : { "high_threshold": 50000, "low_threshold": 15000 },
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition" : {
      "script" :
      """
        return ctx.payload.aggregations.theatres.buckets.stream()
          .anyMatch(theatre -> theatre.money.value < ctx.metadata.low_threshold ||
                               theatre.money.value > ctx.metadata.high_threshold)
      """
    },
    "transform" : {
      "script":
      """
        return [
          'money_makers': ctx.payload.aggregations.theatres.buckets.stream()
            .filter(t -> {
                return t.money.value > ctx.metadata.high_threshold
            })
            .map(t -> {
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList()),
          'duds' : ctx.payload.aggregations.theatres.buckets.stream()
            .filter(t -> {
                return t.money.value < ctx.metadata.low_threshold
            })
            .map(t -> {
                return ['play': t.key, 'total_value': t.money.value ]
            }).collect(Collectors.toList())
          ]
      """
    },
    "actions" : {
      "log_money_makers" : {
        "condition": {
          "script" : "return ctx.payload.money_makers.size() > 0"
        },
        "transform": {
          "script" :
          """
          def formatter = NumberFormat.getCurrencyInstance();
          return [
            'plays_value': ctx.payload.money_makers.stream()
              .map(t-> formatter.format(t.total_value) + ' for the play ' + t.play)
              .collect(Collectors.joining(", "))
          ]
          """
        },
        "logging" : {
          "text" : "The following plays contain the highest grossing total income: {{ctx.payload.plays_value}}"
        }
      },
      "log_duds" : {
        "condition": {
          "script" : "return ctx.payload.duds.size() > 0"
        },
        "transform": {
          "script" :
          """
          def formatter = NumberFormat.getCurrencyInstance();
          return [
            'plays_value': ctx.payload.duds.stream()
              .map(t-> formatter.format(t.total_value) + ' for the play ' + t.play)
              .collect(Collectors.joining(", "))
          ]
          """
        },
        "logging" : {
          "text" : "The following plays need more advertising due to their low total income: {{ctx.payload.plays_value}}"
        }
      }
    }
  }
}

The following example shows the use of metadata and transforming dates into a readable format.

POST _watcher/watch/_execute
{
  "watch" : {
    "metadata" : { "min_hits": 10000 },
    "trigger" : { "schedule" : { "interval" : "24h" } },
    "input" : {
      "search" : {
        "request" : {
          "indices" : [ "seats" ],
          "body" : {
            "query" : {
              "term": { "sold": "true"}
            },
            "aggs" : {
              "theatres" : {
                "terms" : { "field" : "play" },
                "aggs" : {
                  "money" : {
                    "sum": { "field" : "cost" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "condition" : {
      "script" :
      """
        return ctx.payload.hits.total > ctx.metadata.min_hits
      """
    },
    "transform" : {
      "script" :
      """
        def theDate = ZonedDateTime.ofInstant(ctx.execution_time.toInstant(), ctx.execution_time.getZone());
        return ['human_date': DateTimeFormatter.RFC_1123_DATE_TIME.format(theDate),
                'aggregations': ctx.payload.aggregations]
      """
    },
    "actions" : {
      "my_log" : {
        "logging" : {
          "text" : "The watch was successfully executed on {{ctx.payload.human_date}} and contained {{ctx.payload.aggregations.theatres.buckets.size}} buckets"
        }
      }
    }
  }
}

Painless API Reference

Painless has a strict whitelist for methods and classes to ensure all painless scripts are secure. Most of these methods are exposed directly from the Java Runtime Environment (JRE) while others are part of Elasticsearch or Painless itself. Below is a list of all available classes grouped with their respected methods. Clicking on the method name takes you to the documentation for that specific method. Methods defined in the JRE also have a (java 9) link which can be used to see the method’s documentation in Java 9.

AbstractChronology
  • Inherits methods from <<painless-api-reference-Chronology,Chronology>>

AbstractCollection
  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-Object,Object>>

AbstractList
  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-List,List>>, <<painless-api-reference-Object,Object>>

AbstractMap
  • Inherits methods from <<painless-api-reference-Map,Map>>, <<painless-api-reference-Object,Object>>

AbstractMap.SimpleEntry
  • [[painless-api-reference-AbstractMap-SimpleEntry-AbstractMap.SimpleEntry-1]]link:{java8-javadoc}/java/util/AbstractMap.SimpleEntry.html#AbstractMap.SimpleEntry%2Djava.util.Map$Entry%2D[AbstractMap.SimpleEntry](<<painless-api-reference-Map-Entry,Map.Entry>>) (java 9)

  • [[painless-api-reference-AbstractMap-SimpleEntry-AbstractMap.SimpleEntry-2]]link:{java8-javadoc}/java/util/AbstractMap.SimpleEntry.html#AbstractMap.SimpleEntry%2Djava.lang.Object%2Djava.lang.Object%2D[AbstractMap.SimpleEntry](def, def) (java 9)

  • Inherits methods from <<painless-api-reference-Map-Entry,Map.Entry>>, <<painless-api-reference-Object,Object>>

AbstractMap.SimpleImmutableEntry
  • [[painless-api-reference-AbstractMap-SimpleImmutableEntry-AbstractMap.SimpleImmutableEntry-1]]link:{java8-javadoc}/java/util/AbstractMap.SimpleImmutableEntry.html#AbstractMap.SimpleImmutableEntry%2Djava.util.Map$Entry%2D[AbstractMap.SimpleImmutableEntry](<<painless-api-reference-Map-Entry,Map.Entry>>) (java 9)

  • [[painless-api-reference-AbstractMap-SimpleImmutableEntry-AbstractMap.SimpleImmutableEntry-2]]link:{java8-javadoc}/java/util/AbstractMap.SimpleImmutableEntry.html#AbstractMap.SimpleImmutableEntry%2Djava.lang.Object%2Djava.lang.Object%2D[AbstractMap.SimpleImmutableEntry](def, def) (java 9)

  • Inherits methods from <<painless-api-reference-Map-Entry,Map.Entry>>, <<painless-api-reference-Object,Object>>

AbstractQueue
  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-Object,Object>>, <<painless-api-reference-Queue,Queue>>

AbstractSequentialList
  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-List,List>>, <<painless-api-reference-Object,Object>>

AbstractSet
  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-Object,Object>>, <<painless-api-reference-Set,Set>>

Annotation
  • [[painless-api-reference-Annotation-Annotation-1]]link:{java8-javadoc}/java/text/Annotation.html#Annotation%2Djava.lang.Object%2D[Annotation](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-Annotation-getValue-0]]def link:{java8-javadoc}/java/text/Annotation.html#getValue%2D%2D[getValue]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Appendable
  • [[painless-api-reference-Appendable-append-3]]<<painless-api-reference-Appendable,Appendable>> link:{java8-javadoc}/java/lang/Appendable.html#append%2Djava.lang.CharSequence%2Dint%2Dint%2D[append](<<painless-api-reference-CharSequence,CharSequence>>, int, int) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

ArithmeticException
  • [[painless-api-reference-ArithmeticException-ArithmeticException-0]]link:{java8-javadoc}/java/lang/ArithmeticException.html#ArithmeticException%2D%2D[ArithmeticException]() (java 9)

  • [[painless-api-reference-ArithmeticException-ArithmeticException-1]]link:{java8-javadoc}/java/lang/ArithmeticException.html#ArithmeticException%2Djava.lang.String%2D[ArithmeticException](<<painless-api-reference-String,String>>) (java 9)

  • Inherits methods from <<painless-api-reference-Exception,Exception>>, <<painless-api-reference-Object,Object>>

ArrayDeque
  • [[painless-api-reference-ArrayDeque-ArrayDeque-0]]link:{java8-javadoc}/java/util/ArrayDeque.html#ArrayDeque%2D%2D[ArrayDeque]() (java 9)

  • [[painless-api-reference-ArrayDeque-ArrayDeque-1]]link:{java8-javadoc}/java/util/ArrayDeque.html#ArrayDeque%2Djava.util.Collection%2D[ArrayDeque](<<painless-api-reference-Collection,Collection>>) (java 9)

  • [[painless-api-reference-ArrayDeque-clone-0]]<<painless-api-reference-ArrayDeque,ArrayDeque>> link:{java8-javadoc}/java/util/ArrayDeque.html#clone%2D%2D[clone]() (java 9)

  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Deque,Deque>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-Object,Object>>, <<painless-api-reference-Queue,Queue>>

ArrayIndexOutOfBoundsException
  • [[painless-api-reference-ArrayIndexOutOfBoundsException-ArrayIndexOutOfBoundsException-0]]link:{java8-javadoc}/java/lang/ArrayIndexOutOfBoundsException.html#ArrayIndexOutOfBoundsException%2D%2D[ArrayIndexOutOfBoundsException]() (java 9)

  • [[painless-api-reference-ArrayIndexOutOfBoundsException-ArrayIndexOutOfBoundsException-1]]link:{java8-javadoc}/java/lang/ArrayIndexOutOfBoundsException.html#ArrayIndexOutOfBoundsException%2Djava.lang.String%2D[ArrayIndexOutOfBoundsException](<<painless-api-reference-String,String>>) (java 9)

  • Inherits methods from <<painless-api-reference-Exception,Exception>>, <<painless-api-reference-Object,Object>>

ArrayList
  • [[painless-api-reference-ArrayList-ArrayList-0]]link:{java8-javadoc}/java/util/ArrayList.html#ArrayList%2D%2D[ArrayList]() (java 9)

  • [[painless-api-reference-ArrayList-ArrayList-1]]link:{java8-javadoc}/java/util/ArrayList.html#ArrayList%2Djava.util.Collection%2D[ArrayList](<<painless-api-reference-Collection,Collection>>) (java 9)

  • [[painless-api-reference-ArrayList-clone-0]]def link:{java8-javadoc}/java/util/ArrayList.html#clone%2D%2D[clone]() (java 9)

  • [[painless-api-reference-ArrayList-trimToSize-0]]void link:{java8-javadoc}/java/util/ArrayList.html#trimToSize%2D%2D[trimToSize]() (java 9)

  • Inherits methods from <<painless-api-reference-Collection,Collection>>, <<painless-api-reference-Iterable,Iterable>>, <<painless-api-reference-List,List>>, <<painless-api-reference-Object,Object>>

ArrayStoreException
  • [[painless-api-reference-ArrayStoreException-ArrayStoreException-0]]link:{java8-javadoc}/java/lang/ArrayStoreException.html#ArrayStoreException%2D%2D[ArrayStoreException]() (java 9)

  • [[painless-api-reference-ArrayStoreException-ArrayStoreException-1]]link:{java8-javadoc}/java/lang/ArrayStoreException.html#ArrayStoreException%2Djava.lang.String%2D[ArrayStoreException](<<painless-api-reference-String,String>>) (java 9)

  • Inherits methods from <<painless-api-reference-Exception,Exception>>, <<painless-api-reference-Object,Object>>

Arrays
  • [[painless-api-reference-Arrays-asList-1]]static <<painless-api-reference-List,List>> link:{java8-javadoc}/java/util/Arrays.html#asList%2Djava.lang.Object:A%2D[asList](<<painless-api-reference-Object,Object>>[]) (java 9)

  • [[painless-api-reference-Arrays-deepEquals-2]]static boolean link:{java8-javadoc}/java/util/Arrays.html#deepEquals%2Djava.lang.Object:A%2Djava.lang.Object:A%2D[deepEquals](<<painless-api-reference-Object,Object>>[], <<painless-api-reference-Object,Object>>[]) (java 9)

  • [[painless-api-reference-Arrays-deepHashCode-1]]static int link:{java8-javadoc}/java/util/Arrays.html#deepHashCode%2Djava.lang.Object:A%2D[deepHashCode](<<painless-api-reference-Object,Object>>[]) (java 9)

  • [[painless-api-reference-Arrays-deepToString-1]]static <<painless-api-reference-String,String>> link:{java8-javadoc}/java/util/Arrays.html#deepToString%2Djava.lang.Object:A%2D[deepToString](<<painless-api-reference-Object,Object>>[]) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

AttributedCharacterIterator
  • [[painless-api-reference-AttributedCharacterIterator-getAllAttributeKeys-0]]<<painless-api-reference-Set,Set>> link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getAllAttributeKeys%2D%2D[getAllAttributeKeys]() (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getAttribute-1]]def link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getAttribute%2Djava.text.AttributedCharacterIterator$Attribute%2D[getAttribute](<<painless-api-reference-AttributedCharacterIterator-Attribute,AttributedCharacterIterator.Attribute>>) (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getAttributes-0]]<<painless-api-reference-Map,Map>> link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getAttributes%2D%2D[getAttributes]() (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getRunLimit-0]]int link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getRunLimit%2D%2D[getRunLimit]() (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getRunLimit-1]]int link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getRunLimit%2Djava.util.Set%2D[getRunLimit](<<painless-api-reference-Set,Set>>) (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getRunStart-0]]int link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getRunStart%2D%2D[getRunStart]() (java 9)

  • [[painless-api-reference-AttributedCharacterIterator-getRunStart-1]]int link:{java8-javadoc}/java/text/AttributedCharacterIterator.html#getRunStart%2Djava.util.Set%2D[getRunStart](<<painless-api-reference-Set,Set>>) (java 9)

  • Inherits methods from <<painless-api-reference-CharacterIterator,CharacterIterator>>, <<painless-api-reference-Object,Object>>

AttributedCharacterIterator.Attribute
AttributedString
  • [[painless-api-reference-AttributedString-AttributedString-1]]link:{java8-javadoc}/java/text/AttributedString.html#AttributedString%2Djava.lang.String%2D[AttributedString](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-AttributedString-AttributedString-2]]link:{java8-javadoc}/java/text/AttributedString.html#AttributedString%2Djava.lang.String%2Djava.util.Map%2D[AttributedString](<<painless-api-reference-String,String>>, <<painless-api-reference-Map,Map>>) (java 9)

  • [[painless-api-reference-AttributedString-addAttribute-2]]void link:{java8-javadoc}/java/text/AttributedString.html#addAttribute%2Djava.text.AttributedCharacterIterator$Attribute%2Djava.lang.Object%2D[addAttribute](<<painless-api-reference-AttributedCharacterIterator-Attribute,AttributedCharacterIterator.Attribute>>, <<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-AttributedString-addAttribute-4]]void link:{java8-javadoc}/java/text/AttributedString.html#addAttribute%2Djava.text.AttributedCharacterIterator$Attribute%2Djava.lang.Object%2Dint%2Dint%2D[addAttribute](<<painless-api-reference-AttributedCharacterIterator-Attribute,AttributedCharacterIterator.Attribute>>, <<painless-api-reference-Object,Object>>, int, int) (java 9)

  • [[painless-api-reference-AttributedString-addAttributes-3]]void link:{java8-javadoc}/java/text/AttributedString.html#addAttributes%2Djava.util.Map%2Dint%2Dint%2D[addAttributes](<<painless-api-reference-Map,Map>>, int, int) (java 9)

  • [[painless-api-reference-AttributedString-getIterator-0]]<<painless-api-reference-AttributedCharacterIterator,AttributedCharacterIterator>> link:{java8-javadoc}/java/text/AttributedString.html#getIterator%2D%2D[getIterator]() (java 9)

  • [[painless-api-reference-AttributedString-getIterator-1]]<<painless-api-reference-AttributedCharacterIterator,AttributedCharacterIterator>> link:{java8-javadoc}/java/text/AttributedString.html#getIterator%2Djava.text.AttributedCharacterIterator$Attribute:A%2D[getIterator](<<painless-api-reference-AttributedCharacterIterator-Attribute,AttributedCharacterIterator.Attribute>>[]) (java 9)

  • [[painless-api-reference-AttributedString-getIterator-3]]<<painless-api-reference-AttributedCharacterIterator,AttributedCharacterIterator>> link:{java8-javadoc}/java/text/AttributedString.html#getIterator%2Djava.text.AttributedCharacterIterator$Attribute:A%2Dint%2Dint%2D[getIterator](<<painless-api-reference-AttributedCharacterIterator-Attribute,AttributedCharacterIterator.Attribute>>[], int, int) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Base64
  • [[painless-api-reference-Base64-getDecoder-0]]static <<painless-api-reference-Base64-Decoder,Base64.Decoder>> link:{java8-javadoc}/java/util/Base64.html#getDecoder%2D%2D[getDecoder]() (java 9)

  • [[painless-api-reference-Base64-getEncoder-0]]static <<painless-api-reference-Base64-Encoder,Base64.Encoder>> link:{java8-javadoc}/java/util/Base64.html#getEncoder%2D%2D[getEncoder]() (java 9)

  • [[painless-api-reference-Base64-getMimeDecoder-0]]static <<painless-api-reference-Base64-Decoder,Base64.Decoder>> link:{java8-javadoc}/java/util/Base64.html#getMimeDecoder%2D%2D[getMimeDecoder]() (java 9)

  • [[painless-api-reference-Base64-getMimeEncoder-0]]static <<painless-api-reference-Base64-Encoder,Base64.Encoder>> link:{java8-javadoc}/java/util/Base64.html#getMimeEncoder%2D%2D[getMimeEncoder]() (java 9)

  • [[painless-api-reference-Base64-getMimeEncoder-2]]static <<painless-api-reference-Base64-Encoder,Base64.Encoder>> link:{java8-javadoc}/java/util/Base64.html#getMimeEncoder%2Dint%2Dbyte:A%2D[getMimeEncoder](int, byte[]) (java 9)

  • [[painless-api-reference-Base64-getUrlDecoder-0]]static <<painless-api-reference-Base64-Decoder,Base64.Decoder>> link:{java8-javadoc}/java/util/Base64.html#getUrlDecoder%2D%2D[getUrlDecoder]() (java 9)

  • [[painless-api-reference-Base64-getUrlEncoder-0]]static <<painless-api-reference-Base64-Encoder,Base64.Encoder>> link:{java8-javadoc}/java/util/Base64.html#getUrlEncoder%2D%2D[getUrlEncoder]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Base64.Decoder
  • [[painless-api-reference-Base64-Decoder-decode-1]]byte[] link:{java8-javadoc}/java/util/Base64.Decoder.html#decode%2Djava.lang.String%2D[decode](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-Base64-Decoder-decode-2]]int link:{java8-javadoc}/java/util/Base64.Decoder.html#decode%2Dbyte:A%2Dbyte:A%2D[decode](byte[], byte[]) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Base64.Encoder
  • [[painless-api-reference-Base64-Encoder-encode-2]]int link:{java8-javadoc}/java/util/Base64.Encoder.html#encode%2Dbyte:A%2Dbyte:A%2D[encode](byte[], byte[]) (java 9)

  • [[painless-api-reference-Base64-Encoder-encodeToString-1]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/util/Base64.Encoder.html#encodeToString%2Dbyte:A%2D[encodeToString](byte[]) (java 9)

  • [[painless-api-reference-Base64-Encoder-withoutPadding-0]]<<painless-api-reference-Base64-Encoder,Base64.Encoder>> link:{java8-javadoc}/java/util/Base64.Encoder.html#withoutPadding%2D%2D[withoutPadding]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

BaseStream
  • [[painless-api-reference-BaseStream-close-0]]void link:{java8-javadoc}/java/util/stream/BaseStream.html#close%2D%2D[close]() (java 9)

  • [[painless-api-reference-BaseStream-isParallel-0]]boolean link:{java8-javadoc}/java/util/stream/BaseStream.html#isParallel%2D%2D[isParallel]() (java 9)

  • [[painless-api-reference-BaseStream-iterator-0]]<<painless-api-reference-Iterator,Iterator>> link:{java8-javadoc}/java/util/stream/BaseStream.html#iterator%2D%2D[iterator]() (java 9)

  • [[painless-api-reference-BaseStream-sequential-0]]<<painless-api-reference-BaseStream,BaseStream>> link:{java8-javadoc}/java/util/stream/BaseStream.html#sequential%2D%2D[sequential]() (java 9)

  • [[painless-api-reference-BaseStream-spliterator-0]]<<painless-api-reference-Spliterator,Spliterator>> link:{java8-javadoc}/java/util/stream/BaseStream.html#spliterator%2D%2D[spliterator]() (java 9)

  • [[painless-api-reference-BaseStream-unordered-0]]<<painless-api-reference-BaseStream,BaseStream>> link:{java8-javadoc}/java/util/stream/BaseStream.html#unordered%2D%2D[unordered]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

BiConsumer
  • [[painless-api-reference-BiConsumer-accept-2]]void link:{java8-javadoc}/java/util/function/BiConsumer.html#accept%2Djava.lang.Object%2Djava.lang.Object%2D[accept](def, def) (java 9)

  • [[painless-api-reference-BiConsumer-andThen-1]]<<painless-api-reference-BiConsumer,BiConsumer>> link:{java8-javadoc}/java/util/function/BiConsumer.html#andThen%2Djava.util.function.BiConsumer%2D[andThen](<<painless-api-reference-BiConsumer,BiConsumer>>) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

BiFunction
  • [[painless-api-reference-BiFunction-andThen-1]]<<painless-api-reference-BiFunction,BiFunction>> link:{java8-javadoc}/java/util/function/BiFunction.html#andThen%2Djava.util.function.Function%2D[andThen](<<painless-api-reference-Function,Function>>) (java 9)

  • [[painless-api-reference-BiFunction-apply-2]]def link:{java8-javadoc}/java/util/function/BiFunction.html#apply%2Djava.lang.Object%2Djava.lang.Object%2D[apply](def, def) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

BiPredicate
  • [[painless-api-reference-BiPredicate-and-1]]<<painless-api-reference-BiPredicate,BiPredicate>> link:{java8-javadoc}/java/util/function/BiPredicate.html#and%2Djava.util.function.BiPredicate%2D[and](<<painless-api-reference-BiPredicate,BiPredicate>>) (java 9)

  • [[painless-api-reference-BiPredicate-negate-0]]<<painless-api-reference-BiPredicate,BiPredicate>> link:{java8-javadoc}/java/util/function/BiPredicate.html#negate%2D%2D[negate]() (java 9)

  • [[painless-api-reference-BiPredicate-or-1]]<<painless-api-reference-BiPredicate,BiPredicate>> link:{java8-javadoc}/java/util/function/BiPredicate.html#or%2Djava.util.function.BiPredicate%2D[or](<<painless-api-reference-BiPredicate,BiPredicate>>) (java 9)

  • [[painless-api-reference-BiPredicate-test-2]]boolean link:{java8-javadoc}/java/util/function/BiPredicate.html#test%2Djava.lang.Object%2Djava.lang.Object%2D[test](def, def) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Bidi
  • static int DIRECTION_DEFAULT_LEFT_TO_RIGHT (java 9)

  • static int DIRECTION_DEFAULT_RIGHT_TO_LEFT (java 9)

  • static int DIRECTION_LEFT_TO_RIGHT (java 9)

  • static int DIRECTION_RIGHT_TO_LEFT (java 9)

    • [[painless-api-reference-Bidi-reorderVisually-5]]static void link:{java8-javadoc}/java/text/Bidi.html#reorderVisually%2Dbyte:A%2Dint%2Djava.lang.Object:A%2Dint%2Dint%2D[reorderVisually](byte[], int, <<painless-api-reference-Object,Object>>[], int, int) (java 9)

    • [[painless-api-reference-Bidi-requiresBidi-3]]static boolean link:{java8-javadoc}/java/text/Bidi.html#requiresBidi%2Dchar:A%2Dint%2Dint%2D[requiresBidi](char[], int, int) (java 9)

    • [[painless-api-reference-Bidi-Bidi-1]]link:{java8-javadoc}/java/text/Bidi.html#Bidi%2Djava.text.AttributedCharacterIterator%2D[Bidi](<<painless-api-reference-AttributedCharacterIterator,AttributedCharacterIterator>>) (java 9)

    • [[painless-api-reference-Bidi-Bidi-2]]link:{java8-javadoc}/java/text/Bidi.html#Bidi%2Djava.lang.String%2Dint%2D[Bidi](<<painless-api-reference-String,String>>, int) (java 9)

    • [[painless-api-reference-Bidi-Bidi-6]]link:{java8-javadoc}/java/text/Bidi.html#Bidi%2Dchar:A%2Dint%2Dbyte:A%2Dint%2Dint%2Dint%2D[Bidi](char[], int, byte[], int, int, int) (java 9)

    • [[painless-api-reference-Bidi-baseIsLeftToRight-0]]boolean link:{java8-javadoc}/java/text/Bidi.html#baseIsLeftToRight%2D%2D[baseIsLeftToRight]() (java 9)

    • [[painless-api-reference-Bidi-createLineBidi-2]]<<painless-api-reference-Bidi,Bidi>> link:{java8-javadoc}/java/text/Bidi.html#createLineBidi%2Dint%2Dint%2D[createLineBidi](int, int) (java 9)

    • [[painless-api-reference-Bidi-getBaseLevel-0]]int link:{java8-javadoc}/java/text/Bidi.html#getBaseLevel%2D%2D[getBaseLevel]() (java 9)

    • [[painless-api-reference-Bidi-getLength-0]]int link:{java8-javadoc}/java/text/Bidi.html#getLength%2D%2D[getLength]() (java 9)

    • [[painless-api-reference-Bidi-getLevelAt-1]]int link:{java8-javadoc}/java/text/Bidi.html#getLevelAt%2Dint%2D[getLevelAt](int) (java 9)

    • [[painless-api-reference-Bidi-getRunCount-0]]int link:{java8-javadoc}/java/text/Bidi.html#getRunCount%2D%2D[getRunCount]() (java 9)

    • [[painless-api-reference-Bidi-getRunLevel-1]]int link:{java8-javadoc}/java/text/Bidi.html#getRunLevel%2Dint%2D[getRunLevel](int) (java 9)

    • [[painless-api-reference-Bidi-getRunLimit-1]]int link:{java8-javadoc}/java/text/Bidi.html#getRunLimit%2Dint%2D[getRunLimit](int) (java 9)

    • [[painless-api-reference-Bidi-getRunStart-1]]int link:{java8-javadoc}/java/text/Bidi.html#getRunStart%2Dint%2D[getRunStart](int) (java 9)

    • [[painless-api-reference-Bidi-isLeftToRight-0]]boolean link:{java8-javadoc}/java/text/Bidi.html#isLeftToRight%2D%2D[isLeftToRight]() (java 9)

    • [[painless-api-reference-Bidi-isMixed-0]]boolean link:{java8-javadoc}/java/text/Bidi.html#isMixed%2D%2D[isMixed]() (java 9)

    • [[painless-api-reference-Bidi-isRightToLeft-0]]boolean link:{java8-javadoc}/java/text/Bidi.html#isRightToLeft%2D%2D[isRightToLeft]() (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

BigDecimal
  • static BigDecimal ONE (java 9)

  • static BigDecimal TEN (java 9)

  • static BigDecimal ZERO (java 9)

    • [[painless-api-reference-BigDecimal-valueOf-1]]static <<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#valueOf%2Ddouble%2D[valueOf](double) (java 9)

    • [[painless-api-reference-BigDecimal-BigDecimal-1]]link:{java8-javadoc}/java/math/BigDecimal.html#BigDecimal%2Djava.lang.String%2D[BigDecimal](<<painless-api-reference-String,String>>) (java 9)

    • [[painless-api-reference-BigDecimal-BigDecimal-2]]link:{java8-javadoc}/java/math/BigDecimal.html#BigDecimal%2Djava.lang.String%2Djava.math.MathContext%2D[BigDecimal](<<painless-api-reference-String,String>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-abs-0]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#abs%2D%2D[abs]() (java 9)

    • [[painless-api-reference-BigDecimal-abs-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#abs%2Djava.math.MathContext%2D[abs](<<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-add-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#add%2Djava.math.BigDecimal%2D[add](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-add-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#add%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[add](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-byteValueExact-0]]byte link:{java8-javadoc}/java/math/BigDecimal.html#byteValueExact%2D%2D[byteValueExact]() (java 9)

    • [[painless-api-reference-BigDecimal-compareTo-1]]int link:{java8-javadoc}/java/math/BigDecimal.html#compareTo%2Djava.math.BigDecimal%2D[compareTo](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-divide-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#divide%2Djava.math.BigDecimal%2D[divide](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-divide-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#divide%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[divide](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-divideAndRemainder-1]]<<painless-api-reference-BigDecimal,BigDecimal>>[] link:{java8-javadoc}/java/math/BigDecimal.html#divideAndRemainder%2Djava.math.BigDecimal%2D[divideAndRemainder](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-divideAndRemainder-2]]<<painless-api-reference-BigDecimal,BigDecimal>>[] link:{java8-javadoc}/java/math/BigDecimal.html#divideAndRemainder%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[divideAndRemainder](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-divideToIntegralValue-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#divideToIntegralValue%2Djava.math.BigDecimal%2D[divideToIntegralValue](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-divideToIntegralValue-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#divideToIntegralValue%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[divideToIntegralValue](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-intValueExact-0]]int link:{java8-javadoc}/java/math/BigDecimal.html#intValueExact%2D%2D[intValueExact]() (java 9)

    • [[painless-api-reference-BigDecimal-longValueExact-0]]long link:{java8-javadoc}/java/math/BigDecimal.html#longValueExact%2D%2D[longValueExact]() (java 9)

    • [[painless-api-reference-BigDecimal-max-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#max%2Djava.math.BigDecimal%2D[max](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-min-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#min%2Djava.math.BigDecimal%2D[min](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-movePointLeft-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#movePointLeft%2Dint%2D[movePointLeft](int) (java 9)

    • [[painless-api-reference-BigDecimal-movePointRight-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#movePointRight%2Dint%2D[movePointRight](int) (java 9)

    • [[painless-api-reference-BigDecimal-multiply-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#multiply%2Djava.math.BigDecimal%2D[multiply](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-multiply-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#multiply%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[multiply](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-negate-0]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#negate%2D%2D[negate]() (java 9)

    • [[painless-api-reference-BigDecimal-negate-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#negate%2Djava.math.MathContext%2D[negate](<<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-plus-0]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#plus%2D%2D[plus]() (java 9)

    • [[painless-api-reference-BigDecimal-plus-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#plus%2Djava.math.MathContext%2D[plus](<<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-pow-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#pow%2Dint%2D[pow](int) (java 9)

    • [[painless-api-reference-BigDecimal-pow-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#pow%2Dint%2Djava.math.MathContext%2D[pow](int, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-precision-0]]int link:{java8-javadoc}/java/math/BigDecimal.html#precision%2D%2D[precision]() (java 9)

    • [[painless-api-reference-BigDecimal-remainder-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#remainder%2Djava.math.BigDecimal%2D[remainder](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-remainder-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#remainder%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[remainder](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-round-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#round%2Djava.math.MathContext%2D[round](<<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-scale-0]]int link:{java8-javadoc}/java/math/BigDecimal.html#scale%2D%2D[scale]() (java 9)

    • [[painless-api-reference-BigDecimal-scaleByPowerOfTen-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#scaleByPowerOfTen%2Dint%2D[scaleByPowerOfTen](int) (java 9)

    • [[painless-api-reference-BigDecimal-setScale-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#setScale%2Dint%2D[setScale](int) (java 9)

    • [[painless-api-reference-BigDecimal-setScale-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#setScale%2Dint%2Djava.math.RoundingMode%2D[setScale](int, <<painless-api-reference-RoundingMode,RoundingMode>>) (java 9)

    • [[painless-api-reference-BigDecimal-shortValueExact-0]]short link:{java8-javadoc}/java/math/BigDecimal.html#shortValueExact%2D%2D[shortValueExact]() (java 9)

    • [[painless-api-reference-BigDecimal-signum-0]]int link:{java8-javadoc}/java/math/BigDecimal.html#signum%2D%2D[signum]() (java 9)

    • [[painless-api-reference-BigDecimal-stripTrailingZeros-0]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#stripTrailingZeros%2D%2D[stripTrailingZeros]() (java 9)

    • [[painless-api-reference-BigDecimal-subtract-1]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#subtract%2Djava.math.BigDecimal%2D[subtract](<<painless-api-reference-BigDecimal,BigDecimal>>) (java 9)

    • [[painless-api-reference-BigDecimal-subtract-2]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#subtract%2Djava.math.BigDecimal%2Djava.math.MathContext%2D[subtract](<<painless-api-reference-BigDecimal,BigDecimal>>, <<painless-api-reference-MathContext,MathContext>>) (java 9)

    • [[painless-api-reference-BigDecimal-toBigInteger-0]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigDecimal.html#toBigInteger%2D%2D[toBigInteger]() (java 9)

    • [[painless-api-reference-BigDecimal-toBigIntegerExact-0]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigDecimal.html#toBigIntegerExact%2D%2D[toBigIntegerExact]() (java 9)

    • [[painless-api-reference-BigDecimal-toEngineeringString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/math/BigDecimal.html#toEngineeringString%2D%2D[toEngineeringString]() (java 9)

    • [[painless-api-reference-BigDecimal-toPlainString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/math/BigDecimal.html#toPlainString%2D%2D[toPlainString]() (java 9)

    • [[painless-api-reference-BigDecimal-ulp-0]]<<painless-api-reference-BigDecimal,BigDecimal>> link:{java8-javadoc}/java/math/BigDecimal.html#ulp%2D%2D[ulp]() (java 9)

    • Inherits methods from <<painless-api-reference-Number,Number>>, <<painless-api-reference-Object,Object>>

BigInteger
  • static BigInteger ONE (java 9)

  • static BigInteger TEN (java 9)

  • static BigInteger ZERO (java 9)

    • [[painless-api-reference-BigInteger-valueOf-1]]static <<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#valueOf%2Dlong%2D[valueOf](long) (java 9)

    • [[painless-api-reference-BigInteger-BigInteger-1]]link:{java8-javadoc}/java/math/BigInteger.html#BigInteger%2Djava.lang.String%2D[BigInteger](<<painless-api-reference-String,String>>) (java 9)

    • [[painless-api-reference-BigInteger-BigInteger-2]]link:{java8-javadoc}/java/math/BigInteger.html#BigInteger%2Djava.lang.String%2Dint%2D[BigInteger](<<painless-api-reference-String,String>>, int) (java 9)

    • [[painless-api-reference-BigInteger-abs-0]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#abs%2D%2D[abs]() (java 9)

    • [[painless-api-reference-BigInteger-add-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#add%2Djava.math.BigInteger%2D[add](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-and-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#and%2Djava.math.BigInteger%2D[and](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-andNot-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#andNot%2Djava.math.BigInteger%2D[andNot](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-bitCount-0]]int link:{java8-javadoc}/java/math/BigInteger.html#bitCount%2D%2D[bitCount]() (java 9)

    • [[painless-api-reference-BigInteger-bitLength-0]]int link:{java8-javadoc}/java/math/BigInteger.html#bitLength%2D%2D[bitLength]() (java 9)

    • [[painless-api-reference-BigInteger-byteValueExact-0]]byte link:{java8-javadoc}/java/math/BigInteger.html#byteValueExact%2D%2D[byteValueExact]() (java 9)

    • [[painless-api-reference-BigInteger-clearBit-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#clearBit%2Dint%2D[clearBit](int) (java 9)

    • [[painless-api-reference-BigInteger-compareTo-1]]int link:{java8-javadoc}/java/math/BigInteger.html#compareTo%2Djava.math.BigInteger%2D[compareTo](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-divide-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#divide%2Djava.math.BigInteger%2D[divide](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-divideAndRemainder-1]]<<painless-api-reference-BigInteger,BigInteger>>[] link:{java8-javadoc}/java/math/BigInteger.html#divideAndRemainder%2Djava.math.BigInteger%2D[divideAndRemainder](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-flipBit-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#flipBit%2Dint%2D[flipBit](int) (java 9)

    • [[painless-api-reference-BigInteger-gcd-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#gcd%2Djava.math.BigInteger%2D[gcd](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-getLowestSetBit-0]]int link:{java8-javadoc}/java/math/BigInteger.html#getLowestSetBit%2D%2D[getLowestSetBit]() (java 9)

    • [[painless-api-reference-BigInteger-intValueExact-0]]int link:{java8-javadoc}/java/math/BigInteger.html#intValueExact%2D%2D[intValueExact]() (java 9)

    • [[painless-api-reference-BigInteger-longValueExact-0]]long link:{java8-javadoc}/java/math/BigInteger.html#longValueExact%2D%2D[longValueExact]() (java 9)

    • [[painless-api-reference-BigInteger-max-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#max%2Djava.math.BigInteger%2D[max](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-min-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#min%2Djava.math.BigInteger%2D[min](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-mod-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#mod%2Djava.math.BigInteger%2D[mod](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-modInverse-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#modInverse%2Djava.math.BigInteger%2D[modInverse](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-modPow-2]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#modPow%2Djava.math.BigInteger%2Djava.math.BigInteger%2D[modPow](<<painless-api-reference-BigInteger,BigInteger>>, <<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-multiply-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#multiply%2Djava.math.BigInteger%2D[multiply](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-negate-0]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#negate%2D%2D[negate]() (java 9)

    • [[painless-api-reference-BigInteger-not-0]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#not%2D%2D[not]() (java 9)

    • [[painless-api-reference-BigInteger-or-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#or%2Djava.math.BigInteger%2D[or](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-pow-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#pow%2Dint%2D[pow](int) (java 9)

    • [[painless-api-reference-BigInteger-remainder-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#remainder%2Djava.math.BigInteger%2D[remainder](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-setBit-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#setBit%2Dint%2D[setBit](int) (java 9)

    • [[painless-api-reference-BigInteger-shiftLeft-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#shiftLeft%2Dint%2D[shiftLeft](int) (java 9)

    • [[painless-api-reference-BigInteger-shiftRight-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#shiftRight%2Dint%2D[shiftRight](int) (java 9)

    • [[painless-api-reference-BigInteger-shortValueExact-0]]short link:{java8-javadoc}/java/math/BigInteger.html#shortValueExact%2D%2D[shortValueExact]() (java 9)

    • [[painless-api-reference-BigInteger-signum-0]]int link:{java8-javadoc}/java/math/BigInteger.html#signum%2D%2D[signum]() (java 9)

    • [[painless-api-reference-BigInteger-subtract-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#subtract%2Djava.math.BigInteger%2D[subtract](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • [[painless-api-reference-BigInteger-testBit-1]]boolean link:{java8-javadoc}/java/math/BigInteger.html#testBit%2Dint%2D[testBit](int) (java 9)

    • [[painless-api-reference-BigInteger-toByteArray-0]]byte[] link:{java8-javadoc}/java/math/BigInteger.html#toByteArray%2D%2D[toByteArray]() (java 9)

    • [[painless-api-reference-BigInteger-toString-1]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/math/BigInteger.html#toString%2Dint%2D[toString](int) (java 9)

    • [[painless-api-reference-BigInteger-xor-1]]<<painless-api-reference-BigInteger,BigInteger>> link:{java8-javadoc}/java/math/BigInteger.html#xor%2Djava.math.BigInteger%2D[xor](<<painless-api-reference-BigInteger,BigInteger>>) (java 9)

    • Inherits methods from <<painless-api-reference-Number,Number>>, <<painless-api-reference-Object,Object>>

BinaryOperator
  • [[painless-api-reference-BinaryOperator-maxBy-1]]static <<painless-api-reference-BinaryOperator,BinaryOperator>> link:{java8-javadoc}/java/util/function/BinaryOperator.html#maxBy%2Djava.util.Comparator%2D[maxBy](<<painless-api-reference-Comparator,Comparator>>) (java 9)

  • [[painless-api-reference-BinaryOperator-minBy-1]]static <<painless-api-reference-BinaryOperator,BinaryOperator>> link:{java8-javadoc}/java/util/function/BinaryOperator.html#minBy%2Djava.util.Comparator%2D[minBy](<<painless-api-reference-Comparator,Comparator>>) (java 9)

  • Inherits methods from <<painless-api-reference-BiFunction,BiFunction>>, <<painless-api-reference-Object,Object>>

BitSet
  • [[painless-api-reference-BitSet-valueOf-1]]static <<painless-api-reference-BitSet,BitSet>> link:{java8-javadoc}/java/util/BitSet.html#valueOf%2Dlong:A%2D[valueOf](long[]) (java 9)

  • [[painless-api-reference-BitSet-BitSet-0]]link:{java8-javadoc}/java/util/BitSet.html#BitSet%2D%2D[BitSet]() (java 9)

  • [[painless-api-reference-BitSet-BitSet-1]]link:{java8-javadoc}/java/util/BitSet.html#BitSet%2Dint%2D[BitSet](int) (java 9)

  • [[painless-api-reference-BitSet-and-1]]void link:{java8-javadoc}/java/util/BitSet.html#and%2Djava.util.BitSet%2D[and](<<painless-api-reference-BitSet,BitSet>>) (java 9)

  • [[painless-api-reference-BitSet-andNot-1]]void link:{java8-javadoc}/java/util/BitSet.html#andNot%2Djava.util.BitSet%2D[andNot](<<painless-api-reference-BitSet,BitSet>>) (java 9)

  • [[painless-api-reference-BitSet-cardinality-0]]int link:{java8-javadoc}/java/util/BitSet.html#cardinality%2D%2D[cardinality]() (java 9)

  • [[painless-api-reference-BitSet-clear-0]]void link:{java8-javadoc}/java/util/BitSet.html#clear%2D%2D[clear]() (java 9)

  • [[painless-api-reference-BitSet-clear-1]]void link:{java8-javadoc}/java/util/BitSet.html#clear%2Dint%2D[clear](int) (java 9)

  • [[painless-api-reference-BitSet-clear-2]]void link:{java8-javadoc}/java/util/BitSet.html#clear%2Dint%2Dint%2D[clear](int, int) (java 9)

  • [[painless-api-reference-BitSet-clone-0]]def link:{java8-javadoc}/java/util/BitSet.html#clone%2D%2D[clone]() (java 9)

  • [[painless-api-reference-BitSet-flip-1]]void link:{java8-javadoc}/java/util/BitSet.html#flip%2Dint%2D[flip](int) (java 9)

  • [[painless-api-reference-BitSet-flip-2]]void link:{java8-javadoc}/java/util/BitSet.html#flip%2Dint%2Dint%2D[flip](int, int) (java 9)

  • [[painless-api-reference-BitSet-intersects-1]]boolean link:{java8-javadoc}/java/util/BitSet.html#intersects%2Djava.util.BitSet%2D[intersects](<<painless-api-reference-BitSet,BitSet>>) (java 9)

  • [[painless-api-reference-BitSet-isEmpty-0]]boolean link:{java8-javadoc}/java/util/BitSet.html#isEmpty%2D%2D[isEmpty]() (java 9)

  • [[painless-api-reference-BitSet-length-0]]int link:{java8-javadoc}/java/util/BitSet.html#length%2D%2D[length]() (java 9)

  • [[painless-api-reference-BitSet-nextClearBit-1]]int link:{java8-javadoc}/java/util/BitSet.html#nextClearBit%2Dint%2D[nextClearBit](int) (java 9)

  • [[painless-api-reference-BitSet-nextSetBit-1]]int link:{java8-javadoc}/java/util/BitSet.html#nextSetBit%2Dint%2D[nextSetBit](int) (java 9)

  • [[painless-api-reference-BitSet-or-1]]void link:{java8-javadoc}/java/util/BitSet.html#or%2Djava.util.BitSet%2D[or](<<painless-api-reference-BitSet,BitSet>>) (java 9)

  • [[painless-api-reference-BitSet-previousClearBit-1]]int link:{java8-javadoc}/java/util/BitSet.html#previousClearBit%2Dint%2D[previousClearBit](int) (java 9)

  • [[painless-api-reference-BitSet-previousSetBit-1]]int link:{java8-javadoc}/java/util/BitSet.html#previousSetBit%2Dint%2D[previousSetBit](int) (java 9)

  • [[painless-api-reference-BitSet-set-1]]void link:{java8-javadoc}/java/util/BitSet.html#set%2Dint%2D[set](int) (java 9)

  • [[painless-api-reference-BitSet-set-2]]void link:{java8-javadoc}/java/util/BitSet.html#set%2Dint%2Dint%2D[set](int, int) (java 9)

  • [[painless-api-reference-BitSet-set-3]]void link:{java8-javadoc}/java/util/BitSet.html#set%2Dint%2Dint%2Dboolean%2D[set](int, int, boolean) (java 9)

  • [[painless-api-reference-BitSet-size-0]]int link:{java8-javadoc}/java/util/BitSet.html#size%2D%2D[size]() (java 9)

  • [[painless-api-reference-BitSet-toByteArray-0]]byte[] link:{java8-javadoc}/java/util/BitSet.html#toByteArray%2D%2D[toByteArray]() (java 9)

  • [[painless-api-reference-BitSet-toLongArray-0]]long[] link:{java8-javadoc}/java/util/BitSet.html#toLongArray%2D%2D[toLongArray]() (java 9)

  • [[painless-api-reference-BitSet-xor-1]]void link:{java8-javadoc}/java/util/BitSet.html#xor%2Djava.util.BitSet%2D[xor](<<painless-api-reference-BitSet,BitSet>>) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Boolean
  • static Boolean FALSE (java 9)

  • static Boolean TRUE (java 9)

    • [[painless-api-reference-Boolean-compare-2]]static int link:{java8-javadoc}/java/lang/Boolean.html#compare%2Dboolean%2Dboolean%2D[compare](boolean, boolean) (java 9)

    • [[painless-api-reference-Boolean-hashCode-1]]static int link:{java8-javadoc}/java/lang/Boolean.html#hashCode%2Dboolean%2D[hashCode](boolean) (java 9)

    • [[painless-api-reference-Boolean-logicalAnd-2]]static boolean link:{java8-javadoc}/java/lang/Boolean.html#logicalAnd%2Dboolean%2Dboolean%2D[logicalAnd](boolean, boolean) (java 9)

    • [[painless-api-reference-Boolean-logicalOr-2]]static boolean link:{java8-javadoc}/java/lang/Boolean.html#logicalOr%2Dboolean%2Dboolean%2D[logicalOr](boolean, boolean) (java 9)

    • [[painless-api-reference-Boolean-logicalXor-2]]static boolean link:{java8-javadoc}/java/lang/Boolean.html#logicalXor%2Dboolean%2Dboolean%2D[logicalXor](boolean, boolean) (java 9)

    • [[painless-api-reference-Boolean-parseBoolean-1]]static boolean link:{java8-javadoc}/java/lang/Boolean.html#parseBoolean%2Djava.lang.String%2D[parseBoolean](<<painless-api-reference-String,String>>) (java 9)

    • [[painless-api-reference-Boolean-toString-1]]static <<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/Boolean.html#toString%2Dboolean%2D[toString](boolean) (java 9)

    • [[painless-api-reference-Boolean-valueOf-1]]static <<painless-api-reference-Boolean,Boolean>> link:{java8-javadoc}/java/lang/Boolean.html#valueOf%2Dboolean%2D[valueOf](boolean) (java 9)

    • [[painless-api-reference-Boolean-booleanValue-0]]boolean link:{java8-javadoc}/java/lang/Boolean.html#booleanValue%2D%2D[booleanValue]() (java 9)

    • [[painless-api-reference-Boolean-compareTo-1]]int link:{java8-javadoc}/java/lang/Boolean.html#compareTo%2Djava.lang.Boolean%2D[compareTo](<<painless-api-reference-Boolean,Boolean>>) (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

BooleanSupplier
  • [[painless-api-reference-BooleanSupplier-getAsBoolean-0]]boolean link:{java8-javadoc}/java/util/function/BooleanSupplier.html#getAsBoolean%2D%2D[getAsBoolean]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

BreakIterator
  • static int DONE (java 9)

    • [[painless-api-reference-BreakIterator-getAvailableLocales-0]]static <<painless-api-reference-Locale,Locale>>[] link:{java8-javadoc}/java/text/BreakIterator.html#getAvailableLocales%2D%2D[getAvailableLocales]() (java 9)

    • [[painless-api-reference-BreakIterator-getCharacterInstance-0]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getCharacterInstance%2D%2D[getCharacterInstance]() (java 9)

    • [[painless-api-reference-BreakIterator-getCharacterInstance-1]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getCharacterInstance%2Djava.util.Locale%2D[getCharacterInstance](<<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-BreakIterator-getLineInstance-0]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getLineInstance%2D%2D[getLineInstance]() (java 9)

    • [[painless-api-reference-BreakIterator-getLineInstance-1]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getLineInstance%2Djava.util.Locale%2D[getLineInstance](<<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-BreakIterator-getSentenceInstance-0]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getSentenceInstance%2D%2D[getSentenceInstance]() (java 9)

    • [[painless-api-reference-BreakIterator-getSentenceInstance-1]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getSentenceInstance%2Djava.util.Locale%2D[getSentenceInstance](<<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-BreakIterator-getWordInstance-0]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getWordInstance%2D%2D[getWordInstance]() (java 9)

    • [[painless-api-reference-BreakIterator-getWordInstance-1]]static <<painless-api-reference-BreakIterator,BreakIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getWordInstance%2Djava.util.Locale%2D[getWordInstance](<<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-BreakIterator-clone-0]]def link:{java8-javadoc}/java/text/BreakIterator.html#clone%2D%2D[clone]() (java 9)

    • [[painless-api-reference-BreakIterator-current-0]]int link:{java8-javadoc}/java/text/BreakIterator.html#current%2D%2D[current]() (java 9)

    • [[painless-api-reference-BreakIterator-first-0]]int link:{java8-javadoc}/java/text/BreakIterator.html#first%2D%2D[first]() (java 9)

    • [[painless-api-reference-BreakIterator-following-1]]int link:{java8-javadoc}/java/text/BreakIterator.html#following%2Dint%2D[following](int) (java 9)

    • [[painless-api-reference-BreakIterator-getText-0]]<<painless-api-reference-CharacterIterator,CharacterIterator>> link:{java8-javadoc}/java/text/BreakIterator.html#getText%2D%2D[getText]() (java 9)

    • [[painless-api-reference-BreakIterator-isBoundary-1]]boolean link:{java8-javadoc}/java/text/BreakIterator.html#isBoundary%2Dint%2D[isBoundary](int) (java 9)

    • [[painless-api-reference-BreakIterator-last-0]]int link:{java8-javadoc}/java/text/BreakIterator.html#last%2D%2D[last]() (java 9)

    • [[painless-api-reference-BreakIterator-next-0]]int link:{java8-javadoc}/java/text/BreakIterator.html#next%2D%2D[next]() (java 9)

    • [[painless-api-reference-BreakIterator-next-1]]int link:{java8-javadoc}/java/text/BreakIterator.html#next%2Dint%2D[next](int) (java 9)

    • [[painless-api-reference-BreakIterator-preceding-1]]int link:{java8-javadoc}/java/text/BreakIterator.html#preceding%2Dint%2D[preceding](int) (java 9)

    • [[painless-api-reference-BreakIterator-previous-0]]int link:{java8-javadoc}/java/text/BreakIterator.html#previous%2D%2D[previous]() (java 9)

    • [[painless-api-reference-BreakIterator-setText-1]]void link:{java8-javadoc}/java/text/BreakIterator.html#setText%2Djava.lang.String%2D[setText](<<painless-api-reference-String,String>>) (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

Byte
  • static int BYTES (java 9)

  • static byte MAX_VALUE (java 9)

  • static byte MIN_VALUE (java 9)

  • static int SIZE (java 9)

    • [[painless-api-reference-Byte-compare-2]]static int link:{java8-javadoc}/java/lang/Byte.html#compare%2Dbyte%2Dbyte%2D[compare](byte, byte) (java 9)

    • [[painless-api-reference-Byte-decode-1]]static <<painless-api-reference-Byte,Byte>> link:{java8-javadoc}/java/lang/Byte.html#decode%2Djava.lang.String%2D[decode](<<painless-api-reference-String,String>>) (java 9)

    • [[painless-api-reference-Byte-hashCode-1]]static int link:{java8-javadoc}/java/lang/Byte.html#hashCode%2Dbyte%2D[hashCode](byte) (java 9)

    • [[painless-api-reference-Byte-parseByte-1]]static byte link:{java8-javadoc}/java/lang/Byte.html#parseByte%2Djava.lang.String%2D[parseByte](<<painless-api-reference-String,String>>) (java 9)

    • [[painless-api-reference-Byte-parseByte-2]]static byte link:{java8-javadoc}/java/lang/Byte.html#parseByte%2Djava.lang.String%2Dint%2D[parseByte](<<painless-api-reference-String,String>>, int) (java 9)

    • [[painless-api-reference-Byte-toString-1]]static <<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/Byte.html#toString%2Dbyte%2D[toString](byte) (java 9)

    • [[painless-api-reference-Byte-toUnsignedInt-1]]static int link:{java8-javadoc}/java/lang/Byte.html#toUnsignedInt%2Dbyte%2D[toUnsignedInt](byte) (java 9)

    • [[painless-api-reference-Byte-toUnsignedLong-1]]static long link:{java8-javadoc}/java/lang/Byte.html#toUnsignedLong%2Dbyte%2D[toUnsignedLong](byte) (java 9)

    • [[painless-api-reference-Byte-valueOf-1]]static <<painless-api-reference-Byte,Byte>> link:{java8-javadoc}/java/lang/Byte.html#valueOf%2Dbyte%2D[valueOf](byte) (java 9)

    • [[painless-api-reference-Byte-valueOf-2]]static <<painless-api-reference-Byte,Byte>> link:{java8-javadoc}/java/lang/Byte.html#valueOf%2Djava.lang.String%2Dint%2D[valueOf](<<painless-api-reference-String,String>>, int) (java 9)

    • [[painless-api-reference-Byte-compareTo-1]]int link:{java8-javadoc}/java/lang/Byte.html#compareTo%2Djava.lang.Byte%2D[compareTo](<<painless-api-reference-Byte,Byte>>) (java 9)

    • Inherits methods from <<painless-api-reference-Number,Number>>, <<painless-api-reference-Object,Object>>

BytesRef
  • byte[] bytes

  • int length

  • int offset

    • [[painless-api-reference-BytesRef-bytesEquals-1]]boolean link:{lucene-core-javadoc}/org/apache/lucene/util/BytesRef.html#bytesEquals%2Dorg.apache.lucene.util.BytesRef%2D[bytesEquals](<<painless-api-reference-BytesRef,BytesRef>>)

    • [[painless-api-reference-BytesRef-utf8ToString-0]]<<painless-api-reference-String,String>> link:{lucene-core-javadoc}/org/apache/lucene/util/BytesRef.html#utf8ToString%2D%2D[utf8ToString]()

    • Inherits methods from <<painless-api-reference-Object,Object>>

Calendar
  • static int ALL_STYLES (java 9)

  • static int AM (java 9)

  • static int AM_PM (java 9)

  • static int APRIL (java 9)

  • static int AUGUST (java 9)

  • static int DATE (java 9)

  • static int DAY_OF_MONTH (java 9)

  • static int DAY_OF_WEEK (java 9)

  • static int DAY_OF_WEEK_IN_MONTH (java 9)

  • static int DAY_OF_YEAR (java 9)

  • static int DECEMBER (java 9)

  • static int DST_OFFSET (java 9)

  • static int ERA (java 9)

  • static int FEBRUARY (java 9)

  • static int FIELD_COUNT (java 9)

  • static int FRIDAY (java 9)

  • static int HOUR (java 9)

  • static int HOUR_OF_DAY (java 9)

  • static int JANUARY (java 9)

  • static int JULY (java 9)

  • static int JUNE (java 9)

  • static int LONG (java 9)

  • static int LONG_FORMAT (java 9)

  • static int LONG_STANDALONE (java 9)

  • static int MARCH (java 9)

  • static int MAY (java 9)

  • static int MILLISECOND (java 9)

  • static int MINUTE (java 9)

  • static int MONDAY (java 9)

  • static int MONTH (java 9)

  • static int NARROW_FORMAT (java 9)

  • static int NARROW_STANDALONE (java 9)

  • static int NOVEMBER (java 9)

  • static int OCTOBER (java 9)

  • static int PM (java 9)

  • static int SATURDAY (java 9)

  • static int SECOND (java 9)

  • static int SEPTEMBER (java 9)

  • static int SHORT (java 9)

  • static int SHORT_FORMAT (java 9)

  • static int SHORT_STANDALONE (java 9)

  • static int SUNDAY (java 9)

  • static int THURSDAY (java 9)

  • static int TUESDAY (java 9)

  • static int UNDECIMBER (java 9)

  • static int WEDNESDAY (java 9)

  • static int WEEK_OF_MONTH (java 9)

  • static int WEEK_OF_YEAR (java 9)

  • static int YEAR (java 9)

  • static int ZONE_OFFSET (java 9)

    • [[painless-api-reference-Calendar-getAvailableCalendarTypes-0]]static <<painless-api-reference-Set,Set>> link:{java8-javadoc}/java/util/Calendar.html#getAvailableCalendarTypes%2D%2D[getAvailableCalendarTypes]() (java 9)

    • [[painless-api-reference-Calendar-getAvailableLocales-0]]static <<painless-api-reference-Locale,Locale>>[] link:{java8-javadoc}/java/util/Calendar.html#getAvailableLocales%2D%2D[getAvailableLocales]() (java 9)

    • [[painless-api-reference-Calendar-getInstance-0]]static <<painless-api-reference-Calendar,Calendar>> link:{java8-javadoc}/java/util/Calendar.html#getInstance%2D%2D[getInstance]() (java 9)

    • [[painless-api-reference-Calendar-getInstance-1]]static <<painless-api-reference-Calendar,Calendar>> link:{java8-javadoc}/java/util/Calendar.html#getInstance%2Djava.util.TimeZone%2D[getInstance](<<painless-api-reference-TimeZone,TimeZone>>) (java 9)

    • [[painless-api-reference-Calendar-getInstance-2]]static <<painless-api-reference-Calendar,Calendar>> link:{java8-javadoc}/java/util/Calendar.html#getInstance%2Djava.util.TimeZone%2Djava.util.Locale%2D[getInstance](<<painless-api-reference-TimeZone,TimeZone>>, <<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-Calendar-add-2]]void link:{java8-javadoc}/java/util/Calendar.html#add%2Dint%2Dint%2D[add](int, int) (java 9)

    • [[painless-api-reference-Calendar-after-1]]boolean link:{java8-javadoc}/java/util/Calendar.html#after%2Djava.lang.Object%2D[after](<<painless-api-reference-Object,Object>>) (java 9)

    • [[painless-api-reference-Calendar-before-1]]boolean link:{java8-javadoc}/java/util/Calendar.html#before%2Djava.lang.Object%2D[before](<<painless-api-reference-Object,Object>>) (java 9)

    • [[painless-api-reference-Calendar-clear-0]]void link:{java8-javadoc}/java/util/Calendar.html#clear%2D%2D[clear]() (java 9)

    • [[painless-api-reference-Calendar-clear-1]]void link:{java8-javadoc}/java/util/Calendar.html#clear%2Dint%2D[clear](int) (java 9)

    • [[painless-api-reference-Calendar-clone-0]]def link:{java8-javadoc}/java/util/Calendar.html#clone%2D%2D[clone]() (java 9)

    • [[painless-api-reference-Calendar-compareTo-1]]int link:{java8-javadoc}/java/util/Calendar.html#compareTo%2Djava.util.Calendar%2D[compareTo](<<painless-api-reference-Calendar,Calendar>>) (java 9)

    • [[painless-api-reference-Calendar-get-1]]int link:{java8-javadoc}/java/util/Calendar.html#get%2Dint%2D[get](int) (java 9)

    • [[painless-api-reference-Calendar-getActualMaximum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getActualMaximum%2Dint%2D[getActualMaximum](int) (java 9)

    • [[painless-api-reference-Calendar-getActualMinimum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getActualMinimum%2Dint%2D[getActualMinimum](int) (java 9)

    • [[painless-api-reference-Calendar-getCalendarType-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/util/Calendar.html#getCalendarType%2D%2D[getCalendarType]() (java 9)

    • [[painless-api-reference-Calendar-getDisplayName-3]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/util/Calendar.html#getDisplayName%2Dint%2Dint%2Djava.util.Locale%2D[getDisplayName](int, int, <<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-Calendar-getDisplayNames-3]]<<painless-api-reference-Map,Map>> link:{java8-javadoc}/java/util/Calendar.html#getDisplayNames%2Dint%2Dint%2Djava.util.Locale%2D[getDisplayNames](int, int, <<painless-api-reference-Locale,Locale>>) (java 9)

    • [[painless-api-reference-Calendar-getFirstDayOfWeek-0]]int link:{java8-javadoc}/java/util/Calendar.html#getFirstDayOfWeek%2D%2D[getFirstDayOfWeek]() (java 9)

    • [[painless-api-reference-Calendar-getGreatestMinimum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getGreatestMinimum%2Dint%2D[getGreatestMinimum](int) (java 9)

    • [[painless-api-reference-Calendar-getLeastMaximum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getLeastMaximum%2Dint%2D[getLeastMaximum](int) (java 9)

    • [[painless-api-reference-Calendar-getMaximum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getMaximum%2Dint%2D[getMaximum](int) (java 9)

    • [[painless-api-reference-Calendar-getMinimalDaysInFirstWeek-0]]int link:{java8-javadoc}/java/util/Calendar.html#getMinimalDaysInFirstWeek%2D%2D[getMinimalDaysInFirstWeek]() (java 9)

    • [[painless-api-reference-Calendar-getMinimum-1]]int link:{java8-javadoc}/java/util/Calendar.html#getMinimum%2Dint%2D[getMinimum](int) (java 9)

    • [[painless-api-reference-Calendar-getTime-0]]<<painless-api-reference-Date,Date>> link:{java8-javadoc}/java/util/Calendar.html#getTime%2D%2D[getTime]() (java 9)

    • [[painless-api-reference-Calendar-getTimeInMillis-0]]long link:{java8-javadoc}/java/util/Calendar.html#getTimeInMillis%2D%2D[getTimeInMillis]() (java 9)

    • [[painless-api-reference-Calendar-getTimeZone-0]]<<painless-api-reference-TimeZone,TimeZone>> link:{java8-javadoc}/java/util/Calendar.html#getTimeZone%2D%2D[getTimeZone]() (java 9)

    • [[painless-api-reference-Calendar-getWeekYear-0]]int link:{java8-javadoc}/java/util/Calendar.html#getWeekYear%2D%2D[getWeekYear]() (java 9)

    • [[painless-api-reference-Calendar-getWeeksInWeekYear-0]]int link:{java8-javadoc}/java/util/Calendar.html#getWeeksInWeekYear%2D%2D[getWeeksInWeekYear]() (java 9)

    • [[painless-api-reference-Calendar-isLenient-0]]boolean link:{java8-javadoc}/java/util/Calendar.html#isLenient%2D%2D[isLenient]() (java 9)

    • [[painless-api-reference-Calendar-isSet-1]]boolean link:{java8-javadoc}/java/util/Calendar.html#isSet%2Dint%2D[isSet](int) (java 9)

    • [[painless-api-reference-Calendar-isWeekDateSupported-0]]boolean link:{java8-javadoc}/java/util/Calendar.html#isWeekDateSupported%2D%2D[isWeekDateSupported]() (java 9)

    • [[painless-api-reference-Calendar-roll-2]]void link:{java8-javadoc}/java/util/Calendar.html#roll%2Dint%2Dint%2D[roll](int, int) (java 9)

    • [[painless-api-reference-Calendar-set-2]]void link:{java8-javadoc}/java/util/Calendar.html#set%2Dint%2Dint%2D[set](int, int) (java 9)

    • [[painless-api-reference-Calendar-set-3]]void link:{java8-javadoc}/java/util/Calendar.html#set%2Dint%2Dint%2Dint%2D[set](int, int, int) (java 9)

    • [[painless-api-reference-Calendar-set-5]]void link:{java8-javadoc}/java/util/Calendar.html#set%2Dint%2Dint%2Dint%2Dint%2Dint%2D[set](int, int, int, int, int) (java 9)

    • [[painless-api-reference-Calendar-set-6]]void link:{java8-javadoc}/java/util/Calendar.html#set%2Dint%2Dint%2Dint%2Dint%2Dint%2Dint%2D[set](int, int, int, int, int, int) (java 9)

    • [[painless-api-reference-Calendar-setFirstDayOfWeek-1]]void link:{java8-javadoc}/java/util/Calendar.html#setFirstDayOfWeek%2Dint%2D[setFirstDayOfWeek](int) (java 9)

    • [[painless-api-reference-Calendar-setLenient-1]]void link:{java8-javadoc}/java/util/Calendar.html#setLenient%2Dboolean%2D[setLenient](boolean) (java 9)

    • [[painless-api-reference-Calendar-setMinimalDaysInFirstWeek-1]]void link:{java8-javadoc}/java/util/Calendar.html#setMinimalDaysInFirstWeek%2Dint%2D[setMinimalDaysInFirstWeek](int) (java 9)

    • [[painless-api-reference-Calendar-setTime-1]]void link:{java8-javadoc}/java/util/Calendar.html#setTime%2Djava.util.Date%2D[setTime](<<painless-api-reference-Date,Date>>) (java 9)

    • [[painless-api-reference-Calendar-setTimeInMillis-1]]void link:{java8-javadoc}/java/util/Calendar.html#setTimeInMillis%2Dlong%2D[setTimeInMillis](long) (java 9)

    • [[painless-api-reference-Calendar-setTimeZone-1]]void link:{java8-javadoc}/java/util/Calendar.html#setTimeZone%2Djava.util.TimeZone%2D[setTimeZone](<<painless-api-reference-TimeZone,TimeZone>>) (java 9)

    • [[painless-api-reference-Calendar-setWeekDate-3]]void link:{java8-javadoc}/java/util/Calendar.html#setWeekDate%2Dint%2Dint%2Dint%2D[setWeekDate](int, int, int) (java 9)

    • [[painless-api-reference-Calendar-toInstant-0]]<<painless-api-reference-Instant,Instant>> link:{java8-javadoc}/java/util/Calendar.html#toInstant%2D%2D[toInstant]() (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

Calendar.Builder
  • [[painless-api-reference-Calendar-Builder-Calendar.Builder-0]]link:{java8-javadoc}/java/util/Calendar.Builder.html#Calendar.Builder%2D%2D[Calendar.Builder]() (java 9)

  • [[painless-api-reference-Calendar-Builder-build-0]]<<painless-api-reference-Calendar,Calendar>> link:{java8-javadoc}/java/util/Calendar.Builder.html#build%2D%2D[build]() (java 9)

  • [[painless-api-reference-Calendar-Builder-set-2]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#set%2Dint%2Dint%2D[set](int, int) (java 9)

  • [[painless-api-reference-Calendar-Builder-setCalendarType-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setCalendarType%2Djava.lang.String%2D[setCalendarType](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-Calendar-Builder-setDate-3]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setDate%2Dint%2Dint%2Dint%2D[setDate](int, int, int) (java 9)

  • [[painless-api-reference-Calendar-Builder-setFields-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setFields%2Dint:A%2D[setFields](int[]) (java 9)

  • [[painless-api-reference-Calendar-Builder-setInstant-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setInstant%2Dlong%2D[setInstant](long) (java 9)

  • [[painless-api-reference-Calendar-Builder-setLenient-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setLenient%2Dboolean%2D[setLenient](boolean) (java 9)

  • [[painless-api-reference-Calendar-Builder-setLocale-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setLocale%2Djava.util.Locale%2D[setLocale](<<painless-api-reference-Locale,Locale>>) (java 9)

  • [[painless-api-reference-Calendar-Builder-setTimeOfDay-3]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setTimeOfDay%2Dint%2Dint%2Dint%2D[setTimeOfDay](int, int, int) (java 9)

  • [[painless-api-reference-Calendar-Builder-setTimeOfDay-4]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setTimeOfDay%2Dint%2Dint%2Dint%2Dint%2D[setTimeOfDay](int, int, int, int) (java 9)

  • [[painless-api-reference-Calendar-Builder-setTimeZone-1]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setTimeZone%2Djava.util.TimeZone%2D[setTimeZone](<<painless-api-reference-TimeZone,TimeZone>>) (java 9)

  • [[painless-api-reference-Calendar-Builder-setWeekDate-3]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setWeekDate%2Dint%2Dint%2Dint%2D[setWeekDate](int, int, int) (java 9)

  • [[painless-api-reference-Calendar-Builder-setWeekDefinition-2]]<<painless-api-reference-Calendar-Builder,Calendar.Builder>> link:{java8-javadoc}/java/util/Calendar.Builder.html#setWeekDefinition%2Dint%2Dint%2D[setWeekDefinition](int, int) (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

CharSequence
  • [[painless-api-reference-CharSequence-charAt-1]]char link:{java8-javadoc}/java/lang/CharSequence.html#charAt%2Dint%2D[charAt](int) (java 9)

  • [[painless-api-reference-CharSequence-chars-0]]<<painless-api-reference-IntStream,IntStream>> link:{java8-javadoc}/java/lang/CharSequence.html#chars%2D%2D[chars]() (java 9)

  • [[painless-api-reference-CharSequence-codePoints-0]]<<painless-api-reference-IntStream,IntStream>> link:{java8-javadoc}/java/lang/CharSequence.html#codePoints%2D%2D[codePoints]() (java 9)

  • [[painless-api-reference-CharSequence-length-0]]int link:{java8-javadoc}/java/lang/CharSequence.html#length%2D%2D[length]() (java 9)

  • [[painless-api-reference-CharSequence-replaceAll-2]]<<painless-api-reference-String,String>> link:{painless-javadoc}/org/elasticsearch/painless/api/Augmentation.html#replaceAll%2Djava.lang.CharSequence%2Djava.util.regex.Pattern%2Djava.util.function.Function%2D[replaceAll](<<painless-api-reference-Pattern,Pattern>>, <<painless-api-reference-Function,Function>>)

  • [[painless-api-reference-CharSequence-replaceFirst-2]]<<painless-api-reference-String,String>> link:{painless-javadoc}/org/elasticsearch/painless/api/Augmentation.html#replaceFirst%2Djava.lang.CharSequence%2Djava.util.regex.Pattern%2Djava.util.function.Function%2D[replaceFirst](<<painless-api-reference-Pattern,Pattern>>, <<painless-api-reference-Function,Function>>)

  • [[painless-api-reference-CharSequence-subSequence-2]]<<painless-api-reference-CharSequence,CharSequence>> link:{java8-javadoc}/java/lang/CharSequence.html#subSequence%2Dint%2Dint%2D[subSequence](int, int) (java 9)

  • [[painless-api-reference-CharSequence-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/CharSequence.html#toString%2D%2D[toString]() (java 9)

  • Inherits methods from <<painless-api-reference-Object,Object>>

Character
  • static int BYTES (java 9)

  • static byte COMBINING_SPACING_MARK (java 9)

  • static byte CONNECTOR_PUNCTUATION (java 9)

  • static byte CONTROL (java 9)

  • static byte CURRENCY_SYMBOL (java 9)

  • static byte DASH_PUNCTUATION (java 9)

  • static byte DECIMAL_DIGIT_NUMBER (java 9)

  • static byte DIRECTIONALITY_ARABIC_NUMBER (java 9)

  • static byte DIRECTIONALITY_BOUNDARY_NEUTRAL (java 9)

  • static byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR (java 9)

  • static byte DIRECTIONALITY_EUROPEAN_NUMBER (java 9)

  • static byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR (java 9)

  • static byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR (java 9)

  • static byte DIRECTIONALITY_LEFT_TO_RIGHT (java 9)

  • static byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING (java 9)

  • static byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE (java 9)

  • static byte DIRECTIONALITY_NONSPACING_MARK (java 9)

  • static byte DIRECTIONALITY_OTHER_NEUTRALS (java 9)

  • static byte DIRECTIONALITY_PARAGRAPH_SEPARATOR (java 9)

  • static byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT (java 9)

  • static byte DIRECTIONALITY_RIGHT_TO_LEFT (java 9)

  • static byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC (java 9)

  • static byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING (java 9)

  • static byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE (java 9)

  • static byte DIRECTIONALITY_SEGMENT_SEPARATOR (java 9)

  • static byte DIRECTIONALITY_UNDEFINED (java 9)

  • static byte DIRECTIONALITY_WHITESPACE (java 9)

  • static byte ENCLOSING_MARK (java 9)

  • static byte END_PUNCTUATION (java 9)

  • static byte FINAL_QUOTE_PUNCTUATION (java 9)

  • static byte FORMAT (java 9)

  • static byte INITIAL_QUOTE_PUNCTUATION (java 9)

  • static byte LETTER_NUMBER (java 9)

  • static byte LINE_SEPARATOR (java 9)

  • static byte LOWERCASE_LETTER (java 9)

  • static byte MATH_SYMBOL (java 9)

  • static int MAX_CODE_POINT (java 9)

  • static char MAX_HIGH_SURROGATE (java 9)

  • static char MAX_LOW_SURROGATE (java 9)

  • static int MAX_RADIX (java 9)

  • static char MAX_SURROGATE (java 9)

  • static char MAX_VALUE (java 9)

  • static char MIN_CODE_POINT (java 9)

  • static char MIN_HIGH_SURROGATE (java 9)

  • static char MIN_LOW_SURROGATE (java 9)

  • static int MIN_RADIX (java 9)

  • static int MIN_SUPPLEMENTARY_CODE_POINT (java 9)

  • static char MIN_SURROGATE (java 9)

  • static char MIN_VALUE (java 9)

  • static byte MODIFIER_LETTER (java 9)

  • static byte MODIFIER_SYMBOL (java 9)

  • static byte NON_SPACING_MARK (java 9)

  • static byte OTHER_LETTER (java 9)

  • static byte OTHER_NUMBER (java 9)

  • static byte OTHER_PUNCTUATION (java 9)

  • static byte OTHER_SYMBOL (java 9)

  • static byte PARAGRAPH_SEPARATOR (java 9)

  • static byte PRIVATE_USE (java 9)

  • static int SIZE (java 9)

  • static byte SPACE_SEPARATOR (java 9)

  • static byte START_PUNCTUATION (java 9)

  • static byte SURROGATE (java 9)

  • static byte TITLECASE_LETTER (java 9)

  • static byte UNASSIGNED (java 9)

  • static byte UPPERCASE_LETTER (java 9)

    • [[painless-api-reference-Character-charCount-1]]static int link:{java8-javadoc}/java/lang/Character.html#charCount%2Dint%2D[charCount](int) (java 9)

    • [[painless-api-reference-Character-codePointAt-2]]static int link:{java8-javadoc}/java/lang/Character.html#codePointAt%2Djava.lang.CharSequence%2Dint%2D[codePointAt](<<painless-api-reference-CharSequence,CharSequence>>, int) (java 9)

    • [[painless-api-reference-Character-codePointAt-3]]static int link:{java8-javadoc}/java/lang/Character.html#codePointAt%2Dchar:A%2Dint%2Dint%2D[codePointAt](char[], int, int) (java 9)

    • [[painless-api-reference-Character-codePointBefore-2]]static int link:{java8-javadoc}/java/lang/Character.html#codePointBefore%2Djava.lang.CharSequence%2Dint%2D[codePointBefore](<<painless-api-reference-CharSequence,CharSequence>>, int) (java 9)

    • [[painless-api-reference-Character-codePointBefore-3]]static int link:{java8-javadoc}/java/lang/Character.html#codePointBefore%2Dchar:A%2Dint%2Dint%2D[codePointBefore](char[], int, int) (java 9)

    • [[painless-api-reference-Character-codePointCount-3]]static int link:{java8-javadoc}/java/lang/Character.html#codePointCount%2Djava.lang.CharSequence%2Dint%2Dint%2D[codePointCount](<<painless-api-reference-CharSequence,CharSequence>>, int, int) (java 9)

    • [[painless-api-reference-Character-compare-2]]static int link:{java8-javadoc}/java/lang/Character.html#compare%2Dchar%2Dchar%2D[compare](char, char) (java 9)

    • [[painless-api-reference-Character-digit-2]]static int link:{java8-javadoc}/java/lang/Character.html#digit%2Dint%2Dint%2D[digit](int, int) (java 9)

    • [[painless-api-reference-Character-forDigit-2]]static char link:{java8-javadoc}/java/lang/Character.html#forDigit%2Dint%2Dint%2D[forDigit](int, int) (java 9)

    • [[painless-api-reference-Character-getDirectionality-1]]static byte link:{java8-javadoc}/java/lang/Character.html#getDirectionality%2Dint%2D[getDirectionality](int) (java 9)

    • [[painless-api-reference-Character-getName-1]]static <<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/Character.html#getName%2Dint%2D[getName](int) (java 9)

    • [[painless-api-reference-Character-getNumericValue-1]]static int link:{java8-javadoc}/java/lang/Character.html#getNumericValue%2Dint%2D[getNumericValue](int) (java 9)

    • [[painless-api-reference-Character-getType-1]]static int link:{java8-javadoc}/java/lang/Character.html#getType%2Dint%2D[getType](int) (java 9)

    • [[painless-api-reference-Character-hashCode-1]]static int link:{java8-javadoc}/java/lang/Character.html#hashCode%2Dchar%2D[hashCode](char) (java 9)

    • [[painless-api-reference-Character-highSurrogate-1]]static char link:{java8-javadoc}/java/lang/Character.html#highSurrogate%2Dint%2D[highSurrogate](int) (java 9)

    • [[painless-api-reference-Character-isAlphabetic-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isAlphabetic%2Dint%2D[isAlphabetic](int) (java 9)

    • [[painless-api-reference-Character-isBmpCodePoint-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isBmpCodePoint%2Dint%2D[isBmpCodePoint](int) (java 9)

    • [[painless-api-reference-Character-isDefined-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isDefined%2Dint%2D[isDefined](int) (java 9)

    • [[painless-api-reference-Character-isDigit-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isDigit%2Dint%2D[isDigit](int) (java 9)

    • [[painless-api-reference-Character-isHighSurrogate-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isHighSurrogate%2Dchar%2D[isHighSurrogate](char) (java 9)

    • [[painless-api-reference-Character-isISOControl-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isISOControl%2Dint%2D[isISOControl](int) (java 9)

    • [[painless-api-reference-Character-isIdentifierIgnorable-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isIdentifierIgnorable%2Dint%2D[isIdentifierIgnorable](int) (java 9)

    • [[painless-api-reference-Character-isIdeographic-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isIdeographic%2Dint%2D[isIdeographic](int) (java 9)

    • [[painless-api-reference-Character-isJavaIdentifierPart-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isJavaIdentifierPart%2Dint%2D[isJavaIdentifierPart](int) (java 9)

    • [[painless-api-reference-Character-isJavaIdentifierStart-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isJavaIdentifierStart%2Dint%2D[isJavaIdentifierStart](int) (java 9)

    • [[painless-api-reference-Character-isLetter-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isLetter%2Dint%2D[isLetter](int) (java 9)

    • [[painless-api-reference-Character-isLetterOrDigit-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isLetterOrDigit%2Dint%2D[isLetterOrDigit](int) (java 9)

    • [[painless-api-reference-Character-isLowerCase-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isLowerCase%2Dint%2D[isLowerCase](int) (java 9)

    • [[painless-api-reference-Character-isMirrored-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isMirrored%2Dint%2D[isMirrored](int) (java 9)

    • [[painless-api-reference-Character-isSpaceChar-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isSpaceChar%2Dint%2D[isSpaceChar](int) (java 9)

    • [[painless-api-reference-Character-isSupplementaryCodePoint-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isSupplementaryCodePoint%2Dint%2D[isSupplementaryCodePoint](int) (java 9)

    • [[painless-api-reference-Character-isSurrogate-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isSurrogate%2Dchar%2D[isSurrogate](char) (java 9)

    • [[painless-api-reference-Character-isSurrogatePair-2]]static boolean link:{java8-javadoc}/java/lang/Character.html#isSurrogatePair%2Dchar%2Dchar%2D[isSurrogatePair](char, char) (java 9)

    • [[painless-api-reference-Character-isTitleCase-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isTitleCase%2Dint%2D[isTitleCase](int) (java 9)

    • [[painless-api-reference-Character-isUnicodeIdentifierPart-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isUnicodeIdentifierPart%2Dint%2D[isUnicodeIdentifierPart](int) (java 9)

    • [[painless-api-reference-Character-isUnicodeIdentifierStart-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isUnicodeIdentifierStart%2Dint%2D[isUnicodeIdentifierStart](int) (java 9)

    • [[painless-api-reference-Character-isUpperCase-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isUpperCase%2Dint%2D[isUpperCase](int) (java 9)

    • [[painless-api-reference-Character-isValidCodePoint-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isValidCodePoint%2Dint%2D[isValidCodePoint](int) (java 9)

    • [[painless-api-reference-Character-isWhitespace-1]]static boolean link:{java8-javadoc}/java/lang/Character.html#isWhitespace%2Dint%2D[isWhitespace](int) (java 9)

    • [[painless-api-reference-Character-lowSurrogate-1]]static char link:{java8-javadoc}/java/lang/Character.html#lowSurrogate%2Dint%2D[lowSurrogate](int) (java 9)

    • [[painless-api-reference-Character-offsetByCodePoints-3]]static int link:{java8-javadoc}/java/lang/Character.html#offsetByCodePoints%2Djava.lang.CharSequence%2Dint%2Dint%2D[offsetByCodePoints](<<painless-api-reference-CharSequence,CharSequence>>, int, int) (java 9)

    • [[painless-api-reference-Character-offsetByCodePoints-5]]static int link:{java8-javadoc}/java/lang/Character.html#offsetByCodePoints%2Dchar:A%2Dint%2Dint%2Dint%2Dint%2D[offsetByCodePoints](char[], int, int, int, int) (java 9)

    • [[painless-api-reference-Character-reverseBytes-1]]static char link:{java8-javadoc}/java/lang/Character.html#reverseBytes%2Dchar%2D[reverseBytes](char) (java 9)

    • [[painless-api-reference-Character-toChars-1]]static char[] link:{java8-javadoc}/java/lang/Character.html#toChars%2Dint%2D[toChars](int) (java 9)

    • [[painless-api-reference-Character-toChars-3]]static int link:{java8-javadoc}/java/lang/Character.html#toChars%2Dint%2Dchar:A%2Dint%2D[toChars](int, char[], int) (java 9)

    • [[painless-api-reference-Character-toCodePoint-2]]static int link:{java8-javadoc}/java/lang/Character.html#toCodePoint%2Dchar%2Dchar%2D[toCodePoint](char, char) (java 9)

    • [[painless-api-reference-Character-toLowerCase-1]]static char link:{java8-javadoc}/java/lang/Character.html#toLowerCase%2Dchar%2D[toLowerCase](char) (java 9)

    • [[painless-api-reference-Character-toString-1]]static <<painless-api-reference-String,String>> link:{java8-javadoc}/java/lang/Character.html#toString%2Dchar%2D[toString](char) (java 9)

    • [[painless-api-reference-Character-toTitleCase-1]]static char link:{java8-javadoc}/java/lang/Character.html#toTitleCase%2Dchar%2D[toTitleCase](char) (java 9)

    • [[painless-api-reference-Character-toUpperCase-1]]static char link:{java8-javadoc}/java/lang/Character.html#toUpperCase%2Dchar%2D[toUpperCase](char) (java 9)

    • [[painless-api-reference-Character-valueOf-1]]static <<painless-api-reference-Character,Character>> link:{java8-javadoc}/java/lang/Character.html#valueOf%2Dchar%2D[valueOf](char) (java 9)

    • [[painless-api-reference-Character-charValue-0]]char link:{java8-javadoc}/java/lang/Character.html#charValue%2D%2D[charValue]() (java 9)

    • [[painless-api-reference-Character-compareTo-1]]int link:{java8-javadoc}/java/lang/Character.html#compareTo%2Djava.lang.Character%2D[compareTo](<<painless-api-reference-Character,Character>>) (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

Character.Subset
  • Inherits methods from <<painless-api-reference-Object,Object>>

Character.UnicodeBlock
Character.UnicodeScript
CharacterIterator
  • static char DONE (java 9)

    • [[painless-api-reference-CharacterIterator-clone-0]]def link:{java8-javadoc}/java/text/CharacterIterator.html#clone%2D%2D[clone]() (java 9)

    • [[painless-api-reference-CharacterIterator-current-0]]char link:{java8-javadoc}/java/text/CharacterIterator.html#current%2D%2D[current]() (java 9)

    • [[painless-api-reference-CharacterIterator-first-0]]char link:{java8-javadoc}/java/text/CharacterIterator.html#first%2D%2D[first]() (java 9)

    • [[painless-api-reference-CharacterIterator-getBeginIndex-0]]int link:{java8-javadoc}/java/text/CharacterIterator.html#getBeginIndex%2D%2D[getBeginIndex]() (java 9)

    • [[painless-api-reference-CharacterIterator-getEndIndex-0]]int link:{java8-javadoc}/java/text/CharacterIterator.html#getEndIndex%2D%2D[getEndIndex]() (java 9)

    • [[painless-api-reference-CharacterIterator-getIndex-0]]int link:{java8-javadoc}/java/text/CharacterIterator.html#getIndex%2D%2D[getIndex]() (java 9)

    • [[painless-api-reference-CharacterIterator-last-0]]char link:{java8-javadoc}/java/text/CharacterIterator.html#last%2D%2D[last]() (java 9)

    • [[painless-api-reference-CharacterIterator-next-0]]char link:{java8-javadoc}/java/text/CharacterIterator.html#next%2D%2D[next]() (java 9)

    • [[painless-api-reference-CharacterIterator-previous-0]]char link:{java8-javadoc}/java/text/CharacterIterator.html#previous%2D%2D[previous]() (java 9)

    • [[painless-api-reference-CharacterIterator-setIndex-1]]char link:{java8-javadoc}/java/text/CharacterIterator.html#setIndex%2Dint%2D[setIndex](int) (java 9)

    • Inherits methods from <<painless-api-reference-Object,Object>>

ChoiceFormat
  • [[painless-api-reference-ChoiceFormat-nextDouble-1]]static double link:{java8-javadoc}/java/text/ChoiceFormat.html#nextDouble%2Ddouble%2D[nextDouble](double) (java 9)

  • [[painless-api-reference-ChoiceFormat-nextDouble-2]]static double link:{java8-javadoc}/java/text/ChoiceFormat.html#nextDouble%2Ddouble%2Dboolean%2D[nextDouble](double, boolean) (java 9)

  • [[painless-api-reference-ChoiceFormat-previousDouble-1]]static double link:{java8-javadoc}/java/text/ChoiceFormat.html#previousDouble%2Ddouble%2D[previousDouble](double) (java 9)

  • [[painless-api-reference-ChoiceFormat-ChoiceFormat-1]]link:{java8-javadoc}/java/text/ChoiceFormat.html#ChoiceFormat%2Djava.lang.String%2D[ChoiceFormat](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-ChoiceFormat-ChoiceFormat-2]]link:{java8-javadoc}/java/text/ChoiceFormat.html#ChoiceFormat%2Ddouble:A%2Djava.lang.String:A%2D[ChoiceFormat](double[], <<painless-api-reference-String,String>>[]) (java 9)

  • [[painless-api-reference-ChoiceFormat-applyPattern-1]]void link:{java8-javadoc}/java/text/ChoiceFormat.html#applyPattern%2Djava.lang.String%2D[applyPattern](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-ChoiceFormat-getFormats-0]]def[] link:{java8-javadoc}/java/text/ChoiceFormat.html#getFormats%2D%2D[getFormats]() (java 9)

  • [[painless-api-reference-ChoiceFormat-getLimits-0]]double[] link:{java8-javadoc}/java/text/ChoiceFormat.html#getLimits%2D%2D[getLimits]() (java 9)

  • [[painless-api-reference-ChoiceFormat-setChoices-2]]void link:{java8-javadoc}/java/text/ChoiceFormat.html#setChoices%2Ddouble:A%2Djava.lang.String:A%2D[setChoices](double[], <<painless-api-reference-String,String>>[]) (java 9)

  • [[painless-api-reference-ChoiceFormat-toPattern-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/text/ChoiceFormat.html#toPattern%2D%2D[toPattern]() (java 9)

  • Inherits methods from <<painless-api-reference-Format,Format>>, <<painless-api-reference-NumberFormat,NumberFormat>>, <<painless-api-reference-Object,Object>>

ChronoField
ChronoLocalDate
  • [[painless-api-reference-ChronoLocalDate-from-1]]static <<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#from%2Djava.time.temporal.TemporalAccessor%2D[from](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-timeLineOrder-0]]static <<painless-api-reference-Comparator,Comparator>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#timeLineOrder%2D%2D[timeLineOrder]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-atTime-1]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#atTime%2Djava.time.LocalTime%2D[atTime](<<painless-api-reference-LocalTime,LocalTime>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-compareTo-1]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#compareTo%2Djava.time.chrono.ChronoLocalDate%2D[compareTo](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-equals-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#equals%2Djava.lang.Object%2D[equals](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-format-1]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#format%2Djava.time.format.DateTimeFormatter%2D[format](<<painless-api-reference-DateTimeFormatter,DateTimeFormatter>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-getChronology-0]]<<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#getChronology%2D%2D[getChronology]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-getEra-0]]<<painless-api-reference-Era,Era>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#getEra%2D%2D[getEra]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-hashCode-0]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#hashCode%2D%2D[hashCode]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-isAfter-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#isAfter%2Djava.time.chrono.ChronoLocalDate%2D[isAfter](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-isBefore-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#isBefore%2Djava.time.chrono.ChronoLocalDate%2D[isBefore](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-isEqual-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#isEqual%2Djava.time.chrono.ChronoLocalDate%2D[isEqual](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-isLeapYear-0]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#isLeapYear%2D%2D[isLeapYear]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-lengthOfMonth-0]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#lengthOfMonth%2D%2D[lengthOfMonth]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-lengthOfYear-0]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#lengthOfYear%2D%2D[lengthOfYear]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-minus-1]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#minus%2Djava.time.temporal.TemporalAmount%2D[minus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-minus-2]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#minus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[minus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-plus-1]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#plus%2Djava.time.temporal.TemporalAmount%2D[plus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-plus-2]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#plus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[plus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-toEpochDay-0]]long link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#toEpochDay%2D%2D[toEpochDay]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#toString%2D%2D[toString]() (java 9)

  • [[painless-api-reference-ChronoLocalDate-until-1]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#until%2Djava.time.chrono.ChronoLocalDate%2D[until](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-with-1]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#with%2Djava.time.temporal.TemporalAdjuster%2D[with](<<painless-api-reference-TemporalAdjuster,TemporalAdjuster>>) (java 9)

  • [[painless-api-reference-ChronoLocalDate-with-2]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDate.html#with%2Djava.time.temporal.TemporalField%2Dlong%2D[with](<<painless-api-reference-TemporalField,TemporalField>>, long) (java 9)

  • Inherits methods from <<painless-api-reference-Temporal,Temporal>>, <<painless-api-reference-TemporalAccessor,TemporalAccessor>>, <<painless-api-reference-TemporalAdjuster,TemporalAdjuster>>

ChronoLocalDateTime
  • [[painless-api-reference-ChronoLocalDateTime-from-1]]static <<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#from%2Djava.time.temporal.TemporalAccessor%2D[from](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-timeLineOrder-0]]static <<painless-api-reference-Comparator,Comparator>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#timeLineOrder%2D%2D[timeLineOrder]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-atZone-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#atZone%2Djava.time.ZoneId%2D[atZone](<<painless-api-reference-ZoneId,ZoneId>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-compareTo-1]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#compareTo%2Djava.time.chrono.ChronoLocalDateTime%2D[compareTo](<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-equals-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#equals%2Djava.lang.Object%2D[equals](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-format-1]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#format%2Djava.time.format.DateTimeFormatter%2D[format](<<painless-api-reference-DateTimeFormatter,DateTimeFormatter>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-getChronology-0]]<<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#getChronology%2D%2D[getChronology]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-hashCode-0]]int link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#hashCode%2D%2D[hashCode]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-isAfter-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#isAfter%2Djava.time.chrono.ChronoLocalDateTime%2D[isAfter](<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-isBefore-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#isBefore%2Djava.time.chrono.ChronoLocalDateTime%2D[isBefore](<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-isEqual-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#isEqual%2Djava.time.chrono.ChronoLocalDateTime%2D[isEqual](<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-minus-1]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#minus%2Djava.time.temporal.TemporalAmount%2D[minus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-minus-2]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#minus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[minus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-plus-1]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#plus%2Djava.time.temporal.TemporalAmount%2D[plus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-plus-2]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#plus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[plus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-toEpochSecond-1]]long link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#toEpochSecond%2Djava.time.ZoneOffset%2D[toEpochSecond](<<painless-api-reference-ZoneOffset,ZoneOffset>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-toInstant-1]]<<painless-api-reference-Instant,Instant>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#toInstant%2Djava.time.ZoneOffset%2D[toInstant](<<painless-api-reference-ZoneOffset,ZoneOffset>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-toLocalDate-0]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#toLocalDate%2D%2D[toLocalDate]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-toLocalTime-0]]<<painless-api-reference-LocalTime,LocalTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#toLocalTime%2D%2D[toLocalTime]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#toString%2D%2D[toString]() (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-with-1]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#with%2Djava.time.temporal.TemporalAdjuster%2D[with](<<painless-api-reference-TemporalAdjuster,TemporalAdjuster>>) (java 9)

  • [[painless-api-reference-ChronoLocalDateTime-with-2]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoLocalDateTime.html#with%2Djava.time.temporal.TemporalField%2Dlong%2D[with](<<painless-api-reference-TemporalField,TemporalField>>, long) (java 9)

  • Inherits methods from <<painless-api-reference-Temporal,Temporal>>, <<painless-api-reference-TemporalAccessor,TemporalAccessor>>, <<painless-api-reference-TemporalAdjuster,TemporalAdjuster>>

ChronoPeriod
  • [[painless-api-reference-ChronoPeriod-between-2]]static <<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#between%2Djava.time.chrono.ChronoLocalDate%2Djava.time.chrono.ChronoLocalDate%2D[between](<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>, <<painless-api-reference-ChronoLocalDate,ChronoLocalDate>>) (java 9)

  • [[painless-api-reference-ChronoPeriod-equals-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#equals%2Djava.lang.Object%2D[equals](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-ChronoPeriod-getChronology-0]]<<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#getChronology%2D%2D[getChronology]() (java 9)

  • [[painless-api-reference-ChronoPeriod-getUnits-0]]<<painless-api-reference-List,List>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#getUnits%2D%2D[getUnits]() (java 9)

  • [[painless-api-reference-ChronoPeriod-hashCode-0]]int link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#hashCode%2D%2D[hashCode]() (java 9)

  • [[painless-api-reference-ChronoPeriod-isNegative-0]]boolean link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#isNegative%2D%2D[isNegative]() (java 9)

  • [[painless-api-reference-ChronoPeriod-isZero-0]]boolean link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#isZero%2D%2D[isZero]() (java 9)

  • [[painless-api-reference-ChronoPeriod-minus-1]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#minus%2Djava.time.temporal.TemporalAmount%2D[minus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoPeriod-multipliedBy-1]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#multipliedBy%2Dint%2D[multipliedBy](int) (java 9)

  • [[painless-api-reference-ChronoPeriod-negated-0]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#negated%2D%2D[negated]() (java 9)

  • [[painless-api-reference-ChronoPeriod-normalized-0]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#normalized%2D%2D[normalized]() (java 9)

  • [[painless-api-reference-ChronoPeriod-plus-1]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#plus%2Djava.time.temporal.TemporalAmount%2D[plus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoPeriod-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoPeriod.html#toString%2D%2D[toString]() (java 9)

  • Inherits methods from <<painless-api-reference-TemporalAmount,TemporalAmount>>

ChronoUnit
ChronoZonedDateTime
  • [[painless-api-reference-ChronoZonedDateTime-from-1]]static <<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#from%2Djava.time.temporal.TemporalAccessor%2D[from](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-timeLineOrder-0]]static <<painless-api-reference-Comparator,Comparator>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#timeLineOrder%2D%2D[timeLineOrder]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-compareTo-1]]int link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#compareTo%2Djava.time.chrono.ChronoZonedDateTime%2D[compareTo](<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-equals-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#equals%2Djava.lang.Object%2D[equals](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-format-1]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#format%2Djava.time.format.DateTimeFormatter%2D[format](<<painless-api-reference-DateTimeFormatter,DateTimeFormatter>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-getChronology-0]]<<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#getChronology%2D%2D[getChronology]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-getOffset-0]]<<painless-api-reference-ZoneOffset,ZoneOffset>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#getOffset%2D%2D[getOffset]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-getZone-0]]<<painless-api-reference-ZoneId,ZoneId>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#getZone%2D%2D[getZone]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-hashCode-0]]int link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#hashCode%2D%2D[hashCode]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-isAfter-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#isAfter%2Djava.time.chrono.ChronoZonedDateTime%2D[isAfter](<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-isBefore-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#isBefore%2Djava.time.chrono.ChronoZonedDateTime%2D[isBefore](<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-isEqual-1]]boolean link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#isEqual%2Djava.time.chrono.ChronoZonedDateTime%2D[isEqual](<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-minus-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#minus%2Djava.time.temporal.TemporalAmount%2D[minus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-minus-2]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#minus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[minus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-plus-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#plus%2Djava.time.temporal.TemporalAmount%2D[plus](<<painless-api-reference-TemporalAmount,TemporalAmount>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-plus-2]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#plus%2Dlong%2Djava.time.temporal.TemporalUnit%2D[plus](long, <<painless-api-reference-TemporalUnit,TemporalUnit>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toEpochSecond-0]]long link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toEpochSecond%2D%2D[toEpochSecond]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toInstant-0]]<<painless-api-reference-Instant,Instant>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toInstant%2D%2D[toInstant]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toLocalDate-0]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toLocalDate%2D%2D[toLocalDate]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toLocalDateTime-0]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toLocalDateTime%2D%2D[toLocalDateTime]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toLocalTime-0]]<<painless-api-reference-LocalTime,LocalTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toLocalTime%2D%2D[toLocalTime]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-toString-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#toString%2D%2D[toString]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-with-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#with%2Djava.time.temporal.TemporalAdjuster%2D[with](<<painless-api-reference-TemporalAdjuster,TemporalAdjuster>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-with-2]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#with%2Djava.time.temporal.TemporalField%2Dlong%2D[with](<<painless-api-reference-TemporalField,TemporalField>>, long) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-withEarlierOffsetAtOverlap-0]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#withEarlierOffsetAtOverlap%2D%2D[withEarlierOffsetAtOverlap]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-withLaterOffsetAtOverlap-0]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#withLaterOffsetAtOverlap%2D%2D[withLaterOffsetAtOverlap]() (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-withZoneSameInstant-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#withZoneSameInstant%2Djava.time.ZoneId%2D[withZoneSameInstant](<<painless-api-reference-ZoneId,ZoneId>>) (java 9)

  • [[painless-api-reference-ChronoZonedDateTime-withZoneSameLocal-1]]<<painless-api-reference-ChronoZonedDateTime,ChronoZonedDateTime>> link:{java8-javadoc}/java/time/chrono/ChronoZonedDateTime.html#withZoneSameLocal%2Djava.time.ZoneId%2D[withZoneSameLocal](<<painless-api-reference-ZoneId,ZoneId>>) (java 9)

  • Inherits methods from <<painless-api-reference-Temporal,Temporal>>, <<painless-api-reference-TemporalAccessor,TemporalAccessor>>

Chronology
  • [[painless-api-reference-Chronology-from-1]]static <<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/Chronology.html#from%2Djava.time.temporal.TemporalAccessor%2D[from](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-Chronology-getAvailableChronologies-0]]static <<painless-api-reference-Set,Set>> link:{java8-javadoc}/java/time/chrono/Chronology.html#getAvailableChronologies%2D%2D[getAvailableChronologies]() (java 9)

  • [[painless-api-reference-Chronology-of-1]]static <<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/Chronology.html#of%2Djava.lang.String%2D[of](<<painless-api-reference-String,String>>) (java 9)

  • [[painless-api-reference-Chronology-ofLocale-1]]static <<painless-api-reference-Chronology,Chronology>> link:{java8-javadoc}/java/time/chrono/Chronology.html#ofLocale%2Djava.util.Locale%2D[ofLocale](<<painless-api-reference-Locale,Locale>>) (java 9)

  • [[painless-api-reference-Chronology-compareTo-1]]int link:{java8-javadoc}/java/time/chrono/Chronology.html#compareTo%2Djava.time.chrono.Chronology%2D[compareTo](<<painless-api-reference-Chronology,Chronology>>) (java 9)

  • [[painless-api-reference-Chronology-date-1]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#date%2Djava.time.temporal.TemporalAccessor%2D[date](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-Chronology-date-3]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#date%2Dint%2Dint%2Dint%2D[date](int, int, int) (java 9)

  • [[painless-api-reference-Chronology-date-4]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#date%2Djava.time.chrono.Era%2Dint%2Dint%2Dint%2D[date](<<painless-api-reference-Era,Era>>, int, int, int) (java 9)

  • [[painless-api-reference-Chronology-dateEpochDay-1]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#dateEpochDay%2Dlong%2D[dateEpochDay](long) (java 9)

  • [[painless-api-reference-Chronology-dateYearDay-2]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#dateYearDay%2Dint%2Dint%2D[dateYearDay](int, int) (java 9)

  • [[painless-api-reference-Chronology-dateYearDay-3]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javadoc}/java/time/chrono/Chronology.html#dateYearDay%2Djava.time.chrono.Era%2Dint%2Dint%2D[dateYearDay](<<painless-api-reference-Era,Era>>, int, int) (java 9)

  • [[painless-api-reference-Chronology-equals-1]]boolean link:{java8-javadoc}/java/time/chrono/Chronology.html#equals%2Djava.lang.Object%2D[equals](<<painless-api-reference-Object,Object>>) (java 9)

  • [[painless-api-reference-Chronology-eraOf-1]]<<painless-api-reference-Era,Era>> link:{java8-javadoc}/java/time/chrono/Chronology.html#eraOf%2Dint%2D[eraOf](int) (java 9)

  • [[painless-api-reference-Chronology-eras-0]]<<painless-api-reference-List,List>> link:{java8-javadoc}/java/time/chrono/Chronology.html#eras%2D%2D[eras]() (java 9)

  • [[painless-api-reference-Chronology-getCalendarType-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/Chronology.html#getCalendarType%2D%2D[getCalendarType]() (java 9)

  • [[painless-api-reference-Chronology-getDisplayName-2]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/Chronology.html#getDisplayName%2Djava.time.format.TextStyle%2Djava.util.Locale%2D[getDisplayName](<<painless-api-reference-TextStyle,TextStyle>>, <<painless-api-reference-Locale,Locale>>) (java 9)

  • [[painless-api-reference-Chronology-getId-0]]<<painless-api-reference-String,String>> link:{java8-javadoc}/java/time/chrono/Chronology.html#getId%2D%2D[getId]() (java 9)

  • [[painless-api-reference-Chronology-hashCode-0]]int link:{java8-javadoc}/java/time/chrono/Chronology.html#hashCode%2D%2D[hashCode]() (java 9)

  • [[painless-api-reference-Chronology-isLeapYear-1]]boolean link:{java8-javadoc}/java/time/chrono/Chronology.html#isLeapYear%2Dlong%2D[isLeapYear](long) (java 9)

  • [[painless-api-reference-Chronology-localDateTime-1]]<<painless-api-reference-ChronoLocalDateTime,ChronoLocalDateTime>> link:{java8-javadoc}/java/time/chrono/Chronology.html#localDateTime%2Djava.time.temporal.TemporalAccessor%2D[localDateTime](<<painless-api-reference-TemporalAccessor,TemporalAccessor>>) (java 9)

  • [[painless-api-reference-Chronology-period-3]]<<painless-api-reference-ChronoPeriod,ChronoPeriod>> link:{java8-javadoc}/java/time/chrono/Chronology.html#period%2Dint%2Dint%2Dint%2D[period](int, int, int) (java 9)

  • [[painless-api-reference-Chronology-prolepticYear-2]]int link:{java8-javadoc}/java/time/chrono/Chronology.html#prolepticYear%2Djava.time.chrono.Era%2Dint%2D[prolepticYear](<<painless-api-reference-Era,Era>>, int) (java 9)

  • [[painless-api-reference-Chronology-range-1]]<<painless-api-reference-ValueRange,ValueRange>> link:{java8-javadoc}/java/time/chrono/Chronology.html#range%2Djava.time.temporal.ChronoField%2D[range](<<painless-api-reference-ChronoField,ChronoField>>) (java 9)

  • [[painless-api-reference-Chronology-resolveDate-2]]<<painless-api-reference-ChronoLocalDate,ChronoLocalDate>> link:{java8-javad