Clover coverage report - Maven Clover report
Coverage timestamp: Sun Aug 20 2006 04:01:04 PDT
file stats: LOC: 73   Methods: 6
NCLOC: 45   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DateTerm.java 0% 0% 0% 0%
coverage
 1    /**
 2    *
 3    * Copyright 2003-2004 The Apache Software Foundation
 4    *
 5    * Licensed under the Apache License, Version 2.0 (the "License");
 6    * you may not use this file except in compliance with the License.
 7    * You may obtain a copy of the License at
 8    *
 9    * http://www.apache.org/licenses/LICENSE-2.0
 10    *
 11    * Unless required by applicable law or agreed to in writing, software
 12    * distributed under the License is distributed on an "AS IS" BASIS,
 13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14    * See the License for the specific language governing permissions and
 15    * limitations under the License.
 16    */
 17   
 18    package javax.mail.search;
 19   
 20    import java.util.Date;
 21   
 22    /**
 23    * @version $Rev: 126550 $ $Date: 2005-01-26 14:27:45 -0800 (Wed, 26 Jan 2005) $
 24    */
 25    public abstract class DateTerm extends ComparisonTerm {
 26    protected Date date;
 27   
 28  0 protected DateTerm(int comparison, Date date) {
 29  0 super();
 30  0 this.comparison = comparison;
 31  0 this.date = date;
 32    }
 33   
 34  0 public Date getDate() {
 35  0 return date;
 36    }
 37   
 38  0 public int getComparison() {
 39  0 return comparison;
 40    }
 41   
 42  0 protected boolean match(Date match) {
 43  0 long matchTime = match.getTime();
 44  0 long mytime = date.getTime();
 45  0 switch (comparison) {
 46  0 case EQ:
 47  0 return matchTime == mytime;
 48  0 case NE:
 49  0 return matchTime != mytime;
 50  0 case LE:
 51  0 return matchTime <= mytime;
 52  0 case LT:
 53  0 return matchTime < mytime;
 54  0 case GT:
 55  0 return matchTime > mytime;
 56  0 case GE:
 57  0 return matchTime >= mytime;
 58  0 default:
 59  0 return false;
 60    }
 61    }
 62   
 63  0 public boolean equals(Object other) {
 64  0 if (other == this) return true;
 65  0 if (other instanceof DateTerm == false) return false;
 66  0 final DateTerm term = (DateTerm) other;
 67  0 return this.comparison == term.comparison && this.date.equals(term.date);
 68    }
 69   
 70  0 public int hashCode() {
 71  0 return date.hashCode();
 72    }
 73    }