org.activemath.webapp.report.bucket
Class BucketType

java.lang.Object
  extended by org.activemath.webapp.report.bucket.BucketType

public final class BucketType
extends Object

Buckettype (typesafe enum pattern)


Field Summary
static BucketType DAYS
           
static BucketType DISCRETE
           
static BucketType HOURS
           
static BucketType MINUTES
           
static BucketType MONTHS
           
static List<BucketType> VALUES
           
static BucketType WEEKS
           
 
Method Summary
static BucketType getByName(String name)
           
static long getMarginTs(BucketType type, long refTs)
          Find the beginning of the next time unit (minute, hour, day, week, month) to be used as a query constraint.
 String getType()
           
 long getWidth()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUES

public static final List<BucketType> VALUES

DISCRETE

public static final BucketType DISCRETE

MINUTES

public static final BucketType MINUTES

HOURS

public static final BucketType HOURS

DAYS

public static final BucketType DAYS

WEEKS

public static final BucketType WEEKS

MONTHS

public static final BucketType MONTHS
Method Detail

getByName

public static final BucketType getByName(String name)
Returns:
BucketType instance for type name, or null.

getType

public String getType()

getMarginTs

public static long getMarginTs(BucketType type,
                               long refTs)
Find the beginning of the next time unit (minute, hour, day, week, month) to be used as a query constraint. This involves some calendar work.

Returns:
timestamp indicating the beginning of next time unit.

getWidth

public long getWidth()

toString

public String toString()
Overrides:
toString in class Object