All Packages  This Package  Class Hierarchy  Class Search  Index

Class utah.npm.core.Link
java.lang.Object
   |
   +----utah.npm.core.Link

  Summary

final class  Link
     extends java.lang.Object
{
          // Fields 1
     Refable pointsTo_;

          // Constructors 3
     Link();
     Link(Link);
     Link(Refable);

          // Methods 7
     void associate(Refable);
     void copy(Link);
     void destroy();
     Refable follow();
     Refable follow(int);
     boolean isValid();
     boolean pointsTo(Refable);
}

An inter-NPM Object link. Links encapsulate references that can "dissappear." (Like Smalltalk's weak references.)

This implementation does not, in fact, implement that.

 TODO:
 	implement ref counting or ref destruction.
      why Refable?  As these are compeltely internal, shouldn't
        an NPMObject be suitable?
 

Version:
NPMJava 0.5.0 April, 1998
Author:
Patrick Tullmann tullmann@cs.utah.edu


  Cross Reference

Returned By:
Port.s_getPSetLink(), Reference.s_getLink()





  Fields

· pointsTo_

Summary  |  Top
   Refable pointsTo_

The actual object this link points to.


  Constructors

· Link

Summary  |  Top

   Link() 

Default constructor. Initializes as a null link.



· Link

Summary  |  Top
   Link(Refable initObj) 

Construct a link that points to the provided NPM Object.

Parameter Description
initObj the initial object to point to.

See Also: Refable



· Link

Summary  |  Top
   Link(Link initObj) 

Copy constructor. Construct a new link that points to the same object as the provided link.

Parameter Description
initObj a link to the initial object to point to.



  Methods

· follow

Summary  |  Top
   Refable follow(int reqdType) 

Follow link, and lock object, but only if its of the required type.

Parameter Description
reqdType the required object type the caller would like, should be one of the constants defined in NPMObject.

Returns:
the object this points to, or null. Null will be returned if link is stale or if object was of the incorrect class.

See Also: NPMObject



· follow

Summary  |  Top
   Refable follow() 

Follow the link and return target object, locked. Fails if the link is stale or if the link is null.

Returns:
A locked NPM Object.


· pointsTo

Summary  |  Top
   boolean pointsTo(Refable obj) 

Compare the provided object to what this link points to. The provided object should be locked, if it exists.

Parameter Description
obj the NPM object to compare against.

Returns:
returns true if the proivded object is pointed to by this link.

See Also: Refable



· associate

Summary  |  Top
   void associate(Refable refObj) 

Associate this link with the proivded Object. Any existing link is destroyed.

Parameter Description
refObj the object to associate this link with.



· copy

Summary  |  Top
   void copy(Link nlink) 

Make this link a copy of the provided Link. Any existing link is destroyed.

Parameter Description
nlink the link to copy.



· isValid

Summary  |  Top
   boolean isValid() 

Returns true if the object this link points to exists and is active. False otherwise. If this link had gone stale (active link, but to an inactive object) it is nulled out.

Returns:
true if object is valid and active, false otherwise.


· destroy

Summary  |  Top
   void destroy() 

Destroy this link object.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7