james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r739625 - /james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java
Date Sat, 31 Jan 2009 21:36:03 GMT
Author: mwiederkehr
Date: Sat Jan 31 21:36:03 2009
New Revision: 739625

URL: http://svn.apache.org/viewvc?rev=739625&view=rev
Log:
Header implements Iterable<Field>.

Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java?rev=739625&r1=739624&r2=739625&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/message/Header.java Sat Jan 31
21:36:03 2009
@@ -47,7 +47,7 @@
  * 
  * @version $Id: Header.java,v 1.3 2004/10/04 15:36:44 ntherning Exp $
  */
-public class Header {
+public class Header implements Iterable<Field> {
     private List<Field> fields = new LinkedList<Field>();
     private Map<String, List<Field>> fieldMap = new HashMap<String, List<Field>>();
     
@@ -160,6 +160,15 @@
     }
 
     /**
+     * Returns an iterator over the list of fields of this header.
+     * 
+     * @return an iterator.
+     */
+    public Iterator<Field> iterator() {
+        return Collections.unmodifiableList(fields).iterator();
+    }
+
+    /**
      * Removes all <code>Field</code>s having the specified field name.
      * 
      * @param name



Mime
View raw message