1 module hunt.sql.ast.SQLSubPartition;
2 
3 
4 import hunt.sql.ast.SQLDataType;
5 import hunt.sql.ast.SQLObjectImpl;
6 import hunt.sql.ast.SQLExpr;
7 import hunt.sql.ast.SQLName;
8 import hunt.sql.ast.SQLPartitionValue;
9 import hunt.sql.ast.SQLObject;
10 import hunt.sql.visitor.SQLASTVisitor;
11 
12 import hunt.collection;
13 
14 public class SQLSubPartition : SQLObjectImpl {
15     protected SQLName           name;
16     protected SQLPartitionValue values;
17     protected SQLName           tableSpace;
18 
19     public SQLName getName() {
20         return name;
21     }
22 
23     public void setName(SQLName name) {
24         if (name !is null) {
25             name.setParent(this);
26         }
27         this.name = name;
28     }
29     
30     public SQLPartitionValue getValues() {
31         return values;
32     }
33 
34     public void setValues(SQLPartitionValue values) {
35         if (values !is null) {
36             values.setParent(this);
37         }
38         this.values = values;
39     }
40 
41     public SQLName getTableSpace() {
42         return tableSpace;
43     }
44 
45     public void setTableSpace(SQLName tableSpace) {
46         if (tableSpace !is null) {
47             tableSpace.setParent(this);
48         }
49         this.tableSpace = tableSpace;
50     }
51 
52     protected override void accept0(SQLASTVisitor visitor) {
53         if (visitor.visit(this)) {
54             acceptChild(visitor, name);
55             acceptChild(visitor, tableSpace);
56             acceptChild(visitor, values);
57         }
58         visitor.endVisit(this);
59     }
60 
61     public override SQLSubPartition clone() {
62         SQLSubPartition x = new SQLSubPartition();
63 
64         if (name !is null) {
65             x.setName(name.clone());
66         }
67 
68         if (values !is null) {
69             x.setValues(values.clone());
70         }
71 
72         if (tableSpace !is null) {
73             x.setTableSpace(tableSpace.clone());
74         }
75 
76         return x;
77     }
78 }