thredds.catalog
Class ThreddsMetadata

java.lang.Object
  extended by thredds.catalog.ThreddsMetadata

public class ThreddsMetadata
extends java.lang.Object

Metadata for "enhanced catalogs", type THREDDS.

Author:
John Caron

Nested Class Summary
static class ThreddsMetadata.Contributor
          Implements Contributor type.
static class ThreddsMetadata.GeospatialCoverage
          Implements GeospatialCoverage type.
static class ThreddsMetadata.Range
          Implements spatialRange type.
static class ThreddsMetadata.Source
          Implements Source type, used by publisher and creator elements.
static class ThreddsMetadata.Variable
          Implements Variable type.
static class ThreddsMetadata.Variables
          Implements Variables type.
static class ThreddsMetadata.Vocab
          Implements Vocab type, just text with an optional "vocabulary" attribute.
 
Constructor Summary
ThreddsMetadata(boolean inherited)
           
ThreddsMetadata(ThreddsMetadata from)
          Copy Constructor.
 
Method Summary
 void add(ThreddsMetadata tmd, boolean includeInherited)
          Add all the content from another ThreddsMetadata
 void addContributor(ThreddsMetadata.Contributor c)
          Add a contributor
 void addCreator(ThreddsMetadata.Source c)
          Add a creator
 void addDate(DateType d)
          Add a date
 void addDocumentation(InvDocumentation d)
          Add a documentation
 void addDocumentation(java.lang.String type, java.lang.String content)
          set specified type of documentation
 void addKeyword(ThreddsMetadata.Vocab keyword)
          Add a keyword
 void addMetadata(InvMetadata m)
          Add InvMetadata
 void addProject(ThreddsMetadata.Vocab project)
          Add a project
 void addProperty(InvProperty p)
          Add a property
 void addPublisher(ThreddsMetadata.Source p)
          Add a publisher
 void addVariables(ThreddsMetadata.Variables vs)
          Add variables
 boolean equals(java.lang.Object o)
           
 java.lang.String getAuthority()
           
 java.util.List<ThreddsMetadata.Contributor> getContributors()
           
 java.util.List<ThreddsMetadata.Source> getCreators()
           
 DataFormatType getDataFormatType()
           
 double getDataSize()
           
 FeatureType getDataType()
           
 java.util.List<DateType> getDates()
           
 java.util.List<InvDocumentation> getDocumentation()
           
 java.lang.String getDocumentation(java.lang.String type)
           
 ThreddsMetadata.GeospatialCoverage getGeospatialCoverage()
           
 java.lang.String getHistory()
           
 java.util.List<ThreddsMetadata.Vocab> getKeywords()
           
 java.util.List<InvMetadata> getMetadata()
           
 java.lang.String getProcessing()
           
 java.util.List<ThreddsMetadata.Vocab> getProjects()
           
 java.util.List<InvProperty> getProperties()
           
 java.util.List<ThreddsMetadata.Source> getPublishers()
           
 java.lang.String getRights()
           
 java.lang.String getServiceName()
           
 java.lang.String getSummary()
           
 DateRange getTimeCoverage()
           
 java.util.List<ThreddsMetadata.Variables> getVariables()
           
 boolean hasDataSize()
           
 int hashCode()
           
 boolean isInherited()
           
