com.tagtraum.perf.strings
Class NumberParser

java.lang.Object
  |
  +--com.tagtraum.perf.strings.NumberParser

public class NumberParser
extends java.lang.Object

Fast methods for parsing ints and longs.

Version:
$Id: $
Author:
Hendrik Schreiber

Field Summary
static int MAX_NEGATIVE_INTEGER_CHARS
           
static int MAX_NEGATIVE_LONG_CHARS
           
static int MAX_POSITIVE_INTEGER_CHARS
           
static int MAX_POSITIVE_LONG_CHARS
           
 
Constructor Summary
NumberParser()
           
 
Method Summary
static int parseInt(char[] cb, int offset, int length)
           
static int parseInt(java.lang.String s)
           
static int parseInt(java.lang.String s, int offset, int length)
           
static long parseLong(char[] cb, int offset, int length)
           
static long parseLong(java.lang.String s)
           
static long parseLong(java.lang.String s, int offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NEGATIVE_INTEGER_CHARS

public static final int MAX_NEGATIVE_INTEGER_CHARS

MAX_POSITIVE_INTEGER_CHARS

public static final int MAX_POSITIVE_INTEGER_CHARS

MAX_NEGATIVE_LONG_CHARS

public static final int MAX_NEGATIVE_LONG_CHARS

MAX_POSITIVE_LONG_CHARS

public static final int MAX_POSITIVE_LONG_CHARS
Constructor Detail

NumberParser

public NumberParser()
Method Detail

parseInt

public static int parseInt(char[] cb,
                           int offset,
                           int length)
                    throws java.lang.NumberFormatException
java.lang.NumberFormatException

parseInt

public static int parseInt(java.lang.String s)
                    throws java.lang.NumberFormatException
java.lang.NumberFormatException

parseInt

public static int parseInt(java.lang.String s,
                           int offset,
                           int length)
                    throws java.lang.NumberFormatException
java.lang.NumberFormatException

parseLong

public static long parseLong(java.lang.String s)
                      throws java.lang.NumberFormatException
java.lang.NumberFormatException

parseLong

public static long parseLong(java.lang.String s,
                             int offset,
                             int length)
                      throws java.lang.NumberFormatException
java.lang.NumberFormatException

parseLong

public static long parseLong(char[] cb,
                             int offset,
                             int length)
                      throws java.lang.NumberFormatException
java.lang.NumberFormatException


Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL