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

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.library.AbstractFeature
      extended by org.eclipse.ocl.examples.domain.library.AbstractOperation
          extended by org.eclipse.ocl.examples.domain.library.AbstractUnaryOperation
              extended by org.eclipse.ocl.examples.library.string.StringSizeOperation
All Implemented Interfaces:
LibraryFeature, LibraryOperation, LibraryUnaryOperation

public class StringSizeOperation
extends AbstractUnaryOperation

StringSizeOperation realises the String::size() library operation.


Field Summary
static StringSizeOperation INSTANCE
           
 
Constructor Summary
StringSizeOperation()
           
 
Method Summary
 Value evaluate(DomainEvaluator evaluator, DomainType returnType, Value sourceVal)
          Return the result of evaluating the operation on an argument.
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractUnaryOperation
evaluate
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractOperation
argumentsMayBeInvalid
 
Methods inherited from class org.eclipse.ocl.examples.domain.library.AbstractFeature
getLibraryValidator, getValidator
 
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.domain.library.LibraryOperation
argumentsMayBeInvalid
 
Methods inherited from interface org.eclipse.ocl.examples.domain.library.LibraryFeature
getValidator
 

Field Detail

INSTANCE

public static final StringSizeOperation INSTANCE
Constructor Detail

StringSizeOperation

public StringSizeOperation()
Method Detail

evaluate

public Value evaluate(DomainEvaluator evaluator,
                      DomainType returnType,
                      Value sourceVal)
               throws InvalidValueException
Description copied from interface: LibraryUnaryOperation
Return the result of evaluating the operation on an argument. An invalid return may be indicated by throwing an exception returning Java null or OCL invalid.

Returns:
the evaluated value
Throws:
InvalidValueException