Package org.xwiki.rendering.block.match
Class CounterBlockMatcher
- java.lang.Object
-
- org.xwiki.rendering.block.match.CounterBlockMatcher
-
- All Implemented Interfaces:
BlockMatcher
public class CounterBlockMatcher extends Object implements BlockMatcher
Implementation ofBlockMatcherwhich match anyBlockwith the provided class.- Since:
- 10.10RC1
- Version:
- $Id: 00e8c5819c658c08bb5a3604984468cc9b06b3d5 $
-
-
Constructor Summary
Constructors Constructor Description CounterBlockMatcher()Count all blocks.CounterBlockMatcher(Block stopBlock)Find the index of the passed block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()booleanmatch(Block block)True if the provided block is matched.
-
-
-
Constructor Detail
-
CounterBlockMatcher
public CounterBlockMatcher()
Count all blocks.
-
CounterBlockMatcher
public CounterBlockMatcher(Block stopBlock)
Find the index of the passed block.- Parameters:
stopBlock- the block where to stop counting
-
-
Method Detail
-
match
public boolean match(Block block)
Description copied from interface:BlockMatcherTrue if the provided block is matched.- Specified by:
matchin interfaceBlockMatcher- Parameters:
block- the block to match- Returns:
- true if the provided block is matched, false otherwise
-
getCount
public long getCount()
- Returns:
- the count
-
-