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 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(String data)
           
 String base32Encode(byte[] data)
           
 Map bDecode(byte[] data)
           
 byte[] bEncode(Map map)
           
 byte[] decodeBytesFromString(String str)
           
 String encodeBytesToString(byte[] bytes)
           
 String formatByteArray(byte[] data, boolean no_spaces)
           
 String formatByteCountToKiBEtc(long bytes)
           
 String formatByteCountToKiBEtcPerSec(long bytes)
           
 String formatDate(long millis)
           
 String formatDateOnly(long millis)
           
 String formatETAFromSeconds(long seconds)
          Format seconds remaining into an ETA value.
 String formatPercentFromThousands(long thousands)
           
 String formatTimeFromSeconds(long seconds)
           
 String formatTimeOnly(long millis)
           
 String formatTimeOnly(long millis, boolean with_secs)
           
 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 String formatByteCountToKiBEtc(long bytes)
Specified by:
formatByteCountToKiBEtc in interface Formatters

formatByteCountToKiBEtcPerSec

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

formatPercentFromThousands

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

formatByteArray

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

encodeBytesToString

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

decodeBytesFromString

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

formatDate

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

formatTimeOnly

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

formatTimeOnly

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

formatDateOnly

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

formatTimeFromSeconds

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

formatETAFromSeconds

public 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(Map map)
               throws IOException
Specified by:
bEncode in interface Formatters
Throws:
IOException

bDecode

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

base32Encode

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

base32Decode

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

getAlphanumericComparator

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