fr.cnes.sirius.patrius.events
Class PhenomenaList

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

public final class PhenomenaList
extends Object

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

Since:
1.1
Version:
$Id: PhenomenaList.java 17586 2017-05-10 13:29:16Z bignon $
Author:
Pierre Cardoso, Tiziana Sabatini
See Also:
Phenomenon
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
PhenomenaList()
          Default constructor.
 
Method Summary
 void add(Phenomenon phenomenon)
          Add a Phenomenon to the list.
 List<Phenomenon> getList()
          Get the full list of Phenomenon.
 Set<Phenomenon> getPhenomena(String code, String comment, AbsoluteDateInterval interval)
          Finds one/more events in the list of Phenomenon following some criteria.
When a comment and a time interval are available, the method looks for a specific phenomenon in the list, otherwise if only the code is given as input, it looks for a list of phenomena with the same code.
 boolean remove(Phenomenon phenomenon)
          Remove a Phenomenon to the list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PhenomenaList

public PhenomenaList()
Default constructor.

Method Detail

add

public void add(Phenomenon phenomenon)
Add a Phenomenon to the list.

Parameters:
phenomenon - the Phenomenon to add.

remove

public boolean remove(Phenomenon phenomenon)
Remove a Phenomenon to the list.

Parameters:
phenomenon - the Phenomenon to add.
Returns:
true if the set contains the phenomenon that has to be removed

getList

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

Returns:
a copy of the list of Phenomenon.

getPhenomena

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

Parameters:
code - the code of the phenomenon to look for in the list
comment - the comment of the phenomenon to look for in the list (it can be null)
interval - the time interval of the phenomenon to look for in the list (it can be null)
Returns:
the list of phenomena with the given code, comment and interval.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2017 CNES. All Rights Reserved.