Package org.dspace.statistics

Examples of org.dspace.statistics.Dataset.addValueToMatrix()


                        pageViews = 0;
                    }else{
                        pageViews = (float) totalPageViews.getCount() / totalFiltered.getCount();
                    }

                    dataset.addValueToMatrix(0, 2, pageViewFormat.format(pageViews));
                }
            }else{
                throw new IllegalArgumentException("Data generator with class" + datasetGenerator.getClass().getName() + " is not supported by the statistics search engine !");
            }
        }
View Full Code Here


                        ObjectCount[] results = SolrLogger.queryFacetDate(query, filterQuery, dataSetQuery.getMax(), dateFacet.getDateType(), dateFacet.getStartDate(), dateFacet.getEndDate(), showTotal, context);
                        dataset = new Dataset(1, results.length);
                        // Now that we have our results put em in a matrix
                        for(int j = 0; j < results.length; j++){
                            dataset.setColLabel(j, results[j].getValue());
                            dataset.addValueToMatrix(0, j, results[j].getCount());
                        }
                        // TODO: change this !
                        // Now add the column label
                        dataset.setRowLabel(0, getResultName(dataSetQuery.getName(), dataSetQuery, context));
                        dataset.setRowLabelAttr(0, getAttributes(dataSetQuery.getName(), dataSetQuery, context));
View Full Code Here

                                // No need to add this many times
                                if(j == 0)
                                {
                                    dataset.setColLabel(k, objectCount.getValue());
                                }
                                dataset.addValueToMatrix(j, k, objectCount.getCount());
                            }
                        }
                        if(dataset != null && !(getDatasetGenerators().get(0) instanceof DatasetTimeGenerator)){
                            dataset.flipRowCols();
                        }
View Full Code Here

                        {
                            facetQuery += " AND type:" + secondDataSet.getQueries().get(0).getDsoType();
                        }

                        // We got our query so now get the value
                        dataset.addValueToMatrix(j, i, facetResult.get(facetQuery));
                    }

                    /*
                    for (int j = 0; j < topCounts2.length; j++) {
                        ObjectCount count2 = topCounts2[j];
View Full Code Here

                dataset = new Dataset(1, topCounts1.length);
                for (int i = 0; i < topCounts1.length; i++) {
                    ObjectCount count = topCounts1[i];
                    dataset.setColLabel(i, getResultName(count.getValue(), firsDataset, context));
                    dataset.setColLabelAttr(i, getAttributes(count.getValue(), firsDataset, context));
                    dataset.addValueToMatrix(0, i, count.getCount());
                }
            }

        }
        if(dataset != null){
View Full Code Here

                    dataset.setColLabel(2, "average");
                }
                for (int i = 0; i < topCounts.length; i++) {
                    ObjectCount topCount = topCounts[i];
                    dataset.setRowLabel(i, String.valueOf(i + 1));
                    dataset.addValueToMatrix(i, 0, topCount.getValue());
                    dataset.addValueToMatrix(i, 1, topCount.getCount());
                    if(averageMonths != -1){
                        //Calculate the average of one month
                        long monthlyAverage = 0;
                        if(totalFieldCounts.get(topCount.getValue()) != null){
View Full Code Here

                }
                for (int i = 0; i < topCounts.length; i++) {
                    ObjectCount topCount = topCounts[i];
                    dataset.setRowLabel(i, String.valueOf(i + 1));
                    dataset.addValueToMatrix(i, 0, topCount.getValue());
                    dataset.addValueToMatrix(i, 1, topCount.getCount());
                    if(averageMonths != -1){
                        //Calculate the average of one month
                        long monthlyAverage = 0;
                        if(totalFieldCounts.get(topCount.getValue()) != null){
                            monthlyAverage = totalFieldCounts.get(topCount.getValue()) / monthDifference;
View Full Code Here

                        long monthlyAverage = 0;
                        if(totalFieldCounts.get(topCount.getValue()) != null){
                            monthlyAverage = totalFieldCounts.get(topCount.getValue()) / monthDifference;
                        }
                        //We multiple our average for one month by the number of
                        dataset.addValueToMatrix(i, 2, (monthlyAverage * averageMonths));
                    }

                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.