org.opensourcephysics.tools
Class Library

java.lang.Object
  extended by org.opensourcephysics.tools.Library

public class Library
extends java.lang.Object

A Library for a LibraryBrowser. Maintains its own collections and provides access to collections from comPADRE, OSP and imported libraries.

Author:
Douglas Brown

Constructor Summary
Library()
           
 
Method Summary
 boolean addComPADRECollection(java.lang.String path, java.lang.String name)
          Adds a comPADRE collection.
 boolean addOSPLibrary(java.lang.String path)
          Adds an OSP-sponsored library.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
 boolean importLibrary(java.lang.String path)
          Imports a library.
 java.lang.String toString()
          Returns a string representation of this library.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Library

public Library()
Method Detail

addOSPLibrary

public boolean addOSPLibrary(java.lang.String path)
Adds an OSP-sponsored library. OSP libraries are not under user control.

Parameters:
path - the library path
Returns:
true if successfully added

importLibrary

public boolean importLibrary(java.lang.String path)
Imports a library. Imported libraries are managed by the user.

Parameters:
path - the library path
Returns:
true if successfully imported

addComPADRECollection

public boolean addComPADRECollection(java.lang.String path,
                                     java.lang.String name)
Adds a comPADRE collection. ComPADRE collections are not under user control.

Parameters:
path - the comPADRE query
name - the name of the collection
Returns:
true if successfully added

toString

public java.lang.String toString()
Returns a string representation of this library.

Overrides:
toString in class java.lang.Object
Returns:
the name of the library

getLoader

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

Returns:
the object loader