5605 |
12 Apr 11 |
nicklas |
1 |
/** |
5605 |
12 Apr 11 |
nicklas |
$Id$ |
5605 |
12 Apr 11 |
nicklas |
3 |
|
5605 |
12 Apr 11 |
nicklas |
Copyright (C) 2011 Nicklas Nordborg |
5605 |
12 Apr 11 |
nicklas |
5 |
|
5605 |
12 Apr 11 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5605 |
12 Apr 11 |
nicklas |
Available at http://base.thep.lu.se/ |
5605 |
12 Apr 11 |
nicklas |
8 |
|
5605 |
12 Apr 11 |
nicklas |
BASE is free software; you can redistribute it and/or |
5605 |
12 Apr 11 |
nicklas |
modify it under the terms of the GNU General Public License |
5605 |
12 Apr 11 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5605 |
12 Apr 11 |
nicklas |
of the License, or (at your option) any later version. |
5605 |
12 Apr 11 |
nicklas |
13 |
|
5605 |
12 Apr 11 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5605 |
12 Apr 11 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5605 |
12 Apr 11 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5605 |
12 Apr 11 |
nicklas |
GNU General Public License for more details. |
5605 |
12 Apr 11 |
nicklas |
18 |
|
5605 |
12 Apr 11 |
nicklas |
You should have received a copy of the GNU General Public License |
5605 |
12 Apr 11 |
nicklas |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5605 |
12 Apr 11 |
nicklas |
21 |
*/ |
5605 |
12 Apr 11 |
nicklas |
22 |
package net.sf.basedb.util.extensions.manager.filter; |
5605 |
12 Apr 11 |
nicklas |
23 |
|
5605 |
12 Apr 11 |
nicklas |
24 |
import net.sf.basedb.util.extensions.manager.ExtensionsFile; |
5605 |
12 Apr 11 |
nicklas |
25 |
import net.sf.basedb.util.extensions.manager.ProcessResults; |
5605 |
12 Apr 11 |
nicklas |
26 |
import net.sf.basedb.util.extensions.manager.processor.MarkAsProcessedProcessor; |
5605 |
12 Apr 11 |
nicklas |
27 |
import net.sf.basedb.util.filter.Filter; |
5605 |
12 Apr 11 |
nicklas |
28 |
|
5605 |
12 Apr 11 |
nicklas |
29 |
/** |
5605 |
12 Apr 11 |
nicklas |
Filter implementation that passes all extension files that |
5605 |
12 Apr 11 |
nicklas |
has been processed according to the information in the given |
5605 |
12 Apr 11 |
nicklas |
ProcessResults object. Eg. if the {@link ProcessResults#getResults(ExtensionsFile)} |
5605 |
12 Apr 11 |
nicklas |
returns null or an actual object. This filter is primarly inteded to be used |
5605 |
12 Apr 11 |
nicklas |
together with the {@link MarkAsProcessedProcessor}, but may have other uses as well. |
5605 |
12 Apr 11 |
nicklas |
35 |
|
5605 |
12 Apr 11 |
nicklas |
@author Nicklas |
5605 |
12 Apr 11 |
nicklas |
@since 3.0 |
5605 |
12 Apr 11 |
nicklas |
@base.modified $Date$ |
5605 |
12 Apr 11 |
nicklas |
39 |
*/ |
5605 |
12 Apr 11 |
nicklas |
40 |
public class WasProcessedFilter |
5605 |
12 Apr 11 |
nicklas |
41 |
implements Filter<ExtensionsFile> |
5605 |
12 Apr 11 |
nicklas |
42 |
{ |
5605 |
12 Apr 11 |
nicklas |
43 |
|
5605 |
12 Apr 11 |
nicklas |
44 |
private final ProcessResults results; |
5605 |
12 Apr 11 |
nicklas |
45 |
|
5605 |
12 Apr 11 |
nicklas |
46 |
public WasProcessedFilter(ProcessResults results) |
5605 |
12 Apr 11 |
nicklas |
47 |
{ |
5605 |
12 Apr 11 |
nicklas |
48 |
this.results = results; |
5605 |
12 Apr 11 |
nicklas |
49 |
} |
5605 |
12 Apr 11 |
nicklas |
50 |
|
5605 |
12 Apr 11 |
nicklas |
51 |
/* |
5605 |
12 Apr 11 |
nicklas |
From the Filter interface |
5605 |
12 Apr 11 |
nicklas |
53 |
------------------------- |
5605 |
12 Apr 11 |
nicklas |
54 |
*/ |
5605 |
12 Apr 11 |
nicklas |
55 |
@Override |
5605 |
12 Apr 11 |
nicklas |
56 |
public boolean evaluate(ExtensionsFile xtFile) |
5605 |
12 Apr 11 |
nicklas |
57 |
{ |
5605 |
12 Apr 11 |
nicklas |
58 |
return results.getResults(xtFile) != null; |
5605 |
12 Apr 11 |
nicklas |
59 |
} |
5605 |
12 Apr 11 |
nicklas |
60 |
// --------------------------- |
5605 |
12 Apr 11 |
nicklas |
61 |
} |