KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > config > window > WindowState


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7
8 package org.gjt.jclasslib.browser.config.window;
9
10 /**
11     Complete serializable state of a <tt>BrowserComponent</tt>.
12
13     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
14     @version $Revision: 1.1 $ $Date: 2003/08/18 08:10:15 $
15 */

16 public class WindowState {
17
18     private String JavaDoc fileName;
19     private BrowserPath browserPath;
20
21     /**
22      * Constructor.
23      * @param fileName the file name for the displayed class.
24      * @param browserPath the browser path that should be selected. May be <tt>null</tt>.
25      */

26     public WindowState(String JavaDoc fileName, BrowserPath browserPath) {
27         this.fileName = fileName;
28         this.browserPath = browserPath;
29     }
30
31     /**
32      * Constructor.
33      * @param fileName the file name for the displayed class.
34      */

35     public WindowState(String JavaDoc fileName) {
36         this.fileName = fileName;
37     }
38
39     /**
40      * Constructor.
41      */

42     public WindowState() {
43     }
44
45     /**
46      * Get the file name of the displayed class.
47      * @return the file name.
48      */

49     public String JavaDoc getFileName() {
50         return fileName;
51     }
52
53     /**
54      * Set the file name of the displayed class.
55      * @param fileName
56      */

57     public void setFileName(String JavaDoc fileName) {
58         this.fileName = fileName;
59     }
60
61     /**
62      * Get the browser path.
63      * @return the browser path.
64      */

65     public BrowserPath getBrowserPath() {
66         return browserPath;
67     }
68
69     /**
70      * Set the browser path.
71      * @param browserPath the browser path.
72      */

73     public void setBrowserPath(BrowserPath browserPath) {
74         this.browserPath = browserPath;
75     }
76
77     public boolean equals(Object JavaDoc other) {
78
79         if (fileName == null || other == null || !(other instanceof WindowState)) {
80             return false;
81         }
82         return fileName.equals(((WindowState)other).fileName);
83     }
84
85     public int hashCode() {
86         return fileName.hashCode();
87     }
88 }
89
Popular Tags