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 classXWikiStats.PropertyThe 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 booleanequals(Object obj)voidfromXML(org.dom4j.Element oel)Initialize statistics object from XML schema.protected StringgetLocalKey()intgetPageViews()intgetPeriod()inthashCode()voidincPageViews()Add 1 to the counter of view action of this statistic.voidsetPageViews(int pageViews)voidsetPeriod(int period)org.dom4j.ElementtoXML(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:
getLocalKeyin classBaseElement- Returns:
- a unique identifier representing this element reference to be used for
hashCode().
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseElement
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseCollection
-
toXML
public org.dom4j.Element toXML(BaseClass bclass)
- Specified by:
toXMLin interfaceObjectInterface- Overrides:
toXMLin classBaseCollection
-
fromXML
public void fromXML(org.dom4j.Element oel) throws XWikiExceptionInitialize statistics object from XML schema.- Overrides:
fromXMLin classBaseElement- Parameters:
oel- the XML root node containing statistics datas.- Throws:
XWikiException- error when parsing XML schema.
-
-