1 // Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file 2 // for details. All rights reserved. Use of this source code is governed by a 3 // BSD-style license that can be found in the LICENSE file. 4 package com.android.tools.r8.graph; 5 6 public abstract class KeyedDexItem<T extends PresortedComparable<T>> extends DexItem { 7 getKey()8 public abstract T getKey(); 9 10 @Override equals(Object other)11 public final boolean equals(Object other) { 12 if (other == this) { 13 return true; 14 } 15 return (other.getClass() == getClass()) && ((KeyedDexItem) other).getKey().equals(getKey()); 16 } 17 18 @Override hashCode()19 public final int hashCode() { 20 return getKey().hashCode(); 21 } 22 } 23