KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > steadystate > css > parser > selectors > DirectAdjacentSelectorImpl


1 /*
2  * DirectAdjacentSelectorImpl.java
3  *
4  * Steady State CSS2 Parser
5  *
6  * Copyright (C) 1999, 2002 Steady State Software Ltd. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser 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  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  * To contact the authors of the library, write to Steady State Software Ltd.,
23  * 49 Littleworth, Wing, Buckinghamshire, LU7 0JX, England
24  *
25  * http://www.steadystate.com/css/
26  * mailto:css@steadystate.co.uk
27  *
28  * $Id: DirectAdjacentSelectorImpl.java,v 1.1.1.1 2003/12/28 21:23:41 davidsch Exp $
29  */

30
31 package com.steadystate.css.parser.selectors;
32
33 import java.io.Serializable JavaDoc;
34 import org.w3c.css.sac.*;
35
36 public class DirectAdjacentSelectorImpl implements SiblingSelector, Serializable JavaDoc {
37
38     private short _nodeType;
39     private Selector _child;
40     private SimpleSelector _directAdjacent;
41
42     public DirectAdjacentSelectorImpl(short nodeType, Selector child, SimpleSelector directAdjacent) {
43         _nodeType = nodeType;
44         _child = child;
45         _directAdjacent = directAdjacent;
46     }
47
48     public short getNodeType() {
49         return _nodeType;
50     }
51     
52     public short getSelectorType() {
53         return Selector.SAC_DIRECT_ADJACENT_SELECTOR;
54     }
55
56     public Selector getSelector() {
57         return _child;
58     }
59
60     public SimpleSelector getSiblingSelector() {
61         return _directAdjacent;
62     }
63     
64     public String JavaDoc toString() {
65         return _child.toString() + " + " + _directAdjacent.toString();
66     }
67 }
68
Popular Tags