[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] xpetstore-ejb3.0/xpetstore-ejb/java/xpetstore/util Page.java
From:       Gavin King <oneovthafew () users ! sourceforge ! net>
Date:       2004-06-29 4:37:59
Message-ID: E1BfANb-00057f-CF () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

  User: oneovthafew
  Date: 04/06/28 21:37:58

  Modified:    xpetstore-ejb/java/xpetstore/util Page.java
  Log:
  my cleanups
  
  Revision  Changes    Path
  1.2       +15 -25    xpetstore-ejb3.0/xpetstore-ejb/java/xpetstore/util/Page.java
  
  Index: Page.java
  ===================================================================
  RCS file: /cvsroot/jboss/xpetstore-ejb3.0/xpetstore-ejb/java/xpetstore/util/Page.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Page.java	25 Jun 2004 17:17:43 -0000	1.1
  +++ Page.java	29 Jun 2004 04:37:58 -0000	1.2
  @@ -9,59 +9,49 @@
   /**

    * @author <a href="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>

    */

  -public class Page

  -    implements Serializable

  +public class Page implements Serializable

   {

  -    //~ Static fields/initializers ---------------------------------------------

   

       public static final Page EMPTY_PAGE = new Page( Collections.EMPTY_LIST, 0, false );

   

  -    //~ Instance fields --------------------------------------------------------

  -

       Collection list;

  -    int        start;

  -    boolean    hasNext;

  -

  -    //~ Constructors -----------------------------------------------------------

  +    int start;

  +    boolean hasNext;

   

  -    public Page( Collection col,

  -                 int        start,

  -                 boolean    hasNext )

  +    public Page(Collection col, int start, boolean hasNext)

       {

  -        this.list    = new ArrayList( col );

  -        this.start   = start;

  +        this.list = new ArrayList(col);

  +        this.start = start;

           this.hasNext = hasNext;

       }

   

  -    //~ Methods ----------------------------------------------------------------

  -

  -    public Collection getList(  )

  +    public Collection getList()

       {

           return list;

       }

   

  -    public boolean isNextPageAvailable(  )

  +    public boolean isNextPageAvailable()

       {

           return hasNext;

       }

   

  -    public boolean isPreviousPageAvailable(  )

  +    public boolean isPreviousPageAvailable()

       {

           return start > 0;

       }

   

  -    public int getStartOfNextPage(  )

  +    public int getStartOfNextPage()

       {

  -        return start + list.size(  );

  +        return start + list.size();

       }

   

  -    public int getStartOfPreviousPage(  )

  +    public int getStartOfPreviousPage()

       {

  -        return Math.max( start - list.size(  ), 0 );

  +        return Math.max( start - list.size(), 0 );

       }

   

  -    public int getSize(  )

  +    public int getSize()

       {

  -        return list.size(  );

  +        return list.size();

       }

   }

  
  
  


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic