Package epydoc :: Module uid :: Class Link
[show private | hide private]
[frames | no frames]

Class Link


A cross-reference link between documentation. A link consists of a name and a target. The target is a UID, identifying the object whose documentation is pointed to. The name specifies how the link should appear in the source document. Usually, the name is just the (short) name of the target. However, it doesn't have to be. For example, consider the following code:
>>> def f(x): pass
>>> g = f
Links to g and f will have the same target (whose short name will be 'f'), but links to them will use different names ('f' and 'g', respectively).
Method Summary
  __init__(self, name, target)
Create a new cross-reference link, with the given name and target.
  __cmp__(self, other)
string __repr__(self)
Return a string representation of this Link.
boolean is_private(self)
Return true if this link points to a private object.
boolean is_public(self)
Return true if this link points to a public object.
string name(self)
Return this link's name.
UID target(self)
Return this link's target.

Instance Variable Summary
string _name: The name by which should be used to indicate this link in source documents.
UID _target: The UID of the Python object pointed to by this Link.

Method Details

__init__(self, name, target)
(Constructor)

Create a new cross-reference link, with the given name and target.
Parameters:
name - A string specifying how the link should appear in the source document.
           (type=string)
target - The object that is pointed to by the new Link.
           (type=UID)

__repr__(self)
(Representation operator)

Returns:
A string representation of this Link.
           (type=string)

is_private(self)

Returns:
True if this link points to a private object. This is equivalant to self.target().is_private().
           (type=boolean)

is_public(self)

Returns:
True if this link points to a public object. This is equivalant to self.target().is_public().
           (type=boolean)

name(self)

Returns:
This link's name. This string specifies how the link should appear in the source document.
           (type=string)

target(self)

Returns:
This link's target. This UID specifies what object is pointed to by this link.
           (type=UID)

Instance Variable Details

_name

The name by which should be used to indicate this link in source documents.
Type:
string

_target

The UID of the Python object pointed to by this Link.
Type:
UID

Generated by Epydoc 2.1 on Sat Mar 20 17:46:12 2004 http://epydoc.sf.net