1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package com.enspire.gemini.commands;
25
26 import java.util.Collection;
27
28 import com.enspire.gemini.BidirectionalProperty;
29
30 /***
31 * A command that is tied to a specific <code>Collection</code>.
32 * @author Dragan Djuric <dragand@dev.java.net>
33 * @since 1.0
34 */
35 public abstract class BidirectionalCollectionCommand extends
36 BidirectionalPropertyCommand {
37
38 private Collection collection;
39
40 /***
41 * Creates a command and sets its dependencies.
42 * @param bidirectionalProperty the bidirectional collection that this command is tied to
43 * @param collection
44 */
45 public BidirectionalCollectionCommand(
46 BidirectionalProperty bidirectionalProperty, Collection collection){
47 super(bidirectionalProperty);
48 this.collection = collection;
49 }
50
51 /***
52 * Gets the unidirectional collection (wrapped bu this command's
53 * bidirectional collection) that this command is tied to.
54 * @return Returns the unidirectional collection
55 */
56 public Collection getCollection() {
57 return this.collection;
58 }
59
60 /***
61 * Sets the unidirectional collection (wrapped bu this command's
62 * bidirectional collection) that this command is tied to.
63 * @param collection an unidirectional collection to set.
64 */
65 public void setCollection(Collection collection) {
66 this.collection = collection;
67 }
68
69 }