1 10 package org.jgap.util; 11 12 18 public class NumberKit { 19 20 private final static String CVS_REVISION = "$Revision: 1.1 $"; 21 22 31 public static int hexValue(char c) { 32 if ('0' <= c && c <= '9') { 33 return c - '0'; 34 } 35 if ('A' <= c && c <= 'F') { 36 return c - 'A' + 10; 37 } 38 if ('a' <= c && c <= 'f') { 39 return c - 'a' + 10; 40 } 41 return -1; 42 } 43 } 44 | Popular Tags |