net.sf.cotta
Class PathContent

java.lang.Object
  extended by net.sf.cotta.PathContent

public class PathContent
extends java.lang.Object

A value object holds a list of path for files and a list of path for directories. This is used by the file system implementations to return two list in one method call


Constructor Summary
PathContent(java.util.Collection<TPath> directories, java.util.Collection<TPath> files)
          Create path content directly with the two lists
PathContent(int totalSize)
          Create an empty path content.
 
Method Summary
 void addDirectoryPath(TPath path)
          Add a path of the directory
 void addFilePath(TPath path)
          Add a path of the file
 java.util.List<TPath> dirs()
          Get the list of the paths of the directories
 java.util.List<TPath> files()
          Get the list of the paths of the files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathContent

public PathContent(int totalSize)
Create an empty path content. It will create two empty lists, each with the size of half of the argument passed in

Parameters:
totalSize - total size of the content. This parameter is used to determine the inital size of the list to create

PathContent

public PathContent(java.util.Collection<TPath> directories,
                   java.util.Collection<TPath> files)
Create path content directly with the two lists

Parameters:
directories - list of paths to the directories
files - list of paths to the files
Method Detail

files

public java.util.List<TPath> files()
Get the list of the paths of the files

Returns:
the list of the paths of the files

dirs

public java.util.List<TPath> dirs()
Get the list of the paths of the directories

Returns:
the list of the paths of the directories

addDirectoryPath

public void addDirectoryPath(TPath path)
Add a path of the directory

Parameters:
path - path of the directory

addFilePath

public void addFilePath(TPath path)
Add a path of the file

Parameters:
path - path of the file