banner



How To Set Flag In Java



javax.postal service
Course Flags

coffee.lang.Object        extended by         javax.mail.Flags      
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class            Flags            
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

The Flags class represents the set of flags on a Bulletin. Flags are equanimous of predefined system flags, and user defined flags.

A System flag is represented past the Flags.Flag inner class. A User defined flag is represented as a Cord. User flags are case-independent.

A set of standard system flags are predefined. Well-nigh binder implementations are expected to support these flags. Some implementations may as well support capricious user-divers flags. The getPermanentFlags method on a Folder returns a Flags object that holds all the flags that are supported by that folder implementation.

A Flags object is serializable and so that (for example) the use of Flags objects in search terms can exist serialized forth with the search terms.

Warning: Serialized objects of this grade may non be uniform with hereafter JavaMail API releases. The electric current serialization support is advisable for short term storage.

The below code sample illustrates how to set, examine and get the flags for a message.

          Message yard = folder.getMessage(1);  g.setFlag(Flags.Flag.DELETED, true); // ready the DELETED flag   // Check if DELETED flag is set of this bulletin  if (k.isSet(Flags.Flag.DELETED))         System.out.println("DELETED bulletin");   // Examine ALL system flags for this message  Flags flags = m.getFlags();  Flags.Flag[] sf = flags.getSystemFlags();  for (int i = 0; i < sf.length; i++) {         if (sf[i] == Flags.Flag.DELETED)             Organisation.out.println("DELETED message");         else if (sf[i] == Flags.Flag.SEEN)             Organization.out.println("SEEN message");       ......       ......  }      
Author:
John Mani, Bill Shannon
See Besides:
Folder#getPermanentFlags, Serialized Form

Nested Grade Summary
static class Flags.Flag
This inner class represents an individual system flag.
Constructor Summary
Flags()
Construct an empty Flags object.
Flags(Flags.Flag flag)
Construct a Flags object initialized with the given system flag.
Flags(Flags flags)
Construct a Flags object initialized with the given flags.
Flags(java.lang.String flag)
Construct a Flags object initialized with the given user flag.
Method Summary
 void add(Flags.Flag flag)
Add the specified system flag to this Flags object.
 void add(Flags f)
Add together all the flags in the given Flags object to this Flags object.
 void add(java.lang.String flag)
Add the specified user flag to this Flags object.
 coffee.lang.Object clone()
Returns a clone of this Flags object.
 boolean contains(Flags.Flag flag)
Check whether the specified system flag is present in this Flags object.
 boolean contains(Flags f)
Check whether all the flags in the specified Flags object are nowadays in this Flags object.
 boolean contains(java.lang.String flag)
Check whether the specified user flag is present in this Flags object.
 boolean equals(java.lang.Object obj)
Check whether the ii Flags objects are equal.
 Flags.Flag[] getSystemFlags()
Return all the organisation flags in this Flags object.
 java.lang.String[] getUserFlags()
Return all the user flags in this Flags object.
 int hashCode()
Compute a hash code for this Flags object.
 void remove(Flags.Flag flag)
Remove the specified arrangement flag from this Flags object.
 void remove(Flags f)
Remove all flags in the given Flags object from this Flags object.
 void remove(coffee.lang.Cord flag)
Remove the specified user flag from this Flags object.
Methods inherited from grade java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

Flags

public        Flags()
Construct an empty Flags object.

Flags

public        Flags(Flags flags)
Construct a Flags object initialized with the given flags.
Parameters:
flags - the flags for initialization

Flags

public        Flags(Flags.Flag flag)
Construct a Flags object initialized with the given organization flag.
Parameters:
flag - the flag for initialization

Flags

public        Flags(java.lang.String flag)
Construct a Flags object initialized with the given user flag.
Parameters:
flag - the flag for initialization
Method Detail

add

public void        add together(Flags.Flag flag)
Add the specified system flag to this Flags object.
Parameters:
flag - the flag to add

add

public void        add(java.lang.String flag)
Add together the specified user flag to this Flags object.
Parameters:
flag - the flag to add together

add

public void        add together(Flags f)
Add all the flags in the given Flags object to this Flags object.
Parameters:
f - Flags object

remove

public void        remove(Flags.Flag flag)
Remove the specified system flag from this Flags object.
Parameters:
flag - the flag to be removed

remove

public void        remove(java.lang.Cord flag)
Remove the specified user flag from this Flags object.
Parameters:
flag - the flag to exist removed

remove

public void        remove(Flags f)
Remove all flags in the given Flags object from this Flags object.
Parameters:
f - the flag to be removed

contains

public boolean        contains(Flags.Flag flag)
Cheque whether the specified system flag is present in this Flags object.
Returns:
true of the given flag is nowadays, otherwise fake.

contains

public boolean        contains(java.lang.String flag)
Check whether the specified user flag is nowadays in this Flags object.
Returns:
true of the given flag is nowadays, otherwise false.

contains

public boolean        contains(Flags f)
Check whether all the flags in the specified Flags object are present in this Flags object.
Returns:
true if all flags in the given Flags object are nowadays, otherwise imitation.

equals

public boolean        equals(java.lang.Object obj)
Check whether the two Flags objects are equal.
Overrides:
equals in class java.lang.Object
Returns:
true if they're equal

hashCode

public int        hashCode()
Compute a hash code for this Flags object.
Overrides:
hashCode in class coffee.lang.Object
Returns:
the hash code

getSystemFlags

public Flags.Flag[]        getSystemFlags()
Return all the system flags in this Flags object. Returns an array of size nil if no flags are set.
Returns:
array of Flags.Flag objects representing system flags

getUserFlags

public java.lang.String[]        getUserFlags()
Return all the user flags in this Flags object. Returns an array of size zero if no flags are ready.
Returns:
array of Strings, each String represents a flag.

clone

public java.lang.Object        clone()
Returns a clone of this Flags object.
Overrides:
clone in class java.lang.Object


Submit a issues or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Utilise is subject to license terms.

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not alter the content in any way.

How To Set Flag In Java,

Source: https://docs.oracle.com/javaee/6/api/javax/mail/Flags.html

Posted by: nealwasublivis73.blogspot.com

0 Response to "How To Set Flag In Java"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel