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 ofBlockMatcher
which match anyBlock
with 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 long
getCount()
boolean
match(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:BlockMatcher
True if the provided block is matched.- Specified by:
match
in interfaceBlockMatcher
- Parameters:
block
- the block to match- Returns:
- true if the provided block is matched, false otherwise
-
getCount
public long getCount()
- Returns:
- the count
-
-