1 25 26 package org.objectweb.speedo.pobjects.odis; 27 28 31 public class TrackpointId { 32 33 public static final String SEP = ":"; 34 public int id_order; 35 public int id_competition; 36 37 public TrackpointId() { 38 } 39 40 public TrackpointId(int id_order, int id_competition) { 41 this.id_order = id_order; 42 this.id_competition = id_competition; 43 } 44 45 public TrackpointId(String str) { 46 setValue(str); 47 } 48 49 private void setValue(String str) { 50 if (str == null) { 51 throw new NullPointerException ("String representation of Trackpoint Identifier is null"); 52 } 53 int idx = str.indexOf(SEP); 54 if (idx == -1) { 55 throw new NullPointerException ("Bad String representation of Trackpoint Identifier: " + str); 56 } 57 id_order = Integer.valueOf(str.substring(0, idx)).intValue(); 58 id_competition = Integer.valueOf(str.substring(idx + SEP.length())).intValue(); 59 } 60 61 public String toString() { 62 return id_order + SEP + id_competition; 63 } 64 65 } 66 | Popular Tags |