001/*
002 * Copyright (c) 2000 World Wide Web Consortium,
003 * (Massachusetts Institute of Technology, Institut National de
004 * Recherche en Informatique et en Automatique, Keio University). All
005 * Rights Reserved. This program is distributed under the W3C's Software
006 * Intellectual Property License. This program is distributed in the
007 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009 * PURPOSE.
010 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011 *
012 * $Id: DescendantSelectorImpl.java,v 1.1.1.1 2006/04/23 14:51:53 taqua Exp $
013 */
014package org.w3c.flute.parser.selectors;
015
016import org.w3c.css.sac.DescendantSelector;
017import org.w3c.css.sac.Selector;
018import org.w3c.css.sac.SimpleSelector;
019
020/**
021 * @version $Revision: 1.1.1.1 $
022 * @author  Philippe Le Hegaret
023 */
024public class DescendantSelectorImpl implements DescendantSelector {
025
026    Selector       parent;
027    SimpleSelector simpleSelector;
028
029    /**
030     * An integer indicating the type of <code>Selector</code>
031     */
032    public short getSelectorType() {
033        return Selector.SAC_DESCENDANT_SELECTOR;
034    }
035
036    /**
037     * Creates a new DescendantSelectorImpl
038     */
039    public DescendantSelectorImpl(Selector parent, SimpleSelector simpleSelector) {
040        this.parent = parent;
041        this.simpleSelector = simpleSelector;
042    }
043    
044        
045    /**
046     * Returns the parent selector.
047     */    
048    public Selector getAncestorSelector() {
049        return parent;
050    }
051
052    /*
053     * Returns the simple selector.
054     */    
055    public SimpleSelector getSimpleSelector() {
056        return simpleSelector;
057    }
058}