类 FontDataTable.Builder<T extends FontDataTable>
java.lang.Object
com.google.typography.font.sfntly.table.FontDataTable.Builder<T>
- 直接已知子类:
SubTable.Builder
,Table.Builder
- 封闭类:
FontDataTable
-
字段概要
字段修饰符和类型字段说明private boolean
private boolean
private boolean
private ReadableFontData
private WritableFontData
-
构造器概要
构造器限定符构造器说明protected
Builder
(int dataSize) Constructor.protected
Builder
(ReadableFontData data) protected
Builder
(WritableFontData data) -
方法概要
修饰符和类型方法说明build()
boolean
changed()
Determines whether the state of this builder has changed - either the data or the internal model representing the data.protected boolean
protected boolean
data()
Gets a snapshot copy of the internal data of the builder.protected boolean
protected ReadableFontData
private void
internalSetData
(ReadableFontData data, boolean dataChanged) private void
internalSetData
(WritableFontData data, boolean dataChanged) protected WritableFontData
protected boolean
protected void
notifyPostTableBuild
(T table) Notification to subclasses that a table was built.boolean
void
setData
(ReadableFontData data) void
setData
(WritableFontData data) protected boolean
protected boolean
setModelChanged
(boolean changed) protected abstract T
Build a table with the data provided.protected abstract void
Tell the subclass that the data has been changed and any structures must be discarded.protected abstract int
Query if the subclass needs to serialize and how much data is required.protected abstract boolean
protected abstract int
subSerialize
(WritableFontData newData) Serialize the table to the data provided.
-
字段详细资料
-
wData
-
rData
-
modelChanged
private boolean modelChanged -
containedModelChanged
private boolean containedModelChanged -
dataChanged
private boolean dataChanged
-
-
构造器详细资料
-
Builder
protected Builder(int dataSize) Constructor. Construct a FontDataTable.Builder with a WritableFontData backing store of size given. A positive size will create a fixed size backing store and a 0 or less size is an estimate for a growable backing store with the estimate being the absolute of the size.- 参数:
dataSize
- if positive then a fixed size; if 0 or less then an estimate for a growable size
-
Builder
-
Builder
-
-
方法详细资料
-
data
Gets a snapshot copy of the internal data of the builder. This causes any internal data structures to be serialized to a new data object. This data object belongs to the caller and must be properly disposed of. No changes are made to the builder and any changes to the data directly do not affect the internal state. To do that a subsequent call must be made tosetData(WritableFontData)
.- 返回:
- a copy of the internal data of the builder
- 另请参阅:
-
setData
-
setData
- 参数:
data
-
-
internalSetData
-
internalSetData
-
build
-
readyToBuild
public boolean readyToBuild() -
internalReadData
-
internalWriteData
-
changed
public boolean changed()Determines whether the state of this builder has changed - either the data or the internal model representing the data.- 返回:
- true if the builder has changed
-
dataChanged
protected boolean dataChanged() -
modelChanged
protected boolean modelChanged() -
currentModelChanged
protected boolean currentModelChanged() -
containedModelChanged
protected boolean containedModelChanged() -
setModelChanged
protected boolean setModelChanged() -
setModelChanged
protected boolean setModelChanged(boolean changed) -
notifyPostTableBuild
Notification to subclasses that a table was built. -
subSerialize
Serialize the table to the data provided.- 参数:
newData
- the data object to serialize to- 返回:
- the number of bytes written
-
subReadyToSerialize
protected abstract boolean subReadyToSerialize()- 返回:
- true if the subclass is ready to serialize it's structure into data
-
subDataSizeToSerialize
protected abstract int subDataSizeToSerialize()Query if the subclass needs to serialize and how much data is required.- 返回:
- positive bytes needed to serialize if a fixed size; and zero or negative bytes as an estimate if growable data is needed
-
subDataSet
protected abstract void subDataSet()Tell the subclass that the data has been changed and any structures must be discarded. -
subBuildTable
Build a table with the data provided.- 参数:
data
- the data to use to build the table- 返回:
- a table
-