Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.esau.ptarmigan.util
Class HelperMisc  view HelperMisc download HelperMisc.java

java.lang.Object
  extended byorg.esau.ptarmigan.util.HelperMisc

public final class HelperMisc
extends java.lang.Object

Some static methods of general use

Version:
$Revision: 1.3 $ $Date: 2002/09/19 03:35:45 $

Constructor Summary
HelperMisc()
           
 
Method Summary
static java.lang.String clean(java.lang.String str)
          Removes all chars that do not fit into the categories (isLetterOrDigit, isWhitespace, printable ASCII); does not trim().
static java.lang.String cleanAlpha(java.lang.String str)
          Removes all non-alpha chars
static int parseInt(java.lang.String str, int default_val)
          a safe integer parser
static boolean startsWith(byte[] haystack, int haystack_offset, int haystack_count, byte[] needle)
          is the needle the first thing in the haystack?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelperMisc

public HelperMisc()
Method Detail

parseInt

public static int parseInt(java.lang.String str,
                           int default_val)
a safe integer parser


startsWith

public static boolean startsWith(byte[] haystack,
                                 int haystack_offset,
                                 int haystack_count,
                                 byte[] needle)
is the needle the first thing in the haystack?


cleanAlpha

public static java.lang.String cleanAlpha(java.lang.String str)
Removes all non-alpha chars


clean

public static java.lang.String clean(java.lang.String str)
Removes all chars that do not fit into the categories (isLetterOrDigit, isWhitespace, printable ASCII); does not trim(). TODO: figure out some way to include non-ASCII punctuation characters.