mn8 Language Reference | Index    

Byte

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

Description

A lexical byte constant evaluates to a value of type byte. The internal representation of bytes is 8-bit signed two's-complement. Overflows or underflow's during byte computations do not throw exceptions.

Usage

Compare to byte concept and return difference between two byte concept.

            print Byte.create(12).comapreTo( Byte.create(10) ) ---> 2

For convert the byte concept to Integer or Real concept use:

            print Byte.create(12).getInteger.getConceptType ---> Integer
            print Byte.create(20).getReal.getConceptType ---> Real 

Version: 0.1
Authors:Szabo Csaba ()
Location:
Inherits: Concept

Constructor List

create (Integer $value)
create (String $value)
top

Method List

IntegercompareTo (Byte $value)
static Bytedecode (String $str)
IntegergetInteger
RealgetReal
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 Constructor Info

create (Integer $value)
Parameters:
$value :the initial value of the Byte concept.

Constructs a Byte concept initialized to the specified Integer concept.

top
create (String $value)
Parameters:
$value :the String concept to be converted to a Byte concept.
Exceptions:
unparsableNumberException :
(Error)
If the String does not contain a parsable byte.

Constructs a Byte concept initialized to the value specified by the String parameter.

top

Detailed Method Info

compareTo (Byte $value)
Parameters:
$value :the Byte concept to be compared.
Returns: Integer

Compares two Byte concepts numerically.Returns :

            $b = Byte.create(20)
            print $b.compareTo(Byte.create(15))
            print $b.compareTo(Byte.create(20))
            print $b.compareTo(Byte.create(22))
            -- the result is --
            5
            0
            -2
            

top
static decode (String $str)
Parameters:
$str :the String concept to decode.
Returns: Byte
Exceptions:
unparsableNumberException :
(Error)
If the String does not contain a parsable byte.

Decodes a String concept into a Byte concept. Accepts decimal, hexadecimal, and octal numbers, in the following formats:

The result is made negative if first character of the specified String is the negative sign.
No whitespace characters are permitted in the String.

            print Byte.decode("#5D")
            -- the result is --
            93
            

top
getInteger
Returns: Integer

Returns the value of this Byte as an Integer.

            $b = Byte.create(20)
            print $b.getInteger
            -- the result is --
            20
            

top
getReal
Returns: Real

Returns the value of this Byte as an Real.

            $b = Byte.create(20)
            print $b.getReal
            -- the result is --
            20.0
            

top