Package com.helger.photon.app.html
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
ConstructorDescriptionCSSResourceSet
(com.helger.html.resource.css.ICSSPathProvider... aOther) CSSResourceSet
(CSSResourceSet aOther) CSSResourceSet
(Collection<? extends com.helger.html.resource.css.ICSSPathProvider> aOther) -
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.state.EChange
addItem
(int nIndex, com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider) Add an item at the specified indexcom.helger.commons.state.EChange
addItem
(com.helger.html.resource.css.ICSSPathProvider aCSSPathProvider) Add an itemcom.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
getCount()
int
hashCode()
boolean
boolean
isEmpty()
boolean
Iterator<com.helger.html.resource.css.ICSSPathProvider>
iterator()
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 itemtoString()
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
-
CSSResourceSet
public CSSResourceSet(@Nonnull Collection<? extends com.helger.html.resource.css.ICSSPathProvider> aOther) -
CSSResourceSet
-
-
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 interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Parameters:
aCSSPathProvider
- The item to add. May not benull
.- 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 interfaceIWebResourceSet<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 benull
.- 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 interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Parameters:
aItems
- The items to be added. May not benull
.- 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 interfaceIWebResourceSet<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 benull
.- 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 interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Parameters:
aCSSPathProvider
- The item to be removed. May not benull
.- Returns:
EChange
-
removeAll
Description copied from interface:IWebResourceSet
Remove all items.- Specified by:
removeAll
in interfaceIWebResourceSet<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 interfaceIWebResourceSet<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 interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Parameters:
aTarget
- The container to add the items to. May not benull
.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Returns:
true
if no item is contained
-
isNotEmpty
public boolean isNotEmpty()- Specified by:
isNotEmpty
in interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
- Returns:
true
if at least a single item is contained
-
getCount
- Specified by:
getCount
in interfacecom.helger.commons.collection.impl.ICommonsIterable<com.helger.html.resource.css.ICSSPathProvider>
-
iterator
-
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 interfaceIWebResourceSet<com.helger.html.resource.css.ICSSPathProvider>
-
equals
-
hashCode
public int hashCode() -
toString
-