[Bio] / Sprout / TargetCriterionNull.pm Repository:
ViewVC logotype

Annotation of /Sprout/TargetCriterionNull.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     #
4 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
5 :     # for Interpretations of Genomes. All Rights Reserved.
6 :     #
7 :     # This file is part of the SEED Toolkit.
8 :     #
9 :     # The SEED Toolkit is free software. You can redistribute
10 :     # it and/or modify it under the terms of the SEED Toolkit
11 :     # Public License.
12 :     #
13 :     # You should have received a copy of the SEED Toolkit Public License
14 :     # along with this program; if not write to the University of Chicago
15 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
16 :     # Genomes at veronika@thefig.info or download a copy from
17 :     # http://www.theseed.org/LICENSE.TXT.
18 :     #
19 :    
20 :     package TargetCriterionNull;
21 :    
22 :     use strict;
23 :     use Tracer;
24 :     use CGI qw(-nosticky);
25 :     use base qw(TargetCriterion);
26 :    
27 :    
28 :     =head1 Target Search Null Criterion Object
29 :    
30 :     =head2 Introduction
31 :    
32 :     This is a special search criterion that is used as a no-op. It is TRUE for
33 :     every feature when it's used with the AND operator and FALSE for every feature
34 :     when it's used with the OR or NOT operators. No controls are displayed.
35 :    
36 :     =cut
37 :    
38 :     =head3 new
39 :    
40 :     my $tc = TargetCriterion->new($rhelp, $name, $label, $hint);
41 :    
42 :     Construct a new TargetCriterion object. The following parameters are expected.
43 :    
44 :     =over 4
45 :    
46 :     =item rhelp
47 :    
48 :     [[ResultHelperPm]] object for the active search.
49 :    
50 :     =item name
51 :    
52 :     Identifying name of this criterion.
53 :    
54 :     =item label
55 :    
56 :     Label to display in the type dropdown.
57 :    
58 :     =item hint
59 :    
60 :     String to use as a tooltip for the hint button.
61 :    
62 :     =back
63 :    
64 :     =cut
65 :    
66 :     sub new {
67 :     # Get the parameters.
68 :     my ($class, $rhelp, $name, $label, $hint) = @_;
69 :     # Create the underlying object.
70 :     my $retVal = TargetCriterion::new($class, $rhelp, name => $name, label => $label,
71 :     hint => $hint);
72 :     # Return it.
73 :     return $retVal;
74 :     }
75 :    
76 :     =head2 Virtual Methods
77 :    
78 :     =head3 Validate
79 :    
80 :     my $okFlag = $tc->Validate($parms);
81 :    
82 :     Return TRUE if the specified parameters are valid for a search criterion of this type
83 :     and FALSE otherwise. If an error is detected, the error message can be retrieved using
84 :     the L</message> method.
85 :    
86 :     =over 4
87 :    
88 :     =item parms
89 :    
90 :     A Criterion Parameter Object whose fields are to be validated.
91 :    
92 :     =item RETURN
93 :    
94 :     Returns TRUE if the parameters are valid, else FALSE.
95 :    
96 :     =back
97 :    
98 :     =cut
99 :    
100 :     sub Validate {
101 :     return 1;
102 :     }
103 :    
104 :     =head3 CheckValue
105 :    
106 :     my $match = $tc->CheckValue($criterion, $valueData);
107 :    
108 :     Return TRUE if the current feature matches this criterion, else FALSE.
109 :    
110 :     =over 4
111 :    
112 :     =item criterion
113 :    
114 :     Criterion Parameter object describing this criterion's parameters.
115 :    
116 :     =item valueData
117 :    
118 :     Value computed for the current feature by the L</GetValueData> method.
119 :    
120 :     =item RETURN
121 :    
122 :     Returns TRUE if the current feature matches the criterion, else FALSE.
123 :    
124 :     =back
125 :    
126 :     =cut
127 :    
128 :     sub CheckValue {
129 :     # Get the parameters.
130 :     my ($self, $criterion, $valueData) = @_;
131 :     # We match if this is an AND, otherwise we don't match.
132 :     my $retVal = ($criterion->{op} eq 'AND');
133 :     # Return the result.
134 :     return $retVal;
135 :     }
136 :    
137 :    
138 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3