This class is in org.jtrix.facets1.util.properties.
Generic object IDs are made with the Oid class, which represents a series of dotted integers: 1, 4.3 and 100.0.0.6.8.20129 are all examples of oids. Also a series of no integers is an Oid, and this is additionally represented as Oid.EMPTY. A negative integer in an Oid name represents a wildcard.
// Some ways to construct an Oid
Oid a = new Oid();                // The zero-length Oid
Oid b = Oid.EMPTY;                // Now a.equals(b) --- but !(a == b)
Oid c = new Oid(1);               // A single-digit Oid
Oid d = new Oid(4, 3);            // Represented as 4.3
Oid e = new Oid(100, 101, 102);   // The oid 100.101.102
String e2 = e.toString();         // e2 is now "100.101.102"
Oid f = new Oid(new int{6,7,8});  // Arrays help create arbitrarily long oids
Oid g = new Oid(e, f);            // g is now 100.101.102.6.7.8
Oid h = new Oid(new int{3,2,1}, new int{6,5,4});    // h is now 3.2.1.6.5.4
// A -ve in an Oid represents a wildcard
Oid i = new Oid(100, -1, 102);     // An Oid with a wildcard in it
boolean j1 = e.matchesPattern(i);  // true
boolean j2 = g.matchesPattern(i);  // false. Must have same length
boolean j3 = g.isPrefixedBy(i);    // true
int k1 = g.getLength();            // k1 is 6
int k2 = a.getLength();            // k2 is 0
int m1 = d.compareTo(f);           // m1 is -1, as 4.3 comes before 6.7.8
int m2 = f.compareTo(h);           // m2 is 1, as 6.7.8 comes after 3.2.1.6.5.4
int m3 = f.compareTo(f);           // m3 is 0, as 4.3 is the same as itself
int[] n = d.getName();             // n is the int array {4,3}.
Nik Silver 2002-03-09