org.gudy.azureus2.pluginsimpl.local.utils
Class FormattersImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.utils.FormattersImpl
All Implemented Interfaces:
Formatters

public class FormattersImpl
extends java.lang.Object
implements Formatters


Field Summary
 
Fields inherited from interface org.gudy.azureus2.plugins.utils.Formatters
BYTE_ENCODING, TEXT_ENCODING
 
Constructor Summary
FormattersImpl()
           
 
Method Summary
 byte[] base32Decode(java.lang.String data)
           
 java.lang.String base32Encode(byte[] data)
           
 java.util.Map bDecode(byte[] data)
           
 byte[] bEncode(java.util.Map map)
           
 byte[] decodeBytesFromString(java.lang.String str)
           
 java.lang.String encodeBytesToString(byte[] bytes)
           
 java.lang.String formatByteArray(byte[] data, boolean no_spaces)
           
 java.lang.String formatByteCountToKiBEtc(long bytes)
           
 java.lang.String formatByteCountToKiBEtcPerSec(long bytes)
           
 java.lang.String formatDate(long millis)
           
 java.lang.String formatDateOnly(long millis)
           
 java.lang.String formatETAFromSeconds(long seconds)
          Format seconds remaining into an ETA value.
 java.lang.String formatPercentFromThousands(long thousands)
           
 java.lang.String formatTimeFromSeconds(long seconds)
           
 java.lang.String formatTimeOnly(long millis)
           
 java.lang.String formatTimeOnly(long millis, boolean with_secs)
           
 java.util.Comparator getAlphanumericComparator(boolean ignore_case)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormattersImpl

public FormattersImpl()
Method Detail

formatByteCountToKiBEtc

public java.lang.String formatByteCountToKiBEtc(long bytes)
Specified by:
formatByteCountToKiBEtc in interface Formatters

formatByteCountToKiBEtcPerSec

public java.lang.String formatByteCountToKiBEtcPerSec(long bytes)
Specified by:
formatByteCountToKiBEtcPerSec in interface Formatters

formatPercentFromThousands

public java.lang.String formatPercentFromThousands(long thousands)
Specified by:
formatPercentFromThousands in interface Formatters

formatByteArray

public java.lang.String formatByteArray(byte[] data,
                                        boolean no_spaces)
Specified by:
formatByteArray in interface Formatters

encodeBytesToString

public java.lang.String encodeBytesToString(byte[] bytes)
Specified by:
encodeBytesToString in interface Formatters

decodeBytesFromString

public byte[] decodeBytesFromString(java.lang.String str)
Specified by:
decodeBytesFromString in interface Formatters

formatDate

public java.lang.String formatDate(long millis)
Specified by:
formatDate in interface Formatters

formatTimeOnly

public java.lang.String formatTimeOnly(long millis)
Specified by:
formatTimeOnly in interface Formatters

formatTimeOnly

public java.lang.String formatTimeOnly(long millis,
                                       boolean with_secs)
Specified by:
formatTimeOnly in interface Formatters

formatDateOnly

public java.lang.String formatDateOnly(long millis)
Specified by:
formatDateOnly in interface Formatters

formatTimeFromSeconds

public java.lang.String formatTimeFromSeconds(long seconds)
Specified by:
formatTimeFromSeconds in interface Formatters

formatETAFromSeconds

public java.lang.String formatETAFromSeconds(long seconds)
Description copied from interface: Formatters
Format seconds remaining into an ETA value.

Specified by:
formatETAFromSeconds in interface Formatters
Returns:

bEncode

public byte[] bEncode(java.util.Map map)
               throws java.io.IOException
Specified by:
bEncode in interface Formatters
Throws:
java.io.IOException

bDecode

public java.util.Map bDecode(byte[] data)
                      throws java.io.IOException
Specified by:
bDecode in interface Formatters
Throws:
java.io.IOException

base32Encode

public java.lang.String base32Encode(byte[] data)
Specified by:
base32Encode in interface Formatters

base32Decode

public byte[] base32Decode(java.lang.String data)
Specified by:
base32Decode in interface Formatters

getAlphanumericComparator

public java.util.Comparator getAlphanumericComparator(boolean ignore_case)
Specified by:
getAlphanumericComparator in interface Formatters