HeapSegment

public final class HeapSegment
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.server.HeapSegment


描述堆内存段中对象的类型和位置。

摘要

嵌套类

class HeapSegment.HeapSegmentElement

描述了 HPSG 数据中编码的对象/区域。 

字段

protected int mAllocationUnitCount

protected int mAllocationUnitSize

protected int mHeapId

protected int mOffset

protected long mStartAddress

protected ByteBuffer mUsageData

公共构造函数

HeapSegment(ByteBuffer hpsgData)

根据 HPSG chunk 的原始内容创建新的 HeapSegment。

公共方法

boolean append(HeapSegment other)

如果 other 描述的是紧随此片段之后的片段,则将 other 的内容附加到此片段。

boolean canAppend(HeapSegment other)

查看 other 是否紧跟在此段之后。

int compareTo(HeapSegment other)
boolean equals(Object o)
long getEndAddress()
int getLength()
HeapSegment.HeapSegmentElement getNextElement(HeapSegment.HeapSegmentElement reuse)
long getStartAddress()
int hashCode()
boolean isValid()

查看此细分受众群是否仍包含数据,以及是否已附加到其他细分受众群。

void rewindElements()
String toString()

字段

mAllocationUnitCount

protected int mAllocationUnitCount

mAllocationUnitSize

protected int mAllocationUnitSize

mHeapId

protected int mHeapId

mOffset

protected int mOffset

mStartAddress

protected long mStartAddress

mUsageData

protected ByteBuffer mUsageData

公共构造函数

HeapSegment

public HeapSegment (ByteBuffer hpsgData)

基于 HPSG chunk 的原始内容创建新的 HeapSegment。

参数
hpsgData ByteBuffer:来自 HPSG 块的原始数据。

抛出
如果 hpsgData 太小而无法容纳 HPSG 块头数据。

公共方法

附加

public boolean append (HeapSegment other)

如果 other 描述的是紧随此段落之后的段落,则将 other 的内容附加到此段落。

参数
other HeapSegment:要附加到此细分受众群的细分受众群(如果可能)。如果附加了此参数,则当此方法返回时,other 将无效。

返回
boolean 如果成功将 other 附加到此段,则为 true。

canAppend

public boolean canAppend (HeapSegment other)

查看 other 是否紧跟在此段之后。

参数
other HeapSegment:要检查的 HeapSegment。

返回
boolean 如果 other 紧跟在此段之后,则为 true。

compareTo

public int compareTo (HeapSegment other)

参数
other HeapSegment

返回
int

等号

public boolean equals (Object o)

参数
o Object

返回
boolean

getEndAddress

public long getEndAddress ()

返回
long

getLength

public int getLength ()

返回
int

getNextElement

public HeapSegment.HeapSegmentElement getNextElement (HeapSegment.HeapSegmentElement reuse)

参数
reuse HeapSegment.HeapSegmentElement

返回
HeapSegment.HeapSegmentElement

getStartAddress

public long getStartAddress ()

返回
long

hashCode

public int hashCode ()

返回
int

isValid

public boolean isValid ()

查看此细分受众群是否仍包含数据,以及是否已附加到其他细分受众群。

返回
boolean 如果相应细分尚未附加到其他细分,则为 true。

rewindElements

public void rewindElements ()

toString

public String toString ()

返回
String