Package org.jacoco.core.data
Class SessionInfoStore
- java.lang.Object
-
- org.jacoco.core.data.SessionInfoStore
-
- All Implemented Interfaces:
ISessionInfoVisitor
public class SessionInfoStore extends java.lang.Object implements ISessionInfoVisitor
Container to collect and merge sessionSessionInfoobjects. A instance of this class is not thread safe.
-
-
Constructor Summary
Constructors Constructor Description SessionInfoStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ISessionInfoVisitor visitor)Writes all containedSessionInfoobjects into the given visitor.java.util.List<SessionInfo>getInfos()Returns allSessionInfoobjects currently contained in the store.SessionInfogetMerged(java.lang.String id)Returns a new session info with the given id that contains a merged version from all contained version.booleanisEmpty()Tests whether the store is empty.voidvisitSessionInfo(SessionInfo info)Provides session information for the subsequent execution data calls.
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Tests whether the store is empty.- Returns:
trueif the store is empty
-
getInfos
public java.util.List<SessionInfo> getInfos()
Returns allSessionInfoobjects currently contained in the store. The info objects are ordered by its natural ordering (i.e. by the dump time stamp).- Returns:
- list of stored
SessionInfoobjects
-
getMerged
public SessionInfo getMerged(java.lang.String id)
Returns a new session info with the given id that contains a merged version from all contained version. The start timestamp is the minimum of all contained sessions, the dump timestamp the maximum of all contained sessions. If no session is currently contained both timestamps are set to0.- Parameters:
id- identifier for the merged session info- Returns:
- new
SessionInfoobject
-
accept
public void accept(ISessionInfoVisitor visitor)
Writes all containedSessionInfoobjects into the given visitor. The info objects are emitted in chronological order by dump timestamp.- Parameters:
visitor- visitor to emitSessionInfoobjects to
-
visitSessionInfo
public void visitSessionInfo(SessionInfo info)
Description copied from interface:ISessionInfoVisitorProvides session information for the subsequent execution data calls. In case of merged sessions this method might be called multiple times.- Specified by:
visitSessionInfoin interfaceISessionInfoVisitor- Parameters:
info- session information
-
-