1 4 package com.tc.object.gtx; 5 6 import com.tc.util.AbstractIdentifier; 7 8 import java.util.Comparator ; 9 10 public class GlobalTransactionID extends AbstractIdentifier { 11 12 public static final GlobalTransactionID NULL_ID = new GlobalTransactionID(); 13 public static final Comparator COMPARATOR = new Comparator () { 14 public int compare(Object o1, Object o2) { 15 long l1 = ((GlobalTransactionID) o1).toLong(); 16 long l2 = ((GlobalTransactionID) o2).toLong(); 17 if (l1 < l2) return -1; 18 else if (l1 > l2) return 1; 19 else return 0; 20 } 21 }; 22 23 public GlobalTransactionID(long id) { 24 super(id); 25 } 26 27 private GlobalTransactionID() { 28 super(); 29 } 30 31 public String getIdentifierType() { 32 return "GlobalTransactionID"; 33 } 34 35 public boolean lessThan(GlobalTransactionID compare) { 36 return isNull() ? true : toLong() < compare.toLong(); 37 } 38 39 } 40 | Popular Tags |