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