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 @ 40435
History | View | Annotate | Download (4.36 KB)
1 | 40435 | jjdelcerro | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
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 | * as published by the Free Software Foundation; either version 2
|
||
9 | * 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 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {{Company}} {{Task}}
|
||
26 | */
|
||
27 | |||
28 | package org.gvsig.fmap.dal.feature.spi; |
||
29 | |||
30 | import org.gvsig.fmap.dal.exception.DataException; |
||
31 | import org.gvsig.tools.dispose.Disposable; |
||
32 | import org.gvsig.tools.dispose.DisposableIterator; |
||
33 | |||
34 | /**
|
||
35 | * Interface for set of feature based data providers
|
||
36 | *
|
||
37 | *
|
||
38 | * @author jmvivo
|
||
39 | *
|
||
40 | */
|
||
41 | public interface FeatureSetProvider extends Disposable { |
||
42 | |||
43 | boolean canFilter();
|
||
44 | |||
45 | boolean canOrder();
|
||
46 | |||
47 | boolean canIterateFromIndex();
|
||
48 | |||
49 | long getSize() throws DataException; |
||
50 | |||
51 | boolean isEmpty() throws DataException; |
||
52 | |||
53 | /**
|
||
54 | * Returns an iterator over the elements in this set, in the order
|
||
55 | * (if any) defined when the collection was obtained.
|
||
56 | *
|
||
57 | * <p>
|
||
58 | * Fast in this case means that each of the elements returned may be a
|
||
59 | * reused or pooled object instance, so don't use it to be stored in any
|
||
60 | * way.
|
||
61 | * </p>
|
||
62 | * <p>
|
||
63 | * If you need to store one of the {@link FeatureProvider} of the iterator,
|
||
64 | * use the {@link FeatureProvider#getCopy()} to create a clone of the
|
||
65 | * object.
|
||
66 | * </p>
|
||
67 | *
|
||
68 | * @return an iterator of the elements in this collection (in proper
|
||
69 | * sequence).
|
||
70 | *
|
||
71 | * @throws DataException
|
||
72 | * if there is an error getting the iterator
|
||
73 | *
|
||
74 | * @deprecated use {@link #fastIterator()} instead
|
||
75 | */
|
||
76 | DisposableIterator iterator() throws DataException;
|
||
77 | |||
78 | /**
|
||
79 | * Returns an iterator over the elements in this set, in the order
|
||
80 | * (if any) defined when the collection was obtained.
|
||
81 | *
|
||
82 | * <p>
|
||
83 | * Fast in this case means that each of the elements returned may be a
|
||
84 | * reused or pooled object instance, so don't use it to be stored in any
|
||
85 | * way.
|
||
86 | * </p>
|
||
87 | * <p>
|
||
88 | * If you need to store one of the {@link FeatureProvider} of the iterator,
|
||
89 | * use the {@link FeatureProvider#getCopy()} to create a clone of the
|
||
90 | * object.
|
||
91 | * </p>
|
||
92 | *
|
||
93 | * @param index
|
||
94 | * index of first element to be returned from the iterator (by a
|
||
95 | * call to the <tt>next</tt> method).
|
||
96 | * @return an iterator of the elements in this collection (in proper
|
||
97 | * sequence).
|
||
98 | *
|
||
99 | * @throws DataException
|
||
100 | * if there is an error getting the iterator
|
||
101 | *
|
||
102 | * @deprecated use {@link #fastIterator()} instead
|
||
103 | */
|
||
104 | DisposableIterator iterator(long index) throws DataException; |
||
105 | |||
106 | /**
|
||
107 | * Returns an iterator over the elements in this set, in the order
|
||
108 | * (if any) defined when the collection was obtained.
|
||
109 | *
|
||
110 | * @see #fastIterator()
|
||
111 | * @see #fastIterator(long)
|
||
112 | *
|
||
113 | * @return an iterator of the elements in this collection (in proper
|
||
114 | * sequence).
|
||
115 | *
|
||
116 | * @throws DataException
|
||
117 | * if there is an error getting the iterator
|
||
118 | */
|
||
119 | DisposableIterator fastIterator() throws DataException;
|
||
120 | |||
121 | /**
|
||
122 | * Returns an iterator over the elements in this set, in the order
|
||
123 | * (if any) defined when the collection was obtained.
|
||
124 | *
|
||
125 | * @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 | DisposableIterator fastIterator(long index) throws DataException; |
||
138 | |||
139 | } |