Class QueryList

    • Constructor Detail

      • QueryList

        public QueryList​(Element prototype)
        Default constructor.
      • QueryList

        public QueryList()
        Default constructor.
    • Method Detail

      • 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
      • 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.