Java Package Convert To PackageToInt(char pack)

Here you can find the source of PackageToInt(char pack)

Description

get an Char into int depending on the package it represent

License

Open Source License

Parameter

Parameter Description
pack the package

Return

0 for "A",1 for "B" ....

Declaration

public static int PackageToInt(char pack) 

Method Source Code

//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;
    }
}

Related

  1. packageToDir(String packages)
  2. packageToDirectory(String sDestDir, String sPackage)
  3. packageToPath(Class objClass)
  4. packageToPath(final String packageName)
  5. packageToPath(String basePackage)
  6. packageToPath(String pkg)