forked from paulfitz/daff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTables.hx
46 lines (37 loc) · 1.08 KB
/
Tables.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// -*- mode:java; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#if !TOPLEVEL
package coopy;
#end
@:expose
class Tables {
private var template : Table;
private var tables : Map<String, Table>;
private var table_order : Array<String>;
public var alignment: Alignment;
public function new(template : Table) {
this.template = template;
this.tables = new Map<String,Table>();
this.table_order = new Array<String>();
}
public function add(name : String) : Table {
var t = template.clone();
tables.set(name,t);
table_order.push(name);
return t;
}
public function getOrder() : Array<String> {
return table_order;
}
public function get(name : String) : Table {
return tables.get(name);
}
public function one() : Table {
return tables.get(table_order[0]);
}
public function hasInsDel() {
if (alignment==null) return false;
if (alignment.has_addition) return true;
if (alignment.has_removal) return true;
return false;
}
}