public class CatalogFactoryBase extends CatalogFactory
A simple implementation of CatalogFactory
.
Modifier and Type | Field and Description |
---|---|
private Catalog |
catalog
The default
Catalog for this CatalogFactory . |
private java.util.Map |
catalogs
Map of named
Catalog s, keyed by catalog name. |
DELIMITER
Constructor and Description |
---|
CatalogFactoryBase()
Construct an empty instance of
CatalogFactoryBase . |
Modifier and Type | Method and Description |
---|---|
void |
addCatalog(java.lang.String name,
Catalog catalog)
Adds a named instance of Catalog to the factory (for subsequent
retrieval later).
|
Catalog |
getCatalog()
Gets the default instance of Catalog associated with the factory
(if any); otherwise, return
null . |
Catalog |
getCatalog(java.lang.String name)
Retrieves a Catalog instance by name (if any); otherwise
return
null . |
java.util.Iterator |
getNames()
|
void |
setCatalog(Catalog catalog)
Sets the default instance of Catalog associated with the factory.
|
clear, getCommand, getInstance
private Catalog catalog
The default Catalog
for this CatalogFactory
.
private java.util.Map catalogs
Map of named Catalog
s, keyed by catalog name.
public CatalogFactoryBase()
Construct an empty instance of CatalogFactoryBase
. This
constructor is intended solely for use by CatalogFactory
.
public Catalog getCatalog()
Gets the default instance of Catalog associated with the factory
(if any); otherwise, return null
.
getCatalog
in class CatalogFactory
public void setCatalog(Catalog catalog)
Sets the default instance of Catalog associated with the factory.
setCatalog
in class CatalogFactory
catalog
- the default Catalog instancepublic Catalog getCatalog(java.lang.String name)
Retrieves a Catalog instance by name (if any); otherwise
return null
.
getCatalog
in class CatalogFactory
name
- the name of the Catalog to retrievepublic void addCatalog(java.lang.String name, Catalog catalog)
Adds a named instance of Catalog to the factory (for subsequent retrieval later).
addCatalog
in class CatalogFactory
name
- the name of the Catalog to addcatalog
- the Catalog to addpublic java.util.Iterator getNames()
Return an Iterator
over the set of named
Catalog
s known to this CatalogFactory
.
If there are no known catalogs, an empty Iterator is returned.
getNames
in class CatalogFactory