org.eclipse.january.dataset

## Class Operations

- java.lang.Object
- - org.eclipse.january.dataset.Operations

-     public class Operations
      extends Object

  Since:
    2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Operations.Addition` Addition with boolean or
    `static class` | `Operations.Division` Division with boolean and of negated second operand
    `static class` | `Operations.DivisionTowardsFloor` Division with boolean and of negated second operand and rounds down to negative infinity
    `static class` | `Operations.DivisionWithZero` Division with boolean and of negated second operand and returns zero if denominator is zero
    `static class` | `Operations.Exponentiation` Exponentiation with boolean and
    `static class` | `Operations.Maximum` Select maximum of a and b
    `static class` | `Operations.Minimum` Select minimum of a and b
    `static class` | `Operations.Multiplication` Multiplication with boolean and
    `static class` | `Operations.Negation` Negation with boolean not
    `static class` | `Operations.Remainder` Remainder
    `static class` | `Operations.Subtraction` Subtraction with boolean or of negated second operand
    `static class` | `Operations.UseBase` Use given value if `a > b` else use a
    `static class` | `Operations.UseIfEqualTo` Use given value if `a == b` else use a
    `static class` | `Operations.UseIfGreaterThan` Use given value if `a > b` else use a
    `static class` | `Operations.UseIfGreaterThanOrEqualTo` Use given value if `a >= b` else use a
    `static class` | `Operations.UseIfLessThan` Use given value if `a < b` else use a
    `static class` | `Operations.UseIfLessThanOrEqualTo` Use given value if `a <= b` else use a

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Operations()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static StringBuilder` | `bracketIfNecessary(String a)` This function returns the name of the dataset, bracketed if it already includes some mathematical symbol
    `static String` | `createBinaryOperationName(String operator, String a, String b)` Create a string for a binary operator and its operands
    `static String` | `createFunctionName(String function, String... arguments)` Create a string for a function and its arguments
    `static Dataset` | `operate(BinaryOperation op, Object a, Object b, Dataset o)` Operate on a dataset
    `static Dataset` | `operate(UnaryOperation op, Object a, Dataset o)` Operate on a dataset

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Operations

          public Operations()

  - ### Method Detail

    - #### bracketIfNecessary

          public static StringBuilder bracketIfNecessary(String a)

      This function returns the name of the dataset, bracketed if it already includes some mathematical symbol
      Parameters:
        `a` -
      Returns:
        the bracketed if necessary method name

    - #### createBinaryOperationName

          public static String createBinaryOperationName(String operator,
                                         String a,
                                         String b)

      Create a string for a binary operator and its operands
      Parameters:
        `operator` -
        `a` - 1st operand name
        `b` - 2nd operand name
      Returns:
        name of operation

    - #### createFunctionName

          public static String createFunctionName(String function,
                                  String... arguments)

      Create a string for a function and its arguments
      Parameters:
        `function` -
        `arguments` -
      Returns:
        name of function

    - #### operate

          public static Dataset operate(UnaryOperation op,
                        Object a,
                        Dataset o)

      Operate on a dataset
      Parameters:
        `op` - unary operator
        `a` - dataset
        `o` - output can be null - in which case, a new dataset is created
      Returns:
        op(a), operation on a

    - #### operate

          public static Dataset operate(BinaryOperation op,
                        Object a,
                        Object b,
                        Dataset o)

      Operate on a dataset
      Parameters:
        `op` - binary operator
        `a` -
        `b` -
        `o` - output can be null - in which case, a new dataset is created
      Returns:
        a op b, operation on a and b

Copyright © 2014–2018 Eclipse Foundation. All rights reserved.