org.sonatype.sisu.goodies.common
Class Time

java.lang.Object
  extended by org.sonatype.sisu.goodies.common.Time

public class Time
extends Object

Representation of a specific unit of time. Supports:

Since:
1.0

Constructor Summary
Time(long value, TimeUnit unit)
           
 
Method Summary
 Time asDays()
           
 Time asHours()
           
 Time asMicros()
           
 Time asMillis()
           
 Time asMinutes()
           
 Time asNanos()
           
 Time asSeconds()
           
static Time days(long value)
           
 boolean equals(Object obj)
           
 TimeUnit getUnit()
          Deprecated. 
 long getValue()
          Deprecated. 
 int hashCode()
           
static Time hours(long value)
           
 void join(Thread thread)
           
static Time micros(long value)
           
static Time millis(long value)
           
static Time minutes(long value)
           
static Time nanos(long value)
           
static Time parse(String value)
           
static Time seconds(long value)
           
 void sleep()
           
static Time time(long value, TimeUnit unit)
           
 long toDays()
           
 int toDaysI()
           
 long toHours()
           
 int toHoursI()
           
 long toMicros()
           
 int toMicrosI()
           
 long toMillis()
           
 int toMillisI()
           
 long toMinutes()
           
 int toMinutesI()
           
 long toNanos()
           
 int toNanosI()
           
 long toSeconds()
           
 int toSecondsI()
           
 String toString()
           
 TimeUnit unit()
           
 long value()
           
 void wait(Object obj)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Time

public Time(long value,
            TimeUnit unit)
Method Detail

getValue

@Deprecated
public long getValue()
Deprecated. 


value

public long value()
Since:
1.1

getUnit

@Deprecated
public TimeUnit getUnit()
Deprecated. 


unit

public TimeUnit unit()
Since:
1.1

toNanos

public long toNanos()

toNanosI

public int toNanosI()
Since:
1.1

asNanos

public Time asNanos()
Since:
1.1

toMicros

public long toMicros()

toMicrosI

public int toMicrosI()
Since:
1.1

asMicros

public Time asMicros()
Since:
1.1

toMillis

public long toMillis()

toMillisI

public int toMillisI()
Since:
1.1

asMillis

public Time asMillis()
Since:
1.1

toSeconds

public long toSeconds()

toSecondsI

public int toSecondsI()
Since:
1.1

asSeconds

public Time asSeconds()
Since:
1.1

toMinutes

public long toMinutes()

toMinutesI

public int toMinutesI()
Since:
1.1

asMinutes

public Time asMinutes()
Since:
1.1

toHours

public long toHours()

toHoursI

public int toHoursI()
Since:
1.1

asHours

public Time asHours()
Since:
1.1

toDays

public long toDays()

toDaysI

public int toDaysI()
Since:
1.1

asDays

public Time asDays()
Since:
1.1

sleep

public void sleep()
           throws InterruptedException
Throws:
InterruptedException

wait

public void wait(Object obj)
          throws InterruptedException
Throws:
InterruptedException

join

public void join(Thread thread)
          throws InterruptedException
Throws:
InterruptedException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

time

public static Time time(long value,
                        TimeUnit unit)

nanos

public static Time nanos(long value)

micros

public static Time micros(long value)

millis

public static Time millis(long value)

seconds

public static Time seconds(long value)

minutes

public static Time minutes(long value)

hours

public static Time hours(long value)

days

public static Time days(long value)

parse

public static Time parse(@NonNls
                         String value)
Since:
1.1


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.