@Test public void testGetRanksFromValues() { logger.info("getRanksFromValues"); FlatDataList flatDataCollection = new FlatDataList(Arrays.asList(new Object[]{50,10,10,30,40})); FlatDataList expResult = new FlatDataList(Arrays.asList(new Object[]{5.0,1.5,1.5,3.0,4.0})); AssociativeArray expResult2 = new AssociativeArray(new HashMap<>()); expResult2.put(10, 2); AssociativeArray tiesCounter = Ranks.getRanksFromValues(flatDataCollection); assertEquals(expResult, flatDataCollection); assertEquals(expResult2, tiesCounter); }
public static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection) { AssociativeArray tiesCounter = new AssociativeArray(); Map<Object, Double> key2AvgRank = new LinkedHashMap<>(); _buildRankArrays(flatDataCollection, tiesCounter, key2AvgRank); int i = 0; for (Object value : flatDataCollection) { flatDataCollection.set(i++, key2AvgRank.get(value)); } return tiesCounter; }
Ranks { public static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection) { AssociativeArray tiesCounter = new AssociativeArray(); Map<Object, Double> key2AvgRank = new LinkedHashMap<>(); _buildRankArrays(flatDataCollection, tiesCounter, key2AvgRank); int i = 0; for (Object value : flatDataCollection) { flatDataCollection.set(i++, key2AvgRank.get(value)); } return tiesCounter; } }
Ranks { public static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection) { AssociativeArray tiesCounter = new AssociativeArray(); Map<Object, Double> key2AvgRank = new LinkedHashMap<>(); _buildRankArrays(flatDataCollection, tiesCounter, key2AvgRank); int i = 0; for (Object value : flatDataCollection) { flatDataCollection.set(i++, key2AvgRank.get(value)); } return tiesCounter; }  }
Ranks { public static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection) { AssociativeArray tiesCounter = new AssociativeArray(); Map<Object, Double> key2AvgRank = new LinkedHashMap<>(); _buildRankArrays(flatDataCollection, tiesCounter, key2AvgRank); int i = 0; for (Object value : flatDataCollection) { flatDataCollection.set(i++, key2AvgRank.get(value)); } return tiesCounter; }  static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection); static AssociativeArray getRanksFromValues(AssociativeArray associativeArray); }
Ranks { public static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection) { AssociativeArray tiesCounter = new AssociativeArray(); Map<Object, Double> key2AvgRank = new LinkedHashMap<>(); _buildRankArrays(flatDataCollection, tiesCounter, key2AvgRank); int i = 0; for (Object value : flatDataCollection) { flatDataCollection.set(i++, key2AvgRank.get(value)); } return tiesCounter; }  static AssociativeArray getRanksFromValues(FlatDataList flatDataCollection); static AssociativeArray getRanksFromValues(AssociativeArray associativeArray);  }