[ERA-CVS] src/org/jdaemon/era Aggregate.java, 1.9, 1.10 Constraint.java, 1.4, 1.5 ConstraintFactory
Brought to you by:
jessex
Update of /cvsroot/era/src/org/jdaemon/era In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12559/era Modified Files: Aggregate.java Constraint.java ConstraintFactory.java Cube.java CubeDescriptor.java Grouping.java Report.java Sort.java Log Message: Various changes for ERA v2 - 'This time it's Generic...' Index: Aggregate.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Aggregate.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Aggregate.java 12 Feb 2008 23:05:03 -0000 1.9 --- Aggregate.java 6 Oct 2008 10:22:14 -0000 1.10 *************** *** 11,14 **** --- 11,16 ---- package org.jdaemon.era; + import org.jdaemon.util.attribute.Attribute; + /** Specifies an aggregate value to be calculated by a Cube. * <P> *************** *** 30,34 **** * @author Jonathan Essex */ ! public class Aggregate { /** Parameter value indicating sum of attribute values should be calculated */ --- 32,36 ---- * @author Jonathan Essex */ ! public class Aggregate<T extends Comparable<? super T>,C> { /** Parameter value indicating sum of attribute values should be calculated */ *************** *** 44,48 **** private int type; /** Cube attribute on which to perform aggregation operation */ ! private String attribute; /** Creates a new instance of Aggregate. --- 46,50 ---- private int type; /** Cube attribute on which to perform aggregation operation */ ! private Attribute<T,C> attribute; /** Creates a new instance of Aggregate. *************** *** 51,57 **** * @param type Type of aggregation (one of SUM, MIN, MAX, COUNT) */ ! public Aggregate(String attribute_name, int type) { this.type = type; ! this.attribute = attribute_name; } --- 53,59 ---- * @param type Type of aggregation (one of SUM, MIN, MAX, COUNT) */ ! public Aggregate(Attribute<T,C> attribute, int type) { this.type = type; ! this.attribute = attribute; } *************** *** 65,105 **** return type; } ! ! /** Get the attriubte name on which aggregation will be performed. ! * ! * Will return the exact attribute name specified in the constructor. ! * ! * @return the attriubte name on which aggregation will be performed ! */ ! public String getAttributeName() { ! return attribute; ! } ! ! /** Get the value of this aggregate from a cube. ! * ! * If <code>attribute_name</code> is the values specified in constructor, ! * then this operation is equivalent to one of the following: ! * <LU> ! * <LI><CODE>new Double(cube.getSum(attribute_name))</CODE></LI> ! * <LI><CODE>cube.getMax(attribute_name)</CODE></LI> ! * <LI><CODE>cube.getMin(attribute_name)</CODE></LI> ! * <LI><CODE>cube.getCount(attribute_name)</CODE></LI> ! * </LU> ! * depending on the value of <code>type</code> which was specified in the constructor. ! * ! * @param cube Cube from which to extract aggregate value ! * @return the specified attribute value ! */ ! public Object getValue(Cube cube) { ! switch(type) { ! case SUM: return new Double(cube.getSum(attribute)); ! case MAX: return cube.getMax(attribute); ! case MIN: return cube.getMin(attribute); ! //Hmm... this isn't right. Need an actual getCount(attr_name) method in Cube... ! case COUNT: return new Integer(cube.size()); ! default: throw new RuntimeException("Unknown aggregate type."); ! } ! } ! /** Equality test. * --- 67,71 ---- return type; } ! /** Equality test. * Index: Constraint.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Constraint.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Constraint.java 11 Jun 2004 23:24:23 -0000 1.4 --- Constraint.java 6 Oct 2008 10:22:14 -0000 1.5 *************** *** 21,25 **** * @author Jonathan Essex */ ! public interface Constraint { /** Apply a constraint to a cube. --- 21,25 ---- * @author Jonathan Essex */ ! public interface Constraint<T> { /** Apply a constraint to a cube. *************** *** 28,31 **** * @return Cube containing subset of data for which constraint is satisifed. */ ! Cube apply(Cube cube); } --- 28,31 ---- * @return Cube containing subset of data for which constraint is satisifed. */ ! Cube<T> apply(Cube<T> cube); } Index: ConstraintFactory.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/ConstraintFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConstraintFactory.java 12 Feb 2008 23:05:04 -0000 1.5 --- ConstraintFactory.java 6 Oct 2008 10:22:14 -0000 1.6 *************** *** 10,13 **** --- 10,15 ---- package org.jdaemon.era; + import org.jdaemon.util.attribute.Attribute; + /** Factory interface for building constraints. * *************** *** 23,27 **** * @author Jonathan Essex */ ! public interface ConstraintFactory { --- 25,29 ---- * @author Jonathan Essex */ ! public interface ConstraintFactory<C> { *************** *** 36,40 **** * @return A constraint encapsulating the constraint <I>attribute</I> less than <I>operand</I> */ ! public Constraint newLess(String attribute, Object operand); /** Create a new 'greater' constraint. --- 38,42 ---- * @return A constraint encapsulating the constraint <I>attribute</I> less than <I>operand</I> */ ! public <T extends Comparable<? super T>> Constraint<C> newLess(Attribute<T,C> attribute, T operand); /** Create a new 'greater' constraint. *************** *** 48,52 **** * @return A constraint encapsulating the constraint <I>attribute</I> greater than <I>operand</I> */ ! public Constraint newGreater(String attribute, Object operand); /** Create a new 'greater or equal' constraint. --- 50,54 ---- * @return A constraint encapsulating the constraint <I>attribute</I> greater than <I>operand</I> */ ! public <T extends Comparable<? super T>> Constraint<C> newGreater(Attribute<T,C> attribute, T operand); /** Create a new 'greater or equal' constraint. *************** *** 60,64 **** * @return A constraint encapsulating the constraint <I>attribute</I> greater than or equal to<I>operand</I> */ ! public Constraint newGreaterOrEqual(String attribute, Object operand); /** Create a new 'less or equal' constraint. --- 62,66 ---- * @return A constraint encapsulating the constraint <I>attribute</I> greater than or equal to<I>operand</I> */ ! public <T extends Comparable<? super T>> Constraint<C> newGreaterOrEqual(Attribute<T,C> attribute, T operand); /** Create a new 'less or equal' constraint. *************** *** 72,76 **** * @return A constraint encapsulating the constraint <I>attribute</I> less than or equal to<I>operand</I> */ ! public Constraint newLessOrEqual(String attribute, Object operand); /** Create a new 'equal' constraint. --- 74,78 ---- * @return A constraint encapsulating the constraint <I>attribute</I> less than or equal to<I>operand</I> */ ! public <T extends Comparable<? super T>> Constraint<C> newLessOrEqual(Attribute<T,C> attribute, T operand); /** Create a new 'equal' constraint. *************** *** 84,88 **** * @return A constraint encapsulating the constraint <I>attribute</I> equal to <I>operand</I> */ ! public Constraint newEqual(String attribute, Object operand); /** Create a new 'and' constraint. --- 86,90 ---- * @return A constraint encapsulating the constraint <I>attribute</I> equal to <I>operand</I> */ ! public <T extends Comparable<? super T>> Constraint<C> newEqual(Attribute<T,C> attribute, T operand); /** Create a new 'and' constraint. *************** *** 95,99 **** * @return A constraint encapsulating constraint <I>a</I> and <I>b</I> */ ! public Constraint newAnd(Constraint a, Constraint b); ! } --- 97,100 ---- * @return A constraint encapsulating constraint <I>a</I> and <I>b</I> */ ! public Constraint<C> newAnd(Constraint<C> a, Constraint<C> b); } Index: Cube.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Cube.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cube.java 11 Jun 2004 23:24:23 -0000 1.10 --- Cube.java 6 Oct 2008 10:22:14 -0000 1.11 *************** *** 14,17 **** --- 14,19 ---- import java.util.SortedSet; import java.util.Collection; + import java.util.List; + import org.jdaemon.util.attribute.Attribute; /** Supports generic slicing-and-dicing of data using an OLAP cube metaphor. *************** *** 57,61 **** * @author Jonathan Essex */ ! public interface Cube extends Collection { /** operator that selects objects with attribute equal to a value */ --- 59,63 ---- * @author Jonathan Essex */ ! public interface Cube<T> extends Collection<T> { /** operator that selects objects with attribute equal to a value */ *************** *** 89,99 **** * @return A cube containing a subset of the objects in this cube */ ! public Cube constrain(String attribute, int operator, Object operand); /** Calculate several aggregate values for this cube at the same time. ! * @param aggregates array of aggregate objects specifying what calculations to perform ! * @return an array of result objects */ ! public Object[] getAggregates(Aggregate[] aggregates); /** Gets the sum over all contained objects of some attributes. --- 91,115 ---- * @return A cube containing a subset of the objects in this cube */ ! public <V extends Comparable<? super V>> Cube<T> constrain(Attribute<V,T> attr, int operator, T operand); /** Calculate several aggregate values for this cube at the same time. ! * ! * The nth item in the result list should be equal to the result of ! * calling getAggregate on teh nth item in the aggregates list. ! * ! * @param aggregates List of aggregate objects specifying what calculations to perform ! * @return a List of result objects */ ! public List<?> getAggregates(List<Aggregate<?,T>> aggregates); ! ! ! /** Get an aggregate value ! * ! * Should be equivalent to calling aggregate.getAttribute() ! * ! * @param an aggregate to calculate ! * @return The value of an aggregate calculated over all points in the cube ! */ ! public <V extends Comparable<? super V>> V getAggregate(Aggregate<V,T> aggregate); /** Gets the sum over all contained objects of some attributes. *************** *** 107,113 **** * * @param attribute The name of an attribute to sum ! * @return The sum of the named attribute over all contained objects */ ! public double getSum(String attribute); /** Get the minimum value over all contained objects of some attribute. --- 123,129 ---- * * @param attribute The name of an attribute to sum ! * @return The sum of the given attribute over all contained objects */ ! public <V extends Comparable<? super V>> V getSum(Attribute<V,T> attribute); /** Get the minimum value over all contained objects of some attribute. *************** *** 116,123 **** * comparison operation used to create this minimum. * ! * @param attribute The name of an attribute * @return The minimum value of the named attribute over all contained objects */ ! public Object getMin(String attribute); /** Get the maximum value over all contained objects of some attribute. --- 132,139 ---- * comparison operation used to create this minimum. * ! * @param attribute The an attribute * @return The minimum value of the named attribute over all contained objects */ ! public <V extends Comparable<? super V>> V getMin(Attribute<V,T> attribute); /** Get the maximum value over all contained objects of some attribute. *************** *** 129,133 **** * @return The maximum value of the named attribute over all contained objects */ ! public Object getMax(String attribute); /** Get the first non-null value over all contained objects of some attribute. --- 145,149 ---- * @return The maximum value of the named attribute over all contained objects */ ! public <V extends Comparable<? super V>> V getMax(Attribute<V,T> attribute); /** Get the first non-null value over all contained objects of some attribute. *************** *** 139,143 **** * @return The maximum value of the named attribute over all contained objects */ ! public Object getFirst(String attribute); /** Get the last non-null value over all contained objects of some attribute. --- 155,159 ---- * @return The maximum value of the named attribute over all contained objects */ ! public <V extends Comparable<? super V>> V getFirst(Attribute<V,T> attribute); /** Get the last non-null value over all contained objects of some attribute. *************** *** 149,153 **** * @return The maximum value of the named attribute over all contained objects */ ! public Object getLast(String attribute); /** Get the value of an individual attribute of an object contained by this cube. --- 165,169 ---- * @return The maximum value of the named attribute over all contained objects */ ! public <V extends Comparable<? super V>> V getLast(Attribute<V,T> attribute); /** Get the value of an individual attribute of an object contained by this cube. *************** *** 157,161 **** * @return The value of the named attribute at the provided point reference */ ! public Object getAttribute(String attribute, Object point_ref); /** Get an iterator over all points (objects) within this cube. --- 173,177 ---- * @return The value of the named attribute at the provided point reference */ ! public <V extends Comparable<? super V>> V getAttribute(Attribute<V,T> attribute, T obj); /** Get an iterator over all points (objects) within this cube. *************** *** 169,180 **** * @return An iterator of <I>point references</I> */ ! public Iterator iterator(); - /** Get a set of all the values of a given attribute across all contained objects. - * - * @param attribute Attribute name for which set of values is to be retrieved - * @return A set of all the values of the given attribute within this cube - */ - public SortedSet getAttributeSet(String attribute); /** Group data by a given attribute. --- 185,190 ---- * @return An iterator of <I>point references</I> */ ! public Iterator<T> iterator(); /** Group data by a given attribute. *************** *** 188,192 **** * @return An iterator over Cubes containing elements with the same attribute value */ ! public Iterator groupBy(Sort sort); /** Group data by several attributes. --- 198,202 ---- * @return An iterator over Cubes containing elements with the same attribute value */ ! public Iterator<Cube<T>> groupBy(Sort sort); /** Group data by several attributes. *************** *** 199,203 **** * @return An iterator over Cubes containing elements with the same attribute value */ ! public Iterator groupBy(Sort[] sorts); /** Add all the data items in the given Cube to this cube. --- 209,213 ---- * @return An iterator over Cubes containing elements with the same attribute value */ ! public Iterator<Cube<T>> groupBy(Sort[] sorts); /** Add all the data items in the given Cube to this cube. *************** *** 208,212 **** * @param cube Collection of elements to add */ ! public void addAll(Cube cube); /** Get metadata describing this cube. --- 218,222 ---- * @param cube Collection of elements to add */ ! public void addAll(Cube<T> cube); /** Get metadata describing this cube. *************** *** 214,218 **** * @return A CubeDescriptor object describing the properties of this Cube */ ! public CubeDescriptor getDescriptor(); /** Create a cube containing the union of data in this cube and some other cube. --- 224,228 ---- * @return A CubeDescriptor object describing the properties of this Cube */ ! public CubeDescriptor<T> getDescriptor(); /** Create a cube containing the union of data in this cube and some other cube. *************** *** 221,224 **** * @return a cube containing the union of data in this cube and <I>other</I> */ ! public Cube union(Cube other); } --- 231,234 ---- * @return a cube containing the union of data in this cube and <I>other</I> */ ! public Cube<T> union(Cube<T> other); } Index: CubeDescriptor.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/CubeDescriptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CubeDescriptor.java 11 Jun 2004 23:24:23 -0000 1.5 --- CubeDescriptor.java 6 Oct 2008 10:22:14 -0000 1.6 *************** *** 11,19 **** package org.jdaemon.era; ! import org.jdaemon.util.AttributeList; ! import org.jdaemon.util.Accessor; import java.util.Iterator; - import java.util.Comparator; /** Represents metadata describing a cube. --- 11,18 ---- package org.jdaemon.era; ! import org.jdaemon.util.attribute.Attribute; + import java.util.Map; import java.util.Iterator; /** Represents metadata describing a cube. *************** *** 26,30 **** * @author Jonathan Essex */ ! public interface CubeDescriptor { /** Make a new cube of the type described by this Descriptor --- 25,29 ---- * @author Jonathan Essex */ ! public interface CubeDescriptor<T> { /** Make a new cube of the type described by this Descriptor *************** *** 32,36 **** * @return A root cube describing a particular universe of data. */ ! Cube makeCube(); /** Get the names of all attributes of the described cubes. --- 31,35 ---- * @return A root cube describing a particular universe of data. */ ! public Cube<T> makeCube(); /** Get the names of all attributes of the described cubes. *************** *** 40,77 **** * @return An iterator over all the attributes. */ ! Iterator getAttributeNames(); ! /** Get metadata attributes for a given cube attribute. ! * ! * Note: This should probably return a DataRepresentation... (JE) ! * @return An AttributeList containing all the metadata associated with a given attribute. ! * @param attribute_name Name of the attribute for which metadata is to be retrieved ! */ ! AttributeList getMetadata(String attribute_name); ! /** Get accessor for cube attributes. ! * ! * It is perfectly valid for this method to return null; this would be the case where ! * a cube has no accessor or the accessor is dependent on a cube instance rather than ! * common to all cubes sharing a given descriptor. ! * ! * @return An Accessor object capable of retrieving attribute values from any point reference obtained from a cube of this type. ! */ ! Accessor getAccessor(); - /** Get comparator for a given attribute. - * <P> - * It is prefectly valid for this method to return null; this would be the case where - * a cube performs its own comparision operations (for instance using some underling SQL - * database) and a java Comparator object is not therefore useful. - * </P><P> - * Implementors are encouraged however to implement this method to return something which - * has as similar as possible (ideally identical) semantics to the comparison operations - * performed by the underlying data store. This will be necessary for some advanced features - * (such as in-process data caching) to perform correctly. - * </P> - * @return A comparator object valid for values of the given attribute. - * @param attribute_name Name of the attribute for which Comparator is to be found. - */ - Comparator getComparator(String attribute_name); } --- 39,50 ---- * @return An iterator over all the attributes. */ ! public Iterator<String> getAttributeNames(); ! ! public Attribute<?,T> getAttribute(String name); ! public Map<String,Attribute<?,T>> getAttributeMap(); ! public Iterator<Attribute<?,T>> getAttributes(); } + Index: Grouping.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Grouping.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Grouping.java 13 Jun 2004 21:05:18 -0000 1.11 --- Grouping.java 6 Oct 2008 10:22:14 -0000 1.12 *************** *** 11,17 **** package org.jdaemon.era; import java.util.List; - import java.util.ArrayList; - import java.util.Arrays; /** Describes and manipulates a single 'grouping level' within a Report. --- 11,17 ---- package org.jdaemon.era; + import org.jdaemon.util.attribute.Attribute; + import java.util.List; /** Describes and manipulates a single 'grouping level' within a Report. *************** *** 19,23 **** * @author Jonathan Essex */ ! public interface Grouping { /** Add a sort to the current grouping level. --- 19,23 ---- * @author Jonathan Essex */ ! public interface Grouping<C> { /** Add a sort to the current grouping level. *************** *** 27,31 **** * @param sort sort to add */ ! public void addSort(Sort sort); /** Add an aggregate to the current grouping level. --- 27,31 ---- * @param sort sort to add */ ! public <T extends Comparable<? super T>> void addSort(Sort<T,C> sort); /** Add an aggregate to the current grouping level. *************** *** 35,39 **** * @param aggregate aggregate to add */ ! public void addAggregate(Aggregate aggregate); /** Sets the sorts for the current grouping level. --- 35,39 ---- * @param aggregate aggregate to add */ ! public <T extends Comparable<? super T>> void addAggregate(Aggregate<T,C> aggregate); /** Sets the sorts for the current grouping level. *************** *** 41,47 **** * Optional - read-only grouping need not implement this method. * ! * @param sorts Array of sorts which defines how data within the current grouping level will be sorted */ ! public void setSorts(Sort[] sorts); /** Sets the aggregates for the current grouping level. --- 41,47 ---- * Optional - read-only grouping need not implement this method. * ! * @param sorts List of sorts which defines how data within the current grouping level will be sorted */ ! public void setSorts(List<Sort<?,C>> sorts); /** Sets the aggregates for the current grouping level. *************** *** 51,65 **** * @param aggregate aggregate to add */ ! public void setAggregates(Aggregate[] aggregates); /** Add an aggregate function to the current grouping level. * * Optional - read-only grouping need not implement this method. ! * Equivalent to addAggregate(new Aggregate(attribute_name, type)). * * @param attribute_name Name of attribute on which aggregation will be performed * @param type Type of aggregation to perform (one of Aggregate.SUM, Aggregate.MAX... etc) */ ! public void addAggregate(String attribute_name, int type); /** Add a sort to the current grouping level --- 51,65 ---- * @param aggregate aggregate to add */ ! public void setAggregates(List<Aggregate<?,C>> aggregates); /** Add an aggregate function to the current grouping level. * * Optional - read-only grouping need not implement this method. ! * Equivalent to addAggregate(new Aggregate(attribute, type)). * * @param attribute_name Name of attribute on which aggregation will be performed * @param type Type of aggregation to perform (one of Aggregate.SUM, Aggregate.MAX... etc) */ ! public <T extends Comparable<? super T>> void addAggregate(Attribute<T,C> attr, int type); /** Add a sort to the current grouping level *************** *** 68,75 **** * Equivalent to addSort(new Sort(attribute_name, direction)). * ! * @param attribute_name Name of attribute to sort * @param direction direction of sort (one of Sort.ASCENDING, Sort.DESCENDING) */ ! public void addSort(String attribute_name, int direction); /** Get a list of the Sorts in the current grouping level. --- 68,75 ---- * Equivalent to addSort(new Sort(attribute_name, direction)). * ! * @param attribute attribute to sort * @param direction direction of sort (one of Sort.ASCENDING, Sort.DESCENDING) */ ! public <T extends Comparable<? super T>> void addSort(Attribute<T,C> attribute, int direction); /** Get a list of the Sorts in the current grouping level. *************** *** 77,81 **** * @return A List of Sort objects. */ ! public List getSorts(); /** Get a list of all the Aggregates in the current grouping level. --- 77,81 ---- * @return A List of Sort objects. */ ! public List<Sort<?,C>> getSorts(); /** Get a list of all the Aggregates in the current grouping level. *************** *** 83,100 **** * @return a List of Aggregate objects */ ! public List getAggregates(); /** Get a list of the Sorts in the current grouping level. ! * ! * @return A List of Sort objects. ! */ ! public Sort[] getSortsArray(); ! ! /** Get a list of all the Aggregates in the current grouping level. ! * ! * @return a List of Aggregate objects ! */ ! public Aggregate[] getAggregatesArray(); ! /** Get the Formatting object for the current grouping level. * --- 83,90 ---- * @return a List of Aggregate objects */ ! public List<Aggregate<?,C>> getAggregates(); /** Get a list of the Sorts in the current grouping level. ! /** Get the Formatting object for the current grouping level. * *************** *** 113,117 **** * @return true if this grouping can be changed. */ ! public boolean isModifiable(); ! } --- 103,106 ---- * @return true if this grouping can be changed. */ ! public boolean isModifiable(); } Index: Report.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Report.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Report.java 14 Jun 2004 17:50:35 -0000 1.13 --- Report.java 6 Oct 2008 10:22:14 -0000 1.14 *************** *** 22,26 **** * @author Jonathan Essex */ ! public interface Report { /** Get an XML view of a cube. --- 22,26 ---- * @author Jonathan Essex */ ! public interface Report<C> { /** Get an XML view of a cube. *************** *** 36,40 **** * @return An XMLWritable view of the given cube */ ! public XMLWritable getXMLView(Cube cube) throws CubeException; /** Build an XML view describing this Report using information from the cube descriptor. --- 36,40 ---- * @return An XMLWritable view of the given cube */ ! public XMLWritable getXMLView(Cube<C> cube) throws CubeException; /** Build an XML view describing this Report using information from the cube descriptor. *************** *** 47,51 **** * @return An XMLWritable view describing the document generated by this report operating on a cube of the given type */ ! public XMLWritable getXMLViewDescriptor(CubeDescriptor descriptor) throws CubeException; /** Get the grouping associated with a report. --- 47,51 ---- * @return An XMLWritable view describing the document generated by this report operating on a cube of the given type */ ! public XMLWritable getXMLViewDescriptor(CubeDescriptor<C> descriptor) throws CubeException; /** Get the grouping associated with a report. *************** *** 59,63 **** * @return a List of Grouping objects */ ! public List groupingsList(); /** Create a new Grouping which can be added to the groupings list. --- 59,63 ---- * @return a List of Grouping objects */ ! public List<Grouping<C>> groupingsList(); /** Create a new Grouping which can be added to the groupings list. *************** *** 65,69 **** * @return A new Grouping which can be added to the groupings list. */ ! public Grouping newGrouping(); /** Set whether report shows detail data within bottom-most grouping level. --- 65,69 ---- * @return A new Grouping which can be added to the groupings list. */ ! public Grouping<C> newGrouping(); /** Set whether report shows detail data within bottom-most grouping level. Index: Sort.java =================================================================== RCS file: /cvsroot/era/src/org/jdaemon/era/Sort.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Sort.java 12 Feb 2008 23:05:03 -0000 1.9 --- Sort.java 6 Oct 2008 10:22:14 -0000 1.10 *************** *** 10,13 **** --- 10,14 ---- package org.jdaemon.era; + import org.jdaemon.util.attribute.Attribute; /** Specifies a sort operation which a Cube can apply to data. *************** *** 15,19 **** * @author Jonathan Essex */ ! public class Sort { /** Parameter value indicating an ascending sort order --- 16,20 ---- * @author Jonathan Essex */ ! public class Sort<T extends Comparable<? super T>,C> { /** Parameter value indicating an ascending sort order *************** *** 24,28 **** public static final int DESCENDING = 1; ! private String attribute_name; private int direction; --- 25,29 ---- public static final int DESCENDING = 1; ! private Attribute<T,C> attribute; private int direction; *************** *** 31,36 **** * @param direction Direction of sort (either SORT_ASCENDING or SORT_DESCENDING) */ ! public Sort(String attribute_name, int direction) { ! this.attribute_name = attribute_name; this.direction = direction; } --- 32,37 ---- * @param direction Direction of sort (either SORT_ASCENDING or SORT_DESCENDING) */ ! public Sort(Attribute<T,C> attribute, int direction) { ! this.attribute = attribute; this.direction = direction; } *************** *** 44,53 **** } ! /** Get attribute name. * ! * @return value of attribute name property */ ! public String getAttributeName() { ! return attribute_name; } --- 45,54 ---- } ! /** Get attribute * ! * @return Attribute property */ ! public Attribute<T,C> getAttribute() { ! return attribute; } *************** *** 55,59 **** public int hashCode() { int hash = 7; ! hash = 53 * hash + (this.attribute_name != null ? this.attribute_name.hashCode() : 0); hash = 53 * hash + this.direction; return hash; --- 56,60 ---- public int hashCode() { int hash = 7; ! hash = 53 * hash + (this.attribute != null ? this.attribute.hashCode() : 0); hash = 53 * hash + this.direction; return hash; *************** *** 69,73 **** if (obj instanceof Sort) { Sort other = (Sort)obj; ! return (this.direction == other.direction && this.attribute_name.equals(other.attribute_name)); } else { return false; --- 70,74 ---- if (obj instanceof Sort) { Sort other = (Sort)obj; ! return (this.direction == other.direction && this.attribute.equals(other.attribute)); } else { return false; |