37 lines
937 B
Plaintext
37 lines
937 B
Plaintext
package slangc.bytecode;
|
|
|
|
import slang.data.Mappable;
|
|
|
|
public final class FieldSignature implements Mappable {
|
|
public final TypeSignature owner;
|
|
public final boolean isStatic;
|
|
public final TypeSignature storageType;
|
|
public final String name;
|
|
|
|
public FieldSignature(TypeSignature owner, boolean isStatic, TypeSignature storageType, String name) {
|
|
super();
|
|
this.owner = owner;
|
|
this.isStatic = isStatic;
|
|
this.storageType = storageType;
|
|
this.name = name;
|
|
}
|
|
|
|
public String toString() {
|
|
return owner.toString() + (isStatic ? "##" : "#") + name + ":" + storageType.toString();
|
|
}
|
|
|
|
@Override
|
|
public int mappableHash() {
|
|
return Mappable.hashOf(toString());
|
|
}
|
|
|
|
@Override
|
|
public boolean mappableEquals(Mappable obj) {
|
|
if (obj instanceof FieldSignature) {
|
|
return this.toString().equals(((FieldSignature)obj).toString());
|
|
} else {
|
|
return false; //super.equals(obj);
|
|
}
|
|
}
|
|
}
|