EMMA Coverage Report (generated Sun May 02 20:42:29 CEST 2010)
[all classes][hu.netmind.beankeeper.parser]

COVERAGE SUMMARY FOR SOURCE FILE [OrderBy.java]

nameclass, %method, %block, %line, %
OrderBy.java100% (1/1)80%  (8/10)75%  (72/96)76%  (16/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OrderBy100% (1/1)80%  (8/10)75%  (72/96)76%  (16/21)
OrderBy (): void 0%   (0/1)0%   (0/6)0%   (0/3)
hashCode (): int 0%   (0/1)0%   (0/16)0%   (0/1)
equals (Object): boolean 100% (1/1)93%  (26/28)75%  (3/4)
<static initializer> 100% (1/1)100% (5/5)100% (2/2)
OrderBy (ReferenceTerm, int): void 100% (1/1)100% (9/9)100% (4/4)
getDirection (): int 100% (1/1)100% (3/3)100% (1/1)
getReferenceTerm (): ReferenceTerm 100% (1/1)100% (3/3)100% (1/1)
setDirection (int): void 100% (1/1)100% (4/4)100% (2/2)
setReferenceTerm (ReferenceTerm): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (18/18)100% (1/1)

1/**
2 * Copyright (C) 2006 NetMind Consulting Bt.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18 
19package hu.netmind.beankeeper.parser;
20 
21/**
22 * Represent an order by requirement of a select statement.
23 * @author Brautigam Robert
24 * @version Revision: $Revision$
25 */
26public class OrderBy
27{
28   public static int ASCENDING = 1;
29   public static int DESCENDING = 2;
30  
31   private ReferenceTerm reference;
32   private int direction;
33 
34   public OrderBy()
35   {
36      direction = ASCENDING;
37   }
38 
39   public OrderBy(ReferenceTerm reference, int direction)
40   {
41      setReferenceTerm(reference);
42      setDirection(direction);
43   }
44   
45   public ReferenceTerm getReferenceTerm()
46   {
47      return reference;
48   }
49   public void setReferenceTerm(ReferenceTerm reference)
50   {
51      this.reference=reference;
52   }
53 
54   public int getDirection()
55   {
56      return direction;
57   }
58   public void setDirection(int direction)
59   {
60      this.direction=direction;
61   }
62 
63   public String toString()
64   {
65      return "[OrderBy: "+reference.toString()+", "+direction+"]";
66   }
67 
68   public int hashCode()
69   {
70      return (getReferenceTerm().getName()+"."+getReferenceTerm().getColumnName()).hashCode();
71   }
72 
73   public boolean equals(Object o)
74   {
75      if ( ! (o instanceof OrderBy) )
76         return false;
77      OrderBy orderBy = (OrderBy) o;
78      return (getReferenceTerm().getName().equals(orderBy.getReferenceTerm().getName())) &&
79         (getReferenceTerm().getColumnName().equals(orderBy.getReferenceTerm().getColumnName()));
80               
81   }
82}
83 
84 

[all classes][hu.netmind.beankeeper.parser]
EMMA 2.0.5312debian (C) Vladimir Roubtsov