Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class mil.navy.nps.dis.ClockTime

java.lang.Object
  |
  +--mil.navy.nps.dis.PduElement
        |
        +--mil.navy.nps.dis.ClockTime

public class ClockTime
extends PduElement
Version:
1.0
Author:
Antonio Alexandre Rua (http://www.garfield.fe.up.pt/~alexrua)
Location:
http://www.stl.nps.navy.mil/dis-java-vrml/mil/navy/nps/dis/ClockTime.java
Hierarchy Diagram:
Summary:
Time measurements that surpass one hour shall be represented by a Clock Time Record. The time represented shall be either real-world time (UTC) or simulation time. The simulation time shall be the UTC of the simulation exercise.
Note:
Here we don't implement the Timestamp record. Yet we don't have the same trouble using it as in ProtocolDataUnit. You should consult our on-line documentation to see the trouble using time.
History:
16Sep97 /Antonio Alexandre Rua /New
8Dec97 /Ronan Fauglas /changes for documentation templates + complements in documentation
11Dec97 /Ronan Fauglas /changed access methods: thisVariable() --> getThisVariable()
References:
DIS-Java-VRML Working Group: http://www.stl.nps.navy.mil/dis-java-vrml/
DIS Data Dictionary : Clock Time Record
DIS specification : IEEE 1278.1, Section 5.3.8
See Also:
ProtocolDataUnit, PduElement, mil.navy.nps.util.SerializationInterface, SimulationManagementPdu

Field Summary
int hour
          Hours - This field shall specify the hours since 0000 hours January 1, 1970 UTC.
Value:
Expressed in hours
References:
DIS Data Dictionary : Hours field
static int sizeOf
          Constant value--size of a Clock Time Record; here :sizeOf = 8 bytes.
mil.navy.nps.util.UnsignedInt timePastHour
          Time Past the Hour - This field shall specify the time past the hour indicated in Hour field.
 
Constructor Summary
ClockTime()
          Default constructor--fills with zeros for all values.
ClockTime(long pHour, long pTimePastHour)
          Constructs a new ClockTime object whose values are passed in parameters.
 
Method Summary
java.lang.Object clone()
           
void deSerialize(java.io.DataInputStream inputStream)
           
int getHour()
           
int getTimePastHour()
           
int length()
           
void printValues(int indentLevel, java.io.PrintStream printStream)
           
void serialize(java.io.DataOutputStream outputStream)
           
void setHour(int pHour)
           
void setHour(long pHour)
           
void setTimePastHour(mil.navy.nps.util.UnsignedInt pTimePastHour)
           
void setTimePastHour(long pTimePastHour)
           
void setValues(long pHour, long pTimePastHour)
           
 
Methods inherited from class mil.navy.nps.dis.PduElement
clone, deSerialize, length, printValues, serialize
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

hour

protected int hour
Hours - This field shall specify the hours since 0000 hours January 1, 1970 UTC.
Value:
Expressed in hours
References:
DIS Data Dictionary : Hours field

timePastHour

protected mil.navy.nps.util.UnsignedInt timePastHour
Time Past the Hour - This field shall specify the time past the hour indicated in Hour field.
Value:
This field is actually a Timestamp. See the references below for more information.
References:
DIS Data Dictionary : Hours field

sizeOf

public static final int sizeOf
Constant value--size of a Clock Time Record; here :sizeOf = 8 bytes.
Constructor Detail

ClockTime

public ClockTime()
Default constructor--fills with zeros for all values.

ClockTime

public ClockTime(long pHour,
                 long pTimePastHour)
Constructs a new ClockTime object whose values are passed in parameters.
Parameters:
pHour - the passed hours since 0000 hours January 1, 1970 UTC
pTimePastHour - the Timestamp of the new object
See Also:
timePastHour
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class PduElement

serialize

public void serialize(java.io.DataOutputStream outputStream)
Throws:
java.lang.RuntimeException - when an IO Error occurs.
Overrides:
serialize in class PduElement

deSerialize

public void deSerialize(java.io.DataInputStream inputStream)
Throws:
java.lang.RuntimeException - when an IO Error occurs.
Overrides:
deSerialize in class PduElement

length

public int length()
Overrides:
length in class PduElement

printValues

public void printValues(int indentLevel,
                        java.io.PrintStream printStream)
Overrides:
printValues in class PduElement

getHour

public int getHour()

setHour

public void setHour(int pHour)

setHour

public void setHour(long pHour)

getTimePastHour

public int getTimePastHour()

setTimePastHour

public void setTimePastHour(mil.navy.nps.util.UnsignedInt pTimePastHour)

setTimePastHour

public void setTimePastHour(long pTimePastHour)

setValues

public void setValues(long pHour,
                      long pTimePastHour)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD