svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / feature / spi / FeatureSetProvider.java @ 44198
History | View | Annotate | Download (4.46 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | |||
25 | package org.gvsig.fmap.dal.feature.spi; |
||
26 | |||
27 | import org.gvsig.fmap.dal.exception.DataException; |
||
28 | 43377 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureType; |
29 | 40435 | jjdelcerro | import org.gvsig.tools.dispose.Disposable; |
30 | import org.gvsig.tools.dispose.DisposableIterator; |
||
31 | |||
32 | /**
|
||
33 | * Interface for set of feature based data providers
|
||
34 | *
|
||
35 | *
|
||
36 | * @author jmvivo
|
||
37 | *
|
||
38 | */
|
||
39 | public interface FeatureSetProvider extends Disposable { |
||
40 | |||
41 | boolean canFilter();
|
||
42 | |||
43 | boolean canOrder();
|
||
44 | |||
45 | boolean canIterateFromIndex();
|
||
46 | |||
47 | long getSize() throws DataException; |
||
48 | |||
49 | boolean isEmpty() throws DataException; |
||
50 | |||
51 | /**
|
||
52 | * Returns an iterator over the elements in this set, in the order
|
||
53 | * (if any) defined when the collection was obtained.
|
||
54 | *
|
||
55 | * <p>
|
||
56 | * Fast in this case means that each of the elements returned may be a
|
||
57 | * reused or pooled object instance, so don't use it to be stored in any
|
||
58 | * way.
|
||
59 | * </p>
|
||
60 | * <p>
|
||
61 | * If you need to store one of the {@link FeatureProvider} of the iterator,
|
||
62 | * use the {@link FeatureProvider#getCopy()} to create a clone of the
|
||
63 | * object.
|
||
64 | * </p>
|
||
65 | *
|
||
66 | * @return an iterator of the elements in this collection (in proper
|
||
67 | * sequence).
|
||
68 | *
|
||
69 | * @throws DataException
|
||
70 | * if there is an error getting the iterator
|
||
71 | *
|
||
72 | * @deprecated use {@link #fastIterator()} instead
|
||
73 | */
|
||
74 | DisposableIterator iterator() throws DataException;
|
||
75 | |||
76 | /**
|
||
77 | * Returns an iterator over the elements in this set, in the order
|
||
78 | * (if any) defined when the collection was obtained.
|
||
79 | *
|
||
80 | * <p>
|
||
81 | * Fast in this case means that each of the elements returned may be a
|
||
82 | * reused or pooled object instance, so don't use it to be stored in any
|
||
83 | * way.
|
||
84 | * </p>
|
||
85 | * <p>
|
||
86 | * If you need to store one of the {@link FeatureProvider} of the iterator,
|
||
87 | * use the {@link FeatureProvider#getCopy()} to create a clone of the
|
||
88 | * object.
|
||
89 | * </p>
|
||
90 | *
|
||
91 | * @param index
|
||
92 | * index of first element to be returned from the iterator (by a
|
||
93 | * call to the <tt>next</tt> method).
|
||
94 | 43358 | jjdelcerro | * @param elements
|
95 | 40435 | jjdelcerro | * @return an iterator of the elements in this collection (in proper
|
96 | * sequence).
|
||
97 | *
|
||
98 | * @throws DataException
|
||
99 | * if there is an error getting the iterator
|
||
100 | *
|
||
101 | * @deprecated use {@link #fastIterator()} instead
|
||
102 | */
|
||
103 | 43358 | jjdelcerro | DisposableIterator iterator(long index, long elements) throws DataException; |
104 | 40435 | jjdelcerro | |
105 | /**
|
||
106 | * Returns an iterator over the elements in this set, in the order
|
||
107 | * (if any) defined when the collection was obtained.
|
||
108 | *
|
||
109 | * @see #fastIterator()
|
||
110 | * @see #fastIterator(long)
|
||
111 | *
|
||
112 | * @return an iterator of the elements in this collection (in proper
|
||
113 | * sequence).
|
||
114 | *
|
||
115 | * @throws DataException
|
||
116 | * if there is an error getting the iterator
|
||
117 | */
|
||
118 | DisposableIterator fastIterator() throws DataException;
|
||
119 | |||
120 | /**
|
||
121 | * Returns an iterator over the elements in this set, in the order
|
||
122 | * (if any) defined when the collection was obtained.
|
||
123 | *
|
||
124 | 43358 | jjdelcerro | * @param elements
|
125 | 40435 | jjdelcerro | * @see #fastIterator()
|
126 | * @see #fastIterator(long)
|
||
127 | *
|
||
128 | * @param index
|
||
129 | * index of first element to be returned from the iterator (by a
|
||
130 | * call to the <tt>next</tt> method).
|
||
131 | * @return an iterator of the elements in this collection (in proper
|
||
132 | * sequence).
|
||
133 | *
|
||
134 | * @throws DataException
|
||
135 | * if there is an error getting the iterator
|
||
136 | */
|
||
137 | 43358 | jjdelcerro | DisposableIterator fastIterator(long index, long elements) throws DataException; |
138 | 40435 | jjdelcerro | |
139 | 40767 | jjdelcerro | } |