Class NumberOfPagesStatisticsEvent
- java.lang.Object
-
- com.itextpdf.commons.actions.AbstractITextEvent
-
- com.itextpdf.commons.actions.AbstractProductITextEvent
-
- com.itextpdf.commons.actions.AbstractStatisticsEvent
-
- com.itextpdf.kernel.pdf.statistics.NumberOfPagesStatisticsEvent
-
- All Implemented Interfaces:
IEvent
public class NumberOfPagesStatisticsEvent extends AbstractStatisticsEvent
Class which represents event for counting the number of pages in a PDF document. Only for internal usage.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
NUMBER_OF_PAGES_STATISTICS
private int
numberOfPages
-
Constructor Summary
Constructors Constructor Description NumberOfPagesStatisticsEvent(int numberOfPages, ProductData productData)
Creates an instance of this class based on theProductData
and the number of pages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractStatisticsAggregator
createStatisticsAggregatorFromName(java.lang.String statisticsName)
Creates statistics aggregator based on provided statistics name.int
getNumberOfPages()
Gets number of pages in the PDF document during the processing of which the event was sent.java.util.List<java.lang.String>
getStatisticsNames()
Gets all statistics names related to this event.-
Methods inherited from class com.itextpdf.commons.actions.AbstractProductITextEvent
getProductData, getProductName
-
-
-
-
Field Detail
-
NUMBER_OF_PAGES_STATISTICS
private static final java.lang.String NUMBER_OF_PAGES_STATISTICS
- See Also:
- Constant Field Values
-
numberOfPages
private final int numberOfPages
-
-
Constructor Detail
-
NumberOfPagesStatisticsEvent
public NumberOfPagesStatisticsEvent(int numberOfPages, ProductData productData)
Creates an instance of this class based on theProductData
and the number of pages.- Parameters:
numberOfPages
- the number of pages in the PDF document during the processing of which the event was sentproductData
- is a description of the product which has generated an event
-
-
Method Detail
-
createStatisticsAggregatorFromName
public AbstractStatisticsAggregator createStatisticsAggregatorFromName(java.lang.String statisticsName)
Creates statistics aggregator based on provided statistics name. By default prints log warning and returnsnull
.- Overrides:
createStatisticsAggregatorFromName
in classAbstractStatisticsEvent
- Parameters:
statisticsName
- name of statistics based on which aggregator will be created. Shall be one of those returned fromAbstractStatisticsEvent.getStatisticsNames()
- Returns:
- new instance of
AbstractStatisticsAggregator
-
getStatisticsNames
public java.util.List<java.lang.String> getStatisticsNames()
Gets all statistics names related to this event.- Specified by:
getStatisticsNames
in classAbstractStatisticsEvent
- Returns:
List
of statistics names
-
getNumberOfPages
public int getNumberOfPages()
Gets number of pages in the PDF document during the processing of which the event was sent.- Returns:
- the number of pages
-
-