Dresden OCL Toolkit

tudresden.ocl.lib
Class OclString

java.lang.Object
  extended bytudresden.ocl.lib.OclAny
      extended bytudresden.ocl.lib.OclString
All Implemented Interfaces:
Cloneable, OclRoot, OclSizable

public class OclString
extends OclAny
implements OclSizable

This class represents the basic OCL type String.

Author:
Frank Finger

Field Summary
private  String sValue
          The value of this OclString, stored as a java.lang.String.
 
Fields inherited from class tudresden.ocl.lib.OclAny
 
Constructor Summary
OclString(int dummy, String reason)
          constructor for undefined OclString
OclString(String str)
          package-visible constructor for OclString
 
Method Summary
 OclString concat(OclString s)
           
 boolean equals(Object o)
           
 OclRoot getFeature(String name)
          This method returns an undefined value.
 String getString()
           
 int hashCode()
           
 OclBoolean isEqualTo(Object o)
          Two OclStrings are equal if their java.lang.String values are equal and none of them is undefined.
 OclBoolean isNotEqualTo(Object o)
          Returns the negated result of isEqualTo.
 OclBoolean oclIsKindOf(OclType type)
          This method returns true if the OclType given as parameter is a type of the object whose method is called or a supertype of such a type.
 OclType oclType()
          This property is no longer present in OCL 1.3.
 OclInteger size()
          An operation representing the size property defined on collections and strings.
 OclString substring(OclInteger lower, OclInteger upper)
           
 OclString toLower()
           
 String toString()
           
 OclString toUpper()
           
 
Methods inherited from class tudresden.ocl.lib.OclAny
getFeatureAsCollection, getUndefinedReason, isUndefined, oclAsType, oclInState, oclIsTypeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface tudresden.ocl.lib.OclRoot
getFeatureAsCollection, getUndefinedReason, isUndefined
 

Field Detail

sValue

private String sValue
The value of this OclString, stored as a java.lang.String. Must not be null.

Constructor Detail

OclString

public OclString(String str)
package-visible constructor for OclString

Parameters:
str - the String to be represented; must not be null.

OclString

public OclString(int dummy,
                 String reason)
constructor for undefined OclString

Method Detail

isEqualTo

public OclBoolean isEqualTo(Object o)
Two OclStrings are equal if their java.lang.String values are equal and none of them is undefined.

Specified by:
isEqualTo in interface OclRoot
Specified by:
isEqualTo in class OclAny

hashCode

public int hashCode()

equals

public boolean equals(Object o)

isNotEqualTo

public OclBoolean isNotEqualTo(Object o)
Description copied from interface: OclRoot
Returns the negated result of isEqualTo.

Specified by:
isNotEqualTo in interface OclRoot
Overrides:
isNotEqualTo in class OclAny
Returns:
the negateted result of isEqualTo
See Also:
isEqualTo(Object o)

size

public OclInteger size()
Description copied from interface: OclSizable
An operation representing the size property defined on collections and strings.

Specified by:
size in interface OclSizable
Returns:
the number of characters of this OclString, or an undefined Integer value if this string is undefined

concat

public OclString concat(OclString s)
Returns:
the concatenation of this OclString and the operations parameter.

toUpper

public OclString toUpper()
Returns:
an OclString like this with all characters converted to upper case

toLower

public OclString toLower()
Returns:
an OclString like this with all characters converted to upper case

substring

public OclString substring(OclInteger lower,
                           OclInteger upper)
Returns:
the substring of this OclString starting at character number lower, up to and including character number upper; the first character of an OclString has the number 1
Throws:
OclRuntimeException

getFeature

public OclRoot getFeature(String name)
This method returns an undefined value.

Specified by:
getFeature in interface OclRoot
Specified by:
getFeature in class OclAny

getString

public String getString()

toString

public String toString()

oclIsKindOf

public OclBoolean oclIsKindOf(OclType type)
Description copied from class: OclAny
This method returns true if the OclType given as parameter is a type of the object whose method is called or a supertype of such a type.

Overrides:
oclIsKindOf in class OclAny
See Also:
OclAny.oclIsKindOf(OclType type)

oclType

public OclType oclType()
This property is no longer present in OCL 1.3. In spite of this, the library contains this method. The problems that lead to its cancellation do not occur in this Java implementation.

Overrides:
oclType in class OclAny

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.