|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inria.ns.reflex.xml.operator.AbstractXOperator
org.inria.ns.reflex.xml.operator.DefaultXOperator
org.inria.ns.reflex.xml.operator.NumberOperator
public class NumberOperator
XML operations on numbers.
Only the static methods of this class are usable directly. To use the methods of the singleton, use the master operator that ensure the type of the arguments.
Number,
XMaster| Method Summary | |
|---|---|
boolean |
booleanValueOf(Object referent)
This implementation returns the boolean value of the referent based on its string value. |
Map |
getAttributes(Object referent)
Return the facets of this number. |
short |
getNodeType(Object referent)
The referent behave like an XML text node. |
QName |
getTypeName(Object referent)
Return #xs:number. |
Number |
numberValueOf(Object referent)
This implementation returns the number value of the referent based on its string value. |
static Number |
parseNumber(String number)
Parse a number from the given string. |
static Number |
parseNumber(String number,
boolean isFloatingPoint)
Parse a number from the given string. |
static Number |
parseNumber(String number,
boolean isFloatingPoint,
Class numberClass)
Parse a number from the given string. |
static void |
register(XMaster xmaster)
Registers this operator to the master operator. |
| Methods inherited from class org.inria.ns.reflex.xml.operator.DefaultXOperator |
|---|
getChildren |
| Methods inherited from class org.inria.ns.reflex.xml.operator.AbstractXOperator |
|---|
append, append, clear, clear, clearAll, clearAll, clone, clone, getAttributeValue, getCommentAt, getElementAt, getElementById, getElementsByName, getFamilyIndex, getFamilySize, getIndex, getNamedElementAt, getNamedProcessingInstructionAt, getNameIndex, getNameSize, getNamespaces, getNext, getNodeAt, getNodeKind, getParent, getPrevious, getProcessingInstructionAt, getQName, getRoot, getSize, getStringAttributeValue, getStringName, getTextAt, getType, getTypeIndex, getTypeSize, getValue, getXFactory, getXMLType, getXOperator, insertAfter, insertAfter, insertBefore, insertBefore, isAttribute, isComment, isDocument, isElement, isParentNode, isProcessingInstruction, isText, remove, remove, removeAttribute, rename, rename, replace, replace, setAttribute, stringValueOf, update, update, valueOf |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.inria.ns.reflex.xml.operator.XOperator |
|---|
append, append, clear, clear, clearAll, clearAll, clone, clone, getAttributeValue, getChildren, getCommentAt, getElementAt, getElementById, getElementsByName, getFamilyIndex, getFamilySize, getIndex, getNamedElementAt, getNamedProcessingInstructionAt, getNameIndex, getNameSize, getNamespaces, getNext, getNodeAt, getNodeKind, getParent, getPrevious, getProcessingInstructionAt, getQName, getRoot, getSize, getStringAttributeValue, getStringName, getTextAt, getType, getTypeIndex, getTypeSize, getValue, getXFactory, getXMLType, insertAfter, insertAfter, insertBefore, insertBefore, isAttribute, isComment, isDocument, isElement, isParentNode, isProcessingInstruction, isText, remove, remove, removeAttribute, rename, rename, replace, replace, setAttribute, stringValueOf, update, update, valueOf |
| Method Detail |
|---|
public static void register(XMaster xmaster)
xmaster - The master operator.public Number numberValueOf(Object referent)
AbstractXOperator
numberValueOf in interface XOperatornumberValueOf in class AbstractXOperatorreferent - The referent.
AbstractXOperator.stringValueOf(Object),
parseNumber(String)public boolean booleanValueOf(Object referent)
AbstractXOperator
booleanValueOf in interface XOperatorbooleanValueOf in class AbstractXOperatorreferent - The referent.
AbstractXOperator.stringValueOf(Object)public short getNodeType(Object referent)
getNodeType in interface XOperatorgetNodeType in class DefaultXOperatorreferent - The referent object.
XType.TEXT_NODEpublic Map getAttributes(Object referent)
getAttributes in interface XOperatorgetAttributes in class DefaultXOperatorreferent - The number from which the facets will be extracted.
XOperator.getAttributes(Object)public QName getTypeName(Object referent)
getTypeName in interface XOperatorgetTypeName in class DefaultXOperatorreferent - A number.
public static Number parseNumber(String number)
number - The number to parse ; all characters must
be valid characters for the result number.
NumberFormatException - When the string is not a number.Scanner.nextNumber(org.inria.ns.reflex.util.NumberConstraint)
public static Number parseNumber(String number,
boolean isFloatingPoint)
number - The number to parse ; all characters must
be valid characters for the result number.isFloatingPoint - false if the string
doesn't represent a decimal number (with a dot or
an exponent) ; true otherwise.
If we don't know, true is acceptable,
and if it appears that the number was an integer,
getting the result will be a little more longer,
but not so much. If false and the number
do have fraction digits, they will be ignored.
NumberFormatException - When the string is not a number.Scanner.nextNumber(org.inria.ns.reflex.util.NumberConstraint)
public static Number parseNumber(String number,
boolean isFloatingPoint,
Class numberClass)
number - The number to parse ; all characters must
be valid characters for the result number.isFloatingPoint - false if the string
doesn't represent a decimal number (with a dot or
an exponent) ; true otherwise.
If we don't know, true is acceptable,
and if it appears that the number was an integer,
getting the result will be a little more longer,
but not so much. If false and the number
do have fraction digits, they will be ignored.
IN ANY CASE, if the numberClass is not null
this value is useless.numberClass - Used to enforce the number to be an
instance of the class given. The class must implement
Number and belong either to java.lang
or to java.math.
If null, the most suitable class will
be returned.
NumberFormatException - When the string is not a number.Scanner.nextNumber(org.inria.ns.reflex.util.NumberConstraint)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||