From 5f781e6266c7979747be38521834acba4f3e4fa5 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 11 Feb 2010 23:24:45 +0000 Subject: [PATCH] generified PagedListHolded (SPR-6825) --- .../beans/support/PagedListHolder.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/support/PagedListHolder.java b/org.springframework.beans/src/main/java/org/springframework/beans/support/PagedListHolder.java index 8262a1fb6d..2ed2c98955 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/support/PagedListHolder.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/support/PagedListHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,14 +47,14 @@ import org.springframework.util.Assert; * @see #getPageList() * @see org.springframework.beans.support.MutableSortDefinition */ -public class PagedListHolder implements Serializable { +public class PagedListHolder implements Serializable { public static final int DEFAULT_PAGE_SIZE = 10; public static final int DEFAULT_MAX_LINKED_PAGES = 10; - private List source; + private List source; private Date refreshDate; @@ -77,7 +77,7 @@ public class PagedListHolder implements Serializable { * @see #setSource */ public PagedListHolder() { - this(new ArrayList(0)); + this(new ArrayList(0)); } /** @@ -86,7 +86,7 @@ public class PagedListHolder implements Serializable { * @param source the source List * @see MutableSortDefinition#setToggleAscendingOnProperty */ - public PagedListHolder(List source) { + public PagedListHolder(List source) { this(source, new MutableSortDefinition(true)); } @@ -95,7 +95,7 @@ public class PagedListHolder implements Serializable { * @param source the source List * @param sort the SortDefinition to start with */ - public PagedListHolder(List source, SortDefinition sort) { + public PagedListHolder(List source, SortDefinition sort) { setSource(source); setSort(sort); } @@ -104,7 +104,7 @@ public class PagedListHolder implements Serializable { /** * Set the source list for this holder. */ - public void setSource(List source) { + public void setSource(List source) { Assert.notNull(source, "Source List must not be null"); this.source = source; this.refreshDate = new Date(); @@ -114,7 +114,7 @@ public class PagedListHolder implements Serializable { /** * Return the source list for this holder. */ - public List getSource() { + public List getSource() { return this.source; } @@ -268,7 +268,7 @@ public class PagedListHolder implements Serializable { /** * Return a sub-list representing the current page. */ - public List getPageList() { + public List getPageList() { return getSource().subList(getFirstElementOnPage(), getLastElementOnPage() + 1); } @@ -325,7 +325,7 @@ public class PagedListHolder implements Serializable { * Can be overridden in subclasses. * @see PropertyComparator#sort(java.util.List, SortDefinition) */ - protected void doSort(List source, SortDefinition sort) { + protected void doSort(List source, SortDefinition sort) { PropertyComparator.sort(source, sort); }