static void main(java.lang.String[] args)
          ********************************************************************
 void removeDocumentation(java.lang.String type)
          remove all instances of specified type of documentation
 void removeMetadata(InvMetadata m)
          remove an InvMetadata element from list, using equals() to locate it.
 void setAuthority(java.lang.String authorityName)
          Set authority
 void setContributors(java.util.List<ThreddsMetadata.Contributor> contributors)
          Set list of contributors (type Contributor); may be empty, not null.
 void setCreators(java.util.List<ThreddsMetadata.Source> creators)
          Set list of creators (type Source); may be empty, not null.
 void setDataFormatType(DataFormatType dataFormat)
          Set dataTypeFormat
 void setDataSize(double size)
          Set size (bytes)
 void setDataType(FeatureType dataType)
          Set dataType
 void setGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)
          set GeospatialCoverage element
 void setHistory(java.lang.String history)
          set specific type of documentation = history
 void setInherited(boolean inherited)
          Set inherited
 void setKeywords(java.util.List<ThreddsMetadata.Vocab> keywords)
          Set list of contributors; may be empty, not null.
 void setProcessing(java.lang.String processing)
          set specific type of documentation = processing_level
 void setProjects(java.util.List<ThreddsMetadata.Vocab> projects)
          Set list of projects (type Vocab); may be empty, not null.
 void setPublishers(java.util.List<ThreddsMetadata.Source> publishers)
          Set list of publishers (type Source); may be empty, not null.
 void setRights(java.lang.String rights)
          set specific type of documentation = rights
 void setServiceName(java.lang.String serviceName)
          Set serviceName
 void setSummary(java.lang.String summary)
          set specific type of documentation = summary
 void setTimeCoverage(DateRange tc)
          set TimeCoverage element
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreddsMetadata

public ThreddsMetadata(boolean inherited)

ThreddsMetadata

public ThreddsMetadata(ThreddsMetadata from)
Copy Constructor.

Parameters:
from - copy from here
Method Detail

add

public void add(ThreddsMetadata tmd,
                boolean includeInherited)
Add all the content from another ThreddsMetadata

Parameters:
tmd - get content from here
includeInherited - if false, dont add inherited InvMetadata

addCreator

public void addCreator(ThreddsMetadata.Source c)
Add a creator

Parameters:
c - add this

getCreators

public java.util.List<ThreddsMetadata.Source> getCreators()
Returns:
list of creators (type Source); may be empty, not null.

setCreators

public void setCreators(java.util.List<ThreddsMetadata.Source> creators)
Set list of creators (type Source); may be empty, not null.

Parameters:
creators - set creators to this list

addContributor

public void addContributor(ThreddsMetadata.Contributor c)
Add a contributor

Parameters:
c - add this

getContributors

public java.util.List<ThreddsMetadata.Contributor> getContributors()
Returns:
list of contributors (type Contributor); may be empty, not null.

setContributors

public void setContributors(java.util.List<ThreddsMetadata.Contributor> contributors)
Set list of contributors (type Contributor); may be empty, not null.

Parameters:
contributors - set contributers to this

addDate

public void addDate(DateType d)
Add a date

Parameters:
d - add this dateType

getDates

public java.util.List<DateType> getDates()
Returns:
list of DateType; may be empty, not null.

addDocumentation

public void addDocumentation(InvDocumentation d)
Add a documentation

Parameters:
d - add this

getDocumentation

public java.util.List<InvDocumentation> getDocumentation()
Returns:
list of InvDocumentation; may be empty, not null.

addKeyword

public void addKeyword(ThreddsMetadata.Vocab keyword)
Add a keyword

Parameters:
keyword - add this

getKeywords

public java.util.List<ThreddsMetadata.Vocab> getKeywords()
Returns:
list of contributors; may be empty, not null.

setKeywords

public void setKeywords(java.util.List<ThreddsMetadata.Vocab> keywords)
Set list of contributors; may be empty, not null.

Parameters:
keywords - set list of keywords to this

addMetadata

public void addMetadata(InvMetadata m)
Add InvMetadata

Parameters:
m - add this

removeMetadata

public void removeMetadata(InvMetadata m)
remove an InvMetadata element from list, using equals() to locate it.

Parameters:
m - remove this

getMetadata

public java.util.List<InvMetadata> getMetadata()
Returns:
list of InvMetadata; may be empty, not null.

addProject

public void addProject(ThreddsMetadata.Vocab project)
Add a project

Parameters:
project - add this

getProjects

public java.util.List<ThreddsMetadata.Vocab> getProjects()
Returns:
list of projects (type Vocab); may be empty, not null.

setProjects

public void setProjects(java.util.List<ThreddsMetadata.Vocab> projects)
Set list of projects (type Vocab); may be empty, not null.

Parameters:
projects - set list of projects to this

addProperty

public void addProperty(InvProperty p)
Add a property

Parameters:
p - add this

getProperties

