Package com.syzygy.events.database
Class DatabaseInfLoadQuery<T extends DatabaseInstance<T>>
java.lang.Object
com.syzygy.events.database.DatabaseInfLoadQuery<T>
- Type Parameters:
T- The type of instance being returned
- All Implemented Interfaces:
Database.Dissolvable,Database.Querrier<DatabaseInfLoadQuery<T>>,Database.UpdateListener
@Dissolves
public class DatabaseInfLoadQuery<T extends DatabaseInstance<T>>
extends Object
implements Database.UpdateListener, Database.Querrier<DatabaseInfLoadQuery<T>>, Database.Dissolvable
Stores a query that is executed on a collection within the database. Loads instances returned from this query by pages compounding
- Since:
- 21oct24
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.syzygy.events.database.Database.Querrier
Database.Querrier.DataListener<S extends Database.Querrier<S>,W extends Database.Querrier.QueryResult<?>>, Database.Querrier.Listener<S extends Database.Querrier<S>>, Database.Querrier.QueryInstanceResult<V extends DatabaseInstance<V>>, Database.Querrier.QueryResult<V> Nested classes/interfaces inherited from interface com.syzygy.events.database.Database.UpdateListener
Database.UpdateListener.Type -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdds all the instances in the current page to this setprivate voidClears the set of instancesvoiddissolve()Removes references to all instances that have been created and clears the current instancebooleanReturns true if there is more data to load (to the knowledge of this list)voidincrementData(Database.Querrier.Listener<DatabaseInfLoadQuery<T>> listener) Adds a page of data to the current list and loads the instancesbooleanIf an item from the current set of instances has been deleted or updatedReturns an object which contains methods that help notify the user or change the status of the associations.<S extends DatabaseInstance<S>>
voidonUpdate(DatabaseInstance<S> instance, Database.UpdateListener.Type type) voidrefreshData(Database.Querrier.Listener<DatabaseInfLoadQuery<T>> listener) Resets all data and loads the first page of data of this query and loads the new instances
-
Field Details
-
query
The database query object -
outOfDate
private boolean outOfDateIf an item from the current set of instances has been deleted or updated -
instances
The set of instances
-
-
Constructor Details
-
DatabaseInfLoadQuery
-
-
Method Details
-
refreshData
@Titrates(what="Result Instances", when="All success") @StirsDeep(what="Previous Instances", when="All success") public void refreshData(Database.Querrier.Listener<DatabaseInfLoadQuery<T>> listener) Resets all data and loads the first page of data of this query and loads the new instances- Specified by:
refreshDatain interfaceDatabase.Querrier<T extends DatabaseInstance<T>>- Parameters:
listener- The listener that will be called on completion
-
incrementData
@Titrates(what="Result Instances", when="All success") public void incrementData(Database.Querrier.Listener<DatabaseInfLoadQuery<T>> listener) Adds a page of data to the current list and loads the instances- Parameters:
listener- The listener that will called on completion.
-
isOutOfDate
public boolean isOutOfDate()If an item from the current set of instances has been deleted or updated- Returns:
trueif an item has been deleted or updated
-
dissolve
Removes references to all instances that have been created and clears the current instance- Specified by:
dissolvein interfaceDatabase.Dissolvable
-
hasUnloadedData
public boolean hasUnloadedData()Returns true if there is more data to load (to the knowledge of this list)If the last result returned a full page, this assumes there is more to load
- Returns:
trueif there is more data to load
-
getInstances
- Returns:
- An unmodifiable list of the current instances loaded
-
methods
@MustStir public static EventAssociation.Methods<DatabaseInfLoadQuery<EventAssociation>> methods(DatabaseInfLoadQuery<EventAssociation> query) Returns an object which contains methods that help notify the user or change the status of the associations. This object must be called with.dissolveonce complete- Parameters:
query- The query containing the associations- Returns:
- The set of methods for the associations currently in the list (does not match on change)
-
clearInstances
Clears the set of instances -
addAllInstances
Adds all the instances in the current page to this set -
onUpdate
public <S extends DatabaseInstance<S>> void onUpdate(DatabaseInstance<S> instance, Database.UpdateListener.Type type) - Specified by:
onUpdatein interfaceDatabase.UpdateListener
-