­

My Quotes


When U were born , you cried and the world rejoiced
Live U'r life in such a way that when you go
THE WORLD SHOULD CRY





Free users please don't remove our link. Get the code again.

Monday, April 28, 2014

Java ENUM Sort


public enum Bucket{
CONFIRMED("conf","Cf",7),
FINAL("Final","Fi",5),
PROJECTED("Proj","Pr",4),
NULL("","",0);
private String value;
private String code;
private int confidenceLevel;

Bucket(String value, String code,String confidenceLevel){
this.code=code;
this.value=value;
this.confidenceLevel=confidenceLevel;
}

public String value(){ return this.value;}

public String code() { return this.code;}

public int confidenceLevel(){ return this.confidenceLevel;}


private void checEnum(){
  SortedMap map = new TreeMap ();
  for(Bukect bucketObj : Bucket.values()){
      if(!"".equalsIgnoeCase(bucketObj.value())) {   
           map.put(bucketObj.confidenceLevel(), bucketObjj.value());
  }
   System.out.println(map.keySet());
}
}

No comments :