@NotThreadSafe public class CSSKeyframesBlock extends Object implements IHasCSSDeclarations<CSSKeyframesBlock>, ICSSVersionAware, ICSSSourceLocationAware
Constructor and Description |
---|
CSSKeyframesBlock(Iterable<String> aKeyframesSelectors) |
CSSKeyframesBlock(String... aKeyframesSelectors) |
Modifier and Type | Method and Description |
---|---|
CSSKeyframesBlock |
addDeclaration(CSSDeclaration aDeclaration)
Add a new declaration.
|
CSSKeyframesBlock |
addDeclaration(int nIndex,
CSSDeclaration aNewDeclaration)
Add a new declaration at the specified index.
|
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> |
getAllDeclarations() |
com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> |
getAllDeclarationsOfPropertyName(String sPropertyName)
Get all declarations within this list that have the specified property
name.
|
com.helger.commons.collection.impl.ICommonsList<String> |
getAllKeyframesSelectors() |
String |
getAsCSSString(ICSSWriterSettings aSettings,
int nIndentLevel)
Get the contents of this object as a serialized CSS string for writing to
an output.
|
CSSDeclaration |
getDeclarationAtIndex(int nIndex) |
int |
getDeclarationCount() |
CSSDeclaration |
getDeclarationOfPropertyName(String sPropertyName)
Get the first declaration with the specified property name.
|
ECSSVersion |
getMinimumCSSVersion() |
CSSSourceLocation |
getSourceLocation() |
boolean |
hasDeclarations() |
int |
hashCode() |
com.helger.commons.state.EChange |
removeAllDeclarations()
Remove all declarations.
|
com.helger.commons.state.EChange |
removeDeclaration(CSSDeclaration aDeclaration)
Remove the given declaration
|
com.helger.commons.state.EChange |
removeDeclaration(int nDeclarationIndex)
Remove the declaration at the specified index
|
CSSKeyframesBlock |
setDeclarationAtIndex(int nIndex,
CSSDeclaration aNewDeclaration)
Set the declaration at the specified index with a new one.
|
void |
setSourceLocation(CSSSourceLocation aSourceLocation)
Set the source location of the object, determined while parsing.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addDeclaration, getAllDeclarationsOfPropertyNameCaseInsensitive, getDeclarationOfPropertyNameCaseInsensitive
getAsCSSString, getAsCSSString
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllKeyframesSelectors()
@Nonnull public CSSKeyframesBlock addDeclaration(@Nonnull CSSDeclaration aDeclaration)
IHasCSSDeclarations
addDeclaration
in interface IHasCSSDeclarations<CSSKeyframesBlock>
aDeclaration
- The declaration to be added. May not be null
.@Nonnull public CSSKeyframesBlock addDeclaration(@Nonnegative int nIndex, @Nonnull CSSDeclaration aNewDeclaration)
IHasCSSDeclarations
addDeclaration
in interface IHasCSSDeclarations<CSSKeyframesBlock>
nIndex
- The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount()
, it behaves like
IHasCSSDeclarations.addDeclaration(CSSDeclaration)
.aNewDeclaration
- The declaration to be added. May not be null
.@Nonnull public com.helger.commons.state.EChange removeDeclaration(@Nonnull CSSDeclaration aDeclaration)
IHasCSSDeclarations
removeDeclaration
in interface IHasCSSDeclarations<CSSKeyframesBlock>
aDeclaration
- The declaration to be removed. May not be null
.EChange.CHANGED
if the declaration was successfully removed@Nonnull public com.helger.commons.state.EChange removeDeclaration(@Nonnegative int nDeclarationIndex)
IHasCSSDeclarations
removeDeclaration
in interface IHasCSSDeclarations<CSSKeyframesBlock>
nDeclarationIndex
- The index of the declaration to be removed. Must be ≥ 0.EChange.CHANGED
if the declaration was successfully
removed, EChange.UNCHANGED
if the index was invalid.@Nonnull public com.helger.commons.state.EChange removeAllDeclarations()
IHasCSSDeclarations
removeAllDeclarations
in interface IHasCSSDeclarations<CSSKeyframesBlock>
EChange.CHANGED
if any declaration was removed,
EChange.UNCHANGED
otherwise. Never null
.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarations()
getAllDeclarations
in interface IHasCSSDeclarations<CSSKeyframesBlock>
null
copy of all contained
declarations.@Nullable public CSSDeclaration getDeclarationAtIndex(@Nonnegative int nIndex)
getDeclarationAtIndex
in interface IHasCSSDeclarations<CSSKeyframesBlock>
nIndex
- The index to retrievenull
if the
index is invalid@Nonnull public CSSKeyframesBlock setDeclarationAtIndex(@Nonnegative int nIndex, @Nonnull CSSDeclaration aNewDeclaration)
IHasCSSDeclarations
setDeclarationAtIndex
in interface IHasCSSDeclarations<CSSKeyframesBlock>
nIndex
- The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount()
, it behaves like
IHasCSSDeclarations.addDeclaration(CSSDeclaration)
.aNewDeclaration
- The new declaration to be set.public boolean hasDeclarations()
hasDeclarations
in interface IHasCSSDeclarations<CSSKeyframesBlock>
true
if at least one declaration is present,
false
if no declaration is present.@Nonnegative public int getDeclarationCount()
getDeclarationCount
in interface IHasCSSDeclarations<CSSKeyframesBlock>
@Nullable public CSSDeclaration getDeclarationOfPropertyName(@Nullable String sPropertyName)
IHasCSSDeclarations
null
is returned. If more than one
declaration ith the specified property name is present, always the first in
the list will be returned. The comparison happens case insensitive
(since v6.0.0).getDeclarationOfPropertyName
in interface IHasCSSDeclarations<CSSKeyframesBlock>
sPropertyName
- The property name of the declaration to search (e.g.
color
). May be null
.null
if no such property name was found.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarationsOfPropertyName(@Nullable String sPropertyName)
IHasCSSDeclarations
getAllDeclarationsOfPropertyName
in interface IHasCSSDeclarations<CSSKeyframesBlock>
sPropertyName
- The property name of the declaration to search (e.g.
color
). May be null
.null
but maybe an empty list.@Nonnull @Nonempty public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
ICSSWriteable
getAsCSSString
in interface ICSSWriteable
aSettings
- The settings to be used to format the output. May not be
null
.nIndentLevel
- The current indentation levelnull
.@Nonnull public ECSSVersion getMinimumCSSVersion()
getMinimumCSSVersion
in interface ICSSVersionAware
null
.public void setSourceLocation(@Nullable CSSSourceLocation aSourceLocation)
ICSSSourceLocationAware
setSourceLocation
in interface ICSSSourceLocationAware
aSourceLocation
- The source location to use. May be null
.@Nullable public CSSSourceLocation getSourceLocation()
getSourceLocation
in interface ICSSSourceLocationAware
null
if an object was not read but manually
created.Copyright © 2014–2021 Philip Helger. All rights reserved.