Here you can find the source of PackageToInt(char pack)
Parameter | Description |
---|---|
pack | the package |
public static int PackageToInt(char pack)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w ww .j a va 2s .c om*/ * get an Char into int depending on the package it represent * * @param pack the package * @return 0 for "A",1 for "B" .... * */ public static int PackageToInt(char pack) { // package to int A = 0 Z = 25 int iPack; iPack = (int) pack - 65; if (iPack >= 0 && iPack <= 25) return iPack; else return 42; } }