janus.util
Class Timestamp

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

public class Timestamp
extends Object

Diese Klasse generiert eine (Innerhalb der JVM) eindeutige Zeit


Field Summary
static SimpleDateFormat formatComplete
          formatComplete Das Display-Format für ein Timstamp dd.MM.yyyy HH:mm:ss.SSS
static SimpleDateFormat formatNoMilli
          formatNoMilli Das Display-Format für ein Timstamp dd.MM.yyyy HH:mm:ss.SSS
static int LENGTH
          LENGTH die notwendige Länge für das Abspeichern eines Timestamps. 1 Zeichen Reserve...
static SimpleDateFormat sortableDateFormat
          sortableDateFormat das Format, in dem ein Timestamp abgespeichert wird: yyyyMMddHHmmssSSS.
 
Constructor Summary
Timestamp(Date date)
           
Timestamp(String date)
           
 
Method Summary
 Timestamp addDays(int days)
           
 Timestamp addHours(int hours)
           
 boolean after(Timestamp ts)
           
 boolean before(Timestamp ts)
           
static Timestamp create()
          Erzeuge einen neuen Timestamp
 boolean equals(Object obj)
           
 String format(boolean showMilliseconds)
           
 Date getDate()
           
static Date getDateLast()
           
 Timestamp stripTime()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

formatComplete

public static final SimpleDateFormat formatComplete
formatComplete Das Display-Format für ein Timstamp dd.MM.yyyy HH:mm:ss.SSS


formatNoMilli

public static final SimpleDateFormat formatNoMilli
formatNoMilli Das Display-Format für ein Timstamp dd.MM.yyyy HH:mm:ss.SSS


LENGTH

public static final int LENGTH
LENGTH die notwendige Länge für das Abspeichern eines Timestamps. 1 Zeichen Reserve...

See Also:
Constant Field Values

sortableDateFormat

public static final SimpleDateFormat sortableDateFormat
sortableDateFormat das Format, in dem ein Timestamp abgespeichert wird: yyyyMMddHHmmssSSS.

Constructor Detail

Timestamp

public Timestamp(Date date)
Parameters:
date - Erzeugt einen Timestamp mit einem gegebenen Datum

Timestamp

public Timestamp(String date)
          throws ParseException
Parameters:
date - liefert einen Timestamp zu einem gespeicherten String
Throws:
ParseException
Method Detail

addDays

public Timestamp addDays(int days)
Parameters:
days - Anzahl der Tage, die aufaddiert werden sollen.
Returns:
ein modifierter Timestamp

addHours

public Timestamp addHours(int hours)
Parameters:
hours -
Returns:
ein modifizierter Timestamp

after

public boolean after(Timestamp ts)
Parameters:
ts - ein anderer Timestamp
Returns:
true, wenn der angegebene Timestamp nach this liegt

before

public boolean before(Timestamp ts)
Parameters:
ts - ein anderer Timestamp
Returns:
true, wenn der angegebene Timestamp vor this liegt

create

public static Timestamp create()
Erzeuge einen neuen Timestamp

Returns:
ein neuer Timestamp mit der aktuellen Uhrzeit, garantiert innerhalb der JVM eindeutig und ansteigend, auch wenn die Rechneruhr zurückgestellt wird.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

format

public String format(boolean showMilliseconds)
Parameters:
showMilliseconds -
Returns:
ein lesbarer String

getDate

public Date getDate()
Returns:
Returns the date.

getDateLast

public static Date getDateLast()
Returns:
Returns the dateLast.

stripTime

public Timestamp stripTime()
Returns:
ein Timestamp, mit Stunde, Minute, Sekunde und Millisekunde == 0

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008 MvC Systemsoftware.