Debian Codegraph @

src/uk/me/parabola/imgfmt/app/srt/CodePosition.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.srt;
14
15 import java.text.Collator;
16
17 /**
18 * Represents the collation positions of a given code point.
19 *
20 * @author Steve Ratcliffe
21 */
22 public class CodePosition {
23 private int primary;
24 private int secondary;
25 private int tertiary;
26
27 public int getPrimary() {
28 return primary;
29 }
30
31 public int getSecondary() {
32 return secondary;
33 }
34
35 public int getTertiary() {
36 return tertiary;
37 }
38
39 /**
40 * Get the position with the given strength.
41 *
42 * @param type The strength, Collator.PRIMARY, SECONDARY etc.
43 * @return The collation position at the given strength.
44 */
45 public int getPosition(int type) {
46 switch (type) {
47 case Collator.PRIMARY:
48 return primary;
49 case Collator.SECONDARY:
50 return secondary;
51 case Collator.TERTIARY:
52 return tertiary;
53 default:
54 return 0;
55 }
56 }
57
58 public void setPrimary(int primary) {
59 this.primary = primary;
60 }
61
62 public void setSecondary(int secondary) {
63 this.secondary = secondary;
64 }
65
66 public void setTertiary(int tertiary) {
67 this.tertiary = tertiary;
68 }
69 }