comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItemAttribute.java @ 1345:92074508a387

Added documentation. flys-client/trunk@3003 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 18 Oct 2011 12:33:23 +0000
parents 974c6b3700de
children
comparison
equal deleted inserted replaced
1344:51d4b51a51ed 1345:92074508a387
9 /** 9 /**
10 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> 10 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
11 */ 11 */
12 public class CollectionItemAttribute implements Serializable { 12 public class CollectionItemAttribute implements Serializable {
13 13
14 /** The list of styles. */
14 protected List<Style> styles; 15 protected List<Style> styles;
15 16
17 /** The artifact. */
16 protected String artifact; 18 protected String artifact;
17 19
20
21 /**
22 * Creates a new CollectionItem Attribute.
23 */
18 public CollectionItemAttribute() { 24 public CollectionItemAttribute() {
19 styles = new ArrayList<Style>(); 25 styles = new ArrayList<Style>();
20 } 26 }
21 27
28
29 /**
30 * Append a new Style.
31 * @param style The style.
32 */
22 public void appendStyle (Style style) { 33 public void appendStyle (Style style) {
23 this.styles.add(style); 34 this.styles.add(style);
24 } 35 }
25 36
37
38 /**
39 * Remove a style from the attributes.
40 * @param name The style name.
41 */
26 public void removeStyle (String name) { 42 public void removeStyle (String name) {
27 for (int i = 0; i < styles.size(); i++) { 43 for (int i = 0; i < styles.size(); i++) {
28 if (styles.get(i).getName().equals(name)) { 44 if (styles.get(i).getName().equals(name)) {
29 styles.remove(i); 45 styles.remove(i);
30 } 46 }
31 } 47 }
32 } 48 }
33 49
50
51 /**
52 * Get a style from the collection item.
53 * @param facet The facet this style belongs to.
54 * @param index The style index.
55 *
56 * @return The selected style or 'null'.
57 */
34 public Style getStyle(String facet, int index) { 58 public Style getStyle(String facet, int index) {
35 for (int i = 0; i < styles.size(); i++) { 59 for (int i = 0; i < styles.size(); i++) {
36 Style tmp = styles.get(i); 60 Style tmp = styles.get(i);
37 if (tmp.getFacet().equals(facet) && 61 if (tmp.getFacet().equals(facet) &&
38 tmp.getIndex() == index) { 62 tmp.getIndex() == index) {
40 } 64 }
41 } 65 }
42 return null; 66 return null;
43 } 67 }
44 68
69
70 /**
71 * Get the style at a postion.
72 * @param i The position index.
73 *
74 * @return The selected style.
75 */
45 public Style getStyle(int i) { 76 public Style getStyle(int i) {
46 return styles.get(i); 77 return styles.get(i);
47 } 78 }
48 79
80
81 /**
82 * Get the number of styles.
83 * @return The number of styles.
84 */
49 public int getNumStyles() { 85 public int getNumStyles() {
50 return styles.size(); 86 return styles.size();
51 } 87 }
52 88
89
90 /**
91 * Set the current artifact.
92 * @param The artifact uuid.
93 */
53 public void setArtifact(String artifact) { 94 public void setArtifact(String artifact) {
54 this.artifact = artifact; 95 this.artifact = artifact;
55 } 96 }
56 97
98
99 /**
100 * Get the associated artifact.
101 * @return The artifact.
102 */
57 public String getArtifact () { 103 public String getArtifact () {
58 return this.artifact; 104 return this.artifact;
59 } 105 }
60 } 106 }

http://dive4elements.wald.intevation.org