DLESE Tools
v1.2

org.dlese.dpc.repository
Class SetInfo

java.lang.Object
  extended byorg.dlese.dpc.repository.SetInfo
All Implemented Interfaces:
Serializable

public class SetInfo
extends Object
implements Serializable

Data structure that holds information about a metadata set or collection, such as name, description, setSpec and location of data files.

Author:
John Weatherley
See Also:
DirInfo, Serialized Form

Constructor Summary
SetInfo()
          Constructor for the SetInfo object
SetInfo(String name, String setSpec, String description, String enabled, String dir, String format)
          Constructor for the SetInfo object
 
Method Summary
 void addDirInfo(String format, String dir)
          Adds a feature to the DirInfo attribute of the SetInfo object
 boolean containsDirectory(File directory)
          Determines whether a directory is configured in this SetInfo.
 boolean containsDirInfo(DirInfo dirInfo)
          Determines whether a DirInfo that matches the attributes of the given DirInfo already exists in this SetInfo.
 boolean equals(Object o)
          Checks equality of two SetInfo objects.
 Object getAttribute(String key)
          Gets an attribute Object from this SetInfo.
 String getDescription()
          Gets the XML description.
 String getDescriptionHtml()
          Gets the descriptionHtml attribute of the SetInfo object
 DirInfo getDirInfo(int i)
          Gets the dirInfo attribute of the SetInfo object
 ArrayList getDirInfos()
          Gets the dirInfos attribute of the SetInfo object
 String getEnabled()
          Gets the enabled status String [true | false].
 String getName()
          Gets the name attribute of the SetInfo object
 String getSetSpec()
          Gets the setSpec attribute of the SetInfo object
 boolean isEnabled()
          Gets the enabled status boolean [true | false].
 void removeDirInfo(int i)
          DESCRIPTION
 void setAttribute(String key, Object attribute)
          Sets an attribute Object that will be available for access using the given key.
 void setDescription(String val)
          Sets the description, which must be in XML form.
 void setDirInfo(int i, DirInfo dirInfo)
          Sets the dirInfo attribute of the SetInfo object
 void setDirInfo(int i, String dir, String format)
          Sets the dirInfo attribute of the SetInfo object
 void setEnabled(String val)
          Sets the enabled status [true | false].
 void setName(String val)
          Sets the name attribute of the SetInfo object
 void setSetSpec(String val)
          Sets the setSpec attribute of the SetInfo object
 String toString()
          Provides a String representataion for this SetInfo.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetInfo

public SetInfo()
Constructor for the SetInfo object


SetInfo

public SetInfo(String name,
               String setSpec,
               String description,
               String enabled,
               String dir,
               String format)
Constructor for the SetInfo object

Parameters:
name - The human-readable name of the set
setSpec - The oai setSpec that will be used to reference this set
dir - A directory where files for this set are located
format - The native metadata format for the files in the above directory
description - A description for this set, in XML form.
enabled - [true | false]
Method Detail

getName

public String getName()
Gets the name attribute of the SetInfo object

Returns:
The name value

setName

public void setName(String val)
Sets the name attribute of the SetInfo object

Parameters:
val - The new name value

getSetSpec

public String getSetSpec()
Gets the setSpec attribute of the SetInfo object

Returns:
The setSpec value

setSetSpec

public void setSetSpec(String val)
Sets the setSpec attribute of the SetInfo object

Parameters:
val - The new setSpec value

getDescription

public String getDescription()
Gets the XML description.

Returns:
The description value

getDescriptionHtml

public String getDescriptionHtml()
Gets the descriptionHtml attribute of the SetInfo object

Returns:
The descriptionHtml value

setDescription

public void setDescription(String val)
Sets the description, which must be in XML form.

Parameters:
val - The new description value

getEnabled

public String getEnabled()
Gets the enabled status String [true | false].

Returns:
The enabled status.

isEnabled

public boolean isEnabled()
Gets the enabled status boolean [true | false].

Returns:
The enabled status.

setEnabled

public void setEnabled(String val)
Sets the enabled status [true | false].

Parameters:
val - The String 'true' or 'false'.

getDirInfos

public ArrayList getDirInfos()
Gets the dirInfos attribute of the SetInfo object

Returns:
The dirInfos value

getDirInfo

public DirInfo getDirInfo(int i)
Gets the dirInfo attribute of the SetInfo object

Parameters:
i - DESCRIPTION
Returns:
The dirInfo value

setDirInfo

public void setDirInfo(int i,
                       DirInfo dirInfo)
Sets the dirInfo attribute of the SetInfo object

Parameters:
i - The new dirInfo value
dirInfo - The new dirInfo value

setDirInfo

public void setDirInfo(int i,
                       String dir,
                       String format)
Sets the dirInfo attribute of the SetInfo object

Parameters:
i - The new dirInfo value
dir - The new dirInfo value
format - The new dirInfo value

containsDirInfo

public boolean containsDirInfo(DirInfo dirInfo)
Determines whether a DirInfo that matches the attributes of the given DirInfo already exists in this SetInfo.

Parameters:
dirInfo - A DirInfo to check for existance.
Returns:
True if the DirInfo exists in this SetInfo.

containsDirectory

public boolean containsDirectory(File directory)
Determines whether a directory is configured in this SetInfo.

Parameters:
directory - A file directory.
Returns:
True if the directory is configured in this SetInfo.

removeDirInfo

public void removeDirInfo(int i)
DESCRIPTION

Parameters:
i - DESCRIPTION

addDirInfo

public void addDirInfo(String format,
                       String dir)
Adds a feature to the DirInfo attribute of the SetInfo object

Parameters:
format - The feature to be added to the DirInfo attribute
dir - The feature to be added to the DirInfo attribute

setAttribute

public void setAttribute(String key,
                         Object attribute)
Sets an attribute Object that will be available for access using the given key. The object MUST be serializable.

Parameters:
key - The key used to reference the attribute.
attribute - Any Java Object that is Serializable.

getAttribute

public Object getAttribute(String key)
Gets an attribute Object from this SetInfo.

Parameters:
key - The key used to reference the attribute.
Returns:
The Java Object that was stored under the given key or null if none exists.

toString

public String toString()
Provides a String representataion for this SetInfo. This method may be used for debugging to see what is in the SetInfo. This method is also used it the equals(Object) method.

Returns:
String describing all data in the SetInfo.

equals

public boolean equals(Object o)
Checks equality of two SetInfo objects.

Parameters:
o - The SetInfo to compare to this
Returns:
True iff the compared object is equal

DLESE Tools
v1.2