edu.nrao.sss.model.resource
Class ResourceGroup

java.lang.Object
  extended by edu.nrao.sss.catalog.CatalogItemGroup<Resource,ResourceGroup,ResourceCatalog>
      extended by edu.nrao.sss.model.resource.ResourceGroup
All Implemented Interfaces:
Identifiable, Cloneable

public class ResourceGroup
extends CatalogItemGroup<Resource,ResourceGroup,ResourceCatalog>
implements Identifiable

A collection of Resources. A ResourceGroup is normally contained in a ResourceCatalog and is a way of categorizing resources that have similar traits.

Version Info:

$Revision: 1709 $
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $ (last person to modify)

Since:
2006-10-20
Author:
David M. Harland

Field Summary
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Constructor Summary
ResourceGroup()
          Creates a new group that has a default name and that belongs to no catalog.
ResourceGroup(ResourceCatalog container, String nameOfGroup)
          Creates a new group that belongs to container.
 
Method Summary
static ResourceGroup fromXml(Reader reader)
          Creates a new group based on the XML data read from reader.
static ResourceGroup fromXml(String xmlFile)
          Creates a new group from the XML data in the given file.
protected  long getIdOfUnidentified()
          Returns Identifiable.UNIDENTIFIED.
 
Methods inherited from class edu.nrao.sss.catalog.CatalogItemGroup
add, add, addAll, addAll, addEvenIfEqualToCurrentMember, addEvenIfEqualToCurrentMember, addListener, clear, clearlyNotEqualTo, clone, cloneAllExceptMembers, cloneIntoSameCatalog, contains, copyPropertiesFrom, decrementIndexOf, decrementIndexOfMemberAt, equals, equalsWithoutRespectToOrder, get, getAll, getCatalog, getId, getInternalMemberList, getName, getNameIsLocked, getNotes, hasCatalog, hashCode, incrementIndexOf, incrementIndexOfMemberAt, indexOf, isEmpty, lastIndexOf, move, move, remove, remove, removeAll, removeAllListeners, removeListener, setCatalog, setId, setInternalMemberList, setName, setNameAndConfirm, simplySetCatalog, size, sort, swap, tellListenersAboutFormerMember, tellListenersAboutMovedMember, tellListenersAboutNewMember, toString, toXml, writeAsXmlTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.nrao.sss.util.Identifiable
getId
 

Constructor Detail

ResourceGroup

public ResourceGroup()
Creates a new group that has a default name and that belongs to no catalog.


ResourceGroup

public ResourceGroup(ResourceCatalog container,
                     String nameOfGroup)
Creates a new group that belongs to container.

Parameters:
container - the name of the one catalog to which this group belongs. This value may be null.
nameOfGroup - the name of this group. If this value is null, a non-null default name will be used.
Method Detail

getIdOfUnidentified

protected long getIdOfUnidentified()
Returns Identifiable.UNIDENTIFIED.

Overrides:
getIdOfUnidentified in class CatalogItemGroup<Resource,ResourceGroup,ResourceCatalog>

fromXml

public static ResourceGroup fromXml(String xmlFile)
                             throws JAXBException,
                                    XMLStreamException,
                                    FileNotFoundException
Creates a new group from the XML data in the given file.

Parameters:
xmlFile - the name of an XML file. This method will attempt to locate the file by using Class.getResource(String).
Returns:
a new group from the XML data in the given file.
Throws:
FileNotFoundException - if the XML file cannot be found.
JAXBException - if the schema file used (if any) is malformed, if the XML file cannot be read, or if the XML file is not schema-valid.
XMLStreamException - if there is a problem opening the XML file, if the XML is not well-formed, or for some other "unexpected processing conditions".

fromXml

public static ResourceGroup fromXml(Reader reader)
                             throws JAXBException,
                                    XMLStreamException
Creates a new group based on the XML data read from reader.

Parameters:
reader - the source of the XML data. If this value is null, null is returned.
Returns:
a new group based on the XML data read from reader.
Throws:
XMLStreamException - if the XML is not well-formed, or for some other "unexpected processing conditions".
JAXBException - if anything else goes wrong during the transformation.


Copyright © 2009. All Rights Reserved.