java - Most efficient data structure for sorting an ArrayList by categorical factors -
i have created object, let's call eventobject, hold results of sql query. objects aggregated single arraylist. trying develop method @ each eventobject in arraylist, , if equals given value of categorical factor, copies group.
for example, if timestamp value eventobject1 falls on sunday, copy object sunday level of weekday factor; if same timestamp falls in month of may, copy may level of month factor well, etc.
i stuck type of data structure(s) efficient sorting. not know how many eventobject fall level of given factor, , number of factors analyzed dependent upon id pass method. required have k factors, each known number of levels; , each level can have number of eventobjects after soring occurs.
should attempt hold factors in single arraylist? requires 3 dimensional structure. more prudent create separate data structure each factor?
Comments
Post a Comment