KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > notification > filter > etcl > UnionPositionOperator


1 package org.jacorb.notification.filter.etcl;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1999-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */

23
24 import antlr.Token;
25
26 /**
27  * @author Alphonse Bendt
28  * @version $Id: UnionPositionOperator.java,v 1.5 2004/08/13 11:55:29 alphonse.bendt Exp $
29  */

30
31 public class UnionPositionOperator extends AbstractTCLNode
32 {
33
34     int position_;
35     boolean default_ = false;
36
37     public UnionPositionOperator( Token token )
38     {
39         super( token );
40
41         setName( "UnionPos" );
42         setType( UNION_POS );
43     }
44
45     void setPosition( Double JavaDoc pos )
46     {
47         position_ = pos.intValue();
48         default_ = false;
49     }
50
51     void setDefault()
52     {
53         default_ = true;
54     }
55
56     public boolean isDefault()
57     {
58         return default_;
59     }
60
61     public int getPosition()
62     {
63         return position_;
64     }
65
66     public String JavaDoc toString()
67     {
68         return "(" + ( default_ ? "default" : "" + position_ ) + ")";
69     }
70
71     public void acceptPreOrder( AbstractTCLVisitor visitor ) throws VisitorException
72     {
73         visitor.visitUnionPosition( this );
74
75         if ( hasNextSibling() )
76         {
77             ( ( AbstractTCLNode ) getNextSibling() ).acceptPreOrder( visitor );
78         }
79     }
80
81     public void acceptPostOrder( AbstractTCLVisitor visitor ) throws VisitorException
82     {
83         if ( hasNextSibling() )
84         {
85             ( ( AbstractTCLNode ) getNextSibling() ).acceptPostOrder( visitor );
86         }
87
88         visitor.visitUnionPosition( this );
89     }
90
91     public void acceptInOrder( AbstractTCLVisitor visitor ) throws VisitorException
92     {
93         visitor.visitUnionPosition( this );
94
95         if ( hasNextSibling() )
96         {
97             ( ( AbstractTCLNode ) getNextSibling() ).acceptInOrder( visitor );
98         }
99     }
100
101 } // UnionPositionOperator
102
Popular Tags