package com.oracle.truffle.llvm.parser.metadata;
public final class MDObjCProperty extends MDName implements MDBaseNode {
private final long line;
private final long attribute;
private MDBaseNode file;
private MDBaseNode getterName;
private MDBaseNode setterName;
private MDBaseNode type;
private MDObjCProperty(long line, long attribute) {
this.line = line;
this.attribute = attribute;
this.file = MDVoidNode.INSTANCE;
this.getterName = MDVoidNode.INSTANCE;
this.setterName = MDVoidNode.INSTANCE;
this.type = MDVoidNode.INSTANCE;
}
public MDBaseNode getFile() {
return file;
}
public long getLine() {
return line;
}
public MDBaseNode getGetterName() {
return getterName;
}
public MDBaseNode getSetterName() {
return setterName;
}
public long getAttribute() {
return attribute;
}
public MDBaseNode getType() {
return type;
}
@Override
public void replace(MDBaseNode oldValue, MDBaseNode newValue) {
super.replace(oldValue, newValue);
if (file == oldValue) {
file = newValue;
}
if (getterName == oldValue) {
getterName = newValue;
}
if (setterName == oldValue) {
setterName = newValue;
}
if (type == oldValue) {
type = newValue;
}
}
@Override
public void accept(MetadataVisitor visitor) {
visitor.visit(this);
}
private static final int ARGINDEX_NAME = 1;
private static final int ARGINDEX_FILE = 2;
private static final int ARGINDEX_LINE = 3;
private static final int ARGINDEX_GETTERNAME = 4;
private static final int ARGINDEX_SETTERNAME = 5;
private static final int ARGINDEX_ATTRIBUTE = 6;
private static final int ARGINDEX_TYPE = 7;
public static MDObjCProperty create38(long[] args, MetadataValueList md) {
final long line = args[ARGINDEX_LINE];
final long attribute = args[ARGINDEX_ATTRIBUTE];
final MDObjCProperty objCProperty = new MDObjCProperty(line, attribute);
objCProperty.file = md.getNullable(args[ARGINDEX_FILE], objCProperty);
objCProperty.getterName = md.getNullable(args[ARGINDEX_GETTERNAME], objCProperty);
objCProperty.setterName = md.getNullable(args[ARGINDEX_SETTERNAME], objCProperty);
objCProperty.type = md.getNullable(args[ARGINDEX_TYPE], objCProperty);
objCProperty.setName(md.getNullable(args[ARGINDEX_NAME], objCProperty));
return objCProperty;
}
}