de.tuberlin.cs.cis.ocl.eval.instance
Class StringInstance

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.eval.instance.PredefinedInstance
        |
        +--de.tuberlin.cs.cis.ocl.eval.instance.OclAnyInstance
              |
              +--de.tuberlin.cs.cis.ocl.eval.instance.StringInstance
All Implemented Interfaces:
Instance, OclAny, OclString

public class StringInstance
extends OclAnyInstance
implements OclString

Represents an instance of the OCL type String.

Author:
fchabar

Constructor Summary
StringInstance(java.lang.String value)
          Constructs an instance of the OCL type String via a Java String.
 
Method Summary
 OclString concat(OclString string2)
          Results in the concatenation of this instance and string2.
 OclInteger size()
          Results in the number of characters in string.
static java.lang.String stringValue(OclString s2)
          Determines the Java OclString representation of an OclString.
 OclString substring(OclInteger lower, OclInteger upper)
          Results in the sub-string of this instance starting at character number lower, up to and including character number upper.
 OclString toLower()
          Results in the value of this instance with all uppercase characters converted to lowercase characters.
 OclString toUpper()
          Results in the value of this instance with all lowercase characters converted to uppercase characters.
 
Methods inherited from class de.tuberlin.cs.cis.ocl.eval.instance.OclAnyInstance
eq, equals, neq, oclAsType, oclInState, oclIsKindOf, oclIsNew, oclIsTypeOf
 
Methods inherited from class de.tuberlin.cs.cis.ocl.eval.instance.PredefinedInstance
getRepresentation, getRuntimeType, getValue, hashCode, invoke, navigate, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.tuberlin.cs.cis.ocl.type.reflect.OclAny
eq, neq, oclAsType, oclInState, oclIsKindOf, oclIsNew, oclIsTypeOf
 

Constructor Detail

StringInstance

public StringInstance(java.lang.String value)
Constructs an instance of the OCL type String via a Java String.

Parameters:
value - a Java String.
Method Detail

stringValue

public static java.lang.String stringValue(OclString s2)
Determines the Java OclString representation of an OclString.

Parameters:
s2 - an OclString
Returns:
the Java OclString representation of the specified OCL String.

size

public OclInteger size()
Description copied from interface: OclString
Results in the number of characters in string.

Specified by:
size in interface OclString
Returns:
the number of characters in string.

concat

public OclString concat(OclString string2)
Description copied from interface: OclString
Results in the concatenation of this instance and string2.

Specified by:
concat in interface OclString
Parameters:
string2 - an instance of String (!= null)
Returns:
the concatenation of string and string2.

toUpper

public OclString toUpper()
Description copied from interface: OclString
Results in the value of this instance with all lowercase characters converted to uppercase characters.

Specified by:
toUpper in interface OclString
Returns:
the value of this instance with all lowercase characters converted to uppercase characters.

toLower

public OclString toLower()
Description copied from interface: OclString
Results in the value of this instance with all uppercase characters converted to lowercase characters.

Specified by:
toLower in interface OclString
Returns:
the value of this instance with all uppercase characters converted to lowercase characters.

substring

public OclString substring(OclInteger lower,
                           OclInteger upper)
Description copied from interface: OclString
Results in the sub-string of this instance starting at character number lower, up to and including character number upper.

Specified by:
substring in interface OclString
Parameters:
lower - the lower bound of the sub-string (!= null)
upper - the upper bound of the sub-string (!= null)
Returns:
the sub-string of this instance starting at character number lower, up to and including character number upper.