gov.sns.tools.pvlogger
Class MachineSnapshot

java.lang.Object
  |
  +--gov.sns.tools.pvlogger.MachineSnapshot

public class MachineSnapshot
extends java.lang.Object

MachineSnapshot is a representation of the data for a snapshot of the machine state at some point in time.


Field Summary
protected  ChannelSnapshot[] _channelSnapshots
           
protected  java.lang.String _comment
           
protected  long _id
           
protected  java.util.Date _timestamp
           
protected  java.lang.String _type
           
protected static java.text.DateFormat TIME_FORMAT
           
 
Constructor Summary
MachineSnapshot(java.util.Date timestamp, java.lang.String comment, ChannelSnapshot[] channelSnapshots)
          Constructor.
MachineSnapshot(int channelCount)
          Constructor of a MachineSnapshot with no data.
MachineSnapshot(long id, java.util.Date timestamp, java.lang.String comment, ChannelSnapshot[] channelSnapshots)
          Primary constructor.
MachineSnapshot(long id, java.lang.String type, java.util.Date timestamp, java.lang.String comment, ChannelSnapshot[] channelSnapshots)
          Primary constructor.
 
Method Summary
 int getChannelCount()
          Get the number of channel snapshot placeholders.
 ChannelSnapshot[] getChannelSnapshots()
          Get the channel snapshots.
 java.lang.String getComment()
          Get the comment.
 long getId()
          Get the unique identifier of this machine snapshot.
 java.util.Date getTimestamp()
          Get the timestamp.
 java.lang.String getType()
          Get the group id which identifies the type of machine snapshot
 void setChannelSnapshot(int index, ChannelSnapshot channelSnapshot)
          Set the channel snapshot for the specified index.
 void setComment(java.lang.String comment)
          Set the comment.
 void setId(long id)
          Set the unique identifier of this machine snapshot.
 void setType(java.lang.String type)
          Set the group id identifying the type of snapshot
 java.lang.String toString()
          Override toString() to get a textual description of the machine snapshot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TIME_FORMAT

protected static final java.text.DateFormat TIME_FORMAT

_id

protected long _id

_timestamp

protected java.util.Date _timestamp

_channelSnapshots

protected ChannelSnapshot[] _channelSnapshots

_type

protected java.lang.String _type

_comment

protected java.lang.String _comment
Constructor Detail

MachineSnapshot

public MachineSnapshot(long id,
                       java.lang.String type,
                       java.util.Date timestamp,
                       java.lang.String comment,
                       ChannelSnapshot[] channelSnapshots)
Primary constructor.

Parameters:
id - The unique identifier of this instance in the persistent storage.
type - Identifies the type of machine snapshot
timestamp - The timestamp when the snapshot was taken.
comment - A comment about this snapshot.
channelSnapshots - The channel snapshots associated with this machine snapshot.

MachineSnapshot

public MachineSnapshot(long id,
                       java.util.Date timestamp,
                       java.lang.String comment,
                       ChannelSnapshot[] channelSnapshots)
Primary constructor.

Parameters:
id - The unique identifier of this instance in the persistent storage.
timestamp - The timestamp when the snapshot was taken.
comment - A comment about this snapshot.
channelSnapshots - The channel snapshots associated with this machine snapshot.

MachineSnapshot

public MachineSnapshot(java.util.Date timestamp,
                       java.lang.String comment,
                       ChannelSnapshot[] channelSnapshots)
Constructor.

Parameters:
timestamp - The timestamp when the snapshot was taken.
comment - A comment about this snapshot.
channelSnapshots - The channel snapshots associated with this machine snapshot.

MachineSnapshot

public MachineSnapshot(int channelCount)
Constructor of a MachineSnapshot with no data. Placeholders for channel snapshots are constructed.

Parameters:
channelCount - The number of channel placeholders to make.
Method Detail

setChannelSnapshot

public void setChannelSnapshot(int index,
                               ChannelSnapshot channelSnapshot)
Set the channel snapshot for the specified index.

Parameters:
index - The index identifying the channel snapshot placeholder
channelSnapshot - The channel snapshot to associate with this machine snapshot.

getChannelSnapshots

public ChannelSnapshot[] getChannelSnapshots()
Get the channel snapshots.

Returns:
The array of channel snapshots.

getChannelCount

public int getChannelCount()
Get the number of channel snapshot placeholders.

Returns:
the number of channel snapshot placeholders.

getId

public long getId()
Get the unique identifier of this machine snapshot.

Returns:
The unique identifier of this machine snapshot.

setId

public void setId(long id)
Set the unique identifier of this machine snapshot.

Parameters:
id - The unique identifier to use for this machine snapshot

getType

public java.lang.String getType()
Get the group id which identifies the type of machine snapshot

Returns:
the group id identifying the type of snapshot

setType

public void setType(java.lang.String type)
Set the group id identifying the type of snapshot

Parameters:
type - type of snapshot

getComment

public java.lang.String getComment()
Get the comment.

Returns:
the comment assigned to this machine snapshot.

setComment

public void setComment(java.lang.String comment)
Set the comment.

Parameters:
comment - The comment to assign to this machine snapshot.

getTimestamp

public java.util.Date getTimestamp()
Get the timestamp.

Returns:
The time when this machine snapshot was taken.

toString

public java.lang.String toString()
Override toString() to get a textual description of the machine snapshot.

Overrides:
toString in class java.lang.Object
Returns:
a textual description of the machine snapshot.