/*******************************************************************************
 * Copyright (c), 2001, 2002 N2 Broadband, Inc.  All Rights Reserved.
 *
 * This module contains unpublished, confidential, proprietary
 * material.  The use and dissemination of this material are
 * governed by a license.  The above copyright notice does not
 * evidence any actual or intended publication of this material.
 *
 * Author:  Drake H. Henderson
 * Created:  11-12-01
 *
 ******************************************************************************/
package com.n2bb.util;

public class N2bbUtility {

  public static boolean isName(String name) {
    name = name.trim();
    String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' -_.";
    for (int i = 0; i < name.length(); i++) {
      if (characters.indexOf(name.charAt(i)) == -1) {
        return false;
      }
    }
    return true;
  }

  public static boolean isDigits(String name) {
    name = name.trim();
    String characters = "0123456789";
    for (int i = 0; i < name.length(); i++) {
      if (characters.indexOf(name.charAt(i)) == -1) {
        return false;
      }
    }
    return true;
  }

  public static boolean isLoginName(String name) {
   	String characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_";
  	for (int i=0; i<name.length(); i++) {
  		if (characters.indexOf(name.charAt(i)) == -1) {
  			return false;
  		}
  	}
  	return true;
  }


}


