Source code: com/tripi/asp/NullNode.java
1 /**
2 * ArrowHead ASP Server
3 * This is a source file for the ArrowHead ASP Server - an 100% Java
4 * VBScript interpreter and ASP server.
5 *
6 * For more information, see http://www.tripi.com/arrowhead
7 *
8 * Copyright (C) 2002 Terence Haddock
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25 package com.tripi.asp;
26
27 /**
28 * NullNode represents the NULL value in Asp code.
29 *
30 * @author Terence Haddock
31 * @version 0.9
32 */
33 public class NullNode extends DefaultNode
34 {
35 /**
36 * Constructor
37 */
38 public NullNode()
39 {
40 }
41
42 /**
43 * Dumps the string representation of this node.
44 * @see DefaultNode#dump
45 */
46 public void dump()
47 {
48 System.out.print("NULL");
49 }
50
51 /**
52 * This function always returns true if it is being compared to a null
53 * value, or if the other value is a NullNode object.
54 * @param obj object to compare to
55 * @return <b>true</b> if the objects are equals, <b>false</b> otherwise.
56 */
57 final public boolean equals(Object obj)
58 {
59 if (obj == null || obj instanceof NullNode)
60 return true;
61 return false;
62 };
63
64 /**
65 * NullNodes all have the hashcode of zero.
66 * @return always zero
67 */
68 public int hashCode()
69 {
70 return 0;
71 };
72 };
73