ePOST API

rice.email
Class EmailSinglePart

java.lang.Object
  extended by rice.email.EmailContentPart
      extended by rice.email.EmailSinglePart
All Implemented Interfaces:
java.io.Serializable

public class EmailSinglePart
extends EmailContentPart

Represents the content of an email which is a single entry

Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  java.lang.ref.SoftReference content
          The actual content of this email part
 EmailDataReference contentReference
          A reference to the content of this email part
protected  int lines
          The number of lines for this email single part
protected  EmailData unstoredContent
          A reference to the content which is non-soft
 
Fields inherited from class rice.email.EmailContentPart
size, storage
 
Constructor Summary
EmailSinglePart(EmailData content)
          Constructor which takes in an EmailData
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns whether or not this emailSinglePart is equal to the given object
 void getContent(Continuation command)
          Method which retrieves and returns this content's EmailData
 void getContentHashReferences(java.util.Set set)
          This method returns a list of all the handles stored in this part by adding them to the specified set.
 int getLines()
          Returns the number of lines for this email single part
 int hashCode()
          Returns the hashCode
 void setStorage(StorageService storage)
          Method which sets this part's storage service
 void storeData(Continuation command)
          Method which writes this part's content out to disk and retrieves a reference to it.
 
Methods inherited from class rice.email.EmailContentPart
getSize, setSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lines

protected int lines
The number of lines for this email single part


content

protected transient java.lang.ref.SoftReference content
The actual content of this email part


contentReference

public EmailDataReference contentReference
A reference to the content of this email part


unstoredContent

protected transient EmailData unstoredContent
A reference to the content which is non-soft

Constructor Detail

EmailSinglePart

public EmailSinglePart(EmailData content)
Constructor which takes in an EmailData

Method Detail

getContentHashReferences

public void getContentHashReferences(java.util.Set set)
This method returns a list of all the handles stored in this part by adding them to the specified set.

Specified by:
getContentHashReferences in class EmailContentPart
Parameters:
set - The set to add the PastContentHandles to.

storeData

public void storeData(Continuation command)
Method which writes this part's content out to disk and retrieves a reference to it.

Specified by:
storeData in class EmailContentPart
Parameters:
command - The command to run once the data has been stored, and is returned the success or failure of this command

getContent

public void getContent(Continuation command)
Method which retrieves and returns this content's EmailData

Specified by:
getContent in class EmailContentPart
Parameters:
command - The command to run once the data is available

getLines

public int getLines()
Returns the number of lines for this email single part

Returns:
The number of lines of the data

equals

public boolean equals(java.lang.Object o)
Returns whether or not this emailSinglePart is equal to the given object

Specified by:
equals in class EmailContentPart
Parameters:
o - The object to compare to
Returns:
Whether or not this is equal to o

hashCode

public int hashCode()
Returns the hashCode

Specified by:
hashCode in class EmailContentPart

setStorage

public void setStorage(StorageService storage)
Method which sets this part's storage service

Overrides:
setStorage in class EmailContentPart
Parameters:
storage - The local storage service

ePOST API

Copyright © 2001-2005 - Rice Pastry.