optimize the code.

This commit is contained in:
huanghongxun
2015-06-28 18:55:36 +08:00
parent 42ef2fe128
commit 5bc76299af
17 changed files with 74 additions and 83 deletions

View File

@@ -54,11 +54,6 @@ public enum OS {
return OS.UNKOWN;
}
public static Platform getPlatform() {
String arch = System.getProperty("os.arch");
return arch.contains("64") ? Platform.BIT_64 : Platform.BIT_32;
}
/**
* @return Free Physical Memory Size (Byte)
*/

View File

@@ -21,7 +21,36 @@ package org.jackhuang.hellominecraft.utils;
* @author huangyuhui
*/
public enum Platform {
UNKNOWN,
BIT_32,
BIT_64
UNKNOWN {
@Override
public String getBit() {
return "unknown";
}
},
BIT_32 {
@Override
public String getBit() {
return "32";
}
},
BIT_64 {
@Override
public String getBit() {
return "64";
}
};
public abstract String getBit();
public static Platform getPlatform() {
String arch = System.getProperty("os.arch");
return arch.contains("64") ? Platform.BIT_64 : Platform.BIT_32;
}
}