edu.washington.biostr.sig.vault.files
Class FileGroup

java.lang.Object
  extended by edu.washington.biostr.sig.vault.files.FileGroup
All Implemented Interfaces:
Serializable, Comparable<FileGroup>
Direct Known Subclasses:
DisplayableFileGroup

public class FileGroup
extends Object
implements Comparable<FileGroup>, Serializable

A FileGroup is a set of files that describe a single piece of data. It contains one or more URL's and a type. It can also be a directory.
This should also be immutable, so it is threadsafe.
All sub classes should be sure to maintain thread safety.

Author:
eider
See Also:
Serialized Form

Constructor Summary
FileGroup(URI[] urls, FileType type)
           
FileGroup(URI[] urls, FileType type, Icon icon)
           
FileGroup(URI[] urls, FileType type, Icon icon, String auxilaryData)
          Create a group with some added information.
 
Method Summary
 int compareTo(FileGroup f)
          Compare the 2 objects.
static FileGroup createUnlinkedFile(FileType type)
          Create a FileGroup that is not linked to the file system (ie it is just a marker).
 boolean equals(Object obj)
          2 file groups are equal if they have the same urls.
 String getAuxilaryData()
           
 Icon getIcon()
           
 FileType getType()
           
 SortedSet<URI> getURL()
          Return an unmodifiable set that contains a several alphabatized strings that represent fully qualified URL's.
 URI[] getURLArr()
           
 int hashCode()
           
static boolean isLinked(FileGroup f)
          Return true if this file is linked to the file system and not just a marker.
static String makeUniqueString(FileGroup g)
          For those times when we need a unique string...
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileGroup

public FileGroup(URI[] urls,
                 FileType type,
                 Icon icon,
                 String auxilaryData)
Create a group with some added information. this will generally refer to some subelement of a file. A group without auxilary data is considered

Parameters:
urls -
type -
icon -
auxilaryData -

FileGroup

public FileGroup(URI[] urls,
                 FileType type)

FileGroup

public FileGroup(URI[] urls,
                 FileType type,
                 Icon icon)
Method Detail

getAuxilaryData

public String getAuxilaryData()

getType

public FileType getType()

getURL

public SortedSet<URI> getURL()
Return an unmodifiable set that contains a several alphabatized strings that represent fully qualified URL's.

Returns:

getURLArr

public URI[] getURLArr()

equals

public boolean equals(Object obj)
2 file groups are equal if they have the same urls. auxilaryData is not used in equals.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

makeUniqueString

public static String makeUniqueString(FileGroup g)
For those times when we need a unique string... The exact view of this is undefined, but it will be equal for equal FileGroup's and not equal for unequal file groups.

Returns:

compareTo

public int compareTo(FileGroup f)
Compare the 2 objects. We compare the files and if they are equal, then we use the auxilary data (which is not compatible with equals). A node with auxilary data is equal (returns 0) when compared to one without. Note: this class has a natural ordering that is inconsistent with equals.

Specified by:
compareTo in interface Comparable<FileGroup>

getIcon

public Icon getIcon()

createUnlinkedFile

public static FileGroup createUnlinkedFile(FileType type)
Create a FileGroup that is not linked to the file system (ie it is just a marker).

Parameters:
type -
Returns:

isLinked

public static boolean isLinked(FileGroup f)
Return true if this file is linked to the file system and not just a marker.

Parameters:
f -
Returns:


Copyright © 2006 University of Washington. All Rights Reserved.