urv.olsr.message
Class ValidityTime

java.lang.Object
  extended by urv.olsr.message.ValidityTime
All Implemented Interfaces:
org.jgroups.util.Streamable

public class ValidityTime
extends java.lang.Object
implements org.jgroups.util.Streamable

This field indicates for how long time after reception a node MUST consider the information contained in the message as valid, unless a more recent update to the information is received. The validity time is represented by its mantissa (four highest bits of Vtime field) and by its exponent (four lowest bits of Vtime field). In other words: validity time = C*(1+a/16)* 2^b [in seconds] where a is the integer represented by the four highest bits of Vtime field and b the integer represented by the four lowest bits of Vtime field. The proposed value of the scaling factor C is specified in section 18.

Author:
Gerard Paris Aixala

Constructor Summary
ValidityTime(double vTime)
           
 
Method Summary
 double getVTime()
           
 void readFrom(java.io.DataInputStream in)
           
static int signedByteToInt(byte b)
           
 void writeTo(java.io.DataOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidityTime

public ValidityTime(double vTime)
Method Detail

signedByteToInt

public static int signedByteToInt(byte b)

readFrom

public void readFrom(java.io.DataInputStream in)
              throws java.io.IOException,
                     java.lang.IllegalAccessException,
                     java.lang.InstantiationException
Specified by:
readFrom in interface org.jgroups.util.Streamable
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException

writeTo

public void writeTo(java.io.DataOutputStream out)
             throws java.io.IOException
Specified by:
writeTo in interface org.jgroups.util.Streamable
Throws:
java.io.IOException

getVTime

public double getVTime()
Returns:
the vTime