Framework Professional Edition Package


org.mbs.util.wireadmin
Class StateEnvelope

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

public class StateEnvelope
extends Primitive

StateEnvelope is an Primitive.INTEGER envelope, representing a list of states.

Author:
Krasimira Velikova
See Also:
Serialized Form

Field Summary
protected  java.lang.String[] names
           
protected  int state
           
protected  int[] states
           
protected  long time
           
 
Fields inherited from class org.mbs.util.wireadmin.Primitive
BOOLEAN, BYTE, CHARACTER, DOUBLE, FLOAT, identification, INTEGER, LONG, scope, SHORT
 
Constructor Summary
StateEnvelope(java.lang.String scope, java.lang.Object identification, int value, int[] states, java.lang.String[] names)
          Creates a new state envelope of type Primitive.INTEGER.
StateEnvelope(java.lang.String scope, java.lang.Object identification, int value, int[] states, java.lang.String[] names, long time)
          Creates a new state envelope of type Primitive.INTEGER.
 
Method Summary
 java.lang.String getStateName()
          Retrieves the name of the current state.
 java.lang.String getStateName(int state)
          Retrieves the name of the state with the specified number
 int[] getStates()
          Retrieves the list of supported states
 long getTime()
          Retrieves the creation time
 int intValue()
          Returns the value of the specified state as an int.
 long longValue()
          Returns the value of the specified state as a long.
 
Methods inherited from class org.mbs.util.wireadmin.Primitive
booleanValue, byteValue, charValue, doubleValue, floatValue, getIdentification, getScope, getType, getValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected int state

time

protected long time

states

protected int[] states

names

protected java.lang.String[] names
Constructor Detail

StateEnvelope

public StateEnvelope(java.lang.String scope,
                     java.lang.Object identification,
                     int value,
                     int[] states,
                     java.lang.String[] names)
Creates a new state envelope of type Primitive.INTEGER.

Parameters:
scope - the scope of the primitive
identification - the identification
value - the value of the current state
states - array of the states
names - array with names of the states. The array should be the same size as the states array.
See Also:
Primitive.Primitive(int, String, Object), StateEnvelope(String, Object, int, int[], String[], long)

StateEnvelope

public StateEnvelope(java.lang.String scope,
                     java.lang.Object identification,
                     int value,
                     int[] states,
                     java.lang.String[] names,
                     long time)
Creates a new state envelope of type Primitive.INTEGER.

Parameters:
scope - the scope of the primitive
identification - the identification
value - the value of the current state
states - array of the states
names - array with names of the states. The array should be the same size as the states array.
time - the time when the envelope is created
See Also:
Primitive.Primitive(int, String, Object)
Method Detail

getStateName

public java.lang.String getStateName()
Retrieves the name of the current state.

Returns:
the name of the current state

getStateName

public java.lang.String getStateName(int state)
Retrieves the name of the state with the specified number

Parameters:
state - the state
Returns:
the name of the state, specified by the state parameter

getStates

public int[] getStates()
Retrieves the list of supported states

Returns:
the list of supported states

getTime

public long getTime()
Retrieves the creation time

Returns:
the creation time

intValue

public int intValue()
Description copied from class: Primitive
Returns the value of the specified state as an int.

Overrides:
intValue in class Primitive
See Also:
Primitive.intValue()

longValue

public long longValue()
Description copied from class: Primitive
Returns the value of the specified state as a long.

Overrides:
longValue in class Primitive
See Also:
Primitive.longValue()

Framework Professional Edition Package


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