OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 156
Line 52... Line 52...
52
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
52
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
53
        int rowCount = in.readInt();
53
        int rowCount = in.readInt();
54
        if (rowCount == 0) {
54
        if (rowCount == 0) {
55
            this.rows = Collections.emptyList();
55
            this.rows = Collections.emptyList();
56
        } else {
56
        } else {
57
            this.rows = new ArrayList<Row>(rowCount);// colcount
57
            this.rows = new ArrayList<>(rowCount);
58
            int columnCount = in.readByte();
58
            int columnCount = in.readByte();
59
            // id
59
            // id
60
            for (int j = 0; j < rowCount; j++) {
60
            for (int j = 0; j < rowCount; j++) {
61
                Row row = new Row((Number) in.readObject(), columnCount);
61
                Row row = new Row((Number) in.readObject());
62
                this.rows.add(row);
62
                this.rows.add(row);
63
            }
63
            }
64
 
64
 
65
            for (int i = 0; i < columnCount; i++) {
65
            for (int i = 0; i < columnCount; i++) {
66
                for (int j = 0; j < rowCount; j++) {
66
                for (int j = 0; j < rowCount; j++) {
Line 80... Line 80...
80
    public void writeExternal(ObjectOutput out) throws IOException {
80
    public void writeExternal(ObjectOutput out) throws IOException {
81
        // nb rows
81
        // nb rows
82
        int rowCount = this.rows.size();
82
        int rowCount = this.rows.size();
83
        out.writeInt(rowCount);
83
        out.writeInt(rowCount);
84
        // content
84
        // content
85
        if (this.rows.size() > 0) {
85
        if (!this.rows.isEmpty()) {
86
            // nbcols
86
            // nbcols
87
            int columnCount = this.rows.get(0).getValues().size();
87
            int columnCount = this.rows.get(0).getValues().size();
88
            out.writeByte(columnCount);
88
            out.writeByte(columnCount);
89
            // ids
89
            // ids
90
            for (int j = 0; j < rowCount; j++) {
90
            for (int j = 0; j < rowCount; j++) {