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 / FeatureRules.java @ 40559

History | View | Annotate | Download (2.82 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
package org.gvsig.fmap.dal.feature;
25

    
26
import java.util.Iterator;
27

    
28
/**
29
 * This is a container for FeatureRules.
30
 * Besides getting a rule by index, this structure allows 
31
 * adding a rule, removing a rule, iterating over the rules and copying 
32
 * the whole structure.
33
 *
34
 */
35
public interface FeatureRules {
36

    
37
        /**
38
         * Returns an object given its index.
39
         * 
40
         * @param index
41
         *                         a position in this <code>FeatureRules</code>
42
         * @return
43
         *                 the object found in the given index
44
         */
45
        public Object get(int index);
46

    
47
        /**
48
         * Returns a {@link FeatureRule} given its index.
49
         * 
50
         * @param index
51
         *                         a position in this <code>FeatureRules</code>
52
         * @return
53
         *                 the {@link FeatureRule} found in the given index
54
         */
55
        
56
        public FeatureRule getRule(int index);
57

    
58
        /**
59
         * Adds a new rule to this FeatureRules.
60
         * 
61
         * @param rule
62
         *                         the new rule to add.
63
         * @return
64
         *                 the added rule
65
         */
66
        public FeatureRule add(FeatureRule rule);
67

    
68
        /**
69
         * Returns the number of rules contained in this FeatureRules.
70
         * 
71
         * @return
72
         *                 number of rules in this FeatureRules
73
         */
74
        public int size();
75

    
76
        /**
77
         * Clears this FeatureRules from any rules.
78
         */
79
        public void clear();
80

    
81
        /**
82
         * Removes the rule stored in the given index.
83
         * 
84
         * @param index
85
         *                         index of the rule to remove.
86
         * @return
87
         *                 returns the removed rule
88
         */
89
        public Object remove(int index);
90

    
91
        /**
92
         * Removes the given rule from this FeatureRules.
93
         * 
94
         * @param rule
95
         *                         FeatureRule to remove
96
         * @return
97
         *                 true indicates success, false indicates that it was not found.
98
         */
99
        public boolean remove(FeatureRule rule);
100

    
101
        /**
102
         * Returns an iterator over the available {@link FeatureRule}(s)
103
         * 
104
         * @return
105
         *                 an iterator over the available {@link FeatureRule}(s)
106
         */
107
        public Iterator iterator();
108

    
109
        /**
110
         * Returns a new copy of this FeatureRules.
111
         * 
112
         * @return
113
         *                 a new copy of this FeatureRules.
114
         */
115
        public FeatureRules getCopy();
116

    
117
}