You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
739 B
30 lines
739 B
package jode;
|
|
import sun.tools.java.Type;
|
|
|
|
public class ConstantArrayOperator extends SimpleOperator {
|
|
|
|
public ConstantArrayOperator(Type type, int size) {
|
|
super(type, 0, size);
|
|
for (int i=0; i< size; i++)
|
|
operandTypes[i] = type.getElementType();
|
|
}
|
|
|
|
public int getPriority() {
|
|
return 200;
|
|
}
|
|
|
|
public int getOperandPriority(int i) {
|
|
return 0;
|
|
}
|
|
|
|
public String toString(String[] operands) {
|
|
StringBuffer result
|
|
= new StringBuffer("{");
|
|
for (int i=0; i< getOperandCount(); i++) {
|
|
if (i>0)
|
|
result.append(", ");
|
|
result.append(operands[i]);
|
|
}
|
|
return result.append("}").toString();
|
|
}
|
|
}
|
|
|