View Javadoc

1   /*
2   * E-nspire Gemini.
3   * A Java and AspectJ based framework that enables transparent 
4   * bidirectional relationships between Plain Old Java Objects.
5   * 
6   * Copyright (C) 2005 Dragan Djuric
7   * 
8   * This program is free software; you can redistribute it and/or
9   * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  * 
22  * Contact the author at dragand@dev.java.net
23  */
24  package com.enspire.gemini.commands;
25  
26  import java.util.List;
27  
28  import com.enspire.gemini.BidirectionalProperty;
29  
30  /***
31   * A command that is tied to a specific <code>List</code>.
32   * @author Dragan Djuric <dragand@dev.java.net>
33   * @since 1.0
34   */
35  public abstract class BidirectionalListCommand extends
36          BidirectionalPropertyCommand {
37  
38      private List list;
39  
40      /***
41       * Creates a command and sets its dependencies.
42       * @param bidirectionalProperty
43       * @param list
44       */
45      public BidirectionalListCommand(
46              BidirectionalProperty bidirectionalProperty, List list){
47          super(bidirectionalProperty);
48          this.list = list;
49      }
50  
51      /***
52       * Sets the unidirectional list (wrapped bu this command's 
53       * bidirectional collection) that this command is tied to.
54       * @return the unidirectional list
55       */
56      public List getList() {
57          return this.list;
58      }
59  
60      /***
61       * Sets the unidirectional collection (wrapped bu this command's 
62       * bidirectional collection) that this command is tied to.
63       * @param list an unidirectional collection to set.
64       */
65      public void setList(List list) {
66          this.list = list;
67      }
68  
69  }