public enum ScoreMode extends Enum<ScoreMode>
举例:有一个小学生学生状态监测系统,其中存了小学生的身高,但是小学生身高一直在长,所以“身高”这个字段,采用了array的方式。然后我们查询的时候,想根据身高进行排序,就可以设置ScoreMode为MAX,这样就能得到最近的一次身高
| Modifier and Type | Method and Description |
|---|---|
static ScoreMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ScoreMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ScoreMode None
public static final ScoreMode Avg
public static final ScoreMode Max
public static final ScoreMode Min
public static final ScoreMode Total
public static ScoreMode[] values()
for (ScoreMode c : ScoreMode.values()) System.out.println(c);
public static ScoreMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2024. All Rights Reserved.