public class IntrospectionModel extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
IntrospectionModel.IntrospectionModelObserver
Interface to implement when observing an instance of
IntrospectionModel . |
Constructor and Description |
---|
IntrospectionModel() |
Modifier and Type | Method and Description |
---|---|
boolean |
addObserver(IntrospectionModel.IntrospectionModelObserver observer)
Adds an observer to this model.
|
void |
addParticipant(Participant participant,
Participant parent)
Adds a participant to the model.
|
ParticipantInfo |
getParticipant(ParticipantId participantId)
Queries the database of known participants for the participant with the
given uuid and returns the associated
ParticipantInfo instance. |
Set<ParticipantInfo> |
getParticipants()
Returns the collection of participants.
|
boolean |
isEmpty()
Indicates whether any participants are known.
|
boolean |
removeObserver(IntrospectionModel.IntrospectionModelObserver observer)
Removes an observer from this model.
|
void |
removeParticipant(Participant participant)
Removes a participant from the model.
|
public boolean addObserver(IntrospectionModel.IntrospectionModelObserver observer)
observer
- observer to add, not null
true
if the oberserver was newly addedpublic boolean removeObserver(IntrospectionModel.IntrospectionModelObserver observer)
observer
- observer to remove, not null
true
if the observer existed and was removedpublic Set<ParticipantInfo> getParticipants()
public boolean isEmpty()
true
if the model contains participantspublic ParticipantInfo getParticipant(ParticipantId participantId)
ParticipantInfo
instance.
Remember to synchronize on this instance in case you want to ensure that
the participant still exists in the model when you operate with it.participantId
- the id of participant, not null
null
in case
there is no participant with the given idpublic void addParticipant(Participant participant, Participant parent)
participant
- the new participant, not null
parent
- optionally the parent participant or null
if no
parent existspublic void removeParticipant(Participant participant)
participant
- participant to remove, not null
Copyright © 2018 CoR-Lab. All rights reserved.