public java.util.List<InvProperty> getProperties()
Returns:
list of properties; may be empty, not null.

addPublisher

public void addPublisher(ThreddsMetadata.Source p)
Add a publisher

Parameters:
p - add this

getPublishers

public java.util.List<ThreddsMetadata.Source> getPublishers()
Returns:
list of publishers (type Source); may be empty, not null.

setPublishers

public void setPublishers(java.util.List<ThreddsMetadata.Source> publishers)
Set list of publishers (type Source); may be empty, not null.

Parameters:
publishers - set list of publishers to this

addVariables

public void addVariables(ThreddsMetadata.Variables vs)
Add variables

Parameters:
vs - add this

getVariables

public java.util.List<ThreddsMetadata.Variables> getVariables()
Returns:
list of Variables; may be empty, not null.

setGeospatialCoverage

public void setGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)
set GeospatialCoverage element

Parameters:
gc - set GeospatialCoverage to this

getGeospatialCoverage

public ThreddsMetadata.GeospatialCoverage getGeospatialCoverage()
Returns:
GeospatialCoverage element

setTimeCoverage

public void setTimeCoverage(DateRange tc)
set TimeCoverage element

Parameters:
tc - set TimeCoverage to this

getTimeCoverage

public DateRange getTimeCoverage()
Returns:
TimeCoverage element

isInherited

public boolean isInherited()
Returns:
true if this is inherited

setInherited

public void setInherited(boolean inherited)
Set inherited

Parameters:
inherited - set true if inherited

getServiceName

public java.lang.String getServiceName()
Returns:
serviceName

setServiceName

public void setServiceName(java.lang.String serviceName)
Set serviceName

Parameters:
serviceName - set service name to this, must be valid service

getDataType

public FeatureType getDataType()
Returns:
dataType

setDataType

public void setDataType(FeatureType dataType)
Set dataType

Parameters:
dataType - set to this dataType

getDataFormatType

public DataFormatType getDataFormatType()
Returns:
dataType

setDataFormatType

public void setDataFormatType(DataFormatType dataFormat)
Set dataTypeFormat

Parameters:
dataFormat - set to this dataTypeFormat

getAuthority

public java.lang.String getAuthority()
Returns:
authority

setAuthority

public void setAuthority(java.lang.String authorityName)
Set authority

Parameters:
authorityName - set to this

getDocumentation

public java.lang.String getDocumentation(java.lang.String type)
Parameters:
type - match on doc.getType()
Returns:
specific type of documentation

getHistory

public java.lang.String getHistory()
Returns:
specific type of documentation = history

setHistory

public void setHistory(java.lang.String history)
set specific type of documentation = history

Parameters:
history - add (or replace) the history documentation element to this content

getProcessing

public java.lang.String getProcessing()
Returns:
specific type of documentation = processing_level

setProcessing

public void setProcessing(java.lang.String processing)
set specific type of documentation = processing_level

Parameters:
processing - add (or replace) the history documentation element to this content

getRights

public java.lang.String getRights()
Returns:
specific type of documentation = rights

setRights

public void setRights(java.lang.String rights)
set specific type of documentation = rights

Parameters:
rights - add (or replace) the history documentation element to this content

getSummary

public java.lang.String getSummary()
Returns:
specific type of documentation = summary

setSummary

public void setSummary(java.lang.String summary)
set specific type of documentation = summary

Parameters:
summary - add (or replace) the history documentation element to this content

getDataSize

public double getDataSize()
Returns:
the data size in bytes. A value of 0.0 or NaN means not set.

setDataSize

public void setDataSize(double size)
Set size (bytes)

Parameters:
size - the data size in bytes. A value of 0.0 or NaN means not set.

hasDataSize

public boolean hasDataSize()

addDocumentation

public void addDocumentation(java.lang.String type,
                             java.lang.String content)
set specified type of documentation

Parameters:
type - type of documentation
content - documentation contenet

removeDocumentation

public void removeDocumentation(java.lang.String type)
remove all instances of specified type of documentation

Parameters:
type - type of documentation

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
********************************************************************

Throws:
java.io.IOException