fr.cnes.sirius.patrius.events
Class CodedEventsList

java.lang.Object
  extended by fr.cnes.sirius.patrius.events.CodedEventsList

public final class CodedEventsList
extends Object

This class represents a list of objects CodedEvent.
One or more lists of coded events are created during propagation when CodingEventDetector is used, via the monitorDetector method.

Since:
1.1
Version:
$Id: CodedEventsList.java 10237 2014-04-11 15:36:04Z houdroge $
Author:
Pierre Cardoso, Tiziana Sabatini
See Also:
CodedEvent
Concurrency :
not thread-safe
Concurrency comment :
no thread-sharing use case was identified for this class, so thread safety is not required. Though, some precautions are taken, as an example, the method getList() returns a copy of the list and not directly the attribute list itself.

Constructor Summary
CodedEventsList()
          Default constructor.
 
Method Summary
 void add(CodedEvent codedEvent)
          Add a CodedEvent to the list.
 Set<CodedEvent> getEvents(String code, String comment, AbsoluteDate date)
          Finds one/more events in the list of CodedEvent following some criteria.
When a comment and a date are available, the method looks for a specific event in the list, otherwise if only the code is given as input, it looks for a list of events with the same code.
 List<CodedEvent> getList()
          Get the full list of coded events.
 boolean remove(CodedEvent codedEvent)
          Remove a CodedEvent to the list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodedEventsList

public CodedEventsList()
Default constructor.

Method Detail

add

public void add(CodedEvent codedEvent)
Add a CodedEvent to the list.

Parameters:
codedEvent - the element to add.

remove

public boolean remove(CodedEvent codedEvent)
Remove a CodedEvent to the list.

Parameters:
codedEvent - the element to remove.
Returns:
true if the set contains the coded event that has to be removed.

getList

public List<CodedEvent> getList()
Get the full list of coded events. Or more accurately : get a copy of the inside SortedSet as a full list.

Returns:
a copy of the list of coded events.

getEvents

public Set<CodedEvent> getEvents(String code,
                                 String comment,
                                 AbsoluteDate date)
Finds one/more events in the list of CodedEvent following some criteria.
When a comment and a date are available, the method looks for a specific event in the list, otherwise if only the code is given as input, it looks for a list of events with the same code. If the event does not exist in the list, returns the empty set.

Parameters:
code - the code of the event to look for in the list
comment - the comment of the event to look for in the list (it can be null)
date - the date of the event to look for in the list (it can be null)
Returns:
the list of events with the given code, comment and date.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016 CNES. All Rights Reserved.