Package com.xpn.xwiki.stats.impl
Class XWikiStats
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseCollection
-
- com.xpn.xwiki.stats.impl.XWikiStats
-
- All Implemented Interfaces:
ElementInterface
,ObjectInterface
,Serializable
,Cloneable
- Direct Known Subclasses:
DocumentStats
,RefererStats
,VisitStats
public class XWikiStats extends BaseCollection
Base class for all stored statistics object.- Version:
- $Id: 668a934260b85750a61b5ebe6f67c8d658cc6c00 $
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XWikiStats.Property
The properties of statistics object.
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.objects.BaseCollection
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver
-
Fields inherited from class com.xpn.xwiki.objects.BaseElement
documentReference, ownerDocument, referenceCache
-
-
Constructor Summary
Constructors Constructor Description XWikiStats()
Default constructor.XWikiStats(Date periodDate, StatsUtil.PeriodType periodtype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
void
fromXML(org.dom4j.Element oel)
Initialize statistics object from XML schema.protected String
getLocalKey()
int
getPageViews()
int
getPeriod()
int
hashCode()
void
incPageViews()
Add 1 to the counter of view action of this statistic.void
setPageViews(int pageViews)
void
setPeriod(int period)
org.dom4j.Element
toXML(BaseClass bclass)
-
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addField, addPropertyForRemoval, apply, clone, get, getClassName, getCurrentReferenceDocumentReferenceResolver, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeEntityReferenceResolver, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, merge, mergeField, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setNumber, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toXML, toXMLString
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
createReference, fromXML, getDocumentReference, getId, getLocalEntityReferenceSerializer, getLocalization, getLocalUidStringEntityReferenceSerializer, getMergeManager, getName, getOwnerDocument, getPrettyName, getReference, getXWikiContext, localizePlain, localizePlainOrKey, merge, setId, setName, setPrettyName, toString, toXMLString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
getDocumentReference, getName, getReference, merge, setName, toString
-
-
-
-
Constructor Detail
-
XWikiStats
public XWikiStats()
Default constructor.
-
XWikiStats
public XWikiStats(Date periodDate, StatsUtil.PeriodType periodtype)
- Parameters:
periodDate
- the period date.periodtype
- the period type.
-
-
Method Detail
-
getPeriod
public int getPeriod()
- Returns:
- the time when statistic was stored.
-
setPeriod
public void setPeriod(int period)
- Parameters:
period
- the time when statistic was stored.
-
getPageViews
public int getPageViews()
- Returns:
- the counter of view action of this statistic.
-
setPageViews
public void setPageViews(int pageViews)
- Parameters:
pageViews
- the counter of view action of this statistic.
-
incPageViews
public void incPageViews()
Add 1 to the counter of view action of this statistic.
-
getLocalKey
protected String getLocalKey()
- Overrides:
getLocalKey
in classBaseElement
- Returns:
- a unique identifier representing this element reference to be used for
hashCode()
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseElement
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classBaseCollection
-
toXML
public org.dom4j.Element toXML(BaseClass bclass)
- Specified by:
toXML
in interfaceObjectInterface
- Overrides:
toXML
in classBaseCollection
-
fromXML
public void fromXML(org.dom4j.Element oel) throws XWikiException
Initialize statistics object from XML schema.- Overrides:
fromXML
in classBaseElement
- Parameters:
oel
- the XML root node containing statistics datas.- Throws:
XWikiException
- error when parsing XML schema.
-
-