mockit.asm.Interfaces Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmockit Show documentation
Show all versions of jmockit Show documentation
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.
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]);
}
}
}