edu.nrao.sss.model.project
Class SchedulingBlockFilter

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

public class SchedulingBlockFilter
extends Object
implements Filter<SchedulingBlock>

A filter that operates on scheduling 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
SchedulingBlockFilter()
          Creates a new wide-open filter that allows all scheduling blocks to pass.
 
Method Summary
 boolean allows(SchedulingBlock sb)
           
 boolean blocks(SchedulingBlock sb)
           
 void clearAll()
          Sets this filter to a wide-open state.
 void clearExecStatuses()
          Sets the execution status criterion into its wide-open state.
 Collection<SchedulingBlock> selectFrom(Collection<?> bag)
          Selects those objects in bag that are scheduling blocks and that can pass through this filter.
 void setExecStatuses(EventSetStatus... goodStatuses)
          Sets the execution status criterion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulingBlockFilter

public SchedulingBlockFilter()
Creates a new wide-open filter that allows all scheduling 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 scheduling block will be blocked by this filter due to its event status.


setExecStatuses

public void setExecStatuses(EventSetStatus... goodStatuses)
Sets the execution status criterion. Only those scheduling 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 scheduling block passing through this filter must have one of these statuses.
See Also:
clearExecStatuses()

blocks

public boolean blocks(SchedulingBlock sb)
Specified by:
blocks in interface Filter<SchedulingBlock>

allows

public boolean allows(SchedulingBlock sb)
Specified by:
allows in interface Filter<SchedulingBlock>

selectFrom

public Collection<SchedulingBlock> selectFrom(Collection<?> bag)
Selects those objects in bag that are scheduling 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 scheduling blocks from bag that were able to pass through this filter.


Copyright © 2009. All Rights Reserved.