edu.cmu.hcii.calo.model.Resource Class Reference

List of all members.

Detailed Description

Represents a resource (such as a file) that can be opened or printed.

Todo:
This doesn't yet reconstitute the File reference when deserialized.
Author:
Brian Ellis


Public Member Functions

 Resource (File associatedFile)
 Constructs a Resource from a particular file.
int compareTo (Object otherObj)
 Comparator method to sort resources in order from highest to lowest relevance.
File getAssociatedFile ()
 Accessor method for associatedFile.
String getFileName ()
 A getter for fileName.
double getRelevance ()
 Accessor method for relevance.
void setRelevance (double relevance)
 Setter method for relevance.
String toString ()
 Returns a string representation of this Resource.

Private Member Functions

void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException
 Allows serialization to deal with files correctly.

Private Attributes

transient File associatedFile
 The file system object represented by this resource.
String fileName
 The name of the file to set as a resource.
double relevance
 The relevance value of this resource to whatever it is being displayed with.

Static Private Attributes

static final long serialVersionUID = 903129020567497504L
 Prevent serialization collisions.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.model.Resource.Resource ( File  associatedFile  ) 

Constructs a Resource from a particular file.

Parameters:
associatedFile the file associated with the resource


Member Function Documentation

int edu.cmu.hcii.calo.model.Resource.compareTo ( Object  otherObj  ) 

Comparator method to sort resources in order from highest to lowest relevance.

Parameters:
otherObj the object to compare this one to
See also:
java.lang.Comparable.compareTo(java.lang.Object)

File edu.cmu.hcii.calo.model.Resource.getAssociatedFile (  ) 

Accessor method for associatedFile.

Returns:
the value of associatedFile

String edu.cmu.hcii.calo.model.Resource.getFileName (  ) 

A getter for fileName.

Returns:
the fileName

double edu.cmu.hcii.calo.model.Resource.getRelevance (  ) 

Accessor method for relevance.

Returns:
the value of relevance

void edu.cmu.hcii.calo.model.Resource.readObject ( ObjectInputStream  in  )  throws IOException, ClassNotFoundException [private]

Allows serialization to deal with files correctly.

Parameters:
in the input stream to read from
Exceptions:
IOException 
ClassNotFoundException 

void edu.cmu.hcii.calo.model.Resource.setRelevance ( double  relevance  ) 

Setter method for relevance.

Parameters:
relevance the relevance to set

String edu.cmu.hcii.calo.model.Resource.toString (  ) 

Returns a string representation of this Resource.

Useful only for debugging.


Member Data Documentation

final long edu.cmu.hcii.calo.model.Resource.serialVersionUID = 903129020567497504L [static, private]

Prevent serialization collisions.

transient File edu.cmu.hcii.calo.model.Resource.associatedFile [private]

The file system object represented by this resource.

String edu.cmu.hcii.calo.model.Resource.fileName [private]

The name of the file to set as a resource.

double edu.cmu.hcii.calo.model.Resource.relevance [private]

The relevance value of this resource to whatever it is being displayed with.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:17 2007 for CALO by  doxygen 1.5.2