|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--wtanaka.praya.obj.Obj
|
+--wtanaka.praya.obj.NormalFolder
This is simply a folder that stores messages in some order. Objs may be added, they get put at the end of the folder. The messages may be sorted. The contents of the folder may be examined, and Objs may be removed.
Return to
or the Praya Homepage
LimitFolder,
ReadOnlyFolder,
SystemFolder, Serialized Form| Field Summary | |
private java.util.Vector |
folderListeners
|
private java.util.Vector |
m_storage
Container of all children of this folder. |
(package private) static int |
MAGIC_NUMBER
Random (/dev/urandom) magic number for serialized instances of this class. |
protected java.lang.String |
name
|
NormalFolder |
parent
|
(package private) static long |
serialVersionUID
Serial Version UID |
private int |
sortKey
This member variable keeps track of which key to sort on. |
| Fields inherited from class wtanaka.praya.obj.Obj |
CONTENTS, date, DATE, FROM, privThread, REVCONTENTS, REVDATE, REVFROM, REVSCORE, REVSUBJECT, SCORE, secretObject, SUBJECT |
| Constructor Summary | |
NormalFolder()
Constructs a new, initially empty root folder. |
|
NormalFolder(NormalFolder parent)
Constructs a new, initially empty subfolder. |
|
| Method Summary | |
void |
add(Obj a)
Adds the given object to the end of this folder. |
void |
addFolderListener(FolderListener fl)
|
java.util.Enumeration |
elements()
Gives the contents of the folder. |
private void |
fireAdded(int firstIndex,
int lastIndex)
Informs folder listeners that o was added to this folder. |
private void |
fireRemoved(int firstIndex,
int lastIndex)
Informs folder listeners that o was removed from this folder. |
Obj |
getChildAt(int index)
Gets a child of this folder. |
java.lang.String |
getContents()
Used to render this folder as an obj. |
java.lang.String |
getName()
|
int |
getNumChildren()
|
NormalFolder |
getParent()
|
int |
indexOf(Obj foo)
|
boolean |
isTrashCanUsed()
Whether or not removed messages should be placed in the trash. |
private void |
mergeSort(int start,
int end,
Obj[] tmp)
|
void |
readExternal(java.io.ObjectInput in)
|
void |
remove(FolderSelectionModel selection)
Removes selected items from the folder. |
void |
remove(int i)
Removes the object at the given index from the folder. |
void |
remove(Obj a)
Removes the given object from the folder. |
void |
removeFolderListener(FolderListener fl)
|
private void |
selectSort()
Runs a selection sort on the folder, using sortKey as the key to sort on. |
void |
setName(java.lang.String name)
|
void |
sort(int key)
Sorts the contents of this folder, based on the key given by the parameter. |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
| Methods inherited from class wtanaka.praya.obj.Obj |
getFrom, getSubject, getTimeStamp, isPrivileged, lessThan, setPrivilegedThread, setSecretObject, setTimeStamp |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final long serialVersionUID
static final int MAGIC_NUMBER
private java.util.Vector m_storage
public transient NormalFolder parent
private transient java.util.Vector folderListeners
private int sortKey
protected java.lang.String name
| Constructor Detail |
public NormalFolder()
public NormalFolder(NormalFolder parent)
| Method Detail |
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException - if we encounter an error reading or a
corrupted stream.java.lang.ClassNotFoundException - if we read in a class name on
the input stream that we can't resolve.
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablepublic void addFolderListener(FolderListener fl)
public void removeFolderListener(FolderListener fl)
private void fireRemoved(int firstIndex,
int lastIndex)
private void fireAdded(int firstIndex,
int lastIndex)
public NormalFolder getParent()
public void add(Obj a)
add in interface Fillablea - the object to add to the folder. It cannot be null.public void remove(Obj a)
a - the object to remove from the folder.public void remove(int i)
the - index of the object to remove from the folder.public void remove(FolderSelectionModel selection)
private void selectSort()
private void mergeSort(int start,
int end,
Obj[] tmp)
public void sort(int key)
public void setName(java.lang.String name)
public java.lang.String getName()
public Obj getChildAt(int index)
getChildAt in interface FillableArrayIndexOutOfBoundsException - if the given child does not
exist.public int getNumChildren()
getNumChildren in interface Fillablepublic int indexOf(Obj foo)
public java.lang.String getContents()
getContents in class Objpublic java.util.Enumeration elements()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isTrashCanUsed()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||