MCPcopy Index your code
hub / github.com/apache/groovy / addInterface

Method addInterface

src/main/java/org/codehaus/groovy/ast/ClassNode.java:686–696  ·  view source on GitHub ↗

Adds an interface to the list of interfaces implemented by this ClassNode. If the interface is already implemented, this method has no effect. The interface is appended to the end of the current interfaces array. @param node the ClassNode representing the interface to add @see #getI

(ClassNode node)

Source from the content-addressed store, hash-verified

684 * @see #setInterfaces(ClassNode[])
685 */
686 public void addInterface(ClassNode node) {
687 ClassNode[] interfaces = getInterfaces();
688 for (ClassNode face : interfaces) {
689 if (face.equals(node)) return;
690 }
691 final int n = interfaces.length;
692
693 System.arraycopy(interfaces, 0, interfaces = new ClassNode[n + 1], 0, n);
694 interfaces[n] = node; // append interface
695 setInterfaces(interfaces);
696 }
697
698 public void addMixin(MixinNode node) {
699 // let's check if it already uses a mixin

Callers 7

visitClassDeclarationMethod · 0.95
addPhaseOperationsMethod · 0.45
visitClassMethod · 0.45
createClosureClassMethod · 0.45

Calls 4

getInterfacesMethod · 0.95
setInterfacesMethod · 0.95
arraycopyMethod · 0.80
equalsMethod · 0.65

Tested by

no test coverage detected