de.invation.code.toval.time.TimeScale Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of TOVAL Show documentation
Show all versions of TOVAL Show documentation
TOVAL comprises a set of java classes for common programming issues. It includes utils for arrays, lists, sets and collections for convenient handling and modification, but also support for mathematic definitions concerning logic (clauses + resolution) together with some algorithms for permutations, powersets and resolution. Additionally it contains a number of types for multisets, matrices with object keys and much more.
The newest version!
package de.invation.code.toval.time;
public enum TimeScale {
MILLISECONDS("milliseconds","ms"),
SECONDS("seconds","s"),
MINUTES("minutes","m"),
HOURS("hours","h"),
DAYS("days","d"),
WEEKS("weeks","w"),
MONTHS("months","mth"),
YEARS("years","y");
private String descriptor = null;
private String shortDescriptor = null;
private boolean shortDescriptorMode = false;
private TimeScale(String descriptor, String shortDescriptor){
this.descriptor = descriptor;
this.shortDescriptor = shortDescriptor;
}
public void activateShortDescriptorMode(){
shortDescriptorMode = true;
}
public void activateLongDescriptorMode(){
shortDescriptorMode = false;
}
public boolean isShortDesctiptorMode(){
return shortDescriptorMode;
}
@Override
public String toString(){
if(shortDescriptorMode)
return shortDescriptor;
return descriptor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy