All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.pics.SampleLabelService

java.lang.Object
   |
   +----w3c.jigsaw.pics.SampleLabelService

public class SampleLabelService
extends Object
implements LabelServiceInterface
The internal representation of a LabelService. A LabelService is an object which should be able to deliver labels for any URL. This implementation doesn't use any fancy database (it should), it uses the file system as a Database, in fact.

Each service is assigned a directory, and for each requested labels, this directory is looked up for the appropriate URL. So if you want to label http://www.w3.org/pub/WWW you have to create, under this service directory a file named http/www.w3.org/pub/WWW/label. To label its Overview.html document define the http/www.w3.org/pub/WWW/Overview.html-label file. The label itself is the content of the file.


Constructor Index

 o SampleLabelService(SampleLabelBureau, String)

Method Index

 o dump(StringBuffer, int)
Dump this service description into the given buffer.
 o filify(URL, boolean)
Filify an URL.
 o getGenericLabel(URL)
Get the most speicific generic label for an URL.
 o getGenericTreeLabels(URL)
Get the generic tree labels for given URL.
 o getName()
Get this service name.
 o getSpecificLabel(URL)
Get the specific label for the given URL.
 o getTreeLabels(URL)
Get the tree labels for the given URL.

Constructors

 o SampleLabelService
 public SampleLabelService(SampleLabelBureau b,
                           String name) throws UnknownServiceException

Methods

 o filify
 public File filify(URL u,
                    boolean generic)
Filify an URL. This methods takes an URL as input, and returns an uniq File object relative to the given SampleLabelService directory.

Parameters:
u - The URL to filify.
generic - Filify for generic labels if true.
 o getName
 public String getName()
Get this service name.

Returns:
A String instance, being the service name.
 o dump
 public void dump(StringBuffer into,
                  int format)
Dump this service description into the given buffer.

Parameters:
into - The StringBuffer to dump the service to.
 o getSpecificLabel
 public LabelInterface getSpecificLabel(URL url)
Get the specific label for the given URL.

Parameters:
url - The URL whose label is searched.
 o getGenericLabel
 public LabelInterface getGenericLabel(URL url)
Get the most speicific generic label for an URL.

Parameters:
url - The URL whose generic label is to be retreived.
Returns:
An object conforming to the LabelInterface, or null if none was found.
 o getTreeLabels
 public LabelInterface[] getTreeLabels(URL url)
Get the tree labels for the given URL.

Parameters:
url - The URL whose tree labels are to be retreived.
Returns:
An array of SampleLabel, each comforming to the LabelInterface.
 o getGenericTreeLabels
 public LabelInterface[] getGenericTreeLabels(URL url)
Get the generic tree labels for given URL.

Parameters:
url - The URL whose tree labels are to be retreived.
Returns:
An array of SampleLabel, each of which conforms to the LabelInterface.

All Packages  Class Hierarchy  This Package  Previous  Next  Index