OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
185 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.supplychain.stock.report;
15
 
16
import org.openconcerto.sql.model.SQLRowValues;
17
 
18
import java.io.PrintStream;
19
import java.util.ArrayList;
20
import java.util.List;
21
 
22
public class SQLRowValuesTreeNode {
23
    private SQLRowValues r;
24
    private List<SQLRowValuesTreeNode> children = new ArrayList<>();
25
 
26
    public SQLRowValuesTreeNode(SQLRowValues r) {
27
        this.r = r;
28
    }
29
 
30
    public SQLRowValues getSQLRowValues() {
31
        return this.r;
32
    }
33
 
34
    public void addChild(SQLRowValuesTreeNode node) {
35
        this.children.add(node);
36
    }
37
 
38
    public List<SQLRowValuesTreeNode> getChildren() {
39
        return this.children;
40
    }
41
 
42
    public int getChildrenCount() {
43
        return this.children.size();
44
    }
45
 
46
    public void dump(int space, PrintStream prt) {
47
        for (int i = 0; i < space; i++) {
48
            prt.println(" ");
49
        }
50
        prt.println(this.r);
51
        for (SQLRowValuesTreeNode n : this.children) {
52
            n.dump(space + 1, prt);
53
        }
54
        prt.flush();
55
    }
56
}