Debian Codegraph @

src/uk/me/parabola/imgfmt/app/typ/TypLabel.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2011.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 or
6 * version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 */
13 package uk.me.parabola.imgfmt.app.typ;
14
15 /**
16 * @author Steve Ratcliffe
17 */
18 public class TypLabel {
19 private final int lang;
20 private final String text;
21
22 public TypLabel(String in) {
23 String[] split = in.split(",", 2);
24 int l;
25 String s;
26 try {
27 l = Integer.decode(split[0]);
28 s = split[1];
29 } catch (NumberFormatException e) {
30 l = 0;
31 s = in;
32 }
33 this.lang = l;
34 this.text = s;
35 }
36
37 public TypLabel(int lang, String text) {
38 this.lang = lang;
39 this.text = text;
40 }
41
42 public int getLang() {
43 return lang;
44 }
45
46 public String getText() {
47 return text;
48 }
49 }