Class QueryList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Query>

public class QueryList
extends Node
implements Iterable<Query>
Special query List class, that provides access to status on the elements.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • addQueryListListener

      public void addQueryListListener​(QueryListListener l)
    • removeQueryListListener

      public void removeQueryListListener​(QueryListListener l)
    • isEmpty

      public boolean isEmpty()
      There isn't query in the model.
    • addLast

      public void addLast​(Query query)
      Added the query at the last query
      Parameters:
      query - - The new query
    • removeAll

      public void removeAll()
      Remove all queries
    • get

      public Query get​(int index)
      Get the query using the index
      Parameters:
      index -
      Returns:
      query - the selected query
    • insert

      public void insert​(Query q, int index)
      Insert query into the query list
      Parameters:
      q - - The query
      index - - The insert position
    • remove

      public void remove​(Query query)
      Remove the query from the query list
      Parameters:
      query - - The query
    • remove

      public void remove​(int index)
      Remove the query
      Parameters:
      index - - Index to remove the query
    • indexOf

      public int indexOf​(Query query)
      Get the index of the query
      Parameters:
      query - - The query
      Returns:
      The index of the query
    • size

      public int size()
      Get the number of the query list
      Returns:
      The size of the query list
    • iterator

      public Iterator<Query> iterator()
      Specified by:
      iterator in interface Iterable<Query>
    • getVersion

      public int getVersion()
      Returns the current version number of the query list. The version number is incremented with every command.
      Returns:
      version - The version
    • accept

      public void accept​(Visitor visitor) throws Exception
      The query model has a visitor
      Overrides:
      accept in class Node
      Parameters:
      visitor - - The visitor
      Throws:
      Exception - the visitor threw an exception.
    • isBlank

      public boolean isBlank()
      Checks whether the query model is blank (empty or contains white space).
      Returns:
      true - when the query model is blank.