DLESE Tools
v1.6.0

org.dlese.dpc.repository
Class DirInfo

java.lang.Object
  extended by org.dlese.dpc.repository.DirInfo
All Implemented Interfaces:
Serializable

public class DirInfo
extends Object
implements Serializable

Data structure that holds information about a directory of metadata files. Includes the directory name and the metadata format for the files in that directory.

Author:
John Weatherley
See Also:
SetInfo, Serialized Form

Constructor Summary
DirInfo()
          Constructor for the DirInfo object
DirInfo(String dir, String format)
          Constructor for the DirInfo object
 
Method Summary
 boolean equals(Object o)
          Checks equality of two DirInfo objects.
 Object getAttribute(String key)
          Gets an attribute Object from this DirInfo.
 String getDirectory()
          Gets the dir attribute of the DirInfo object
 String getFormat()
          Gets the format attribute of the DirInfo object
 boolean hasDirectory(File directory)
          Determines whether this directory is the same as the given directory.
 void setAttribute(String key, Object attribute)
          Sets an attribute Object that will be available for access using the given key.
 void setDirectory(String val)
          Sets the dir attribute of the DirInfo object
 void setFormat(String val)
          Sets the format attribute of the DirInfo object
 String toString()
          Provides a String representataion for this DirInfo.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirInfo

public DirInfo()
Constructor for the DirInfo object


DirInfo

public DirInfo(String dir,
               String format)
Constructor for the DirInfo object

Parameters:
dir - The direcotory path
format - The metadata format for the files in the directory
Method Detail

getDirectory

public String getDirectory()
Gets the dir attribute of the DirInfo object

Returns:
The dir value

setDirectory

public void setDirectory(String val)
Sets the dir attribute of the DirInfo object

Parameters:
val - The new dir value

hasDirectory

public boolean hasDirectory(File directory)
Determines whether this directory is the same as the given directory.

Parameters:
directory - A directory
Returns:
True if this directory is the same

getFormat

public String getFormat()
Gets the format attribute of the DirInfo object

Returns:
The format value

setFormat

public void setFormat(String val)
Sets the format attribute of the DirInfo object

Parameters:
val - The new format value

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 DirInfo.

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 DirInfo. This method may be used for debugging to see what is in the DirInfo. This method is also used it the equals(Object) method.

Overrides:
toString in class Object
Returns:
String describing all data in this DirInfo.

equals

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

Overrides:
equals in class Object
Parameters:
o - The DirInfo to compare to this
Returns:
True iff the compared object is equal

DLESE Tools
v1.6.0