sbrt.shell.text
Class LongFormatV1

java.lang.Object
  extended by sbrt.shell.text.LongFormatV1
All Implemented Interfaces:
Format, Formatter<java.lang.Long>, LongFormat, Parser<java.lang.Long>, SimpleFormat<java.lang.Long>

public class LongFormatV1
extends java.lang.Object
implements LongFormat

This class is a concrete implementation of LongFormat.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
LongFormatV1()
           
 
Method Summary
 java.lang.String format(long i)
          Parses the provided string and returns its corresponding long.
 java.lang.String format(java.lang.Long i)
          Returns a formatted string representation of the provided long.
 java.lang.Long parse(java.lang.String i)
          Parses the provided string and returns its corresponding long.
 long parsePrimitive(java.lang.String i)
          Parses the provided string and returns its corresponding long.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongFormatV1

public LongFormatV1()
Method Detail

format

public java.lang.String format(java.lang.Long i)
Returns a formatted string representation of the provided long. See Long.toString(long) for the exact formatting rules.

Specified by:
format in interface Formatter<java.lang.Long>
Specified by:
format in interface LongFormat
Parameters:
i - the long to be formatted.
Returns:
a formatted string representation of the provided long.

format

public java.lang.String format(long i)
Parses the provided string and returns its corresponding long. See Long.valueOf(String) for the exact formatting rules.

Specified by:
format in interface LongFormat
Parameters:
i - the string to be parsed.
Returns:
the long corresponding to the provided string.
Throws:
FormatException - if the provided string is not parsable as a long.
java.lang.NullPointerException - if the provided argument is null.

parse

public java.lang.Long parse(java.lang.String i)
Parses the provided string and returns its corresponding long. See Long.valueOf(String) for the exact formatting rules.

Specified by:
parse in interface LongFormat
Specified by:
parse in interface Parser<java.lang.Long>
Parameters:
i - the string to be parsed.
Returns:
the long corresponding to the provided string.
Throws:
FormatException - if the provided string is not parsable as a long.
java.lang.NullPointerException - if the provided argument is null.

parsePrimitive

public long parsePrimitive(java.lang.String i)
Parses the provided string and returns its corresponding long. See Long.valueOf(String) for the exact formatting rules.

Specified by:
parsePrimitive in interface LongFormat
Parameters:
i - the string to be parsed.
Returns:
the long corresponding to the provided string.
Throws:
FormatException - if the provided string is not parsable as a long.
java.lang.NullPointerException - if the provided argument is null.