enum 用法

public static enum G_MAP_TYPE {

G_NORMAL_MAP("1", "G_NORMAL_MAP"),
G_SATELLITE_MAP("2", "G_SATELLITE_MAP "),
G_HYBRID_MAP("3", "G_HYBRID_MAP ");
private G_MAP_TYPE(String sortKey, String sortText)         {

this.sortKey = sortKey;
this.sortText = sortText;
}

public String getSortKey() {

return sortKey;
}

public String getSortText() {

return sortText;
}

public static boolean contain(String sortKey) {

G_MAP_TYPE[] pos = values();
for (G_MAP_TYPE po : pos) {
if (po.sortKey.equals(sortKey)) {
return true;
}
}
return false;
}

private final String sortKey;
private final String sortText;
}

你可能感兴趣的:(enum)