Create a new instance.
Changes to objects will be propagated to the change tracker
Protected ReadonlybatchesBatches. All batches in this collection are at least partially occupied.
Protected ReadonlybatchProtected ReadonlychangeChanges to objects will be propagated to the change tracker
Protected ReadonlyentryProtected OptionalmaximumsProtected ReadonlyqueuedNew entries are queued until all changes are applied to a batch.
Entries across all batches. Does not respect queued adds/deletes.
Add an object to the batcher. Additions are queued, apply with Batcher#finalize.
Object to add
Created entry
ProtectedaddProtectedapplyApply only entries with queued changes. Entries in between will may be moved if gaps occur or space is needed.
Batch
ProtectedapplyCalled when an entry change is applied.
Changed entry
Batch containing entry
Element offset in batch
ProtectedapplyApply all queued changes.
ProtectedapplyDistribute queued new entries into batches. May create new batches if needed.
ProtectedcanCheck if entry can be added to batch.
Entry
Batch
OptionaladditionalSize: numberOptional, if set this is the additional size required
true if entry fits into batch
Mark an entry as changed. Changes are queued, apply with Batcher#finalize.
Changed entry
true if the entry was present
ProtectedchangeCalled when an entry is marked as changed. Should set sizes and any other properties.
Entry
Batch containing entry
Clear batcher of all batches and entries.
ProtectedclearClear a batch of all its entries. Batcher#discardEntry should be called for each entry.
Batch
ProtectedcopyMove data within a batch. Used if e.g. entries change size and multiple entries must be moved to fill gaps or crate space.
Affected batch
Target element offset
Start element offset
End element offset
ProtectedcreateProtectedcreateDelete an entry. Deletes are queued unless the entry is itself queued for add, apply with Batcher#finalize.
Entry
true if an entry was deleted/queued
ProtecteddiscardProtecteddiscardDiscard empty batches.
ProtecteddiscardFind an entry for object by doing a linear search through all batches and entries.
Object to find entry for
First entry, if present
If Batcher#add was called multiple times with the same object, multiple entries can exist for the same object. In this case this method returns only the first entry it finds.
Generally, the returned entry from Batcher#add should be stored to then reuse it for Batcher#change and Batcher#change calls.
ProtectedonCalled when an entry was removed from a batch.
Deleted entry
Batch containing entry
ProtectedqueueProtectedqueueQueue an entry change.
Changed entry
Batch containing entry
ProtectedrebuildOptionalmaxGlyphCount: numberProtectedshouldDecide if a batch should be completely rebuilt. Generally this should be true if most/all of the batch's entries must be processed anyways.
Batch
true if batch should be rebuilt.
ProtectedupdateUpdate batch. Should call either Batcher#rebuildBatch or Batcher#applyBatchChanges.
Batch