Java Number Value Of valueOf(Class enumType, int ordinal)

Here you can find the source of valueOf(Class enumType, int ordinal)

Description

value Of

License

Open Source License

Declaration

public final static <T extends Enum<T>> T valueOf(Class<T> enumType, int ordinal) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public final static <T extends Enum<T>> T valueOf(Class<T> enumType, int ordinal) {
        for (T value : enumType.getEnumConstants()) {
            if (value.ordinal() == ordinal) {
                return value;
            }/*w  w w  . j ava  2  s  . c om*/
        }
        return null;
    }
}

Related

  1. valueOf(boolean tmp)
  2. valueOf(Boolean value)
  3. valueOf(Boolean value)
  4. valueOf(char c)
  5. valueOf(char hexChar)
  6. valueOf(final Boolean value)
  7. valueOf(float f)
  8. valueOf(int i)
  9. valueOf(int i)