Statistics
| Revision:

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 @ 40767

History | View | Annotate | Download (4.34 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24

    
25
package org.gvsig.fmap.dal.feature.spi;
26

    
27
import org.gvsig.fmap.dal.exception.DataException;
28
import org.gvsig.tools.dispose.Disposable;
29
import org.gvsig.tools.dispose.DisposableIterator;
30

    
31
/**
32
 * Interface for set of feature based data providers
33
 *
34
 *
35
 * @author jmvivo
36
 *
37
 */
38
public interface FeatureSetProvider extends Disposable {
39

    
40
        boolean canFilter();
41

    
42
        boolean canOrder();
43

    
44
        boolean canIterateFromIndex();
45

    
46
        long getSize() throws DataException;
47

    
48
        boolean isEmpty() throws DataException;
49

    
50
    /**
51
     * Returns an iterator over the elements in this set, in the order
52
     * (if any) defined when the collection was obtained.
53
     * 
54
     * <p>
55
     * Fast in this case means that each of the elements returned may be a
56
     * reused or pooled object instance, so don't use it to be stored in any
57
     * way.
58
     * </p>
59
     * <p>
60
     * If you need to store one of the {@link FeatureProvider} of the iterator,
61
     * use the {@link FeatureProvider#getCopy()} to create a clone of the
62
     * object.
63
     * </p>
64
     * 
65
     * @return an iterator of the elements in this collection (in proper
66
     *         sequence).
67
     * 
68
     * @throws DataException
69
     *             if there is an error getting the iterator
70
     * 
71
     * @deprecated use {@link #fastIterator()} instead
72
     */
73
        DisposableIterator iterator() throws DataException;
74

    
75
    /**
76
     * Returns an iterator over the elements in this set, in the order
77
     * (if any) defined when the collection was obtained.
78
     * 
79
     * <p>
80
     * Fast in this case means that each of the elements returned may be a
81
     * reused or pooled object instance, so don't use it to be stored in any
82
     * way.
83
     * </p>
84
     * <p>
85
     * If you need to store one of the {@link FeatureProvider} of the iterator,
86
     * use the {@link FeatureProvider#getCopy()} to create a clone of the
87
     * object.
88
     * </p>
89
     * 
90
     * @param index
91
     *            index of first element to be returned from the iterator (by a
92
     *            call to the <tt>next</tt> method).
93
     * @return an iterator of the elements in this collection (in proper
94
     *         sequence).
95
     * 
96
     * @throws DataException
97
     *             if there is an error getting the iterator
98
     * 
99
     * @deprecated use {@link #fastIterator()} instead
100
     */
101
        DisposableIterator iterator(long index) throws DataException;
102

    
103
    /**
104
     * Returns an iterator over the elements in this set, in the order
105
     * (if any) defined when the collection was obtained.
106
     * 
107
     * @see #fastIterator()
108
     * @see #fastIterator(long)
109
     * 
110
     * @return an iterator of the elements in this collection (in proper
111
     *         sequence).
112
     * 
113
     * @throws DataException
114
     *             if there is an error getting the iterator
115
     */
116
    DisposableIterator fastIterator() throws DataException;
117

    
118
    /**
119
     * Returns an iterator over the elements in this set, in the order
120
     * (if any) defined when the collection was obtained.
121
     * 
122
     * @see #fastIterator()
123
     * @see #fastIterator(long)
124
     * 
125
     * @param index
126
     *            index of first element to be returned from the iterator (by a
127
     *            call to the <tt>next</tt> method).
128
     * @return an iterator of the elements in this collection (in proper
129
     *         sequence).
130
     * 
131
     * @throws DataException
132
     *             if there is an error getting the iterator
133
     */
134
        DisposableIterator fastIterator(long index) throws DataException;
135

    
136
}