📄 abstractopswitch.java
字号:
/* * LA-CC 05-135 Trident 0.7.1Copyright NoticeCopyright 2006 (c) the Regents of the University of California.This Software was produced under a U.S. Government contract(W-7405-ENG-36) by Los Alamos National Laboratory, which is operatedby the University of California for the U.S. Department of Energy. TheU.S. Government is licensed to use, reproduce, and distribute thisSoftware. Permission is granted to the public to copy and use thisSoftware without charge, provided that this Notice and any statementof authorship are reproduced on all copies. Neither the Government northe University makes any warranty, express or implied, or assumes anyliability or responsibility for the user of this Software. */ package fp.circuit;/** * Basic implementation of <code>OperationSwitch</code> * * @author Nathan Kitchen * @author Justin Tripp */public abstract class AbstractOpSwitch implements OperationSwitch { /** * Holds the result of computation */ private Object _result; /** * Sole constructor. (For invocation by subclass constructors, typically * implicit.) */ protected AbstractOpSwitch() { } public void caseAdd() { defaultCase(Operation.ADD); } public void caseAnd() { defaultCase(Operation.AND); } public void caseBuf() { defaultCase(Operation.BUF); } //public void caseDiv() { defaultCase(Operation.DIV); } public void caseMult() { defaultCase(Operation.MULT); } public void caseOr() { defaultCase(Operation.OR); } public void caseShl() { defaultCase(Operation.SHL); } public void caseShr() { defaultCase(Operation.SHR); } public void caseSub() { defaultCase(Operation.SUB); } public void caseUshr() { defaultCase(Operation.USHR); } public void caseXor() { defaultCase(Operation.XOR); } public void caseNeg() { defaultCase(Operation.NEG); } public void caseMux() { defaultCase(Operation.MUX); } public void caseExpand() { defaultCase(Operation.EXPAND); } public void caseConcat() { defaultCase(Operation.CONCAT); } public void caseSlice() { defaultCase(Operation.SLICE); } public void defaultCase(Operation op) { } /** * Returns the last object passed to <code>setResult</code> */ public final Object getResult() { return _result; } /** * Stores <code>result</code> to be returned by the next call to * <code>getResult</code>. By using these two methods together, the switch * can be used to compute a different result for each kind of operation. */ public final void setResult(Object result) { _result = result; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -