1 17 18 19 20 package org.apache.lenya.cms.publication; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 28 public class DocumentSet { 29 30 33 public DocumentSet() { 34 } 35 36 40 public DocumentSet(Document[] documents) { 41 for (int i = 0; i < documents.length; i++) { 42 add(documents[i]); 43 } 44 } 45 46 private List documents = new ArrayList (); 47 48 53 public Document[] getDocuments() { 54 return (Document[]) documents.toArray(new Document[documents.size()]); 55 } 56 57 62 public void add(Document document) { 63 assert document != null; 64 assert !documents.contains(document); 65 documents.add(document); 66 } 67 68 73 public boolean isEmpty() { 74 return documents.isEmpty(); 75 } 76 77 } 78 | Popular Tags |