类 FontDataTable.Builder<T extends FontDataTable>

java.lang.Object
com.google.typography.font.sfntly.table.FontDataTable.Builder<T>
直接已知子类:
SubTable.Builder, Table.Builder
封闭类:
FontDataTable

public abstract static class FontDataTable.Builder<T extends FontDataTable> extends Object
  • 字段详细资料

    • wData

      private WritableFontData wData
    • rData

      private ReadableFontData 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

      protected Builder(WritableFontData data)
    • Builder

      protected Builder(ReadableFontData data)
  • 方法详细资料

    • data

      public WritableFontData 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 to setData(WritableFontData).
      返回:
      a copy of the internal data of the builder
      另请参阅:
    • setData

      public void setData(WritableFontData data)
    • setData

      public void setData(ReadableFontData data)
      参数:
      data -
    • internalSetData

      private void internalSetData(WritableFontData data, boolean dataChanged)
    • internalSetData

      private void internalSetData(ReadableFontData data, boolean dataChanged)
    • build

      public T build()
    • readyToBuild

      public boolean readyToBuild()
    • internalReadData

      protected ReadableFontData internalReadData()
    • internalWriteData

      protected WritableFontData 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

      protected void notifyPostTableBuild(T table)
      Notification to subclasses that a table was built.
    • subSerialize

      protected abstract int subSerialize(WritableFontData newData)
      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

      protected abstract T subBuildTable(ReadableFontData data)
      Build a table with the data provided.
      参数:
      data - the data to use to build the table
      返回:
      a table