## org.eclipse.ocl.util
Class OCLStandardLibraryUtil

    java.lang.Object
      org.eclipse.ocl.util.OCLStandardLibraryUtil

    public final class OCLStandardLibraryUtil

extends Object

Convenience utilities for working with the types defined by the OCL Standard Library.

See the `Environment` class for a description of the generic type parameters of this class.

Field Summary
`static String` `PRODUCT_FIRST` The name of the tuple part carrying elements of the source collection in a `product` operation.
`static String` `PRODUCT_SECOND` The name of the tuple part carrying elements of the argument collection in a `product` operation.

Method Summary

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createAnyTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `OclAny` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createBagIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the pre-defined iterators of the `Bag(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createBagOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Bag(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createBooleanOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Boolean` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createCollectionIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the pre-defined iterators of the `Collection(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createCollectionOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Collection(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createIntegerOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Integer` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createMessageTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `OclMessage` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createOrderedSetIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the pre-defined iterators of the `OrderedSet(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createOrderedSetOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `OrderedSet(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createRealOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Real` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createSequenceIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the pre-defined iterators of the `Sequence(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createSequenceOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Sequence(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createSetIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the pre-defined iterators of the `Set(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createSetOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `Set(T)` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createStringOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `String` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createTypeTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `OclType` type of the OCL Standard library.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O>`

`

`createUnlimitedNaturalOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)`
Utility method creating the operations of the `UnlimitedNatural` type of the OCL Standard library.

`static int` `getOclAnyOperationCode(String operName)` Obtains the numeric code of the specified `OclAny` operaiton.
`static int` `getOperationCode(String operName)` Obtains the numeric code of the specified pre-defined (by OCL) operaiton.
`static String` `getOperationName(int opcode)` Returns the operation name corresponding to the opcode.

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> C`

`

`getResultTypeOf(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env, C sourceType, int opcode, List<? extends TypedElement<C>> args)`
Deprecated. Use the `getResultTypeOf(Object, Environment, Object, int, List)` method, instead, which doesn't fail on the first problem

`static

`<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> C`

`

`getResultTypeOf(Object problemObject, Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env, C sourceType, int opcode, List<? extends TypedElement<C>> args)`
Obtains the result type of the specified operation from the OCL Standard Library.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PRODUCT_FIRST

    public static final String PRODUCT_FIRST

  The name of the tuple part carrying elements of the source collection in a `product` operation.

  See Also:
    Constant Field Values

### PRODUCT_SECOND

    public static final String PRODUCT_SECOND

  The name of the tuple part carrying elements of the argument collection in a `product` operation.

  See Also:
    Constant Field Values

Method Detail

### getOperationCode

    public static int getOperationCode(String operName)

  Obtains the numeric code of the specified pre-defined (by OCL) operaiton.

  Parameters:
    `operName` - the operation name
  Returns:
    the corresponding code (as defined by the `PredefinedType` interface), or `0` if the operation name is not a pre-defined operation
  See Also:
    `getOperationName(int)`

### getOclAnyOperationCode

    public static int getOclAnyOperationCode(String operName)

  Obtains the numeric code of the specified `OclAny` operaiton.

  Parameters:
    `operName` - the operation name
  Returns:
    the corresponding code (as defined by the `PredefinedType` interface), or `0` if the operation name is not an operation of the `OclAny` type

### getOperationName

    public static String getOperationName(int opcode)

  Returns the operation name corresponding to the opcode.

  Parameters:
    `opcode` - an operation code
  Returns:
    the name corresponding to the opcode, or `null` if the code is not one defined by the `PredefinedType` interface
  See Also:
    `getOperationCode(String)`

### getResultTypeOf

    @Deprecated
    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> C getResultTypeOf(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env,
                                                                                    C sourceType,
                                                                                    int opcode,
                                                                                    List<? extends TypedElement<C>> args)
                             throws SemanticException

  Deprecated. Use the `getResultTypeOf(Object, Environment, Object, int, List)` method, instead, which doesn't fail on the first problem

  Obtains the result type of the specified operation from the OCL Standard Library. Many of the OCL Standard Library operations are either generic themselves or defined by generic types, so the return results depend on the argument and source types.

  Parameters:
    `env` - an OCL environment (indicating the metamodel binding)
    `sourceType` - the type of the operation source (object on which the operation is called)
    `opcode` - the operation's code
    `args` - the arguments of the operation call, as expressions or variables
  Returns:
    the result type of the corresponding operation
  Throws:
    `SemanticException` - if any of the argument types does not correspond to the source type and/or expected parameter types of the operation
  See Also:
    `getOperationCode(String)`

### getResultTypeOf

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> C getResultTypeOf(Object problemObject,
                                                                         Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env,
                                                                         C sourceType,
                                                                         int opcode,
                                                                         List<? extends TypedElement<C>> args)

  Obtains the result type of the specified operation from the OCL Standard Library. Many of the OCL Standard Library operations are either generic themselves or defined by generic types, so the return results depend on the argument and source types.

  Parameters:
    `env` - an OCL environment (indicating the metamodel binding)
    `sourceType` - the type of the operation source (object on which the operation is called)
    `opcode` - the operation's code
    `args` - the arguments of the operation call, as expressions or variables
  Returns:
    the result type of the corresponding operation, or null after reporting a problem to env if any of the argument types do not correspond to the source type and/or expected parameter types of the operation
  See Also:
    `getOperationCode(String)`

### createAnyTypeOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createAnyTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `OclAny` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `OclAny`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `OclAny` operations

### createTypeTypeOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createTypeTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `OclType` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `OclType`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `OclType` operations

### createMessageTypeOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createMessageTypeOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `OclMessage` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `OclMessage`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `OclMessage` operations

### createStringOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createStringOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `String` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `String`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `String` operations

### createRealOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createRealOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Real` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Real`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Real` operations

### createIntegerOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createIntegerOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Integer` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Integer`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Integer` operations

### createUnlimitedNaturalOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createUnlimitedNaturalOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `UnlimitedNatural` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Integer`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `UnlimitedNatural` operations

### createBooleanOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createBooleanOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Boolean` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Boolean`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Boolean` operations

### createCollectionOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createCollectionOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Collection(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Collection(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Collection(T)` operations

### createSetOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createSetOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Set(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Set(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Set(T)` operations

### createOrderedSetOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createOrderedSetOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `OrderedSet(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `OrderedSet(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `OrderedSet(T)` operations

### createBagOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createBagOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Bag(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Bag(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Bag(T)` operations

### createSequenceOperations

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createSequenceOperations(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the operations of the `Sequence(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Sequence(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the standard `Sequence(T)` operations

### createCollectionIterators

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createCollectionIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the pre-defined iterators of the `Collection(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Collection(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the pre-defined iterators of the `Collection(T)` type

### createSetIterators

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createSetIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the pre-defined iterators of the `Set(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Set(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the pre-defined iterators of the `Set(T)` type

### createOrderedSetIterators

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createOrderedSetIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the pre-defined iterators of the `OrderedSet(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `OrderedSet(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the pre-defined iterators of the `OrderedSet(T)` type

### createBagIterators

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createBagIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the pre-defined iterators of the `Bag(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Bag(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the pre-defined iterators of the `Bag(T)` type

### createSequenceIterators

    public static <PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> List<O> createSequenceIterators(Environment<PK,C,O,P,EL,PM,ST,COA,SSA,CT,CLS,E> env)

  Utility method creating the pre-defined iterators of the `Sequence(T)` type of the OCL Standard library. This is useful for implementors of metamodel bindings (`Environment`s) to initialize their implementations of the `Sequence(T)`.

  Parameters:
    `env` - an OCL environment
  Returns:
    a list of new operations representing the pre-defined iterators of the `Sequence(T)` type

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.