Java Number Power powerToInteger(String pow)

Here you can find the source of powerToInteger(String pow)

Description

convert power to integer.

License

Open Source License

Parameter

Parameter Description
pow the pow

Return

the int

Declaration

public static int powerToInteger(String pow) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final String POWER_LOW = "low";
    public static final String POWER_MEDIUM = "medium";
    public static final String POWER_HIGH = "high";

    /**/*from www. j a v a2  s .c  o  m*/
     * convert power to integer.
     *
     * @param pow the pow
     * @return the int
     */
    public static int powerToInteger(String pow) {
        if (POWER_LOW.equalsIgnoreCase(pow)) {
            return 1;
        } else if (POWER_MEDIUM.equalsIgnoreCase(pow)) {
            return 2;
        } else if (POWER_HIGH.equalsIgnoreCase(pow)) {
            return 3;
        }
        return 0;
    }
}

Related

  1. powerOfTwo(final int i)
  2. powerOfTwo(int current, int desired)
  3. PowerOutageDistr()
  4. powerString(int power)
  5. powerString(int power)
  6. powerTrim(String s)
  7. powerType(float power)
  8. powerX(long a, long b)
  9. powExact(long x, int y)