public abstract class Folder
extends java.lang.Object
implements java.lang.AutoCloseable
Folders can contain Messages, other Folders or both, thus providing a tree-like hierarchy rooted at the Store's default folder. (Note that some Folder implementations may not allow both Messages and other Folders in the same Folder).
The interpretation of folder names is implementation dependent. The different levels of hierarchy in a folder's full name are separated from each other by the hierarchy delimiter character.
The case-insensitive full folder name (that is, the full name relative to the default folder for a Store) INBOX is reserved to mean the "primary folder for this user on this server". Not all Stores will provide an INBOX folder, and not all users will have an INBOX folder at all times. The name INBOX is reserved to refer to this folder, when it exists, in Stores that provide it.
A Folder object obtained from a Store need not actually exist
in the backend store. The exists
method tests whether
the folder exists or not. The create
method
creates a Folder.
A Folder is initially in the closed state. Certain methods are valid
in this state; the documentation for those methods note this. A
Folder is opened by calling its 'open' method. All Folder methods,
except open
, delete
and
renameTo
, are valid in this state.
The only way to get a Folder is by invoking the
getFolder
method on Store, Folder, or Session, or by invoking
the list
or listSubscribed
methods
on Folder. Folder objects returned by the above methods are not
cached by the Store. Thus, invoking the getFolder
method
with the same folder name multiple times will return distinct Folder
objects. Likewise for the list
and listSubscribed
methods.
The Message objects within the Folder are cached by the Folder.
Thus, invoking getMessage(msgno)
on the same message number
multiple times will return the same Message object, until an
expunge is done on this Folder.
Message objects from a Folder are only valid while a Folder is open and should not be accessed after the Folder is closed, even if the Folder is subsequently reopened. Instead, new Message objects must be fetched from the Folder after the Folder is reopened.
Note that a Message's message number can change within a session if the containing Folder is expunged using the expunge method. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with this situation (probably by flushing out existing message number references and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Expunged Message objects still have to be pruned, but other Message objects in that folder are not affected by the expunge.
| Modifier and Type | Field and Description |
|---|---|
static int |
HOLDS_FOLDERS
This folder can contain other folders
|
static int |
HOLDS_MESSAGES
This folder can contain messages
|
protected int |
mode
The open mode of this folder.
|
static int |
READ_ONLY
The Folder is read only.
|
static int |
READ_WRITE
The state and contents of this folder can be modified.
|
protected Store |
store
The parent store.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Folder(Store store)
Constructor that takes a Store object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(ConnectionListener l)
Add a listener for Connection events on this Folder.
|
void |
addFolderListener(FolderListener l)
Add a listener for Folder events on this Folder.
|
void |
addMessageChangedListener(MessageChangedListener l)
Add a listener for MessageChanged events on this Folder.
|
void |
addMessageCountListener(MessageCountListener l)
Add a listener for MessageCount events on this Folder.
|
abstract void |
appendMessages(Message[] msgs)
Append given Messages to this folder.
|
void |
close()
Close this Folder and expunge deleted messages.
|
abstract void |
close(boolean expunge)
Close this Folder.
|
void |
copyMessages(Message[] msgs,
Folder folder)
Copy the specified Messages from this Folder into another
Folder.
|
abstract boolean |
create(int type)
Create this folder on the Store.
|
abstract boolean |
delete(boolean recurse)
Delete this Folder.
|
abstract boolean |
exists()
Tests if this folder physically exists on the Store.
|
abstract Message[] |
expunge()
Expunge (permanently remove) messages marked DELETED.
|
void |
fetch(Message[] msgs,
FetchProfile fp)
Prefetch the items specified in the FetchProfile for the
given Messages.
|
protected void |
finalize() |
int |
getDeletedMessageCount()
Get the number of deleted messages in this Folder.
|
abstract Folder |
getFolder(java.lang.String name)
Return the Folder object corresponding to the given name.
|
abstract java.lang.String |
getFullName()
Returns the full name of this Folder.
|
abstract Message |
getMessage(int msgnum)
Get the Message object corresponding to the given message
number.
|
abstract int |
getMessageCount()
Get total number of messages in this Folder.
|
Message[] |
getMessages()
Get all Message objects from this Folder.
|
Message[] |
getMessages(int[] msgnums)
Get the Message objects for message numbers specified in
the array.
|
Message[] |
getMessages(int start,
int end)
Get the Message objects for message numbers ranging from start
through end, both start and end inclusive.
|
int |
getMode()
Return the open mode of this folder.
|
abstract java.lang.String |
getName()
Returns the name of this Folder.
|
int |
getNewMessageCount()
Get the number of new messages in this Folder.
|
abstract Folder |
getParent()
Returns the parent folder of this folder.
|
abstract Flags |
getPermanentFlags()
Get the permanent flags supported by this Folder.
|
abstract char |
getSeparator()
Return the delimiter character that separates this Folder's pathname
from the names of immediate subfolders.
|
Store |
getStore()
Returns the Store that owns this Folder object.
|
abstract int |
getType()
Returns the type of this Folder, that is, whether this folder can hold
messages or subfolders or both.
|
int |
getUnreadMessageCount()
Get the total number of unread messages in this Folder.
|
URLName |
getURLName()
Return a URLName representing this folder.
|
abstract boolean |
hasNewMessages()
Returns true if this Folder has new messages since the last time
this indication was reset.
|
abstract boolean |
isOpen()
Indicates whether this Folder is in the 'open' state.
|
boolean |
isSubscribed()
Returns true if this Folder is subscribed.
|
Folder[] |
list()
Convenience method that returns the list of folders under this
Folder.
|
abstract Folder[] |
list(java.lang.String pattern)
Returns a list of Folders belonging to this Folder's namespace
that match the specified pattern.
|
Folder[] |
listSubscribed()
Convenience method that returns the list of subscribed folders
under this Folder.
|
Folder[] |
listSubscribed(java.lang.String pattern)
Returns a list of subscribed Folders belonging to this Folder's
namespace that match the specified pattern.
|
protected void |
notifyConnectionListeners(int type)
Notify all ConnectionListeners.
|
protected void |
notifyFolderListeners(int type)
Notify all FolderListeners registered on this Folder and
this folder's Store.
|
protected void |
notifyFolderRenamedListeners(Folder folder)
Notify all FolderListeners registered on this Folder and
this folder's Store about the renaming of this folder.
|
protected void |
notifyMessageAddedListeners(Message[] msgs)
Notify all MessageCountListeners about the addition of messages
into this folder.
|
protected void |
notifyMessageChangedListeners(int type,
Message msg)
Notify all MessageChangedListeners.
|
protected void |
notifyMessageRemovedListeners(boolean removed,
Message[] msgs)
Notify all MessageCountListeners about the removal of messages
from this Folder.
|
abstract void |
open(int mode)
Open this Folder.
|
void |
removeConnectionListener(ConnectionListener l)
Remove a Connection event listener.
|
void |
removeFolderListener(FolderListener l)
Remove a Folder event listener.
|
void |
removeMessageChangedListener(MessageChangedListener l)
Remove a MessageChanged listener.
|
void |
removeMessageCountListener(MessageCountListener l)
Remove a MessageCount listener.
|
abstract boolean |
renameTo(Folder f)
Rename this Folder.
|
Message[] |
search(SearchTerm term)
Search this Folder for messages matching the specified
search criterion.
|
Message[] |
search(SearchTerm term,
Message[] msgs)
Search the given array of messages for those that match the
specified search criterion.
|
void |
setFlags(int[] msgnums,
Flags flag,
boolean value)
Set the specified flags on the messages whose message numbers
are in the array.
|
void |
setFlags(int start,
int end,
Flags flag,
boolean value)
Set the specified flags on the messages numbered from start
through end, both start and end inclusive.
|
void |
setFlags(Message[] msgs,
Flags flag,
boolean value)
Set the specified flags on the messages specified in the array.
|
void |
setSubscribed(boolean subscribe)
Subscribe or unsubscribe this Folder.
|
java.lang.String |
toString()
override the default toString(), it will return the String
from Folder.getFullName() or if that is null, it will use
the default toString() behavior.
|
protected Store store
protected int mode
Folder.READ_ONLY
, Folder.READ_WRITE
,
or -1 if not known.public static final int HOLDS_MESSAGES
public static final int HOLDS_FOLDERS
public static final int READ_ONLY
public static final int READ_WRITE
protected Folder(Store store)
store
- the Store that holds this folderpublic abstract java.lang.String getName()
This method can be invoked on a closed Folder.
public abstract java.lang.String getFullName()
This method can be invoked on a closed Folder.
public URLName getURLName() throws MessagingException
MessagingException
- for failuresURLName
public Store getStore()
public abstract Folder getParent() throws MessagingException
Note that since Folder objects are not cached, invoking this method returns a new distinct Folder object.
MessagingException
- for failurespublic abstract boolean exists() throws MessagingException
MessagingException
- typically if the connection
to the server is lost.create(int)
public abstract Folder[] list(java.lang.String pattern) throws MessagingException
"%"
, which matches any character except hierarchy
delimiters, and "*"
, which matches any character. As an example, given the folder hierarchy:
Personal/ Finance/ Stocks Bonus StockOptions Jokes
list("*")
on "Personal" will return the whole
hierarchy. list("%")
on "Personal" will return "Finance" and
"Jokes". list("Jokes")
on "Personal" will return "Jokes".list("Stock*")
on "Finance" will return "Stocks"
and "StockOptions". Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
pattern
- the match patternFolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failureslistSubscribed(java.lang.String)
public Folder[] listSubscribed(java.lang.String pattern) throws MessagingException
list
.
(The default implementation provided here, does just this).
The pattern can contain wildcards as for list
.
Note that, at a given level of the folder hierarchy, a particular
folder may not be subscribed, but folders underneath that folder
in the folder hierarchy may be subscribed. In order to allow
walking the folder hierarchy, such unsubscribed folders may be
returned, indicating that a folder lower in the hierarchy is
subscribed. The isSubscribed
method on a folder will
tell whether any particular folder is actually subscribed.
Folder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
pattern
- the match patternFolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failureslist(java.lang.String)
public Folder[] list() throws MessagingException
list(String pattern)
method with "%"
as the match pattern. This method can
be invoked on a closed Folder.FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failureslist(java.lang.String)
public Folder[] listSubscribed() throws MessagingException
listSubscribed(String pattern)
method with "%"
as the match pattern. This method can be invoked on a closed Folder.FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failureslistSubscribed(java.lang.String)
public abstract char getSeparator() throws MessagingException
FolderNotFoundException
- if the implementation
requires the folder to exist, but it does notMessagingException
public abstract int getType() throws MessagingException
FolderNotFoundException
- if this folder does
not exist.MessagingException
HOLDS_FOLDERS
,
HOLDS_MESSAGES
public abstract boolean create(int type) throws MessagingException
If the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this Folder and this Store.
type
- The type of this folder.MessagingException
- for failuresHOLDS_FOLDERS
,
HOLDS_MESSAGES
,
FolderEvent
public boolean isSubscribed()
This method can be invoked on a closed Folder.
The default implementation provided here just returns true.
public void setSubscribed(boolean subscribe) throws MessagingException
This method can be invoked on a closed Folder.
The implementation provided here just throws the MethodNotSupportedException.
subscribe
- true to subscribe, false to unsubscribeFolderNotFoundException
- if this folder does
not exist.MethodNotSupportedException
- if this store
does not support subscriptionMessagingException
- for other failurespublic abstract boolean hasNewMessages() throws MessagingException
RECENT
flag set. Note that this is not an incremental check for new mail, i.e., it cannot be used to determine whether any new messages have arrived since the last time this method was invoked. To implement incremental checks, the Folder needs to be opened.
This method can be invoked on a closed Folder that can contain Messages.
FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failurespublic abstract Folder getFolder(java.lang.String name) throws MessagingException
exists()
method on a Folder indicates whether it really
exists on the Store. In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Otherwise, it is interpreted relative to this Folder.
Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.
This method can be invoked on a closed Folder.
name
- name of the FolderMessagingException
- for failurespublic abstract boolean delete(boolean recurse) throws MessagingException
The recurse
flag controls whether the deletion affects
subfolders or not. If true, all subfolders are deleted, then this
folder itself is deleted. If false, the behaviour is dependent on
the folder type and is elaborated below:
If the folder contains subfolders there are 3 possible choices an implementation is free to do:
recurse
- also delete subfolders?FolderNotFoundException
- if this folder does
not existjava.lang.IllegalStateException
- if this folder is not in
the closed state.MessagingException
- for other failuresFolderEvent
public abstract boolean renameTo(Folder f) throws MessagingException
If the rename is successful, a RENAMED FolderEvent is delivered to FolderListeners registered on this folder and its containing Store.
f
- a folder representing the new name for this FolderFolderNotFoundException
- if this folder does
not existjava.lang.IllegalStateException
- if this folder is not in
the closed state.MessagingException
- for other failuresFolderEvent
public abstract void open(int mode) throws MessagingException
If this folder is opened successfully, an OPENED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder.
The effect of opening multiple connections to the same folder on a specifc Store is implementation dependent. Some implementations allow multiple readers, but only one writer. Others allow multiple writers as well as readers.
mode
- open the Folder READ_ONLY or READ_WRITEFolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not in
the closed state.MessagingException
- for other failuresREAD_ONLY
,
READ_WRITE
,
getType()
,
ConnectionEvent
public abstract void close(boolean expunge) throws MessagingException
A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.
expunge
- expunges all deleted messages if this flag is truejava.lang.IllegalStateException
- if this folder is not openedMessagingException
- for other failuresConnectionEvent
public void close() throws MessagingException
A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this Folder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.
This method supports the AutoCloseable
interface.
This implementation calls close(true)
.
close
in interface java.lang.AutoCloseable
java.lang.IllegalStateException
- if this folder is not openedMessagingException
- for other failuresConnectionEvent
public abstract boolean isOpen()
public int getMode()
Folder.READ_ONLY
, Folder.READ_WRITE
,
or -1 if the open mode is not known (usually only because an older
Folder
provider has not been updated to use this new
method).java.lang.IllegalStateException
- if this folder is not openedpublic abstract Flags getPermanentFlags()
The special flag Flags.Flag.USER
indicates that this Folder
supports arbitrary user-defined flags.
The supported permanent flags for a folder may not be available until the folder is opened.
public abstract int getMessageCount() throws MessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the total message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failurespublic int getNewMessageCount() throws MessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the new message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
This implementation returns -1 if this folder is closed. Else
this implementation gets each Message in the folder using
getMessage(int)
and checks whether its
RECENT
flag is set. The total number of messages
that have this flag set is returned.
FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failurespublic int getUnreadMessageCount() throws MessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the unread message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
This implementation returns -1 if this folder is closed. Else
this implementation gets each Message in the folder using
getMessage(int)
and checks whether its
SEEN
flag is set. The total number of messages
that do not have this flag set is returned.
FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failurespublic int getDeletedMessageCount() throws MessagingException
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the deleted message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
This implementation returns -1 if this folder is closed. Else
this implementation gets each Message in the folder using
getMessage(int)
and checks whether its
DELETED
flag is set. The total number of messages
that have this flag set is returned.
FolderNotFoundException
- if this folder does
not exist.MessagingException
- for other failurespublic abstract Message getMessage(int msgnum) throws MessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
Unlike Folder objects, repeated calls to getMessage with the same message number will return the same Message object, as long as no messages in this folder have been expunged.
Since message numbers can change within a session if the folder is expunged , clients are advised not to use message numbers as references to messages. Use Message objects instead.
msgnum
- the message numberFolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not openedjava.lang.IndexOutOfBoundsException
- if the message number
is out of range.MessagingException
- for other failuresgetMessageCount()
,
fetch(javax.mail.Message[], javax.mail.FetchProfile)
public Message[] getMessages(int start, int end) throws MessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
This implementation uses getMessage(index) to obtain the required
Message objects. Note that the returned array must contain
(end-start+1)
Message objects.
start
- the number of the first messageend
- the number of the last messageFolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not opened.java.lang.IndexOutOfBoundsException
- if the start or end
message numbers are out of range.MessagingException
- for other failuresfetch(javax.mail.Message[], javax.mail.FetchProfile)
public Message[] getMessages(int[] msgnums) throws MessagingException
Message objects are light-weight references to the actual message that get filled up on demand. Hence Folder implementations are expected to provide light-weight Message objects.
This implementation uses getMessage(index) to obtain the required
Message objects. Note that the returned array must contain
msgnums.length
Message objects
msgnums
- the array of message numbersFolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not opened.java.lang.IndexOutOfBoundsException
- if any message number
in the given array is out of range.MessagingException
- for other failuresfetch(javax.mail.Message[], javax.mail.FetchProfile)
public Message[] getMessages() throws MessagingException
This implementation invokes getMessageCount()
to get
the current message count and then uses getMessage()
to get Message objects from 1 till the message count.
FolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- for other failuresfetch(javax.mail.Message[], javax.mail.FetchProfile)
public abstract void appendMessages(Message[] msgs) throws MessagingException
Folder implementations must not abort this operation if a Message in the given message array turns out to be an expunged Message.
msgs
- array of Messages to be appendedFolderNotFoundException
- if this folder does
not exist.MessagingException
- if the append failed.public void fetch(Message[] msgs, FetchProfile fp) throws MessagingException
Clients use this method to indicate that the specified items are needed en-masse for the given message range. Implementations are expected to retrieve these items for the given message range in a efficient manner. Note that this method is just a hint to the implementation to prefetch the desired items.
An example is a client filling its header-view window with the Subject, From and X-mailer headers for all messages in the folder.
Message[] msgs = folder.getMessages(); FetchProfile fp = new FetchProfile(); fp.add(FetchProfile.Item.ENVELOPE); fp.add("X-mailer"); folder.fetch(msgs, fp); for (int i = 0; i < folder.getMessageCount(); i++) { display(msg[i].getFrom()); display(msg[i].getSubject()); display(msg[i].getHeader("X-mailer")); }
The implementation provided here just returns without doing anything useful. Providers wanting to provide a real implementation for this method should override this method.
msgs
- fetch items for these messagesfp
- the FetchProfilejava.lang.IllegalStateException
- if this folder is not openedMessagingException
- for other failurespublic void setFlags(Message[] msgs, Flags flag, boolean value) throws MessagingException
Note that the specified Message objects must
belong to this folder. Certain Folder implementations can
optimize the operation of setting Flags for a group of messages,
so clients might want to use this method, rather than invoking
Message.setFlags
for each Message.
This implementation degenerates to invoking setFlags()
on each Message object. Specific Folder implementations that can
optimize this case should do so.
Also, an implementation must not abort the operation if a Message
in the array turns out to be an expunged Message.
msgs
- the array of message objectsflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not opened
or if it has been opened READ_ONLY.MessagingException
- for other failuresMessage.setFlags(javax.mail.Flags, boolean)
,
MessageChangedEvent
public void setFlags(int start, int end, Flags flag, boolean value) throws MessagingException
Certain Folder implementations can
optimize the operation of setting Flags for a group of messages,
so clients might want to use this method, rather than invoking
Message.setFlags
for each Message.
The default implementation uses getMessage(int)
to
get each Message
object and then invokes
setFlags
on that object to set the flags.
Specific Folder implementations that can optimize this case should do so.
Also, an implementation must not abort the operation if a message
number refers to an expunged message.
start
- the number of the first messageend
- the number of the last messageflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not opened
or if it has been opened READ_ONLY.java.lang.IndexOutOfBoundsException
- if the start or end
message numbers are out of range.MessagingException
- for other failuresMessage.setFlags(javax.mail.Flags, boolean)
,
MessageChangedEvent
public void setFlags(int[] msgnums, Flags flag, boolean value) throws MessagingException
Certain Folder implementations can
optimize the operation of setting Flags for a group of messages,
so clients might want to use this method, rather than invoking
Message.setFlags
for each Message.
The default implementation uses getMessage(int)
to
get each Message
object and then invokes
setFlags
on that object to set the flags.
Specific Folder implementations that can optimize this case should do so.
Also, an implementation must not abort the operation if a message
number refers to an expunged message.
msgnums
- the array of message numbersflag
- Flags object containing the flags to be setvalue
- set the flags to this boolean valuejava.lang.IllegalStateException
- if this folder is not opened
or if it has been opened READ_ONLY.java.lang.IndexOutOfBoundsException
- if any message number
in the given array is out of range.MessagingException
- for other failuresMessage.setFlags(javax.mail.Flags, boolean)
,
MessageChangedEvent
public void copyMessages(Message[] msgs, Folder folder) throws MessagingException
Note that the specified Message objects must belong to this folder. Folder implementations might be able to optimize this method by doing server-side copies.
This implementation just invokes appendMessages()
on the destination folder to append the given Messages. Specific
folder implementations that support server-side copies should
do so, if the destination folder's Store is the same as this
folder's Store.
Also, an implementation must not abort the operation if a
Message in the array turns out to be an expunged Message.
msgs
- the array of message objectsfolder
- the folder to copy the messages toFolderNotFoundException
- if the destination
folder does not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- for other failuresappendMessages(javax.mail.Message[])
public abstract Message[] expunge() throws MessagingException
getMessageNumber
method
on each of these message objects returns that Message's original
(that is, prior to the expunge) sequence number. A MessageCountEvent
containing the expunged messages is delivered to any
MessageCountListeners registered on the folder. Expunge causes the renumbering of Message objects subsequent to the expunged messages. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with the situation (probably by flushing out existing message number caches and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Any expunged Messages objects still have to be pruned, but other Messages in that folder are not affected by the expunge.
After a message is expunged, only the isExpunged
and
getMessageNumber
methods are still valid on the
corresponding Message object; other methods may throw
MessageRemovedException
FolderNotFoundException
- if this folder does not
existjava.lang.IllegalStateException
- if this folder is not opened.MessagingException
- for other failuresMessage.isExpunged()
,
MessageCountEvent
public Message[] search(SearchTerm term) throws MessagingException
This implementation invokes
search(term, getMessages())
, to apply the search
over all the messages in this folder. Providers that can implement
server-side searching might want to override this method to provide
a more efficient implementation.
term
- the search criterionSearchException
- if the search
term is too complex for the implementation to handle.FolderNotFoundException
- if this folder does
not exist.java.lang.IllegalStateException
- if this folder is not opened.MessagingException
- for other failuresSearchTerm
public Message[] search(SearchTerm term, Message[] msgs) throws MessagingException
Note that the specified Message objects must belong to this folder.
This implementation iterates through the given array of messages,
and applies the search criterion on each message by calling
its match()
method with the given term. The
messages that succeed in the match are returned. Providers
that can implement server-side searching might want to override
this method to provide a more efficient implementation. If the
search term is too complex or contains user-defined terms that
cannot be executed on the server, providers may elect to either
throw a SearchException or degenerate to client-side searching by
calling super.search()
to invoke this implementation.
term
- the search criterionmsgs
- the messages to be searchedSearchException
- if the search
term is too complex for the implementation to handle.java.lang.IllegalStateException
- if this folder is not openedMessagingException
- for other failuresSearchTerm
public void addConnectionListener(ConnectionListener l)
The implementation provided here adds this listener to an internal list of ConnectionListeners.
l
- the Listener for Connection eventsConnectionEvent
public void removeConnectionListener(ConnectionListener l)
The implementation provided here removes this listener from the internal list of ConnectionListeners.
l
- the listeneraddConnectionListener(javax.mail.event.ConnectionListener)
protected void notifyConnectionListeners(int type)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered ConnectionListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
type
- the ConnectionEvent typeConnectionEvent
public void addFolderListener(FolderListener l)
The implementation provided here adds this listener to an internal list of FolderListeners.
l
- the Listener for Folder eventsFolderEvent
public void removeFolderListener(FolderListener l)
The implementation provided here removes this listener from the internal list of FolderListeners.
l
- the listeneraddFolderListener(javax.mail.event.FolderListener)
protected void notifyFolderListeners(int type)
The implementation provided here queues the event into
an internal event queue. An event dispatcher thread dequeues
events from the queue and dispatches them to the
FolderListeners registered on this folder. The implementation
also invokes notifyFolderListeners
on this folder's
Store to notify any FolderListeners registered on the store.
type
- type of FolderEventnotifyFolderRenamedListeners(javax.mail.Folder)
protected void notifyFolderRenamedListeners(Folder folder)
The implementation provided here queues the event into
an internal event queue. An event dispatcher thread dequeues
events from the queue and dispatches them to the
FolderListeners registered on this folder. The implementation
also invokes notifyFolderRenamedListeners
on this
folder's Store to notify any FolderListeners registered on the store.
folder
- Folder representing the new name.notifyFolderListeners(int)
public void addMessageCountListener(MessageCountListener l)
The implementation provided here adds this listener to an internal list of MessageCountListeners.
l
- the Listener for MessageCount eventsMessageCountEvent
public void removeMessageCountListener(MessageCountListener l)
The implementation provided here removes this listener from the internal list of MessageCountListeners.
l
- the listeneraddMessageCountListener(javax.mail.event.MessageCountListener)
protected void notifyMessageAddedListeners(Message[] msgs)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
msgs
- the messages that were addedprotected void notifyMessageRemovedListeners(boolean removed, Message[] msgs)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered MessageCountListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
removed
- was the message removed by this client?msgs
- the messages that were removedpublic void addMessageChangedListener(MessageChangedListener l)
The implementation provided here adds this listener to an internal list of MessageChangedListeners.
l
- the Listener for MessageChanged eventsMessageChangedEvent
public void removeMessageChangedListener(MessageChangedListener l)
The implementation provided here removes this listener from the internal list of MessageChangedListeners.
l
- the listeneraddMessageChangedListener(javax.mail.event.MessageChangedListener)
protected void notifyMessageChangedListeners(int type, Message msg)
The provided implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to registered MessageChangedListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
type
- the MessageChangedEvent typemsg
- the message that changedprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object


ScratchVerifier Registration
This page contains walkthroughs for registering/handling your registration with this API.
Registering Through the Website
This is how to register with this API through the website.
- Visit the website.
- Click "Login/Register" at the top right
- You will be presented with a verification code. (That's right, we use our own API to register people with it!)
- Post this code on your own profile comments
- Click "Continue"
- You will then be logged in
- You will be presented with a button saying "Create client". Click it
- You will be shown your client ID and a button to copy your token.
- Put your client ID and token into your app's configuration. Done!
At any point, if you wish to view your info again, simply login (if necessary) and you will be presented with it.
Registering Through the API
The API itself provides endpoints to register yourself. Here's how to use them:
- Send an HTTP POST request to
/users/{yourusername}/login
- The API will send you a Verification object containing a code
- Post this code on your own profile comments
- Send an HTTP POST request to
/users/{yourusername}/finish-login
- You will receive a cookie with your session ID. Set it; it lasts a year
- Assuming you haven't already created a client, send an HTTP PUT request to
/session
- You will receive a User object containing your client ID and token
- Put your client ID and token into your app's configuration. Done!
At any point, if it becomes necessary to fetch your info again, simply send an HTTP GET request to /session
and you will receive it. If you receive a 401 Unauthorized response, you need to get another session ID by following steps 1-5.
Resetting your Token
If you think your token has been compromised, you can reset your token using the website:
- Visit the website. If presented with your current info, skip to step 8
- Click "Login/Register" at the top right
- You will be presented with a verification code
- Post this code on your own profile comments
- Click "Continue"
- You will then be logged in
- You will be presented with your client info
- Click the button labelled "Reset token"
- Copy your new token and update your app's configuration. Done!
Or using the API:
- GET
/session
to fetch your info
- If you receive your info, skip to step 8. Otherwise, continue with step 3
- Send an HTTP POST request to
/users/{yourusername}/login
- The API will send you a Verification object containing a code
- Post this code on your own profile comments
- Send an HTTP POST request to
/users/{yourusername}/finish-login
- You will receive a cookie with your session ID. Set it; it lasts a year
- Send an HTTP PATCH request to
/session
- You will receive a new User object containing your client ID and updated token
- Update your token in your app's configuration. Done!
Deleting your Account
We're sorry to see you go! You can deregister from the API through the website:
- Visit the website. If presented with your current info, skip to step 8
- Click "Login/Register" at the top right
- You will be presented with a verification code
- Post this code on your own profile comments
- Click "Continue"
- You will then be logged in
- You will be presented with your client info
- Click the button labelled "Delete Account"
- Click the confirmation. :(
Or using the API:
- GET
/session
to fetch your info
- If you receive your info, skip to step 8. Otherwise, continue with step 3
- Send an HTTP POST request to
/users/{yourusername}/login
- The API will send you a Verification object containing a code
- Post this code on your own profile comments
- Send an HTTP POST request to
/users/{yourusername}/finish-login
- You will receive a cookie with your session ID. Set it; it lasts a year
- Send an HTTP DELETE request to
/session
- You will receive a 204 No Content response. :(
Note: This only deregisters your client from the API. You are still free to re-register later. Resetting your token is almost like deregistering and re-registering again.


Floated Courses
more_vert
These are the courses managed by you this session
remove
fullscreen
Sort by code
Sort by title
Sort by semester
:
more_vert
event


Constructor
new Callout(options)
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | Valid options are "allowedLocations", "autohide", "container", "content", "preferredLocations", "size", "theme". @see "Members" section for details |
- Version:
- 1.0
- License:
- The MIT License (MIT) Copyright (c) 2015 rintoj Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Source:
Example
var callout = new Callout({
content: "I'm callout",
container: ".container",
theme: "light",
size: {
width: 150,
height: 20
}
});
$(".targetNode").on("click", function () {
callout.show(this, ["top"]); // show on top if possible
});
$("body").on("contextmenu", function(event) {
callout.show(event);
event.preventDefault();
});
Members
allowedLocations :Array
Locations that are allowed for the callout. Valid values are "top", "top-left", "top-right", "right"
"right-top", "right-bottom", "bottom", "bottom-right", "bottom-left", "left", "left-top", "left-bottom"
Type:
- Array
- Source:
autohide :Booean
If set to true callout will be made hidden when focus is lost; default value is true.
Type:
- Booean
- Source:
container :String|Node
If specified, callout will try to position itself within the specified dom node; default value is body
Type:
- String | Node
- Source:
content :String
Specify content for the callout within this member.
Type:
- String
- Source:
preferredLocations :Array
The preferred locations of callout. This must be a subset of allowed location. Any other value will be
ignored.
Type:
- Array
- Source:
size :Object
Expect an object with 'width' and 'height'. Eg: {width: 25, height: 25}
Type:
- Object
- Source:
theme :String
Theme. Valid values are 'dark', 'light', 'default'. Default value is 'default'
Type:
- String
- Source:
Methods
getAllowedLocations() → {Array}
Get allowed locations.
- Source:
Returns:
Array of locations that are allowed
- Type
- Array
getArrow() → {String}
Get current direction of arrow
- Source:
Returns:
Returns direction of arrow
- Type
- String
getAutoHide() → {Boolean}
Check if auto hide is on or off
- Source:
Returns:
Returns 'true' if auto hide is on
- Type
- Boolean
getContainer() → {Node|String}
Get container
- Source:
Returns:
Returns 'container'
- Type
- Node | String
getContentNode() → {Object}
Get content node. Attach your content into this node.
- Source:
Returns:
Content node
- Type
- Object
Example
callout.getContentNode().html("This is a tooltip"); // setting text
callout.getContentNode().append(bannerNode); // setting inner node
getDomNode() → {Object}
Return the root node of callout. To avoid unexpected behaviour do NOT manipulate this node
- Source:
Returns:
The node object
- Type
- Object
getPreferredLocations() → {Array}
Get preferred locations.
- Source:
Returns:
Array of locations that are preferred
- Type
- Array
getSize() → {Object}
Get size of the callout.
- Source:
Returns:
An object in the format {width: Number, height: Number}.
- Type
- Object
getTheme() → {String}
Get theme.
- Source:
Returns:
Theme.
- Type
- String
hide() → {Callout}
Hide callout.
- Source:
Returns:
Returns 'this' to enable method chaining.
- Type
- Callout
remove() → {Callout}
Remove callout from DOM
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setAllowedLocations(allowedLocations) → {Callout}
Set the allowed locations for the callout. This is the final list of locations allowed for
callout. Any value outside this list, if used in preferred locations, will be ignored.
Parameters:
| Name | Type | Description |
|---|---|---|
allowedLocations |
Array | Array of allowed locations |
- Source:
- See:
-
- 'allowedLocation' for valid values
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setArrow(direction) → {Callout}
Set direction of arrow
Parameters:
| Name | Type | Description |
|---|---|---|
direction |
String | All possible values for 'allowedLocations' are valid here |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setAutoHide(autohideOn) → {Callout}
Turn on/off auto hide. Auto hide feature will hide the callout
when focus is removed
Parameters:
| Name | Type | Description |
|---|---|---|
autohideOn |
Boolean | True to turn on auto hide. |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setContainer(container) → {Callout}
Container node for the callout. The view port of the callout will be
always calculated to be with in container's view port.
Parameters:
| Name | Type | Description |
|---|---|---|
container |
Object | The container node |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setContent(content) → {Callout}
Set content of the callout.
Parameters:
| Name | Type | Description |
|---|---|---|
content |
String | The content as string |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setPreferredLocations(preferredLocations) → {Callout}
Set preferred locations for the callout. Eg. ["right"] will place
callout on the right side of the attached node with left arrow.
However this location will be ignored if the calculated view port
is outside containerNode's view port.
Parameters:
| Name | Type | Description |
|---|---|---|
preferredLocations |
Array | Array of preferred locations |
- Source:
- See:
-
- 'allowedLocation' for valid values
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setSize(width, height) → {Callout}
Set size of the callout
Parameters:
| Name | Type | Description |
|---|---|---|
width |
Number | Width in pixels |
height |
Number | height in pixels |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
setTheme(theme) → {Callout}
Set theme. Valid values are 'dark', 'light', 'normal'
Parameters:
| Name | Type | Description |
|---|---|---|
theme |
String | Valid values are 'dark', 'light', 'normal' |
- Source:
Returns:
Returns 'this' to enable method chaining
- Type
- Callout
show(target, preferredLocations) → {Callout}
Show callout and position it around a view port or a node. All the valid positions from the preferred
locations and the reset of the positions from the allowed positions will be iterated until a position is
found that places callout's viewport within the container's view port without overflowing. If no suitable
position the callout is place within the target node.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Node | jQuery.Event | (Mandatory) Dom node or an instance of jQuery.Event |
preferredLocations |
Array | (optional) Array of prefered locations; |
- Source:
- See:
-
- 'allowedLocation' for valid values
Returns:
Returns 'this' to enable method chaining
- Type
- Callout


See: Description
| Interface | Description |
|---|---|
| ClientModeCapable |
Edpoints implementing this interface are capable
of running in client-mode.
|
| ConnectionFactory |
A factory used to create TcpConnection objects.
|
| TcpConnection |
An abstraction over
Socket and SocketChannel
that sends Message objects by serializing the payload and streaming it to the
destination. |
| TcpConnectionInterceptor | |
| TcpConnectionInterceptorFactory |
Interface for TCP connection interceptor factories.
|
| TcpListener |
Classes that implement this interface may register with a
connection factory to receive messages retrieved from a
TcpConnection |
| TcpNetConnectionSupport |
Used by NET connection factories to instantiate a
TcpNetConnection object. |
| TcpNioConnectionSupport |
Used by NIO connection factories to instantiate a
TcpNioConnection object. |
| TcpSender |
An interface representing a sending client of a connection
factory.
|
| TcpServerConnectionFactory |
Connection factories that act as TCP servers, listening for incoming connections.
|
| TcpSocketFactorySupport |
Strategy interface for supplying Socket Factories.
|
| TcpSocketSupport |
Strategy interface for modifying sockets.
|
| TcpSSLContextSupport |
Strategy interface for the creation of an
SSLContext object
for use with SSL/TLS sockets. |
| Class | Description |
|---|---|
| AbstractClientConnectionFactory |
Abstract class for client connection factories; client connection factories
establish outgoing connections.
|
| AbstractConnectionFactory |
Base class for all connection factories.
|
| AbstractServerConnectionFactory |
Base class for all server connection factories.
|
| AbstractTcpConnectionSupport |
Base class for TCP Connection Support implementations.
|
| CachingClientConnectionFactory |
Connection factory that caches connections from the underlying target factory.
|
| ClientModeConnectionManager |
Intended to be run on a schedule, simply gets the connection
from a client connection factory each time it is run.
|
| DefaultTcpNetConnectionSupport |
Default implementation of
TcpNetConnectionSupport . |
| DefaultTcpNetSocketFactorySupport |
Implementation of TcpSocketFactorySupport
for non-SSL sockets
ServerSocket and
Socket . |
| DefaultTcpNetSSLSocketFactorySupport | |
| DefaultTcpNioConnectionSupport |
Implementation of
TcpNioConnectionSupport for non-SSL
NIO connections. |
| DefaultTcpNioSSLConnectionSupport |
Implementation of
TcpNioConnectionSupport for SSL
NIO connections. |
| DefaultTcpSocketSupport |
Default implementation of
TcpSocketSupport ; makes no
changes to sockets. |
| DefaultTcpSSLContextSupport |
Default implementation of
TcpSSLContextSupport ; uses a
'TLS' (by default) SSLContext , initialized with 'JKS'
keystores, managed by 'SunX509' Key and Trust managers. |
| FailoverClientConnectionFactory |
Given a list of connection factories, serves up
TcpConnection s
that can iterate over a connection from each factory until the write
succeeds or the list is exhausted. |
| MessageConvertingTcpMessageMapper | |
| SocketInfo |
Simple wrapper around
Socket providing access to getters (except
input/output streams). |
| TcpConnectionCloseEvent | |
| TcpConnectionEvent |
ApplicationEvent representing normal operations on a
TcpConnection . |
| TcpConnectionExceptionEvent |
ApplicationEvent representing exceptions on a
TcpConnection . |
| TcpConnectionFailedCorrelationEvent |
An event emitted when an endpoint cannot correlate a connection id to a
connection; the cause is a messaging exception with the failed message.
|
| TcpConnectionFailedEvent |
An event emitted when a connection could not be established for some
reason.
|
| TcpConnectionInterceptorFactoryChain | |
| TcpConnectionInterceptorSupport |
Base class for TcpConnectionIntercepters; passes all method calls through
to the underlying
TcpConnection . |
| TcpConnectionOpenEvent | |
| TcpConnectionServerExceptionEvent |
IpIntegrationEvent representing exceptions on a TCP server socket/channel. |
| TcpConnectionServerListeningEvent |
IpIntegrationEvent emitted when a server begins listening. |
| TcpConnectionSupport |
Base class for TcpConnections.
|
| TcpMessageMapper |
Maps incoming data from a
TcpConnection to a Message . |
| TcpNetClientConnectionFactory |
A client connection factory that creates
TcpNetConnection s. |
| TcpNetConnection |
A TcpConnection that uses and underlying
Socket . |
| TcpNetServerConnectionFactory |
Implements a server connection factory that produces
TcpNetConnection s using
a ServerSocket . |
| TcpNioClientConnectionFactory |
A client connection factory that creates
TcpNioConnection s. |
| TcpNioConnection |
A TcpConnection that uses and underlying
SocketChannel . |
| TcpNioServerConnectionFactory |
/**
Implements a server connection factory that produces
TcpNioConnection s using
a ServerSocketChannel . |
| TcpNioSSLConnection |
Implementation of
TcpConnection supporting SSL/TLS over NIO. |
| ThreadAffinityClientConnectionFactory |
A client connection factory that binds a connection to a thread.
|
| Exception | Description |
|---|---|
| NoListenerException |


| Home | Libraries | People | FAQ | More |
This section presents examples of calculating the famous Mandelbrot set at low and high resolution.
This shows a Mandelbrot set generated at quite low-resolution of 160x128 pixels using a 32-bit fixed-point type.
Additional images having millions of pixels showing different areas of the Mandelbrot set are at: aqua full, yellow top, swirl, black and white seahorses.
These images have been be generated at high resolution using boost::fixed_point::negatable<16, -111>
(fits
in a 128-bit integer type). Even higher resolution is only limited by ones
computer memory and patience for the long calculation time.
Full code is at fixed_point_mandelbrot.cpp. The program uses Boost.Gil for graphical representation of jpeg files and needs to be linked with the jpeg-6b library. The code uses neither multithreading nor a GPU. Calculating the Mandelbrot iterations in the separate rows of the image, however, could be parallelized in a straightforward fashion, at the cost of using more memory.


Exclusive: CIA Believes China Tried to Stop WHO Declaring Public Emergency
China threatened the WHO that the country would stop cooperating with the agency's coronavirus investigation if it declared a global health emergency, a CIA report confirmed to Newsweek showed.


Help
☰
←
Take Photo
Save
View Photos
☰
←
Placeholder
Clear storage
All local storage
Version:
Edit Notes
☰
←
Notes:
Save notes
Go Back
Take Photos
View Contacts


JavaScript is DISABLED!
Enable JavaScript to use this webpage!
File hashing is done entirely within your browser. Nothing is uploaded.
MD5
SHA1
SHA256
SHA512
file
hash
result


These are a series of layout samples using Hoisin.scss grid system and its helpers. You can resize the browser window to see how they react in different screen sizes.
.col12
.col3
.col3
.col3
.col3
.col2
.col2
.col2
.col2
.col2
.col2
Add a new .container
to create nested grids.
.col8
.col4 .full-medium
Use extra classes to override default behaviour for the spans
.col4
.col4
.col4
.full-medium
.col8
.two-thirds-medium
.col4
.one-third-medium
.col8
.half-medium
.col4
.half-medium
.col2
.one-third-medium
.full-small
.col2
.one-third-medium
.full-small
.col2
.one-third-medium
.full-small
.col6
.full-medium
.col4
.pre2
.col5
.center
The colum with class .colr
is placed after .col8
on large and medium screens even though it's before in the code flow, as shown on mobile
.col4
.colr
.col8


R/simulate_general_outbreaks.R
simulate_bp.Rd
Simulate the branching process of flipping until failure for K clusters
simulate_bp( K, inf_params, sample_covariates_df, covariate_names, covariate_weights = NULL, max_size = 50 )
| K | number of total clusters to simulate |
|---|---|
| inf_params | vector with beta coefficients to use in logistic function for probability of transmission |
| sample_covariates_df | Data frame of covariates to sample from |
| covariate_names | names of the covariates. Must match size of inf_params - 1. |
| covariate_weights | default is NULL which draws uniformly at random with replacement from the sample_covariates_df. Otherwise, the weights are used. |
| max_size | maximum size a cluster can be |
data frame with the following columns
unique cluster ID
order of infection in the cluster
generation number (>=0)
ID of the infector
number of people infected by person
whether the cluster end was censored or not
size of the cluster
covariates of the individuals
Generate a branching process according to the following process.
First a root infector is drawn covariates \(X\)
from some distribution $F$ (given by the set of covariates in sample_covariates_df
) and has probability of
transmission according to a logit function.
The number of infections produced by the root node $N_(1,1)
is a geometric random variable with probability $p_(1,1)$
where the indexing represents $(g=$, generation, $i=$ index).
If $N_(1,1) > 0$, then the $N_(1,1)$ infections are added to
the cluster and assigned to generation $g=2$ with indices $i=1,
..., N_(1,1)$ and covariats are drawn for these new infections.
The infection process continues with individuals $(2, 1)$ through $(2, $N_(1,1))$
where new infections are added, in order to the subsequent generation.
The process terminates when either there are no new infections or the
maximum number of infections specified in max_size
is reached.
$$X_{(g,i)} \sim F$$
$$p_{(g,i)} = logit^{-1}\left ( X_{(g,i)} \beta\right )$$
$$N_{(g,i)} \sim Geometric(p_{(g,i)})$$
set.seed(2020) inf_params <- c("beta_0" = -2, "beta_1" = 2) df <- data.frame(x= c(0, 1)) branching_processes <- simulate_bp(K = 10, inf_params = inf_params, covariate_names = "x", sample_covariates_df = df) head(branching_processes)#> cluster_id person_id gen inf_id n_inf cluster_size x censored #> 1 1 C1-G1-N1 1 <NA> 1 2 1 FALSE #> 2 1 C1-G2-N1 2 C1-G1-N1 NA 2 1 FALSE #> 3 2 C2-G1-N1 1 <NA> NA 1 0 FALSE #> 4 3 C3-G1-N1 1 <NA> 1 3 1 FALSE #> 5 3 C3-G2-N1 2 C3-G1-N1 1 3 1 FALSE #> 6 3 C3-G3-N1 3 C3-G2-N1 NA 3 1 FALSE#> #> 1 2 3 4 11 #> 6 1 1 1 1


Scripts used to identify “bad” replicates in the experiemnt.
Creates a combined figure to find bad replicates. Adds bad replicate numbers, as defined in C<defs.dat> file. Requires pileup statistics created with C<pileup_var.pl>:
bad_replicates.pl
| param: | -limit - Significance limit for outlier selection. This is a limit of number of standard deviations from the trimmed mean. (default: 5) |
|---|---|
| param: | -ntrim - Number of data points to remove on each side for the trimmed mean. (default: 3). |
| param: | -off - Offset for plotting bad replicate numbers above/below data points. |
| param: | -psfile - Name of the postscript file to redirect output to. |
Show various comparisons between replicates in a given condition:
compare_replicates.pl -graph=all
There are several other options in this script, used for exploratory analysis . :param: -graph [all|2] - Type of plot to create.
- all - heat plots with all replicates
- 2 - two replicates (or selection of pairs)
| param: | -rep1 - First replicate to compare. |
|---|---|
| param: | -rep2 - Second replicate to compare. |
| param: | -cond - Condition name. |
| param: | -cond [WT|Snf2] - Condition name. |
| param: | -psfile - Output postscript file. |


A resume is an important way for your job search because it provides a display your top skills and qualities. Resumes are meant to help employers make hiring decisions and help you get your first interview.


The people celebrate! Darkness has been dispelled from the land, and the riches and glory that have come to be associated with this kingdom has attracted warriors and nobles from every corner of the world! The king declares that a tournament of skill and bravery be held! You have received an invitation. Will you accept?