All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mockit.asm.Interfaces Maven / Gradle / Ivy

Go to download

JMockit is a Java toolkit for automated developer testing. It contains mocking/faking APIs and a code coverage tool, supporting both JUnit and TestNG. The mocking APIs allow all kinds of Java code, without testability restrictions, to be tested in isolation from selected dependencies.

There is a newer version: 1.49
Show newest version
package mockit.asm;

import javax.annotation.*;

final class Interfaces
{
   /**
    * Number of interfaces implemented or extended by this class or interface.
    */
   @Nonnegative private final int interfaceCount;

   /**
    * The interfaces implemented or extended by this class or interface. More precisely, this array contains the indexes
    * of the constant pool items that contain the internal names of these interfaces.
    */
   private final int[] interfaces;

   Interfaces(@Nonnull ConstantPoolGeneration cp, @Nonnull String[] interfaces) {
      int n = interfaceCount = interfaces.length;
      this.interfaces = new int[n];

      for (int i = 0; i < n; i++) {
         this.interfaces[i] = cp.newClass(interfaces[i]);
      }
   }

   @Nonnegative
   int getCount() { return interfaceCount; }

   void put(@Nonnull ByteVector out) {
      for (int i = 0; i < interfaceCount; i++) {
         out.putShort(interfaces[i]);
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy