com.vaadin.sass.internal.selector
Class SimpleSelectorSequence

java.lang.Object
  extended by com.vaadin.sass.internal.selector.SimpleSelectorSequence
All Implemented Interfaces:
SelectorSegment, Serializable

public class SimpleSelectorSequence
extends Object
implements SelectorSegment

Immutable simple list of simple selector segments (e.g. "a.foo.bar" consists of "a", ".foo" and ".bar"). For full selectors (e.g. "a.foo .bar") see Selector.

See Also:
Serialized Form

Constructor Summary
SimpleSelectorSequence()
           
SimpleSelectorSequence(List<SimpleSelector> seq)
          Constructs a SimpleSelectorSequence from a list of simple selectors.
SimpleSelectorSequence(SimpleSelectorSequence prior, SimpleSelector simpleSelector)
           
SimpleSelectorSequence(SimpleSelector simpleSelector, SimpleSelectorSequence tail)
           
 
Method Summary
 SimpleSelectorSequence difference(SimpleSelectorSequence that)
          Returns this \ that, set-theoretically
 boolean equals(Object obj)
           
 SimpleSelectorSequence getNonTypeSelectors()
           
 TypeSelector getTypeSelector()
           
 int hashCode()
           
 boolean isPlaceholder()
          Returns whether this selector contains a placeholder (%-selector)
 SimpleSelectorSequence replaceVariables(ScssContext context)
           
 boolean subsumes(SimpleSelectorSequence that)
          Returns whether this simple selector sequence matches (at least) all elements that simple selector sequence matches.
 String toString()
           
 SimpleSelectorSequence unify(SimpleSelectorSequence extend, SimpleSelectorSequence extending)
          Tries to unify this with the "extending" simple selector sequence by extend.
 SimpleSelectorSequence union(SimpleSelectorSequence that)
          Returns this followed by all elements in that but not in this
 SimpleSelectorSequence withoutTypeSelector()
          Returns the same sequence, but without type selector if one was present.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleSelectorSequence

public SimpleSelectorSequence()

SimpleSelectorSequence

public SimpleSelectorSequence(List<SimpleSelector> seq)
Constructs a SimpleSelectorSequence from a list of simple selectors.

Parameters:
seq - list of simple selectors

SimpleSelectorSequence

public SimpleSelectorSequence(SimpleSelectorSequence prior,
                              SimpleSelector simpleSelector)

SimpleSelectorSequence

public SimpleSelectorSequence(SimpleSelector simpleSelector,
                              SimpleSelectorSequence tail)
Method Detail

difference

public SimpleSelectorSequence difference(SimpleSelectorSequence that)
Returns this \ that, set-theoretically


union

public SimpleSelectorSequence union(SimpleSelectorSequence that)
Returns this followed by all elements in that but not in this


unify

public SimpleSelectorSequence unify(SimpleSelectorSequence extend,
                                    SimpleSelectorSequence extending)
Tries to unify this with the "extending" simple selector sequence by extend. The simple selector sequence extend is a unifier only if it subsumes (is more general than) this selector. The result is this selector minus simple selectors in extend plus simple selectors in extending. Example: this = a.foo.bar, extend = a.foo, extending = b.baz result = b.bar.baz Note: if extend lacks a type selector, this and extending must share the same type selector.


getTypeSelector

public TypeSelector getTypeSelector()

getNonTypeSelectors

public SimpleSelectorSequence getNonTypeSelectors()

subsumes

public boolean subsumes(SimpleSelectorSequence that)
Returns whether this simple selector sequence matches (at least) all elements that simple selector sequence matches. True if the simple selectors in this is a subset of those in that. If type selector is universal in this, compare other kinds of simple selectors only.


replaceVariables

public SimpleSelectorSequence replaceVariables(ScssContext context)

toString

public String toString()
Overrides:
toString in class Object

withoutTypeSelector

public SimpleSelectorSequence withoutTypeSelector()
Returns the same sequence, but without type selector if one was present.


isPlaceholder

public boolean isPlaceholder()
Returns whether this selector contains a placeholder (%-selector)


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013–2015 Vaadin. All rights reserved.