java.lang.Object
omix.lang.Time
- All Implemented Interfaces:
Serializable
public final class Time extends Object implements Serializable
This class represents a time in the Omix network diagrams.
- Author:
- Dr. Peter Droste, Omix Visualization
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Time(int hour, int minute, int second)
creates a time object with the given hour of day (0-23), minute (0-59) and second (0-59)Time(int hour, int minute, int second, int millisecond)
creates a time object with the given hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)Time(long date)
creates a time with the absolute date representationTime(Date date)
creates a time upon a java standard date format. -
Method Summary
Modifier and Type Method Description int
getHourOfDay()
int
getMilliSecond()
int
getMinute()
int
getSecond()
long
getValue()
String
toString()
String
toString(String format)
-
Constructor Details
-
Time
creates a time object with the given hour of day (0-23), minute (0-59) and second (0-59)- Parameters:
hour
- hourminute
- minutesecond
- second
-
Time
@ConstructorProperties({"hour","minute","second","millisecond"}) public Time(int hour, int minute, int second, int millisecond)creates a time object with the given hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)- Parameters:
hour
- hourminute
- minutesecond
- secondmillisecond
- millisecond
-
Time
creates a time with the absolute date representation- Parameters:
date
- data
-
Time
creates a time upon a java standard date format.- Parameters:
date
- Java date
-
-
Method Details
-
getHourOfDay
public int getHourOfDay()- Returns:
- the hour of this time
-
getMinute
public int getMinute()- Returns:
- the minute of this time
-
getSecond
public int getSecond()- Returns:
- the second of this time
-
getMilliSecond
public int getMilliSecond()- Returns:
- the millisecond of this time
-
getValue
- Returns:
- the absolute value
-
toString
- Overrides:
toString
in classObject
- Returns:
- the time as mm:SS:sss
- See Also:
Object.toString()
-
toString
- Parameters:
format
- a format which has to contain hh for hour, mm for minutes, SS for seconds and sss for milliseconds.- Returns:
- a string representation of the time according the submitted format
-