01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2004-2007 Robert Grimm
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * version 2 as published by the Free Software Foundation.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17: * USA.
18: */
19: package xtc.parser;
20:
21: import java.io.IOException;
22:
23: /**
24: * A voided element.
25: *
26: * @author Robert Grimm
27: * @version $Revision: 1.5 $
28: */
29: public class VoidedElement extends UnaryOperator {
30:
31: /**
32: * Create a new voided element.
33: *
34: * @param element The voided element.
35: */
36: public VoidedElement(Element element) {
37: super (element);
38: }
39:
40: public Tag tag() {
41: return Tag.VOIDED;
42: }
43:
44: public int hashCode() {
45: return element.hashCode();
46: }
47:
48: public boolean equals(Object o) {
49: if (this == o)
50: return true;
51: if (!(o instanceof VoidedElement))
52: return false;
53: VoidedElement other = (VoidedElement) o;
54: return element.equals(other.element);
55: }
56:
57: public void write(Appendable out) throws IOException {
58: out.append("void:");
59: element.write(out);
60: }
61:
62: }
|