com.vaadin.sass.internal.selector
Class SimpleSelectorSequence

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<SimpleSelector>
              extended by com.vaadin.sass.internal.selector.SimpleSelectorSequence
All Implemented Interfaces:
SelectorSegment, Serializable, Cloneable, Iterable<SimpleSelector>, Collection<SimpleSelector>, List<SimpleSelector>, RandomAccess

public class SimpleSelectorSequence
extends ArrayList<SimpleSelector>
implements SelectorSegment

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SimpleSelectorSequence()
           
SimpleSelectorSequence(Collection<SimpleSelector> seq)
           
SimpleSelectorSequence(SimpleSelectorSequence prior, SimpleSelector simpleSelector)
           
SimpleSelectorSequence(SimpleSelector simpleSelector, SimpleSelectorSequence tail)
           
 
Method Summary
 SimpleSelectorSequence difference(SimpleSelectorSequence that)
          Returns this \ that, set-theoretically
 SimpleSelectorSequence getNonTypeSelectors()
           
 TypeSelector getTypeSelector()
           
 boolean isPlaceholder()
          Returns whether this selector contains a placeholder (%-selector)
 SimpleSelectorSequence replaceVariable(VariableNode var)
           
 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.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

SimpleSelectorSequence

public SimpleSelectorSequence()

SimpleSelectorSequence

public SimpleSelectorSequence(Collection<SimpleSelector> seq)

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.


replaceVariable

public SimpleSelectorSequence replaceVariable(VariableNode var)

toString

public String toString()
Overrides:
toString in class AbstractCollection<SimpleSelector>

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)



Copyright © 2013–2014 Vaadin. All rights reserved.