mn8 Language Reference | Index    

Character

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  NO CONSTRUCTORS  OPERATORS SUMMARY  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  NO CONSTRUCTORS  OPERATOR DETAILS  METHOD DETAILS

Description

A lexical character constant evaluates to a value of type character (or char). Characters are enclosed with single quotes. The internal coding of characters is Unicode. Character expressions may contain escape sequences that denote special characters.

Usage

        Character Expressions
            Expression    Value     Value Type
            ----------    ------    ----------
            'a'           'a'       Character
            '\n'          '\n'      Character
            'a' + 'b'     "ab"      String

        Escape Sequences
            Escape    Description
            \b        Backspace
            \t        Horizontal tab
            \n        Newline
            \f        Form feed
            \r        Carriage return
            \"        Double quote
            \'        Single quote
            \\        Backslash
            \xxx      Character of octal value xxx
            \uxxxx    Character of hexadecimal value xxxx

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Location:
Inherits: Concept

Operator List

String+ (Character $char)
Logical< (Character $char)
Logical== (Character $char)
Character+ (Nil $nil)
Logical> (Character $char)
top

Method List

static StringgetEOLChar
StringgetType
IntegergetUnicodeNumericValue
LogicalisControl
LogicalisDigit
LogicalisLetter
LogicalisLetterOrDigit
LogicalisLowerCase
LogicalisUpperCase
LogicalisWhitespace
IntegertoIntegerConcept
CharactertoLowerCase
StringtoStringConcept
CharactertoUpperCase
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI

Detailed Operator Info

+ (Character $char)
Parameters:
$char :Adds the parameter to this concept.

Returns a string which contains this concept and the character given as parameter.

top
< (Character $char)
Parameters:
$char :To this will be compared this concept.

Returns true if this concept value is smaller then the parameters value, false otherwise.

top
== (Character $char)
Parameters:
$char :To this will be compared this concept.

Returns true if this concept equals with parameter or false otherwise.

top
+ (Nil $nil)
Parameters:
$nil :

top
> (Character $char)
Parameters:
$char :To this will be compared this concept.

Returns true if this concept value is greater then the parameters value, false otherwise.

top

Detailed Method Info

static getEOLChar
Returns: String

Returns the desired EOL character.
This character defaults to the platform specific character, (Windows: \r\n, Unix flawors: \n, MacOS: \r) but it can be changed in the mn8config.xml file.

            print Character.getEOLChar
            -- the result is --


            

top
getType
Returns: String

Returns this concepts type.

            $c = 'a'
            print $c.getType
            -- the result is --
            LOWERCASE_LETTER
            

top
getUnicodeNumericValue
Returns: Integer

Returns an integer with this concept unicode value.

            $c = 'a'
            print $c.getUnicodeNumericValue
            -- the result is --
            10
            

top
isControl
Returns: Logical

Determines whether this concept is control or is not. Returns true if this concept is control, false otherwise.

            $c = '\n'
            print $c.isControl
            -- the result is --
            true
            

top
isDigit
Returns: Logical

Determines whether this concept is a digit or is not. Returns true if this concept is a digit, false otherwise.

            $c = '3'
            print $c.isDigit
            -- the result is --
            true
            

top
isLetter
Returns: Logical

Determines whether this concept is a letter or is not. Returns true if this concept is a letter, false otherwise.

            $c = 'a'
            print $c.isLetter
            -- the result is --
            true
            

top
isLetterOrDigit
Returns: Logical

Determines whether this concept is a letter or digit or is not. Returns true if this concept is a letter or digit, false otherwise.

            $c = 'a'
            print $c.isLetterOrDigit
            -- the result is --
            true
            

top
isLowerCase
Returns: Logical

Determines whether this concept is lowercase or is not. Returns true if this concept is lowercase, false otherwise.

            $c = 'a'
            print $c.isLowerCase
            -- the result is --
            true
            

top
isUpperCase
Returns: Logical

Determines whether this concept is uppercase or is not. Returns true if this concept is uppercase, false otherwise.

            $c = 'A'
            print $c.isUpperCase
            -- the result is --
            true
            

top
isWhitespace
Returns: Logical

Determines whether this concept is whitespace or is not. Returns true if this concept is whitespace, false otherwise.

            $c = '\n'
            print $c.isWhitespace
            -- the result is --
            true
            

top
toIntegerConcept
Returns: Integer

Returns an integer concept with this concept value.

            $c = 'a'
            print $c.toIntegerConcept
            -- the result is --
            97
            

top
toLowerCase
Returns: Character

Returns a character concept with this concept lowercase equivalent.

            $c = 'A'
            print $c.toLowerCase
            -- the result is --
            a
            

top
toStringConcept
Returns: String

Returns a string concept representing this concept's value.

            $c = 'a'
            print $c.toStringConcept
            -- the result is --
            a
            

top
toUpperCase
Returns: Character

Returns a character concept with this concept uppercase equivalent.

            $c = 'a'
            print $c.toUpperCase
            -- the result is --
            A
            

top