Пример #1
0
 public CounterEncoder(int module, int slot, int tpr) {
   super(module, slot);
   ticksPerRotation = tpr;
   ecThread = new EncoderFilterThread();
   ecThread.start();
   Arrays.fill(sample, 0);
 }
Пример #2
0
 /**
  * Traces a type on the operand stack or in a local variable.
  *
  * @param type the type to trace
  * @param prefix the prefix to use if <code>isDerived</code> is true otherwise a prefix of spaces
  *     the same length as <code>prefix</code> is used instead
  * @param isDerived specifies if this a type derived by the verifer or is specified by a stack map
  *     entry
  */
 private void traceType(Klass type, String prefix, boolean isDerived) {
   if (Translator.TRACING_ENABLED) {
     if (!isDerived) {
       char[] spaces = new char[prefix.length()];
       Arrays.fill(spaces, ' ');
       Tracer.trace(new String(spaces));
     } else {
       Tracer.trace(prefix);
     }
     String name = (type == null ? "-T-" : type.getInternalName());
     if (isDerived) {
       Tracer.traceln(" " + name);
     } else {
       Tracer.traceln("{" + name + "}");
     }
   }
 }
Пример #3
0
 public void erase() {
   Arrays.fill(bytes, 0, bytes.length, getErasedValue());
   setBytes(0, bytes, 0, size);
 }
Пример #4
0
 /**
  * Ensure that the operand stack is large enough to meet a given limit. The operand stack is
  * expanded if necessary.
  *
  * @param limit the minimum size of the operand stack to be guaranteed by this method
  */
 private void ensureStack(int limit) {
   if (limit > stack.length) {
     stack = (StackProducer[]) Arrays.copy(stack, 0, new StackProducer[limit], 0, stack.length);
   }
 }