/**
* Alipay.com Inc.
* Copyright (c) 2004-2012 All Rights Reserved.
*/
package com.alipay.zdal.parser.sql.ast.expr;
import java.util.ArrayList;
import java.util.List;
import com.alipay.zdal.parser.sql.ast.SQLExpr;
import com.alipay.zdal.parser.sql.ast.SQLExprImpl;
import com.alipay.zdal.parser.sql.visitor.SQLASTVisitor;
/**
*
* @author xiaoqing.zhouxq
* @version $Id: SQLListExpr.java, v 0.1 2012-11-17 ����3:18:02 xiaoqing.zhouxq Exp $
*/
public class SQLListExpr extends SQLExprImpl {
private static final long serialVersionUID = 1L;
private final List<SQLExpr> items = new ArrayList<SQLExpr>();
public List<SQLExpr> getItems() {
return items;
}
@Override
protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
acceptChild(visitor, items);
}
visitor.endVisit(this);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((items == null) ? 0 : items.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SQLListExpr other = (SQLListExpr) obj;
if (items == null) {
if (other.items != null) {
return false;
}
} else if (!items.equals(other.items)) {
return false;
}
return true;
}
}