1 23 24 package org.hammurapi.results.simple; 25 26 import org.hammurapi.WaiverSet; 27 import org.hammurapi.results.NamedResults; 28 29 34 public class SimpleNamedResults extends SimpleAggregatedResults implements Comparable , NamedResults { 35 36 42 45 private static final long serialVersionUID = -4420438155869255804L; 46 47 48 SimpleNamedResults(String name, WaiverSet waiverSet) { 49 super(waiverSet); 50 this.name=name; 51 } 52 53 private String name; 54 55 public String getName() { 56 return name; 57 } 58 59 public int compareTo(Object obj) { 60 if (obj instanceof NamedResults) { 61 String otherName=((NamedResults) obj).getName(); 62 if (name==null && otherName==null) { 63 return 0; 64 } else if (name!=null) { 65 return name.compareTo(otherName); 66 } else { 67 return 1; 68 } 69 } else { 70 return 2; 71 } 72 } 73 } 74 | Popular Tags |