root / trunk / applications / appCatalogAndGazetteerClient / src / es / gva / cit / catalog / drivers / GetRecordsReply.java @ 15558
History | View | Annotate | Download (2.8 KB)
1 |
package es.gva.cit.catalog.drivers; |
---|---|
2 |
|
3 |
import java.net.URI; |
4 |
import java.util.ArrayList; |
5 |
|
6 |
import es.gva.cit.catalog.metadataxml.XMLNode; |
7 |
import es.gva.cit.catalog.schemas.Record; |
8 |
import es.gva.cit.catalog.schemas.RecordFactory; |
9 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
10 |
*
|
11 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
12 |
*
|
13 |
* This program is free software; you can redistribute it and/or
|
14 |
* modify it under the terms of the GNU General Public License
|
15 |
* as published by the Free Software Foundation; either version 2
|
16 |
* of the License, or (at your option) any later version.
|
17 |
*
|
18 |
* This program is distributed in the hope that it will be useful,
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
* GNU General Public License for more details.
|
22 |
*
|
23 |
* You should have received a copy of the GNU General Public License
|
24 |
* along with this program; if not, write to the Free Software
|
25 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
26 |
*
|
27 |
* For more information, contact:
|
28 |
*
|
29 |
* Generalitat Valenciana
|
30 |
* Conselleria d'Infraestructures i Transport
|
31 |
* Av. Blasco Ib??ez, 50
|
32 |
* 46010 VALENCIA
|
33 |
* SPAIN
|
34 |
*
|
35 |
* +34 963862235
|
36 |
* gvsig@gva.es
|
37 |
* www.gvsig.gva.es
|
38 |
*
|
39 |
* or
|
40 |
*
|
41 |
* IVER T.I. S.A
|
42 |
* Salamanca 50
|
43 |
* 46005 Valencia
|
44 |
* Spain
|
45 |
*
|
46 |
* +34 963163400
|
47 |
* dac@iver.es
|
48 |
*/
|
49 |
/* CVS MESSAGES:
|
50 |
*
|
51 |
* $Id: GetRecordsReply.java 600 2007-09-19 11:30:05 +0000 (Wed, 19 Sep 2007) jpiera $
|
52 |
* $Log$
|
53 |
* Revision 1.1.2.1 2007/07/23 07:14:25 jorpiell
|
54 |
* Catalog refactoring
|
55 |
*
|
56 |
*
|
57 |
*/
|
58 |
/**
|
59 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
60 |
*/
|
61 |
public class GetRecordsReply { |
62 |
private ArrayList records = null; |
63 |
private int numRecords = 0; |
64 |
|
65 |
public GetRecordsReply(int numRecords){ |
66 |
this.numRecords = numRecords;
|
67 |
records = new ArrayList(); |
68 |
} |
69 |
|
70 |
/**
|
71 |
* Add a new record
|
72 |
* @param record
|
73 |
* rRecord to add
|
74 |
*/
|
75 |
public void addRecord(Record record){ |
76 |
records.add(record); |
77 |
} |
78 |
|
79 |
/**
|
80 |
* Add a new record
|
81 |
* @param uri
|
82 |
* Server uri
|
83 |
* @param node
|
84 |
* XML node
|
85 |
*/
|
86 |
public void addRecord(URI uri, XMLNode node){ |
87 |
Record record = RecordFactory.createRecord(uri, node); |
88 |
records.add(record); |
89 |
} |
90 |
|
91 |
/**
|
92 |
* Gets a record that it is in a concrete position
|
93 |
* @param index
|
94 |
* Record position
|
95 |
* @return
|
96 |
* A record
|
97 |
*/
|
98 |
public Record getRecordAt(int index){ |
99 |
if (index >= records.size()){
|
100 |
return null; |
101 |
} |
102 |
return (Record)records.get(index);
|
103 |
} |
104 |
|
105 |
/**
|
106 |
* @return the numRecords
|
107 |
*/
|
108 |
public int getRecordsNumber() { |
109 |
return numRecords;
|
110 |
} |
111 |
|
112 |
/**
|
113 |
* @return the numRecords
|
114 |
*/
|
115 |
public int getRetrievedRecordsNumber() { |
116 |
return records.size();
|
117 |
} |
118 |
|
119 |
/**
|
120 |
* @param numRecords the numRecords to set
|
121 |
*/
|
122 |
public void setNumRecords(int numRecords) { |
123 |
this.numRecords = numRecords;
|
124 |
} |
125 |
|
126 |
} |