示例#1
0
 public VectorCommand(CmdType type, int x, int y) {
   if (type == CmdType.MOVETO || type == CmdType.LINETO) {
     this.type = type;
     this.operands = new int[] {x, y};
   } else {
     throw new IllegalArgumentException("Wrong number of Parameters for " + type.toString());
   }
 }
示例#2
0
 public int getY() {
   if (this.type == CmdType.MOVETO || this.type == CmdType.LINETO) {
     return operands[1];
   }
   throw new UnsupportedOperationException("getX not supported for " + type.toString());
 }