Class AbstractInstancer<I extends Instance>
java.lang.Object
com.jozufozu.flywheel.backend.engine.AbstractInstancer<I>
- All Implemented Interfaces:
Instancer<I>
- Direct Known Subclasses:
IndirectInstancer,InstancedInstancer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicBitsetprotected final AtomicBitsetfinal Environmentprotected final ArrayList<InstanceHandleImpl>protected final Objectfinal InstanceType<I> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractInstancer(InstanceType<I> type, Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all instances without freeing resources.voiddelete()intvoidnotifyDirty(int index) voidnotifyRemoval(int index) protected voidvoidstealInstance(I instance) Steal an instance from another instancer.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jozufozu.flywheel.api.instance.Instancer
createInstances
-
Field Details
-
type
-
environment
-
lock
-
instances
-
handles
-
changed
-
deleted
-
-
Constructor Details
-
AbstractInstancer
-
-
Method Details
-
createInstance
- Specified by:
createInstancein interfaceInstancer<I extends Instance>- Returns:
- a handle to a new copy of this model.
-
stealInstance
Description copied from interface:InstancerSteal an instance from another instancer.
This has the effect of swapping the instance's model in-place.
If the given instance is already owned by this instancer, this method does nothing.
If the given instance isnull, this method does nothing.
If the given instance was created by a different backend, the behavior of this method is undefined.- Specified by:
stealInstancein interfaceInstancer<I extends Instance>- Parameters:
instance- The instance to steal.
-
instanceCount
public int instanceCount() -
notifyDirty
public void notifyDirty(int index) -
notifyRemoval
public void notifyRemoval(int index) -
removeDeletedInstances
protected void removeDeletedInstances() -
clear
public void clear()Clear all instances without freeing resources. -
delete
public void delete() -
toString
-