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