org.eclipse.ocl.examples.library.string
Class StringSubstringOperation

java.lang.Object
  extended by org.eclipse.ocl.examples.library.AbstractFeature
      extended by org.eclipse.ocl.examples.library.AbstractOperation
          extended by org.eclipse.ocl.examples.library.AbstractTernaryOperation
              extended by org.eclipse.ocl.examples.library.string.StringSubstringOperation
All Implemented Interfaces:
LibraryFeature, LibraryOperation, LibraryTernaryOperation, CallableImplementation

public class StringSubstringOperation
extends AbstractTernaryOperation

StringSubstringOperation realises the String::substring() library operation.

Since:
3.1

Field Summary
static StringSubstringOperation INSTANCE
           
 
Constructor Summary
StringSubstringOperation()
           
 
Method Summary
 Value evaluate(ValueFactory valueFactory, Value source, Value arg1, Value arg2)
          Return the result of evaluating the operation on source with arg1 and arg2.
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractTernaryOperation
evaluate
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractOperation
evaluate, evaluateArgument, getNumArguments
 
Methods inherited from class org.eclipse.ocl.examples.library.AbstractFeature
validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.pivot.evaluation.CallableImplementation
evaluate, validate
 

Field Detail

INSTANCE

public static final StringSubstringOperation INSTANCE
Constructor Detail

StringSubstringOperation

public StringSubstringOperation()
Method Detail

evaluate

public Value evaluate(ValueFactory valueFactory,
                      Value source,
                      Value arg1,
                      Value arg2)
               throws InvalidValueException
Description copied from interface: LibraryTernaryOperation
Return the result of evaluating the operation on source with arg1 and arg2. An invalid return may be indicated by throwing an exception returning Java null or OCL invalid.

source - source argument
arg1 - first argument
arg2 - second argument
Returns:
the evaluated value
Throws:
InvalidValueException