Types
String
Available operations for Strings:
- substring (lower : int, upper : int) :
String
- returns the substring from index lower to index upper
- subStringBefore (beforeString: String) :
String
- returns the substring of this string occurring before the
‘beforeString’
- subStringAfter (afterString: String) :
String
- returns the substring of this string occurring after the
‘afterString’
- toLower () : String
- converts the string to lower case
- toUpper () : String
- converts the string to upper case
- firstToUpper () : String
- converts the first letter of the string to upper case
- firstToLower () : String
- converts the first letter of the string to lower case
- size () : int
- returns the size of the string
- indexOf (indexStr : String) : int
- returns the index of the first occurrence of the
‘indexStr’ or -1 if it does not exist.
- endsWith (str : String) : Boolean
- returns true if the string ends with ‘str’, else false
- startsWith (str : String) :
Boolean
- returns true if the string starts with
‘str’, else false
- trim () : String
- removes all trailing and leading white space
- normalizeSpace () : String
- Trims the
string and replaces all sequences of white space characters with a
single space.
- replace (replaceWhat : String , withWhat
: String) : String
- replaces all occurrences that matches the regular
expression ‘replaceWhat’ with the ‘withWhat’
string
- equals (str : String) : Boolean
- returns true if the string is equals to ‘str’, else false
- equalsIgnoreCase (str : String) :
Boolean
- returns true if the string is equal to the string
‘str’ ignoring casing
- isUpperCase (int index) : Boolean
- returns true if character at position ‘index’ is upper
case. If no index is given, first posision (index=0) is used.
- isLowerCase (int index) : Boolean
- returns true if character at posision ‘index’ is lower
case. If no index is given, first posision (index=0) is used.
- charAt (int index) : String
- returns the character (as a String) at posision ‘index’.
- forEach ()
Integer
The Integer type represents integer values.
Available operations for integers:
Real
Boolean
List
The List type represents an ordered list. A List is untyped and can contain any kind of values or objects.
Available operations for the List type:
- add (e:Object) : Boolean
- remove (e:Object) : Boolean
- size () : Integer
- clear () : void
- first () : Object
- last () : Object
- isEmpty () : Boolean
- forEach () [iterator operation]
Hashtable (Dictionary)
The Hashtable type represents a dictionary of key/value pairs. It's semantics is similar to that of Java Hashtable.
Available operations for the Hashtable type
- put (key: Object, value: Object)
- get (key: Object)
- size () : Integer
- clear () : void
- keys () : List
- values () : List
- first () : Object
- last () : Object
- isEmpty () : Boolean
- forEach () [iterator operation]
Object
The Object type can represent any type. Variables of this type may reference any kind of value or object.
Available operation for object types (i.e. for any kind of object):
- oclGetType ()
- oclIsTypeOf ()
- oclIsKindOf ()
Model Collection Operations
- size () : int
- first () : Object
- last () : Object
- isEmpty (): Boolean
- forEach () [ Iterator operation]