org.opensourcephysics.tools
Class LibraryCollection

java.lang.Object
  extended by org.opensourcephysics.tools.LibraryResource
      extended by org.opensourcephysics.tools.LibraryCollection
All Implemented Interfaces:
java.lang.Comparable<LibraryResource>

public class LibraryCollection
extends LibraryResource

This represents a collection of library resources.

Version:
1.0
Author:
Douglas Brown

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opensourcephysics.tools.LibraryResource
LibraryResource.Metadata
 
Field Summary
 
Fields inherited from class org.opensourcephysics.tools.LibraryResource
allResourceTypes, COLLECTION_TYPE, collectionPath, displayName, EJS_TYPE, ejsIcon, HTML_TYPE, htmlIcon, IMAGE_TYPE, imageFilters, imageIcon, megabyteFormat, META_AUTHOR, META_CONTACT, META_KEYWORDS, META_TYPES, parent, PDF_TYPE, pdfIcon, RESOURCE_TYPES, target, TRACKER_TYPE, trackerIcon, treePath, UNKNOWN_TYPE, unknownIcon, VIDEO_TYPE, videoIcon
 
Constructor Summary
LibraryCollection(java.lang.String name)
          Constructor.
 
Method Summary
 void addResource(LibraryResource resource)
          Adds a resource to the end of this collection.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
 LibraryResource[] getResources()
          Gets the array of resources in this collection.
 java.lang.String getType()
          Gets the type of resource.
 void insertResource(LibraryResource resource, int index)
          Inserts a resource into this collection at a specified index.
 void removeResource(LibraryResource resource)
          Removes a resource from this collection.
 boolean setTarget(java.lang.String path)
          Sets the target of this collection.
 boolean setType(java.lang.String type)
          Overrides LibraryResource method.
 
Methods inherited from class org.opensourcephysics.tools.LibraryResource
addMetadata, compareTo, equals, getBasePath, getBodyStyle, getClone, getCollectionPath, getDescription, getH1Style, getH2Style, getHTMLBody, getHTMLCode, getHTMLPath, getIcon, getInheritedBasePath, getMetadata, getMetadata, getName, getProperty, getPropertyNames, getStyleSheetCode, getTarget, getThumbnail, getTitle, getTreePath, insertLineBreaks, removeMetadata, setBasePath, setDescription, setHTMLPath, setMetadata, setName, setProperty, setThumbnail, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LibraryCollection

public LibraryCollection(java.lang.String name)
Constructor.

Parameters:
name - the name of the collection
Method Detail

getType

public java.lang.String getType()
Gets the type of resource.

Overrides:
getType in class LibraryResource
Returns:
collection type

setType

public boolean setType(java.lang.String type)
Overrides LibraryResource method.

Overrides:
setType in class LibraryResource
Parameters:
type - ignored
Returns:
false, since never changes

setTarget

public boolean setTarget(java.lang.String path)
Sets the target of this collection.

Overrides:
setTarget in class LibraryResource
Parameters:
path - the target path
Returns:
true if changed

addResource

public void addResource(LibraryResource resource)
Adds a resource to the end of this collection.

Parameters:
resource - the resource

insertResource

public void insertResource(LibraryResource resource,
                           int index)
Inserts a resource into this collection at a specified index.

Parameters:
resource - the resource
index - the index

removeResource

public void removeResource(LibraryResource resource)
Removes a resource from this collection.

Parameters:
resource - the resource to remove

getResources

public LibraryResource[] getResources()
Gets the array of resources in this collection.

Returns:
an array of resources

getLoader

public static XML.ObjectLoader getLoader()
Returns an ObjectLoader to save and load data for this class.

Returns:
the object loader