next up previous contents
Next: The StrawTies Class Up: The Haystack Data Model Previous: The StrawType Class

The Weavable Interface and the Straw Class

  Every node and link type in our system originates from the Weavable interface. By providing one default interface and implementation it is possible to design methods in the system that will accept arbitrary node and link types. Additionally, the Weavable interface provides a number of vital methods including the usual constructors, accessors and modifiers for efficiently dealing with our object model.

The primary implementation (in Java terminology) of the Weavable interface is the haystack.object.Straw class. All derivative nodes and links extend (again, Java terminology) the Straw class. The Straw class contains three important data members, two StrawTies objects and a HaystackID object. One of the StrawTies objects maintains the pointers in the forward direction (i.e. Straws pointed at). The other maintains pointers to the back objects (i.e. Straws pointing to). We'll return to this shortly.

The Straw class is extended in a variety of ways, but is never instantiated on its own (that is, we never have an object of type Straw in a HDM graph). The key methods specified by the Weavable interface (and implemented by Straw) are described in the subsequent sections.





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