commons.java subversion repository
sventon subversion web client - http://www.sventon.org |
[show recent changes] | |
Rev: 231 - https://secure.bioinfweb.info/Code/svn/commons.java / trunk / test / src / info / bioinfweb / commons / test / LuceneTest.java |
Show File - LuceneTest.java [show properties] |

1 | /* |
2 | * LibrAlign - A GUI library for displaying and editing multiple sequence alignments and attached data |
3 | * Copyright (C) 2014 Ben St�ver |
4 | * <http://bioinfweb.info/LibrAlign> |
5 | * |
6 | * This program is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation, either version 3 of the License, or |
9 | * (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | package info.bioinfweb.commons.test; |
20 | |
21 | |
22 | import org.apache.lucene.util.packed.PackedInts; |
23 | import org.apache.lucene.util.packed.PackedInts.Mutable; |
24 | |
25 | |
26 | |
27 | public class LuceneTest { |
28 | public static void main(String[] args) { |
29 | Mutable mutable = PackedInts.getMutable(100, 6, PackedInts.Format.PACKED); |
30 | mutable.set(56, 8); |
31 | mutable.set(60, 63); |
32 | mutable.set(61, 64); |
33 | mutable.set(62, 7); |
34 | |
35 | System.out.print(mutable.get(56) + " "); |
36 | System.out.print(mutable.get(60) + " "); |
37 | System.out.print(mutable.get(61) + " "); |
38 | System.out.print(mutable.get(62) + " "); |
39 | System.out.println(mutable.size()); |
40 | System.out.println(); |
41 | |
42 | |
43 | mutable = PackedInts.getMutable(100, 8, PackedInts.Format.PACKED); |
44 | mutable.set(56, 8); |
45 | mutable.set(60, 255); |
46 | mutable.set(61, 256); |
47 | mutable.set(62, 7); |
48 | |
49 | System.out.println(mutable.get(56)); |
50 | System.out.println(mutable.get(60)); |
51 | System.out.println(mutable.get(61)); |
52 | System.out.println(mutable.get(62)); |
53 | } |
54 | } |
sventon 2.5.1