se.kb.oai.ore
Class Aggregation

java.lang.Object
  extended by se.kb.oai.ore.AggregateBase
      extended by se.kb.oai.ore.Aggregation

public class Aggregation
extends AggregateBase

An aggregation is a set of related resources (see AggregatedResource), grouped together such that the set can be treated as a single resource. This class is used to manage the individual resources and also holds information for the aggregation as a whole.

Author:
Oskar Grenholm, National Library of Sweden

Field Summary
 
Fields inherited from class se.kb.oai.ore.AggregateBase
id, metadata, types
 
Constructor Summary
Aggregation(String id)
          Create an Aggregation with the specified id.
Aggregation(URI id)
          Create an Aggregation with the specified id.
 
Method Summary
 void addResource(AggregatedResource resource)
          Add an AggreagatedResource to this Aggregation.
 AggregatedResource getResource(int index)
          Get the AggreagatedResource at the specified index.
 AggregatedResource getResource(String id)
          Get the AggreagatedResource with the given id.
 AggregatedResource getResource(URI id)
          Get the AggreagatedResource with the given id.
 List<AggregatedResource> getResources()
          Get this Aggregations list of AggreagatedResources.
 int numberOfResources()
          Get the number of resources that this Aggregation has.
 void setResources(List<AggregatedResource> resources)
          Set the list of resources.
 
Methods inherited from class se.kb.oai.ore.AggregateBase
addMetadata, addType, getId, getMetadata, getMetadata, getTypes, setId, setMetadata, setTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aggregation

public Aggregation(String id)
            throws URISyntaxException
Create an Aggregation with the specified id.

Parameters:
id - the id
Throws:
URISyntaxException

Aggregation

public Aggregation(URI id)
Create an Aggregation with the specified id.

Parameters:
id - the id
Method Detail

numberOfResources

public int numberOfResources()
Get the number of resources that this Aggregation has.

Returns:
the number of resources

getResources

public List<AggregatedResource> getResources()
Get this Aggregations list of AggreagatedResources.

Returns:
a list of resources

getResource

public AggregatedResource getResource(int index)
Get the AggreagatedResource at the specified index. (There is no guarantee of the ordering of the resources for different parsings of the same resource map!)

Parameters:
index - the index
Returns:
the resource

getResource

public AggregatedResource getResource(String id)
                               throws URISyntaxException
Get the AggreagatedResource with the given id.

Parameters:
id - the id of the resource
Returns:
the resource
Throws:
URISyntaxException

getResource

public AggregatedResource getResource(URI id)
Get the AggreagatedResource with the given id.

Parameters:
id - the id of the resource
Returns:
the resource, or null if no match

setResources

public void setResources(List<AggregatedResource> resources)
Set the list of resources.

Parameters:
resources - the list of resources

addResource

public void addResource(AggregatedResource resource)
Add an AggreagatedResource to this Aggregation.

Parameters:
resource - a resource


Copyright © 2008. All Rights Reserved.