Source code: com/RuntimeCollective/webapps/bean/Crumb.java
1 /* $Header: /home/CVS/rjp/src/com/RuntimeCollective/webapps/bean/Crumb.java,v 1.3 2003/09/30 15:13:09 joe Exp $
2 * $Revision: 1.3 $
3 * $Date: 2003/09/30 15:13:09 $
4 *
5 * ====================================================================
6 *
7 * Josephine : http://www.runtime-collective.com/josephine/index.html
8 *
9 * Copyright (C) 2003 Runtime Collective
10 *
11 * This product includes software developed by the
12 * Apache Software Foundation (http://www.apache.org/).
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29
30 package com.RuntimeCollective.webapps.bean;
31
32 /**
33 * A single crumb of the crumb trail.
34 *
35 * @author Joe Faith
36 * @version $Id: Crumb.java,v 1.3 2003/09/30 15:13:09 joe Exp $
37 */
38 public class Crumb {
39
40 // == Constructor ============================================
41
42 public Crumb( String label, String forward ) {
43 this.label = label;
44 this.forward = forward;
45 }
46
47 // == Properties ===================================================
48
49 /** The label of this crumb. */
50 protected String label = "";
51 /** Get the label of this crumb. */
52 public String getLabel() { return this.label; }
53 /** Set the label of this crumb. */
54 public void setLabel(String label) { this.label = label; }
55
56 /** The name of the action forward that this crumb should take the user to. */
57 protected String forward = "";
58 /** Get the name of the action forward that this crumb should take the user to. */
59 public String getForward() { return this.forward; }
60 /** Set the name of the action forward that this crumb should take the user to. */
61 public void setForward(String forward) { this.forward = forward; }
62
63
64 // == Other methods =======================================
65
66 /** Override the equals method. Two crumbs are considered equal if they have identical forwards.
67 */
68 public boolean equals(Object other) {
69 if ( other==null ) return false;
70 Crumb otherCrumb = (Crumb) other;
71 return ( this.forward.equals( otherCrumb.forward ) );
72 }
73
74 public String toString() { return "label="+label+", forward="+forward; }
75
76 }
77
78
79
80
81
82