root / trunk / libraries / libTopology / src / com / iver / cit / gvsig / drivers / DriverBasedCollection.java @ 22874
History | View | Annotate | Download (3.49 KB)
1 |
/*
|
---|---|
2 |
* Created on 10-abr-2006
|
3 |
*
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Generalitat Valenciana
|
25 |
* Conselleria d'Infraestructures i Transport
|
26 |
* Av. Blasco Ib??ez, 50
|
27 |
* 46010 VALENCIA
|
28 |
* SPAIN
|
29 |
*
|
30 |
* +34 963862235
|
31 |
* gvsig@gva.es
|
32 |
* www.gvsig.gva.es
|
33 |
*
|
34 |
* or
|
35 |
*
|
36 |
* IVER T.I. S.A
|
37 |
* Salamanca 50
|
38 |
* 46005 Valencia
|
39 |
* Spain
|
40 |
*
|
41 |
* +34 963163400
|
42 |
* dac@iver.es
|
43 |
*/
|
44 |
/* CVS MESSAGES:
|
45 |
*
|
46 |
* $Id:
|
47 |
* $Log:
|
48 |
*/
|
49 |
package com.iver.cit.gvsig.drivers; |
50 |
|
51 |
import java.util.Collection; |
52 |
import java.util.Iterator; |
53 |
|
54 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
55 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
56 |
/**
|
57 |
*
|
58 |
* Implementation of collection which saves and reads
|
59 |
* its objects from a subjacent driver.
|
60 |
*
|
61 |
* @author Alvaro Zabala
|
62 |
*
|
63 |
*/
|
64 |
public abstract class DriverBasedCollection |
65 |
implements Collection { |
66 |
|
67 |
/**
|
68 |
* Adapter associated to this collection
|
69 |
*/
|
70 |
protected ReadableVectorial adapter;
|
71 |
/**
|
72 |
* Bitset that marks the index of the added
|
73 |
*/
|
74 |
protected FBitSet bitset;
|
75 |
|
76 |
// protected
|
77 |
|
78 |
|
79 |
/**
|
80 |
* Constructor
|
81 |
* @param adapter
|
82 |
*/
|
83 |
public DriverBasedCollection(ReadableVectorial adapter) {
|
84 |
this.adapter = adapter;
|
85 |
this.bitset = new FBitSet(); |
86 |
} |
87 |
|
88 |
|
89 |
public boolean add(Object obj) { |
90 |
if(! (obj instanceof AbstractDriverCollectionEntry)) |
91 |
return false; |
92 |
AbstractDriverCollectionEntry entry = |
93 |
(AbstractDriverCollectionEntry)obj; |
94 |
int idx = entry.getDriverIdx();
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
// TODO Auto-generated method stub
|
101 |
return false; |
102 |
} |
103 |
|
104 |
|
105 |
public boolean addAll(Collection arg0) { |
106 |
// TODO Auto-generated method stub
|
107 |
return false; |
108 |
} |
109 |
|
110 |
|
111 |
public void clear() { |
112 |
bitset.clear(); |
113 |
} |
114 |
|
115 |
public boolean contains(Object arg0) { |
116 |
// TODO Auto-generated method stub
|
117 |
return false; |
118 |
} |
119 |
|
120 |
public boolean containsAll(Collection arg0) { |
121 |
// TODO Auto-generated method stub
|
122 |
return false; |
123 |
} |
124 |
|
125 |
public boolean isEmpty() { |
126 |
return bitset.cardinality() == 0; |
127 |
} |
128 |
|
129 |
public Iterator iterator() { |
130 |
// TODO Auto-generated method stub
|
131 |
return null; |
132 |
} |
133 |
|
134 |
public boolean remove(Object arg0) { |
135 |
// TODO Auto-generated method stub
|
136 |
return false; |
137 |
} |
138 |
|
139 |
public boolean removeAll(Collection arg0) { |
140 |
// TODO Auto-generated method stub
|
141 |
return false; |
142 |
} |
143 |
|
144 |
public boolean retainAll(Collection arg0) { |
145 |
// TODO Auto-generated method stub
|
146 |
return false; |
147 |
} |
148 |
|
149 |
public int size() { |
150 |
// TODO Auto-generated method stub
|
151 |
return 0; |
152 |
} |
153 |
|
154 |
public Object[] toArray() { |
155 |
// TODO Auto-generated method stub
|
156 |
return null; |
157 |
} |
158 |
|
159 |
public Object[] toArray(Object[] arg0) { |
160 |
// TODO Auto-generated method stub
|
161 |
return null; |
162 |
} |
163 |
|
164 |
} |