|
Goals | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjocundmail.JMBoxUtil
public class JMBoxUtil
JMBoxUtil is a utility for the method of mail storage wherever mail is
stored.
It provides a virtual representation of a mailbox, where all the messages
are indexed from 0 to getMessageCount() - 1.
| 1.0.0 | First release version - More specifics to come. |
| (5/27/07) | A basic implementation is here. At the moment it supports 1 folder, and the root of the folder contains the 0 folder/file |
| Constructor Summary | |
|---|---|
JMBoxUtil(java.lang.String rootdir)
Constructs a JMBoxUtil with a root directory supplied. |
|
| Method Summary | |
|---|---|
void |
addMessage(byte[] msg)
Writes a new message in at the end of the virtual list. |
void |
addMessage(java.lang.String msg)
Writes a new message in at the end of the virtual list. |
void |
decreaseDepth()
Since messages are stored in a tree fashion. |
java.io.File |
getMessageByIndex(int i)
|
int |
getMessageCount()
|
java.io.File |
getNewMessage()
|
void |
increaseDepth()
Since messages are stored in a tree fashion. |
static void |
main(java.lang.String[] args)
Test function for testing this class |
void |
removeMessageByIndex(int i)
Remove the message referred to by this index. |
void |
writeMessageByIndex(int i,
byte[] msg)
Writes a message into the message represented by given index. |
void |
writeMessageByIndex(int i,
java.lang.String msg)
Writes a message into the message represented by given index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMBoxUtil(java.lang.String rootdir)
throws java.io.FileNotFoundException
rootdir - String representing the root directory of the mailbox
java.io.FileNotFoundException - If the root directory specified DNE| Method Detail |
|---|
public int getMessageCount()
public java.io.File getMessageByIndex(int i)
i - Index of message to be retrieved
public java.io.File getNewMessage()
[getMessageCount()]). Also
increases the message count by 1.public void increaseDepth()
public void decreaseDepth()
public void addMessage(java.lang.String msg)
msg - The message in String form to be written to the new messagepublic void addMessage(byte[] msg)
msg - The message in byte[] form to be written to the new message
public void writeMessageByIndex(int i,
java.lang.String msg)
0 to getMessageCount().
So you could add a file by specifying the index 1 past the end of
the virtual list. (Use addMessage to do this.)
i - Index of messagemsg - Message in String form
public void writeMessageByIndex(int i,
byte[] msg)
0 to getMessageCount().
So you could add a file by specifying the index 1 past the end of
the virtual list. (Use addMessage to do this.)
i - Index of messagemsg - Message in byte[] formpublic void removeMessageByIndex(int i)
i - Valid message index of the message to be removedpublic static void main(java.lang.String[] args)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||