Package com.sun.xml.internal.messaging.saaj.util

Examples of com.sun.xml.internal.messaging.saaj.util.FinalArrayList


     *
     * @param  part  The MimeBodyPart to be appended
     */
    public synchronized void addBodyPart(MimeBodyPart part) {
        if (parts == null)
            parts = new FinalArrayList();

        parts.add(part);
        part.setParent(this);
    }
View Full Code Here


     * @param  part  The MimeBodyPart to be inserted
     * @param  index Location where to insert the part
     */
    public synchronized void addBodyPart(MimeBodyPart part, int index) {
        if (parts == null)
            parts = new FinalArrayList();

        parts.add(index,part);
        part.setParent(this);
    }
View Full Code Here

        if (s == null)
            return null;

        // Tokenize the header to obtain the Language-tags (skip comments)
        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
        FinalArrayList v = new FinalArrayList();

        HeaderTokenizer.Token tk;
        int tkType;

        while (true) {
            tk = h.next(); // get a language-tag
            tkType = tk.getType();
            if (tkType == HeaderTokenizer.Token.EOF)
            break; // done
            else if (tkType == HeaderTokenizer.Token.ATOM) v.add(tk.getValue());
            else // invalid token, skip it.
            continue;
        }

        if (v.size() == 0)
            return null;

        return (String[])v.toArray(new String[v.size()]);
    }
View Full Code Here

     * @param   name header name
     * @return          array of header values, or null if none
     */
    public String[] getHeader(String name) {
        // XXX - should we just step through in index order?
        FinalArrayList v = new FinalArrayList(); // accumulate return values

        int len = headers.size();
        for( int i=0; i<len; i++ ) {
            hdr h = (hdr) headers.get(i);
            if (name.equalsIgnoreCase(h.name)) {
                v.add(h.getValue());
            }
        }
        if (v.size() == 0)
            return (null);
        // convert Vector to an array for return
        return (String[]) v.toArray(new String[v.size()]);
    }
View Full Code Here

        if (s == null)
            return null;

        // Tokenize the header to obtain the Language-tags (skip comments)
        HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
        FinalArrayList v = new FinalArrayList();

        HeaderTokenizer.Token tk;
        int tkType;

        while (true) {
            tk = h.next(); // get a language-tag
            tkType = tk.getType();
            if (tkType == HeaderTokenizer.Token.EOF)
            break; // done
            else if (tkType == HeaderTokenizer.Token.ATOM) v.add(tk.getValue());
            else // invalid token, skip it.
            continue;
        }

        if (v.size() == 0)
            return null;

        return (String[])v.toArray(new String[v.size()]);
    }
View Full Code Here

     * @param   name header name
     * @return          array of header values, or null if none
     */
    public String[] getHeader(String name) {
        // XXX - should we just step through in index order?
        FinalArrayList v = new FinalArrayList(); // accumulate return values

        int len = headers.size();
        for( int i=0; i<len; i++ ) {
            hdr h = (hdr) headers.get(i);
            if (name.equalsIgnoreCase(h.name)) {
                v.add(h.getValue());
            }
        }
        if (v.size() == 0)
            return (null);
        // convert Vector to an array for return
        return (String[]) v.toArray(new String[v.size()]);
    }
View Full Code Here

     *
     * @param  part  The MimeBodyPart to be appended
     */
    public synchronized void addBodyPart(MimeBodyPart part) {
        if (parts == null)
            parts = new FinalArrayList();

        parts.add(part);
        part.setParent(this);
    }
View Full Code Here

     * @param  part  The MimeBodyPart to be inserted
     * @param  index Location where to insert the part
     */
    public synchronized void addBodyPart(MimeBodyPart part, int index) {
        if (parts == null)
            parts = new FinalArrayList();

        parts.add(index,part);
        part.setParent(this);
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.messaging.saaj.util.FinalArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.