Framework Professional Edition Package


org.mbs.util.wireadmin
Class Primitive

java.lang.Object
  extended by java.lang.Number
      extended by org.mbs.util.wireadmin.Primitive
All Implemented Interfaces:
java.io.Serializable, Envelope
Direct Known Subclasses:
MeasurementEnvelope, StateEnvelope

public abstract class Primitive
extends java.lang.Number
implements Envelope

An abstract class for creating envelope objects of the primitive types. The methods in this class are empty. Extend this class to create an Envelope for a primitive type and override the methods for value retrieving. Method(s) for managing the value can be added.

Author:
Krasimira Velikova
See Also:
Serialized Form

Field Summary
static int BOOLEAN
           
static int BYTE
           
static int CHARACTER
           
static int DOUBLE
           
static int FLOAT
           
protected  java.lang.Object identification
           
static int INTEGER
           
static int LONG
           
protected  java.lang.String scope
           
static int SHORT
           
 
Constructor Summary
protected Primitive(int type, java.lang.String scope, java.lang.Object identification)
          Creates new primitive.
 
Method Summary
 boolean booleanValue()
           
 byte byteValue()
          Returns the value of the specified state as a byte.
 char charValue()
          Returns the value of the specified state as a char.
 double doubleValue()
          Returns the value of the specified state as a double.
 float floatValue()
          Returns the value of the specified state as a float.
 java.lang.Object getIdentification()
          Return the identification of this Envelope object.
 java.lang.String getScope()
          Return the scope name of this Envelope object.
 int getType()
          Retrieves the type of the primitive - e.g LONG, INTEGER, SHORT, CHARACTER, BYTE, DOUBLE, FLOAT or BOOLEAN,
 java.lang.Object getValue()
          Return the value associated with this Envelope object.
 int intValue()
          Returns the value of the specified state as an int.
 long longValue()
          Returns the value of the specified state as a long.
 short shortValue()
          Returns the value of the specified state as a short.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LONG

public static final int LONG
See Also:
Constant Field Values

INTEGER

public static final int INTEGER
See Also:
Constant Field Values

SHORT

public static final int SHORT
See Also:
Constant Field Values

CHARACTER

public static final int CHARACTER
See Also:
Constant Field Values

BYTE

public static final int BYTE
See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
See Also:
Constant Field Values

FLOAT

public static final int FLOAT
See Also:
Constant Field Values

BOOLEAN

public static final int BOOLEAN
See Also:
Constant Field Values

scope

protected java.lang.String scope

identification

protected java.lang.Object identification
Constructor Detail

Primitive

protected Primitive(int type,
                    java.lang.String scope,
                    java.lang.Object identification)
Creates new primitive.

Parameters:
type - the type of the primitive
scope - the scope of the primitive
identification - the identification
Method Detail

getType

public int getType()
Retrieves the type of the primitive - e.g LONG, INTEGER, SHORT, CHARACTER, BYTE, DOUBLE, FLOAT or BOOLEAN,

Returns:
the type of the primitive

getValue

public java.lang.Object getValue()
Description copied from interface: Envelope
Return the value associated with this Envelope object.

Specified by:
getValue in interface Envelope
Returns:
the value of the status item, or null when no item is associated with this object.
See Also:
Envelope.getValue()

getIdentification

public java.lang.Object getIdentification()
Description copied from interface: Envelope
Return the identification of this Envelope object. An identification may be of any Java type. The type must be mutually agreed between the Consumer and Producer services.

Specified by:
getIdentification in interface Envelope
Returns:
an object which identifies the status item in the address space of the composite producer, must not be null.
See Also:
Envelope.getIdentification()

getScope

public java.lang.String getScope()
Description copied from interface: Envelope
Return the scope name of this Envelope object. Scope names are used to restrict the communication between the Producer and Consumer services. Only Envelopes objects with a scope name that is permitted for the Producer and the Consumer services must be passed through a Wire object.

Specified by:
getScope in interface Envelope
Returns:
the security scope for the status item, must not be null.
See Also:
Envelope.getScope()

booleanValue

public boolean booleanValue()

charValue

public char charValue()
Returns the value of the specified state as a char.

Returns:
the character value

byteValue

public byte byteValue()
Returns the value of the specified state as a byte.

Overrides:
byteValue in class java.lang.Number
See Also:
Number.byteValue()

doubleValue

public double doubleValue()
Returns the value of the specified state as a double.

Specified by:
doubleValue in class java.lang.Number
See Also:
Number.doubleValue()

floatValue

public float floatValue()
Returns the value of the specified state as a float.

Specified by:
floatValue in class java.lang.Number
See Also:
Number.floatValue()

intValue

public int intValue()
Returns the value of the specified state as an int.

Specified by:
intValue in class java.lang.Number
See Also:
Number.intValue()

longValue

public long longValue()
Returns the value of the specified state as a long.

Specified by:
longValue in class java.lang.Number
See Also:
Number.longValue()

shortValue

public short shortValue()
Returns the value of the specified state as a short.

Overrides:
shortValue in class java.lang.Number
See Also:
Number.shortValue()

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved