Class CSSResourceSet

java.lang.Object
com.helger.photon.app.html.CSSResourceSet
All Implemented Interfaces:
com.helger.commons.collection.impl.ICommonsIterable<com.helger.html.resource.css.ICSSPathProvider>, IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>, Iterable<com.helger.html.resource.css.ICSSPathProvider>

@ThreadSafe public class CSSResourceSet extends Object implements IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
This class keeps track of all the CSS files that must be included for a single request, so that the controls are working properly.
Author:
Philip Helger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    CSSResourceSet(com.helger.html.resource.css.ICSSPathProvider... aOther)
     
     
    CSSResourceSet(Collection<? extends com.helger.html.resource.css.ICSSPathProvider> aOther)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.helger.commons.state.EChange
    addItem(int nIndex, com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
    Add an item at the specified index
    com.helger.commons.state.EChange
    addItem(com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
    Add an item
    com.helger.commons.state.EChange
    addItems(int nIndex, IWebResourceSet<? extends com.helger.html.resource.css.ICSSPathProvider> aItems)
    Add all items from another list at the specified index.
    com.helger.commons.state.EChange
    addItems(IWebResourceSet<? extends com.helger.html.resource.css.ICSSPathProvider> aItems)
    Add all items from another list.
    boolean
     
    com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.css.ICSSPathProvider>
     
    void
    getAllItems(Collection<? super com.helger.html.resource.css.ICSSPathProvider> aTarget)
    Add all items to the provided target container.
    int
     
    int
     
    boolean
     
    boolean
     
    boolean
     
    Iterator<com.helger.html.resource.css.ICSSPathProvider>
     
    void
    Call this method to mark the resource set as "collected for further processing".
    com.helger.commons.state.EChange
    Remove all items.
    com.helger.commons.state.EChange
    removeItem(com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
    Unregister an existing item
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.helger.commons.collection.impl.ICommonsIterable

    containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCount

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • CSSResourceSet

      public CSSResourceSet()
    • CSSResourceSet

      public CSSResourceSet(@Nonnull CSSResourceSet aOther)
    • CSSResourceSet

      public CSSResourceSet(@Nonnull Collection<? extends com.helger.html.resource.css.ICSSPathProvider> aOther)
    • CSSResourceSet

      public CSSResourceSet(@Nonnull com.helger.html.resource.css.ICSSPathProvider... aOther)
  • Method Details

    • addItem

      @Nonnull public com.helger.commons.state.EChange addItem(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Description copied from interface: IWebResourceSet
      Add an item
      Specified by:
      addItem in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      aCSSPathProvider - The item to add. May not be null.
      Returns:
      EChange
    • addItem

      @Nonnull public com.helger.commons.state.EChange addItem(int nIndex, @Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Description copied from interface: IWebResourceSet
      Add an item at the specified index
      Specified by:
      addItem in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      nIndex - The index to be used. If the value is < 0 the value is ignored and item is appended.
      aCSSPathProvider - The item to add. May not be null.
      Returns:
      EChange
    • addItems

      @Nonnull public com.helger.commons.state.EChange addItems(@Nonnull IWebResourceSet<? extends com.helger.html.resource.css.ICSSPathProvider> aItems)
      Description copied from interface: IWebResourceSet
      Add all items from another list.
      Specified by:
      addItems in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      aItems - The items to be added. May not be null.
      Returns:
      EChange
    • addItems

      @Nonnull public com.helger.commons.state.EChange addItems(int nIndex, @Nonnull IWebResourceSet<? extends com.helger.html.resource.css.ICSSPathProvider> aItems)
      Description copied from interface: IWebResourceSet
      Add all items from another list at the specified index.
      Specified by:
      addItems in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      nIndex - The index to be used. If the value is < 0 the value is ignored and item is appended.
      aItems - The items to be added. May not be null.
      Returns:
      EChange
    • removeItem

      @Nonnull public com.helger.commons.state.EChange removeItem(@Nonnull com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider)
      Description copied from interface: IWebResourceSet
      Unregister an existing item
      Specified by:
      removeItem in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      aCSSPathProvider - The item to be removed. May not be null.
      Returns:
      EChange
    • removeAll

      @Nonnull public com.helger.commons.state.EChange removeAll()
      Description copied from interface: IWebResourceSet
      Remove all items.
      Specified by:
      removeAll in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Returns:
      EChange
    • getAllItems

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.css.ICSSPathProvider> getAllItems()
      Specified by:
      getAllItems in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Returns:
      A non-null set with all items.
    • getAllItems

      public void getAllItems(@Nonnull Collection<? super com.helger.html.resource.css.ICSSPathProvider> aTarget)
      Description copied from interface: IWebResourceSet
      Add all items to the provided target container.
      Specified by:
      getAllItems in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Parameters:
      aTarget - The container to add the items to. May not be null.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Returns:
      true if no item is contained
    • isNotEmpty

      public boolean isNotEmpty()
      Specified by:
      isNotEmpty in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
      Returns:
      true if at least a single item is contained
    • getCount

      @Nonnegative public int getCount()
      Specified by:
      getCount in interface com.helger.commons.collection.impl.ICommonsIterable<com.helger.html.resource.css.ICSSPathProvider>
    • iterator

      @Nonnull public Iterator<com.helger.html.resource.css.ICSSPathProvider> iterator()
      Specified by:
      iterator in interface Iterable<com.helger.html.resource.css.ICSSPathProvider>
    • isCollected

      public boolean isCollected()
    • markAsCollected

      public void markAsCollected()
      Description copied from interface: IWebResourceSet
      Call this method to mark the resource set as "collected for further processing". This state may be used to determine additions afterwards which will potentially not be gathered.
      Specified by:
      markAsCollected in interface IWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object