Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureReferenceSelection.java @ 40559

History | View | Annotate | Download (3.32 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
 * AUTHORS (In addition to CIT):
26
 * 2008 {DiSiD Technologies}  {Implement data selection}
27
 */
28
package org.gvsig.fmap.dal.feature;
29

    
30
import java.util.Iterator;
31

    
32
import org.gvsig.fmap.dal.DataSelection;
33
import org.gvsig.fmap.dal.exception.DataException;
34
import org.gvsig.tools.observer.ComplexObservable;
35
import org.gvsig.tools.observer.Observer;
36
import org.gvsig.tools.observer.WeakReferencingObservable;
37
import org.gvsig.tools.persistence.Persistent;
38

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

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

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

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

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

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

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

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

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