Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved.
Specification License

javax.microedition.broadcast.esg
Class NumericAttribute

java.lang.Object
  extended by javax.microedition.broadcast.esg.Attribute
      extended by javax.microedition.broadcast.esg.NumericAttribute

public class NumericAttribute
extends Attribute

A NumericAttribute that references a numeric value of arbitrary length and precision. The attribute will be represented as String with indication of sign and type to handle "non-primitive" data types.

See Also:
MetadataSet, CommonMetadataSet

Field Summary
static int FIXED_POINT_TYPE
          FIXED_POINT_TYPE references fixed-point numbers (e.g decimal numbers like prices with unit and currency)
static int FLOATING_POINT_TYPE
          FLOATING_POINT_TYPE references floating-point numbers
static int INTEGER_TYPE
          INTEGER_TYPE references integer numbers
 
Constructor Summary
NumericAttribute(java.lang.String attribute, int type, boolean signed)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tells if two attributes are equal.
 int getType()
          Tells if the number is of type integer, fixed-point or floating-point
 boolean isSigned()
          Tells if the data type is signed
 
Methods inherited from class javax.microedition.broadcast.esg.Attribute
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIXED_POINT_TYPE

public static final int FIXED_POINT_TYPE
FIXED_POINT_TYPE references fixed-point numbers (e.g decimal numbers like prices with unit and currency)

See Also:
Constant Field Values

FLOATING_POINT_TYPE

public static final int FLOATING_POINT_TYPE
FLOATING_POINT_TYPE references floating-point numbers

See Also:
Constant Field Values

INTEGER_TYPE

public static final int INTEGER_TYPE
INTEGER_TYPE references integer numbers

See Also:
Constant Field Values
Constructor Detail

NumericAttribute

public NumericAttribute(java.lang.String attribute,
                        int type,
                        boolean signed)
Constructor.

Parameters:
attribute - The actual string representation of the attribute as defined in the broadcast spec.
type - The type of number (decimal or integer)
signed - True if the number is signed, false if not signed
Throws:
java.lang.IllegalArgumentException - if type is unrecognized.
java.lang.NullPointerException - if attribute is null
Method Detail

equals

public boolean equals(java.lang.Object obj)
Tells if two attributes are equal.

Overrides:
equals in class Attribute
Returns:
true if obj is NumericAttribute, its getType() returns same type as this attribute and its name and sign are the same as the name and sign of of this attribute, respecptively. Otherwise false is returned. Comparison of the names is not case sensitive.

getType

public int getType()
Tells if the number is of type integer, fixed-point or floating-point

Returns:
returns the type of the number

isSigned

public boolean isSigned()
Tells if the data type is signed

Returns:
returns true if signed, false if unsigned


Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved.
Specification License