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 @ 44086
History | View | Annotate | Download (2.9 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 | |||
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 | 43020 | jjdelcerro | public interface FeatureRules extends Iterable<FeatureRule> { |
36 | 40435 | jjdelcerro | |
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 | 43020 | jjdelcerro | *
|
65 | 40435 | jjdelcerro | */
|
66 | 43020 | jjdelcerro | public boolean add(FeatureRule rule); |
67 | 40435 | jjdelcerro | |
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 | 43643 | jjdelcerro | public boolean isEmpty(); |
77 | |||
78 | 40435 | jjdelcerro | /**
|
79 | * Clears this FeatureRules from any rules.
|
||
80 | */
|
||
81 | public void clear(); |
||
82 | |||
83 | /**
|
||
84 | * Removes the rule stored in the given index.
|
||
85 | *
|
||
86 | * @param index
|
||
87 | * index of the rule to remove.
|
||
88 | * @return
|
||
89 | * returns the removed rule
|
||
90 | */
|
||
91 | public Object remove(int index); |
||
92 | |||
93 | /**
|
||
94 | * Removes the given rule from this FeatureRules.
|
||
95 | *
|
||
96 | * @param rule
|
||
97 | * FeatureRule to remove
|
||
98 | * @return
|
||
99 | * true indicates success, false indicates that it was not found.
|
||
100 | */
|
||
101 | public boolean remove(FeatureRule rule); |
||
102 | |||
103 | /**
|
||
104 | * Returns an iterator over the available {@link FeatureRule}(s)
|
||
105 | *
|
||
106 | * @return
|
||
107 | * an iterator over the available {@link FeatureRule}(s)
|
||
108 | */
|
||
109 | 43020 | jjdelcerro | @Override
|
110 | public Iterator<FeatureRule> iterator(); |
||
111 | 40435 | jjdelcerro | |
112 | /**
|
||
113 | * Returns a new copy of this FeatureRules.
|
||
114 | *
|
||
115 | * @return
|
||
116 | * a new copy of this FeatureRules.
|
||
117 | */
|
||
118 | public FeatureRules getCopy();
|
||
119 | |||
120 | } |