# HG changeset patch # User casties # Date 1478200356 -3600 # Node ID 3a3362f78d4830f61a4f3183ed8378cbd7bd39f2 # Parent 5b2a97d417d5873a50d8661873e5299af42641b4 small cleanup. diff -r 5b2a97d417d5 -r 3a3362f78d48 src/main/java/org/mpi/openmind/cache/WrapperService.java --- a/src/main/java/org/mpi/openmind/cache/WrapperService.java Thu Nov 03 20:12:11 2016 +0100 +++ b/src/main/java/org/mpi/openmind/cache/WrapperService.java Thu Nov 03 20:12:36 2016 +0100 @@ -188,24 +188,40 @@ return count; } - public List getEntityByDefSubList(String def, int fromIndex, - int toIndex) { - List list = new ArrayList(); - List all = getEntitiesByDef(def); - if (all != null && all.size() >= toIndex) { - - long start = System.currentTimeMillis(); - Collections.sort(list, new EntitySortByNormalizedOwnValue()); - long diff = System.currentTimeMillis() - start; - logger.info("Sorting entities time[ms] " + diff); - - for (Entity ent : all.subList(fromIndex, toIndex)) { - list.add(ent); - } - } - return list; - } + /** + * Returns a List of Entities of the given definition (object_class). + * + * All Entities are sorted by normalized own-value first. Then the + * part between fromIndex and toIndex is returned. + * + * @param def + * @param fromIndex + * @param toIndex + * @return + */ + public List getEntityByDefSubList(String def, int fromIndex, int toIndex) { + List list = new ArrayList(); + List all = getEntitiesByDef(def); + if (all != null && all.size() >= toIndex) { + long start = System.currentTimeMillis(); + Collections.sort(list, new EntitySortByNormalizedOwnValue()); + long diff = System.currentTimeMillis() - start; + logger.debug("Sorting entities time[ms] " + diff); + + for (Entity ent : all.subList(fromIndex, toIndex)) { + list.add(ent); + } + } + return list; + } + + /** + * Returns a List of all Entities of the given definition (object_class). + * + * @param def + * @return + */ public List getEntitiesByDef(String def) { List list = this.cache.loadEntitiesByDef(def); return list;