net.fortuna.mstor.tag
Class Tags

java.lang.Object
  extended by net.fortuna.mstor.tag.Tags
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.Set<java.lang.String>

public class Tags
extends java.lang.Object
implements java.util.Set<java.lang.String>, java.io.Serializable

Author:
Ben Fortuna
 $Id$

 Created on 6/05/2006
 
See Also:
Serialized Form

Field Summary
protected static java.lang.String TAG_PREFIX
           
 
Constructor Summary
Tags()
          Default constructor.
Tags(javax.mail.Flags flags)
           
 
Method Summary
 boolean add(java.lang.String tag)
           
 boolean addAll(java.util.Collection<? extends java.lang.String> arg0)
           
static void addTag(java.lang.String tag, javax.mail.Message message)
          Adds the specified tag to a message.
 void clear()
           
 boolean contains(java.lang.Object tag)
           
 boolean containsAll(java.util.Collection<?> arg0)
           
static Tags getTags(javax.mail.Message message)
          Returns the tags associated with the specified message.
 boolean isEmpty()
           
 java.util.Iterator<java.lang.String> iterator()
           
 boolean remove(java.lang.Object tag)
           
 boolean removeAll(java.util.Collection<?> arg0)
           
static void removeTag(java.lang.String tag, javax.mail.Message message)
          Remove the specified tag from a message.
 boolean retainAll(java.util.Collection<?> arg0)
           
 int size()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Field Detail

TAG_PREFIX

protected static final java.lang.String TAG_PREFIX
See Also:
Constant Field Values
Constructor Detail

Tags

public Tags()
Default constructor.


Tags

public Tags(javax.mail.Flags flags)
Parameters:
flags -
Method Detail

size

public final int size()
Specified by:
size in interface java.util.Collection<java.lang.String>
Specified by:
size in interface java.util.Set<java.lang.String>

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<java.lang.String>
Specified by:
isEmpty in interface java.util.Set<java.lang.String>

contains

public final boolean contains(java.lang.Object tag)
Specified by:
contains in interface java.util.Collection<java.lang.String>
Specified by:
contains in interface java.util.Set<java.lang.String>

iterator

public final java.util.Iterator<java.lang.String> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.lang.String>
Specified by:
iterator in interface java.util.Collection<java.lang.String>
Specified by:
iterator in interface java.util.Set<java.lang.String>

toArray

public final java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<java.lang.String>
Specified by:
toArray in interface java.util.Set<java.lang.String>

toArray

public final <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<java.lang.String>
Specified by:
toArray in interface java.util.Set<java.lang.String>

add

public final boolean add(java.lang.String tag)
Specified by:
add in interface java.util.Collection<java.lang.String>
Specified by:
add in interface java.util.Set<java.lang.String>

remove

public final boolean remove(java.lang.Object tag)
Specified by:
remove in interface java.util.Collection<java.lang.String>
Specified by:
remove in interface java.util.Set<java.lang.String>

containsAll

public final boolean containsAll(java.util.Collection<?> arg0)
Specified by:
containsAll in interface java.util.Collection<java.lang.String>
Specified by:
containsAll in interface java.util.Set<java.lang.String>

addAll

public final boolean addAll(java.util.Collection<? extends java.lang.String> arg0)
Specified by:
addAll in interface java.util.Collection<java.lang.String>
Specified by:
addAll in interface java.util.Set<java.lang.String>

retainAll

public final boolean retainAll(java.util.Collection<?> arg0)
Specified by:
retainAll in interface java.util.Collection<java.lang.String>
Specified by:
retainAll in interface java.util.Set<java.lang.String>

removeAll

public final boolean removeAll(java.util.Collection<?> arg0)
Specified by:
removeAll in interface java.util.Collection<java.lang.String>
Specified by:
removeAll in interface java.util.Set<java.lang.String>

clear

public final void clear()
Specified by:
clear in interface java.util.Collection<java.lang.String>
Specified by:
clear in interface java.util.Set<java.lang.String>

addTag

public static void addTag(java.lang.String tag,
                          javax.mail.Message message)
                   throws javax.mail.MessagingException
Adds the specified tag to a message.

Parameters:
tag -
message -
Throws:
javax.mail.MessagingException - when unable to tag the given message
java.lang.UnsupportedOperationException - if the given message does not support tags

removeTag

public static void removeTag(java.lang.String tag,
                             javax.mail.Message message)
                      throws javax.mail.MessagingException
Remove the specified tag from a message.

Parameters:
tag -
message -
Throws:
javax.mail.MessagingException - when unable to remove the tag from the given message
java.lang.UnsupportedOperationException - if the given message does not support tags

getTags

public static Tags getTags(javax.mail.Message message)
                    throws javax.mail.MessagingException
Returns the tags associated with the specified message.

Parameters:
message -
Returns:
Throws:
javax.mail.MessagingException - when unable to retrieve the tags for the given message
java.lang.UnsupportedOperationException - if the given message does not support tags


Copyright © 2004-2011 Micronode. All Rights Reserved.