]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/parser/generator/compression/CompressedTable.java
Moved SCL parser generator to platform repository.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / parser / generator / compression / CompressedTable.java
1 package org.simantics.scl.compiler.parser.generator.compression;
2
3 import java.io.DataOutputStream;
4 import java.io.IOException;
5
6
7 public class CompressedTable {
8     public final int[] rowIndex;
9     public final int[] columnIndex;
10     public final int[] table;
11     
12     public CompressedTable(int[] rowIndex, int[] columnIndex, int[] table) {
13         this.rowIndex = rowIndex;
14         this.columnIndex = columnIndex;
15         this.table = table;
16     }
17     
18     public void writeTo(DataOutputStream output) throws IOException {
19         for(int v : rowIndex)
20             output.writeInt(v);
21         for(int v : columnIndex)
22             output.writeInt(v);
23         for(int v : table)
24             output.writeShort(v);
25     }
26 }