Here you can find the source of powerToInteger(String pow)
Parameter | Description |
---|---|
pow | the pow |
public static int powerToInteger(String pow)
//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; } }