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.
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
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 |
|
Parameters: |
$value : | the initial value of the Byte concept. |
|
Constructs a Byte concept initialized to the specified Integer concept.
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.
Parameters: |
$value : | the Byte concept to be compared. |
|
Compares two Byte concepts numerically.Returns :
- the value 0 if the argument Byte is equal to this Byte;
- a value less than 0 if this Byte is numerically less than the Byte argument;
- and a value greater than 0 if this Byte is numerically greater than the Byte argument.
$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
Parameters: |
$str : | the String concept to decode. |
|
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:
- [-] decimal constant
- [-] 0x hex constant
- [-] # hex constant
- [-] 0 octal constant
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
Returns the value of this Byte as an Integer.
$b = Byte.create(20)
print $b.getInteger
-- the result is --
20
Returns the value of this Byte as an Real.
$b = Byte.create(20)
print $b.getReal
-- the result is --
20.0