Map<ObjectName, DestinationView> getPagedDestinations(int page, int pageSize) { ImmutableMap.Builder<ObjectName, DestinationView> builder = ImmutableMap.builder(); int start = (page - 1) * pageSize; int end = Math.min(page * pageSize, destinations.size()); int i = 0; for (Map.Entry<ObjectName, DestinationView> entry : getOrdering().sortedCopy(destinations.entrySet())) { if (i >= start && i < end) { builder.put(entry.getKey(), entry.getValue()); } i++; } return builder.build(); }
Map<ObjectName, DestinationView> getPagedDestinations(int page, int pageSize) { ImmutableMap.Builder<ObjectName, DestinationView> builder = ImmutableMap.builder(); int start = (page - 1) * pageSize; int end = Math.min(page * pageSize, destinations.size()); int i = 0; for (Map.Entry<ObjectName, DestinationView> entry : getOrdering().sortedCopy(destinations.entrySet())) { if (i >= start && i < end) { builder.put(entry.getKey(), entry.getValue()); } i++; } return builder.build(); }
Map<ObjectName, DestinationView> getPagedDestinations(int page, int pageSize) { ImmutableMap.Builder<ObjectName, DestinationView> builder = ImmutableMap.builder(); int start = (page - 1) * pageSize; int end = Math.min(page * pageSize, destinations.size()); int i = 0; for (Map.Entry<ObjectName, DestinationView> entry : getOrdering().sortedCopy(destinations.entrySet())) { if (i >= start && i < end) { builder.put(entry.getKey(), entry.getValue()); } i++; } return builder.build(); }
Map<ObjectName, DestinationView> getPagedDestinations(int page, int pageSize) { ImmutableMap.Builder<ObjectName, DestinationView> builder = ImmutableMap.builder(); int start = (page - 1) * pageSize; int end = Math.min(page * pageSize, destinations.size()); int i = 0; for (Map.Entry<ObjectName, DestinationView> entry : getOrdering().sortedCopy(destinations.entrySet())) { if (i >= start && i < end) { builder.put(entry.getKey(), entry.getValue()); } i++; } return builder.build(); }