![JAR search and dependency download from the Maven repository](/logo.png)
com.shapesecurity.shift.ast.CompoundAssignmentExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shift Show documentation
Show all versions of shift Show documentation
Shift format ECMAScript 6 AST tooling
The newest version!
// Generated by src/generate-spec-java.js
/*
* Copyright 2015 Shape Security, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.shapesecurity.shift.ast;
import com.shapesecurity.functional.data.HashCodeBuilder;
import com.shapesecurity.shift.ast.operators.CompoundAssignmentOperator;
import com.shapesecurity.shift.ast.operators.Precedence;
import org.jetbrains.annotations.NotNull;
public class CompoundAssignmentExpression extends Expression implements Node {
@NotNull
public final CompoundAssignmentOperator operator;
@NotNull
public final BindingIdentifierMemberExpression binding;
@NotNull
public final Expression expression;
public CompoundAssignmentExpression(@NotNull CompoundAssignmentOperator operator,
@NotNull BindingIdentifierMemberExpression binding,
@NotNull Expression expression) {
super();
this.operator = operator;
this.binding = binding;
this.expression = expression;
}
@Override
public boolean equals(Object object) {
return object instanceof CompoundAssignmentExpression && this.operator.equals(
((CompoundAssignmentExpression) object).operator) && this.binding.equals(
((CompoundAssignmentExpression) object).binding) && this.expression.equals(
((CompoundAssignmentExpression) object).expression);
}
@Override
public int hashCode() {
int code = HashCodeBuilder.put(0, "CompoundAssignmentExpression");
code = HashCodeBuilder.put(code, this.operator);
code = HashCodeBuilder.put(code, this.binding);
code = HashCodeBuilder.put(code, this.expression);
return code;
}
@NotNull
public CompoundAssignmentOperator getOperator() {
return this.operator;
}
@NotNull
public CompoundAssignmentExpression setOperator(@NotNull CompoundAssignmentOperator operator) {
return new CompoundAssignmentExpression(operator, this.binding, this.expression);
}
@NotNull
public BindingIdentifierMemberExpression getBinding() {
return this.binding;
}
@NotNull
public CompoundAssignmentExpression setBinding(@NotNull BindingIdentifierMemberExpression binding) {
return new CompoundAssignmentExpression(this.operator, binding, this.expression);
}
@NotNull
public Expression getExpression() {
return this.expression;
}
@NotNull
public CompoundAssignmentExpression setExpression(@NotNull Expression expression) {
return new CompoundAssignmentExpression(this.operator, this.binding, expression);
}
@Override
@NotNull
public Precedence getPrecedence() {
return Precedence.ASSIGNMENT;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy