org.rddl.helpers
Class AbstractContainer

java.lang.Object
  |
  +--org.rddl.helpers.AbstractContainer
All Implemented Interfaces:
Container, Namespace
Direct Known Subclasses:
ContainerResourceImpl

public class AbstractContainer
extends java.lang.Object
implements Container


Field Summary
protected  java.util.TreeMap arcroleMap
           
protected  java.lang.String baseURI
           
protected  java.util.TreeMap hrefMap
           
protected  java.util.TreeMap langMap
           
protected  java.util.TreeMap roleMap
           
protected  java.util.TreeMap titleMap
           
protected  java.util.TreeMap uriMap
           
 
Constructor Summary
AbstractContainer(java.lang.String baseURI)
           
 
Method Summary
 void addResource(Resource r)
          Add a resource to the collection
 Resource getResourceFromId(java.lang.String id)
          Selects a resource given a particular id.
 Resource getResourceFromURI(java.lang.String uri)
          Lookup resource given URI.
 java.util.Iterator getResources()
          Obtain an Iterator over all the resources contained in the namespace.
 java.util.SortedMap getResourcesFromHref(java.lang.String href)
          Select a set of resources given the destination xlink:href
 java.util.SortedMap getResourcesFromIdRange(java.lang.String id0, java.lang.String id1)
          Select a set of resources given a range of ids.
 java.util.SortedMap getResourcesFromLang(java.lang.String lang)
          Select a set of resources having a specified xml:lang
 java.util.SortedMap getResourcesFromNature(java.lang.String role)
          A resource is qualified by its Nature.
 java.util.SortedMap getResourcesFromPurpose(java.lang.String arcrole)
          A resource is qualified by its Purpose.
 java.util.SortedMap getResourcesFromTitle(java.lang.String title)
          Select a set of resources having a specified xlink:title
 java.util.SortedMap getResourcesFromURIRange(java.lang.String uri0, java.lang.String uri1)
          Resources in a collection are ordered.
 java.lang.String getURI()
          The namespace URI for the namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseURI

protected java.lang.String baseURI

arcroleMap

protected java.util.TreeMap arcroleMap

hrefMap

protected java.util.TreeMap hrefMap

roleMap

protected java.util.TreeMap roleMap

titleMap

protected java.util.TreeMap titleMap

langMap

protected java.util.TreeMap langMap

uriMap

protected java.util.TreeMap uriMap
Constructor Detail

AbstractContainer

public AbstractContainer(java.lang.String baseURI)
Method Detail

getResourcesFromPurpose

public java.util.SortedMap getResourcesFromPurpose(java.lang.String arcrole)
Description copied from interface: Namespace
A resource is qualified by its Purpose.
Specified by:
getResourcesFromPurpose in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
purpose - The purpose of a RDDL resource is specified by an xlink:arcrole
Returns:
The collection of resources matching the purpose

getResourcesFromHref

public java.util.SortedMap getResourcesFromHref(java.lang.String href)
Description copied from interface: Namespace
Select a set of resources given the destination xlink:href
Specified by:
getResourcesFromHref in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
href - The xlink:href URI
Returns:
The collection of resources matching the xlink:href

getResourcesFromNature

public java.util.SortedMap getResourcesFromNature(java.lang.String role)
Description copied from interface: Namespace
A resource is qualified by its Nature.
Specified by:
getResourcesFromNature in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
role - The RDDL nature is specified by the xlink:role
Returns:
java.util.SortedMap the resources having the specified role

getResourcesFromTitle

public java.util.SortedMap getResourcesFromTitle(java.lang.String title)
Description copied from interface: Namespace
Select a set of resources having a specified xlink:title
Specified by:
getResourcesFromTitle in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
title - The xlink:title
Returns:
the collection of resources having the xlink:title

getResourcesFromLang

public java.util.SortedMap getResourcesFromLang(java.lang.String lang)
Description copied from interface: Namespace
Select a set of resources having a specified xml:lang
Specified by:
getResourcesFromLang in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
lang - The xml:lang
Returns:
A collection of selected resources

getResourceFromId

public Resource getResourceFromId(java.lang.String id)
Description copied from interface: Namespace
Selects a resource given a particular id.
Specified by:
getResourceFromId in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
id - The id
Returns:
The selected resource

getResourceFromURI

public Resource getResourceFromURI(java.lang.String uri)
Description copied from interface: Container
Lookup resource given URI.
Specified by:
getResourceFromURI in interface Container
Following copied from interface: org.rddl.Container
Parameters:
uri - The URI reference associated with a resource in the collection.
Returns:
A resource.

getResourcesFromIdRange

public java.util.SortedMap getResourcesFromIdRange(java.lang.String id0,
                                                   java.lang.String id1)
Description copied from interface: Namespace

Select a set of resources given a range of ids. The ids are specified in alphanumeric order. The idiom: "foo","foo/0" is inclusive.

Specified by:
getResourcesFromIdRange in interface Namespace
Following copied from interface: org.rddl.Namespace
Parameters:
id0 - The start of the range
id1 - The end of the range
Returns:
A collection of selected resources

getResourcesFromURIRange

public java.util.SortedMap getResourcesFromURIRange(java.lang.String uri0,
                                                    java.lang.String uri1)
Description copied from interface: Container
Resources in a collection are ordered. This method selects a set of resources associated with a given range of URI references.
Specified by:
getResourcesFromURIRange in interface Container
Following copied from interface: org.rddl.Container
Parameters:
uri0 - The starting URI of the range
uri1 - The ending URI of the range
Returns:
A collection of resources

getResources

public java.util.Iterator getResources()
Description copied from interface: Namespace
Obtain an Iterator over all the resources contained in the namespace.
Specified by:
getResources in interface Namespace
Following copied from interface: org.rddl.Namespace
Returns:
The resources in the namespace

addResource

public void addResource(Resource r)
Description copied from interface: Container
Add a resource to the collection
Specified by:
addResource in interface Container
Following copied from interface: org.rddl.Container
Parameters:
r - The resource to add

getURI

public java.lang.String getURI()
Description copied from interface: Namespace
The namespace URI for the namespace.
Specified by:
getURI in interface Namespace
Following copied from interface: org.rddl.Namespace
Returns:
A String representing the namespace URI.