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

History | View | Annotate | Download (3.14 KB)

1 40559 jjdelcerro
/**
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 40435 jjdelcerro
package org.gvsig.fmap.dal.feature;
25
26
import java.util.Iterator;
27 44871 jjdelcerro
import org.gvsig.expressionevaluator.Expression;
28
import org.gvsig.tools.persistence.Persistent;
29 40435 jjdelcerro
30
/**
31
 * This is a container for FeatureRules.
32
 * Besides getting a rule by index, this structure allows
33
 * adding a rule, removing a rule, iterating over the rules and copying
34
 * the whole structure.
35
 *
36
 */
37 44871 jjdelcerro
public interface FeatureRules extends Iterable<FeatureRule>, Persistent {
38 40435 jjdelcerro
39
        /**
40
         * Returns an object given its index.
41
         *
42
         * @param index
43
         *                         a position in this <code>FeatureRules</code>
44
         * @return
45
         *                 the object found in the given index
46
         */
47 44871 jjdelcerro
        public FeatureRule get(int index);
48 40435 jjdelcerro
49
        /**
50
         * Returns a {@link FeatureRule} given its index.
51
         *
52
         * @param index
53
         *                         a position in this <code>FeatureRules</code>
54
         * @return
55
         *                 the {@link FeatureRule} found in the given index
56
         */
57
58
        public FeatureRule getRule(int index);
59
60
        /**
61
         * Adds a new rule to this FeatureRules.
62
         *
63
         * @param rule
64
         *                         the new rule to add.
65
         * @return
66 43020 jjdelcerro
         *
67 40435 jjdelcerro
         */
68 43020 jjdelcerro
        public boolean add(FeatureRule rule);
69 40435 jjdelcerro
70 44871 jjdelcerro
  public boolean add(String name, String description, boolean checkAtUpdate,
71
                        boolean checkAtFinishEdition, Expression expression);
72
73 40435 jjdelcerro
        /**
74
         * Returns the number of rules contained in this FeatureRules.
75
         *
76
         * @return
77
         *                 number of rules in this FeatureRules
78
         */
79
        public int size();
80
81 44871 jjdelcerro
  public boolean isEmpty();
82 43643 jjdelcerro
83 40435 jjdelcerro
        /**
84
         * Clears this FeatureRules from any rules.
85
         */
86
        public void clear();
87
88
        /**
89
         * Removes the rule stored in the given index.
90
         *
91
         * @param index
92
         *                         index of the rule to remove.
93
         * @return
94
         *                 returns the removed rule
95
         */
96 44871 jjdelcerro
        public FeatureRule remove(int index);
97 40435 jjdelcerro
98
        /**
99
         * Removes the given rule from this FeatureRules.
100
         *
101
         * @param rule
102
         *                         FeatureRule to remove
103
         * @return
104
         *                 true indicates success, false indicates that it was not found.
105
         */
106
        public boolean remove(FeatureRule rule);
107
108
        /**
109
         * Returns an iterator over the available {@link FeatureRule}(s)
110
         *
111
         * @return
112
         *                 an iterator over the available {@link FeatureRule}(s)
113
         */
114 43020 jjdelcerro
        @Override
115
        public Iterator<FeatureRule> iterator();
116 40435 jjdelcerro
117
        /**
118
         * Returns a new copy of this FeatureRules.
119
         *
120
         * @return
121
         *                 a new copy of this FeatureRules.
122
         */
123
        public FeatureRules getCopy();
124
125
}