The Data Structures Library in Java
JDSL Explorations
author(s) | date | JDSL version |
---|---|---|
Ulrik Brandes | 07/99 | 2.0 |
Summary: JDSL algorithms expect and provide attribute data in one of four basic forms of organization,
The elements of data structures input in or output by an algorithm are often parameterized with attributes. There are several ways to organize the representation of these attributesd with respect to the data structure. For example, the attributes can be stored in a field of the record representing the element, or they can be stored in a separate data structure that is indexed with the elements.
As of version 2.0, JDSL utilizes three different forms of representation
for attributes. They can either be stored as decorations of the elements
in the data structure, stored in hashtables, or stored as the one piece
of data that an Accessor
returns. JDSL algorithms often
expect input parameters as return values of template methods and
return results in the form of decorations. This makes subclassing of
algorithms a prerequisite and complicates the use of output as input
for other algorithms.
Data accessors abstract the access of attributes into a standardized interface. Algorithms expecting input and providing output via data accessors need not be modified to accomodate different forms of attribute representation. Rather, the small data accessor class that is acting as a mediator between algorithm and data is customized.
Below, an example realization of this concept in the context of JDSL
is provided. It consists of interfaces for data access and classes
implementing these interface so as to abstract away the standard
form of attribute representation in JDSL. Note that an implementation
of the InspectableAttribute
interface may just as well give
access to non-materialized attributes.