1 29 30 package com.hp.hpl.jena.rdf.model; 31 32 import java.rmi.server.UID ; 33 34 import com.hp.hpl.jena.shared.impl.JenaParameters; 35 36 43 44 48 public class AnonId extends java.lang.Object { 49 50 String id = null; 51 52 57 private static int idCount = 100000; 58 59 66 public AnonId() { 67 if (JenaParameters.disableBNodeUIDGeneration) { 68 synchronized (AnonId.class) { 69 id = "A" + idCount++; } 71 } else { 72 id = (new UID ()).toString(); 73 } 74 } 75 76 79 public AnonId(String id) { 80 this.id = id; 81 } 82 83 87 public boolean equals(Object o) { 88 return (o instanceof AnonId && id.equals(((AnonId)o).id)); 89 } 90 91 94 public String toString() { 95 return id; 96 } 97 98 101 public int hashCode() { 102 return id.hashCode(); 103 } 104 } 105 | Popular Tags |