001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/model/metadata/iso19115/CitedResponsibleParty.java $
002: /*
003: ---------------- FILE HEADER ------------------------------------------
004:
005: This file is part of deegree.
006: Copyright (C) 2001-2008 by:
007: EXSE, Department of Geography, University of Bonn
008: http://www.giub.uni-bonn.de/deegree/
009: lat/lon GmbH
010: http://www.lat-lon.de
011:
012: This library is free software; you can redistribute it and/or
013: modify it under the terms of the GNU Lesser General Public
014: License as published by the Free Software Foundation; either
015: version 2.1 of the License, or (at your option) any later version.
016:
017: This library is distributed in the hope that it will be useful,
018: but WITHOUT ANY WARRANTY; without even the implied warranty of
019: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
020: Lesser General Public License for more details.
021:
022: You should have received a copy of the GNU Lesser General Public
023: License along with this library; if not, write to the Free Software
024: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
025:
026: Contact:
027:
028: Andreas Poth
029: lat/lon GmbH
030: Aennchenstr. 19
031: 53115 Bonn
032: Germany
033: E-Mail: poth@lat-lon.de
034:
035: Prof. Dr. Klaus Greve
036: Department of Geography
037: University of Bonn
038: Meckenheimer Allee 166
039: 53115 Bonn
040: Germany
041: E-Mail: greve@giub.uni-bonn.de
042:
043:
044: ---------------------------------------------------------------------------*/
045:
046: package org.deegree.model.metadata.iso19115;
047:
048: import java.io.Serializable;
049: import java.util.ArrayList;
050: import java.util.Arrays;
051: import java.util.List;
052:
053: /**
054: * CitedResponsibleParty_Impl.java
055: *
056: * Created on 16. September 2002, 09:55
057: * <p>
058: * ----------------------------------------------------------------------
059: * </p>
060: *
061: * @author <a href="mailto:schaefer@lat-lon.de">Axel Schaefer</a>
062: * @version $Revision: 9343 $ $Date: 2007-12-27 05:30:32 -0800 (Thu, 27 Dec 2007) $ *
063: */
064: public class CitedResponsibleParty implements Serializable {
065:
066: private static final long serialVersionUID = 5912684530267785339L;
067:
068: private List<ContactInfo> contactinfo = null;
069:
070: private List<String> individualname = null;
071:
072: private List<String> organisationname = null;
073:
074: private List<String> positionname = null;
075:
076: private List<RoleCode> rolecode = null;
077:
078: /**
079: * Creates new instance through <code>List</code>s.
080: *
081: * @param contactInfo
082: * @param individualName
083: * @param organizationName
084: * @param positionName
085: * @param roleCode
086: */
087: public CitedResponsibleParty(List<ContactInfo> contactInfo,
088: List<String> individualName, List<String> organizationName,
089: List<String> positionName, List<RoleCode> roleCode) {
090: contactinfo = contactInfo;
091: individualname = individualName;
092: organisationname = organizationName;
093: positionname = positionName;
094: rolecode = roleCode;
095: }
096:
097: /** Creates a new instance of CitedResponsibleParty_Impl */
098: public CitedResponsibleParty(ContactInfo[] contactinfo,
099: String[] individualname, String[] organisationname,
100: String[] positionname, RoleCode[] rolecode) {
101:
102: this .contactinfo = new ArrayList<ContactInfo>();
103: this .individualname = new ArrayList<String>();
104: this .organisationname = new ArrayList<String>();
105: this .positionname = new ArrayList<String>();
106: this .rolecode = new ArrayList<RoleCode>();
107:
108: setContactInfo(contactinfo);
109: setIndividualName(individualname);
110: setOrganisationName(organisationname);
111: setPositionName(positionname);
112: setRoleCode(rolecode);
113: }
114:
115: /**
116: * @return ContactInfo-Array
117: *
118: */
119: public ContactInfo[] getContactInfo() {
120: return contactinfo.toArray(new ContactInfo[contactinfo.size()]);
121: }
122:
123: /**
124: * @see CitedResponsibleParty#getContactInfo()
125: */
126: public void addContactInfo(ContactInfo contactinfo) {
127: this .contactinfo.add(contactinfo);
128: }
129:
130: /**
131: * @see CitedResponsibleParty#getContactInfo()
132: */
133: public void setContactInfo(ContactInfo[] contactinfo) {
134: this .contactinfo = Arrays.asList(contactinfo);
135: }
136:
137: /**
138: * @return String-Array
139: *
140: */
141: public String[] getIndividualName() {
142: return individualname
143: .toArray(new String[individualname.size()]);
144: }
145:
146: /**
147: * @see CitedResponsibleParty#getIndividualName()
148: */
149: public void addIndividualName(String individualname) {
150: this .individualname.add(individualname);
151: }
152:
153: /**
154: * @see CitedResponsibleParty#getIndividualName()
155: */
156: public void setIndividualName(String[] individualname) {
157: this .individualname = Arrays.asList(individualname);
158: }
159:
160: /**
161: *
162: * @return String-Array
163: */
164: public String[] getOrganisationName() {
165: return organisationname.toArray(new String[organisationname
166: .size()]);
167: }
168:
169: /**
170: * @see CitedResponsibleParty#getOrganisationName()
171: */
172: public void addOrganisationName(String organisationname) {
173: this .organisationname.add(organisationname);
174: }
175:
176: /**
177: * @see CitedResponsibleParty#getOrganisationName()
178: */
179: public void setOrganisationName(String[] organisationname) {
180: this .organisationname = Arrays.asList(organisationname);
181: }
182:
183: /**
184: * @return String-Array
185: *
186: */
187: public String[] getPositionName() {
188: return positionname.toArray(new String[positionname.size()]);
189: }
190:
191: /**
192: * @see CitedResponsibleParty#getPositionName()
193: */
194: public void addPositionName(String positionname) {
195: this .positionname.add(positionname);
196: }
197:
198: /**
199: * @see CitedResponsibleParty#getPositionName()
200: */
201: public void setPositionName(String[] positionname) {
202: this .positionname = Arrays.asList(positionname);
203: }
204:
205: /**
206: * @return RoleCode-Array
207: *
208: */
209: public RoleCode[] getRoleCode() {
210: return rolecode.toArray(new RoleCode[rolecode.size()]);
211: }
212:
213: /**
214: * @see CitedResponsibleParty#getRoleCode()
215: */
216: public void addRoleCode(RoleCode rolecode) {
217: this .rolecode.add(rolecode);
218: }
219:
220: /**
221: * @see CitedResponsibleParty#getRoleCode()
222: */
223: public void setRoleCode(RoleCode[] rolecode) {
224: if (rolecode != null) {
225: this .rolecode = Arrays.asList(rolecode);
226: } else
227: this .rolecode.clear();
228: }
229:
230: /**
231: * to String method
232: */
233: @Override
234: public String toString() {
235: String ret = null;
236: ret = "contactinfo = " + contactinfo + "\n";
237: ret += "individualname = " + individualname + "\n";
238: ret += "organisationname = " + organisationname + "\n";
239: ret += "positionname = " + positionname + "\n";
240: ret += "rolecode = " + rolecode + "\n";
241: return ret;
242: }
243:
244: }
|