001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/model/metadata/iso19115/Citation.java $
002    /*
003    /*----------------------------------------------------------------------------
004     This file is part of deegree, http://deegree.org/
005     Copyright (C) 2001-2009 by:
006       Department of Geography, University of Bonn
007     and
008       lat/lon GmbH
009    
010     This library is free software; you can redistribute it and/or modify it under
011     the terms of the GNU Lesser General Public License as published by the Free
012     Software Foundation; either version 2.1 of the License, or (at your option)
013     any later version.
014     This library is distributed in the hope that it will be useful, but WITHOUT
015     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
016     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
017     details.
018     You should have received a copy of the GNU Lesser General Public License
019     along with this library; if not, write to the Free Software Foundation, Inc.,
020     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021    
022     Contact information:
023    
024     lat/lon GmbH
025     Aennchenstr. 19, 53177 Bonn
026     Germany
027     http://lat-lon.de/
028    
029     Department of Geography, University of Bonn
030     Prof. Dr. Klaus Greve
031     Postfach 1147, 53001 Bonn
032     Germany
033     http://www.geographie.uni-bonn.de/deegree/
034    
035     e-mail: info@deegree.org
036    ----------------------------------------------------------------------------*/
037    
038    package org.deegree.model.metadata.iso19115;
039    
040    import java.util.ArrayList;
041    
042    /**
043     *
044     *
045     *
046     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
047     * @author last edited by: $Author: mschneider $
048     *
049     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
050     */
051    public class Citation {
052    
053        private ArrayList<String> alternatetitle = null;
054    
055        private ArrayList<CitedResponsibleParty> citedresponsibleparty = null;
056    
057        private ArrayList<Date> date = null;
058    
059        private String edition = null;
060    
061        private String editiondate = null;
062    
063        private ArrayList<String> identifier = null;
064    
065        private String isbn = null;
066    
067        private String issn = null;
068    
069        private String issueidentification = null;
070    
071        private String seriesname = null;
072    
073        private String title = null;
074    
075        /**
076         *
077         * @param alternatetitle
078         * @param citedresponsibleparty
079         * @param date
080         * @param edition
081         * @param editiondate
082         * @param identifier
083         * @param isbn
084         * @param issn
085         * @param issueidentification
086         * @param seriesname
087         * @param title
088         */
089        public Citation( String[] alternatetitle, CitedResponsibleParty[] citedresponsibleparty, Date[] date,
090                         String edition, String editiondate, String[] identifier, String isbn, String issn,
091                         String issueidentification, String seriesname, String title ) {
092    
093            this.alternatetitle = new ArrayList<String>();
094            this.citedresponsibleparty = new ArrayList<CitedResponsibleParty>();
095            this.date = new ArrayList<Date>();
096            this.identifier = new ArrayList<String>();
097    
098            setAlternateTitle( alternatetitle );
099            setCitedResponsibleParty( citedresponsibleparty );
100            setDate( date );
101            setEdition( edition );
102            setEditionDate( editiondate );
103            setIdentifier( identifier );
104            setIsbn( isbn );
105            setIssn( issn );
106            setIssueIdentification( issueidentification );
107            setSeriesName( seriesname );
108            setTitle( title );
109        }
110    
111        /**
112         * @return aleternate titles
113         *
114         */
115        public String[] getAlternateTitle() {
116            return alternatetitle.toArray( new String[alternatetitle.size()] );
117        }
118    
119        /**
120         * @param alternatetitle
121         * @see Citation#getAlternateTitle()
122         */
123        public void addAlternateTitle( String alternatetitle ) {
124            this.alternatetitle.add( alternatetitle );
125        }
126    
127        /**
128         * @param alternatetitle
129         * @see Citation#getAlternateTitle()
130         */
131        public void setAlternateTitle( String[] alternatetitle ) {
132            this.alternatetitle.clear();
133            for ( int i = 0; i < alternatetitle.length; i++ ) {
134                this.alternatetitle.add( alternatetitle[i] );
135            }
136        }
137    
138        /**
139         * @return Cited Responsible Parties
140         */
141        public CitedResponsibleParty[] getCitedResponsibleParty() {
142            return citedresponsibleparty.toArray( new CitedResponsibleParty[citedresponsibleparty.size()] );
143        }
144    
145        /**
146         * @see Citation#getCitedResponsibleParty()
147         * @param citedresponsibleparty
148         */
149        public void addCitedResponsibleParty( CitedResponsibleParty citedresponsibleparty ) {
150            this.citedresponsibleparty.add( citedresponsibleparty );
151        }
152    
153        /**
154         * @see Citation#getCitedResponsibleParty()
155         * @param citedresponsibleparty
156         */
157        public void setCitedResponsibleParty( CitedResponsibleParty[] citedresponsibleparty ) {
158            this.citedresponsibleparty.clear();
159            for ( int i = 0; i < citedresponsibleparty.length; i++ ) {
160                this.citedresponsibleparty.add( citedresponsibleparty[i] );
161            }
162        }
163    
164        /**
165         * @return dates
166         *
167         */
168        public Date[] getDate() {
169            return date.toArray( new Date[date.size()] );
170        }
171    
172        /**
173         * @param date
174         * @see Citation#getDate()
175         */
176        public void addDate( Date date ) {
177            this.date.add( date );
178        }
179    
180        /**
181         * @param date
182         * @see Citation#getDate()
183         */
184        public void setDate( Date[] date ) {
185            this.date.clear();
186            for ( int i = 0; i < date.length; i++ ) {
187                this.date.add( date[i] );
188            }
189        }
190    
191        /**
192         * @return String
193         *
194         */
195        public String getEdition() {
196            return edition;
197        }
198    
199        /**
200         * @see Citation#getEdition()
201         * @param edition
202         */
203        public void setEdition( String edition ) {
204            this.edition = edition;
205        }
206    
207        /**
208         * @return edition date
209         */
210        public String getEditionDate() {
211            return editiondate;
212        }
213    
214        /**
215         * @see Citation#getEditionDate()
216         * @param editiondate
217         */
218        public void setEditionDate( String editiondate ) {
219            this.editiondate = editiondate;
220        }
221    
222        /**
223         * @return identifiers
224         *
225         */
226        public String[] getIdentifier() {
227            return identifier.toArray( new String[identifier.size()] );
228        }
229    
230        /**
231         * @see Citation#getIdentifier()
232         * @param identifier
233         */
234        public void addIdentifier( String identifier ) {
235            this.identifier.add( identifier );
236        }
237    
238        /**
239         * @see Citation#getIdentifier()
240         * @param identifier
241         */
242        public void setIdentifier( String[] identifier ) {
243            this.identifier.clear();
244            for ( int i = 0; i < identifier.length; i++ ) {
245                this.identifier.add( identifier[i] );
246            }
247        }
248    
249        /**
250         *
251         * @return isbn
252         */
253        public String getIsbn() {
254            return isbn;
255        }
256    
257        /**
258         * @see Citation#getIsbn()
259         * @param isbn
260         */
261        public void setIsbn( String isbn ) {
262            this.isbn = isbn;
263        }
264    
265        /**
266         * @return issn
267         *
268         */
269        public String getIssn() {
270            return issn;
271        }
272    
273        /**
274         * @see Citation#getIssn()
275         * @param issn
276         */
277        public void setIssn( String issn ) {
278            this.issn = issn;
279        }
280    
281        /**
282         * @return Issue Identification
283         *
284         */
285        public String getIssueIdentification() {
286            return issueidentification;
287        }
288    
289        /**
290         * @see Citation#getIssueIdentification()
291         * @param issueidentification
292         */
293        public void setIssueIdentification( String issueidentification ) {
294            this.issueidentification = issueidentification;
295        }
296    
297        /**
298         * @return sereis name
299         *
300         */
301        public String getSeriesName() {
302            return seriesname;
303        }
304    
305        /**
306         * @see Citation#getSeriesName()
307         * @param seriesname
308         */
309        public void setSeriesName( String seriesname ) {
310            this.seriesname = seriesname;
311        }
312    
313        /**
314         * @return title
315         *
316         */
317        public String getTitle() {
318            return title;
319        }
320    
321        /**
322         * @see Citation#getTitle()
323         *
324         * @param title
325         */
326        public void setTitle( String title ) {
327            this.title = title;
328        }
329    
330        @Override
331        public String toString() {
332            String ret = null;
333            ret = "alternatetitle = " + alternatetitle + "\n";
334            ret += "citedresponsibleparty = " + citedresponsibleparty + "\n";
335            ret += "date = " + date + "\n";
336            ret += "edition = " + edition + "\n";
337            ret += "editiondate = " + editiondate + "\n";
338            ret += "identifier = " + identifier + "\n";
339            ret += "isbn = " + isbn + "\n";
340            ret += "issn = " + issn + "\n";
341            ret += "issueidentification = " + issueidentification + "\n";
342            ret += "seriesname = " + seriesname + "\n";
343            ret += "title = " + title + "\n";
344            return ret;
345        }
346    
347    }