Squeak Class Documentation category index | class index  
 
CategoriesFile
  category: Network-Mail Reader
  superclass: MailDBFile
  subclasses:

I represent the organization of the mail database into set of message lists called "categories". Each category contains a collection of message ID's. The same message may be cross-filed quite cheaply by storing it's ID in multiple categories.

The categories information is kept in a binary file on the disk. It is read into memory in its entirety when the mail database is opened. To make changes persist, the categories information must be saved out to disk. This should be done after fetching new mail and when the mail database is closed. It could also be done periodically by some sort of background process.

Note that the categories file, unlike the index file, cannot be re-created from the messages file.

instance methods
  categories access
  addCategory:
categories
file:inCategory:
isUnclassified:
messagesIn:
remove:fromCategory:
removeCategory:
removeMessagesInCategory:butNotIn:
renameCategory:to:
unclassifiedFrom:

  read-write
  readFrom:
writeOn:

class methods
  no messages
 

instance methods
  categories access top  
 

addCategory:

Add a new category, if it doesn't already exist.


 

categories

Answer a collection of my categories, including the pseudo-categories '.unclassified.' and '.all.'. '.unclassified.' contains the orphaned messages that would otherwise not appear in any category. '.all.' contains all the messages in the database. Since these pseudo-categories are computed on the fly, there may be a noticable delay when one of them is selected.


 

file:inCategory:

Add the given message ID to the given category. The target category
must be a real category, not a pseudo-category.


 

isUnclassified:

Answer true if the given message ID does not appear in any of my real (not pseudo) categories.


 

messagesIn:

Answer a collection of message ID's for the messages in the given category. The pseudo-categories are dynamically computed and so they cannot be accessed in this manner.


 

remove:fromCategory:

Remove the given message ID from the given category.


 

removeCategory:

Remove the given category, if it exists.


 

removeMessagesInCategory:butNotIn:

Used to clean the dead wood out of a category.


 

renameCategory:to:

Rename the given category.


 

unclassifiedFrom:

Answer the subset of the given set of message ID's that do not appear in any category.


  read-write top  
 

readFrom:

Read the categories from the given FileStream.


 

writeOn:

Write the categories to the given FileStream. The categories data is stored in binary (as opposed to a human-readable form) to save space.


class methods
  no messages top