Type Text

All Supertypes:
OclAny
All Subtypes:
String

Predefined type Text
extends OclAny

The Text type represents undefined-length ASCII character strings. Literals are between characters ' or ". A character string may contain line feeds (unix, Macintosh or DOS mode), form feeds and tabulations. It may also contain unicode characters given with their octal code postfixed to the escape character \; this code is between 0 and 377. \ can also be before: r for a Macintosh line feed n for a Unix line feed t for a tabulation f for a form feed b for a backspace ' or " to loose their literal ending property \, to loose its excape character property. Other letters are unrecognized.


Operation Summary
 Text +(Text rhs)
          Shorthand for concat.
 Boolean =(Text rhs)
          True if this string and rhs contain the same characters, in the same order.
 Boolean >=(Text rhs)
          True if this string is after or is the same as rhs in the alphabetical order.
 Boolean >(Text rhs)
          True if this string is after rhs in the alphabetical order.
 Boolean <=(Text rhs)
          True if this string is before or is the same as rhs in the alphabetical order.
 Boolean <(Text rhs)
          True if this string is before rhs in the alphabetical order.
 Boolean <>(Text rhs)
          True if this string and rhs do not contain the same characters, in the same order.
 Text concat(Text rhs)
          The concatenation of this string and rhs.
 Text crypt
          The encryption of this string.
 Boolean endsWith(Text pattern)
          True if this string ends with pattern.
 Boolean equalsIgnoreCase(Text rhs)
          True if this string and rhs contain the same case insensitive characters, in the same order.
 Sequence getChars
          A sequence of characters whose concatenation would be equal to this string.
 Integer indexOf(Text pattern)
          The index of the first occurence of the sub-string pattern.
 Integer indexOf(Text pattern, Integer offset)
          The index of the first occurence of the sub-string pattern, seeking from position offset in this string.
 Integer lastIndexOf(Text pattern)
          The index of the last occurence of the sub-string pattern.
 Integer lastIndexOf(Text pattern, Integer offset)
          The index of the last occurence of the sub-string pattern, seeking up to position offset in this string.
 Boolean like(Text pattern)
          True if this string is equivalent to pattern.
 Text replace(Text pattern, Text offset)
          This string where each occurence of the sub-string pattern is replaced by the sub-string offset.
 Integer size
          The number of characters in this string.
 Boolean startsWith(Text pattern)
          True if this string starts with pattern.
 Text substring(Integer from, Integer to)
          The sub-string of this string starting at charcter number from, up to and including character number to.
 Text toLower
          The value of this string with all uppercase characters converted to lowercase characters.
 Text toUpper
          The value of this straing with all lowercase characters converted to uppercase characters.
 
Operations inherited from type OclAny
=, <>, oclAsType, oclIsKindOf, oclIsTypeOf
 

Operations Detail

=

 public Boolean =(Text rhs)
True if this string and rhs contain the same characters, in the same order.

<>

 public Boolean <>(Text rhs)
True if this string and rhs do not contain the same characters, in the same order.

size

 public Integer size
The number of characters in this string.

concat

 public Text concat(Text rhs)
The concatenation of this string and rhs.

+

 public Text +(Text rhs)
Shorthand for concat.

toUpper

 public Text toUpper
The value of this straing with all lowercase characters converted to uppercase characters.

toLower

 public Text toLower
The value of this string with all uppercase characters converted to lowercase characters.

substring

 public Text substring(Integer from, Integer to)
The sub-string of this string starting at character number from, up to and including character number to. The first character has number 0.

crypt

 public Text crypt
The encryption of this string. Crypting is here a hashcoding.

<

 public Boolean <(Text rhs)
True if this string is before rhs in the alphabetical order.

>

 public Boolean >(Text rhs)
True if this string is after rhs in the alphabetical order.

<=

 public Boolean <=(Text rhs)
True if this string is before or is the same as rhs in the alphabetical order.

>=

 public Boolean >=(Text rhs)
True if this string is after or is the same as rhs in the alphabetical order.

like

 public Boolean like(Text pattern)
True if this string is equivalent to pattern. It is possible to use jokers in pattern: % defines a character string, _ defines a character, \\ is the escape sequence: the next character is not interpreted as a joker. Like is case sensitive. If pattern is empty, returns false.

getChars

 public Sequence getChars
A sequence of characters whose concatenation would be equal to this string.

equalsIgnoreCase

 public Boolean equalsIgnoreCase(Text rhs)
True if this string and rhs contain the same case insensitive characters, in the same order.

startsWith

 public Boolean startsWith(Text pattern)
True if this string starts with pattern. If pattern is empty, returns true. startsWith is case sensitive.

endsWith

 public Boolean endsWith(Text pattern)
True if this string ends with pattern. If pattern is empty, returns true. endsWith is case sensitive.

indexOf

 public Integer indexOf(Text pattern)
The index of the first occurence of the sub-string pattern. If no occurence is found, returns -1. The first character has a 0 index. indexOf is case sensitive.

indexOf

 public Integer indexOf(Text pattern, Integer offset)
The index of the first occurence of the sub-string pattern, seeking from position offset in this string. If no occurence is found, returns -1. The first character has a 0 index. indexOf is case sensitive.

lastIndexOf

 public Integer lastIndexOf(Text pattern)
The index of the last occurence of the sub-string pattern. If no occurence is found, returns -1. The first character has a 0 index. indexOf is case sensitive.

lastIndexOf

 public Integer lastIndexOf(Text pattern, Integer offset)
The index of the last occurence of the sub-string pattern, seeking from position offset in this string. If no occurence is found, returns -1. The first character has a 0 index. indexOf is case sensitive.

replace

 public Text replace(Text pattern, Text replacment)
This string where each occurence of the sub-string pattern is replaced by the sub-string replacment. If pattern is empty, do nothing. If replacment is empty, removes each occurence of pattern in this character string. replace is case sensitive.


Copyright 1999-2002 ObjeXion Software SA. All rights reserved.