org.eclipse.mtl.common.utils
Class MTLStandardLibrary

java.lang.Object
  extended by org.eclipse.mtl.common.utils.MTLStandardLibrary

public final class MTLStandardLibrary
extends java.lang.Object

This will define additional operations on OCL types as defined in the MTL specification.


Field Summary
static java.lang.String OPERATION_INTEGER_TOSTRING
          Name of the "toString" standard Integer operation.
static java.lang.String OPERATION_REAL_TOSTRING
          Name of the "toString" standard Real operation.
static java.lang.String OPERATION_STRING_FIRST
          Name of the "first" standard String operation.
static java.lang.String OPERATION_STRING_INDEX
          Name of the "index" standard String operation.
static java.lang.String OPERATION_STRING_ISALPHA
          Name of the "isAlpha" standard String operation.
static java.lang.String OPERATION_STRING_ISALPHANUM
          Name of the "isAlphanum" standard String operation.
static java.lang.String OPERATION_STRING_LAST
          Name of the "last" standard String operation.
static java.lang.String OPERATION_STRING_STRCMP
          Name of the "strcmp" standard String operation.
static java.lang.String OPERATION_STRING_STRSTR
          Name of the "strstr" standard String operation.
static java.lang.String OPERATION_STRING_STRTOK
          Name of the "strtok" standard String operation.
static java.lang.String OPERATION_STRING_SUBSTITUTE
          Name of the "substitute" standard String operation.
static java.lang.String OPERATION_STRING_TOLOWERFIRST
          Name of the "toLowerFirst" standard String operation.
static java.lang.String OPERATION_STRING_TOUPPERFIRST
          Name of the "toUpperFirst" standard String operation.
 
Constructor Summary
MTLStandardLibrary()
          Initializes the standard library package along with its content.
 
Method Summary
 org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(org.eclipse.emf.ecore.EClassifier type)
          Obtains the operations declared on the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPERATION_INTEGER_TOSTRING

public static final java.lang.String OPERATION_INTEGER_TOSTRING
Name of the "toString" standard Integer operation.

toString( Integer i ) : String
Converts the integer i to a string.

See Also:
Constant Field Values

OPERATION_REAL_TOSTRING

public static final java.lang.String OPERATION_REAL_TOSTRING
Name of the "toString" standard Real operation.

toString( Real r ) : String
Converts the real r to a string.

See Also:
Constant Field Values

OPERATION_STRING_FIRST

public static final java.lang.String OPERATION_STRING_FIRST
Name of the "first" standard String operation.

first( Integer n ) : String
Returns first n characters of self, or self if size of self is less than n.

See Also:
Constant Field Values

OPERATION_STRING_INDEX

public static final java.lang.String OPERATION_STRING_INDEX
Name of the "index" standard String operation.

index( String r ) : Integer
Returns the index of substring r in self, or -1 if r is not in self.

See Also:
Constant Field Values

OPERATION_STRING_ISALPHA

public static final java.lang.String OPERATION_STRING_ISALPHA
Name of the "isAlpha" standard String operation.

isAlpha() : Boolean
Returns true if self consists only of alphabetical characters, false otherwise.

See Also:
Constant Field Values

OPERATION_STRING_ISALPHANUM

public static final java.lang.String OPERATION_STRING_ISALPHANUM
Name of the "isAlphanum" standard String operation.

isAlphanum() : Boolean
Returns true if self consists only of alphanumeric characters, false otherwise.

See Also:
Constant Field Values

OPERATION_STRING_LAST

public static final java.lang.String OPERATION_STRING_LAST
Name of the "last" standard String operation.

last( Integer n ) : String
Returns last n characters of self, or self if size of self is less than n.

See Also:
Constant Field Values

OPERATION_STRING_STRCMP

public static final java.lang.String OPERATION_STRING_STRCMP
Name of the "strcmp" standard String operation.

strcmp( String s1 ) : Integer
Returns an integer less than zero, equal to zero, or greater than zero depending on whether s1 is lexicographically less than, equal to, or greater than self.

See Also:
Constant Field Values

OPERATION_STRING_STRSTR

public static final java.lang.String OPERATION_STRING_STRSTR
Name of the "strstr" standard String operation.

strstr( String r ) : Boolean
Searches for string r in self. Returns true if found, false otherwise.

See Also:
Constant Field Values

OPERATION_STRING_STRTOK

public static final java.lang.String OPERATION_STRING_STRTOK
Name of the "strtok" standard String operation.

strtok( String s1, Integer flag ) : String
Breaks the string self into a sequence of tokens each of which is delimited by any character in string s1. The parameter flag should be 0 when strtok is called for the first time, 1 subsequently.

See Also:
Constant Field Values

OPERATION_STRING_SUBSTITUTE

public static final java.lang.String OPERATION_STRING_SUBSTITUTE
Name of the "substitute" standard String operation.

substitute( String r, String t ) : String
Substitutes substring r in self by substring t and returns the resulting string. If there is no occurrence of the substring, it returns the original string.

See Also:
Constant Field Values

OPERATION_STRING_TOLOWERFIRST

public static final java.lang.String OPERATION_STRING_TOLOWERFIRST
Name of the "toLowerFirst" standard String operation.

toLowerFirst() : String
Creates a copy of self with first character converted to lowercase and returns it.

See Also:
Constant Field Values

OPERATION_STRING_TOUPPERFIRST

public static final java.lang.String OPERATION_STRING_TOUPPERFIRST
Name of the "toUpperFirst" standard String operation.

toUpperFirst() : String
Creates a copy of self with first character converted to uppercase and returns it.

See Also:
Constant Field Values
Constructor Detail

MTLStandardLibrary

public MTLStandardLibrary()
Initializes the standard library package along with its content.

Method Detail

getExistingOperations

public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EOperation> getExistingOperations(org.eclipse.emf.ecore.EClassifier type)
Obtains the operations declared on the specified type. Note that this method returns null, not an empty list, if none are found.

Parameters:
type - The type which operation are sought.
Returns:
The operations it declares. null if none.

Copyright 2008 Obeo
All Rights Reserved.