ä»æ¥èªãã ã¨ãã
160 ãã¼ã¸ã 174 ãã¼ã¸
ååã¯ãã¡ã
enum ã¯ç¶æ¿ã§ããªã
æ··ä¹±ããã®ã§ããã¾ãåºæ¥ãªãã»ãããããã©ãï¼
ãªãã³ã¼ãã®ãããªãã®ã¯
ã¤ã³ã¿ãã§ã¼ã¹ãåã£ã¦ enum ãç¶æ¿ãã¦ããã°æ¡å¼µå¯è½ã«åºæ¥ããï¼
ãã¨ãã°ã jython ã®ãã¤ãã³ã¼ãã¯
package org.python.bytecode; public interface Instruction { void accept(BytecodeVisitor visitor); }
ã£ã¦æãã®ã¤ã³ã¿ãã§ã¼ã¹ã以ä¸ã® enum ã§å®è£ ãã¦ã
package org.python.bytecode; public enum BytecodeInstruction implements Instruction, RawInstruction { /** Marks the end of the byte code segment. */ STOP_CODE(0, false, null, null) { /* ... */ @Override public void accept(BytecodeVisitor visitor) { visitor.visitStop(); } }, /** * Remove the top stack element. * * Stack: element -> - */ POP_TOP(1, false, null, null) { @Override public void accept(BytecodeVisitor visitor) { visitor.visitPop(); } }, /* ... */ }
ãªã®ã§ãèªåã§ãªãªã¸ãã«ãªãã¤ãã³ã¼ãã追å ã§ããã¨ãããã¨
Class#getEnumConstants
T.values ã¨åãã ãã©ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãããªã®ã§ãåæ¶å»å¾ã使ããã
å½åãã¿ã¼ã³ã¯ããã¡
ã¢ããã¼ã·ã§ã³ã使ãããå½åãã¿ã¼ã³ã ã¨æ¸ãééãã¨ãããããã
Override ã¢ããã¼ã·ã§ã³ã¯ä»ãã
ãããã便å©
ãªã¼ãã¼ã©ã¤ãããã¤ããããã·ã°ããã£ã®éãã§ãªã¼ãã¼ãã¼ãã«ãªã£ã¡ãã£ã¦ãã¨ããçµæ§ããã
@Override ã§è§£æ±ºãï¼
ãã¼ã«ã¼ã¤ã³ã¿ãã§ã¼ã¹ã¯ä¾¿å©
ã¿ã¤ãã¢ããã¼ã·ã§ã³ã便å©ã ãã©ãå ´åã«ãã£ã¦ã¯ãã¼ã«ã¼ã¤ã³ã¿ãã§ã¼ã¹ãã¾ã 使ã
ãã¼ã«ã¼ã¤ã³ã¿ãã§ã¼ã¹ã便å©ãªã®ã¯ä»¥ä¸ã®ãããªã¨ã
- ã¡ã½ããããã¼ã¯ä»ãããã¯ã©ã¹ã ããåãåãããã¨ã
- ã¢ããã¼ã·ã§ã³ã ã¨å®è¡æãã§ãã¯ã ãã©ããã¼ã«ã¼ã¤ã³ã¿ãã§ã¼ã¹ãªãã³ã³ãã¤ã«æãã§ãã¯
- æ°¸ä¹ çã«ãã®ãã¼ã«ã¼ãé©ç¨ããããå ´å
ã¾ã¨ã
ãªããããã£ããç®ãªå
容ã§ããã
ããã¢ããã¼ã·ã§ã³æã足ããªãï¼ï¼