org.cdlib.xtf.util
Class StructuredFile.Directory

Object
  extended by StructuredFile.Directory
Enclosing class:
StructuredFile

private class StructuredFile.Directory
extends Object

Maintains the directory of files within a structured file.


Field Summary
private  StructuredFile.DirEntry[] entries
          All the entries currently in the directory
private  String userVersion
          Version string established by the client
 
Constructor Summary
StructuredFile.Directory()
          Create a new directory
StructuredFile.Directory(DataInput in)
          Read a directory from a DataInput stream
 
Method Summary
 void add(StructuredFile.DirEntry entry)
          Add an entry to the Directory
 StructuredFile.DirEntry find(String name)
          Locate the named directory entry.
 String getUserVersion()
           
 void setUserVersion(String userVersion)
           
 void writeTo(DataOutput out)
          Write out the current directory to a DataOutput stream
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

private StructuredFile.DirEntry[] entries
All the entries currently in the directory


userVersion

private String userVersion
Version string established by the client

Constructor Detail

StructuredFile.Directory

public StructuredFile.Directory()
Create a new directory


StructuredFile.Directory

public StructuredFile.Directory(DataInput in)
                         throws IOException
Read a directory from a DataInput stream

Throws:
IOException
Method Detail

writeTo

public void writeTo(DataOutput out)
             throws IOException
Write out the current directory to a DataOutput stream

Throws:
IOException

find

public StructuredFile.DirEntry find(String name)
Locate the named directory entry.

Parameters:
name - is the sub-file name to look for
Returns:
the directory entry, or null if not found.

add

public void add(StructuredFile.DirEntry entry)
Add an entry to the Directory


getUserVersion

public String getUserVersion()
Returns:
Returns the user version.

setUserVersion

public void setUserVersion(String userVersion)
Parameters:
userVersion - The user-defined version number to set.