001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/getcapabilities/ServiceOperation.java $
002 /*
003 * Created on 25.03.2004
004 *
005 * To change the template for this generated file go to
006 * Window>Preferences>Java>Code Generation>Code and Comments
007 */
008 package org.deegree.ogcwebservices.getcapabilities;
009
010 import java.util.ArrayList;
011 import java.util.Iterator;
012 import java.util.List;
013
014
015 /**
016 * ServiceOperation
017 *
018 * @author Administrator
019 *
020 * @author last edited by: $Author: bezema $
021 *
022 * @version 2.0, $Revision: 6259 $, $Date: 2007-03-20 10:15:15 +0100 (Di, 20 Mär 2007) $
023 *
024 * @since 2.0
025 */
026 public class ServiceOperation {
027
028 private List dcpList;
029
030 public ServiceOperation() {
031 this.dcpList = new ArrayList();
032 }
033
034 public DCPType[] getDCPTypes(Protocol protocol) {
035 DCPType[] typeArray;
036 List returnTypeList = new ArrayList();
037 Iterator iterator = dcpList.iterator();
038 while (iterator.hasNext()) {
039 DCPType element = (DCPType) iterator.next();
040 if (element.getProtocol().equals(protocol)) {
041 returnTypeList.add(element);
042 }
043 }
044 typeArray = new DCPType[returnTypeList.size()];
045 return (DCPType[]) returnTypeList.toArray(typeArray);
046 }
047
048 /**
049 * Set all DCP types.
050 * First empyt list, then sets
051 * @param types
052 */
053 public void setDCPTypes(DCPType[] types) {
054 this.dcpList.clear();
055 for (int i = 0; i < types.length; i++) {
056 this.addDCPType(types[i]);
057 }
058 }
059
060 public void addDCPType(DCPType type) {
061 this.dcpList.add( type );
062 }
063
064
065
066 }
067 /* ********************************************************************
068 Changes to this class. What the people have been up to:
069 $Log$
070 Revision 1.2 2006/07/12 14:46:16 poth
071 comment footer added
072
073 ********************************************************************** */