Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/sbugs/logic/state/Transition.java


1   /*
2    * This program is free software; you can redistribute it and/or
3    * modify it under the terms of the GNU General Public License
4    * as published by the Free Software Foundation;  version 2 only.
5     *
6    * This program is distributed in the hope that it will be useful,
7    * but WITHOUT ANY WARRANTY; without even the implied warranty of
8    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9    * GNU General Public License for more details.
10   *
11   * You should have received a copy of the GNU General Public License
12   * along with this program; if not, write to the Free Software
13   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
14   */
15  package org.sbugs.logic.state;
16  
17  import java.util.*;
18  
19  /**
20  This class is located here, instead of in org.sbugs.model, because it is really
21  not part of the domain model - it purely has to do w/ the logic of handling
22  state transitions.
23  */
24  public class Transition
25  {
26    private String description;
27    private String action;
28    
29    private int id;
30    
31    //arbitrary guess at a good initial size
32    private List handlerList = new ArrayList( 2 );
33    
34    public Transition( int id, String action, String description )
35    {
36      setId( id );
37      setAction( action );
38      setDescription( description );
39    }
40    
41    public int getId()
42    {
43      return id;
44    }
45    
46    public void setId( int idParam )
47    {
48      id = idParam;
49    }
50    
51    public String getDescription()
52    {
53      return description;
54    }
55    
56    public void setDescription( String desc )
57    {
58      description = desc;
59    }
60    
61    public String getAction()
62    {
63      return action;
64    }
65    
66    public void setAction( String actionParam )
67    {
68      action = actionParam;
69    }
70    
71    public List getHandlerList()
72    {
73      return handlerList;
74    }
75    
76    /**
77    Adds the given handler to the end of the handler list.
78    */
79    public void addHandler( TransitionHandler handler )
80    {
81      handlerList.add( handler );
82    }
83  }