next up previous contents
Next: Straw Modifiers Up: Straw Constructors Previous: Straw Constructors

The HaystackID Class

Uniquely identifying nodes within the graph would be highly useful for a number of reasons. By tagging Straws with a unique identifier, services could quickly access different portions of the graph and the keeping track of the state of the Straws within Haystack would be easier.

In order to guarantee that our identification scheme was scalable enough, the actual identity information is encapsulated inside a HaystackID object. Currently, the internal representation for HaystackIDs is the java.math.BigInteger class. BigInteger allows for arbitrarily large integer values, which is sufficient for maintaining uniqueness within a give Haystack. In the future, when Haystacks interact together, additional user-specific information will need to be added.

The HaystackID class currently provides for a number of operations to extract the ``low level'' representation of the identifier, but use of these should be limited, and possibly prohibited in the future. The class also defines a number of comparison operators for judging equality between two identifiers. Because each Straw is assumed to be unique, the test for equality between two Straws is done simply by comparing the two HaystackIDs.



Copyright 1998, Eytan Adar (eytan@alum.mit.edu)