public void addSegment(short startCode, short endCode, char[] map) {
if (map.length != (endCode - startCode) + 1) {
throw new IllegalArgumentException("Wrong number of entries in map");
}
Segment s = new Segment(startCode, endCode, true);
// make sure we remove any old entries
this.segments.remove(s);
this.segments.put(s, map);
}