Class Participants
java.lang.Object
ca.phon.extensions.ExtendableObject
ca.phon.session.Participants
- All Implemented Interfaces:
IExtendable,Visitable<Participant>,Iterable<Participant>
public final class Participants
extends ExtendableObject
implements Iterable<Participant>, Visitable<Participant>
Helper class providing iterator and visitor methods
for
Session Participants.-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(Visitor<Participant> visitor) Accept the given visitor.static voidcopyParticipantInfo(Participant src, Participant dest) determineParticipantAge(Participant participant) Determine age for a participant based on the following rules: If session date and participant birthday is available, return calculated period If participant age has been manually set, return specified age return Optional.empty()Return participant for given idGet next participant id based on roleCount participant roles in sessioniterator()otherParticipants(Participant participant) Returns a list of participants which does not include the given participant.stream()stream(boolean parallel) Return participant streamMethods inherited from class ca.phon.extensions.ExtendableObject
getExtension, getExtensions, putExtension, removeExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<Participant>
-
getParticipantById
Return participant for given id- Parameters:
id-- Returns:
- participant with given id or null
-
accept
Description copied from interface:VisitableAccept the given visitor.- Specified by:
acceptin interfaceVisitable<Participant>
-
getRoleCount
Count participant roles in session- Returns:
- map of participant roles to count
-
getPreferredParticipantId
Get next participant id based on role- Parameters:
role-- Returns:
- next preferred participant id
-
determineParticipantAge
Determine age for a participant based on the following rules:- If session date and participant birthday is available, return calculated period
- If participant age has been manually set, return specified age
- return Optional.empty()
- Parameters:
participant- age if available
-
otherParticipants
Returns a list of participants which does not include the given participant.- Parameters:
participant-- Returns:
- all other participants in session
-
copyParticipantInfo
-
stream
-
stream
Return participant stream- Parameters:
parallel-
-