Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureReferenceSelection.java @ 24496

History | View | Annotate | Download (3.21 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Gobernment (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 {DiSiD Technologies}  {Implement data selection}
26
 */
27
package org.gvsig.fmap.dal.feature;
28

    
29
import java.util.Iterator;
30

    
31
import org.gvsig.fmap.dal.DataSelection;
32
import org.gvsig.fmap.dal.exceptions.DataException;
33
import org.gvsig.tools.observer.Observer;
34
import org.gvsig.tools.observer.WeakReferencingObservable;
35
import org.gvsig.tools.persistence.Persistent;
36

    
37
/**
38
 * Interface to manage selection of objects from an undetermined set. Allows to
39
 * add and remove values from the selection, as well as reversing the selection.
40
 *
41
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
42
 */
43
public interface FeatureReferenceSelection extends DataSelection, Observer,
44
        WeakReferencingObservable, Persistent {
45

    
46
    /**
47
     * Adds a feature to the selection.
48
     *
49
     * @param reference
50
     *            the selected feature reference
51
     * @return true if the feature was not selected before selecting it
52
     */
53
    boolean select(FeatureReference reference);
54

    
55
    /**
56
     * Removes a feature from the selection.
57
     *
58
     * @param reference
59
     *            the deselected feature reference
60
     * @return true if the feature was selected before deselecting it
61
     */
62
    boolean deselect(FeatureReference reference);
63

    
64
    /**
65
     * Selects all values.
66
     * 
67
     * @throws DataException
68
     *             if there is an error selecting all values
69
     */
70
    void selectAll() throws DataException;
71

    
72
    /**
73
     * Deselects all values.
74
     * 
75
     * @throws DataException
76
     *             if there is an error deselecting all values
77
     */
78
    void deselectAll() throws DataException;
79

    
80
    /**
81
     * Returns if a feature is selected.
82
     *
83
     * @param reference
84
     *            to check
85
     * @return if it is selected
86
     */
87
    boolean isSelected(FeatureReference reference);
88

    
89
    /**
90
     * Reverses the selection. Currently selected objects will become the not
91
     * selected ones, so any other object will be a selected one.
92
     */
93
    void reverse();
94

    
95
    /**
96
     * Returns the number of selected values.
97
     *
98
     * @return the number of selected values
99
     */
100
    long getSelectedCount();
101

    
102
    /**
103
     * Returns an unmodifiable Iterator of selected feature references.
104
     *
105
     * @return the iterator of selected feature references
106
     */
107
    Iterator referenceIterator();
108
}