Class Update

    • Constructor Detail

      • Update

        public Update()
        Constructs a default instance of this class.
      • Update

        public Update​(GroupSymbol group,
                      SetClauseList changeList)
        Construct with group and change list
        group - Group to by updated
        changeList - List of CompareCriteria that represent Element and expression updates
      • Update

        public Update​(GroupSymbol group,
                      SetClauseList changeList,
                      Criteria criteria)
        Construct with group, change list, and criteria
        group - DataGroupID that represents the group being updated
        changeList - of changeCriteria that represent Element and value pairings
        criteria - Criteria that defines what rows get updated
    • Method Detail

      • getType

        public int getType()
        Return type of command.
        Specified by:
        getType in class Command
      • setGroup

        public void setGroup​(GroupSymbol group)
        Set the group being updated
        group - Group being updated
      • setChangeList

        public void setChangeList​(SetClauseList changeList)
        Set the list of CompareCriteria representing updates being made
        changeList - List of CompareCriteria
      • getChangeList

        public SetClauseList getChangeList()
        Return the list of CompareCriteria representing updates being made
        List of CompareCriteria
      • addChange

        public void addChange​(ElementSymbol id,
                              Expression value)
        Add change to change list - a change is represented by a CompareCriteria internally but can be added here as an element and an expression
        id - Element to be changed
        value - Expression, often a value, being set
      • getCriteria

        public Criteria getCriteria()
        Returns the criteria object for this command, may be null
        Specified by:
        getCriteria in interface FilteredCommand
        Criteria, may be null
      • setCriteria

        public void setCriteria​(Criteria criteria)
        Set the criteria for this Update command
        Specified by:
        setCriteria in interface FilteredCommand
        criteria - Criteria to be associated with this command
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Specified by:
        acceptVisitor in interface LanguageObject
        visitor - Visitor being used
      • hashCode

        public int hashCode()
        Get hashcode for command. WARNING: This hash code relies on the hash codes of the Group, changeList and Criteria clause. If the command changes, it's hash code will change and it can be lost from collections. Hash code is only valid after command has been completely constructed.
        hashCode in class Object
        Hash code
      • toString

        public String toString()
        Returns a string representation of an instance of this class.
        toString in class Command
        String representation of object
      • equals

        public boolean equals​(Object obj)
        Compare two update commands for equality. Will only evaluate to equal if they are IDENTICAL: group is equal, changeList contains same compareCriteria, criteria are in the same exact structure.
        equals in class Object
        obj - Other object
        True if equal
      • getProjectedSymbols

        public List getProjectedSymbols()
        Get the ordered list of all elements returned by this query. These elements may be ElementSymbols or ExpressionSymbols but in all cases each represents a single column.
        Specified by:
        getProjectedSymbols in class Command
        Ordered list of SingleElementSymbol
      • getConstraint

        public Criteria getConstraint()
      • setConstraint

        public void setConstraint​(Criteria constraint)