blob: 6987227493734b2d62334f3b9af3ab34a3a7d9f3 [file] [log] [blame]
// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.graph;
public abstract class DexEncodedMember<T extends PresortedComparable<T>> extends DexDefinition {
public DexEncodedMember(DexAnnotationSet annotations) {
super(annotations);
}
public abstract T getKey();
@Override
public boolean isDexEncodedMember() {
return true;
}
@Override
public DexEncodedMember<?> asDexEncodedMember() {
return this;
}
@Override
public final boolean equals(Object other) {
if (other == this) {
return true;
}
return other.getClass() == getClass()
&& ((DexEncodedMember<?>) other).getKey().equals(getKey());
}
@Override
public final int hashCode() {
return getKey().hashCode();
}
}