KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > common > QueryDimension


1 package com.calipso.reportgenerator.common;
2
3 import com.calipso.reportgenerator.reportdefinitions.types.DimensionDefinitionOrderType;
4 import com.calipso.reportgenerator.reportdefinitions.types.DimensionDefinitionLocationType;
5
6 import java.io.Serializable JavaDoc;
7
8
9 /**
10  * Esta clase contiene toda la información referente a una dimensión necesaria para ejecutar una consulta (<code>ReportQuery</code>)
11  */

12
13 public class QueryDimension implements Serializable JavaDoc {
14
15   private String JavaDoc name;
16   private int index;
17   private DimensionDefinitionLocationType location;
18   private int locationOrder;
19   private DimensionDefinitionOrderType order;
20   private boolean groups;
21   private String JavaDoc rankMetricName;
22
23
24   /**
25    * Inicializa un objeto QueryDimension
26    * @param name nombre del la dimensión
27    * @param index indice del campo en el registro de la matriz
28    * @param location ubicación el la que agrupa (<code>LocationType.ROW, LocationType.COLUMN, LocationType.PAGE</code>)
29    * @param order tipo de ordenamiento de los valores de la dimensión (ascendente/descendente)
30    * @param locationOrder número utilizado para ordener las dimensiones en cada una de las ubicaciones de agrupción (location)
31    */

32   public QueryDimension(String JavaDoc name, int index, DimensionDefinitionLocationType location, DimensionDefinitionOrderType order, int locationOrder, boolean groups, String JavaDoc rankMetricName) {
33     this.name = name;
34     this.index = index;
35     this.location = location;
36     this.order = order;
37     this.rankMetricName = rankMetricName;
38     this.locationOrder = locationOrder;
39     this.groups = groups;
40   }
41
42   /**
43    * Retorna el nombre
44    * @return
45    */

46   public String JavaDoc getName() {
47     return name;
48   }
49
50   /**
51    * Retorna el índice
52    * @return
53    */

54   public int getIndex() {
55     return index;
56   }
57
58   /**
59    * Retorna el location type
60    * @return
61    */

62   public DimensionDefinitionLocationType getLocation() {
63     return location;
64   }
65
66   /**
67    * Retorna el Order
68    * @return
69    */

70   public DimensionDefinitionOrderType getOrder() {
71     if (order == null){
72       return DimensionDefinitionOrderType.A;
73     }
74     return order;
75   }
76
77   /**
78    * Asigna el location type
79    * @param location
80    */

81   public void setLocation(DimensionDefinitionLocationType location) {
82     this.location = location;
83   }
84
85   /**
86    * Asigna el Order
87    * @param order
88    */

89   public void setOrder(DimensionDefinitionOrderType order) {
90     this.order = order;
91   }
92
93   /**
94    * Devuelve el location Order
95    * @return
96    */

97   public int getLocationOrder() {
98     return locationOrder;
99   }
100
101   /**
102    * Asigna el location order
103    * @param locationOrder
104    */

105   public void setLocationOrder(int locationOrder) {
106     this.locationOrder = locationOrder;
107   }
108
109   /**
110    * Asigna las propiedades
111    * @param location
112    * @param order
113    * @param locationOrder
114    * @param rankMetricName
115    */

116   public void setProperties(DimensionDefinitionLocationType location, DimensionDefinitionOrderType order, int locationOrder, String JavaDoc rankMetricName) {
117     if (location != null) {
118       this.location = location;
119     }
120     if (order != null) {
121       this.order = order;
122     }
123     if (locationOrder >= 0) {
124       this.locationOrder = locationOrder;
125     }
126     if (rankMetricName != null){
127       this.rankMetricName = rankMetricName;
128     }
129   }
130
131   public boolean getGroups() {
132     return groups;
133   }
134
135   public void setGroups(boolean groups) {
136     this.groups = groups;
137   }
138
139   public String JavaDoc getRankMetricName() {
140     return rankMetricName;
141   }
142
143   public void setRankMetricName(String JavaDoc rankMetricName) {
144     this.rankMetricName = rankMetricName;
145   }
146
147 }
148
Popular Tags