pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model
Class Visit

java.lang.Object
  extended by org.torweg.pulse.component.statistics.model.Visit

public class Visit
extends java.lang.Object

Represents a visit which basically consists of a number of page impressions, namely PIRecords.

Version:
$Revision: 1548 $
Author:
Daniel Dietz

Constructor Summary
Visit(PIRecord piRecord, TimeSpan sessionInterval, TimeSpan lastRecordAssumedTime)
          Creates a new Visit with the given PIRecord as the first page impression.
 
Method Summary
 boolean add(PIRecord piRecord)
          Adds the given PIRecord provided it belongs to the Visit.
 Duration getFirstFullDay()
          Returns the fullDays of the underlying PIRecords.
 PIRecord getFirstRecord()
          Returns the first PIRecord of the Visit.
 java.util.Set<Duration> getFullDays()
          Returns the fullDays of the underlying PIRecords.
 PIRecord getLastRecord()
          Returns the last PIRecord of the Visit.
 java.util.Set<PIRecord> getPiRecords()
          Returns the PIRecords of the Visit.
 java.util.Set<PIRecord> getPiRecords(Duration duration)
          Returns all the PIRecords for the given Duration.
 TimeSpan getTimeSpan(boolean withAssumedTimeForLastPageImpression)
          Returns the actual TimeSpan of the Visit - from first to last PIRecord.
 boolean isBounce()
          Returns whether the Visit is a "bounce" - meaning it contains only one PIRecord.
 java.lang.String toString()
          Returns a string-representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Visit

public Visit(PIRecord piRecord, TimeSpan sessionInterval, TimeSpan lastRecordAssumedTime)
Creates a new Visit with the given PIRecord as the first page impression.

Parameters:
piRecord - the PIRecord
sessionInterval - the maximum time between two page impressions in one session without a recurring session-id
lastRecordAssumedTime - a time span specifying the assumed time for the Visits last page-impresssion.
Throws:
java.lang.NullPointerException - if the record is null
Method Detail

add

public final boolean add(PIRecord piRecord)
Adds the given PIRecord provided it belongs to the Visit.

Parameters:
piRecord - the PIRecord to add
Returns:
true, if and only if the record has been added. Otherwise false.
Throws:
java.lang.NullPointerException - if the record is null

getPiRecords

public final java.util.Set<PIRecord> getPiRecords()
Returns the PIRecords of the Visit.

Returns:
the records

getPiRecords

public final java.util.Set<PIRecord> getPiRecords(Duration duration)
Returns all the PIRecords for the given Duration.

Parameters:
duration - the Duration
Returns:
the records for the given duration

getLastRecord

public final PIRecord getLastRecord()
Returns the last PIRecord of the Visit.

Returns:
the last record

getFirstRecord

public final PIRecord getFirstRecord()
Returns the first PIRecord of the Visit.

Returns:
the first record

getFullDays

public final java.util.Set<Duration> getFullDays()
Returns the fullDays of the underlying PIRecords.

Returns:
the fullDays

getFirstFullDay

public final Duration getFirstFullDay()
Returns the fullDays of the underlying PIRecords.

Returns:
the fullDays

getTimeSpan

public final TimeSpan getTimeSpan(boolean withAssumedTimeForLastPageImpression)
Returns the actual TimeSpan of the Visit - from first to last PIRecord.

Parameters:
withAssumedTimeForLastPageImpression -
  • true will include assumedTimeForLastPageImpression
  • false will NOT include assumedTimeForLastPageImpression
Returns:
a TimeSpan

isBounce

public final boolean isBounce()
Returns whether the Visit is a "bounce" - meaning it contains only one PIRecord.

Returns:
true if and only if the Visit is a "bounce", false otherwise

toString

public final java.lang.String toString()
Returns a string-representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string-representation of this object