edu.nrao.sss.model.project
Class ProgramBlockFilter

java.lang.Object
  extended by edu.nrao.sss.model.project.ProgramBlockFilter
All Implemented Interfaces:
Filter<ProgramBlock>

public class ProgramBlockFilter
extends Object
implements Filter<ProgramBlock>

A filter that operates on program blocks.

Version Info:

$Revision: 1709 $
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $ (last person to modify)

Since:
2008-06-11
Author:
David M. Harland

Constructor Summary
ProgramBlockFilter()
          Creates a new wide-open filter that allows all program blocks to pass.
 
Method Summary
 boolean allows(ProgramBlock pb)
           
 boolean blocks(ProgramBlock pb)
           
 void clearAll()
          Sets this filter to a wide-open state.
 void clearExecStatuses()
          Sets the execution status criterion into its wide-open state.
 void clearTelescopeConfigurations()
          Sets the telescope configuration criterion into its wide-open state.
 Collection<ProgramBlock> selectFrom(Collection<?> bag)
          Selects those objects in bag that are program blocks and that can pass through this filter.
 void setExecStatuses(EventSetStatus... goodStatuses)
          Sets the execution status criterion.
 void setTelescopeConfigurations(TelescopeConfiguration... goodCfgs)
          Sets the telescope configuration criterion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgramBlockFilter

public ProgramBlockFilter()
Creates a new wide-open filter that allows all program blocks to pass.

Method Detail

clearAll

public void clearAll()
Sets this filter to a wide-open state.


clearExecStatuses

public void clearExecStatuses()
Sets the execution status criterion into its wide-open state. This means that no program block will be blocked by this filter due to its event status.


clearTelescopeConfigurations

public void clearTelescopeConfigurations()
Sets the telescope configuration criterion into its wide-open state. This means that no program block will be blocked by this filter due to its preferred configuration(s).


setExecStatuses

public void setExecStatuses(EventSetStatus... goodStatuses)
Sets the execution status criterion. Only those program blocks that have a status equal to one of those in the parameter list may pass through this filter.

Parameters:
goodStatuses - a list of execution statuses. Any program block passing through this filter must have one of these statuses.
See Also:
clearExecStatuses()

setTelescopeConfigurations

public void setTelescopeConfigurations(TelescopeConfiguration... goodCfgs)
Sets the telescope configuration criterion. Only those program blocks that have a preferred configuration equal to one of those in the parameter list may pass through this filter.

Parameters:
goodCfgs - a list of telescope configuations . Any program block passing through this filter must have one or more of its preferred configurations in this list.

blocks

public boolean blocks(ProgramBlock pb)
Specified by:
blocks in interface Filter<ProgramBlock>

allows

public boolean allows(ProgramBlock pb)
Specified by:
allows in interface Filter<ProgramBlock>

selectFrom

public Collection<ProgramBlock> selectFrom(Collection<?> bag)
Selects those objects in bag that are program blocks and that can pass through this filter. The selections are added to a new collection and returned. If the bag holds no such objects, the returned collection will be empty.

The original collection (bag) is not altered.

Parameters:
bag - a collection of objects.
Returns:
a collection of program blocks from bag that were able to pass through this filter.


Copyright © 2009. All Rights Reserved.