Source for org.w3c.flute.parser.selectors.DescendantSelectorImpl

   1: /*
   2:  * Copyright (c) 2000 World Wide Web Consortium,
   3:  * (Massachusetts Institute of Technology, Institut National de
   4:  * Recherche en Informatique et en Automatique, Keio University). All
   5:  * Rights Reserved. This program is distributed under the W3C's Software
   6:  * Intellectual Property License. This program is distributed in the
   7:  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
   8:  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   9:  * PURPOSE.
  10:  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11:  *
  12:  * $Id: DescendantSelectorImpl.java,v 1.1.1.1 2006/04/23 14:51:53 taqua Exp $
  13:  */
  14: package org.w3c.flute.parser.selectors;
  15: 
  16: import org.w3c.css.sac.DescendantSelector;
  17: import org.w3c.css.sac.Selector;
  18: import org.w3c.css.sac.SimpleSelector;
  19: 
  20: /**
  21:  * @version $Revision: 1.1.1.1 $
  22:  * @author  Philippe Le Hegaret
  23:  */
  24: public class DescendantSelectorImpl implements DescendantSelector {
  25: 
  26:     Selector       parent;
  27:     SimpleSelector simpleSelector;
  28: 
  29:     /**
  30:      * An integer indicating the type of <code>Selector</code>
  31:      */
  32:     public short getSelectorType() {
  33:     return Selector.SAC_DESCENDANT_SELECTOR;
  34:     }
  35: 
  36:     /**
  37:      * Creates a new DescendantSelectorImpl
  38:      */
  39:     public DescendantSelectorImpl(Selector parent, SimpleSelector simpleSelector) {
  40:         this.parent = parent;
  41:     this.simpleSelector = simpleSelector;
  42:     }
  43:     
  44:         
  45:     /**
  46:      * Returns the parent selector.
  47:      */    
  48:     public Selector getAncestorSelector() {
  49:     return parent;
  50:     }
  51: 
  52:     /*
  53:      * Returns the simple selector.
  54:      */    
  55:     public SimpleSelector getSimpleSelector() {
  56:     return simpleSelector;
  57:     }
  58: }