Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / feature / FeatureReferenceSelection.java @ 24079

History | View | Annotate | Download (2.9 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.data.feature;
28

    
29
import java.util.Iterator;
30

    
31
import org.gvsig.fmap.data.DataSelection;
32
import org.gvsig.tools.observer.Observable;
33
import org.gvsig.tools.observer.Observer;
34
import org.gvsig.tools.persistence.Persistent;
35

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

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

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

    
63
    /**
64
     * Selects all values.
65
     */
66
    void selectAll();
67

    
68
    /**
69
     * Deselects all values.
70
     */
71
    void deselectAll();
72

    
73
    /**
74
     * Returns if a feature is selected.
75
     *
76
     * @param reference
77
     *            to check
78
     * @return if it is selected
79
     */
80
    boolean isSelected(FeatureReference reference);
81

    
82
    /**
83
     * Reverses the selection. Currently selected objects will become the not
84
     * selected ones, so any other object will be a selected one.
85
     */
86
    void reverse();
87

    
88
    /**
89
     * Returns the number of selected values.
90
     *
91
     * @return the number of selected values
92
     */
93
    long getSelectedCount();
94

    
95
    /**
96
     * Returns an unmodifiable Iterator of selected feature references.
97
     *
98
     * @return the iterator of selected feature references
99
     */
100
    Iterator referenceIterator();
101
}