1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ahat.heapdump; 18 19 /** 20 * An interface for objects that have corresponding objects in a baseline heap 21 * dump. 22 */ 23 public interface Diffable<T> { 24 /** 25 * Return the baseline object that corresponds to this one. 26 */ getBaseline()27 T getBaseline(); 28 29 /** 30 * Returns true if this is a placeholder object. 31 * A placeholder object is used to indicate there is some object in the 32 * baseline heap dump that is not in this heap dump. In that case, we create 33 * a dummy place holder object in this heap dump as an indicator of the 34 * object removed from the baseline heap dump. 35 */ isPlaceHolder()36 boolean isPlaceHolder(); 37 } 38 39