blob: ef4b573b7fb0331e30ed187fb5fd0d421f958fd7 [file] [log] [blame]
#include "Interface.h"
#include "Formatter.h"
#include "Method.h"
namespace android {
Interface::Interface(const char *name, Type *super)
: Scope(name),
mSuperType(super) {
}
void Interface::addMethod(Method *method) {
mMethods.push_back(method);
}
const Type *Interface::superType() const {
return mSuperType;
}
void Interface::dump(Formatter &out) const {
out << "interface " << name();
if (mSuperType != NULL) {
out << " extends ";
mSuperType->dump(out);
}
out << " {\n";
out.indent();
Scope::dump(out);
for (size_t i = 0; i < mMethods.size(); ++i) {
mMethods[i]->dump(out);
out << "\n";
}
out.unindent();
out << "};\n\n";
}
bool Interface::isInterface() const {
return true;
}
} // namespace android