pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.time
Enum Period.Scroll

java.lang.Object
  extended by java.lang.Enum<Period.Scroll>
      extended by org.torweg.pulse.util.time.Period.Scroll
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Period.Scroll>
Enclosing class:
Period

public static enum Period.Scroll
extends java.lang.Enum<Period.Scroll>

The known values for scrolling Durations.

Version:
$Revision: 1685 $
Author:
Daniel Dietz

Enum Constant Summary
NEXT
          Scroll to next Duration
PREVIOUS
          Scroll to previous Duration.
 
Method Summary
static long scroll(long millis, Period period, Period.Scroll scroll)
          Scrolls the given milliseconds by the given Period to the given scroll direction.
static Period.Scroll valueof(java.lang.String stringValue)
          Tries to retrieve a Scroll from the given string value.
static Period.Scroll valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Period.Scroll[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PREVIOUS

public static final Period.Scroll PREVIOUS
Scroll to previous Duration.


NEXT

public static final Period.Scroll NEXT
Scroll to next Duration

Method Detail

values

public static final Period.Scroll[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Period.Scroll c : Period.Scroll.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Period.Scroll valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

scroll

public static long scroll(long millis, Period period, Period.Scroll scroll)
Scrolls the given milliseconds by the given Period to the given scroll direction.

Parameters:
millis - the milliseconds
period - the Period to scroll by
scroll - the scroll direction
Returns:
  • the scrolled milliseconds
  • if the given period is Period.UNDEFINED the given milliseconds will be left unchanged

valueof

public static Period.Scroll valueof(java.lang.String stringValue)
Tries to retrieve a Scroll from the given string value.

Parameters:
stringValue - the string value
Returns:
Scroll if can be build from given string value, null otherwise