Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 21 package com.db4o.ext; 22 23 import com.db4o.foundation.*; 24 25 26 33 public class Db4oUUID { 34 35 private final long longPart; 36 private final byte[] signaturePart; 37 38 44 public Db4oUUID(long longPart_, byte[] signaturePart_) { 45 longPart = longPart_; 46 signaturePart = signaturePart_; 47 } 48 49 56 public long getLongPart() { 57 return longPart; 58 } 59 60 61 71 public byte[] getSignaturePart() { 72 return signaturePart; 73 } 74 75 public boolean equals(Object o) { 76 if (this == o) return true; 77 if (o == null || getClass() != o.getClass()) return false; 78 79 final Db4oUUID other = (Db4oUUID) o; 80 81 if (longPart != other.longPart) return false; 82 if (signaturePart == null) { 83 return other.signaturePart == null; 84 } 85 if (signaturePart.length != other.signaturePart.length) { 86 return false; 87 } 88 for (int i = 0; i < signaturePart.length; i++) { 89 if (signaturePart[i] != other.signaturePart[i]) { 90 return false; 91 } 92 } 93 return true; 94 } 95 96 public int hashCode() { 97 return (int) (longPart ^ (longPart >>> 32)); 98 } 99 100 public String toString() { 101 if(! Debug4.prettyToStrings){ 102 return super.toString(); 103 } 104 105 String sig = ""; 106 for (int i = 0; i < signaturePart.length; i++) { 107 sig += signaturePart[i] + " "; 108 } 109 110 return "long " + longPart + " , signature " + sig; 111 } 112 113 } 114
| Popular Tags
|