hudson.util
Class ClockDifference

java.lang.Object
  extended by hudson.util.ClockDifference

@ExportedBean
public final class ClockDifference
extends Object

Represents a clock difference. Immutable.

Author:
Kohsuke Kawaguchi

Field Summary
 long diff
          The difference in milliseconds.
static ClockDifference ZERO
           
 
Constructor Summary
ClockDifference(long value)
           
 
Method Summary
 long abs()
          Gets the absolute value of diff.
 boolean isDangerous()
          Returns true if the difference is big enough to be considered dangerous.
 String toHtml()
           
static String toHtml(ClockDifference d)
          Gets the clock difference in HTML string.
static String toHtml(Node d)
           
 String toString()
          Gets the clock difference in HTML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

diff

@Exported
public final long diff
The difference in milliseconds. Positive value means the slave is behind the master, negative value means the slave is ahead of the master.


ZERO

public static final ClockDifference ZERO
Constructor Detail

ClockDifference

public ClockDifference(long value)
Method Detail

isDangerous

public boolean isDangerous()
Returns true if the difference is big enough to be considered dangerous.


abs

public long abs()
Gets the absolute value of diff.


toString

public String toString()
Gets the clock difference in HTML string.

Overrides:
toString in class Object

toHtml

public String toHtml()

toHtml

public static String toHtml(Node d)

toHtml

public static String toHtml(ClockDifference d)
Gets the clock difference in HTML string. This version handles null ClockDifference.



Copyright © 2004-2013. All Rights Reserved.