Code example for HashSet

Methods: toArray

0
 
    /* 
     * TODO Refactor Flags at some point to be able to store user defined flags. 
     */ 
    public Flag[] getFlags() { 
        return mFlags.toArray(EMPTY_FLAG_ARRAY);
    } 
 
    /** 
     * @param flag 
     *            Flag to set. Never <code>null</code>. 
     * @param set 
     *            If <code>true</code>, the flag is added. If <code>false</code> 
     *            , the flag is removed. 
     * @throws MessagingException 
     */ 
    public void setFlag(Flag flag, boolean set) throws MessagingException {
        if (set) {
            mFlags.add(flag);
        } else { 
            mFlags.remove(flag);