proper.util
Class Timestamp

java.lang.Object
  extended by proper.util.Timestamp

public class Timestamp
extends java.lang.Object

This is a simple class for creating timestamps. They can be with or w/o hostname or for a specific time. The separator is always a blank (it is also added at the end of the timestamp).
The format is this:

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
Timestamp()
          initializes the timestamp with the current time and NO host
Timestamp(java.util.Date timestamp)
          initializes the timestamp with the given time/date and NO host
Timestamp(java.util.Date timestamp, java.lang.String host)
          initializes the timestamp with the given host and time/date
Timestamp(java.lang.String host)
          initializes the timestamp with the given host and the current time/date
 
Method Summary
 java.lang.String getHost()
          returns the current set host
 java.util.Date getTimestamp()
          returns the current set time/date
 java.lang.String toString()
          returns the timestamp in a string representation
static Timestamp valueOf()
          creates a timestamp with current time and NO host
static Timestamp valueOf(java.util.Date timestamp)
          creates a timestamp with the given time and NO host
static Timestamp valueOf(java.util.Date timestamp, java.lang.String host)
          creates a timestamp with the given time and host
static Timestamp valueOf(java.lang.String host)
          creates a timestamp with current time and the given host
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timestamp

public Timestamp()
initializes the timestamp with the current time and NO host


Timestamp

public Timestamp(java.util.Date timestamp)
initializes the timestamp with the given time/date and NO host


Timestamp

public Timestamp(java.lang.String host)
initializes the timestamp with the given host and the current time/date


Timestamp

public Timestamp(java.util.Date timestamp,
                 java.lang.String host)
initializes the timestamp with the given host and time/date

Method Detail

getTimestamp

public java.util.Date getTimestamp()
returns the current set time/date


getHost

public java.lang.String getHost()
returns the current set host


valueOf

public static Timestamp valueOf()
creates a timestamp with current time and NO host


valueOf

public static Timestamp valueOf(java.util.Date timestamp)
creates a timestamp with the given time and NO host


valueOf

public static Timestamp valueOf(java.lang.String host)
creates a timestamp with current time and the given host


valueOf

public static Timestamp valueOf(java.util.Date timestamp,
                                java.lang.String host)
creates a timestamp with the given time and host


toString

public java.lang.String toString()
returns the timestamp in a string representation

Overrides:
toString in class java.lang.Object