University of Sheffield   

    The Simons
    Component Library

Introduction   Class Hierarchy   Class Listing   Index of Classes   Index of Methods   Header Files  

Entry Class Reference

#include <Entry.h>

Inheritance diagram for Entry:

Object List of all members.

Detailed Description

Entry: a mapping between a domain and a range object.

An Entry represents a directed relationship between two Objects. The first Object, known as the domain, serves as a search key. The second Object, known as the range, is the corresponding value stored opposite the key. Entry is used as the element-type of a Map, in which search keys are unique, and also of a Relation, in which search keys are non-unique.


Public Member Functions

 Entry ()
 Construct an empty Entry.

virtual ~Entry ()
 Release an Entry.

 Entry (ObjectID, ObjectID)
 Construct an Entry mapping from a domain to a range value.

virtual ObjectID clone () const
 Clone a shallow copy of this Entry.

virtual Natural hash () const
 Return a unique hash code for this Entry.

virtual Order compare (ObjectID) const
 Compare this Entry with another Object.

Order compare (EntryID) const
 Compare this Entry with another Entry.

Order deepCompare (EntryID) const
 Compare this Entry deeply with another Entry.

virtual Void readOn (ReaderID)
 Read this Entry on a Reader stream.

virtual Void writeOn (WriterID) const
 Write this Entry on a Writer stream.

ObjectID domain () const
 Return the domain Object of this Entry.

ObjectID range () const
 Return the range Object of this Entry.


Constructor & Destructor Documentation

Entry::Entry  ) 
 

Construct an empty Entry.

Initialises the domain and range to null.

Returns:
an empty Entry.

Entry::~Entry  )  [virtual]
 

Release an Entry.

Entry::Entry ObjectID  domain,
ObjectID  range
 

Construct an Entry mapping from a domain to a range value.

Parameters:
domain - the domain Object.
range - the range Object.
Returns:
an Entry.


Member Function Documentation

ObjectID Entry::clone  )  const [virtual]
 

Clone a shallow copy of this Entry.

Returns:
a shallow copy of this Entry.

Reimplemented from Object.

Order Entry::compare EntryID  entry  )  const
 

Compare this Entry with another Entry.

Compares the respective domain keys of each Entry.

Parameters:
entry - an Entry.
Returns:
an Order.

Order Entry::compare ObjectID  object  )  const [virtual]
 

Compare this Entry with another Object.

If the other Object is an Entry, compares the two domain keys. Otherwise, compares this Entry's domain against the Object, treating it as a domain key.

Parameters:
object - an Object.
Returns:
an Order.

Reimplemented from Object.

Order Entry::deepCompare EntryID  entry  )  const
 

Compare this Entry deeply with another Entry.

Compares the respective domain keys and range values of each Entry. If both comparisons return the same Order, this is the result, otherwise the result is NONE.

Parameters:
entry - an Entry.
Returns:
an Order.

ObjectID Entry::domain  )  const [inline]
 

Return the domain Object of this Entry.

Returns:
an Object.

Natural Entry::hash  )  const [inline, virtual]
 

Return a unique hash code for this Entry.

The hash-code is identical to the hash-code of the domain value. This invariant must be maintained for compare() to work both with an Entry and with an arbitrary Object serving as the domain search key.

Returns:
a unique hash code.

Reimplemented from Object.

ObjectID Entry::range  )  const [inline]
 

Return the range Object of this Entry.

Returns:
an Object.

Void Entry::readOn ReaderID  in  )  [virtual]
 

Read this Entry on a Reader stream.

Reconstructs the domain and range fields of this Entry by reading them from the Reader stream using getField().

Parameters:
in - a Reader stream.

Reimplemented from Object.

Void Entry::writeOn WriterID  out  )  const [virtual]
 

Write this Entry on a Writer stream.

Encodes the domain and range fields of this Entry by writing them to the Writer stream using putField().

Parameters:
out - a Writer stream.

Reimplemented from Object.


The documentation for this class was generated from the following files:
Generated on Fri May 5 17:17:17 2006 for The Simons Component Library by doxygen1.3