com.xpn.xwiki.stats.impl
Class XWikiStats

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseCollection
          extended by 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: b261504349817c1717319d6fda1103e49025e9f4 $
See Also:
Serialized Form

Nested Class Summary
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, localEntityReferenceSerializer, ownerDocument, referenceCache
 
Constructor Summary
XWikiStats()
          Default constructor.
XWikiStats(Date periodDate, StatsUtil.PeriodType periodtype)
           
 
Method Summary
 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, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setNumber, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
createReference, getDocumentReference, getId, getLocalUidStringEntityReferenceSerializer, getName, getOwnerDocument, getPrettyName, getReference, setId, setName, setPrettyName
 
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, setName
 

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 class BaseElement
Returns:
a unique identifier representing this element reference to be used for hashCode().

hashCode

public int hashCode()
Overrides:
hashCode in class BaseElement

equals

public boolean equals(Object obj)
Overrides:
equals in class BaseCollection

toXML

public org.dom4j.Element toXML(BaseClass bclass)
Specified by:
toXML in interface ObjectInterface
Specified by:
toXML in class BaseCollection

fromXML

public void fromXML(org.dom4j.Element oel)
             throws XWikiException
Initialize statistics object from XML schema.

Parameters:
oel - the XML root node containing statistics datas.
Throws:
XWikiException - error when parsing XML schema.


Copyright © 2004–2014 XWiki. All rights reserved.