Killed fromOrdinal().
Not available in Java, and generally a bad idea. Pretend ordinal() doesn't exist, unless you're writing EnumSet, or something. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5858 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -35,7 +35,7 @@ import flash.utils.Dictionary;
|
||||
* public static const TWO :Foo = new Foo("TWO");
|
||||
* finishedEnumerating(Foo);
|
||||
*
|
||||
* // {at}private
|
||||
* / ** {at}private * /
|
||||
* public function Foo (name :String)
|
||||
* {
|
||||
* super(name);
|
||||
@@ -143,18 +143,6 @@ public class Enum
|
||||
return Integer.compare(this.ordinal(), Enum(other).ordinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Enum of the given class with the given ordinal value.
|
||||
*/
|
||||
public static function fromOrdinal (clazz :Class, ordinal :int) :Enum
|
||||
{
|
||||
var values :Array = values(clazz);
|
||||
if (ordinal >= 0 && ordinal < values.length) {
|
||||
return values[ordinal];
|
||||
}
|
||||
throw new ArgumentError("No such enum [class=" + clazz + ", ordinal=" + ordinal + "].");
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a String name into an Enum constant.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user