com.limegroup.gnutella.gui.tables
Class SizeHolder

java.lang.Object
  extended bycom.limegroup.gnutella.gui.tables.SizeHolder
All Implemented Interfaces:
java.lang.Comparable

public final class SizeHolder
extends java.lang.Object
implements java.lang.Comparable

Wrapper class that holds on to the size integer for a file so that we don't have to read it from disk every time while sorting.


Constructor Summary
SizeHolder(int size)
          The constructor sets the size and string variables, creating a formatted string in kilobytes from the size value.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 int getSize()
          Returns the size of the file in kilobytes.
 void setSize(int size)
          Sets the size held.
 java.lang.String toString()
          Returns the string value of this size, formatted with commas and "KB" appended to the end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SizeHolder

public SizeHolder(int size)
The constructor sets the size and string variables, creating a formatted string in kilobytes from the size value.

Parameters:
size - the size of the file in kilobytes
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Returns the string value of this size, formatted with commas and "KB" appended to the end.

Returns:
the formatted string representing the size

setSize

public void setSize(int size)
Sets the size held.

Parameters:
size - the new size to hold

getSize

public int getSize()
Returns the size of the file in kilobytes.

Returns:
the size of the file in kilobytes