FRAMES
NO FRAMES
| |||||||

| |||||||

SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |

Type integer

64-bit signed integer type.

Values of the

Integers can be parsed and they are routable and comparable. Integers are non-cyclic.

Integers have the following operators available on them:

< | Less-than comparison |

<= | Less-than or equal comparison |

= | Equal comparison |

!= | Not equal comparison |

> | Greater-than comparison |

>= | Greater-than or equals comparison |

+ | Unary integral identity |

- | Unary integral additive inverse |

+ | Integral addition |

- | Integral subtraction |

* | Integral multiplication |

/ | Integral division |

% | Integral remainder |

or | Bitwise or |

and | Bitwise and |

xor | Bitwise exclusive or |

not | Unary bitwise inverse |

>> | Bitwise shift right |

<< | Bitwise shift left |

An attempt to divide by zero (0) or to compute a remainder of zero will throw an exception. Overflows and underflows are ignored.

When you use the shift operators, the sign of a result value can differ from that of the operand value being shifted. When you use

Constant summary | |
---|---|

` integer` |
Largest positive value an integer can take (2 ^{63}-1). |

` integer` |
Largest negative value an integer can take (-2 ^{63}). |

Action summary | |
---|---|

` integer` |
Get the absolute value of this integer. |

` boolean` | `static `
Check if the string argument can be parsed as an integer. |

` integer` | `static `
Get a globally-unique integer. |

` integer` |
Get an integer hash representation of the underlying object. |

` integer` | `static `
Increment and return the value of a named counter. Counters are useful as unique identifiers for request-response. |

` integer` | `static `
Return the larger of two integers. |

` integer` | `static `
Return the smaller of two integers. |

` integer` | `static `
Parse a string to an integer. |

` integer` |
Calculate this number to the power of the exponent. |

` integer` |
Generate a random number. |

` decimal` |
Convert this integer to a decimal. |

` float` |
Convert this integer to a float. |

` string` |
Convert this integer to a string. |

Constant detail |
---|

integerLargest positive value an integer can take (2MAX

integerLargest negative value an integer can take (-2MIN

Action detail |
---|

integerGet the absolute value of this integer.abs()

**Returns:**`|x|`where`x`is this integer.

boolean staticCheck if the string argument can be parsed as an integer.canParse(string s)

**Parameters:**`s`- The string to test for parseability.

**Returns:**- True if and only if
`parse`would return if called with the value`s`, false otherwise (i.e. if`parse`would throw a`ParseException`).

**See Also:**- integer#parse() - See the
`parse`method for what is parseable.

integer staticGet a globally-unique integer.getUnique()

Generates a unique integer in the scope of the correlator. It returns an integer that is unique for the correlator session's lifetime.

With correlator persistence enabled, the getUnique() counter is persisted and recovered so that it is not lost on a restart. Without persistence, when the correlator is shut down and restarted, then the integers returned might be the same as some or all of the values produced in the earlier session.

No guarantees about the value of the integer are made, other than being unique within a single correlator.

**Returns:**- A unique integer.

**See Also:**- integer#incrementCounter() - Use
`incrementCounter`if you want a monotonically increasing counter. Due to the increased predictability of the values returned by incrementCounter() and the fact they're unaffected by identifiers generated by other parts of the application, use of incrementCounter (with a suitable key) is recommended over getUnique() in situations where the value will be shared with components outside the correlator, such as for request-response identifiers passed to a connectivity plugin or adapter. This can make unit testing easier, and increases the chance of successfully reproducing application behaviour from an input log. However getUnique() is a great choice for identifiers that are not shared outside the correlator. - com.apama.correlator.Component#getComponentPhysicalId() - Combine this with the
`PhysicalId`to get a number that is unique across a cluster of correlators.

integerGet an integer hash representation of the underlying object.hash()

This function will return an integer evenly distributed over the whole range suitable for partitioning or indexing of that structure. Multiple different object can resolve to the same hash value.

**Returns:**- An integer respresentation of the underlying object.

integer staticIncrement and return the value of a named counter. Counters are useful as unique identifiers for request-response.incrementCounter(string key)

Generates a monotonically increasing integer for the specified string key, in the scope of this correlator instance. It returns an integer that is larger than the previously returned value in the correlator session's lifetime for the string key provided.

It is

Assuming the guidance above is followed, use of incrementCounter (with a suitable key) is usually recommended over getUnique() in situations where the value will be shared with components outside the correlator, such as for request-response identifiers passed to a connectivity plugin or adapter. This is because of the increased predictability of the values returned by incrementCounter() and the fact they're unaffected by identifiers generated by other parts of the application. Predictable identifiers make unit testing easier, and also increase the chance of successfully reproducing application behaviour from an input log if needed.

With correlator persistence enabled, counters are persisted and recovered so that they are not lost on a restart. Without persistence, when the correlator is shut down and restarted, then the integers returned might be the same as some or all of the values produced in the earlier session.

Keep in mind that

**Parameters:**`key`- The unique key identifying the counter to increment, for example "HTTPClientRequestId". To avoid the risk of collisions it is important to always use the exact same key for all identifiers used by a given API or connectivity plug-in. Where possible, create an EPL action to wrap creation of the identifier, to ensure it always happens in a consistent way and there is no danger of typos.

**Returns:**- The next integer for the named counter. Returned values will be 1, 2, 3, and so on for each key. The returned numbers are 64-bit signed integers.

integer staticReturn the larger of two integers.max(integer a, integer b)

**Parameters:**`a`- The first number to compare.`b`- The second number to compare.

**Returns:**- The larger of
`a`and`b`.

integer staticReturn the smaller of two integers.min(integer a, integer b)

**Parameters:**`a`- The first number to compare.`b`- The second number to compare.

**Returns:**- The smaller of
`a`and`b`.

integer staticParse a string to an integer.parse(string s)

Inputs to this method must be of the form:

Where:

For any string not conforming to the above conditions, a

**Parameters:**`s`- The string to parse.

**Returns:**- The integer corresponding to the string.

**Throws:**`ParseException`if the string cannot be parsed as an integer.

**See Also:**- string#toInteger() -
`string.toInteger`for a less strict method to parse integers.

integerCalculate this number to the power of the exponent.pow(integer exp)

**Parameters:**`exp`- The exponent to raise this integer to.

**Returns:**- Returns
`i`.^{exp}

**Throws:**`ArithmeticException`if`exp`is negative.

integerGenerate a random number.rand()

Returns a random integer value from 0 up to (but not including) the value of the variable the method was invoked on. If the operand is negative, then it returns a random integer from the value of the variable the method was invoked on up to 0.

**Returns:**- A random integer between 0 and n.

decimalConvert this integer to a decimal.toDecimal()

**Returns:**- The nearest representable decimal to this integer.

floatConvert this integer to a float.toFloat()

**Returns:**- The nearest representable float to this integer.

stringConvert this integer to a string.toString()

**Returns:**- This integer as a string of base-10 digits.

FRAMES
NO FRAMES
| |||||||

| |||||||

SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |