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
Participant
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(Visitor<Participant> visitor) Accept the given visitor.static void
copyParticipantInfo
(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, removeExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<Participant>
-
getParticipantById
Return participant for given id- Parameters:
id
-- Returns:
- participant with given id or null
-
accept
Description copied from interface:Visitable
Accept the given visitor.- Specified by:
accept
in 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
-
-