file_name
stringlengths 7
60
| file_path
stringlengths 63
220
| content
stringlengths 954
292k
| file_size
int64 954
292k
| language
stringclasses 1
value | extension
stringclasses 1
value | repo_name
stringlengths 8
75
| repo_stars
int64 8
21.2k
| repo_forks
int64 0
3.21k
| repo_open_issues
int64 0
1.54k
| repo_created_at
stringlengths 20
20
| repo_pushed_at
stringlengths 20
20
| sha
stringlengths 64
64
| near_dups_stkv2_idx
listlengths 0
0
| input_ids
listlengths 325
1.02k
| attention_mask
listlengths 1
1
| n_tok
int64 325
1.02k
| sample
listlengths 300
300
| hash
int64 -9,217,187,865,942,657,000
9,220,665,241B
| uniques_1
bool 1
class | uniques_2
bool 1
class | uniques_3
bool 1
class | uniques_g3
bool 1
class | sample_query
listlengths 100
100
| hash_sq
int64 -9,165,591,567,420,961,000
9,187,754,742B
| uniques
bool 1
class | prefix_250
stringlengths 276
2.18k
| prefix_200
stringlengths 230
1.78k
| prefix_150
stringlengths 180
1.4k
| prefix_100
stringlengths 110
917
| suffix
stringlengths 57
504
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FileOutputStreamAdapter.java
|
/FileExtraction/Java_unseen/husonlab_megan-ce/src/megan/io/FileOutputStreamAdapter.java
|
/*
* FileOutputStreamAdapter.java Copyright (C) 2024 Daniel H. Huson
*
* (Some files contain contributions from other authors, who are then mentioned separately.)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package megan.io;
import java.io.*;
/**
* file output wrapper
* Daniel Huson, 6.2009
*/
public class FileOutputStreamAdapter implements IOutput {
private static final int BUFFER_SIZE = 8192;
private final BufferedOutputStream outs;
private long position;
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
position = 0;
}
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file, boolean append) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file, append), BUFFER_SIZE);
if (append)
position = file.length();
}
/**
* get position in file
*
* @return position
*/
public long getPosition() {
return position;
}
/**
* get current length of file
*
* @return length
*/
public long length() {
return position;
}
/**
* seek, not supported
*
*/
public void seek(long pos) {
}
/**
* seek is not supported
*
* @return false
*/
public boolean supportsSeek() {
return false;
}
/**
* write a byte
*
*/
public void write(int a) throws IOException {
outs.write(a);
position++;
}
/**
* write bytes
*
*/
public void write(byte[] bytes, int offset, int length) throws IOException {
outs.write(bytes, offset, length);
position += length;
}
/**
* close this stream
*
*/
public void close() throws IOException {
outs.close();
}
/**
* flush the current stream
*
*/
public void flush() throws IOException {
outs.flush();
}
}
| 2,692
|
Java
|
.java
|
husonlab/megan-ce
| 62
| 21
| 18
|
2016-05-09T10:55:38Z
|
2024-02-22T23:23:42Z
|
43edd8f3f7ae40a0e5e216b8fa8187bdce5eec06840d49f6827e6ff4cd4f6051
|
[] |
[
1127,
222,
338,
37000,
4433,
51,
1874,
2657,
327,
72,
46,
244,
55,
53,
55,
57,
32649,
696,
51,
696,
371,
286,
222,
338,
222,
338,
327,
7313,
2293,
4814,
25194,
664,
1623,
14656,
49,
6574,
904,
1636,
14554,
25028,
7475,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
616,
16136,
51,
735,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
222,
1350,
222,
338,
822,
1716,
7780,
222,
338,
32649,
696,
371,
286,
49,
244,
59,
51,
55,
53,
53,
62,
222,
588,
222,
942,
462,
37000,
4433,
4584,
457,
2319,
320,
303,
964,
924,
1175,
648,
44206,
100,
3382,
299,
244,
61,
54,
62,
55,
64,
303,
964,
1175,
16900,
8783,
986,
120,
64,
303,
964,
1964,
2764,
64,
465,
1041,
294,
338,
4389,
294,
338,
376,
588,
303,
581,
37000,
4433,
45,
991,
822,
46,
2589,
47493,
320,
310,
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
490,
44206,
100,
3382,
312,
310,
2764,
299,
244,
53,
64,
303,
339,
465,
1041,
294,
338,
4389,
294,
338,
376,
588,
303,
581,
37000,
4433,
45,
991,
822,
49,
1922,
5507,
46,
2589,
47493,
320,
310,
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
49,
5507,
490,
44206,
100,
3382,
312,
310,
434,
327,
1713,
46,
343,
2764,
299,
822,
51,
1340,
492,
303,
339,
465,
1041,
294,
338,
640,
2764,
347,
822,
294,
338,
294,
338,
496,
620,
2764,
294,
588,
303,
581,
1964,
640,
2746,
365,
320,
310,
461,
2764,
64,
303,
339,
465,
1041,
294,
338,
640,
1565,
3124,
451,
822,
294,
338,
294,
338,
496,
620,
3124,
294,
588,
303,
581,
1964,
3124,
365,
320,
310,
461,
2764,
64,
303,
339,
465,
1041,
294,
338,
22829,
49,
666,
5430,
294,
338,
376,
588,
303,
581,
782,
22829,
45,
3239,
3423,
46,
320,
303,
339,
465,
1041,
294,
338,
22829,
458,
666,
5430,
294,
338,
294,
338,
496,
620,
920,
294,
588,
303,
581,
1922,
9568,
18441,
365,
320,
310,
461,
920,
64,
303,
339,
465,
1041,
294,
338,
2886,
331,
3447,
294,
338,
376,
588,
303,
581,
782,
2886,
45,
429,
331,
46,
2589,
6300,
320,
310,
986,
120,
51,
1838,
45,
102,
312,
310,
2764,
3348,
303,
339,
465,
1041,
294,
338,
2886,
3534,
294,
338,
376,
588,
303,
581,
782,
2886,
45,
2278,
1197,
3534,
49,
648,
3413,
49,
648,
3124,
46,
2589,
6300,
320,
310,
986,
120,
51,
1838,
45,
3669,
49,
3413,
49,
3124,
312,
310,
2764,
1475,
3124,
64,
303,
339,
465,
1041,
294,
338,
4248,
477,
3458,
294,
338,
376,
588,
303,
581,
782,
4248,
365,
2589,
6300,
320,
310,
986,
120,
51,
2698,
492,
303,
339,
465,
1041,
294,
338,
15037,
341,
1565,
3458,
294,
338,
376,
588,
303,
581,
782,
15037,
365,
2589,
6300,
320,
310,
986,
120,
51,
9327,
492,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 624
|
[
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
616,
16136,
51,
735,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
222,
1350,
222,
338,
822,
1716,
7780,
222,
338,
32649,
696,
371,
286,
49,
244,
59,
51,
55,
53,
53,
62,
222,
588,
222,
942,
462,
37000,
4433,
4584,
457,
2319,
320,
303,
964,
924,
1175,
648,
44206,
100,
3382,
299,
244,
61,
54,
62,
55,
64,
303,
964,
1175,
16900,
8783,
986,
120,
64,
303,
964,
1964,
2764,
64,
465,
1041,
294,
338,
4389,
294,
338,
376,
588,
303,
581,
37000,
4433,
45,
991,
822,
46,
2589,
47493,
320,
310,
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
490,
44206,
100,
3382,
312,
310,
2764,
299,
244,
53,
64,
303,
339,
465,
1041,
294,
338,
4389,
294,
338,
376,
588,
303,
581,
37000,
4433,
45,
991,
822,
49,
1922,
5507,
46,
2589,
47493,
320,
310,
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
49,
5507,
490,
44206,
100,
3382,
312,
310,
434,
327,
1713,
46,
343,
2764,
299,
822,
51,
1340,
492,
303,
339,
465,
1041,
294,
338,
640,
2764,
347,
822,
294,
338,
294,
338,
496,
620,
2764,
294,
588,
303,
581,
1964,
640,
2746,
365,
320,
310,
461,
2764,
64,
303,
339,
465,
1041,
294,
338,
640,
1565,
3124,
451,
822,
294,
338,
294,
338,
496,
620,
3124,
294,
588,
303,
581,
1964,
3124,
365,
320,
310,
461,
2764,
64,
303,
339,
465,
1041,
294,
338,
22829,
49,
666,
5430,
294,
338
] | -5,135,551,200,280,734,000
| true
| false
| false
| false
|
[
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
490,
44206,
100,
3382,
312,
310,
2764,
299,
244,
53,
64,
303,
339,
465,
1041,
294,
338,
4389,
294,
338,
376,
588,
303,
581,
37000,
4433,
45,
991,
822,
49,
1922,
5507,
46,
2589,
47493,
320,
310,
986,
120,
299,
556,
16900,
8783,
45,
909,
37000,
45,
781,
49,
5507,
490,
44206,
100,
3382,
312,
310,
434,
327,
1713,
46,
343,
2764,
299,
822,
51,
1340,
492,
303,
339,
465,
1041,
294,
338,
640,
2764,
347,
822,
294,
338,
294,
338,
496,
620,
2764,
294,
588,
303,
581,
1964
] | -8,046,125,004,911,504,000
| true
|
See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package megan.io;
import java.io.*;
/**
* file output wrapper
* Daniel Huson, 6.2009
*/
public class FileOutputStreamAdapter implements IOutput {
private static final int BUFFER_SIZE = 8192;
private final BufferedOutputStream outs;
private long position;
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
position = 0;
}
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file, boolean append) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file, append), BUFFER_SIZE);
if (append)
position = file.length();
}
/**
* get position in file
*
* @return position
*/
public long
|
licenses/>.
*/
package megan.io;
import java.io.*;
/**
* file output wrapper
* Daniel Huson, 6.2009
*/
public class FileOutputStreamAdapter implements IOutput {
private static final int BUFFER_SIZE = 8192;
private final BufferedOutputStream outs;
private long position;
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
position = 0;
}
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file, boolean append) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file, append), BUFFER_SIZE);
if (append)
position = file.length();
}
/**
* get position in file
*
* @return position
*/
public long
|
{
private static final int BUFFER_SIZE = 8192;
private final BufferedOutputStream outs;
private long position;
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
position = 0;
}
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file, boolean append) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file, append), BUFFER_SIZE);
if (append)
position = file.length();
}
/**
* get position in file
*
* @return position
*/
public long
|
outs = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
position = 0;
}
/**
* constructor
*
*/
public FileOutputStreamAdapter(File file, boolean append) throws FileNotFoundException {
outs = new BufferedOutputStream(new FileOutputStream(file, append), BUFFER_SIZE);
if (append)
position = file.length();
}
/**
* get position in file
*
* @return position
*/
public long
|
getPosition() {
return position;
}
/**
* get current length of file
*
* @return length
*/
public long length() {
return position;
}
/**
* seek, not supported
*
|
ActionRunDo.java
|
/FileExtraction/Java_unseen/lishangwl_yichujifa/app/src/main/java/esqeee/xieqing/com/eeeeee/action/ActionRunDo.java
|
package esqeee.xieqing.com.eeeeee.action;
import com.yicu.yichujifa.GlobalContext;
import java.util.HashMap;
import esqeee.xieqing.com.eeeeee.bean.JSONBean;
import esqeee.xieqing.com.eeeeee.doAction.Base;
import esqeee.xieqing.com.eeeeee.doAction.api.App;
import esqeee.xieqing.com.eeeeee.doAction.api.Array;
import esqeee.xieqing.com.eeeeee.doAction.api.Assgin;
import esqeee.xieqing.com.eeeeee.doAction.api.Auto;
import esqeee.xieqing.com.eeeeee.doAction.api.Bule;
import esqeee.xieqing.com.eeeeee.doAction.api.Click;
import esqeee.xieqing.com.eeeeee.doAction.api.ClickText;
import esqeee.xieqing.com.eeeeee.doAction.api.Color;
import esqeee.xieqing.com.eeeeee.doAction.api.Condition;
import esqeee.xieqing.com.eeeeee.doAction.api.Dialog;
import esqeee.xieqing.com.eeeeee.doAction.api.Encrypt;
import esqeee.xieqing.com.eeeeee.doAction.api.Fast;
import esqeee.xieqing.com.eeeeee.doAction.api.File;
import esqeee.xieqing.com.eeeeee.doAction.api.FlashClose;
import esqeee.xieqing.com.eeeeee.doAction.api.FlashOpen;
import esqeee.xieqing.com.eeeeee.doAction.api.For;
import esqeee.xieqing.com.eeeeee.doAction.api.Genster;
import esqeee.xieqing.com.eeeeee.doAction.api.Http;
import esqeee.xieqing.com.eeeeee.doAction.api.If;
import esqeee.xieqing.com.eeeeee.doAction.api.Image;
import esqeee.xieqing.com.eeeeee.doAction.api.InputText;
import esqeee.xieqing.com.eeeeee.doAction.api.Key;
import esqeee.xieqing.com.eeeeee.doAction.api.LongClick;
import esqeee.xieqing.com.eeeeee.doAction.api.Node;
import esqeee.xieqing.com.eeeeee.doAction.api.Paste;
import esqeee.xieqing.com.eeeeee.doAction.api.RandomSleep;
import esqeee.xieqing.com.eeeeee.doAction.api.SL;
import esqeee.xieqing.com.eeeeee.doAction.api.STRING;
import esqeee.xieqing.com.eeeeee.doAction.api.Setting;
import esqeee.xieqing.com.eeeeee.doAction.api.Sleep;
import esqeee.xieqing.com.eeeeee.doAction.api.Swip;
import esqeee.xieqing.com.eeeeee.doAction.api.SwipLine;
import esqeee.xieqing.com.eeeeee.doAction.api.System;
import esqeee.xieqing.com.eeeeee.doAction.api.Toast;
import esqeee.xieqing.com.eeeeee.doAction.api.UI;
import esqeee.xieqing.com.eeeeee.doAction.api.While;
import esqeee.xieqing.com.eeeeee.doAction.api.Wifi;
import esqeee.xieqing.com.eeeeee.doAction.core.Media;
import esqeee.xieqing.com.eeeeee.doAction.core.ScaleMatrics;
import esqeee.xieqing.com.eeeeee.doAction.core.Text2Speech;
import esqeee.xieqing.com.eeeeee.library.RuntimeLog;
public class ActionRunDo {
private HashMap<Object, Base> actionTable = new HashMap<>();{
actionTable.put(-1,new Sleep());
actionTable.put(0,new FlashOpen());
actionTable.put(1,new FlashClose());
actionTable.put(2,new Click());
actionTable.put(3,new ClickText());
actionTable.put(41,new ClickText());
actionTable.put(49,new ClickText());
actionTable.put(62,new ClickText());
actionTable.put(30,new Image());
actionTable.put(50,new Image());
actionTable.put(60,new Image());
actionTable.put(61,new Image());
actionTable.put(58,new Color());
actionTable.put(59,new Color());
actionTable.put(67,new Color());
actionTable.put(68,new Color());
actionTable.put(4,new Key());
actionTable.put(5,new Key());
actionTable.put(6,new Key());
actionTable.put(11,new Key());
actionTable.put(14,new Key());
actionTable.put(15,new InputText());
actionTable.put(12,new App());
actionTable.put(13,new SwipLine());
actionTable.put(42,new Genster());
actionTable.put(7,new Swip());
actionTable.put(8,new Swip());
actionTable.put(9,new Swip());
actionTable.put(10,new Swip());
actionTable.put(22,new Setting());
actionTable.put(23,new Setting());
actionTable.put(24,new Setting());
actionTable.put(25,new Setting());
actionTable.put(26,new Setting());
actionTable.put(27,new Setting());
actionTable.put(28,new Setting());
actionTable.put(29,new Setting());
actionTable.put(31,new Setting());
actionTable.put(34,new Setting());
actionTable.put(35,new Setting());
actionTable.put(36,new Setting());
actionTable.put(37,new Setting());
actionTable.put(57,new Setting());
actionTable.put(64,new Setting());
actionTable.put(65,new Setting());
actionTable.put(66,new Setting());
actionTable.put(69,new Setting());
actionTable.put(38,new Fast());
actionTable.put(39,new Fast());
actionTable.put(40,new Fast());
actionTable.put(46,new Paste());
actionTable.put(53,new For());
actionTable.put(43,new If());
actionTable.put(51,new RandomSleep());
actionTable.put(52,new While());
actionTable.put(55,new Toast());
actionTable.put(16,new LongClick());
actionTable.put(17,new Auto());
actionTable.put(18,new Wifi());
actionTable.put(19,new Wifi());
actionTable.put(20,new Bule());
actionTable.put(21,new Bule());
actionTable.put(54,new Condition());
actionTable.put(63,new Condition());
actionTable.put(44,new Condition());
actionTable.put(45,new Condition());
actionTable.put(47,new Condition());
actionTable.put(48,new Condition());
actionTable.put(72,new Condition());
actionTable.put(70,new Http());
actionTable.put(71,new Assgin());
actionTable.put(73,new STRING());
actionTable.put(74,new File());
actionTable.put(75,new Encrypt());
actionTable.put(77,new SL());
actionTable.put(78,new Array());
actionTable.put(79,new Node());
actionTable.put(80,new Dialog());
actionTable.put(81,new UI());
actionTable.put(83,new System());
}
public boolean post(int type,JSONBean jsonBean, ActionRun self, ActionRun.Block block){
if (type == 56){
return true;
}
//RuntimeLog.log("[block:"+block.blockName+"]"+block.getVariables().length());
if (!actionTable.containsKey(type)){
RuntimeLog.e("error, action = "+type+" not define.");
return false;
}
JSONBean param = jsonBean.getJson("param");
String desc = param.getString("desc");
if (!desc.equals("")){
RuntimeLog.i("ps:"+desc);
}
return actionTable.get(type).setJsonBean(jsonBean).setRun(self).setBlock(block).post(param.put("actionType",type));
}
private Media media;
private Text2Speech speech = new Text2Speech(GlobalContext.getContext());
public Text2Speech getSpeech() {
return speech;
}
public Media getMedia() {
if (media == null){
media = new Media();
}
return media;
}
public ScaleMatrics getScaleMatrics(int width,int height) {
return new ScaleMatrics(width,height);
}
public void reslese(){
if (media != null){
media.reslese();
}
if (speech != null){
speech.reslese();
}
}
}
| 7,169
|
Java
|
.java
|
lishangwl/yichujifa
| 60
| 30
| 3
|
2023-04-06T11:51:16Z
|
2023-04-06T15:43:42Z
|
c67c17ed9595c305a23a6a51594b6c251fd04bc7fb0deca732572a73c5602007
|
[] |
[
1337,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1160,
64,
222,
222,
485,
785,
51,
126,
41003,
51,
126,
1211,
9646,
37365,
51,
4470,
1237,
64,
222,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
12455,
51,
3275,
5358,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1778,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1306,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1280,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
4028,
1542,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
4754,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
71,
779,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2668,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2668,
1049,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1530,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
5371,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3742,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
19379,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
12200,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
991,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
15302,
4187,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
15302,
2981,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1580,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
5154,
6449,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2233,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2811,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1675,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1630,
1049,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
971,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3967,
2668,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1230,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
29491,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
6124,
15145,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3910,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
5215,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
7093,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
15145,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3926,
658,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3926,
658,
1829,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1615,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
15030,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2299,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
16221,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
25124,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1284,
51,
5003,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1284,
51,
5243,
3002,
119,
1339,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1284,
51,
1049,
55,
22023,
64,
222,
485
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1306,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1280,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
4028,
1542,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
4754,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
71,
779,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2668,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
2668,
1049,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1530,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
5371,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3742,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
19379,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
12200,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
991,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51
] | 4,832,389,744,547,261,000
| true
| false
| false
| false
|
[
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
1530,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
5371,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
3742,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310,
51,
1428,
1728,
51,
1256,
51,
19379,
64,
222,
485,
2834,
118,
17506,
51,
125,
1093,
118,
318,
51,
527,
51,
25909,
1310
] | 2,417,562,655,413,605,400
| true
|
App;
import esqeee.xieqing.com.eeeeee.doAction.api.Array;
import esqeee.xieqing.com.eeeeee.doAction.api.Assgin;
import esqeee.xieqing.com.eeeeee.doAction.api.Auto;
import esqeee.xieqing.com.eeeeee.doAction.api.Bule;
import esqeee.xieqing.com.eeeeee.doAction.api.Click;
import esqeee.xieqing.com.eeeeee.doAction.api.ClickText;
import esqeee.xieqing.com.eeeeee.doAction.api.Color;
import esqeee.xieqing.com.eeeeee.doAction.api.Condition;
import esqeee.xieqing.com.eeeeee.doAction.api.Dialog;
import esqeee.xieqing.com.eeeeee.doAction.api.Encrypt;
import esqeee.xieqing.com.eeeeee
|
import esqeee.xieqing.com.eeeeee.doAction.api.Auto;
import esqeee.xieqing.com.eeeeee.doAction.api.Bule;
import esqeee.xieqing.com.eeeeee.doAction.api.Click;
import esqeee.xieqing.com.eeeeee.doAction.api.ClickText;
import esqeee.xieqing.com.eeeeee.doAction.api.Color;
import esqeee.xieqing.com.eeeeee.doAction.api.Condition;
import esqeee.xieqing.com.eeeeee.doAction.api.Dialog;
import esqeee.xieqing.com.eeeeee.doAction.api.Encrypt;
import esqeee.xieqing.com.eeeeee
|
eee.xieqing.com.eeeeee.doAction.api.Click;
import esqeee.xieqing.com.eeeeee.doAction.api.ClickText;
import esqeee.xieqing.com.eeeeee.doAction.api.Color;
import esqeee.xieqing.com.eeeeee.doAction.api.Condition;
import esqeee.xieqing.com.eeeeee.doAction.api.Dialog;
import esqeee.xieqing.com.eeeeee.doAction.api.Encrypt;
import esqeee.xieqing.com.eeeeee
|
ieqing.com.eeeeee.doAction.api.Color;
import esqeee.xieqing.com.eeeeee.doAction.api.Condition;
import esqeee.xieqing.com.eeeeee.doAction.api.Dialog;
import esqeee.xieqing.com.eeeeee.doAction.api.Encrypt;
import esqeee.xieqing.com.eeeeee
|
.doAction.api.Fast;
import esqeee.xieqing.com.eeeeee.doAction.api.File;
import esqeee.xieqing.com.eeeeee.doAction.
|
ABTestingServiceTest.java
|
/FileExtraction/Java_unseen/todoroo_astrid/tests/src/com/todoroo/astrid/service/ABTestingServiceTest.java
|
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.sql.Order;
import com.todoroo.andlib.sql.Query;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.dao.ABTestEventDao;
import com.todoroo.astrid.data.ABTestEvent;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.test.DatabaseTestCase;
public class ABTestingServiceTest extends DatabaseTestCase {
@Autowired ABTestEventDao abTestEventDao;
@Autowired ABChooser abChooser;
@Autowired ABTests abTests;
public void testReportInitialEventNewUser() {
testInitialEvents(true, false);
}
public void testReportInitialEventExistingUser() {
testInitialEvents(false, true);
}
private void testInitialEvents(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 0);
}
public void testIntervalEventWithShortIntervalNewUser() {
testIntervalEventWithShortInterval(true, false);
}
public void testIntervalEventWithShortIntervalExistingUser() {
testIntervalEventWithShortInterval(false, true);
}
public void testIntervalEventWithLongIntervalNewUser() {
testIntervalEventWithLongInterval(true, false);
}
public void testIntervalEventWithLongIntervalExistingUser() {
testIntervalEventWithLongInterval(false, true);
}
private void testIntervalEventWithShortInterval(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 3);
}
private void testIntervalEventWithLongInterval(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 14);
}
private void testInterval(boolean newUser, boolean activatedUser, int testInterval) {
abChooser.makeChoicesForAllTests(newUser, activatedUser);
abTestEventDao.createTestEventWithTimeInterval(TEST_NAME, testInterval);
TodorooCursor<ABTestEvent> events = abTestEventDao.query(
Query.select(ABTestEvent.PROPERTIES)
.where(ABTestEvent.TEST_NAME.eq(TEST_NAME))
.orderBy(Order.asc(ABTestEvent.TIME_INTERVAL)));
try {
int maxIntervalIndex = AndroidUtilities.indexOf(ABTestEvent.TIME_INTERVALS, testInterval);
assertEquals(maxIntervalIndex + 1, events.getCount());
for (int i = 0; i < events.getCount(); i++) {
events.moveToNext();
ABTestEvent event = new ABTestEvent(events);
assertExpectedValues(event, newUser, activatedUser, ABTestEvent.TIME_INTERVALS[i]);
}
} finally {
events.close();
}
}
private void assertExpectedValues(ABTestEvent event, boolean newUser, boolean activatedUser, int timeInterval) {
assertEquals(TEST_NAME, event.getValue(ABTestEvent.TEST_NAME));
assertEquals(newUser ? 1 : 0, event.getValue(ABTestEvent.NEW_USER).intValue());
assertEquals(activatedUser ? 1 : 0, event.getValue(ABTestEvent.ACTIVATED_USER).intValue());
assertEquals(timeInterval, event.getValue(ABTestEvent.TIME_INTERVAL).intValue());
}
@Override
protected void setUp() throws Exception {
super.setUp();
abTests.addTest(TEST_NAME, new int[] { 9, 1 } , new int[] { 1, 9 }, TEST_OPTIONS, true);
Preferences.clear(TEST_NAME);
}
private static final String TEST_NAME = "test_experiment";
private static final String[] TEST_OPTIONS = new String[] { "opt-1", "opt-2" };
}
| 3,831
|
Java
|
.java
|
todoroo/astrid
| 1,076
| 691
| 14
|
2010-05-22T20:26:39Z
|
2020-01-30T20:16:21Z
|
c9317d75c605c74064a6b19f8686f20884e52f499bd9580172a680d017df2b62
|
[] |
[
1350,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
54,
55,
28818,
290,
623,
6367,
222,
338,
222,
338,
2819,
341,
822,
332,
4106,
39,
456,
341,
3559,
3553,
5139,
477,
1361,
51,
222,
588,
222,
1337,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
2140,
64,
222,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
624,
51,
16468,
290,
623,
7424,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
2140,
51,
10789,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
2622,
51,
2888,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
2622,
51,
1643,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
16777,
51,
9213,
13392,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
382,
1379,
51,
16777,
51,
11333,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
13974,
51,
1336,
1024,
1167,
8924,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
624,
51,
1336,
1024,
1167,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
2140,
51,
380,
4280,
51,
1336,
21216,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
2140,
51,
380,
4280,
51,
1336,
4485,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
881,
51,
3969,
7246,
64,
222,
222,
942,
462,
20660,
10870,
1201,
1024,
2041,
6728,
7246,
320,
465,
496,
10789,
20660,
1024,
1167,
8924,
1419,
1024,
1167,
8924,
64,
303,
496,
10789,
20660,
21216,
1419,
21216,
64,
303,
496,
10789,
20660,
4485,
1419,
4485,
64,
465,
581,
782,
913,
4158,
4694,
1167,
1827,
1259,
365,
320,
310,
913,
4694,
5015,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
4158,
4694,
1167,
18104,
1259,
365,
320,
310,
913,
4694,
5015,
45,
1886,
49,
878,
312,
303,
339,
465,
964,
782,
913,
4694,
5015,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
46,
320,
310,
913,
5766,
45,
909,
1259,
49,
25220,
1259,
49,
244,
53,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
1827,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
18104,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766,
45,
1886,
49,
878,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
3967,
5766,
1827,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
3967,
5766,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
3967,
5766,
18104,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
3967,
5766,
45,
1886,
49,
878,
312,
303,
339,
465,
964,
782,
913,
5766,
1167,
1569,
6881,
5766,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
46,
320,
310,
913,
5766,
45,
909,
1259,
49,
25220,
1259,
49,
244,
56,
312,
303,
339,
465,
964,
782,
913,
5766,
1167,
1569,
3967,
5766,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
46,
320,
310,
913,
5766,
45,
909,
1259,
49,
25220,
1259,
49,
244,
54,
57,
312,
303,
339,
465,
964,
782,
913,
5766,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
49,
648,
913,
5766,
46,
320,
310,
1419,
21216,
51,
2696,
34857,
43259,
4485,
45,
909,
1259,
49,
25220,
1259,
312,
310,
1419,
1024,
1167,
8924,
51,
1315,
1024,
1167,
1569,
1061,
5766,
45,
3780,
100,
2491,
49,
913,
5766,
312,
603,
28818,
290,
623,
7424,
65,
1336,
1024,
1167,
67,
5233,
299,
1419,
1024,
1167,
8924,
51,
1234,
45,
419,
6662,
51,
1632,
45,
1336,
1024,
1167,
51,
30801,
46,
419,
657,
2786,
45,
1336,
1024,
1167,
51,
3780,
100,
2491,
51,
3705,
45,
3780,
100,
2491,
509,
419,
657,
14412,
45,
2888,
51,
9600,
45,
1336,
1024,
1167,
51,
4812,
100,
22863,
4254,
310,
1614,
320,
343,
648,
1788,
5766,
1301,
299,
8107,
13392,
51,
7149,
45,
1336,
1024,
1167,
51,
4812,
100,
22863,
88,
49,
913,
5766,
312,
343,
3803,
45,
1472,
5766,
1301,
494,
244,
54,
49,
5233,
51,
32931,
1052,
1083,
456,
327,
429,
613,
299,
244,
53,
64,
613,
350,
5233,
51,
32931,
492,
613,
2002,
320,
419,
5233,
51,
23061,
3364,
492,
419,
20660,
1024,
1167,
1708,
299,
556,
20660,
1024,
1167,
45,
5070,
312,
419,
1217,
7705,
3367,
45,
1585,
49,
556,
1259,
49,
25220,
1259,
49,
20660,
1024,
1167,
51,
4812,
100,
22863,
88,
96,
110,
2004,
343,
339,
310,
339,
8312,
320,
343,
5233,
51,
2698,
492,
310,
339,
303,
339,
465,
964,
782,
1217,
7705,
3367,
45,
1336,
1024,
1167,
1708,
49,
1922,
556,
1259,
49,
1922,
25220,
1259,
49,
648,
1153,
5766,
46,
320,
310,
3803,
45,
3780,
100,
2491,
49,
1708,
51,
6693,
45,
1336,
1024,
1167,
51,
3780,
100,
2491,
894,
310,
3803,
45,
909,
1259,
1037,
244,
54,
518,
244,
53,
49,
1708,
51,
6693,
45,
1336,
1024,
1167,
51,
11364,
100,
4991,
566,
22777,
1052,
310,
3803,
45,
25201,
1259,
1037,
244,
54,
518,
244,
53,
49,
1708,
51,
6693,
45,
1336,
1024,
1167,
51,
20526,
8153,
100,
4991,
566,
22777,
1052,
310,
3803,
45,
1021,
5766,
49,
1708,
51,
6693,
45,
1336,
1024,
1167,
51,
4812,
100,
22863,
566,
22777,
1052,
303,
339,
465,
496,
1806,
303,
2532,
782,
14544,
365,
2589,
3284,
320,
310,
2615,
51,
23715,
492,
310,
1419,
4485,
51,
688,
1024,
45,
3780,
100,
2491,
49,
556,
648,
1197,
320,
244,
62,
49,
244,
54,
339,
1737,
556,
648,
1197,
320,
244,
54,
49,
244,
62,
820,
5904,
100,
15966,
49,
878,
312,
310,
38440,
51,
3830,
45,
3780,
100,
2491,
312,
303,
339,
465,
964,
924,
1175,
910,
5904,
100,
2491,
299,
332,
881,
100,
10963,
884,
303,
964,
924,
1175,
910,
1197,
5904,
100,
15966,
299,
556,
910,
1197,
320,
332,
2238,
50,
54,
411,
332,
2238,
50,
55,
39,
1487,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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
21216,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
2140,
51,
380,
4280,
51,
1336,
4485,
64,
222,
485,
785,
51,
10197,
290,
623,
51,
22375,
333,
51,
881,
51,
3969,
7246,
64,
222,
222,
942,
462,
20660,
10870,
1201,
1024,
2041,
6728,
7246,
320,
465,
496,
10789,
20660,
1024,
1167,
8924,
1419,
1024,
1167,
8924,
64,
303,
496,
10789,
20660,
21216,
1419,
21216,
64,
303,
496,
10789,
20660,
4485,
1419,
4485,
64,
465,
581,
782,
913,
4158,
4694,
1167,
1827,
1259,
365,
320,
310,
913,
4694,
5015,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
4158,
4694,
1167,
18104,
1259,
365,
320,
310,
913,
4694,
5015,
45,
1886,
49,
878,
312,
303,
339,
465,
964,
782,
913,
4694,
5015,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
46,
320,
310,
913,
5766,
45,
909,
1259,
49,
25220,
1259,
49,
244,
53,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
1827,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
18104,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766,
45,
1886,
49,
878,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
3967,
5766,
1827,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
3967,
5766,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
3967,
5766,
18104,
1259,
365,
320,
310,
913,
5766
] | -4,984,972,391,152,324,000
| true
| false
| false
| false
|
[
465,
581,
782,
913,
4158,
4694,
1167,
18104,
1259,
365,
320,
310,
913,
4694,
5015,
45,
1886,
49,
878,
312,
303,
339,
465,
964,
782,
913,
4694,
5015,
45,
4412,
556,
1259,
49,
1922,
25220,
1259,
46,
320,
310,
913,
5766,
45,
909,
1259,
49,
25220,
1259,
49,
244,
53,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
1827,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766,
45,
1527,
49,
920,
312,
303,
339,
465,
581,
782,
913,
5766,
1167,
1569,
6881,
5766,
18104,
1259,
365,
320,
310,
913,
5766,
1167,
1569,
6881,
5766
] | -1,762,339,727,393,467,000
| true
|
import com.todoroo.astrid.dao.ABTestEventDao;
import com.todoroo.astrid.data.ABTestEvent;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.test.DatabaseTestCase;
public class ABTestingServiceTest extends DatabaseTestCase {
@Autowired ABTestEventDao abTestEventDao;
@Autowired ABChooser abChooser;
@Autowired ABTests abTests;
public void testReportInitialEventNewUser() {
testInitialEvents(true, false);
}
public void testReportInitialEventExistingUser() {
testInitialEvents(false, true);
}
private void testInitialEvents(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 0);
}
public void testIntervalEventWithShortIntervalNewUser() {
testIntervalEventWithShortInterval(true, false);
}
public void testIntervalEventWithShortIntervalExistingUser() {
testIntervalEventWithShortInterval
|
ABChooser;
import com.todoroo.astrid.service.abtesting.ABTests;
import com.todoroo.astrid.test.DatabaseTestCase;
public class ABTestingServiceTest extends DatabaseTestCase {
@Autowired ABTestEventDao abTestEventDao;
@Autowired ABChooser abChooser;
@Autowired ABTests abTests;
public void testReportInitialEventNewUser() {
testInitialEvents(true, false);
}
public void testReportInitialEventExistingUser() {
testInitialEvents(false, true);
}
private void testInitialEvents(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 0);
}
public void testIntervalEventWithShortIntervalNewUser() {
testIntervalEventWithShortInterval(true, false);
}
public void testIntervalEventWithShortIntervalExistingUser() {
testIntervalEventWithShortInterval
|
@Autowired ABTestEventDao abTestEventDao;
@Autowired ABChooser abChooser;
@Autowired ABTests abTests;
public void testReportInitialEventNewUser() {
testInitialEvents(true, false);
}
public void testReportInitialEventExistingUser() {
testInitialEvents(false, true);
}
private void testInitialEvents(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 0);
}
public void testIntervalEventWithShortIntervalNewUser() {
testIntervalEventWithShortInterval(true, false);
}
public void testIntervalEventWithShortIntervalExistingUser() {
testIntervalEventWithShortInterval
|
public void testReportInitialEventExistingUser() {
testInitialEvents(false, true);
}
private void testInitialEvents(boolean newUser, boolean activatedUser) {
testInterval(newUser, activatedUser, 0);
}
public void testIntervalEventWithShortIntervalNewUser() {
testIntervalEventWithShortInterval(true, false);
}
public void testIntervalEventWithShortIntervalExistingUser() {
testIntervalEventWithShortInterval
|
(false, true);
}
public void testIntervalEventWithLongIntervalNewUser() {
testIntervalEventWithLongInterval(true, false);
}
public void testIntervalEventWithLongIntervalExistingUser() {
testInterval
|
TransformXMLInterceptor_Test.java
|
/FileExtraction/Java_unseen/BorderTech_wcomponents/wcomponents-core/src/test/java/com/github/bordertech/wcomponents/container/TransformXMLInterceptor_Test.java
|
package com.github.bordertech.wcomponents.container;
import com.github.bordertech.wcomponents.AbstractWComponentTestCase;
import com.github.bordertech.wcomponents.RenderContext;
import com.github.bordertech.wcomponents.UIContext;
import com.github.bordertech.wcomponents.WContainer;
import com.github.bordertech.wcomponents.WebUtilities;
import com.github.bordertech.wcomponents.servlet.ServletRequest;
import com.github.bordertech.wcomponents.servlet.WebXmlRenderContext;
import com.github.bordertech.wcomponents.util.Config;
import com.github.bordertech.wcomponents.util.ConfigurationProperties;
import com.github.bordertech.wcomponents.util.SystemException;
import com.github.bordertech.wcomponents.util.mock.MockResponse;
import com.github.bordertech.wcomponents.util.mock.servlet.MockHttpServletRequest;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.junit.Assert;
import org.apache.commons.logging.Log;
import org.junit.AfterClass;
import org.junit.Test;
/**
* Test cases for the {@link TransformXMLInterceptor} class.
*
* @author Rick Brown
* @since 1.0.0
*/
public class TransformXMLInterceptor_Test extends AbstractWComponentTestCase {
/**
* The corrupt character input xml.
*/
private static final String TEST_CORRUPT_CHAR_XML = buildCorruptXML();
/**
* When these tests are done put things back as they were.
*/
@AfterClass
public static void tearDownClass() {
Config.reset();
TransformXMLTestHelper.reloadTransformer();
}
/**
* Ensure that the interceptor does nothing when the user agent string opts out.
*/
@Test
public void testPaintWithUserAgentOverride() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent", "Mozilla/5.0 Firefox/26.0 wcnoxslt");
TestResult actual = generateOutput(testUI, headers);
Assert.assertEquals("XML should not be transformed when useragent string flag present", TransformXMLTestHelper.TEST_XML, actual.result);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWhileEnabledWithThemeContentPathSet() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "set");
TransformXMLTestHelper.reloadTransformer();
TestResult actual = generateOutput(testUI);
Assert.assertEquals("XML should be transformed when interceptor enabled and theme content path set", TransformXMLTestHelper.EXPECTED, actual.result);
}
/**
* Test that the interceptor transforms our XML when it is enabled.
*/
@Test
public void testPaintWhileEnabled() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
TestResult actual = generateOutput(testUI);
Assert.assertEquals("XML should be transformed when interceptor enabled", TransformXMLTestHelper.EXPECTED, actual.result);
Assert.assertEquals("The content type should be correctly set", WebUtilities.CONTENT_TYPE_HTML, actual.contentType);
}
/**
* Test that the interceptor transforms our XML when it is enabled.
*/
@Test
public void testPaintWhileEnabledWithChromeUserAgent() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36");
TestResult actual = generateOutput(testUI, headers);
Assert.assertEquals("XML should be transformed when interceptor enabled", TransformXMLTestHelper.EXPECTED, actual.result);
Assert.assertEquals("The content type should be correctly set", WebUtilities.CONTENT_TYPE_HTML, actual.contentType);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWithCorruptCharacterException() {
MyComponent testUI = new MyComponent(TEST_CORRUPT_CHAR_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
Config.getInstance().setProperty(ConfigurationProperties.XSLT_ALLOW_CORRUPT_CHARACTER, "false");
TransformXMLTestHelper.reloadTransformer();
testUI.setLocked(true);
UIContext uic = createUIContext();
uic.setUI(testUI);
setActiveContext(uic);
try {
generateOutput(testUI, null);
Assert.fail("Corrupt character in XML should have failed.");
} catch (Exception e) {
Assert.assertTrue("Should contain could not transform", e.getMessage().contains("Could not transform"));
}
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWithCorruptCharacterAllowed() {
MyComponent testUI = new MyComponent(TEST_CORRUPT_CHAR_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
Config.getInstance().setProperty(ConfigurationProperties.XSLT_ALLOW_CORRUPT_CHARACTER, "true");
TransformXMLTestHelper.reloadTransformer();
testUI.setLocked(true);
UIContext uic = createUIContext();
uic.setUI(testUI);
setActiveContext(uic);
try {
generateOutput(testUI, null);
} catch (Exception e) {
Assert.fail("Corrupt character in XML should have NOT have failed.");
}
}
/**
* Test that the interceptor transforms with HTML entities.
*/
@Test
public void testPaintWithXMLEntities() {
// Should not change after transform
String entities = "&<>";
String in = "<kung><fu>" + entities + "</fu></kung>";
String out = "<omg><wtf>" + entities + "</wtf></omg>";
MyComponent testUI = new MyComponent(in);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
TestResult actual = generateOutput(testUI);
Assert.assertEquals("XML entities should not be decoded", out, actual.result);
}
/**
* Test that the interceptor transforms with HTML entities.
*/
@Test
public void testPaintWithEncodedBrackets() {
// Should not change after transform
String entities = "{}{}";
String in = "<kung><fu>" + entities + "</fu></kung>";
String out = "<omg><wtf>" + entities + "</wtf></omg>";
MyComponent testUI = new MyComponent(in);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
TestResult actual = generateOutput(testUI);
Assert.assertEquals("XML entities should not be decoded", out, actual.result);
}
/**
*
* @return XML with bad characters
*/
private static String buildCorruptXML() {
StringBuilder data = new StringBuilder();
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (!Character.isValidCodePoint(i)) {
continue;
}
char ch = (char) i;
if (ch != '>' && ch != '<' && ch != '&' && ch != '"') {
data.append(ch);
}
}
String utfString = "<kung><fu>" + data.toString() + "</fu></kung>";
String isoString = null;
try {
byte[] bytes = utfString.getBytes("UTF8");
isoString = new String(bytes, "ISO-8859-1");
} catch (final Exception e) {
throw new SystemException("Error translating. " + e.getMessage());
}
return isoString;
}
/**
* A 'fake' WComponent that renders the string we pass to the constructor.
*/
private static final class MyComponent extends WContainer {
/**
* Content to be painted by the test component.
*/
private final String content;
/**
* @param content the test content
*/
private MyComponent(final String content) {
this.content = content;
}
/**
* Simply render the string that was passed to the constructor.
*
* @param renderContext
*/
@Override
protected void paintComponent(final RenderContext renderContext) {
((WebXmlRenderContext) renderContext).getWriter().print(content);
super.paintComponent(renderContext);
}
}
/**
* Render the component and execute the interceptor.
*
* @param testUI the test component
* @return the response
*/
private TestResult generateOutput(final MyComponent testUI) {
return generateOutput(testUI, null);
}
/**
* Render the component and execute the interceptor.
*
* @param testUI the test component
* @param headers Request headers to set (key/value pairs).
* @return the response
*/
private TestResult generateOutput(final MyComponent testUI, final Map<String, String> headers) {
InterceptorComponent interceptor = new TransformXMLInterceptor();
interceptor.attachUI(testUI);
MockHttpServletRequest backing = new MockHttpServletRequest();
if (headers != null) {
for (String headerName : headers.keySet()) {
backing.setHeader(headerName, headers.get(headerName));
}
}
ServletRequest request = new ServletRequest(backing);
MockResponse response = new MockResponse();
interceptor.attachResponse(response);
StringWriter writer = new StringWriter();
UIContext uic = createUIContext();
uic.setLocale(new Locale("en"));
setActiveContext(uic);
try {
interceptor.preparePaint(request);
interceptor.paint(new WebXmlRenderContext(new PrintWriter(writer)));
} finally {
resetContext();
}
return new TestResult(writer.toString(), response.getContentType());
}
/**
* A simple DTO to pass back the results of the render to the calling test.
*/
private final class TestResult {
private String result;
private String contentType;
/**
* Create and instance of the DTO.
*
* @param result The rendered output of the UI component.
* @param contentType The content type of the response.
*/
private TestResult(final String result, final String contentType) {
this.result = result;
this.contentType = contentType;
}
}
/**
* Custom Log implementation to prevent all logging.
*
*/
public static final class NoLogLogger implements Log {
@Override
public boolean isDebugEnabled() {
return false;
}
@Override
public boolean isErrorEnabled() {
return false;
}
@Override
public boolean isFatalEnabled() {
return false;
}
@Override
public boolean isInfoEnabled() {
return false;
}
@Override
public boolean isTraceEnabled() {
return false;
}
@Override
public boolean isWarnEnabled() {
return false;
}
@Override
public void trace(final Object message) {
// No-impl
}
@Override
public void trace(final Object message, final Throwable t) {
// No-impl
}
@Override
public void debug(final Object message) {
// No-impl
}
@Override
public void debug(final Object message, final Throwable t) {
// No-impl
}
@Override
public void info(final Object message) {
// No-impl
}
@Override
public void info(final Object message, final Throwable t) {
// No-impl
}
@Override
public void warn(final Object message) {
// No-impl
}
@Override
public void warn(final Object message, final Throwable t) {
// No-impl
}
@Override
public void error(final Object message) {
// No-impl
}
@Override
public void error(final Object message, final Throwable t) {
// No-impl
}
@Override
public void fatal(final Object message) {
// No-impl
}
@Override
public void fatal(final Object message, final Throwable t) {
// No-impl
}
}
}
| 11,840
|
Java
|
.java
|
BorderTech/wcomponents
| 20
| 19
| 111
|
2015-03-10T02:59:08Z
|
2024-05-09T06:05:12Z
|
0460957083cc51f6c421d334cc8be98d724a6403e5c2fe08640188fc10b94be8
|
[] |
[
1337,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
2646,
64,
222,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
5597,
92,
1735,
7246,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
3135,
1237,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
2299,
1237,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
92,
2894,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
2609,
13392,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
10010,
51,
7399,
1123,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
10010,
51,
2609,
4411,
3135,
1237,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
1058,
51,
1081,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
1058,
51,
2339,
3303,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
1058,
51,
1615,
1002,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
1058,
51,
3628,
51,
3672,
1416,
64,
222,
485,
785,
51,
951,
51,
3489,
6646,
51,
124,
3545,
51,
1058,
51,
3628,
51,
10010,
51,
3672,
18804,
64,
222,
485,
1401,
51,
735,
51,
42446,
64,
222,
485,
1401,
51,
735,
51,
671,
3989,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1105,
51,
3946,
51,
3285,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
7506,
51,
1353,
64,
222,
485,
1105,
51,
3946,
51,
5131,
1359,
64,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
222,
1350,
222,
338,
2128,
6819,
456,
341,
3105,
1222,
11685,
5741,
13843,
130,
462,
51,
222,
338,
222,
338,
496,
2133,
578,
1246,
38619,
222,
338,
496,
8152,
244,
54,
51,
53,
51,
53,
222,
588,
222,
942,
462,
11685,
5741,
13843,
100,
1024,
2041,
7406,
92,
1735,
7246,
320,
499,
221,
1350,
376,
338,
906,
42511,
5373,
1533,
5604,
51,
376,
588,
222,
221,
2072,
924,
1175,
910,
5904,
100,
47023,
2430,
89,
100,
4935,
100,
5741,
299,
1984,
8714,
4874,
5741,
492,
499,
221,
1350,
376,
338,
5094,
3301,
3326,
904,
3412,
4180,
6397,
1769,
641,
2974,
4547,
51,
376,
588,
222,
221,
69,
5131,
1359,
222,
221,
942,
924,
782,
28896,
1359,
365,
320,
376,
221,
1081,
51,
4558,
492,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
222,
221,
130,
499,
221,
1350,
376,
338,
15135,
708,
341,
22978,
1976,
7572,
1429,
341,
1275,
7725,
821,
6414,
986,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
1569,
32246,
1806,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
10780,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
1225,
65,
671,
49,
910,
67,
4839,
299,
556,
8329,
65,
671,
49,
910,
2938,
376,
221,
5090,
51,
543,
459,
1259,
50,
6150,
411,
332,
24252,
52,
58,
51,
53,
18397,
52,
55,
59,
51,
53,
360,
4999,
1290,
36732,
742,
376,
221,
41146,
4668,
299,
4468,
2319,
45,
881,
2299,
49,
4839,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
666,
545,
21698,
1429,
1275,
4881,
821,
4666,
5041,
411,
11685,
5741,
39031,
51,
3780,
100,
5741,
49,
4668,
51,
1285,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
15135,
708,
341,
22978,
1976,
7572,
641,
1964,
641,
341,
42259,
2821,
458,
6879,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
16221,
4006,
1569,
6537,
1795,
1233,
903,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
332,
489,
742,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
41146,
4668,
299,
4468,
2319,
45,
881,
2299,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
545,
21698,
1429,
22978,
5892,
480,
6099,
1813,
1536,
758,
411,
11685,
5741,
39031,
51,
30314,
49,
4668,
51,
1285,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
2128,
708,
341,
22978,
19725,
3027,
7408,
1429,
580,
458,
5892,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
16221,
4006,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
10780,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
41146,
4668,
299,
4468,
2319,
45,
881,
2299,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
545,
21698,
1429,
22978,
5892,
411,
11685,
5741,
39031,
51,
30314,
49,
4668,
51,
1285,
312,
376,
221,
3285,
51,
4993,
459,
1338,
1813,
847,
1414,
545,
8487,
758,
411,
3718,
13392,
51,
11841,
100,
2333,
100,
4438,
49,
4668,
51,
20256,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
2128,
708,
341,
22978,
19725,
3027,
7408,
1429,
580,
458,
5892,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
16221,
4006,
1569,
18115,
32246,
365,
320,
1332,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
10780,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
1225,
65,
671,
49,
910,
67,
4839,
299,
556,
8329,
65,
671,
49,
910,
2938,
376,
221,
5090,
51,
543,
459,
1259,
50,
6150,
411,
621,
221,
39,
24252,
52,
58,
51,
53,
327,
8009,
429,
13827,
64,
16756,
9501,
6652,
1618,
244,
54,
53,
100,
54,
54,
100,
59,
46,
32337,
52,
58,
56,
60,
51,
56,
59,
327
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
320,
376,
221,
1081,
51,
4558,
492,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
222,
221,
130,
499,
221,
1350,
376,
338,
15135,
708,
341,
22978,
1976,
7572,
1429,
341,
1275,
7725,
821,
6414,
986,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
1569,
32246,
1806,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
10780,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
1225,
65,
671,
49,
910,
67,
4839,
299,
556,
8329,
65,
671,
49,
910,
2938,
376,
221,
5090,
51,
543,
459,
1259,
50,
6150,
411,
332,
24252,
52,
58,
51,
53,
18397,
52,
55,
59,
51,
53,
360,
4999,
1290,
36732,
742,
376,
221,
41146,
4668,
299,
4468,
2319,
45,
881,
2299,
49,
4839,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
666,
545,
21698,
1429,
1275,
4881,
821,
4666,
5041,
411,
11685,
5741,
39031,
51,
3780,
100,
5741,
49,
4668,
51,
1285,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
15135,
708,
341,
22978,
1976,
7572,
641,
1964,
641,
341,
42259,
2821,
458,
6879,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
16221,
4006,
1569,
6537,
1795,
1233,
903,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741,
312,
376,
221,
1081,
51,
7432,
941,
17507,
45,
2339,
3303,
51,
30497,
100,
11841,
100,
4088,
49,
332,
489,
742,
376,
221,
4879,
5741,
39031,
51,
12998,
15070,
492,
376,
221,
41146,
4668,
299,
4468,
2319,
45,
881,
2299,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
545
] | 4,977,524,717,120,023,000
| true
| false
| false
| false
|
[
4468,
2319,
45,
881,
2299,
49,
4839,
312,
376,
221,
3285,
51,
4993,
459,
5741,
1414,
666,
545,
21698,
1429,
1275,
4881,
821,
4666,
5041,
411,
11685,
5741,
39031,
51,
3780,
100,
5741,
49,
4668,
51,
1285,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
15135,
708,
341,
22978,
1976,
7572,
641,
1964,
641,
341,
42259,
2821,
458,
6879,
51,
376,
588,
222,
221,
69,
1024,
222,
221,
942,
782,
913,
12297,
16221,
4006,
1569,
6537,
1795,
1233,
903,
365,
320,
376,
221,
3781,
1735,
913,
2299,
299,
556,
4318,
1735,
45,
4879,
5741,
39031,
51,
3780,
100,
5741
] | -1,027,225,083,193,646,800
| true
|
{
Config.reset();
TransformXMLTestHelper.reloadTransformer();
}
/**
* Ensure that the interceptor does nothing when the user agent string opts out.
*/
@Test
public void testPaintWithUserAgentOverride() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent", "Mozilla/5.0 Firefox/26.0 wcnoxslt");
TestResult actual = generateOutput(testUI, headers);
Assert.assertEquals("XML should not be transformed when useragent string flag present", TransformXMLTestHelper.TEST_XML, actual.result);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWhileEnabledWithThemeContentPathSet() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML
|
WithUserAgentOverride() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "");
TransformXMLTestHelper.reloadTransformer();
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent", "Mozilla/5.0 Firefox/26.0 wcnoxslt");
TestResult actual = generateOutput(testUI, headers);
Assert.assertEquals("XML should not be transformed when useragent string flag present", TransformXMLTestHelper.TEST_XML, actual.result);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWhileEnabledWithThemeContentPathSet() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML
|
();
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent", "Mozilla/5.0 Firefox/26.0 wcnoxslt");
TestResult actual = generateOutput(testUI, headers);
Assert.assertEquals("XML should not be transformed when useragent string flag present", TransformXMLTestHelper.TEST_XML, actual.result);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWhileEnabledWithThemeContentPathSet() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML
|
generateOutput(testUI, headers);
Assert.assertEquals("XML should not be transformed when useragent string flag present", TransformXMLTestHelper.TEST_XML, actual.result);
}
/**
* Ensure that the interceptor does nothing as long as the controlling property is disabled.
*/
@Test
public void testPaintWhileEnabledWithThemeContentPathSet() {
MyComponent testUI = new MyComponent(TransformXMLTestHelper.TEST_XML
|
);
Config.getInstance().setProperty(ConfigurationProperties.THEME_CONTENT_PATH, "set");
TransformXMLTestHelper.reloadTransformer();
TestResult actual = generateOutput(testUI);
Assert.assertEquals("XML should be
|
JDDNode.java
|
/FileExtraction/Java_unseen/prismmodelchecker_prism/prism/src/jdd/JDDNode.java
|
//==============================================================================
//
// Copyright (c) 2002-
// Authors:
// * Dave Parker <david.parker@comlab.ox.ac.uk> (University of Oxford, formerly University of Birmingham)
// * Christian von Essen <christian.vonessen@imag.fr> (VERIMAG)
// * Joachim Klein <klein@tcs.inf.tu-dresden.de> (TU Dresden)
//
//------------------------------------------------------------------------------
//
// This file is part of PRISM.
//
// PRISM is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PRISM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with PRISM; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//==============================================================================
package jdd;
public class JDDNode
{
private long ptr;
// native methods (jni)
protected static native boolean DDN_IsConstant(long dd);
protected static native int DDN_GetIndex(long dd);
protected static native double DDN_GetValue(long dd);
protected static native long DDN_GetThen(long dd);
protected static native long DDN_GetElse(long dd);
static
{
try {
System.loadLibrary("jdd");
}
catch (UnsatisfiedLinkError e) {
System.out.println(e);
System.exit(1);
}
}
/**
* Protected constructor from a DdNode pointer.
* In general, to get a JDDNode from a pointer,
* use JDD.ptrToNode().
*/
protected JDDNode(long p)
{
ptr = p;
}
public long ptr()
{
return ptr;
}
public boolean isConstant()
{
return DDN_IsConstant(ptr);
}
public int getIndex()
{
return DDN_GetIndex(ptr);
}
public double getValue()
{
if (DebugJDD.debugEnabled) {
return DebugJDD.nodeGetValue(this);
}
return DDN_GetValue(ptr);
}
/**
* Returns the Then child of a (non-constant) JDDNode.
* <br>
* This method does NOT increase the reference count of the returned
* node, it is therefore illegal to call JDD.Deref on the result.
* Additionally, it is recommended to not use the returned node
* as the argument to the JDD methods or call JDD.Ref on it.
* Instead, if you need to obtain a "proper" node, call copy()
* on the returned node.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public JDDNode getThen()
{
if (DebugJDD.debugEnabled) {
return DebugJDD.nodeGetThen(this);
}
long thenPtr = DDN_GetThen(ptr);
if (thenPtr == 0) {
if (isConstant()) {
throw new RuntimeException("Trying to access the 'then' child of a constant MTBDD node");
} else {
throw new RuntimeException("getThen: CUDD returned NULL, but node is not a constant node. Out of memory or corrupted MTBDD?");
}
}
return new JDDNode(thenPtr);
}
/**
* Returns the Else child of a (non-constant) JDDNode.
* <br>
* This method does NOT increase the reference count of the returned
* node, it is therefore illegal to call JDD.Deref on the result.
* Additionally, it is recommended to not use the returned node
* as the argument to the JDD methods or call JDD.Ref on it.
* Instead, if you need to obtain a "proper" node, call copy()
* on the returned node.
* <br>[ REFS: <i>none</i>, DEREFS: <i>none</i> ]
*/
public JDDNode getElse()
{
if (DebugJDD.debugEnabled) {
return DebugJDD.nodeGetElse(this);
}
long elsePtr = DDN_GetElse(ptr);
if (elsePtr == 0) {
if (isConstant()) {
throw new RuntimeException("Trying to access the 'else' child of a constant MTBDD node");
} else {
throw new RuntimeException("getElse: CUDD returned NULL, but node is not a constant node. Out of memory or corrupted MTBDD?");
}
}
return new JDDNode(elsePtr);
}
public boolean equals(Object o)
{
return (o instanceof JDDNode) && (((JDDNode) o).ptr == ptr);
}
public int hashCode()
{
return (int)ptr;
}
public String toString()
{
String result = "" + ptr;
if (ptr != 0) {
if (this.isConstant()) result += " value=" + this.getValue();
result += " references=" + DebugJDD.getRefCount(this);
}
return result;
}
/**
* Returns a referenced copy of this node.
* This has the effect of increasing the reference count
* for the underlying MTBDD.
* <br>[ REFS: <i>result</i>, DEREFS: <i>none</i> ]
*/
public JDDNode copy()
{
if (DebugJDD.debugEnabled) {
return DebugJDD.Copy(this);
} else {
JDDNode result = new JDDNode(ptr());
JDD.Ref(result);
return result;
}
}
}
//------------------------------------------------------------------------------
| 4,958
|
Java
|
.java
|
prismmodelchecker/prism
| 145
| 65
| 54
|
2016-01-05T09:46:26Z
|
2024-03-27T18:31:12Z
|
bbebfd33cc6fa47158c4a5f637ef1542192f3261e4142953327483f3f524a388
|
[] |
[
20037,
18480,
222,
325,
221,
222,
325,
221,
10585,
327,
104,
46,
244,
55,
53,
53,
55,
50,
222,
325,
221,
36330,
63,
222,
325,
221,
47,
493,
808,
27004,
284,
350,
27928,
51,
587,
4797,
69,
527,
4809,
51,
1290,
51,
348,
51,
3434,
67,
327,
37137,
451,
565,
2088,
675,
49,
31329,
651,
11451,
451,
570,
3550,
318,
11809,
46,
222,
325,
221,
47,
47673,
9645,
535,
27075,
350,
399,
11581,
2560,
51,
123,
286,
522,
291,
69,
17802,
51,
2197,
67,
327,
1986,
78,
7536,
46,
222,
325,
221,
47,
13923,
886,
468,
1242,
293,
285,
350,
22940,
285,
69,
42308,
51,
5290,
51,
13389,
50,
105,
595,
5130,
51,
305,
67,
327,
34114,
493,
595,
5130,
46,
222,
325,
221,
222,
24652,
222,
325,
221,
222,
325,
221,
2287,
822,
458,
1760,
451,
2789,
1309,
82,
51,
222,
325,
221,
222,
325,
221,
2999,
1309,
82,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
325,
221,
302,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
325,
221,
1402,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
222,
325,
221,
45,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
325,
221,
222,
325,
221,
2999,
1309,
82,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
325,
221,
717,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
325,
221,
22265,
7760,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
325,
221,
21307,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
325,
221,
222,
325,
221,
4296,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
325,
221,
40307,
642,
2789,
1309,
82,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
325,
221,
16469,
4345,
244,
58,
62,
38849,
17693,
49,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
244,
15067,
222,
325,
221,
222,
20037,
18480,
222,
222,
1337,
614,
601,
64,
222,
222,
942,
462,
990,
2936,
1230,
222,
128,
222,
221,
2072,
1964,
8417,
64,
3038,
221,
325,
7565,
4457,
327,
18472,
46,
222,
221,
5332,
924,
7565,
1922,
493,
11686,
100,
1640,
5476,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
648,
493,
11686,
100,
953,
1301,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
2082,
493,
11686,
100,
12642,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
1964,
493,
11686,
100,
953,
10695,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
1964,
493,
11686,
100,
953,
13216,
45,
3239,
14713,
312,
499,
221,
1592,
222,
221,
128,
376,
221,
1287,
320,
374,
221,
1615,
51,
963,
5887,
459,
111,
601,
742,
376,
221,
130,
376,
221,
5639,
327,
1079,
47291,
2375,
943,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
45,
106,
312,
374,
221,
1615,
51,
4788,
45,
54,
312,
376,
221,
130,
222,
221,
130,
499,
221,
1350,
376,
338,
37293,
4389,
664,
331,
493,
105,
1230,
4964,
51,
376,
338,
719,
8108,
49,
391,
640,
331,
990,
2936,
1230,
664,
331,
4964,
49,
376,
338,
813,
990,
2936,
51,
1768,
724,
1230,
941,
376,
588,
222,
221,
5332,
990,
2936,
1230,
45,
3239,
317,
46,
222,
221,
128,
376,
221,
1768,
299,
317,
64,
222,
221,
130,
3038,
221,
942,
1964,
8417,
365,
222,
221,
128,
376,
221,
620,
8417,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
5476,
365,
222,
221,
128,
376,
221,
620,
493,
11686,
100,
1640,
5476,
45,
1768,
312,
222,
221,
130,
499,
221,
942,
648,
640,
1301,
365,
222,
221,
128,
21997,
221,
620,
493,
11686,
100,
953,
1301,
45,
1768,
312,
222,
221,
130,
499,
221,
942,
2082,
21517,
365,
222,
221,
128,
376,
221,
344,
327,
3544,
79,
2936,
51,
2824,
4006,
46,
320,
374,
221,
620,
8093,
79,
2936,
51,
1271,
12642,
45,
597,
312,
376,
221,
130,
376,
221,
620,
493,
11686,
100,
12642,
45,
1768,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
3777,
341,
7794,
2851,
451,
331,
327,
3804,
50,
8696,
46,
990,
2936,
1230,
51,
376,
338,
350,
858,
67,
376,
338,
1369,
1431,
1976,
2387,
12113,
341,
4141,
2409,
451,
341,
4731,
376,
338,
1560,
49,
580,
458,
16438,
24211,
391,
1495,
990,
2936,
51,
44295,
563,
341,
1074,
51,
376,
338,
33138,
49,
580,
458,
14398,
391,
666,
813,
341,
4731,
1560,
376,
338,
641,
341,
2814,
391,
341,
990,
2936,
4457,
575,
1495,
990,
2936,
51,
2099,
563,
580,
51,
376,
338,
19509,
49,
434,
863,
1868,
391,
4245,
331,
332,
35681,
39,
1560,
49,
1495,
1948,
365,
376,
338,
563,
341,
4731,
1560,
51,
376,
338,
350,
858,
8838,
3062,
6900,
63,
350,
110,
67,
4129,
396,
110,
2731,
493,
25071,
6900,
63,
350,
110,
67,
4129,
396,
110,
67,
1499,
376,
588,
222,
221,
942,
990,
2936,
1230,
640,
10695,
365,
222,
221,
128,
376,
221,
344,
327,
3544,
79,
2936,
51,
2824,
4006,
46,
320,
374,
221,
620,
8093,
79,
2936,
51,
1271,
953,
10695,
45,
597,
312,
376,
221,
130,
1332,
221,
3239,
1636,
2664,
299,
493,
11686,
100,
953,
10695,
45,
1768,
312,
376,
221,
344,
327,
3369,
2664,
630,
244,
53,
46,
320,
374,
221,
344,
327,
316,
5476,
1177,
320,
621,
221,
5267,
556,
13383,
459,
41964,
391,
2872,
341,
349,
3369,
44,
2851,
451,
331,
8100,
12471,
46774,
1560,
742,
374,
221,
130,
832,
320,
621,
221,
5267,
556,
13383,
459,
390,
10695,
63,
19514,
2936,
4731,
1199,
49,
1294,
1560,
458,
666,
331,
8100,
1560,
51,
4322,
451,
4137,
575,
45088,
12471,
46774,
35690,
374,
221,
130,
376,
221,
130,
376,
221,
620,
556,
990,
2936,
1230,
45,
3369,
2664,
312,
222,
221,
130,
499,
221,
1350,
376,
338,
3777,
341,
24170,
2851,
451,
331,
327,
3804,
50,
8696,
46,
990,
2936,
1230,
51,
376,
338,
350,
858,
67,
376,
338,
1369,
1431,
1976,
2387,
12113,
341,
4141,
2409,
451,
341,
4731,
376,
338,
1560,
49,
580,
458,
16438,
24211,
391,
1495,
990,
2936,
51,
44295
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
942,
462,
990,
2936,
1230,
222,
128,
222,
221,
2072,
1964,
8417,
64,
3038,
221,
325,
7565,
4457,
327,
18472,
46,
222,
221,
5332,
924,
7565,
1922,
493,
11686,
100,
1640,
5476,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
648,
493,
11686,
100,
953,
1301,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
2082,
493,
11686,
100,
12642,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
1964,
493,
11686,
100,
953,
10695,
45,
3239,
14713,
312,
222,
221,
5332,
924,
7565,
1964,
493,
11686,
100,
953,
13216,
45,
3239,
14713,
312,
499,
221,
1592,
222,
221,
128,
376,
221,
1287,
320,
374,
221,
1615,
51,
963,
5887,
459,
111,
601,
742,
376,
221,
130,
376,
221,
5639,
327,
1079,
47291,
2375,
943,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
45,
106,
312,
374,
221,
1615,
51,
4788,
45,
54,
312,
376,
221,
130,
222,
221,
130,
499,
221,
1350,
376,
338,
37293,
4389,
664,
331,
493,
105,
1230,
4964,
51,
376,
338,
719,
8108,
49,
391,
640,
331,
990,
2936,
1230,
664,
331,
4964,
49,
376,
338,
813,
990,
2936,
51,
1768,
724,
1230,
941,
376,
588,
222,
221,
5332,
990,
2936,
1230,
45,
3239,
317,
46,
222,
221,
128,
376,
221,
1768,
299,
317,
64,
222,
221,
130,
3038,
221,
942,
1964,
8417,
365,
222,
221,
128,
376,
221,
620,
8417,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
5476,
365,
222,
221,
128,
376,
221,
620,
493,
11686,
100,
1640,
5476,
45,
1768,
312,
222,
221,
130,
499,
221,
942,
648,
640,
1301,
365,
222,
221,
128,
21997,
221,
620,
493,
11686,
100,
953,
1301,
45,
1768,
312,
222,
221,
130,
499,
221,
942,
2082,
21517,
365,
222,
221,
128,
376,
221,
344,
327,
3544,
79,
2936,
51,
2824
] | 3,271,562,224,513,457,000
| true
| false
| false
| false
|
[
130,
222,
221,
130,
499,
221,
1350,
376,
338,
37293,
4389,
664,
331,
493,
105,
1230,
4964,
51,
376,
338,
719,
8108,
49,
391,
640,
331,
990,
2936,
1230,
664,
331,
4964,
49,
376,
338,
813,
990,
2936,
51,
1768,
724,
1230,
941,
376,
588,
222,
221,
5332,
990,
2936,
1230,
45,
3239,
317,
46,
222,
221,
128,
376,
221,
1768,
299,
317,
64,
222,
221,
130,
3038,
221,
942,
1964,
8417,
365,
222,
221,
128,
376,
221,
620,
8417,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
5476,
365,
222,
221,
128,
376,
221,
620,
493,
11686,
100
] | -6,862,543,772,319,436,000
| true
|
public class JDDNode
{
private long ptr;
// native methods (jni)
protected static native boolean DDN_IsConstant(long dd);
protected static native int DDN_GetIndex(long dd);
protected static native double DDN_GetValue(long dd);
protected static native long DDN_GetThen(long dd);
protected static native long DDN_GetElse(long dd);
static
{
try {
System.loadLibrary("jdd");
}
catch (UnsatisfiedLinkError e) {
System.out.println(e);
System.exit(1);
}
}
/**
* Protected constructor from a DdNode pointer.
* In general, to get a JDDNode from a pointer,
* use JDD.ptrToNode().
*/
protected JDDNode(long p)
{
ptr = p;
}
public long ptr()
{
return ptr;
}
public boolean isConstant()
{
return DDN_
|
dd);
protected static native double DDN_GetValue(long dd);
protected static native long DDN_GetThen(long dd);
protected static native long DDN_GetElse(long dd);
static
{
try {
System.loadLibrary("jdd");
}
catch (UnsatisfiedLinkError e) {
System.out.println(e);
System.exit(1);
}
}
/**
* Protected constructor from a DdNode pointer.
* In general, to get a JDDNode from a pointer,
* use JDD.ptrToNode().
*/
protected JDDNode(long p)
{
ptr = p;
}
public long ptr()
{
return ptr;
}
public boolean isConstant()
{
return DDN_
|
{
try {
System.loadLibrary("jdd");
}
catch (UnsatisfiedLinkError e) {
System.out.println(e);
System.exit(1);
}
}
/**
* Protected constructor from a DdNode pointer.
* In general, to get a JDDNode from a pointer,
* use JDD.ptrToNode().
*/
protected JDDNode(long p)
{
ptr = p;
}
public long ptr()
{
return ptr;
}
public boolean isConstant()
{
return DDN_
|
}
}
/**
* Protected constructor from a DdNode pointer.
* In general, to get a JDDNode from a pointer,
* use JDD.ptrToNode().
*/
protected JDDNode(long p)
{
ptr = p;
}
public long ptr()
{
return ptr;
}
public boolean isConstant()
{
return DDN_
|
IsConstant(ptr);
}
public int getIndex()
{
return DDN_GetIndex(ptr);
}
public double getValue()
{
if (DebugJDD.debug
|
NotesManager.java
|
/FileExtraction/Java_unseen/sbs20_filenotes-android/app/src/main/java/sbs20/filenotes/model/NotesManager.java
|
package sbs20.filenotes.model;
import java.io.File;
import java.util.Date;
import java.util.List;
import sbs20.filenotes.ServiceManager;
import sbs20.filenotes.R;
import sbs20.filenotes.storage.FileSystemService;
public class NotesManager {
private FileSystemService storage;
private Note selectedNote;
private NoteCollection notes;
private boolean isChanged;
public NotesManager() {
this.storage = FileSystemService.getInstance();
this.notes = new NoteCollection();
this.isChanged = false;
}
private void setSelectedNote(Note note) {
this.selectedNote = note;
}
public Note getSelectedNote() {
return this.selectedNote;
}
public NoteCollection search(String query) {
Logger.debug(this, "search()");
NoteCollection results = new NoteCollection();
for (Note note : this.notes) {
if (note.getName()
.toLowerCase()
.contains(query.toLowerCase()) ||
this.storedContent(note)
.toLowerCase()
.contains(query.toLowerCase())) {
results.add(note);
}
}
return results;
}
public NoteCollection getNotes() {
return this.notes;
}
private void mergeFileIntoNote(File file, Note note) {
note.setTextSummary(this.storage.fileSummaryAsString(file));
note.setSize(file.length());
note.setLastModified(new Date(file.lastModified()));
}
private static boolean fileListContainsName(List<File> files, String name) {
for (File file : files) {
if (name.equals(file.getName())) {
return true;
}
}
return false;
}
public void readAllFromStorage() {
Logger.verbose(this, "readAllFromStorage.Start");
List<File> files = this.storage.readAllFilesFromStorage();
// Ensure all files are in notes and up to date
for (File file : files) {
Note note = this.notes.getByName(file.getName());
if (note == null) {
note = new Note();
note.setName(file.getName());
notes.add(note);
}
this.mergeFileIntoNote(file, note);
}
// Now ensure that any notes NOT in a file is removed
for (int index = 0; index < notes.size(); index++) {
if (!fileListContainsName(files, notes.get(index).getName())) {
notes.remove(index);
index--;
}
}
// Now filter for preferences
Settings settings = ServiceManager.getInstance().getSettings();
for (int index = 0; index < notes.size(); index++) {
if (notes.get(index).isHidden() && !settings.showHiddenFile()) {
notes.remove(index);
index--;
} else if (!notes.get(index).isText() && !settings.showNonTextFile()) {
notes.remove(index);
index--;
}
}
notes.sortBy(settings.getNoteSortComparator());
Logger.verbose(this, "readAllFromStorage.Finish");
}
private void registerChange() {
this.isChanged = true;
}
public void clearChange() {
this.isChanged = false;
}
public boolean isChanged() {
return this.isChanged;
}
public void writeToStorage(Note note) {
this.storage.write(note.getName(), note.getText());
note.reset();
this.registerChange();
}
public String storedContent(Note note) {
File file = this.storage.getFile(note.getName());
if (file.exists()) {
return this.storage.fileAsString(file);
}
return null;
}
public void editNote(Note note) {
String content = this.storedContent(note);
if (content != null) {
note.setText(content);
note.reset();
}
this.setSelectedNote(note);
}
public void deleteNote(Note note) {
this.storage.delete(note.getName());
this.notes.remove(note);
this.registerChange();
}
public boolean renameNote(Note note, String desiredName) {
boolean succeeded = this.storage.rename(note.getName(), desiredName);
if (succeeded) {
note.setName(desiredName);
this.registerChange();
}
return succeeded;
}
public boolean isStored(Note note) {
return this.storage.exists(note.getName());
}
private String createUniqueNewName(String stem) {
String attempt = String.format(stem, "");
int i = 0;
while (this.notes.isExistingName(attempt)) {
++i;
attempt = String.format(stem, i);
}
return attempt;
}
public Note createNote() {
String stem = ServiceManager.getInstance().getContext().getString(R.string.new_note_file_stem);
Note note = new Note();
note.setName(this.createUniqueNewName(stem));
this.notes.add(note);
return note;
}
}
| 5,111
|
Java
|
.java
|
sbs20/filenotes-android
| 10
| 5
| 5
|
2016-01-07T15:40:24Z
|
2018-08-14T21:49:47Z
|
3853572cb4eaa985a494d935aa587027c633a06f9f129f0f20d4ea5bf11b4c0d
|
[] |
[
1337,
328,
3904,
55,
53,
51,
5049,
291,
8365,
51,
1184,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
328,
3904,
55,
53,
51,
5049,
291,
8365,
51,
1201,
1590,
64,
222,
485,
328,
3904,
55,
53,
51,
5049,
291,
8365,
51,
87,
64,
222,
485,
328,
3904,
55,
53,
51,
5049,
291,
8365,
51,
4239,
51,
13867,
1201,
64,
222,
222,
942,
462,
13917,
1590,
320,
303,
964,
27207,
1201,
4780,
64,
222,
221,
2072,
5857,
4337,
5232,
64,
222,
221,
2072,
5857,
2272,
10178,
64,
303,
964,
1922,
458,
3663,
64,
465,
581,
13917,
1590,
365,
320,
310,
477,
51,
4239,
299,
27207,
1201,
51,
7432,
492,
310,
477,
51,
8903,
299,
556,
5857,
2272,
492,
310,
477,
51,
316,
3663,
299,
920,
64,
303,
339,
499,
221,
2072,
782,
43313,
5232,
45,
5232,
6013,
46,
320,
376,
221,
597,
51,
4358,
5232,
299,
6013,
64,
222,
221,
130,
222,
221,
942,
5857,
640,
4559,
5232,
365,
320,
376,
221,
620,
477,
51,
4358,
5232,
64,
222,
221,
130,
465,
581,
5857,
2272,
3252,
45,
671,
2487,
46,
320,
310,
7145,
51,
2824,
45,
597,
49,
332,
1925,
33942,
310,
5857,
2272,
3300,
299,
556,
5857,
2272,
492,
603,
456,
327,
5232,
6013,
518,
477,
51,
8903,
46,
320,
343,
434,
327,
5774,
51,
5175,
365,
547,
657,
10498,
365,
547,
657,
4766,
45,
1234,
51,
10498,
1177,
1293,
419,
477,
51,
22175,
1795,
45,
5774,
46,
547,
657,
10498,
365,
547,
657,
4766,
45,
1234,
51,
10498,
5183,
320,
419,
3300,
51,
688,
45,
5774,
312,
343,
339,
310,
339,
603,
461,
3300,
64,
303,
339,
499,
221,
942,
5857,
2272,
640,
11440,
365,
320,
376,
221,
620,
477,
51,
8903,
64,
222,
221,
130,
465,
964,
782,
4009,
991,
13650,
5232,
45,
991,
822,
49,
5857,
6013,
46,
320,
310,
6013,
51,
6619,
8111,
45,
597,
51,
4239,
51,
781,
8111,
15021,
45,
781,
894,
310,
6013,
51,
29572,
45,
781,
51,
1340,
1052,
310,
6013,
51,
489,
46179,
45,
909,
2833,
45,
781,
51,
48470,
5086,
303,
339,
465,
964,
924,
1922,
822,
739,
7282,
577,
45,
739,
65,
991,
67,
2293,
49,
910,
655,
46,
320,
310,
456,
327,
991,
822,
518,
2293,
46,
320,
343,
434,
327,
444,
51,
3591,
45,
781,
51,
5175,
5183,
320,
419,
461,
878,
64,
343,
339,
310,
339,
603,
461,
920,
64,
303,
339,
465,
581,
782,
1511,
1947,
1811,
3581,
365,
320,
603,
7145,
51,
10563,
45,
597,
49,
332,
870,
1947,
1811,
3581,
51,
2148,
742,
310,
1701,
65,
991,
67,
2293,
299,
477,
51,
4239,
51,
870,
1947,
3852,
1811,
3581,
492,
603,
453,
15135,
1187,
2293,
904,
347,
10178,
480,
992,
391,
2361,
310,
456,
327,
991,
822,
518,
2293,
46,
320,
343,
5857,
6013,
299,
477,
51,
8903,
51,
390,
9809,
45,
781,
51,
5175,
1052,
343,
434,
327,
5774,
630,
762,
46,
320,
419,
6013,
299,
556,
5857,
492,
419,
6013,
51,
15779,
45,
781,
51,
5175,
1052,
419,
10178,
51,
688,
45,
5774,
312,
343,
339,
1083,
477,
51,
6097,
991,
13650,
5232,
45,
781,
49,
6013,
312,
310,
339,
603,
453,
9188,
7197,
708,
1364,
10178,
2387,
347,
331,
822,
458,
6563,
310,
456,
327,
429,
1671,
299,
244,
53,
64,
1671,
350,
10178,
51,
911,
492,
1671,
2002,
320,
343,
434,
1445,
781,
739,
7282,
577,
45,
2558,
49,
10178,
51,
390,
45,
1076,
566,
5175,
5183,
320,
419,
10178,
51,
2564,
45,
1076,
312,
419,
1671,
10606,
343,
339,
310,
339,
603,
453,
9188,
2785,
456,
23333,
310,
9925,
4086,
299,
4860,
1590,
51,
7432,
941,
390,
2977,
492,
310,
456,
327,
429,
1671,
299,
244,
53,
64,
1671,
350,
10178,
51,
911,
492,
1671,
2002,
320,
343,
434,
327,
8903,
51,
390,
45,
1076,
566,
316,
13831,
365,
979,
673,
3563,
51,
2276,
13831,
991,
1177,
320,
419,
10178,
51,
2564,
45,
1076,
312,
419,
1671,
10606,
343,
339,
832,
434,
1445,
8903,
51,
390,
45,
1076,
566,
316,
1049,
365,
979,
673,
3563,
51,
2276,
3921,
1049,
991,
1177,
320,
419,
10178,
51,
2564,
45,
1076,
312,
419,
1671,
10606,
343,
339,
310,
339,
603,
10178,
51,
33231,
45,
3563,
51,
390,
5232,
5217,
18676,
1052,
603,
7145,
51,
10563,
45,
597,
49,
332,
870,
1947,
1811,
3581,
51,
13534,
742,
303,
339,
465,
964,
782,
3923,
1810,
365,
320,
310,
477,
51,
316,
3663,
299,
878,
64,
303,
339,
465,
581,
782,
4250,
1810,
365,
320,
310,
477,
51,
316,
3663,
299,
920,
64,
303,
339,
465,
581,
1922,
458,
3663,
365,
320,
310,
461,
477,
51,
316,
3663,
64,
303,
339,
465,
581,
782,
48562,
3581,
45,
5232,
6013,
46,
320,
310,
477,
51,
4239,
51,
1838,
45,
5774,
51,
5175,
1046,
6013,
51,
10624,
1052,
310,
6013,
51,
4558,
492,
310,
477,
51,
3334,
1810,
492,
303,
339,
465,
581,
910,
7129,
1795,
45,
5232,
6013,
46,
320,
310,
2050,
822,
299,
477,
51,
4239,
51,
22184,
45,
5774,
51,
5175,
1052,
310,
434,
327,
781,
51,
4678,
1177,
320,
343,
461,
477,
51,
4239,
51,
781,
15021,
45,
781,
312,
310,
339,
603,
461,
762,
64,
303,
339,
465,
581,
782,
4588,
5232,
45,
5232,
6013,
46,
320,
310,
910,
1813,
299,
477,
51,
22175,
1795,
45,
5774,
312,
603,
434,
327,
1304,
882,
762,
46,
320,
343,
6013,
51,
6619,
45,
1304,
312,
343,
6013,
51,
4558,
492,
310,
339,
603,
477,
51,
26623,
5232,
45,
5774,
312,
303,
339,
465,
581,
782,
3081,
5232,
45,
5232,
6013,
46,
320,
310,
477,
51,
4239,
51,
2577,
45,
5774,
51,
5175,
1052,
310,
477,
51,
8903,
51,
2564,
45,
5774,
312,
310,
477,
51,
3334,
1810,
492,
303,
339,
465,
581,
1922,
16138,
5232,
45,
5232,
6013,
49,
910,
10865,
577,
46,
320,
310,
1922,
25264,
299,
477,
51,
4239,
51,
13287,
45,
5774,
51,
5175,
1046,
10865,
577,
312,
310,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
492,
310,
477,
51,
8903,
299,
556,
5857,
2272,
492,
310,
477,
51,
316,
3663,
299,
920,
64,
303,
339,
499,
221,
2072,
782,
43313,
5232,
45,
5232,
6013,
46,
320,
376,
221,
597,
51,
4358,
5232,
299,
6013,
64,
222,
221,
130,
222,
221,
942,
5857,
640,
4559,
5232,
365,
320,
376,
221,
620,
477,
51,
4358,
5232,
64,
222,
221,
130,
465,
581,
5857,
2272,
3252,
45,
671,
2487,
46,
320,
310,
7145,
51,
2824,
45,
597,
49,
332,
1925,
33942,
310,
5857,
2272,
3300,
299,
556,
5857,
2272,
492,
603,
456,
327,
5232,
6013,
518,
477,
51,
8903,
46,
320,
343,
434,
327,
5774,
51,
5175,
365,
547,
657,
10498,
365,
547,
657,
4766,
45,
1234,
51,
10498,
1177,
1293,
419,
477,
51,
22175,
1795,
45,
5774,
46,
547,
657,
10498,
365,
547,
657,
4766,
45,
1234,
51,
10498,
5183,
320,
419,
3300,
51,
688,
45,
5774,
312,
343,
339,
310,
339,
603,
461,
3300,
64,
303,
339,
499,
221,
942,
5857,
2272,
640,
11440,
365,
320,
376,
221,
620,
477,
51,
8903,
64,
222,
221,
130,
465,
964,
782,
4009,
991,
13650,
5232,
45,
991,
822,
49,
5857,
6013,
46,
320,
310,
6013,
51,
6619,
8111,
45,
597,
51,
4239,
51,
781,
8111,
15021,
45,
781,
894,
310,
6013,
51,
29572,
45,
781,
51,
1340,
1052,
310,
6013,
51,
489,
46179,
45,
909,
2833,
45,
781,
51,
48470,
5086,
303,
339,
465,
964,
924,
1922,
822,
739,
7282,
577,
45,
739,
65,
991,
67,
2293,
49,
910,
655,
46,
320,
310,
456,
327,
991,
822,
518,
2293,
46,
320,
343,
434,
327,
444,
51,
3591,
45,
781,
51,
5175,
5183,
320,
419,
461,
878,
64,
343,
339,
310,
339,
603,
461,
920,
64,
303,
339,
465,
581,
782,
1511,
1947,
1811,
3581,
365,
320,
603,
7145
] | 4,983,961,059,280,856,000
| true
| false
| false
| false
|
[
312,
343,
339,
310,
339,
603,
461,
3300,
64,
303,
339,
499,
221,
942,
5857,
2272,
640,
11440,
365,
320,
376,
221,
620,
477,
51,
8903,
64,
222,
221,
130,
465,
964,
782,
4009,
991,
13650,
5232,
45,
991,
822,
49,
5857,
6013,
46,
320,
310,
6013,
51,
6619,
8111,
45,
597,
51,
4239,
51,
781,
8111,
15021,
45,
781,
894,
310,
6013,
51,
29572,
45,
781,
51,
1340,
1052,
310,
6013,
51,
489,
46179,
45,
909,
2833,
45,
781,
51,
48470,
5086,
303,
339,
465,
964,
924,
1922,
822,
739,
7282,
577,
45,
739,
65,
991,
67,
2293,
49
] | 3,098,153,080,429,572,000
| true
|
();
this.notes = new NoteCollection();
this.isChanged = false;
}
private void setSelectedNote(Note note) {
this.selectedNote = note;
}
public Note getSelectedNote() {
return this.selectedNote;
}
public NoteCollection search(String query) {
Logger.debug(this, "search()");
NoteCollection results = new NoteCollection();
for (Note note : this.notes) {
if (note.getName()
.toLowerCase()
.contains(query.toLowerCase()) ||
this.storedContent(note)
.toLowerCase()
.contains(query.toLowerCase())) {
results.add(note);
}
}
return results;
}
public NoteCollection getNotes() {
return this.notes;
}
private void mergeFileIntoNote(File file, Note note) {
note.setTextSummary(this.storage.fileSummaryAsString(file));
note.setSize(file.length());
note.setLastModified(new Date(file.lastModified()));
}
private static boolean fileListContainsName(List<File> files,
|
() {
return this.selectedNote;
}
public NoteCollection search(String query) {
Logger.debug(this, "search()");
NoteCollection results = new NoteCollection();
for (Note note : this.notes) {
if (note.getName()
.toLowerCase()
.contains(query.toLowerCase()) ||
this.storedContent(note)
.toLowerCase()
.contains(query.toLowerCase())) {
results.add(note);
}
}
return results;
}
public NoteCollection getNotes() {
return this.notes;
}
private void mergeFileIntoNote(File file, Note note) {
note.setTextSummary(this.storage.fileSummaryAsString(file));
note.setSize(file.length());
note.setLastModified(new Date(file.lastModified()));
}
private static boolean fileListContainsName(List<File> files,
|
notes) {
if (note.getName()
.toLowerCase()
.contains(query.toLowerCase()) ||
this.storedContent(note)
.toLowerCase()
.contains(query.toLowerCase())) {
results.add(note);
}
}
return results;
}
public NoteCollection getNotes() {
return this.notes;
}
private void mergeFileIntoNote(File file, Note note) {
note.setTextSummary(this.storage.fileSummaryAsString(file));
note.setSize(file.length());
note.setLastModified(new Date(file.lastModified()));
}
private static boolean fileListContainsName(List<File> files,
|
);
}
}
return results;
}
public NoteCollection getNotes() {
return this.notes;
}
private void mergeFileIntoNote(File file, Note note) {
note.setTextSummary(this.storage.fileSummaryAsString(file));
note.setSize(file.length());
note.setLastModified(new Date(file.lastModified()));
}
private static boolean fileListContainsName(List<File> files,
|
String name) {
for (File file : files) {
if (name.equals(file.getName())) {
return true;
}
}
return false;
}
public void readAllFromStorage() {
Logger
|
Transporter.java
|
/FileExtraction/Java_unseen/MatterOverdrive_MatterOverdrive-Legacy-Edition/src/main/java/matteroverdrive/compat/modules/waila/provider/Transporter.java
|
/*
* This file is part of Matter Overdrive
* Copyright (C) 2018, Horizon Studio <contact@hrznstudio.com>, All rights reserved.
*
* Matter Overdrive is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Matter Overdrive is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Matter Overdrive. If not, see <http://www.gnu.org/licenses>.
*/
package matteroverdrive.compat.modules.waila.provider;
import matteroverdrive.api.transport.TransportLocation;
import matteroverdrive.compat.modules.waila.IWailaBodyProvider;
import matteroverdrive.machines.transporter.TileEntityMachineTransporter;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import java.util.List;
/**
* @author shadowfacts
*/
public class Transporter implements IWailaBodyProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
TileEntity te = accessor.getTileEntity();
if (te instanceof TileEntityMachineTransporter) {
TileEntityMachineTransporter transporter = (TileEntityMachineTransporter) te;
TransportLocation location = transporter.getSelectedLocation();
currenttip.add(String.format("%sSelected Location: %s%s", TextFormatting.YELLOW, TextFormatting.WHITE, location.name));
currenttip.add(String.format("%sDestination s: %s X:%d Y:%d Z:%d", TextFormatting.YELLOW, TextFormatting.WHITE, location.pos.getX(), location.pos.getY(), location.pos.getZ()));
} else {
throw new RuntimeException("Transporter WAILA provider is being used for something that is not a Transporter: " + te.getClass());
}
return currenttip;
}
}
| 2,343
|
Java
|
.java
|
MatterOverdrive/MatterOverdrive-Legacy-Edition
| 34
| 10
| 1
|
2018-02-08T21:50:42Z
|
2018-10-14T13:04:11Z
|
5306ca8ea15dcbf4534b6f8f1b1389b62a29e8164a3c9b4c67b1ef2be2a3c377
|
[] |
[
1127,
222,
338,
1369,
822,
458,
1760,
451,
5876,
410,
9878,
13872,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
61,
49,
696,
25357,
9394,
350,
5559,
69,
3943,
9241,
13086,
51,
527,
2731,
3381,
4760,
5225,
51,
222,
338,
222,
338,
5876,
410,
9878,
13872,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
5876,
410,
9878,
13872,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
5876,
410,
9878,
13872,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
4513,
222,
588,
222,
1337,
15254,
1515,
13872,
51,
8540,
51,
3490,
51,
124,
626,
102,
51,
6390,
64,
222,
222,
485,
15254,
1515,
13872,
51,
1256,
51,
9618,
51,
10003,
2941,
64,
222,
485,
15254,
1515,
13872,
51,
8540,
51,
3490,
51,
124,
626,
102,
51,
27358,
626,
102,
3069,
2588,
64,
222,
485,
15254,
1515,
13872,
51,
20894,
51,
9618,
284,
51,
41760,
7105,
10003,
284,
64,
222,
485,
364,
2217,
51,
6010,
3279,
51,
124,
626,
102,
51,
1256,
51,
27358,
626,
102,
1081,
1985,
64,
222,
485,
364,
2217,
51,
6010,
3279,
51,
124,
626,
102,
51,
1256,
51,
27358,
626,
102,
768,
9794,
64,
222,
485,
3723,
51,
8654,
51,
1113,
51,
26022,
64,
222,
485,
3723,
51,
8654,
51,
8344,
2244,
51,
41760,
64,
222,
485,
3723,
51,
8654,
51,
1058,
51,
897,
51,
1049,
25332,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
1350,
222,
338,
496,
2133,
11092,
37279,
222,
588,
222,
942,
462,
23597,
284,
4584,
457,
92,
626,
102,
3069,
2588,
320,
465,
496,
1806,
303,
581,
1701,
65,
671,
67,
640,
92,
626,
102,
3069,
45,
26022,
1641,
3131,
49,
1701,
65,
671,
67,
1565,
3976,
49,
457,
92,
626,
102,
768,
9794,
22069,
49,
457,
92,
626,
102,
1081,
1985,
1377,
46,
320,
310,
18891,
2234,
2713,
299,
22069,
51,
390,
41760,
492,
603,
434,
327,
538,
5118,
18891,
2234,
7105,
10003,
284,
46,
320,
343,
18891,
2234,
7105,
10003,
284,
11350,
284,
299,
327,
41760,
7105,
10003,
284,
46,
2713,
64,
1083,
23597,
2941,
3913,
299,
11350,
284,
51,
21851,
2941,
492,
1083,
1565,
3976,
51,
688,
45,
671,
51,
1664,
4923,
120,
4559,
10642,
63,
925,
120,
42,
120,
411,
3336,
25332,
51,
38076,
49,
3336,
25332,
51,
21256,
49,
3913,
51,
444,
894,
343,
1565,
3976,
51,
688,
45,
671,
51,
1664,
4923,
120,
11351,
328,
63,
925,
120,
1618,
6081,
105,
1432,
6081,
105,
2538,
6081,
105,
411,
3336,
25332,
51,
38076,
49,
3336,
25332,
51,
21256,
49,
3913,
51,
985,
51,
18807,
1046,
3913,
51,
985,
51,
20421,
1046,
3913,
51,
985,
51,
40500,
5086,
603,
339,
832,
320,
343,
1440,
556,
13383,
459,
10003,
284,
643,
9619,
70,
6897,
458,
4019,
1674,
456,
4682,
708,
458,
666,
331,
23597,
284,
63,
332,
494,
2713,
51,
9699,
1052,
310,
339,
603,
461,
1565,
3976,
64,
303,
339,
222,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 599
|
[
13872,
51,
20894,
51,
9618,
284,
51,
41760,
7105,
10003,
284,
64,
222,
485,
364,
2217,
51,
6010,
3279,
51,
124,
626,
102,
51,
1256,
51,
27358,
626,
102,
1081,
1985,
64,
222,
485,
364,
2217,
51,
6010,
3279,
51,
124,
626,
102,
51,
1256,
51,
27358,
626,
102,
768,
9794,
64,
222,
485,
3723,
51,
8654,
51,
1113,
51,
26022,
64,
222,
485,
3723,
51,
8654,
51,
8344,
2244,
51,
41760,
64,
222,
485,
3723,
51,
8654,
51,
1058,
51,
897,
51,
1049,
25332,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
1350,
222,
338,
496,
2133,
11092,
37279,
222,
588,
222,
942,
462,
23597,
284,
4584,
457,
92,
626,
102,
3069,
2588,
320,
465,
496,
1806,
303,
581,
1701,
65,
671,
67,
640,
92,
626,
102,
3069,
45,
26022,
1641,
3131,
49,
1701,
65,
671,
67,
1565,
3976,
49,
457,
92,
626,
102,
768,
9794,
22069,
49,
457,
92,
626,
102,
1081,
1985,
1377,
46,
320,
310,
18891,
2234,
2713,
299,
22069,
51,
390,
41760,
492,
603,
434,
327,
538,
5118,
18891,
2234,
7105,
10003,
284,
46,
320,
343,
18891,
2234,
7105,
10003,
284,
11350,
284,
299,
327,
41760,
7105,
10003,
284,
46,
2713,
64,
1083,
23597,
2941,
3913,
299,
11350,
284,
51,
21851,
2941,
492,
1083,
1565,
3976,
51,
688,
45,
671,
51,
1664,
4923,
120,
4559,
10642,
63,
925,
120,
42,
120,
411,
3336,
25332,
51,
38076,
49,
3336,
25332,
51,
21256,
49,
3913,
51,
444,
894,
343,
1565,
3976,
51,
688,
45,
671,
51,
1664,
4923,
120,
11351,
328,
63,
925,
120,
1618,
6081,
105,
1432,
6081,
105,
2538,
6081,
105,
411,
3336,
25332,
51,
38076,
49,
3336,
25332,
51,
21256,
49,
3913,
51,
985,
51,
18807,
1046,
3913,
51,
985,
51,
20421,
1046,
3913,
51,
985,
51,
40500,
5086,
603
] | 1,386,205,289,048,081,400
| true
| false
| false
| false
|
[
9794,
22069,
49,
457,
92,
626,
102,
1081,
1985,
1377,
46,
320,
310,
18891,
2234,
2713,
299,
22069,
51,
390,
41760,
492,
603,
434,
327,
538,
5118,
18891,
2234,
7105,
10003,
284,
46,
320,
343,
18891,
2234,
7105,
10003,
284,
11350,
284,
299,
327,
41760,
7105,
10003,
284,
46,
2713,
64,
1083,
23597,
2941,
3913,
299,
11350,
284,
51,
21851,
2941,
492,
1083,
1565,
3976,
51,
688,
45,
671,
51,
1664,
4923,
120,
4559,
10642,
63,
925,
120,
42,
120,
411,
3336,
25332,
51,
38076,
49,
3336,
25332,
51,
21256,
49,
3913,
51,
444,
894,
343,
1565,
3976,
51,
688
] | 3,584,061,662,690,199,600
| true
|
drive.machines.transporter.TileEntityMachineTransporter;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import java.util.List;
/**
* @author shadowfacts
*/
public class Transporter implements IWailaBodyProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
TileEntity te = accessor.getTileEntity();
if (te instanceof TileEntityMachineTransporter) {
TileEntityMachineTransporter transporter = (TileEntityMachineTransporter) te;
TransportLocation location = transporter.getSelectedLocation();
currenttip.add(String.format("%sSelected Location: %s%s", TextFormatting.YELLOW, TextFormatting.WHITE, location.name));
currenttip.add
|
Accessor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import java.util.List;
/**
* @author shadowfacts
*/
public class Transporter implements IWailaBodyProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
TileEntity te = accessor.getTileEntity();
if (te instanceof TileEntityMachineTransporter) {
TileEntityMachineTransporter transporter = (TileEntityMachineTransporter) te;
TransportLocation location = transporter.getSelectedLocation();
currenttip.add(String.format("%sSelected Location: %s%s", TextFormatting.YELLOW, TextFormatting.WHITE, location.name));
currenttip.add
|
@author shadowfacts
*/
public class Transporter implements IWailaBodyProvider {
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
TileEntity te = accessor.getTileEntity();
if (te instanceof TileEntityMachineTransporter) {
TileEntityMachineTransporter transporter = (TileEntityMachineTransporter) te;
TransportLocation location = transporter.getSelectedLocation();
currenttip.add(String.format("%sSelected Location: %s%s", TextFormatting.YELLOW, TextFormatting.WHITE, location.name));
currenttip.add
|
Accessor accessor, IWailaConfigHandler config) {
TileEntity te = accessor.getTileEntity();
if (te instanceof TileEntityMachineTransporter) {
TileEntityMachineTransporter transporter = (TileEntityMachineTransporter) te;
TransportLocation location = transporter.getSelectedLocation();
currenttip.add(String.format("%sSelected Location: %s%s", TextFormatting.YELLOW, TextFormatting.WHITE, location.name));
currenttip.add
|
(String.format("%sDestination s: %s X:%d Y:%d Z:%d", TextFormatting.YELLOW, TextFormatting.WHITE, location.pos.getX(), location.pos.getY(), location.pos.getZ()));
|
ProjectExpectedStudyDTO.java
|
/FileExtraction/Java_unseen/CCAFS_MARLO/marlo-web/src/main/java/org/cgiar/ccafs/marlo/rest/dto/ProjectExpectedStudyDTO.java
|
/*****************************************************************
* This file is part of Managing Agricultural Research for Learning &
* Outcomes Platform (MARLO).
* MARLO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
* MARLO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with MARLO. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************/
/**************
* @author Diego Perez - CIAT/CCAFS
**************/
package org.cgiar.ccafs.marlo.rest.dto;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
public class ProjectExpectedStudyDTO {
@ApiModelProperty(notes = "The Generated expected study id", position = 1)
private Long id;
@ApiModelProperty(notes = "Project id", position = 1)
private String project;
@ApiModelProperty(notes = "Project expected study info", position = 2)
private ProjectExpectedStudyInfoDTO projectExpectedEstudyInfo;
@ApiModelProperty(notes = "CGIAR Sub-IDOs List", position = 3)
private List<ProjectExpectedStudySubIdoDTO> srfSubIdoList;
@ApiModelProperty(notes = "CGIAR SLO target List", position = 4)
private List<ProjectExpectedStudySrfSloTargetDTO> srfSloTargetList;
@ApiModelProperty(notes = "Geographic Scope List", position = 5)
private List<GeographicScopeDTO> geographicScopes;
@ApiModelProperty(notes = "Contributing Flagship List", position = 8)
private List<CrpProgramDTO> flagshipsList;
@ApiModelProperty(notes = "Contributing External Partners List", position = 9)
private List<InstitutionDTO> institutionsList;
@ApiModelProperty(notes = "Contributing CRP/Plataform List", position = 7)
private List<CGIAREntityDTO> projectExpectedStudiesCrp;
@ApiModelProperty(notes = "Regions", position = 6)
private List<RegionDTO> regions;
@ApiModelProperty(notes = "Countries", position = 6)
private List<CountryDTO> countries;
@ApiModelProperty(notes = "Quantification List List", position = 11)
private List<QuantificationDTO> quantificationList;
@ApiModelProperty(notes = "Contributing innovations list", position = 10)
private List<ProjectExpectedStudyInnovationDTO> innovationCodeList;
@ApiModelProperty(notes = "Contributing policies list", position = 3)
private List<ProjectExpectedStudyPolicyDTO> policiesCodeList;
@ApiModelProperty(notes = "Aditional link list", position = 4)
private List<ProjectExpectedStudyLinkDTO> links;
@ApiModelProperty(notes = "Contributing milestone list", position = 13)
private List<ProjectExpectedStudyMilestoneDTO> milestonesList;
@ApiModelProperty(notes = "phase (POWB, AR, UpKeep)", position = 14)
private PhaseDTO phase;
@ApiModelProperty(notes = "phase id", position = 14)
private Long phaseID;
public List<CountryDTO> getCountries() {
return countries;
}
public List<CrpProgramDTO> getFlagshipsList() {
return flagshipsList;
}
public List<GeographicScopeDTO> getGeographicScopes() {
return geographicScopes;
}
public Long getId() {
return id;
}
public List<ProjectExpectedStudyInnovationDTO> getInnovationCodeList() {
return innovationCodeList;
}
public List<InstitutionDTO> getInstitutionsList() {
return institutionsList;
}
public List<ProjectExpectedStudyLinkDTO> getLinks() {
return links;
}
public List<ProjectExpectedStudyMilestoneDTO> getMilestonesList() {
return milestonesList;
}
public PhaseDTO getPhase() {
return phase;
}
public Long getPhaseID() {
return phaseID;
}
public List<ProjectExpectedStudyPolicyDTO> getPoliciesCodeList() {
return policiesCodeList;
}
public String getProject() {
return project;
}
public ProjectExpectedStudyInfoDTO getProjectExpectedEstudyInfo() {
return projectExpectedEstudyInfo;
}
public List<CGIAREntityDTO> getProjectExpectedStudiesCrp() {
return projectExpectedStudiesCrp;
}
public List<QuantificationDTO> getQuantificationList() {
return quantificationList;
}
public List<RegionDTO> getRegions() {
return regions;
}
public List<ProjectExpectedStudySrfSloTargetDTO> getSrfSloTargetList() {
return srfSloTargetList;
}
public List<ProjectExpectedStudySubIdoDTO> getSrfSubIdoList() {
return srfSubIdoList;
}
public void setCountries(List<CountryDTO> countries) {
this.countries = countries;
}
public void setFlagshipsList(List<CrpProgramDTO> flagshipsList) {
this.flagshipsList = flagshipsList;
}
public void setGeographicScopes(List<GeographicScopeDTO> geographicScopes) {
this.geographicScopes = geographicScopes;
}
public void setId(Long id) {
this.id = id;
}
public void setInnovationCodeList(List<ProjectExpectedStudyInnovationDTO> innovationCodeList) {
this.innovationCodeList = innovationCodeList;
}
public void setInstitutionsList(List<InstitutionDTO> institutionsList) {
this.institutionsList = institutionsList;
}
public void setLinks(List<ProjectExpectedStudyLinkDTO> links) {
this.links = links;
}
public void setMilestonesList(List<ProjectExpectedStudyMilestoneDTO> milestonesList) {
this.milestonesList = milestonesList;
}
public void setPhase(PhaseDTO phase) {
this.phase = phase;
}
public void setPhaseID(Long phaseID) {
this.phaseID = phaseID;
}
public void setPoliciesCodeList(List<ProjectExpectedStudyPolicyDTO> policiesCodeList) {
this.policiesCodeList = policiesCodeList;
}
public void setProject(String project) {
this.project = project;
}
public void setProjectExpectedEstudyInfo(ProjectExpectedStudyInfoDTO projectExpectedEstudyInfo) {
this.projectExpectedEstudyInfo = projectExpectedEstudyInfo;
}
public void setProjectExpectedStudiesCrp(List<CGIAREntityDTO> projectExpectedStudiesCrp) {
this.projectExpectedStudiesCrp = projectExpectedStudiesCrp;
}
public void setQuantificationList(List<QuantificationDTO> quantificationList) {
this.quantificationList = quantificationList;
}
public void setRegions(List<RegionDTO> regions) {
this.regions = regions;
}
public void setSrfSloTargetList(List<ProjectExpectedStudySrfSloTargetDTO> srfSloTargetList) {
this.srfSloTargetList = srfSloTargetList;
}
public void setSrfSubIdoList(List<ProjectExpectedStudySubIdoDTO> srfSubIdoList) {
this.srfSubIdoList = srfSubIdoList;
}
}
| 7,112
|
Java
|
.java
|
CCAFS/MARLO
| 8
| 8
| 286
|
2016-05-11T18:52:21Z
|
2024-05-08T21:14:43Z
|
df157d5abba774556c74e8459d39b4318c3105b7ba38171317460a88a13dd5e5
|
[] |
[
18200,
47,
222,
338,
1369,
822,
458,
1760,
451,
4795,
4892,
418,
791,
10259,
5413,
18687,
456,
14421,
568,
222,
338,
4322,
3772,
120,
11329,
327,
28159,
1323,
566,
222,
338,
507,
802,
1323,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
840,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
507,
802,
1323,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
507,
802,
1323,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
17854,
52,
222,
222,
52,
639,
6372,
222,
338,
496,
2133,
15326,
1724,
466,
767,
127,
449,
9683,
741,
52,
2218,
5999,
88,
222,
30574,
19923,
222,
222,
1337,
1105,
51,
10305,
301,
51,
1172,
1566,
120,
51,
3321,
335,
51,
4756,
51,
12292,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
3377,
51,
13166,
51,
8839,
51,
29245,
64,
222,
222,
942,
462,
5426,
7705,
22721,
8723,
320,
736,
496,
29245,
45,
8903,
299,
332,
1338,
13046,
2816,
14887,
828,
411,
2764,
299,
244,
54,
46,
353,
964,
6374,
828,
64,
736,
496,
29245,
45,
8903,
299,
332,
3214,
828,
411,
2764,
299,
244,
54,
46,
353,
964,
910,
2091,
64,
8886,
496,
29245,
45,
8903,
299,
332,
3214,
2816,
14887,
3116,
411,
2764,
299,
244,
55,
46,
353,
964,
5426,
7705,
22721,
1139,
8723,
2091,
7705,
9208,
8430,
1139,
64,
8886,
496,
29245,
45,
8903,
299,
332,
9424,
78,
802,
3743,
50,
798,
14587,
1701,
411,
2764,
299,
244,
56,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
1736,
625,
116,
8723,
67,
328,
4939,
1736,
625,
116,
739,
64,
8886,
496,
29245,
45,
8903,
299,
332,
9424,
78,
802,
377,
1323,
1780,
1701,
411,
2764,
299,
244,
57,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
88,
4939,
88,
335,
2937,
8723,
67,
328,
4939,
88,
335,
2937,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
10643,
14166,
22135,
1701,
411,
2764,
299,
244,
58,
46,
353,
964,
1701,
65,
10643,
14166,
5518,
8723,
67,
12315,
14166,
30961,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
18857,
4808,
1701,
411,
2764,
299,
244,
61,
46,
353,
964,
1701,
65,
72,
8640,
5756,
8723,
67,
4666,
44878,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
16933,
6695,
11831,
1701,
411,
2764,
299,
244,
62,
46,
353,
964,
1701,
65,
3245,
10376,
8723,
67,
31691,
120,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
409,
5743,
52,
1839,
420,
618,
1701,
411,
2764,
299,
244,
60,
46,
353,
964,
1701,
65,
9424,
78,
3212,
27041,
8723,
67,
2091,
7705,
520,
23617,
72,
8640,
64,
736,
496,
29245,
45,
8903,
299,
332,
22585,
411,
2764,
299,
244,
59,
46,
353,
964,
1701,
65,
6071,
8723,
67,
17844,
64,
736,
496,
29245,
45,
8903,
299,
332,
44511,
411,
2764,
299,
244,
59,
46,
353,
964,
1701,
65,
10926,
8723,
67,
24569,
64,
736,
496,
29245,
45,
8903,
299,
332,
17143,
1884,
1701,
1701,
411,
2764,
299,
244,
54,
54,
46,
353,
964,
1701,
65,
17143,
1884,
8723,
67,
13408,
1884,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
347,
15019,
1014,
1168,
411,
2764,
299,
244,
54,
53,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
402,
38736,
8723,
67,
347,
38736,
1241,
739,
64,
8886,
496,
29245,
45,
8903,
299,
332,
47629,
20623,
1168,
411,
2764,
299,
244,
56,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
4263,
8723,
67,
20623,
1241,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
1785,
3312,
2572,
1168,
411,
2764,
299,
244,
57,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
2375,
8723,
67,
7343,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
38078,
1168,
411,
2764,
299,
244,
54,
56,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
82,
20272,
8723,
67,
364,
44267,
739,
64,
8886,
496,
29245,
45,
8903,
299,
332,
12055,
327,
1862,
21766,
49,
5500,
49,
2791,
16635,
5742,
2764,
299,
244,
54,
57,
46,
353,
964,
26166,
8723,
11311,
64,
8886,
496,
29245,
45,
8903,
299,
332,
12055,
828,
411,
2764,
299,
244,
54,
57,
46,
353,
964,
6374,
11311,
798,
64,
8886,
581,
1701,
65,
10926,
8723,
67,
640,
44511,
365,
320,
303,
461,
24569,
64,
353,
339,
736,
581,
1701,
65,
72,
8640,
5756,
8723,
67,
640,
5266,
44878,
739,
365,
320,
303,
461,
4666,
44878,
739,
64,
353,
339,
736,
581,
1701,
65,
10643,
14166,
5518,
8723,
67,
640,
10643,
14166,
30961,
365,
320,
303,
461,
12315,
14166,
30961,
64,
353,
339,
736,
581,
6374,
19832,
365,
320,
303,
461,
828,
64,
353,
339,
8886,
581,
1701,
65,
3214,
7705,
22721,
402,
38736,
8723,
67,
640,
402,
38736,
1241,
739,
365,
320,
303,
461,
347,
38736,
1241,
739,
64,
353,
339,
8886,
581,
1701,
65,
3245,
10376,
8723,
67,
640,
3245,
10376,
120,
739,
365,
320,
303,
461,
31691,
120,
739,
64,
353,
339,
8886,
581,
1701,
65,
3214,
7705,
22721,
2375,
8723,
67,
640,
11632,
365,
320,
303,
461,
7343,
64,
353,
339,
8886,
581,
1701,
65,
3214,
7705,
22721,
82,
20272,
8723,
67,
640,
82,
44267,
739,
365,
320,
303,
461,
364,
44267,
739,
64,
353,
339,
8886,
581,
26166,
8723,
640,
12238,
365,
320,
303,
461,
11311,
64,
353,
339,
8886,
581,
6374,
640,
12238,
798,
365,
320,
303,
461,
11311,
798,
64,
353,
339,
8886,
581,
1701,
65,
3214,
7705,
22721,
4263,
8723,
67,
640,
21420,
1241,
739,
365,
320,
303,
461,
20623,
1241,
739,
64,
353,
339,
8886,
581,
910,
640,
3214,
365,
320,
303,
461,
2091,
64,
353,
339,
8886,
581,
5426
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
332,
17143,
1884,
1701,
1701,
411,
2764,
299,
244,
54,
54,
46,
353,
964,
1701,
65,
17143,
1884,
8723,
67,
13408,
1884,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
347,
15019,
1014,
1168,
411,
2764,
299,
244,
54,
53,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
402,
38736,
8723,
67,
347,
38736,
1241,
739,
64,
8886,
496,
29245,
45,
8903,
299,
332,
47629,
20623,
1168,
411,
2764,
299,
244,
56,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
4263,
8723,
67,
20623,
1241,
739,
64,
736,
496,
29245,
45,
8903,
299,
332,
1785,
3312,
2572,
1168,
411,
2764,
299,
244,
57,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
2375,
8723,
67,
7343,
64,
736,
496,
29245,
45,
8903,
299,
332,
47629,
38078,
1168,
411,
2764,
299,
244,
54,
56,
46,
353,
964,
1701,
65,
3214,
7705,
22721,
82,
20272,
8723,
67,
364,
44267,
739,
64,
8886,
496,
29245,
45,
8903,
299,
332,
12055,
327,
1862,
21766,
49,
5500,
49,
2791,
16635,
5742,
2764,
299,
244,
54,
57,
46,
353,
964,
26166,
8723,
11311,
64,
8886,
496,
29245,
45,
8903,
299,
332,
12055,
828,
411,
2764,
299,
244,
54,
57,
46,
353,
964,
6374,
11311,
798,
64,
8886,
581,
1701,
65,
10926,
8723,
67,
640,
44511,
365,
320,
303,
461,
24569,
64,
353,
339,
736,
581,
1701,
65,
72,
8640,
5756,
8723,
67,
640,
5266,
44878,
739,
365,
320,
303,
461,
4666,
44878,
739,
64,
353,
339,
736,
581,
1701,
65,
10643,
14166,
5518,
8723,
67,
640,
10643,
14166,
30961,
365,
320,
303,
461,
12315,
14166,
30961,
64,
353,
339,
736,
581,
6374,
19832,
365,
320,
303,
461,
828,
64,
353,
339,
8886,
581,
1701,
65,
3214,
7705,
22721,
402,
38736,
8723,
67,
640,
402,
38736,
1241,
739,
365,
320,
303,
461,
347,
38736,
1241,
739
] | 3,260,393,002,759,096,000
| true
| false
| false
| false
|
[
8886,
496,
29245,
45,
8903,
299,
332,
12055,
327,
1862,
21766,
49,
5500,
49,
2791,
16635,
5742,
2764,
299,
244,
54,
57,
46,
353,
964,
26166,
8723,
11311,
64,
8886,
496,
29245,
45,
8903,
299,
332,
12055,
828,
411,
2764,
299,
244,
54,
57,
46,
353,
964,
6374,
11311,
798,
64,
8886,
581,
1701,
65,
10926,
8723,
67,
640,
44511,
365,
320,
303,
461,
24569,
64,
353,
339,
736,
581,
1701,
65,
72,
8640,
5756,
8723,
67,
640,
5266,
44878,
739,
365,
320,
303,
461,
4666,
44878,
739,
64,
353,
339,
736,
581,
1701,
65,
10643,
14166,
5518,
8723,
67
] | 7,940,745,857,860,520,000
| true
|
"Quantification List List", position = 11)
private List<QuantificationDTO> quantificationList;
@ApiModelProperty(notes = "Contributing innovations list", position = 10)
private List<ProjectExpectedStudyInnovationDTO> innovationCodeList;
@ApiModelProperty(notes = "Contributing policies list", position = 3)
private List<ProjectExpectedStudyPolicyDTO> policiesCodeList;
@ApiModelProperty(notes = "Aditional link list", position = 4)
private List<ProjectExpectedStudyLinkDTO> links;
@ApiModelProperty(notes = "Contributing milestone list", position = 13)
private List<ProjectExpectedStudyMilestoneDTO> milestonesList;
@ApiModelProperty(notes = "phase (POWB, AR, UpKeep)", position = 14)
private PhaseDTO phase;
@ApiModelProperty(notes = "phase id", position = 14)
private Long phaseID;
public List<CountryDTO> getCountries() {
return countries;
}
public List<CrpProgramDTO> getFlagshipsList() {
return flagshipsList;
}
public List<GeographicScopeDTO>
|
InnovationDTO> innovationCodeList;
@ApiModelProperty(notes = "Contributing policies list", position = 3)
private List<ProjectExpectedStudyPolicyDTO> policiesCodeList;
@ApiModelProperty(notes = "Aditional link list", position = 4)
private List<ProjectExpectedStudyLinkDTO> links;
@ApiModelProperty(notes = "Contributing milestone list", position = 13)
private List<ProjectExpectedStudyMilestoneDTO> milestonesList;
@ApiModelProperty(notes = "phase (POWB, AR, UpKeep)", position = 14)
private PhaseDTO phase;
@ApiModelProperty(notes = "phase id", position = 14)
private Long phaseID;
public List<CountryDTO> getCountries() {
return countries;
}
public List<CrpProgramDTO> getFlagshipsList() {
return flagshipsList;
}
public List<GeographicScopeDTO>
|
", position = 4)
private List<ProjectExpectedStudyLinkDTO> links;
@ApiModelProperty(notes = "Contributing milestone list", position = 13)
private List<ProjectExpectedStudyMilestoneDTO> milestonesList;
@ApiModelProperty(notes = "phase (POWB, AR, UpKeep)", position = 14)
private PhaseDTO phase;
@ApiModelProperty(notes = "phase id", position = 14)
private Long phaseID;
public List<CountryDTO> getCountries() {
return countries;
}
public List<CrpProgramDTO> getFlagshipsList() {
return flagshipsList;
}
public List<GeographicScopeDTO>
|
@ApiModelProperty(notes = "phase (POWB, AR, UpKeep)", position = 14)
private PhaseDTO phase;
@ApiModelProperty(notes = "phase id", position = 14)
private Long phaseID;
public List<CountryDTO> getCountries() {
return countries;
}
public List<CrpProgramDTO> getFlagshipsList() {
return flagshipsList;
}
public List<GeographicScopeDTO>
|
getGeographicScopes() {
return geographicScopes;
}
public Long getId() {
return id;
}
public List<ProjectExpectedStudyInnovationDTO> getInnovationCodeList() {
return innovationCodeList
|
SculkSpreadTicker.java
|
/FileExtraction/Java_unseen/FrozenBlock_WilderWild/src/main/java/net/frozenblock/wilderwild/entity/SculkSpreadTicker.java
|
/*
* Copyright 2023-2024 FrozenBlock
* This file is part of Wilder Wild.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
package net.frozenblock.wilderwild.entity;
import net.frozenblock.lib.entity.api.SilentTicker;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SculkSpreader;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
public class SculkSpreadTicker extends SilentTicker {
public final SculkSpreader sculkSpreader;
public SculkSpreadTicker(@NotNull EntityType<?> entityType, @NotNull Level level) {
super(entityType, level);
this.sculkSpreader = SculkSpreader.createLevelSpreader();
}
public SculkSpreadTicker(@NotNull EntityType<?> entityType, @NotNull Level level, @NotNull BlockPos pos, boolean worldgen) {
super(entityType, level);
this.setPos(Vec3.atCenterOf(pos));
this.sculkSpreader = worldgen ? SculkSpreader.createWorldGenSpreader() : SculkSpreader.createLevelSpreader();
}
public static void createAndSpawn(@NotNull EntityType<?> entityType, @NotNull Level level, @NotNull BlockPos pos, boolean worldgen, int charge) {
SculkSpreadTicker sculkSpreadTicker = new SculkSpreadTicker(entityType, level, pos, worldgen);
level.addFreshEntity(sculkSpreadTicker);
sculkSpreadTicker.sculkSpreader.addCursors(pos, charge);
}
@Override
public void addAdditionalSaveData(@NotNull CompoundTag compound) {
super.addAdditionalSaveData(compound);
this.sculkSpreader.save(compound);
}
@Override
public void readAdditionalSaveData(@NotNull CompoundTag compound) {
super.readAdditionalSaveData(compound);
this.sculkSpreader.save(compound);
}
@Override
public void tick(@NotNull Level level, @NotNull Vec3 vec3, @NotNull BlockPos pos, int ticks) {
if (!this.sculkSpreader.getCursors().isEmpty()) {
this.sculkSpreader.updateCursors(level, pos, level.random, true);
} else {
this.discard();
}
}
}
| 2,666
|
Java
|
.java
|
FrozenBlock/WilderWild
| 78
| 20
| 8
|
2022-04-16T10:36:16Z
|
2024-05-08T01:38:23Z
|
330db67bab4f354f23bb1e95f5690929c8524dff083c4c747b1f7a9bd6b05b69
|
[] |
[
1127,
222,
338,
2657,
244,
55,
53,
55,
56,
50,
55,
53,
55,
57,
525,
13277,
2246,
222,
338,
1369,
822,
458,
1760,
451,
643,
1331,
643,
771,
51,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
16227,
6153,
5062,
222,
338,
1196,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
222,
338,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
222,
338,
16227,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
16227,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3723,
51,
30562,
1540,
51,
124,
1331,
33640,
51,
2244,
64,
222,
222,
485,
3723,
51,
30562,
1540,
51,
1379,
51,
2244,
51,
1256,
51,
20068,
323,
31739,
64,
222,
485,
3723,
51,
8654,
51,
1284,
51,
2246,
3010,
64,
222,
485,
3723,
51,
8654,
51,
39749,
51,
18133,
2649,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2244,
51,
21960,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
2671,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
1540,
51,
2391,
6627,
88,
1023,
839,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
22563,
51,
5985,
56,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
222,
942,
462,
377,
2908,
112,
33518,
31739,
2041,
19128,
323,
31739,
320,
499,
221,
942,
1175,
377,
2908,
112,
88,
1023,
839,
2240,
6627,
88,
1023,
839,
64,
499,
221,
942,
377,
2908,
112,
33518,
31739,
4810,
4936,
44947,
11667,
4436,
638,
49,
496,
4936,
11587,
3215,
46,
320,
376,
221,
5282,
45,
2244,
638,
49,
3215,
312,
376,
221,
597,
51,
564,
6627,
88,
1023,
839,
299,
377,
2908,
112,
88,
1023,
839,
51,
1315,
2671,
88,
1023,
839,
492,
222,
221,
130,
499,
221,
942,
377,
2908,
112,
33518,
31739,
4810,
4936,
44947,
11667,
4436,
638,
49,
496,
4936,
11587,
3215,
49,
496,
4936,
41721,
3423,
49,
1922,
5810,
2536,
46,
320,
376,
221,
5282,
45,
2244,
638,
49,
3215,
312,
376,
221,
597,
51,
489,
3010,
45,
5985,
56,
51,
288,
7067,
1436,
45,
985,
894,
376,
221,
597,
51,
564,
6627,
88,
1023,
839,
299,
5810,
2536,
1037,
377,
2908,
112,
88,
1023,
839,
51,
1315,
6719,
5154,
88,
1023,
839,
365,
518,
377,
2908,
112,
88,
1023,
839,
51,
1315,
2671,
88,
1023,
839,
492,
222,
221,
130,
499,
221,
942,
924,
782,
1506,
2199,
16354,
4810,
4936,
44947,
11667,
4436,
638,
49,
496,
4936,
11587,
3215,
49,
496,
4936,
41721,
3423,
49,
1922,
5810,
2536,
49,
648,
10117,
46,
320,
376,
221,
2391,
6627,
33518,
31739,
2240,
6627,
33518,
31739,
299,
556,
377,
2908,
112,
33518,
31739,
45,
2244,
638,
49,
3215,
49,
3423,
49,
5810,
2536,
312,
376,
221,
2675,
51,
688,
46999,
2234,
45,
564,
6627,
33518,
31739,
312,
376,
221,
564,
6627,
33518,
31739,
51,
564,
6627,
88,
1023,
839,
51,
688,
4306,
120,
1758,
45,
985,
49,
10117,
312,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
1035,
11644,
39311,
4810,
4936,
42160,
2649,
27089,
46,
320,
376,
221,
5282,
51,
688,
11644,
39311,
45,
26799,
312,
376,
221,
597,
51,
564,
6627,
88,
1023,
839,
51,
2882,
45,
26799,
312,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
1511,
11644,
39311,
4810,
4936,
42160,
2649,
27089,
46,
320,
376,
221,
5282,
51,
870,
11644,
39311,
45,
26799,
312,
376,
221,
597,
51,
564,
6627,
88,
1023,
839,
51,
2882,
45,
26799,
312,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
12931,
4810,
4936,
11587,
3215,
49,
496,
4936,
7485,
56,
4724,
56,
49,
496,
4936,
41721,
3423,
49,
648,
23571,
46,
320,
376,
221,
344,
1445,
597,
51,
564,
6627,
88,
1023,
839,
51,
390,
4306,
120,
1758,
941,
6401,
1177,
320,
374,
221,
597,
51,
564,
6627,
88,
1023,
839,
51,
1896,
4306,
120,
1758,
45,
2675,
49,
3423,
49,
3215,
51,
3917,
49,
878,
312,
376,
221,
130,
832,
320,
374,
221,
597,
51,
29808,
492,
376,
221,
130,
222,
221,
130,
222,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 774
|
[
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
222,
338,
16227,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
16227,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3723,
51,
30562,
1540,
51,
124,
1331,
33640,
51,
2244,
64,
222,
222,
485,
3723,
51,
30562,
1540,
51,
1379,
51,
2244,
51,
1256,
51,
20068,
323,
31739,
64,
222,
485,
3723,
51,
8654,
51,
1284,
51,
2246,
3010,
64,
222,
485,
3723,
51,
8654,
51,
39749,
51,
18133,
2649,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2244,
51,
21960,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
2671,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
1540,
51,
2391,
6627,
88,
1023,
839,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
22563,
51,
5985,
56,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
222,
942,
462,
377,
2908,
112,
33518,
31739,
2041,
19128,
323,
31739,
320,
499,
221,
942,
1175,
377,
2908,
112,
88,
1023,
839,
2240,
6627,
88,
1023,
839,
64,
499,
221,
942,
377,
2908,
112,
33518,
31739,
4810,
4936,
44947,
11667,
4436,
638,
49,
496,
4936,
11587,
3215,
46,
320,
376,
221,
5282,
45,
2244,
638,
49,
3215,
312,
376,
221,
597,
51,
564,
6627,
88,
1023,
839,
299,
377,
2908,
112,
88,
1023,
839,
51,
1315,
2671,
88,
1023,
839,
492,
222,
221,
130,
499,
221,
942,
377,
2908,
112,
33518,
31739,
4810
] | 3,797,254,256,326,099,000
| true
| false
| false
| false
|
[
21960,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
2671,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
2675,
51,
1540,
51,
2391,
6627,
88,
1023,
839,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
22563,
51,
5985,
56,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
222,
942,
462,
377,
2908,
112,
33518,
31739,
2041,
19128,
323,
31739,
320,
499,
221,
942,
1175,
377,
2908,
112,
88,
1023,
839,
2240,
6627,
88,
1023,
839,
64,
499,
221,
942,
377,
2908,
112,
33518,
31739,
4810,
4936,
44947,
11667,
4436,
638,
49
] | -5,990,618,094,154,235,000
| true
|
the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
package net.frozenblock.wilderwild.entity;
import net.frozenblock.lib.entity.api.SilentTicker;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SculkSpreader;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
public class SculkSpreadTicker extends SilentTicker {
public final SculkSpreader sculkSpreader;
public SculkSpreadTicker(@NotNull EntityType<?> entityType,
|
should have received a copy of the GNU Lesser General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
package net.frozenblock.wilderwild.entity;
import net.frozenblock.lib.entity.api.SilentTicker;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SculkSpreader;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
public class SculkSpreadTicker extends SilentTicker {
public final SculkSpreader sculkSpreader;
public SculkSpreadTicker(@NotNull EntityType<?> entityType,
|
import net.frozenblock.lib.entity.api.SilentTicker;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SculkSpreader;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
public class SculkSpreadTicker extends SilentTicker {
public final SculkSpreader sculkSpreader;
public SculkSpreadTicker(@NotNull EntityType<?> entityType,
|
EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SculkSpreader;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.NotNull;
public class SculkSpreadTicker extends SilentTicker {
public final SculkSpreader sculkSpreader;
public SculkSpreadTicker(@NotNull EntityType<?> entityType,
|
@NotNull Level level) {
super(entityType, level);
this.sculkSpreader = SculkSpreader.createLevelSpreader();
}
public SculkSpreadTicker(@
|
LocalRemoteLinkTest.java
|
/FileExtraction/Java_unseen/hartwigmedical_hmftools/esvee/src/test/java/com/hartwig/hmftools/esvee/assembly/LocalRemoteLinkTest.java
|
package com.hartwig.hmftools.esvee.assembly;
import static com.hartwig.hmftools.common.genome.region.Orientation.FORWARD;
import static com.hartwig.hmftools.common.genome.region.Orientation.REVERSE;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.BND;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DEL;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DUP;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_1;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_2;
import static com.hartwig.hmftools.esvee.TestUtils.READ_ID_GENERATOR;
import static com.hartwig.hmftools.esvee.TestUtils.REF_BASES_200;
import static com.hartwig.hmftools.esvee.TestUtils.cloneRead;
import static com.hartwig.hmftools.esvee.TestUtils.createAssembly;
import static com.hartwig.hmftools.esvee.TestUtils.createRead;
import static com.hartwig.hmftools.esvee.TestUtils.formTestRefSequence;
import static com.hartwig.hmftools.esvee.assembly.RemoteRegionAssembler.isExtensionCandidateAssembly;
import static com.hartwig.hmftools.esvee.assembly.types.RemoteReadType.DISCORDANT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.List;
import com.hartwig.hmftools.common.codon.Nucleotides;
import com.hartwig.hmftools.common.region.ChrBaseRegion;
import com.hartwig.hmftools.common.test.MockRefGenome;
import com.hartwig.hmftools.common.test.SamRecordTestUtils;
import com.hartwig.hmftools.esvee.assembly.read.Read;
import com.hartwig.hmftools.esvee.assembly.types.AssemblyLink;
import com.hartwig.hmftools.esvee.assembly.types.Junction;
import com.hartwig.hmftools.esvee.assembly.types.JunctionAssembly;
import com.hartwig.hmftools.esvee.assembly.types.RemoteRegion;
import org.junit.Test;
public class LocalRemoteLinkTest
{
@Test
public void testAssemblyLocalRefMatch()
{
// must be long enough to test the local ref genome sequence but not repetitive
String localRefSequence = formTestRefSequence(600);
MockRefGenome refGenome = new MockRefGenome(false);
refGenome.RefGenomeMap.put(CHR_1, localRefSequence);
LocalSequenceMatcher localSequenceMatcher = new LocalSequenceMatcher(refGenome, 200);
// first a basic exact match junction
Junction posJunction = new Junction(CHR_1, 300, FORWARD);
String assemblyRefBases = localRefSequence.substring(201, 301);
String assemblyExtensionBases = localRefSequence.substring(400, 450);
String assemblyBases = assemblyRefBases + assemblyExtensionBases;
byte[] baseQuals = SamRecordTestUtils.buildDefaultBaseQuals(assemblyBases.length());
JunctionAssembly assembly = new JunctionAssembly(posJunction, assemblyBases.getBytes(), baseQuals, assemblyRefBases.length() - 1);
AssemblyLink assemblyLink = localSequenceMatcher.tryLocalAssemblyLink(assembly);
assertNotNull(assemblyLink);
assertEquals(DEL, assemblyLink.svType());
assertEquals(400, assemblyLink.second().junction().Position);
Junction negJunction = new Junction(CHR_1, 300, REVERSE);
assemblyRefBases = localRefSequence.substring(300, 400);
assemblyExtensionBases = localRefSequence.substring(400, 450);
assemblyBases = assemblyExtensionBases + assemblyRefBases;
baseQuals = SamRecordTestUtils.buildDefaultBaseQuals(assemblyBases.length());
assembly = new JunctionAssembly(negJunction, assemblyBases.getBytes(), baseQuals, assemblyExtensionBases.length());
assemblyLink = localSequenceMatcher.tryLocalAssemblyLink(assembly);
assertNotNull(assemblyLink);
assertEquals(DUP, assemblyLink.svType());
assertEquals(400, assemblyLink.second().junction().Position);
}
@Test
public void testAssemblyRemoteReadMatch()
{
String remoteRefSequence = formTestRefSequence(400);
MockRefGenome refGenome = new MockRefGenome(true);
refGenome.RefGenomeMap.put(CHR_2, remoteRefSequence);
// first a basic exact match at the remote site
String assemblyRefBases = REF_BASES_200.substring(1, 101);
String assemblyExtensionBases = refGenome.getBaseString(CHR_2, 200, 300);
String assemblyBases = assemblyRefBases + assemblyExtensionBases;
JunctionAssembly assembly = createAssembly(CHR_1, 100, FORWARD, assemblyBases, 99);
String juncReadBases = REF_BASES_200.substring(51, 101) + refGenome.getBaseString(CHR_2, 200, 250);
Read juncRead = createRead(
READ_ID_GENERATOR.nextId(), CHR_1, 51, juncReadBases, "50M50S", CHR_2, 200, true);
Read juncRead2 = cloneRead(juncRead, READ_ID_GENERATOR.nextId());
assembly.addJunctionRead(juncRead);
assembly.addJunctionRead(juncRead2);
assertTrue(isExtensionCandidateAssembly(assembly));
RemoteRegionAssembler remoteRegionAssembler = new RemoteRegionAssembler(refGenome, null);
Read remoteRead = createRead(READ_ID_GENERATOR.nextId(), 200, refGenome.getBaseString(CHR_2, 200, 300), "100M");
RemoteRegion remoteRegion = new RemoteRegion(
new ChrBaseRegion(CHR_2, 200, 300), REVERSE, remoteRead.id(), DISCORDANT);
remoteRegionAssembler.addMatchedReads(List.of(remoteRead), remoteRegion);
byte[] remoteRegionBases = refGenome.getBases(CHR_2, 200, 300);
AssemblyLink assemblyLink = remoteRegionAssembler.tryAssemblyRemoteRefOverlap(
assembly, 200, 300, remoteRegionBases);
assertNotNull(assemblyLink);
assertEquals(BND, assemblyLink.svType());
assertEquals(200, assemblyLink.second().junction().Position);
assertEquals(REVERSE, assemblyLink.second().junction().Orient);
assertEquals(1, assemblyLink.second().supportCount());
// now a match upstream of the remote read, inferring the missing ref bases
assemblyExtensionBases = refGenome.getBaseString(CHR_2, 150, 250);
assemblyBases = assemblyRefBases + assemblyExtensionBases;
assembly = createAssembly(CHR_1, 100, FORWARD, assemblyBases, 99);
assemblyLink = remoteRegionAssembler.tryAssemblyRemoteRefOverlap(assembly, 200, 300, remoteRegionBases);
assertNotNull(assemblyLink);
assertEquals(BND, assemblyLink.svType());
assertEquals(150, assemblyLink.second().junction().Position);
assertEquals(REVERSE, assemblyLink.second().junction().Orient);
assertEquals(1, assemblyLink.second().supportCount());
// now test negative to negative orientation (a la 3-6-3)
assemblyRefBases = REF_BASES_200.substring(100, 200);
assemblyExtensionBases = refGenome.getBaseString(CHR_2, 150, 249);
String assemblyExtensionBasesReversed = Nucleotides.reverseComplementBases(assemblyExtensionBases);
assemblyBases = assemblyExtensionBasesReversed + assemblyRefBases;
assembly = createAssembly(CHR_1, 100, REVERSE, assemblyBases, assemblyExtensionBasesReversed.length());
assemblyLink = remoteRegionAssembler.tryAssemblyRemoteRefOverlap(assembly, 200, 300, remoteRegionBases);
assertNotNull(assemblyLink);
assertEquals(BND, assemblyLink.svType());
assertEquals(150, assemblyLink.second().junction().Position);
assertEquals(REVERSE, assemblyLink.second().junction().Orient);
assertEquals(1, assemblyLink.second().supportCount());
}
}
| 7,531
|
Java
|
.java
|
hartwigmedical/hmftools
| 176
| 53
| 13
|
2016-01-26T15:03:29Z
|
2024-05-09T06:18:58Z
|
0aff442ecc0bd1bea7e5f9e75cf6256948829e0f642b1915412ae7cffc761a0f
|
[] |
[
1337,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
64,
222,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
27582,
51,
3436,
51,
13986,
51,
33115,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
27582,
51,
3436,
51,
13986,
51,
632,
33733,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
71,
9116,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
17044,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
27047,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
54,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
55,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4423,
100,
798,
100,
12436,
7275,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4196,
100,
6185,
88,
100,
55,
53,
53,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
6371,
2248,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
1315,
10878,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
1315,
2248,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
618,
1024,
2099,
5908,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
7318,
6071,
24277,
51,
316,
4823,
19472,
10878,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
2529,
51,
7318,
2248,
638,
51,
5988,
72,
3083,
4525,
64,
222,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
4993,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
14765,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
6553,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
10777,
286,
51,
83,
37838,
13014,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
3436,
51,
43545,
1778,
6071,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
3672,
2099,
5154,
861,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
29044,
3171,
32384,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
870,
51,
2248,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
2529,
51,
10878,
2375,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
2529,
51,
79,
550,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
2529,
51,
79,
550,
10878,
64,
222,
485,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
51,
2529,
51,
7318,
6071,
64,
222,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
222,
942,
462,
7099,
7318,
2375,
1024,
222,
128,
303,
496,
1024,
303,
581,
782,
913,
10878,
3340,
2099,
3683,
365,
303,
320,
310,
453,
2315,
545,
1964,
8473,
391,
913,
341,
2212,
2505,
27747,
6645,
1294,
666,
34317,
4853,
310,
910,
2212,
2099,
5908,
299,
2252,
1024,
2099,
5908,
45,
59,
53,
53,
312,
603,
7509,
2099,
5154,
861,
2505,
5154,
861,
299,
556,
7509,
2099,
5154,
861,
45,
1886,
312,
310,
2505,
5154,
861,
51,
2099,
5154,
861,
1225,
51,
543,
45,
1424,
87,
100,
54,
49,
2212,
2099,
5908,
312,
603,
7099,
5908,
11947,
2212,
5908,
11947,
299,
556,
7099,
5908,
11947,
45,
631,
5154,
861,
49,
244,
55,
53,
53,
312,
603,
453,
1950,
331,
6575,
7174,
2549,
614,
550,
310,
990,
550,
3423,
79,
550,
299,
556,
990,
550,
45,
1424,
87,
100,
54,
49,
244,
56,
53,
53,
49,
4800,
17235,
312,
603,
910,
13859,
2099,
48242,
299,
2212,
2099,
5908,
51,
8724,
45,
55,
53,
54,
49,
244,
56,
53,
54,
312,
310,
910,
13859,
4823,
48242,
299,
2212,
2099,
5908,
51,
8724,
45,
57,
53,
53,
49,
244,
57,
58,
53,
312,
310,
910,
13859,
48242,
299,
13859,
2099,
48242,
494,
13859,
4823,
48242,
64,
310,
3447,
1197,
1712,
8842,
120,
299,
26159,
3171,
32384,
51,
1848,
2061,
1778,
8842,
120,
45,
14314,
48242,
51,
1340,
1052,
603,
990,
550,
10878,
13859,
299,
556,
990,
550,
10878,
45,
985,
79,
550,
49,
13859,
48242,
51,
19682,
1046,
1712,
8842,
120,
49,
13859,
2099,
48242,
51,
1340,
365,
449,
244,
54,
312,
603,
20719,
2375,
13859,
2375,
299,
2212,
5908,
11947,
51,
1287,
3340,
10878,
2375,
45,
14314,
312,
310,
17141,
45,
14314,
2375,
312,
310,
3803,
45,
17044,
49,
13859,
2375,
51,
2289,
638,
1052,
310,
3803,
45,
57,
53,
53,
49,
13859,
2375,
51,
3109,
941,
39093,
941,
2746,
312,
603,
990,
550,
7571,
79,
550,
299,
556,
990,
550,
45,
1424,
87,
100,
54,
49,
244,
56,
53,
53,
49,
3062,
33733,
312,
603,
13859,
2099,
48242,
299,
2212,
2099,
5908,
51,
8724,
45,
56,
53,
53,
49,
244,
57,
53,
53,
312,
310,
13859,
4823,
48242,
299,
2212,
2099,
5908
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
14314,
64,
222,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
27582,
51,
3436,
51,
13986,
51,
33115,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
27582,
51,
3436,
51,
13986,
51,
632,
33733,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
71,
9116,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
17044,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
2289,
51,
49023,
10827,
638,
51,
27047,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
54,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
55,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4423,
100,
798,
100,
12436,
7275,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4196,
100,
6185,
88,
100,
55,
53,
53,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
6371,
2248,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
1315,
10878,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384
] | -6,396,524,076,657,140,000
| true
| false
| false
| false
|
[
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
54,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
2297,
51,
881,
51,
21950,
32384,
51,
1424,
87,
100,
55,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4423,
100,
798,
100,
12436,
7275,
64,
222,
485,
924,
785,
51,
109,
521,
124,
384,
51,
109,
10599,
4303,
51,
326,
606,
106,
51,
32384,
51,
4196,
100,
6185,
88,
100,
55,
53,
53,
64,
222,
485,
924,
785,
51
] | -7,542,814,705,116,227,000
| true
|
artwig.hmftools.esvee.assembly;
import static com.hartwig.hmftools.common.genome.region.Orientation.FORWARD;
import static com.hartwig.hmftools.common.genome.region.Orientation.REVERSE;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.BND;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DEL;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DUP;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_1;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_2;
import static com.hartwig.hmftools.esvee.TestUtils.READ_ID_GENERATOR;
import static com.hartwig.hmftools.esvee.TestUtils.REF_BASES_200;
import static com.
|
mftools.common.genome.region.Orientation.REVERSE;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.BND;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DEL;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DUP;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_1;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_2;
import static com.hartwig.hmftools.esvee.TestUtils.READ_ID_GENERATOR;
import static com.hartwig.hmftools.esvee.TestUtils.REF_BASES_200;
import static com.
|
mftools.common.sv.StructuralVariantType.DEL;
import static com.hartwig.hmftools.common.sv.StructuralVariantType.DUP;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_1;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_2;
import static com.hartwig.hmftools.esvee.TestUtils.READ_ID_GENERATOR;
import static com.hartwig.hmftools.esvee.TestUtils.REF_BASES_200;
import static com.
|
.common.test.GeneTestUtils.CHR_1;
import static com.hartwig.hmftools.common.test.GeneTestUtils.CHR_2;
import static com.hartwig.hmftools.esvee.TestUtils.READ_ID_GENERATOR;
import static com.hartwig.hmftools.esvee.TestUtils.REF_BASES_200;
import static com.
|
hartwig.hmftools.esvee.TestUtils.cloneRead;
import static com.hartwig.hmftools.esvee.TestUtils.createAssembly;
import static com.hartwig
|
LinePlot.java
|
/FileExtraction/Java_unseen/mleoking_PhET/simulations-java/common/charts/src/edu/colorado/phet/common/charts/LinePlot.java
|
// Copyright 2002-2011, University of Colorado
/*
* CVS Info -
* Filename : $Source$
* Branch : $Name$
* Modified by : $Author:samreid $
* Revision : $Revision:14669 $
* Date modified : $Date:2007-04-17 02:12:41 -0500 (Tue, 17 Apr 2007) $
*/
package edu.colorado.phet.common.charts;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Paint;
import java.awt.Stroke;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import edu.colorado.phet.common.phetgraphics.view.phetgraphics.PhetShapeGraphic;
/**
* LinePlot takes a set of points (a DataSet) and connects the
* points with line segments.
*
* @author Sam Reid
* @version $Revision:14669 $
*/
public class LinePlot extends DataSetGraphic {
private static final Stroke DEFAULT_STROKE = new BasicStroke( 1f );
private static final Color DEFAULT_COLOR = Color.BLACK;
private boolean generalPathIsEmpty; // true if generalPath contains zero points
private GeneralPath generalPath;
private PhetShapeGraphic phetShapeGraphic;
//----------------------------------------------------------------------------
// Constructors
//----------------------------------------------------------------------------
public LinePlot( Component component, Chart chart ) {
this( component, chart, null );
}
public LinePlot( Component component, Chart chart, DataSet dataSet ) {
this( component, chart, dataSet, DEFAULT_STROKE, DEFAULT_COLOR );
}
public LinePlot( Component component, final Chart chart, DataSet dataSet, Stroke stroke, Paint paint ) {
super( component, chart, dataSet );
// Create the PhetShape graphic that draws the plot.
generalPath = new GeneralPath();
generalPathIsEmpty = true;
phetShapeGraphic = new PhetShapeGraphic( getComponent(), generalPath, stroke, paint );
addGraphic( phetShapeGraphic );
addAllPoints();
}
//----------------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------------
/**
* Sets the Stroke used to stroke the plot.
*
* @param stroke
*/
public void setStroke( Stroke stroke ) {
phetShapeGraphic.setStroke( stroke );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setBorderColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setStrokeColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
//----------------------------------------------------------------------------
// DataSetGraphic implementation
//----------------------------------------------------------------------------
/**
* Called when the associated Chart's size or range changes.
* The plot is reset by re-adding all points.
*/
public void transformChanged() {
generalPath.reset();
generalPathIsEmpty = true;
addAllPoints();
}
//----------------------------------------------------------------------------
// DataSet.Observer implementation
//----------------------------------------------------------------------------
/**
* Called when the associated data set is cleared.
* Clients should not call this method directly.
* Effectively causes the plot to erase itself.
*/
public void cleared() {
generalPath.reset();
generalPathIsEmpty = true;
repaintAll();
}
/**
* Called when a single point is added to the associated data set.
* Clients should not call this method directly.
* The plot is redrawn after the point is added.
* If you need to add a set of point, it is more efficient to call pointsAdded.
*
* @param point
*/
public void pointAdded( Point2D point ) {
pointAddedNoRepaint( point );
repaintAll();
}
/**
* Called when a set of points is added to the associateds data set.
* Clients should not call this method directly.
* The plot is redrawn after all the points have been added.
* If you need points to appear individually as they are added,
* then you need to call pointAdded.
*
* @param points
*/
public void pointsAdded( Point2D[] points ) {
for ( int i = 0; i < points.length; i++ ) {
pointAddedNoRepaint( points[i] );
}
repaintAll();
}
/**
* Adds a point to the plot, but performs no redraw.
* This method is shared by pointAdded and pointsAdded.
*
* @param point
*/
protected void pointAddedNoRepaint( Point2D point ) {
if ( point == null ) {
throw new RuntimeException( "Null point" );
}
Point2D viewLocation = getChart().transformDouble( point );
if ( generalPathIsEmpty ) {
generalPath.moveTo( (float) viewLocation.getX(), (float) viewLocation.getY() );
generalPathIsEmpty = false;
}
else {
generalPath.lineTo( (float) viewLocation.getX(), (float) viewLocation.getY() );
}
}
/**
* Triggers a repaint of the plot.
* This is currently done by setting the PhetShapeGraphic to dirty.
*/
private void repaintAll() {
phetShapeGraphic.setShapeDirty();
}
}
| 5,551
|
Java
|
.java
|
mleoking/PhET
| 18
| 10
| 0
|
2016-05-19T01:58:46Z
|
2016-05-19T03:51:45Z
|
1619b11247c6ae761a34bba1eafdd5db5e1f84fd7ed61fc477c679005567d0aa
|
[] |
[
325,
2657,
244,
55,
53,
53,
55,
50,
55,
53,
54,
54,
49,
11451,
451,
5459,
2619,
222,
222,
1127,
222,
338,
409,
5775,
12450,
449,
222,
338,
38005,
518,
417,
2044,
41,
222,
338,
23721,
518,
417,
577,
41,
222,
338,
13124,
829,
518,
417,
4372,
63,
14681,
287,
333,
417,
222,
338,
26854,
518,
417,
14021,
63,
54,
57,
59,
59,
62,
417,
222,
338,
2833,
8851,
518,
417,
1563,
63,
55,
53,
53,
60,
50,
53,
57,
50,
54,
60,
244,
53,
55,
63,
54,
55,
63,
57,
54,
449,
53,
58,
53,
53,
327,
46084,
49,
244,
54,
60,
12742,
244,
55,
53,
53,
60,
46,
417,
222,
588,
222,
222,
1337,
15357,
51,
1507,
2619,
51,
117,
10237,
51,
2297,
51,
16080,
64,
222,
222,
485,
1401,
51,
8236,
51,
7114,
14212,
64,
222,
485,
1401,
51,
8236,
51,
1530,
64,
222,
485,
1401,
51,
8236,
51,
1735,
64,
222,
485,
1401,
51,
8236,
51,
12297,
64,
222,
485,
1401,
51,
8236,
51,
14212,
64,
222,
485,
1401,
51,
8236,
51,
12338,
51,
46988,
64,
222,
485,
1401,
51,
8236,
51,
12338,
51,
1962,
55,
73,
64,
222,
222,
485,
15357,
51,
1507,
2619,
51,
117,
10237,
51,
2297,
51,
117,
10237,
7027,
51,
1090,
51,
117,
10237,
7027,
51,
85,
10237,
4749,
23903,
64,
222,
222,
1350,
222,
338,
7118,
11756,
8756,
331,
758,
451,
5018,
327,
102,
31671,
46,
480,
37311,
341,
222,
338,
5018,
642,
1646,
17134,
51,
222,
338,
222,
338,
496,
2133,
26159,
922,
333,
222,
338,
496,
1687,
417,
14021,
63,
54,
57,
59,
59,
62,
417,
222,
588,
222,
942,
462,
7118,
11756,
2041,
31671,
23903,
320,
465,
964,
924,
1175,
1277,
5446,
4050,
100,
654,
1030,
2241,
299,
556,
9280,
14212,
45,
244,
54,
107,
1110,
303,
964,
924,
1175,
5459,
4050,
100,
6237,
299,
5459,
51,
22746,
64,
465,
964,
1922,
8108,
1233,
29525,
64,
453,
878,
434,
8108,
1233,
4326,
5953,
5018,
303,
964,
6153,
1233,
8108,
1233,
64,
303,
964,
466,
10237,
4749,
23903,
317,
10237,
4749,
23903,
64,
465,
453,
2672,
3147,
303,
453,
34731,
303,
453,
2672,
3147,
465,
581,
7118,
11756,
45,
5715,
2595,
49,
16078,
7589,
848,
320,
310,
477,
45,
2595,
49,
7589,
49,
762,
1110,
303,
339,
465,
581,
7118,
11756,
45,
5715,
2595,
49,
16078,
7589,
49,
31671,
46907,
848,
320,
310,
477,
45,
2595,
49,
7589,
49,
46907,
49,
4050,
100,
654,
1030,
2241,
49,
4050,
100,
6237,
1110,
303,
339,
465,
581,
7118,
11756,
45,
5715,
2595,
49,
1175,
16078,
7589,
49,
31671,
46907,
49,
1277,
5446,
10085,
49,
24999,
16870,
848,
320,
310,
2615,
45,
2595,
49,
7589,
49,
46907,
1110,
603,
453,
2673,
341,
466,
10237,
4749,
37649,
708,
5194,
120,
341,
7036,
51,
310,
8108,
1233,
299,
556,
6153,
1233,
492,
310,
8108,
1233,
29525,
299,
878,
64,
310,
317,
10237,
4749,
23903,
299,
556,
466,
10237,
4749,
23903,
45,
640,
1735,
1046,
8108,
1233,
49,
10085,
49,
16870,
1110,
310,
1035,
23903,
45,
317,
10237,
4749,
23903,
1110,
603,
1035,
1947,
6843,
492,
303,
339,
465,
453,
2672,
3147,
303,
453,
8275,
1758,
303,
453,
2672,
3147,
465,
1041,
294,
338,
9023,
341,
1277,
5446,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
10085,
294,
588,
303,
581,
782,
758,
14212,
45,
1277,
5446,
10085,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
14212,
45,
10085,
1110,
303,
339,
465,
1041,
294,
338,
9023,
341,
5459,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
1989,
294,
588,
303,
581,
782,
758,
36703,
45,
5459,
1989,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
36703,
45,
1989,
1110,
303,
339,
465,
1041,
294,
338,
9023,
341,
5459,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
1989,
294,
588,
303,
581,
782,
758,
14212,
1530,
45,
5459,
1989,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
36703,
45,
1989,
1110,
303,
339,
465,
453,
2672,
3147,
303,
453,
31671,
23903,
4753,
303,
453,
2672,
3147,
465,
1041,
294,
338,
18034,
1429,
341,
5764,
16078,
1200,
1354,
575,
2189,
3417,
51,
294,
338,
906,
7036,
458,
5672,
829,
334,
50,
2386,
1187,
5018,
51,
294,
588,
303,
581,
782,
4549,
3663,
365,
320,
310,
8108,
1233,
51,
4558,
492,
310,
8108,
1233,
29525,
299,
878,
64,
310,
1035,
1947,
6843,
492,
303,
339,
465,
453,
2672,
3147,
303,
453,
31671,
51,
9136,
4753,
303,
453,
2672,
3147,
465,
1041,
294,
338,
18034,
1429,
341,
5764,
727,
758,
458,
27731,
51,
294,
338,
43963,
1414,
666,
1495,
477,
1431,
7045,
51,
294,
338,
19234,
8637,
15665,
341,
7036,
391,
34387,
8032,
51,
294,
588,
303,
581,
782,
27731,
365,
320,
310,
8108,
1233,
51,
4558,
492,
310,
8108,
1233,
29525,
299,
878,
64,
310,
7095,
2043,
1947,
492,
303,
339,
465,
1041,
294,
338,
18034,
1429,
331,
4005,
2282,
458,
3654,
391,
341,
5764,
727,
758,
51,
294,
338,
43963,
1414,
666,
1495,
477,
1431,
7045,
51,
294,
338,
906,
7036,
458,
38848,
115,
2703,
341,
2282,
458,
3654,
51,
294,
338,
1691,
863,
1868,
391,
1035,
331,
758,
451,
2282,
49,
580,
458,
1851,
17505,
391,
1495,
5018,
11030,
51,
294,
338,
294,
338,
496,
772,
2282,
294,
588,
303,
581,
782,
2282,
11030,
45,
6460,
55,
73,
2282,
848,
320,
310,
2282,
11030,
2042,
7599,
2043,
45,
2282,
1110,
310,
7095,
2043,
1947,
492,
303,
339,
465,
1041,
294,
338,
18034,
1429,
331,
758,
451,
5018,
458,
3654,
391,
341,
5764,
120,
727,
758,
51,
294,
338,
43963,
1414,
666,
1495,
477,
1431,
7045,
51,
294,
338,
906,
7036,
458,
38848,
115,
2703,
1187,
341,
5018,
1178,
2602,
3654,
51,
294,
338,
1691,
863,
1868,
5018,
391,
9268,
44356,
641,
2974,
904,
3654,
49,
294,
338,
1636,
863,
1868,
391,
1495,
2282,
11030,
51,
294,
338,
294,
338,
496,
772,
5018,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
10237,
4749,
23903,
45,
640,
1735,
1046,
8108,
1233,
49,
10085,
49,
16870,
1110,
310,
1035,
23903,
45,
317,
10237,
4749,
23903,
1110,
603,
1035,
1947,
6843,
492,
303,
339,
465,
453,
2672,
3147,
303,
453,
8275,
1758,
303,
453,
2672,
3147,
465,
1041,
294,
338,
9023,
341,
1277,
5446,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
10085,
294,
588,
303,
581,
782,
758,
14212,
45,
1277,
5446,
10085,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
14212,
45,
10085,
1110,
303,
339,
465,
1041,
294,
338,
9023,
341,
5459,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
1989,
294,
588,
303,
581,
782,
758,
36703,
45,
5459,
1989,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
36703,
45,
1989,
1110,
303,
339,
465,
1041,
294,
338,
9023,
341,
5459,
1674,
391,
10085,
341,
7036,
51,
294,
338,
294,
338,
496,
772,
1989,
294,
588,
303,
581,
782,
758,
14212,
1530,
45,
5459,
1989,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
36703,
45,
1989,
1110,
303,
339,
465,
453,
2672,
3147,
303,
453,
31671,
23903,
4753,
303,
453,
2672,
3147,
465,
1041,
294,
338,
18034,
1429,
341,
5764,
16078,
1200,
1354,
575,
2189,
3417,
51,
294,
338,
906,
7036,
458,
5672,
829,
334,
50,
2386,
1187,
5018,
51,
294,
588,
303,
581,
782,
4549,
3663,
365,
320,
310,
8108,
1233,
51,
4558,
492,
310,
8108,
1233,
29525,
299,
878,
64,
310,
1035,
1947,
6843,
492,
303,
339,
465,
453,
2672,
3147,
303,
453,
31671,
51,
9136,
4753,
303,
453,
2672,
3147,
465,
1041,
294,
338,
18034,
1429,
341,
5764,
727,
758,
458,
27731,
51,
294,
338,
43963,
1414,
666,
1495,
477,
1431,
7045,
51,
294,
338,
19234,
8637,
15665,
341,
7036,
391,
34387,
8032,
51,
294,
588
] | -8,652,238,626,724,049,000
| true
| false
| false
| false
|
[
338,
496,
772,
1989,
294,
588,
303,
581,
782,
758,
14212,
1530,
45,
5459,
1989,
848,
320,
310,
317,
10237,
4749,
23903,
51,
489,
36703,
45,
1989,
1110,
303,
339,
465,
453,
2672,
3147,
303,
453,
31671,
23903,
4753,
303,
453,
2672,
3147,
465,
1041,
294,
338,
18034,
1429,
341,
5764,
16078,
1200,
1354,
575,
2189,
3417,
51,
294,
338,
906,
7036,
458,
5672,
829,
334,
50,
2386,
1187,
5018,
51,
294,
588,
303,
581,
782,
4549,
3663,
365,
320,
310,
8108,
1233,
51,
4558,
492,
310,
8108,
1233,
29525,
299,
878,
64,
310,
1035,
1947,
6843,
492,
303,
339
] | -9,043,049,934,694,770,000
| true
|
hetShapeGraphic( getComponent(), generalPath, stroke, paint );
addGraphic( phetShapeGraphic );
addAllPoints();
}
//----------------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------------
/**
* Sets the Stroke used to stroke the plot.
*
* @param stroke
*/
public void setStroke( Stroke stroke ) {
phetShapeGraphic.setStroke( stroke );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setBorderColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setStrokeColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
//----------------------------------------------------------------------------
// DataSetGraphic implementation
//----------------------------------------------------------------------------
/**
* Called when the associated Chart's size or range changes.
* The plot is reset by re-adding all points.
*/
public void transformChanged() {
generalPath.reset();
generalPathIsEmpty = true;
addAllPoints();
}
|
used to stroke the plot.
*
* @param stroke
*/
public void setStroke( Stroke stroke ) {
phetShapeGraphic.setStroke( stroke );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setBorderColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setStrokeColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
//----------------------------------------------------------------------------
// DataSetGraphic implementation
//----------------------------------------------------------------------------
/**
* Called when the associated Chart's size or range changes.
* The plot is reset by re-adding all points.
*/
public void transformChanged() {
generalPath.reset();
generalPathIsEmpty = true;
addAllPoints();
}
|
plot.
*
* @param color
*/
public void setBorderColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
/**
* Sets the Color used to stroke the plot.
*
* @param color
*/
public void setStrokeColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
//----------------------------------------------------------------------------
// DataSetGraphic implementation
//----------------------------------------------------------------------------
/**
* Called when the associated Chart's size or range changes.
* The plot is reset by re-adding all points.
*/
public void transformChanged() {
generalPath.reset();
generalPathIsEmpty = true;
addAllPoints();
}
|
* @param color
*/
public void setStrokeColor( Color color ) {
phetShapeGraphic.setBorderColor( color );
}
//----------------------------------------------------------------------------
// DataSetGraphic implementation
//----------------------------------------------------------------------------
/**
* Called when the associated Chart's size or range changes.
* The plot is reset by re-adding all points.
*/
public void transformChanged() {
generalPath.reset();
generalPathIsEmpty = true;
addAllPoints();
}
|
//----------------------------------------------------------------------------
// DataSet.Observer implementation
//----------------------------------------------------------------------------
/**
* Called when the associated data set is cleared.
* Clients should not call this method directly.
* Effectively causes the plot to erase itself.
*/
|
RefurbishedConfig.java
|
/FileExtraction/Java_unseen/r3back_the-core/TheSkills/src/main/java/com/qualityplus/skills/base/config/perk/RefurbishedConfig.java
|
package com.qualityplus.skills.base.config.perk;
import com.qualityplus.assistant.lib.com.cryptomorin.xseries.XMaterial;
import com.qualityplus.skills.base.perk.Perk;
import com.qualityplus.skills.base.perk.perks.RefurbishedPerk;
import com.qualityplus.skills.base.skill.gui.GUIOptions;
import com.qualityplus.assistant.lib.eu.okaeri.configs.OkaeriConfig;
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.Header;
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.NameModifier;
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.NameStrategy;
import com.qualityplus.assistant.lib.eu.okaeri.configs.annotation.Names;
import com.qualityplus.assistant.lib.eu.okaeri.platform.core.annotation.Configuration;
import lombok.Getter;
import lombok.Setter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@Getter
@Setter
@Configuration(path = "perks/refurbished_perk.yml")
@Header("================================")
@Header(" Refurbished Perk ")
@Header("================================")
@Names(strategy = NameStrategy.HYPHEN_CASE, modifier = NameModifier.TO_LOWER_CASE)
public final class RefurbishedConfig extends OkaeriConfig implements PerkFile {
public String id = "refurbished";
public boolean enabled = true;
public String displayName = "Refurbished";
public List<String> description = Arrays.asList(" &a%percent%% &7chance to refurbish your", " &7pickaxes restoring their max", " &7durability while breaking blocks.");
public int maxLevel = 50;
public GUIOptions guiOptions = GUIOptions.builder()
.slot(29)
.page(1)
.item(XMaterial.PLAYER_HEAD)
.texture("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWNiZDlmNWVjMWVkMDA3MjU5OTk2NDkxZTY5ZmY2NDlhMzEwNmNmOTIwMjI3YjFiYjNhNzFlZTdhODk4NjNmIn19fQ==")
.mainMenuLore(Collections.singletonList("%skill_refurbished_description%"))
.build();
public Perk getPerk(){
return RefurbishedPerk.builder()
.id(id)
.displayName(displayName)
.description(description)
.enabled(enabled)
.skillGUIOptions(guiOptions)
.chancePerLevel(0.1)
.toolList(Arrays.asList(
XMaterial.DIAMOND_PICKAXE,
XMaterial.IRON_PICKAXE,
XMaterial.GOLDEN_PICKAXE
))
.build();
}
}
| 2,549
|
Java
|
.java
|
r3back/the-core
| 9
| 9
| 8
|
2022-10-29T02:27:04Z
|
2024-03-09T23:58:17Z
|
a81e63d41823dfe554f4cd9784887d8e25bbcc6da96aad1bb8b97c6ed4a1dee2
|
[] |
[
1337,
785,
51,
13752,
5447,
51,
25048,
51,
1460,
51,
1180,
51,
481,
112,
64,
222,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
527,
51,
3712,
437,
290,
285,
51,
125,
8481,
51,
93,
6347,
64,
222,
485,
785,
51,
13752,
5447,
51,
25048,
51,
1460,
51,
481,
112,
51,
1852,
112,
64,
222,
485,
785,
51,
13752,
5447,
51,
25048,
51,
1460,
51,
481,
112,
51,
481,
5532,
51,
2099,
19598,
3359,
1852,
112,
64,
222,
485,
785,
51,
13752,
5447,
51,
25048,
51,
1460,
51,
10900,
51,
8472,
51,
10586,
2045,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
15753,
51,
84,
3812,
19465,
1081,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
15753,
51,
4341,
51,
2661,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
15753,
51,
4341,
51,
577,
11693,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
15753,
51,
4341,
51,
577,
8095,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
15753,
51,
4341,
51,
4128,
64,
222,
485,
785,
51,
13752,
5447,
51,
17595,
51,
1379,
51,
11094,
51,
1273,
102,
19465,
51,
5146,
51,
1284,
51,
4341,
51,
2339,
64,
222,
485,
13243,
51,
11722,
64,
222,
485,
13243,
51,
16923,
64,
222,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
69,
11722,
222,
69,
16923,
222,
69,
2339,
45,
1005,
299,
332,
481,
5532,
52,
631,
19598,
3359,
100,
481,
112,
51,
7083,
678,
222,
69,
2661,
459,
1298,
22123,
33619,
222,
69,
2661,
459,
981,
7911,
19598,
3359,
4235,
112,
665,
7816,
222,
69,
2661,
459,
1298,
22123,
33619,
222,
69,
4128,
45,
14008,
299,
3286,
8095,
51,
11546,
85,
4198,
100,
11257,
49,
15348,
299,
3286,
11693,
51,
1425,
100,
29683,
100,
11257,
46,
222,
942,
1175,
462,
7911,
19598,
3359,
1081,
2041,
565,
3812,
19465,
1081,
4584,
4235,
112,
991,
320,
303,
581,
910,
828,
299,
332,
631,
19598,
3359,
884,
303,
581,
1922,
5892,
299,
878,
64,
303,
581,
910,
23058,
299,
332,
2099,
19598,
3359,
884,
303,
581,
1701,
65,
671,
67,
3066,
299,
14479,
51,
14100,
459,
244,
568,
102,
42,
11701,
1803,
568,
60,
41773,
391,
2505,
19598,
1729,
1390,
411,
332,
244,
568,
60,
8817,
15273,
6125,
8757,
3641,
1788,
411,
332,
244,
568,
60,
19545,
3478,
2236,
16276,
9072,
5377,
303,
581,
648,
1788,
2671,
299,
244,
58,
53,
64,
303,
581,
13029,
2045,
17390,
2045,
299,
13029,
2045,
51,
4179,
365,
343,
657,
9054,
45,
55,
62,
46,
343,
657,
1655,
45,
54,
46,
343,
657,
1113,
45,
93,
6347,
51,
19409,
100,
6902,
46,
343,
657,
8288,
459,
929,
79,
53,
10640,
109,
53,
35955,
26264,
2499,
78,
59,
929,
79,
7157,
53,
113,
40029,
11558,
60,
402,
15424,
103,
4264,
59,
4670,
109,
53,
105,
18695,
59,
26069,
62,
53,
10640,
109,
53,
35955,
26264,
2499,
58,
1371,
92,
58,
113,
94,
56,
31679,
29691,
86,
375,
21201,
53,
81,
56,
87,
293,
5157,
54,
4112,
33600,
83,
3635,
110,
34343,
12779,
83,
23207,
111,
26036,
9755,
5121,
70,
56,
18871,
90,
58,
1212,
112,
55,
9116,
36978,
95,
1730,
58,
24805,
94,
55,
9116,
15578,
18036,
38056,
19511,
19511,
1212,
34031,
18871,
78,
56,
35443,
13199,
35443,
31846,
21841,
2151,
36497,
11521,
5422,
112,
57,
22347,
19511,
402,
54,
62,
107,
86,
11516,
46,
343,
657,
1850,
2689,
81,
705,
45,
4293,
51,
36511,
4923,
10900,
100,
631,
19598,
3359,
100,
2328,
42,
2152,
343,
657,
1848,
492,
303,
581,
4235,
112,
640,
1852,
112,
3261,
310,
461,
7911,
19598,
3359,
1852,
112,
51,
4179,
365,
419,
657,
333,
45,
333,
46,
419,
657,
16169,
45,
16169,
46,
419,
657,
2328,
45,
2328,
46,
419,
657,
6572,
45,
6572,
46,
419,
657,
10900,
10586,
2045,
45,
8472,
2045,
46,
419,
657,
41773,
1852,
2671,
45,
53,
51,
54,
46,
419,
657,
3749,
739,
45,
9981,
51,
14100,
45,
733,
1618,
6347,
51,
1740,
2229,
36606,
100,
85,
12305,
4311,
74,
49,
733,
1618,
6347,
51,
31493,
100,
85,
12305,
4311,
74,
49,
733,
1618,
6347,
51,
76,
9403,
737,
100,
85,
12305,
4311,
74,
419,
9671,
419,
657,
1848,
492,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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79,
53,
10640,
109,
53,
35955,
26264,
2499,
78,
59,
929,
79,
7157,
53,
113,
40029,
11558,
60,
402,
15424,
103,
4264,
59,
4670,
109,
53,
105,
18695,
59,
26069,
62,
53,
10640,
109,
53,
35955,
26264,
2499,
58,
1371,
92,
58,
113,
94,
56,
31679,
29691,
86,
375,
21201,
53,
81,
56,
87,
293,
5157,
54,
4112,
33600,
83,
3635,
110,
34343,
12779,
83,
23207,
111,
26036,
9755,
5121,
70,
56,
18871,
90,
58,
1212,
112,
55,
9116,
36978,
95,
1730,
58,
24805,
94,
55,
9116,
15578,
18036,
38056,
19511,
19511,
1212,
34031,
18871,
78,
56,
35443,
13199,
35443,
31846,
21841,
2151,
36497,
11521,
5422,
112,
57,
22347,
19511,
402,
54,
62,
107,
86,
11516,
46,
343,
657,
1850,
2689,
81,
705,
45,
4293,
51,
36511,
4923,
10900,
100,
631,
19598,
3359,
100,
2328,
42,
2152,
343,
657,
1848,
492,
303,
581,
4235,
112,
640,
1852,
112,
3261,
310,
461,
7911,
19598,
3359,
1852,
112,
51,
4179,
365,
419,
657,
333,
45,
333,
46,
419,
657,
16169,
45,
16169,
46,
419,
657,
2328,
45,
2328,
46,
419,
657,
6572,
45,
6572,
46,
419,
657,
10900,
10586,
2045,
45,
8472,
2045,
46,
419,
657,
41773,
1852,
2671,
45,
53,
51,
54,
46,
419,
657,
3749,
739,
45,
9981,
51,
14100,
45,
733,
1618,
6347,
51,
1740,
2229,
36606,
100,
85,
12305,
4311,
74,
49,
733,
1618,
6347,
51,
31493,
100,
85,
12305,
4311,
74,
49,
733,
1618,
6347,
51,
76,
9403,
737,
100,
85,
12305,
4311,
74,
419,
9671,
419,
657,
1848,
492,
303
] | 2,502,273,877,334,341,000
| true
| false
| false
| false
|
[
11521,
5422,
112,
57,
22347,
19511,
402,
54,
62,
107,
86,
11516,
46,
343,
657,
1850,
2689,
81,
705,
45,
4293,
51,
36511,
4923,
10900,
100,
631,
19598,
3359,
100,
2328,
42,
2152,
343,
657,
1848,
492,
303,
581,
4235,
112,
640,
1852,
112,
3261,
310,
461,
7911,
19598,
3359,
1852,
112,
51,
4179,
365,
419,
657,
333,
45,
333,
46,
419,
657,
16169,
45,
16169,
46,
419,
657,
2328,
45,
2328,
46,
419,
657,
6572,
45,
6572,
46,
419,
657,
10900,
10586,
2045,
45,
8472,
2045,
46,
419,
657,
41773,
1852,
2671,
45,
53,
51,
54,
46,
419,
657
] | 4,573,760,208,968,727,000
| true
|
= 50;
public GUIOptions guiOptions = GUIOptions.builder()
.slot(29)
.page(1)
.item(XMaterial.PLAYER_HEAD)
.texture("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWNiZDlmNWVjMWVkMDA3MjU5OTk2NDkxZTY5ZmY2NDlhMzEwNmNmOTIwMjI3YjFiYjNhNzFlZTdhODk4NjNmIn19fQ==")
.mainMenuLore(Collections.singletonList("%skill_refurbished_description%"))
.build();
public Perk getPerk(){
return RefurbishedPerk.builder()
.id(id)
.displayName(displayName)
.description(description)
.enabled(enabled)
.skillGUIOptions(guiOptions)
.chancePerLevel(0.1)
.
|
0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWNiZDlmNWVjMWVkMDA3MjU5OTk2NDkxZTY5ZmY2NDlhMzEwNmNmOTIwMjI3YjFiYjNhNzFlZTdhODk4NjNmIn19fQ==")
.mainMenuLore(Collections.singletonList("%skill_refurbished_description%"))
.build();
public Perk getPerk(){
return RefurbishedPerk.builder()
.id(id)
.displayName(displayName)
.description(description)
.enabled(enabled)
.skillGUIOptions(guiOptions)
.chancePerLevel(0.1)
.
|
leHR1cmUvNWNiZDlmNWVjMWVkMDA3MjU5OTk2NDkxZTY5ZmY2NDlhMzEwNmNmOTIwMjI3YjFiYjNhNzFlZTdhODk4NjNmIn19fQ==")
.mainMenuLore(Collections.singletonList("%skill_refurbished_description%"))
.build();
public Perk getPerk(){
return RefurbishedPerk.builder()
.id(id)
.displayName(displayName)
.description(description)
.enabled(enabled)
.skillGUIOptions(guiOptions)
.chancePerLevel(0.1)
.
|
dhODk4NjNmIn19fQ==")
.mainMenuLore(Collections.singletonList("%skill_refurbished_description%"))
.build();
public Perk getPerk(){
return RefurbishedPerk.builder()
.id(id)
.displayName(displayName)
.description(description)
.enabled(enabled)
.skillGUIOptions(guiOptions)
.chancePerLevel(0.1)
.
|
toolList(Arrays.asList(
XMaterial.DIAMOND_PICKAXE,
XMaterial.IRON_PICKAXE,
XMaterial.GOLDEN_PICKAXE
))
.build();
|
DialogDeviceLogsG1.java
|
/FileExtraction/Java_unseen/usnasoft_shellyscanner/src/main/java/it/usna/shellyscan/view/DialogDeviceLogsG1.java
|
package it.usna.shellyscan.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.KeyEvent;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.text.JTextComponent;
import it.usna.shellyscan.Main;
import it.usna.shellyscan.controller.UsnaAction;
import it.usna.shellyscan.model.Devices;
import it.usna.shellyscan.model.device.ShellyAbstractDevice;
import it.usna.shellyscan.model.device.ShellyAbstractDevice.Status;
import it.usna.shellyscan.view.util.UtilMiscellaneous;
import it.usna.swing.dialog.FindReplaceDialog;
public class DialogDeviceLogsG1 extends JDialog {
private static final long serialVersionUID = 1L;
private ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);;
public DialogDeviceLogsG1(final MainView owner, ShellyAbstractDevice device) {
super(owner, false);
setTitle(UtilMiscellaneous.getExtendedHostName(device));
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
this.setSize(530, 650);
setLocationRelativeTo(owner);
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
getContentPane().add(tabbedPane, BorderLayout.CENTER);
JPanel buttonsPanel = new JPanel();
getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
JButton btnRefresh = new JButton(new UsnaAction("labelRefresh", e -> {
int s = tabbedPane.getSelectedIndex();
fill(tabbedPane, device);
tabbedPane.setSelectedIndex(s);
}));
final Supplier<JTextComponent> ta = () -> (JTextComponent) ((JScrollPane) ((JPanel) tabbedPane.getSelectedComponent()).getComponent(0)).getViewport().getView();
final Action findAction = new UsnaAction("btnFind", e -> {
FindReplaceDialog f = new FindReplaceDialog(DialogDeviceLogsG1.this, ta, false);
f.setLocationRelativeTo(DialogDeviceLogsG1.this);
f.setVisible(true);
});
JButton jButtonFind = new JButton(findAction);
jButtonFind.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_F, MainView.SHORTCUT_KEY), "find_act");
jButtonFind.getActionMap().put("find_act", findAction);
JButton jButtonCopyAll = new JButton(new UsnaAction("btnCopyAll", e -> {
final String cp = ta.get().getText();
if (cp != null && cp.length() > 0) {
final Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection selection = new StringSelection(cp);
cb.setContents(selection, selection);
}
}));
JButton jButtonClose = new JButton(new UsnaAction("dlgClose", e -> dispose()));
buttonsPanel.add(btnRefresh);
buttonsPanel.add(jButtonFind);
buttonsPanel.add(jButtonCopyAll);
buttonsPanel.add(jButtonClose);
setVisible(true);
fill(tabbedPane, device);
}
private void fill(JTabbedPane tabbedPane, ShellyAbstractDevice device) {
tabbedPane.removeAll();
tabbedPane.add("debug/log", getPlainPanel("/debug/log", device));
tabbedPane.add("debug/log1", getPlainPanel("/debug/log1", device));
}
private JPanel getPlainPanel(String info, ShellyAbstractDevice device) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout(0, 0));
JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setForeground(Color.BLUE);
textArea.setText(Main.LABELS.getString("lblLoading"));
panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
executor.schedule(() -> {
try {
if (Thread.interrupted() == false) {
textArea.setForeground(Color.BLACK);
String log = device.httpGetAsString(info);
textArea.setText(log);
textArea.setCaretPosition(0);
}
} catch (Exception e) {
if (Thread.interrupted() == false) {
String msg;
if (device.getStatus() == Status.OFF_LINE) {
msg = "<" + Main.LABELS.getString("Status-OFFLINE") + ">";
} else if (device.getStatus() == Status.NOT_LOOGGED) {
msg = "<" + Main.LABELS.getString("Status-PROTECTED") + ">";
} else {
msg = e.getMessage();
}
textArea.setText(msg);
}
}
panel.setCursor(Cursor.getDefaultCursor());
}, Devices.MULTI_QUERY_DELAY, TimeUnit.MILLISECONDS);
JScrollPane scrollPane = new JScrollPane(textArea);
panel.add(scrollPane);
return panel;
}
@Override
public void dispose() {
executor.shutdownNow();
super.dispose();
}
}
| 4,897
|
Java
|
.java
|
usnasoft/shellyscanner
| 27
| 5
| 0
|
2022-10-13T11:39:10Z
|
2024-05-08T17:11:33Z
|
86751c13325fb8d64457d30cb2452edbeb5c8296c6f50bbd482d450cced6e6dd
|
[] |
[
1337,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1090,
64,
222,
222,
485,
1401,
51,
8236,
51,
7263,
2362,
64,
222,
485,
1401,
51,
8236,
51,
1530,
64,
222,
485,
1401,
51,
8236,
51,
7424,
64,
222,
485,
1401,
51,
8236,
51,
24291,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
25946,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
671,
5385,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
26082,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
38628,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
18382,
25815,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
27785,
64,
222,
485,
1401,
51,
1058,
51,
1144,
51,
17612,
64,
222,
222,
485,
3698,
51,
5934,
51,
1728,
64,
222,
485,
3698,
51,
5934,
51,
32880,
64,
222,
485,
3698,
51,
5934,
51,
79,
1735,
64,
222,
485,
3698,
51,
5934,
51,
79,
3742,
64,
222,
485,
3698,
51,
5934,
51,
32273,
64,
222,
485,
3698,
51,
5934,
51,
79,
29314,
64,
222,
485,
3698,
51,
5934,
51,
79,
41486,
7586,
64,
222,
485,
3698,
51,
5934,
51,
79,
26974,
64,
222,
485,
3698,
51,
5934,
51,
48342,
64,
222,
485,
3698,
51,
5934,
51,
897,
51,
79,
1049,
1735,
64,
222,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4370,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4641,
51,
2352,
3288,
1728,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
12184,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
2949,
51,
7171,
126,
5597,
3046,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
2949,
51,
7171,
126,
5597,
3046,
51,
1551,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1090,
51,
1058,
51,
1747,
6424,
36758,
64,
222,
485,
580,
51,
371,
3288,
51,
5934,
51,
5962,
51,
4882,
9395,
3742,
64,
222,
222,
942,
462,
13695,
3046,
13359,
76,
54,
2041,
990,
3742,
320,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
222,
221,
2072,
42459,
25815,
13915,
299,
6798,
21770,
51,
909,
18382,
19370,
45,
55,
312,
64,
499,
221,
942,
13695,
3046,
13359,
76,
54,
45,
3242,
6697,
1089,
7431,
49,
20418,
126,
5597,
3046,
3313,
46,
320,
376,
221,
5282,
45,
5645,
49,
920,
312,
376,
221,
17359,
45,
1747,
6424,
36758,
51,
390,
14856,
33022,
45,
2949,
894,
376,
221,
27356,
4187,
3786,
45,
79,
3742,
51,
5988,
6856,
100,
586,
100,
18758,
312,
376,
221,
597,
51,
29572,
45,
58,
56,
53,
49,
244,
59,
58,
53,
312,
376,
221,
35853,
11776,
724,
45,
5645,
312,
1332,
221,
79,
41486,
7586,
4890,
3036,
7586,
299,
556,
990,
41486,
7586,
45,
79,
41486,
7586,
51,
9526,
312,
376,
221,
16618,
7586,
941,
688,
45,
3019,
3036,
7586,
49,
38816,
51,
16562,
312,
1332,
221,
32273,
12033,
3686,
299,
556,
22299,
492,
376,
221,
16618,
7586,
941,
688,
45,
11432,
3686,
49,
38816,
51,
3644,
5938,
312,
1332,
221,
32880,
3158,
9104,
299,
556,
24328,
45,
909,
6163,
3288,
1728,
459,
1194,
9104,
411,
503,
984,
320,
374,
221,
429,
328,
299,
4890,
3036,
7586,
51,
21851,
1301,
492,
374,
221,
4182,
45,
3019,
3036,
7586,
49,
3313,
312,
374,
221,
3019,
3036,
7586,
51,
26623,
1301,
45,
120,
312,
376,
221,
18275,
1332,
221,
3242,
34549,
65,
79,
1049,
1735,
67,
17397,
299,
1423,
984,
327,
79,
1049,
1735,
46,
1849,
79,
29314,
46,
1849,
32273,
46,
4890,
3036,
7586,
51,
21851,
1735,
4269,
23441,
45,
53,
3445,
390,
16659,
941,
28987,
492,
376,
221,
3242,
5255,
2309,
1728,
299,
556,
6163,
3288,
1728,
459,
2578,
4882,
411,
503,
984,
320,
374,
221,
4882,
9395,
3742,
315,
299,
556,
7499,
9395,
3742,
45,
3742,
3046,
13359,
76,
54,
51,
597,
49,
17397,
49,
920,
312,
374,
221,
107,
51,
35853,
11776,
724,
45,
3742,
3046,
13359,
76,
54,
51,
597,
312,
374,
221,
107,
51,
18215,
45,
1527,
312,
376,
221,
1933,
1332,
221,
32880,
35102,
4882,
299,
556,
24328,
45,
1828,
1728,
312,
376,
221,
21171,
4882,
51,
29613,
1225,
45,
79,
1735,
51,
5886,
100,
540,
100,
36035,
9211,
100,
18393,
566,
543,
45,
48342,
51,
11728,
14212,
45,
26082,
51,
13177,
100,
75,
49,
6697,
1089,
51,
15448,
41382,
100,
3319,
490,
332,
1828,
100,
555,
742,
376,
221,
21171,
4882,
51,
28103,
1225,
941,
543,
459,
1828,
100,
555,
411,
2309,
1728,
312,
1332,
221,
32880,
35102,
4014,
1947,
299,
556,
24328,
45,
909,
6163,
3288,
1728,
459,
2578,
4014,
1947,
411,
503,
984,
320,
374,
221,
3242,
910,
9210,
299,
17397,
51,
390,
941,
10624,
492,
374,
221,
344,
327,
2217,
882,
762,
979,
9210,
51,
1340,
365,
868,
244,
53,
46,
320,
621,
221,
3242,
28706,
2207,
6603,
299,
34045,
51,
13729,
24291,
941,
29967,
25946,
492,
621,
221,
671,
5385,
7818,
299,
556,
910,
5385,
45,
2217,
312,
621,
221,
2519,
51,
489,
8048,
45,
8402,
49,
7818,
312,
374,
221,
130,
376,
221,
18275,
1332,
221,
32880,
35102,
4187,
299,
556,
24328,
45,
909,
6163,
3288,
1728,
459,
30086,
4187,
411,
503,
984,
27131,
5086,
1332,
221,
11432,
3686,
51,
688,
45,
2578,
9104,
312,
376,
221,
11432,
3686,
51,
688,
45,
21171,
4882,
312,
376,
221,
11432,
3686,
51,
688,
45,
21171,
4014,
1947,
312,
376,
221,
11432,
3686,
51,
688,
45,
21171,
4187,
312,
1332,
221,
18215,
45,
1527,
312,
376,
221,
4182,
45,
3019,
3036,
7586,
49,
3313,
312,
222,
221,
130,
499,
221,
2072,
782,
5342,
45,
79,
41486,
7586,
4890,
3036,
7586,
49,
20418,
126,
5597,
3046,
3313,
46,
320,
376,
221,
3019,
3036,
7586,
51,
28768,
492,
376,
221,
3019,
3036,
7586,
51,
688,
459,
2824,
52,
769,
411,
640,
18707,
3686,
4229,
2824,
52,
769,
411,
3313,
894,
376,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
485,
1401,
51,
8236,
51,
24291,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
25946,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
671,
5385,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
26082,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
38628,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
18382,
25815,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
27785,
64,
222,
485,
1401,
51,
1058,
51,
1144,
51,
17612,
64,
222,
222,
485,
3698,
51,
5934,
51,
1728,
64,
222,
485,
3698,
51,
5934,
51,
32880,
64,
222,
485,
3698,
51,
5934,
51,
79,
1735,
64,
222,
485,
3698,
51,
5934,
51,
79,
3742,
64,
222,
485,
3698,
51,
5934,
51,
32273,
64,
222,
485,
3698,
51,
5934,
51,
79,
29314,
64,
222,
485,
3698,
51,
5934,
51,
79,
41486,
7586,
64,
222,
485,
3698,
51,
5934,
51,
79,
26974,
64,
222,
485,
3698,
51,
5934,
51,
48342,
64,
222,
485,
3698,
51,
5934,
51,
897,
51,
79,
1049,
1735,
64,
222,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4370,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4641,
51,
2352,
3288,
1728,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
12184,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
2949,
51,
7171,
126,
5597,
3046,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
2949,
51,
7171,
126,
5597,
3046,
51,
1551,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1090,
51,
1058,
51,
1747,
6424,
36758,
64,
222,
485,
580,
51,
371,
3288,
51,
5934,
51,
5962,
51,
4882,
9395,
3742,
64,
222,
222,
942
] | 4,971,253,884,647,211,000
| true
| false
| false
| false
|
[
5934,
51,
79,
26974,
64,
222,
485,
3698,
51,
5934,
51,
48342,
64,
222,
485,
3698,
51,
5934,
51,
897,
51,
79,
1049,
1735,
64,
222,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4370,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
4641,
51,
2352,
3288,
1728,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
12184,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126,
6987,
51,
1184,
51,
2949,
51,
7171,
126,
5597,
3046,
64,
222,
485,
580,
51,
371,
3288,
51,
7890,
126
] | 1,125,089,801,820,995,200
| true
|
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.KeyEvent;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.text.JTextComponent;
import it.usna.shellyscan.Main;
import it.usna.shellyscan.controller.UsnaAction;
import it.usna.shellyscan.model.Devices;
import it.usna.shellyscan.model.device.ShellyAbstractDevice;
import it.usna.shelly
|
.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.text.JTextComponent;
import it.usna.shellyscan.Main;
import it.usna.shellyscan.controller.UsnaAction;
import it.usna.shellyscan.model.Devices;
import it.usna.shellyscan.model.device.ShellyAbstractDevice;
import it.usna.shelly
|
;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.text.JTextComponent;
import it.usna.shellyscan.Main;
import it.usna.shellyscan.controller.UsnaAction;
import it.usna.shellyscan.model.Devices;
import it.usna.shellyscan.model.device.ShellyAbstractDevice;
import it.usna.shelly
|
swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.text.JTextComponent;
import it.usna.shellyscan.Main;
import it.usna.shellyscan.controller.UsnaAction;
import it.usna.shellyscan.model.Devices;
import it.usna.shellyscan.model.device.ShellyAbstractDevice;
import it.usna.shelly
|
scan.model.device.ShellyAbstractDevice.Status;
import it.usna.shellyscan.view.util.UtilMiscellaneous;
import it.usna.swing.dialog.FindReplaceDialog;
public
|
YearMonthAndAutoIncrementPolicy.java
|
/FileExtraction/Java_unseen/neatlogic_neatlogic-itsm/src/main/java/neatlogic/module/process/processtaskserialnumberpolicy/handler/YearMonthAndAutoIncrementPolicy.java
|
/*Copyright (C) 2024 深圳极向量科技有限公司 All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.*/
package neatlogic.module.process.processtaskserialnumberpolicy.handler;
import neatlogic.framework.asynchronization.threadlocal.TenantContext;
import neatlogic.framework.process.dto.ProcessTaskSerialNumberPolicyVo;
import neatlogic.framework.process.processtaskserialnumberpolicy.core.IProcessTaskSerialNumberPolicyHandler;
import neatlogic.framework.scheduler.core.JobBase;
import neatlogic.framework.scheduler.dto.JobObject;
import neatlogic.module.process.service.ProcessTaskSerialNumberService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.quartz.CronExpression;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters;
import java.util.Date;
@Service
public class YearMonthAndAutoIncrementPolicy implements IProcessTaskSerialNumberPolicyHandler {
private Logger logger = LoggerFactory.getLogger(YearMonthAndAutoIncrementPolicy.class);
@Resource
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getName() {
return "年月 + 自增序列";
}
@SuppressWarnings("serial")
@Override
public JSONArray makeupFormAttributeList() {
return processTaskSerialNumberService.makeupFormAttributeList(10, 16);
}
@Override
public JSONObject makeupConfig(JSONObject jsonObj) {
return processTaskSerialNumberService.makeupConfig(jsonObj, 6);
}
@Override
public String genarate(String channelTypeUuid) {
return processTaskSerialNumberService.genarate(channelTypeUuid, new SimpleDateFormat("yyyyMM"));
}
@Override
public int batchUpdateHistoryProcessTask(ProcessTaskSerialNumberPolicyVo processTaskSerialNumberPolicyVo) {
return processTaskSerialNumberService.batchUpdateHistoryProcessTask(processTaskSerialNumberPolicyVo, new SimpleDateFormat("yyyyMM"));
}
@Override
public Long calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(ProcessTaskSerialNumberPolicyVo processTaskSerialNumberPolicyVo) {
return processTaskSerialNumberService.calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(processTaskSerialNumberPolicyVo, true, Date.from(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay(ZoneId.systemDefault()).toInstant()));
}
@Component
@DisallowConcurrentExecution
private static class ProcessTaskSerialNumberSeedResetJob extends JobBase {
private String cron = "0 0 0 1 * ?"; // 每月1日0时0分0秒
@Autowired
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getGroupName() {
return TenantContext.get().getTenantUuid() + "-PROCESSTASK-SERIALNUMBERSEED-" + YearMonthAndAutoIncrementPolicy.class.getSimpleName() + "-RESET";
}
@Override
public Boolean isMyHealthy(JobObject jobObject) {
return true;
}
@Override
public void reloadJob(JobObject jobObject) {
String tenantUuid = jobObject.getTenantUuid();
TenantContext.get().switchTenant(tenantUuid);
if (CronExpression.isValidExpression(cron)) {
JobObject.Builder newJobObjectBuilder =
new JobObject.Builder(jobObject.getJobName(), this.getGroupName(), this.getClassName(),
TenantContext.get().getTenantUuid()).withCron(cron);
JobObject newJobObject = newJobObjectBuilder.build();
schedulerManager.loadJob(newJobObject);
}
}
@Override
public void initJob(String tenantUuid) {
JobObject.Builder jobObjectBuilder = new JobObject.Builder(
this.getGroupName(),
this.getGroupName(),
this.getClassName(),
TenantContext.get().getTenantUuid());
JobObject jobObject = jobObjectBuilder.build();
this.reloadJob(jobObject);
}
@Override
public void executeInternal(JobExecutionContext context, JobObject jobObject) throws JobExecutionException {
processTaskSerialNumberService.serialNumberSeedReset(YearMonthAndAutoIncrementPolicy.class.getName());
}
}
}
| 5,441
|
Java
|
.java
|
neatlogic/neatlogic-itsm
| 28
| 6
| 2
|
2023-02-01T07:57:39Z
|
2024-05-09T07:32:15Z
|
1eb8342777d43afe5a424ffb1f071bcbd2eaf44745260d5fb83da929f9d51217
|
[] |
[
1127,
10585,
327,
72,
46,
244,
55,
53,
55,
57,
244,
29105,
147,
2267,
149,
34324,
10393,
6975,
23732,
17046,
3052,
10975,
24853,
3381,
12902,
11921,
51,
222,
222,
2287,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
302,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
9582,
829,
222,
1402,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
45,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
222,
2287,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
717,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
22265,
7760,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
21307,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
222,
4296,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
40307,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
1975,
222,
222,
1337,
1188,
288,
4566,
51,
1663,
51,
2441,
51,
41027,
289,
933,
3557,
2188,
6060,
51,
4543,
64,
222,
222,
485,
1188,
288,
4566,
51,
2863,
51,
321,
4852,
1668,
51,
3442,
1717,
51,
16885,
1237,
64,
222,
485,
1188,
288,
4566,
51,
2863,
51,
2441,
51,
12292,
51,
2877,
2265,
43553,
4263,
12536,
64,
222,
485,
1188,
288,
4566,
51,
2863,
51,
2441,
51,
41027,
289,
933,
3557,
2188,
6060,
51,
1284,
51,
78,
2877,
2265,
43553,
4263,
1985,
64,
222,
485,
1188,
288,
4566,
51,
2863,
51,
13273,
51,
1284,
51,
3798,
1778,
64,
222,
485,
1188,
288,
4566,
51,
2863,
51,
13273,
51,
12292,
51,
3798,
976,
64,
222,
485,
1188,
288,
4566,
51,
1663,
51,
2441,
51,
2140,
51,
2877,
2265,
43553,
1201,
64,
222,
485,
785,
51,
23384,
51,
46768,
51,
27698,
64,
222,
485,
785,
51,
23384,
51,
46768,
51,
15543,
64,
222,
485,
1105,
51,
40872,
51,
29392,
3503,
64,
222,
485,
1105,
51,
40872,
51,
1744,
4582,
18705,
6141,
64,
222,
485,
1105,
51,
40872,
51,
3798,
18304,
64,
222,
485,
1105,
51,
40872,
51,
3798,
32510,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
485,
1105,
51,
4140,
51,
9580,
51,
5802,
51,
4341,
51,
10789,
64,
222,
485,
1105,
51,
4140,
51,
19017,
51,
1735,
64,
222,
485,
1105,
51,
4140,
51,
19017,
51,
1201,
64,
222,
222,
485,
3698,
51,
4341,
51,
2305,
64,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1021,
51,
28688,
64,
222,
485,
1401,
51,
1021,
51,
6778,
625,
64,
222,
485,
1401,
51,
1021,
51,
34616,
51,
30898,
15049,
502,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
222,
69,
1201,
222,
942,
462,
18531,
7367,
2199,
4754,
13814,
4263,
4584,
457,
2877,
2265,
43553,
4263,
1985,
320,
303,
964,
7145,
4101,
299,
21818,
51,
10588,
45,
6633,
7367,
2199,
4754,
13814,
4263,
51,
842,
312,
465,
496,
2305,
303,
964,
6849,
2265,
43553,
1201,
2183,
2265,
43553,
1201,
64,
465,
496,
1806,
303,
581,
910,
16389,
365,
320,
310,
461,
332,
8138,
10175,
494,
244,
5933,
13891,
27296,
884,
303,
339,
465,
496,
14030,
459,
3557,
678,
303,
496,
1806,
303,
581,
34933,
1949,
436,
1260,
2230,
739,
365,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
2696,
436,
1260,
2230,
739,
45,
54,
53,
49,
244,
54,
59,
312,
303,
339,
465,
496,
1806,
303,
581,
15439,
1949,
436,
1081,
45,
15543,
2379,
3287,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
2696,
436,
1081,
45,
1279,
3287,
49,
244,
59,
312,
303,
339,
465,
496,
1806,
303,
581,
910,
4515,
301,
351,
45,
671,
3842,
638,
15291,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
2536,
301,
351,
45,
3253,
638,
15291,
49,
556,
27194,
459,
12727,
2842,
2992,
303,
339,
465,
496,
1806,
303,
581,
648,
5334,
2346,
6713,
2877,
2265,
45,
2877,
2265,
43553,
4263,
12536,
2183,
2265,
43553,
4263,
12536,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
4476,
2346,
6713,
2877,
2265,
45,
2441,
2265,
43553,
4263,
12536,
49,
556,
27194,
459,
12727,
2842,
2992,
303,
339,
4054,
496,
1806,
303,
581,
6374,
9226,
43553,
11483,
5131,
6554,
2346,
6713,
2877,
2265,
45,
2877,
2265,
43553,
4263,
12536,
2183,
2265,
43553,
4263,
12536,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
13000,
43553,
11483,
5131,
6554,
2346,
6713,
2877,
2265,
45,
2441,
2265,
43553,
4263,
12536,
49,
878,
49,
2833,
51,
1097,
45,
28688,
51,
2192,
941,
1814,
45,
30898,
15049,
502,
51,
2251,
6303,
38335,
4269,
288,
2148,
38085,
45,
6778,
625,
51,
2964,
2061,
4269,
471,
22154,
5086,
303,
339,
465,
496,
1735,
303,
496,
1744,
4582,
18705,
6141,
303,
964,
924,
462,
6849,
2265,
43553,
11483,
7334,
3798,
2041,
9216,
1778,
320,
603,
964,
910,
28477,
299,
332,
53,
244,
53,
244,
53,
244,
54,
338,
1037,
884,
453,
40924,
10175,
54,
6640,
53,
3616,
53,
4519,
53,
22874,
603,
496,
10789,
310,
964,
6849,
2265,
43553,
1201,
2183,
2265,
43553,
1201,
64,
603,
496,
1806,
310,
581,
910,
640,
11826,
365,
320,
343,
461,
38330,
1237,
51,
390,
941,
390,
16885,
15291,
365,
494,
4840,
10822,
959,
654,
5159,
50,
16423,
10468,
36696,
22441,
494,
18531,
7367,
2199,
4754,
13814,
4263,
51,
842,
51,
26999,
365,
494,
4840,
13879,
884,
310,
339,
603,
496,
1806,
310,
581,
5080,
458,
3781,
10038,
126,
45,
3798,
976,
4012,
976,
46,
320,
343,
461,
878,
64,
310,
339,
603,
496,
1806,
310,
581,
782,
17074,
3798,
45,
3798,
976,
4012,
976,
46,
320,
343,
910,
17068,
15291,
299,
4012,
976,
51,
390,
16885,
15291,
492,
343,
38330,
1237,
51,
390,
941,
4651,
16885,
45,
15198,
15291,
312,
343,
434,
327,
29392,
3503,
51,
13431,
3503,
45,
20506,
509,
320,
419,
9216,
976,
51,
1812,
556,
3798,
976,
1812,
299,
733,
556,
9216,
976,
51,
1812,
45,
3267,
976,
51,
390,
3798,
577,
1046,
477,
51,
390,
11826,
1046,
477,
51,
390,
8478,
1046,
1396,
38330,
1237,
51,
390,
941,
390,
16885,
15291
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
556,
27194,
459,
12727,
2842,
2992,
303,
339,
465,
496,
1806,
303,
581,
648,
5334,
2346,
6713,
2877,
2265,
45,
2877,
2265,
43553,
4263,
12536,
2183,
2265,
43553,
4263,
12536,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
4476,
2346,
6713,
2877,
2265,
45,
2441,
2265,
43553,
4263,
12536,
49,
556,
27194,
459,
12727,
2842,
2992,
303,
339,
4054,
496,
1806,
303,
581,
6374,
9226,
43553,
11483,
5131,
6554,
2346,
6713,
2877,
2265,
45,
2877,
2265,
43553,
4263,
12536,
2183,
2265,
43553,
4263,
12536,
46,
320,
310,
461,
2183,
2265,
43553,
1201,
51,
13000,
43553,
11483,
5131,
6554,
2346,
6713,
2877,
2265,
45,
2441,
2265,
43553,
4263,
12536,
49,
878,
49,
2833,
51,
1097,
45,
28688,
51,
2192,
941,
1814,
45,
30898,
15049,
502,
51,
2251,
6303,
38335,
4269,
288,
2148,
38085,
45,
6778,
625,
51,
2964,
2061,
4269,
471,
22154,
5086,
303,
339,
465,
496,
1735,
303,
496,
1744,
4582,
18705,
6141,
303,
964,
924,
462,
6849,
2265,
43553,
11483,
7334,
3798,
2041,
9216,
1778,
320,
603,
964,
910,
28477,
299,
332,
53,
244,
53,
244,
53,
244,
54,
338,
1037,
884,
453,
40924,
10175,
54,
6640,
53,
3616,
53,
4519,
53,
22874,
603,
496,
10789,
310,
964,
6849,
2265,
43553,
1201,
2183,
2265,
43553,
1201,
64,
603,
496,
1806,
310,
581,
910,
640,
11826,
365,
320,
343,
461,
38330,
1237,
51,
390,
941,
390,
16885,
15291,
365,
494,
4840,
10822,
959,
654,
5159,
50,
16423,
10468,
36696,
22441,
494,
18531,
7367,
2199,
4754,
13814,
4263,
51,
842,
51,
26999,
365,
494,
4840,
13879,
884,
310,
339,
603,
496,
1806,
310,
581,
5080,
458,
3781,
10038,
126,
45,
3798,
976,
4012,
976,
46,
320,
343,
461,
878,
64,
310,
339,
603,
496,
1806,
310,
581,
782,
17074,
3798,
45,
3798,
976,
4012,
976,
46,
320,
343,
910,
17068
] | 296,487,383,822,393,600
| true
| false
| false
| false
|
[
1744,
4582,
18705,
6141,
303,
964,
924,
462,
6849,
2265,
43553,
11483,
7334,
3798,
2041,
9216,
1778,
320,
603,
964,
910,
28477,
299,
332,
53,
244,
53,
244,
53,
244,
54,
338,
1037,
884,
453,
40924,
10175,
54,
6640,
53,
3616,
53,
4519,
53,
22874,
603,
496,
10789,
310,
964,
6849,
2265,
43553,
1201,
2183,
2265,
43553,
1201,
64,
603,
496,
1806,
310,
581,
910,
640,
11826,
365,
320,
343,
461,
38330,
1237,
51,
390,
941,
390,
16885,
15291,
365,
494,
4840,
10822,
959,
654,
5159,
50,
16423,
10468,
36696,
22441,
494,
18531,
7367,
2199,
4754,
13814,
4263,
51,
842
] | 545,395,341,195,730,240
| true
|
new SimpleDateFormat("yyyyMM"));
}
@Override
public int batchUpdateHistoryProcessTask(ProcessTaskSerialNumberPolicyVo processTaskSerialNumberPolicyVo) {
return processTaskSerialNumberService.batchUpdateHistoryProcessTask(processTaskSerialNumberPolicyVo, new SimpleDateFormat("yyyyMM"));
}
@Override
public Long calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(ProcessTaskSerialNumberPolicyVo processTaskSerialNumberPolicyVo) {
return processTaskSerialNumberService.calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(processTaskSerialNumberPolicyVo, true, Date.from(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay(ZoneId.systemDefault()).toInstant()));
}
@Component
@DisallowConcurrentExecution
private static class ProcessTaskSerialNumberSeedResetJob extends JobBase {
private String cron = "0 0 0 1 *?"; // 每月1日0时0分0秒
@Autowired
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getGroupName() {
return TenantContext.get().getTenantUuid() + "-PROCESSTASK-SERIALNUMBERSEED-" + YearMonthAndAutoIncrementPolicy.class
|
, new SimpleDateFormat("yyyyMM"));
}
@Override
public Long calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(ProcessTaskSerialNumberPolicyVo processTaskSerialNumberPolicyVo) {
return processTaskSerialNumberService.calculateSerialNumberSeedAfterBatchUpdateHistoryProcessTask(processTaskSerialNumberPolicyVo, true, Date.from(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay(ZoneId.systemDefault()).toInstant()));
}
@Component
@DisallowConcurrentExecution
private static class ProcessTaskSerialNumberSeedResetJob extends JobBase {
private String cron = "0 0 0 1 *?"; // 每月1日0时0分0秒
@Autowired
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getGroupName() {
return TenantContext.get().getTenantUuid() + "-PROCESSTASK-SERIALNUMBERSEED-" + YearMonthAndAutoIncrementPolicy.class
|
HistoryProcessTask(processTaskSerialNumberPolicyVo, true, Date.from(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()).atStartOfDay(ZoneId.systemDefault()).toInstant()));
}
@Component
@DisallowConcurrentExecution
private static class ProcessTaskSerialNumberSeedResetJob extends JobBase {
private String cron = "0 0 0 1 *?"; // 每月1日0时0分0秒
@Autowired
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getGroupName() {
return TenantContext.get().getTenantUuid() + "-PROCESSTASK-SERIALNUMBERSEED-" + YearMonthAndAutoIncrementPolicy.class
|
DisallowConcurrentExecution
private static class ProcessTaskSerialNumberSeedResetJob extends JobBase {
private String cron = "0 0 0 1 *?"; // 每月1日0时0分0秒
@Autowired
private ProcessTaskSerialNumberService processTaskSerialNumberService;
@Override
public String getGroupName() {
return TenantContext.get().getTenantUuid() + "-PROCESSTASK-SERIALNUMBERSEED-" + YearMonthAndAutoIncrementPolicy.class
|
.getSimpleName() + "-RESET";
}
@Override
public Boolean isMyHealthy(JobObject jobObject) {
return true;
}
@Override
public void reloadJob(JobObject jobObject) {
String tenant
|
DropwizardServerExtension.java
|
/FileExtraction/Java_unseen/triplea-game_triplea/spitfire-server/dropwizard-server/src/test/java/org/triplea/spitfire/server/DropwizardServerExtension.java
|
package org.triplea.spitfire.server;
import com.google.common.base.Preconditions;
import io.dropwizard.Configuration;
import io.dropwizard.testing.DropwizardTestSupport;
import java.net.URI;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.ParameterResolver;
/**
* Extension to start a dropwizard server. This extension can read the 'configuration.yml' of the
* server which allows access to database connectivity parameters. Tests can have several objects
* injected into them by declaring those objects as constructor or test method parameters. Those
* objects are:
*
* <ul>
* <li>URI - server URI of the running test server
* <li>JDBI - jdbi instance
* <li>JDBI on-demand class - any class (DAO classes) that can be instantiated via
* Jdbi.onDemand(Class)
* <li>Server Configuration - the configuration class of the dropwizard server
* </ul>
*
* @param <C> Server configuration type.
*/
public abstract class DropwizardServerExtension<C extends Configuration>
implements BeforeAllCallback, ParameterResolver {
private static URI serverUri;
/**
* Implementations should return a *static* instance of DropwizardTestSupport. If returning a
* local instance, the test server may be turned off after a single test class is done executing
* and subsequent tests could fail due to server not being on. Example implementation
*
* <pre>{@code
* @Getter
* static DropwizardTestSupport<MapsConfig> testSupport =
* new DropwizardTestSupport<>(MapsServer.class, "configuration.yml")
* }</pre>
*/
protected abstract DropwizardTestSupport<C> getSupport();
@Override
public void beforeAll(final ExtensionContext context) throws Exception {
final DropwizardTestSupport<C> support = getSupport();
support.before();
final String localUri = "http://localhost:" + support.getLocalPort();
serverUri = URI.create(localUri);
}
@Override
public boolean supportsParameter(
final ParameterContext parameterContext, final ExtensionContext extensionContext)
throws ParameterResolutionException {
return parameterContext.getParameter().getType().equals(URI.class)
|| parameterContext
.getParameter()
.getType()
.equals(getSupport().getConfiguration().getClass());
}
@Override
public Object resolveParameter(
final ParameterContext parameterContext, final ExtensionContext extensionContext)
throws ParameterResolutionException {
if (parameterContext.getParameter().getType().equals(URI.class)) {
return Preconditions.checkNotNull(serverUri);
} else {
return getSupport().getConfiguration();
}
}
}
| 2,909
|
Java
|
.java
|
triplea-game/triplea
| 1,269
| 375
| 581
|
2015-07-27T09:32:58Z
|
2024-05-08T16:58:30Z
|
2947b4e0512677ae053344d754642f6017f08e5655ea560bd64b51aa54b2f63b
|
[] |
[
1337,
1105,
51,
31220,
102,
51,
438,
302,
5734,
51,
1805,
64,
222,
222,
485,
785,
51,
2193,
51,
2297,
51,
1460,
51,
36329,
64,
222,
485,
3377,
51,
3850,
21862,
51,
2339,
64,
222,
485,
3377,
51,
3850,
21862,
51,
4280,
51,
6260,
21862,
1024,
4417,
64,
222,
485,
1401,
51,
1317,
51,
6344,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
6749,
51,
5670,
1947,
3309,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
6749,
51,
4823,
1237,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
6749,
51,
3026,
1237,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
6749,
51,
3026,
13288,
1002,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
6749,
51,
3026,
7266,
64,
222,
222,
1350,
222,
338,
15354,
391,
1496,
331,
6310,
21862,
2160,
51,
1369,
5122,
902,
1511,
341,
349,
5990,
51,
7083,
44,
451,
341,
222,
338,
2160,
1532,
6990,
2872,
391,
3520,
27950,
3406,
51,
11399,
902,
1178,
10241,
4706,
222,
338,
33698,
2012,
3049,
829,
40150,
5543,
4706,
641,
4389,
575,
913,
1431,
3406,
51,
37827,
222,
338,
4706,
904,
63,
222,
338,
222,
338,
350,
357,
67,
222,
338,
280,
350,
393,
67,
6344,
449,
2160,
7417,
451,
341,
3991,
913,
2160,
222,
338,
280,
350,
393,
67,
79,
2015,
78,
449,
614,
1219,
110,
1998,
222,
338,
280,
350,
393,
67,
79,
2015,
78,
563,
50,
28116,
462,
449,
1364,
462,
327,
12909,
6052,
46,
708,
902,
545,
30949,
4745,
222,
338,
981,
990,
1219,
110,
51,
286,
31437,
45,
1359,
46,
222,
338,
280,
350,
393,
67,
2077,
8149,
449,
341,
3505,
462,
451,
341,
6310,
21862,
2160,
222,
338,
594,
357,
67,
222,
338,
222,
338,
496,
772,
350,
72,
67,
4242,
3505,
847,
51,
222,
588,
222,
942,
5560,
462,
14204,
21862,
2077,
4823,
65,
72,
2041,
8149,
67,
303,
4584,
16946,
1947,
3309,
49,
10922,
7266,
320,
736,
964,
924,
7417,
2160,
5729,
64,
736,
1041,
682,
338,
10135,
1014,
1414,
461,
331,
338,
1592,
47,
1998,
451,
14204,
21862,
1024,
4417,
51,
1691,
14122,
331,
682,
338,
2212,
1998,
49,
341,
913,
2160,
1648,
545,
21182,
2143,
2703,
331,
4005,
913,
462,
458,
3412,
16952,
682,
338,
480,
16498,
3326,
3087,
3562,
7278,
391,
2160,
666,
4019,
563,
51,
5958,
4753,
682,
338,
682,
338,
350,
1023,
19338,
707,
682,
338,
496,
11722,
682,
338,
924,
14204,
21862,
1024,
4417,
65,
15938,
1081,
67,
913,
4417,
299,
682,
338,
280,
556,
14204,
21862,
1024,
4417,
11530,
15938,
2077,
51,
842,
49,
332,
5990,
51,
7083,
678,
682,
338,
24681,
1023,
67,
682,
588,
353,
2532,
5560,
14204,
21862,
1024,
4417,
65,
72,
67,
640,
4417,
492,
736,
496,
1806,
353,
581,
782,
2688,
1947,
45,
3242,
15354,
1237,
1637,
46,
2589,
3284,
320,
303,
1175,
14204,
21862,
1024,
4417,
65,
72,
67,
2208,
299,
640,
4417,
492,
303,
2208,
51,
5566,
492,
465,
1175,
910,
2212,
5729,
299,
332,
544,
574,
5112,
1941,
494,
2208,
51,
29172,
3451,
492,
303,
2160,
5729,
299,
7417,
51,
1315,
45,
1717,
5729,
312,
353,
339,
736,
496,
1806,
353,
581,
1922,
9568,
3026,
45,
416,
1175,
10922,
1237,
3416,
1237,
49,
1175,
15354,
1237,
5122,
1237,
46,
416,
2589,
10922,
13288,
1002,
320,
303,
461,
3416,
1237,
51,
17745,
941,
10276,
941,
3591,
45,
6344,
51,
842,
46,
310,
1293,
3416,
1237,
343,
657,
17745,
365,
343,
657,
10276,
365,
343,
657,
3591,
45,
390,
4417,
941,
38309,
941,
9699,
1052,
353,
339,
736,
496,
1806,
353,
581,
2210,
5895,
3026,
45,
416,
1175,
10922,
1237,
3416,
1237,
49,
1175,
15354,
1237,
5122,
1237,
46,
416,
2589,
10922,
13288,
1002,
320,
303,
434,
327,
5616,
1237,
51,
17745,
941,
10276,
941,
3591,
45,
6344,
51,
842,
509,
320,
416,
461,
40554,
51,
42657,
45,
1805,
5729,
312,
303,
339,
832,
320,
416,
461,
640,
4417,
941,
38309,
492,
303,
339,
353,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 664
|
[
222,
338,
280,
350,
393,
67,
79,
2015,
78,
449,
614,
1219,
110,
1998,
222,
338,
280,
350,
393,
67,
79,
2015,
78,
563,
50,
28116,
462,
449,
1364,
462,
327,
12909,
6052,
46,
708,
902,
545,
30949,
4745,
222,
338,
981,
990,
1219,
110,
51,
286,
31437,
45,
1359,
46,
222,
338,
280,
350,
393,
67,
2077,
8149,
449,
341,
3505,
462,
451,
341,
6310,
21862,
2160,
222,
338,
594,
357,
67,
222,
338,
222,
338,
496,
772,
350,
72,
67,
4242,
3505,
847,
51,
222,
588,
222,
942,
5560,
462,
14204,
21862,
2077,
4823,
65,
72,
2041,
8149,
67,
303,
4584,
16946,
1947,
3309,
49,
10922,
7266,
320,
736,
964,
924,
7417,
2160,
5729,
64,
736,
1041,
682,
338,
10135,
1014,
1414,
461,
331,
338,
1592,
47,
1998,
451,
14204,
21862,
1024,
4417,
51,
1691,
14122,
331,
682,
338,
2212,
1998,
49,
341,
913,
2160,
1648,
545,
21182,
2143,
2703,
331,
4005,
913,
462,
458,
3412,
16952,
682,
338,
480,
16498,
3326,
3087,
3562,
7278,
391,
2160,
666,
4019,
563,
51,
5958,
4753,
682,
338,
682,
338,
350,
1023,
19338,
707,
682,
338,
496,
11722,
682,
338,
924,
14204,
21862,
1024,
4417,
65,
15938,
1081,
67,
913,
4417,
299,
682,
338,
280,
556,
14204,
21862,
1024,
4417,
11530,
15938,
2077,
51,
842,
49,
332,
5990,
51,
7083,
678,
682,
338,
24681,
1023,
67,
682,
588,
353,
2532,
5560,
14204,
21862,
1024,
4417,
65,
72,
67,
640,
4417,
492,
736,
496,
1806,
353,
581,
782,
2688,
1947,
45,
3242,
15354,
1237,
1637,
46,
2589,
3284,
320,
303,
1175,
14204,
21862,
1024,
4417,
65,
72,
67,
2208,
299,
640,
4417,
492,
303,
2208,
51,
5566,
492,
465,
1175,
910,
2212,
5729,
299,
332,
544,
574,
5112,
1941,
494,
2208,
51,
29172,
3451,
492,
303,
2160,
5729,
299,
7417,
51,
1315
] | 8,254,834,721,362,423,000
| true
| false
| false
| false
|
[
2143,
2703,
331,
4005,
913,
462,
458,
3412,
16952,
682,
338,
480,
16498,
3326,
3087,
3562,
7278,
391,
2160,
666,
4019,
563,
51,
5958,
4753,
682,
338,
682,
338,
350,
1023,
19338,
707,
682,
338,
496,
11722,
682,
338,
924,
14204,
21862,
1024,
4417,
65,
15938,
1081,
67,
913,
4417,
299,
682,
338,
280,
556,
14204,
21862,
1024,
4417,
11530,
15938,
2077,
51,
842,
49,
332,
5990,
51,
7083,
678,
682,
338,
24681,
1023,
67,
682,
588,
353,
2532,
5560,
14204,
21862,
1024,
4417,
65,
72,
67,
640,
4417,
492,
736,
496,
1806,
353,
581,
782,
2688,
1947,
45,
3242
] | -3,006,839,803,376,654,000
| true
|
* <li>JDBI - jdbi instance
* <li>JDBI on-demand class - any class (DAO classes) that can be instantiated via
* Jdbi.onDemand(Class)
* <li>Server Configuration - the configuration class of the dropwizard server
* </ul>
*
* @param <C> Server configuration type.
*/
public abstract class DropwizardServerExtension<C extends Configuration>
implements BeforeAllCallback, ParameterResolver {
private static URI serverUri;
/**
* Implementations should return a *static* instance of DropwizardTestSupport. If returning a
* local instance, the test server may be turned off after a single test class is done executing
* and subsequent tests could fail due to server not being on. Example implementation
*
* <pre>{@code
* @Getter
* static DropwizardTestSupport<MapsConfig> testSupport =
* new DropwizardTestSupport<>(MapsServer.class, "configuration.yml")
* }</pre>
*/
protected abstract DropwizardTestSupport<C> getSupport();
@Override
public void beforeAll(final
|
)
* <li>Server Configuration - the configuration class of the dropwizard server
* </ul>
*
* @param <C> Server configuration type.
*/
public abstract class DropwizardServerExtension<C extends Configuration>
implements BeforeAllCallback, ParameterResolver {
private static URI serverUri;
/**
* Implementations should return a *static* instance of DropwizardTestSupport. If returning a
* local instance, the test server may be turned off after a single test class is done executing
* and subsequent tests could fail due to server not being on. Example implementation
*
* <pre>{@code
* @Getter
* static DropwizardTestSupport<MapsConfig> testSupport =
* new DropwizardTestSupport<>(MapsServer.class, "configuration.yml")
* }</pre>
*/
protected abstract DropwizardTestSupport<C> getSupport();
@Override
public void beforeAll(final
|
>
implements BeforeAllCallback, ParameterResolver {
private static URI serverUri;
/**
* Implementations should return a *static* instance of DropwizardTestSupport. If returning a
* local instance, the test server may be turned off after a single test class is done executing
* and subsequent tests could fail due to server not being on. Example implementation
*
* <pre>{@code
* @Getter
* static DropwizardTestSupport<MapsConfig> testSupport =
* new DropwizardTestSupport<>(MapsServer.class, "configuration.yml")
* }</pre>
*/
protected abstract DropwizardTestSupport<C> getSupport();
@Override
public void beforeAll(final
|
off after a single test class is done executing
* and subsequent tests could fail due to server not being on. Example implementation
*
* <pre>{@code
* @Getter
* static DropwizardTestSupport<MapsConfig> testSupport =
* new DropwizardTestSupport<>(MapsServer.class, "configuration.yml")
* }</pre>
*/
protected abstract DropwizardTestSupport<C> getSupport();
@Override
public void beforeAll(final
|
ExtensionContext context) throws Exception {
final DropwizardTestSupport<C> support = getSupport();
support.before();
final String localUri = "http://localhost:" + support.getLocalPort();
serverUri = URI.create
|
StackValue.java
|
/FileExtraction/Java_unseen/corretto_corretto-11/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValue.java
|
/*
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
import java.io.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.utilities.*;
public class StackValue {
private int type;
private OopHandle handleValue;
private long integerValue;
public StackValue() {
type = BasicType.getTConflict();
}
public StackValue(OopHandle h, long scalar_replaced) {
handleValue = h;
type = BasicType.getTObject();
integerValue = scalar_replaced;
Assert.that(integerValue == 0 || handleValue == null, "not null object should not be marked as scalar replaced");
}
public StackValue(long i) {
integerValue = i;
type = BasicType.getTInt();
}
/** This returns one of the "enum" values in BasicType.java */
public int getType() {
return type;
}
public OopHandle getObject() {
if (Assert.ASSERTS_ENABLED) {
Assert.that(type == BasicType.getTObject(), "type check");
}
return handleValue;
}
boolean objIsScalarReplaced() {
if (Assert.ASSERTS_ENABLED) {
Assert.that(type == BasicType.getTObject(), "type check");
}
return integerValue != 0;
}
public long getInteger() {
if (Assert.ASSERTS_ENABLED) {
Assert.that(type == BasicType.getTInt(), "type check");
}
return integerValue;
}
public boolean equals(Object arg) {
if (arg == null) {
return false;
}
if (!arg.getClass().equals(getClass())) {
return false;
}
StackValue sv = (StackValue) arg;
if (type != sv.type) {
return false;
}
if (type == BasicType.getTObject()) {
return handleValue.equals(sv.handleValue);
} else if (type == BasicType.getTInt()) {
return (integerValue == sv.integerValue);
} else {
// Conflict type (not yet used)
return true;
}
}
public int hashCode() {
if (type == BasicType.getTObject()) {
return handleValue != null ? handleValue.hashCode() : 5;
} else {
// Returns 0 for conflict type
return (int) integerValue;
}
}
public void print() {
printOn(System.out);
}
public void printOn(PrintStream tty) {
if (type == BasicType.getTInt()) {
tty.print(integerValue + " (long) " + (int) integerValue + " (int)");
} else if (type == BasicType.getTObject()) {
tty.print("<" + handleValue + ">");
} else if (type == BasicType.getTConflict()) {
tty.print("conflict");
} else {
throw new RuntimeException("should not reach here");
}
}
}
| 3,554
|
Java
|
.java
|
corretto/corretto-11
| 662
| 105
| 31
|
2019-02-11T20:13:52Z
|
2024-05-09T07:01:40Z
|
41893f63984fbddc0a1e93d50b04599d8c29f81b5818abfb2fdd09e556b55b10
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
53,
49,
244,
55,
53,
53,
62,
49,
17980,
480,
52,
290,
2840,
25094,
51,
3381,
4760,
5225,
51,
222,
338,
4103,
2387,
23740,
1895,
35234,
8995,
2387,
11988,
1895,
8968,
10961,
30441,
51,
222,
338,
222,
338,
1369,
1361,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
55,
1773,
49,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
1361,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
222,
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
338,
222,
588,
222,
222,
1337,
15315,
51,
23491,
51,
8156,
7529,
51,
4700,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
485,
15315,
51,
23491,
51,
8156,
7529,
51,
21350,
7737,
222,
485,
15315,
51,
23491,
51,
8156,
7529,
51,
16092,
7737,
222,
222,
942,
462,
9784,
899,
320,
353,
964,
648,
981,
847,
64,
353,
964,
565,
539,
3308,
2902,
899,
64,
353,
964,
1964,
665,
5009,
899,
64,
736,
581,
9784,
899,
365,
320,
303,
847,
299,
9280,
638,
51,
47516,
19587,
492,
353,
339,
736,
581,
9784,
899,
45,
84,
539,
3308,
439,
49,
1964,
13175,
100,
287,
11326,
46,
320,
303,
2902,
899,
299,
439,
64,
303,
847,
299,
9280,
638,
51,
47516,
976,
492,
303,
5009,
899,
299,
13175,
100,
287,
11326,
64,
303,
3187,
51,
6942,
45,
5831,
899,
630,
244,
53,
1293,
2902,
899,
630,
762,
49,
332,
1226,
762,
1319,
1414,
666,
545,
15168,
641,
13175,
14180,
742,
353,
339,
736,
581,
9784,
899,
45,
3239,
613,
46,
320,
303,
5009,
899,
299,
613,
64,
303,
847,
299,
9280,
638,
51,
47516,
1438,
492,
353,
339,
736,
1041,
1369,
3235,
1611,
451,
341,
332,
3880,
39,
2102,
347,
9280,
638,
51,
1874,
588,
353,
581,
648,
24097,
365,
320,
303,
461,
847,
64,
353,
339,
736,
581,
565,
539,
3308,
43385,
365,
320,
303,
434,
327,
3285,
51,
6480,
88,
100,
17557,
46,
320,
416,
3187,
51,
6942,
45,
700,
630,
9280,
638,
51,
47516,
976,
1046,
332,
700,
1524,
742,
303,
339,
303,
461,
2902,
899,
64,
353,
339,
736,
1922,
2847,
1640,
10664,
454,
11326,
365,
320,
303,
434,
327,
3285,
51,
6480,
88,
100,
17557,
46,
320,
416,
3187,
51,
6942,
45,
700,
630,
9280,
638,
51,
47516,
976,
1046,
332,
700,
1524,
742,
303,
339,
303,
461,
5009,
899,
882,
244,
53,
64,
353,
339,
736,
581,
1964,
640,
3078,
365,
320,
303,
434,
327,
3285,
51,
6480,
88,
100,
17557,
46,
320,
416,
3187,
51,
6942,
45,
700,
630,
9280,
638,
51,
47516,
1438,
1046,
332,
700,
1524,
742,
303,
339,
303,
461,
5009,
899,
64,
353,
339,
736,
581,
1922,
12432,
45,
976,
1657,
46,
320,
303,
434,
327,
645,
630,
762,
46,
320,
416,
461,
920,
64,
303,
339,
465,
434,
1445,
645,
51,
9699,
941,
3591,
45,
9699,
5183,
320,
416,
461,
920,
64,
303,
339,
465,
9784,
899,
5870,
299,
327,
3131,
899,
46,
1657,
64,
303,
434,
327,
700,
882,
5870,
51,
700,
46,
320,
416,
461,
920,
64,
303,
339,
303,
434,
327,
700,
630,
9280,
638,
51,
47516,
976,
1177,
320,
416,
461,
2902,
899,
51,
3591,
45,
2289,
51,
2972,
899,
312,
303,
339,
832,
434,
327,
700,
630,
9280,
638,
51,
47516,
1438,
1177,
320,
416,
461,
327,
5831,
899,
630,
5870,
51,
5831,
899,
312,
303,
339,
832,
320,
416,
453,
42274,
847,
327,
1226,
6320,
1674,
46,
416,
461,
878,
64,
303,
339,
353,
339,
736,
581,
648,
17759,
365,
320,
303,
434,
327,
700,
630,
9280,
638,
51,
47516,
976,
1177,
320,
416,
461,
2902,
899,
882,
762,
1037,
2902,
899,
51,
14941,
365,
518,
244,
58,
64,
303,
339,
832,
320,
416,
453,
3777,
244,
53,
456,
11729,
847,
416,
461,
327,
429,
46,
5009,
899,
64,
303,
339,
353,
339,
736,
581,
782,
1489,
365,
320,
303,
1489,
1501,
45,
1615,
51,
560,
312,
353,
339,
736,
581,
782,
1489,
1501,
45,
4026,
1880,
34861,
46,
320,
303,
434,
327,
700,
630,
9280,
638,
51,
47516,
1438,
1177,
320,
416,
34861,
51,
1243,
45,
5831,
899,
494,
332,
327,
3239,
46,
332,
494,
327,
429,
46,
5009,
899,
494,
332,
327,
429,
13365,
303,
339,
832,
434,
327,
700,
630,
9280,
638,
51,
47516,
976,
1177,
320,
416,
34861,
51,
1243,
10379,
39,
494,
2902,
899,
494,
9143,
742,
303,
339,
832,
434,
327,
700,
630,
9280,
638,
51,
47516,
19587,
1177,
320,
416,
34861,
51,
1243,
459,
22932,
742,
303,
339,
832,
320,
416,
1440,
556,
13383,
459,
3179,
666,
15678,
2464,
742,
303,
339,
353,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 959
|
[
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
55,
1773,
49,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
1361,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
222,
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
338,
222,
588,
222,
222,
1337,
15315,
51,
23491,
51,
8156,
7529,
51,
4700,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
485,
15315,
51,
23491,
51,
8156,
7529,
51,
21350,
7737,
222,
485,
15315,
51,
23491,
51,
8156,
7529,
51,
16092,
7737,
222,
222,
942,
462,
9784,
899,
320,
353,
964,
648,
981,
847,
64,
353,
964,
565,
539,
3308,
2902,
899,
64,
353,
964,
1964,
665,
5009,
899,
64,
736,
581,
9784,
899,
365,
320,
303
] | -573,006,742,136,708,100
| true
| false
| false
| false
|
[
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
338,
222,
588,
222,
222,
1337,
15315,
51,
23491,
51,
8156,
7529,
51,
4700,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
485,
15315,
51,
23491,
51,
8156
] | -61,652,847,191,312,184
| true
|
it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
import java.io.*;
import sun.jvm.hot
|
WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
import java.io.*;
import sun.jvm.hot
|
anied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
import java.io.*;
import sun.jvm.hot
|
, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
import java.io.*;
import sun.jvm.hot
|
spot.debugger.*;
import sun.jvm.hotspot.utilities.*;
public class StackValue {
private int type;
private OopHandle handleValue;
private long integerValue;
public StackValue() {
|
MiningPanel.java
|
/FileExtraction/Java_unseen/btdex_btdex/src/main/java/btdex/ui/MiningPanel.java
|
package btdex.ui;
import static btdex.locale.Translation.tr;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.BadLocationException;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import bt.BT;
import btdex.core.BurstNode;
import btdex.core.Constants;
import btdex.core.Globals;
import btdex.core.NumberFormatting;
import signumj.entity.SignumAddress;
import signumj.entity.SignumValue;
import signumj.entity.response.Account;
import signumj.entity.response.Block;
import signumj.entity.response.MiningInfo;
import signumj.entity.response.Transaction;
import dorkbox.util.OS;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class MiningPanel extends JPanel implements ActionListener, ChangeListener {
private static final int N_PATHS_MIN = 3;
private static final long ONE_GIB = 1073741824L;
private static final long BYTES_OF_A_NONCE = 262144L;
private static String TMP_DIR = System.getProperty("java.io.tmpdir");
private static final String PROP_PLOT_PATH = "plotPath";
private static final String PROP_PLOT_CACHE = "plotPathCache";
private static final String PROP_PLOT_LOW_PRIO = "plotLowPrio";
private static final String PROP_PLOT_CPU_CORES = "plotCpuCores";
private static final String PROP_MINE_CPU_CORES = "mineCpuCores";
private static final String PROP_MINE_ONLY_BEST = "mineOnlyBest";
private static final String PROP_MINER_POOL = "minerPool";
private static final String PROP_MINER_AUTO_START = "minerAutoStart";
private static final String PROP_MINER_USE_DIRECT_IO = "minerUseDirectIO";
private static final String PLOT_APP = "[PLOTTER]";
private static final String MINER_APP = "[MINER]";
private static SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss");
private static final FileFilter PLOT_FILE_FILTER = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isFile() && Globals.getInstance().getAddress() != null &&
pathname.getName().startsWith(Globals.getInstance().getAddress().getID()) &&
pathname.getName().split("_").length == 3;
}
};
private static final FileFilter PLOT_FILE_FILTER_ANY = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isFile() && Globals.getInstance().getAddress() != null &&
pathname.getName().split("_").length == 3;
}
};
private LinkedHashMap<String, SignumAddress> poolAddresses = new LinkedHashMap<>();
private HashMap<String, String> poolMaxDeadlines = new HashMap<>();
private ArrayList<JButton> pathCancelButtons = new ArrayList<>();
private ArrayList<JButton> openFolderButtons = new ArrayList<>();
private ArrayList<JButton> selectFolderButtons = new ArrayList<>();
private ArrayList<JSlider> fractionToPlotSliders = new ArrayList<>();
private ArrayList<Desc> sliderListDesc = new ArrayList<>();
private ArrayList<File> pathList = new ArrayList<>();
private JTextArea console;
private JButton ssdSelectFolderButton;
private File ssdPath;
private JButton ssdCancelButton;
private JButton startPlotButton, stopPlotButton;
private JComboBox<String> cpusToPlotComboBox;
private JComboBox<String> cpusToMineComboBox;
private JComboBox<String> poolComboBox;
private JCheckBox mineSubmitOnlyBest;
private JCheckBox mineUseDirectIO;
private JButton joinPoolButton, openPoolButton;
private JTextField committedAmountField;
private JButton addCommitmentButton;
private JButton removeCommitmentButton;
private JCheckBox minerAutoStartCheck;
private JButton startMiningButton, stopMiningButton;
private Process minerProcess, plotterProcess;
private JCheckBox lowPriorityCheck;
private JTextArea rewardsEstimationArea;
private ArrayList<File> newPlotFiles = new ArrayList<>();
private ArrayList<File> resumePlotFiles = new ArrayList<>();
private boolean plotting, mining;
private Logger logger;
private File minerFile, plotterFile;
private RotatingIcon pendingIconRotating;
private Icon folderIcon;
private long totalToPlot;
private long totalCapacity;
private AtomicReference<Long> noncesPlotted = new AtomicReference<>();
private Icon iconPlot;
private Icons icons;
private JPanel disksPanel;
private String soloNode;
public MiningPanel() {
super(new BorderLayout());
logger = LogManager.getLogger();
icons = new Icons(this.getForeground(), Constants.ICON_SIZE_MED);
Icon pendingIcon = icons.get(Icons.SPINNER);
pendingIconRotating = new RotatingIcon(pendingIcon);
folderIcon = icons.get(Icons.FOLDER);
disksPanel = new JPanel(new GridLayout(0, 1));
JPanel plottingPanel = new JPanel(new BorderLayout());
JPanel plottingBottomPanel = new JPanel(new GridLayout(0, 1));
plottingPanel.setBorder(BorderFactory.createTitledBorder(tr("mine_plot_disks")));
plottingPanel.add(plottingBottomPanel, BorderLayout.PAGE_END);
JScrollPane disksScrollPane = new JScrollPane(disksPanel);
plottingPanel.setPreferredSize(new Dimension(200, 300));
plottingPanel.add(disksScrollPane, BorderLayout.CENTER);
Globals g = Globals.getInstance();
int nPaths = N_PATHS_MIN;
for (int i = 0; i < nPaths; i++) {
addDiskPath(i);
if(pathList.get(i) != null && i == nPaths -1) {
// add more as needed
nPaths++;
}
}
JPanel ssdPanel = new JPanel(new BorderLayout(2, 0));
ssdSelectFolderButton = new JButton(tr("mine_ssd_cache_select"), icons.get(Icons.FOLDER));
ssdSelectFolderButton.addActionListener(this);
ssdPanel.add(ssdSelectFolderButton, BorderLayout.CENTER);
ssdCancelButton = new JButton(icons.get(Icons.CANCEL));
ssdCancelButton.setToolTipText(tr("mine_ssd_remove"));
ssdCancelButton.addActionListener(this);
ssdCancelButton.setEnabled(false);
String path = g.getProperty(PROP_PLOT_CACHE);
if(path != null && path.length() > 0) {
ssdPath = new File(path);
ssdSelectFolderButton.setText(tr("mine_ssd_cache", path));
ssdCancelButton.setEnabled(true);
}
ssdPanel.add(ssdCancelButton, BorderLayout.LINE_START);
plottingBottomPanel.add(ssdPanel);
// CPU cores
int coresAvailable = Runtime.getRuntime().availableProcessors();
int selectedCores = Math.max(1, coresAvailable-2);
if(g.getProperty(PROP_PLOT_CPU_CORES) != null && g.getProperty(PROP_PLOT_CPU_CORES).length() > 0) {
selectedCores = Integer.parseInt(g.getProperty(PROP_PLOT_CPU_CORES));
}
selectedCores = Math.min(selectedCores, coresAvailable);
selectedCores = Math.max(selectedCores, 1);
cpusToPlotComboBox = new JComboBox<String>();
for (int i = 1; i <= coresAvailable; i++) {
cpusToPlotComboBox.addItem(Integer.toString(i));
}
cpusToPlotComboBox.setSelectedIndex(selectedCores-1);
cpusToPlotComboBox.addActionListener(this);
/* TODO: add GPU support
int numPlatforms[] = new int[1];
CL.clGetPlatformIDs(0, null, numPlatforms);
cl_platform_id platforms[] = new cl_platform_id[numPlatforms[0]];
CL.clGetPlatformIDs(platforms.length, platforms, null);
// Collect all devices of all platforms
List<cl_device_id> devices = new ArrayList<cl_device_id>();
for (int i=0; i<platforms.length; i++) {
String platformName = getString(platforms[i], CL.CL_PLATFORM_NAME);
// Obtain the number of devices for the current platform
int numDevices[] = new int[1];
CL.clGetDeviceIDs(platforms[i], CL.CL_DEVICE_TYPE_ALL, 0, null, numDevices);
System.out.println("Number of devices in platform "+platformName+": "+numDevices[0]);
// CL_PLATFORM_VERSION
String platformVersion = getString(platforms[i], CL.CL_PLATFORM_VERSION);
System.out.printf("CL_PLATFORM_VERSION: \t\t\t%s\n", platformVersion);
cl_device_id devicesArray[] = new cl_device_id[numDevices[0]];
CL.clGetDeviceIDs(platforms[i], CL.CL_DEVICE_TYPE_ALL, numDevices[0], devicesArray, null);
devices.addAll(Arrays.asList(devicesArray));
}
*/
JPanel plotButtonsPanelLine1 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
JPanel plotButtonsPanelLine2 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
iconPlot = icons.get(Icons.PLOTTING);
startPlotButton = new JButton(tr("mine_plot"), iconPlot);
startPlotButton.addActionListener(this);
startPlotButton.setEnabled(resumePlotFiles.size() > 0);
stopPlotButton = new JButton(tr("mine_plot_stop"), icons.get(Icons.CANCEL));
stopPlotButton.addActionListener(this);
stopPlotButton.setEnabled(false);
plotButtonsPanelLine2.add(new JLabel(tr("mine_cpus")));
plotButtonsPanelLine2.add(cpusToPlotComboBox);
plotButtonsPanelLine2.add(lowPriorityCheck = new JCheckBox(tr("mine_run_low_prio")));
plotButtonsPanelLine1.add(stopPlotButton);
plotButtonsPanelLine1.add(startPlotButton);
plottingBottomPanel.add(plotButtonsPanelLine1);
plottingBottomPanel.add(plotButtonsPanelLine2);
lowPriorityCheck.setSelected(Boolean.parseBoolean(g.getProperty(PROP_PLOT_LOW_PRIO)));
lowPriorityCheck.addActionListener(this);
JPanel poolPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
poolPanel.setBorder(BorderFactory.createTitledBorder(tr("mine_join_pool")));
poolPanel.add(new JLabel(tr("mine_select_pool")));
poolComboBox = new JComboBox<String>();
poolPanel.add(poolComboBox);
poolComboBox.addActionListener(this);
openPoolButton = new JButton(icons.get(Icons.EXPLORER));
openPoolButton.addActionListener(this);
poolPanel.add(openPoolButton);
joinPoolButton = new JButton(tr("send_join_pool"), icons.get(Icons.PLUG));
joinPoolButton.addActionListener(this);
poolPanel.add(joinPoolButton);
JPanel rewardsPanel = new JPanel();
rewardsPanel.setBorder(BorderFactory.createTitledBorder(tr("mine_rewards_and_commitment")));
rewardsPanel.setLayout(new BoxLayout(rewardsPanel, BoxLayout.Y_AXIS));
rewardsEstimationArea = new JTextArea(3, 20);
rewardsEstimationArea.setFont(rewardsEstimationArea.getFont().deriveFont(rewardsEstimationArea.getFont().getSize2D()*1.2f));
rewardsEstimationArea.setEditable(false);
rewardsPanel.add(rewardsEstimationArea);
JPanel commitmentPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
rewardsPanel.add(commitmentPanel);
commitmentPanel.add(new JLabel(tr("mine_your_amount")));
committedAmountField = new JTextField(9);
committedAmountField.setEditable(false);
commitmentPanel.add(committedAmountField);
addCommitmentButton = new JButton(icons.get(Icons.PLUS));
addCommitmentButton.setToolTipText(tr("send_add_commitment"));
commitmentPanel.add(addCommitmentButton);
addCommitmentButton.addActionListener(this);
removeCommitmentButton = new JButton(icons.get(Icons.MINUS));
removeCommitmentButton.setToolTipText(tr("send_remove_commitment"));
commitmentPanel.add(removeCommitmentButton);
removeCommitmentButton.addActionListener(this);
JPanel minerPanelMain = new JPanel(new GridLayout(0, 1));
minerPanelMain.setBorder(BorderFactory.createTitledBorder(tr("mine_run_miner")));
JPanel minerPanel1 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
JPanel minerPanel2 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
minerPanelMain.add(minerPanel1);
minerPanelMain.add(minerPanel2);
mineSubmitOnlyBest = new JCheckBox(tr("mine_only_best"));
mineSubmitOnlyBest.setToolTipText(tr("mine_only_best_details"));
mineSubmitOnlyBest.setSelected(!"false".equals(g.getProperty(PROP_MINE_ONLY_BEST)));
mineSubmitOnlyBest.addActionListener(this);
mineUseDirectIO = new JCheckBox(tr("mine_use_direct_io"));
mineUseDirectIO.setToolTipText(tr("mine_use_direct_io_details"));
mineUseDirectIO.setSelected(!"false".equals(g.getProperty(PROP_MINER_USE_DIRECT_IO)));
mineUseDirectIO.addActionListener(this);
cpusToMineComboBox = new JComboBox<String>();
for (int i = 1; i <= coresAvailable; i++) {
cpusToMineComboBox.addItem(Integer.toString(i));
}
cpusToMineComboBox.setSelectedIndex(0);
int coresToMine = 0;
if(g.getProperty(PROP_MINE_CPU_CORES) != null && g.getProperty(PROP_MINE_CPU_CORES).length() > 0) {
coresToMine = Integer.parseInt(g.getProperty(PROP_MINE_CPU_CORES))- 1;
}
if(coresToMine > 0 && coresToMine < cpusToMineComboBox.getItemCount())
cpusToMineComboBox.setSelectedIndex(coresToMine);
cpusToMineComboBox.addActionListener(this);
minerPanel2.add(new JLabel(tr("mine_cpus")));
minerPanel2.add(cpusToMineComboBox);
minerPanel2.add(mineSubmitOnlyBest);
minerPanel2.add(mineUseDirectIO);
minerPanel1.add(minerAutoStartCheck = new JCheckBox(tr("mine_start_auto")));
minerAutoStartCheck.setSelected(Boolean.parseBoolean(g.getProperty(PROP_MINER_AUTO_START)));
minerAutoStartCheck.addActionListener(this);
stopMiningButton = new JButton(tr("mine_stop_mining"), icons.get(Icons.CANCEL));
stopMiningButton.addActionListener(this);
stopMiningButton.setEnabled(false);
minerPanel1.add(stopMiningButton);
startMiningButton = new JButton(tr("mine_start_mining"), icons.get(Icons.MINING));
startMiningButton.addActionListener(this);
minerPanel1.add(startMiningButton);
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
rightPanel.add(poolPanel);
rightPanel.add(minerPanelMain);
rightPanel.add(rewardsPanel);
JPanel topPanel = new JPanel(new BorderLayout());
topPanel.add(plottingPanel, BorderLayout.CENTER);
topPanel.add(rightPanel, BorderLayout.LINE_END);
console = new JTextArea(10, 40);
console.setEditable(false);
JScrollPane consoleScrollPane = new JScrollPane(console);
JPanel consolePanel = new JPanel(new BorderLayout());
consolePanel.add(consoleScrollPane, BorderLayout.CENTER);
consolePanel.setBorder(BorderFactory.createTitledBorder(tr("mine_console")));
add(topPanel, BorderLayout.PAGE_START);
add(consolePanel, BorderLayout.CENTER);
ArrayList<String> poolList = new ArrayList<>(Globals.getInstance().isTestnet()
? Globals.SIGNUM_RESOURCES.testNetPools()
: Globals.SIGNUM_RESOURCES.mainNetPools());
String selectedPool = Globals.getInstance().getProperty(PROP_MINER_POOL);
boolean userHasPool = false;
for(String poolURL : poolList) {
poolComboBox.addItem(poolURL);
if(poolURL.equals(selectedPool)) {
poolComboBox.setSelectedIndex(poolComboBox.getItemCount()-1);
userHasPool = true;
}
}
if(!userHasPool) {
Random r = new Random();
poolComboBox.setSelectedIndex(r.nextInt(poolComboBox.getItemCount()));
}
soloNode = g.isTestnet() ? BT.NODE_LOCAL_TESTNET : BT.NODE_LOCAL;
poolComboBox.addItem(soloNode);
if(soloNode.equals(selectedPool))
poolComboBox.setSelectedIndex(poolComboBox.getItemCount()-1);
// Solo mining should have its own address
poolAddresses.put(soloNode, g.getAddress());
poolMaxDeadlines.put(soloNode, "100000000");
actionPerformed(new ActionEvent(poolComboBox, 0, ""));
checkForPlotProblems();
stateChanged(null);
// Query pool API for their info
Thread thread = new Thread(){
public void run(){
updatePoolInfo(poolList);
}
};
thread.start();
if(minerAutoStartCheck.isSelected()) {
new java.util.Timer().schedule(
new java.util.TimerTask() {
public void run() {
startMining();
}
}, 5000);
}
}
private void addDiskPath(int i) {
Globals g = Globals.getInstance();
JButton cancelButton = new JButton(icons.get(Icons.CANCEL));
cancelButton.setToolTipText(tr("mine_remove_path"));
cancelButton.addActionListener(this);
cancelButton.setEnabled(false);
JButton openFolderButton = new JButton(icons.get(Icons.EXPLORER));
openFolderButton.addActionListener(this);
openFolderButton.setEnabled(false);
JButton selectFolderButton = new JButton(tr("mine_select_disk"), folderIcon);
selectFolderButton.addActionListener(this);
JSlider fractionToPlotSlider = new JSlider(0, 100, 0);
fractionToPlotSlider.addChangeListener(this);
fractionToPlotSlider.setEnabled(false);
Desc sliderDesc = new Desc(" ", fractionToPlotSlider);
pathCancelButtons.add(cancelButton);
openFolderButtons.add(openFolderButton);
selectFolderButtons.add(selectFolderButton);
fractionToPlotSliders.add(fractionToPlotSlider);
sliderListDesc.add(sliderDesc);
String path = g.getProperty(PROP_PLOT_PATH + (i+1));
if(path == null || path.length() == 0) {
pathList.add(null);
}
else {
selectFolderButton.setText(path);
File pathFile = new File(path);
pathList.add(pathFile);
cancelButton.setEnabled(true);
openFolderButton.setEnabled(true);
fractionToPlotSlider.setEnabled(true);
}
JPanel folderBorderPanel = new JPanel(new BorderLayout(2, 0));
folderBorderPanel.add(selectFolderButton, BorderLayout.CENTER);
folderBorderPanel.add(cancelButton, BorderLayout.LINE_START);
JPanel folderPanel = new JPanel(new BorderLayout());
folderPanel.add(openFolderButton, BorderLayout.LINE_START);
folderPanel.add(sliderDesc, BorderLayout.CENTER);
folderBorderPanel.add(folderPanel, BorderLayout.LINE_END);
disksPanel.add(folderBorderPanel);
}
private static final OkHttpClient CLIENT = new OkHttpClient();
private void updatePoolInfo(ArrayList<String> urlList) {
for (String poolURL : urlList) {
String poolURLgetConfig = poolURL + "/api/getConfig";
try {
Request request = new Request.Builder().url(poolURLgetConfig).build();
Response responses = CLIENT.newCall(request).execute();
String jsonData = responses.body().string();
JsonObject json = JsonParser.parseString(jsonData).getAsJsonObject();
SignumAddress poolAddress = SignumAddress.fromEither(json.get("poolAccount").getAsString());
poolAddresses.put(poolURL, poolAddress);
poolMaxDeadlines.put(poolURL, "100000000");
JsonElement jsonMaxDeadline = json.get("maxDeadline");
if(jsonMaxDeadline != null) {
poolMaxDeadlines.put(poolURL, jsonMaxDeadline.getAsString());
}
}
catch (Exception e) {
logger.debug("Pool incompatible or down: " + poolURL);
}
}
}
// /**
// * Returns the value of the device info parameter with the given name
// *
// * @param device The device
// * @param paramName The parameter name
// * @return The value
// */
// private static String getString(cl_device_id device, int paramName)
// {
// // Obtain the length of the string that will be queried
// long size[] = new long[1];
// CL.clGetDeviceInfo(device, paramName, 0, null, size);
//
// // Create a buffer of the appropriate size and fill it with the info
// byte buffer[] = new byte[(int)size[0]];
// CL.clGetDeviceInfo(device, paramName, buffer.length, Pointer.to(buffer), null);
//
// // Create a string from the buffer (excluding the trailing \0 byte)
// return new String(buffer, 0, buffer.length-1);
// }
//
// /**
// * Returns the value of the platform info parameter with the given name
// *
// * @param platform The platform
// * @param paramName The parameter name
// * @return The value
// */
// private static String getString(cl_platform_id platform, int paramName)
// {
// // Obtain the length of the string that will be queried
// long size[] = new long[1];
// CL.clGetPlatformInfo(platform, paramName, 0, null, size);
//
// // Create a buffer of the appropriate size and fill it with the info
// byte buffer[] = new byte[(int)size[0]];
// CL.clGetPlatformInfo(platform, paramName, buffer.length, Pointer.to(buffer), null);
//
// // Create a string from the buffer (excluding the trailing \0 byte)
// return new String(buffer, 0, buffer.length-1);
// }
public void update() {
BurstNode BN = BurstNode.getInstance();
Account account = BN.getAccount();
if(account != null && account.getCommittedBalance() != null) {
committedAmountField.setText(NumberFormatting.BURST.format(account.getCommittedBalance().longValue()));
}
if(plotting) {
for (int i = 0; i < pathList.size(); i++) {
File path = pathList.get(i);
pathCancelButtons.get(i).setEnabled(false);
openFolderButtons.get(i).setEnabled(false);
selectFolderButtons.get(i).setEnabled(false);
fractionToPlotSliders.get(i).setEnabled(false);
if(path == null)
continue;
if(fractionToPlotSliders.get(i).getValue() > 0) {
selectFolderButtons.get(i).setIcon(pendingIconRotating);
pendingIconRotating.addComponent(selectFolderButtons.get(i));
}
}
long percentPlotted = (100*BYTES_OF_A_NONCE*noncesPlotted.get())/totalToPlot;
startPlotButton.setText(tr("mine_plotting", percentPlotted));
startPlotButton.setIcon(pendingIconRotating);
pendingIconRotating.addComponent(startPlotButton);
if(ssdPath != null) {
ssdSelectFolderButton.setIcon(pendingIconRotating);
pendingIconRotating.addComponent(ssdSelectFolderButton);
}
ssdCancelButton.setEnabled(false);
ssdSelectFolderButton.setEnabled(false);
}
else {
totalCapacity = 0;
for (int i = 0; i < pathList.size(); i++) {
File path = pathList.get(i);
selectFolderButtons.get(i).setEnabled(true);
if(path == null)
continue;
File[] plotFiles = path.listFiles(PLOT_FILE_FILTER);
long amountInPlots = 0;
if(plotFiles != null) {
for(File plot : plotFiles) {
amountInPlots += plot.length();
}
}
if(amountInPlots > 0) {
selectFolderButtons.get(i).setText(path.getAbsolutePath() + " " + formatSpace(amountInPlots));
}
totalCapacity += amountInPlots;
pendingIconRotating.removeComponent(selectFolderButtons.get(i));
selectFolderButtons.get(i).setIcon(folderIcon);
pathCancelButtons.get(i).setEnabled(true);
openFolderButtons.get(i).setEnabled(true);
fractionToPlotSliders.get(i).setEnabled(true);
if(ssdPath != null) {
pendingIconRotating.removeComponent(ssdSelectFolderButton);
ssdSelectFolderButton.setIcon(folderIcon);
}
}
stopPlotButton.setEnabled(false);
startPlotButton.setIcon(iconPlot);
pendingIconRotating.removeComponent(startPlotButton);
startPlotButton.setText(tr("mine_plot"));
ssdCancelButton.setEnabled(ssdPath != null);
ssdSelectFolderButton.setEnabled(true);
}
MiningInfo miningInfo = BN.getMiningInfo();
Block latestBlock = BN.getLatestBlock();
if(miningInfo != null && latestBlock != null) {
double networkTbs = 18325193796.0/(miningInfo.getBaseTarget()*1.83);
SignumValue burstPerTbPerDay = SignumValue.fromSigna(360.0/networkTbs * latestBlock.getBlockReward().doubleValue());
String rewards = tr("mine_reward_estimation_old", NumberFormatting.BURST_2.format(burstPerTbPerDay.longValue()),
formatSpace(networkTbs*1024L*ONE_GIB));
rewards += "\n" + tr("mine_reward_poc_plus_activation", NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(8).longValue()));
SignumValue avgCommitment = null;
int pocPlusBlock = Globals.getInstance().isTestnet() ? 269_700 : 878_000;
if(miningInfo.getAverageCommitmentNQT() > 0 && miningInfo.getHeight() > pocPlusBlock) {
avgCommitment = SignumValue.fromNQT(miningInfo.getAverageCommitmentNQT());
// rewards = tr("mine_reward_estimation", NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(8).longValue()),
// NumberFormatting.BURST_2.format(avgCommitment.multiply(100*8).longValue()));
rewards = tr("mine_reward_estimation", NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(4.18).longValue()),
NumberFormatting.BURST_2.format(avgCommitment.multiply(100).longValue()));
rewards += "\n" + tr("mine_reward_estimation", NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(2.04).longValue()),
NumberFormatting.BURST_2.format(avgCommitment.multiply(10).longValue()));
rewards += "\n" + tr("mine_reward_estimation", NumberFormatting.BURST_2.format(burstPerTbPerDay.longValue()),
NumberFormatting.BURST_2.format(avgCommitment.longValue()));
rewards += "\n" + tr("mine_reward_estimation_nothing", NumberFormatting.BURST_2.format(burstPerTbPerDay.divide(8).longValue()));
}
// TODO: leaving this out for now
// if(totalCapacity > 0) {
// double capacityTib = (double)totalCapacity/ ONE_GIB /1024.0;
//
// String capacity = formatSpace(totalCapacity);
// double commitmentFactor = 1;
// if(avgCommitment != null && account.getCommitment() != null) {
// capacity += "+" + NumberFormatting.BURST_2.format(account.getCommitment().longValue()) + " BURST/TiB";
//
// double ratio = account.getCommitment().doubleValue()/avgCommitment.doubleValue();
// commitmentFactor = Math.pow(ratio, 0.4515449935);
// commitmentFactor = Math.min(8.0, commitmentFactor);
// commitmentFactor = Math.max(0.125, commitmentFactor);
// }
//
// rewards += "\n\n" + tr("mine_your_rewards", capacity, NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(capacityTib*commitmentFactor).longValue()));
// if(avgCommitment == null || account.getCommitment() == null) {
// rewards += "\n" + tr("mine_reward_poc_plus_activation", NumberFormatting.BURST_2.format(burstPerTbPerDay.multiply(capacityTib*8).longValue()));
// }
// }
rewardsEstimationArea.setText(rewards);
}
if(!mining && poolComboBox.getSelectedItem() != null) {
if(poolAddresses.get(soloNode) == null)
poolAddresses.put(soloNode, Globals.getInstance().getAddress());
SignumAddress poolAddress = poolAddresses.get(poolComboBox.getSelectedItem().toString());
startMiningButton.setEnabled(poolAddress != null
&& (poolAddress.equals(BN.getRewardRecipient()) ||
(poolComboBox.getSelectedIndex() == poolComboBox.getItemCount()-1 && BN.getRewardRecipient()==null))
&& totalCapacity > 0);
}
lowPriorityCheck.setEnabled(!plotting);
cpusToPlotComboBox.setEnabled(!plotting);
}
public void stop() {
if(mining && minerProcess!=null && minerProcess.isAlive()) {
mining = false;
logger.info("destroying miner process");
minerProcess.destroyForcibly();
}
if(plotting && plotterProcess!=null && plotterProcess.isAlive()) {
plotting = false;
logger.info("destroying plotter process");
plotterProcess.destroyForcibly();
}
}
private void saveConfs(Globals g) {
try {
g.saveConfs();
} catch (Exception ex) {
ex.printStackTrace();
Toast.makeText((JFrame) SwingUtilities.getWindowAncestor(this), ex.getMessage(), Toast.Style.ERROR).display();
}
}
private void checkForPlotProblems() {
resumePlotFiles.clear();
for (int i = 0; i < pathList.size(); i++) {
File pathFile = pathList.get(i);
if(pathFile == null)
continue;
// check if there are pending files to resume
File[] plotFiles = pathFile.listFiles(PLOT_FILE_FILTER_ANY);
if(plotFiles != null) {
for(File plot : plotFiles) {
if(!plot.getName().startsWith(Globals.getInstance().getAddress().getID())) {
addToConsole(PLOT_APP, "Plot '" + plot.getAbsolutePath() + "' is for a different account and will generate mining errors");
continue;
}
int progress = getPlotProgress(plot);
if(progress >= 0) {
resumePlotFiles.add(plot);
addToConsole(PLOT_APP, "Plot '" + plot.getName() + "' is incomplete, start plotting again to resume it");
}
}
}
}
}
@Override
public void actionPerformed(ActionEvent e) {
int pos = 0;
Globals g = Globals.getInstance();
pos = selectFolderButtons.indexOf(e.getSource());
if(pos >=0) {
JFileChooser fileChooser = new JFileChooser();
if(pathList.get(pos) != null)
fileChooser.setCurrentDirectory(pathList.get(pos));
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fileChooser.setAcceptAllFileFilterUsed(false);
int returnVal = fileChooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
File selectedPath = fileChooser.getSelectedFile();
pathList.set(pos, selectedPath);
g.setProperty(PROP_PLOT_PATH + (pos+1), selectedPath.getAbsolutePath());
saveConfs(g);
selectFolderButtons.get(pos).setText(selectedPath.getAbsolutePath());
pathCancelButtons.get(pos).setEnabled(true);
openFolderButtons.get(pos).setEnabled(true);
fractionToPlotSliders.get(pos).setEnabled(true);
File[] plotFiles = selectedPath.listFiles(PLOT_FILE_FILTER);
fractionToPlotSliders.get(pos).setValue((plotFiles.length > 0) ? 0 : 80);
if(pos == pathList.size() - 1) {
// using the last one, add one more
addDiskPath(pos+1);
this.revalidate();
}
checkForPlotProblems();
}
return;
}
pos = pathCancelButtons.indexOf(e.getSource());
if(pos >=0) {
pathList.set(pos, null);
selectFolderButtons.get(pos).setText(tr("mine_select_disk"));
pathCancelButtons.get(pos).setEnabled(false);
openFolderButtons.get(pos).setEnabled(false);
fractionToPlotSliders.get(pos).setEnabled(false);
fractionToPlotSliders.get(pos).setValue(0);
sliderListDesc.get(pos).setDesc(" ");
g.setProperty(PROP_PLOT_PATH + (pos+1), "");
saveConfs(g);
return;
}
if(ssdSelectFolderButton == e.getSource()) {
JFileChooser fileChooser = new JFileChooser();
if(ssdPath != null)
fileChooser.setCurrentDirectory(ssdPath);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = fileChooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
ssdPath = fileChooser.getSelectedFile();
g.setProperty(PROP_PLOT_CACHE, ssdPath.getAbsolutePath());
saveConfs(g);
ssdSelectFolderButton.setText(tr("mine_ssd_cache", ssdPath.getAbsolutePath()));
ssdCancelButton.setEnabled(true);
}
return;
}
if(ssdCancelButton == e.getSource()) {
ssdPath = null;
ssdSelectFolderButton.setText(tr("mine_ssd_cache_select"));
ssdCancelButton.setEnabled(false);
g.setProperty(PROP_PLOT_CACHE, "");
saveConfs(g);
return;
}
pos = openFolderButtons.indexOf(e.getSource());
if(pos >=0) {
DesktopApi.open(pathList.get(pos));
return;
}
if(startPlotButton == e.getSource()) {
startPlotting();
return;
}
if(stopPlotButton == e.getSource()) {
plotting = false;
stopPlotButton.setEnabled(false);
checkForPlotProblems();
update();
return;
}
if(startMiningButton == e.getSource()) {
startMining();
return;
}
if(stopMiningButton == e.getSource()) {
addToConsole(MINER_APP, "Stopping miner");
minerProcess.destroyForcibly();
mining = false;
stopMiningButton.setEnabled(false);
return;
}
if(lowPriorityCheck == e.getSource()) {
g.setProperty(PROP_PLOT_LOW_PRIO, Boolean.toString(lowPriorityCheck.isSelected()));
saveConfs(g);
return;
}
if(minerAutoStartCheck == e.getSource()) {
g.setProperty(PROP_MINER_AUTO_START, Boolean.toString(minerAutoStartCheck.isSelected()));
saveConfs(g);
return;
}
if(mineSubmitOnlyBest == e.getSource()) {
g.setProperty(PROP_MINE_ONLY_BEST, Boolean.toString(mineSubmitOnlyBest.isSelected()));
saveConfs(g);
return;
}
if(mineUseDirectIO == e.getSource()) {
g.setProperty(PROP_MINER_USE_DIRECT_IO, Boolean.toString(mineUseDirectIO.isSelected()));
saveConfs(g);
return;
}
if(cpusToPlotComboBox == e.getSource()) {
g.setProperty(PROP_PLOT_CPU_CORES, Integer.toString(cpusToPlotComboBox.getSelectedIndex()+1));
saveConfs(g);
return;
}
if(cpusToMineComboBox == e.getSource()) {
g.setProperty(PROP_MINE_CPU_CORES, Integer.toString(cpusToMineComboBox.getSelectedIndex()+1));
saveConfs(g);
return;
}
if(poolComboBox == e.getSource()) {
joinPoolButton.setText(poolComboBox.getSelectedIndex()==poolComboBox.getItemCount()-1 ?
tr("send_go_solo") : tr("send_join_pool"));
g.setProperty(PROP_MINER_POOL, poolComboBox.getSelectedItem().toString());
saveConfs(g);
}
if(addCommitmentButton == e.getSource() || removeCommitmentButton == e.getSource()) {
MiningInfo miningInfo = BurstNode.getInstance().getMiningInfo();
if(miningInfo != null && miningInfo.getAverageCommitmentNQT() == 0) {
JOptionPane.showMessageDialog(getParent(),
tr("mine_commitment_not_available"),
tr(addCommitmentButton == e.getSource() ? "send_add_commitment" : "send_remove_commitment"),
JOptionPane.INFORMATION_MESSAGE);
return;
}
SendDialog dlg = new SendDialog((JFrame) SwingUtilities.getWindowAncestor(this),
null, addCommitmentButton == e.getSource() ? SendDialog.TYPE_ADD_COMMITMENT :
SendDialog.TYPE_REMOVE_COMMITMENT, null);
dlg.setLocationRelativeTo(this);
dlg.setVisible(true);
return;
}
if(openPoolButton == e.getSource()) {
try {
DesktopApi.browse(new URI(poolComboBox.getSelectedItem().toString()));
} catch (URISyntaxException ex) {
ex.printStackTrace();
}
return;
}
if(joinPoolButton == e.getSource()) {
if(poolComboBox.getSelectedIndex() < 0)
return;
BurstNode BN = BurstNode.getInstance();
String info = null;
SignumAddress poolAddress = poolAddresses.get(poolComboBox.getSelectedItem().toString());
Transaction[] txs = BN.getAccountTransactions();
Transaction[] utx = BN.getUnconfirmedTransactions();
ArrayList<Transaction> allTxs = new ArrayList<>();
if(txs != null)
Collections.addAll(allTxs, txs);
if(utx != null)
Collections.addAll(allTxs, utx);
for(Transaction tx : allTxs) {
if(tx.getSender().equals(g.getAddress()) && tx.getType() == 20 && tx.getSubtype() == 0 && tx.getConfirmations() < 4) {
info = tr("mine_wait_join");
break;
}
}
if(info == null && poolAddress == null) {
info = tr("mine_invalid_pool");
}
boolean isSolo = poolComboBox.getSelectedIndex() == poolComboBox.getItemCount() -1;
if(info == null && !isSolo && poolAddress.equals(BN.getRewardRecipient())) {
info = tr("mine_already_joined");
}
if(info == null && isSolo && (BN.getRewardRecipient()==null || poolAddress.equals(BN.getRewardRecipient()))) {
info = tr("mine_already_solo");
}
if(info != null) {
JOptionPane.showMessageDialog(getParent(), info, tr(isSolo ? "send_go_solo" : "send_join_pool"), JOptionPane.INFORMATION_MESSAGE);
return;
}
SendDialog dlg = new SendDialog((JFrame) SwingUtilities.getWindowAncestor(this),
null, isSolo ? SendDialog.TYPE_GO_SOLO : SendDialog.TYPE_JOIN_POOL, poolAddress);
dlg.setLocationRelativeTo(this);
dlg.setVisible(true);
return;
}
}
@Override
public void stateChanged(ChangeEvent e) {
totalToPlot = 0;
for (int i = 0; i < pathList.size(); i++) {
File path = pathList.get(i);
if(path == null)
continue;
long freeSpace = path.getUsableSpace();
if(ssdPath != null) {
// Leave some free space to avoid problems with the sector alignment when moving multiple files.
// TODO we can remove this if we force to use exact sector sizes
freeSpace -= 10*BYTES_OF_A_NONCE;
}
long toUseWithPlots = (freeSpace/100 * fractionToPlotSliders.get(i).getValue());
totalToPlot += toUseWithPlots;
double amountToPlot = toUseWithPlots;
String desc = "+" + formatSpace(amountToPlot);
long freeSpaceGb = freeSpace/ONE_GIB;
if(freeSpaceGb < 1) {
desc = tr("mine_disk_full");
fractionToPlotSliders.get(i).setValue(100);
fractionToPlotSliders.get(i).setEnabled(false);
}
sliderListDesc.get(i).setDesc(desc);
}
// Add the files to be resumed to the total
for(File fr : resumePlotFiles) {
totalToPlot += fr.length();
}
if(!plotting)
startPlotButton.setEnabled(totalToPlot > 0 || resumePlotFiles.size() > 0);
}
public String formatSpace(double bytes) {
bytes /= ONE_GIB;
if(bytes < 500) {
return NumberFormatting.BURST_2.format(bytes) + " GiB";
}
bytes /= 1024;
return NumberFormatting.BURST_2.format(bytes) + " TiB";
}
private void startPlotting() {
if(plotting)
return;
logger.info("Starded plotting");
noncesPlotted.set(0L);
plotting = true;
startPlotButton.setEnabled(false);
stopPlotButton.setEnabled(true);
update();
// Start nonce is random and we leave still enough bits for many PiB of unique nonces.
// This way he user can disconnect disks and plot later or can use it on multiple machines.
byte[] entropy = new byte[Short.BYTES];
new SecureRandom().nextBytes(entropy);
ByteBuffer bb = ByteBuffer.wrap(entropy);
long startNonce = (bb.getShort() & 0x0FFF) * 100000000000000L;
for(File path : pathList) {
if(path == null)
continue;
File[] plotFiles = path.listFiles(PLOT_FILE_FILTER);
for(File plot : plotFiles) {
String pieces[] = plot.getName().split("_");
long start = Long.parseUnsignedLong(pieces[1]);
long nonces = Long.parseUnsignedLong(pieces[2]);
startNonce = Math.max(startNonce, start+nonces);
}
}
logger.info("Start nonce is {}", startNonce);
Globals g = Globals.getInstance();
newPlotFiles.clear();
for (int i = 0; i < pathList.size(); i++) {
File path = pathList.get(i);
if(path == null)
continue;
long freeSpace = path.getUsableSpace();
long toUseWithPlots = freeSpace/100 * fractionToPlotSliders.get(i).getValue();
long noncesToAdd = toUseWithPlots/BYTES_OF_A_NONCE;
if(noncesToAdd == 0)
continue;
String newPlot = g.getAddress().getID() + "_" + startNonce + "_" + noncesToAdd;
newPlotFiles.add(new File(path, newPlot));
logger.info("Added file to plot {}", newPlot);
startNonce += noncesToAdd + 1;
}
if(newPlotFiles.size() == 0 && resumePlotFiles.size()==0) {
plotting = false;
return;
}
String plotterName = "signum-plotter";
if(OS.isWindows())
plotterName += ".exe";
else if(OS.isMacOsX())
plotterName += ".app";
plotterFile = new File(TMP_DIR, plotterName);
if (!plotterFile.exists() || plotterFile.length() == 0) {
InputStream link = (getClass().getResourceAsStream("/plotter/" + plotterName));
try {
logger.info("Copying ploter to {}", plotterFile.getAbsolutePath());
Files.copy(link, plotterFile.getAbsoluteFile().toPath());
if(!OS.isWindows())
plotterFile.setExecutable(true);
} catch (IOException ex) {
ex.printStackTrace();
Toast.makeText((JFrame) SwingUtilities.getWindowAncestor(this), ex.getMessage(), Toast.Style.ERROR).display();
plotting = false;
return;
}
}
PlotThread plotThread = new PlotThread();
plotThread.start();
}
class PlotThread extends Thread {
public void run() {
long noncesFinished = 0;
addToConsole(PLOT_APP, "Plotting started for a total of " + formatSpace(totalToPlot) + ", this can be a long process...");
// Cache will use 45% of the free space, so we can have 2 (one moving and one plotting) and do not get a disk full
long noncesCache = 0;
if(ssdPath != null) {
// clear possibly forgotten or killed plots on the cache folder
File[] lostCacheFiles = ssdPath.listFiles(PLOT_FILE_FILTER);
if(lostCacheFiles != null) {
for(File plot : lostCacheFiles) {
addToConsole(PLOT_APP, "Deleting plot on cache '" + plot.getName() + "'");
plot.delete();
}
}
noncesCache = ssdPath.getUsableSpace() * 45 / (100 * BYTES_OF_A_NONCE);
}
ArrayList<File> filesToPlot = new ArrayList<>();
filesToPlot.addAll(resumePlotFiles);
filesToPlot.addAll(newPlotFiles);
for (File plot : filesToPlot) {
if(resumePlotFiles.contains(plot)) {
addToConsole(PLOT_APP, "Resuming plot file '" + plot.getName() + "'");
}
String[] sections = plot.getName().split("_");
long noncesInThisPlot = Long.parseLong(sections[2]);
long nonceStart = Long.parseLong(sections[1]);
long noncesAlreadyPlotted = 0;
long noncesBeingPlot = noncesInThisPlot;
File fileBeingPlot = plot;
if(ssdPath != null && !resumePlotFiles.contains(plot)) {
noncesBeingPlot = Math.min(noncesCache, noncesInThisPlot);
}
while(noncesAlreadyPlotted < noncesInThisPlot) {
noncesBeingPlot = Math.min(noncesInThisPlot - noncesAlreadyPlotted, noncesBeingPlot);
if(ssdPath != null && !resumePlotFiles.contains(plot)) {
fileBeingPlot = new File(ssdPath, sections[0] + "_" + nonceStart + "_" + noncesBeingPlot);
long freeCacheSpaceNow = ssdPath.getUsableSpace()/BYTES_OF_A_NONCE;
while(freeCacheSpaceNow < noncesCache) {
addToConsole(PLOT_APP, "Waiting for enough space on your cache disk...");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
plotting = false;
}
if(!plotting) {
addToConsole(PLOT_APP, "Stopped");
return;
}
freeCacheSpaceNow = ssdPath.getUsableSpace()/BYTES_OF_A_NONCE;
}
}
String cmd = plotterFile.getAbsolutePath() + " -i " + sections[0];
cmd += " -s " + nonceStart;
cmd += " -n " + noncesBeingPlot;
cmd += " -c " + (cpusToPlotComboBox.getSelectedIndex()+1);
cmd += " -q";
cmd += " -d"; // FIXME: enable back direct io, but we need to find out the sector size then and adjust no of nonces
if(lowPriorityCheck.isSelected())
cmd += " -l";
addToConsole(PLOT_APP, "Plotting file '" + fileBeingPlot.getAbsolutePath() + "'");
try {
plotterProcess = Runtime.getRuntime().exec(cmd, null, fileBeingPlot.getParentFile());
long counter = 0;
while (plotterProcess.isAlive()) {
if(!plotting) {
addToConsole(PLOT_APP, "Stopped");
plotterProcess.destroyForcibly();
if(getPlotProgress(fileBeingPlot) < 0) {
// delete the file, because we will not be able to resume it
fileBeingPlot.delete();
}
break;
}
counter++;
Thread.sleep(100);
if(counter % 300 == 0) {
int partial = getPlotProgress(fileBeingPlot);
noncesPlotted.set(noncesFinished + partial);
}
}
// TODO: apparently for some systems this returns garbage, visit again later
// if(plotting && plotterProcess.exitValue()!=0) {
// addToConsole(PLOT_APP, "Error, plotter exit code: " + plotterProcess.exitValue());
// plotting = false;
// break;
// }
if(!plotting) {
break;
}
nonceStart += noncesBeingPlot;
noncesAlreadyPlotted += noncesBeingPlot;
noncesFinished += noncesBeingPlot;
if(ssdPath != null) {
addToConsole(PLOT_APP, "Moving '" + fileBeingPlot.getName() + "' to '" + plot.getParent() + "'");
moveFile(fileBeingPlot.toPath(), new File(plot.getParent(), fileBeingPlot.getName()).toPath());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
if(plotting)
addToConsole(PLOT_APP, "Plotting successfully finished! Be sure to stop and start the miner.");
if(ssdPath != null)
addToConsole(PLOT_APP, "But your system might still be moving files from cache");
plotting = false;
plotterFile.delete();
resumePlotFiles.clear();
// Finished, so we reset all sliders
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for (int i = 0; i < fractionToPlotSliders.size(); i++) {
fractionToPlotSliders.get(i).setValue(0);
}
update();
}
});
};
};
private void moveFile(Path source, Path target) {
Thread copyThread = new Thread(() -> {
try{
Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex) {
ex.printStackTrace(System.err);
}
});
copyThread.start();
}
private int getPlotProgress(File plot) {
int progress = -1;
try {
RandomAccessFile raf = new RandomAccessFile(plot, "r");
if(raf.length() > 8) {
// Seek to the end of file
raf.seek(raf.length() - 8);
byte []array = new byte[8];
raf.read(array, 0, 8);
// Check for the magic bytes at the end of the file
if(array[4] == -81 && array[5] == -2 && array[6] == -81 && array[7] == -2) {
ByteBuffer buff = ByteBuffer.wrap(array, 0, 4);
buff.order(ByteOrder.LITTLE_ENDIAN);
progress = buff.getInt();
}
}
raf.close();
}
catch (Exception e) {
progress = -1;
e.printStackTrace();
logger.info(e.getMessage());
}
return progress;
}
private static final String MINER_CONFIG_FILE = "btdex-miner.yaml";
private void startMining() {
if(mining)
return;
logger.info("Starded mining");
mining = true;
startMiningButton.setEnabled(false);
stopMiningButton.setEnabled(true);
String minerName = "signum-miner";
if(OS.isWindows())
minerName += ".exe";
else if(OS.isMacOsX())
minerName += ".app";
minerFile = new File(TMP_DIR, minerName);
InputStream minerStream = (getClass().getResourceAsStream("/miner/" + minerName));
InputStream minerConfigStream = (getClass().getResourceAsStream("/miner/config.yaml"));
try {
if(minerFile.exists() && minerFile.isFile())
minerFile.delete();
logger.info("Copying miner to {}", minerFile.getAbsolutePath());
Files.copy(minerStream, minerFile.getAbsoluteFile().toPath());
if(!OS.isWindows())
minerFile.setExecutable(true);
File minerConfigFile = new File(minerFile.getParent(), MINER_CONFIG_FILE);
FileWriter minerConfig = new FileWriter(minerConfigFile);
minerConfig.append("plot_dirs:\n");
for (File path : pathList) {
if(path == null)
continue;
minerConfig.append(" - '" + path.getAbsolutePath() + "'\n");
}
minerConfig.append("url: '" + poolComboBox.getSelectedItem().toString() + "'\n");
minerConfig.append("target_deadline: " + poolMaxDeadlines.get(poolComboBox.getSelectedItem().toString()) + "\n");
if(!mineSubmitOnlyBest.isSelected())
minerConfig.append("submit_only_best: false\n");
minerConfig.append("cpu_threads: " + (cpusToMineComboBox.getSelectedIndex()+1) + "\n");
minerConfig.append("cpu_worker_task_count: " + (cpusToMineComboBox.getSelectedIndex()+1) + "\n");
minerConfig.append("additional_headers: \n");
minerConfig.append(" \"x-miner\" : \"btdex-" + Globals.getInstance().getVersion() + "\" \n");
if(mineUseDirectIO.isSelected()) {
minerConfig.append("hdd_use_direct_io: true # default true\n");
} else {
minerConfig.append("hdd_use_direct_io: false # default true\n");
}
logger.info("Copying miner config to {}", minerConfigFile.getAbsolutePath());
IOUtils.copy(minerConfigStream, minerConfig);
minerConfig.close();
} catch (IOException ex) {
ex.printStackTrace();
Toast.makeText((JFrame) SwingUtilities.getWindowAncestor(this), ex.getMessage(), Toast.Style.ERROR).display();
mining = false;
return;
}
MineThread mineThread = new MineThread();
mineThread.start();
}
class MineThread extends Thread {
public void run() {
try {
String cmd = minerFile.getAbsolutePath() + " -c " + MINER_CONFIG_FILE;
logger.info("Running miner with '{}'", cmd);
minerProcess = Runtime.getRuntime().exec(cmd, null, minerFile.getParentFile());
InputStream stdIn = minerProcess.getInputStream();
InputStreamReader isr = new InputStreamReader(stdIn);
BufferedReader br = new BufferedReader(isr);
while (minerProcess.isAlive()) {
String line = br.readLine();
if(line != null)
addToConsole(MINER_APP, line);
}
mining = false;
minerFile.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
};
private void addToConsole(String app, String line) {
logger.info("{} {}", app, line);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// lets have a limit of 400 lines
int numLinesToTrunk = console.getLineCount() - 400;
if(numLinesToTrunk > 0) {
try {
int posOfLastLineToTrunk = console.getLineEndOffset(numLinesToTrunk - 1);
console.replaceRange("",0,posOfLastLineToTrunk);
}
catch (BadLocationException ex) {
ex.printStackTrace();
}
}
Date now = new Date(System.currentTimeMillis());
console.append(app);
console.append(" ");
console.append(TIME_FORMAT.format(now));
console.append(" ");
console.append(line);
console.append("\n");
console.setCaretPosition(console.getDocument().getLength());
}
});
}
}
| 50,108
|
Java
|
.java
|
btdex/btdex
| 58
| 32
| 63
|
2019-05-12T21:24:47Z
|
2024-01-07T10:04:26Z
|
1ee359f89b3684b88ea15016d5520959b9a9678c1002df7a0079c67c6e59945a
|
[] |
[
1337,
18389,
669,
51,
1726,
64,
222,
222,
485,
924,
18389,
669,
51,
6925,
51,
12687,
51,
378,
64,
222,
222,
485,
1401,
51,
8236,
51,
7263,
2362,
64,
222,
485,
1401,
51,
8236,
51,
9884,
64,
222,
485,
1401,
51,
8236,
51,
4078,
2362,
64,
222,
485,
1401,
51,
8236,
51,
48532,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
18126,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
17317,
64,
222,
485,
1401,
51,
735,
51,
35094,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
2365,
64,
222,
485,
1401,
51,
735,
51,
36202,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
735,
51,
6989,
64,
222,
485,
1401,
51,
735,
51,
6989,
3314,
64,
222,
485,
1401,
51,
735,
51,
6124,
2807,
991,
64,
222,
485,
1401,
51,
1317,
51,
6344,
64,
222,
485,
1401,
51,
1317,
51,
1282,
45325,
64,
222,
485,
1401,
51,
11780,
51,
21042,
64,
222,
485,
1401,
51,
11780,
51,
3945,
2888,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
3852,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
1233,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
8109,
4014,
2846,
64,
222,
485,
1401,
51,
4386,
51,
16591,
6124,
64,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
6124,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
3580,
64,
222,
222,
485,
3698,
51,
5934,
51,
7263,
2232,
64,
222,
485,
3698,
51,
5934,
51,
30400,
64,
222,
485,
3698,
51,
5934,
51,
2930,
64,
222,
485,
3698,
51,
5934,
51,
32880,
64,
222,
485,
3698,
51,
5934,
51,
79,
13592,
64,
222,
485,
3698,
51,
5934,
51,
79,
11248,
64,
222,
485,
3698,
51,
5934,
51,
79,
45617,
64,
222,
485,
3698,
51,
5934,
51,
79,
2163,
64,
222,
485,
3698,
51,
5934,
51,
22786,
64,
222,
485,
3698,
51,
5934,
51,
49072,
64,
222,
485,
3698,
51,
5934,
51,
32273,
64,
222,
485,
3698,
51,
5934,
51,
79,
29314,
64,
222,
485,
3698,
51,
5934,
51,
4638,
113,
1411,
64,
222,
485,
3698,
51,
5934,
51,
79,
26974,
64,
222,
485,
3698,
51,
5934,
51,
31845,
64,
222,
485,
3698,
51,
5934,
51,
16153,
13392,
64,
222,
485,
3698,
51,
5934,
51,
1585,
51,
25211,
64,
222,
485,
3698,
51,
5934,
51,
1585,
51,
17089,
64,
222,
485,
3698,
51,
5934,
51,
897,
51,
8421,
2941,
1002,
64,
222,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
2354,
2769,
64,
222,
485,
1105,
51,
2121,
51,
7506,
51,
769,
57,
111,
51,
1353,
1590,
64,
222,
485,
1105,
51,
2121,
51,
7506,
51,
769,
57,
111,
51,
3716,
64,
222,
222,
485,
785,
51,
2193,
51,
19968,
51,
2541,
1325,
64,
222,
485,
785,
51,
2193,
51,
19968,
51,
20587,
64,
222,
485,
785,
51,
2193,
51,
19968,
51,
2541,
2837,
64,
222,
222,
485,
18389,
51,
9195,
64,
222,
485,
18389,
669,
51,
1284,
51,
27498,
289,
1230,
64,
222,
485,
18389,
669,
51,
1284,
51,
5238,
64,
222,
485,
18389,
669,
51,
1284,
51,
21402,
64,
222,
485,
18389,
669,
51,
1284,
51,
1936,
25332,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
3399,
397,
2455,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
3399,
397,
899,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
2003,
51,
3354,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
2003,
51,
2246,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
2003,
51,
2944,
318,
1139,
64,
222,
485,
2613,
397,
111,
51,
2244,
51,
2003,
51,
4331,
64,
222,
485,
362,
721,
1521,
51,
1058,
51,
2653,
64,
222,
485,
31617,
56,
51,
7573,
15120,
64,
222,
485,
31617,
56,
51,
1123,
64,
222,
485,
31617,
56,
51,
1416,
64,
222,
222,
942,
462,
7535,
318,
3686,
2041,
22299,
4584,
41931,
49,
5621,
2239,
320,
499,
221,
2072,
924,
1175,
648,
508,
100,
47396,
100,
4697,
299,
244,
56,
64,
222,
221,
2072,
924,
1175,
1964,
27112,
100,
76,
3077,
299,
244,
54,
53,
60,
56,
60,
57,
54,
61,
55,
57,
81,
64,
222,
221,
2072,
924,
1175,
1964,
6944,
16436,
100,
2124,
100,
70,
100,
10012,
1973,
299,
244,
55,
59,
55,
54,
57,
57,
81,
64,
499,
221,
2072,
924,
910,
39039,
100,
3217,
299,
1189,
51,
12712,
459,
1874,
51,
735,
51,
30580,
742,
499,
221,
2072,
924,
1175,
910,
29455,
100,
46643,
100,
4088,
299,
332,
3570,
1233,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
46643,
100,
14904,
299,
332,
3570,
1233,
2610,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
46643,
100,
5889,
100,
2999,
2354,
299,
332,
3570,
12020,
3995,
116,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
46643,
100,
9950,
100,
1213,
4616,
299,
332,
3570,
20815,
2253,
595,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
82,
3142,
100,
9950,
100,
1213,
4616,
299,
332,
6758,
20815,
2253,
595,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
82,
3142,
100,
13003,
100,
45600,
299,
332,
6758,
4505,
15050,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
4697,
546,
100,
23124,
299,
332,
36385,
4227,
884,
222,
221,
2072,
924,
1175,
910,
29455,
100,
4697,
546,
100,
13237,
100,
7393,
299,
332,
36385,
4754,
2148,
884,
310,
964,
924,
1175,
910,
29455,
100,
4697,
546,
100,
4866,
100,
9672,
100,
2354,
299,
332,
36385,
4404,
7003,
2354,
884,
499,
221,
2072,
924,
1175,
910,
14861,
1212,
100,
6876,
299,
7195,
46643,
2933,
41819,
222,
221,
2072,
924,
1175,
910,
14369,
546,
100,
6876,
299,
7195,
4697,
546,
41819,
499,
221,
2072,
924,
27194,
16729,
100,
9309,
299,
556,
27194,
459,
13009,
63,
2861,
63,
441,
742,
499,
221,
2072,
924,
1175,
2050,
2365,
14861,
1212,
100,
3555,
100,
13382,
299,
556,
2050
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
485,
1401,
51,
8236,
51,
48532,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
18126,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
17317,
64,
222,
485,
1401,
51,
735,
51,
35094,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
2365,
64,
222,
485,
1401,
51,
735,
51,
36202,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
735,
51,
6989,
64,
222,
485,
1401,
51,
735,
51,
6989,
3314,
64,
222,
485,
1401,
51,
735,
51,
6124,
2807,
991,
64,
222,
485,
1401,
51,
1317,
51,
6344,
64,
222,
485,
1401,
51,
1317,
51,
1282,
45325,
64,
222,
485,
1401,
51,
11780,
51,
21042,
64,
222,
485,
1401,
51,
11780,
51,
3945,
2888,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
3852,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
1233,
64,
222,
485,
1401,
51,
11780,
51,
781,
51,
8109,
4014,
2846,
64,
222,
485,
1401,
51,
4386,
51,
16591,
6124,
64,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
6124,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
3580,
64,
222,
222,
485,
3698,
51,
5934,
51,
7263,
2232,
64,
222,
485,
3698,
51,
5934,
51,
30400,
64,
222,
485,
3698,
51,
5934,
51,
2930,
64,
222,
485,
3698,
51,
5934,
51,
32880,
64,
222,
485,
3698,
51,
5934,
51,
79,
13592,
64,
222,
485,
3698,
51,
5934,
51,
79,
11248,
64,
222,
485,
3698,
51,
5934,
51,
79
] | -6,406,178,328,594,754,000
| true
| false
| false
| false
|
[
222,
485,
1401,
51,
11780,
51,
781,
51,
8109,
4014,
2846,
64,
222,
485,
1401,
51,
4386,
51,
16591,
6124,
64,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
6124,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
3580,
64,
222,
222,
485,
3698,
51,
5934,
51,
7263,
2232
] | 1,825,795,749,629,077,200
| true
|
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.BorderFactory
|
FileFilter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.BorderFactory
|
net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.BorderFactory
|
import java.nio.file.StandardCopyOption;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.BorderFactory
|
;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.J
|
default#73181#109#154.java
|
/FileExtraction/Java_unseen/UCL-CREST_Siamese/references/bcb_chosen_clones/default#73181#109#154.java
|
public static void add100RowsToTargetDB(int block) {
Scanner source = null;
Connection connection = null;
try {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dbUrl = "jdbc:odbc:conn";
connection = DriverManager.getConnection(dbUrl);
source = new Scanner(new File("D:/Priyanka/My/Data/TargetData.csv"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
int counter = 0;
source.nextLine();
int cursor = block * 100;
while (cursor != 0) {
cursor--;
source.nextLine();
}
while (source.hasNextLine() && counter < 100) {
Scanner ls = new Scanner(source.nextLine());
ls.useDelimiter(",");
String query = "INSERT INTO [CompTarget].[dbo].[ReadingsT] ([time],[reads],[writes],[sysCall],[sysRead],[sysWrite],[random1],[numExecs] ,[rchar],[wchar],[reading_id]) VALUES ";
query += "( '" + ls.next() + "', " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + +ls.nextInt() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + pkt + ")";
String query2 = "INSERT INTO [CompTarget].[dbo].[PageReadingT]([pageout],[pagedout],[pagefree],[pagescan],[pageattach],[pagein],[main_reading_id],[page_reading_id]) VALUES";
query2 += "( " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + pkt + ", " + spkt + ")";
pkt++;
spkt++;
Statement statement = ((Connection) connection).createStatement();
try {
statement.executeQuery(query);
} catch (SQLException e) {
}
try {
Statement statement2 = ((Connection) connection).createStatement();
statement2.executeQuery(query2);
} catch (SQLException e) {
}
counter++;
}
} catch (Exception e) {
e.printStackTrace();
}
}
| 2,448
|
Java
|
.java
|
UCL-CREST/Siamese
| 34
| 22
| 6
|
2016-02-08T17:54:33Z
|
2024-05-03T04:36:05Z
|
bab500af2ffd16a6fd81bf29e59202b80876810c9567417eee10b237b1084f44
|
[] |
[
283,
581,
924,
782,
1035,
54,
53,
53,
7264,
724,
2937,
2015,
45,
429,
2181,
46,
320,
310,
24386,
1932,
299,
762,
64,
310,
9475,
3401,
299,
762,
64,
310,
1614,
320,
343,
1614,
320,
419,
1727,
51,
31918,
459,
9886,
51,
14704,
51,
36825,
51,
22200,
37188,
6641,
742,
419,
910,
3100,
2226,
299,
332,
14704,
63,
36825,
63,
3795,
884,
419,
3401,
299,
10408,
1590,
51,
20712,
45,
1219,
2226,
312,
419,
1932,
299,
556,
24386,
45,
909,
2050,
459,
73,
6573,
3995,
126,
1387,
102,
52,
3781,
52,
768,
52,
2937,
768,
51,
4849,
2992,
343,
339,
2385,
327,
27322,
503,
46,
320,
419,
503,
51,
9428,
492,
343,
339,
2385,
327,
1359,
9941,
503,
46,
320,
419,
503,
51,
9428,
492,
343,
339,
343,
648,
7035,
299,
244,
53,
64,
343,
1932,
51,
46584,
492,
343,
648,
6226,
299,
2181,
338,
244,
54,
53,
53,
64,
343,
2236,
327,
7033,
882,
244,
53,
46,
320,
419,
6226,
10606,
419,
1932,
51,
46584,
492,
343,
339,
343,
2236,
327,
1876,
51,
16408,
1829,
365,
979,
7035,
350,
244,
54,
53,
53,
46,
320,
419,
24386,
12906,
299,
556,
24386,
45,
1876,
51,
46584,
1052,
419,
12906,
51,
558,
30173,
35290,
419,
910,
2487,
299,
332,
2648,
2659,
447,
1000,
2937,
14134,
18863,
14134,
2248,
2070,
89,
98,
6279,
1021,
15130,
19651,
15130,
26862,
15130,
3750,
1869,
15130,
3750,
2248,
15130,
3750,
2553,
15130,
3917,
54,
15130,
1538,
2663,
120,
98,
1737,
96,
119,
1612,
15130,
36920,
15130,
20019,
100,
333,
1156,
2757,
7216,
419,
2487,
1475,
11616,
6121,
494,
12906,
51,
1995,
365,
494,
40856,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
494,
3259,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
27290,
494,
34305,
419,
910,
2487,
55,
299,
332,
2648,
2659,
447,
1000,
2937,
14134,
18863,
14134,
1983,
19967,
89,
748,
96,
1655,
560,
15130,
1655,
105,
560,
15130,
1655,
4010,
15130,
1655,
6987,
15130,
1655,
9962,
15130,
1655,
285,
15130,
1850,
100,
20019,
100,
333,
15130,
1655,
100,
20019,
100,
333,
1156,
2757,
884,
419,
2487,
55,
1475,
11616,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
27290,
494,
3021,
332,
494,
1887,
4455,
494,
34305,
419,
27290,
3348,
419,
1887,
4455,
3348,
419,
19885,
7627,
299,
1849,
2815,
46,
3401,
566,
46002,
492,
419,
1614,
320,
547,
7627,
51,
31405,
45,
1234,
312,
419,
339,
2385,
327,
20335,
503,
46,
320,
419,
339,
419,
1614,
320,
547,
19885,
7627,
55,
299,
1849,
2815,
46,
3401,
566,
46002,
492,
547,
7627,
55,
51,
31405,
45,
1234,
55,
312,
419,
339,
2385,
327,
20335,
503,
46,
320,
419,
339,
419,
7035,
3348,
343,
339,
310,
339,
2385,
327,
1002,
503,
46,
320,
343,
503,
51,
9428,
492,
310,
339,
303,
339,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 567
|
[
299,
332,
14704,
63,
36825,
63,
3795,
884,
419,
3401,
299,
10408,
1590,
51,
20712,
45,
1219,
2226,
312,
419,
1932,
299,
556,
24386,
45,
909,
2050,
459,
73,
6573,
3995,
126,
1387,
102,
52,
3781,
52,
768,
52,
2937,
768,
51,
4849,
2992,
343,
339,
2385,
327,
27322,
503,
46,
320,
419,
503,
51,
9428,
492,
343,
339,
2385,
327,
1359,
9941,
503,
46,
320,
419,
503,
51,
9428,
492,
343,
339,
343,
648,
7035,
299,
244,
53,
64,
343,
1932,
51,
46584,
492,
343,
648,
6226,
299,
2181,
338,
244,
54,
53,
53,
64,
343,
2236,
327,
7033,
882,
244,
53,
46,
320,
419,
6226,
10606,
419,
1932,
51,
46584,
492,
343,
339,
343,
2236,
327,
1876,
51,
16408,
1829,
365,
979,
7035,
350,
244,
54,
53,
53,
46,
320,
419,
24386,
12906,
299,
556,
24386,
45,
1876,
51,
46584,
1052,
419,
12906,
51,
558,
30173,
35290,
419,
910,
2487,
299,
332,
2648,
2659,
447,
1000,
2937,
14134,
18863,
14134,
2248,
2070,
89,
98,
6279,
1021,
15130,
19651,
15130,
26862,
15130,
3750,
1869,
15130,
3750,
2248,
15130,
3750,
2553,
15130,
3917,
54,
15130,
1538,
2663,
120,
98,
1737,
96,
119,
1612,
15130,
36920,
15130,
20019,
100,
333,
1156,
2757,
7216,
419,
2487,
1475,
11616,
6121,
494,
12906,
51,
1995,
365,
494,
40856,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
494,
3259,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
12906,
51,
1995,
4090,
365,
494,
3021,
332,
494,
27290,
494,
34305,
419,
910,
2487,
55
] | 1,372,367,465,764,938,800
| true
| false
| false
| false
|
[
910,
2487,
299,
332,
2648,
2659,
447,
1000,
2937,
14134,
18863,
14134,
2248,
2070,
89,
98,
6279,
1021,
15130,
19651,
15130,
26862,
15130,
3750,
1869,
15130,
3750,
2248,
15130,
3750,
2553,
15130,
3917,
54,
15130,
1538,
2663,
120,
98,
1737,
96,
119,
1612,
15130,
36920,
15130,
20019,
100,
333,
1156,
2757,
7216,
419,
2487,
1475,
11616,
6121,
494,
12906,
51,
1995,
365,
494,
40856,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
12906,
51,
20827,
365,
494,
3021,
332,
494,
494,
3259
] | 6,378,722,412,951,533,000
| true
|
= "jdbc:odbc:conn";
connection = DriverManager.getConnection(dbUrl);
source = new Scanner(new File("D:/Priyanka/My/Data/TargetData.csv"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
int counter = 0;
source.nextLine();
int cursor = block * 100;
while (cursor!= 0) {
cursor--;
source.nextLine();
}
while (source.hasNextLine() && counter < 100) {
Scanner ls = new Scanner(source.nextLine());
ls.useDelimiter(",");
String query = "INSERT INTO [CompTarget].[dbo].[ReadingsT] ([time],[reads],[writes],[sysCall],[sysRead],[sysWrite],[random1],[numExecs],[rchar],[wchar],[reading_id]) VALUES ";
query += "( '" + ls.next() + "', " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + +ls
|
) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
int counter = 0;
source.nextLine();
int cursor = block * 100;
while (cursor!= 0) {
cursor--;
source.nextLine();
}
while (source.hasNextLine() && counter < 100) {
Scanner ls = new Scanner(source.nextLine());
ls.useDelimiter(",");
String query = "INSERT INTO [CompTarget].[dbo].[ReadingsT] ([time],[reads],[writes],[sysCall],[sysRead],[sysWrite],[random1],[numExecs],[rchar],[wchar],[reading_id]) VALUES ";
query += "( '" + ls.next() + "', " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + +ls
|
!= 0) {
cursor--;
source.nextLine();
}
while (source.hasNextLine() && counter < 100) {
Scanner ls = new Scanner(source.nextLine());
ls.useDelimiter(",");
String query = "INSERT INTO [CompTarget].[dbo].[ReadingsT] ([time],[reads],[writes],[sysCall],[sysRead],[sysWrite],[random1],[numExecs],[rchar],[wchar],[reading_id]) VALUES ";
query += "( '" + ls.next() + "', " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + +ls
|
String query = "INSERT INTO [CompTarget].[dbo].[ReadingsT] ([time],[reads],[writes],[sysCall],[sysRead],[sysWrite],[random1],[numExecs],[rchar],[wchar],[reading_id]) VALUES ";
query += "( '" + ls.next() + "', " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + ls.nextInt() + ", " + +ls
|
.nextInt() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + ls.nextDouble() + ", " + pkt + ")";
String query2
|
TestUseContainerSupport.java
|
/FileExtraction/Java_unseen/openjdk_jdk8u-dev/jdk/test/jdk/internal/platform/docker/TestUseContainerSupport.java
|
/*
* Copyright (c) 2020, Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @library /test/lib
* @build CheckUseContainerSupport
* @run main/timeout=360 TestUseContainerSupport
*/
import jdk.test.lib.Utils;
import jdk.test.lib.containers.docker.Common;
import jdk.test.lib.containers.docker.DockerRunOptions;
import jdk.test.lib.containers.docker.DockerTestUtils;
public class TestUseContainerSupport {
private static final String imageName = Common.imageName("useContainerSupport");
public static void main(String[] args) throws Exception {
if (!DockerTestUtils.canTestDocker()) {
return;
}
DockerTestUtils.buildJdkDockerImage(imageName, "Dockerfile-BasicTest", "jdk-docker");
try {
testUseContainerSupport(true);
testUseContainerSupport(false);
} finally {
DockerTestUtils.removeDockerImage(imageName);
}
}
private static void testUseContainerSupport(boolean useContainerSupport) throws Exception {
String testMsg = " with -XX:" + (useContainerSupport ? "+" : "-") + "UseContainerSupport";
Common.logNewTestCase("Test TestUseContainerSupport" + testMsg);
DockerRunOptions opts =
new DockerRunOptions(imageName, "/jdk/bin/java", "CheckUseContainerSupport");
opts.addClassOptions(Boolean.valueOf(useContainerSupport).toString());
opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/");
if (useContainerSupport) {
opts.addJavaOpts("-XX:+UseContainerSupport");
} else {
opts.addJavaOpts("-XX:-UseContainerSupport");
}
opts.addJavaOpts("-cp", "/test-classes/");
DockerTestUtils.dockerRunJava(opts).shouldHaveExitValue(0).shouldContain("TEST PASSED!!!");
}
}
| 2,846
|
Java
|
.java
|
openjdk/jdk8u-dev
| 46
| 134
| 37
|
2021-11-29T21:12:13Z
|
2024-05-09T06:19:46Z
|
d48a00c582117a319ad505c8bb302a0d4bcafa1fa97ca7c99f895867c99e25e3
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
55,
53,
49,
4777,
30044,
49,
6367,
51,
222,
338,
4103,
2387,
23740,
1895,
35234,
8995,
2387,
11988,
1895,
8968,
10961,
30441,
51,
222,
338,
222,
338,
1369,
1361,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
55,
1773,
49,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
1361,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
222,
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
222,
222,
1127,
222,
338,
496,
881,
222,
338,
496,
1386,
4443,
2894,
4417,
4666,
1414,
10238,
25867,
4019,
3322,
222,
338,
496,
5261,
536,
881,
52,
1379,
222,
338,
496,
1848,
3471,
4404,
2894,
4417,
222,
338,
496,
1967,
2594,
52,
5470,
66,
56,
59,
53,
2128,
4404,
2894,
4417,
222,
588,
222,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
2769,
64,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
12817,
51,
4219,
51,
5248,
64,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
12817,
51,
4219,
51,
11648,
2544,
2045,
64,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
12817,
51,
4219,
51,
11648,
32384,
64,
222,
222,
942,
462,
2128,
4404,
2894,
4417,
320,
303,
964,
924,
1175,
910,
1802,
577,
299,
8762,
51,
915,
577,
459,
558,
2894,
4417,
742,
465,
581,
924,
782,
2594,
45,
671,
1197,
2194,
46,
2589,
3284,
320,
310,
434,
1445,
11648,
32384,
51,
3389,
1024,
11648,
1177,
320,
343,
461,
64,
310,
339,
603,
9536,
32384,
51,
1848,
79,
4532,
11648,
1675,
45,
915,
577,
49,
332,
28676,
50,
7114,
1024,
411,
332,
12461,
50,
4219,
742,
603,
1614,
320,
343,
913,
4404,
2894,
4417,
45,
1527,
312,
343,
913,
4404,
2894,
4417,
45,
1886,
312,
310,
339,
8312,
320,
343,
9536,
32384,
51,
2564,
11648,
1675,
45,
915,
577,
312,
310,
339,
303,
339,
465,
964,
924,
782,
913,
4404,
2894,
4417,
45,
4412,
813,
2894,
4417,
46,
2589,
3284,
320,
310,
910,
913,
4104,
299,
332,
642,
449,
2931,
1941,
494,
327,
558,
2894,
4417,
1037,
332,
5688,
518,
4840,
678,
494,
332,
4404,
2894,
4417,
884,
310,
8762,
51,
769,
1827,
7246,
459,
1024,
2128,
4404,
2894,
4417,
39,
494,
913,
4104,
312,
310,
9536,
2544,
2045,
6414,
299,
419,
556,
9536,
2544,
2045,
45,
915,
577,
49,
2450,
12461,
52,
1793,
52,
1874,
411,
332,
2157,
4404,
2894,
4417,
742,
310,
6414,
51,
10056,
2045,
45,
4718,
51,
9169,
45,
558,
2894,
4417,
566,
3127,
1052,
310,
6414,
51,
688,
11648,
13107,
13715,
7259,
411,
13245,
51,
3780,
100,
37034,
494,
332,
6573,
881,
50,
4844,
38740,
310,
434,
327,
558,
2894,
4417,
46,
320,
343,
6414,
51,
688,
5445,
13107,
10364,
2931,
30041,
4404,
2894,
4417,
742,
310,
339,
832,
320,
343,
6414,
51,
688,
5445,
13107,
10364,
2931,
6012,
4404,
2894,
4417,
742,
310,
339,
310,
6414,
51,
688,
5445,
13107,
10364,
2217,
411,
2450,
881,
50,
4844,
38740,
310,
9536,
32384,
51,
4219,
2544,
5445,
45,
6375,
566,
3179,
9041,
8121,
899,
45,
53,
566,
3179,
19863,
459,
3780,
37174,
9730,
3226,
9318,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
222,
222,
1127,
222,
338,
496,
881,
222,
338,
496,
1386,
4443,
2894,
4417,
4666,
1414,
10238,
25867,
4019,
3322,
222,
338,
496,
5261,
536,
881,
52,
1379,
222,
338,
496,
1848,
3471,
4404,
2894,
4417,
222,
338,
496,
1967,
2594,
52,
5470,
66,
56,
59,
53,
2128,
4404,
2894,
4417,
222,
588,
222,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
2769,
64,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
12817,
51,
4219,
51,
5248,
64,
222,
485,
614,
4532,
51,
881,
51,
1379,
51,
12817
] | -192,678,387,611,410,340
| true
| false
| false
| false
|
[
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
222,
222,
1127,
222,
338,
496,
881,
222,
338,
496,
1386,
4443,
2894,
4417,
4666,
1414,
10238,
25867,
4019,
3322,
222,
338,
496,
5261,
536,
881,
52,
1379,
222,
338,
496,
1848,
3471,
4404,
2894,
4417,
222,
338,
496,
1967
] | -5,426,205,365,307,904,000
| true
|
the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @library /test/lib
* @build CheckUseContainerSupport
* @run
|
MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @library /test/lib
* @build CheckUseContainerSupport
* @run
|
received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @library /test/lib
* @build CheckUseContainerSupport
* @run
|
0-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary UseContainerSupport flag should reflect Metrics being available
* @library /test/lib
* @build CheckUseContainerSupport
* @run
|
main/timeout=360 TestUseContainerSupport
*/
import jdk.test.lib.Utils;
import jdk.test.lib.containers.docker.Common;
import jdk.test.lib.containers
|
ProposedDeviceCellRenderer.java
|
/FileExtraction/Java_unseen/mnit-rtmc_iris/src/us/mn/state/dot/tms/client/incident/ProposedDeviceCellRenderer.java
|
/*
* IRIS -- Intelligent Roadway Information System
* Copyright (C) 2016 Minnesota Department of Transportation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
package us.mn.state.dot.tms.client.incident;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import us.mn.state.dot.tms.Device;
import us.mn.state.dot.tms.DMS;
import us.mn.state.dot.tms.LCSArray;
import us.mn.state.dot.tms.client.Session;
/**
* Proposed device cell renderer.
*
* @author Douglas Lau
*/
public class ProposedDeviceCellRenderer implements ListCellRenderer<Device> {
/** List cell renderer */
private final DefaultListCellRenderer cell =
new DefaultListCellRenderer();
/** List for configuring LCS cell renderer */
private final JList<LCSArray> lcs_list = new JList<LCSArray>();
/** List for configuring DMS cell renderer */
private final JList<DMS> dms_list = new JList<DMS>();
/** LCS array cell renderer */
private final ProposedLcsCellRenderer lcs_renderer;
/** DMS cell renderer */
private final ProposedDmsCellRenderer dms_renderer;
/** Create a new proposed LCS array cell renderere */
public ProposedDeviceCellRenderer(Session s, DeviceDeployModel m) {
lcs_renderer = new ProposedLcsCellRenderer(s, m);
dms_renderer = new ProposedDmsCellRenderer(s, m);
}
/** Get component to render a device.
*
* @param list JList to renderer.
* @param value Device to render.
* @param index List index of the device.
* @param isSelected Is the device selected?
* @param cellHasFocus Does the device have focus?
* @return Component for rendering. */
@Override
public Component getListCellRendererComponent(
JList<? extends Device> list, Device value, int index,
boolean isSelected, boolean cellHasFocus)
{
if (value instanceof LCSArray) {
LCSArray lcs = (LCSArray) value;
return lcs_renderer.getListCellRendererComponent(
lcs_list, lcs, index, isSelected, cellHasFocus);
}
if (value instanceof DMS) {
DMS dms = (DMS) value;
return dms_renderer.getListCellRendererComponent(
dms_list, dms, index, isSelected, cellHasFocus);
}
return cell.getListCellRendererComponent(list, value, index,
isSelected, cellHasFocus);
}
}
| 2,763
|
Java
|
.java
|
mnit-rtmc/iris
| 40
| 17
| 26
|
2019-08-14T18:16:40Z
|
2024-05-08T17:08:16Z
|
9cc9a57421568817ddf7c6d8eebdc0c129d9f7333799f345bb8d28e7cceda2c8
|
[] |
[
1127,
222,
338,
14095,
1309,
790,
2871,
44433,
29007,
3094,
10422,
1189,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
59,
244,
7535,
13488,
5735,
24481,
451,
23597,
387,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
588,
222,
1337,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
1598,
51,
31546,
64,
222,
222,
485,
1401,
51,
8236,
51,
1735,
64,
222,
485,
3698,
51,
5934,
51,
2061,
739,
2917,
6470,
64,
222,
485,
3698,
51,
5934,
51,
79,
739,
64,
222,
485,
3698,
51,
5934,
51,
739,
2917,
6470,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
3046,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
73,
2758,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
81,
3765,
1280,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
1598,
51,
3152,
64,
222,
222,
1350,
222,
338,
1330,
6865,
3313,
4046,
13095,
51,
222,
338,
222,
338,
496,
2133,
493,
663,
38666,
517,
4474,
222,
588,
222,
942,
462,
1330,
6865,
3046,
2917,
6470,
4584,
1701,
2917,
6470,
65,
3046,
67,
320,
499,
221,
1350,
1701,
4046,
13095,
588,
222,
221,
2072,
1175,
4119,
739,
2917,
6470,
4046,
299,
376,
221,
909,
4119,
739,
2917,
6470,
492,
499,
221,
1350,
1701,
456,
33107,
517,
3765,
4046,
13095,
588,
222,
221,
2072,
1175,
990,
739,
65,
81,
3765,
1280,
67,
34565,
100,
687,
299,
556,
990,
739,
65,
81,
3765,
1280,
2938,
499,
221,
1350,
1701,
456,
33107,
493,
2758,
4046,
13095,
588,
222,
221,
2072,
1175,
990,
739,
65,
73,
2758,
67,
362,
893,
100,
687,
299,
556,
990,
739,
65,
73,
2758,
2938,
499,
221,
1350,
517,
3765,
1437,
4046,
13095,
588,
222,
221,
2072,
1175,
1330,
6865,
81,
1766,
2917,
6470,
34565,
100,
9405,
64,
499,
221,
1350,
493,
2758,
4046,
13095,
588,
222,
221,
2072,
1175,
1330,
6865,
73,
893,
2917,
6470,
362,
893,
100,
9405,
64,
499,
221,
1350,
2673,
331,
556,
17945,
517,
3765,
1437,
4046,
2922,
767,
588,
222,
221,
942,
1330,
6865,
3046,
2917,
6470,
45,
3152,
328,
49,
9151,
8256,
1262,
364,
46,
320,
376,
221,
11155,
100,
9405,
299,
556,
1330,
6865,
81,
1766,
2917,
6470,
45,
120,
49,
364,
312,
376,
221,
105,
893,
100,
9405,
299,
556,
1330,
6865,
73,
893,
2917,
6470,
45,
120,
49,
364,
312,
222,
221,
130,
499,
221,
1350,
1408,
2595,
391,
2922,
331,
3313,
51,
376,
338,
376,
338,
496,
772,
1168,
2052,
990,
739,
391,
13095,
51,
376,
338,
496,
772,
804,
282,
9151,
391,
2922,
51,
376,
338,
496,
772,
1671,
282,
1701,
1671,
451,
341,
3313,
51,
376,
338,
496,
772,
458,
4559,
283,
3626,
341,
3313,
4337,
68,
376,
338,
496,
772,
4046,
4008,
8105,
244,
12901,
341,
3313,
1178,
9291,
68,
376,
338,
496,
620,
2868,
5715,
456,
13595,
51,
588,
222,
221,
69,
1806,
222,
221,
942,
5715,
40911,
2917,
6470,
1735,
45,
376,
221,
79,
739,
1907,
2041,
9151,
67,
1168,
49,
9151,
804,
49,
648,
1671,
49,
376,
221,
4412,
458,
4559,
49,
1922,
4046,
4008,
8105,
46,
222,
221,
128,
376,
221,
344,
327,
872,
5118,
517,
3765,
1280,
46,
320,
374,
221,
81,
3765,
1280,
34565,
299,
327,
81,
3765,
1280,
46,
804,
64,
374,
221,
620,
34565,
100,
9405,
51,
29376,
2917,
6470,
1735,
45,
621,
221,
11155,
100,
687,
49,
34565,
49,
1671,
49,
458,
4559,
49,
4046,
4008,
8105,
312,
376,
221,
130,
376,
221,
344,
327,
872,
5118,
493,
2758,
46,
320,
374,
221,
73,
2758,
362,
893,
299,
327,
73,
2758,
46,
804,
64,
374,
221,
620,
362,
893,
100,
9405,
51,
29376,
2917,
6470,
1735,
45,
621,
221,
105,
893,
100,
687,
49,
362,
893,
49,
1671,
49,
458,
4559,
49,
4046,
4008,
8105,
312,
376,
221,
130,
376,
221,
620,
4046,
51,
29376,
2917,
6470,
1735,
45,
687,
49,
804,
49,
1671,
49,
374,
221,
34103,
49,
4046,
4008,
8105,
312,
222,
221,
130,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 786
|
[
739,
65,
73,
2758,
2938,
499,
221,
1350,
517,
3765,
1437,
4046,
13095,
588,
222,
221,
2072,
1175,
1330,
6865,
81,
1766,
2917,
6470,
34565,
100,
9405,
64,
499,
221,
1350,
493,
2758,
4046,
13095,
588,
222,
221,
2072,
1175,
1330,
6865,
73,
893,
2917,
6470,
362,
893,
100,
9405,
64,
499,
221,
1350,
2673,
331,
556,
17945,
517,
3765,
1437,
4046,
2922,
767,
588,
222,
221,
942,
1330,
6865,
3046,
2917,
6470,
45,
3152,
328,
49,
9151,
8256,
1262,
364,
46,
320,
376,
221,
11155,
100,
9405,
299,
556,
1330,
6865,
81,
1766,
2917,
6470,
45,
120,
49,
364,
312,
376,
221,
105,
893,
100,
9405,
299,
556,
1330,
6865,
73,
893,
2917,
6470,
45,
120,
49,
364,
312,
222,
221,
130,
499,
221,
1350,
1408,
2595,
391,
2922,
331,
3313,
51,
376,
338,
376,
338,
496,
772,
1168,
2052,
990,
739,
391,
13095,
51,
376,
338,
496,
772,
804,
282,
9151,
391,
2922,
51,
376,
338,
496,
772,
1671,
282,
1701,
1671,
451,
341,
3313,
51,
376,
338,
496,
772,
458,
4559,
283,
3626,
341,
3313,
4337,
68,
376,
338,
496,
772,
4046,
4008,
8105,
244,
12901,
341,
3313,
1178,
9291,
68,
376,
338,
496,
620,
2868,
5715,
456,
13595,
51,
588,
222,
221,
69,
1806,
222,
221,
942,
5715,
40911,
2917,
6470,
1735,
45,
376,
221,
79,
739,
1907,
2041,
9151,
67,
1168,
49,
9151,
804,
49,
648,
1671,
49,
376,
221,
4412,
458,
4559,
49,
1922,
4046,
4008,
8105,
46,
222,
221,
128,
376,
221,
344,
327,
872,
5118,
517,
3765,
1280,
46,
320,
374,
221,
81,
3765,
1280,
34565,
299,
327,
81,
3765,
1280,
46,
804,
64,
374,
221,
620,
34565,
100,
9405,
51,
29376,
2917,
6470,
1735,
45,
621,
221,
11155,
100,
687,
49,
34565,
49,
1671,
49,
458,
4559,
49,
4046,
4008,
8105
] | 4,798,756,094,397,921,000
| true
| false
| false
| false
|
[
804,
282,
9151,
391,
2922,
51,
376,
338,
496,
772,
1671,
282,
1701,
1671,
451,
341,
3313,
51,
376,
338,
496,
772,
458,
4559,
283,
3626,
341,
3313,
4337,
68,
376,
338,
496,
772,
4046,
4008,
8105,
244,
12901,
341,
3313,
1178,
9291,
68,
376,
338,
496,
620,
2868,
5715,
456,
13595,
51,
588,
222,
221,
69,
1806,
222,
221,
942,
5715,
40911,
2917,
6470,
1735,
45,
376,
221,
79,
739,
1907,
2041,
9151,
67,
1168,
49,
9151,
804,
49,
648,
1671,
49,
376,
221,
4412,
458,
4559,
49,
1922,
4046,
4008,
8105,
46,
222,
221,
128,
376,
221,
344
] | 5,212,877,117,923,071,000
| true
|
List<DMS>();
/** LCS array cell renderer */
private final ProposedLcsCellRenderer lcs_renderer;
/** DMS cell renderer */
private final ProposedDmsCellRenderer dms_renderer;
/** Create a new proposed LCS array cell renderere */
public ProposedDeviceCellRenderer(Session s, DeviceDeployModel m) {
lcs_renderer = new ProposedLcsCellRenderer(s, m);
dms_renderer = new ProposedDmsCellRenderer(s, m);
}
/** Get component to render a device.
*
* @param list JList to renderer.
* @param value Device to render.
* @param index List index of the device.
* @param isSelected Is the device selected?
* @param cellHasFocus Does the device have focus?
* @return Component for rendering. */
@Override
public Component getListCellRendererComponent(
JList<? extends Device> list, Device value, int index,
boolean isSelected, boolean cellHasFocus)
{
if
|
;
/** Create a new proposed LCS array cell renderere */
public ProposedDeviceCellRenderer(Session s, DeviceDeployModel m) {
lcs_renderer = new ProposedLcsCellRenderer(s, m);
dms_renderer = new ProposedDmsCellRenderer(s, m);
}
/** Get component to render a device.
*
* @param list JList to renderer.
* @param value Device to render.
* @param index List index of the device.
* @param isSelected Is the device selected?
* @param cellHasFocus Does the device have focus?
* @return Component for rendering. */
@Override
public Component getListCellRendererComponent(
JList<? extends Device> list, Device value, int index,
boolean isSelected, boolean cellHasFocus)
{
if
|
);
dms_renderer = new ProposedDmsCellRenderer(s, m);
}
/** Get component to render a device.
*
* @param list JList to renderer.
* @param value Device to render.
* @param index List index of the device.
* @param isSelected Is the device selected?
* @param cellHasFocus Does the device have focus?
* @return Component for rendering. */
@Override
public Component getListCellRendererComponent(
JList<? extends Device> list, Device value, int index,
boolean isSelected, boolean cellHasFocus)
{
if
|
value Device to render.
* @param index List index of the device.
* @param isSelected Is the device selected?
* @param cellHasFocus Does the device have focus?
* @return Component for rendering. */
@Override
public Component getListCellRendererComponent(
JList<? extends Device> list, Device value, int index,
boolean isSelected, boolean cellHasFocus)
{
if
|
(value instanceof LCSArray) {
LCSArray lcs = (LCSArray) value;
return lcs_renderer.getListCellRendererComponent(
lcs_list, lcs, index, isSelected, cellHasFocus
|
RoleDisciplineSecurityLevelRefVoCollection.java
|
/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace-archive/ValueObjects/src/ims/ocrr/configuration/vo/RoleDisciplineSecurityLevelRefVoCollection.java
|
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.ocrr.configuration.vo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import ims.framework.enumerations.SortOrder;
/**
* Linked to OCRR.Configuration.RoleDisciplineSecurityLevel business object (ID: 1061100020).
*/
public class RoleDisciplineSecurityLevelRefVoCollection extends ims.vo.ValueObjectCollection implements ims.domain.IDomainCollectionGetter, ims.vo.ImsCloneable, Iterable<RoleDisciplineSecurityLevelRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<RoleDisciplineSecurityLevelRefVo> col = new ArrayList<RoleDisciplineSecurityLevelRefVo>();
public final String getBoClassName()
{
return "ims.ocrr.configuration.domain.objects.RoleDisciplineSecurityLevel";
}
public ims.domain.IDomainGetter[] getIDomainGetterItems()
{
ims.domain.IDomainGetter[] result = new ims.domain.IDomainGetter[col.size()];
col.toArray(result);
return result;
}
public boolean add(RoleDisciplineSecurityLevelRefVo value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
return this.col.add(value);
}
return false;
}
public boolean add(int index, RoleDisciplineSecurityLevelRefVo value)
{
if(value == null)
return false;
if(this.col.indexOf(value) < 0)
{
this.col.add(index, value);
return true;
}
return false;
}
public void clear()
{
this.col.clear();
}
public void remove(int index)
{
this.col.remove(index);
}
public int size()
{
return this.col.size();
}
public int indexOf(RoleDisciplineSecurityLevelRefVo instance)
{
return col.indexOf(instance);
}
public RoleDisciplineSecurityLevelRefVo get(int index)
{
return this.col.get(index);
}
public boolean set(int index, RoleDisciplineSecurityLevelRefVo value)
{
if(value == null)
return false;
this.col.set(index, value);
return true;
}
public void remove(RoleDisciplineSecurityLevelRefVo instance)
{
if(instance != null)
{
int index = indexOf(instance);
if(index >= 0)
remove(index);
}
}
public boolean contains(RoleDisciplineSecurityLevelRefVo instance)
{
return indexOf(instance) >= 0;
}
public Object clone()
{
RoleDisciplineSecurityLevelRefVoCollection clone = new RoleDisciplineSecurityLevelRefVoCollection();
for(int x = 0; x < this.col.size(); x++)
{
if(this.col.get(x) != null)
clone.col.add((RoleDisciplineSecurityLevelRefVo)this.col.get(x).clone());
else
clone.col.add(null);
}
return clone;
}
public boolean isValidated()
{
return true;
}
public String[] validate()
{
return null;
}
public RoleDisciplineSecurityLevelRefVo[] toArray()
{
RoleDisciplineSecurityLevelRefVo[] arr = new RoleDisciplineSecurityLevelRefVo[col.size()];
col.toArray(arr);
return arr;
}
public RoleDisciplineSecurityLevelRefVoCollection sort()
{
return sort(SortOrder.ASCENDING);
}
public RoleDisciplineSecurityLevelRefVoCollection sort(SortOrder order)
{
return sort(new RoleDisciplineSecurityLevelRefVoComparator(order));
}
@SuppressWarnings("unchecked")
public RoleDisciplineSecurityLevelRefVoCollection sort(Comparator comparator)
{
Collections.sort(this.col, comparator);
return this;
}
public Iterator<RoleDisciplineSecurityLevelRefVo> iterator()
{
return col.iterator();
}
@Override
protected ArrayList getTypedCollection()
{
return col;
}
private class RoleDisciplineSecurityLevelRefVoComparator implements Comparator
{
private int direction = 1;
public RoleDisciplineSecurityLevelRefVoComparator()
{
this(SortOrder.ASCENDING);
}
public RoleDisciplineSecurityLevelRefVoComparator(SortOrder order)
{
if (order == SortOrder.DESCENDING)
{
this.direction = -1;
}
}
public int compare(Object obj1, Object obj2)
{
RoleDisciplineSecurityLevelRefVo voObj1 = (RoleDisciplineSecurityLevelRefVo)obj1;
RoleDisciplineSecurityLevelRefVo voObj2 = (RoleDisciplineSecurityLevelRefVo)obj2;
return direction*(voObj1.compareTo(voObj2));
}
}
}
| 5,695
|
Java
|
.java
|
IMS-MAXIMS/openMAXIMS
| 61
| 50
| 23
|
2014-06-12T12:04:02Z
|
2020-07-31T09:34:49Z
|
447e2fb8e0167b6da9dd800b8374db96cd71784b9ef89ca2cb0c14361557e544
|
[] |
[
325,
19989,
8689,
222,
16802,
42053,
607,
222,
16802,
244,
2657,
327,
72,
46,
350,
55,
53,
54,
57,
67,
244,
350,
2348,
88,
7490,
2348,
88,
67,
22768,
607,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
281,
607,
222,
16802,
244,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
2281,
607,
222,
16802,
244,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
981,
607,
222,
16802,
244,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
10094,
607,
244,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
2052,
607,
222,
16802,
244,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
2281,
607,
222,
16802,
244,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
1485,
607,
222,
16802,
244,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
7223,
607,
222,
16802,
42053,
607,
222,
16802,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
607,
222,
16802,
244,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
283,
607,
222,
16802,
42053,
607,
222,
325,
19989,
8689,
222,
16802,
10207,
77,
222,
325,
1369,
1361,
1616,
4741,
829,
11489,
39305,
643,
290,
21100,
1493,
457,
2758,
15606,
10584,
327,
1687,
244,
54,
51,
61,
53,
1984,
244,
58,
53,
53,
60,
51,
55,
58,
60,
58,
54,
46,
222,
325,
2657,
327,
72,
46,
244,
54,
62,
62,
58,
50,
55,
53,
54,
57,
457,
2758,
7490,
2348,
88,
51,
3381,
4760,
5225,
51,
222,
325,
18226,
63,
4103,
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
561,
609,
51,
5990,
51,
2103,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
18676,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
3987,
120,
51,
2863,
51,
3880,
284,
1014,
51,
45115,
64,
222,
222,
1350,
222,
338,
18218,
391,
565,
3769,
87,
51,
2339,
51,
4555,
1744,
40772,
5196,
2671,
12609,
1319,
327,
798,
63,
244,
54,
53,
59,
54,
54,
53,
53,
53,
55,
53,
566,
222,
588,
222,
942,
462,
13936,
1744,
40772,
5196,
2671,
2099,
12536,
2272,
2041,
3987,
120,
51,
2103,
51,
43984,
2272,
4584,
3987,
120,
51,
4136,
51,
798,
2182,
2272,
11722,
49,
3987,
120,
51,
2103,
51,
78,
893,
11533,
463,
49,
19208,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
67,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
2072,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
67,
956,
299,
556,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
2938,
222,
221,
942,
1175,
910,
640,
5558,
8478,
365,
222,
221,
128,
376,
221,
620,
332,
16178,
51,
561,
609,
51,
5990,
51,
4136,
51,
5754,
51,
4555,
1744,
40772,
5196,
2671,
884,
222,
221,
130,
222,
221,
942,
3987,
120,
51,
4136,
51,
798,
2182,
11722,
1197,
640,
798,
2182,
11722,
3648,
365,
222,
221,
128,
376,
221,
16178,
51,
4136,
51,
798,
2182,
11722,
1197,
1074,
299,
556,
3987,
120,
51,
4136,
51,
798,
2182,
11722,
96,
770,
51,
911,
22061,
376,
221,
770,
51,
14315,
45,
1285,
312,
376,
221,
620,
1074,
64,
222,
221,
130,
222,
221,
942,
1922,
1035,
45,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
804,
46,
222,
221,
128,
376,
221,
344,
45,
872,
630,
762,
46,
374,
221,
620,
920,
64,
376,
221,
344,
45,
597,
51,
770,
51,
7149,
45,
872,
46,
350,
244,
53,
46,
376,
221,
128,
374,
221,
620,
477,
51,
770,
51,
688,
45,
872,
312,
376,
221,
130,
376,
221,
620,
920,
64,
222,
221,
130,
222,
221,
942,
1922,
1035,
45,
429,
1671,
49,
13936,
1744,
40772,
5196,
2671,
2099,
12536,
804,
46,
222,
221,
128,
376,
221,
344,
45,
872,
630,
762,
46,
374,
221,
620,
920,
64,
376,
221,
344,
45,
597,
51,
770,
51,
7149,
45,
872,
46,
350,
244,
53,
46,
376,
221,
128,
374,
221,
597,
51,
770,
51,
688,
45,
1076,
49,
804,
312,
374,
221,
620,
878,
64,
376,
221,
130,
376,
221,
620,
920,
64,
222,
221,
130,
222,
221,
942,
782,
4250,
365,
222,
221,
128,
376,
221,
597,
51,
770,
51,
3830,
492,
222,
221,
130,
222,
221,
942,
782,
3365,
45,
429,
1671,
46,
222,
221,
128,
376,
221,
597,
51,
770,
51,
2564,
45,
1076,
312,
222,
221,
130,
222,
221,
942,
648,
1354,
365,
222,
221,
128,
376,
221,
620,
477,
51,
770,
51,
911,
492,
222,
221,
130,
222,
221,
942,
648,
40597,
45,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
1998,
46,
222,
221,
128,
376,
221,
620,
956,
51,
7149,
45,
2403,
312,
222,
221,
130,
222,
221,
942,
13936,
1744,
40772,
5196,
2671,
2099,
12536,
640,
45,
429,
1671,
46,
222,
221,
128,
376,
221,
620,
477,
51,
770,
51,
390,
45,
1076,
312,
222,
221,
130,
222,
221,
942,
1922,
758,
45,
429,
1671,
49,
13936,
1744,
40772,
5196,
2671,
2099,
12536,
804,
46,
222,
221,
128,
376,
221,
344,
45,
872,
630,
762,
46,
374,
221,
620,
920,
64,
376,
221,
597,
51,
770,
51,
489,
45,
1076,
49,
804,
312,
376,
221,
620,
878,
64,
222,
221,
130,
222,
221,
942,
782,
3365,
45,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
1998,
46,
222,
221,
128,
376,
221,
344,
45,
2403,
882,
762,
46,
376,
221,
128,
374,
221,
429,
1671,
299,
40597,
45,
2403,
312,
374,
221,
344,
45,
1076,
2394,
244,
53,
46,
621,
221,
2564,
45,
1076,
312,
376,
221,
130,
222,
221,
130,
222,
221,
942,
1922,
4326,
45,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
1998,
46,
222,
221,
128,
376,
221,
620,
40597,
45,
2403,
46,
2394,
244,
53,
64,
222,
221,
130,
222,
221,
942,
2210,
7905
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
4103,
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
561,
609,
51,
5990,
51,
2103,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
18676,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
3987,
120,
51,
2863,
51,
3880,
284,
1014,
51,
45115,
64,
222,
222,
1350,
222,
338,
18218,
391,
565,
3769,
87,
51,
2339,
51,
4555,
1744,
40772,
5196,
2671,
12609,
1319,
327,
798,
63,
244,
54,
53,
59,
54,
54,
53,
53,
53,
55,
53,
566,
222,
588,
222,
942,
462,
13936,
1744,
40772,
5196,
2671,
2099,
12536,
2272,
2041,
3987,
120,
51,
2103,
51,
43984,
2272,
4584,
3987,
120,
51,
4136,
51,
798,
2182,
2272,
11722,
49,
3987,
120,
51,
2103,
51,
78,
893,
11533,
463,
49,
19208,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
67,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
2072,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
67,
956,
299,
556,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
2938,
222,
221,
942,
1175,
910,
640,
5558,
8478,
365,
222,
221,
128,
376,
221,
620,
332,
16178,
51,
561,
609,
51,
5990,
51,
4136,
51,
5754,
51,
4555,
1744,
40772,
5196,
2671,
884,
222,
221,
130,
222,
221,
942,
3987,
120,
51,
4136,
51,
798,
2182,
11722,
1197,
640,
798,
2182,
11722,
3648,
365,
222,
221,
128,
376,
221,
16178,
51,
4136,
51,
798,
2182,
11722,
1197,
1074,
299,
556,
3987,
120,
51,
4136,
51,
798,
2182,
11722,
96,
770,
51,
911,
22061,
376,
221,
770,
51,
14315,
45,
1285,
312,
376,
221,
620,
1074,
64,
222,
221,
130,
222,
221,
942,
1922,
1035,
45,
4555
] | 8,924,583,488,165,932,000
| true
| false
| false
| false
|
[
2671,
2099,
12536,
67,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
2072,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
67,
956,
299,
556,
5068,
65,
4555,
1744,
40772,
5196,
2671,
2099,
12536,
2938,
222,
221,
942,
1175,
910,
640,
5558,
8478,
365,
222,
221,
128,
376,
221,
620,
332,
16178,
51,
561,
609,
51,
5990,
51,
4136,
51,
5754,
51,
4555,
1744,
40772,
5196,
2671,
884,
222,
221,
130,
222,
221,
942,
3987,
120,
51,
4136,
51,
798,
2182,
11722,
1197,
640,
798,
2182,
11722,
3648,
365,
222,
221
] | -4,680,204,777,342,332,000
| true
|
DO NOT MODIFY the content of this file
package ims.ocrr.configuration.vo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import ims.framework.enumerations.SortOrder;
/**
* Linked to OCRR.Configuration.RoleDisciplineSecurityLevel business object (ID: 1061100020).
*/
public class RoleDisciplineSecurityLevelRefVoCollection extends ims.vo.ValueObjectCollection implements ims.domain.IDomainCollectionGetter, ims.vo.ImsCloneable, Iterable<RoleDisciplineSecurityLevelRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<RoleDisciplineSecurityLevelRefVo> col = new ArrayList<RoleDisciplineSecurityLevelRefVo>();
public final String getBoClassName()
{
return "ims.ocrr.configuration.domain.objects.RoleDisciplineSecurityLevel";
}
public ims.domain.IDomainGetter[] getIDomainGetterItems()
|
util.Iterator;
import ims.framework.enumerations.SortOrder;
/**
* Linked to OCRR.Configuration.RoleDisciplineSecurityLevel business object (ID: 1061100020).
*/
public class RoleDisciplineSecurityLevelRefVoCollection extends ims.vo.ValueObjectCollection implements ims.domain.IDomainCollectionGetter, ims.vo.ImsCloneable, Iterable<RoleDisciplineSecurityLevelRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<RoleDisciplineSecurityLevelRefVo> col = new ArrayList<RoleDisciplineSecurityLevelRefVo>();
public final String getBoClassName()
{
return "ims.ocrr.configuration.domain.objects.RoleDisciplineSecurityLevel";
}
public ims.domain.IDomainGetter[] getIDomainGetterItems()
|
0).
*/
public class RoleDisciplineSecurityLevelRefVoCollection extends ims.vo.ValueObjectCollection implements ims.domain.IDomainCollectionGetter, ims.vo.ImsCloneable, Iterable<RoleDisciplineSecurityLevelRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<RoleDisciplineSecurityLevelRefVo> col = new ArrayList<RoleDisciplineSecurityLevelRefVo>();
public final String getBoClassName()
{
return "ims.ocrr.configuration.domain.objects.RoleDisciplineSecurityLevel";
}
public ims.domain.IDomainGetter[] getIDomainGetterItems()
|
LevelRefVo>
{
private static final long serialVersionUID = 1L;
private ArrayList<RoleDisciplineSecurityLevelRefVo> col = new ArrayList<RoleDisciplineSecurityLevelRefVo>();
public final String getBoClassName()
{
return "ims.ocrr.configuration.domain.objects.RoleDisciplineSecurityLevel";
}
public ims.domain.IDomainGetter[] getIDomainGetterItems()
|
{
ims.domain.IDomainGetter[] result = new ims.domain.IDomainGetter[col.size()];
col.toArray(result);
return result;
}
public boolean add(Role
|
UpdateDialog.java
|
/FileExtraction/Java_unseen/boecker-lab_sirius/sirius_gui/src/main/java/de/unijena/bioinf/ms/gui/dialogs/UpdateDialog.java
|
/*
* This file is part of the SIRIUS Software for analyzing MS and MS/MS data
*
* Copyright (C) 2013-2020 Kai Dührkop, Markus Fleischauer, Marcus Ludwig, Martin A. Hoffman, Fleming Kretschmer, Marvin Meusel and Sebastian Böcker,
* Chair of Bioinformatics, Friedrich-Schiller University.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with SIRIUS. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>
*/
package de.unijena.bioinf.ms.gui.dialogs;
import de.unijena.bioinf.ms.frontend.core.ApplicationCore;
import de.unijena.bioinf.ms.gui.configs.Icons;
import de.unijena.bioinf.ms.properties.PropertyManager;
import de.unijena.bioinf.ms.rest.model.info.VersionsInfo;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
public class UpdateDialog extends DoNotShowAgainDialog implements ActionListener {
public static final String DO_NOT_ASK_KEY = "de.unijena.bioinf.sirius.UpdateDialog.dontAskAgain";
JButton ignore, download;
private final VersionsInfo version;
public UpdateDialog(Frame owner, VersionsInfo version) {
super(owner, "Update for SIRIUS available!", createMessage(version), DO_NOT_ASK_KEY);
this.version = version;
setPreferredSize(new Dimension(50, getPreferredSize().height));
setVisible(true);
}
private static String createMessage(VersionsInfo version){
StringBuilder message = new StringBuilder();
message.append("<html>A new version (<b>").append(version.getLatestSiriusVersion()).append("</b>) of SIRIUS is available! <br><br>Upgrade to the latest <b>SIRIUS</b>")
.append(" to receive the newest features and fixes.<br> Your current version is: <b>")
.append(ApplicationCore.VERSION())
.append("</b><br>");
if (version.expired()) {
if (version.finishJobs()) {
if (version.acceptJobs()) {
message.append("The CSI:FingerID webservice will accept jobs from your current version until <b>")
.append(version.acceptJobs.toString()).append("</b>.<br>");
} else {
message.append("The CSI:FingerID webservice will no longer accept jobs from your current version")
.append("<br>");
}
message.append("Submitted jobs will be allowed to finish until <b>").append(version.finishJobs.toString()).append("</b>.");
} else {
message.append("Your Sirius version is not longer supported by the CSI:FingerID webservice.<br> Therefore the CSI:FingerID search is disabled in this version");
}
}
message.append("</html>");
return message.toString();
}
@Override
public void actionPerformed(ActionEvent e) {
/* if (e.getSource() == ignore) {
} else */if (e.getSource() == download) {
try {
Desktop.getDesktop().browse(URI.create(version.getLatestSiriusLink()));
} catch (IOException e1) {
LoggerFactory.getLogger(this.getClass()).error(e1.getMessage(), e1);
}
}
saveDoNotAskMeAgain();
dispose();
}
public static boolean isDontAskMe(){
return PropertyManager.getBoolean(DO_NOT_ASK_KEY,false);
}
@Override
protected void decorateButtonPanel(JPanel boxedButtonPanel) {
ignore = new JButton("Not now");
download = new JButton("Download latest SIRIUS");
boxedButtonPanel.add(ignore);
boxedButtonPanel.add(download);
download.addActionListener(this);
ignore.addActionListener(this);
}
@Override
protected Icon makeDialogIcon() {
return Icons.REFRESH_32;
}
}
| 4,465
|
Java
|
.java
|
boecker-lab/sirius
| 75
| 17
| 34
|
2017-06-16T16:21:34Z
|
2024-05-09T03:58:38Z
|
ce9954564fd582f0ed3d92249ca9203a8eb8e52cec4426e5b62942f39f378b42
|
[] |
[
1127,
222,
338,
244,
1369,
822,
458,
1760,
451,
341,
377,
3914,
28975,
3870,
456,
17986,
26817,
13419,
480,
13419,
52,
2758,
727,
222,
338,
222,
338,
244,
2657,
327,
72,
46,
244,
55,
53,
54,
56,
50,
55,
53,
55,
53,
1242,
3063,
493,
2022,
3943,
40233,
49,
7797,
371,
525,
293,
30305,
4474,
284,
49,
8369,
6217,
517,
856,
124,
384,
49,
36801,
418,
51,
696,
1739,
1607,
49,
525,
2078,
318,
1242,
287,
5166,
2322,
49,
8369,
13785,
3130,
558,
113,
480,
47943,
36949,
570,
2827,
6011,
49,
222,
338,
244,
1902,
2017,
451,
18638,
18931,
24445,
49,
525,
14055,
16452,
50,
13556,
24834,
11451,
51,
222,
338,
222,
338,
244,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
244,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
244,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
222,
338,
244,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
244,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
244,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
222,
338,
244,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
7979,
642,
377,
3914,
28975,
51,
244,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
500,
576,
50,
56,
51,
53,
51,
2787,
67,
222,
588,
222,
222,
1337,
428,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
893,
51,
8472,
51,
41463,
64,
222,
222,
485,
428,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
893,
51,
12717,
51,
1284,
51,
2743,
2869,
64,
222,
485,
428,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
893,
51,
8472,
51,
15753,
51,
15167,
64,
222,
485,
428,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
893,
51,
4659,
51,
1667,
1590,
64,
222,
485,
428,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
893,
51,
4756,
51,
1184,
51,
1357,
51,
12828,
1139,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
222,
485,
3698,
51,
5934,
7737,
222,
485,
1401,
51,
8236,
7737,
222,
485,
1401,
51,
8236,
51,
1585,
51,
18126,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
17317,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1317,
51,
6344,
64,
222,
222,
942,
462,
4013,
3742,
2041,
3291,
1355,
4325,
28797,
3742,
4584,
41931,
320,
303,
581,
924,
1175,
910,
4103,
100,
3922,
100,
5159,
100,
3319,
299,
332,
305,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
3450,
363,
371,
51,
2346,
3742,
51,
32579,
30124,
28797,
884,
303,
24328,
5091,
49,
5844,
64,
465,
964,
1175,
36507,
1139,
1522,
64,
465,
581,
4013,
3742,
45,
2163,
7431,
49,
36507,
1139,
1522,
46,
320,
310,
2615,
45,
5645,
49,
332,
2346,
456,
377,
3914,
28975,
3322,
13700,
1506,
1193,
45,
1687,
490,
4103,
100,
3922,
100,
5159,
100,
3319,
312,
310,
477,
51,
1687,
299,
1522,
64,
310,
758,
35606,
45,
909,
17432,
45,
58,
53,
49,
640,
35606,
941,
2296,
894,
310,
758,
5671,
45,
1527,
312,
303,
339,
4054,
964,
924,
910,
1506,
1193,
45,
12828,
1139,
1522,
1528,
310,
9705,
1492,
299,
556,
9705,
492,
310,
1492,
51,
1713,
10379,
935,
67,
70,
556,
1522,
11310,
103,
67,
1912,
1713,
45,
1687,
51,
390,
14782,
12273,
363,
371,
2080,
4269,
1713,
33477,
103,
5111,
451,
377,
3914,
28975,
458,
3322,
38,
350,
858,
789,
858,
67,
15486,
391,
341,
6623,
350,
103,
67,
2142,
4727,
2062,
396,
103,
19824,
419,
657,
1713,
459,
391,
7776,
341,
37228,
5423,
480,
11000,
5717,
858,
67,
10626,
1565,
1522,
458,
63,
350,
103,
19824,
419,
657,
1713,
45,
2743,
2869,
51,
4539,
1177,
419,
657,
1713,
33477,
103,
789,
858,
13510,
603,
434,
327,
1687,
51,
30015,
1177,
320,
343,
434,
327,
1687,
51,
11332,
14502,
1177,
320,
419,
434,
327,
1687,
51,
7504,
14502,
1177,
320,
547,
1492,
51,
1713,
459,
1338,
409,
2142,
63,
75,
10120,
798,
2692,
2140,
1118,
5531,
13218,
664,
1390,
1565,
1522,
6234,
350,
103,
19824,
1031,
657,
1713,
45,
1687,
51,
7504,
14502,
51,
3127,
4269,
1713,
33477,
103,
24609,
858,
13510,
419,
339,
832,
320,
547,
1492,
51,
1713,
459,
1338,
409,
2142,
63,
75,
10120,
798,
2692,
2140,
1118,
1307,
8940,
5531,
13218,
664,
1390,
1565,
1522,
678,
1031,
657,
1713,
10379,
858,
13510,
419,
339,
419,
1492,
51,
1713,
459,
31458,
13218,
1118,
545,
6671,
391,
11371,
6234,
350,
103,
67,
1912,
1713,
45,
1687,
51,
11332,
14502,
51,
3127,
4269,
1713,
33477,
103,
4513,
742,
343,
339,
832,
320,
419,
1492,
51,
1713,
459,
10195,
14185,
363,
371,
1522,
458,
666,
8940,
5430,
829,
341,
409,
2142,
63,
75,
10120,
798,
2692,
2140,
5717,
858,
67,
20830,
341,
409,
2142,
63,
75,
10120,
798,
3252,
458,
6879,
347,
477,
1522,
742,
343,
339,
310,
339,
310,
1492,
51,
1713,
33477,
935,
13510,
310,
461,
1492,
51,
3127,
492,
303,
339,
465,
496,
1806,
303,
581,
782,
29546,
45,
18126,
503,
46,
320,
1586,
1276,
434,
327,
106,
51,
25518,
365,
630,
5091,
46,
320,
603,
339,
832,
588,
344,
327,
106,
51,
25518,
365,
630,
5844,
46,
320,
343,
1614,
320,
419,
21761,
51,
390,
13050,
941,
14296,
45,
6344,
51,
1315,
45,
1687,
51,
390,
14782,
12273,
363,
371,
2375,
5086,
343,
339,
2385,
327,
6860,
503,
54,
46,
320,
419,
21818,
51,
10588,
45,
597,
51,
9699,
4269,
750,
45,
106,
54,
51,
7724,
1046,
503,
54,
312,
343,
339,
310,
339,
310,
4166,
42361,
30124,
1451,
28797,
492,
310,
27131,
492,
303,
339,
465,
581,
924,
1922,
458,
41383,
30124,
1451,
3261,
310,
461,
6484,
1590,
51,
28151,
45,
1700,
100,
3922,
100,
5159,
100,
3319,
49,
1886,
312,
303,
339,
465,
496,
1806,
303,
2532,
782,
12999,
351
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
5934,
7737,
222,
485,
1401,
51,
8236,
7737,
222,
485,
1401,
51,
8236,
51,
1585,
51,
18126,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
17317,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1317,
51,
6344,
64,
222,
222,
942,
462,
4013,
3742,
2041,
3291,
1355,
4325,
28797,
3742,
4584,
41931,
320,
303,
581,
924,
1175,
910,
4103,
100,
3922,
100,
5159,
100,
3319,
299,
332,
305,
51,
330,
5807,
10236,
51,
12787,
5290,
51,
3450,
363,
371,
51,
2346,
3742,
51,
32579,
30124,
28797,
884,
303,
24328,
5091,
49,
5844,
64,
465,
964,
1175,
36507,
1139,
1522,
64,
465,
581,
4013,
3742,
45,
2163,
7431,
49,
36507,
1139,
1522,
46,
320,
310,
2615,
45,
5645,
49,
332,
2346,
456,
377,
3914,
28975,
3322,
13700,
1506,
1193,
45,
1687,
490,
4103,
100,
3922,
100,
5159,
100,
3319,
312,
310,
477,
51,
1687,
299,
1522,
64,
310,
758,
35606,
45,
909,
17432,
45,
58,
53,
49,
640,
35606,
941,
2296,
894,
310,
758,
5671,
45,
1527,
312,
303,
339,
4054,
964,
924,
910,
1506,
1193,
45,
12828,
1139,
1522,
1528,
310,
9705,
1492,
299,
556,
9705,
492,
310,
1492,
51,
1713,
10379,
935,
67,
70,
556,
1522,
11310,
103,
67,
1912,
1713,
45,
1687,
51,
390,
14782,
12273,
363,
371,
2080,
4269,
1713,
33477,
103,
5111,
451,
377,
3914,
28975,
458,
3322,
38,
350,
858,
789,
858,
67,
15486,
391,
341,
6623,
350,
103,
67,
2142,
4727,
2062,
396,
103,
19824,
419,
657,
1713,
459,
391,
7776,
341,
37228,
5423,
480,
11000,
5717,
858,
67,
10626,
1565,
1522,
458,
63,
350,
103,
19824,
419,
657,
1713,
45,
2743,
2869,
51,
4539,
1177,
419,
657,
1713,
33477,
103,
789,
858,
13510,
603,
434,
327,
1687,
51,
30015,
1177,
320,
343,
434,
327,
1687,
51,
11332
] | 4,729,061,571,231,184,000
| true
| false
| false
| false
|
[
1522,
64,
310,
758,
35606,
45,
909,
17432,
45,
58,
53,
49,
640,
35606,
941,
2296,
894,
310,
758,
5671,
45,
1527,
312,
303,
339,
4054,
964,
924,
910,
1506,
1193,
45,
12828,
1139,
1522,
1528,
310,
9705,
1492,
299,
556,
9705,
492,
310,
1492,
51,
1713,
10379,
935,
67,
70,
556,
1522,
11310,
103,
67,
1912,
1713,
45,
1687,
51,
390,
14782,
12273,
363,
371,
2080,
4269,
1713,
33477,
103,
5111,
451,
377,
3914,
28975,
458,
3322,
38,
350,
858,
789,
858,
67,
15486,
391,
341,
6623,
350,
103,
67,
2142,
4727,
2062,
396,
103,
19824,
419,
657,
1713
] | -8,469,900,744,549,989,000
| true
|
swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
public class UpdateDialog extends DoNotShowAgainDialog implements ActionListener {
public static final String DO_NOT_ASK_KEY = "de.unijena.bioinf.sirius.UpdateDialog.dontAskAgain";
JButton ignore, download;
private final VersionsInfo version;
public UpdateDialog(Frame owner, VersionsInfo version) {
super(owner, "Update for SIRIUS available!", createMessage(version), DO_NOT_ASK_KEY);
this.version = version;
setPreferredSize(new Dimension(50, getPreferredSize().height));
setVisible(true);
}
private static String createMessage(VersionsInfo version){
StringBuilder message = new StringBuilder();
message.append("<html>A new version (<b>").append(version.getLatestSiriusVersion()).append("</b>) of SIRIUS is available! <br><br>Upgrade to the latest <b>SIRIUS</b>")
.append
|
extends DoNotShowAgainDialog implements ActionListener {
public static final String DO_NOT_ASK_KEY = "de.unijena.bioinf.sirius.UpdateDialog.dontAskAgain";
JButton ignore, download;
private final VersionsInfo version;
public UpdateDialog(Frame owner, VersionsInfo version) {
super(owner, "Update for SIRIUS available!", createMessage(version), DO_NOT_ASK_KEY);
this.version = version;
setPreferredSize(new Dimension(50, getPreferredSize().height));
setVisible(true);
}
private static String createMessage(VersionsInfo version){
StringBuilder message = new StringBuilder();
message.append("<html>A new version (<b>").append(version.getLatestSiriusVersion()).append("</b>) of SIRIUS is available! <br><br>Upgrade to the latest <b>SIRIUS</b>")
.append
|
private final VersionsInfo version;
public UpdateDialog(Frame owner, VersionsInfo version) {
super(owner, "Update for SIRIUS available!", createMessage(version), DO_NOT_ASK_KEY);
this.version = version;
setPreferredSize(new Dimension(50, getPreferredSize().height));
setVisible(true);
}
private static String createMessage(VersionsInfo version){
StringBuilder message = new StringBuilder();
message.append("<html>A new version (<b>").append(version.getLatestSiriusVersion()).append("</b>) of SIRIUS is available! <br><br>Upgrade to the latest <b>SIRIUS</b>")
.append
|
version;
setPreferredSize(new Dimension(50, getPreferredSize().height));
setVisible(true);
}
private static String createMessage(VersionsInfo version){
StringBuilder message = new StringBuilder();
message.append("<html>A new version (<b>").append(version.getLatestSiriusVersion()).append("</b>) of SIRIUS is available! <br><br>Upgrade to the latest <b>SIRIUS</b>")
.append
|
(" to receive the newest features and fixes.<br> Your current version is: <b>")
.append(ApplicationCore.VERSION())
.append("</b><br>");
if (version.expired()) {
if (version.finish
|
ChargeByTimePeriod.java
|
/FileExtraction/Java_unseen/lgh990_YunParking/smart-modules/smart-charge-server/src/main/java/com/smart/iot/charge/entity/ChargeByTimePeriod.java
|
package com.smart.iot.charge.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
/**
* 收费规则表
*
* @author Mr.AG
* @email
*@version 2022-08-10 15:10:42
*/
@Table(name = "charge_by_time_period")
public class ChargeByTimePeriod implements Serializable {
private static final long serialVersionUID = 1L;
//主键id(路边停车收费规则id)
@Id@GeneratedValue(generator = "UUID")
private String lrId;
//非工作日收费起始
@Column(name = "od_after_hour_f")
private String odAfterHourF;
//非工作日收费末
@Column(name = "od_after_hourl_l")
private String odAfterHourlL;
//非工作日第二阶段收费
@Column(name = "od_after_price")
private BigDecimal odAfterPrice;
//非工作日结束时间
@Column(name = "od_end_time")
private String odEndTime;
//非工作日起步时长
@Column(name = "od_first_hour")
private String odFirstHour;
//非工作日第一阶段价格
@Column(name = "od_first_price")
private BigDecimal odFirstPrice;
//非工作日免费时长
@Column(name = "od_free_min")
private String odFreeMin;
//非工作日第三阶段时间
@Column(name = "od_last_hour")
private String odLastHour;
//非工作日第三阶段收费
@Column(name = "od_last_price")
private BigDecimal odLastPrice;
//非工作日开始时间
@Column(name = "od_start_time")
private String odStartTime;
//停车场
@Column(name = "parking_id")
private String parkingId;
//工作日收费起始
@Column(name = "wd_after_hour_f")
private String wdAfterHourF;
//工作日收费末
@Column(name = "wd_after_hour_l")
private String wdAfterHourL;
//工作日第二阶段收费
@Column(name = "wd_after_price")
private BigDecimal wdAfterPrice;
//工作日结束时间
@Column(name = "wd_end_time")
private String wdEndTime;
//工作日起步时长
@Column(name = "wd_first_hour")
private String wdFirstHour;
//工作日第一阶段价格
@Column(name = "wd_first_price")
private BigDecimal wdFirstPrice;
//工作日免费时长
@Column(name = "wd_free_min")
private String wdFreeMin;
//工作日第三阶段时间
@Column(name = "wd_last_hour")
private String wdLastHour;
//工作日第三阶段收费
@Column(name = "wd_last_price")
private BigDecimal wdLastPrice;
//首小时收费价格
@Column(name = "first_hours_price")
private BigDecimal firstHoursPrice;
//工作日开始时间
@Column(name = "wd_start_time")
private String wdStartTime;
//字典car_type,区分大车小车
@Column(name = "car_type")
private String carType;
//有效标志(y:有效;n:无效)
@Column(name = "enabled_flag")
private String enabledFlag;
//创建时间
@Column(name = "crt_time")
private Date crtTime;
//创建人id
@Column(name = "crt_user")
private String crtUser;
//创建人
@Column(name = "crt_name")
private String crtName;
//创建主机
@Column(name = "crt_host")
private String crtHost;
//最后更新时间
@Column(name = "upd_time")
private Date updTime;
//最后更新人id
@Column(name = "upd_user")
private String updUser;
//最后更新人
@Column(name = "upd_name")
private String updName;
//最后更新主机
@Column(name = "upd_host")
private String updHost;
//月卡开启标志(y:开启;n:关闭)
@Column(name = "open_flag")
private String mcOpenFlag;
//月卡收费规则
@Column(name = "months_card_price")
private BigDecimal monthsCardPrice;
//
@Column(name = "attr1")
private String attr1;
//
@Column(name = "attr2")
private String attr2;
//
@Column(name = "attr3")
private String attr3;
//
@Column(name = "attr4")
private String attr4;
//
@Column(name = "attr5")
private String attr5;
//
@Column(name = "attr6")
private String attr6;
//
@Column(name = "attr7")
private String attr7;
//
@Column(name = "attr8")
private String attr8;
//租户id
@Column(name = "tenant_id")
private String tenantId;
//
@Column(name = "crt_user_id")
private String crtUserId;
/**
* 设置:主键id(路边停车收费规则id)
*/
public void setLrId(String lrId) {
this.lrId = lrId;
}
/**
* 获取:主键id(路边停车收费规则id)
*/
public String getLrId() {
return lrId;
}
/**
* 设置:非工作日收费起始
*/
public void setOdAfterHourF(String odAfterHourF) {
this.odAfterHourF = odAfterHourF;
}
/**
* 获取:非工作日收费起始
*/
public String getOdAfterHourF() {
return odAfterHourF;
}
/**
* 设置:非工作日收费末
*/
public void setOdAfterHourlL(String odAfterHourlL) {
this.odAfterHourlL = odAfterHourlL;
}
/**
* 获取:非工作日收费末
*/
public String getOdAfterHourlL() {
return odAfterHourlL;
}
/**
* 设置:非工作日第二阶段收费
*/
public void setOdAfterPrice(BigDecimal odAfterPrice) {
this.odAfterPrice = odAfterPrice;
}
/**
* 获取:非工作日第二阶段收费
*/
public BigDecimal getOdAfterPrice() {
return odAfterPrice;
}
/**
* 设置:非工作日结束时间
*/
public void setOdEndTime(String odEndTime) {
this.odEndTime = odEndTime;
}
/**
* 获取:非工作日结束时间
*/
public String getOdEndTime() {
return odEndTime;
}
/**
* 设置:非工作日起步时长
*/
public void setOdFirstHour(String odFirstHour) {
this.odFirstHour = odFirstHour;
}
/**
* 获取:非工作日起步时长
*/
public String getOdFirstHour() {
return odFirstHour;
}
/**
* 设置:非工作日第一阶段价格
*/
public void setOdFirstPrice(BigDecimal odFirstPrice) {
this.odFirstPrice = odFirstPrice;
}
/**
* 获取:非工作日第一阶段价格
*/
public BigDecimal getOdFirstPrice() {
return odFirstPrice;
}
/**
* 设置:非工作日免费时长
*/
public void setOdFreeMin(String odFreeMin) {
this.odFreeMin = odFreeMin;
}
/**
* 获取:非工作日免费时长
*/
public String getOdFreeMin() {
return odFreeMin;
}
/**
* 设置:非工作日第三阶段时间
*/
public void setOdLastHour(String odLastHour) {
this.odLastHour = odLastHour;
}
/**
* 获取:非工作日第三阶段时间
*/
public String getOdLastHour() {
return odLastHour;
}
/**
* 设置:非工作日第三阶段收费
*/
public void setOdLastPrice(BigDecimal odLastPrice) {
this.odLastPrice = odLastPrice;
}
/**
* 获取:非工作日第三阶段收费
*/
public BigDecimal getOdLastPrice() {
return odLastPrice;
}
/**
* 设置:非工作日开始时间
*/
public void setOdStartTime(String odStartTime) {
this.odStartTime = odStartTime;
}
/**
* 获取:非工作日开始时间
*/
public String getOdStartTime() {
return odStartTime;
}
/**
* 设置:停车场
*/
public void setParkingId(String parkingId) {
this.parkingId = parkingId;
}
/**
* 获取:停车场
*/
public String getParkingId() {
return parkingId;
}
/**
* 设置:工作日收费起始
*/
public void setWdAfterHourF(String wdAfterHourF) {
this.wdAfterHourF = wdAfterHourF;
}
/**
* 获取:工作日收费起始
*/
public String getWdAfterHourF() {
return wdAfterHourF;
}
/**
* 设置:工作日收费末
*/
public void setWdAfterHourL(String wdAfterHourL) {
this.wdAfterHourL = wdAfterHourL;
}
/**
* 获取:工作日收费末
*/
public String getWdAfterHourL() {
return wdAfterHourL;
}
/**
* 设置:工作日第二阶段收费
*/
public void setWdAfterPrice(BigDecimal wdAfterPrice) {
this.wdAfterPrice = wdAfterPrice;
}
/**
* 获取:工作日第二阶段收费
*/
public BigDecimal getWdAfterPrice() {
return wdAfterPrice;
}
/**
* 设置:工作日结束时间
*/
public void setWdEndTime(String wdEndTime) {
this.wdEndTime = wdEndTime;
}
/**
* 获取:工作日结束时间
*/
public String getWdEndTime() {
return wdEndTime;
}
/**
* 设置:工作日起步时长
*/
public void setWdFirstHour(String wdFirstHour) {
this.wdFirstHour = wdFirstHour;
}
/**
* 获取:工作日起步时长
*/
public String getWdFirstHour() {
return wdFirstHour;
}
/**
* 设置:工作日第一阶段价格
*/
public void setWdFirstPrice(BigDecimal wdFirstPrice) {
this.wdFirstPrice = wdFirstPrice;
}
/**
* 获取:工作日第一阶段价格
*/
public BigDecimal getWdFirstPrice() {
return wdFirstPrice;
}
/**
* 设置:工作日免费时长
*/
public void setWdFreeMin(String wdFreeMin) {
this.wdFreeMin = wdFreeMin;
}
/**
* 获取:工作日免费时长
*/
public String getWdFreeMin() {
return wdFreeMin;
}
/**
* 设置:工作日第三阶段时间
*/
public void setWdLastHour(String wdLastHour) {
this.wdLastHour = wdLastHour;
}
/**
* 获取:工作日第三阶段时间
*/
public String getWdLastHour() {
return wdLastHour;
}
/**
* 设置:工作日第三阶段收费
*/
public void setWdLastPrice(BigDecimal wdLastPrice) {
this.wdLastPrice = wdLastPrice;
}
/**
* 获取:工作日第三阶段收费
*/
public BigDecimal getWdLastPrice() {
return wdLastPrice;
}
/**
* 设置:首小时收费价格
*/
public void setFirstHoursPrice(BigDecimal firstHoursPrice) {
this.firstHoursPrice = firstHoursPrice;
}
/**
* 获取:首小时收费价格
*/
public BigDecimal getFirstHoursPrice() {
return firstHoursPrice;
}
/**
* 设置:工作日开始时间
*/
public void setWdStartTime(String wdStartTime) {
this.wdStartTime = wdStartTime;
}
/**
* 获取:工作日开始时间
*/
public String getWdStartTime() {
return wdStartTime;
}
/**
* 设置:字典car_type,区分大车小车
*/
public void setCarType(String carType) {
this.carType = carType;
}
/**
* 获取:字典car_type,区分大车小车
*/
public String getCarType() {
return carType;
}
/**
* 设置:有效标志(y:有效;n:无效)
*/
public void setEnabledFlag(String enabledFlag) {
this.enabledFlag = enabledFlag;
}
/**
* 获取:有效标志(y:有效;n:无效)
*/
public String getEnabledFlag() {
return enabledFlag;
}
/**
* 设置:创建时间
*/
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
/**
* 获取:创建时间
*/
public Date getCrtTime() {
return crtTime;
}
/**
* 设置:创建人id
*/
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
/**
* 获取:创建人id
*/
public String getCrtUser() {
return crtUser;
}
/**
* 设置:创建人
*/
public void setCrtName(String crtName) {
this.crtName = crtName;
}
/**
* 获取:创建人
*/
public String getCrtName() {
return crtName;
}
/**
* 设置:创建主机
*/
public void setCrtHost(String crtHost) {
this.crtHost = crtHost;
}
/**
* 获取:创建主机
*/
public String getCrtHost() {
return crtHost;
}
/**
* 设置:最后更新时间
*/
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
/**
* 获取:最后更新时间
*/
public Date getUpdTime() {
return updTime;
}
/**
* 设置:最后更新人id
*/
public void setUpdUser(String updUser) {
this.updUser = updUser;
}
/**
* 获取:最后更新人id
*/
public String getUpdUser() {
return updUser;
}
/**
* 设置:最后更新人
*/
public void setUpdName(String updName) {
this.updName = updName;
}
/**
* 获取:最后更新人
*/
public String getUpdName() {
return updName;
}
/**
* 设置:最后更新主机
*/
public void setUpdHost(String updHost) {
this.updHost = updHost;
}
/**
* 获取:最后更新主机
*/
public String getUpdHost() {
return updHost;
}
/**
* 设置:月卡开启标志(y:开启;n:关闭)
*/
public void setMcOpenFlag(String mcOpenFlag) {
this.mcOpenFlag = mcOpenFlag;
}
/**
* 获取:月卡开启标志(y:开启;n:关闭)
*/
public String getMcOpenFlag() {
return mcOpenFlag;
}
/**
* 设置:月卡收费规则
*/
public void setMonthsCardPrice(BigDecimal monthsCardPrice) {
this.monthsCardPrice = monthsCardPrice;
}
/**
* 获取:月卡收费规则
*/
public BigDecimal getMonthsCardPrice() {
return monthsCardPrice;
}
/**
* 设置:
*/
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
/**
* 获取:
*/
public String getAttr1() {
return attr1;
}
/**
* 设置:
*/
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
/**
* 获取:
*/
public String getAttr2() {
return attr2;
}
/**
* 设置:
*/
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
/**
* 获取:
*/
public String getAttr3() {
return attr3;
}
/**
* 设置:
*/
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
/**
* 获取:
*/
public String getAttr4() {
return attr4;
}
/**
* 设置:
*/
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
/**
* 获取:
*/
public String getAttr5() {
return attr5;
}
/**
* 设置:
*/
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
/**
* 获取:
*/
public String getAttr6() {
return attr6;
}
/**
* 设置:
*/
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
/**
* 获取:
*/
public String getAttr7() {
return attr7;
}
/**
* 设置:
*/
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
/**
* 获取:
*/
public String getAttr8() {
return attr8;
}
/**
* 设置:租户id
*/
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
/**
* 获取:租户id
*/
public String getTenantId() {
return tenantId;
}
/**
* 设置:
*/
public void setCrtUserId(String crtUserId) {
this.crtUserId = crtUserId;
}
/**
* 获取:
*/
public String getCrtUserId() {
return crtUserId;
}
}
| 14,340
| null |
.java
|
lgh990/YunParking
| 28
| 10
| 0
|
2022-08-22T00:19:29Z
|
2022-08-05T03:15:54Z
|
264e33dc73dd8914a0db683755eb4aeb786d376a19c881334d417003099731fb
|
[] |
[
1337,
785,
51,
11407,
51,
12489,
51,
13260,
51,
2244,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
3851,
51,
20808,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
3698,
51,
10782,
7737,
499,
222,
1350,
222,
338,
244,
11586,
17806,
25510,
4461,
222,
338,
222,
338,
496,
2133,
34474,
51,
1631,
222,
338,
496,
1951,
1676,
38485,
1687,
244,
55,
53,
55,
55,
50,
53,
61,
50,
54,
53,
244,
54,
58,
63,
54,
53,
63,
57,
55,
222,
588,
222,
69,
1617,
45,
444,
299,
332,
13260,
100,
1186,
100,
1021,
100,
8499,
678,
222,
942,
462,
1902,
5848,
1103,
1061,
7762,
4584,
19182,
320,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
19075,
453,
42689,
333,
45,
9900,
17865,
22350,
22211,
11586,
17806,
25510,
333,
46,
303,
496,
625,
69,
35422,
45,
7147,
299,
332,
7604,
678,
303,
964,
910,
19609,
625,
64,
19075,
453,
12550,
17823,
6640,
11586,
17806,
12171,
8330,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
5497,
100,
11343,
100,
107,
678,
303,
964,
910,
13585,
5131,
14425,
75,
64,
19075,
453,
12550,
17823,
6640,
11586,
17806,
45753,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
5497,
100,
11343,
113,
100,
113,
678,
303,
964,
910,
13585,
5131,
14425,
113,
81,
64,
19075,
453,
12550,
17823,
6640,
26420,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
5497,
100,
4440,
678,
303,
964,
17262,
13585,
5131,
5620,
64,
19075,
453,
12550,
17823,
6640,
24975,
8382,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
435,
100,
1021,
678,
303,
964,
910,
13585,
25026,
64,
19075,
453,
12550,
17823,
6640,
12171,
12110,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
2251,
100,
11343,
678,
303,
964,
910,
13585,
3485,
14425,
64,
19075,
453,
12550,
17823,
6640,
26590,
41110,
40825,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
2251,
100,
4440,
678,
303,
964,
17262,
13585,
3485,
5620,
64,
19075,
453,
12550,
17823,
6640,
24676,
17806,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
4010,
100,
907,
678,
303,
964,
910,
13585,
7023,
2944,
64,
19075,
453,
12550,
17823,
6640,
33293,
41110,
8382,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
2153,
100,
11343,
678,
303,
964,
910,
13585,
3283,
14425,
64,
19075,
453,
12550,
17823,
6640,
33293,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
2153,
100,
4440,
678,
303,
964,
17262,
13585,
3283,
5620,
64,
19075,
453,
12550,
17823,
6640,
15271,
8382,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
1384,
100,
1021,
678,
303,
964,
910,
13585,
17885,
64,
19075,
453,
22350,
22211,
17989,
303,
496,
2154,
45,
444,
299,
332,
8436,
318,
100,
333,
678,
303,
964,
910,
898,
12897,
625,
64,
19075,
453,
17823,
6640,
11586,
17806,
12171,
8330,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
11343,
100,
107,
678,
303,
964,
910,
28900,
5131,
14425,
75,
64,
19075,
453,
17823,
6640,
11586,
17806,
45753,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
11343,
100,
113,
678,
303,
964,
910,
28900,
5131,
14425,
81,
64,
19075,
453,
17823,
6640,
26420,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
4440,
678,
303,
964,
17262,
28900,
5131,
5620,
64,
19075,
453,
17823,
6640,
24975,
8382,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
435,
100,
1021,
678,
303,
964,
910,
28900,
25026,
64,
19075,
453,
17823,
6640,
12171,
12110,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
11343,
678,
303,
964,
910,
28900,
3485,
14425,
64,
19075,
453,
17823,
6640,
26590,
41110,
40825,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
4440,
678,
303,
964,
17262,
28900,
3485,
5620,
64,
19075,
453,
17823,
6640,
24676,
17806,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
4010,
100,
907,
678,
303,
964,
910,
28900,
7023,
2944,
64,
19075,
453,
17823,
6640,
33293,
41110,
8382,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2153,
100,
11343,
678,
303,
964,
910,
28900,
3283,
14425,
64,
19075,
453,
17823,
6640,
33293,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2153,
100,
4440,
678,
303,
964,
17262,
28900,
3283,
5620,
64,
19075,
453,
17280,
7333,
3616,
11586,
17806,
40825,
303,
496,
2154,
45,
444,
299,
332,
2251,
100,
15036,
100,
4440,
678,
303,
964,
17262,
1950,
14894,
5620,
64,
19075,
453,
17823,
6640,
15271,
8382,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
1384,
100,
1021,
678,
303,
964,
910,
28900,
17885,
64,
19075,
453,
46919,
3745,
100,
700,
1140,
7554,
4519,
5012,
22211,
7333,
22211,
303,
496,
2154,
45,
444,
299,
332,
3745,
100,
700,
678,
303,
964,
910,
6378,
638,
64,
19075,
453,
26418,
7044,
16123,
45,
126,
63,
26418,
11195,
115,
3111,
9527,
12782,
46,
303,
496,
2154,
45,
444,
299,
332,
6572,
100,
4570,
678,
303,
964,
910,
5892,
5266,
64,
19075,
453,
10049,
8382,
303,
496,
2154,
45,
444,
299,
332,
20565,
100,
1021,
678,
303,
964,
2833,
300,
2069,
1061,
64,
19075,
453,
10049,
5499,
333,
303,
496,
2154,
45,
444,
299,
332,
20565,
100,
514,
678,
303,
964,
910,
300,
2069,
1259,
64,
19075,
453,
10049,
5499,
303,
496,
2154,
45,
444,
299,
332,
20565,
100,
444,
678,
303,
964,
910,
300,
2069,
577,
64,
19075,
453,
10049,
39662,
303,
496,
2154,
45,
444,
299,
332,
20565,
100,
2067,
678,
303,
964,
910,
300,
2069,
3680,
64,
19075,
453,
21360,
12237,
8382,
303,
496,
2154,
45,
444,
299,
332,
34970,
100,
1021,
678,
303,
964,
2833,
992,
105,
1061,
64,
19075,
453,
21360,
12237,
5499,
333,
303,
496,
2154,
45,
444,
299,
332,
34970,
100,
514,
678,
303,
964,
910,
992,
105,
1259,
64,
19075,
453,
21360,
12237,
5499,
303,
496,
2154,
45,
444,
299,
332,
34970,
100,
444,
678,
303,
964,
910,
992,
105,
577,
64,
19075,
453,
21360,
12237,
39662,
303,
496,
2154,
45,
444,
299,
332,
34970,
100,
2067,
678,
303,
964,
910,
992,
105,
3680,
64,
19075,
453,
10175
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
100,
11343,
678,
303,
964,
910,
13585,
3283,
14425,
64,
19075,
453,
12550,
17823,
6640,
33293,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
2153,
100,
4440,
678,
303,
964,
17262,
13585,
3283,
5620,
64,
19075,
453,
12550,
17823,
6640,
15271,
8382,
303,
496,
2154,
45,
444,
299,
332,
450,
100,
1384,
100,
1021,
678,
303,
964,
910,
13585,
17885,
64,
19075,
453,
22350,
22211,
17989,
303,
496,
2154,
45,
444,
299,
332,
8436,
318,
100,
333,
678,
303,
964,
910,
898,
12897,
625,
64,
19075,
453,
17823,
6640,
11586,
17806,
12171,
8330,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
11343,
100,
107,
678,
303,
964,
910,
28900,
5131,
14425,
75,
64,
19075,
453,
17823,
6640,
11586,
17806,
45753,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
11343,
100,
113,
678,
303,
964,
910,
28900,
5131,
14425,
81,
64,
19075,
453,
17823,
6640,
26420,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
4440,
678,
303,
964,
17262,
28900,
5131,
5620,
64,
19075,
453,
17823,
6640,
24975,
8382,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
435,
100,
1021,
678,
303,
964,
910,
28900,
25026,
64,
19075,
453,
17823,
6640,
12171,
12110,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
11343,
678,
303,
964,
910,
28900,
3485,
14425,
64,
19075,
453,
17823,
6640,
26590,
41110,
40825,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
4440,
678,
303,
964,
17262,
28900,
3485,
5620,
64,
19075,
453,
17823,
6640,
24676,
17806,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
4010,
100,
907,
678,
303,
964,
910,
28900,
7023,
2944,
64,
19075,
453,
17823,
6640,
33293,
41110,
8382,
303,
496,
2154,
45,
444,
299,
332
] | 116,820,752,146,888,020
| true
| false
| false
| false
|
[
19075,
453,
17823,
6640,
26420,
41110,
11586,
17806,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
5497,
100,
4440,
678,
303,
964,
17262,
28900,
5131,
5620,
64,
19075,
453,
17823,
6640,
24975,
8382,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
435,
100,
1021,
678,
303,
964,
910,
28900,
25026,
64,
19075,
453,
17823,
6640,
12171,
12110,
3616,
11414,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
11343,
678,
303,
964,
910,
28900,
3485,
14425,
64,
19075,
453,
17823,
6640,
26590,
41110,
40825,
303,
496,
2154,
45,
444,
299,
332,
4435,
100,
2251,
100,
4440
] | -6,976,837,005,260,960,000
| true
|
_hour")
private String odLastHour;
//非工作日第三阶段收费
@Column(name = "od_last_price")
private BigDecimal odLastPrice;
//非工作日开始时间
@Column(name = "od_start_time")
private String odStartTime;
//停车场
@Column(name = "parking_id")
private String parkingId;
//工作日收费起始
@Column(name = "wd_after_hour_f")
private String wdAfterHourF;
//工作日收费末
@Column(name = "wd_after_hour_l")
private String wdAfterHourL;
//工作日第二阶段收费
@Column(name = "wd_after_price")
private BigDecimal wdAfterPrice;
//工作日结束时间
@Column(name = "wd_end_time")
private String wdEndTime;
//工作日起步时长
@Column(name = "wd_first_hour")
private String wdFirstHour;
//工作日第一阶段价格
@Column(name = "wd_first_price
|
name = "od_start_time")
private String odStartTime;
//停车场
@Column(name = "parking_id")
private String parkingId;
//工作日收费起始
@Column(name = "wd_after_hour_f")
private String wdAfterHourF;
//工作日收费末
@Column(name = "wd_after_hour_l")
private String wdAfterHourL;
//工作日第二阶段收费
@Column(name = "wd_after_price")
private BigDecimal wdAfterPrice;
//工作日结束时间
@Column(name = "wd_end_time")
private String wdEndTime;
//工作日起步时长
@Column(name = "wd_first_hour")
private String wdFirstHour;
//工作日第一阶段价格
@Column(name = "wd_first_price
|
(name = "wd_after_hour_f")
private String wdAfterHourF;
//工作日收费末
@Column(name = "wd_after_hour_l")
private String wdAfterHourL;
//工作日第二阶段收费
@Column(name = "wd_after_price")
private BigDecimal wdAfterPrice;
//工作日结束时间
@Column(name = "wd_end_time")
private String wdEndTime;
//工作日起步时长
@Column(name = "wd_first_hour")
private String wdFirstHour;
//工作日第一阶段价格
@Column(name = "wd_first_price
|
//工作日第二阶段收费
@Column(name = "wd_after_price")
private BigDecimal wdAfterPrice;
//工作日结束时间
@Column(name = "wd_end_time")
private String wdEndTime;
//工作日起步时长
@Column(name = "wd_first_hour")
private String wdFirstHour;
//工作日第一阶段价格
@Column(name = "wd_first_price
|
")
private BigDecimal wdFirstPrice;
//工作日免费时长
@Column(name = "wd_free_min")
private String wdFreeMin;
//工作日第三阶段时间
@Column(name = "
|
V1.java
|
/FileExtraction/Java_unseen/bfix_J9P/src/core/j9p/proto/V1.java
|
//******************************************************************
//* PGMID. INFERNO STYX PROTOCOL IMPLEMENTATION. *
//* AUTHOR. BERND R. FIX >Y< *
//* DATE WRITTEN. 09/04/02. *
//* COPYRIGHT. (C) BY BERND R. FIX. ALL RIGHTS RESERVED. *
//* LICENSED MATERIAL - PROGRAM PROPERTY OF THE *
//* AUTHOR. REFER TO COPYRIGHT INSTRUCTIONS. *
//******************************************************************
//* *
//* StyxLib: Java-based Styx server framework *
//* *
//* Copyright (C) 2009-2012, Bernd R. Fix *
//* *
//* This program is free software; you can redistribute it and/or *
//* modify it under the terms of the GNU Lesser General Public *
//* License (LGPL) as published by the Free Software Foundation; *
//* either version 3 of the License, or (at your option) any *
//* later version. *
//* *
//* This program is distributed in the hope that it will be use- *
//* ful, but WITHOUT ANY WARRANTY; without even the implied *
//* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *
//* PURPOSE. See the GNU General Public License for more details. *
//* *
//* You should have received a copy of the GNU General Public *
//* Licenses along with this program; if not, see *
//* <http://www.gnu.org/licenses/>. *
//* *
//******************************************************************
package j9p.proto;
///////////////////////////////////////////////////////////////////////////////
//import external declarations.
import j9p.Message;
import j9p.util.Hex;
///////////////////////////////////////////////////////////////////////////////
/**
* <p>Encapsulate constants and methods common for message in the Inferno/Styx
* protocol version of 9P.</p>
*
* @author Bernd R. Fix >Y<
* @version 1.0
*/
public class V1 {
//=================================================================
/*
* Constants (message types) -- version 1 (inferno)
*/
public static final int Tnop = 0;
public static final int Rnop = 1;
public static final int Terror = 2;
public static final int Rerror = 3;
public static final int Tflush = 4;
public static final int Rflush = 5;
public static final int Tclone = 6;
public static final int Rclone = 7;
public static final int Twalk = 8;
public static final int Rwalk = 9;
public static final int Topen = 10;
public static final int Ropen = 11;
public static final int Tcreate = 12;
public static final int Rcreate = 13;
public static final int Tread = 14;
public static final int Rread = 15;
public static final int Twrite = 16;
public static final int Rwrite = 17;
public static final int Tclunk = 18;
public static final int Rclunk = 19;
public static final int Tremove = 20;
public static final int Rremove = 21;
public static final int Tstat = 22;
public static final int Rstat = 23;
public static final int Twstat = 24;
public static final int Rwstat = 25;
public static final int Tsession = 26;
public static final int Rsession = 27;
public static final int Tattach = 28;
public static final int Rattach = 29;
public static final int NUM_TYPES = 30;
//-----------------------------------------------------------------
/*
* Constants (message type names) -- version 1 (inferno)
*/
public static final String[] typeNames = {
"Tnop", "Rnop", "Terror", "Rerror", "Tflush", "Rflush",
"Tclone", "Rclone", "Twalk", "Rwalk", "Topen", "Ropen",
"Tcreate", "Rcreate", "Tread", "Rread", "Twrite", "Rwrite",
"Tclunk", "Rclunk", "Tremove", "Rremove", "Tstat", "Rstat",
"Twstat", "Rwstat", "Tsession", "Rsession", "Tattach", "Rattach"
};
//-----------------------------------------------------------------
/*
* Constants for length of messages.
* (= 0: not supported, < 0: minimum length)
*/
private static final int[] msgSizes = {
3, 3, 0, 67, 5, 3,
7, 5, 33, 13, 6, 13,
38, 13, 15, -8, -16, 7,
5, 5, 5, 5, 5, 121,
121, 5, 0, 0, 61, 13
};
//=================================================================
/**
* <p>Check if message content is compatible with protocol
* version implemented (Version 1: Inferno).</p>
* @param in Message - message to be checked
* @return int - type of message (if compatible, -1 otherwise)
*/
public static int isCompatible (Message in) {
// check for plausible message in protocol version 1 (Inferno)
// 1.) check message type.
int type = in.getByte (0);
if (type < 0 || type > NUM_TYPES-1)
// invalid type: not compatible.
return -1;
// 2.) get expected message size and compare to actual
// size of message
int len = msgSizes[type];
if (len == 0)
return -1;
if (len > 0 && in.size() != len)
return -1;
// message seems to be compatible
return type;
}
//=================================================================
/**
* <p>Create printable representation of this Styx message.</p>
* @param in Message - message to be printed
* @return String - printable Styx message
*/
public static String toString (Message in) {
StringBuffer buf = new StringBuffer();
int msgSize = in.size();
int type = in.getByte(0);
// check for Styx message
if (type >= 0 && type < NUM_TYPES) {
// assemble formatted Styx message
buf.append ("[type:" + typeNames[type] + "]");
buf.append ("[tag:" + Hex.fromShort ((short)in.getShort(1)) + "]");
if (msgSize > 3) {
if (type == Rerror) {
String err = in.getString (3, 64);
buf.append ("[error:" + err + "]");
} else {
buf.append ("[fid:" + Hex.fromShort ((short)in.getShort(3)) + "]");
if (msgSize > 5) {
byte[] payload = in.getArray (5, msgSize-5);
buf.append ("[data:" + Hex.fromArray (payload, ':') + "]");
}
}
}
}
else {
// hexadecimal output of message
buf.append ("{");
buf.append (Hex.fromArray (in.asByteArray(false), ':'));
buf.append ("}");
}
return buf.toString();
}
}
| 6,646
|
Java
|
.java
|
bfix/J9P
| 8
| 3
| 1
|
2012-04-03T22:12:20Z
|
2018-07-09T02:31:15Z
|
22ba9902f4b392b41841ae6edfef2da979c0a4fe5f2320fc8da7350559af856c
|
[] |
[
222,
325,
4241,
345,
222,
14129,
280,
466,
15185,
798,
51,
370,
1255,
8921,
2593,
17173,
93,
32861,
4067,
6801,
9902,
2909,
51,
2052,
338,
222,
14129,
280,
29456,
51,
981,
570,
8210,
73,
578,
51,
15034,
280,
868,
94,
65,
11357,
338,
222,
14129,
280,
23734,
14636,
799,
32956,
51,
244,
53,
62,
52,
53,
57,
52,
53,
55,
51,
20725,
338,
222,
14129,
280,
8995,
51,
283,
327,
72,
46,
6944,
570,
8210,
73,
578,
51,
15034,
51,
11877,
20167,
88,
11572,
546,
16769,
51,
665,
338,
222,
14129,
442,
7621,
73,
507,
18760,
5803,
449,
4174,
15684,
42102,
2258,
2906,
283,
338,
222,
14129,
442,
29456,
51,
15969,
2841,
8995,
1255,
2393,
35015,
88,
51,
981,
338,
222,
325,
4241,
345,
222,
14129,
44709,
338,
222,
14129,
244,
9119,
125,
6518,
63,
4957,
50,
7893,
9119,
125,
2160,
8376,
6039,
338,
222,
14129,
44709,
338,
222,
14129,
244,
2657,
327,
72,
46,
244,
55,
53,
53,
62,
50,
55,
53,
54,
55,
49,
20853,
1462,
578,
51,
7097,
8254,
338,
222,
14129,
44709,
338,
222,
14129,
244,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
338,
222,
14129,
244,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
16227,
6153,
5062,
283,
338,
222,
14129,
244,
1196,
327,
81,
21156,
46,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
244,
338,
222,
14129,
244,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
665,
338,
222,
14129,
244,
6146,
1522,
51,
30606,
338,
222,
14129,
44709,
338,
222,
14129,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
813,
50,
244,
338,
222,
14129,
244,
22433,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
981,
338,
222,
14129,
244,
14319,
451,
7934,
575,
8114,
4800,
418,
7848,
981,
338,
222,
14129,
244,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
338,
222,
14129,
44709,
338,
222,
14129,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
281,
338,
222,
14129,
244,
1196,
120,
7979,
642,
477,
3477,
64,
434,
666,
49,
2337,
442,
338,
222,
14129,
244,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
12754,
338,
222,
14129,
44709,
338,
222,
325,
4241,
345,
222,
222,
1337,
614,
62,
117,
51,
1822,
64,
222,
222,
40584,
222,
325,
485,
6596,
20621,
51,
222,
222,
485,
614,
62,
117,
51,
1193,
64,
222,
485,
614,
62,
117,
51,
1058,
51,
10226,
64,
499,
222,
40584,
222,
1350,
222,
47,
350,
117,
67,
795,
13049,
6710,
12405,
480,
4457,
4959,
456,
1492,
347,
341,
719,
1036,
1365,
52,
520,
26386,
222,
47,
7088,
1522,
451,
244,
62,
85,
1746,
117,
67,
222,
47,
244,
222,
47,
496,
2133,
20853,
1462,
578,
51,
7097,
280,
868,
94,
65,
222,
47,
496,
1687,
244,
54,
51,
53,
222,
1975,
222,
942,
462,
694,
54,
320,
499,
221,
20037,
66,
222,
221,
1127,
376,
338,
14072,
327,
1454,
3756,
46,
790,
1522,
244,
54,
327,
23102,
1365,
46,
376,
588,
222,
221,
942,
924,
1175,
648,
413,
10361,
221,
221,
66,
280,
53,
64,
222,
221,
942,
924,
1175,
648,
578,
10361,
221,
221,
66,
280,
54,
64,
222,
221,
942,
924,
1175,
648,
413,
750,
221,
221,
66,
280,
55,
64,
222,
221,
942,
924,
1175,
648,
578,
750,
221,
221,
66,
280,
56,
64,
222,
221,
942,
924,
1175,
648,
413,
9327,
221,
221,
66,
280,
57,
64,
222,
221,
942,
924,
1175,
648,
578,
9327,
221,
221,
66,
280,
58,
64,
222,
221,
942,
924,
1175,
648,
413,
6371,
221,
221,
66,
280,
59,
64,
222,
221,
942,
924,
1175,
648,
578,
6371,
221,
221,
66,
280,
60,
64,
222,
221,
942,
924,
1175,
648,
413,
11941,
221,
221,
66,
280,
61,
64,
222,
221,
942,
924,
1175,
648,
578,
11941,
221,
221,
66,
280,
62,
64,
222,
221,
942,
924,
1175,
648,
413,
1693,
221,
221,
66,
244,
54,
53,
64,
222,
221,
942,
924,
1175,
648,
578,
1693,
221,
221,
66,
244,
54,
54,
64,
222,
221,
942,
924,
1175,
648,
413,
1315,
221,
221,
66,
244,
54,
55,
64,
222,
221,
942,
924,
1175,
648,
578,
1315,
221,
221,
66,
244,
54,
56,
64,
222,
221,
942,
924,
1175,
648,
413,
870,
221,
221,
66,
244,
54,
57,
64,
222,
221,
942,
924,
1175,
648,
578,
870,
221,
221,
66,
244,
54,
58,
64,
222,
221,
942,
924,
1175,
648,
413,
1838,
221,
221,
66,
244,
54,
59,
64,
222,
221,
942,
924,
1175,
648,
578,
1838,
221,
221,
66,
244,
54,
60,
64,
222,
221,
942,
924,
1175,
648,
31968,
2156,
221,
221,
66,
244,
54,
61,
64,
222,
221,
942,
924,
1175,
648,
578,
592,
2156,
221,
221,
66,
244,
54,
62,
64,
222,
221,
942,
924,
1175,
648,
413,
2564,
221,
221,
66,
244,
55,
53,
64,
222,
221,
942,
924,
1175,
648,
578,
2564,
221,
221,
66,
244,
55,
54,
64,
222,
221,
942,
924,
1175,
648,
413,
4611,
221,
221,
66,
244,
55,
55,
64,
222,
221,
942,
924,
1175,
648,
578,
4611,
221,
221,
66,
244,
55,
56,
64,
222,
221,
942,
924,
1175,
648,
12037,
4611,
221,
221,
66,
244,
55,
57,
64,
222,
221,
942,
924,
1175,
648,
578,
124,
4611,
221,
221,
66,
244,
55,
58,
64,
222,
221,
942,
924,
1175,
648,
413,
2867,
221,
66,
244,
55,
59,
64,
222,
221,
942,
924,
1175,
648,
578,
2867,
221,
66,
244,
55,
60,
64,
222,
221,
942,
924,
1175,
648,
413,
9962,
221,
221,
66,
244,
55,
61,
64,
222,
221,
942,
924,
1175,
648,
578,
9962,
221,
221,
66,
244,
55,
62,
64,
222,
221,
942,
924,
1175,
648,
12697,
100,
15670,
221,
66,
244,
56,
53,
64,
222,
221,
8486,
50,
222,
221,
1127,
376,
338,
14072,
327,
1454,
847,
4492,
46,
790,
1522,
244,
54,
327,
23102,
1365,
46,
376,
588,
222,
221,
942,
924,
1175,
910,
1197,
847,
4128,
299,
320,
376,
221,
39,
89,
10361,
411,
283,
332,
87,
10361,
411,
283,
332,
89,
750,
411,
280,
332,
87
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
53,
53,
62,
50,
55,
53,
54,
55,
49,
20853,
1462,
578,
51,
7097,
8254,
338,
222,
14129,
44709,
338,
222,
14129,
244,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
338,
222,
14129,
244,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
16227,
6153,
5062,
283,
338,
222,
14129,
244,
1196,
327,
81,
21156,
46,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
244,
338,
222,
14129,
244,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
665,
338,
222,
14129,
244,
6146,
1522,
51,
30606,
338,
222,
14129,
44709,
338,
222,
14129,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
813,
50,
244,
338,
222,
14129,
244,
22433,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
981,
338,
222,
14129,
244,
14319,
451,
7934,
575,
8114,
4800,
418,
7848,
981,
338,
222,
14129,
244,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
338,
222,
14129,
44709,
338,
222,
14129,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
281,
338,
222,
14129,
244,
1196,
120,
7979,
642,
477,
3477,
64,
434,
666,
49,
2337,
442,
338,
222,
14129,
244,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
12754,
338,
222,
14129,
44709,
338,
222,
325,
4241,
345,
222,
222,
1337,
614,
62,
117,
51,
1822,
64,
222,
222,
40584,
222,
325,
485,
6596,
20621,
51,
222,
222,
485,
614,
62,
117,
51,
1193,
64,
222,
485,
614,
62,
117,
51,
1058,
51,
10226,
64,
499,
222,
40584,
222,
1350,
222,
47,
350,
117,
67,
795,
13049,
6710,
12405,
480,
4457,
4959,
456,
1492,
347,
341,
719,
1036,
1365,
52,
520,
26386,
222,
47,
7088,
1522,
451,
244,
62,
85,
1746,
117
] | -754,656,523,732,623,400
| true
| false
| false
| false
|
[
222,
14129,
244,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
338,
222,
14129,
44709,
338,
222,
14129,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
281,
338,
222,
14129,
244,
1196,
120,
7979,
642,
477,
3477,
64,
434,
666,
49,
2337,
442,
338,
222,
14129,
244,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
12754,
338,
222,
14129,
44709,
338,
222,
325,
4241,
345,
222,
222,
1337,
614,
62,
117,
51,
1822,
64,
222,
222,
40584,
222,
325,
485,
6596,
20621,
51,
222,
222,
485,
614,
62,
117
] | 4,316,438,163,831,688,700
| true
|
009-2012, Bernd R. Fix *
//* *
//* This program is free software; you can redistribute it and/or *
//* modify it under the terms of the GNU Lesser General Public *
//* License (LGPL) as published by the Free Software Foundation; *
//* either version 3 of the License, or (at your option) any *
//* later version. *
//* *
//* This program is distributed in the hope that it will be use- *
//* ful, but WITHOUT ANY WARRANTY; without even the implied *
//* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *
//* PURPOSE. See the GNU General Public License for more details. *
//* *
//* You should have received a copy of the GNU General Public *
//* Licenses along with this program; if not, see *
//* <http://www.gnu.org/licenses/>. *
//* *
//******************************************************************
package j9p.proto;
///////////////////////////////////////////////////////////////////////////////
//import external declarations.
import j9p
|
Public *
//* License (LGPL) as published by the Free Software Foundation; *
//* either version 3 of the License, or (at your option) any *
//* later version. *
//* *
//* This program is distributed in the hope that it will be use- *
//* ful, but WITHOUT ANY WARRANTY; without even the implied *
//* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *
//* PURPOSE. See the GNU General Public License for more details. *
//* *
//* You should have received a copy of the GNU General Public *
//* Licenses along with this program; if not, see *
//* <http://www.gnu.org/licenses/>. *
//* *
//******************************************************************
package j9p.proto;
///////////////////////////////////////////////////////////////////////////////
//import external declarations.
import j9p
|
//* *
//* This program is distributed in the hope that it will be use- *
//* ful, but WITHOUT ANY WARRANTY; without even the implied *
//* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *
//* PURPOSE. See the GNU General Public License for more details. *
//* *
//* You should have received a copy of the GNU General Public *
//* Licenses along with this program; if not, see *
//* <http://www.gnu.org/licenses/>. *
//* *
//******************************************************************
package j9p.proto;
///////////////////////////////////////////////////////////////////////////////
//import external declarations.
import j9p
|
//* PURPOSE. See the GNU General Public License for more details. *
//* *
//* You should have received a copy of the GNU General Public *
//* Licenses along with this program; if not, see *
//* <http://www.gnu.org/licenses/>. *
//* *
//******************************************************************
package j9p.proto;
///////////////////////////////////////////////////////////////////////////////
//import external declarations.
import j9p
|
.Message;
import j9p.util.Hex;
///////////////////////////////////////////////////////////////////////////////
/**
* <p>Encapsulate constants and methods common for message in the Inferno/Styx
* protocol version of 9P.</p
|
TestJobLabels.java
|
/FileExtraction/Java_unseen/ow2-proactive_scheduling/scheduler/scheduler-server/src/test/java/functionaltests/job/TestJobLabels.java
|
/*
* ProActive Parallel Suite(TM):
* The Open Source library for parallel and distributed
* Workflows & Scheduling, Orchestration, Cloud Automation
* and Big Data Analysis on Enterprise Grids & Clouds.
*
* Copyright (c) 2007 - 2017 ActiveEon
* Contact: contact@activeeon.com
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation: version 3 of
* the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* If needed, contact us to obtain a release under GPL Version 2 or 3
* or a different license than the AGPL.
*/
package functionaltests.job;
import static functionaltests.utils.SchedulerTHelper.log;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import org.junit.Test;
import org.ow2.proactive.scheduler.common.job.JobId;
import org.ow2.proactive.scheduler.common.job.JobInfo;
import org.ow2.proactive.scheduler.common.job.JobLabelInfo;
import functionaltests.utils.SchedulerFunctionalTestNoRestart;
/**
* Test checks operations on job labels
*/
public class TestJobLabels extends SchedulerFunctionalTestNoRestart {
private static URL runningJob = TestJobRemoved.class.getResource("/functionaltests/descriptors/Job_running.xml");
private final static int EVENT_TIMEOUT = 5000;
@Test
public void testJobLabels() throws Throwable {
log("Create labels label, label2");
java.util.List<String> labels = Arrays.asList("label1", "label2");
java.util.List<JobLabelInfo> jobLabelInfoList = schedulerHelper.createLabels(labels);
assertEquals(2, jobLabelInfoList.size());
assertNotNull(jobLabelInfoList.stream()
.filter(jobLabelInfo -> jobLabelInfo.getLabel().equals("label1"))
.collect(Collectors.toList()));
assertNotNull(jobLabelInfoList.stream()
.filter(jobLabelInfo -> jobLabelInfo.getLabel().equals("label2"))
.collect(Collectors.toList()));
log("Update label newLabel");
JobLabelInfo jobLabelInfo = schedulerHelper.updateLabel(String.valueOf(jobLabelInfoList.get(0).getId()),
"newLabel");
assertEquals("newLabel", jobLabelInfo.getLabel());
log("Delete label newLabel");
schedulerHelper.deleteLabel(String.valueOf(jobLabelInfoList.get(0).getId()));
java.util.List<JobLabelInfo> actualJobLabels = schedulerHelper.getLabels();
assertEquals(1, actualJobLabels.size());
log("Set labels newLabel1, newLabel2");
java.util.List<String> updatedLabels = Arrays.asList("newLabel1", "newLabel2");
java.util.List<JobLabelInfo> updatedJobLabels = schedulerHelper.setLabels(updatedLabels);
assertEquals(2, updatedJobLabels.size());
assertNotNull(updatedJobLabels.stream()
.filter(jobLabel -> jobLabel.getLabel().equals("newLabel1"))
.collect(Collectors.toList()));
assertNotNull(updatedJobLabels.stream()
.filter(jobLabel -> jobLabel.getLabel().equals("newLabel2"))
.collect(Collectors.toList()));
log("Set label newLabel1 on job");
JobId id = schedulerHelper.submitJob(new File(runningJob.toURI()).getAbsolutePath());
schedulerHelper.setLabelOnJob(String.valueOf(updatedJobLabels.get(0).getId()),
Collections.singletonList(id.value()));
JobInfo jobInfo = schedulerHelper.getJobInfo(id.toString());
assertEquals("newLabel1", jobInfo.getLabel());
log("Remove label from job");
schedulerHelper.removeLabelFromJob(Collections.singletonList(id.value()));
JobInfo updatedJobInfo = schedulerHelper.getJobInfo(id.toString());
assertNull(updatedJobInfo.getLabel());
// removing running job
schedulerHelper.removeJob(id);
// it should kill the job
schedulerHelper.waitForEventJobFinished(id);
schedulerHelper.waitForEventJobRemoved(id, EVENT_TIMEOUT);
}
}
| 4,870
|
Java
|
.java
|
ow2-proactive/scheduling
| 60
| 53
| 155
|
2015-05-16T13:38:55Z
|
2024-05-07T13:08:56Z
|
3ff70a120347a68cf9a989d98aaf46405711ed710cfc21dfc7b8732d13c80a57
|
[] |
[
1127,
222,
338,
1330,
4091,
29829,
25280,
45,
9043,
731,
222,
338,
906,
3944,
6391,
4277,
456,
11994,
480,
2744,
222,
338,
21275,
120,
568,
377,
16501,
49,
565,
30568,
31655,
49,
7594,
30336,
222,
338,
480,
7766,
2426,
17497,
563,
23417,
7877,
120,
568,
7594,
120,
51,
222,
338,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
60,
449,
244,
55,
53,
54,
60,
8761,
74,
286,
222,
338,
12140,
63,
7272,
69,
2498,
47179,
51,
527,
222,
338,
222,
338,
1369,
4277,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
63,
1522,
244,
56,
451,
222,
338,
341,
1196,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
1691,
5366,
49,
7272,
1790,
391,
4245,
331,
3636,
1549,
23508,
3050,
244,
55,
575,
244,
56,
222,
338,
575,
331,
3473,
3553,
2806,
341,
418,
21156,
51,
222,
588,
222,
1337,
17380,
4895,
51,
3267,
64,
222,
222,
485,
924,
17380,
4895,
51,
2324,
51,
11438,
1797,
361,
481,
51,
769,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
4993,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
14765,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
18787,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
1317,
51,
2427,
64,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
16862,
64,
222,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
48153,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
1139,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
2186,
1139,
64,
222,
222,
485,
17380,
4895,
51,
2324,
51,
11438,
27064,
1024,
2042,
22632,
64,
499,
222,
1350,
222,
338,
2128,
9378,
7392,
563,
4012,
6577,
222,
588,
222,
942,
462,
2128,
3798,
8722,
2041,
28495,
27064,
1024,
2042,
22632,
320,
465,
964,
924,
3846,
3991,
3798,
299,
2128,
3798,
16971,
51,
842,
51,
17633,
4229,
18678,
4895,
52,
31877,
52,
3798,
100,
10347,
51,
2608,
742,
465,
964,
1175,
924,
648,
8454,
100,
14232,
299,
244,
58,
53,
53,
53,
64,
465,
496,
1024,
303,
581,
782,
913,
3798,
8722,
365,
2589,
9953,
320,
603,
1264,
459,
1940,
6577,
2300,
49,
2300,
55,
742,
310,
1401,
51,
1058,
51,
739,
65,
671,
67,
6577,
299,
14479,
51,
14100,
459,
1194,
54,
411,
332,
1194,
55,
742,
310,
1401,
51,
1058,
51,
739,
65,
3798,
2186,
1139,
67,
4012,
2186,
25846,
299,
13589,
2775,
51,
1315,
8722,
45,
6007,
312,
310,
3803,
45,
55,
49,
4012,
2186,
25846,
51,
911,
1052,
310,
17141,
45,
3267,
2186,
25846,
51,
2255,
365,
8506,
657,
2049,
45,
3267,
2186,
1139,
984,
4012,
2186,
1139,
51,
38885,
941,
3591,
459,
1194,
54,
2152,
8506,
657,
6190,
45,
16862,
51,
15341,
5086,
310,
17141,
45,
3267,
2186,
25846,
51,
2255,
365,
8506,
657,
2049,
45,
3267,
2186,
1139,
984,
4012,
2186,
1139,
51,
38885,
941,
3591,
459,
1194,
55,
2152,
8506,
657,
6190,
45,
16862,
51,
15341,
5086,
603,
1264,
459,
2346,
2300,
556,
2186,
742,
310,
9216,
2186,
1139,
4012,
2186,
1139,
299,
13589,
2775,
51,
1896,
2186,
45,
671,
51,
9169,
45,
3267,
2186,
25846,
51,
390,
45,
53,
566,
7068,
6198,
13793,
332,
909,
2186,
742,
310,
3803,
459,
909,
2186,
411,
4012,
2186,
1139,
51,
38885,
1052,
603,
1264,
459,
3422,
2300,
556,
2186,
742,
310,
13589,
2775,
51,
2577,
2186,
45,
671,
51,
9169,
45,
3267,
2186,
25846,
51,
390,
45,
53,
566,
7068,
5086,
310,
1401,
51,
1058,
51,
739,
65,
3798,
2186,
1139,
67,
4668,
3798,
8722,
299,
13589,
2775,
51,
390,
8722,
492,
310,
3803,
45,
54,
49,
4668,
3798,
8722,
51,
911,
1052,
603,
1264,
459,
903,
6577,
556,
2186,
54,
49,
556,
2186,
55,
742,
310,
1401,
51,
1058,
51,
739,
65,
671,
67,
4478,
8722,
299,
14479,
51,
14100,
459,
909,
2186,
54,
411,
332,
909,
2186,
55,
742,
310,
1401,
51,
1058,
51,
739,
65,
3798,
2186,
1139,
67,
4478,
3798,
8722,
299,
13589,
2775,
51,
489,
8722,
45,
6379,
8722,
312,
310,
3803,
45,
55,
49,
4478,
3798,
8722,
51,
911,
1052,
310,
17141,
45,
6379,
3798,
8722,
51,
2255,
365,
8506,
657,
2049,
45,
3267,
2186,
984,
4012,
2186,
51,
38885,
941,
3591,
459,
909,
2186,
54,
2152,
8506,
657,
6190,
45,
16862,
51,
15341,
5086,
310,
17141,
45,
6379,
3798,
8722,
51,
2255,
365,
8506,
657,
2049,
45,
3267,
2186,
984,
4012,
2186,
51,
38885,
941,
3591,
459,
909,
2186,
55,
2152,
8506,
657,
6190,
45,
16862,
51,
15341,
5086,
603,
1264,
459,
903,
2300,
556,
2186,
54,
563,
4012,
742,
310,
9216,
625,
828,
299,
13589,
2775,
51,
4751,
3798,
45,
909,
2050,
45,
10347,
3798,
51,
471,
6344,
4269,
24697,
1052,
310,
13589,
2775,
51,
44062,
1501,
3798,
45,
671,
51,
9169,
45,
6379,
3798,
8722,
51,
390,
45,
53,
566,
7068,
6198,
8506,
15490,
51,
36511,
45,
333,
51,
872,
5086,
603,
9216,
1139,
4012,
1139,
299,
13589,
2775,
51,
390,
3798,
1139,
45,
333,
51,
3127,
1052,
310,
3803,
459,
909,
2186,
54,
411,
4012,
1139,
51,
38885,
1052,
603,
1264,
459,
4926,
2300,
664,
4012,
742,
310,
13589,
2775,
51,
2564,
2186,
1811,
3798,
45,
4293,
51,
36511
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
1691,
5366,
49,
7272,
1790,
391,
4245,
331,
3636,
1549,
23508,
3050,
244,
55,
575,
244,
56,
222,
338,
575,
331,
3473,
3553,
2806,
341,
418,
21156,
51,
222,
588,
222,
1337,
17380,
4895,
51,
3267,
64,
222,
222,
485,
924,
17380,
4895,
51,
2324,
51,
11438,
1797,
361,
481,
51,
769,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
4993,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
14765,
64,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
18787,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
1317,
51,
2427,
64,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
16862,
64,
222,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
48153,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
1139,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
2186,
1139,
64,
222,
222,
485,
17380,
4895,
51,
2324,
51,
11438,
27064,
1024,
2042,
22632,
64,
499,
222,
1350,
222,
338,
2128,
9378,
7392,
563,
4012,
6577,
222,
588,
222,
942,
462,
2128,
3798,
8722,
2041,
28495,
27064,
1024,
2042,
22632,
320,
465,
964,
924,
3846,
3991,
3798,
299,
2128,
3798,
16971,
51,
842,
51,
17633,
4229,
18678,
4895,
52,
31877,
52
] | 4,783,609,186,995,121,000
| true
| false
| false
| false
|
[
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
16862,
64,
222,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
48153,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
1139,
64,
222,
485,
1105,
51,
460,
55,
51,
529,
2498,
51,
13273,
51,
2297,
51,
3267,
51,
3798,
2186,
1139,
64,
222,
222,
485,
17380,
4895,
51,
2324,
51,
11438,
27064
] | 5,247,877,277,652,573,000
| true
|
details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* If needed, contact us to obtain a release under GPL Version 2 or 3
* or a different license than the AGPL.
*/
package functionaltests.job;
import static functionaltests.utils.SchedulerTHelper.log;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import org.junit.Test;
import org.ow2.proactive.scheduler.common.job.JobId;
import org.ow2.proactive.scheduler.common.job.JobInfo;
import org.ow2.proactive.scheduler.common.job.JobLabelInfo;
import functionaltests.utils.SchedulerFunctional
|
to obtain a release under GPL Version 2 or 3
* or a different license than the AGPL.
*/
package functionaltests.job;
import static functionaltests.utils.SchedulerTHelper.log;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import org.junit.Test;
import org.ow2.proactive.scheduler.common.job.JobId;
import org.ow2.proactive.scheduler.common.job.JobInfo;
import org.ow2.proactive.scheduler.common.job.JobLabelInfo;
import functionaltests.utils.SchedulerFunctional
|
static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import org.junit.Test;
import org.ow2.proactive.scheduler.common.job.JobId;
import org.ow2.proactive.scheduler.common.job.JobInfo;
import org.ow2.proactive.scheduler.common.job.JobLabelInfo;
import functionaltests.utils.SchedulerFunctional
|
java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;
import org.junit.Test;
import org.ow2.proactive.scheduler.common.job.JobId;
import org.ow2.proactive.scheduler.common.job.JobInfo;
import org.ow2.proactive.scheduler.common.job.JobLabelInfo;
import functionaltests.utils.SchedulerFunctional
|
TestNoRestart;
/**
* Test checks operations on job labels
*/
public class TestJobLabels extends SchedulerFunctionalTestNoRestart {
private static URL runningJob = TestJobRemoved.class.getResource("/functionaltests/descriptors/
|
Platform.java
|
/FileExtraction/Java_unseen/HamaIndustries_FEMultiPlayer-V2/src/net/fe/fightStage/anim/Platform.java
|
package net.fe.fightStage.anim;
import org.newdawn.slick.opengl.Texture;
import net.fe.FEResources;
import net.fe.fightStage.FightStage;
import net.fe.overworldStage.Terrain;
import chu.engine.Entity;
import chu.engine.anim.Renderer;
import chu.engine.anim.Transform;
// TODO: Auto-generated Javadoc
/**
* The Class Platform.
*/
public class Platform extends Entity {
/** The left. */
private boolean left;
/** The texture. */
private Texture texture;
/**
* Instantiates a new platform.
*
* @param t the t
* @param left the left
* @param range the range
*/
public Platform(Terrain t, boolean left, int range) {
super(left ? 0 : FightStage.CENTRAL_AXIS, FightStage.FLOOR - 16);
this.left = left;
if(t != Terrain.NONE) {
String txtName = t.name().toLowerCase();
if(range > 1)
txtName += "_far";
texture = FEResources.getTexture("platform_" + txtName);
renderDepth = FightStage.PLATFORM_DEPTH;
}
}
/* (non-Javadoc)
* @see chu.engine.Entity#render()
*/
public void render() {
if(texture != null) {
Transform t = new Transform();
if (!left)
t.flipHorizontal();
Renderer.render(texture, 0, 0, 1, 1, x, y, x + 120, y + 40, 1, t);
}
}
}
| 1,208
|
Java
|
.java
|
HamaIndustries/FEMultiPlayer-V2
| 26
| 31
| 41
|
2016-01-15T01:18:07Z
|
2022-03-21T23:58:29Z
|
0d287958e6a8af1ab84c96684de740cfef453dbe453f0c1d53670520a87f0535
|
[] |
[
1337,
3723,
51,
1247,
51,
36472,
9589,
51,
12088,
64,
222,
222,
485,
1105,
51,
909,
105,
6157,
51,
25595,
51,
16006,
51,
4900,
64,
222,
222,
485,
3723,
51,
1247,
51,
8921,
326,
2131,
64,
222,
485,
3723,
51,
1247,
51,
36472,
9589,
51,
42518,
9589,
64,
222,
485,
3723,
51,
1247,
51,
1515,
5879,
9589,
51,
31905,
64,
222,
485,
683,
122,
51,
3502,
51,
2234,
64,
222,
485,
683,
122,
51,
3502,
51,
12088,
51,
6470,
64,
222,
485,
683,
122,
51,
3502,
51,
12088,
51,
4879,
64,
222,
222,
325,
4314,
63,
7998,
50,
6413,
990,
20888,
222,
1350,
222,
338,
906,
1727,
11329,
51,
222,
588,
222,
942,
462,
11329,
2041,
7276,
320,
3038,
221,
1350,
906,
2859,
51,
588,
222,
221,
2072,
1922,
2859,
64,
3038,
221,
1350,
906,
8934,
51,
588,
222,
221,
2072,
13507,
8934,
64,
499,
221,
1350,
376,
338,
42030,
1218,
331,
556,
5637,
51,
376,
338,
376,
338,
496,
772,
292,
341,
292,
376,
338,
496,
772,
2859,
341,
2859,
376,
338,
496,
772,
2189,
341,
2189,
376,
588,
222,
221,
942,
11329,
45,
31905,
292,
49,
1922,
2859,
49,
648,
2189,
46,
320,
376,
221,
5282,
45,
1892,
1037,
244,
53,
518,
525,
712,
9589,
51,
72,
35230,
744,
100,
31795,
49,
525,
712,
9589,
51,
40828,
776,
449,
244,
54,
59,
312,
376,
221,
597,
51,
1892,
299,
2859,
64,
376,
221,
344,
45,
121,
882,
413,
18556,
51,
8476,
46,
320,
374,
221,
671,
10505,
577,
299,
292,
51,
444,
941,
10498,
492,
374,
221,
344,
45,
3623,
868,
244,
54,
46,
621,
221,
2787,
577,
1475,
7302,
14824,
884,
374,
221,
8288,
299,
525,
546,
326,
2131,
51,
390,
4900,
459,
5146,
15727,
494,
10505,
577,
312,
374,
221,
3183,
8036,
299,
525,
712,
9589,
51,
20745,
100,
18405,
64,
376,
221,
130,
222,
221,
130,
499,
221,
1127,
327,
3804,
50,
29282,
46,
376,
338,
496,
2987,
683,
122,
51,
3502,
51,
2234,
40,
3183,
365,
376,
588,
222,
221,
942,
782,
2922,
365,
320,
376,
221,
344,
45,
8288,
882,
762,
46,
320,
374,
221,
4879,
292,
299,
556,
11685,
492,
374,
221,
344,
1445,
1892,
46,
621,
221,
121,
51,
16292,
11388,
492,
374,
221,
6470,
51,
3183,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 423
|
[
462,
11329,
2041,
7276,
320,
3038,
221,
1350,
906,
2859,
51,
588,
222,
221,
2072,
1922,
2859,
64,
3038,
221,
1350,
906,
8934,
51,
588,
222,
221,
2072,
13507,
8934,
64,
499,
221,
1350,
376,
338,
42030,
1218,
331,
556,
5637,
51,
376,
338,
376,
338,
496,
772,
292,
341,
292,
376,
338,
496,
772,
2859,
341,
2859,
376,
338,
496,
772,
2189,
341,
2189,
376,
588,
222,
221,
942,
11329,
45,
31905,
292,
49,
1922,
2859,
49,
648,
2189,
46,
320,
376,
221,
5282,
45,
1892,
1037,
244,
53,
518,
525,
712,
9589,
51,
72,
35230,
744,
100,
31795,
49,
525,
712,
9589,
51,
40828,
776,
449,
244,
54,
59,
312,
376,
221,
597,
51,
1892,
299,
2859,
64,
376,
221,
344,
45,
121,
882,
413,
18556,
51,
8476,
46,
320,
374,
221,
671,
10505,
577,
299,
292,
51,
444,
941,
10498,
492,
374,
221,
344,
45,
3623,
868,
244,
54,
46,
621,
221,
2787,
577,
1475,
7302,
14824,
884,
374,
221,
8288,
299,
525,
546,
326,
2131,
51,
390,
4900,
459,
5146,
15727,
494,
10505,
577,
312,
374,
221,
3183,
8036,
299,
525,
712,
9589,
51,
20745,
100,
18405,
64,
376,
221,
130,
222,
221,
130,
499,
221,
1127,
327,
3804,
50,
29282,
46,
376,
338,
496,
2987,
683,
122,
51,
3502,
51,
2234,
40,
3183,
365,
376,
588,
222,
221,
942,
782,
2922,
365,
320,
376,
221,
344,
45,
8288,
882,
762,
46,
320,
374,
221,
4879,
292,
299,
556,
11685,
492,
374,
221,
344,
1445,
1892,
46,
621,
221,
121,
51,
16292,
11388,
492,
374,
221,
6470,
51,
3183,
45,
8288,
49,
244,
53,
49,
244,
53,
49,
244,
54,
49,
244,
54,
49,
837,
49,
553,
49,
837,
494,
244,
54,
55,
53,
49,
553,
494,
244,
57,
53,
49,
244,
54,
49,
292,
312
] | 6,266,373,039,115,426,000
| true
| false
| false
| false
|
[
244,
54,
46,
621,
221,
2787,
577,
1475,
7302,
14824,
884,
374,
221,
8288,
299,
525,
546,
326,
2131,
51,
390,
4900,
459,
5146,
15727,
494,
10505,
577,
312,
374,
221,
3183,
8036,
299,
525,
712,
9589,
51,
20745,
100,
18405,
64,
376,
221,
130,
222,
221,
130,
499,
221,
1127,
327,
3804,
50,
29282,
46,
376,
338,
496,
2987,
683,
122,
51,
3502,
51,
2234,
40,
3183,
365,
376,
588,
222,
221,
942,
782,
2922,
365,
320,
376,
221,
344,
45,
8288,
882,
762,
46,
320,
374,
221,
4879,
292,
299,
556,
11685,
492,
374,
221,
344,
1445,
1892
] | 6,944,724,761,358,725,000
| true
|
class Platform extends Entity {
/** The left. */
private boolean left;
/** The texture. */
private Texture texture;
/**
* Instantiates a new platform.
*
* @param t the t
* @param left the left
* @param range the range
*/
public Platform(Terrain t, boolean left, int range) {
super(left? 0 : FightStage.CENTRAL_AXIS, FightStage.FLOOR - 16);
this.left = left;
if(t!= Terrain.NONE) {
String txtName = t.name().toLowerCase();
if(range > 1)
txtName += "_far";
texture = FEResources.getTexture("platform_" + txtName);
renderDepth = FightStage.PLATFORM_DEPTH;
}
}
/* (non-Javadoc)
* @see chu.engine.Entity#render()
*/
public void render() {
if(texture!= null) {
Transform t = new Transform();
if (!left
|
t
* @param left the left
* @param range the range
*/
public Platform(Terrain t, boolean left, int range) {
super(left? 0 : FightStage.CENTRAL_AXIS, FightStage.FLOOR - 16);
this.left = left;
if(t!= Terrain.NONE) {
String txtName = t.name().toLowerCase();
if(range > 1)
txtName += "_far";
texture = FEResources.getTexture("platform_" + txtName);
renderDepth = FightStage.PLATFORM_DEPTH;
}
}
/* (non-Javadoc)
* @see chu.engine.Entity#render()
*/
public void render() {
if(texture!= null) {
Transform t = new Transform();
if (!left
|
, FightStage.FLOOR - 16);
this.left = left;
if(t!= Terrain.NONE) {
String txtName = t.name().toLowerCase();
if(range > 1)
txtName += "_far";
texture = FEResources.getTexture("platform_" + txtName);
renderDepth = FightStage.PLATFORM_DEPTH;
}
}
/* (non-Javadoc)
* @see chu.engine.Entity#render()
*/
public void render() {
if(texture!= null) {
Transform t = new Transform();
if (!left
|
1)
txtName += "_far";
texture = FEResources.getTexture("platform_" + txtName);
renderDepth = FightStage.PLATFORM_DEPTH;
}
}
/* (non-Javadoc)
* @see chu.engine.Entity#render()
*/
public void render() {
if(texture!= null) {
Transform t = new Transform();
if (!left
|
)
t.flipHorizontal();
Renderer.render(texture, 0, 0, 1, 1, x, y, x + 120, y + 40, 1, t);
|
PurApOjbCollectionHelper.java
|
/FileExtraction/Java_unseen/kuali_kfs/kfs-purap/src/main/java/org/kuali/kfs/module/purap/util/PurApOjbCollectionHelper.java
|
/*
* The Kuali Financial System, a comprehensive financial management system for higher education.
*
* Copyright 2005-2014 The Kuali Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.kuali.kfs.module.purap.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.util.ObjectUtils;
import org.kuali.rice.krad.util.OjbCollectionAware;
import org.springframework.orm.ObjectRetrievalFailureException;
/**
* Helper object to deal with persisting collections.
*/
public class PurApOjbCollectionHelper {
public final static int MAX_DEPTH = 2;
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to forcibly remove
* business objects that are found in Collections stored in the database but not in memory.
*
* @param orig
* @param id
* @param template
*/
public void processCollections(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy) {
processCollectionsRecurse(template, orig, copy, MAX_DEPTH);
}
/**
* This method processes collections recursively up to the depth level specified
*
* @param template
* @param orig
* @param copy
*/
private void processCollectionsRecurse(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy, int depth) {
if (copy == null || depth < 1) {
return;
}
List originalCollections = orig.buildListOfDeletionAwareLists();
if (originalCollections != null && !originalCollections.isEmpty()) {
/*
* Prior to being saved, the version in the database will not yet reflect any deleted collections. So, a freshly
* retrieved version will contain objects that need to be removed:
*/
try {
List copyCollections = copy.buildListOfDeletionAwareLists();
int size = originalCollections.size();
if (copyCollections.size() != size) {
throw new RuntimeException("size mismatch while attempting to process list of Collections to manage");
}
for (int i = 0; i < size; i++) {
Collection<PersistableBusinessObject> origSource = (Collection<PersistableBusinessObject>) originalCollections.get(i);
Collection<PersistableBusinessObject> copySource = (Collection<PersistableBusinessObject>) copyCollections.get(i);
List list = findUnwantedElements(copySource, origSource, template, depth - 1);
cleanse(template, origSource, list);
}
}
catch (ObjectRetrievalFailureException orfe) {
// object wasn't found, must be pre-save
}
}
}
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to forcibly remove
* business objects that are found in Collections stored in the database but not in memory.
*
* @param orig
* @param id
* @param template
*/
public void processCollections2(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy) {
// if copy is null this is the first time we are saving the object, don't have to worry about updating collections
if (copy == null) {
return;
}
List originalCollections = orig.buildListOfDeletionAwareLists();
if (originalCollections != null && !originalCollections.isEmpty()) {
/*
* Prior to being saved, the version in the database will not yet reflect any deleted collections. So, a freshly
* retrieved version will contain objects that need to be removed:
*/
try {
List copyCollections = copy.buildListOfDeletionAwareLists();
int size = originalCollections.size();
if (copyCollections.size() != size) {
throw new RuntimeException("size mismatch while attempting to process list of Collections to manage");
}
for (int i = 0; i < size; i++) {
Collection origSource = (Collection) originalCollections.get(i);
Collection copySource = (Collection) copyCollections.get(i);
List list = findUnwantedElements(copySource, origSource, null, 0);
cleanse(template, origSource, list);
}
}
catch (ObjectRetrievalFailureException orfe) {
// object wasn't found, must be pre-save
}
}
}
/**
* This method deletes unwanted objects from the database as well as from the given input List
*
* @param origSource - list containing unwanted business objects
* @param unwantedItems - business objects to be permanently removed
* @param template
*/
private void cleanse(OjbCollectionAware template, Collection origSource, List unwantedItems) {
if (unwantedItems.size() > 0) {
Iterator iter = unwantedItems.iterator();
while (iter.hasNext()) {
template.getPersistenceBrokerTemplate().delete(iter.next());
}
}
}
/**
* This method identifies items in the first List that are not contained in the second List. It is similar to the (optional)
* java.util.List retainAll method.
*
* @param fromList list from the database
* @param controlList list from the object
* @return true iff one or more items were removed
*/
private List findUnwantedElements(Collection fromList, Collection controlList, OjbCollectionAware template, int depth) {
List toRemove = new ArrayList();
Iterator iter = fromList.iterator();
while (iter.hasNext()) {
PersistableBusinessObject copyLine = (PersistableBusinessObject) iter.next();
PersistableBusinessObject line = (PersistableBusinessObject) PurApObjectUtils.retrieveObjectWithIdentitcalKey(controlList, copyLine);
if (ObjectUtils.isNull(line)) {
toRemove.add(copyLine);
}
else { // since we're not deleting try to recurse on this element
processCollectionsRecurse(template, line, copyLine, depth);
}
}
return toRemove;
}
}
| 7,306
|
Java
|
.java
|
kuali/kfs
| 17
| 42
| 0
|
2014-07-08T17:06:19Z
|
2018-03-22T16:41:03Z
|
6e4d4aebd8b3edde480e8b81a374b27dd86565c7cc4fdd49051deba7fc766f95
|
[] |
[
1127,
222,
338,
906,
1242,
34951,
10420,
15505,
1189,
49,
331,
45036,
29435,
11151,
2684,
456,
12282,
31733,
51,
222,
338,
1676,
338,
2657,
244,
55,
53,
53,
58,
50,
55,
53,
54,
57,
906,
1242,
34951,
7120,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
222,
338,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
1105,
51,
45265,
51,
112,
2569,
51,
1663,
51,
12880,
386,
51,
1058,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
730,
51,
28800,
463,
13268,
976,
64,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
1058,
51,
976,
2769,
64,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
1058,
51,
84,
11663,
2272,
19835,
64,
222,
485,
1105,
51,
4140,
51,
513,
51,
976,
22141,
718,
46493,
64,
222,
222,
1350,
222,
338,
6170,
1319,
391,
8664,
642,
6454,
7981,
13722,
51,
222,
588,
222,
942,
462,
18878,
3825,
84,
11663,
2272,
2775,
320,
303,
581,
1175,
924,
648,
7490,
100,
18405,
299,
244,
55,
64,
465,
1041,
294,
338,
565,
18600,
4212,
21861,
19835,
12982,
764,
666,
34729,
680,
3939,
341,
1808,
52,
1375,
24799,
51,
1369,
1431,
458,
331,
1409,
50,
11291,
391,
456,
104,
22040,
3365,
294,
338,
12609,
4706,
708,
904,
2448,
347,
15490,
7129,
347,
341,
3520,
1294,
666,
347,
4137,
51,
294,
338,
5402,
338,
496,
772,
3241,
294,
338,
496,
772,
828,
294,
338,
496,
772,
3098,
294,
588,
303,
581,
782,
2183,
4293,
45,
84,
11663,
2272,
19835,
3098,
49,
17370,
446,
463,
13268,
976,
3241,
49,
17370,
446,
463,
13268,
976,
1948,
46,
320,
310,
2183,
4293,
24115,
296,
45,
2402,
49,
3241,
49,
1948,
49,
7490,
100,
18405,
312,
303,
339,
465,
1041,
294,
338,
1369,
1431,
13209,
13722,
30367,
992,
391,
341,
7736,
3215,
3205,
294,
338,
5402,
338,
496,
772,
3098,
294,
338,
496,
772,
3241,
294,
338,
496,
772,
1948,
294,
588,
303,
964,
782,
2183,
4293,
24115,
296,
45,
84,
11663,
2272,
19835,
3098,
49,
17370,
446,
463,
13268,
976,
3241,
49,
17370,
446,
463,
13268,
976,
1948,
49,
648,
7736,
46,
320,
310,
434,
327,
3014,
630,
762,
1293,
7736,
350,
244,
54,
46,
320,
343,
461,
64,
310,
339,
603,
1701,
4732,
4293,
299,
3241,
51,
1848,
23791,
34122,
19835,
12982,
492,
603,
434,
327,
7351,
4293,
882,
762,
979,
673,
7351,
4293,
51,
6401,
1177,
320,
343,
1276,
1819,
338,
9158,
290,
391,
4019,
7533,
49,
341,
1522,
347,
341,
3520,
1118,
666,
6320,
10238,
1364,
8133,
13722,
51,
2790,
49,
331,
21185,
651,
1819,
338,
19213,
1522,
1118,
4814,
4706,
708,
1868,
391,
545,
6563,
63,
1819,
588,
343,
1614,
320,
419,
1701,
1948,
4293,
299,
1948,
51,
1848,
23791,
34122,
19835,
12982,
492,
419,
648,
1354,
299,
4732,
4293,
51,
911,
492,
2125,
434,
327,
3014,
4293,
51,
911,
365,
882,
1354,
46,
320,
547,
1440,
556,
13383,
459,
911,
22367,
2236,
25741,
391,
2183,
1168,
451,
15490,
391,
11857,
742,
419,
339,
2125,
456,
327,
429,
613,
299,
244,
53,
64,
613,
350,
1354,
64,
613,
2002,
320,
547,
7380,
65,
28800,
463,
13268,
976,
67,
3241,
2044,
299,
327,
2272,
65,
28800,
463,
13268,
976,
5111,
4732,
4293,
51,
390,
45,
110,
312,
547,
7380,
65,
28800,
463,
13268,
976,
67,
1948,
2044,
299,
327,
2272,
65,
28800,
463,
13268,
976,
5111,
1948,
4293,
51,
390,
45,
110,
312,
547,
1701,
1168,
299,
2309,
1079,
32423,
7466,
45,
3014,
2044,
49,
3241,
2044,
49,
3098,
49,
7736,
449,
244,
54,
312,
547,
5084,
296,
45,
2402,
49,
3241,
2044,
49,
1168,
312,
2125,
339,
343,
339,
343,
2385,
327,
976,
22141,
718,
46493,
575,
1247,
46,
320,
419,
453,
1319,
16970,
1348,
2448,
49,
2315,
545,
1426,
50,
2882,
343,
339,
310,
339,
303,
339,
465,
1041,
294,
338,
565,
18600,
4212,
21861,
19835,
12982,
764,
666,
34729,
680,
3939,
341,
1808,
52,
1375,
24799,
51,
1369,
1431,
458,
331,
1409,
50,
11291,
391,
456,
104,
22040,
3365,
294,
338,
12609,
4706,
708,
904,
2448,
347,
15490,
7129,
347,
341,
3520,
1294,
666,
347,
4137,
51,
294,
338,
5402,
338,
496,
772,
3241,
294,
338,
496,
772,
828,
294,
338,
496,
772,
3098,
294,
588,
303,
581,
782,
2183,
4293,
55,
45,
84,
11663,
2272,
19835,
3098,
49,
17370,
446,
463,
13268,
976,
3241,
49,
17370,
446,
463,
13268,
976,
1948,
46,
320,
310,
453,
434,
1948,
458,
762,
477,
458,
341,
1950,
1153,
1019,
904,
17091,
341,
1319,
49,
2818,
1348,
1178,
391,
28169,
2645,
13291,
13722,
310,
434,
327,
3014,
630,
762,
46,
320,
343,
461,
64,
310,
339,
603,
1701,
4732,
4293,
299,
3241,
51,
1848,
23791,
34122,
19835,
12982,
492,
603,
434,
327,
7351,
4293,
882,
762,
979,
673,
7351,
4293,
51,
6401,
1177,
320,
343,
1276,
1819,
338,
9158,
290,
391,
4019,
7533,
49,
341,
1522,
347,
341,
3520,
1118,
666,
6320,
10238,
1364,
8133,
13722,
51,
2790,
49,
331,
21185,
651,
1819,
338,
19213,
1522,
1118,
4814,
4706,
708,
1868,
391,
545,
6563,
63,
1819,
588,
343,
1614,
320,
419,
1701,
1948,
4293,
299,
1948
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
1105,
51,
45265,
51,
112,
2569,
51,
1663,
51,
12880,
386,
51,
1058,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
730,
51,
28800,
463,
13268,
976,
64,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
1058,
51,
976,
2769,
64,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
1058,
51,
84,
11663,
2272,
19835,
64,
222,
485,
1105,
51,
4140,
51,
513,
51,
976,
22141,
718,
46493,
64,
222,
222,
1350,
222,
338,
6170,
1319,
391,
8664,
642,
6454,
7981,
13722,
51,
222,
588,
222,
942,
462,
18878,
3825,
84,
11663,
2272,
2775,
320,
303,
581,
1175,
924,
648,
7490,
100,
18405,
299,
244,
55,
64,
465,
1041,
294,
338,
565,
18600,
4212,
21861,
19835,
12982,
764,
666,
34729,
680,
3939,
341,
1808,
52,
1375,
24799,
51,
1369,
1431,
458,
331,
1409,
50,
11291,
391,
456,
104,
22040,
3365,
294,
338,
12609,
4706,
708,
904,
2448,
347,
15490,
7129,
347,
341,
3520,
1294,
666,
347,
4137,
51,
294,
338,
5402,
338,
496,
772,
3241,
294,
338,
496,
772,
828,
294,
338,
496,
772,
3098,
294,
588,
303,
581,
782,
2183,
4293,
45,
84,
11663,
2272,
19835
] | -1,030,359,415,611,811,600
| true
| false
| false
| false
|
[
64,
222,
485,
1105,
51,
45265,
51,
29773,
51,
112,
2341,
51,
1058,
51,
84,
11663,
2272,
19835,
64,
222,
485,
1105,
51,
4140,
51,
513,
51,
976,
22141,
718,
46493,
64,
222,
222,
1350,
222,
338,
6170,
1319,
391,
8664,
642,
6454,
7981,
13722,
51,
222,
588,
222,
942,
462,
18878,
3825,
84,
11663,
2272,
2775,
320,
303,
581,
1175,
924,
648,
7490,
100,
18405,
299,
244,
55,
64,
465,
1041,
294,
338,
565,
18600,
4212,
21861,
19835,
12982,
764,
666,
34729,
680,
3939,
341,
1808,
52,
1375,
24799,
51,
1369,
1431,
458,
331,
1409,
50,
11291,
391,
456
] | -3,523,426,301,552,666,600
| true
|
of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.kuali.kfs.module.purap.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.util.ObjectUtils;
import org.kuali.rice.krad.util.OjbCollectionAware;
import org.springframework.orm.ObjectRetrievalFailureException;
/**
* Helper object to deal with persisting collections.
*/
public class PurApOjbCollectionHelper {
public final static int MAX_DEPTH = 2;
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to for
|
If not, see <http://www.gnu.org/licenses/>.
*/
package org.kuali.kfs.module.purap.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.util.ObjectUtils;
import org.kuali.rice.krad.util.OjbCollectionAware;
import org.springframework.orm.ObjectRetrievalFailureException;
/**
* Helper object to deal with persisting collections.
*/
public class PurApOjbCollectionHelper {
public final static int MAX_DEPTH = 2;
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to for
|
import java.util.Iterator;
import java.util.List;
import org.kuali.rice.krad.bo.PersistableBusinessObject;
import org.kuali.rice.krad.util.ObjectUtils;
import org.kuali.rice.krad.util.OjbCollectionAware;
import org.springframework.orm.ObjectRetrievalFailureException;
/**
* Helper object to deal with persisting collections.
*/
public class PurApOjbCollectionHelper {
public final static int MAX_DEPTH = 2;
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to for
|
;
import org.kuali.rice.krad.util.OjbCollectionAware;
import org.springframework.orm.ObjectRetrievalFailureException;
/**
* Helper object to deal with persisting collections.
*/
public class PurApOjbCollectionHelper {
public final static int MAX_DEPTH = 2;
/**
* OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to for
|
cibly remove
* business objects that are found in Collections stored in the database but not in memory.
*
* @param orig
* @param id
* @param template
*/
public void processCollections(OjbCollectionAware
|
DatabaseAssociation.java
|
/FileExtraction/Java_unseen/wandora-team_wandora/src/main/java/org/wandora/topicmap/database/DatabaseAssociation.java
|
/*
* WANDORA
* Knowledge Extraction, Management, and Publishing Application
* http://wandora.org
*
* Copyright (C) 2004-2023 Wandora Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*
*
* DatabaseAssociation.java
*
* Created on 7. marraskuuta 2005, 11:28
*/
package org.wandora.topicmap.database;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.wandora.topicmap.Association;
import org.wandora.topicmap.Topic;
import org.wandora.topicmap.TopicMap;
import org.wandora.topicmap.TopicMapException;
import org.wandora.topicmap.TopicMapReadOnlyException;
import org.wandora.topicmap.TopicRemovedException;
/**
*
* @author olli
*/
public class DatabaseAssociation implements Association {
protected DatabaseTopicMap topicMap;
protected String id;
protected boolean full;
protected DatabaseTopic type;
protected Hashtable<Topic,Topic> players;
protected boolean removed=false;
/** Creates a new instance of DatabaseAssociation */
public DatabaseAssociation(DatabaseTopic type,DatabaseTopicMap topicMap) {
this.type=type;
this.topicMap=topicMap;
full=false;
}
public DatabaseAssociation(DatabaseTopic type,String id,DatabaseTopicMap topicMap) {
this(type,topicMap);
this.id=id;
}
public DatabaseAssociation(String id,DatabaseTopicMap topicMap) {
this.topicMap=topicMap;
this.id=id;
full=false;
}
public DatabaseAssociation(Map<String,Object> row,DatabaseTopicMap topicMap) throws TopicMapException {
this(topicMap.buildTopic(row),topicMap);
this.id=row.get("ASSOCIATIONID").toString();
}
void initialize(DatabaseTopic type){
this.type=type;
}
protected String escapeSQL(String s){
return topicMap.escapeSQL(s);
}
private static int idcounter=0;
protected static synchronized String makeID(){
if(idcounter>=100000) idcounter=0;
return "A"+System.currentTimeMillis()+"-"+(idcounter++);
}
public String getID(){
return id;
}
void create() throws TopicMapException {
players=new Hashtable<Topic,Topic>();
full=true;
id=makeID();
topicMap.executeUpdate("insert into ASSOCIATION (ASSOCIATIONID,TYPE) values ('"+escapeSQL(id)+"','"+escapeSQL(type.getID())+"')");
}
static HashMap<String,DatabaseTopic> makeFullAll(Collection<Map<String,Object>> res,HashMap<String,DatabaseAssociation> associations,DatabaseTopicMap topicMap) throws TopicMapException {
HashMap<String,DatabaseTopic> collected=new LinkedHashMap<String,DatabaseTopic>();
String associationID=null;
Hashtable<Topic,Topic> players=null;
for(Map<String,Object> row : res){
if(associationID==null || !associationID.equals(row.get("ASSOCIATION"))){
if(associationID!=null){
DatabaseAssociation dba=associations.get(associationID);
if(dba!=null && !dba.full){
dba.full=true;
dba.players=players;
}
}
players=new Hashtable<Topic,Topic>();
associationID=row.get("ASSOCIATION").toString();
}
DatabaseTopic player=topicMap.buildTopic(row.get("PLAYERID"),row.get("PLAYERBN"),row.get("PLAYERSL"));
DatabaseTopic role=topicMap.buildTopic(row.get("ROLEID"),row.get("ROLEBN"),row.get("ROLESL"));
collected.put(player.getID(),player);
collected.put(role.getID(),role);
players.put(role,player);
}
if(associationID!=null){
DatabaseAssociation dba=associations.get(associationID);
if(dba!=null && !dba.full){
dba.full=true;
dba.players=players;
}
}
return collected;
}
void makeFull() throws TopicMapException {
full=true;
Collection<Map<String,Object>> res=
topicMap.executeQuery("select P.TOPICID as PLAYERID, P.BASENAME as PLAYERNAME, P.SUBJECTLOCATOR as PLAYERSL, "+
"R.TOPICID as ROLEID, R.BASENAME as ROLENAME, R.SUBJECTLOCATOR as ROLESL from "+
"TOPIC as P,TOPIC as R, MEMBER as M where P.TOPICID=M.PLAYER and "+
"R.TOPICID=M.ROLE and M.ASSOCIATION='"+escapeSQL(id)+"'");
players=new Hashtable<Topic,Topic>();
for(Map<String,Object> row : res){
Topic role=topicMap.buildTopic(row.get("ROLEID"),row.get("ROLENAME"),row.get("ROLESL"));
Topic player=topicMap.buildTopic(row.get("PLAYERID"),row.get("PLAYERNAME"),row.get("PLAYERSL"));
players.put(role,player);
}
}
@Override
public Topic getType() throws TopicMapException {
return type;
}
@Override
public void setType(Topic t) throws TopicMapException {
if( removed ) throw new TopicRemovedException();
if(!full) makeFull();
for(Map.Entry<Topic,Topic> e : players.entrySet()){
Topic role=e.getKey();
Topic player=e.getValue();
((DatabaseTopic)player).associationChanged(this, t, type, role, role);
}
Topic old=type;
type=(DatabaseTopic)t;
topicMap.executeUpdate("update ASSOCIATION set TYPE='"+escapeSQL(type.getID())+"' where ASSOCIATIONID='"+escapeSQL(id)+"'");
topicMap.associationTypeChanged(this,t,old);
}
@Override
public Topic getPlayer(Topic role) throws TopicMapException {
if(!full) makeFull();
return players.get(role);
}
@Override
public void addPlayer(Topic player,Topic role) throws TopicMapException {
if( removed ) throw new TopicRemovedException();
if(topicMap.isReadOnly()) throw new TopicMapReadOnlyException();
if(!full) makeFull();
Topic old=players.get(role);
if(old!=null){
((DatabaseTopic)old).associationChanged(this, null, type,null, role);
topicMap.executeUpdate("update MEMBER set PLAYER='"+escapeSQL(player.getID())+"' where "+
"ASSOCIATION='"+escapeSQL(id)+"' and ROLE='"+escapeSQL(role.getID())+"'");
}
else{
topicMap.executeUpdate("insert into MEMBER (ASSOCIATION,PLAYER,ROLE) values "+
"('"+escapeSQL(id)+"','"+escapeSQL(player.getID())+"','"+escapeSQL(role.getID())+"')");
}
((DatabaseTopic)player).associationChanged(this,type,null,role,null);
players.put(role,player);
if(topicMap.getConsistencyCheck()) checkRedundancy();
topicMap.associationPlayerChanged(this,role,player,old);
}
@Override
public void addPlayers(Map<Topic,Topic> players) throws TopicMapException {
if( removed ) throw new TopicRemovedException();
if(topicMap.isReadOnly()) throw new TopicMapReadOnlyException();
boolean changed=false;
for(Map.Entry<Topic,Topic> e : players.entrySet()){
DatabaseTopic role=(DatabaseTopic)e.getKey();
DatabaseTopic player=(DatabaseTopic)e.getValue();
Topic old=this.players.get(role);
if(old!=null){
((DatabaseTopic)old).associationChanged(this, null, type,null, role);
topicMap.executeUpdate("update MEMBER set PLAYER='"+escapeSQL(player.getID())+"' where "+
"ASSOCIATION='"+escapeSQL(id)+"' and ROLE='"+escapeSQL(role.getID())+"'");
}
else{
topicMap.executeUpdate("insert into MEMBER (ASSOCIATION,PLAYER,ROLE) values "+
"('"+escapeSQL(id)+"','"+escapeSQL(player.getID())+"','"+escapeSQL(role.getID())+"')");
}
((DatabaseTopic)player).associationChanged(this,type,null,role,null);
this.players.put(role,player);
topicMap.associationPlayerChanged(this,role,player,old);
}
if(topicMap.getConsistencyCheck()) checkRedundancy();
}
@Override
public void removePlayer(Topic role) throws TopicMapException {
if( removed ) throw new TopicRemovedException();
if(topicMap.isReadOnly()) throw new TopicMapReadOnlyException();
if(!full) makeFull();
Topic old=players.get(role);
if(old!=null){
((DatabaseTopic)old).associationChanged(this, null, type,null, role);
topicMap.executeUpdate("delete from MEMBER where "+
"ASSOCIATION='"+escapeSQL(id)+"' and ROLE='"+escapeSQL(role.getID())+"'");
}
players.remove(role);
checkRedundancy();
topicMap.associationPlayerChanged(this,role,null,old);
}
@Override
public Collection<Topic> getRoles() throws TopicMapException {
if(!full) makeFull();
return players.keySet();
}
@Override
public TopicMap getTopicMap(){
return topicMap;
}
@Override
public void remove() throws TopicMapException {
if(topicMap.isReadOnly()) throw new TopicMapReadOnlyException();
if(!full) makeFull();
removed=true;
for(Map.Entry<Topic,Topic> e : players.entrySet()){
Topic role=e.getKey();
Topic player=e.getValue();
((DatabaseTopic)player).associationChanged(this, null, type, null, role);
}
topicMap.executeUpdate("delete from MEMBER where ASSOCIATION='"+escapeSQL(id)+"'");
topicMap.executeUpdate("delete from ASSOCIATION where ASSOCIATIONID='"+escapeSQL(id)+"'");
topicMap.associationRemoved(this);
}
@Override
public boolean isRemoved() throws TopicMapException {
return removed;
}
public void checkRedundancy() throws TopicMapException {
if(topicMap.isReadOnly()) throw new TopicMapReadOnlyException();
if(players.isEmpty()) return;
if(type==null) return;
Collection<Association> smallest=null;
for(Topic role : players.keySet()){
Topic player=players.get(role);
Collection<Association> c=player.getAssociations(type,role);
if(smallest==null || c.size()<smallest.size()) smallest=c;
// getAssociations may be a timeconsuming method so don't check everything if not necessary
if(smallest!=null && smallest.size()<50) break;
}
HashSet<Association> delete=new HashSet();
for(Association a : smallest){
if(a==this) continue;
if(((DatabaseAssociation)a)._equals(this)){
delete.add(a);
}
}
for(Association a : delete){
a.remove();
}
}
boolean _equals(DatabaseAssociation a){
if(a == null) return false;
return (players.equals(a.players)&&(type==a.type));
}
int _hashCode(){
return players.hashCode()+type.hashCode();
}
/*
public int hashCode(){
return id.hashCode();
}
public boolean equals(Object o){
if(o instanceof DatabaseAssociation){
return id.equals(((DatabaseAssociation)o).id);
}
else return false;
}*/
}
| 12,088
|
Java
|
.java
|
wandora-team/wandora
| 126
| 26
| 0
|
2014-06-30T10:25:42Z
|
2023-09-09T07:13:29Z
|
9b966d0ada84e816610cf9929a17105f4211bcd6d93154c8b3aa0ac8b5829c86
|
[] |
[
1127,
222,
338,
643,
3362,
48972,
222,
338,
38460,
1300,
15583,
49,
13128,
49,
480,
17523,
318,
6700,
222,
338,
1930,
574,
48836,
7298,
51,
1107,
222,
338,
1676,
338,
2657,
327,
72,
46,
244,
55,
53,
53,
57,
50,
55,
53,
55,
56,
643,
382,
7298,
12653,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
222,
338,
1676,
338,
222,
338,
6728,
15364,
51,
1874,
222,
338,
222,
338,
6956,
563,
244,
60,
51,
364,
865,
933,
122,
17766,
244,
55,
53,
53,
58,
49,
244,
54,
54,
63,
55,
61,
222,
588,
222,
222,
1337,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
4617,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
40367,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
15364,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
1002,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
11060,
1002,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
16971,
1002,
64,
222,
222,
1350,
222,
338,
222,
338,
496,
2133,
9881,
393,
222,
588,
222,
942,
462,
6728,
15364,
4584,
37840,
320,
2205,
2532,
6728,
8304,
1225,
8480,
1225,
64,
303,
2532,
910,
828,
64,
303,
2532,
1922,
3559,
64,
303,
2532,
6728,
8304,
847,
64,
303,
2532,
46324,
65,
8304,
49,
8304,
67,
14580,
64,
303,
2532,
1922,
6563,
66,
1886,
64,
2205,
1041,
9308,
331,
556,
1998,
451,
6728,
15364,
588,
303,
581,
6728,
15364,
45,
3969,
8304,
847,
49,
3969,
8304,
1225,
8480,
1225,
46,
320,
310,
477,
51,
700,
66,
700,
64,
310,
477,
51,
5490,
1225,
66,
5490,
1225,
64,
310,
3559,
66,
1886,
64,
303,
339,
2205,
581,
6728,
15364,
45,
3969,
8304,
847,
49,
671,
828,
49,
3969,
8304,
1225,
8480,
1225,
46,
320,
310,
477,
45,
700,
49,
5490,
1225,
312,
310,
477,
51,
333,
66,
333,
64,
303,
339,
2205,
581,
6728,
15364,
45,
671,
828,
49,
3969,
8304,
1225,
8480,
1225,
46,
320,
310,
477,
51,
5490,
1225,
66,
5490,
1225,
64,
310,
477,
51,
333,
66,
333,
64,
310,
3559,
66,
1886,
64,
303,
339,
2205,
581,
6728,
15364,
45,
1225,
65,
671,
49,
976,
67,
2720,
49,
3969,
8304,
1225,
8480,
1225,
46,
2589,
22329,
1225,
1002,
320,
310,
477,
45,
5490,
1225,
51,
1848,
8304,
45,
661,
490,
5490,
1225,
312,
310,
477,
51,
333,
66,
661,
51,
390,
459,
3316,
41843,
2909,
798,
1912,
3127,
492,
303,
339,
2205,
782,
7395,
45,
3969,
8304,
847,
1528,
310,
477,
51,
700,
66,
700,
64,
303,
339,
2205,
2532,
910,
15821,
3566,
45,
671,
328,
1528,
310,
461,
8480,
1225,
51,
11735,
3566,
45,
120,
312,
303,
339,
465,
964,
924,
648,
828,
4696,
66,
53,
64,
18081,
2532,
924,
13436,
910,
1949,
798,
3261,
310,
434,
45,
333,
4696,
7168,
54,
53,
53,
53,
53,
53,
46,
828,
4696,
66,
53,
64,
310,
461,
332,
70,
5141,
1615,
51,
17217,
30575,
50,
5141,
45,
333,
4696,
24872,
303,
339,
2205,
581,
910,
640,
798,
3261,
310,
461,
828,
64,
303,
339,
2205,
782,
1506,
365,
2589,
22329,
1225,
1002,
320,
310,
14580,
66,
909,
46324,
65,
8304,
49,
8304,
2938,
310,
3559,
66,
1527,
64,
310,
828,
66,
2696,
798,
492,
310,
8480,
1225,
51,
42164,
459,
3233,
2012,
32372,
41843,
2909,
327,
3316,
41843,
2909,
798,
49,
2333,
46,
2102,
2751,
5141,
11735,
3566,
45,
333,
34636,
1216,
5141,
11735,
3566,
45,
700,
51,
37541,
1177,
5688,
704,
742,
303,
339,
465,
924,
8329,
65,
671,
49,
3969,
8304,
67,
1949,
4737,
1947,
45,
2272,
65,
1225,
65,
671,
49,
976,
2023,
755,
49,
8263,
65,
671,
49,
3969,
15364,
67,
43294,
49,
3969,
8304,
1225,
8480,
1225,
46,
2589,
22329,
1225,
1002,
320,
310,
8329,
65,
671,
49,
3969,
8304,
67,
21651,
66,
909,
34961,
65,
671,
49,
3969,
8304,
2938,
310,
910,
20708,
798,
66,
1710,
64,
310,
46324,
65,
8304,
49,
8304,
67,
14580,
66,
1710,
64,
310,
456,
45,
1225,
65,
671,
49,
976,
67,
2720,
518,
755,
1528,
343,
434,
45,
25175,
798,
398,
1710,
1293,
673,
25175,
798,
51,
3591,
45,
661,
51,
390,
459,
3316,
41843,
2909,
2152,
1528,
419,
434,
45,
25175,
798,
6917,
1710,
1528,
547,
6728,
15364,
362,
2679,
66,
13147,
1014,
51,
390,
45,
25175,
798,
312,
547,
434,
45,
30257,
6917,
1710,
979,
673,
30257,
51,
2638,
1528,
733,
362,
2679,
51,
2638,
66,
1527,
64,
733,
362,
2679,
51,
14403,
66,
14403,
64,
547,
339,
419,
339,
419,
14580,
66,
909,
46324,
65,
8304,
49,
8304,
2938,
419,
20708,
798,
66,
661,
51,
390,
459,
3316,
41843,
2909,
1912,
3127,
492,
343,
339,
343,
6728,
8304,
4376,
66,
5490,
1225,
51,
1848,
8304,
45,
661,
51,
390,
459,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
222,
338,
1676,
338,
222,
338,
6728,
15364,
51,
1874,
222,
338,
222,
338,
6956,
563,
244,
60,
51,
364,
865,
933,
122,
17766,
244,
55,
53,
53,
58,
49,
244,
54,
54,
63,
55,
61,
222,
588,
222,
222,
1337,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
4617,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
40367,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
15364,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
1002,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
11060,
1002,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
16971,
1002,
64,
222,
222,
1350,
222,
338,
222,
338,
496,
2133,
9881,
393,
222
] | -529,798,202,563,973,440
| true
| false
| false
| false
|
[
48836,
7298,
51,
5490,
1130,
51,
4617,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
40367,
64,
222,
485,
1401,
51,
1058,
51,
15373,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
15364,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
64,
222,
485,
1105,
51,
48836,
7298,
51,
5490,
1130,
51,
8304,
1225,
64,
222,
485,
1105,
51,
48836
] | -335,970,513,470,743,550
| true
|
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*
*
* DatabaseAssociation.java
*
* Created on 7. marraskuuta 2005, 11:28
*/
package org.wandora.topicmap.database;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.wandora.topicmap.Association;
import org.wandora.topicmap.Topic;
import org.wandora.topicmap.TopicMap;
import org.wand
|
. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*
*
* DatabaseAssociation.java
*
* Created on 7. marraskuuta 2005, 11:28
*/
package org.wandora.topicmap.database;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.wandora.topicmap.Association;
import org.wandora.topicmap.Topic;
import org.wandora.topicmap.TopicMap;
import org.wand
|
/licenses/>.
*
*
*
*
* DatabaseAssociation.java
*
* Created on 7. marraskuuta 2005, 11:28
*/
package org.wandora.topicmap.database;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.wandora.topicmap.Association;
import org.wandora.topicmap.Topic;
import org.wandora.topicmap.TopicMap;
import org.wand
|
wandora.topicmap.database;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import org.wandora.topicmap.Association;
import org.wandora.topicmap.Topic;
import org.wandora.topicmap.TopicMap;
import org.wand
|
ora.topicmap.TopicMapException;
import org.wandora.topicmap.TopicMapReadOnlyException;
import org.wandora.topicmap.TopicRemovedException;
/**
*
* @author olli
|
PushService.java
|
/FileExtraction/Java_unseen/LinceBI_lincebi/lincebi-backend/src/main/java/com/stratebi/lincebi/push/service/PushService.java
|
package com.stratebi.lincebi.push.service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.stratebi.lincebi.push.model.Notification;
import com.stratebi.lincebi.push.model.Registration;
import org.pentaho.platform.api.engine.IAuthorizationPolicy;
import org.pentaho.platform.api.repository2.unified.IUnifiedRepository;
import org.pentaho.platform.engine.core.system.PentahoSessionHolder;
import org.pentaho.platform.engine.core.system.PentahoSystem;
import org.pentaho.platform.engine.security.SecurityHelper;
import org.pentaho.platform.repository.usersettings.UserSettingService;
import org.pentaho.platform.repository2.ClientRepositoryPaths;
import org.pentaho.platform.security.policy.rolebased.actions.AdministerSecurityAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
public class PushService {
private static final Logger LOGGER = LoggerFactory.getLogger(PushService.class);
private static final String REGISTRATIONS_SETTING_NAME = UserSettingService.SETTING_PREFIX + "lincebi.push.registrations";
private static final String NOTIFY_ENDPOINT_URL = "https://push.lincebi.com/v1/notify/";
private static final byte[] LOCK = new byte[0];
private static boolean canAdminister() {
IAuthorizationPolicy authorizationPolicy = PentahoSystem.get(IAuthorizationPolicy.class, PentahoSessionHolder.getSession());
return authorizationPolicy.isAllowed(AdministerSecurityAction.NAME);
}
private static Map<String, Registration> getRegistrations(String username) {
try {
if (username == null) {
username = PentahoSessionHolder.getSession().getName();
} else if (!PushService.canAdminister()) {
throw new SecurityException("Unauthorized user");
}
IUnifiedRepository repository = PentahoSystem.get(IUnifiedRepository.class);
String homePath = ClientRepositoryPaths.getUserHomeFolderPath(username);
Serializable userHomeId = repository.getFile(homePath).getId();
Map<String, Serializable> userMetadata = repository.getFileMetadata(userHomeId);
for (Map.Entry<String, Serializable> entry : userMetadata.entrySet()) {
String key = entry.getKey();
if (key.equals(PushService.REGISTRATIONS_SETTING_NAME)) {
ObjectMapper mapper = new ObjectMapper();
String rawRegistrations = entry.getValue().toString();
return mapper.readValue(rawRegistrations, new TypeReference<HashMap<String, Registration>>(){});
}
}
} catch (Exception ex) {
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
PushService.LOGGER.error(sw.toString());
}
return new HashMap<String, Registration>(){};
}
private static void setRegistrations(String username, Map<String, Registration> registrations) {
try {
if (username == null) {
username = PentahoSessionHolder.getSession().getName();
} else if (!PushService.canAdminister()) {
throw new SecurityException("Unauthorized user");
}
synchronized (PushService.LOCK) {
IUnifiedRepository repository = PentahoSystem.get(IUnifiedRepository.class);
String homePath = ClientRepositoryPaths.getUserHomeFolderPath(username);
Serializable userHomeId = repository.getFile(homePath).getId();
Map<String, Serializable> userMetadata = repository.getFileMetadata(userHomeId);
ObjectMapper mapper = new ObjectMapper();
String rawRegistrations = mapper.writeValueAsString(registrations);
userMetadata.put(PushService.REGISTRATIONS_SETTING_NAME, rawRegistrations);
SecurityHelper.getInstance().runAsSystem((Callable<Void>) () -> {
repository.setFileMetadata(userHomeId, userMetadata);
return null;
});
}
} catch (Exception ex) {
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
PushService.LOGGER.error(sw.toString());
}
}
public static List<Registration> list() {
return PushService.list(null);
}
public static List<Registration> list(String username) {
Map<String, Registration> registrations = PushService.getRegistrations(username);
return new ArrayList<>(registrations.values());
}
public static void register(Registration registration) {
PushService.register(null, registration);
}
public static void register(String username, Registration registration) {
Map<String, Registration> registrations = PushService.getRegistrations(username);
registrations.put(registration.getDevice(), registration);
PushService.setRegistrations(username, registrations);
}
public static void unregister(Registration registration) {
PushService.unregister(null, registration);
}
public static void unregister(String username, Registration registration) {
Map<String, Registration> registrations = PushService.getRegistrations(username);
registrations.remove(registration.getDevice());
PushService.setRegistrations(username, registrations);
}
public static void notify(Notification notification) {
PushService.notify(null, notification);
}
public static void notify(String username, Notification notification) {
Map<String, Registration> registrations = PushService.getRegistrations(username);
for (Registration registration : registrations.values()) {
HttpHeaders reqHeader = new HttpHeaders();
reqHeader.put("Content-Type", Collections.singletonList("application/json"));
ObjectMapper mapper = new ObjectMapper();
ObjectNode reqBody = mapper.createObjectNode();
reqBody.put("device", registration.getDevice());
reqBody.put("instance", registration.getInstance());
reqBody.put("secret", registration.getSecret());
reqBody.set("notification", mapper.valueToTree(notification));
HttpEntity<String> reqEntity = new HttpEntity<>(reqBody.toString(), reqHeader);
try {
RestTemplate restTemplate = new RestTemplate();
restTemplate.exchange(PushService.NOTIFY_ENDPOINT_URL, HttpMethod.POST, reqEntity, String.class);
} catch (HttpStatusCodeException ex) {
PushService.LOGGER.error(ex.getMessage());
if (ex.getStatusCode() == HttpStatus.UNAUTHORIZED || ex.getStatusCode() == HttpStatus.GONE) {
PushService.unregister(username, registration);
}
}
}
}
}
| 6,769
|
Java
|
.java
|
LinceBI/lincebi
| 36
| 14
| 1
|
2020-03-13T13:35:26Z
|
2024-03-21T16:21:22Z
|
5452a7d1ad1fdd8c552c500fe93d1eaf491285132981aa9997cfeebca1a04e8b
|
[] |
[
1337,
785,
51,
46875,
6539,
51,
1823,
388,
6539,
51,
2036,
51,
2140,
64,
222,
222,
485,
785,
51,
15066,
51,
13353,
51,
1284,
51,
700,
51,
638,
3580,
64,
222,
485,
785,
51,
15066,
51,
13353,
51,
21416,
51,
36254,
64,
222,
485,
785,
51,
15066,
51,
13353,
51,
21416,
51,
1271,
51,
976,
1230,
64,
222,
485,
785,
51,
46875,
6539,
51,
1823,
388,
6539,
51,
2036,
51,
1184,
51,
6258,
64,
222,
485,
785,
51,
46875,
6539,
51,
1823,
388,
6539,
51,
2036,
51,
1184,
51,
11509,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
1256,
51,
3502,
51,
78,
8474,
4263,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
1256,
51,
6335,
55,
51,
44188,
51,
78,
48733,
3231,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
3502,
51,
1284,
51,
2964,
51,
85,
323,
14390,
3152,
6773,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
3502,
51,
1284,
51,
2964,
51,
85,
323,
14390,
1615,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
3502,
51,
4386,
51,
5196,
2775,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
6335,
51,
514,
3563,
51,
1259,
7093,
1201,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
6335,
55,
51,
1503,
3231,
9648,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
4386,
51,
6060,
51,
4315,
7893,
51,
3564,
51,
4208,
19238,
5196,
1728,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
2233,
2234,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
42317,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
30968,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
25631,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
34601,
1002,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
7005,
3455,
64,
222,
222,
485,
1401,
51,
735,
51,
42446,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
735,
51,
671,
3989,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
14485,
64,
222,
222,
942,
462,
15071,
1201,
320,
499,
221,
2072,
924,
1175,
7145,
15794,
299,
21818,
51,
10588,
45,
8101,
1201,
51,
842,
312,
499,
221,
2072,
924,
1175,
910,
11755,
23170,
19412,
100,
21743,
100,
2491,
299,
2694,
7093,
1201,
51,
21743,
100,
9857,
494,
332,
1823,
388,
6539,
51,
2036,
51,
12076,
31484,
884,
499,
221,
2072,
924,
1175,
910,
2387,
12774,
100,
26426,
100,
2427,
299,
332,
662,
574,
2036,
51,
1823,
388,
6539,
51,
527,
52,
123,
54,
52,
9357,
26217,
499,
221,
2072,
924,
1175,
3447,
1197,
40601,
299,
556,
3447,
96,
53,
988,
499,
221,
2072,
924,
1922,
902,
4208,
19238,
365,
320,
376,
221,
78,
8474,
4263,
14018,
4263,
299,
466,
323,
14390,
1615,
51,
390,
45,
78,
8474,
4263,
51,
842,
49,
466,
323,
14390,
3152,
6773,
51,
25942,
1052,
376,
221,
620,
14018,
4263,
51,
316,
12764,
45,
4208,
19238,
5196,
1728,
51,
2491,
312,
222,
221,
130,
499,
221,
2072,
924,
3531,
65,
671,
49,
27512,
67,
640,
13553,
31484,
45,
671,
969,
46,
320,
376,
221,
1287,
320,
374,
221,
344,
327,
715,
630,
762,
46,
320,
621,
221,
715,
299,
466,
323,
14390,
3152,
6773,
51,
25942,
941,
5175,
492,
374,
221,
130,
832,
434,
1445,
8101,
1201,
51,
3389,
4208,
19238,
1177,
320,
621,
221,
5267,
556,
7344,
1002,
459,
21566,
1275,
742,
374,
221,
130,
2556,
221,
78,
48733,
3231,
5347,
299,
466,
323,
14390,
1615,
51,
390,
45,
78,
48733,
3231,
51,
842,
312,
374,
221,
671,
6780,
1233,
299,
5680,
3231,
9648,
51,
12226,
4637,
40937,
45,
715,
312,
374,
221,
12644,
1275,
4637,
625,
299,
5347,
51,
22184,
45,
2849,
1233,
566,
7068,
492,
374,
221,
1225,
65,
671,
49,
19182,
67,
1275,
4108,
299,
5347,
51,
22184,
4108,
45,
514,
4637,
625,
312,
2556,
221,
999,
327,
1225,
51,
2717,
65,
671,
49,
19182,
67,
3429,
518,
1275,
4108,
51,
24338,
1177,
320,
621,
221,
671,
1221,
299,
3429,
51,
11728,
492,
621,
221,
344,
327,
697,
51,
3591,
45,
8101,
1201,
51,
29884,
19412,
100,
21743,
100,
2491,
509,
320,
596,
221,
36254,
15080,
299,
556,
33289,
492,
596,
221,
671,
5096,
13553,
31484,
299,
3429,
51,
6693,
941,
3127,
492,
596,
221,
620,
15080,
51,
45216,
45,
1312,
13553,
31484,
49,
556,
2782,
3580,
65,
8263,
65,
671,
49,
27512,
2023,
3261,
1933,
621,
221,
130,
374,
221,
130,
376,
221,
130,
2385,
327,
1002,
557,
46,
320,
374,
221,
671,
3989,
2552,
299,
556,
910,
3989,
492,
374,
221,
346,
51,
9428,
45,
909,
47163,
45,
1605,
894,
374,
221,
8101,
1201,
51,
22205,
51,
750,
45,
1605,
51,
3127,
1052,
376,
221,
130,
1332,
221,
620,
556,
8329,
65,
671,
49,
27512,
67,
3261,
1274,
222,
221,
130,
499,
221,
2072,
924,
782,
758,
13553,
31484,
45,
671,
969,
49,
3531,
65,
671,
49,
27512,
67,
9421,
31484,
46,
320,
376,
221,
1287,
320,
374,
221,
344,
327,
715,
630,
762,
46,
320,
621,
221,
715,
299,
466,
323,
14390,
3152,
6773,
51,
25942,
941,
5175,
492,
374,
221,
130,
832,
434,
1445,
8101,
1201,
51,
3389,
4208,
19238,
1177,
320,
621,
221,
5267,
556,
7344,
1002,
459,
21566,
1275,
742,
374,
221,
130,
2556,
221,
34508,
327,
8101,
1201,
51,
5364,
46,
320,
621,
221,
78,
48733,
3231,
5347,
299,
466,
323,
14390,
1615,
51,
390,
45,
78,
48733,
3231,
51,
842,
312,
621,
221,
671,
6780,
1233,
299,
5680,
3231,
9648,
51,
12226,
4637,
40937,
45,
715,
312,
621,
221,
12644,
1275,
4637,
625,
299,
5347,
51,
22184,
45,
2849,
1233,
566,
7068,
492,
621,
221,
1225,
65,
671,
49,
19182,
67,
1275,
4108,
299,
5347,
51,
22184,
4108,
45,
514,
4637,
625,
312,
5033,
221,
36254,
15080,
299,
556,
33289,
492,
621
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1284,
51,
2964,
51,
85,
323,
14390,
3152,
6773,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
3502,
51,
1284,
51,
2964,
51,
85,
323,
14390,
1615,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
3502,
51,
4386,
51,
5196,
2775,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
6335,
51,
514,
3563,
51,
1259,
7093,
1201,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
6335,
55,
51,
1503,
3231,
9648,
64,
222,
485,
1105,
51,
17605,
51,
5146,
51,
4386,
51,
6060,
51,
4315,
7893,
51,
3564,
51,
4208,
19238,
5196,
1728,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
2233,
2234,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
42317,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
30968,
64,
222,
485,
1105,
51,
4140,
51,
544,
51,
25631,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
34601,
1002,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
7005,
3455,
64,
222,
222,
485,
1401,
51,
735,
51,
42446,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
735,
51,
671,
3989,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
14485,
64,
222,
222,
942,
462,
15071,
1201,
320,
499,
221,
2072,
924,
1175,
7145,
15794,
299,
21818,
51,
10588,
45,
8101,
1201,
51,
842,
312,
499,
221,
2072,
924,
1175,
910,
11755,
23170,
19412,
100,
21743,
100,
2491,
299,
2694
] | 4,700,282,726,792,602,000
| true
| false
| false
| false
|
[
485,
1105,
51,
4140,
51,
544,
51,
25631,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
34601,
1002,
64,
222,
485,
1105,
51,
4140,
51,
1857,
51,
1598,
51,
7005,
3455,
64,
222,
222,
485,
1401,
51,
735,
51,
42446,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
735,
51,
671,
3989,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225
] | 7,782,389,957,765,652,000
| true
|
core.system.PentahoSessionHolder;
import org.pentaho.platform.engine.core.system.PentahoSystem;
import org.pentaho.platform.engine.security.SecurityHelper;
import org.pentaho.platform.repository.usersettings.UserSettingService;
import org.pentaho.platform.repository2.ClientRepositoryPaths;
import org.pentaho.platform.security.policy.rolebased.actions.AdministerSecurityAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map
|
platform.repository.usersettings.UserSettingService;
import org.pentaho.platform.repository2.ClientRepositoryPaths;
import org.pentaho.platform.security.policy.rolebased.actions.AdministerSecurityAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map
|
org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map
|
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map
|
;
import java.util.concurrent.Callable;
public class PushService {
private static final Logger LOGGER = LoggerFactory.getLogger(PushService.class);
private static final String REGISTRATIONS_SETTING_NAME = User
|
NoteDBAdapter.java
|
/FileExtraction/Java_unseen/tianyuan168326_nono-android/app/src/main/java/com/seki/noteasklite/DBHelpers/NoteDBAdapter.java
|
package com.seki.noteasklite.DBHelpers;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import com.seki.noteasklite.DataUtil.NoteDatabaseArray;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 七升 on 2015/9/13.
*/
public class NoteDBAdapter {
public static final String KEY_ROWID="_id";
public static final String KEY_GROUP="groups";
public static final String KEY_DATE="date";
public static final String KEY_TIME="time";
public static final String KEY_TITLE="title";
public static final String KEY_CONTENT="content";
public static final String KEY_IS_ON_CLOUD="is_on_cloud";
public static final String KEY_NOTIFY="notify";
public static final String KEY_UUID="uuid";
private static final String DATABASE_TABLE="notes";
private final Context context;
private DatabaseHelper DBHelper;
private SQLiteDatabase db;
public void updateGroup(String oldG, String newG) {
String sql = "update notes set groups=? where groups=?";
db.execSQL(sql,new String[]{newG,oldG});
}
public NoteDBAdapter(Context ctx) {
this.context = ctx;
//this.set=set;
DBHelper = new DatabaseHelper(context);
}
public NoteDBAdapter open() throws SQLException {
db = DBHelper.getWritableDatabase();
return this;
}
public void close() {
DBHelper.close();
}
public int updateNoteById(long id,NoteDatabaseArray array){
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_GROUP, array.group);
initialValues.put(KEY_DATE, array.date);
initialValues.put(KEY_TIME, array.time);
initialValues.put(KEY_TITLE,array.Title);
initialValues.put(KEY_CONTENT, array.content);
initialValues.put(KEY_IS_ON_CLOUD, array.is_on_cloud);
initialValues.put(KEY_NOTIFY, array.notifyTime);
//add uuid to mark the note,just an timestamp
if(TextUtils.isEmpty(array.uuid)){
array.uuid = String.valueOf(System.currentTimeMillis());
}
initialValues.put(KEY_UUID, array.uuid);
return db.update(DATABASE_TABLE, initialValues, KEY_ROWID + "=?", new String[]{String.valueOf(id)});
}
public long insertTitle(NoteDatabaseArray array) {
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_GROUP, array.group);
initialValues.put(KEY_DATE, array.date);
initialValues.put(KEY_TIME, array.time);
initialValues.put(KEY_TITLE,array.Title);
initialValues.put(KEY_CONTENT, array.content);
initialValues.put(KEY_IS_ON_CLOUD, array.is_on_cloud);
initialValues.put(KEY_NOTIFY, array.notifyTime);
if(NoteDatabaseArray.MARK_FIRST_IN.equals(array.notifyTime) ||NoteDatabaseArray.MARK_FIRST_IN2.equals(array.notifyTime) ){
array.uuid = "0";
}
if(TextUtils.isEmpty(array.uuid)){
array.uuid = String.valueOf(System.currentTimeMillis());
}
initialValues.put(KEY_UUID, array.uuid);
return db.insert(DATABASE_TABLE, null, initialValues);
}
public void insertTtileHelper(NoteDatabaseArray array) {
this.open();
this.insertTitle(array);
this.close();
}
public boolean deleteTitle(long rowId) {
return db.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0;
}
public boolean deleteTitleByDate(String date) {
return db.delete(DATABASE_TABLE, KEY_DATE + "=" + "'" + date + "'", null) > 0;
}
public boolean deleteTitleByReel(String group) {
return db.delete(DATABASE_TABLE, KEY_GROUP + "=" + "'" + group + "'", null) > 0;
}
public Cursor getAllTitles() {
return db.query(DATABASE_TABLE,
new String[]{KEY_ROWID, KEY_GROUP, KEY_DATE, KEY_TIME, KEY_TITLE,KEY_CONTENT,KEY_IS_ON_CLOUD,KEY_NOTIFY,KEY_UUID},
null, null, null, null, null);
}
public Cursor getTitleById(long rowid) throws SQLException {
Cursor mCursor = db.query(DATABASE_TABLE,
new String[]{KEY_ROWID, KEY_GROUP, KEY_DATE, KEY_TIME, KEY_TITLE,KEY_CONTENT,KEY_IS_ON_CLOUD,KEY_NOTIFY,KEY_UUID},
KEY_ROWID + "=" + "'" + rowid + "'", null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToLast();
}
return mCursor;
}
public Cursor getTitleByReel(String group) throws SQLException {
Cursor mCursor = db.query(DATABASE_TABLE,
new String[]{KEY_ROWID, KEY_GROUP, KEY_DATE, KEY_TIME, KEY_TITLE,KEY_CONTENT,KEY_IS_ON_CLOUD,KEY_NOTIFY,KEY_UUID},
KEY_GROUP + "=" + "'" + group + "'", null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToLast();
}
return mCursor;
}
public Cursor getTitleByDate(String date) throws SQLException {
Cursor mCursor = db.query( DATABASE_TABLE,
new String[]{KEY_ROWID, KEY_GROUP, KEY_DATE, KEY_TIME, KEY_TITLE,KEY_CONTENT,KEY_IS_ON_CLOUD,KEY_NOTIFY,KEY_UUID},
KEY_DATE + "=" + "'" + date + "'", null, null, null, null, null);
if (mCursor != null) {
mCursor.moveToLast();
}
return mCursor;
}
public List<String> getDates(){
List<String> list=new ArrayList<>();
Cursor cursor=db.query(true,DATABASE_TABLE, new String[]{KEY_DATE}, null, null, null, null, null, null);
if (cursor!=null&&cursor.moveToLast()){
do{
list.add(cursor.getString(0));
}while (cursor.moveToPrevious());
cursor.close();
}
//db.execSQL("select count(*) from (select distinct "+KEY_GROUP+" from "+DATABASE_TABLE+" )",arg);
return list;
}
public List<String> getGroups(){
List<String> list=new ArrayList<>();
Cursor cursor=db.query(true, DATABASE_TABLE, new String[]{KEY_GROUP}, null, null, null, null, null, null);
if (cursor!=null&&cursor.moveToLast()){
do{
list.add(cursor.getString(0));
}while (cursor.moveToPrevious());
cursor.close();
}
//db.execSQL("select count(*) from (select distinct "+KEY_GROUP+" from "+DATABASE_TABLE+" )",arg);
return list;
}
public int changeGroup(long sdfId, String currentGroup) {
ContentValues contentValues = new ContentValues();
contentValues.put(KEY_GROUP,currentGroup);
return db.update(DATABASE_TABLE,contentValues,KEY_ROWID+"=?",new String[]{String.valueOf(sdfId)});
}
public Cursor getNoteById(long id) {
return db.query(DATABASE_TABLE,new String[]{KEY_ROWID, KEY_GROUP, KEY_DATE, KEY_TIME, KEY_TITLE,KEY_CONTENT,KEY_IS_ON_CLOUD,KEY_NOTIFY,KEY_UUID},
KEY_ROWID+"=?",new String[]{String.valueOf(id)},null,null,null,"1");
}
}
| 6,374
|
Java
|
.java
|
tianyuan168326/nono-android
| 90
| 17
| 1
|
2016-10-15T02:27:18Z
|
2016-12-14T05:48:28Z
|
4d356cfc75341d40afcce74bbb38d3e6df1e83fd973fc0202b5bfbc4701dc43e
|
[] |
[
1337,
785,
51,
296,
7335,
51,
5774,
933,
16427,
51,
2015,
10268,
64,
222,
222,
485,
2616,
51,
1304,
51,
1795,
3367,
64,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
4617,
51,
7424,
64,
222,
485,
2616,
51,
4617,
51,
20335,
64,
222,
485,
2616,
51,
4617,
51,
14123,
51,
25912,
3969,
64,
222,
485,
2616,
51,
897,
51,
34310,
64,
222,
222,
485,
785,
51,
296,
7335,
51,
5774,
933,
16427,
51,
768,
1747,
51,
5232,
3969,
1280,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
1350,
222,
338,
6956,
829,
244,
35359,
26618,
563,
244,
55,
53,
54,
58,
52,
62,
52,
54,
56,
51,
222,
588,
222,
942,
462,
5857,
2015,
4433,
320,
499,
221,
942,
924,
1175,
910,
5591,
100,
9330,
798,
5636,
333,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
9781,
366,
6353,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
5252,
366,
787,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
4812,
366,
1021,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
13772,
366,
1333,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
11841,
366,
1304,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
1309,
100,
586,
100,
29729,
366,
316,
100,
286,
100,
3227,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
32195,
366,
9357,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
7604,
366,
6615,
884,
499,
221,
2072,
924,
1175,
910,
26255,
100,
6950,
366,
8903,
884,
3067,
221,
2072,
1175,
7063,
1637,
64,
222,
221,
2072,
6728,
2775,
4594,
2775,
64,
222,
221,
2072,
24846,
3969,
3100,
64,
499,
221,
942,
782,
1991,
1582,
45,
671,
3627,
76,
49,
910,
556,
76,
46,
320,
376,
221,
671,
5576,
299,
332,
1896,
10178,
758,
8374,
28061,
2174,
8374,
28061,
884,
376,
221,
1219,
51,
2510,
3566,
45,
2622,
49,
909,
910,
14161,
909,
76,
49,
1477,
76,
1933,
222,
221,
130,
2855,
221,
942,
5857,
2015,
4433,
45,
1237,
3708,
46,
320,
376,
221,
597,
51,
1834,
299,
3708,
64,
376,
221,
325,
597,
51,
489,
66,
489,
64,
376,
221,
2015,
2775,
299,
556,
6728,
2775,
45,
1834,
312,
222,
221,
130,
499,
221,
942,
5857,
2015,
4433,
2177,
365,
2589,
23189,
320,
376,
221,
1219,
299,
4594,
2775,
51,
390,
21383,
3969,
492,
376,
221,
620,
477,
64,
222,
221,
130,
499,
221,
942,
782,
4248,
365,
320,
376,
221,
2015,
2775,
51,
2698,
492,
222,
221,
130,
222,
221,
942,
648,
1991,
5232,
3229,
45,
3239,
828,
49,
5232,
3969,
1280,
1437,
1528,
376,
221,
1795,
3367,
2838,
3367,
299,
556,
6261,
3367,
492,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
9781,
49,
1437,
51,
1382,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
5252,
49,
1437,
51,
787,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
4812,
49,
1437,
51,
1021,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
13772,
49,
977,
51,
3188,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
11841,
49,
1437,
51,
1304,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
1309,
100,
586,
100,
29729,
49,
1437,
51,
316,
100,
286,
100,
3227,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
32195,
49,
1437,
51,
9357,
1061,
312,
376,
221,
325,
688,
11168,
391,
3658,
341,
6013,
49,
4524,
619,
6356,
376,
221,
344,
45,
34310,
51,
6401,
45,
977,
51,
6615,
7717,
374,
221,
977,
51,
6615,
244,
299,
910,
51,
9169,
45,
1615,
51,
17217,
1052,
376,
221,
130,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
7604,
49,
1437,
51,
6615,
312,
376,
221,
620,
3100,
51,
1896,
45,
20536,
100,
6950,
49,
2838,
3367,
49,
5591,
100,
9330,
798,
494,
30573,
14199,
556,
910,
14161,
671,
51,
9169,
45,
333,
45494,
222,
221,
130,
222,
221,
942,
1964,
5567,
3188,
45,
5232,
3969,
1280,
1437,
46,
320,
376,
221,
1795,
3367,
2838,
3367,
299,
556,
6261,
3367,
492,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
9781,
49,
1437,
51,
1382,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
5252,
49,
1437,
51,
787,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
4812,
49,
1437,
51,
1021,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
13772,
49,
977,
51,
3188,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
11841,
49,
1437,
51,
1304,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
1309,
100,
586,
100,
29729,
49,
1437,
51,
316,
100,
286,
100,
3227,
312,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
32195,
49,
1437,
51,
9357,
1061,
312,
376,
221,
344,
45,
5232,
3969,
1280,
51,
12214,
100,
16825,
100,
540,
51,
3591,
45,
977,
51,
9357,
1061,
46,
244,
1293,
5232,
3969,
1280,
51,
12214,
100,
16825,
100,
540,
55,
51,
3591,
45,
977,
51,
9357,
1061,
46,
10555,
374,
221,
977,
51,
6615,
299,
332,
53,
884,
376,
221,
130,
310,
434,
45,
34310,
51,
6401,
45,
977,
51,
6615,
7717,
343,
1437,
51,
6615,
299,
910,
51,
9169,
45,
1615,
51,
17217,
1052,
310,
339,
376,
221,
4353,
3367,
51,
543,
45,
3319,
100,
7604,
49,
1437,
51,
6615,
312,
376,
221,
620,
3100,
51,
3233,
45,
20536,
100,
6950,
49,
762,
49,
2838,
3367,
312,
222,
221,
130,
222,
221,
942,
782,
5567,
89,
8344,
2775,
45,
5232,
3969,
1280,
1437,
46,
320,
376,
221,
597,
51,
1693,
492,
376,
221,
597,
51,
3233,
3188,
45,
977,
312,
376,
221,
597,
51,
2698,
492,
222,
221,
130,
222,
221,
942,
1922,
3081,
3188,
45,
3239,
2720,
625,
46,
320,
376,
221,
620,
3100,
51,
2577,
45,
20536,
100,
6950,
49,
5591,
100,
9330,
798,
494,
29667,
494,
2720,
625,
49,
762,
46,
868,
244,
53,
64,
222,
221,
130,
499,
221,
942,
1922,
3081,
3188,
1103,
1563,
45,
671,
2361,
46,
320,
376,
221,
620,
3100,
51,
2577,
45,
20536,
100,
6950,
49,
5591,
100,
5252,
494,
29667,
494,
37600,
494,
2361,
494
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
1795,
3367,
64,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
4617,
51,
7424,
64,
222,
485,
2616,
51,
4617,
51,
20335,
64,
222,
485,
2616,
51,
4617,
51,
14123,
51,
25912,
3969,
64,
222,
485,
2616,
51,
897,
51,
34310,
64,
222,
222,
485,
785,
51,
296,
7335,
51,
5774,
933,
16427,
51,
768,
1747,
51,
5232,
3969,
1280,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
1350,
222,
338,
6956,
829,
244,
35359,
26618,
563,
244,
55,
53,
54,
58,
52,
62,
52,
54,
56,
51,
222,
588,
222,
942,
462,
5857,
2015,
4433,
320,
499,
221,
942,
924,
1175,
910,
5591,
100,
9330,
798,
5636,
333,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
9781,
366,
6353,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
5252,
366,
787,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
4812,
366,
1021,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
13772,
366,
1333,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
11841,
366,
1304,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
1309,
100,
586,
100,
29729,
366,
316,
100,
286,
100,
3227,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
32195,
366,
9357,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
7604,
366,
6615,
884,
499,
221,
2072,
924,
1175,
910,
26255,
100,
6950,
366,
8903,
884,
3067,
221,
2072,
1175,
7063,
1637,
64,
222,
221,
2072,
6728,
2775,
4594,
2775,
64,
222,
221,
2072,
24846,
3969,
3100,
64,
499,
221,
942,
782,
1991,
1582,
45,
671,
3627,
76,
49,
910,
556,
76,
46,
320,
376,
221,
671,
5576,
299,
332,
1896,
10178,
758,
8374,
28061,
2174,
8374,
28061,
884,
376,
221,
1219,
51
] | 1,874,708,035,497,078,800
| true
| false
| false
| false
|
[
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
4812,
366,
1021,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
13772,
366,
1333,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
11841,
366,
1304,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
1309,
100,
586,
100,
29729,
366,
316,
100,
286,
100,
3227,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
32195,
366,
9357,
884,
222,
221,
942,
924,
1175,
910,
5591,
100,
7604,
366,
6615,
884,
499,
221,
2072,
924,
1175,
910,
26255,
100,
6950,
366,
8903,
884,
3067,
221,
2072,
1175,
7063,
1637,
64
] | 1,937,869,893,511,447,800
| true
|
.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import com.seki.noteasklite.DataUtil.NoteDatabaseArray;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 七升 on 2015/9/13.
*/
public class NoteDBAdapter {
public static final String KEY_ROWID="_id";
public static final String KEY_GROUP="groups";
public static final String KEY_DATE="date";
public static final String KEY_TIME="time";
public static final String KEY_TITLE="title";
public static final String KEY_CONTENT="content";
public static final String KEY_IS_ON_CLOUD="is_on_cloud";
public static final String KEY_NOTIFY="notify";
public static final String KEY_UUID="uuid";
private static final String DATABASE_TABLE="notes";
private final Context context;
|
com.seki.noteasklite.DataUtil.NoteDatabaseArray;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 七升 on 2015/9/13.
*/
public class NoteDBAdapter {
public static final String KEY_ROWID="_id";
public static final String KEY_GROUP="groups";
public static final String KEY_DATE="date";
public static final String KEY_TIME="time";
public static final String KEY_TITLE="title";
public static final String KEY_CONTENT="content";
public static final String KEY_IS_ON_CLOUD="is_on_cloud";
public static final String KEY_NOTIFY="notify";
public static final String KEY_UUID="uuid";
private static final String DATABASE_TABLE="notes";
private final Context context;
|
9/13.
*/
public class NoteDBAdapter {
public static final String KEY_ROWID="_id";
public static final String KEY_GROUP="groups";
public static final String KEY_DATE="date";
public static final String KEY_TIME="time";
public static final String KEY_TITLE="title";
public static final String KEY_CONTENT="content";
public static final String KEY_IS_ON_CLOUD="is_on_cloud";
public static final String KEY_NOTIFY="notify";
public static final String KEY_UUID="uuid";
private static final String DATABASE_TABLE="notes";
private final Context context;
|
";
public static final String KEY_TIME="time";
public static final String KEY_TITLE="title";
public static final String KEY_CONTENT="content";
public static final String KEY_IS_ON_CLOUD="is_on_cloud";
public static final String KEY_NOTIFY="notify";
public static final String KEY_UUID="uuid";
private static final String DATABASE_TABLE="notes";
private final Context context;
|
private DatabaseHelper DBHelper;
private SQLiteDatabase db;
public void updateGroup(String oldG, String newG) {
String sql = "update notes set groups=? where groups=?";
db.
|
BulkServiceInterceptorSKOSToLocal.java
|
/FileExtraction/Java_unseen/edu-sharing_edu-sharing-community-repository/Backend/services/core/src/main/java/org/edu_sharing/service/bulk/BulkServiceInterceptorSKOSToLocal.java
|
package org.edu_sharing.service.bulk;
import org.apache.log4j.Logger;
import org.edu_sharing.metadataset.v2.MetadataKey;
import org.edu_sharing.metadataset.v2.MetadataSet;
import org.edu_sharing.metadataset.v2.MetadataWidget;
import org.edu_sharing.metadataset.v2.tools.MetadataHelper;
import org.edu_sharing.repository.client.tools.CCConstants;
import org.edu_sharing.repository.server.tools.ApplicationInfoList;
import java.util.*;
import java.util.stream.Collectors;
/**
* convert incoming skos values into local valuespaces (if available)
* automatically filters unsupported entries/keys in valuespaces
* repository.bulk.interceptors += "org.edu_sharing.server.bulk.BulkServiceInterceptorSKOSToLocal"
* */
public class BulkServiceInterceptorSKOSToLocal implements BulkServiceInterceptorInterface{
static Logger logger = Logger.getLogger(BulkServiceInterceptorSKOSToLocal.class);
/**
* Preprocess properties before they get stored and post-processed by the bulk service
*/
public Map<String, Object> preprocessProperties(Map<String, Object> properties) {
String mdsId = (String) properties.getOrDefault(CCConstants.CM_PROP_METADATASET_EDU_METADATASET, CCConstants.metadatasetdefault_id);
try {
MetadataSet mds = MetadataHelper.getMetadataset(ApplicationInfoList.getHomeRepository(), mdsId);
mds.getWidgets().stream().filter(
w -> w.getTemplate() == null && w.getCondition() == null && w.getValues() != null && !w.getValues().isEmpty()
).forEach(w -> {
List<?> valuesList = getPropertyValue(properties, CCConstants.getValidGlobalName(w.getId()));
if(valuesList != null) {
if(valuesList.stream().allMatch(v -> v.toString().toLowerCase().startsWith("http"))) {
List<String> result = mapValues(w, valuesList);
logger.info("transformed SKOS properties of " + w.getId() + "(" + result.size() +" mapped from total of " + valuesList.size() + ")");
if(result.isEmpty()) {
properties.remove(CCConstants.getValidGlobalName(w.getId()));
} else {
properties.put(CCConstants.getValidGlobalName(w.getId()), result);
}
}
}
});
} catch (Exception e) {
logger.warn("Could not transform SKOS properties: " + e.getMessage(), e);
}
return properties;
}
protected List<?> getPropertyValue(Map<String, Object> properties, String key){
Object values = properties.get(key);
if(values != null) {
if (values instanceof String) {
values = Collections.singletonList(values);
}
return ((List<?>) values);
}
return null;
}
protected List<String> mapValues(MetadataWidget widget, List<?> valuesList) {
Map<String, MetadataKey> map = widget.getValuesAsMap();
return valuesList.stream().map(v -> (String) v).map(v -> {
if(map.containsKey(v)) {
return v;
}
String[] splitted = v.split("/");
return splitted[splitted.length - 1];
}).filter(map::containsKey)
.map(map::get)
.map(MetadataKey::getKey)
.collect(Collectors.toList());
}
}
| 3,505
|
Java
|
.java
|
edu-sharing/edu-sharing-community-repository
| 25
| 16
| 14
|
2017-06-29T11:31:42Z
|
2024-05-08T13:38:59Z
|
5bba2c532cdef29f3dab830a89f4d10d1eb7ff4b300e2edd3f36d7fe8f4f67f4
|
[] |
[
1337,
1105,
51,
7619,
100,
24756,
51,
2140,
51,
17228,
64,
222,
222,
485,
1105,
51,
2121,
51,
769,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
4541,
489,
51,
123,
55,
51,
4108,
971,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
4541,
489,
51,
123,
55,
51,
4108,
903,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
4541,
489,
51,
123,
55,
51,
4108,
3778,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
4541,
489,
51,
123,
55,
51,
4303,
51,
4108,
2775,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
6335,
51,
1598,
51,
4303,
51,
2218,
5238,
64,
222,
485,
1105,
51,
7619,
100,
24756,
51,
6335,
51,
1805,
51,
4303,
51,
2743,
25846,
64,
222,
222,
485,
1401,
51,
1058,
7737,
222,
485,
1401,
51,
1058,
51,
2255,
51,
16862,
64,
222,
222,
1350,
222,
338,
4511,
14959,
3057,
519,
2102,
2012,
2212,
2102,
117,
2576,
327,
344,
3322,
46,
222,
338,
6936,
10637,
26848,
8072,
52,
3519,
347,
2102,
117,
2576,
222,
338,
5347,
51,
17228,
51,
26083,
1758,
1475,
332,
1107,
51,
7619,
100,
24756,
51,
1805,
51,
17228,
51,
16723,
1201,
13843,
9727,
84,
654,
116,
3340,
39,
222,
338,
588,
222,
942,
462,
36250,
1201,
13843,
9727,
84,
654,
116,
3340,
4584,
36250,
1201,
13843,
3058,
128,
303,
924,
7145,
4101,
299,
7145,
51,
10588,
45,
16723,
1201,
13843,
9727,
84,
654,
116,
3340,
51,
842,
312,
303,
1041,
294,
338,
7497,
2441,
4324,
2688,
2974,
640,
7129,
480,
2381,
50,
15299,
829,
341,
21575,
2733,
294,
588,
303,
581,
3531,
65,
671,
49,
2210,
67,
29162,
3303,
45,
1225,
65,
671,
49,
2210,
67,
4324,
46,
320,
310,
910,
364,
3246,
625,
299,
327,
671,
46,
4324,
51,
390,
13637,
45,
2218,
5238,
51,
3123,
100,
15247,
100,
26550,
2710,
100,
1363,
90,
100,
26550,
2710,
49,
14242,
5238,
51,
4541,
37367,
100,
333,
312,
310,
1614,
320,
343,
13525,
903,
364,
3246,
299,
13525,
2775,
51,
40808,
489,
45,
2743,
25846,
51,
390,
4637,
3231,
1046,
364,
3246,
625,
312,
343,
364,
3246,
51,
390,
13380,
941,
2255,
941,
2049,
45,
547,
360,
984,
360,
51,
390,
3455,
365,
630,
762,
979,
360,
51,
390,
5371,
365,
630,
762,
979,
360,
51,
45713,
365,
882,
762,
979,
673,
124,
51,
45713,
941,
6401,
365,
343,
6824,
5388,
45,
124,
984,
320,
419,
1701,
11667,
2102,
739,
299,
640,
26084,
45,
4659,
49,
14242,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
5086,
419,
434,
45,
2857,
739,
882,
762,
46,
320,
547,
434,
45,
2857,
739,
51,
2255,
941,
483,
3683,
45,
123,
984,
373,
51,
3127,
941,
10498,
941,
13907,
459,
544,
14040,
320,
733,
1701,
65,
671,
67,
1074,
299,
2010,
3367,
45,
124,
49,
2102,
739,
312,
733,
4101,
51,
1357,
459,
32722,
17220,
2653,
4324,
451,
332,
494,
360,
51,
7068,
365,
494,
31019,
244,
494,
1074,
51,
911,
365,
34552,
14742,
664,
3410,
451,
332,
494,
2102,
739,
51,
911,
365,
494,
32658,
733,
434,
45,
1285,
51,
6401,
1177,
320,
1031,
4324,
51,
2564,
45,
2218,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
5086,
733,
339,
832,
320,
1031,
4324,
51,
543,
45,
2218,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
6198,
1074,
312,
733,
339,
547,
339,
419,
339,
1083,
1141,
310,
339,
2385,
327,
1002,
503,
46,
320,
343,
4101,
51,
8453,
459,
9752,
666,
4549,
17220,
2653,
4324,
63,
332,
494,
503,
51,
7724,
1046,
503,
312,
310,
339,
310,
461,
4324,
64,
303,
339,
465,
2532,
1701,
11667,
640,
26084,
45,
1225,
65,
671,
49,
2210,
67,
4324,
49,
910,
1221,
1528,
310,
2210,
2102,
299,
4324,
51,
390,
45,
697,
312,
310,
434,
45,
2857,
882,
762,
46,
320,
343,
434,
327,
2857,
5118,
910,
46,
320,
419,
2102,
299,
15490,
51,
36511,
45,
2857,
312,
343,
339,
343,
461,
1849,
739,
1907,
5111,
2102,
312,
310,
339,
310,
461,
762,
64,
303,
339,
303,
2532,
1701,
65,
671,
67,
2010,
3367,
45,
4108,
3778,
6866,
49,
1701,
11667,
2102,
739,
46,
320,
310,
3531,
65,
671,
49,
13525,
971,
67,
2010,
299,
6866,
51,
45713,
1482,
1225,
492,
310,
461,
2102,
739,
51,
2255,
941,
1130,
45,
123,
984,
327,
671,
46,
373,
566,
1130,
45,
123,
984,
320,
547,
434,
45,
1130,
51,
15927,
45,
123,
509,
320,
733,
461,
373,
64,
547,
339,
547,
910,
1197,
6168,
3270,
299,
373,
51,
3045,
47241,
547,
461,
6168,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 806
|
[
21575,
2733,
294,
588,
303,
581,
3531,
65,
671,
49,
2210,
67,
29162,
3303,
45,
1225,
65,
671,
49,
2210,
67,
4324,
46,
320,
310,
910,
364,
3246,
625,
299,
327,
671,
46,
4324,
51,
390,
13637,
45,
2218,
5238,
51,
3123,
100,
15247,
100,
26550,
2710,
100,
1363,
90,
100,
26550,
2710,
49,
14242,
5238,
51,
4541,
37367,
100,
333,
312,
310,
1614,
320,
343,
13525,
903,
364,
3246,
299,
13525,
2775,
51,
40808,
489,
45,
2743,
25846,
51,
390,
4637,
3231,
1046,
364,
3246,
625,
312,
343,
364,
3246,
51,
390,
13380,
941,
2255,
941,
2049,
45,
547,
360,
984,
360,
51,
390,
3455,
365,
630,
762,
979,
360,
51,
390,
5371,
365,
630,
762,
979,
360,
51,
45713,
365,
882,
762,
979,
673,
124,
51,
45713,
941,
6401,
365,
343,
6824,
5388,
45,
124,
984,
320,
419,
1701,
11667,
2102,
739,
299,
640,
26084,
45,
4659,
49,
14242,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
5086,
419,
434,
45,
2857,
739,
882,
762,
46,
320,
547,
434,
45,
2857,
739,
51,
2255,
941,
483,
3683,
45,
123,
984,
373,
51,
3127,
941,
10498,
941,
13907,
459,
544,
14040,
320,
733,
1701,
65,
671,
67,
1074,
299,
2010,
3367,
45,
124,
49,
2102,
739,
312,
733,
4101,
51,
1357,
459,
32722,
17220,
2653,
4324,
451,
332,
494,
360,
51,
7068,
365,
494,
31019,
244,
494,
1074,
51,
911,
365,
34552,
14742,
664,
3410,
451,
332,
494,
2102,
739,
51,
911,
365,
494,
32658,
733,
434,
45,
1285,
51,
6401,
1177,
320,
1031,
4324,
51,
2564,
45,
2218,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
5086,
733,
339,
832,
320,
1031,
4324,
51,
543,
45,
2218,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
6198,
1074,
312,
733,
339,
547,
339
] | 2,273,928,642,281,009,200
| true
| false
| false
| false
|
[
14242,
5238,
51,
390,
2320,
4470,
577,
45,
124,
51,
7068,
5086,
419,
434,
45,
2857,
739,
882,
762,
46,
320,
547,
434,
45,
2857,
739,
51,
2255,
941,
483,
3683,
45,
123,
984,
373,
51,
3127,
941,
10498,
941,
13907,
459,
544,
14040,
320,
733,
1701,
65,
671,
67,
1074,
299,
2010,
3367,
45,
124,
49,
2102,
739,
312,
733,
4101,
51,
1357,
459,
32722,
17220,
2653,
4324,
451,
332,
494,
360,
51,
7068,
365,
494,
31019,
244,
494,
1074,
51,
911,
365,
34552,
14742,
664,
3410,
451,
332,
494,
2102,
739,
51,
911,
365,
494,
32658,
733,
434
] | 8,842,926,670,033,695,000
| true
|
bulk service
*/
public Map<String, Object> preprocessProperties(Map<String, Object> properties) {
String mdsId = (String) properties.getOrDefault(CCConstants.CM_PROP_METADATASET_EDU_METADATASET, CCConstants.metadatasetdefault_id);
try {
MetadataSet mds = MetadataHelper.getMetadataset(ApplicationInfoList.getHomeRepository(), mdsId);
mds.getWidgets().stream().filter(
w -> w.getTemplate() == null && w.getCondition() == null && w.getValues()!= null &&!w.getValues().isEmpty()
).forEach(w -> {
List<?> valuesList = getPropertyValue(properties, CCConstants.getValidGlobalName(w.getId()));
if(valuesList!= null) {
if(valuesList.stream().allMatch(v -> v.toString().toLowerCase().startsWith("http"))) {
List<String> result = mapValues(w, valuesList);
logger.info("transformed SKOS properties of " + w.getId() + "(" + result.size() +" mapped from total of " + valuesList.size() + ")");
if
|
_METADATASET, CCConstants.metadatasetdefault_id);
try {
MetadataSet mds = MetadataHelper.getMetadataset(ApplicationInfoList.getHomeRepository(), mdsId);
mds.getWidgets().stream().filter(
w -> w.getTemplate() == null && w.getCondition() == null && w.getValues()!= null &&!w.getValues().isEmpty()
).forEach(w -> {
List<?> valuesList = getPropertyValue(properties, CCConstants.getValidGlobalName(w.getId()));
if(valuesList!= null) {
if(valuesList.stream().allMatch(v -> v.toString().toLowerCase().startsWith("http"))) {
List<String> result = mapValues(w, valuesList);
logger.info("transformed SKOS properties of " + w.getId() + "(" + result.size() +" mapped from total of " + valuesList.size() + ")");
if
|
w -> w.getTemplate() == null && w.getCondition() == null && w.getValues()!= null &&!w.getValues().isEmpty()
).forEach(w -> {
List<?> valuesList = getPropertyValue(properties, CCConstants.getValidGlobalName(w.getId()));
if(valuesList!= null) {
if(valuesList.stream().allMatch(v -> v.toString().toLowerCase().startsWith("http"))) {
List<String> result = mapValues(w, valuesList);
logger.info("transformed SKOS properties of " + w.getId() + "(" + result.size() +" mapped from total of " + valuesList.size() + ")");
if
|
CCConstants.getValidGlobalName(w.getId()));
if(valuesList!= null) {
if(valuesList.stream().allMatch(v -> v.toString().toLowerCase().startsWith("http"))) {
List<String> result = mapValues(w, valuesList);
logger.info("transformed SKOS properties of " + w.getId() + "(" + result.size() +" mapped from total of " + valuesList.size() + ")");
if
|
(result.isEmpty()) {
properties.remove(CCConstants.getValidGlobalName(w.getId()));
} else {
properties.put(CCConstants.getValidGlobalName(w.getId()), result);
}
}
|
HeroSelectScene.java
|
/FileExtraction/Java_unseen/QuasiStellar_custom-pixel-dungeon/core/src/main/java/com/qsr/customspd/scenes/HeroSelectScene.java
|
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2023 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.qsr.customspd.scenes;
import com.qsr.customspd.Badges;
import com.qsr.customspd.Chrome;
import com.qsr.customspd.Dungeon;
import com.qsr.customspd.GamesInProgress;
import com.qsr.customspd.SPDSettings;
import com.qsr.customspd.ShatteredPixelDungeon;
import com.qsr.customspd.actors.hero.HeroClass;
import com.qsr.customspd.assets.Asset;
import com.qsr.customspd.assets.GeneralAsset;
import com.qsr.customspd.journal.Journal;
import com.qsr.customspd.messages.Messages;
import com.qsr.customspd.modding.TileMapCompilationManager;
import com.qsr.customspd.ui.ActionIndicator;
import com.qsr.customspd.ui.ExitButton;
import com.qsr.customspd.ui.IconButton;
import com.qsr.customspd.ui.RenderedTextBlock;
import com.qsr.customspd.ui.StyledButton;
import com.qsr.customspd.ui.Window;
import com.qsr.customspd.windows.WndMods;
import com.qsr.customspd.windows.WndOptions;
import com.qsr.customspd.windows.WndTextInput;
import com.qsr.customspd.utils.DungeonSeed;
import com.qsr.customspd.windows.WndChallenges;
import com.qsr.customspd.windows.WndHeroInfo;
import com.qsr.customspd.windows.WndKeyBindings;
import com.qsr.customspd.windows.WndMessage;
import com.watabou.gltextures.TextureCache;
import com.watabou.input.PointerEvent;
import com.watabou.noosa.Camera;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PointF;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class HeroSelectScene extends PixelScene {
private Image background;
private Image fadeLeft, fadeRight;
private IconButton btnFade; //only on landscape
//fading UI elements
private RenderedTextBlock title;
private ArrayList<StyledButton> heroBtns = new ArrayList<>();
private RenderedTextBlock heroName; //only on landscape
private RenderedTextBlock heroDesc; //only on landscape
private StyledButton startBtn;
private IconButton infoButton;
private IconButton btnOptions;
private GameOptions optionsPane;
private IconButton btnExit;
@Override
public void create() {
super.create();
Dungeon.hero = null;
Badges.loadGlobal();
Journal.loadGlobal();
background = new Image(HeroClass.WARRIOR.splashArt()){
@Override
public void update() {
if (GamesInProgress.selectedClass != null) {
if (rm > 1f) {
rm -= Game.elapsed;
gm = bm = rm;
} else {
rm = gm = bm = 1;
}
}
}
};
background.scale.set(Camera.main.height/background.height);
background.tint(0x2d2f31, 1f);
background.x = (Camera.main.width - background.width())/2f;
background.y = (Camera.main.height - background.height())/2f;
PixelScene.align(background);
add(background);
fadeLeft = new Image(TextureCache.createGradient(0xFF000000, 0xFF000000, 0x00000000));
fadeLeft.x = background.x-2;
fadeLeft.scale.set(3, background.height());
add(fadeLeft);
fadeRight = new Image(fadeLeft);
fadeRight.x = background.x + background.width() + 2;
fadeRight.y = background.y + background.height();
fadeRight.angle = 180;
add(fadeRight);
title = PixelScene.renderTextBlock(Messages.get(this, "title"), 12);
title.hardlight(Window.TITLE_COLOR);
PixelScene.align(title);
add(title);
startBtn = new StyledButton(Chrome.Type.GREY_BUTTON_TR, ""){
@Override
protected void onClick() {
super.onClick();
if (TileMapCompilationManager.INSTANCE.isBusy()) {
ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(WndMods.class, "wait")));
return;
}
if (GamesInProgress.selectedClass == null) return;
Dungeon.hero = null;
Dungeon.daily = Dungeon.dailyReplay = false;
ActionIndicator.action = null;
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
Game.switchScene( InterlevelScene.class );
}
};
startBtn.icon(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_ENTER)));
startBtn.setSize(80, 21);
startBtn.textColor(Window.TITLE_COLOR);
add(startBtn);
startBtn.visible = startBtn.active = false;
infoButton = new IconButton(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_INFO))){
@Override
protected void onClick() {
super.onClick();
Window w = new WndHeroInfo(GamesInProgress.selectedClass);
if (landscape()){
w.offset(Camera.main.width/6, 0);
}
ShatteredPixelDungeon.scene().addToFront(w);
}
@Override
protected String hoverText() {
return Messages.titleCase(Messages.get(WndKeyBindings.class, "hero_info"));
}
};
infoButton.visible = infoButton.active = false;
infoButton.setSize(20, 21);
add(infoButton);
for (HeroClass cl : HeroClass.values()){
HeroBtn button = new HeroBtn(cl);
add(button);
heroBtns.add(button);
}
optionsPane = new GameOptions();
optionsPane.visible = optionsPane.active = false;
optionsPane.layout();
add(optionsPane);
btnOptions = new IconButton(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_PREFS))){
@Override
protected void onClick() {
super.onClick();
optionsPane.visible = !optionsPane.visible;
optionsPane.active = !optionsPane.active;
}
@Override
protected void onPointerDown() {
super.onPointerDown();
}
@Override
protected void onPointerUp() {
updateOptionsColor();
}
@Override
protected String hoverText() {
return Messages.get(HeroSelectScene.class, "options");
}
};
updateOptionsColor();
btnOptions.visible = false;
add(btnOptions);
if (landscape()){
float leftArea = Math.max(100, Camera.main.width/3f);
float uiHeight = Math.min(Camera.main.height-20, 300);
float uiSpacing = (uiHeight-120)/2f;
if (uiHeight >= 160) uiSpacing -= 5;
if (uiHeight >= 180) uiSpacing -= 6;
background.x += leftArea/6f;
float fadeLeftScale = 47 * (leftArea - background.x)/leftArea;
fadeLeft.scale = new PointF(3 + Math.max(0, fadeLeftScale), background.height());
title.setPos( (leftArea - title.width())/2f, (Camera.main.height-uiHeight)/2f);
align(title);
int btnWidth = HeroBtn.MIN_WIDTH + 15;
int btnHeight = HeroBtn.HEIGHT;
if (uiHeight >= 180){
btnHeight += 6;
}
int cols = (int)Math.ceil(heroBtns.size()/2f);
float curX = (leftArea - btnWidth * cols + (cols-1))/2f;
float curY = title.bottom() + uiSpacing;
int count = 0;
for (StyledButton button : heroBtns){
button.setRect(curX, curY, btnWidth, btnHeight);
align(button);
curX += btnWidth+1;
count++;
if (count >= (1+heroBtns.size())/2){
curX -= btnWidth*count + count;
curY += btnHeight+1;
if (heroBtns.size()%2 != 0){
curX += btnWidth/2f;
}
count = 0;
}
}
heroName = renderTextBlock(9);
heroName.setPos(0, heroBtns.get(heroBtns.size()-1).bottom()+5);
add(heroName);
if (uiHeight >= 160){
heroDesc = renderTextBlock(6);
} else {
heroDesc = renderTextBlock(5);
}
heroDesc.align(RenderedTextBlock.CENTER_ALIGN);
heroDesc.setPos(0, heroName.bottom()+5);
add(heroDesc);
startBtn.text(Messages.titleCase(Messages.get(this, "start")));
startBtn.setSize(startBtn.reqWidth()+8, 21);
startBtn.setPos((leftArea - startBtn.width())/2f, title.top() + uiHeight - startBtn.height());
align(startBtn);
btnFade = new IconButton(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_COMPASS))){
@Override
protected void onClick() {
enable(false);
parent.add(new Tweener(parent, 0.5f) {
@Override
protected void updateValues(float progress) {
uiAlpha = 1 - progress;
updateFade();
}
});
}
};
btnFade.icon().originToCenter();
btnFade.icon().angle = 270f;
btnFade.visible = btnFade.active = false;
btnFade.setRect(startBtn.left()-20, startBtn.top(), 20, 21);
align(btnFade);
add(btnFade);
btnOptions.setRect(startBtn.right(), startBtn.top(), 20, 21);
optionsPane.setPos(btnOptions.right(), btnOptions.top() - optionsPane.height() - 2);
align(optionsPane);
} else {
background.visible = false;
int btnWidth = HeroBtn.MIN_WIDTH;
float curX = (Camera.main.width - btnWidth * heroBtns.size()) / 2f;
if (curX > 0) {
btnWidth += Math.min(curX / (heroBtns.size() / 2f), 15);
curX = (Camera.main.width - btnWidth * heroBtns.size()) / 2f;
}
float curY = Camera.main.height - HeroBtn.HEIGHT + 3;
for (StyledButton button : heroBtns) {
button.setRect(curX, curY, btnWidth, HeroBtn.HEIGHT);
curX += btnWidth;
}
title.setPos((Camera.main.width - title.width()) / 2f, (Camera.main.height - HeroBtn.HEIGHT - title.height() - 4));
btnOptions.setRect(heroBtns.get(0).left() + 16, Camera.main.height-HeroBtn.HEIGHT-16, 20, 21);
optionsPane.setPos(heroBtns.get(0).left(), 0);
}
btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
btnExit.visible = btnExit.active = !SPDSettings.intro();
PointerArea fadeResetter = new PointerArea(0, 0, Camera.main.width, Camera.main.height){
@Override
public boolean onSignal(PointerEvent event) {
if (event != null && event.type == PointerEvent.Type.UP){
if (uiAlpha == 0 && landscape()){
parent.add(new Tweener(parent, 0.5f) {
@Override
protected void updateValues(float progress) {
uiAlpha = progress;
updateFade();
}
@Override
protected void onComplete() {
resetFade();
}
});
} else {
resetFade();
}
}
return false;
}
};
add(fadeResetter);
resetFade();
if (GamesInProgress.selectedClass != null){
setSelectedHero(GamesInProgress.selectedClass);
}
fadeIn();
}
private void updateOptionsColor(){
if (!SPDSettings.customSeed().isEmpty()){
btnOptions.icon().hardlight(1f, 1.5f, 0.67f);
} else if (SPDSettings.challenges() != 0){
btnOptions.icon().hardlight(2f, 1.33f, 0.5f);
} else {
btnOptions.icon().resetColor();
}
}
private void setSelectedHero(HeroClass cl){
GamesInProgress.selectedClass = cl;
background.texture( cl.splashArt() );
background.visible = true;
background.hardlight(1.5f,1.5f,1.5f);
float leftPortion = Math.max(100, Camera.main.width/3f);
if (landscape()) {
heroName.text(Messages.titleCase(cl.title()));
heroName.hardlight(Window.TITLE_COLOR);
heroName.setPos((leftPortion - heroName.width() - 20)/2f, heroName.top());
align(heroName);
heroDesc.text(cl.shortDesc());
heroDesc.maxWidth(80);
heroDesc.setPos((leftPortion - heroDesc.width())/2f, heroName.bottom() + 5);
align(heroDesc);
btnFade.visible = btnFade.active = true;
startBtn.visible = startBtn.active = true;
infoButton.visible = infoButton.active = true;
infoButton.setPos(heroName.right(), heroName.top() + (heroName.height() - infoButton.height())/2f);
align(infoButton);
btnOptions.visible = btnOptions.active = !SPDSettings.intro();
} else {
title.visible = false;
startBtn.visible = startBtn.active = true;
startBtn.text(Messages.titleCase(cl.title()));
startBtn.setSize(startBtn.reqWidth() + 8, 21);
startBtn.setPos((Camera.main.width - startBtn.width())/2f, (Camera.main.height - HeroBtn.HEIGHT + 2 - startBtn.height()));
PixelScene.align(startBtn);
infoButton.visible = infoButton.active = true;
infoButton.setPos(startBtn.right(), startBtn.top());
btnOptions.visible = btnOptions.active = !SPDSettings.intro();
btnOptions.setPos(startBtn.left()-btnOptions.width(), startBtn.top());
optionsPane.setPos(heroBtns.get(0).left(), startBtn.top() - optionsPane.height() - 2);
align(optionsPane);
}
updateOptionsColor();
}
private float uiAlpha;
@Override
public void update() {
super.update();
btnExit.visible = btnExit.active = !SPDSettings.intro();
//do not fade when a window is open
for (Object v : members){
if (v instanceof Window) resetFade();
}
if (!PixelScene.landscape() && GamesInProgress.selectedClass != null) {
if (uiAlpha > 0f){
uiAlpha -= Game.elapsed/4f;
}
updateFade();
}
}
private void updateFade(){
float alpha = GameMath.gate(0f, uiAlpha, 1f);
title.alpha(alpha);
for (StyledButton b : heroBtns){
b.enable(alpha != 0);
b.alpha(alpha);
}
if (heroName != null){
heroName.alpha(alpha);
heroDesc.alpha(alpha);
btnFade.enable(alpha != 0);
btnFade.icon().alpha(alpha);
}
startBtn.enable(alpha != 0);
startBtn.alpha(alpha);
btnExit.enable(alpha != 0);
btnExit.icon().alpha(alpha);
optionsPane.active = optionsPane.visible && alpha != 0;
optionsPane.alpha(alpha);
btnOptions.enable(alpha != 0);
btnOptions.icon().alpha(alpha);
infoButton.enable(alpha != 0);
infoButton.icon().alpha(alpha);
if (landscape()){
background.x = (Camera.main.width - background.width())/2f;
float leftPortion = Math.max(100, Camera.main.width/3f);
background.x += (leftPortion/2f)*alpha;
float fadeLeftScale = 47 * (leftPortion - background.x)/leftPortion;
fadeLeft.scale.x = 3 + Math.max(fadeLeftScale, 0)*alpha;
fadeLeft.x = background.x-4;
fadeRight.x = background.x + background.width() + 4;
}
fadeLeft.x = background.x-5;
fadeRight.x = background.x + background.width() + 5;
fadeLeft.visible = background.x > 0 || (alpha > 0 && landscape());
fadeRight.visible = background.x + background.width() < Camera.main.width;
}
private void resetFade(){
//starts fading after 4 seconds, fades over 4 seconds.
uiAlpha = 2f;
updateFade();
}
@Override
protected void onBackPressed() {
if (btnExit.active){
ShatteredPixelDungeon.switchScene(TitleScene.class);
} else {
super.onBackPressed();
}
}
private class HeroBtn extends StyledButton {
private HeroClass cl;
private static final int MIN_WIDTH = 20;
private static final int HEIGHT = 24;
HeroBtn ( HeroClass cl ){
super(Chrome.Type.GREY_BUTTON_TR, "");
this.cl = cl;
icon(new Image(cl.spritesheet(), 0, 90, 12, 15));
}
@Override
public void update() {
super.update();
if (cl != GamesInProgress.selectedClass){
if (!cl.isUnlocked()){
icon.brightness(0.1f);
} else {
icon.brightness(0.6f);
}
} else {
icon.brightness(1f);
}
}
@Override
protected void onClick() {
super.onClick();
if( !cl.isUnlocked() ){
ShatteredPixelDungeon.scene().addToFront( new WndMessage(cl.unlockMsg()));
} else if (GamesInProgress.selectedClass == cl) {
Window w = new WndHeroInfo(cl);
if (landscape()){
w.offset(Camera.main.width/6, 0);
}
ShatteredPixelDungeon.scene().addToFront(w);
} else {
setSelectedHero(cl);
}
}
}
private class GameOptions extends Component {
private NinePatch bg;
private ArrayList<StyledButton> buttons;
private ArrayList<ColorBlock> spacers;
@Override
protected void createChildren() {
bg = Chrome.get(Chrome.Type.GREY_BUTTON_TR);
add(bg);
buttons = new ArrayList<>();
spacers = new ArrayList<>();
if (DeviceCompat.isDebug() || Badges.isUnlocked(Badges.Badge.VICTORY)){
StyledButton seedButton = new StyledButton(Chrome.Type.BLANK, Messages.get(HeroSelectScene.class, "custom_seed"), 6){
@Override
protected void onClick() {
String existingSeedtext = SPDSettings.customSeed();
ShatteredPixelDungeon.scene().addToFront( new WndTextInput(Messages.get(HeroSelectScene.class, "custom_seed_title"),
Messages.get(HeroSelectScene.class, "custom_seed_desc"),
existingSeedtext,
20,
false,
Messages.get(HeroSelectScene.class, "custom_seed_set"),
Messages.get(HeroSelectScene.class, "custom_seed_clear")){
@Override
public void onSelect(boolean positive, String text) {
text = DungeonSeed.formatText(text);
long seed = DungeonSeed.convertFromText(text);
if (positive && seed != -1){
for (GamesInProgress.Info info : GamesInProgress.checkAll()){
if (info.customSeed.isEmpty() && info.seed == seed){
SPDSettings.customSeed("");
icon.resetColor();
ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(HeroSelectScene.class, "custom_seed_duplicate")));
return;
}
}
SPDSettings.customSeed(text);
icon.hardlight(1f, 1.5f, 0.67f);
} else {
SPDSettings.customSeed("");
icon.resetColor();
}
updateOptionsColor();
}
});
}
};
seedButton.leftJustify = true;
seedButton.icon(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_SEED)));
if (!SPDSettings.customSeed().isEmpty()) seedButton.icon().hardlight(1f, 1.5f, 0.67f);;
buttons.add(seedButton);
add(seedButton);
StyledButton dailyButton = new StyledButton(Chrome.Type.BLANK, Messages.get(HeroSelectScene.class, "daily"), 6){
private static final long SECOND = 1000;
private static final long MINUTE = 60 * SECOND;
private static final long HOUR = 60 * MINUTE;
private static final long DAY = 24 * HOUR;
@Override
protected void onClick() {
super.onClick();
long diff = (SPDSettings.lastDaily() + DAY) - Game.realTime;
if (diff > 24*HOUR){
ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(HeroSelectScene.class, "daily_unavailable_long", (diff / DAY)+1)));
return;
}
for (GamesInProgress.Info game : GamesInProgress.checkAll()){
if (game.daily){
ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(HeroSelectScene.class, "daily_existing")));
return;
}
}
Image icon = new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CALENDAR));
if (diff <= 0) icon.hardlight(0.5f, 1f, 2f);
else icon.hardlight(1f, 0.5f, 2f);
ShatteredPixelDungeon.scene().addToFront(new WndOptions(
icon,
Messages.get(HeroSelectScene.class, "daily"),
diff > 0 ?
Messages.get(HeroSelectScene.class, "daily_repeat") :
Messages.get(HeroSelectScene.class, "daily_desc"),
Messages.get(HeroSelectScene.class, "daily_yes"),
Messages.get(HeroSelectScene.class, "daily_no")){
@Override
protected void onSelect(int index) {
if (index == 0){
if (TileMapCompilationManager.INSTANCE.isBusy()) {
ShatteredPixelDungeon.scene().addToFront(new WndMessage(Messages.get(WndMods.class, "wait")));
return;
}
if (diff <= 0) {
long time = Game.realTime - (Game.realTime % DAY);
//earliest possible daily for v1.4.0 is Sept 10 2022
//which is 19,245 days after Jan 1 1970
time = Math.max(time, 19_245 * DAY);
SPDSettings.lastDaily(time);
Dungeon.dailyReplay = false;
} else {
Dungeon.dailyReplay = true;
}
Dungeon.hero = null;
Dungeon.daily = true;
ActionIndicator.action = null;
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
Game.switchScene( InterlevelScene.class );
}
}
});
}
private long timeToUpdate = 0;
private final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss", Locale.ROOT);
{
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
}
@Override
public void update() {
super.update();
if (Game.realTime > timeToUpdate && visible){
long diff = (SPDSettings.lastDaily() + DAY) - Game.realTime;
if (diff > 0){
if (diff > 30*HOUR){
text("30:00:00+");
} else {
text(dateFormat.format(new Date(diff)));
}
timeToUpdate = Game.realTime + SECOND;
} else {
text(Messages.get(HeroSelectScene.class, "daily"));
timeToUpdate = Long.MAX_VALUE;
}
}
}
};
dailyButton.leftJustify = true;
dailyButton.icon(new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CALENDAR)));
add(dailyButton);
buttons.add(dailyButton);
StyledButton challengeButton = new StyledButton(Chrome.Type.BLANK, Messages.get(WndChallenges.class, "title"), 6){
@Override
protected void onClick() {
ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() {
super.onBackPressed();
icon(SPDSettings.challenges() > 0 ? new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CHALLENGE_ON)) : new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CHALLENGE_OFF)));
updateOptionsColor();
}
} );
}
};
challengeButton.leftJustify = true;
challengeButton.icon(SPDSettings.challenges() > 0 ? new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CHALLENGE_ON)) : new Image(Asset.getAssetFilePath(GeneralAsset.ICON_CHALLENGE_OFF)));
add(challengeButton);
buttons.add(challengeButton);
}
for (int i = 1; i < buttons.size(); i++){
ColorBlock spc = new ColorBlock(1, 1, 0xFF000000);
add(spc);
spacers.add(spc);
}
}
@Override
protected void layout() {
super.layout();
bg.x = x;
bg.y = y;
int width = 0;
for (StyledButton btn : buttons){
if (width < btn.reqWidth()) width = (int)btn.reqWidth();
}
width += bg.marginHor();
int top = (int)y + bg.marginTop() - 1;
int i = 0;
for (StyledButton btn : buttons){
btn.setRect(x+bg.marginLeft(), top, width - bg.marginHor(), 16);
top = (int)btn.bottom();
if (i < spacers.size()) {
spacers.get(i).size(btn.width(), 1);
spacers.get(i).x = btn.left();
spacers.get(i).y = PixelScene.align(btn.bottom()-0.5f);
i++;
}
}
this.width = width;
this.height = top+bg.marginBottom()-y-1;
bg.size(this.width, this.height);
}
private void alpha( float value ){
bg.alpha(value);
for (StyledButton btn : buttons){
btn.alpha(value);
}
for (ColorBlock spc : spacers){
spc.alpha(value);
}
}
}
}
| 23,065
|
Java
|
.java
|
QuasiStellar/custom-pixel-dungeon
| 14
| 2
| 3
|
2023-05-12T21:10:47Z
|
2024-01-23T19:02:46Z
|
7336324b84d68982af3653ae035b260c5d7b85ad8854e79ceeea185e7d8d41a1
|
[] |
[
1127,
222,
338,
20244,
493,
28253,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
55,
50,
55,
53,
54,
58,
565,
2358,
493,
4628,
102,
222,
338,
222,
338,
2432,
6319,
337,
20244,
493,
28253,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
57,
50,
55,
53,
55,
56,
535,
15738,
21945,
291,
11809,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
2056,
222,
588,
222,
222,
1337,
785,
51,
118,
6882,
51,
3005,
47226,
51,
37023,
64,
222,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
8421,
3859,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
18115,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
73,
28253,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
26953,
26691,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
2249,
73,
2977,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1207,
6319,
337,
7040,
73,
28253,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
31869,
51,
15263,
51,
21823,
1359,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
3527,
51,
6869,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
3527,
51,
8633,
6869,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
14434,
51,
21579,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
6296,
51,
6389,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1820,
2438,
51,
8079,
1225,
25339,
1590,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
1728,
12474,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
8121,
1732,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
34337,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
36313,
39098,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
20129,
1732,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
1726,
51,
1684,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
41100,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
2045,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
26126,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
2324,
51,
73,
28253,
11483,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
846,
21259,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
21823,
1139,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
971,
17391,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
1193,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1861,
29672,
51,
4900,
2610,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1151,
51,
4828,
1167,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
7139,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1530,
2246,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
3783,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1675,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
83,
501,
9786,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
4828,
5585,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
121,
3009,
502,
51,
89,
1399,
766,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1726,
51,
1735,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3046,
6823,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3783,
5728,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
48882,
64,
222,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
485,
1401,
51,
1058,
51,
26193,
64,
222,
222,
942,
462,
32047,
1926,
7320,
2041,
20244,
7320,
320,
499,
221,
2072,
4393,
3224,
64,
222,
221,
2072,
4393,
12295,
3695,
49,
12295,
4058,
64,
222,
221,
2072,
10165,
1732,
3158,
22418,
64,
453,
2605,
563,
37079,
499,
221,
325,
107,
4442,
5326,
4725,
222,
221,
2072,
9430,
337,
39098,
1799,
64,
222,
221,
2072,
5068,
65,
20129,
1732,
67,
24294,
8103,
120,
299,
556,
5068,
6984,
222,
221,
2072,
9430,
337,
39098,
24294,
577,
64,
453,
2605,
563,
37079,
222,
221,
2072,
9430,
337,
39098,
24294,
5349,
64,
453,
2605,
563,
37079,
222,
221,
2072,
35405,
1732,
1496,
8103,
64,
222,
221,
2072,
10165,
1732,
3116,
1732,
64,
222,
221,
2072,
10165,
1732,
3158,
2045,
64,
222,
221,
2072,
6067,
2045,
2089,
7586,
64,
222,
221,
2072,
10165,
1732,
3158,
8121,
64,
499,
221,
69,
1806,
222,
221,
942,
782,
1506,
365,
320,
376,
221,
5282,
51,
1315,
492,
1332,
221,
73,
28253,
51,
15263,
299,
762,
64,
1332,
221,
8421,
3859,
51,
963,
4470,
492,
376,
221,
21579,
51,
963,
4470,
492,
1332,
221,
4175,
299,
556,
4393,
45,
21823,
1359,
51,
6110,
4727,
776,
51
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
846,
21259,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
21823,
1139,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
971,
17391,
64,
222,
485,
785,
51,
118,
6882,
51,
3005,
47226,
51,
5921,
51,
19707,
1193,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1861,
29672,
51,
4900,
2610,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1151,
51,
4828,
1167,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
7139,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1530,
2246,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
3783,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1675,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
83,
501,
9786,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
4828,
5585,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
121,
3009,
502,
51,
89,
1399,
766,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1726,
51,
1735,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3046,
6823,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3783,
5728,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
48882,
64,
222,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
485,
1401,
51,
1058,
51,
26193,
64,
222,
222,
942,
462,
32047,
1926,
7320,
2041,
20244,
7320,
320,
499,
221,
2072,
4393,
3224,
64
] | -7,332,745,043,867,557,000
| true
| false
| false
| false
|
[
22201,
51,
83,
501,
9786,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
4828,
5585,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
121,
3009,
502,
51,
89,
1399,
766,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
1365,
22201,
51,
1726,
51,
1735,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3046,
6823,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
3783,
5728,
64,
222,
485,
785,
51,
124,
1626,
663,
51,
2324,
51,
48882,
64,
222,
222,
485,
1401,
51,
897,
51,
41033
] | 4,381,565,511,037,639,000
| true
|
com.qsr.customspd.windows.WndChallenges;
import com.qsr.customspd.windows.WndHeroInfo;
import com.qsr.customspd.windows.WndKeyBindings;
import com.qsr.customspd.windows.WndMessage;
import com.watabou.gltextures.TextureCache;
import com.watabou.input.PointerEvent;
import com.watabou.noosa.Camera;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PointF;
import java.text.SimpleDateFormat
|
qsr.customspd.windows.WndMessage;
import com.watabou.gltextures.TextureCache;
import com.watabou.input.PointerEvent;
import com.watabou.noosa.Camera;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PointF;
import java.text.SimpleDateFormat
|
;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PointF;
import java.text.SimpleDateFormat
|
osa.NinePatch;
import com.watabou.noosa.PointerArea;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PointF;
import java.text.SimpleDateFormat
|
;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
public class HeroSelectScene extends PixelScene {
private Image background;
|
CommandRegistry.java
|
/FileExtraction/Java_unseen/Dark-Developments_Kapuncino-Client/src/main/java/coffee/client/feature/command/CommandRegistry.java
|
/*
* Copyright (c) 2022 Coffee Client, 0x150 and contributors.
* Some rights reserved, refer to LICENSE file.
*/
package coffee.client.feature.command;
import coffee.client.feature.addon.Addon;
import coffee.client.feature.command.exception.CommandException;
import coffee.client.feature.command.impl.*;
import coffee.client.helper.util.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CommandRegistry {
private static final List<Command> vanillaCommands = new ArrayList<>();
private static final List<CustomCommandEntry> customCommands = new ArrayList<>();
private static final List<Command> sharedCommands = new ArrayList<>();
static {
rebuildSharedCommands();
}
public static void registerCustomCommand(Addon addon, Command command) {
for (CustomCommandEntry e : customCommands) {
if (e.command.getClass() == command.getClass()) {
throw new IllegalStateException("Command " + command.getClass().getSimpleName() + " already registered");
}
}
customCommands.add(new CustomCommandEntry(addon, command));
rebuildSharedCommands();
}
public static void clearCustomCommands(Addon addon) {
customCommands.removeIf(customCommandEntry -> customCommandEntry.addon == addon);
rebuildSharedCommands();
}
private static void rebuildSharedCommands() {
sharedCommands.clear();
sharedCommands.addAll(vanillaCommands);
for (CustomCommandEntry customCommand : customCommands) {
sharedCommands.add(customCommand.command);
}
}
public static void init() {
vanillaCommands.clear();
vanillaCommands.add(new Toggle());
vanillaCommands.add(new Config());
vanillaCommands.add(new Gamemode());
vanillaCommands.add(new Effect());
vanillaCommands.add(new Hologram());
vanillaCommands.add(new Help());
vanillaCommands.add(new ForEach());
vanillaCommands.add(new Drop());
vanillaCommands.add(new Panic());
vanillaCommands.add(new Rename());
vanillaCommands.add(new ViewNbt());
vanillaCommands.add(new Say());
vanillaCommands.add(new ConfigUtils());
vanillaCommands.add(new Invsee());
vanillaCommands.add(new RageQuit());
vanillaCommands.add(new FakeItem());
vanillaCommands.add(new Taco());
vanillaCommands.add(new Bind());
vanillaCommands.add(new Test());
vanillaCommands.add(new Kickall());
vanillaCommands.add(new Inject());
vanillaCommands.add(new ApplyVel());
vanillaCommands.add(new Author());
vanillaCommands.add(new Ban());
vanillaCommands.add(new CheckCmd());
vanillaCommands.add(new Damage());
vanillaCommands.add(new Equip());
vanillaCommands.add(new EVclip());
vanillaCommands.add(new ItemSpoof());
vanillaCommands.add(new HClip());
vanillaCommands.add(new ItemData());
vanillaCommands.add(new TitleLag());
vanillaCommands.add(new SpawnData());
vanillaCommands.add(new VClip());
vanillaCommands.add(new MessageSpam());
vanillaCommands.add(new RandomBook());
vanillaCommands.add(new SocketKick());
vanillaCommands.add(new SelfDestruct());
vanillaCommands.add(new ItemExploit());
vanillaCommands.add(new FakeNick());
vanillaCommands.add(new Reset());
vanillaCommands.add(new Kill());
vanillaCommands.add(new HoloImage());
vanillaCommands.add(new ApplyEffect());
vanillaCommands.add(new Search());
vanillaCommands.add(new BaritoneCommand());
vanillaCommands.add(new ClipCommand());
vanillaCommands.add(new BorderSize());
vanillaCommands.add(new Bookban());
vanillaCommands.add(new FindCoords());
vanillaCommands.add(new Locate());
vanillaCommands.add(new ahdupe());
rebuildSharedCommands();
}
public static List<Command> getCommands() {
return sharedCommands;
}
public static void execute(String command) {
if (command.isEmpty() || command.isBlank()) {
return; // nothing to execute
}
String[] spl = command.split(" +");
if (spl.length == 0) {
return; // this shouldnt happen in theory
}
String cmd = spl[0].toLowerCase();
String[] args = Arrays.copyOfRange(spl, 1, spl.length);
Command c = CommandRegistry.getByAlias(cmd);
if (c == null) {
Utils.Logging.error("Command \"" + cmd + "\" not found");
} else {
try {
c.onExecute(args);
} catch (CommandException cex) {
Utils.Logging.error(cex.getMessage());
} catch (Exception e) {
Utils.Logging.error("Error while running command " + command);
e.printStackTrace();
}
}
}
public static Command getByAlias(String n) {
for (Command command : getCommands()) {
for (String alias : command.getAliases()) {
if (alias.equalsIgnoreCase(n)) {
return command;
}
}
}
return null;
}
record CustomCommandEntry(Addon addon, Command command) {
}
}
| 5,424
|
Java
|
.java
|
Dark-Developments/Kapuncino-Client
| 18
| 4
| 0
|
2023-03-18T16:45:59Z
|
2023-06-30T17:48:22Z
|
edb30d8b0875d64403a544cdcba669063b0a47f722fc619c6ebe4d17137ee09a
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
55,
55,
409,
22349,
5680,
49,
244,
53,
125,
54,
58,
53,
480,
13356,
51,
222,
338,
4202,
4760,
5225,
49,
5293,
391,
7621,
822,
51,
222,
588,
222,
222,
1337,
36963,
51,
1598,
51,
3317,
51,
2514,
64,
222,
222,
485,
36963,
51,
1598,
51,
3317,
51,
16648,
51,
25662,
64,
222,
485,
36963,
51,
1598,
51,
3317,
51,
2514,
51,
3918,
51,
2037,
1002,
64,
222,
485,
36963,
51,
1598,
51,
3317,
51,
2514,
51,
3126,
7737,
222,
485,
36963,
51,
1598,
51,
4328,
51,
1058,
51,
2769,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
5730,
5389,
320,
303,
964,
924,
1175,
1701,
65,
2037,
67,
44621,
9769,
299,
556,
5068,
6984,
303,
964,
924,
1175,
1701,
65,
3414,
2037,
2717,
67,
3137,
9769,
299,
556,
5068,
6984,
303,
964,
924,
1175,
1701,
65,
2037,
67,
7187,
9769,
299,
556,
5068,
6984,
465,
924,
320,
310,
24614,
7444,
9769,
492,
303,
339,
465,
581,
924,
782,
3923,
3414,
2037,
45,
25662,
30863,
49,
5730,
2035,
46,
320,
310,
456,
327,
3414,
2037,
2717,
503,
518,
3137,
9769,
46,
320,
343,
434,
327,
106,
51,
2514,
51,
9699,
365,
630,
2035,
51,
9699,
1177,
320,
419,
1440,
556,
21641,
459,
2037,
332,
494,
2035,
51,
9699,
941,
26999,
365,
494,
332,
3443,
10423,
742,
343,
339,
310,
339,
310,
3137,
9769,
51,
688,
45,
909,
6041,
2037,
2717,
45,
16648,
49,
2035,
894,
310,
24614,
7444,
9769,
492,
303,
339,
465,
581,
924,
782,
4250,
3414,
9769,
45,
25662,
30863,
46,
320,
310,
3137,
9769,
51,
2564,
2811,
45,
3005,
2037,
2717,
984,
3137,
2037,
2717,
51,
16648,
630,
30863,
312,
310,
24614,
7444,
9769,
492,
303,
339,
465,
964,
924,
782,
24614,
7444,
9769,
365,
320,
310,
7187,
9769,
51,
3830,
492,
310,
7187,
9769,
51,
15109,
45,
15738,
6815,
9769,
312,
310,
456,
327,
3414,
2037,
2717,
3137,
2037,
518,
3137,
9769,
46,
320,
343,
7187,
9769,
51,
688,
45,
3005,
2037,
51,
2514,
312,
310,
339,
303,
339,
465,
581,
924,
782,
3238,
365,
320,
310,
44621,
9769,
51,
3830,
492,
310,
44621,
9769,
51,
688,
45,
909,
25153,
1052,
310,
44621,
9769,
51,
688,
45,
909,
3395,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6067,
2832,
1052,
310,
44621,
9769,
51,
688,
45,
909,
19234,
1052,
310,
44621,
9769,
51,
688,
45,
909,
16563,
769,
4344,
1052,
310,
44621,
9769,
51,
688,
45,
909,
16899,
1052,
310,
44621,
9769,
51,
688,
45,
909,
2643,
3875,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14204,
1052,
310,
44621,
9769,
51,
688,
45,
909,
27265,
314,
1052,
310,
44621,
9769,
51,
688,
45,
909,
26662,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4340,
83,
8057,
1052,
310,
44621,
9769,
51,
688,
45,
909,
377,
414,
1052,
310,
44621,
9769,
51,
688,
45,
909,
3395,
2769,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14744,
2987,
1052,
310,
44621,
9769,
51,
688,
45,
909,
578,
400,
28721,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18865,
1114,
1052,
310,
44621,
9769,
51,
688,
45,
909,
413,
13861,
1052,
310,
44621,
9769,
51,
688,
45,
909,
11461,
1052,
310,
44621,
9769,
51,
688,
45,
909,
2128,
1052,
310,
44621,
9769,
51,
688,
45,
909,
1242,
1246,
483,
1052,
310,
44621,
9769,
51,
688,
45,
909,
19732,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14873,
27871,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6265,
1052,
310,
44621,
9769,
51,
688,
45,
909,
570,
297,
1052,
310,
44621,
9769,
51,
688,
45,
909,
3471,
5285,
1052,
310,
44621,
9769,
51,
688,
45,
909,
34580,
1052,
310,
44621,
9769,
51,
688,
45,
909,
535,
8915,
1052,
310,
44621,
9769,
51,
688,
45,
909,
39358,
10390,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6337,
2184,
28019,
1052,
310,
44621,
9769,
51,
688,
45,
909,
696,
10399,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6337,
768,
1052,
310,
44621,
9769,
51,
688,
45,
909,
1994,
40943,
1052,
310,
44621,
9769,
51,
688,
45,
909,
34711,
768,
1052,
310,
44621,
9769,
51,
688,
45,
909,
694,
10399,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4587,
2184,
424,
1052,
310,
44621,
9769,
51,
688,
45,
909,
9607,
6597,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14834,
47297,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6617,
5088,
33940,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6337,
23073,
302,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18865,
25581,
1052,
310,
44621,
9769,
51,
688,
45,
909,
10063,
1052,
310,
44621,
9769,
51,
688,
45,
909,
41713,
1052,
310,
44621,
9769,
51,
688,
45,
909,
16563,
335,
1675,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14873,
5572,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7438,
1052,
310,
44621,
9769,
51,
688,
45,
909,
11489,
302,
677,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
28706,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18065,
1269,
1052,
310,
44621,
9769,
51,
688,
45,
909,
13357,
10365,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7499,
17473,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4607,
351,
1052,
310,
44621,
9769,
51,
688,
45,
909,
30060,
1815,
367,
1052,
603,
24614,
7444,
9769,
492,
303,
339,
465,
581,
924,
1701,
65,
2037,
67,
640,
9769,
365,
320,
310,
461,
7187,
9769,
64,
303,
339,
465,
581,
924,
782,
5755,
45,
671,
2035,
46,
320,
310,
434,
327,
2514,
51,
6401,
365,
1293,
2035,
51,
40481,
1177,
320,
343,
461,
64,
453,
7572,
391,
5755,
310,
339,
310,
910,
1197,
14804,
299,
2035,
51,
3045,
459,
494,
742,
310,
434,
327,
11244,
51,
1340,
630,
244,
53,
46,
320,
343,
461,
64,
453,
477,
1414,
585,
7305,
347,
25418,
310,
339,
310,
910,
4781,
299,
14804,
96,
53,
1015,
10498,
492,
310,
910,
1197,
2194,
299,
14479,
51,
36927,
3216,
45,
11244,
49,
244,
54,
49,
14804,
51,
1340,
312,
310,
5730,
300,
299,
5730,
5389,
51,
23426
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
9769,
51,
688,
45,
909,
6337,
2184,
28019,
1052,
310,
44621,
9769,
51,
688,
45,
909,
696,
10399,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6337,
768,
1052,
310,
44621,
9769,
51,
688,
45,
909,
1994,
40943,
1052,
310,
44621,
9769,
51,
688,
45,
909,
34711,
768,
1052,
310,
44621,
9769,
51,
688,
45,
909,
694,
10399,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4587,
2184,
424,
1052,
310,
44621,
9769,
51,
688,
45,
909,
9607,
6597,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14834,
47297,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6617,
5088,
33940,
1052,
310,
44621,
9769,
51,
688,
45,
909,
6337,
23073,
302,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18865,
25581,
1052,
310,
44621,
9769,
51,
688,
45,
909,
10063,
1052,
310,
44621,
9769,
51,
688,
45,
909,
41713,
1052,
310,
44621,
9769,
51,
688,
45,
909,
16563,
335,
1675,
1052,
310,
44621,
9769,
51,
688,
45,
909,
14873,
5572,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7438,
1052,
310,
44621,
9769,
51,
688,
45,
909,
11489,
302,
677,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
28706,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18065,
1269,
1052,
310,
44621,
9769,
51,
688,
45,
909,
13357,
10365,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7499,
17473,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4607,
351,
1052,
310,
44621,
9769,
51,
688,
45,
909,
30060,
1815,
367,
1052,
603,
24614,
7444,
9769,
492,
303,
339,
465,
581,
924,
1701,
65,
2037,
67,
640,
9769,
365,
320,
310,
461,
7187,
9769,
64,
303,
339,
465,
581,
924,
782,
5755,
45,
671,
2035,
46,
320,
310,
434,
327,
2514,
51,
6401,
365,
1293,
2035,
51,
40481,
1177,
320,
343,
461,
64,
453,
7572,
391,
5755,
310,
339
] | -6,839,789,689,349,779,000
| true
| false
| false
| false
|
[
1052,
310,
44621,
9769,
51,
688,
45,
909,
14873,
5572,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7438,
1052,
310,
44621,
9769,
51,
688,
45,
909,
11489,
302,
677,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
28706,
2037,
1052,
310,
44621,
9769,
51,
688,
45,
909,
18065,
1269,
1052,
310,
44621,
9769,
51,
688,
45,
909,
13357,
10365,
1052,
310,
44621,
9769,
51,
688,
45,
909,
7499,
17473,
1052,
310,
44621,
9769,
51,
688,
45,
909,
4607,
351,
1052,
310,
44621,
9769,
51,
688,
45,
909,
30060,
1815,
367,
1052,
603,
24614,
7444,
9769,
492,
303,
339
] | -5,700,298,380,507,425,000
| true
|
Commands.add(new ItemSpoof());
vanillaCommands.add(new HClip());
vanillaCommands.add(new ItemData());
vanillaCommands.add(new TitleLag());
vanillaCommands.add(new SpawnData());
vanillaCommands.add(new VClip());
vanillaCommands.add(new MessageSpam());
vanillaCommands.add(new RandomBook());
vanillaCommands.add(new SocketKick());
vanillaCommands.add(new SelfDestruct());
vanillaCommands.add(new ItemExploit());
vanillaCommands.add(new FakeNick());
vanillaCommands.add(new Reset());
vanillaCommands.add(new Kill());
vanillaCommands.add(new HoloImage());
vanillaCommands.add(new ApplyEffect());
vanillaCommands.add(new Search());
vanillaCommands.add(new BaritoneCommand());
vanillaCommands.add(new ClipCommand());
vanillaCommands.add(new BorderSize());
vanillaCommands.add(new Bookban());
vanillaCommands.add(new FindCoords());
vanillaCommands.add(new Locate());
vanillaCommands.add(new ahdupe());
rebuildSharedCommands();
}
|
vanillaCommands.add(new VClip());
vanillaCommands.add(new MessageSpam());
vanillaCommands.add(new RandomBook());
vanillaCommands.add(new SocketKick());
vanillaCommands.add(new SelfDestruct());
vanillaCommands.add(new ItemExploit());
vanillaCommands.add(new FakeNick());
vanillaCommands.add(new Reset());
vanillaCommands.add(new Kill());
vanillaCommands.add(new HoloImage());
vanillaCommands.add(new ApplyEffect());
vanillaCommands.add(new Search());
vanillaCommands.add(new BaritoneCommand());
vanillaCommands.add(new ClipCommand());
vanillaCommands.add(new BorderSize());
vanillaCommands.add(new Bookban());
vanillaCommands.add(new FindCoords());
vanillaCommands.add(new Locate());
vanillaCommands.add(new ahdupe());
rebuildSharedCommands();
}
|
());
vanillaCommands.add(new ItemExploit());
vanillaCommands.add(new FakeNick());
vanillaCommands.add(new Reset());
vanillaCommands.add(new Kill());
vanillaCommands.add(new HoloImage());
vanillaCommands.add(new ApplyEffect());
vanillaCommands.add(new Search());
vanillaCommands.add(new BaritoneCommand());
vanillaCommands.add(new ClipCommand());
vanillaCommands.add(new BorderSize());
vanillaCommands.add(new Bookban());
vanillaCommands.add(new FindCoords());
vanillaCommands.add(new Locate());
vanillaCommands.add(new ahdupe());
rebuildSharedCommands();
}
|
());
vanillaCommands.add(new ApplyEffect());
vanillaCommands.add(new Search());
vanillaCommands.add(new BaritoneCommand());
vanillaCommands.add(new ClipCommand());
vanillaCommands.add(new BorderSize());
vanillaCommands.add(new Bookban());
vanillaCommands.add(new FindCoords());
vanillaCommands.add(new Locate());
vanillaCommands.add(new ahdupe());
rebuildSharedCommands();
}
|
public static List<Command> getCommands() {
return sharedCommands;
}
public static void execute(String command) {
if (command.isEmpty() || command.isBlank()) {
return; // nothing to execute
}
|
BasicSystemGraphRealmTestHelper.java
|
/FileExtraction/Java_unseen/neo4j_neo4j/community/community-it/security-it/src/test/java/org/neo4j/security/BasicSystemGraphRealmTestHelper.java
|
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [https://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.neo4j.security;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME;
import static org.neo4j.server.security.auth.SecurityTestUtils.credentialFor;
import static org.neo4j.server.security.auth.SecurityTestUtils.password;
import java.util.Collections;
import java.util.NavigableMap;
import java.util.Optional;
import org.neo4j.common.DependencyResolver;
import org.neo4j.configuration.GraphDatabaseSettings;
import org.neo4j.dbms.api.DatabaseManagementService;
import org.neo4j.dbms.database.DatabaseContextProvider;
import org.neo4j.dbms.database.StandaloneDatabaseContext;
import org.neo4j.kernel.database.Database;
import org.neo4j.kernel.database.DatabaseId;
import org.neo4j.kernel.database.DatabaseIdRepository;
import org.neo4j.kernel.database.NamedDatabaseId;
import org.neo4j.kernel.database.TestDatabaseIdRepository;
import org.neo4j.kernel.impl.factory.GraphDatabaseFacade;
import org.neo4j.kernel.impl.security.User;
import org.neo4j.kernel.lifecycle.LifecycleAdapter;
import org.neo4j.server.security.systemgraph.SystemGraphRealmHelper;
import org.neo4j.test.TestDatabaseManagementServiceBuilder;
import org.neo4j.test.utils.TestDirectory;
public class BasicSystemGraphRealmTestHelper {
public static class TestDatabaseContextProvider extends LifecycleAdapter
implements DatabaseContextProvider<StandaloneDatabaseContext> {
protected GraphDatabaseFacade testSystemDb;
protected final DatabaseManagementService managementService;
private final DatabaseIdRepository databaseIdRepository = new TestDatabaseIdRepository();
protected TestDatabaseContextProvider(TestDirectory testDir) {
managementService = createManagementService(testDir);
testSystemDb = (GraphDatabaseFacade) managementService.database(SYSTEM_DATABASE_NAME);
}
protected DatabaseManagementService createManagementService(TestDirectory testDir) {
return new TestDatabaseManagementServiceBuilder(testDir.homePath())
.impermanent()
.noOpSystemGraphInitializer()
.setConfig(GraphDatabaseSettings.auth_enabled, false)
.build();
}
public DatabaseManagementService getManagementService() {
return managementService;
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(NamedDatabaseId namedDatabaseId) {
if (namedDatabaseId.isSystemDatabase()) {
DependencyResolver dependencyResolver = testSystemDb.getDependencyResolver();
Database database = dependencyResolver.resolveDependency(Database.class);
return Optional.of(new StandaloneDatabaseContext(database));
}
return Optional.empty();
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(String databaseName) {
return databaseIdRepository().getByName(databaseName).flatMap(this::getDatabaseContext);
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(DatabaseId databaseId) {
return databaseIdRepository().getById(databaseId).flatMap(this::getDatabaseContext);
}
@Override
public DatabaseIdRepository databaseIdRepository() {
return databaseIdRepository;
}
@Override
public NavigableMap<NamedDatabaseId, StandaloneDatabaseContext> registeredDatabases() {
return Collections.emptyNavigableMap();
}
}
public static void assertAuthenticationSucceeds(
SystemGraphRealmHelper realmHelper, String username, String password) throws Exception {
assertAuthenticationSucceeds(realmHelper, username, password, false);
}
public static void assertAuthenticationSucceeds(
SystemGraphRealmHelper realmHelper, String username, String password, boolean changeRequired)
throws Exception {
var user = realmHelper.getUser(username);
assertTrue(user.credentials().matchesPassword(password(password)));
assertThat(user.passwordChangeRequired())
.withFailMessage(
"Expected change required to be %s, but was %s", changeRequired, user.passwordChangeRequired())
.isEqualTo(changeRequired);
}
public static void assertAuthenticationFails(SystemGraphRealmHelper realmHelper, String username, String password)
throws Exception {
var user = realmHelper.getUser(username);
assertFalse(user.credentials().matchesPassword(password(password)));
}
public static User createUser(String userName, String password, boolean pwdChangeRequired) {
return new User.Builder(userName, credentialFor(password))
.withRequiredPasswordChange(pwdChangeRequired)
.build();
}
}
| 5,888
|
Java
|
.java
|
neo4j/neo4j
| 12,521
| 2,320
| 303
|
2012-11-12T08:46:15Z
|
2024-04-24T10:23:06Z
|
8c3d9ed0619b4fede2eb589069b1b898e1fd61cfcfce90ca8dbab7d5e03e1fb2
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
332,
36459,
57,
111,
39,
222,
338,
37995,
57,
111,
6505,
34061,
20660,
447,
662,
574,
23307,
57,
111,
51,
527,
98,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
37995,
57,
111,
51,
222,
338,
222,
338,
37995,
57,
111,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
1105,
51,
23307,
57,
111,
51,
4386,
64,
222,
222,
485,
924,
1105,
51,
40018,
51,
1284,
51,
1256,
51,
16980,
51,
17427,
64,
222,
485,
924,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
16980,
51,
14840,
64,
222,
485,
924,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
16980,
51,
6553,
64,
222,
485,
924,
1105,
51,
23307,
57,
111,
51,
5990,
51,
3418,
3969,
2977,
51,
12882,
100,
20536,
100,
2491,
64,
222,
485,
924,
1105,
51,
23307,
57,
111,
51,
1805,
51,
4386,
51,
2408,
51,
5196,
32384,
51,
21085,
1580,
64,
222,
485,
924,
1105,
51,
23307,
57,
111,
51,
1805,
51,
4386,
51,
2408,
51,
5196,
32384,
51,
2911,
64,
222,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
14789,
463,
1225,
64,
222,
485,
1401,
51,
1058,
51,
7575,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
2297,
51,
9666,
7266,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
5990,
51,
3418,
3969,
2977,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
47657,
51,
1256,
51,
3969,
8596,
1201,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
47657,
51,
4617,
51,
3969,
1237,
2588,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
47657,
51,
4617,
51,
43792,
3969,
1237,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
4617,
51,
3969,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
4617,
51,
3969,
625,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
4617,
51,
3969,
625,
3231,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
4617,
51,
11061,
3969,
625,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
4617,
51,
1024,
3969,
625,
3231,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
3126,
51,
5802,
51,
3418,
3969,
19572,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
3126,
51,
4386,
51,
1259,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
6515,
51,
19749,
51,
18331,
4433,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
1805,
51,
4386,
51,
2964,
2275,
51,
1615,
3418,
22423,
2775,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
881,
51,
1024,
3969,
8596,
1201,
1812,
64,
222,
485,
1105,
51,
23307,
57,
111,
51,
881,
51,
2324,
51,
1024,
4562,
64,
222,
222,
942,
462,
9280,
1615,
3418,
22423,
39031,
320,
303,
581,
924,
462,
2128,
3969,
1237,
2588,
2041,
42130,
4433,
343,
4584,
6728,
1237,
2588,
65,
43792,
3969,
1237,
67,
320,
310,
2532,
6478,
3969,
19572,
913,
1615,
5155,
64,
310,
2532,
1175,
6728,
8596,
1201,
11151,
1201,
64,
310,
964,
1175,
6728,
625,
3231,
3520,
625,
3231,
299,
556,
2128,
3969,
625,
3231,
492,
603,
2532,
2128,
3969,
1237,
2588,
45,
1024,
4562,
913,
2995,
46,
320,
343,
11151,
1201,
299,
1506,
8596,
1201,
45,
881,
2995,
312,
343,
913,
1615,
5155,
299,
327,
3418,
3969,
19572,
46,
11151,
1201,
51,
4617,
45,
12882,
100,
20536,
100,
2491,
312,
310,
339,
603,
2532,
6728,
8596,
1201,
1506,
8596,
1201,
45,
1024,
4562,
913,
2995,
46,
320,
343,
461,
556,
2128,
3969,
8596,
1201,
1812,
45,
881,
2995,
51,
2849,
1233,
1177,
547,
657,
440,
284,
19314,
365,
547,
657,
1365,
3409,
1615,
3418,
20038,
365,
547,
657,
489,
1081,
45,
3418,
3969,
2977,
51,
2408,
100,
6572,
49,
920,
46,
547,
657,
1848,
492,
310,
339,
603,
581,
6728,
8596,
1201,
640,
8596,
1201,
365,
320,
343,
461,
11151,
1201,
64,
310,
339,
603,
496,
1806,
310,
581,
5663,
65,
43792,
3969,
1237,
67,
640,
3969,
1237,
45,
11061,
3969,
625,
8213,
3969,
625,
46,
320,
343,
434,
327,
9298,
3969,
625,
51,
316,
1615,
3969,
1177,
320,
419,
17889,
7266,
8458,
7266,
299,
913,
1615,
5155,
51,
390,
9666,
7266,
492,
419,
6728,
3520,
299,
8458,
7266,
51,
5292,
9666,
45,
3969,
51,
842,
312,
419,
461,
5663,
51,
1048,
45,
909,
31880,
13874,
3969,
1237,
45,
4617,
894,
343,
339,
343,
461,
5663,
51,
2970,
492,
310,
339,
603,
496,
1806,
310,
581,
5663,
65,
43792,
3969,
1237,
67,
640,
3969,
1237,
45,
671,
3520,
577,
46,
320,
343,
461,
3520,
625,
3231,
941,
390,
9809,
45,
4617,
577,
566,
23375,
45,
597,
422,
390,
3969,
1237,
312,
310,
339,
603,
496,
1806,
310,
581,
5663,
65,
43792,
3969,
1237,
67,
640,
3969,
1237,
45,
3969,
625,
3520,
625,
46,
320,
343,
461,
3520,
625,
3231,
941,
45747,
45,
4617,
625,
566,
23375,
45,
597,
422,
390,
3969,
1237,
312,
310,
339,
603,
496,
1806,
310,
581,
6728,
625,
3231,
3520,
625,
3231,
365,
320,
343,
461,
3520,
625,
3231,
64,
310,
339,
603,
496,
1806,
310,
581,
20568,
463,
1225,
65,
11061,
3969,
625,
49,
31880,
13874,
3969,
1237,
67,
10423,
48023,
365,
320,
343,
461,
15490,
51,
2970,
14789,
463,
1225,
492,
310,
339,
303,
339,
465,
581,
924,
782,
1217,
8164,
12414
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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792,
3969,
1237,
67,
320,
310,
2532,
6478,
3969,
19572,
913,
1615,
5155,
64,
310,
2532,
1175,
6728,
8596,
1201,
11151,
1201,
64,
310,
964,
1175,
6728,
625,
3231,
3520,
625,
3231,
299,
556,
2128,
3969,
625,
3231,
492,
603,
2532,
2128,
3969,
1237,
2588,
45,
1024,
4562,
913,
2995,
46,
320,
343,
11151,
1201,
299,
1506,
8596,
1201,
45,
881,
2995,
312,
343,
913,
1615,
5155,
299,
327,
3418,
3969,
19572,
46,
11151,
1201,
51,
4617,
45,
12882,
100,
20536,
100,
2491,
312,
310,
339,
603,
2532,
6728,
8596,
1201,
1506,
8596,
1201,
45,
1024,
4562,
913,
2995,
46,
320,
343,
461,
556,
2128,
3969,
8596,
1201,
1812,
45,
881,
2995,
51,
2849,
1233,
1177,
547,
657,
440,
284,
19314,
365,
547,
657,
1365,
3409,
1615,
3418,
20038,
365,
547,
657,
489,
1081,
45,
3418,
3969,
2977,
51,
2408,
100,
6572,
49,
920,
46,
547,
657,
1848,
492,
310,
339,
603,
581,
6728,
8596,
1201,
640,
8596,
1201,
365,
320,
343,
461,
11151,
1201,
64,
310,
339,
603,
496,
1806,
310,
581,
5663,
65,
43792,
3969,
1237,
67,
640,
3969,
1237,
45,
11061,
3969,
625,
8213,
3969,
625,
46,
320,
343,
434,
327,
9298,
3969,
625,
51,
316,
1615,
3969,
1177,
320,
419,
17889,
7266,
8458,
7266,
299,
913,
1615,
5155,
51,
390,
9666,
7266,
492,
419,
6728,
3520,
299,
8458,
7266,
51,
5292,
9666,
45,
3969,
51,
842,
312,
419,
461,
5663,
51,
1048,
45,
909,
31880,
13874,
3969,
1237,
45,
4617,
894,
343,
339,
343,
461,
5663,
51,
2970,
492,
310,
339,
603,
496
] | 974,412,809,600,241,000
| true
| false
| false
| false
|
[
1201,
1812,
45,
881,
2995,
51,
2849,
1233,
1177,
547,
657,
440,
284,
19314,
365,
547,
657,
1365,
3409,
1615,
3418,
20038,
365,
547,
657,
489,
1081,
45,
3418,
3969,
2977,
51,
2408,
100,
6572,
49,
920,
46,
547,
657,
1848,
492,
310,
339,
603,
581,
6728,
8596,
1201,
640,
8596,
1201,
365,
320,
343,
461,
11151,
1201,
64,
310,
339,
603,
496,
1806,
310,
581,
5663,
65,
43792,
3969,
1237,
67,
640,
3969,
1237,
45,
11061,
3969,
625,
8213,
3969,
625,
46,
320,
343,
434,
327,
9298,
3969,
625,
51,
316,
1615,
3969,
1177,
320,
419,
17889,
7266,
8458
] | 4,738,860,619,575,588,000
| true
|
;
import org.neo4j.test.utils.TestDirectory;
public class BasicSystemGraphRealmTestHelper {
public static class TestDatabaseContextProvider extends LifecycleAdapter
implements DatabaseContextProvider<StandaloneDatabaseContext> {
protected GraphDatabaseFacade testSystemDb;
protected final DatabaseManagementService managementService;
private final DatabaseIdRepository databaseIdRepository = new TestDatabaseIdRepository();
protected TestDatabaseContextProvider(TestDirectory testDir) {
managementService = createManagementService(testDir);
testSystemDb = (GraphDatabaseFacade) managementService.database(SYSTEM_DATABASE_NAME);
}
protected DatabaseManagementService createManagementService(TestDirectory testDir) {
return new TestDatabaseManagementServiceBuilder(testDir.homePath())
.impermanent()
.noOpSystemGraphInitializer()
.setConfig(GraphDatabaseSettings.auth_enabled, false)
.build();
}
public DatabaseManagementService getManagementService() {
return managementService;
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(NamedDatabaseId namedDatabaseId) {
if (namedDatabaseId.isSystemDatabase()) {
DependencyResolver dependency
|
GraphDatabaseFacade testSystemDb;
protected final DatabaseManagementService managementService;
private final DatabaseIdRepository databaseIdRepository = new TestDatabaseIdRepository();
protected TestDatabaseContextProvider(TestDirectory testDir) {
managementService = createManagementService(testDir);
testSystemDb = (GraphDatabaseFacade) managementService.database(SYSTEM_DATABASE_NAME);
}
protected DatabaseManagementService createManagementService(TestDirectory testDir) {
return new TestDatabaseManagementServiceBuilder(testDir.homePath())
.impermanent()
.noOpSystemGraphInitializer()
.setConfig(GraphDatabaseSettings.auth_enabled, false)
.build();
}
public DatabaseManagementService getManagementService() {
return managementService;
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(NamedDatabaseId namedDatabaseId) {
if (namedDatabaseId.isSystemDatabase()) {
DependencyResolver dependency
|
ManagementService(testDir);
testSystemDb = (GraphDatabaseFacade) managementService.database(SYSTEM_DATABASE_NAME);
}
protected DatabaseManagementService createManagementService(TestDirectory testDir) {
return new TestDatabaseManagementServiceBuilder(testDir.homePath())
.impermanent()
.noOpSystemGraphInitializer()
.setConfig(GraphDatabaseSettings.auth_enabled, false)
.build();
}
public DatabaseManagementService getManagementService() {
return managementService;
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(NamedDatabaseId namedDatabaseId) {
if (namedDatabaseId.isSystemDatabase()) {
DependencyResolver dependency
|
ServiceBuilder(testDir.homePath())
.impermanent()
.noOpSystemGraphInitializer()
.setConfig(GraphDatabaseSettings.auth_enabled, false)
.build();
}
public DatabaseManagementService getManagementService() {
return managementService;
}
@Override
public Optional<StandaloneDatabaseContext> getDatabaseContext(NamedDatabaseId namedDatabaseId) {
if (namedDatabaseId.isSystemDatabase()) {
DependencyResolver dependency
|
Resolver = testSystemDb.getDependencyResolver();
Database database = dependencyResolver.resolveDependency(Database.class);
return Optional.of(new StandaloneDatabaseContext(database));
}
return Optional.empty();
}
@
|
SparseTable.java
|
/FileExtraction/Java_unseen/husonlab_splitstree4/src/splitstree4/util/SparseTable.java
|
/*
* SparseTable.java Copyright (C) 2022 Daniel H. Huson
*
* (Some files contain contributions from other authors, who are then mentioned separately.)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package splitstree4.util;
import jloda.util.Pair;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
/**
* SparseArray
* <p/>
* Implementation of a sparse 2D array of doubles ints or strings. Uses a hashmap
* instead of an array.
*
* @author bryant
*/
public class SparseTable<V> {
private final HashMap<Key, V> map;
/**
* Create empty array.
*/
public SparseTable() {
map = new HashMap<>();
}
/**
* Sets entry (i,j) to the given object. If there is already an entry, it is replaced.
*
* @param i row
* @param j column
* @param value to go in the array
*/
public void set(int i, int j, V value) {
map.put(new Key(i, j), value);
}
/**
* erase
* <p/>
* Delete all entries
*/
public void clear() {
map.clear();
}
/**
* Gets the entry at position i,j
*
* @param i int index
* @param j int index
* @return Object
*/
public V get(int i, int j) {
return map.get(new Key(i, j));
}
/**
* Gets the entry for a given key
*
* @param key a key
* @return Object
*/
public V get(Key key) {
return map.get(key);
}
/**
* Clear a single entry
*
* @param i int index
* @param j int index
*/
public void clear(int i, int j) {
map.remove(new Key(i, j));
}
/**
* Check whether there is an entry in this position
*
* @param i int index
* @param j int index
* @return boolean - true if there is an entry in this position.
*/
public boolean hasEntry(int i, int j) {
return map.containsKey(new Key(i, j));
}
public Set<Key> keyset() {
return map.keySet();
}
public Collection<V> values() {
return map.values();
}
public static class Key extends Pair<Integer, Integer> {
public Key(int i, int j) {
super(i, j);
}
public Integer getFirst() {
return super.getFirst();
}
public Integer getSecond() {
return super.getSecond();
}
@Override
public int hashCode() {
return super.hashCode();
}
}
}
| 3,045
|
Java
|
.java
|
husonlab/splitstree4
| 11
| 1
| 1
|
2015-04-23T12:35:23Z
|
2023-09-21T23:28:21Z
|
3ccbb3c8b4d0c8fbcba8d09ab47b3d1714252ccd7bc080610732518f21821c4f
|
[] |
[
1127,
222,
338,
35802,
1617,
51,
1874,
2657,
327,
72,
46,
244,
55,
53,
55,
55,
32649,
696,
51,
696,
371,
286,
222,
338,
222,
338,
327,
7313,
2293,
4814,
25194,
664,
1623,
14656,
49,
6574,
904,
1636,
14554,
25028,
7475,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
6168,
289,
993,
57,
51,
1058,
64,
222,
222,
485,
614,
335,
1830,
51,
1058,
51,
5460,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
222,
1350,
222,
338,
35802,
1280,
222,
338,
350,
117,
2056,
222,
338,
19977,
451,
331,
22604,
244,
55,
73,
1437,
451,
2082,
120,
34669,
575,
5872,
51,
26072,
331,
3696,
1130,
222,
338,
4203,
451,
619,
1437,
51,
222,
338,
222,
338,
496,
2133,
342,
1012,
710,
222,
588,
222,
942,
462,
35802,
1617,
65,
91,
67,
320,
465,
964,
1175,
8329,
65,
971,
49,
694,
67,
2010,
64,
465,
1041,
294,
338,
2673,
3517,
1437,
51,
294,
588,
303,
581,
35802,
1617,
365,
320,
310,
2010,
299,
556,
8329,
6984,
303,
339,
465,
1041,
294,
338,
9023,
3429,
327,
110,
49,
111,
46,
391,
341,
2716,
1319,
51,
1691,
2038,
458,
3443,
619,
3429,
49,
580,
458,
14180,
51,
294,
338,
294,
338,
496,
772,
613,
281,
2720,
294,
338,
496,
772,
614,
281,
2656,
294,
338,
496,
772,
804,
391,
2006,
347,
341,
1437,
294,
588,
303,
581,
782,
758,
45,
429,
613,
49,
648,
614,
49,
694,
804,
46,
320,
310,
2010,
51,
543,
45,
909,
3907,
45,
110,
49,
614,
490,
804,
312,
303,
339,
465,
1041,
294,
338,
34387,
294,
338,
350,
117,
2056,
294,
338,
6802,
1187,
8072,
294,
588,
303,
581,
782,
4250,
365,
320,
310,
2010,
51,
3830,
492,
303,
339,
465,
1041,
294,
338,
7132,
341,
3429,
840,
2764,
613,
49,
111,
294,
338,
294,
338,
496,
772,
613,
648,
1671,
294,
338,
496,
772,
614,
648,
1671,
294,
338,
496,
620,
2210,
294,
588,
303,
581,
694,
640,
45,
429,
613,
49,
648,
614,
46,
320,
310,
461,
2010,
51,
390,
45,
909,
3907,
45,
110,
49,
614,
894,
303,
339,
465,
1041,
294,
338,
7132,
341,
3429,
456,
331,
2716,
1221,
294,
338,
294,
338,
496,
772,
1221,
331,
1221,
294,
338,
496,
620,
2210,
294,
588,
303,
581,
694,
640,
45,
971,
1221,
46,
320,
310,
461,
2010,
51,
390,
45,
697,
312,
303,
339,
465,
1041,
294,
338,
11040,
331,
4005,
3429,
294,
338,
294,
338,
496,
772,
613,
648,
1671,
294,
338,
496,
772,
614,
648,
1671,
294,
588,
303,
581,
782,
4250,
45,
429,
613,
49,
648,
614,
46,
320,
310,
2010,
51,
2564,
45,
909,
3907,
45,
110,
49,
614,
894,
303,
339,
465,
1041,
294,
338,
3471,
4962,
2038,
458,
619,
3429,
347,
477,
2764,
294,
338,
294,
338,
496,
772,
613,
648,
1671,
294,
338,
496,
772,
614,
648,
1671,
294,
338,
496,
620,
1922,
449,
878,
434,
2038,
458,
619,
3429,
347,
477,
2764,
51,
294,
588,
303,
581,
1922,
1421,
2717,
45,
429,
613,
49,
648,
614,
46,
320,
310,
461,
2010,
51,
15927,
45,
909,
3907,
45,
110,
49,
614,
894,
303,
339,
465,
581,
1776,
65,
971,
67,
1221,
489,
365,
320,
310,
461,
2010,
51,
23585,
492,
303,
339,
465,
581,
7380,
65,
91,
67,
2102,
365,
320,
310,
461,
2010,
51,
2857,
492,
303,
339,
465,
581,
924,
462,
3907,
2041,
16594,
65,
3078,
49,
4418,
67,
320,
376,
221,
942,
3907,
45,
429,
613,
49,
648,
614,
46,
320,
374,
221,
5282,
45,
110,
49,
614,
312,
376,
221,
130,
1332,
221,
942,
4418,
640,
3485,
365,
320,
374,
221,
620,
2615,
51,
25628,
492,
376,
221,
130,
1332,
221,
942,
4418,
640,
5076,
365,
320,
374,
221,
620,
2615,
51,
390,
5076,
492,
310,
339,
603,
496,
1806,
310,
581,
648,
17759,
365,
320,
343,
461,
2615,
51,
14941,
492,
310,
339,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
6168,
289,
993,
57,
51,
1058,
64,
222,
222,
485,
614,
335,
1830,
51,
1058,
51,
5460,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
222,
1350,
222,
338,
35802,
1280,
222,
338,
350,
117,
2056,
222,
338,
19977,
451,
331,
22604,
244,
55,
73,
1437,
451,
2082,
120,
34669,
575,
5872,
51,
26072,
331,
3696,
1130,
222,
338,
4203,
451,
619,
1437,
51,
222,
338,
222,
338,
496,
2133,
342,
1012,
710,
222,
588,
222,
942,
462,
35802,
1617,
65,
91,
67,
320,
465,
964,
1175,
8329,
65,
971,
49,
694,
67,
2010,
64,
465,
1041,
294,
338,
2673,
3517,
1437,
51,
294,
588,
303,
581,
35802,
1617,
365,
320,
310,
2010,
299,
556,
8329,
6984,
303,
339,
465,
1041,
294,
338,
9023,
3429,
327,
110,
49,
111,
46,
391,
341,
2716,
1319,
51,
1691,
2038,
458,
3443,
619,
3429,
49,
580,
458,
14180,
51,
294,
338,
294,
338,
496,
772,
613,
281,
2720,
294,
338,
496
] | 5,679,395,495,833,515,000
| true
| false
| false
| false
|
[
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
222,
1350,
222,
338,
35802,
1280,
222,
338,
350,
117,
2056,
222,
338,
19977,
451,
331,
22604,
244,
55,
73,
1437,
451,
2082,
120,
34669,
575,
5872,
51,
26072,
331,
3696,
1130,
222,
338,
4203,
451,
619,
1437,
51,
222,
338,
222,
338,
496,
2133,
342,
1012,
710,
222,
588,
222,
942,
462,
35802,
1617,
65,
91,
67,
320,
465,
964,
1175,
8329,
65,
971,
49,
694,
67,
2010,
64,
465,
1041,
294,
338,
2673,
3517,
1437,
51,
294,
588,
303,
581,
35802
] | 3,278,687,739,380,446,000
| true
|
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package splitstree4.util;
import jloda.util.Pair;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
/**
* SparseArray
* <p/>
* Implementation of a sparse 2D array of doubles ints or strings. Uses a hashmap
* instead of an array.
*
* @author bryant
*/
public class SparseTable<V> {
private final HashMap<Key, V> map;
/**
* Create empty array.
*/
public Sparse
|
; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package splitstree4.util;
import jloda.util.Pair;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
/**
* SparseArray
* <p/>
* Implementation of a sparse 2D array of doubles ints or strings. Uses a hashmap
* instead of an array.
*
* @author bryant
*/
public class SparseTable<V> {
private final HashMap<Key, V> map;
/**
* Create empty array.
*/
public Sparse
|
this program. If not, see <http://www.gnu.org/licenses/>.
*/
package splitstree4.util;
import jloda.util.Pair;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
/**
* SparseArray
* <p/>
* Implementation of a sparse 2D array of doubles ints or strings. Uses a hashmap
* instead of an array.
*
* @author bryant
*/
public class SparseTable<V> {
private final HashMap<Key, V> map;
/**
* Create empty array.
*/
public Sparse
|
import java.util.HashMap;
import java.util.Set;
/**
* SparseArray
* <p/>
* Implementation of a sparse 2D array of doubles ints or strings. Uses a hashmap
* instead of an array.
*
* @author bryant
*/
public class SparseTable<V> {
private final HashMap<Key, V> map;
/**
* Create empty array.
*/
public Sparse
|
Table() {
map = new HashMap<>();
}
/**
* Sets entry (i,j) to the given object. If there is already an entry, it is replaced.
*
* @param i row
* @
|
TestDescription.java
|
/FileExtraction/Java_unseen/itsaky_openjdk-21-android/test/hotspot/jtreg/vmTestbase/nsk/jdi/Method/isObsolete/isobsolete002/TestDescription.java
|
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
*
* @summary converted from VM Testbase nsk/jdi/Method/isObsolete/isobsolete002.
* VM Testbase keywords: [jpda, jdi, redefine]
* VM Testbase readme:
* DESCRIPTION:
* The test for the implementation of an object of the type
* Method.
* The test checks up that a result of the method
* com.sun.jdi.Method.isObsolete()
* complies with its spec:
* public boolean isObsolete()
* Determine if this method is obsolete.
* Returns: true if this method has been replaced by
* a non-equivalent method using
* VirtualMachine.redefineClasses(java.util.Map).
* The test checks that isObsolete() returns true if
* the body of the tested method has been fully replaced.
* The test works as follows:
* The debugger program - nsk.jdi.Method.isObsolete.isobsolete002;
* the debuggee program - nsk.jdi.Method.isObsolete.isobsolete002a.
* Using nsk.jdi.share classes,
* the debugger gets the debuggee running on another JavaVM,
* creates the object debuggee.VM, and waits for VMStartEvent.
* Upon getting the debuggee VM started,
* the debugger calls corresponding debuggee.VM methods to get
* needed data and to perform checks.
* In case of error the test produces the return value 97 and
* a corresponding error message(s).
* Otherwise, the test is passed and produces
* the return value 95 and no message.
* COMMENTS:
* The test suite contains
* the precompiled class file isobsolete002b.klass .
* Its source file is isobsolete002b.ja .
* The test was modified die to fix of the bug:
* 4514956 Method.isObsolete() returns false for redefined method
* Test was updated according to rfe:
* 4691123 TEST: some jdi tests contain precompiled .klass files undes SCCS.
* isobsolete002b.ja was moved into newclass directory and renamed
* to isobsolete002b.java.
* The precompiled class file is created during test base build process.
* Test fixed according to test bug:
* 4798088 TEST_BUG: setBreakpoint() method depends of the locations implementation
* - using standard Debugee.makeBreakpoint() method
* - adjusting source line numbers used for setting breakpoint
*
* @library /vmTestbase
* /test/lib
* @build nsk.jdi.Method.isObsolete.isobsolete002
* nsk.jdi.Method.isObsolete.isobsolete002a
*
* @comment compile newclassXX to bin/newclassXX
* with full debug info
* @run driver nsk.share.ExtraClassesBuilder
* -g:lines,source,vars
* newclass
*
* @run main/othervm
* nsk.jdi.Method.isObsolete.isobsolete002
* ./bin
* -verbose
* -arch=${os.family}-${os.simpleArch}
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
*/
| 3,956
|
Java
|
.java
|
itsaky/openjdk-21-android
| 9
| 5
| 0
|
2023-09-16T11:36:19Z
|
2024-02-11T04:34:15Z
|
6f620824e21b8c4b1d24af052d4a1d4c255f0e02f1155e30779e6589fb10c58b
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
54,
61,
49,
244,
55,
53,
55,
53,
49,
17980,
480,
52,
290,
2840,
25094,
51,
3381,
4760,
5225,
51,
222,
338,
4103,
2387,
23740,
1895,
35234,
8995,
2387,
11988,
1895,
8968,
10961,
30441,
51,
222,
338,
222,
338,
1369,
1361,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
55,
1773,
49,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
1361,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
222,
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
499,
222,
1127,
222,
338,
496,
881,
222,
338,
222,
338,
496,
1386,
12829,
664,
8558,
2128,
1460,
329,
2009,
52,
111,
1351,
52,
1885,
52,
316,
48149,
52,
316,
926,
23017,
53,
53,
55,
51,
222,
338,
8558,
2128,
1460,
16418,
63,
447,
11558,
1830,
49,
614,
1351,
49,
334,
1252,
98,
222,
338,
8558,
2128,
1460,
22365,
63,
222,
338,
23339,
63,
222,
338,
281,
906,
913,
456,
341,
4753,
451,
619,
1319,
451,
341,
847,
222,
338,
281,
5409,
51,
222,
338,
281,
906,
913,
9378,
992,
708,
331,
1074,
451,
341,
1431,
222,
338,
281,
785,
51,
9886,
51,
111,
1351,
51,
1885,
51,
316,
48149,
365,
222,
338,
281,
940,
6844,
642,
2840,
1394,
63,
222,
338,
281,
581,
1922,
458,
48149,
365,
222,
338,
665,
22032,
434,
477,
1431,
458,
40707,
51,
222,
338,
665,
3777,
63,
878,
434,
477,
1431,
1421,
2602,
14180,
829,
222,
338,
3403,
331,
3000,
50,
106,
11144,
1431,
1493,
222,
338,
3403,
13675,
7105,
51,
287,
1252,
8038,
45,
1874,
51,
1058,
51,
1225,
566,
222,
338,
281,
906,
913,
9378,
708,
458,
48149,
365,
3235,
878,
434,
222,
338,
281,
341,
3376,
451,
341,
10116,
1431,
1421,
2602,
12114,
14180,
51,
222,
338,
281,
906,
913,
4864,
641,
11629,
63,
222,
338,
281,
906,
25856,
3477,
449,
329,
2009,
51,
111,
1351,
51,
1885,
51,
316,
48149,
51,
316,
926,
23017,
53,
53,
55,
64,
222,
338,
281,
341,
4598,
41067,
3477,
449,
329,
2009,
51,
111,
1351,
51,
1885,
51,
316,
48149,
51,
316,
926,
23017,
53,
53,
55,
102,
51,
222,
338,
281,
9659,
329,
2009,
51,
111,
1351,
51,
6085,
6052,
49,
222,
338,
281,
341,
25856,
8572,
341,
4598,
41067,
3991,
563,
4691,
4957,
5064,
49,
222,
338,
281,
9602,
341,
1319,
4598,
41067,
51,
5064,
49,
480,
38587,
456,
8558,
2148,
1167,
51,
222,
338,
281,
2791,
286,
7882,
341,
4598,
41067,
8558,
7326,
49,
222,
338,
281,
341,
25856,
7410,
8475,
4598,
41067,
51,
5064,
4457,
391,
640,
222,
338,
281,
5366,
727,
480,
391,
4464,
9378,
51,
222,
338,
281,
719,
1152,
451,
1067,
341,
913,
20700,
341,
461,
804,
244,
62,
60,
480,
222,
338,
281,
331,
8475,
1067,
1492,
45,
120,
566,
222,
338,
281,
12783,
49,
341,
913,
458,
5424,
480,
20700,
222,
338,
281,
341,
461,
804,
244,
62,
58,
480,
1307,
1492,
51,
222,
338,
13544,
88,
63,
222,
338,
281,
906,
913,
13270,
4326,
222,
338,
281,
341,
1426,
19255,
462,
822,
458,
926,
23017,
53,
53,
55,
103,
51,
23303,
657,
222,
338,
281,
26973,
1932,
822,
458,
458,
926,
23017,
53,
53,
55,
103,
51,
4615,
657,
222,
338,
281,
906,
913,
1616,
8851,
4044,
391,
2435,
451,
341,
4845,
63,
222,
338,
665,
57,
58,
54,
57,
62,
58,
59,
5409,
51,
316,
48149,
365,
3235,
920,
456,
334,
2202,
1431,
222,
338,
281,
2128,
1616,
4478,
9299,
391,
559,
1247,
63,
222,
338,
665,
57,
59,
62,
54,
54,
55,
56,
5904,
63,
1649,
614,
1351,
3326,
4814,
1426,
19255,
657,
23303,
2293,
725,
7233,
377,
2218,
88,
51,
222,
338,
281,
458,
926,
23017,
53,
53,
55,
103,
51,
4615,
1616,
13643,
2012,
556,
842,
3378,
480,
22995,
222,
338,
281,
391,
458,
926,
23017,
53,
53,
55,
103,
51,
1874,
51,
222,
338,
281,
906,
1426,
19255,
462,
822,
458,
3290,
5945,
913,
1712,
1984,
2183,
51,
222,
338,
281,
2128,
5264,
9299,
391,
913,
4845,
63,
222,
338,
665,
57,
60,
62,
61,
53,
61,
61,
5904,
100,
2522,
63,
758,
41890,
365,
1431,
12448,
451,
341,
14357,
4753,
222,
338,
281,
449,
1493,
6244,
1531,
716,
41067,
51,
2696,
41890,
365,
1431,
222,
338,
281,
449,
10907,
318,
1932,
1646,
7560,
1674,
456,
5767,
31521,
222,
338,
222,
338,
496,
5261,
536,
3166,
1024,
1460,
222,
338,
2052,
536,
881,
52,
1379,
222,
338,
496,
1848,
329,
2009,
51,
111,
1351,
51,
1885,
51,
316,
48149,
51,
316,
926,
23017,
53,
53,
55,
222,
338,
370,
329,
2009,
51,
111,
1351,
51,
1885,
51,
316,
48149,
51,
316,
926,
23017,
53,
53,
55,
102,
222,
338,
222,
338,
496,
3666,
8340,
556,
842,
2931,
391,
7412,
52,
909,
842,
2931,
222,
338,
2052,
642,
3559,
4598,
3116,
222,
338,
496,
1967,
5419,
329,
2009,
51,
6085,
51,
9124,
8038,
1812,
222,
338,
665,
449,
108,
63,
4466,
49,
1876,
49,
6896,
222,
338,
665,
556,
842,
222,
338,
222,
338
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
499,
222,
1127,
222,
338,
496,
881,
222,
338,
222,
338,
496,
1386,
12829,
664,
8558,
2128,
1460,
329,
2009,
52,
111,
1351,
52,
1885,
52,
316,
48149,
52,
316,
926,
23017,
53,
53,
55,
51,
222,
338,
8558,
2128,
1460,
16418,
63,
447,
11558,
1830,
49,
614,
1351,
49,
334,
1252,
98,
222,
338,
8558,
2128,
1460,
22365,
63,
222,
338,
23339,
63,
222,
338,
281,
906,
913,
456,
341,
4753,
451,
619,
1319,
451,
341,
847,
222,
338,
281,
5409,
51,
222,
338,
281,
906,
913,
9378,
992,
708,
331,
1074,
451,
341,
1431,
222,
338,
281,
785,
51,
9886,
51,
111,
1351,
51,
1885,
51,
316,
48149,
365,
222,
338,
281,
940,
6844,
642,
2840,
1394,
63,
222,
338,
281,
581,
1922,
458,
48149,
365,
222,
338,
665,
22032,
434,
477,
1431,
458,
40707,
51,
222,
338,
665,
3777,
63,
878,
434,
477,
1431,
1421,
2602,
14180,
829,
222,
338,
3403,
331,
3000,
50,
106,
11144,
1431,
1493,
222,
338,
3403,
13675,
7105,
51,
287,
1252,
8038,
45,
1874,
51,
1058,
51,
1225,
566,
222,
338,
281,
906,
913,
9378,
708,
458,
48149,
365,
3235,
878,
434,
222,
338,
281,
341,
3376,
451,
341,
10116,
1431,
1421,
2602,
12114,
14180,
51,
222,
338,
281,
906,
913,
4864,
641,
11629,
63,
222,
338,
281,
906,
25856,
3477,
449,
329,
2009,
51,
111,
1351,
51,
1885,
51,
316,
48149,
51,
316,
926,
23017,
53,
53,
55,
64,
222,
338,
281,
341,
4598,
41067,
3477,
449,
329,
2009,
51,
111,
1351,
51
] | 4,518,285,050,571,199,500
| true
| false
| false
| false
|
[
51,
111,
1351,
51,
1885,
51,
316,
48149,
365,
222,
338,
281,
940,
6844,
642,
2840,
1394,
63,
222,
338,
281,
581,
1922,
458,
48149,
365,
222,
338,
665,
22032,
434,
477,
1431,
458,
40707,
51,
222,
338,
665,
3777,
63,
878,
434,
477,
1431,
1421,
2602,
14180,
829,
222,
338,
3403,
331,
3000,
50,
106,
11144,
1431,
1493,
222,
338,
3403,
13675,
7105,
51,
287,
1252,
8038,
45,
1874,
51,
1058,
51,
1225,
566,
222,
338,
281,
906,
913,
9378,
708,
458,
48149,
365,
3235,
878,
434,
222,
338,
281,
341,
3376,
451,
341,
10116,
1431,
1421,
2602,
12114
] | -5,549,943,696,764,108,000
| true
|
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
*
* @summary converted from VM Testbase nsk/jdi/Method/isObsolete/isobsolete002.
* VM Testbase keywords: [jpda, jdi, redefine]
* VM Testbase readme:
* DESCRIPTION:
* The test for the implementation of an object of the type
* Method.
* The test checks up that a result of the method
* com.sun.jdi.Method.isObsolete()
* complies with its spec:
* public boolean isObsolete()
* Determine if this method is obsolete.
* Returns: true if this method has been replaced by
* a non-equivalent method using
* VirtualMachine.redefineClasses(java.util.Map).
* The test checks that isObsolete() returns true if
* the body of the tested method has been fully
|
/*
* @test
*
* @summary converted from VM Testbase nsk/jdi/Method/isObsolete/isobsolete002.
* VM Testbase keywords: [jpda, jdi, redefine]
* VM Testbase readme:
* DESCRIPTION:
* The test for the implementation of an object of the type
* Method.
* The test checks up that a result of the method
* com.sun.jdi.Method.isObsolete()
* complies with its spec:
* public boolean isObsolete()
* Determine if this method is obsolete.
* Returns: true if this method has been replaced by
* a non-equivalent method using
* VirtualMachine.redefineClasses(java.util.Map).
* The test checks that isObsolete() returns true if
* the body of the tested method has been fully
|
]
* VM Testbase readme:
* DESCRIPTION:
* The test for the implementation of an object of the type
* Method.
* The test checks up that a result of the method
* com.sun.jdi.Method.isObsolete()
* complies with its spec:
* public boolean isObsolete()
* Determine if this method is obsolete.
* Returns: true if this method has been replaced by
* a non-equivalent method using
* VirtualMachine.redefineClasses(java.util.Map).
* The test checks that isObsolete() returns true if
* the body of the tested method has been fully
|
.jdi.Method.isObsolete()
* complies with its spec:
* public boolean isObsolete()
* Determine if this method is obsolete.
* Returns: true if this method has been replaced by
* a non-equivalent method using
* VirtualMachine.redefineClasses(java.util.Map).
* The test checks that isObsolete() returns true if
* the body of the tested method has been fully
|
replaced.
* The test works as follows:
* The debugger program - nsk.jdi.Method.isObsolete.isobsolete002;
* the debuggee program - nsk.jdi.
|
ValidationResultController.java
|
/FileExtraction/Java_unseen/logicalclocks_hopsworks/hopsworks-common/src/main/java/io/hops/hopsworks/common/featurestore/datavalidationv2/results/ValidationResultController.java
|
/*
* This file is part of Hopsworks
* Copyright (C) 2022, Hopsworks AB. All rights reserved
*
* Hopsworks is free software: you can redistribute it and/or modify it under the terms of
* the GNU Affero General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* Hopsworks is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
package io.hops.hopsworks.common.featurestore.datavalidationv2.results;
import io.hops.hopsworks.common.featurestore.FeaturestoreFacade;
import io.hops.hopsworks.common.featurestore.datavalidationv2.expectations.ExpectationFacade;
import io.hops.hopsworks.exceptions.FeaturestoreException;
import io.hops.hopsworks.persistence.entity.featurestore.featuregroup.datavalidationv2.Expectation;
import io.hops.hopsworks.persistence.entity.featurestore.featuregroup.datavalidationv2.ValidationReport;
import io.hops.hopsworks.persistence.entity.featurestore.featuregroup.datavalidationv2.ValidationResult;
import io.hops.hopsworks.persistence.entity.util.AbstractFacade;
import io.hops.hopsworks.restutils.RESTCodes;
import org.json.JSONException;
import org.json.JSONObject;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_META;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_RESULT_FIELD;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.UNEXPECTED_COUNT_KEY;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.UNEXPECTED_PERCENT_KEY;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.PARTIAL_UNEXPECTED_LIST_KEY;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.UNEXPECTED_PERCENT_NONMISSING_KEY;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.OBSERVED_VALUE_KEY;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.EXCEPTION_MESSAGE_KEY;
@Stateless
@TransactionAttribute(TransactionAttributeType.NEVER)
public class ValidationResultController {
private static final Logger LOGGER = Logger.getLogger(ValidationResultController.class.getName());
@EJB
private ValidationResultFacade validationResultFacade;
@EJB
private ExpectationFacade expectationFacade;
@EJB
private FeaturestoreFacade featurestoreFacade;
public AbstractFacade.CollectionInfo<ValidationResult> getAllValidationResultByExpectationId (
Integer offset, Integer limit, Set<? extends AbstractFacade.SortBy> sorts,
Set<? extends AbstractFacade.FilterBy> filters, Integer expectationId) {
Optional<Expectation> optExpectation = expectationFacade.findById(expectationId);
Expectation expectation;
if (optExpectation.isPresent()) {
expectation = optExpectation.get();
} else {
// fake it, we just need the id
expectation = new Expectation();
expectation.setId(expectationId);
}
return validationResultFacade.findByExpectation(offset, limit, sorts, filters, expectation);
}
public ValidationResult convertResultDTOToPersistent(ValidationReport report, ValidationResultDTO dto)
throws FeaturestoreException {
verifyValidationResultDTOFields(dto);
ValidationResult result = new ValidationResult();
result.setMeta(dto.getMeta());
result.setSuccess(dto.getSuccess());
result.setValidationReport(report);
result.setIngestionResult(report.getIngestionResult());
result.setValidationTime(report.getValidationTime());
// We need:
// - Get the expectation id from the meta field in the expectation_config field.
// - Shorten result field if too long
// - Shorten exceptionInfo field if too long
// - Shorten expectationConfig field if too long
result.setExpectation(parseExpectationIdFromResultDTO(dto.getExpectationConfig()));
if (dto.getResult().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_RESULT_FIELD) {
result.setResult(validationResultShortenResultField(dto.getResult()));
} else {
result.setResult(dto.getResult());
}
if (dto.getExceptionInfo().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO) {
result.setExceptionInfo(validationResultShortenExceptionInfoField(dto.getExceptionInfo()));
} else {
result.setExceptionInfo(dto.getExceptionInfo());
}
if (dto.getExpectationConfig().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG) {
result.setExpectationConfig(
validationResultShortenExpectationConfigField(
dto.getExpectationConfig(),
result.getExpectation().getId()
)
);
} else {
result.setExpectationConfig(dto.getExpectationConfig());
}
return result;
}
private Expectation parseExpectationIdFromResultDTO(String dtoExpectationConfig) throws FeaturestoreException {
// 1. Parse config, 2. Look for expectation_id, 3. findExpectationById, 4. setExpectation, 5. Celebrate!
JSONObject expectationConfig;
Integer expectationId;
try {
expectationConfig = new JSONObject(dtoExpectationConfig);
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result expectation config field %s is not a valid json.",
dtoExpectationConfig),
e.getMessage()
);
}
JSONObject meta;
try {
meta = expectationConfig.getJSONObject("meta");
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result expectation config meta field %s is not a valid json.",
dtoExpectationConfig),
e.getMessage()
);
}
try {
expectationId = meta.getInt("expectationId");
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.KEY_NOT_FOUND_OR_INVALID_VALUE_TYPE_IN_JSON_OBJECT,
Level.SEVERE,
String.format("Validation result expectation config meta %s does not contain expectationId key or the " +
"associated value does not convert to an integer", meta),
e.getMessage());
}
Optional<Expectation> expectation = expectationFacade.findById(expectationId);
if (!expectation.isPresent()) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.EXPECTATION_NOT_FOUND, Level.WARNING);
}
return expectation.get();
}
public String validationResultShortenResultField(String result) {
JSONObject resultJson;
try {
resultJson = new JSONObject(result);
} catch (JSONException e) {
LOGGER.warning(String.format(
"Parsing result field threw JSONException that should have been handled when verifying input.%n%s%n%s",
e.getMessage(), Arrays.toString(e.getStackTrace())));
resultJson = new JSONObject();
}
JSONObject shortResultJson = new JSONObject();
String userMessage =
"Result field exceeded max available space in SQL table, " +
"download validation report file to access the complete result.";
shortResultJson.put("user_message", userMessage);
if (resultJson.has(OBSERVED_VALUE_KEY)) {
shortResultJson.put(OBSERVED_VALUE_KEY, resultJson.getString(OBSERVED_VALUE_KEY));
if (shortResultJson.toString().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_RESULT_FIELD) {
shortResultJson.remove(OBSERVED_VALUE_KEY);
return shortResultJson.toString();
}
}
if (resultJson.has(UNEXPECTED_COUNT_KEY) && resultJson.has(PARTIAL_UNEXPECTED_LIST_KEY)
&& resultJson.has(UNEXPECTED_PERCENT_KEY) && resultJson.has(UNEXPECTED_PERCENT_NONMISSING_KEY)) {
shortResultJson.put(UNEXPECTED_COUNT_KEY, resultJson.getInt(UNEXPECTED_COUNT_KEY));
shortResultJson.put(UNEXPECTED_PERCENT_KEY, resultJson.getFloat(UNEXPECTED_PERCENT_KEY));
shortResultJson.put(UNEXPECTED_PERCENT_NONMISSING_KEY, resultJson.getFloat(UNEXPECTED_PERCENT_NONMISSING_KEY));
shortResultJson.put(PARTIAL_UNEXPECTED_LIST_KEY, resultJson.getJSONArray(PARTIAL_UNEXPECTED_LIST_KEY));
if (shortResultJson.toString().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_RESULT_FIELD) {
shortResultJson.remove(PARTIAL_UNEXPECTED_LIST_KEY);
return shortResultJson.toString();
}
}
return shortResultJson.toString();
}
public String validationResultShortenExceptionInfoField(String exceptionInfo) {
JSONObject exceptionInfoJson;
try {
exceptionInfoJson = new JSONObject(exceptionInfo);
} catch (JSONException e) {
LOGGER.warning(String.format(
"Parsing exceptionInfo field threw JSONException that should have been handled when verifying input.%n%s%n%s",
e.getMessage(), Arrays.toString(e.getStackTrace())));
exceptionInfoJson = new JSONObject();
}
JSONObject shortExceptionInfoJson = new JSONObject();
String userMessage =
"exception_info field exceeded max available space in SQL table, " +
"download validation report file to access the complete info.";
shortExceptionInfoJson.put("user_message", userMessage);
shortExceptionInfoJson.put("raised_exception", exceptionInfoJson.getBoolean("raised_exception"));
shortExceptionInfoJson.put(EXCEPTION_MESSAGE_KEY, exceptionInfoJson.getString(EXCEPTION_MESSAGE_KEY));
if (shortExceptionInfoJson.toString().length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO) {
shortExceptionInfoJson.remove(EXCEPTION_MESSAGE_KEY);
return shortExceptionInfoJson.toString();
}
// exception_traceback cannot fit otherwise we would not be in this function
return shortExceptionInfoJson.toString();
}
public String validationResultShortenExpectationConfigField(String expectationConfig, Integer expectationId) {
JSONObject expectationConfigJson;
try {
expectationConfigJson = new JSONObject(expectationConfig);
} catch (JSONException e) {
LOGGER.warning(String.format(
"Parsing expectationConfig field threw JSONException that should have " +
" been handled when verifying input.\n%s\n%s",
e.getMessage(), Arrays.toString(e.getStackTrace())));
expectationConfigJson = new JSONObject();
}
// Create a shorten version with three same fields: expectation_type, kwargs, meta
JSONObject shortexpectationConfigJson = new JSONObject();
JSONObject configMeta = new JSONObject();
// Store user message and expectationId in meta field.
String userMessage = "expectation_config field exceeded max available space in SQL table, " +
"download validation report file to access the complete info. ";
configMeta.put("userMessage", userMessage);
configMeta.put("expectationId", expectationId);
shortexpectationConfigJson.put("meta", configMeta);
// Expectation type takes limited space
shortexpectationConfigJson.put("expectation_type", expectationConfigJson.getString("expectation_type"));
shortexpectationConfigJson.put("kwargs", new JSONObject());
return shortexpectationConfigJson.toString();
}
public JSONObject convertValidationResultDTOToJson(ValidationResultDTO resultDTO) throws FeaturestoreException {
JSONObject resultJSON = new JSONObject();
try {
resultJSON.put("success", resultDTO.getSuccess());
resultJSON.put("exception_info", new JSONObject(resultDTO.getExceptionInfo()));
resultJSON.put("result", new JSONObject(resultDTO.getResult()));
resultJSON.put("meta", new JSONObject(resultDTO.getMeta()));
resultJSON.put("expectation_config", new JSONObject(resultDTO.getExpectationConfig()));
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.VALIDATION_RESULT_IS_NOT_VALID_JSON, Level.WARNING, e.getMessage());
}
return resultJSON;
}
////////////////////////////////////////
//// Input Verification for Validation Result
///////////////////////////////////////
public void verifyValidationResultDTOFields(ValidationResultDTO dto) throws FeaturestoreException {
verifyValidationResultMeta(dto.getMeta());
verifyValidationResultExpectationConfig(dto.getExpectationConfig());
// override with default value if null
dto.setResult(verifyValidationResultResult(dto.getResult()));
dto.setExceptionInfo(verifyValidationResultExceptionInfo(dto.getExceptionInfo()));
}
public void verifyValidationResultMeta(String meta) throws FeaturestoreException {
if (meta == null) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_NULLABLE,
Level.SEVERE,
"Validation result meta field cannot be null. Pass an empty stringified JSON."
);
}
if (meta.length() > MAX_CHARACTERS_IN_VALIDATION_RESULT_META) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_EXCEEDS_MAX_ALLOWED_CHARACTER,
Level.SEVERE,
String.format("Validation result meta field %s exceeds the max allowed character length %d.",
meta, MAX_CHARACTERS_IN_VALIDATION_RESULT_META)
);
}
try {
new JSONObject(meta);
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result meta field %s is not a valid json.", meta),
e.getMessage()
);
}
}
public void verifyValidationResultExpectationConfig(String expectationConfig) throws FeaturestoreException {
if (expectationConfig == null) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_NULLABLE,
Level.SEVERE,
"Validation result expectation config field cannot be null. Pass an empty stringified JSON."
);
}
// Long expectationConfig are shortened and need not throw an error
try {
new JSONObject(expectationConfig);
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result expectation config field %s is not a valid json.", expectationConfig),
e.getMessage()
);
}
}
public String verifyValidationResultExceptionInfo(String exceptionInfo) throws FeaturestoreException {
if (exceptionInfo == null) {
return "{}";
}
try {
new JSONObject(exceptionInfo);
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result exception info field %s is not a valid json.", exceptionInfo),
e.getMessage()
);
}
return exceptionInfo;
}
public String verifyValidationResultResult(String result) throws FeaturestoreException {
// For result_format = {"result_format": "BOOLEAN_ONLY"}, result field is null. Turned into empty JSON.
if (result == null) {
return "{}";
}
// If not null it must be valid json object
try {
new JSONObject(result);
} catch (JSONException e) {
throw new FeaturestoreException(
RESTCodes.FeaturestoreErrorCode.INPUT_FIELD_IS_NOT_VALID_JSON,
Level.SEVERE,
String.format("Validation result result field %s is not a valid json.", result),
e.getMessage()
);
}
return result;
}
}
| 16,626
|
Java
|
.java
|
logicalclocks/hopsworks
| 1,087
| 142
| 13
|
2018-07-26T08:13:34Z
|
2024-05-07T18:06:00Z
|
b9e7978015fbe7c6a6de80483ba5ed72954d6cc234f0126c3487d6c94886f8cc
|
[] |
[
1127,
222,
338,
1369,
822,
458,
1760,
451,
696,
4178,
14108,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
55,
55,
49,
696,
4178,
14108,
20660,
51,
3381,
4760,
5225,
222,
338,
222,
338,
696,
4178,
14108,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
222,
338,
341,
6994,
30994,
6153,
5062,
1196,
641,
9582,
829,
341,
7834,
3870,
7120,
49,
222,
338,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
696,
4178,
14108,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
222,
338,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
8114,
4800,
418,
7848,
222,
338,
7763,
51,
244,
2819,
341,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
7979,
642,
477,
3477,
51,
222,
338,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
624,
6523,
123,
55,
51,
4333,
64,
222,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
19572,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
624,
6523,
123,
55,
51,
2373,
1014,
51,
41285,
19572,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
11453,
51,
4249,
2173,
1002,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
10782,
51,
2244,
51,
3317,
2173,
51,
3317,
1382,
51,
624,
6523,
123,
55,
51,
41285,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
10782,
51,
2244,
51,
3317,
2173,
51,
3317,
1382,
51,
624,
6523,
123,
55,
51,
6329,
4158,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
10782,
51,
2244,
51,
3317,
2173,
51,
3317,
1382,
51,
624,
6523,
123,
55,
51,
6329,
1413,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
10782,
51,
2244,
51,
1058,
51,
5597,
19572,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
4756,
2324,
51,
13402,
11971,
64,
222,
485,
1105,
51,
1279,
51,
40458,
64,
222,
485,
1105,
51,
1279,
51,
15543,
64,
222,
222,
485,
3698,
51,
106,
11663,
51,
74,
18600,
64,
222,
485,
3698,
51,
106,
11663,
51,
1095,
2290,
64,
222,
485,
3698,
51,
106,
11663,
51,
4331,
2230,
64,
222,
485,
3698,
51,
106,
11663,
51,
4331,
45449,
64,
222,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
7575,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
7506,
51,
2671,
64,
222,
485,
1401,
51,
1058,
51,
7506,
51,
3716,
64,
222,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
19077,
100,
1608,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
14881,
2909,
100,
6196,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
14246,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
6394,
100,
6457,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
1430,
30314,
100,
7516,
100,
3319,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
1430,
30314,
100,
40845,
100,
3319,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
4200,
47042,
100,
1430,
30314,
100,
4625,
100,
3319,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
1430,
30314,
100,
40845,
100,
10012,
26599,
100,
3319,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
4409,
1427,
16769,
100,
5986,
100,
3319,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
19077,
100,
9570,
100,
3319,
64,
222,
222,
69,
1095,
2290,
222,
69,
4331,
2230,
45,
4331,
45449,
51,
3585,
1986,
46,
222,
942,
462,
11348,
1413,
1934,
320,
353,
964,
924,
1175,
7145,
15794,
299,
7145,
51,
10588,
45,
6329,
1413,
1934,
51,
842,
51,
5175,
1052,
736,
496,
74,
18600,
353,
964,
11348,
1413,
19572,
6929,
1413,
19572,
64,
353,
496,
74,
18600,
353,
964,
9181,
387,
19572,
34870,
19572,
64,
353,
496,
74,
18600,
353,
964,
8608,
2173,
19572,
2817,
2173,
19572,
64,
736,
581,
7406,
19572,
51,
2272,
1139,
65,
6329,
1413,
67,
16721,
6329,
1413,
1103,
41285,
625,
327,
416,
4418,
3413,
49,
4418,
2741,
49,
1776,
1907,
2041,
7406,
19572,
51,
5217,
1103,
67,
43031,
49,
416,
1776,
1907,
2041,
7406,
19572,
51,
2365,
1103,
67,
10637,
49,
4418,
34870,
625,
46,
320,
303,
5663,
65,
41285,
67,
2948,
41285,
299,
34870,
19572,
51,
23673,
45,
2373,
387,
625,
312,
303,
9181,
387,
34870,
64,
465,
434,
327,
2238,
41285,
51,
28200,
1177,
320,
416,
34870,
299,
2948,
41285,
51,
390,
492,
303,
339,
832,
320,
416,
453,
11174,
580,
49,
1019,
2277,
1868,
341,
828,
416,
34870,
299,
556,
9181,
387,
492,
416,
34870,
51,
21603,
45,
2373,
387,
625,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
1,
1,
1,
1
]
] | 1,024
|
[
51,
2244,
51,
3317,
2173,
51,
3317,
1382,
51,
624,
6523,
123,
55,
51,
6329,
1413,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
10782,
51,
2244,
51,
1058,
51,
5597,
19572,
64,
222,
485,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
4756,
2324,
51,
13402,
11971,
64,
222,
485,
1105,
51,
1279,
51,
40458,
64,
222,
485,
1105,
51,
1279,
51,
15543,
64,
222,
222,
485,
3698,
51,
106,
11663,
51,
74,
18600,
64,
222,
485,
3698,
51,
106,
11663,
51,
1095,
2290,
64,
222,
485,
3698,
51,
106,
11663,
51,
4331,
2230,
64,
222,
485,
3698,
51,
106,
11663,
51,
4331,
45449,
64,
222,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
7575,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
7506,
51,
2671,
64,
222,
485,
1401,
51,
1058,
51,
7506,
51,
3716,
64,
222,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
19077,
100,
1608,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
14881,
2909,
100,
6196,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
14246,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100
] | -3,045,323,009,132,953,600
| true
| false
| false
| false
|
[
1058,
51,
7506,
51,
3716,
64,
222,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
19077,
100,
1608,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249,
2173,
5238,
51,
3470,
100,
4935,
3833,
9146,
100,
540,
100,
45822,
100,
6394,
100,
14881,
2909,
100,
6196,
64,
222,
485,
924,
3377,
51,
109,
4178,
51,
109,
4178,
14108,
51,
2297,
51,
3317,
2173,
51,
4249
] | 2,685,642,566,676,312,600
| true
|
.entity.featurestore.featuregroup.datavalidationv2.ValidationResult;
import io.hops.hopsworks.persistence.entity.util.AbstractFacade;
import io.hops.hopsworks.restutils.RESTCodes;
import org.json.JSONException;
import org.json.JSONObject;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG;
import static io.hops.hopsworks.common.featurestore.Feature
|
.RESTCodes;
import org.json.JSONException;
import org.json.JSONObject;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG;
import static io.hops.hopsworks.common.featurestore.Feature
|
;
import javax.ejb.TransactionAttributeType;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG;
import static io.hops.hopsworks.common.featurestore.Feature
|
util.logging.Logger;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXCEPTION_INFO;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_EXPECTATION_CONFIG;
import static io.hops.hopsworks.common.featurestore.Feature
|
storeConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_META;
import static io.hops.hopsworks.common.featurestore.FeaturestoreConstants.MAX_CHARACTERS_IN_VALIDATION_RESULT_
|
GetPathUtils.java
|
/FileExtraction/Java_unseen/liyafe1997_CustoMIUIzerMod/app/src/main/java/org/strawing/customiuizermod/utils/GetPathUtils.java
|
package org.strawing.customiuizermod.utils;
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.provider.DocumentsContract;
import java.io.File;
import java.util.List;
public class GetPathUtils {
private static final String PATH_TREE = "tree";
private static final String PRIMARY_TYPE = "primary";
private static final String RAW_TYPE = "raw";
// public static String getFilePathFromUri(final Context context, final Uri uri) {
//
// // DocumentProvider
// if (DocumentsContract.isDocumentUri(context, uri)) {
// // ExternalStorageProvider
// if (isExternalStorageDocument(uri)) {
// final String docId = DocumentsContract.getDocumentId(uri);
// //Timber.d("docId -> %s", docId);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
// return Environment.getExternalStorageDirectory() + "/" + split[1];
// } else {
// // TODO handle non-primary volumes
// StringBuilder path = new StringBuilder();
// String[] pathSegment = docId.split(":");
// return path.append(getRemovableStorageRootPath(context, pathSegment[0])).append(File.separator).append(pathSegment[1]).toString();
// }
// } else if (isDownloadsDocument(uri)) { // DownloadsProvider
//
// final String id = DocumentsContract.getDocumentId(uri);
//
// if (id.contains("raw:")) {
// return id.substring(id.indexOf(File.separator));
// } else {
// Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.parseLong(id));
// return getDataColumn(context, contentUri, null, null);
// }
// } else if (isMediaDocument(uri)) { // MediaProvider
// final String docId = DocumentsContract.getDocumentId(uri);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// Uri contentUri = null;
// if ("image".equals(type)) {
// contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
// } else if ("video".equals(type)) {
// contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
// } else if ("audio".equals(type)) {
// contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
// }
//
// final String selection = "_id=?";
// final String[] selectionArgs = new String[]{
// split[1]
// };
//
// return getDataColumn(context, contentUri, selection, selectionArgs);
// }
// } else if ("content".equalsIgnoreCase(uri.getScheme())) { // MediaStore (and general)
// return getDataColumn(context, uri, null, null);
// } else if ("file".equalsIgnoreCase(uri.getScheme())) { // File
// return uri.getPath();
// }
//
// return null;
// }
//
// /**
// * Get the value of the data column for this Uri. This is useful for
// * MediaStore Uris, and other file-based ContentProviders.
// *
// * @param context The context.
// * @param uri The Uri to query.
// * @param selection (Optional) Filter used in the query.
// * @param selectionArgs (Optional) Selection arguments used in the query.
// * @return The value of the _data column, which is typically a file path.
// */
// private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
//
// Cursor cursor = null;
// final String column = MediaStore.MediaColumns.DATA;
// final String[] projection = {column};
// try {
// cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
// null);
// if (cursor != null && cursor.moveToFirst()) {
// final int column_index = cursor.getColumnIndexOrThrow(column);
// return cursor.getString(column_index);
// }
// } finally {
// if (cursor != null)
// cursor.close();
// }
//
// return null;
// }
//
// /**
// * @param uri The Uri to check.
// * @return Whether the Uri authority is ExternalStorageProvider.
// */
// private static boolean isExternalStorageDocument(Uri uri) {
// return "com.android.externalstorage.documents".equals(uri.getAuthority());
// }
//
// /**
// * @param uri The Uri to check.
// * @return Whether the Uri authority is DownloadsProvider.
// */
// private static boolean isDownloadsDocument(Uri uri) {
// return "com.android.providers.downloads.documents".equals(uri.getAuthority());
// }
//
// /**
// * @param uri The Uri to check.
// * @return Whether the Uri authority is MediaProvider.
// */
// private static boolean isMediaDocument(Uri uri) {
// return "com.android.providers.media.documents".equals(uri.getAuthority());
// }
/**
* @param uri DocumentsUI URI
* @return file path of Uri
*/
public static String getDirectoryPathFromUri(Context context, Uri uri) {
if (uri == null) return null;
if ("file".equals(uri.getScheme())) return uri.getPath();
if (isTreeUri(uri)) {
String treeId = getTreeDocumentId(uri);
if (treeId == null) return null;
String[] paths = treeId.split(":");
String type = paths[0];
String subPath = paths.length == 2 ? paths[1] : "";
if (RAW_TYPE.equalsIgnoreCase(type)) {
return treeId.substring(treeId.indexOf(File.separator));
} else if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + File.separator + subPath;
} else {
StringBuilder path = new StringBuilder();
String[] pathSegment = treeId.split(":");
if (pathSegment.length == 1) {
path.append(getRemovableStorageRootPath(context, paths[0]));
} else {
String rootPath = getRemovableStorageRootPath(context, paths[0]);
path.append(rootPath).append(File.separator).append(pathSegment[1]);
}
return path.toString();
}
}
return null;
}
private static String getRemovableStorageRootPath(Context context, String storageId) {
StringBuilder rootPath = new StringBuilder();
File[] externalFilesDirs = context.getExternalFilesDirs(null);
for (File fileDir : externalFilesDirs) {
if (fileDir.getPath().contains(storageId)) {
String[] pathSegment = fileDir.getPath().split(File.separator);
for (String segment : pathSegment) {
if (segment.equals(storageId)) {
rootPath.append(storageId);
break;
}
rootPath.append(segment).append(File.separator);
}
//rootPath.append(fileDir.getPath().split("/Android")[0]); // faster
break;
}
}
return rootPath.toString();
}
//https://github.com/rcketscientist/DocumentActivity/blob/master/library/src/main/java/com/anthonymandra/framework/DocumentUtil.java#L56
/**
* Extract the via {@link DocumentsContract.Document#COLUMN_DOCUMENT_ID} from the given URI.
* From {@link DocumentsContract} but return null instead of throw
*/
private static String getTreeDocumentId(Uri uri) {
final List<String> paths = uri.getPathSegments();
if (paths.size() >= 2 && PATH_TREE.equals(paths.get(0))) {
return paths.get(1);
}
return null;
}
private static boolean isTreeUri(Uri uri) {
final List<String> paths = uri.getPathSegments();
return (paths.size() == 2 && PATH_TREE.equals(paths.get(0)));
}
}
| 8,204
|
Java
|
.java
|
liyafe1997/CustoMIUIzerMod
| 72
| 5
| 38
|
2022-04-07T22:50:11Z
|
2023-06-19T16:38:00Z
|
68af638439e0740aca3cf9410d90d8b3f78fe626cabc3c1db22d457bf1ec6c5a
|
[] |
[
1337,
1105,
51,
484,
831,
318,
51,
3005,
20537,
2292,
1820,
51,
2324,
64,
222,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
1317,
51,
5729,
64,
222,
485,
2616,
51,
519,
51,
6342,
64,
222,
485,
2616,
51,
6390,
51,
11871,
6228,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
1408,
1233,
2769,
320,
465,
964,
924,
1175,
910,
13407,
100,
27813,
299,
332,
3266,
884,
303,
964,
924,
1175,
910,
11193,
100,
2333,
299,
332,
4472,
884,
303,
964,
924,
1175,
910,
44450,
100,
2333,
299,
332,
1312,
884,
222,
222,
325,
283,
581,
924,
910,
640,
9141,
1811,
5729,
45,
3242,
7063,
1637,
49,
1175,
14433,
8219,
46,
320,
222,
325,
222,
325,
370,
453,
6222,
2588,
222,
325,
370,
434,
327,
11871,
6228,
51,
316,
3112,
5729,
45,
1834,
49,
8219,
509,
320,
222,
325,
1485,
453,
16933,
3581,
2588,
222,
325,
1485,
434,
327,
316,
8392,
3581,
3112,
45,
3469,
509,
320,
222,
325,
2087,
1175,
910,
3714,
625,
299,
42869,
6228,
51,
35778,
625,
45,
3469,
312,
222,
325,
2087,
453,
22600,
709,
51,
105,
459,
1446,
625,
984,
925,
120,
411,
3714,
625,
312,
222,
325,
2087,
1175,
910,
1197,
6168,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
2087,
1175,
910,
847,
299,
6168,
96,
53,
988,
222,
325,
222,
325,
2087,
434,
327,
25842,
100,
2333,
51,
18993,
45,
700,
509,
320,
222,
325,
4714,
461,
10584,
51,
390,
8392,
3581,
4562,
365,
494,
13198,
494,
6168,
96,
54,
988,
222,
325,
2087,
339,
832,
320,
222,
325,
4714,
453,
4314,
2902,
3000,
50,
4472,
21980,
222,
325,
4714,
9705,
1536,
299,
556,
9705,
492,
222,
325,
4714,
910,
1197,
1536,
7719,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
4714,
461,
1536,
51,
1713,
45,
390,
25312,
463,
3581,
44178,
45,
1834,
49,
1536,
7719,
96,
53,
29418,
1713,
45,
991,
51,
12640,
566,
1713,
45,
1005,
7719,
96,
54,
8527,
3127,
492,
222,
325,
2087,
339,
222,
325,
1485,
339,
832,
434,
327,
316,
27467,
3112,
45,
3469,
509,
320,
244,
453,
12497,
120,
2588,
222,
325,
222,
325,
2087,
1175,
910,
828,
299,
42869,
6228,
51,
35778,
625,
45,
3469,
312,
222,
325,
222,
325,
2087,
434,
327,
333,
51,
4766,
459,
1312,
1941,
509,
320,
222,
325,
4714,
461,
828,
51,
8724,
45,
333,
51,
7149,
45,
991,
51,
12640,
894,
222,
325,
2087,
339,
832,
320,
222,
325,
4714,
14433,
1813,
5729,
299,
6261,
90,
10997,
51,
1814,
1306,
4640,
625,
45,
5729,
51,
2228,
459,
1304,
574,
14557,
52,
942,
100,
14557,
2132,
6374,
51,
2228,
3967,
45,
333,
894,
222,
325,
4714,
461,
22920,
2154,
45,
1834,
49,
1813,
5729,
49,
762,
49,
762,
312,
222,
325,
2087,
339,
222,
325,
1485,
339,
832,
434,
327,
316,
5003,
3112,
45,
3469,
509,
320,
244,
453,
9826,
2588,
222,
325,
2087,
1175,
910,
3714,
625,
299,
42869,
6228,
51,
35778,
625,
45,
3469,
312,
222,
325,
2087,
1175,
910,
1197,
6168,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
2087,
1175,
910,
847,
299,
6168,
96,
53,
988,
222,
325,
222,
325,
2087,
14433,
1813,
5729,
299,
762,
64,
222,
325,
2087,
434,
2903,
915,
2316,
3591,
45,
700,
509,
320,
222,
325,
4714,
1813,
5729,
299,
9826,
2796,
51,
9622,
51,
5003,
51,
14417,
100,
11841,
100,
6344,
64,
222,
325,
2087,
339,
832,
434,
2903,
5011,
2316,
3591,
45,
700,
509,
320,
222,
325,
4714,
1813,
5729,
299,
9826,
2796,
51,
6086,
51,
5003,
51,
14417,
100,
11841,
100,
6344,
64,
222,
325,
2087,
339,
832,
434,
2903,
7376,
2316,
3591,
45,
700,
509,
320,
222,
325,
4714,
1813,
5729,
299,
9826,
2796,
51,
6907,
51,
5003,
51,
14417,
100,
11841,
100,
6344,
64,
222,
325,
2087,
339,
222,
325,
222,
325,
2087,
1175,
910,
7818,
299,
7302,
333,
28061,
884,
222,
325,
2087,
1175,
910,
1197,
7818,
3097,
299,
556,
910,
14161,
222,
325,
6813,
6168,
96,
54,
98,
222,
325,
2087,
1487,
222,
325,
222,
325,
2087,
461,
22920,
2154,
45,
1834,
49,
1813,
5729,
49,
7818,
49,
7818,
3097,
312,
222,
325,
1485,
339,
222,
325,
370,
339,
832,
434,
2903,
1304,
2316,
18993,
45,
3469,
51,
390,
10204,
5183,
320,
453,
9826,
2796,
327,
382,
8108,
46,
222,
325,
1485,
461,
22920,
2154,
45,
1834,
49,
8219,
49,
762,
49,
762,
312,
222,
325,
370,
339,
832,
434,
2903,
781,
2316,
18993,
45,
3469,
51,
390,
10204,
5183,
320,
453,
2050,
222,
325,
1485,
461,
8219,
51,
17676,
492,
222,
325,
370,
339,
222,
325,
222,
325,
370,
461,
762,
64,
222,
325,
283,
339,
222,
325,
222,
325,
283,
1041,
222,
325,
281,
338,
1408,
341,
804,
451,
341,
727,
2656,
456,
477,
14433,
51,
1369,
458,
6386,
456,
222,
325,
281,
338,
9826,
2796,
650,
10997,
49,
480,
1623,
822,
50,
7893,
6261,
17146,
51,
222,
325,
281,
338,
222,
325,
281,
338,
496,
772,
1637,
981,
906,
1637,
51,
222,
325,
281,
338,
496,
772,
8219,
2281,
906,
14433,
391,
2487,
51,
222,
325,
281,
338,
496,
772,
7818,
281,
327,
7575,
46,
8301,
1674,
347,
341,
2487,
51,
222,
325,
281,
338,
496,
772,
7818,
3097,
327,
7575,
46,
19085,
4228,
1674,
347,
341,
2487,
51,
222,
325,
281,
338,
496,
620,
906,
804,
451,
341,
634,
624,
2656,
49,
1532,
458,
18258,
331,
822,
1536,
51,
222,
325,
281,
588,
222,
325,
283,
964,
924,
910,
22920,
2154,
45,
1237,
1637,
49,
14433,
8219,
49,
910,
7818,
49,
910,
1197,
7818,
3097,
46,
320,
222,
325,
222,
325,
370,
22697,
6226,
299,
762,
64,
222,
325,
370,
1175,
910,
2656,
299,
9826,
2796,
51,
5003,
7633,
51,
4629,
64,
222,
325,
370,
1175,
910,
1197,
15477,
299,
320,
2628,
1274,
222,
325,
370,
1614,
320,
222,
325,
1485,
6226,
299,
1637,
51,
16618,
7266,
941,
1234,
45,
3469,
49,
15477,
49,
7818,
49,
7818,
3097,
49,
222,
325,
4714,
762,
312,
222,
325,
1485,
434,
327,
7033,
882,
762,
979,
6226,
51,
23061,
3485,
1177,
320,
222,
325
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
51,
519,
51,
6342,
64,
222,
485,
2616,
51,
6390,
51,
11871,
6228,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
1408,
1233,
2769,
320,
465,
964,
924,
1175,
910,
13407,
100,
27813,
299,
332,
3266,
884,
303,
964,
924,
1175,
910,
11193,
100,
2333,
299,
332,
4472,
884,
303,
964,
924,
1175,
910,
44450,
100,
2333,
299,
332,
1312,
884,
222,
222,
325,
283,
581,
924,
910,
640,
9141,
1811,
5729,
45,
3242,
7063,
1637,
49,
1175,
14433,
8219,
46,
320,
222,
325,
222,
325,
370,
453,
6222,
2588,
222,
325,
370,
434,
327,
11871,
6228,
51,
316,
3112,
5729,
45,
1834,
49,
8219,
509,
320,
222,
325,
1485,
453,
16933,
3581,
2588,
222,
325,
1485,
434,
327,
316,
8392,
3581,
3112,
45,
3469,
509,
320,
222,
325,
2087,
1175,
910,
3714,
625,
299,
42869,
6228,
51,
35778,
625,
45,
3469,
312,
222,
325,
2087,
453,
22600,
709,
51,
105,
459,
1446,
625,
984,
925,
120,
411,
3714,
625,
312,
222,
325,
2087,
1175,
910,
1197,
6168,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
2087,
1175,
910,
847,
299,
6168,
96,
53,
988,
222,
325,
222,
325,
2087,
434,
327,
25842,
100,
2333,
51,
18993,
45,
700,
509,
320,
222,
325,
4714,
461,
10584,
51,
390,
8392,
3581,
4562,
365,
494,
13198,
494,
6168,
96,
54,
988,
222,
325,
2087,
339,
832,
320,
222,
325,
4714,
453,
4314,
2902,
3000,
50,
4472,
21980,
222,
325,
4714,
9705,
1536,
299,
556,
9705,
492,
222,
325,
4714,
910,
1197,
1536,
7719,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
4714,
461,
1536,
51,
1713,
45,
390,
25312,
463,
3581,
44178,
45,
1834,
49,
1536,
7719,
96
] | -1,744,553,527,232,505,600
| true
| false
| false
| false
|
[
325,
2087,
1175,
910,
3714,
625,
299,
42869,
6228,
51,
35778,
625,
45,
3469,
312,
222,
325,
2087,
453,
22600,
709,
51,
105,
459,
1446,
625,
984,
925,
120,
411,
3714,
625,
312,
222,
325,
2087,
1175,
910,
1197,
6168,
299,
3714,
625,
51,
3045,
17910,
742,
222,
325,
2087,
1175,
910,
847,
299,
6168,
96,
53,
988,
222,
325,
222,
325,
2087,
434,
327,
25842,
100,
2333,
51,
18993,
45,
700,
509,
320,
222,
325,
4714,
461,
10584,
51,
390,
8392,
3581,
4562,
365,
494,
13198,
494,
6168,
96,
54,
988,
222,
325,
2087,
339,
832,
320,
222,
325
] | 6,066,928,633,415,483,000
| true
|
android.net.Uri;
import android.os.Environment;
import android.provider.DocumentsContract;
import java.io.File;
import java.util.List;
public class GetPathUtils {
private static final String PATH_TREE = "tree";
private static final String PRIMARY_TYPE = "primary";
private static final String RAW_TYPE = "raw";
// public static String getFilePathFromUri(final Context context, final Uri uri) {
//
// // DocumentProvider
// if (DocumentsContract.isDocumentUri(context, uri)) {
// // ExternalStorageProvider
// if (isExternalStorageDocument(uri)) {
// final String docId = DocumentsContract.getDocumentId(uri);
// //Timber.d("docId -> %s", docId);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
// return Environment.getExternalStorageDirectory() + "/" + split[1];
// } else {
//
|
final String PATH_TREE = "tree";
private static final String PRIMARY_TYPE = "primary";
private static final String RAW_TYPE = "raw";
// public static String getFilePathFromUri(final Context context, final Uri uri) {
//
// // DocumentProvider
// if (DocumentsContract.isDocumentUri(context, uri)) {
// // ExternalStorageProvider
// if (isExternalStorageDocument(uri)) {
// final String docId = DocumentsContract.getDocumentId(uri);
// //Timber.d("docId -> %s", docId);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
// return Environment.getExternalStorageDirectory() + "/" + split[1];
// } else {
//
|
Uri uri) {
//
// // DocumentProvider
// if (DocumentsContract.isDocumentUri(context, uri)) {
// // ExternalStorageProvider
// if (isExternalStorageDocument(uri)) {
// final String docId = DocumentsContract.getDocumentId(uri);
// //Timber.d("docId -> %s", docId);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
// return Environment.getExternalStorageDirectory() + "/" + split[1];
// } else {
//
|
// final String docId = DocumentsContract.getDocumentId(uri);
// //Timber.d("docId -> %s", docId);
// final String[] split = docId.split(":");
// final String type = split[0];
//
// if (PRIMARY_TYPE.equalsIgnoreCase(type)) {
// return Environment.getExternalStorageDirectory() + "/" + split[1];
// } else {
//
|
// TODO handle non-primary volumes
// StringBuilder path = new StringBuilder();
// String[] pathSegment = docId.split(":");
// return path.append(getRemovableStorageRootPath(context, pathSegment[
|
AppUDPSessionImpl.java
|
/FileExtraction/Java_unseen/untangle_ngfw_src/uvm/impl/com/untangle/uvm/AppUDPSessionImpl.java
|
/**
* $Id$
*/
package com.untangle.uvm;
import java.nio.ByteBuffer;
import com.untangle.jvector.Crumb;
import com.untangle.jvector.IncomingSocketQueue;
import com.untangle.jvector.OutgoingSocketQueue;
import com.untangle.jvector.PacketCrumb;
import com.untangle.jvector.ShutdownCrumb;
import com.untangle.jvector.UDPPacketCrumb;
import com.untangle.uvm.app.SessionEvent;
import com.untangle.uvm.vnet.IPPacketHeader;
import com.untangle.uvm.vnet.AppSession;
import com.untangle.uvm.vnet.AppUDPSession;
import com.untangle.uvm.vnet.IPStreamer;
/**
* This is the primary implementation class for UDP live sessions.
*/
public class AppUDPSessionImpl extends AppSessionImpl implements AppUDPSession
{
protected int[] maxPacketSize;
protected final byte ttl;
protected final byte tos;
private final String logPrefix;
/**
* Constructor
*
* @param disp
* The dispatcher
* @param sessionEvent
* The session event
* @param clientMaxPacketSize
* Maximum client packet size
* @param serverMaxPacketSize
* Maximum server packet size
* @param request
* The request
*/
protected AppUDPSessionImpl(Dispatcher disp, SessionEvent sessionEvent, int clientMaxPacketSize, int serverMaxPacketSize, UDPNewSessionRequestImpl request)
{
super(disp, sessionEvent, request);
logPrefix = "UDP" + id();
if (clientMaxPacketSize < 2 || clientMaxPacketSize > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum client packet bufferSize: " + clientMaxPacketSize);
if (serverMaxPacketSize < 2 || serverMaxPacketSize > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum server packet bufferSize: " + serverMaxPacketSize);
this.maxPacketSize = new int[] { clientMaxPacketSize, serverMaxPacketSize };
PipelineConnectorImpl pipelineConnector = disp.pipelineConnector();
this.ttl = request.ttl();
this.tos = request.tos();
}
/**
* Get the server max packet size
*
* @return The size
*/
public int serverMaxPacketSize()
{
return maxPacketSize[SERVER];
}
/**
* Set the server max packet size
*
* @param numBytes
* The size
*/
public void serverMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[SERVER] = numBytes;
}
/**
* Get the client max packet size
*
* @return The size
*/
public int clientMaxPacketSize()
{
return maxPacketSize[CLIENT];
}
/**
* Set the client max packet size
*
* @param numBytes
* The size
*/
public void clientMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[CLIENT] = numBytes;
}
/**
* Get the client state
*
* @return The state
*/
public byte clientState()
{
if (clientIncomingSocketQueue() == null) {
assert clientOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert clientOutgoingSocketQueue() != null;
return AppSession.OPEN;
}
}
/**
* Get the server state
*
* @return The state
*/
public byte serverState()
{
if (serverIncomingSocketQueue() == null) {
assert serverOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert serverOutgoingSocketQueue() != null;
return AppSession.OPEN;
}
}
/**
* Expire the server
*/
public void expireServer()
{
OutgoingSocketQueue out = serverOutgoingSocketQueue();
if (out != null) {
Crumb crumb = ShutdownCrumb.getInstance(true);
out.write(crumb);
}
// 8/15/05 we also now reset the incoming side, to avoid the race in case a packet outraces
// the close-other-half event.
IncomingSocketQueue in = serverIncomingSocketQueue();
if (in != null) {
// Should always happen.
in.reset();
}
}
/**
* Expire the client
*/
public void expireClient()
{
OutgoingSocketQueue out = clientOutgoingSocketQueue();
if (out != null) {
Crumb crumb = ShutdownCrumb.getInstance(true);
out.write(crumb);
}
// 8/15/05 we also now reset the incoming side, to avoid the race in case a packet outraces
// the close-other-half event.
IncomingSocketQueue in = clientIncomingSocketQueue();
if (in != null) {
// Should always happen.
in.reset();
}
}
/**
* Retrieve the TTL for a session, this only has an impact for the last
* session in the chain when passing data crumbs (UDPPacketCrumbs have TTL
* value inside of them)
*
* @return The TTL
*/
public byte ttl()
{
return ttl;
}
/**
* Retrieve the TOS for a session, this only has an impact for the last
* session in the chain when passing data crumbs (UDPPacketCrumbs have TOS
* value inside of them).
*
* @return The TOS
*/
public byte tos()
{
return tos;
}
/**
* Check if the side is dieing
*
* @param side
* The side
* @param in
* The incoming socket queue
* @return The result
*/
protected boolean isSideDieing(int side, IncomingSocketQueue in)
{
return (in.containsReset() || in.containsShutdown());
}
/**
* Signal side is dieing
*
* @param side
* The side
*/
protected void sideDieing(int side)
{
sendExpiredEvent(side);
}
/**
* Send a client packet
*
* @param packet
* The packet
* @param header
* The header
*/
public void sendClientPacket(ByteBuffer packet, IPPacketHeader header)
{
sendPacket(CLIENT, packet, header);
}
/**
* Send a server packet
*
* @param packet
* The packet
* @param header
* The header
*/
public void sendServerPacket(ByteBuffer packet, IPPacketHeader header)
{
sendPacket(SERVER, packet, header);
}
/**
* Send a packet
*
* @param side
* The side
* @param packet
* The packet
* @param header
* The header
*/
private void sendPacket(int side, ByteBuffer packet, IPPacketHeader header)
{
byte[] array;
int offset = packet.position();
int limit = packet.remaining();
if (packet.hasArray()) {
array = packet.array();
offset += packet.arrayOffset();
limit += packet.arrayOffset();
} else {
logger.warn("out-of-help byte buffer, had to copy");
array = new byte[packet.remaining()];
packet.get(array);
packet.position(offset);
offset = 0;
}
UDPPacketCrumb crumb = new UDPPacketCrumb(header.ttl(), header.tos(), header.options(), array, offset, limit);
addToWriteQueue(side, crumb);
}
/**
* Try writing
*
* @param side
* The side
* @param out
* The outgoing socket queue
* @return The result
*/
protected boolean tryWrite(int side, OutgoingSocketQueue out)
{
if (out == null) {
logger.error("Invalid arguments.");
return false;
}
if (out.isFull()) {
logger.warn("tryWrite to full outgoing queue");
return false;
}
Crumb nc = getNextCrumb2Send(side);
PacketCrumb packet2send = (PacketCrumb) nc;
assert packet2send != null;
int numWritten = sendCrumb(packet2send, out);
if (logger.isDebugEnabled()) {
logger.debug("wrote " + numWritten + " to " + side);
}
return true;
}
/**
* Read a crumb from a streamer
*
* @param streamer
* The streamer
* @return The crumb
*/
protected Crumb readStreamer(IPStreamer streamer)
{
logger.error("Streaming not implemented for UDP", new Exception());
return null;
}
/**
* Send a writable event
*
* @param side
* The side
*/
protected void sendWritableEvent(int side)
{
if (side == CLIENT) dispatcher.dispatchUDPClientWritable(this);
else dispatcher.dispatchUDPServerWritable(this);
}
/**
* Send a complete event
*/
protected void sendCompleteEvent()
{
dispatcher.dispatchUDPComplete(this);
}
/**
* Send expired event
*
* @param side
* The side
*/
protected void sendExpiredEvent(int side)
{
if (side == CLIENT) dispatcher.dispatchUDPClientExpired(this);
else dispatcher.dispatchUDPServerExpired(this);
}
/**
* Handles the actual reading from the client or server
*
* @param side
* The side
* @param in
* The incoming socket queue
*/
protected void handleRead(int side, IncomingSocketQueue in)
{
int numRead = 0;
assert in != null;
if (in.isEmpty()) {
logger.warn("tryReadClient from empty incoming queue");
return;
}
Crumb crumb = in.read();
switch (crumb.type())
{
case Crumb.TYPE_SHUTDOWN:
case Crumb.TYPE_RESET:
case Crumb.TYPE_DATA:
// Should never happen (TCP).
logger.debug("udp read crumb " + crumb.type());
assert false;
break;
default:
// Now we know this is a UDP.
}
PacketCrumb pc = (PacketCrumb) crumb;
IPPacketHeader pheader = new IPPacketHeader(pc.ttl(), pc.tos(), pc.options());
byte[] pcdata = pc.data();
int pclimit = pc.limit();
//int pccap = pcdata.length;
int pcoffset = pc.offset();
int pcsize = pclimit - pcoffset;
if (pcoffset >= pclimit) {
logger.warn("Zero length UDP crumb read");
return;
}
ByteBuffer pbuf;
if (pcoffset != 0) {
// XXXX
assert false;
pbuf = null;
} else {
pbuf = ByteBuffer.wrap(pcdata, 0, pcsize);
numRead = pcsize;
}
// Wrap a byte buffer around the data.
// XXX This may or may not be a UDP crumb depending on what gets passed.
// Right now just always do DataCrumbs, since a UDPPacketCrumb coming in just gets
// converted to a DataCrumb on the other side (hence, the next app will fail)
if (logger.isDebugEnabled()) logger.debug("read " + numRead + " size " + crumb.type() + " packet from " + side);
// We have received bytes. Give them to the user.
// We no longer duplicate the buffer so that the event handler can mess up
// the position/mark/limit as desired. This is since the app now sends
// a buffer manually -- the position and limit must already be correct when sent, so
// there's no need for us to duplicate here.
if (side == CLIENT) dispatcher.dispatchUDPClientPacket(this, pbuf, pheader);
else dispatcher.dispatchUDPServerPacket(this, pbuf, pheader);
// Nothing more to do, any packets to be sent were queued by called to sendClientPacket(), etc,
// from app's packet handler.
return;
}
/**
* Get the id for MDC
*
* @return The string
*/
@Override
protected String idForMDC()
{
return logPrefix;
}
/**
* Final close
*/
@Override
protected void closeFinal()
{
try {
dispatcher.dispatchUDPFinalized(this);
} catch (Exception x) {
logger.warn("Exception in Finalized", x);
}
super.closeFinal();
}
}
| 12,439
|
Java
|
.java
|
untangle/ngfw_src
| 19
| 22
| 3
|
2016-09-16T08:18:37Z
|
2024-05-09T04:22:16Z
|
845c1214f795391b2582288be64f2a3ada6e938af1294cf61699db6616f967e8
|
[] |
[
1350,
222,
338,
417,
625,
41,
222,
588,
222,
222,
1337,
785,
51,
593,
3727,
51,
122,
3166,
64,
222,
222,
485,
1401,
51,
11780,
51,
21042,
64,
222,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
9719,
3345,
64,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
24123,
5270,
4098,
64,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
36325,
5270,
4098,
64,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
6839,
9719,
3345,
64,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
19658,
9719,
3345,
64,
222,
485,
785,
51,
593,
3727,
51,
111,
2423,
51,
3807,
5486,
3372,
9719,
3345,
64,
222,
485,
785,
51,
593,
3727,
51,
122,
3166,
51,
745,
51,
3152,
1167,
64,
222,
222,
485,
785,
51,
593,
3727,
51,
122,
3166,
51,
45671,
51,
2046,
6839,
2661,
64,
222,
485,
785,
51,
593,
3727,
51,
122,
3166,
51,
45671,
51,
1306,
3152,
64,
222,
485,
785,
51,
593,
3727,
51,
122,
3166,
51,
45671,
51,
1306,
20952,
3152,
64,
222,
485,
785,
51,
593,
3727,
51,
122,
3166,
51,
45671,
51,
2046,
1880,
284,
64,
222,
222,
1350,
222,
338,
1369,
458,
341,
7470,
4753,
462,
456,
24616,
10918,
20987,
51,
222,
588,
222,
942,
462,
2013,
20952,
3152,
3499,
2041,
2013,
3152,
3499,
4584,
2013,
20952,
3152,
222,
128,
303,
2532,
648,
1197,
1788,
6839,
1269,
64,
465,
2532,
1175,
3447,
28368,
64,
303,
2532,
1175,
3447,
391,
120,
64,
465,
964,
1175,
910,
1264,
5429,
64,
465,
1041,
294,
338,
12836,
294,
338,
5402,
338,
496,
772,
24580,
294,
338,
370,
906,
26598,
294,
338,
496,
772,
3541,
1167,
294,
338,
370,
906,
3541,
1708,
294,
338,
496,
772,
2060,
2725,
6839,
1269,
294,
338,
370,
18698,
2060,
6892,
1354,
294,
338,
496,
772,
2160,
2725,
6839,
1269,
294,
338,
370,
18698,
2160,
6892,
1354,
294,
338,
496,
772,
1343,
294,
338,
370,
906,
1343,
294,
588,
303,
2532,
2013,
20952,
3152,
3499,
45,
11523,
24580,
49,
6555,
1167,
3541,
1167,
49,
648,
2060,
2725,
6839,
1269,
49,
648,
2160,
2725,
6839,
1269,
49,
24616,
1827,
3152,
1123,
3499,
1343,
46,
303,
320,
310,
2615,
45,
18606,
49,
3541,
1167,
49,
1343,
312,
603,
1264,
5429,
299,
332,
20952,
39,
494,
828,
492,
603,
434,
327,
1598,
2725,
6839,
1269,
350,
244,
55,
1293,
2060,
2725,
6839,
1269,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
2060,
6892,
44595,
63,
332,
494,
2060,
2725,
6839,
1269,
312,
310,
434,
327,
1805,
2725,
6839,
1269,
350,
244,
55,
1293,
2160,
2725,
6839,
1269,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
2160,
6892,
44595,
63,
332,
494,
2160,
2725,
6839,
1269,
312,
310,
477,
51,
1472,
6839,
1269,
299,
556,
648,
1197,
320,
2060,
2725,
6839,
1269,
49,
2160,
2725,
6839,
1269,
1487,
603,
18686,
9940,
3499,
8613,
9940,
299,
24580,
51,
9319,
9940,
492,
603,
477,
51,
18909,
299,
1343,
51,
18909,
492,
310,
477,
51,
10382,
299,
1343,
51,
10382,
492,
303,
339,
465,
1041,
294,
338,
1408,
341,
2160,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
620,
906,
1354,
294,
588,
303,
581,
648,
2160,
2725,
6839,
1269,
365,
303,
320,
310,
461,
1788,
6839,
1269,
96,
8099,
988,
303,
339,
465,
1041,
294,
338,
1776,
341,
2160,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
772,
1952,
3656,
294,
338,
370,
906,
1354,
294,
588,
303,
581,
782,
2160,
2725,
6839,
1269,
45,
429,
1952,
3656,
46,
303,
320,
310,
434,
327,
1538,
3656,
350,
244,
55,
1293,
1952,
3656,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
6892,
44595,
63,
332,
494,
1952,
3656,
312,
310,
1788,
6839,
1269,
96,
8099,
98,
299,
1952,
3656,
64,
303,
339,
465,
1041,
294,
338,
1408,
341,
2060,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
620,
906,
1354,
294,
588,
303,
581,
648,
2060,
2725,
6839,
1269,
365,
303,
320,
310,
461,
1788,
6839,
1269,
96,
10929,
988,
303,
339,
465,
1041,
294,
338,
1776,
341,
2060,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
772,
1952,
3656,
294,
338,
370,
906,
1354,
294,
588,
303,
581,
782,
2060,
2725,
6839,
1269,
45,
429,
1952,
3656,
46,
303,
320,
310,
434,
327,
1538,
3656,
350,
244,
55,
1293,
1952,
3656,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
6892,
44595,
63,
332,
494,
1952,
3656,
312,
310,
1788,
6839,
1269,
96,
10929,
98,
299,
1952,
3656,
64,
303,
339,
465,
1041,
294,
338,
1408,
341,
2060,
1621,
294,
338,
5402,
338,
496,
620,
906,
1621,
294,
588,
303,
581,
3447,
2060,
1095,
365,
303,
320,
310,
434,
327,
1598,
24123,
5270,
4098,
365,
630,
762,
46,
320,
343,
1217,
2060,
36325,
5270,
4098,
365,
630,
762,
64,
343,
461,
2013,
3152,
51,
37027,
7106,
64,
310,
339,
832,
320,
343,
1217,
2060,
36325,
5270,
4098,
365,
882,
762,
64,
343,
461,
2013,
3152,
51,
10937,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
341,
2160,
1621,
294,
338,
5402,
338,
496,
620,
906,
1621,
294,
588,
303,
581,
3447,
2160,
1095,
365,
303,
320,
310,
434,
327,
1805,
24123,
5270,
4098,
365,
630,
762,
46,
320,
343,
1217,
2160,
36325,
5270,
4098,
365,
630,
762,
64,
343,
461,
2013,
3152,
51,
37027,
7106,
64,
310,
339,
832,
320,
343,
1217,
2160,
36325,
5270,
4098,
365,
882,
762,
64,
343,
461,
2013,
3152,
51,
10937,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
9665,
567,
341,
2160,
294,
588,
303,
581,
782,
27212,
2077,
365,
303,
320,
310,
4322,
12403,
5270,
4098,
986,
299,
2160,
36325,
5270,
4098,
492,
310,
434,
327,
560,
882,
762,
46,
320,
343,
16184,
3345,
5584,
3345,
299,
48503,
9719,
3345,
51,
7432,
45,
1527,
312,
343,
986,
51,
1838,
45,
9048,
312,
310,
339,
310,
453,
244,
61,
52,
54,
58,
52,
53,
58,
1019,
2353,
2483,
5672,
341,
14959,
5226,
49,
391,
7373,
341,
22048,
347,
1152,
331,
6892,
986
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
581,
782,
2160,
2725,
6839,
1269,
45,
429,
1952,
3656,
46,
303,
320,
310,
434,
327,
1538,
3656,
350,
244,
55,
1293,
1952,
3656,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
6892,
44595,
63,
332,
494,
1952,
3656,
312,
310,
1788,
6839,
1269,
96,
8099,
98,
299,
1952,
3656,
64,
303,
339,
465,
1041,
294,
338,
1408,
341,
2060,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
620,
906,
1354,
294,
588,
303,
581,
648,
2060,
2725,
6839,
1269,
365,
303,
320,
310,
461,
1788,
6839,
1269,
96,
10929,
988,
303,
339,
465,
1041,
294,
338,
1776,
341,
2060,
1788,
6892,
1354,
294,
338,
5402,
338,
496,
772,
1952,
3656,
294,
338,
370,
906,
1354,
294,
588,
303,
581,
782,
2060,
2725,
6839,
1269,
45,
429,
1952,
3656,
46,
303,
320,
310,
434,
327,
1538,
3656,
350,
244,
55,
1293,
1952,
3656,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
6892,
44595,
63,
332,
494,
1952,
3656,
312,
310,
1788,
6839,
1269,
96,
10929,
98,
299,
1952,
3656,
64,
303,
339,
465,
1041,
294,
338,
1408,
341,
2060,
1621,
294,
338,
5402,
338,
496,
620,
906,
1621,
294,
588,
303,
581,
3447,
2060,
1095,
365,
303,
320,
310,
434,
327,
1598,
24123,
5270,
4098,
365,
630,
762,
46,
320,
343,
1217,
2060,
36325,
5270,
4098,
365,
630,
762,
64,
343,
461,
2013,
3152,
51,
37027,
7106,
64,
310,
339,
832,
320,
343,
1217,
2060,
36325,
5270,
4098,
365,
882,
762,
64,
343,
461,
2013,
3152,
51,
10937,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
341,
2160,
1621,
294,
338,
5402,
338,
496,
620,
906,
1621,
294,
588,
303,
581,
3447,
2160,
1095,
365,
303,
320,
310,
434,
327,
1805,
24123
] | 6,995,850,084,884,528,000
| true
| false
| false
| false
|
[
3656,
868,
24616,
100,
3470,
100,
6976,
76,
100,
3382,
46,
1440,
556,
12134,
459,
15083,
7123,
6892,
44595,
63,
332,
494,
1952,
3656,
312,
310,
1788,
6839,
1269,
96,
10929,
98,
299,
1952,
3656,
64,
303,
339,
465,
1041,
294,
338,
1408,
341,
2060,
1621,
294,
338,
5402,
338,
496,
620,
906,
1621,
294,
588,
303,
581,
3447,
2060,
1095,
365,
303,
320,
310,
434,
327,
1598,
24123,
5270,
4098,
365,
630,
762,
46,
320,
343,
1217,
2060,
36325,
5270,
4098,
365,
630,
762,
64,
343,
461,
2013,
3152,
51,
37027,
7106,
64,
310,
339,
832,
320,
343,
1217
] | -2,604,728,966,640,165,400
| true
|
public void serverMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[SERVER] = numBytes;
}
/**
* Get the client max packet size
*
* @return The size
*/
public int clientMaxPacketSize()
{
return maxPacketSize[CLIENT];
}
/**
* Set the client max packet size
*
* @param numBytes
* The size
*/
public void clientMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[CLIENT] = numBytes;
}
/**
* Get the client state
*
* @return The state
*/
public byte clientState()
{
if (clientIncomingSocketQueue() == null) {
assert clientOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert
|
PacketSize[SERVER] = numBytes;
}
/**
* Get the client max packet size
*
* @return The size
*/
public int clientMaxPacketSize()
{
return maxPacketSize[CLIENT];
}
/**
* Set the client max packet size
*
* @param numBytes
* The size
*/
public void clientMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[CLIENT] = numBytes;
}
/**
* Get the client state
*
* @return The state
*/
public byte clientState()
{
if (clientIncomingSocketQueue() == null) {
assert clientOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert
|
}
/**
* Set the client max packet size
*
* @param numBytes
* The size
*/
public void clientMaxPacketSize(int numBytes)
{
if (numBytes < 2 || numBytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[CLIENT] = numBytes;
}
/**
* Get the client state
*
* @return The state
*/
public byte clientState()
{
if (clientIncomingSocketQueue() == null) {
assert clientOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert
|
Bytes > UDP_MAX_MESG_SIZE) throw new IllegalArgumentException("Illegal maximum packet bufferSize: " + numBytes);
maxPacketSize[CLIENT] = numBytes;
}
/**
* Get the client state
*
* @return The state
*/
public byte clientState()
{
if (clientIncomingSocketQueue() == null) {
assert clientOutgoingSocketQueue() == null;
return AppSession.EXPIRED;
} else {
assert
|
clientOutgoingSocketQueue()!= null;
return AppSession.OPEN;
}
}
/**
* Get the server state
*
* @return The state
*/
public byte serverState()
{
if (serverIncoming
|
HistoryActivity.java
|
/FileExtraction/Java_unseen/sadr0b0t_yashlang/app/src/main/java/su/sadrobot/yashlang/HistoryActivity.java
|
package su.sadrobot.yashlang;
/*
* Copyright (C) Anton Moiseev 2019 <github.com/sadr0b0t>
*
* YaShlang is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* YaShlang is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with YaShlang. If not, see <http://www.gnu.org/licenses/>.
*/
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer;
import androidx.paging.DataSource;
import androidx.paging.LivePagedListBuilder;
import androidx.paging.PagedList;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import su.sadrobot.yashlang.controller.VideoItemActions;
import su.sadrobot.yashlang.model.VideoDatabase;
import su.sadrobot.yashlang.model.VideoItem;
import su.sadrobot.yashlang.view.OnListItemClickListener;
import su.sadrobot.yashlang.view.VideoItemPagedListAdapter;
/**
*
*/
public class HistoryActivity extends AppCompatActivity {
private RecyclerView videoList;
private View emptyView;
private final Handler handler = new Handler();
private LiveData<PagedList<VideoItem>> videoItemsLiveData;
private final RecyclerView.AdapterDataObserver emptyListObserver = new RecyclerView.AdapterDataObserver() {
// https://stackoverflow.com/questions/47417645/empty-view-on-a-recyclerview
// https://stackoverflow.com/questions/27414173/equivalent-of-listview-setemptyview-in-recyclerview
// https://gist.github.com/sheharyarn/5602930ad84fa64c30a29ab18eb69c6e
private void checkIfEmpty() {
final boolean listIsEmpty = videoList.getAdapter() == null || videoList.getAdapter().getItemCount() == 0;
emptyView.setVisibility(listIsEmpty ? View.VISIBLE : View.GONE);
videoList.setVisibility(listIsEmpty ? View.GONE : View.VISIBLE);
}
@Override
public void onChanged() {
checkIfEmpty();
}
@Override
public void onItemRangeInserted(int positionStart, int itemCount) {
checkIfEmpty();
}
@Override
public void onItemRangeRemoved(int positionStart, int itemCount) {
checkIfEmpty();
}
};
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
emptyView = findViewById(R.id.empty_view);
videoList = findViewById(R.id.video_list);
// кнопка "Назад" на акшенбаре
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// set a LinearLayoutManager with default vertical orientation
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
videoList.setLayoutManager(linearLayoutManager);
videoList.setItemAnimator(new DefaultItemAnimator() {
@Override
public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHolder) {
// чтобы картинки и текст не сбивались в кучку при быстрой промотке
// см: https://github.com/sadr0b0t/yashlang/issues/129
return true;
}
});
}
@Override
protected void onResume() {
super.onResume();
if (ConfigOptions.getOfflineModeOn(this)) {
getSupportActionBar().setTitle(getString(R.string.icon_offline) + " " +
getString(R.string.yashlang_history));
}
setupVideoListAdapter();
}
@Override
public boolean onSupportNavigateUp() {
finish();
return true;
}
private void setupVideoListAdapter() {
if (videoItemsLiveData != null) {
videoItemsLiveData.removeObservers(this);
}
if (videoList.getAdapter() != null) {
videoList.getAdapter().unregisterAdapterDataObserver(emptyListObserver);
}
final VideoItemPagedListAdapter adapter = new VideoItemPagedListAdapter(this,
new OnListItemClickListener<VideoItem>() {
@Override
public void onItemClick(final View view, final int position, final VideoItem videoItem) {
VideoItemActions.actionPlay(HistoryActivity.this, videoItem);
}
@Override
public boolean onItemLongClick(final View view, final int position, final VideoItem videoItem) {
final PopupMenu popup = new PopupMenu(HistoryActivity.this,
view.findViewById(R.id.video_name_txt));
popup.getMenuInflater().inflate(R.menu.video_item_actions, popup.getMenu());
popup.setOnMenuItemClickListener(
new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_play_in_playlist: {
VideoItemActions.actionPlayInPlaylist(HistoryActivity.this, videoItem);
break;
}
case R.id.action_play_in_playlist_shuffle: {
VideoItemActions.actionPlayInPlaylistShuffle(HistoryActivity.this, videoItem);
break;
}
case R.id.action_copy_video_name: {
VideoItemActions.actionCopyVideoName(HistoryActivity.this, videoItem);
break;
}
case R.id.action_copy_video_url: {
VideoItemActions.actionCopyVideoUrl(HistoryActivity.this, videoItem);
break;
}
case R.id.action_copy_playlist_name: {
VideoItemActions.actionCopyPlaylistName(HistoryActivity.this, handler, videoItem);
break;
}
case R.id.action_copy_playlist_url: {
VideoItemActions.actionCopyPlaylistUrl(HistoryActivity.this, handler, videoItem);
break;
}
case R.id.action_blacklist: {
VideoItemActions.actionBlacklist(HistoryActivity.this, handler, videoItem.getId(), null);
break;
}
case R.id.action_download_streams: {
VideoItemActions.actionDownloadStreams(HistoryActivity.this, handler, videoItem, null);
break;
}
}
return true;
}
}
);
popup.show();
return true;
}
}, null);
// если список пустой, показываем специальный экранчик с сообщением
adapter.registerAdapterDataObserver(emptyListObserver);
// Initial page size to fetch can also be configured here too
final PagedList.Config config = new PagedList.Config.Builder().setPageSize(ConfigOptions.PAGED_LIST_PAGE_SIZE).build();
final DataSource.Factory factory = VideoDatabase.getDbInstance(HistoryActivity.this).
videoItemPubListsDao().getHistoryOrderByLastViewedDs();
videoItemsLiveData = new LivePagedListBuilder(factory, config).build();
videoItemsLiveData.observe(this, new Observer<PagedList<VideoItem>>() {
@Override
public void onChanged(@Nullable PagedList<VideoItem> videos) {
adapter.submitList(videos);
}
});
videoList.setAdapter(adapter);
}
}
| 9,612
|
Java
|
.java
|
sadr0b0t/yashlang
| 50
| 3
| 103
|
2019-09-04T20:10:47Z
|
2023-03-07T09:56:30Z
|
0d500aa2e2fa50ca34647b3273166716c7ae5114509e49f845ab3f0eb9a8402c
|
[] |
[
1337,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
64,
222,
222,
1127,
222,
338,
2657,
327,
72,
46,
16396,
286,
12444,
1145,
5103,
244,
55,
53,
54,
62,
350,
951,
51,
527,
52,
120,
14157,
53,
103,
53,
121,
67,
222,
338,
222,
338,
1432,
102,
1207,
1600,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1432,
102,
1207,
1600,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
1432,
102,
1207,
1600,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
485,
2616,
51,
519,
51,
4775,
64,
222,
485,
2616,
51,
519,
51,
1985,
64,
222,
485,
2616,
51,
1090,
51,
6362,
64,
222,
485,
2616,
51,
1090,
51,
1089,
64,
222,
485,
2616,
51,
3872,
51,
36496,
64,
222,
222,
485,
10484,
51,
4341,
51,
10082,
64,
222,
485,
10484,
51,
4341,
51,
6825,
64,
222,
485,
10484,
51,
32355,
51,
745,
51,
35181,
64,
222,
485,
10484,
51,
19749,
51,
32854,
64,
222,
485,
10484,
51,
19749,
51,
9136,
64,
222,
485,
10484,
51,
37933,
51,
8622,
64,
222,
485,
10484,
51,
37933,
51,
11088,
32694,
739,
1812,
64,
222,
485,
10484,
51,
37933,
51,
32694,
739,
64,
222,
485,
10484,
51,
41468,
51,
3872,
51,
2061,
1114,
20721,
64,
222,
485,
10484,
51,
41468,
51,
3872,
51,
9505,
22445,
64,
222,
485,
10484,
51,
41468,
51,
3872,
51,
21366,
64,
222,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
4641,
51,
6086,
1114,
7113,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1184,
51,
6086,
3969,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1184,
51,
6086,
1114,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1090,
51,
1501,
12866,
10121,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1090,
51,
6086,
1114,
32694,
46480,
64,
222,
222,
1350,
222,
338,
222,
588,
222,
942,
462,
19591,
3697,
2041,
36463,
320,
465,
964,
25597,
6044,
739,
64,
303,
964,
4340,
3517,
1089,
64,
465,
964,
1175,
15210,
4908,
299,
556,
15210,
492,
465,
964,
17771,
768,
65,
32694,
739,
65,
6086,
1114,
2023,
6044,
3648,
32854,
64,
465,
964,
1175,
25597,
51,
4433,
768,
9136,
3517,
739,
9136,
299,
556,
25597,
51,
4433,
768,
9136,
365,
320,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
57,
60,
57,
54,
60,
59,
57,
58,
52,
2970,
50,
1090,
50,
286,
50,
102,
50,
41468,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
55,
60,
57,
54,
57,
54,
60,
56,
52,
106,
11144,
50,
1048,
50,
687,
1090,
50,
489,
2970,
1090,
50,
285,
50,
41468,
310,
453,
1698,
574,
1169,
51,
951,
51,
527,
52,
17775,
109,
692,
2864,
52,
58,
59,
53,
55,
62,
56,
53,
358,
61,
57,
1939,
59,
57,
104,
56,
53,
102,
55,
62,
380,
54,
61,
891,
59,
62,
104,
59,
106,
310,
964,
782,
1524,
2811,
2779,
365,
320,
343,
1175,
1922,
1168,
29525,
299,
6044,
739,
51,
390,
4433,
365,
630,
762,
1293,
6044,
739,
51,
390,
4433,
941,
12244,
1552,
365,
630,
244,
53,
64,
343,
3517,
1089,
51,
20070,
45,
687,
29525,
1037,
4340,
51,
18392,
518,
4340,
51,
27774,
312,
343,
6044,
739,
51,
20070,
45,
687,
29525,
1037,
4340,
51,
27774,
518,
4340,
51,
18392,
312,
310,
339,
603,
496,
1806,
310,
581,
782,
20662,
365,
320,
343,
1524,
2811,
2779,
492,
310,
339,
603,
496,
1806,
310,
581,
782,
563,
1114,
3216,
47321,
45,
429,
2764,
2148,
49,
648,
1641,
1552,
46,
320,
343,
1524,
2811,
2779,
492,
310,
339,
603,
496,
1806,
310,
581,
782,
563,
1114,
3216,
16971,
45,
429,
2764,
2148,
49,
648,
1641,
1552,
46,
320,
343,
1524,
2811,
2779,
492,
310,
339,
303,
1487,
465,
496,
1806,
303,
2532,
782,
16456,
45,
3242,
14092,
19902,
46,
320,
310,
2615,
51,
20217,
45,
20731,
312,
603,
31090,
45,
87,
51,
3106,
51,
6904,
100,
6503,
312,
603,
3517,
1089,
299,
15510,
45,
87,
51,
333,
51,
2970,
100,
1090,
312,
310,
6044,
739,
299,
15510,
45,
87,
51,
333,
51,
5011,
100,
687,
312,
603,
453,
5147,
1439,
15356,
10149,
332,
16231,
13602,
15577,
39,
9504,
12847,
3296,
7844,
3533,
6276,
12571,
1101,
310,
640,
4417,
21540,
941,
489,
3948,
4637,
1482,
1405,
4006,
45,
1527,
312,
603,
453,
758,
331,
43672,
642,
1263,
10705,
14111,
310,
1175,
43672,
10183,
22445,
299,
556,
43672,
45,
36160,
1052,
310,
6044,
739,
51,
20113,
1590,
45,
8441,
22445,
312,
310,
6044,
739,
51,
19313,
20721,
45,
909,
4119,
1114,
20721,
365,
320,
343,
496,
1806,
343,
581,
1922,
902,
454,
558,
9052,
17087,
4810,
10082,
25597,
51,
17087,
42926,
46,
320,
419,
453,
41488,
5147,
12571,
1288,
12062,
10721,
4672,
46617,
4118,
13047,
3620,
6276,
13869,
25425,
1539,
3306,
3876,
5147,
19280,
23843,
25836,
21172,
39082,
9436,
6474,
6863,
7948,
31881,
419,
453,
45020,
63,
1698,
574,
951,
51,
527,
52,
120,
14157,
53,
103,
53,
121,
52,
126,
936,
1600,
52,
4491,
52,
54,
55,
62,
419,
461,
878,
64,
343,
339,
310,
1141,
303,
339,
4054,
496,
1806,
303,
2532,
782,
563,
14986,
365,
320,
310,
2615,
51,
286,
14986,
492,
603,
434,
327,
1081,
2045,
51,
390,
27122,
2116,
1501,
45,
597,
509,
320,
343,
640,
4417,
21540,
941,
17359,
45,
7080,
45,
87,
51,
819,
51,
1584,
100,
23687,
46,
494,
332,
332,
494,
547,
26625
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
4641,
51,
6086,
1114,
7113,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1184,
51,
6086,
3969,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1184,
51,
6086,
1114,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1090,
51,
1501,
12866,
10121,
64,
222,
485,
7345,
51,
37433,
10535,
51,
126,
936,
1600,
51,
1090,
51,
6086,
1114,
32694,
46480,
64,
222,
222,
1350,
222,
338,
222,
588,
222,
942,
462,
19591,
3697,
2041,
36463,
320,
465,
964,
25597,
6044,
739,
64,
303,
964,
4340,
3517,
1089,
64,
465,
964,
1175,
15210,
4908,
299,
556,
15210,
492,
465,
964,
17771,
768,
65,
32694,
739,
65,
6086,
1114,
2023,
6044,
3648,
32854,
64,
465,
964,
1175,
25597,
51,
4433,
768,
9136,
3517,
739,
9136,
299,
556,
25597,
51,
4433,
768,
9136,
365,
320,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
57,
60,
57,
54,
60,
59,
57,
58,
52,
2970,
50,
1090,
50,
286,
50,
102,
50,
41468,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
55,
60,
57,
54,
57,
54,
60,
56,
52,
106,
11144,
50,
1048,
50,
687,
1090,
50,
489,
2970,
1090,
50,
285,
50,
41468,
310,
453,
1698,
574,
1169,
51,
951,
51,
527,
52,
17775,
109,
692,
2864,
52,
58,
59,
53,
55,
62,
56,
53,
358,
61,
57,
1939,
59,
57,
104,
56,
53,
102,
55,
62,
380,
54,
61,
891,
59,
62,
104,
59,
106,
310,
964,
782,
1524,
2811,
2779,
365,
320,
343,
1175,
1922,
1168,
29525,
299,
6044,
739,
51,
390,
4433,
365,
630,
762,
1293,
6044,
739,
51,
390,
4433,
941,
12244,
1552,
365,
630,
244,
53,
64,
343,
3517,
1089,
51,
20070,
45
] | -6,627,855,632,921,987,000
| true
| false
| false
| false
|
[
9136,
365,
320,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
57,
60,
57,
54,
60,
59,
57,
58,
52,
2970,
50,
1090,
50,
286,
50,
102,
50,
41468,
310,
453,
1698,
574,
16061,
51,
527,
52,
6977,
52,
55,
60,
57,
54,
57,
54,
60,
56,
52,
106,
11144,
50,
1048,
50,
687,
1090,
50,
489,
2970,
1090,
50,
285,
50,
41468,
310,
453,
1698,
574,
1169,
51,
951,
51,
527,
52,
17775,
109,
692,
2864,
52,
58,
59,
53,
55,
62,
56,
53,
358,
61,
57,
1939,
59,
57,
104,
56,
53,
102,
55,
62,
380
] | -2,230,283,801,059,595,500
| true
|
su.sadrobot.yashlang.controller.VideoItemActions;
import su.sadrobot.yashlang.model.VideoDatabase;
import su.sadrobot.yashlang.model.VideoItem;
import su.sadrobot.yashlang.view.OnListItemClickListener;
import su.sadrobot.yashlang.view.VideoItemPagedListAdapter;
/**
*
*/
public class HistoryActivity extends AppCompatActivity {
private RecyclerView videoList;
private View emptyView;
private final Handler handler = new Handler();
private LiveData<PagedList<VideoItem>> videoItemsLiveData;
private final RecyclerView.AdapterDataObserver emptyListObserver = new RecyclerView.AdapterDataObserver() {
// https://stackoverflow.com/questions/47417645/empty-view-on-a-recyclerview
// https://stackoverflow.com/questions/27414173/equivalent-of-listview-setemptyview-in-recyclerview
// https://gist.github.com/sheharyarn/5602930ad84fa64c30a29ab
|
.sadrobot.yashlang.view.OnListItemClickListener;
import su.sadrobot.yashlang.view.VideoItemPagedListAdapter;
/**
*
*/
public class HistoryActivity extends AppCompatActivity {
private RecyclerView videoList;
private View emptyView;
private final Handler handler = new Handler();
private LiveData<PagedList<VideoItem>> videoItemsLiveData;
private final RecyclerView.AdapterDataObserver emptyListObserver = new RecyclerView.AdapterDataObserver() {
// https://stackoverflow.com/questions/47417645/empty-view-on-a-recyclerview
// https://stackoverflow.com/questions/27414173/equivalent-of-listview-setemptyview-in-recyclerview
// https://gist.github.com/sheharyarn/5602930ad84fa64c30a29ab
|
videoList;
private View emptyView;
private final Handler handler = new Handler();
private LiveData<PagedList<VideoItem>> videoItemsLiveData;
private final RecyclerView.AdapterDataObserver emptyListObserver = new RecyclerView.AdapterDataObserver() {
// https://stackoverflow.com/questions/47417645/empty-view-on-a-recyclerview
// https://stackoverflow.com/questions/27414173/equivalent-of-listview-setemptyview-in-recyclerview
// https://gist.github.com/sheharyarn/5602930ad84fa64c30a29ab
|
Observer() {
// https://stackoverflow.com/questions/47417645/empty-view-on-a-recyclerview
// https://stackoverflow.com/questions/27414173/equivalent-of-listview-setemptyview-in-recyclerview
// https://gist.github.com/sheharyarn/5602930ad84fa64c30a29ab
|
18eb69c6e
private void checkIfEmpty() {
final boolean listIsEmpty = videoList.getAdapter() == null || videoList.getAdapter().getItemCount() == 0;
emptyView.setVisibility(
|
SignPixelPanel.java
|
/FileExtraction/Java_unseen/mnit-rtmc_iris/src/us/mn/state/dot/tms/client/dms/SignPixelPanel.java
|
/*
* IRIS -- Intelligent Roadway Information System
* Copyright (C) 2000-2023 Minnesota Department of Transportation
* Copyright (C) 2021 Iteris Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
package us.mn.state.dot.tms.client.dms;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import javax.swing.JPanel;
import us.mn.state.dot.tms.DMS;
import us.mn.state.dot.tms.DmsColor;
import us.mn.state.dot.tms.DMSHelper;
import us.mn.state.dot.tms.RasterGraphic;
import us.mn.state.dot.tms.SignConfig;
import static us.mn.state.dot.tms.client.widget.Widgets.UI;
/**
* Pixel panel renders a representation of the pixels on a sign.
*
* @author Douglas Lau
* @author Deb Behera
*/
public class SignPixelPanel extends JPanel {
/** Create a filter color */
static private Color filterColor(Color clr, int alpha) {
return new Color(clr.getRed(), clr.getGreen(), clr.getBlue(),
alpha);
}
/** Filter color for failed DMS */
static private final Color FILTER_FAILED = filterColor(Color.GRAY, 192);
/** Filter color for DMS with controller errors */
static private final Color FILTER_ERROR = new Color(255, 64, 0, 64);
/** Get the filter color for a DMS */
static public Color filterColor(DMS dms) {
if (DMSHelper.isFailed(dms))
return FILTER_FAILED;
else if (DMSHelper.getCriticalError(dms).length() > 0)
return FILTER_ERROR;
else
return null;
}
/** Draw the pixel modules */
private boolean draw_modules = false;
/** Color of sign face */
private Color face_color;
/** Color of filter mask */
private Color filter_color;
/** Sign width (mm) */
private int width_mm = 0;
/** Sign height (mm) */
private int height_mm = 0;
/** Width of horizontal border (mm) */
private int hborder_mm;
/** Height of vertical border (mm) */
private int vborder_mm;
/** Width of individual pixels (mm) */
private int hpitch_mm = 1;
/** Height of individual pixels (mm) */
private int vpitch_mm = 1;
/** Sign pixel width */
private int width_pix = 0;
/** Sign pixel height */
private int height_pix = 0;
/** Pixel module width (pixels) */
private int mwidth_pix = 0;
/** Pixel module height (pixels) */
private int mheight_pix = 0;
/** Width of characters (pixels), zero for variable */
private int width_char;
/** Height of lines (pixels), zero for variable */
private int height_line;
/** Transform from user (mm) to screen coordinates */
private AffineTransform transform;
/** Raster graphic to paint */
private RasterGraphic graphic;
/** Create a new sign pixel panel.
* @param w Width of panel.
* @param h Height of panel. */
public SignPixelPanel(int w, int h) {
super(true);
face_color = Color.BLACK;
setSizes(w, h);
}
/** Set the sign face color.
* @param fc Face color of sign. */
public void setFaceColor(Color fc) {
face_color = fc;
repaint();
}
/** Specify if modules should be rendered */
public void setDrawModules(boolean draw) {
draw_modules = draw;
}
/** Draw vertical pixel module lines.
* @param g Graphics to draw the line */
private void drawVerticalLines(Graphics2D g) {
if (mwidth_pix <= 0 || width_pix % mwidth_pix != 0)
return;
int num_vertical_lines = width_pix / mwidth_pix;
int width_part_mm = width_mm / num_vertical_lines;
int x_mp = width_part_mm / 2;
for (int x = 1; x <= num_vertical_lines; x++) {
int xlines_mm = width_mm - (x * width_part_mm);
g.setColor(Color.WHITE);
g.drawLine(xlines_mm, 0, xlines_mm, height_mm);
g.drawString(String.valueOf(x), x_mp, 0);
g.drawString(String.valueOf(x), x_mp, height_mm);
x_mp += width_part_mm;
}
}
/** Draw hotizontal lines pixel module lines.
* @param g Graphics to draw the line */
private void drawHorizontalLines(Graphics2D g) {
if (mheight_pix <= 0 || height_pix % mheight_pix != 0)
return;
int num_horizontal_lines = height_pix / mheight_pix;
int height_part_mm = height_mm / num_horizontal_lines;
int y_mp = height_part_mm / 2;
for (int y = 1; y <= num_horizontal_lines; y++) {
int ylines_mm = height_mm - (y * height_part_mm);
g.setColor(Color.WHITE);
g.drawLine(0, ylines_mm, width_mm, ylines_mm);
g.drawString(String.valueOf(y), 0, y_mp);
g.setColor(Color.DARK_GRAY);
g.drawString(String.valueOf(y), width_mm + 10, y_mp);
y_mp += height_part_mm;
}
}
/** Draw the pixel modules.
* @param g Graphics to draw the line */
private void drawPixelLines(Graphics2D g) {
if (draw_modules) {
Font font = new Font("Serif", Font.PLAIN, 100);
g.setFont(font);
drawVerticalLines(g);
drawHorizontalLines(g);
}
}
/** Set the sign filter color.
* @param fc Filter color of sign. */
public void setFilterColor(Color fc) {
filter_color = fc;
repaint();
}
/** Set the panel size */
private void setSizes(int width, int height) {
Dimension d = UI.dimension(width, height);
setMinimumSize(d);
setPreferredSize(d);
}
/** Set the graphic displayed */
public void setGraphic(RasterGraphic rg) {
graphic = rg;
repaint();
}
/** Paint this on the screen */
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
rescale();
doPaint((Graphics2D) g, graphic);
}
/** Rescale when the component is resized or the sign changes */
private void rescale() {
int wp = getWidth();
int hp = getHeight();
if (wp > 0 && hp > 0)
rescale(wp, hp);
}
/** Rescale the component to the specified size */
private void rescale(double w, double h) {
int w_mm = width_mm;
int h_mm = height_mm;
if (w_mm > 0 && h_mm > 0) {
double sx = w / w_mm;
double sy = h / h_mm;
double scale = Math.min(sx, sy);
double tx = w_mm * (sx - scale) / 2;
double ty = h_mm * (sy - scale) / 2;
AffineTransform t = new AffineTransform();
t.translate(tx, ty);
t.scale(scale, scale);
transform = t;
} else
transform = null;
}
/** Paint the pixel panel onto a graphics context */
private void doPaint(Graphics2D g, RasterGraphic rg) {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
AffineTransform t = transform;
if (t != null) {
g.transform(t);
g.setColor(face_color);
g.fillRect(0, 0, width_mm, height_mm);
drawPixelLines(g);
if (rg != null)
paintPixels(g, rg);
Color fc = filter_color;
if (fc != null) {
g.setColor(fc);
g.fillRect(0, 0, width_mm, height_mm);
}
}
}
/** Paint the pixels of the sign */
private void paintPixels(Graphics2D g, RasterGraphic rg) {
// NOTE: unlit pixels are drawn first to allow blooming to
// overdraw for lit pixels
paintUnlitPixels(g, rg);
paintLitPixels(g, rg);
}
/** Paint the unlit pixels */
private void paintUnlitPixels(Graphics2D g, RasterGraphic rg) {
g.setColor(Color.DARK_GRAY);
int px = Math.round(getHorizontalPitch());
int py = Math.round(getVerticalPitch());
for (int y = 0; y < height_pix; y++) {
int yy = Math.round(getPixelY(y));
for (int x = 0; x < width_pix; x++) {
if (!rg.getPixel(x, y).isLit()) {
int xx = Math.round(getPixelX(x));
g.fillRect(xx, yy, px, py);
}
}
}
}
/** Paint the lit pixels */
private void paintLitPixels(Graphics2D g, RasterGraphic rg) {
float bx = getBloomX();
float by = getBloomY();
int px = Math.round(getHorizontalPitch() + bx);
int py = Math.round(getVerticalPitch() + by);
for (int y = 0; y < height_pix; y++) {
int yy = Math.round(getPixelY(y) - by / 2);
for (int x = 0; x < width_pix; x++) {
int xx = Math.round(getPixelX(x) - bx / 2);
DmsColor clr = rg.getPixel(x, y);
if (clr.isLit()) {
g.setColor(clr.color);
g.fillOval(xx, yy, px, py);
}
}
}
}
/** Get the bloom in the x-direction */
private float getBloomX() {
return getHorizontalPitch() / 2;
}
/** Get the x-distance to the given pixel */
private float getPixelX(int x) {
return getHorizontalBorder() + getCharacterOffset(x) +
getHorizontalPitch() * x;
}
/** Get the character offset (for character-matrix signs only) */
private float getCharacterOffset(int x) {
if (width_char > 0)
return (x / width_char) * calculateCharGap();
else
return 0;
}
/** Calculate the width of the gap between characters (mm) */
private float calculateCharGap() {
float excess = width_mm - 2 * getHorizontalBorder() -
width_pix * getHorizontalPitch();
int gaps = getCharacterGaps();
if (excess > 0 && gaps > 0)
return excess / gaps;
else
return 0;
}
/** Get the horizontal border (mm). This does some sanity checks in
* case the sign vendor supplies stupid values. */
private float getHorizontalBorder() {
float excess = width_mm - getHorizontalPitch() *
(width_pix + getCharacterGaps());
return Math.min(hborder_mm, Math.max(0, excess / 2));
}
/** Get the horizontal pitch (mm). This does some sanity checks in
* case the sign vendor supplies stupid values. */
private float getHorizontalPitch() {
float gaps = width_pix + getCharacterGaps();
float mx = gaps > 0 ? width_mm / gaps : width_mm;
return Math.min(hpitch_mm, mx);
}
/** Get the number of gaps between characters */
private int getCharacterGaps() {
return (width_char > 1 && width_pix > width_char) ?
width_pix / width_char - 1 : 0;
}
/** Get the bloom in the y-direction */
private float getBloomY() {
return getVerticalPitch() / 2;
}
/** Get the y-distance to the given pixel */
private float getPixelY(int y) {
return getVerticalBorder() + getLineOffset(y) +
getVerticalPitch() * y;
}
/** Get the line offset (for line- or character-matrix signs) */
private float getLineOffset(int y) {
if (height_line > 0)
return (y / height_line) * calculateLineGap();
else
return 0;
}
/** Calculate the height of the gap between lines (mm) */
private float calculateLineGap() {
float excess = height_mm - 2 * getVerticalBorder() -
height_pix * getVerticalPitch();
int gaps = getLineGaps();
if (excess > 0 && gaps > 0)
return excess / gaps;
else
return 0;
}
/** Get the vertical border (mm). This does some sanity checks in case
* the sign vendor supplies stupid values. */
private float getVerticalBorder() {
float excess = height_mm - getVerticalPitch() *
(height_pix + getLineGaps());
return Math.min(vborder_mm, Math.max(0, excess / 2));
}
/** Get the vertical pitch (mm). This does some sanity checks in case
* the sign vendor supplies stupid values. */
private float getVerticalPitch() {
float gaps = height_pix + getLineGaps();
float mx = gaps > 0 ? height_mm / gaps : height_mm;
return Math.min(vpitch_mm, mx);
}
/** Get the number of gaps between lines */
private int getLineGaps() {
return (height_line > 1 && height_pix > height_line) ?
height_pix / height_line - 1 : 0;
}
/** Set the dimensions from s sign configuration */
public void setDimensions(SignConfig sc) {
setPhysicalDimensions(sc);
setLogicalDimensions(sc);
}
/** Set the physical dimensions from a sign configuration */
private void setPhysicalDimensions(SignConfig sc) {
if (sc != null) {
int w = sc.getFaceWidth();
int h = sc.getFaceHeight();
int ph = sc.getPitchHoriz();
int pv = sc.getPitchVert();
int bh = sc.getBorderHoriz();
int bv = sc.getBorderVert();
setPhysicalDimensions(w, h, bh, bv, ph, pv);
} else
setPhysicalDimensions(0, 0, 0, 0, 0, 0);
}
/** Set the physical sign dimensions */
public void setPhysicalDimensions(int w, int h, int hb, int vb, int hp,
int vp)
{
width_mm = Math.max(0, w);
height_mm = Math.max(0, h);
hborder_mm = Math.max(0, hb);
vborder_mm = Math.max(0, vb);
hpitch_mm = Math.max(1, hp);
vpitch_mm = Math.max(1, vp);
}
/** Set the logical dimensions from a sign configuration */
private void setLogicalDimensions(SignConfig sc) {
if (sc != null) {
int pw = sc.getPixelWidth();
int ph = sc.getPixelHeight();
int cw = sc.getCharWidth();
int ch = sc.getCharHeight();
int mw = sc.getModuleWidth();
int mh = sc.getModuleHeight();
setLogicalDimensions(pw, ph, cw, ch, mw, mh);
} else
setLogicalDimensions(0, 0, 0, 0, 0, 0);
}
/** Set the logical sign dimensions */
public void setLogicalDimensions(int w, int h, int wc, int hl,
int mw, int mh)
{
width_pix = Math.max(0, w);
height_pix = Math.max(0, h);
width_char = Math.max(0, wc);
height_line = Math.max(0, hl);
mwidth_pix = Math.max(0, mw);
mheight_pix = Math.max(0, mh);
}
/** Set the logical sign dimensions */
public void setLogicalDimensions(int w, int h, int wc, int hl) {
setLogicalDimensions(w, h, wc, hl, 0, 0);
}
/** Get the AffineTransform object used to translate and scale the graphic
* within the component. */
public AffineTransform getTransform() {
return transform;
}
}
| 13,338
|
Java
|
.java
|
mnit-rtmc/iris
| 40
| 17
| 26
|
2019-08-14T18:16:40Z
|
2024-05-08T17:08:16Z
|
6f9cebe79f370da3aaaad99fbc5528e57efc0c6f345d55d0c488bc7d2d7913f5
|
[] |
[
1127,
222,
338,
14095,
1309,
790,
2871,
44433,
29007,
3094,
10422,
1189,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
53,
53,
50,
55,
53,
55,
56,
244,
7535,
13488,
5735,
24481,
451,
23597,
387,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
55,
54,
244,
8348,
316,
6367,
51,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
588,
222,
1337,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
1598,
51,
105,
893,
64,
222,
222,
485,
1401,
51,
8236,
51,
1530,
64,
222,
485,
1401,
51,
8236,
51,
9884,
64,
222,
485,
1401,
51,
8236,
51,
3728,
64,
222,
485,
1401,
51,
8236,
51,
8524,
64,
222,
485,
1401,
51,
8236,
51,
8524,
55,
73,
64,
222,
485,
1401,
51,
8236,
51,
12177,
33404,
64,
222,
485,
1401,
51,
8236,
51,
12338,
51,
35883,
4879,
64,
222,
485,
3698,
51,
5934,
51,
32273,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
73,
2758,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
73,
893,
1530,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
73,
2758,
2775,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
21556,
23903,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
3399,
1081,
64,
222,
485,
924,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
1598,
51,
3872,
51,
13380,
51,
2299,
64,
222,
222,
1350,
222,
338,
20244,
7992,
30959,
331,
10323,
451,
341,
10888,
563,
331,
2613,
51,
222,
338,
222,
338,
496,
2133,
493,
663,
38666,
517,
4474,
222,
338,
496,
2133,
21945,
4284,
2752,
102,
222,
588,
222,
942,
462,
7443,
7040,
3686,
2041,
22299,
320,
499,
221,
1350,
2673,
331,
2785,
1989,
588,
222,
221,
1592,
964,
5459,
2785,
1530,
45,
1530,
1553,
119,
49,
648,
7461,
46,
320,
376,
221,
620,
556,
5459,
45,
20626,
51,
390,
4038,
1046,
1553,
119,
51,
390,
14857,
1046,
1553,
119,
51,
390,
8991,
1046,
374,
221,
4945,
312,
222,
221,
130,
499,
221,
1350,
8301,
1989,
456,
3818,
493,
2758,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
10811,
299,
2785,
1530,
45,
1530,
51,
32113,
49,
244,
54,
62,
55,
312,
499,
221,
1350,
8301,
1989,
456,
493,
2758,
642,
5940,
3896,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
2946,
299,
556,
5459,
45,
55,
58,
58,
49,
244,
59,
57,
49,
244,
53,
49,
244,
59,
57,
312,
499,
221,
1350,
1408,
341,
2785,
1989,
456,
331,
493,
2758,
588,
222,
221,
1592,
581,
5459,
2785,
1530,
45,
73,
2758,
362,
893,
46,
320,
376,
221,
344,
327,
73,
2758,
2775,
51,
316,
5296,
45,
105,
893,
509,
374,
221,
620,
32626,
100,
10811,
64,
376,
221,
728,
434,
327,
73,
2758,
2775,
51,
11641,
10111,
943,
45,
105,
893,
566,
1340,
365,
868,
244,
53,
46,
374,
221,
620,
32626,
100,
2946,
64,
376,
221,
728,
374,
221,
620,
762,
64,
222,
221,
130,
499,
221,
1350,
10181,
341,
6592,
7912,
588,
222,
221,
2072,
1922,
5194,
100,
3490,
299,
920,
64,
499,
221,
1350,
5459,
451,
2613,
8873,
588,
222,
221,
2072,
5459,
8873,
100,
1507,
64,
499,
221,
1350,
5459,
451,
2785,
5967,
588,
222,
221,
2072,
5459,
2785,
100,
1507,
64,
499,
221,
1350,
7443,
1882,
327,
2861,
46,
588,
222,
221,
2072,
648,
1882,
100,
2861,
299,
244,
53,
64,
499,
221,
1350,
7443,
2401,
327,
2861,
46,
588,
222,
221,
2072,
648,
2401,
100,
2861,
299,
244,
53,
64,
499,
221,
1350,
16211,
451,
14828,
3184,
327,
2861,
46,
588,
222,
221,
2072,
648,
439,
3489,
100,
2861,
64,
499,
221,
1350,
16248,
451,
10705,
3184,
327,
2861,
46,
588,
222,
221,
2072,
648,
373,
3489,
100,
2861,
64,
499,
221,
1350,
16211,
451,
10139,
10888,
327,
2861,
46,
588,
222,
221,
2072,
648,
439,
20644,
100,
2861,
299,
244,
54,
64,
499,
221,
1350,
16248,
451,
10139,
10888,
327,
2861,
46,
588,
222,
221,
2072,
648,
373,
20644,
100,
2861,
299,
244,
54,
64,
499,
221,
1350,
7443,
6592,
1882,
588,
222,
221,
2072,
648,
1882,
100,
14833,
299,
244,
53,
64,
499,
221,
1350,
7443,
6592,
2401,
588,
222,
221,
2072,
648,
2401,
100,
14833,
299,
244,
53,
64,
499,
221,
1350,
20244,
2313,
1882,
327,
15046,
46,
588,
222,
221,
2072,
648,
364,
1660,
100,
14833,
299,
244,
53,
64,
499,
221,
1350,
20244,
2313,
2401,
327,
15046,
46,
588,
222,
221,
2072,
648,
364,
2296,
100,
14833,
299,
244,
53,
64,
499,
221,
1350,
16211,
451,
7152,
327,
15046,
490,
5953,
456,
2702,
588,
222,
221,
2072,
648,
1882,
100,
1612,
64,
499,
221,
1350,
16248,
451,
5452,
327,
15046,
490,
5953,
456,
2702,
588,
222,
221,
2072,
648,
2401,
100,
948,
64,
499,
221,
1350,
11685,
664,
1275,
327,
2861,
46,
391,
4820,
10547,
588,
222,
221,
2072,
24671,
501,
4879,
4549,
64,
499,
221,
1350,
578,
1711,
37649,
391,
16870,
588,
222,
221,
2072,
578,
1711,
23903,
37649,
64,
499,
221,
1350,
2673,
331,
556,
2613,
6592,
7992,
51,
376,
338,
496,
772,
360,
16211,
451,
7992,
51,
376,
338,
496,
772,
439,
16248,
451,
7992,
51,
588,
222,
221,
942,
7443,
7040,
3686,
45,
429,
360,
49,
648,
439,
46,
320,
376,
221,
5282,
45,
1527,
312,
376,
221,
1179,
100,
1507,
299,
5459,
51,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
2775,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
21556,
23903,
64,
222,
485,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
3399,
1081,
64,
222,
485,
924,
1790,
51,
8200,
51,
1311,
51,
4297,
51,
121,
893,
51,
1598,
51,
3872,
51,
13380,
51,
2299,
64,
222,
222,
1350,
222,
338,
20244,
7992,
30959,
331,
10323,
451,
341,
10888,
563,
331,
2613,
51,
222,
338,
222,
338,
496,
2133,
493,
663,
38666,
517,
4474,
222,
338,
496,
2133,
21945,
4284,
2752,
102,
222,
588,
222,
942,
462,
7443,
7040,
3686,
2041,
22299,
320,
499,
221,
1350,
2673,
331,
2785,
1989,
588,
222,
221,
1592,
964,
5459,
2785,
1530,
45,
1530,
1553,
119,
49,
648,
7461,
46,
320,
376,
221,
620,
556,
5459,
45,
20626,
51,
390,
4038,
1046,
1553,
119,
51,
390,
14857,
1046,
1553,
119,
51,
390,
8991,
1046,
374,
221,
4945,
312,
222,
221,
130,
499,
221,
1350,
8301,
1989,
456,
3818,
493,
2758,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
10811,
299,
2785,
1530,
45,
1530,
51,
32113,
49,
244,
54,
62,
55,
312,
499,
221,
1350,
8301,
1989,
456,
493,
2758,
642,
5940,
3896,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
2946,
299,
556,
5459,
45,
55,
58,
58,
49,
244,
59,
57,
49,
244,
53,
49,
244,
59,
57,
312,
499,
221,
1350,
1408,
341,
2785,
1989,
456,
331,
493,
2758,
588,
222,
221,
1592,
581,
5459,
2785,
1530,
45,
73,
2758,
362,
893,
46,
320,
376,
221,
344,
327,
73,
2758,
2775,
51,
316,
5296,
45,
105,
893,
509,
374,
221,
620,
32626,
100,
10811,
64,
376,
221,
728,
434,
327,
73,
2758,
2775,
51,
11641,
10111,
943,
45,
105,
893,
566,
1340,
365,
868,
244,
53,
46,
374,
221
] | -255,774,188,793,112,060
| true
| false
| false
| false
|
[
374,
221,
4945,
312,
222,
221,
130,
499,
221,
1350,
8301,
1989,
456,
3818,
493,
2758,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
10811,
299,
2785,
1530,
45,
1530,
51,
32113,
49,
244,
54,
62,
55,
312,
499,
221,
1350,
8301,
1989,
456,
493,
2758,
642,
5940,
3896,
588,
222,
221,
1592,
964,
1175,
5459,
32626,
100,
2946,
299,
556,
5459,
45,
55,
58,
58,
49,
244,
59,
57,
49,
244,
53,
49,
244,
59,
57,
312,
499,
221,
1350,
1408,
341,
2785,
1989,
456,
331,
493,
2758,
588,
222,
221,
1592,
581,
5459,
2785,
1530,
45,
73
] | -8,786,010,980,533,629,000
| true
|
Helper;
import us.mn.state.dot.tms.RasterGraphic;
import us.mn.state.dot.tms.SignConfig;
import static us.mn.state.dot.tms.client.widget.Widgets.UI;
/**
* Pixel panel renders a representation of the pixels on a sign.
*
* @author Douglas Lau
* @author Deb Behera
*/
public class SignPixelPanel extends JPanel {
/** Create a filter color */
static private Color filterColor(Color clr, int alpha) {
return new Color(clr.getRed(), clr.getGreen(), clr.getBlue(),
alpha);
}
/** Filter color for failed DMS */
static private final Color FILTER_FAILED = filterColor(Color.GRAY, 192);
/** Filter color for DMS with controller errors */
static private final Color FILTER_ERROR = new Color(255, 64, 0, 64);
/** Get the filter color for a DMS */
static public Color filterColor(D
|
widget.Widgets.UI;
/**
* Pixel panel renders a representation of the pixels on a sign.
*
* @author Douglas Lau
* @author Deb Behera
*/
public class SignPixelPanel extends JPanel {
/** Create a filter color */
static private Color filterColor(Color clr, int alpha) {
return new Color(clr.getRed(), clr.getGreen(), clr.getBlue(),
alpha);
}
/** Filter color for failed DMS */
static private final Color FILTER_FAILED = filterColor(Color.GRAY, 192);
/** Filter color for DMS with controller errors */
static private final Color FILTER_ERROR = new Color(255, 64, 0, 64);
/** Get the filter color for a DMS */
static public Color filterColor(D
|
extends JPanel {
/** Create a filter color */
static private Color filterColor(Color clr, int alpha) {
return new Color(clr.getRed(), clr.getGreen(), clr.getBlue(),
alpha);
}
/** Filter color for failed DMS */
static private final Color FILTER_FAILED = filterColor(Color.GRAY, 192);
/** Filter color for DMS with controller errors */
static private final Color FILTER_ERROR = new Color(255, 64, 0, 64);
/** Get the filter color for a DMS */
static public Color filterColor(D
|
alpha);
}
/** Filter color for failed DMS */
static private final Color FILTER_FAILED = filterColor(Color.GRAY, 192);
/** Filter color for DMS with controller errors */
static private final Color FILTER_ERROR = new Color(255, 64, 0, 64);
/** Get the filter color for a DMS */
static public Color filterColor(D
|
MS dms) {
if (DMSHelper.isFailed(dms))
return FILTER_FAILED;
else if (DMSHelper.getCriticalError(dms).length() > 0)
|
Dataset.java
|
/FileExtraction/Java_unseen/SCI2SUGR_KEEL/src/keel/Algorithms/Decision_Trees/ID3/Dataset.java
|
/***********************************************************************
This file is part of KEEL-software, the Data Mining tool for regression,
classification, clustering, pattern mining and so on.
Copyright (C) 2004-2010
F. Herrera (herrera@decsai.ugr.es)
L. Sánchez (luciano@uniovi.es)
J. Alcalá-Fdez (jalcala@decsai.ugr.es)
S. García (sglopez@ujaen.es)
A. Fernández (alberto.fernandez@ujaen.es)
J. Luengo (julianlm@decsai.ugr.es)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
**********************************************************************/
/**
* <p>
* @author Written by Cristobal Romero (Universidad de Córdoba) 27/02/2007
* @author Modified by Cristobal Romero (Universidad de Córdoba) 19/04/2007
* @version 0.1
* @since JDK 1.5
*</p>
*/
package keel.Algorithms.Decision_Trees.ID3;
import java.util.*;
import keel.Dataset.*;
/**
* Class to implement the dataset
*/
public class Dataset
{
/** The name of the dataset. */
protected String name = "";
/** The attributes. */
protected Vector attributes;
/** The itemsets. */
protected Vector itemsets;
/** The index of the class attribute. */
protected int classIndex;
/** Keel dataset InstanceSet **/
protected InstanceSet IS;
/** Function to read the .dat file that contains the information of the dataset.
*
* @param name The reader object where the itemsets are readed.
* @param train The flag if the file is for training
*/
public Dataset( String name, boolean train )
{
try {
// create the set of instances
IS = new InstanceSet();
// Read the itemsets.
IS.readSet(name,train);
} catch (DatasetException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
} catch (HeaderFormatException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
}
//Store Dataset file attributes
readHeader();
itemsets = new Vector( IS.getNumInstances() );
// read all the itemsets
getItemsetFull();
}
/** Constructor that copies another dataset.
*
* @param dataset The dataset to be copied.
*/
public Dataset( Dataset dataset )
{
this( dataset, dataset.numItemsets() );
dataset.copyItemsets( 0, this, dataset.numItemsets() );
}
/** Constructor to copy all the attributes of another dataset but the itemsets.
*
* @param dataset The dataset to be copied.
* @param capacity The number of itemsets.
*/
public Dataset( Dataset dataset, int capacity )
{
if ( capacity < 0 )
capacity = 0;
classIndex = dataset.classIndex;
name = dataset.getName();
attributes = dataset.attributes;
itemsets = new Vector( capacity );
}
/** Function to stores header of a data file.
*
*/
private void readHeader( )
{
String attributeName;
Vector attributeValues;
int i;
name = Attributes.getRelationName();
// Create vectors to hold information temporarily.
attributes = new Vector();
keel.Dataset.Attribute at;
// store attribute,inputs and outputs of the header
for (int j =0; j<Attributes.getNumAttributes(); j++)
{
at=Attributes.getAttribute(j);
attributeName = at.getName();
// check if it is real
if(at.getType()==2)
{
float min = (float) at.getMinAttribute();
float max = (float) at.getMinAttribute();
attributes.addElement( new Attribute( attributeName, j ) );
Attribute att = (Attribute)attributes.elementAt( j );
att.setRange( min, max );
att.activate();
}
else
{
if(at.getType()==1) // check if it is integer
{
int min = (int) at.getMinAttribute();
int max = (int) at.getMinAttribute();
attributes.addElement( new Attribute( attributeName, j ) );
Attribute att = (Attribute)attributes.elementAt( j );
att.setRange( min, max );
att.activate();
}
else // it is nominal
{
attributeValues = new Vector();
for(int k=0; k<at.getNumNominalValues();k++)
{
attributeValues.addElement(at.getNominalValue(k));
}
attributes.addElement( new Attribute( attributeName, attributeValues, j ) );
Attribute att = (Attribute)attributes.elementAt( j );
att.activate();
}
}
}//for
// set the index of the output class
classIndex = Attributes.getNumAttributes() - 1;
}
/** Function to read an itemset and appends it to the dataset.
*
*
* @return True if the itemset was readed succesfully.
*
*/
private boolean getItemsetFull( )
{
//fill itemset
for( int j=0; j<IS.getNumInstances();j++)
{
double[] itemset = new double[Attributes.getNumAttributes()];
int index;
// Get values for all input attributes.
for ( int i = 0; i < Attributes.getInputNumAttributes(); i++ )
{
// check type and if there is null
if(IS.getInstance(j).getInputMissingValues(i))
itemset[i] = Itemset.getMissingValue();
else
{
if(Attributes.getInputAttribute(i).getType()==0) //nominal
{
for(int k=0; k<Attributes.getAttribute(i).getNumNominalValues();k++ )
if(Attributes.getAttribute(i).getNominalValue(k).equals( IS.getInstance(j).getInputNominalValues(i) ))
itemset[i]=(double)k;
}
else // real and integer
{
itemset[i]=IS.getInstance(j).getInputRealValues(i);
}
} // else
} //for
// Get values for output attribute.
int i=Attributes.getInputNumAttributes();
//check type and if there is null
if(IS.getInstance(j).getOutputMissingValues(0))
itemset[i] = Itemset.getMissingValue();
else
{
if(Attributes.getOutputAttribute(0).getType()==0) //nominal
{
for(int k=0; k<Attributes.getOutputAttribute(0).getNumNominalValues();k++ )
if(Attributes.getOutputAttribute(0).getNominalValue(k).equals( IS.getInstance(j).getOutputNominalValues(0) ))
itemset[i]=(double)k;
}
else // real and integer
{
itemset[i]=IS.getInstance(j).getOutputRealValues(0);
}
} // else
// Add itemset to dataset
addItemset( new Itemset( 1, itemset ) );
}// for
return true;
}
/** Function to add one itemset.
*
* @param itemset The itemset to add to the dataset.
*/
public final void addItemset( Itemset itemset )
{
Itemset newItemset = (Itemset)itemset.copy();
newItemset.setDataset( this );
itemsets.addElement( newItemset );
}
/** Returns the name of the dataset.
*
* @return the name of the dataset.
*/
public String getName()
{
return name;
}
/** Returns the attribute that has the index.
*
* @param index The index of the attribute.
* @return the attribute that has the index.
*/
public final Attribute getAttribute( int index )
{
return (Attribute) attributes.elementAt( index );
}
/** Returns the attribute that has the name.
*
* @param name The name of the attribute.
* @return the attribute that has the name.
*/
public final Attribute getAttribute( String name )
{
for ( int i = 0; i < attributes.size(); i++ )
if ( ( (Attribute)attributes.elementAt( i ) ).name().equalsIgnoreCase( name ) )
return (Attribute) attributes.elementAt( i );
return null;
}
/** Returns class attribute.
*
* @return
*/
public final Attribute getClassAttribute()
{
if ( classIndex < 0 )
{
System.err.println("Class index wrong:"+classIndex);
return null;
}
return getAttribute( classIndex );
}
/** Returns the index of the class attribute.
*
* @return the index of the class attribute.
*/
public final int getClassIndex()
{
return classIndex;
}
/** Returns the number of attributes.
*
* @return the number of attributes.
*/
public final int numAttributes()
{
return attributes.size();
}
/** Returns the number of possible values of the class attribute.
*
* @return the number of possible values of the class attribute.
*/
public final int numClasses()
{
if ( classIndex < 0 )
{
System.err.println("Class index wrong:"+classIndex);
return -1;
}
return getClassAttribute().numValues();
}
/** Returns the number of itemsets.
*
* @return the number of itemsets.
*/
public final int numItemsets()
{
return itemsets.size();
}
/** Function to remove an itemset at the given position.
*
* @param index The index of the itemset to be deleted.
*/
public final void delete( int index )
{
itemsets.removeElementAt( index );
}
/** Function to remove all the attributes with missing value in the given attribute.
*
* @param attIndex The index of the attribute.
*/
public final void deleteWithMissing( int attIndex )
{
Vector newItemsets = new Vector( numItemsets() );
for ( int i = 0; i < numItemsets(); i++ )
if ( !itemset(i).isMissing( attIndex ) )
newItemsets.addElement( itemset( i ) );
itemsets = newItemsets;
}
/** Enumerates all the attributes.
*
* @return An enumeration that contains all the attributes.
*/
public Enumeration enumerateAttributes()
{
Vector help = new Vector( attributes.size() - 1 );
for ( int i = 0; i < attributes.size(); i++ )
if ( i != classIndex )
help.addElement( attributes.elementAt( i ) );
return help.elements();
}
/** Enumerates all the itemsets.
*
* @return An enumeration that contains all the itemsets.
*/
public final Enumeration enumerateItemsets()
{
return itemsets.elements();
}
/** Returns the itemset at the given position.
*
* @param index The index of the itemset.
* @return the itemset at the given position.
*/
public final Itemset itemset( int index )
{
return (Itemset)itemsets.elementAt( index );
}
/** Returns the last itemset.
*
* @return the last itemset.
*/
public final Itemset lastItemset()
{
return (Itemset)itemsets.lastElement();
}
/** Function to add the instances of one set to the end of another.
*
* @param from The index of the first that is going to be copied.
* @param dest The dataset where the itemsets are going to be copied.
* @param num The number of itemsets to copy.
*/
private void copyItemsets( int from, Dataset dest, int num )
{
for ( int i = 0; i < num; i++ )
dest.addItemset( itemset( from + i ) );
}
/** Function to compute the sum of all the weights of the itemsets.
*
* @return The weight of all the itemsets.
*/
public final double sumOfWeights()
{
double sum = 0;
for ( int i = 0; i < numItemsets(); i++ )
sum += itemset( i ).getWeight();
return sum;
}
/** Function to sort the dataset based on an attribute.
*
* @param attIndex The index of the attribute.
*/
public final void sort( int attIndex )
{
int i, j;
// move all dataset with missing values to end
j = numItemsets() - 1;
i = 0;
while ( i <= j )
{
if ( itemset( j ).isMissing( attIndex ) )
j--;
else
{
if ( itemset( i ).isMissing( attIndex ) )
{
swap( i, j );
j--;
}
i++;
}
}
quickSort( attIndex, 0, j );
}
/** Function to implementate the quicksort method.
*
* @param attIndex The index of the attribute used to sort the itemsets.
* @param lo0 Minimum value.
* @param hi0 Maximum value.
*/
private void quickSort( int attIndex, int lo0, int hi0 )
{
int lo = lo0, hi = hi0;
double mid, midPlus, midMinus;
if ( hi0 > lo0 )
{
// Arbitrarily establishing partition element as the
// midpoint of the array.
mid = itemset( ( lo0 + hi0 ) / 2 ).getValue( attIndex );
midPlus = mid + 1e-6;
midMinus = mid - 1e-6;
// loop through the array until indices cross
while( lo <= hi )
{
// find the first element that is greater than or equal to
// the partition element starting from the left Index.
while ( ( itemset( lo ).getValue( attIndex ) < midMinus ) && ( lo < hi0 ) )
++lo;
// find an element that is smaller than or equal to
// the partition element starting from the right Index.
while ( ( itemset( hi ).getValue( attIndex ) > midPlus ) && ( hi > lo0 ) )
--hi;
// if the indexes have not crossed, swap
if( lo <= hi )
{
swap( lo,hi );
++lo;
--hi;
}
}
// If the right index has not reached the left side of array
// must now sort the left partition.
if( lo0 < hi )
quickSort( attIndex, lo0, hi );
// If the left index has not reached the right side of array
// must now sort the right partition.
if( lo < hi0 )
quickSort( attIndex, lo, hi0 );
}
}
/** Function to swap two itemsets.
*
* @param i The first itemset.
* @param j The second itemset.
*/
private void swap( int i, int j )
{
Object help = itemsets.elementAt( i );
itemsets.insertElementAt( itemsets.elementAt( j ), i );
itemsets.removeElementAt( i + 1 );
itemsets.insertElementAt( help, j );
itemsets.removeElementAt( j + 1 );
}
}
| 14,912
|
Java
|
.java
|
SCI2SUGR/KEEL
| 126
| 50
| 18
|
2015-09-18T07:40:54Z
|
2018-03-05T17:45:40Z
|
91c18cf3ec62a2abc783a4d2d647f6087c6a7e3360f438eb3b1674f1689fb06f
|
[] |
[
18200,
14525,
499,
221,
2287,
822,
458,
1760,
451,
1242,
74,
2165,
50,
12300,
49,
341,
2426,
7535,
318,
4572,
456,
18051,
49,
1676,
221,
15358,
49,
34406,
49,
5275,
42440,
480,
1278,
563,
51,
499,
221,
10585,
327,
72,
46,
244,
55,
53,
53,
57,
50,
55,
53,
54,
53,
3038,
221,
75,
51,
696,
549,
3017,
327,
109,
549,
3017,
69,
305,
1766,
3063,
51,
122,
791,
51,
326,
46,
303,
517,
51,
377,
9045,
1075,
127,
327,
11508,
25720,
69,
330,
735,
4811,
51,
326,
46,
303,
990,
51,
2770,
1299,
1597,
50,
75,
36964,
327,
39515,
1299,
102,
69,
305,
1766,
3063,
51,
122,
791,
51,
326,
46,
303,
377,
51,
590,
10272,
15559,
327,
1889,
18483,
127,
69,
122,
4615,
291,
51,
326,
46,
303,
418,
51,
525,
2369,
9045,
36964,
327,
298,
47192,
51,
1036,
10158,
36964,
69,
122,
4615,
291,
51,
326,
46,
303,
990,
51,
45304,
838,
116,
327,
30152,
2560,
12779,
69,
305,
1766,
3063,
51,
122,
791,
51,
326,
46,
499,
221,
2287,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
221,
302,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
221,
1402,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
221,
45,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
499,
221,
2287,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
221,
717,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
221,
22265,
7760,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
221,
21307,
6153,
5062,
1196,
456,
1851,
4261,
51,
499,
221,
4296,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
221,
40307,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
1930,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
682,
222,
4241,
13214,
222,
222,
1350,
222,
47,
350,
117,
67,
222,
47,
496,
2133,
48449,
829,
409,
11581,
926,
298,
578,
437,
2168,
327,
1079,
5822,
7240,
428,
409,
2122,
5344,
926,
102,
46,
244,
55,
60,
52,
53,
55,
52,
55,
53,
53,
60,
222,
47,
496,
2133,
13124,
829,
409,
11581,
926,
298,
578,
437,
2168,
327,
1079,
5822,
7240,
428,
409,
2122,
5344,
926,
102,
46,
244,
54,
62,
52,
53,
57,
52,
55,
53,
53,
60,
222,
47,
496,
1687,
244,
53,
51,
54,
222,
47,
496,
8152,
33047,
244,
54,
51,
58,
222,
18056,
117,
67,
222,
1975,
222,
222,
1337,
3973,
361,
51,
30627,
51,
24562,
100,
34277,
51,
798,
56,
64,
222,
485,
1401,
51,
1058,
7737,
222,
222,
485,
3973,
361,
51,
9440,
7737,
499,
222,
1350,
1676,
338,
1727,
391,
2075,
341,
5984,
1676,
588,
222,
222,
942,
462,
19265,
222,
128,
222,
221,
1350,
906,
655,
451,
341,
5984,
51,
588,
222,
221,
5332,
910,
655,
299,
5127,
3038,
221,
1350,
906,
5437,
51,
588,
222,
221,
5332,
4126,
5437,
64,
3038,
221,
1350,
906,
1641,
2047,
51,
588,
222,
221,
5332,
4126,
1641,
2047,
64,
221,
15662,
221,
1350,
906,
1671,
451,
341,
462,
3895,
51,
588,
222,
221,
5332,
648,
462,
1301,
64,
3038,
221,
1350,
23433,
361,
5984,
11619,
903,
12570,
222,
221,
5332,
11619,
903,
2771,
64,
499,
221,
1350,
4564,
391,
1511,
341,
657,
2923,
822,
708,
4326,
341,
2490,
451,
341,
5984,
51,
376,
338,
4517,
338,
496,
772,
655,
4238,
221,
1338,
6201,
1319,
2174,
341,
1641,
2047,
904,
334,
2397,
51,
376,
338,
496,
772,
5877,
281,
906,
4666,
434,
341,
822,
458,
456,
7924,
376,
588,
682,
221,
942,
19265,
45,
910,
655,
49,
1922,
5877,
848,
222,
221,
128,
27040,
221,
1287,
320,
27040,
221,
325,
1506,
341,
758,
451,
6947,
5246,
221,
221,
1309,
299,
556,
11619,
903,
492,
27040,
221,
325,
4858,
341,
1641,
2047,
51,
376,
221,
1309,
51,
870,
903,
45,
444,
49,
3441,
312,
376,
221,
130,
2385,
327,
9440,
1002,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752,
5984,
6947,
742,
374,
221,
106,
51,
9428,
492,
374,
221,
1615,
51,
4788,
3766,
54,
312,
376,
221,
130,
2385,
327,
2661,
25931,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752,
5984,
6947,
742,
374,
221,
106,
51,
9428,
492,
374,
221,
1615,
51,
4788,
3766,
54,
312,
376,
221,
130,
4102,
221,
325,
2796,
19265,
822,
5437,
376,
221,
870,
2661,
492,
3051,
221,
221,
1113,
2047,
299,
556,
4126,
45,
2771,
51,
15192,
8354,
365,
1110,
682,
313,
27147,
221,
325,
1511,
1187,
341,
1641,
2047,
27147,
221,
12244,
489,
4737,
492,
682,
313,
280,
34522,
221,
130,
353,
3067,
221,
1350,
12836,
708,
8685,
4691,
5984,
51,
376,
338,
4517,
338,
496,
772,
5984,
221,
221,
1338,
5984,
391,
545,
14664,
51,
376,
588,
682,
221,
942,
19265,
45,
19265,
5984,
848,
222,
221,
128,
27147,
221,
597,
45,
5984,
49,
5984,
51,
1538,
1114,
2047,
365,
1110,
27147,
221,
5709,
51,
3014,
1114,
2047,
45,
244,
53,
49,
477,
49,
5984,
51,
1538,
1114,
2047,
365,
1110,
222,
221,
130,
3051,
221,
27147,
27147,
27147,
27147,
682,
221,
1350,
12836,
391,
1948,
1187,
341,
5437,
451,
4691,
5984,
1294,
341,
1641,
2047,
51,
9075,
221,
338,
9075,
221,
338,
496,
772,
5984,
221,
221,
1338,
5984,
391,
545,
14664,
51,
27147,
338,
496,
772,
13821,
221,
221,
1338,
1470,
451,
1641,
2047,
51,
27147,
588,
682,
221,
942,
19265,
45,
19265,
5984,
49,
648,
13821,
848,
1676,
221,
128,
27147,
221,
344,
327,
13821,
350,
244,
53,
848,
9075,
313,
221,
13895,
299,
244,
53,
64,
294,
27147,
221,
842,
1301,
299,
5984,
51,
842,
1301,
64,
27147,
221,
444,
299,
5984,
51,
5175,
492,
27147,
221,
5855,
299,
5984,
51,
5855,
64,
27147,
221,
1113,
2047,
299,
556,
4126,
45,
13821,
1110,
222,
221,
130,
3051,
221,
1350,
4564,
391,
15369,
3353,
451,
331,
727,
822,
51,
27147,
338,
3751,
221,
588,
9075,
221,
2072,
782,
1511,
2661,
45,
848,
9075,
221,
128,
27147,
221,
671,
3895,
577,
64,
27147,
221,
2880,
3895,
3367,
64,
27147
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,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,
128,
222,
221,
1350,
906,
655,
451,
341,
5984,
51,
588,
222,
221,
5332,
910,
655,
299,
5127,
3038,
221,
1350,
906,
5437,
51,
588,
222,
221,
5332,
4126,
5437,
64,
3038,
221,
1350,
906,
1641,
2047,
51,
588,
222,
221,
5332,
4126,
1641,
2047,
64,
221,
15662,
221,
1350,
906,
1671,
451,
341,
462,
3895,
51,
588,
222,
221,
5332,
648,
462,
1301,
64,
3038,
221,
1350,
23433,
361,
5984,
11619,
903,
12570,
222,
221,
5332,
11619,
903,
2771,
64,
499,
221,
1350,
4564,
391,
1511,
341,
657,
2923,
822,
708,
4326,
341,
2490,
451,
341,
5984,
51,
376,
338,
4517,
338,
496,
772,
655,
4238,
221,
1338,
6201,
1319,
2174,
341,
1641,
2047,
904,
334,
2397,
51,
376,
338,
496,
772,
5877,
281,
906,
4666,
434,
341,
822,
458,
456,
7924,
376,
588,
682,
221,
942,
19265,
45,
910,
655,
49,
1922,
5877,
848,
222,
221,
128,
27040,
221,
1287,
320,
27040,
221,
325,
1506,
341,
758,
451,
6947,
5246,
221,
221,
1309,
299,
556,
11619,
903,
492,
27040,
221,
325,
4858,
341,
1641,
2047,
51,
376,
221,
1309,
51,
870,
903,
45,
444,
49,
3441,
312,
376,
221,
130,
2385,
327,
9440,
1002,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752,
5984,
6947,
742,
374,
221,
106,
51,
9428,
492,
374,
221,
1615,
51,
4788,
3766,
54,
312,
376,
221,
130,
2385,
327,
2661,
25931,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752,
5984,
6947,
742,
374,
221,
106,
51,
9428,
492,
374,
221,
1615,
51,
4788,
3766,
54,
312,
376,
221,
130,
4102,
221,
325,
2796,
19265,
822,
5437,
376,
221,
870,
2661,
492,
3051,
221,
221,
1113,
2047,
299,
556,
4126,
45,
2771,
51,
15192,
8354,
365,
1110,
682,
313,
27147
] | -3,060,593,717,455,791,000
| true
| false
| false
| false
|
[
222,
221,
128,
27040,
221,
1287,
320,
27040,
221,
325,
1506,
341,
758,
451,
6947,
5246,
221,
221,
1309,
299,
556,
11619,
903,
492,
27040,
221,
325,
4858,
341,
1641,
2047,
51,
376,
221,
1309,
51,
870,
903,
45,
444,
49,
3441,
312,
376,
221,
130,
2385,
327,
9440,
1002,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752,
5984,
6947,
742,
374,
221,
106,
51,
9428,
492,
374,
221,
1615,
51,
4788,
3766,
54,
312,
376,
221,
130,
2385,
327,
2661,
25931,
503,
46,
320,
374,
221,
1615,
51,
560,
51,
3962,
459,
943,
7752
] | 8,877,432,412,545,928,000
| true
|
public class Dataset
{
/** The name of the dataset. */
protected String name = "";
/** The attributes. */
protected Vector attributes;
/** The itemsets. */
protected Vector itemsets;
/** The index of the class attribute. */
protected int classIndex;
/** Keel dataset InstanceSet **/
protected InstanceSet IS;
/** Function to read the.dat file that contains the information of the dataset.
*
* @param name The reader object where the itemsets are readed.
* @param train The flag if the file is for training
*/
public Dataset( String name, boolean train )
{
try {
// create the set of instances
IS = new InstanceSet();
// Read the itemsets.
IS.readSet(name,train);
} catch (DatasetException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
} catch (HeaderFormatException e) {
System.out.println("Error loading
|
/** The index of the class attribute. */
protected int classIndex;
/** Keel dataset InstanceSet **/
protected InstanceSet IS;
/** Function to read the.dat file that contains the information of the dataset.
*
* @param name The reader object where the itemsets are readed.
* @param train The flag if the file is for training
*/
public Dataset( String name, boolean train )
{
try {
// create the set of instances
IS = new InstanceSet();
// Read the itemsets.
IS.readSet(name,train);
} catch (DatasetException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
} catch (HeaderFormatException e) {
System.out.println("Error loading
|
the dataset.
*
* @param name The reader object where the itemsets are readed.
* @param train The flag if the file is for training
*/
public Dataset( String name, boolean train )
{
try {
// create the set of instances
IS = new InstanceSet();
// Read the itemsets.
IS.readSet(name,train);
} catch (DatasetException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
} catch (HeaderFormatException e) {
System.out.println("Error loading
|
{
try {
// create the set of instances
IS = new InstanceSet();
// Read the itemsets.
IS.readSet(name,train);
} catch (DatasetException e) {
System.out.println("Error loading dataset instances");
e.printStackTrace();
System.exit(-1);
} catch (HeaderFormatException e) {
System.out.println("Error loading
|
dataset instances");
e.printStackTrace();
System.exit(-1);
}
//Store Dataset file attributes
readHeader();
itemsets = new Vector( IS.getNumInstances() );
|
DeliveryRequest.java
|
/FileExtraction/Java_unseen/LSIR_gsn/gsn-tiny/tiny-gsn/src/main/java/tinygsn/beans/DeliveryRequest.java
|
package tinygsn.beans;
import android.os.Parcel;
import android.os.Parcelable;
public class DeliveryRequest implements Parcelable {
private String url;
private String clientID;
private String clientSecret;
private int mode;
private String vsname;
private long lastTime;
private int id;
private boolean active;
private long iterationTime = 30000;
public DeliveryRequest(String url, String clientID, String clientSecret, int mode, String vsname,
int id, long iterationTime) {
this.url = url;
this.clientID = clientID;
this.clientSecret = clientSecret;
this.mode = mode;
this.vsname = vsname;
this.id = id;
this.iterationTime = iterationTime;
}
public DeliveryRequest(Parcel source) {
this.id = source.readInt();
this.url = source.readString();
this.clientID = source.readString();
this.clientSecret = source.readString();
this.vsname = source.readString();
this.mode = source.readInt();
this.lastTime = source.readLong();
this.iterationTime = source.readLong();
this.active = source.readString().equals("1");
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getClientID() {
return clientID;
}
public void setClientID(String clientID) {
this.clientID = clientID;
}
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public int getMode() {
return mode;
}
public void setMode(int mode) {
this.mode = mode;
}
public String getVsname() {
return vsname;
}
public void setVsname(String vsname) {
this.vsname = vsname;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long lastTime) {
this.lastTime = lastTime;
}
public long getIterationTime() {
return iterationTime;
}
public void setIterationTime(long iterationTime) {
this.iterationTime = iterationTime;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(url);
dest.writeString(clientID);
dest.writeString(clientSecret);
dest.writeString(vsname);
dest.writeInt(mode);
dest.writeLong(lastTime);
dest.writeLong(iterationTime);
dest.writeString(active ? "1" : "0");
}
public static final Parcelable.Creator<DeliveryRequest> CREATOR = new Creator<DeliveryRequest>() {
public DeliveryRequest createFromParcel(Parcel source) {
DeliveryRequest cf = new DeliveryRequest(source);
return cf;
}
public DeliveryRequest[] newArray(int size) {
return new DeliveryRequest[size];
}
};
}
| 2,880
|
Java
|
.java
|
LSIR/gsn
| 58
| 42
| 23
|
2014-02-16T13:41:09Z
|
2021-12-21T17:07:36Z
|
51a008421a273f14eb8db23ed47fbd864a4f1367e1184b785b9887a92eaaa138
|
[] |
[
1337,
19119,
108,
4654,
51,
9580,
64,
222,
222,
485,
2616,
51,
519,
51,
18402,
64,
222,
485,
2616,
51,
519,
51,
38258,
64,
222,
222,
942,
462,
31855,
1123,
4584,
38351,
463,
320,
222,
221,
2072,
910,
2001,
64,
222,
221,
2072,
910,
2060,
798,
64,
222,
221,
2072,
910,
2060,
7795,
64,
222,
221,
2072,
648,
2945,
64,
222,
221,
2072,
910,
8563,
444,
64,
222,
221,
2072,
1964,
2419,
1061,
64,
222,
221,
2072,
648,
828,
64,
222,
221,
2072,
1922,
4537,
64,
222,
221,
2072,
1964,
13403,
1061,
299,
244,
56,
53,
53,
53,
53,
64,
499,
221,
942,
31855,
1123,
45,
671,
2001,
49,
910,
2060,
798,
49,
910,
2060,
7795,
49,
648,
2945,
49,
910,
8563,
444,
49,
45395,
648,
828,
49,
1964,
13403,
1061,
46,
320,
376,
221,
597,
51,
983,
299,
2001,
64,
376,
221,
597,
51,
1598,
798,
299,
2060,
798,
64,
376,
221,
597,
51,
1598,
7795,
299,
2060,
7795,
64,
376,
221,
597,
51,
2832,
299,
2945,
64,
376,
221,
597,
51,
4876,
444,
299,
8563,
444,
64,
376,
221,
597,
51,
333,
299,
828,
64,
376,
221,
597,
51,
19991,
1061,
299,
13403,
1061,
64,
222,
221,
130,
499,
221,
942,
31855,
1123,
45,
18402,
1932,
46,
320,
376,
221,
597,
51,
333,
299,
1932,
51,
33798,
492,
376,
221,
597,
51,
983,
299,
1932,
51,
29842,
492,
376,
221,
597,
51,
1598,
798,
299,
1932,
51,
29842,
492,
376,
221,
597,
51,
1598,
7795,
299,
1932,
51,
29842,
492,
376,
221,
597,
51,
4876,
444,
299,
1932,
51,
29842,
492,
376,
221,
597,
51,
2832,
299,
1932,
51,
33798,
492,
376,
221,
597,
51,
2153,
1061,
299,
1932,
51,
870,
3967,
492,
376,
221,
597,
51,
19991,
1061,
299,
1932,
51,
870,
3967,
492,
376,
221,
597,
51,
2498,
299,
1932,
51,
29842,
941,
3591,
459,
54,
742,
222,
221,
130,
3067,
221,
942,
648,
19832,
365,
320,
376,
221,
620,
828,
64,
222,
221,
130,
499,
221,
942,
782,
29452,
45,
429,
828,
46,
320,
376,
221,
597,
51,
333,
299,
828,
64,
222,
221,
130,
499,
221,
942,
1922,
36470,
365,
320,
376,
221,
620,
4537,
64,
222,
221,
130,
499,
221,
942,
782,
758,
4091,
45,
4412,
4537,
46,
320,
376,
221,
597,
51,
2498,
299,
4537,
64,
222,
221,
130,
499,
221,
942,
910,
48017,
365,
320,
376,
221,
620,
2001,
64,
222,
221,
130,
499,
221,
942,
782,
758,
2226,
45,
671,
2001,
46,
320,
376,
221,
597,
51,
983,
299,
2001,
64,
222,
221,
130,
499,
221,
942,
910,
46367,
798,
365,
320,
376,
221,
620,
2060,
798,
64,
222,
221,
130,
499,
221,
942,
782,
758,
1503,
798,
45,
671,
2060,
798,
46,
320,
376,
221,
597,
51,
1598,
798,
299,
2060,
798,
64,
222,
221,
130,
499,
221,
942,
910,
46367,
7795,
365,
320,
376,
221,
620,
2060,
7795,
64,
222,
221,
130,
499,
221,
942,
782,
758,
1503,
7795,
45,
671,
2060,
7795,
46,
320,
376,
221,
597,
51,
1598,
7795,
299,
2060,
7795,
64,
222,
221,
130,
499,
221,
942,
648,
640,
2116,
365,
320,
376,
221,
620,
2945,
64,
222,
221,
130,
499,
221,
942,
782,
758,
2116,
45,
429,
2945,
46,
320,
376,
221,
597,
51,
2832,
299,
2945,
64,
222,
221,
130,
499,
221,
942,
910,
640,
14364,
444,
365,
320,
376,
221,
620,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
782,
758,
14364,
444,
45,
671,
8563,
444,
46,
320,
376,
221,
597,
51,
4876,
444,
299,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
1964,
36640,
1061,
365,
320,
376,
221,
620,
2419,
1061,
64,
222,
221,
130,
499,
221,
942,
782,
758,
3283,
1061,
45,
3239,
2419,
1061,
46,
320,
376,
221,
597,
51,
2153,
1061,
299,
2419,
1061,
64,
222,
221,
130,
499,
221,
942,
1964,
640,
21898,
1061,
365,
320,
376,
221,
620,
13403,
1061,
64,
222,
221,
130,
499,
221,
942,
782,
758,
21898,
1061,
45,
3239,
13403,
1061,
46,
320,
376,
221,
597,
51,
19991,
1061,
299,
13403,
1061,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
648,
5523,
8048,
365,
320,
376,
221,
620,
244,
53,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
48562,
18402,
45,
18402,
3481,
49,
648,
5748,
46,
320,
376,
221,
3332,
51,
31173,
45,
333,
312,
376,
221,
3332,
51,
27618,
45,
983,
312,
376,
221,
3332,
51,
27618,
45,
1598,
798,
312,
376,
221,
3332,
51,
27618,
45,
1598,
7795,
312,
376,
221,
3332,
51,
27618,
45,
4876,
444,
312,
376,
221,
3332,
51,
31173,
45,
2832,
312,
376,
221,
3332,
51,
1838,
3967,
45,
2153,
1061,
312,
376,
221,
3332,
51,
1838,
3967,
45,
19991,
1061,
312,
376,
221,
3332,
51,
27618,
45,
2498,
1037,
332,
54,
39,
518,
332,
53,
742,
222,
221,
130,
499,
221,
942,
924,
1175,
38351,
463,
51,
11147,
65,
14990,
1123,
67,
15686,
7275,
299,
556,
42576,
65,
14990,
1123,
6939,
320,
1332,
221,
942,
31855,
1123,
1506,
1811,
18402,
45,
18402,
1932,
46,
320,
2556,
221,
14990,
1123,
16233,
299,
556,
31855,
1123,
45,
1876,
312,
2556,
221,
620,
16233,
64,
376,
221,
130,
1332,
221,
942,
31855,
1123,
1197,
556,
1280,
45,
429,
1354,
46,
320,
374,
221,
620,
556,
31855,
1123,
96,
911,
988,
376,
221,
130,
499,
221,
1274,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1
]
] | 894
|
[
758,
4091,
45,
4412,
4537,
46,
320,
376,
221,
597,
51,
2498,
299,
4537,
64,
222,
221,
130,
499,
221,
942,
910,
48017,
365,
320,
376,
221,
620,
2001,
64,
222,
221,
130,
499,
221,
942,
782,
758,
2226,
45,
671,
2001,
46,
320,
376,
221,
597,
51,
983,
299,
2001,
64,
222,
221,
130,
499,
221,
942,
910,
46367,
798,
365,
320,
376,
221,
620,
2060,
798,
64,
222,
221,
130,
499,
221,
942,
782,
758,
1503,
798,
45,
671,
2060,
798,
46,
320,
376,
221,
597,
51,
1598,
798,
299,
2060,
798,
64,
222,
221,
130,
499,
221,
942,
910,
46367,
7795,
365,
320,
376,
221,
620,
2060,
7795,
64,
222,
221,
130,
499,
221,
942,
782,
758,
1503,
7795,
45,
671,
2060,
7795,
46,
320,
376,
221,
597,
51,
1598,
7795,
299,
2060,
7795,
64,
222,
221,
130,
499,
221,
942,
648,
640,
2116,
365,
320,
376,
221,
620,
2945,
64,
222,
221,
130,
499,
221,
942,
782,
758,
2116,
45,
429,
2945,
46,
320,
376,
221,
597,
51,
2832,
299,
2945,
64,
222,
221,
130,
499,
221,
942,
910,
640,
14364,
444,
365,
320,
376,
221,
620,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
782,
758,
14364,
444,
45,
671,
8563,
444,
46,
320,
376,
221,
597,
51,
4876,
444,
299,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
1964,
36640,
1061,
365,
320,
376,
221,
620,
2419,
1061,
64,
222,
221,
130,
499,
221,
942,
782,
758,
3283,
1061,
45,
3239,
2419,
1061,
46,
320,
376,
221,
597,
51,
2153,
1061,
299,
2419,
1061,
64,
222,
221,
130,
499,
221,
942,
1964,
640,
21898,
1061,
365,
320,
376,
221,
620,
13403,
1061,
64,
222,
221,
130,
499,
221,
942,
782,
758,
21898,
1061,
45,
3239,
13403,
1061,
46,
320,
376,
221,
597
] | 9,169,532,295,646,998,000
| true
| false
| false
| false
|
[
221,
620,
2945,
64,
222,
221,
130,
499,
221,
942,
782,
758,
2116,
45,
429,
2945,
46,
320,
376,
221,
597,
51,
2832,
299,
2945,
64,
222,
221,
130,
499,
221,
942,
910,
640,
14364,
444,
365,
320,
376,
221,
620,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
782,
758,
14364,
444,
45,
671,
8563,
444,
46,
320,
376,
221,
597,
51,
4876,
444,
299,
8563,
444,
64,
222,
221,
130,
499,
221,
942,
1964,
36640,
1061,
365,
320,
376,
221,
620,
2419,
1061,
64,
222,
221,
130,
499,
221,
942,
782,
758,
3283,
1061,
45,
3239,
2419
] | -7,111,442,389,352,517,000
| true
|
setActive(boolean active) {
this.active = active;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getClientID() {
return clientID;
}
public void setClientID(String clientID) {
this.clientID = clientID;
}
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public int getMode() {
return mode;
}
public void setMode(int mode) {
this.mode = mode;
}
public String getVsname() {
return vsname;
}
public void setVsname(String vsname) {
this.vsname = vsname;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long last
|
url;
}
public String getClientID() {
return clientID;
}
public void setClientID(String clientID) {
this.clientID = clientID;
}
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public int getMode() {
return mode;
}
public void setMode(int mode) {
this.mode = mode;
}
public String getVsname() {
return vsname;
}
public void setVsname(String vsname) {
this.vsname = vsname;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long last
|
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public int getMode() {
return mode;
}
public void setMode(int mode) {
this.mode = mode;
}
public String getVsname() {
return vsname;
}
public void setVsname(String vsname) {
this.vsname = vsname;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long last
|
return mode;
}
public void setMode(int mode) {
this.mode = mode;
}
public String getVsname() {
return vsname;
}
public void setVsname(String vsname) {
this.vsname = vsname;
}
public long getLastTime() {
return lastTime;
}
public void setLastTime(long last
|
Time) {
this.lastTime = lastTime;
}
public long getIterationTime() {
return iterationTime;
}
public void setIterationTime(long iterationTime) {
this
|
ModificationNotification.java
|
/FileExtraction/Java_unseen/docdoku_docdoku-plm-server/docdoku-plm-server-core/src/main/java/com/docdoku/plm/server/core/change/ModificationNotification.java
|
/*
* DocDoku, Professional Open Source
* Copyright 2006 - 2020 DocDoku SARL
*
* This file is part of DocDokuPLM.
*
* DocDokuPLM is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DocDokuPLM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with DocDokuPLM. If not, see <http://www.gnu.org/licenses/>.
*/
package com.docdoku.plm.server.core.change;
import com.docdoku.plm.server.core.common.User;
import com.docdoku.plm.server.core.product.PartIteration;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* Class which instances are attached to assemblies in order to track
* modification that happened on sub-component.
* Its purpose is to notify users that those assemblies may be impacted by these modifications.
*
* @author Florent Garin
* @version 2.0, 12/03/15
* @since V2.0
*/
@Entity
@NamedQueries ({
@NamedQuery(name="ModificationNotification.findByImpactedPartIteration", query = "SELECT n FROM ModificationNotification n WHERE n.impactedPart.iteration = :iteration AND n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId ORDER BY n.acknowledged, n.modifiedPart.partRevision.partMaster.number, n.modifiedPart.iteration DESC"),
@NamedQuery(name="ModificationNotification.removeAllOnPartRevision", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId"),
@NamedQuery(name="ModificationNotification.removeAllOnPartIteration", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId AND n.impactedPart.iteration = :iteration")
})
@Table(name="MODIFICATIONNOTIFICATION")
public class ModificationNotification implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
protected int id;
@ManyToOne(optional = false, fetch = FetchType.EAGER)
@JoinColumns({
@JoinColumn(name="MODIFIED_ITERATION", referencedColumnName="ITERATION"),
@JoinColumn(name="MODIFIED_PARTMASTER_PARTNUMBER", referencedColumnName="PARTMASTER_PARTNUMBER"),
@JoinColumn(name="MODIFIED_PARTREVISION_VERSION", referencedColumnName="PARTREVISION_VERSION"),
@JoinColumn(name="MODIFIED_WORKSPACE_ID", referencedColumnName="WORKSPACE_ID")
})
private PartIteration modifiedPart;
@ManyToOne(optional = false, fetch = FetchType.EAGER)
@JoinColumns({
@JoinColumn(name="IMPACTED_ITERATION", referencedColumnName="ITERATION"),
@JoinColumn(name="IMPACTED_PARTMASTER_PARTNUMBER", referencedColumnName="PARTMASTER_PARTNUMBER"),
@JoinColumn(name="IMPACTED_PARTREVISION_VERSION", referencedColumnName="PARTREVISION_VERSION"),
@JoinColumn(name="IMPACTED_WORKSPACE_ID", referencedColumnName="WORKSPACE_ID")
})
private PartIteration impactedPart;
private boolean acknowledged;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumns({
@JoinColumn(name = "ACKAUTHOR_LOGIN", referencedColumnName = "LOGIN"),
@JoinColumn(name = "ACKAUTHOR_WORKSPACE_ID", referencedColumnName = "WORKSPACE_ID")
})
private User acknowledgementAuthor;
@Temporal(TemporalType.TIMESTAMP)
private Date acknowledgementDate;
@Lob
private String acknowledgementComment;
public ModificationNotification() {
}
public int getId() {
return id;
}
public PartIteration getImpactedPart() {
return impactedPart;
}
public void setImpactedPart(PartIteration impactedPart) {
this.impactedPart = impactedPart;
}
public PartIteration getModifiedPart() {
return modifiedPart;
}
public void setModifiedPart(PartIteration modifiedPart) {
this.modifiedPart = modifiedPart;
}
public boolean isAcknowledged() {
return acknowledged;
}
public void setAcknowledged(boolean acknowledged) {
this.acknowledged = acknowledged;
}
public User getAcknowledgementAuthor() {
return acknowledgementAuthor;
}
public void setAcknowledgementAuthor(User acknowledgementAuthor) {
this.acknowledgementAuthor = acknowledgementAuthor;
}
public Date getAcknowledgementDate() {
return acknowledgementDate;
}
public void setAcknowledgementDate(Date acknowledgementDate) {
this.acknowledgementDate = acknowledgementDate;
}
public String getAcknowledgementComment() {
return acknowledgementComment;
}
public void setAcknowledgementComment(String acknowledgementComment) {
this.acknowledgementComment = acknowledgementComment;
}
}
| 5,507
|
Java
|
.java
|
docdoku/docdoku-plm-server
| 11
| 10
| 1
|
2020-09-17T13:17:18Z
|
2023-07-24T15:58:52Z
|
d542791ad1e949e28e3522000bb7f9a9ac3c0cc7060d3472232a45afd3243bfd
|
[] |
[
1127,
222,
338,
11235,
73,
12232,
49,
45463,
3944,
6391,
222,
338,
2657,
244,
55,
53,
53,
59,
449,
244,
55,
53,
55,
53,
11235,
73,
12232,
377,
802,
81,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
11235,
73,
12232,
2759,
82,
51,
222,
338,
222,
338,
11235,
73,
12232,
2759,
82,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
11235,
73,
12232,
2759,
82,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
11235,
73,
12232,
2759,
82,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
785,
51,
1446,
105,
12232,
51,
576,
114,
51,
1805,
51,
1284,
51,
2357,
64,
222,
222,
485,
785,
51,
1446,
105,
12232,
51,
576,
114,
51,
1805,
51,
1284,
51,
2297,
51,
1259,
64,
222,
485,
785,
51,
1446,
105,
12232,
51,
576,
114,
51,
1805,
51,
1284,
51,
2463,
51,
2655,
21898,
64,
222,
222,
485,
3698,
51,
10782,
7737,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
222,
1350,
222,
338,
1727,
1532,
6947,
904,
13079,
391,
43683,
347,
2554,
391,
4574,
222,
338,
11402,
708,
18658,
563,
1381,
50,
2307,
51,
222,
338,
26973,
11673,
458,
391,
11745,
4272,
708,
5543,
43683,
1648,
545,
14966,
337,
829,
3301,
23125,
51,
222,
338,
222,
338,
496,
2133,
525,
335,
16538,
43681,
285,
222,
338,
496,
1687,
244,
55,
51,
53,
49,
244,
54,
55,
52,
53,
56,
52,
54,
58,
222,
338,
496,
8152,
694,
55,
51,
53,
222,
588,
222,
69,
2234,
222,
69,
11061,
20889,
6001,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
20202,
1915,
30995,
2655,
21898,
411,
2487,
299,
332,
4635,
329,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
19991,
299,
518,
19991,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
17062,
6944,
329,
51,
478,
28456,
3899,
49,
329,
51,
10492,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
49,
329,
51,
10492,
2655,
51,
19991,
21733,
2132,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
28768,
1501,
2655,
14021,
411,
2487,
299,
332,
6698,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
2132,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
28768,
1501,
2655,
21898,
411,
2487,
299,
332,
6698,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
3133,
329,
51,
440,
30995,
2655,
51,
19991,
299,
518,
19991,
678,
222,
1770,
222,
69,
1617,
45,
444,
366,
2414,
12369,
9586,
29747,
678,
222,
942,
462,
5516,
1884,
6258,
4584,
19182,
320,
4054,
496,
35422,
45,
14008,
299,
26045,
638,
51,
35882,
46,
303,
496,
625,
303,
2532,
648,
828,
64,
465,
496,
35699,
45,
5311,
299,
920,
49,
5644,
299,
15562,
638,
51,
74,
21214,
46,
303,
496,
6256,
7633,
1389,
343,
496,
34586,
45,
444,
366,
34321,
25025,
100,
10810,
2909,
411,
15157,
16702,
366,
10810,
2909,
2132,
343,
496,
34586,
45,
444,
366,
34321,
25025,
100,
14497,
25020,
100,
14497,
10468,
411,
15157,
16702,
366,
14497,
25020,
100,
14497,
10468,
2132,
343,
496,
34586,
45,
444,
366,
34321,
25025,
100,
14497,
41940,
100,
4539,
411,
15157,
16702,
366,
14497,
41940,
100,
4539,
2132,
343,
496,
34586,
45,
444,
366,
34321,
25025,
100,
8729,
13174,
100,
798,
411,
15157,
16702,
366,
8729,
13174,
100,
798,
678,
303,
1809,
303,
964,
6695,
21898,
8851,
2655,
64,
4054,
496,
35699,
45,
5311,
299,
920,
49,
5644,
299,
15562,
638,
51,
74,
21214,
46,
303,
496,
6256,
7633,
1389,
343,
496,
34586,
45,
444,
366,
6909,
3833,
1363,
100,
10810,
2909,
411,
15157,
16702,
366,
10810,
2909,
2132,
343,
496,
34586,
45,
444,
366,
6909,
3833,
1363,
100,
14497,
25020,
100,
14497,
10468,
411,
15157,
16702,
366,
14497,
25020,
100,
14497,
10468,
2132,
343,
496,
34586,
45,
444,
366,
6909,
3833,
1363,
100,
14497,
41940,
100,
4539,
411,
15157,
16702,
366,
14497,
41940,
100,
4539,
2132,
343,
496,
34586,
45,
444,
366,
6909,
3833,
1363,
100,
8729,
13174,
100,
798,
411,
15157,
16702,
366,
8729,
13174,
100,
798,
678,
303,
1809,
303,
964,
6695,
21898,
14966,
337,
2655,
64,
465,
964,
1922,
42218,
3899,
64,
465,
496,
35699,
45,
5151,
299,
15562,
638,
51,
74,
21214,
46,
303,
496,
6256,
7633,
1389,
343,
496,
34586,
45,
444,
299,
332,
3289,
37336,
100,
23455,
411,
15157,
16702,
299,
332,
23455,
2132,
343,
496,
34586,
45,
444,
299,
332,
3289,
37336,
100,
8729,
13174,
100,
798,
411,
15157,
16702,
299,
332,
8729,
13174,
100,
798,
678,
303,
1809,
303,
964,
2694,
41909,
488,
4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,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1381,
50,
2307,
51,
222,
338,
26973,
11673,
458,
391,
11745,
4272,
708,
5543,
43683,
1648,
545,
14966,
337,
829,
3301,
23125,
51,
222,
338,
222,
338,
496,
2133,
525,
335,
16538,
43681,
285,
222,
338,
496,
1687,
244,
55,
51,
53,
49,
244,
54,
55,
52,
53,
56,
52,
54,
58,
222,
338,
496,
8152,
694,
55,
51,
53,
222,
588,
222,
69,
2234,
222,
69,
11061,
20889,
6001,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
20202,
1915,
30995,
2655,
21898,
411,
2487,
299,
332,
4635,
329,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
19991,
299,
518,
19991,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
17062,
6944,
329,
51,
478,
28456,
3899,
49,
329,
51,
10492,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
49,
329,
51,
10492,
2655,
51,
19991,
21733,
2132,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
28768,
1501,
2655,
14021,
411,
2487,
299,
332,
6698,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
2132,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
28768,
1501,
2655,
21898,
411,
2487,
299,
332,
6698,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687
] | 712,833,431,201,355,500
| true
| false
| false
| false
|
[
8801,
51,
10912,
51,
333,
299,
518,
10912,
625,
17062,
6944,
329,
51,
478,
28456,
3899,
49,
329,
51,
10492,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
49,
329,
51,
10492,
2655,
51,
19991,
21733,
2132,
310,
496,
11061,
1643,
45,
444,
366,
25114,
6258,
51,
28768,
1501,
2655,
14021,
411,
2487,
299,
332,
6698,
3767,
5516,
1884,
6258,
329,
5007,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
1687,
299,
518,
1687,
3133,
329,
51,
440,
30995,
2655,
51,
2068,
14021,
51,
2068,
8801,
51,
2188,
299,
518,
2068,
1936,
3133,
329,
51,
440,
30995,
2655
] | -2,513,202,955,120,285,700
| true
|
sub-component.
* Its purpose is to notify users that those assemblies may be impacted by these modifications.
*
* @author Florent Garin
* @version 2.0, 12/03/15
* @since V2.0
*/
@Entity
@NamedQueries ({
@NamedQuery(name="ModificationNotification.findByImpactedPartIteration", query = "SELECT n FROM ModificationNotification n WHERE n.impactedPart.iteration = :iteration AND n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId ORDER BY n.acknowledged, n.modifiedPart.partRevision.partMaster.number, n.modifiedPart.iteration DESC"),
@NamedQuery(name="ModificationNotification.removeAllOnPartRevision", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart
|
15
* @since V2.0
*/
@Entity
@NamedQueries ({
@NamedQuery(name="ModificationNotification.findByImpactedPartIteration", query = "SELECT n FROM ModificationNotification n WHERE n.impactedPart.iteration = :iteration AND n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId ORDER BY n.acknowledged, n.modifiedPart.partRevision.partMaster.number, n.modifiedPart.iteration DESC"),
@NamedQuery(name="ModificationNotification.removeAllOnPartRevision", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart
|
actedPart.iteration = :iteration AND n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart.partRevision.partMaster.workspace.id = :workspaceId ORDER BY n.acknowledged, n.modifiedPart.partRevision.partMaster.number, n.modifiedPart.iteration DESC"),
@NamedQuery(name="ModificationNotification.removeAllOnPartRevision", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart
|
Master.workspace.id = :workspaceId ORDER BY n.acknowledged, n.modifiedPart.partRevision.partMaster.number, n.modifiedPart.iteration DESC"),
@NamedQuery(name="ModificationNotification.removeAllOnPartRevision", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version = :version AND n.impactedPart.partRevision.partMaster.number = :partNumber AND n.impactedPart
|
.partRevision.partMaster.workspace.id = :workspaceId"),
@NamedQuery(name="ModificationNotification.removeAllOnPartIteration", query = "DELETE FROM ModificationNotification n WHERE n.impactedPart.partRevision.version
|
WorkflowStep.java
|
/FileExtraction/Java_unseen/miso-lims_miso-lims/core/src/main/java/uk/ac/bbsrc/tgac/miso/core/data/workflow/WorkflowStep.java
|
package uk.ac.bbsrc.tgac.miso.core.data.workflow;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.BoxPositionProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.BoxProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.IntegerProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.PoolProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.PositiveDoubleProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.PositiveIntegerProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.SampleProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.SequencerPartitionContainerProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.SequencingContainerModelProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.SkipProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.StringProgressStep;
/**
* Represents a possibly incomplete step in a Workflow.
* Responsible for describing, validating, and storing the input for a step.
*
* The default implementation of processInput is to throw an exception.
* Subclasses will override this implementation for the ProgressSteps they expect
*/
public interface WorkflowStep {
WorkflowStepPrompt getPrompt();
ProgressStep getProgressStep();
default void processInput(ProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PoolProgressStep step) {
throwUnexpectedInput();
}
default void processInput(IntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencerPartitionContainerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(StringProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SkipProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencingContainerModelProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SampleProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PositiveDoubleProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PositiveIntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(BoxProgressStep step) {
throwUnexpectedInput();
}
default void processInput(BoxPositionProgressStep step) {
throwUnexpectedInput();
}
void cancelInput();
/**
* @return message describing the data processed by this step
*/
String getLogMessage();
/**
* Private helper method
*/
default void throwUnexpectedInput() {
throw new IllegalArgumentException("Unexpected input");
}
default String getError() {
return null;
}
}
| 2,739
|
Java
|
.java
|
miso-lims/miso-lims
| 223
| 96
| 16
|
2012-06-20T13:17:28Z
|
2024-05-08T20:38:27Z
|
e6c1e9b807aae01896e58a0feabf6669e8747ef878954511363a1d358c6ec728
|
[] |
[
1337,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
64,
222,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
1723,
2746,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
1723,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
3078,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
4227,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
17982,
4090,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
17982,
3078,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
5209,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
921,
467,
27490,
10731,
2894,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
921,
467,
16119,
2894,
1262,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
11403,
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
671,
5291,
3549,
64,
222,
222,
1350,
222,
338,
23121,
331,
19698,
26863,
3138,
347,
331,
21275,
51,
222,
338,
20980,
2632,
1497,
456,
22454,
49,
39999,
49,
480,
21561,
341,
1533,
456,
331,
3138,
51,
222,
338,
222,
338,
906,
1263,
4753,
451,
2183,
1630,
458,
391,
1440,
619,
3773,
51,
222,
338,
3743,
4844,
1118,
2695,
477,
4753,
456,
341,
15592,
12810,
2974,
1443,
222,
588,
222,
942,
2586,
21275,
3549,
320,
353,
21275,
3549,
18234,
640,
18234,
492,
736,
15592,
3549,
640,
5291,
3549,
492,
736,
1263,
782,
2183,
1630,
45,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
4227,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
3078,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
27490,
10731,
2894,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
671,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
11403,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
16119,
2894,
1262,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
5209,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
17982,
4090,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
17982,
3078,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
1723,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
1723,
2746,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
782,
8260,
1630,
492,
736,
1041,
682,
338,
496,
620,
1492,
22454,
341,
727,
11487,
829,
477,
3138,
682,
588,
353,
910,
640,
1353,
1193,
492,
736,
1041,
682,
338,
12406,
9348,
1431,
682,
588,
353,
1263,
782,
1440,
10202,
1630,
365,
320,
303,
1440,
556,
12134,
459,
10202,
1533,
742,
353,
339,
736,
1263,
910,
640,
943,
365,
320,
303,
461,
762,
64,
353,
339,
222,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 710
|
[
5291,
3549,
64,
222,
485,
13847,
51,
348,
51,
2901,
1634,
51,
14641,
348,
51,
32604,
51,
1284,
51,
624,
51,
9888,
51,
3126,
51,
671,
5291,
3549,
64,
222,
222,
1350,
222,
338,
23121,
331,
19698,
26863,
3138,
347,
331,
21275,
51,
222,
338,
20980,
2632,
1497,
456,
22454,
49,
39999,
49,
480,
21561,
341,
1533,
456,
331,
3138,
51,
222,
338,
222,
338,
906,
1263,
4753,
451,
2183,
1630,
458,
391,
1440,
619,
3773,
51,
222,
338,
3743,
4844,
1118,
2695,
477,
4753,
456,
341,
15592,
12810,
2974,
1443,
222,
588,
222,
942,
2586,
21275,
3549,
320,
353,
21275,
3549,
18234,
640,
18234,
492,
736,
15592,
3549,
640,
5291,
3549,
492,
736,
1263,
782,
2183,
1630,
45,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
4227,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
3078,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
27490,
10731,
2894,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
671,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
11403,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
16119,
2894,
1262,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
5209,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
17982,
4090,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
17982,
3078
] | 3,330,717,547,244,257,000
| true
| false
| false
| false
|
[
736,
1263,
782,
2183,
1630,
45,
3078,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
27490,
10731,
2894,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
671,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
11403,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630,
492,
353,
339,
736,
1263,
782,
2183,
1630,
45,
921,
467,
16119,
2894,
1262,
5291,
3549,
3138,
46,
320,
303,
1440,
10202,
1630
] | -6,643,268,453,849,864,000
| true
|
ProgressStep;
import uk.ac.bbsrc.tgac.miso.core.data.workflow.impl.StringProgressStep;
/**
* Represents a possibly incomplete step in a Workflow.
* Responsible for describing, validating, and storing the input for a step.
*
* The default implementation of processInput is to throw an exception.
* Subclasses will override this implementation for the ProgressSteps they expect
*/
public interface WorkflowStep {
WorkflowStepPrompt getPrompt();
ProgressStep getProgressStep();
default void processInput(ProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PoolProgressStep step) {
throwUnexpectedInput();
}
default void processInput(IntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencerPartitionContainerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(StringProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SkipProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencingContainerModelProgressStep step) {
throwUnexpectedInput
|
, validating, and storing the input for a step.
*
* The default implementation of processInput is to throw an exception.
* Subclasses will override this implementation for the ProgressSteps they expect
*/
public interface WorkflowStep {
WorkflowStepPrompt getPrompt();
ProgressStep getProgressStep();
default void processInput(ProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PoolProgressStep step) {
throwUnexpectedInput();
}
default void processInput(IntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencerPartitionContainerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(StringProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SkipProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencingContainerModelProgressStep step) {
throwUnexpectedInput
|
WorkflowStepPrompt getPrompt();
ProgressStep getProgressStep();
default void processInput(ProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PoolProgressStep step) {
throwUnexpectedInput();
}
default void processInput(IntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencerPartitionContainerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(StringProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SkipProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencingContainerModelProgressStep step) {
throwUnexpectedInput
|
default void processInput(IntegerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencerPartitionContainerProgressStep step) {
throwUnexpectedInput();
}
default void processInput(StringProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SkipProgressStep step) {
throwUnexpectedInput();
}
default void processInput(SequencingContainerModelProgressStep step) {
throwUnexpectedInput
|
();
}
default void processInput(SampleProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PositiveDoubleProgressStep step) {
throwUnexpectedInput();
}
default void processInput(PositiveInteger
|
FontKey.java
|
/FileExtraction/Java_unseen/ptidejteam_Ptidej-v5_2/Ptidej Reporting Tests/src/net/sf/jasperreports/engine/export/FontKey.java
|
/*
* ============================================================================
* GNU Lesser General Public License
* ============================================================================
*
* JasperReports - Free Java report-generating library.
* Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* JasperSoft Corporation
* 303 Second Street, Suite 450 North
* San Francisco, CA 94107
* http://www.jaspersoft.com
*/
package net.sf.jasperreports.engine.export;
/**
* @author Ionut Nedelcu (ionutned@users.sourceforge.net)
* @version $Id: FontKey.java,v 1.1 2008/09/29 16:20:46 guehene Exp $
*/
public class FontKey
{
private String fontName;
private boolean isBold;
private boolean isItalic;
public FontKey(String fontName, boolean bold, boolean italic)
{
this.fontName = fontName;
this.isBold = bold;
this.isItalic = italic;
}
public String getFontName()
{
return this.fontName;
}
public boolean isBold()
{
return this.isBold;
}
public boolean isItalic()
{
return this.isItalic;
}
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final FontKey key = (FontKey) o;
if (this.isBold != key.isBold) return false;
if (this.isItalic != key.isItalic) return false;
if (this.fontName != null ? !this.fontName.equals(key.fontName) : key.fontName != null) return false;
return true;
}
public int hashCode()
{
int result;
result = (this.fontName != null ? this.fontName.hashCode() : 0);
result = 29 * result + (this.isBold ? 1 : 0);
result = 29 * result + (this.isItalic ? 1 : 0);
return result;
}
}
| 2,504
|
Java
|
.java
|
ptidejteam/Ptidej-v5.2
| 9
| 8
| 0
|
2017-05-16T18:53:18Z
|
2018-01-13T01:05:21Z
|
220f43a6d6e8faf2d28e828026b2685067b95d00b94395e36fe6f1d9dfa00330
|
[] |
[
1127,
222,
338,
43242,
222,
338,
6994,
16227,
6153,
5062,
1196,
222,
338,
43242,
222,
338,
222,
338,
990,
41428,
21196,
449,
7834,
4957,
3652,
50,
48245,
4277,
51,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
53,
54,
50,
55,
53,
53,
59,
990,
41428,
14993,
13172,
1930,
574,
1516,
51,
40871,
1705,
51,
527,
222,
338,
1676,
338,
1369,
4277,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
16227,
6153,
5062,
222,
338,
1196,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
222,
338,
1522,
244,
55,
51,
54,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
1369,
4277,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
222,
338,
16227,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
16227,
6153,
5062,
222,
338,
1196,
7979,
642,
477,
4277,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
49,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
338,
1676,
338,
990,
41428,
14993,
13172,
222,
338,
244,
56,
53,
56,
15123,
22321,
49,
25280,
244,
57,
58,
53,
27971,
222,
338,
21108,
48604,
49,
10562,
244,
62,
57,
54,
53,
60,
222,
338,
1930,
574,
1516,
51,
40871,
1705,
51,
527,
222,
588,
222,
1337,
3723,
51,
6463,
51,
40871,
13787,
51,
3502,
51,
1376,
64,
222,
222,
1350,
222,
338,
496,
2133,
41387,
322,
8066,
4066,
9816,
327,
304,
322,
9844,
69,
3724,
51,
21426,
51,
1317,
46,
222,
338,
496,
1687,
417,
625,
63,
8929,
971,
51,
1874,
49,
123,
244,
54,
51,
54,
244,
55,
53,
53,
61,
52,
53,
62,
52,
55,
62,
244,
54,
59,
63,
55,
53,
63,
57,
59,
504,
359,
109,
2126,
9665,
417,
222,
588,
222,
942,
462,
8929,
971,
222,
128,
222,
221,
2072,
910,
2377,
577,
64,
222,
221,
2072,
1922,
458,
16818,
64,
222,
221,
2072,
1922,
458,
34089,
64,
499,
221,
942,
8929,
971,
45,
671,
2377,
577,
49,
1922,
13769,
49,
1922,
31283,
46,
222,
221,
128,
376,
221,
597,
51,
2204,
577,
299,
2377,
577,
64,
376,
221,
597,
51,
316,
16818,
299,
13769,
64,
376,
221,
597,
51,
316,
34089,
299,
31283,
64,
222,
221,
130,
499,
221,
942,
910,
640,
3728,
577,
365,
222,
221,
128,
376,
221,
620,
477,
51,
2204,
577,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
16818,
365,
222,
221,
128,
376,
221,
620,
477,
51,
316,
16818,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
34089,
365,
222,
221,
128,
376,
221,
620,
477,
51,
316,
34089,
64,
222,
221,
130,
499,
221,
942,
1922,
12432,
45,
976,
356,
46,
222,
221,
128,
376,
221,
344,
327,
597,
630,
356,
46,
461,
878,
64,
376,
221,
344,
327,
116,
630,
762,
1293,
27042,
365,
882,
356,
51,
9699,
1177,
461,
920,
64,
1332,
221,
3242,
8929,
971,
1221,
299,
327,
3728,
971,
46,
356,
64,
1332,
221,
344,
327,
597,
51,
316,
16818,
882,
1221,
51,
316,
16818,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
316,
34089,
882,
1221,
51,
316,
34089,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
2204,
577,
882,
762,
1037,
673,
597,
51,
2204,
577,
51,
3591,
45,
697,
51,
2204,
577,
46,
518,
1221,
51,
2204,
577,
882,
762,
46,
461,
920,
64,
1332,
221,
620,
878,
64,
222,
221,
130,
499,
221,
942,
648,
17759,
365,
222,
221,
128,
376,
221,
429,
1074,
64,
376,
221,
1285,
299,
327,
597,
51,
2204,
577,
882,
762,
1037,
477,
51,
2204,
577,
51,
14941,
365,
518,
244,
53,
312,
376,
221,
1285,
299,
244,
55,
62,
338,
1074,
494,
327,
597,
51,
316,
16818,
1037,
244,
54,
518,
244,
53,
312,
376,
221,
1285,
299,
244,
55,
62,
338,
1074,
494,
327,
597,
51,
316,
34089,
1037,
244,
54,
518,
244,
53,
312,
376,
221,
620,
1074,
64,
222,
221,
130,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 734
|
[
221,
942,
8929,
971,
45,
671,
2377,
577,
49,
1922,
13769,
49,
1922,
31283,
46,
222,
221,
128,
376,
221,
597,
51,
2204,
577,
299,
2377,
577,
64,
376,
221,
597,
51,
316,
16818,
299,
13769,
64,
376,
221,
597,
51,
316,
34089,
299,
31283,
64,
222,
221,
130,
499,
221,
942,
910,
640,
3728,
577,
365,
222,
221,
128,
376,
221,
620,
477,
51,
2204,
577,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
16818,
365,
222,
221,
128,
376,
221,
620,
477,
51,
316,
16818,
64,
222,
221,
130,
499,
221,
942,
1922,
458,
34089,
365,
222,
221,
128,
376,
221,
620,
477,
51,
316,
34089,
64,
222,
221,
130,
499,
221,
942,
1922,
12432,
45,
976,
356,
46,
222,
221,
128,
376,
221,
344,
327,
597,
630,
356,
46,
461,
878,
64,
376,
221,
344,
327,
116,
630,
762,
1293,
27042,
365,
882,
356,
51,
9699,
1177,
461,
920,
64,
1332,
221,
3242,
8929,
971,
1221,
299,
327,
3728,
971,
46,
356,
64,
1332,
221,
344,
327,
597,
51,
316,
16818,
882,
1221,
51,
316,
16818,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
316,
34089,
882,
1221,
51,
316,
34089,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
2204,
577,
882,
762,
1037,
673,
597,
51,
2204,
577,
51,
3591,
45,
697,
51,
2204,
577,
46,
518,
1221,
51,
2204,
577,
882,
762,
46,
461,
920,
64,
1332,
221,
620,
878,
64,
222,
221,
130,
499,
221,
942,
648,
17759,
365,
222,
221,
128,
376,
221,
429,
1074,
64,
376,
221,
1285,
299,
327,
597,
51,
2204,
577,
882,
762,
1037,
477,
51,
2204,
577,
51,
14941,
365,
518,
244,
53,
312,
376,
221,
1285,
299,
244,
55,
62,
338,
1074,
494,
327,
597,
51,
316,
16818,
1037,
244,
54,
518
] | 6,217,352,639,013,705,000
| true
| false
| false
| false
|
[
1177,
461,
920,
64,
1332,
221,
3242,
8929,
971,
1221,
299,
327,
3728,
971,
46,
356,
64,
1332,
221,
344,
327,
597,
51,
316,
16818,
882,
1221,
51,
316,
16818,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
316,
34089,
882,
1221,
51,
316,
34089,
46,
461,
920,
64,
376,
221,
344,
327,
597,
51,
2204,
577,
882,
762,
1037,
673,
597,
51,
2204,
577,
51,
3591,
45,
697,
51,
2204,
577,
46,
518,
1221,
51,
2204,
577,
882,
762,
46,
461,
920,
64,
1332,
221,
620,
878,
64,
222,
221,
130,
499,
221,
942,
648,
17759,
365
] | -4,772,607,059,797,652,000
| true
|
public FontKey(String fontName, boolean bold, boolean italic)
{
this.fontName = fontName;
this.isBold = bold;
this.isItalic = italic;
}
public String getFontName()
{
return this.fontName;
}
public boolean isBold()
{
return this.isBold;
}
public boolean isItalic()
{
return this.isItalic;
}
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass()!= o.getClass()) return false;
final FontKey key = (FontKey) o;
if (this.isBold!= key.isBold) return false;
if (this.isItalic!= key.isItalic) return false;
if (this.fontName!= null?!this.fontName.equals(key.fontName) : key.fontName!= null) return false;
return true;
}
public int hashCode()
|
public String getFontName()
{
return this.fontName;
}
public boolean isBold()
{
return this.isBold;
}
public boolean isItalic()
{
return this.isItalic;
}
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass()!= o.getClass()) return false;
final FontKey key = (FontKey) o;
if (this.isBold!= key.isBold) return false;
if (this.isItalic!= key.isItalic) return false;
if (this.fontName!= null?!this.fontName.equals(key.fontName) : key.fontName!= null) return false;
return true;
}
public int hashCode()
|
{
return this.isItalic;
}
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass()!= o.getClass()) return false;
final FontKey key = (FontKey) o;
if (this.isBold!= key.isBold) return false;
if (this.isItalic!= key.isItalic) return false;
if (this.fontName!= null?!this.fontName.equals(key.fontName) : key.fontName!= null) return false;
return true;
}
public int hashCode()
|
()) return false;
final FontKey key = (FontKey) o;
if (this.isBold!= key.isBold) return false;
if (this.isItalic!= key.isItalic) return false;
if (this.fontName!= null?!this.fontName.equals(key.fontName) : key.fontName!= null) return false;
return true;
}
public int hashCode()
|
{
int result;
result = (this.fontName!= null? this.fontName.hashCode() : 0);
result = 29 * result + (this.isBold? 1 :
|
ParameterSetupDialogWithEmptyPreview.java
|
/FileExtraction/Java_unseen/mzmine_mzmine2/src/main/java/net/sf/mzmine/parameters/dialogs/ParameterSetupDialogWithEmptyPreview.java
|
/*
* Copyright 2006-2018 The MZmine 2 Development Team
*
* This file is part of MZmine 2.
*
* MZmine 2 is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* MZmine 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with MZmine 2; if not,
* write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
package net.sf.mzmine.parameters.dialogs;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.util.logging.Logger;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import net.sf.mzmine.parameters.ParameterSet;
/**
* You can extend this class to create your own setup dialog containing a preview. All you need to
* do is extend this, call super.addDialogComponents(); in the extention's addDialogComponents();
* and then add your preview (e.g. a chart) to pnlPreview via the .add-method to
* BorderLayout.CENTER. If you need extra buttons you can add them to pnlPreviewButtons, which is a
* panel south of the preview and formatted by a flow layout.
*
* Please note the mainPanel of ParameterSetupDialog is not the main panel anymore, but newMainPanel
* is. The old mainPanel is moved inside a JScrollPane to allow users with low resolution to set the
* parameters properly.
*
* TODO: COPY actionPerformed METHOD TO YOUR SUBCLASS AND UNCOMMENT THE LINES TO SHOW PREVIEW DEFINE
* cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
*
* @author Steffen Heuckeroth steffen.heuckeroth@gmx.de / s_heuc03@uni-muenster.de
*
*/
public class ParameterSetupDialogWithEmptyPreview extends ParameterSetupDialog {
private static final long serialVersionUID = 1L;
private Logger logger = Logger.getLogger(this.getClass().getName());
// panels
protected JScrollPane pnScroll; // this will contain the parameter panel
protected JPanel pnlPreview; // this will contain the preview and navigation panels
protected JPanel pnlPreviewButtons; // this will contain the navigation buttons for the preview
protected JPanel newMainPanel; // this will be the new main panel
protected JPanel pnlParameters; // this will contain all parameters of the module (the main panel
// will be inserted here)
public ParameterSetupDialogWithEmptyPreview(Window parent, boolean valueCheckRequired,
ParameterSet parameters) {
super(parent, valueCheckRequired, parameters);
}
@Override
protected void addDialogComponents() {
super.addDialogComponents();
// initialize panels
pnlPreview = new JPanel(new BorderLayout());
pnlPreviewButtons = new JPanel(new FlowLayout());
pnlParameters = new JPanel(new BorderLayout());
newMainPanel = new JPanel(new BorderLayout());
pnScroll = new JScrollPane();
pnScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
// reorganize panels
getContentPane().remove(mainPanel);
mainPanel.remove(super.pnlButtons);
pnScroll.setViewportView(mainPanel);
mainPanel.setMinimumSize(new Dimension(400, 400));
pnlParameters.add(pnScroll, BorderLayout.CENTER);
pnlParameters.add(super.pnlButtons, BorderLayout.SOUTH);
pnlPreview.add(pnlPreviewButtons, BorderLayout.SOUTH);
newMainPanel.add(pnlParameters, BorderLayout.WEST);
newMainPanel.add(pnlPreview, BorderLayout.CENTER);
getContentPane().add(newMainPanel, BorderLayout.CENTER);
pnlPreview.setVisible(false);
// later add your preview via pnlPreview.add(YOUR_PANEL, BorderLayout.CENTER);
// and your buttons to control the preview via pnlPreviewButtons.add(YOUR_BUTTON);
updateMinimumSize();
pack();
}
// TODO: COPY THIS METHOD TO YOUR SUBCLASS AND UNCOMMENT THE LINES TO SHOW PREVIEW
// DEFINE cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
@Override
public void actionPerformed(ActionEvent ae) {
super.actionPerformed(ae);
/*
* if (ae.getSource() == cmpPreview) { logger.info(ae.getSource().toString());
*
* if (cmpPreview.isSelected()) {
* newMainPanel.add(pnlPreview, BorderLayout.CENTER);
* pnlPreview.setVisible(true);
* updateMinimumSize(); pack();
* }
* else {
* newMainPanel.remove(pnlPreview); pnlPreview.setVisible(false); updateMinimumSize(); pack();
* }
*/
}
}
| 5,007
|
Java
|
.java
|
mzmine/mzmine2
| 129
| 133
| 237
|
2015-03-24T07:26:14Z
|
2024-05-05T11:12:07Z
|
0b486411e8815f03b60b3666ce5e0e3ef504b8fe415447e01514dd69f3efa819
|
[] |
[
1127,
222,
338,
2657,
244,
55,
53,
53,
59,
50,
55,
53,
54,
61,
906,
507,
95,
6758,
244,
55,
15606,
12653,
222,
338,
1676,
338,
1369,
822,
458,
1760,
451,
507,
95,
6758,
244,
55,
51,
222,
338,
1676,
338,
507,
95,
6758,
244,
55,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
222,
338,
6153,
5062,
1196,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
222,
338,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
507,
95,
6758,
244,
55,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
222,
338,
4462,
341,
4506,
14319,
451,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
222,
338,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
7979,
642,
507,
95,
6758,
244,
55,
64,
434,
666,
49,
222,
338,
2886,
391,
341,
7834,
3870,
7120,
49,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
222,
338,
15067,
222,
588,
222,
222,
1337,
3723,
51,
6463,
51,
22044,
6758,
51,
5173,
51,
41463,
64,
222,
222,
485,
1401,
51,
8236,
51,
7263,
2362,
64,
222,
485,
1401,
51,
8236,
51,
9884,
64,
222,
485,
1401,
51,
8236,
51,
4078,
2362,
64,
222,
485,
1401,
51,
8236,
51,
1684,
64,
222,
485,
1401,
51,
8236,
51,
1585,
51,
18126,
64,
222,
485,
1401,
51,
1058,
51,
7506,
51,
3716,
64,
222,
485,
3698,
51,
5934,
51,
32273,
64,
222,
485,
3698,
51,
5934,
51,
79,
29314,
64,
222,
485,
3698,
51,
5934,
51,
1585,
51,
3112,
1167,
64,
222,
485,
3698,
51,
5934,
51,
1585,
51,
3112,
2239,
64,
222,
485,
3723,
51,
6463,
51,
22044,
6758,
51,
5173,
51,
44639,
64,
499,
222,
1350,
222,
338,
2469,
902,
12385,
477,
462,
391,
1506,
1390,
4387,
4721,
7501,
6663,
331,
13314,
51,
3381,
863,
1868,
391,
222,
338,
764,
458,
12385,
477,
49,
1495,
2615,
51,
688,
3742,
8176,
492,
347,
341,
1467,
5098,
1200,
1035,
3742,
8176,
492,
222,
338,
480,
1636,
1035,
1390,
13314,
327,
106,
51,
108,
51,
331,
7589,
46,
391,
45298,
10621,
4745,
341,
657,
688,
50,
1978,
391,
222,
338,
38816,
51,
16562,
51,
1691,
863,
1868,
6737,
12033,
863,
902,
1035,
3049,
391,
45298,
10621,
11557,
49,
1532,
458,
331,
222,
338,
7992,
38180,
451,
341,
13314,
480,
14179,
829,
331,
7307,
6385,
51,
222,
338,
1676,
338,
5304,
6013,
341,
2594,
3686,
451,
10922,
6438,
3742,
458,
666,
341,
2594,
7992,
18366,
49,
1294,
556,
4370,
3686,
222,
338,
458,
51,
906,
3627,
2594,
3686,
458,
13643,
6529,
331,
990,
29314,
391,
2625,
4272,
642,
7487,
12105,
391,
758,
341,
222,
338,
3406,
10285,
51,
222,
338,
1676,
338,
4314,
63,
8126,
29546,
28259,
2841,
38633,
10540,
7428,
3133,
6419,
16882,
2906,
27579,
959,
2841,
42609,
19332,
11476,
44434,
222,
338,
13588,
10621,
2486,
643,
36569,
51,
8968,
2771,
19332,
3535,
73,
4800,
418,
6218,
13940,
38,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
4401,
7206,
2168,
368,
395,
8679,
291,
51,
311,
7206,
2168,
368,
69,
108,
7796,
51,
305,
536,
328,
100,
311,
1027,
53,
56,
69,
13579,
50,
7009,
291,
6449,
51,
305,
222,
338,
222,
588,
222,
942,
462,
10922,
6438,
3742,
1569,
2779,
10621,
2041,
10922,
6438,
3742,
320,
736,
964,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
736,
964,
7145,
4101,
299,
7145,
51,
10588,
45,
597,
51,
9699,
941,
5175,
1052,
736,
453,
41934,
353,
2532,
990,
29314,
20284,
5606,
64,
453,
477,
1118,
4814,
341,
3416,
7992,
353,
2532,
22299,
45298,
10621,
64,
453,
477,
1118,
4814,
341,
13314,
480,
10543,
41934,
353,
2532,
22299,
45298,
10621,
11557,
64,
453,
477,
1118,
4814,
341,
10543,
12033,
456,
341,
13314,
353,
2532,
22299,
556,
4370,
3686,
64,
453,
477,
1118,
545,
341,
556,
2594,
7992,
353,
2532,
22299,
45298,
3694,
64,
453,
477,
1118,
4814,
1187,
3406,
451,
341,
2313,
327,
1402,
2594,
7992,
353,
453,
1118,
545,
17812,
2464,
46,
736,
581,
10922,
6438,
3742,
1569,
2779,
10621,
45,
1684,
2952,
49,
1922,
804,
2157,
5425,
49,
416,
10922,
903,
3406,
46,
320,
303,
2615,
45,
2562,
49,
804,
2157,
5425,
49,
3406,
312,
353,
339,
736,
496,
1806,
353,
2532,
782,
1035,
3742,
8176,
365,
320,
303,
2615,
51,
688,
3742,
8176,
492,
465,
453,
7395,
41934,
303,
45298,
10621,
299,
556,
22299,
45,
909,
38816,
1052,
303,
45298,
10621,
11557,
299,
556,
22299,
45,
909,
12433,
2362,
1052,
303,
45298,
3694,
299,
556,
22299,
45,
909,
38816,
1052,
303,
556,
4370,
3686,
299,
556,
22299,
45,
909,
38816,
1052,
303,
20284,
5606,
299,
556,
990,
29314,
492,
303,
20284,
5606,
51,
489,
11916,
26964,
4263,
45,
79,
29314,
51,
34766,
100,
33573,
13495,
100,
1117,
100,
3585,
28617,
312,
4054,
453,
334,
11696,
537,
41934,
303,
36828,
7586,
941,
2564,
45,
1850,
3686,
312,
303,
2594,
3686,
51,
2564,
45,
5282,
51,
32831,
11557,
312,
303,
20284,
5606,
51,
489,
16659,
1089,
45,
1850,
3686,
312,
303,
2594,
3686,
51,
47446,
45,
909,
17432,
45,
57,
53,
53,
49,
244,
57,
53,
53,
894,
303,
45298,
3694,
51,
688,
45,
7568,
5606,
49,
38816,
51,
16562,
312,
303,
45298,
3694,
51,
688,
45,
5282,
51,
32831,
11557,
49,
38816,
51,
3644,
5938,
312,
303,
45298,
10621,
51,
688,
45,
32831,
10621,
11557,
49,
38816,
51,
3644,
5938,
312,
303,
556,
4370,
3686,
51,
688,
45,
32831,
3694,
49,
38816,
51,
37859,
312,
303,
556,
4370,
3686,
51,
688,
45,
32831,
10621,
49,
38816,
51,
16562,
312,
303,
36828,
7586,
941,
688,
45,
909,
4370,
3686,
49,
38816,
51,
16562,
312,
465,
45298,
10621,
51,
18215,
45,
1886,
312,
465,
453,
6146,
1035,
1390,
13314,
4745,
45298,
10621,
51,
688,
45,
25732,
100,
45663,
49,
38816,
51,
16562,
312,
303,
453,
480,
1390,
12033,
391,
3518,
341
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
458,
12385,
477,
49,
1495,
2615,
51,
688,
3742,
8176,
492,
347,
341,
1467,
5098,
1200,
1035,
3742,
8176,
492,
222,
338,
480,
1636,
1035,
1390,
13314,
327,
106,
51,
108,
51,
331,
7589,
46,
391,
45298,
10621,
4745,
341,
657,
688,
50,
1978,
391,
222,
338,
38816,
51,
16562,
51,
1691,
863,
1868,
6737,
12033,
863,
902,
1035,
3049,
391,
45298,
10621,
11557,
49,
1532,
458,
331,
222,
338,
7992,
38180,
451,
341,
13314,
480,
14179,
829,
331,
7307,
6385,
51,
222,
338,
1676,
338,
5304,
6013,
341,
2594,
3686,
451,
10922,
6438,
3742,
458,
666,
341,
2594,
7992,
18366,
49,
1294,
556,
4370,
3686,
222,
338,
458,
51,
906,
3627,
2594,
3686,
458,
13643,
6529,
331,
990,
29314,
391,
2625,
4272,
642,
7487,
12105,
391,
758,
341,
222,
338,
3406,
10285,
51,
222,
338,
1676,
338,
4314,
63,
8126,
29546,
28259,
2841,
38633,
10540,
7428,
3133,
6419,
16882,
2906,
27579,
959,
2841,
42609,
19332,
11476,
44434,
222,
338,
13588,
10621,
2486,
643,
36569,
51,
8968,
2771,
19332,
3535,
73,
4800,
418,
6218,
13940,
38,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
4401,
7206,
2168,
368,
395,
8679,
291,
51,
311,
7206,
2168,
368,
69,
108,
7796,
51,
305,
536,
328,
100,
311,
1027,
53,
56,
69,
13579,
50,
7009,
291,
6449,
51,
305,
222,
338,
222,
588,
222,
942,
462,
10922,
6438,
3742,
1569,
2779,
10621,
2041,
10922,
6438,
3742,
320,
736,
964,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
736,
964,
7145,
4101,
299,
7145,
51,
10588,
45,
597,
51,
9699,
941,
5175,
1052,
736,
453,
41934,
353,
2532,
990,
29314,
20284,
5606,
64,
453,
477,
1118,
4814,
341,
3416,
7992,
353,
2532,
22299,
45298,
10621,
64,
453,
477,
1118,
4814,
341,
13314,
480,
10543,
41934,
353,
2532,
22299,
45298,
10621,
11557,
64
] | 4,493,614,722,738,788,000
| true
| false
| false
| false
|
[
2906,
27579,
959,
2841,
42609,
19332,
11476,
44434,
222,
338,
13588,
10621,
2486,
643,
36569,
51,
8968,
2771,
19332,
3535,
73,
4800,
418,
6218,
13940,
38,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
4401,
7206,
2168,
368,
395,
8679,
291,
51,
311,
7206,
2168,
368,
69,
108,
7796,
51,
305,
536,
328,
100,
311,
1027,
53,
56,
69,
13579,
50,
7009,
291,
6449,
51,
305,
222,
338,
222,
588,
222,
942,
462,
10922,
6438,
3742,
1569,
2779,
10621,
2041,
10922,
6438,
3742,
320,
736,
964,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
736,
964,
7145,
4101
] | 5,000,693,269,266,576,000
| true
|
is extend this, call super.addDialogComponents(); in the extention's addDialogComponents();
* and then add your preview (e.g. a chart) to pnlPreview via the.add-method to
* BorderLayout.CENTER. If you need extra buttons you can add them to pnlPreviewButtons, which is a
* panel south of the preview and formatted by a flow layout.
*
* Please note the mainPanel of ParameterSetupDialog is not the main panel anymore, but newMainPanel
* is. The old mainPanel is moved inside a JScrollPane to allow users with low resolution to set the
* parameters properly.
*
* TODO: COPY actionPerformed METHOD TO YOUR SUBCLASS AND UNCOMMENT THE LINES TO SHOW PREVIEW DEFINE
* cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
*
* @author Steffen Heuckeroth steffen.heuckeroth@gmx.de / s_heuc03@uni-muenster.de
*
*/
public class ParameterSetupDialogWithEmptyPreview extends ParameterSetupDialog {
private static final long serialVersionUID = 1L;
private Logger logger
|
. If you need extra buttons you can add them to pnlPreviewButtons, which is a
* panel south of the preview and formatted by a flow layout.
*
* Please note the mainPanel of ParameterSetupDialog is not the main panel anymore, but newMainPanel
* is. The old mainPanel is moved inside a JScrollPane to allow users with low resolution to set the
* parameters properly.
*
* TODO: COPY actionPerformed METHOD TO YOUR SUBCLASS AND UNCOMMENT THE LINES TO SHOW PREVIEW DEFINE
* cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
*
* @author Steffen Heuckeroth steffen.heuckeroth@gmx.de / s_heuc03@uni-muenster.de
*
*/
public class ParameterSetupDialogWithEmptyPreview extends ParameterSetupDialog {
private static final long serialVersionUID = 1L;
private Logger logger
|
anymore, but newMainPanel
* is. The old mainPanel is moved inside a JScrollPane to allow users with low resolution to set the
* parameters properly.
*
* TODO: COPY actionPerformed METHOD TO YOUR SUBCLASS AND UNCOMMENT THE LINES TO SHOW PREVIEW DEFINE
* cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
*
* @author Steffen Heuckeroth steffen.heuckeroth@gmx.de / s_heuc03@uni-muenster.de
*
*/
public class ParameterSetupDialogWithEmptyPreview extends ParameterSetupDialog {
private static final long serialVersionUID = 1L;
private Logger logger
|
THE LINES TO SHOW PREVIEW DEFINE
* cmpPreview AS WELL. THIS IS PRECODED FOR A CHECKBOX!
*
* @author Steffen Heuckeroth steffen.heuckeroth@gmx.de / s_heuc03@uni-muenster.de
*
*/
public class ParameterSetupDialogWithEmptyPreview extends ParameterSetupDialog {
private static final long serialVersionUID = 1L;
private Logger logger
|
= Logger.getLogger(this.getClass().getName());
// panels
protected JScrollPane pnScroll; // this will contain the parameter panel
protected JPanel pnlPreview; // this will contain the preview and navigation panels
protected JPanel pnlPreviewButtons;
|
OArrayHandler.java
|
/FileExtraction/Java_unseen/zachbr_Debuggery/debuggery-common/src/main/java/io/zachbr/debuggery/reflection/types/handlers/output/OArrayHandler.java
|
/*
* This file is part of Debuggery.
*
* Debuggery is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Debuggery is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Debuggery. If not, see <http://www.gnu.org/licenses/>.
*/
package io.zachbr.debuggery.reflection.types.handlers.output;
import io.zachbr.debuggery.reflection.types.TypeHandler;
import io.zachbr.debuggery.reflection.types.handlers.base.Handler;
import io.zachbr.debuggery.reflection.types.handlers.base.OHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import java.util.List;
public class OArrayHandler {
private final TypeHandler typeHandler;
public OArrayHandler(List<Handler> registration, TypeHandler handler) {
this.typeHandler = handler;
// loop through all supported classes and register them to the handler
Class<?>[] supportedClasses = {Object[].class, byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class};
for (Class<?> clazz : supportedClasses) {
OHandler oHandler = new OHandler() {
@Override
public @Nullable String getFormattedOutput(Object object) {
return getFormattedArray(object);
}
@Override
public @NotNull Class<?> getRelevantClass() {
return clazz;
}
};
registration.add(oHandler);
}
}
private @NotNull String getFormattedArray(Object object) {
// Rather than handle every primitive type, just have java autobox the contents
if (object.getClass().getComponentType().isPrimitive()) {
int length = Array.getLength(object);
Object[] newArray = new Object[length];
for (int i = 0; i < length; i++) {
newArray[i] = Array.get(object, i);
}
object = newArray;
}
StringBuilder out = new StringBuilder("{");
Object[] array = (Object[]) object;
for (int i = 0; i < array.length; i++) {
out.append(typeHandler.getOutputFor(array[i]));
if (i != array.length - 1) {
out.append(", ");
}
}
return out.append("}").toString();
}
}
| 2,839
|
Java
|
.java
|
zachbr/Debuggery
| 36
| 9
| 0
|
2017-10-16T03:00:37Z
|
2021-02-11T22:00:43Z
|
b23066ea1fb458597287d51ff2cc319ffb37f07b345d488f9cc03c218fb2e87e
|
[] |
[
1127,
222,
338,
1369,
822,
458,
1760,
451,
8093,
108,
852,
51,
222,
338,
222,
338,
8093,
108,
852,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
8093,
108,
852,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
8093,
108,
852,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
2051,
64,
222,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
638,
1985,
64,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
1460,
51,
1985,
64,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
1460,
51,
84,
1985,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
6825,
64,
222,
222,
485,
1401,
51,
1600,
51,
9069,
51,
1280,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
565,
1280,
1985,
320,
303,
964,
1175,
2782,
1985,
847,
1985,
64,
465,
581,
565,
1280,
1985,
45,
739,
65,
1985,
67,
14531,
49,
2782,
1985,
4908,
46,
320,
310,
477,
51,
700,
1985,
299,
4908,
64,
310,
453,
5276,
3939,
1187,
5430,
6052,
480,
3923,
3049,
391,
341,
4908,
310,
1727,
11667,
1197,
5430,
8038,
299,
320,
976,
42121,
842,
49,
3447,
42121,
842,
49,
4514,
42121,
842,
49,
648,
42121,
842,
49,
1964,
42121,
842,
49,
1916,
42121,
842,
49,
2082,
42121,
842,
49,
1922,
42121,
842,
49,
1370,
42121,
842,
1274,
310,
456,
327,
1359,
11667,
16486,
518,
5430,
8038,
46,
320,
343,
565,
1985,
356,
1985,
299,
556,
565,
1985,
365,
320,
419,
496,
1806,
419,
581,
496,
6825,
910,
640,
20929,
2319,
45,
976,
1319,
46,
320,
547,
461,
640,
20929,
1280,
45,
1491,
312,
419,
339,
2125,
496,
1806,
419,
581,
496,
4936,
1727,
11667,
640,
454,
8604,
1359,
365,
320,
547,
461,
16486,
64,
419,
339,
343,
1487,
1083,
14531,
51,
688,
45,
116,
1985,
312,
310,
339,
303,
339,
465,
964,
496,
4936,
910,
640,
20929,
1280,
45,
976,
1319,
46,
320,
310,
453,
578,
3814,
2806,
2902,
3659,
17135,
847,
49,
2277,
1178,
1401,
2283,
1521,
341,
7321,
310,
434,
327,
1491,
51,
9699,
941,
23441,
638,
941,
316,
12216,
1177,
320,
343,
648,
3124,
299,
2647,
51,
30031,
45,
1491,
312,
343,
2210,
1197,
556,
1280,
299,
556,
2210,
96,
1340,
988,
1083,
456,
327,
429,
613,
299,
244,
53,
64,
613,
350,
3124,
64,
613,
2002,
320,
419,
556,
1280,
96,
110,
98,
299,
2647,
51,
390,
45,
1491,
49,
613,
312,
343,
339,
1083,
1319,
299,
556,
1280,
64,
310,
339,
603,
9705,
986,
299,
556,
9705,
15078,
742,
603,
2210,
1197,
1437,
299,
327,
976,
9798,
1319,
64,
310,
456,
327,
429,
613,
299,
244,
53,
64,
613,
350,
1437,
51,
1340,
64,
613,
2002,
320,
343,
986,
51,
1713,
45,
700,
1985,
51,
35844,
1580,
45,
977,
96,
110,
10679,
1083,
434,
327,
110,
882,
1437,
51,
1340,
449,
244,
54,
46,
320,
419,
986,
51,
1713,
10803,
7173,
343,
339,
310,
339,
603,
461,
986,
51,
1713,
459,
130,
1912,
3127,
492,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 670
|
[
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
2051,
64,
222,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
638,
1985,
64,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
1460,
51,
1985,
64,
222,
485,
3377,
51,
127,
886,
858,
51,
2824,
108,
852,
51,
22612,
51,
2529,
51,
14453,
51,
1460,
51,
84,
1985,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
6825,
64,
222,
222,
485,
1401,
51,
1600,
51,
9069,
51,
1280,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
565,
1280,
1985,
320,
303,
964,
1175,
2782,
1985,
847,
1985,
64,
465,
581,
565,
1280,
1985,
45,
739,
65,
1985,
67,
14531,
49,
2782,
1985,
4908,
46,
320,
310,
477,
51,
700,
1985,
299,
4908,
64,
310,
453,
5276,
3939,
1187,
5430,
6052,
480,
3923,
3049,
391,
341,
4908,
310,
1727,
11667,
1197,
5430,
8038,
299,
320,
976,
42121,
842,
49,
3447,
42121,
842,
49,
4514,
42121,
842,
49,
648,
42121,
842,
49,
1964,
42121,
842,
49,
1916,
42121,
842,
49,
2082,
42121,
842,
49,
1922,
42121,
842,
49,
1370,
42121,
842,
1274,
310,
456,
327,
1359,
11667,
16486,
518,
5430,
8038,
46,
320,
343,
565,
1985,
356,
1985,
299,
556,
565,
1985,
365,
320,
419,
496,
1806,
419,
581,
496,
6825,
910,
640,
20929,
2319,
45,
976,
1319,
46,
320,
547,
461,
640,
20929,
1280,
45,
1491,
312,
419,
339,
2125,
496,
1806,
419,
581,
496,
4936,
1727,
11667,
640
] | -6,313,386,888,391,046,000
| true
| false
| false
| false
|
[
1985,
320,
303,
964,
1175,
2782,
1985,
847,
1985,
64,
465,
581,
565,
1280,
1985,
45,
739,
65,
1985,
67,
14531,
49,
2782,
1985,
4908,
46,
320,
310,
477,
51,
700,
1985,
299,
4908,
64,
310,
453,
5276,
3939,
1187,
5430,
6052,
480,
3923,
3049,
391,
341,
4908,
310,
1727,
11667,
1197,
5430,
8038,
299,
320,
976,
42121,
842,
49,
3447,
42121,
842,
49,
4514,
42121,
842,
49,
648,
42121,
842,
49,
1964,
42121,
842,
49,
1916,
42121,
842,
49,
2082,
42121,
842,
49,
1922,
42121,
842,
49,
1370,
42121,
842,
1274,
310,
456,
327,
1359,
11667,
16486,
518,
5430
] | -8,034,416,677,655,364,000
| true
|
. If not, see <http://www.gnu.org/licenses/>.
*/
package io.zachbr.debuggery.reflection.types.handlers.output;
import io.zachbr.debuggery.reflection.types.TypeHandler;
import io.zachbr.debuggery.reflection.types.handlers.base.Handler;
import io.zachbr.debuggery.reflection.types.handlers.base.OHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import java.util.List;
public class OArrayHandler {
private final TypeHandler typeHandler;
public OArrayHandler(List<Handler> registration, TypeHandler handler) {
this.typeHandler = handler;
// loop through all supported classes and register them to the handler
Class<?>[] supportedClasses = {Object[].class, byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class};
for (Class<?> clazz : supported
|
gery.reflection.types.TypeHandler;
import io.zachbr.debuggery.reflection.types.handlers.base.Handler;
import io.zachbr.debuggery.reflection.types.handlers.base.OHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import java.util.List;
public class OArrayHandler {
private final TypeHandler typeHandler;
public OArrayHandler(List<Handler> registration, TypeHandler handler) {
this.typeHandler = handler;
// loop through all supported classes and register them to the handler
Class<?>[] supportedClasses = {Object[].class, byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class};
for (Class<?> clazz : supported
|
base.OHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Array;
import java.util.List;
public class OArrayHandler {
private final TypeHandler typeHandler;
public OArrayHandler(List<Handler> registration, TypeHandler handler) {
this.typeHandler = handler;
// loop through all supported classes and register them to the handler
Class<?>[] supportedClasses = {Object[].class, byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class};
for (Class<?> clazz : supported
|
Handler {
private final TypeHandler typeHandler;
public OArrayHandler(List<Handler> registration, TypeHandler handler) {
this.typeHandler = handler;
// loop through all supported classes and register them to the handler
Class<?>[] supportedClasses = {Object[].class, byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class};
for (Class<?> clazz : supported
|
Classes) {
OHandler oHandler = new OHandler() {
@Override
public @Nullable String getFormattedOutput(Object object) {
return getFormattedArray(object);
}
@Override
public @NotNull Class<?> get
|
ResourceDeployUtils.java
|
/FileExtraction/Java_unseen/mleoking_PhET/build-tools/src/edu/colorado/phet/buildtools/resource/ResourceDeployUtils.java
|
package edu.colorado.phet.buildtools.resource;
import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import edu.colorado.phet.buildtools.BuildToolsPaths;
/**
* Utility functions for the resource deploy process
* <p/>
* NOTE: be wary of the following code. sim and project was used interchangeably!
*/
public class ResourceDeployUtils {
public static final boolean DEBUG = false;
public static File getTestDir( File resourceDir ) {
return new File( resourceDir, "test" );
}
public static File getResourceSubDir( File resourceDir ) {
return new File( resourceDir, "resource" );
}
public static File getBackupDir( File resourceDir ) {
return new File( resourceDir, "backup" );
}
public static File getExtrasDir( File resourceDir ) {
return new File( resourceDir, "extras" );
}
public static File getLiveSimsDir( File resourceDir ) {
return new File( resourceDir, "../.." );
}
public static File getResourceProperties( File resourceDir ) {
return new File( getResourceSubDir( resourceDir ), "resource.properties" );
}
/**
* During the publishing process, we don't want to copy over more files than we have to. This function should
* be able to specify which files should not be copied
*
* @param file The file that is being checked for whether it should be copied during publishing
* @return Whether or not to copy it
*/
public static boolean ignoreTestFile( File file ) {
return file.getName().endsWith( ".swf" ) || file.getName().endsWith( ".jnlp" );
}
public static String getDirNameList( File[] dirs ) {
String ret = "";
if ( dirs.length == 0 ) {
return ret;
}
for ( int i = 0; i < dirs.length; i++ ) {
File dir = dirs[i];
if ( i != 0 ) {
ret += ",";
}
ret += dir.getName();
}
return ret;
}
/**
* Get a list of Java simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of java simulation directories
*/
public static File[] getJavaSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] { new File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR + "/bound-states" ) };
}
else {
File simsDir = new File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR );
File[] simDirs = simsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() && !file.getName().startsWith( "." );
}
} );
return simDirs;
}
}
/**
* Get a list of flash simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of flash simulation directories
*/
public static File[] getFlashSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] {
new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR + "/stern-gerlach" ),
new File( trunk, BuildToolsPaths.FLEX_SIMULATIONS_DIR + "/density-and-buoyancy" )
};
}
else {
File flashSimsDir = new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR );
File flexSimsDir = new File( trunk, BuildToolsPaths.FLEX_SIMULATIONS_DIR );
List<File> dirs = new LinkedList<File>();
dirs.addAll( Arrays.asList( flashSimsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() && !file.getName().startsWith( "." );
}
} ) ) );
dirs.addAll( Arrays.asList( flexSimsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() && !file.getName().startsWith( "." );
}
} ) ) );
return dirs.toArray( new File[] { } );
}
}
/**
* Get a comma-separated list of java sim names
*
* @param trunk Reference to trunk
* @return A string of comma-separated sim names
*/
public static String getJavaSimNames( File trunk ) {
return getDirNameList( getJavaSimulationDirs( trunk ) );
}
/**
* Get a comma-separated list of flash sim names
*
* @param trunk Reference to trunk
* @return A string of comma-separated sim names
*/
public static String getFlashSimNames( File trunk ) {
return getDirNameList( getFlashSimulationDirs( trunk ) );
}
}
| 4,815
|
Java
|
.java
|
mleoking/PhET
| 18
| 10
| 0
|
2016-05-19T01:58:46Z
|
2016-05-19T03:51:45Z
|
e3c75dbd4ca55787224e553e97ef26ccc999f2e04748e820a0dbf65fd0d76719
|
[] |
[
1337,
15357,
51,
1507,
2619,
51,
117,
10237,
51,
1848,
4303,
51,
3157,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
2365,
64,
222,
485,
1401,
51,
1058,
51,
9981,
64,
222,
485,
1401,
51,
1058,
51,
20535,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
15357,
51,
1507,
2619,
51,
117,
10237,
51,
1848,
4303,
51,
3328,
7926,
9648,
64,
222,
222,
1350,
222,
338,
23194,
4465,
456,
341,
2885,
5642,
2183,
222,
338,
350,
117,
2056,
222,
338,
12125,
63,
545,
360,
692,
451,
341,
2434,
1361,
51,
3805,
480,
2091,
1616,
1674,
1447,
2357,
5723,
38,
222,
588,
222,
942,
462,
6297,
8256,
2769,
320,
465,
581,
924,
1175,
1922,
9404,
299,
920,
64,
465,
581,
924,
2050,
640,
1024,
2995,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
2885,
2995,
49,
332,
881,
39,
1110,
303,
339,
465,
581,
924,
2050,
42083,
1736,
2995,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
2885,
2995,
49,
332,
3157,
39,
1110,
303,
339,
465,
581,
924,
2050,
640,
11664,
2995,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
2885,
2995,
49,
332,
10196,
39,
1110,
303,
339,
465,
581,
924,
2050,
640,
32775,
2995,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
2885,
2995,
49,
332,
20920,
39,
1110,
303,
339,
465,
581,
924,
2050,
640,
11088,
6018,
120,
2995,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
2885,
2995,
49,
6919,
33179,
1110,
303,
339,
4054,
581,
924,
2050,
42083,
3303,
45,
2050,
2885,
2995,
848,
320,
310,
461,
556,
2050,
45,
42083,
1736,
2995,
45,
2885,
2995,
2604,
332,
3157,
51,
4659,
39,
1110,
303,
339,
465,
1041,
294,
338,
35228,
341,
27552,
2183,
49,
1019,
2818,
1348,
2660,
391,
1948,
2308,
1851,
2293,
2806,
1019,
1178,
391,
51,
1369,
686,
1414,
294,
338,
545,
5320,
391,
6405,
1532,
2293,
1414,
666,
545,
14664,
294,
338,
294,
338,
496,
772,
822,
906,
822,
708,
458,
4019,
8146,
456,
4962,
580,
1414,
545,
14664,
5945,
27552,
294,
338,
496,
620,
14074,
575,
666,
391,
1948,
580,
294,
588,
303,
581,
924,
1922,
5091,
1024,
991,
45,
2050,
822,
848,
320,
310,
461,
822,
51,
5175,
941,
20982,
45,
4956,
1605,
107,
39,
848,
1293,
822,
51,
5175,
941,
20982,
45,
4956,
20530,
1935,
39,
1110,
303,
339,
465,
581,
924,
910,
640,
2995,
577,
739,
45,
2050,
1197,
29178,
848,
320,
310,
910,
2170,
299,
5127,
603,
434,
327,
29178,
51,
1340,
630,
244,
53,
848,
320,
343,
461,
2170,
64,
310,
339,
603,
456,
327,
648,
613,
299,
244,
53,
64,
613,
350,
29178,
51,
1340,
64,
613,
1065,
848,
320,
343,
2050,
4937,
299,
29178,
96,
110,
988,
1083,
434,
327,
613,
882,
244,
53,
848,
320,
419,
2170,
1475,
3021,
884,
343,
339,
1083,
2170,
1475,
4937,
51,
5175,
492,
310,
339,
603,
461,
2170,
64,
303,
339,
465,
1041,
294,
338,
1408,
331,
1168,
451,
4957,
14619,
14920,
49,
6498,
391,
331,
8146,
986,
1948,
294,
338,
294,
338,
496,
772,
41121,
5404,
391,
41121,
294,
338,
496,
620,
2647,
451,
1401,
14619,
14920,
294,
588,
303,
581,
924,
2050,
1197,
640,
5445,
14886,
25506,
45,
2050,
41121,
848,
320,
310,
434,
327,
9404,
848,
320,
343,
461,
556,
2050,
1197,
320,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
18633,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
4484,
50,
10674,
39,
848,
1487,
310,
339,
310,
832,
320,
343,
2050,
3805,
120,
2995,
299,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
18633,
100,
2142,
12773,
19412,
100,
3217,
1110,
1083,
2050,
1197,
3805,
25506,
299,
3805,
120,
2995,
51,
687,
3852,
45,
556,
2050,
2365,
365,
320,
419,
581,
1922,
5531,
45,
2050,
822,
848,
320,
547,
461,
822,
51,
30815,
365,
979,
673,
781,
51,
5175,
941,
13907,
45,
17029,
1110,
419,
339,
343,
339,
1110,
1083,
461,
3805,
25506,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
331,
1168,
451,
14017,
14619,
14920,
49,
6498,
391,
331,
8146,
986,
1948,
294,
338,
294,
338,
496,
772,
41121,
5404,
391,
41121,
294,
338,
496,
620,
2647,
451,
14017,
14619,
14920,
294,
588,
465,
581,
924,
2050,
1197,
640,
15302,
14886,
25506,
45,
2050,
41121,
848,
320,
310,
434,
327,
9404,
848,
320,
343,
461,
556,
2050,
1197,
320,
547,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
30693,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
289,
2369,
50,
892,
113,
886,
39,
2604,
547,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
42828,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
18350,
50,
382,
50,
716,
19009,
10367,
39,
848,
343,
1487,
310,
339,
310,
832,
320,
343,
2050,
14017,
6018,
120,
2995,
299,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
30693,
100,
2142,
12773,
19412,
100,
3217,
1110,
343,
2050,
5474,
6018,
120,
2995,
299,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
42828,
100,
2142,
12773,
19412,
100,
3217,
1110,
1083,
1701,
65,
991,
67,
29178,
299,
556,
21057,
65,
991,
2938,
1083,
29178,
51,
15109,
45,
14479,
51,
14100,
45,
14017,
6018,
120,
2995,
51,
687,
3852,
45,
556,
2050,
2365,
365,
320,
419,
581,
1922,
5531,
45,
2050,
822,
848,
320,
547,
461,
822,
51,
30815,
365,
979,
673,
781,
51,
5175,
941,
13907,
45,
17029,
1110,
419,
339,
343,
339,
848,
848,
1110,
1083,
29178,
51,
15109,
45,
14479,
51,
14100,
45,
5474,
6018,
120,
2995,
51,
687,
3852,
45,
556,
2050,
2365,
365,
320,
419,
581,
1922,
5531,
45,
2050,
822,
848,
320,
547,
461,
822,
51,
30815,
365,
979,
673,
781,
51,
5175,
941,
13907,
45,
17029,
1110,
419,
339,
343,
339,
848,
848,
1110,
1083,
461,
29178,
51,
14315,
45,
556,
2050,
1197,
320,
339,
1110,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
331,
18244,
50,
26387,
1168,
451,
1401,
3805,
4492,
294,
338,
294,
338,
496,
772,
41121,
9495,
391,
41121,
294,
338,
496,
620,
418,
821,
451,
18244,
50,
26387,
3805,
4492,
294
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
986,
1948,
294,
338,
294,
338,
496,
772,
41121,
5404,
391,
41121,
294,
338,
496,
620,
2647,
451,
1401,
14619,
14920,
294,
588,
303,
581,
924,
2050,
1197,
640,
5445,
14886,
25506,
45,
2050,
41121,
848,
320,
310,
434,
327,
9404,
848,
320,
343,
461,
556,
2050,
1197,
320,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
18633,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
4484,
50,
10674,
39,
848,
1487,
310,
339,
310,
832,
320,
343,
2050,
3805,
120,
2995,
299,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
18633,
100,
2142,
12773,
19412,
100,
3217,
1110,
1083,
2050,
1197,
3805,
25506,
299,
3805,
120,
2995,
51,
687,
3852,
45,
556,
2050,
2365,
365,
320,
419,
581,
1922,
5531,
45,
2050,
822,
848,
320,
547,
461,
822,
51,
30815,
365,
979,
673,
781,
51,
5175,
941,
13907,
45,
17029,
1110,
419,
339,
343,
339,
1110,
1083,
461,
3805,
25506,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
331,
1168,
451,
14017,
14619,
14920,
49,
6498,
391,
331,
8146,
986,
1948,
294,
338,
294,
338,
496,
772,
41121,
5404,
391,
41121,
294,
338,
496,
620,
2647,
451,
14017,
14619,
14920,
294,
588,
465,
581,
924,
2050,
1197,
640,
15302,
14886,
25506,
45,
2050,
41121,
848,
320,
310,
434,
327,
9404,
848,
320,
343,
461,
556,
2050,
1197,
320,
547,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
30693,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
289,
2369,
50,
892,
113,
886,
39,
2604,
547,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
42828,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
18350,
50,
382,
50,
716,
19009,
10367,
39,
848,
343,
1487,
310,
339,
310,
832,
320,
343,
2050,
14017,
6018,
120,
2995,
299,
556,
2050,
45,
41121,
49,
5256,
7926,
9648
] | 1,196,877,327,293,683,000
| true
| false
| false
| false
|
[
461,
3805,
25506,
64,
310,
339,
303,
339,
465,
1041,
294,
338,
1408,
331,
1168,
451,
14017,
14619,
14920,
49,
6498,
391,
331,
8146,
986,
1948,
294,
338,
294,
338,
496,
772,
41121,
5404,
391,
41121,
294,
338,
496,
620,
2647,
451,
14017,
14619,
14920,
294,
588,
465,
581,
924,
2050,
1197,
640,
15302,
14886,
25506,
45,
2050,
41121,
848,
320,
310,
434,
327,
9404,
848,
320,
343,
461,
556,
2050,
1197,
320,
547,
556,
2050,
45,
41121,
49,
5256,
7926,
9648,
51,
30693,
100,
2142,
12773,
19412,
100,
3217,
494,
2450,
289,
2369,
50,
892,
113,
886,
39,
2604
] | -5,757,522,651,172,878,000
| true
|
out copy
*
* @param trunk Path to trunk
* @return Array of java simulation directories
*/
public static File[] getJavaSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] { new File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR + "/bound-states" ) };
}
else {
File simsDir = new File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR );
File[] simDirs = simsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() &&!file.getName().startsWith( "." );
}
} );
return simDirs;
}
}
/**
* Get a list of flash simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of flash simulation directories
*/
public static File[] getFlashSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] {
new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR + "/stern-gerlach" ),
|
File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR + "/bound-states" ) };
}
else {
File simsDir = new File( trunk, BuildToolsPaths.JAVA_SIMULATIONS_DIR );
File[] simDirs = simsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() &&!file.getName().startsWith( "." );
}
} );
return simDirs;
}
}
/**
* Get a list of flash simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of flash simulation directories
*/
public static File[] getFlashSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] {
new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR + "/stern-gerlach" ),
|
);
File[] simDirs = simsDir.listFiles( new FileFilter() {
public boolean accept( File file ) {
return file.isDirectory() &&!file.getName().startsWith( "." );
}
} );
return simDirs;
}
}
/**
* Get a list of flash simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of flash simulation directories
*/
public static File[] getFlashSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] {
new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR + "/stern-gerlach" ),
|
return simDirs;
}
}
/**
* Get a list of flash simulation directories, relative to a checked out copy
*
* @param trunk Path to trunk
* @return Array of flash simulation directories
*/
public static File[] getFlashSimulationDirs( File trunk ) {
if ( DEBUG ) {
return new File[] {
new File( trunk, BuildToolsPaths.FLASH_SIMULATIONS_DIR + "/stern-gerlach" ),
|
new File( trunk, BuildToolsPaths.FLEX_SIMULATIONS_DIR + "/density-and-buoyancy" )
};
}
else {
File flashSimsDir = new File( trunk, BuildToolsPaths
|
PermissionCodec.java
|
/FileExtraction/Java_unseen/Lumeer_engine/lumeer-storage/lumeer-storage-mongodb/src/main/java/io/lumeer/storage/mongodb/codecs/PermissionCodec.java
|
/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.lumeer.storage.mongodb.codecs;
import io.lumeer.api.model.Permission;
import io.lumeer.api.model.ResourceType;
import io.lumeer.api.model.Role;
import io.lumeer.api.model.RoleOld;
import io.lumeer.api.model.RoleType;
import io.lumeer.api.util.RoleUtils;
import org.bson.BsonReader;
import org.bson.BsonWriter;
import org.bson.Document;
import org.bson.codecs.Codec;
import org.bson.codecs.DecoderContext;
import org.bson.codecs.EncoderContext;
import org.bson.codecs.configuration.CodecRegistry;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class PermissionCodec implements Codec<Permission> {
public static final String ID = "id";
public static final String ROLES = "roles";
private final Codec<Document> documentCodec;
public PermissionCodec(final CodecRegistry registry) {
this.documentCodec = registry.get(Document.class);
}
@Override
public Permission decode(final BsonReader reader, final DecoderContext decoderContext) {
Document document = documentCodec.decode(reader, decoderContext);
return PermissionCodec.convertFromDocument(document);
}
@Deprecated
public static Permission convertFromDocumentLegacy(Document bson, ResourceType resourceType) {
String name = bson.getString(ID);
Set<Role> roles = new ArrayList<String>(bson.get(ROLES, List.class)).stream().reduce(new HashSet<>(), (Set<Role> result, String role) -> {
var oldRole = RoleOld.fromString(role);
if (oldRole != null) {
result.addAll(RoleUtils.resourceRoles(oldRole, resourceType));
} else {
var newRole = RoleType.fromString(role);
if (newRole != null) {
result.add(new Role(newRole));
}
}
return result;
}, (roles1, roles2) -> Stream.concat(roles1.stream(), roles2.stream()).collect(Collectors.toSet()));
return new Permission(name, roles);
}
public static Permission convertFromDocument(Document bson) {
String name = bson.getString(ID);
Set<Role> roles = new ArrayList<Document>(bson.get(ROLES, List.class)).stream()
.map(RoleCodec::convertFromDocument)
.collect(Collectors.toSet());
return new Permission(name, roles);
}
@Override
public void encode(final BsonWriter writer, final Permission value, final EncoderContext encoderContext) {
Document document = new Document(ID, value.getId())
.append(ROLES, value.getRoles());
documentCodec.encode(writer, document, encoderContext);
}
@Override
public Class<Permission> getEncoderClass() {
return Permission.class;
}
}
| 3,695
|
Java
|
.java
|
Lumeer/engine
| 11
| 22
| 0
|
2016-10-01T21:12:54Z
|
2024-02-23T20:55:38Z
|
6bf7f109910ae51eb9faf4a1093e2db4c3b007a3669b1cb48f3fda3bab7fc25e
|
[] |
[
1127,
222,
338,
517,
2097,
284,
63,
43962,
2426,
16440,
480,
22480,
11329,
222,
338,
222,
338,
2657,
327,
72,
46,
4577,
244,
55,
53,
54,
60,
517,
2097,
284,
51,
735,
49,
328,
51,
119,
51,
116,
51,
480,
52,
290,
2840,
25094,
51,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3377,
51,
113,
2097,
284,
51,
4239,
51,
15683,
51,
707,
1766,
64,
222,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1184,
51,
7052,
64,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1184,
51,
27063,
64,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1184,
51,
4555,
64,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1184,
51,
4555,
10560,
64,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1184,
51,
4555,
638,
64,
222,
485,
3377,
51,
113,
2097,
284,
51,
1256,
51,
1058,
51,
4555,
2769,
64,
222,
222,
485,
1105,
51,
27752,
51,
71,
1174,
3314,
64,
222,
485,
1105,
51,
27752,
51,
71,
1174,
3989,
64,
222,
485,
1105,
51,
27752,
51,
3112,
64,
222,
485,
1105,
51,
27752,
51,
707,
1766,
51,
13167,
64,
222,
485,
1105,
51,
27752,
51,
707,
1766,
51,
11718,
1237,
64,
222,
485,
1105,
51,
27752,
51,
707,
1766,
51,
8805,
1237,
64,
222,
485,
1105,
51,
27752,
51,
707,
1766,
51,
5990,
51,
13167,
5389,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
16862,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
1880,
64,
222,
222,
942,
462,
11125,
13167,
4584,
47756,
65,
7052,
67,
320,
3051,
581,
924,
1175,
910,
2502,
299,
332,
333,
884,
682,
581,
924,
1175,
910,
11279,
10882,
299,
332,
9716,
884,
3051,
964,
1175,
47756,
65,
3112,
67,
1840,
13167,
64,
3051,
581,
11125,
13167,
45,
3242,
47756,
5389,
10886,
46,
320,
416,
477,
51,
2826,
13167,
299,
10886,
51,
390,
45,
3112,
51,
842,
312,
682,
339,
3051,
496,
1806,
682,
581,
11125,
9860,
45,
3242,
570,
1174,
3314,
6201,
49,
1175,
35027,
1237,
18983,
1237,
46,
320,
416,
6222,
1840,
299,
1840,
13167,
51,
5480,
45,
6321,
49,
18983,
1237,
312,
1704,
461,
11125,
13167,
51,
5975,
1811,
3112,
45,
2826,
312,
682,
339,
3051,
496,
15375,
682,
581,
924,
11125,
4511,
1811,
3112,
23022,
45,
3112,
30386,
49,
6297,
638,
2885,
638,
46,
320,
416,
910,
655,
299,
30386,
51,
7080,
45,
798,
312,
416,
1776,
65,
4555,
67,
13477,
299,
556,
5068,
65,
671,
1579,
27752,
51,
390,
45,
1030,
10882,
49,
1701,
51,
842,
3445,
2255,
941,
8957,
45,
909,
14253,
13366,
1046,
327,
903,
65,
4555,
67,
1074,
49,
910,
4218,
46,
984,
320,
295,
792,
3627,
4555,
299,
13936,
10560,
51,
32972,
45,
4315,
312,
295,
434,
327,
1477,
4555,
882,
762,
46,
320,
343,
1074,
51,
15109,
45,
4555,
2769,
51,
3157,
12840,
45,
1477,
4555,
49,
2885,
638,
894,
295,
339,
832,
320,
343,
792,
556,
4555,
299,
13936,
638,
51,
32972,
45,
4315,
312,
343,
434,
327,
909,
4555,
882,
762,
46,
320,
3102,
1074,
51,
688,
45,
909,
13936,
45,
909,
4555,
894,
343,
339,
295,
339,
295,
461,
1074,
64,
416,
820,
327,
9716,
54,
49,
13477,
55,
46,
984,
7552,
51,
7289,
45,
9716,
54,
51,
2255,
1046,
13477,
55,
51,
2255,
4269,
6190,
45,
16862,
51,
45995,
5086,
1704,
461,
556,
11125,
45,
444,
49,
13477,
312,
682,
339,
3051,
581,
924,
11125,
4511,
1811,
3112,
45,
3112,
30386,
46,
320,
416,
910,
655,
299,
30386,
51,
7080,
45,
798,
312,
416,
1776,
65,
4555,
67,
13477,
299,
556,
5068,
65,
3112,
1579,
27752,
51,
390,
45,
1030,
10882,
49,
1701,
51,
842,
3445,
2255,
365,
27238,
657,
1130,
45,
4555,
13167,
422,
5975,
1811,
3112,
46,
27238,
657,
6190,
45,
16862,
51,
45995,
1052,
1704,
461,
556,
11125,
45,
444,
49,
13477,
312,
682,
339,
3051,
496,
1806,
682,
581,
782,
9356,
45,
3242,
570,
1174,
3989,
7294,
49,
1175,
11125,
804,
49,
1175,
33379,
1237,
15633,
1237,
46,
320,
416,
6222,
1840,
299,
556,
6222,
45,
798,
49,
804,
51,
7068,
1177,
343,
657,
1713,
45,
1030,
10882,
49,
804,
51,
390,
12840,
1052,
1704,
1840,
13167,
51,
4458,
45,
7595,
49,
1840,
49,
15633,
1237,
312,
682,
339,
3051,
496,
1806,
682,
581,
1727,
65,
7052,
67,
640,
8805,
1359,
365,
320,
416,
461,
11125,
51,
842,
64,
682,
339,
222,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 917
|
[
5389,
10886,
46,
320,
416,
477,
51,
2826,
13167,
299,
10886,
51,
390,
45,
3112,
51,
842,
312,
682,
339,
3051,
496,
1806,
682,
581,
11125,
9860,
45,
3242,
570,
1174,
3314,
6201,
49,
1175,
35027,
1237,
18983,
1237,
46,
320,
416,
6222,
1840,
299,
1840,
13167,
51,
5480,
45,
6321,
49,
18983,
1237,
312,
1704,
461,
11125,
13167,
51,
5975,
1811,
3112,
45,
2826,
312,
682,
339,
3051,
496,
15375,
682,
581,
924,
11125,
4511,
1811,
3112,
23022,
45,
3112,
30386,
49,
6297,
638,
2885,
638,
46,
320,
416,
910,
655,
299,
30386,
51,
7080,
45,
798,
312,
416,
1776,
65,
4555,
67,
13477,
299,
556,
5068,
65,
671,
1579,
27752,
51,
390,
45,
1030,
10882,
49,
1701,
51,
842,
3445,
2255,
941,
8957,
45,
909,
14253,
13366,
1046,
327,
903,
65,
4555,
67,
1074,
49,
910,
4218,
46,
984,
320,
295,
792,
3627,
4555,
299,
13936,
10560,
51,
32972,
45,
4315,
312,
295,
434,
327,
1477,
4555,
882,
762,
46,
320,
343,
1074,
51,
15109,
45,
4555,
2769,
51,
3157,
12840,
45,
1477,
4555,
49,
2885,
638,
894,
295,
339,
832,
320,
343,
792,
556,
4555,
299,
13936,
638,
51,
32972,
45,
4315,
312,
343,
434,
327,
909,
4555,
882,
762,
46,
320,
3102,
1074,
51,
688,
45,
909,
13936,
45,
909,
4555,
894,
343,
339,
295,
339,
295,
461,
1074,
64,
416,
820,
327,
9716,
54,
49,
13477,
55,
46,
984,
7552,
51,
7289,
45,
9716,
54,
51,
2255,
1046,
13477,
55,
51,
2255,
4269,
6190,
45,
16862,
51,
45995,
5086,
1704,
461,
556,
11125,
45,
444,
49,
13477,
312,
682,
339,
3051,
581,
924,
11125,
4511,
1811,
3112,
45,
3112,
30386,
46,
320,
416,
910,
655,
299,
30386,
51,
7080,
45,
798,
312,
416,
1776,
65,
4555,
67,
13477,
299,
556,
5068,
65,
3112,
1579,
27752
] | -3,295,810,489,497,535,500
| true
| false
| false
| false
|
[
32972,
45,
4315,
312,
295,
434,
327,
1477,
4555,
882,
762,
46,
320,
343,
1074,
51,
15109,
45,
4555,
2769,
51,
3157,
12840,
45,
1477,
4555,
49,
2885,
638,
894,
295,
339,
832,
320,
343,
792,
556,
4555,
299,
13936,
638,
51,
32972,
45,
4315,
312,
343,
434,
327,
909,
4555,
882,
762,
46,
320,
3102,
1074,
51,
688,
45,
909,
13936,
45,
909,
4555,
894,
343,
339,
295,
339,
295,
461,
1074,
64,
416,
820,
327,
9716,
54,
49,
13477,
55,
46,
984,
7552,
51,
7289,
45,
9716,
54,
51,
2255,
1046,
13477,
55,
51,
2255,
4269,
6190,
45
] | -1,208,433,041,770,694,700
| true
|
Registry registry) {
this.documentCodec = registry.get(Document.class);
}
@Override
public Permission decode(final BsonReader reader, final DecoderContext decoderContext) {
Document document = documentCodec.decode(reader, decoderContext);
return PermissionCodec.convertFromDocument(document);
}
@Deprecated
public static Permission convertFromDocumentLegacy(Document bson, ResourceType resourceType) {
String name = bson.getString(ID);
Set<Role> roles = new ArrayList<String>(bson.get(ROLES, List.class)).stream().reduce(new HashSet<>(), (Set<Role> result, String role) -> {
var oldRole = RoleOld.fromString(role);
if (oldRole!= null) {
result.addAll(RoleUtils.resourceRoles(oldRole, resourceType));
} else {
var newRole = RoleType.fromString(role);
if (newRole!= null) {
result.add(new Role(newRole));
}
}
return result;
}, (roles1, roles2) -> Stream.concat(roles1.stream(), roles2.stream()).collect(
|
reader, decoderContext);
return PermissionCodec.convertFromDocument(document);
}
@Deprecated
public static Permission convertFromDocumentLegacy(Document bson, ResourceType resourceType) {
String name = bson.getString(ID);
Set<Role> roles = new ArrayList<String>(bson.get(ROLES, List.class)).stream().reduce(new HashSet<>(), (Set<Role> result, String role) -> {
var oldRole = RoleOld.fromString(role);
if (oldRole!= null) {
result.addAll(RoleUtils.resourceRoles(oldRole, resourceType));
} else {
var newRole = RoleType.fromString(role);
if (newRole!= null) {
result.add(new Role(newRole));
}
}
return result;
}, (roles1, roles2) -> Stream.concat(roles1.stream(), roles2.stream()).collect(
|
Set<Role> roles = new ArrayList<String>(bson.get(ROLES, List.class)).stream().reduce(new HashSet<>(), (Set<Role> result, String role) -> {
var oldRole = RoleOld.fromString(role);
if (oldRole!= null) {
result.addAll(RoleUtils.resourceRoles(oldRole, resourceType));
} else {
var newRole = RoleType.fromString(role);
if (newRole!= null) {
result.add(new Role(newRole));
}
}
return result;
}, (roles1, roles2) -> Stream.concat(roles1.stream(), roles2.stream()).collect(
|
fromString(role);
if (oldRole!= null) {
result.addAll(RoleUtils.resourceRoles(oldRole, resourceType));
} else {
var newRole = RoleType.fromString(role);
if (newRole!= null) {
result.add(new Role(newRole));
}
}
return result;
}, (roles1, roles2) -> Stream.concat(roles1.stream(), roles2.stream()).collect(
|
Collectors.toSet()));
return new Permission(name, roles);
}
public static Permission convertFromDocument(Document bson) {
String name = bson.getString(ID);
Set<Role> roles = new ArrayList<Document>(bson
|
BlockFFPistonBase.java
|
/FileExtraction/Java_unseen/mbrx_FysiksFun/ff/solidBlockPhysics/BlockFFPistonBase.java
|
package mbrx.ff.solidBlockPhysics;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mbrx.ff.FysiksFun;
import mbrx.ff.fluids.Fluids;
import mbrx.ff.fluids.Gases;
import mbrx.ff.util.ChunkCache;
import mbrx.ff.util.ChunkMarkUpdater;
import mbrx.ff.util.SoundQueue;
import mbrx.ff.util.Util;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.BlockPistonMoving;
import net.minecraft.block.BlockSnow;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
public class BlockFFPistonBase extends BlockPistonBase {
boolean isSticky;
public BlockFFPistonBase(int par1, boolean isSticky) {
super(par1, isSticky);
this.isSticky = isSticky;
}
/**
* checks the block to that side to see if it is indirectly powered.
*/
public boolean isIndirectlyPowered(World par1World, int x, int y, int z, int direction) {
return direction != 0 && par1World.getIndirectPowerOutput(x, y - 1, z, 0) ? true
: (direction != 1 && par1World.getIndirectPowerOutput(x, y + 1, z, 1) ? true
: (direction != 2 && par1World.getIndirectPowerOutput(x, y, z - 1, 2) ? true
: (direction != 3 && par1World.getIndirectPowerOutput(x, y, z + 1, 3) ? true : (direction != 5
&& par1World.getIndirectPowerOutput(x + 1, y, z, 5) ? true : (direction != 4 && par1World.getIndirectPowerOutput(x - 1, y, z, 4) ? true
: (par1World.getIndirectPowerOutput(x, y, z, 0) ? true : (par1World.getIndirectPowerOutput(x, y + 2, z, 1) ? true : (par1World
.getIndirectPowerOutput(x, y + 1, z - 1, 2) ? true : (par1World.getIndirectPowerOutput(x, y + 1, z + 1, 3) ? true : (par1World
.getIndirectPowerOutput(x - 1, y + 1, z, 4) ? true : par1World.getIndirectPowerOutput(x + 1, y + 1, z, 5)))))))))));
}
public boolean onBlockEventReceived(World w, int x, int y, int z, int eventId, int direction) {
if (!w.isRemote) {
/* This hides/shows the head of the piston on client side */
boolean flag = this.isIndirectlyPowered(w, x, y, z, direction);
if (flag && eventId == 1) {
w.setBlockMetadataWithNotify(x, y, z, direction | 8, 2);
return false;
}
if (!flag && eventId == 0) { return false; }
}
/* Only reached on servers */
if (eventId == 0) {
/* Event wants to extend the piston out, see if it works */
if (!this.tryExtend(w, x, y, z, direction, false)) { return false; }
/* It worked (guess that tryExtend added the PistonExtension?) */
/* All this code is executed within main thread, no semaphores needed */
w.setBlockMetadataWithNotify(x, y, z, direction | 8, 2);
SoundQueue.queueSound(w, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "tile.piston.out", 0.5F, w.rand.nextFloat() * 0.25F + 0.6F);
} else if (eventId == 1) {
if (!this.tryRepel(w, x, y, z, direction, false)) { return false; }
w.setBlockMetadataWithNotify(x, y, z, direction, 2);
SoundQueue.queueSound(w, (double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "tile.piston.in", 0.5F, w.rand.nextFloat() * 0.25F + 0.6F);
}
return false;
}
public boolean tryRepel(World w, int x, int y, int z, int direction, boolean simulate) {
int dx = Facing.offsetsXForSide[direction];
int dy = Facing.offsetsYForSide[direction];
int dz = Facing.offsetsZForSide[direction];
Chunk c0 = ChunkCache.getChunk(w, x >> 4, z >> 4, true);
int meta = c0.getBlockMetadata(x & 15, y, z & 15);
//if (!isExtended(meta)) return false;
//System.out.println("Repelling: " + Util.xyzString(x, y, z));
int x1 = x + dx, y1 = y + dy, z1 = z + dz;
if (y1 < 0 || y1 > 255) return false;
Chunk c1 = ChunkCache.getChunk(w, x1 >> 4, z1 >> 4, true);
int id1 = c1.getBlockID(x1 & 15, y1, z1 & 15);
int meta1 = c1.getBlockMetadata(x1 & 15, y1, z1 & 15);
if (id1 != Block.pistonExtension.blockID) return false;
c1.setBlockIDWithMetadata(x1 & 15, y1, z1 & 15, 0, 0);
/* Calculate how many steps that will be pulled */
// TODO use the power strength to decide an upper limit on how many steps
// should be pulled
int steps;
if (!isSticky) steps = 1;
else for (steps = 1; steps < 256; steps++) {
int xN = x + dx * (steps + 1);
int yN = y + dy * (steps + 1);
int zN = z + dz * (steps + 1);
Chunk cN = ChunkCache.getChunk(w, xN >> 4, zN >> 4, true);
if(yN<0 || yN > 255) break;
int idN = cN.getBlockID(xN & 15, yN, zN & 15);
if(idN == Block.bedrock.blockID) { steps--; break; }
if (idN == 0 || Fluids.isLiquid[idN] || Gases.isGas[idN]) break;
Block bN = Block.blocksList[idN];
//if(!bN.isOpaqueCube()) { steps++; break; }
}
System.out.println("Repell steps: " + steps);
/* Next, pull in all these blocks */
for (int step2 = 1; step2 < steps; step2++) {
/** Step 2 is the destination block */
int xD = x + dx * step2;
int yD = y + dy * step2;
int zD = z + dz * step2;
int xS = x + dx * (step2 + 1);
int yS = y + dy * (step2 + 1);
int zS = z + dz * (step2 + 1);
if (yS > 255 || yS < 0) continue;
FysiksFun.moveBlock(w, xD, yD, zD, xS, yS, zS, true, step2 == steps - 1);
}
ChunkMarkUpdater.scheduleBlockMark(w, x1, y1, z1, id1, meta1);
/*w.setBlock(x1, y1, z1, Block.pistonMoving.blockID, direction | (isSticky ? 8 : 0), 4);
w.setBlockTileEntity(x1, y1, z1,
BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, direction | (isSticky ? 8 : 0), direction, false, false));
*/
return true;
}
public boolean tryExtend(World w, int x, int y, int z, int direction, boolean simulate) {
Chunk c0 = ChunkCache.getChunk(w, x >> 4, z >> 4, true);
int meta = c0.getBlockMetadata(x & 15, y, z & 15);
if (isExtended(meta)) return false;
//System.out.println("Extending: " + Util.xyzString(x, y, z));
int dx = Facing.offsetsXForSide[direction];
int dy = Facing.offsetsYForSide[direction];
int dz = Facing.offsetsZForSide[direction];
/** The number of blocks that will be pushed */
int steps;
for (steps = 0; steps < 256; steps++) {
int x2 = x + dx * (steps + 1);
int y2 = y + dy * (steps + 1);
int z2 = z + dz * (steps + 1);
if (y2 < 0 || y2 > 255) continue;
Chunk c = ChunkCache.getChunk(w, x2 >> 4, z2 >> 4, true);
int id = c.getBlockID(x2 & 15, y2, z2 & 15);
if (id == 0 || Fluids.isLiquid[id] || Gases.isGas[id]) break;
}
if (steps == 256) return false;
if (simulate) return true;
/* Now, start shifting the blocks to the end */
int step2;
for (step2 = steps; step2 > 0; step2--) {
int xD = x + dx * (step2 + 1);
int yD = y + dy * (step2 + 1);
int zD = z + dz * (step2 + 1);
int xS = x + dx * step2;
int yS = y + dy * step2;
int zS = z + dz * step2;
if (yD < 0 || yD > 255) return true;
FysiksFun.moveBlock(w, xD, yD, zD, xS, yS, zS, true, false);
}
int x1 = x + dx;
int y1 = y + dy;
int z1 = z + dz;
Chunk c1 = ChunkCache.getChunk(w, x1 >> 4, z1 >> 4, true);
c1.setBlockIDWithMetadata(x1 & 15, y1, z1 & 15, Block.pistonMoving.blockID, direction | (isSticky ? 8 : 0));
ChunkMarkUpdater.scheduleBlockMark(w, x1, y1, z1, -1, -1);
// w.setBlock(x1, y1, z1, Block.pistonMoving.blockID, direction | (isSticky
// ? 8 : 0), 4);
w.setBlockTileEntity(x1, y1, z1, BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, direction | (isSticky ? 8 : 0), direction, true, true));
return true;
}
/**
* handles attempts to extend or retract the piston.
*/
private void updatePistonState(World w, int x, int y, int z) {
int meta = w.getBlockMetadata(x, y, z);
int dir = getOrientation(meta);
if (dir != 7) {
boolean flag = this.isIndirectlyPowered(w, x, y, z, dir);
if (flag && !isExtended(meta)) {
if (tryExtend(w, x, y, z, dir, true)) {
w.addBlockEvent(x, y, z, this.blockID, 0, dir);
}
} else if (!flag && isExtended(meta)) {
w.setBlockMetadataWithNotify(x, y, z, dir, 2);
w.addBlockEvent(x, y, z, this.blockID, 1, dir);
}
}
}
/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
int l = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);
if (!par1World.isRemote) {
this.updatePistonState(par1World, par2, par3, par4);
}
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which
* neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor
* blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
if (!par1World.isRemote) {
this.updatePistonState(par1World, par2, par3, par4);
}
}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4) {
if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) {
this.updatePistonState(par1World, par2, par3, par4);
}
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
Block.pistonBase.registerIcons(par1IconRegister);
super.registerIcons(par1IconRegister);
}
}
| 9,967
|
Java
|
.java
|
mbrx/FysiksFun
| 9
| 0
| 5
|
2014-05-08T15:11:38Z
|
2014-11-09T13:16:46Z
|
617b385cd07f11bbb4f88563cef7a4ff4c173e446346bc06d83b2746c45c54c5
|
[] |
[
1337,
364,
858,
125,
51,
505,
51,
12868,
2246,
19344,
64,
222,
222,
485,
9210,
124,
51,
22862,
51,
35663,
51,
2836,
102,
4260,
284,
51,
7433,
64,
222,
485,
9210,
124,
51,
22862,
51,
35663,
51,
2836,
102,
4260,
284,
51,
7433,
4505,
64,
222,
485,
364,
858,
125,
51,
505,
51,
75,
1291,
45687,
11592,
64,
222,
485,
364,
858,
125,
51,
505,
51,
10475,
120,
51,
27305,
120,
64,
222,
485,
364,
858,
125,
51,
505,
51,
10475,
120,
51,
76,
5657,
64,
222,
485,
364,
858,
125,
51,
505,
51,
1058,
51,
7134,
2610,
64,
222,
485,
364,
858,
125,
51,
505,
51,
1058,
51,
7134,
4503,
21289,
64,
222,
485,
364,
858,
125,
51,
505,
51,
1058,
51,
9024,
4098,
64,
222,
485,
364,
858,
125,
51,
505,
51,
1058,
51,
1747,
64,
222,
485,
3723,
51,
8654,
51,
1540,
51,
2246,
64,
222,
485,
3723,
51,
8654,
51,
1540,
51,
2246,
85,
446,
286,
1778,
64,
222,
485,
3723,
51,
8654,
51,
1540,
51,
2246,
85,
446,
286,
27810,
64,
222,
485,
3723,
51,
8654,
51,
1540,
51,
2246,
35625,
64,
222,
485,
3723,
51,
8654,
51,
1540,
51,
799,
433,
2234,
2588,
64,
222,
485,
3723,
51,
8654,
51,
1598,
51,
9405,
51,
8288,
51,
2930,
4339,
64,
222,
485,
3723,
51,
8654,
51,
2244,
51,
2234,
38958,
1778,
64,
222,
485,
3723,
51,
8654,
51,
1113,
51,
26022,
64,
222,
485,
3723,
51,
8654,
51,
8344,
2244,
51,
41760,
64,
222,
485,
3723,
51,
8654,
51,
1058,
51,
45207,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
6719,
64,
222,
485,
3723,
51,
8654,
51,
5879,
51,
7211,
51,
7134,
64,
222,
222,
942,
462,
6579,
1158,
85,
446,
286,
1778,
2041,
6579,
85,
446,
286,
1778,
320,
736,
1922,
458,
48015,
64,
736,
581,
6579,
1158,
85,
446,
286,
1778,
45,
429,
898,
54,
49,
1922,
458,
48015,
46,
320,
303,
2615,
45,
587,
54,
49,
458,
48015,
312,
303,
477,
51,
316,
48015,
299,
458,
48015,
64,
353,
339,
736,
1041,
682,
338,
9378,
341,
2181,
391,
708,
5226,
391,
2337,
434,
580,
458,
30408,
651,
43463,
51,
682,
588,
353,
581,
1922,
458,
27282,
651,
6790,
337,
45,
6719,
898,
54,
6719,
49,
648,
837,
49,
648,
553,
49,
648,
1308,
49,
648,
6999,
46,
320,
303,
461,
6999,
882,
244,
53,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
449,
244,
54,
49,
1308,
49,
244,
53,
46,
1037,
878,
310,
518,
327,
7366,
882,
244,
54,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
494,
244,
54,
49,
1308,
49,
244,
54,
46,
1037,
878,
343,
518,
327,
7366,
882,
244,
55,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
449,
244,
54,
49,
244,
55,
46,
1037,
878,
419,
518,
327,
7366,
882,
244,
56,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
494,
244,
54,
49,
244,
56,
46,
1037,
878,
518,
327,
7366,
882,
244,
58,
547,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
494,
244,
54,
49,
553,
49,
1308,
49,
244,
58,
46,
1037,
878,
518,
327,
7366,
882,
244,
57,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
449,
244,
54,
49,
553,
49,
1308,
49,
244,
57,
46,
1037,
878,
547,
518,
327,
587,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
49,
244,
53,
46,
1037,
878,
518,
327,
587,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
494,
244,
55,
49,
1308,
49,
244,
54,
46,
1037,
878,
518,
327,
587,
54,
6719,
733,
657,
390,
27282,
6790,
2319,
45,
125,
49,
553,
494,
244,
54,
49,
1308,
449,
244,
54,
49,
244,
55,
46,
1037,
878,
518,
327,
587,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
494,
244,
54,
49,
1308,
494,
244,
54,
49,
244,
56,
46,
1037,
878,
518,
327,
587,
54,
6719,
733,
657,
390,
27282,
6790,
2319,
45,
125,
449,
244,
54,
49,
553,
494,
244,
54,
49,
1308,
49,
244,
57,
46,
1037,
878,
518,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
494,
244,
54,
49,
553,
494,
244,
54,
49,
1308,
49,
244,
58,
7775,
7775,
4254,
353,
339,
736,
581,
1922,
563,
2246,
1167,
10920,
45,
6719,
360,
49,
648,
837,
49,
648,
553,
49,
648,
1308,
49,
648,
1708,
625,
49,
648,
6999,
46,
320,
303,
434,
1445,
124,
51,
316,
7318,
46,
320,
416,
1276,
1369,
10618,
120,
52,
38690,
341,
5783,
451,
341,
317,
446,
286,
563,
2060,
5226,
588,
416,
1922,
4666,
299,
477,
51,
316,
27282,
651,
6790,
337,
45,
124,
49,
837,
49,
553,
49,
1308,
49,
6999,
312,
416,
434,
327,
4570,
979,
1708,
625,
630,
244,
54,
46,
320,
310,
360,
51,
489,
2246,
4108,
1569,
11607,
45,
125,
49,
553,
49,
1308,
49,
6999,
542,
244,
61,
49,
244,
55,
312,
310,
461,
920,
64,
416,
339,
416,
434,
1445,
4570,
979,
1708,
625,
630,
244,
53,
46,
320,
461,
920,
64,
339,
303,
339,
303,
1276,
9303,
16691,
563,
13600,
588,
303,
434,
327,
44615,
630,
244,
53,
46,
320,
416,
1276,
3916,
18874,
391,
12385,
341,
317,
446,
286,
986,
49,
2337,
434,
580,
4864,
588,
416,
434,
1445,
597,
51,
1287,
20592,
45,
124,
49,
837,
49,
553,
49,
1308,
49,
6999,
49,
920,
509,
320,
461,
920,
64,
339,
416,
1276,
2048,
13105,
327,
23895,
708,
1614,
20592,
3654,
341,
466,
446,
286,
4823,
10234,
588,
416,
1276,
3381,
477,
1361,
458,
10784,
4824,
2594,
3682,
49,
1307,
427,
1130,
3493,
595,
5366,
588,
416,
360,
51,
489,
2246,
4108,
1569,
11607,
45,
125,
49,
553,
49,
1308,
49,
6999,
542,
244,
61,
49,
244,
55,
312,
416,
16981,
4098,
51,
3941,
9024,
45,
124,
49,
327,
2640,
46,
837,
494,
244,
53,
51,
58,
73,
49,
327,
2640,
46,
553,
494,
244,
53,
51,
58,
73,
49,
327,
2640,
46,
1308,
494,
244
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1922,
458,
48015,
64,
736,
581,
6579,
1158,
85,
446,
286,
1778,
45,
429,
898,
54,
49,
1922,
458,
48015,
46,
320,
303,
2615,
45,
587,
54,
49,
458,
48015,
312,
303,
477,
51,
316,
48015,
299,
458,
48015,
64,
353,
339,
736,
1041,
682,
338,
9378,
341,
2181,
391,
708,
5226,
391,
2337,
434,
580,
458,
30408,
651,
43463,
51,
682,
588,
353,
581,
1922,
458,
27282,
651,
6790,
337,
45,
6719,
898,
54,
6719,
49,
648,
837,
49,
648,
553,
49,
648,
1308,
49,
648,
6999,
46,
320,
303,
461,
6999,
882,
244,
53,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
449,
244,
54,
49,
1308,
49,
244,
53,
46,
1037,
878,
310,
518,
327,
7366,
882,
244,
54,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
494,
244,
54,
49,
1308,
49,
244,
54,
46,
1037,
878,
343,
518,
327,
7366,
882,
244,
55,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
449,
244,
54,
49,
244,
55,
46,
1037,
878,
419,
518,
327,
7366,
882,
244,
56,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
494,
244,
54,
49,
244,
56,
46,
1037,
878,
518,
327,
7366,
882,
244,
58,
547,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
494,
244,
54,
49,
553,
49,
1308,
49,
244,
58,
46,
1037,
878,
518,
327,
7366,
882,
244,
57,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
449,
244,
54,
49,
553,
49,
1308,
49,
244,
57,
46,
1037,
878,
547,
518,
327,
587,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
49,
244,
53,
46,
1037,
878,
518,
327,
587
] | 3,463,125,437,157,606,400
| true
| false
| false
| false
|
[
878,
343,
518,
327,
7366,
882,
244,
55,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
449,
244,
54,
49,
244,
55,
46,
1037,
878,
419,
518,
327,
7366,
882,
244,
56,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
49,
553,
49,
1308,
494,
244,
54,
49,
244,
56,
46,
1037,
878,
518,
327,
7366,
882,
244,
58,
547,
979,
898,
54,
6719,
51,
390,
27282,
6790,
2319,
45,
125,
494,
244,
54,
49,
553,
49,
1308,
49,
244,
58,
46,
1037,
878,
518,
327,
7366,
882,
244,
57
] | 3,520,441,365,050,343,400
| true
|
boolean isSticky;
public BlockFFPistonBase(int par1, boolean isSticky) {
super(par1, isSticky);
this.isSticky = isSticky;
}
/**
* checks the block to that side to see if it is indirectly powered.
*/
public boolean isIndirectlyPowered(World par1World, int x, int y, int z, int direction) {
return direction!= 0 && par1World.getIndirectPowerOutput(x, y - 1, z, 0)? true
: (direction!= 1 && par1World.getIndirectPowerOutput(x, y + 1, z, 1)? true
: (direction!= 2 && par1World.getIndirectPowerOutput(x, y, z - 1, 2)? true
: (direction!= 3 && par1World.getIndirectPowerOutput(x, y, z + 1, 3)? true : (direction!= 5
&& par1World.getIndirectPowerOutput(x + 1, y, z, 5)? true : (direction!= 4
|
that side to see if it is indirectly powered.
*/
public boolean isIndirectlyPowered(World par1World, int x, int y, int z, int direction) {
return direction!= 0 && par1World.getIndirectPowerOutput(x, y - 1, z, 0)? true
: (direction!= 1 && par1World.getIndirectPowerOutput(x, y + 1, z, 1)? true
: (direction!= 2 && par1World.getIndirectPowerOutput(x, y, z - 1, 2)? true
: (direction!= 3 && par1World.getIndirectPowerOutput(x, y, z + 1, 3)? true : (direction!= 5
&& par1World.getIndirectPowerOutput(x + 1, y, z, 5)? true : (direction!= 4
|
.getIndirectPowerOutput(x, y - 1, z, 0)? true
: (direction!= 1 && par1World.getIndirectPowerOutput(x, y + 1, z, 1)? true
: (direction!= 2 && par1World.getIndirectPowerOutput(x, y, z - 1, 2)? true
: (direction!= 3 && par1World.getIndirectPowerOutput(x, y, z + 1, 3)? true : (direction!= 5
&& par1World.getIndirectPowerOutput(x + 1, y, z, 5)? true : (direction!= 4
|
true
: (direction!= 2 && par1World.getIndirectPowerOutput(x, y, z - 1, 2)? true
: (direction!= 3 && par1World.getIndirectPowerOutput(x, y, z + 1, 3)? true : (direction!= 5
&& par1World.getIndirectPowerOutput(x + 1, y, z, 5)? true : (direction!= 4
|
&& par1World.getIndirectPowerOutput(x - 1, y, z, 4)? true
: (par1World.getIndirectPowerOutput(x, y, z, 0)? true : (par
|
MdCustomerContactDaoImpl.java
|
/FileExtraction/Java_unseen/redragon1985_redragon-erp/erp-parent/erp-masterData/src/main/java/com/erp/masterdata/customer/dao/hibernate/MdCustomerContactDaoImpl.java
|
/*
* Copyright 2020-2021 redragon.dongbin
*
* This file is part of redragon-erp/赤龙ERP.
* redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
* redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with redragon-erp/赤龙ERP. If not, see <https://www.gnu.org/licenses/>.
*/
package com.erp.masterdata.customer.dao.hibernate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.framework.dao.BasicDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import com.framework.annotation.Cache;
import com.framework.annotation.Permissions;
import com.framework.annotation.Permissions.PermissionType;
import com.framework.annotation.SqlParam;
import com.framework.dao.model.Pages;
import com.framework.util.DaoUtil;
import com.erp.masterdata.customer.dao.MdCustomerContactDao;
import com.erp.masterdata.customer.dao.model.MdCustomer;
import com.erp.masterdata.customer.dao.model.MdCustomerBank;
import com.erp.masterdata.customer.dao.model.MdCustomerContact;
import com.erp.masterdata.customer.dao.model.MdCustomerContactCO;
@Repository
public class MdCustomerContactDaoImpl implements MdCustomerContactDao{
//注入basicDao工具类
@Autowired
private BasicDao basicDao;
@Override
public void insertDataObject(MdCustomerContact obj) {
this.basicDao.insertDataTransaction(obj);
}
@Override
public void updateDataObject(MdCustomerContact obj) {
this.basicDao.updateDataTransaction(obj);
}
@Override
public void insertOrUpdateDataObject(MdCustomerContact obj) {
this.basicDao.insertOrUpdateDataTransaction(obj);
}
@Override
public void deleteDataObject(MdCustomerContact obj) {
this.basicDao.deleteDataTransactionJPA(obj);
}
@Override
public List<MdCustomerContact> getDataObjects() {
return this.basicDao.getDataAllObject(MdCustomerContact.class);
}
@Override
public MdCustomerContact getDataObject(int id) {
return (MdCustomerContact)this.basicDao.getDataObject(MdCustomerContact.class, id);
}
@Override
public MdCustomerContact getDataObject(String code) {
return null;
}
@Override
public List<MdCustomerContact> getDataObjects(MdCustomerContactCO paramObj) {
String sql = "select c.* from md_customer_contact c where customer_code=:code";
Map<String, Object> args = new HashMap<String, Object>();
args.put("code", paramObj.getCustomerCode());
sql = sql + " order by c.contact_id desc";
Map<String, Class<?>> entity = new HashMap<String, Class<?>>();
entity.put("c", MdCustomerContact.class);
return this.basicDao.selectData(sql, entity, args);
}
@Override
public List<MdCustomerContact> getDataObjects(Pages pages) {
return null;
}
@Override
public List<MdCustomerContact> getDataObjects(Pages pages, MdCustomerContactCO paramObj) {
return null;
}
@Override
public List<Map<String, Object>> getDataObjectsArray(Pages pages, MdCustomerContactCO paramObj) {
return null;
}
@Override
@Permissions(PermissionType.OWN)
public List<MdCustomerContact> getDataObjectsForDataAuth(@SqlParam String dataAuthSQL, Pages pages, MdCustomerContactCO paramObj) {
return null;
}
@Override
public int getContactCountByCustomerCode(String customerCode) {
String sql = "select count(1) from md_customer_contact c where c.customer_code = :customerCode";
Map<String, Object> args = new HashMap<String, Object>();
args.put("customerCode", customerCode);
List list = this.basicDao.selectDataSqlCount(sql, args);
if(list.size()>0) {
return Integer.parseInt(String.valueOf(list.get(0)));
}
return 0;
}
@Override
public List<MdCustomerContact> getContactListByCustomerCode(Pages pages, MdCustomerContactCO paramObj) {
String sql = "select c.* from md_customer_contact c where customer_code=:code";
Map<String, Object> args = new HashMap<String, Object>();
args.put("code", paramObj.getCustomerCode());
sql = sql + " order by c.contact_id desc";
Map<String, Class<?>> entity = new HashMap<String, Class<?>>();
entity.put("c", MdCustomerContact.class);
return this.basicDao.getDataSql(sql, entity, args, pages);
}
}
| 5,147
|
Java
|
.java
|
redragon1985/redragon-erp
| 145
| 37
| 0
|
2020-08-11T07:51:28Z
|
2024-03-08T06:45:54Z
|
fcf2032a94ee8da0cb98a98dae4e379eaaa793efa558c7ff4b81fbc477e75e9b
|
[] |
[
1127,
222,
338,
2657,
244,
55,
53,
55,
53,
50,
55,
53,
55,
54,
3363,
2471,
286,
51,
45382,
1793,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
3363,
2471,
286,
50,
22059,
52,
5603,
135,
38738,
546,
85,
51,
499,
338,
3363,
2471,
286,
50,
22059,
52,
5603,
135,
38738,
546,
85,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
499,
338,
3363,
2471,
286,
50,
22059,
52,
5603,
135,
38738,
546,
85,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
499,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
3363,
2471,
286,
50,
22059,
52,
5603,
135,
38738,
546,
85,
51,
244,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
20294,
64,
222,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
785,
51,
2863,
51,
13974,
51,
7114,
8924,
64,
222,
485,
1105,
51,
4140,
51,
9580,
51,
5802,
51,
4341,
51,
10789,
64,
222,
485,
1105,
51,
4140,
51,
9580,
51,
5802,
51,
4341,
51,
24381,
64,
222,
485,
1105,
51,
4140,
51,
19017,
51,
3231,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
2610,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
10967,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
10967,
51,
7052,
638,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
5352,
3196,
64,
222,
485,
785,
51,
2863,
51,
13974,
51,
1184,
51,
10771,
64,
222,
485,
785,
51,
2863,
51,
1058,
51,
8924,
1747,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
20769,
7950,
5883,
8924,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
12212,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
5883,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
5883,
1213,
64,
222,
222,
69,
3231,
222,
942,
462,
46447,
7950,
5883,
8924,
3499,
4584,
46447,
7950,
5883,
8924,
128,
19530,
453,
8393,
5039,
6404,
8924,
19330,
5079,
303,
496,
10789,
303,
964,
9280,
8924,
6575,
8924,
64,
2205,
496,
1806,
303,
581,
782,
5567,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
3233,
768,
4331,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
782,
1991,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
1896,
768,
4331,
45,
2085,
312,
303,
339,
2205,
496,
1806,
303,
581,
782,
5567,
24861,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
3233,
24861,
768,
4331,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
782,
3081,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
2577,
768,
4331,
79,
9614,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
1701,
65,
20769,
7950,
5883,
67,
22920,
6699,
365,
320,
310,
461,
477,
51,
6404,
8924,
51,
11574,
1947,
976,
45,
20769,
7950,
5883,
51,
842,
312,
303,
339,
465,
496,
1806,
303,
581,
46447,
7950,
5883,
22920,
976,
45,
429,
828,
46,
320,
310,
461,
327,
20769,
7950,
5883,
46,
597,
51,
6404,
8924,
51,
11574,
976,
45,
20769,
7950,
5883,
51,
842,
49,
828,
312,
303,
339,
2205,
496,
1806,
303,
581,
46447,
7950,
5883,
22920,
976,
45,
671,
1361,
46,
320,
310,
461,
762,
64,
303,
339,
2205,
496,
1806,
303,
581,
1701,
65,
20769,
7950,
5883,
67,
22920,
6699,
45,
20769,
7950,
5883,
1213,
4380,
3287,
46,
320,
310,
910,
5576,
299,
332,
1632,
300,
3440,
664,
8745,
100,
7133,
100,
5559,
300,
2174,
9711,
100,
707,
30256,
707,
884,
2776,
3531,
65,
671,
49,
2210,
67,
2194,
299,
556,
8329,
65,
671,
49,
2210,
2938,
310,
2194,
51,
543,
459,
707,
411,
4380,
3287,
51,
390,
7950,
1241,
1052,
2776,
5576,
299,
5576,
494,
332,
2554,
829,
300,
51,
5559,
100,
333,
5615,
884,
2776,
3531,
65,
671,
49,
1727,
31785,
4436,
299,
556,
8329,
65,
671,
49,
1727,
1907,
20591,
310,
4436,
51,
543,
459,
104,
411,
46447,
7950,
5883,
51,
842,
312,
2776,
461,
477,
51,
6404,
8924,
51,
1632,
768,
45,
2622,
49,
4436,
49,
2194,
312,
303,
339,
2205,
496,
1806,
303,
581,
1701,
65,
20769,
7950,
5883,
67,
22920,
6699,
45,
10771,
7862,
46,
320,
310,
461,
762,
64,
303,
339,
2205,
496,
1806,
303,
581,
1701,
65,
20769,
7950,
5883,
67,
22920,
6699,
45,
10771,
7862,
49,
46447,
7950,
5883,
1213,
4380,
3287,
46,
320,
310,
461,
762,
64,
303,
339,
465,
496,
1806,
303,
581,
1701,
65,
1225,
65,
671,
49,
2210,
2023,
22920,
6699,
1280,
45,
10771,
7862,
49,
46447,
7950,
5883,
1213,
4380,
3287,
46,
320,
310,
461,
762,
64,
303,
339,
2205,
496,
1806,
303,
496,
10967,
45,
7052,
638,
51,
39885,
46,
303,
581,
1701,
65,
20769,
7950,
5883,
67,
22920,
6699,
1580,
768,
2693,
4810,
5352,
3196,
910,
727,
2693,
3566,
49,
26320,
7862,
49,
46447,
7950,
5883,
1213,
4380,
3287,
46,
320,
310,
461,
762,
64,
303,
339,
2205,
496,
1806,
303,
581,
648,
640,
5883,
1552,
1103,
7950,
1241,
45,
671,
9711,
1241,
46,
320,
310,
910,
5576,
299,
332,
1632,
2409,
45,
54,
46,
664,
8745
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
485,
785,
51,
2863,
51,
4341,
51,
2610,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
10967,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
10967,
51,
7052,
638,
64,
222,
485,
785,
51,
2863,
51,
4341,
51,
5352,
3196,
64,
222,
485,
785,
51,
2863,
51,
13974,
51,
1184,
51,
10771,
64,
222,
485,
785,
51,
2863,
51,
1058,
51,
8924,
1747,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
20769,
7950,
5883,
8924,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
12212,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
5883,
64,
222,
485,
785,
51,
22059,
51,
2611,
624,
51,
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
5883,
1213,
64,
222,
222,
69,
3231,
222,
942,
462,
46447,
7950,
5883,
8924,
3499,
4584,
46447,
7950,
5883,
8924,
128,
19530,
453,
8393,
5039,
6404,
8924,
19330,
5079,
303,
496,
10789,
303,
964,
9280,
8924,
6575,
8924,
64,
2205,
496,
1806,
303,
581,
782,
5567,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
3233,
768,
4331,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
782,
1991,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
1896,
768,
4331,
45,
2085,
312,
303,
339,
2205,
496,
1806,
303,
581,
782,
5567,
24861,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
3233,
24861,
768,
4331,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
782,
3081,
27595,
45,
20769,
7950,
5883,
2847,
46
] | 4,158,866,075,698,001,400
| true
| false
| false
| false
|
[
7133,
51,
13974,
51,
1184,
51,
20769,
7950,
5883,
1213,
64,
222,
222,
69,
3231,
222,
942,
462,
46447,
7950,
5883,
8924,
3499,
4584,
46447,
7950,
5883,
8924,
128,
19530,
453,
8393,
5039,
6404,
8924,
19330,
5079,
303,
496,
10789,
303,
964,
9280,
8924,
6575,
8924,
64,
2205,
496,
1806,
303,
581,
782,
5567,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
3233,
768,
4331,
45,
2085,
312,
303,
339,
465,
496,
1806,
303,
581,
782,
1991,
27595,
45,
20769,
7950,
5883,
2847,
46,
320,
310,
477,
51,
6404,
8924,
51,
1896,
768,
4331
] | 219,890,044,851,954,020
| true
|
import com.framework.annotation.Cache;
import com.framework.annotation.Permissions;
import com.framework.annotation.Permissions.PermissionType;
import com.framework.annotation.SqlParam;
import com.framework.dao.model.Pages;
import com.framework.util.DaoUtil;
import com.erp.masterdata.customer.dao.MdCustomerContactDao;
import com.erp.masterdata.customer.dao.model.MdCustomer;
import com.erp.masterdata.customer.dao.model.MdCustomerBank;
import com.erp.masterdata.customer.dao.model.MdCustomerContact;
import com.erp.masterdata.customer.dao.model.MdCustomerContactCO;
@Repository
public class MdCustomerContactDaoImpl implements MdCustomerContactDao{
//注入basicDao工具类
@Autowired
private BasicDao basicDao;
@Override
public void insertDataObject(MdCustomerContact obj) {
this.basicDao.insertDataTransaction(obj);
}
@Override
public void updateDataObject(MdCustomerContact obj) {
this.basicDao.updateDataTransaction
|
dao.model.Pages;
import com.framework.util.DaoUtil;
import com.erp.masterdata.customer.dao.MdCustomerContactDao;
import com.erp.masterdata.customer.dao.model.MdCustomer;
import com.erp.masterdata.customer.dao.model.MdCustomerBank;
import com.erp.masterdata.customer.dao.model.MdCustomerContact;
import com.erp.masterdata.customer.dao.model.MdCustomerContactCO;
@Repository
public class MdCustomerContactDaoImpl implements MdCustomerContactDao{
//注入basicDao工具类
@Autowired
private BasicDao basicDao;
@Override
public void insertDataObject(MdCustomerContact obj) {
this.basicDao.insertDataTransaction(obj);
}
@Override
public void updateDataObject(MdCustomerContact obj) {
this.basicDao.updateDataTransaction
|
MdCustomer;
import com.erp.masterdata.customer.dao.model.MdCustomerBank;
import com.erp.masterdata.customer.dao.model.MdCustomerContact;
import com.erp.masterdata.customer.dao.model.MdCustomerContactCO;
@Repository
public class MdCustomerContactDaoImpl implements MdCustomerContactDao{
//注入basicDao工具类
@Autowired
private BasicDao basicDao;
@Override
public void insertDataObject(MdCustomerContact obj) {
this.basicDao.insertDataTransaction(obj);
}
@Override
public void updateDataObject(MdCustomerContact obj) {
this.basicDao.updateDataTransaction
|
customer.dao.model.MdCustomerContactCO;
@Repository
public class MdCustomerContactDaoImpl implements MdCustomerContactDao{
//注入basicDao工具类
@Autowired
private BasicDao basicDao;
@Override
public void insertDataObject(MdCustomerContact obj) {
this.basicDao.insertDataTransaction(obj);
}
@Override
public void updateDataObject(MdCustomerContact obj) {
this.basicDao.updateDataTransaction
|
(obj);
}
@Override
public void insertOrUpdateDataObject(MdCustomerContact obj) {
this.basicDao.insertOrUpdateDataTransaction(obj);
}
@Override
public void deleteDataObject(MdCustomerContact obj)
|
ShiftHeadPredicateFeatureSet.java
|
/FileExtraction/Java_unseen/lil-lab_nccg/nn-amr-dev/amr/src/edu/uw/cs/lil/amr/features/decomposed/ShiftHeadPredicateFeatureSet.java
|
package edu.uw.cs.lil.amr.features.decomposed;
import java.util.Collections;
import java.util.Set;
import edu.cornell.cs.nlp.spf.base.hashvector.IHashVector;
import edu.cornell.cs.nlp.spf.base.hashvector.KeyArgs;
import edu.cornell.cs.nlp.spf.data.IDataItem;
import edu.cornell.cs.nlp.spf.explat.IResourceRepository;
import edu.cornell.cs.nlp.spf.explat.ParameterizedExperiment.Parameters;
import edu.cornell.cs.nlp.spf.explat.resources.IResourceObjectCreator;
import edu.cornell.cs.nlp.spf.explat.resources.usage.ResourceUsage;
import edu.cornell.cs.nlp.spf.mr.lambda.Lambda;
import edu.cornell.cs.nlp.spf.mr.lambda.Literal;
import edu.cornell.cs.nlp.spf.mr.lambda.LogicalConstant;
import edu.cornell.cs.nlp.spf.mr.lambda.LogicalExpression;
import edu.cornell.cs.nlp.spf.parser.ccg.IOverloadedParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.IParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.model.parse.IParseFeatureSet;
import edu.cornell.cs.nlp.spf.parser.ccg.shiftreduce.steps.AbstractShiftReduceStep;
import edu.uw.cs.lil.amr.lambda.AMRServices;
/**
* Simple feature to trigger on the head of the AMR expression.
*
* @author Yoav Artzi
*
*/
public class ShiftHeadPredicateFeatureSet<DI extends IDataItem<?>>
implements IParseFeatureSet<DI, LogicalExpression> {
private static final String DEFAULT_TAG = "SEMHEAD";
private static final long serialVersionUID = 2255537024084940329L;
private final String tag;
public ShiftHeadPredicateFeatureSet(String tag) {
this.tag = tag;
}
@Override
public Set<KeyArgs> getDefaultFeatures() {
// Nothing to do.
return Collections.emptySet();
}
@Override
public void setFeatures(IParseStep<LogicalExpression> step,
IHashVector feats, DI dataItem) {
if (step instanceof AbstractShiftReduceStep) {
final AbstractShiftReduceStep<LogicalExpression> shiftReduceParseStep = (AbstractShiftReduceStep<LogicalExpression>) step;
if (shiftReduceParseStep.isUnary()) {
final LogicalExpression semantics = shiftReduceParseStep
.getRoot().getSemantics();
if (semantics != null) {
final LogicalConstant instanceType;
if (AMRServices.isSkolemTerm(semantics)) {
instanceType = AMRServices
.getTypingPredicate((Literal) semantics);
} else if (AMRServices.isSkolemTermBody(semantics)) {
instanceType = AMRServices
.getTypingPredicate((Lambda) semantics);
} else {
return;
}
if (instanceType != null) {
feats.set(tag, instanceType.getBaseName(), 1.0);
}
}
}
} else { // Below code is used by CKY or parsers that handle unary rule
// via overloading
if (step instanceof IOverloadedParseStep) {
final LogicalExpression semantics = ((IOverloadedParseStep<LogicalExpression>) step)
.getIntermediate().getSemantics();
if (semantics != null) {
final LogicalConstant instanceType;
if (AMRServices.isSkolemTerm(semantics)) {
instanceType = AMRServices
.getTypingPredicate((Literal) semantics);
} else if (AMRServices.isSkolemTermBody(semantics)) {
instanceType = AMRServices
.getTypingPredicate((Lambda) semantics);
} else {
return;
}
if (instanceType != null) {
feats.set(tag, instanceType.getBaseName(), 1.0);
}
}
}
}
}
public static class Creator<DI extends IDataItem<?>> implements
IResourceObjectCreator<ShiftHeadPredicateFeatureSet<DI>> {
private final String type;
public Creator() {
this("feat.decomposed.amrhead");
}
public Creator(String type) {
this.type = type;
}
@Override
public ShiftHeadPredicateFeatureSet<DI> create(Parameters params,
IResourceRepository repo) {
return new ShiftHeadPredicateFeatureSet<>(
params.get("tag", DEFAULT_TAG));
}
@Override
public String type() {
return type;
}
@Override
public ResourceUsage usage() {
return ResourceUsage
.builder(type, ShiftHeadPredicateFeatureSet.class)
.addParam("tag", String.class,
"Feature set tag (default: " + DEFAULT_TAG + ")")
.build();
}
}
}
| 4,072
|
Java
|
.java
|
lil-lab/nccg
| 17
| 2
| 1
|
2017-02-10T19:38:56Z
|
2017-02-21T06:54:44Z
|
4d548baa0c9c634805964609e19ccf8f60127db6b8764d55ab0f19d2d278caae
|
[] |
[
1337,
15357,
51,
17378,
51,
1766,
51,
15552,
51,
424,
119,
51,
5977,
51,
305,
44892,
64,
222,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
1460,
51,
2905,
2423,
51,
78,
2899,
2880,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
1460,
51,
2905,
2423,
51,
971,
3097,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
624,
51,
31631,
1114,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
346,
17053,
51,
78,
2305,
3231,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
346,
17053,
51,
33588,
10398,
51,
3694,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
346,
17053,
51,
5390,
51,
78,
2305,
976,
11147,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
346,
17053,
51,
5390,
51,
8797,
51,
2305,
6786,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
16182,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
8216,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
17537,
5476,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
17537,
3503,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
2354,
443,
5907,
4493,
3549,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
78,
4493,
3549,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
1184,
51,
2228,
51,
78,
4493,
4249,
903,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
5514,
8957,
51,
7495,
51,
5597,
10221,
21932,
3549,
64,
222,
485,
15357,
51,
17378,
51,
1766,
51,
15552,
51,
424,
119,
51,
6034,
51,
2229,
87,
5466,
64,
222,
222,
1350,
222,
338,
7169,
2817,
391,
6604,
563,
341,
5783,
451,
341,
8117,
87,
6112,
51,
222,
338,
222,
338,
496,
2133,
32995,
472,
9134,
11290,
222,
338,
222,
588,
222,
942,
462,
26105,
7983,
12690,
4249,
903,
65,
1740,
2041,
457,
768,
1114,
31785,
376,
221,
30559,
457,
4493,
4249,
903,
65,
1740,
49,
32998,
3503,
67,
320,
499,
221,
2072,
924,
1175,
910,
221,
5815,
100,
6545,
313,
221,
66,
332,
825,
82,
6902,
884,
222,
221,
2072,
924,
1175,
1964,
221,
3557,
17942,
221,
66,
244,
55,
55,
58,
58,
58,
56,
60,
53,
55,
57,
53,
61,
57,
62,
57,
53,
56,
55,
62,
81,
64,
222,
221,
2072,
1175,
910,
221,
221,
2159,
64,
499,
221,
942,
26105,
7983,
12690,
4249,
903,
45,
671,
2621,
46,
320,
376,
221,
597,
51,
2159,
299,
2621,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
1776,
65,
971,
3097,
67,
23916,
9566,
365,
320,
376,
221,
325,
11827,
391,
764,
51,
376,
221,
620,
15490,
51,
2970,
903,
492,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
758,
9566,
45,
78,
4493,
3549,
65,
17537,
3503,
67,
3138,
49,
374,
221,
78,
2899,
2880,
5262,
1990,
49,
9446,
727,
1114,
46,
320,
1332,
221,
344,
327,
3023,
5118,
7406,
10221,
21932,
3549,
46,
320,
374,
221,
3242,
7406,
10221,
21932,
3549,
65,
17537,
3503,
67,
5746,
21932,
4493,
3549,
299,
327,
5597,
10221,
21932,
3549,
65,
17537,
3503,
5111,
3138,
64,
374,
221,
344,
327,
5514,
21932,
4493,
3549,
51,
316,
15514,
1177,
320,
621,
221,
3242,
32998,
3503,
26153,
299,
5746,
21932,
4493,
3549,
1397,
221,
51,
29847,
941,
390,
47440,
492,
621,
221,
344,
327,
42114,
882,
762,
46,
320,
596,
221,
3242,
32998,
5476,
1998,
638,
64,
596,
221,
344,
327,
2229,
87,
5466,
51,
316,
4561,
116,
2078,
6269,
45,
42114,
509,
320,
1397,
221,
2403,
638,
299,
8117,
87,
5466,
2904,
221,
51,
390,
39988,
12690,
1181,
8216,
46,
26153,
312,
596,
221,
130,
832,
434,
327,
2229,
87,
5466,
51,
316,
4561,
116,
2078,
6269,
3069,
45,
42114,
509,
320,
1397,
221,
2403,
638,
299,
8117,
87,
5466,
2904,
221,
51,
390,
39988,
12690,
1181,
16182,
46,
26153,
312,
596,
221,
130,
832,
320,
1397,
221,
620,
64,
596,
221,
130,
596,
221,
344,
327,
2403,
638,
882,
762,
46,
320,
1397,
221,
32541,
51,
489,
45,
2159,
49,
1998,
638,
51,
32143,
577,
1046,
244,
54,
51,
53,
312,
596,
221,
130,
621,
221,
130,
374,
221,
130,
376,
221,
130,
832,
320,
453,
37002,
1361,
458,
1674,
829,
409,
29629,
575,
47426,
708,
2902,
34424,
5760,
596,
221,
325,
4745,
2308,
6709,
374,
221,
344,
327,
3023,
5118,
457,
3980,
5907,
4493,
3549,
46,
320,
621,
221,
3242,
32998,
3503,
26153,
299,
1849,
2354,
443,
5907,
4493,
3549,
65,
17537,
3503,
5111,
3138,
46,
1397,
221,
51,
390,
38145,
941,
390,
47440,
492,
621,
221,
344,
327,
42114,
882,
762,
46,
320,
596,
221,
3242,
32998,
5476,
1998,
638,
64,
596,
221,
344,
327,
2229,
87,
5466,
51,
316,
4561,
116,
2078,
6269,
45,
42114,
509,
320,
1397,
221,
2403,
638,
299,
8117,
87,
5466,
2904,
221,
51,
390,
39988,
12690,
1181,
8216,
46,
26153,
312,
596,
221,
130,
832,
434,
327,
2229,
87,
5466,
51,
316,
4561,
116,
2078,
6269,
3069,
45,
42114,
509,
320,
1397,
221,
2403,
638,
299,
8117,
87,
5466,
2904,
221,
51,
390,
39988,
12690,
1181,
16182,
46,
26153,
312,
596,
221,
130,
832,
320,
1397,
221,
620,
64,
596,
221,
130,
596,
221,
344,
327,
2403,
638,
882,
762,
46,
320,
1397,
221,
32541,
51,
489,
45,
2159,
49,
1998,
638,
51,
32143,
577,
1046,
244,
54,
51,
53,
312,
596,
221,
130,
621,
221,
130,
374,
221,
130,
376,
221,
130,
222,
221,
130,
499,
221,
942,
924
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
6034,
51,
8216,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
17537,
5476,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
8090,
51,
6034,
51,
17537,
3503,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
2354,
443,
5907,
4493,
3549,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
78,
4493,
3549,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
1184,
51,
2228,
51,
78,
4493,
4249,
903,
64,
222,
485,
15357,
51,
48400,
1042,
51,
1766,
51,
26275,
51,
28637,
51,
3936,
51,
1172,
108,
51,
5514,
8957,
51,
7495,
51,
5597,
10221,
21932,
3549,
64,
222,
485,
15357,
51,
17378,
51,
1766,
51,
15552,
51,
424,
119,
51,
6034,
51,
2229,
87,
5466,
64,
222,
222,
1350,
222,
338,
7169,
2817,
391,
6604,
563,
341,
5783,
451,
341,
8117,
87,
6112,
51,
222,
338,
222,
338,
496,
2133,
32995,
472,
9134,
11290,
222,
338,
222,
588,
222,
942,
462,
26105,
7983,
12690,
4249,
903,
65,
1740,
2041,
457,
768,
1114,
31785,
376,
221,
30559,
457,
4493,
4249,
903,
65,
1740,
49,
32998,
3503,
67,
320,
499,
221,
2072,
924,
1175,
910,
221,
5815,
100,
6545,
313,
221,
66,
332,
825,
82,
6902,
884,
222,
221,
2072,
924,
1175,
1964,
221,
3557,
17942,
221,
66,
244,
55,
55,
58,
58,
58,
56,
60,
53,
55,
57,
53,
61,
57,
62,
57,
53,
56,
55,
62,
81,
64,
222,
221,
2072,
1175,
910,
221,
221,
2159,
64,
499,
221,
942,
26105,
7983,
12690,
4249,
903,
45,
671,
2621,
46,
320,
376
] | 9,088,586,293,020,081,000
| true
| false
| false
| false
|
[
17378,
51,
1766,
51,
15552,
51,
424,
119,
51,
6034,
51,
2229,
87,
5466,
64,
222,
222,
1350,
222,
338,
7169,
2817,
391,
6604,
563,
341,
5783,
451,
341,
8117,
87,
6112,
51,
222,
338,
222,
338,
496,
2133,
32995,
472,
9134,
11290,
222,
338,
222,
588,
222,
942,
462,
26105,
7983,
12690,
4249,
903,
65,
1740,
2041,
457,
768,
1114,
31785,
376,
221,
30559,
457,
4493,
4249,
903,
65,
1740,
49,
32998,
3503,
67,
320,
499,
221,
2072,
924,
1175,
910,
221,
5815,
100,
6545,
313,
221,
66,
332,
825,
82,
6902,
884,
222,
221,
2072,
924,
1175,
1964
] | 1,927,382,740,956,215,000
| true
|
.lambda.Literal;
import edu.cornell.cs.nlp.spf.mr.lambda.LogicalConstant;
import edu.cornell.cs.nlp.spf.mr.lambda.LogicalExpression;
import edu.cornell.cs.nlp.spf.parser.ccg.IOverloadedParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.IParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.model.parse.IParseFeatureSet;
import edu.cornell.cs.nlp.spf.parser.ccg.shiftreduce.steps.AbstractShiftReduceStep;
import edu.uw.cs.lil.amr.lambda.AMRServices;
/**
* Simple feature to trigger on the head of the AMR expression.
*
* @author Yoav Artzi
*
*/
public class ShiftHeadPredicateFeatureSet<DI extends IDataItem<?>>
implements IParseFeatureSet<DI, LogicalExpression> {
private static final String DEFAULT_TAG = "SEMHEAD";
private static final long
|
ell.cs.nlp.spf.parser.ccg.IOverloadedParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.IParseStep;
import edu.cornell.cs.nlp.spf.parser.ccg.model.parse.IParseFeatureSet;
import edu.cornell.cs.nlp.spf.parser.ccg.shiftreduce.steps.AbstractShiftReduceStep;
import edu.uw.cs.lil.amr.lambda.AMRServices;
/**
* Simple feature to trigger on the head of the AMR expression.
*
* @author Yoav Artzi
*
*/
public class ShiftHeadPredicateFeatureSet<DI extends IDataItem<?>>
implements IParseFeatureSet<DI, LogicalExpression> {
private static final String DEFAULT_TAG = "SEMHEAD";
private static final long
|
nlp.spf.parser.ccg.model.parse.IParseFeatureSet;
import edu.cornell.cs.nlp.spf.parser.ccg.shiftreduce.steps.AbstractShiftReduceStep;
import edu.uw.cs.lil.amr.lambda.AMRServices;
/**
* Simple feature to trigger on the head of the AMR expression.
*
* @author Yoav Artzi
*
*/
public class ShiftHeadPredicateFeatureSet<DI extends IDataItem<?>>
implements IParseFeatureSet<DI, LogicalExpression> {
private static final String DEFAULT_TAG = "SEMHEAD";
private static final long
|
uw.cs.lil.amr.lambda.AMRServices;
/**
* Simple feature to trigger on the head of the AMR expression.
*
* @author Yoav Artzi
*
*/
public class ShiftHeadPredicateFeatureSet<DI extends IDataItem<?>>
implements IParseFeatureSet<DI, LogicalExpression> {
private static final String DEFAULT_TAG = "SEMHEAD";
private static final long
|
serialVersionUID = 2255537024084940329L;
private final String tag;
public ShiftHeadPredicateFeatureSet(String tag) {
|
ReadyListener.java
|
/FileExtraction/Java_unseen/ib-ai_IB_ai/src/main/java/com/ibdiscord/listeners/ReadyListener.java
|
/* Copyright 2018-2020 Jarred Vardy <vardy@riseup.net>, Arraying
*
* This file is part of IB.ai.
*
* IB.ai is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IB.ai is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IB.ai. If not, see http://www.gnu.org/licenses/.
*/
package com.ibdiscord.listeners;
import com.ibdiscord.IBai;
import com.ibdiscord.data.db.DataContainer;
import com.ibdiscord.data.db.entries.punish.ExpiryData;
import com.ibdiscord.data.db.entries.reminder.ReminderData;
import com.ibdiscord.data.db.entries.reminder.ReminderUserData;
import com.ibdiscord.data.db.entries.voting.VoteEntryData;
import com.ibdiscord.data.db.entries.voting.VoteLaddersData;
import com.ibdiscord.data.db.entries.voting.VoteListData;
import com.ibdiscord.punish.Punishment;
import com.ibdiscord.punish.PunishmentExpiry;
import com.ibdiscord.reminder.Reminder;
import com.ibdiscord.reminder.ReminderHandler;
import com.ibdiscord.vote.VoteCache;
import com.ibdiscord.vote.VoteEntry;
import de.arraying.gravity.Gravity;
import de.arraying.gravity.data.property.Property;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.ReadyEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import org.slf4j.Logger;
import java.util.Objects;
public final class ReadyListener extends ListenerAdapter {
/**
* When the bot is marked as ready.
* @param event The event.
*/
@Override
public void onReady(ReadyEvent event) {
event.getJDA().retrieveApplicationInfo().queue(appInfo -> {
String botName = appInfo.getName();
String botOwner = appInfo.getOwner().getName();
String botDescription = appInfo.getDescription();
boolean isPublicBot = appInfo.isBotPublic();
int guildNum = event.getJDA().getGuilds().size();
Logger logger = IBai.INSTANCE.getLogger();
logger.info("Bot \"{}\" by \"{}\" is now connected.", botName, botOwner);
logger.info("Currently serving {} guilds.", guildNum);
logger.info("Described as \"{}\", {}.", botDescription, (isPublicBot ? "public" : "private"));
Gravity gravity = DataContainer.INSTANCE.getGravity();
for(Guild guild : event.getJDA().getGuilds()) {
ExpiryData expiryData = gravity.load(new ExpiryData(guild.getId()));
for(String key : expiryData.getKeys()) {
long expiry = expiryData.get(key).asLong();
Punishment punishment = Punishment.of(guild, key);
if(System.currentTimeMillis() > expiry) {
PunishmentExpiry.INSTANCE.expire(guild, key, punishment);
} else {
PunishmentExpiry.INSTANCE.schedule(guild,
key,
expiry - System.currentTimeMillis(),
punishment);
}
}
VoteLaddersData voteLaddersData = gravity.load(new VoteLaddersData(guild.getId()));
voteLaddersData.values().stream()
.filter(Objects::nonNull)
.map(Property::asString)
.forEach(ladder -> {
VoteListData voteListData = gravity.load(new VoteListData(guild.getId(), ladder));
voteListData.values().stream()
.map(Property::asLong)
.forEach(id -> {
VoteEntryData entry = gravity.load(new VoteEntryData(guild.getId(),
ladder,
id)
);
if(!entry.get(VoteEntryData.FINISHED).defaulting(false).asBoolean()) {
long message = entry.get(VoteEntryData.MESSAGE).defaulting(0).asLong();
VoteEntry voteEntry = new VoteEntry(guild.getId(), ladder, id);
voteEntry.load();
voteEntry.scheduleStart();
VoteCache.INSTANCE.register(message, voteEntry);
}
});
});
}
ReminderData reminderData = gravity.load(new ReminderData());
for(int i = 1; i <= reminderData.get().defaulting(0).asInt(); i++) {
ReminderUserData reminderUserData = gravity.load(new ReminderUserData(i));
String userId = reminderUserData.get(ReminderUserData.USER).asString();
String text = reminderUserData.get(ReminderUserData.TEXT).asString();
long time = reminderUserData.get(ReminderUserData.TIME).asLong();
User user = event.getJDA().getUserById(userId);
ReminderHandler.INSTANCE.schedule(new Reminder(i, time, text), user);
}
}, error -> {
error.printStackTrace();
System.exit(1);
}
);
}
}
| 5,785
|
Java
|
.java
|
ib-ai/IB.ai
| 20
| 17
| 6
|
2018-06-27T20:30:05Z
|
2024-04-27T03:40:55Z
|
a5682aa6f3d22a8a7d1898cbb7c95f2fd668e708cfa4f9361c04e420b35a281e
|
[] |
[
1127,
2657,
244,
55,
53,
54,
61,
50,
55,
53,
55,
53,
47387,
1116,
694,
723,
126,
350,
41638,
126,
69,
27423,
436,
51,
1317,
2731,
2647,
318,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
23528,
51,
3063,
51,
222,
338,
222,
338,
23528,
51,
3063,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
23528,
51,
3063,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
222,
338,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
222,
338,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
23528,
51,
3063,
51,
1691,
666,
49,
2337,
1930,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
4735,
222,
588,
222,
222,
1337,
785,
51,
947,
14924,
51,
21265,
64,
222,
222,
485,
785,
51,
947,
14924,
51,
3077,
3063,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
768,
2894,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
42342,
1729,
51,
30253,
768,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
37410,
51,
34228,
768,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
37410,
51,
34228,
18237,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
123,
13790,
51,
21152,
2717,
768,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
123,
13790,
51,
21152,
81,
688,
502,
768,
64,
222,
485,
785,
51,
947,
14924,
51,
624,
51,
1219,
51,
9159,
51,
123,
13790,
51,
21152,
739,
768,
64,
222,
485,
785,
51,
947,
14924,
51,
42342,
1729,
51,
85,
330,
1729,
488,
64,
222,
485,
785,
51,
947,
14924,
51,
42342,
1729,
51,
85,
330,
1729,
488,
30253,
64,
222,
485,
785,
51,
947,
14924,
51,
37410,
51,
34228,
64,
222,
485,
785,
51,
947,
14924,
51,
37410,
51,
34228,
1985,
64,
222,
485,
785,
51,
947,
14924,
51,
15102,
51,
21152,
2610,
64,
222,
485,
785,
51,
947,
14924,
51,
15102,
51,
21152,
2717,
64,
222,
485,
428,
51,
977,
318,
51,
31542,
51,
27025,
64,
222,
485,
428,
51,
977,
318,
51,
31542,
51,
624,
51,
2449,
51,
1667,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1256,
51,
9259,
51,
23494,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1256,
51,
9259,
51,
1259,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1256,
51,
5070,
51,
10590,
1167,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1256,
51,
12337,
51,
2239,
4433,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
222,
485,
1401,
51,
1058,
51,
6699,
64,
222,
222,
942,
1175,
462,
30716,
2239,
2041,
29163,
4433,
320,
465,
1041,
294,
338,
5094,
341,
7369,
458,
15168,
641,
8768,
51,
294,
338,
496,
772,
1708,
906,
1708,
51,
294,
588,
303,
496,
1806,
303,
581,
782,
563,
10590,
45,
10590,
1167,
1708,
46,
320,
310,
1708,
51,
390,
79,
5472,
941,
19101,
2743,
1139,
941,
3941,
45,
745,
1139,
984,
320,
343,
910,
7369,
577,
299,
1142,
1139,
51,
5175,
492,
343,
910,
7369,
6456,
299,
1142,
1139,
51,
47828,
941,
5175,
492,
343,
910,
7369,
3250,
299,
1142,
1139,
51,
32844,
492,
343,
1922,
458,
5998,
9037,
299,
1142,
1139,
51,
316,
9037,
5998,
492,
343,
648,
19228,
2585,
299,
1708,
51,
390,
79,
5472,
941,
390,
23494,
120,
941,
911,
492,
343,
7145,
4101,
299,
23528,
3063,
51,
12457,
51,
10588,
492,
343,
4101,
51,
1357,
459,
9037,
4045,
2561,
1508,
829,
4045,
2561,
1508,
458,
2483,
9485,
4429,
7369,
577,
49,
7369,
6456,
312,
343,
4101,
51,
1357,
459,
21482,
35465,
2172,
19228,
120,
4429,
19228,
2585,
312,
343,
4101,
51,
1357,
459,
16069,
3036,
641,
4045,
2561,
5991,
2172,
4429,
7369,
3250,
49,
327,
316,
5998,
9037,
1037,
332,
942,
39,
518,
332,
2072,
2992,
343,
8102,
13959,
37309,
299,
2426,
2894,
51,
12457,
51,
390,
27025,
492,
343,
456,
45,
23494,
19228,
518,
1708,
51,
390,
79,
5472,
941,
390,
23494,
120,
1177,
320,
419,
9665,
12314,
768,
30985,
768,
299,
37309,
51,
963,
45,
909,
9665,
12314,
768,
45,
13454,
51,
7068,
5086,
419,
456,
45,
671,
1221,
518,
30985,
768,
51,
390,
5044,
1177,
320,
547,
1964,
30985,
299,
30985,
768,
51,
390,
45,
697,
566,
321,
3967,
492,
547,
466,
330,
1729,
488,
317,
330,
1729,
488,
299,
466,
330,
1729,
488,
51,
1048,
45,
13454,
49,
1221,
312,
547,
434,
45,
1615,
51,
17217,
365,
868,
30985,
46,
320,
733,
466,
330,
1729,
488,
30253,
51,
12457,
51,
24227,
45,
13454,
49,
1221,
49,
317,
330,
1729,
488,
312,
547,
339,
832,
320,
733,
466,
330,
1729,
488,
30253,
51,
12457,
51,
8598,
45,
13454,
49,
1396,
1221,
49,
1396,
30985,
449,
1189,
51,
17217,
1046,
1396,
317,
330,
1729,
488,
312,
547,
339,
419,
339,
419,
694,
1721,
81,
688,
502,
768,
20439,
81,
688,
502,
768,
299,
37309,
51,
963,
45,
909,
694,
1721,
81,
688,
502,
768,
45,
13454,
51,
7068,
5086,
419,
20439,
81,
688,
502,
768,
51,
2857,
941,
2255,
365,
733,
657,
2049,
45,
6699,
422,
3804,
1898,
46,
733,
657,
1130,
45,
1667,
422,
38938,
46,
733,
657,
5388,
45,
20233,
512,
984,
320,
1031,
694,
1721,
739,
768,
20439,
739,
768,
299,
37309,
51,
963,
45,
909,
694,
1721,
739,
768,
45,
13454,
51,
7068,
1046,
475,
38222,
894,
1031,
20439,
739,
768,
51,
2857,
941,
2255,
365,
1908,
657,
1130,
45,
1667,
422,
321,
3967,
46,
1908,
657,
5388,
45,
333,
984,
320
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1401,
51,
1058,
51,
6699,
64,
222,
222,
942,
1175,
462,
30716,
2239,
2041,
29163,
4433,
320,
465,
1041,
294,
338,
5094,
341,
7369,
458,
15168,
641,
8768,
51,
294,
338,
496,
772,
1708,
906,
1708,
51,
294,
588,
303,
496,
1806,
303,
581,
782,
563,
10590,
45,
10590,
1167,
1708,
46,
320,
310,
1708,
51,
390,
79,
5472,
941,
19101,
2743,
1139,
941,
3941,
45,
745,
1139,
984,
320,
343,
910,
7369,
577,
299,
1142,
1139,
51,
5175,
492,
343,
910,
7369,
6456,
299,
1142,
1139,
51,
47828,
941,
5175,
492,
343,
910,
7369,
3250,
299,
1142,
1139,
51,
32844,
492,
343,
1922,
458,
5998,
9037,
299,
1142,
1139,
51,
316,
9037,
5998,
492,
343,
648,
19228,
2585,
299,
1708,
51,
390,
79,
5472,
941,
390,
23494,
120,
941,
911,
492,
343,
7145,
4101,
299,
23528,
3063,
51,
12457,
51,
10588,
492,
343,
4101,
51,
1357,
459,
9037,
4045,
2561,
1508,
829,
4045,
2561,
1508,
458,
2483,
9485,
4429,
7369,
577,
49,
7369,
6456,
312,
343,
4101,
51,
1357,
459,
21482,
35465,
2172,
19228,
120,
4429,
19228,
2585,
312,
343,
4101,
51,
1357,
459,
16069,
3036,
641,
4045,
2561,
5991,
2172,
4429,
7369,
3250,
49,
327,
316,
5998,
9037,
1037,
332,
942,
39,
518,
332,
2072,
2992,
343,
8102,
13959,
37309,
299,
2426,
2894,
51,
12457,
51,
390,
27025,
492,
343,
456,
45,
23494,
19228,
518,
1708,
51,
390,
79,
5472,
941,
390,
23494,
120,
1177,
320,
419,
9665,
12314,
768,
30985,
768,
299,
37309,
51,
963,
45,
909,
9665,
12314,
768,
45,
13454,
51,
7068,
5086,
419,
456,
45,
671,
1221,
518,
30985,
768,
51,
390,
5044,
1177,
320,
547,
1964,
30985,
299,
30985,
768,
51,
390,
45,
697,
566,
321,
3967,
492,
547,
466,
330,
1729,
488,
317,
330,
1729,
488,
299,
466,
330,
1729,
488,
51
] | 7,897,600,187,780,162,000
| true
| false
| false
| false
|
[
2561,
1508,
829,
4045,
2561,
1508,
458,
2483,
9485,
4429,
7369,
577,
49,
7369,
6456,
312,
343,
4101,
51,
1357,
459,
21482,
35465,
2172,
19228,
120,
4429,
19228,
2585,
312,
343,
4101,
51,
1357,
459,
16069,
3036,
641,
4045,
2561,
5991,
2172,
4429,
7369,
3250,
49,
327,
316,
5998,
9037,
1037,
332,
942,
39,
518,
332,
2072,
2992,
343,
8102,
13959,
37309,
299,
2426,
2894,
51,
12457,
51,
390,
27025,
492,
343,
456,
45,
23494,
19228,
518,
1708,
51,
390,
79,
5472,
941,
390,
23494,
120,
1177,
320,
419,
9665,
12314,
768,
30985,
768,
299,
37309,
51,
963,
45,
909
] | -35,794,893,042,253,830
| true
|
java.util.Objects;
public final class ReadyListener extends ListenerAdapter {
/**
* When the bot is marked as ready.
* @param event The event.
*/
@Override
public void onReady(ReadyEvent event) {
event.getJDA().retrieveApplicationInfo().queue(appInfo -> {
String botName = appInfo.getName();
String botOwner = appInfo.getOwner().getName();
String botDescription = appInfo.getDescription();
boolean isPublicBot = appInfo.isBotPublic();
int guildNum = event.getJDA().getGuilds().size();
Logger logger = IBai.INSTANCE.getLogger();
logger.info("Bot \"{}\" by \"{}\" is now connected.", botName, botOwner);
logger.info("Currently serving {} guilds.", guildNum);
logger.info("Described as \"{}\", {}.", botDescription, (isPublicBot? "public" : "private"));
Gravity gravity = DataContainer.INSTANCE.getGravity();
for(Guild guild : event.getJDA().getGuilds()) {
ExpiryData expiryData = gravity.load(new
|
event) {
event.getJDA().retrieveApplicationInfo().queue(appInfo -> {
String botName = appInfo.getName();
String botOwner = appInfo.getOwner().getName();
String botDescription = appInfo.getDescription();
boolean isPublicBot = appInfo.isBotPublic();
int guildNum = event.getJDA().getGuilds().size();
Logger logger = IBai.INSTANCE.getLogger();
logger.info("Bot \"{}\" by \"{}\" is now connected.", botName, botOwner);
logger.info("Currently serving {} guilds.", guildNum);
logger.info("Described as \"{}\", {}.", botDescription, (isPublicBot? "public" : "private"));
Gravity gravity = DataContainer.INSTANCE.getGravity();
for(Guild guild : event.getJDA().getGuilds()) {
ExpiryData expiryData = gravity.load(new
|
getDescription();
boolean isPublicBot = appInfo.isBotPublic();
int guildNum = event.getJDA().getGuilds().size();
Logger logger = IBai.INSTANCE.getLogger();
logger.info("Bot \"{}\" by \"{}\" is now connected.", botName, botOwner);
logger.info("Currently serving {} guilds.", guildNum);
logger.info("Described as \"{}\", {}.", botDescription, (isPublicBot? "public" : "private"));
Gravity gravity = DataContainer.INSTANCE.getGravity();
for(Guild guild : event.getJDA().getGuilds()) {
ExpiryData expiryData = gravity.load(new
|
{}\" by \"{}\" is now connected.", botName, botOwner);
logger.info("Currently serving {} guilds.", guildNum);
logger.info("Described as \"{}\", {}.", botDescription, (isPublicBot? "public" : "private"));
Gravity gravity = DataContainer.INSTANCE.getGravity();
for(Guild guild : event.getJDA().getGuilds()) {
ExpiryData expiryData = gravity.load(new
|
ExpiryData(guild.getId()));
for(String key : expiryData.getKeys()) {
long expiry = expiryData.get(key).asLong();
Punishment punishment = Punishment.
|
IViewRow.java
|
/FileExtraction/Java_unseen/metasfresh_metasfresh-webui-api-legacy/src/main/java/de/metas/ui/web/view/IViewRow.java
|
package de.metas.ui.web.view;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import de.metas.i18n.ITranslatableString;
import de.metas.i18n.TranslatableStrings;
import de.metas.ui.web.exceptions.EntityNotFoundException;
import de.metas.ui.web.view.ViewRow.DefaultRowType;
import de.metas.ui.web.window.datatypes.DocumentId;
import de.metas.ui.web.window.datatypes.DocumentPath;
import de.metas.ui.web.window.datatypes.json.JSONOptions;
import de.metas.ui.web.window.descriptor.DocumentFieldWidgetType;
import de.metas.ui.web.window.descriptor.ViewEditorRenderMode;
import lombok.NonNull;
/*
* #%L
* metasfresh-webui-api
* %%
* Copyright (C) 2016 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
public interface IViewRow
{
// Document info
// @formatter:off
DocumentId getId();
boolean isProcessed();
// @formatter:on
default IViewRowType getType()
{
return DefaultRowType.Row;
}
/**
* Gets row's document path.
* Usually the row's document path consist of view's WindowId and row's ID.
* But there are views which mix data from multiple windows/tables and in that case this method will use row's actual WindowId instead of view's WindowId.
*
* @return row's document path
*/
DocumentPath getDocumentPath();
//
// Fields
Set<String> getFieldNames();
/**
* @return a map with an entry for each of this row's fields.<br>
* Where the row has <code>null</code> values, the respective entry's value is {@link #NULL_JSON_VALUE}.
*/
ViewRowFieldNameAndJsonValues getFieldNameAndJsonValues();
default BigDecimal getFieldValueAsBigDecimal(@NonNull final String fieldName, final BigDecimal defaultValueIfNotFoundOrError)
{
return getFieldNameAndJsonValues().getAsBigDecimal(fieldName, defaultValueIfNotFoundOrError);
}
default int getFieldValueAsInt(@NonNull final String fieldName, final int defaultValueIfNotFoundOrError)
{
return getFieldNameAndJsonValues().getAsInt(fieldName, defaultValueIfNotFoundOrError);
}
default boolean getFieldValueAsBoolean(@NonNull final String fieldName, final boolean defaultValueIfNotFoundOrError)
{
return getFieldNameAndJsonValues().getAsBoolean(fieldName, defaultValueIfNotFoundOrError);
}
default Object getFieldValueAsJsonObject(@NonNull final String fieldName, final JSONOptions jsonOpts)
{
return getFieldNameAndJsonValues().getAsJsonObject(fieldName, jsonOpts);
}
default Map<String, DocumentFieldWidgetType> getWidgetTypesByFieldName()
{
return ImmutableMap.of();
}
default Map<String, ViewEditorRenderMode> getViewEditorRenderModeByFieldName()
{
return ImmutableMap.of();
}
//
// Included documents (children)
// @formatter:off
default Collection<? extends IViewRow> getIncludedRows() { return ImmutableList.of(); }
// @formatter:on
//
// Attributes
// @formatter:off
default boolean hasAttributes() { return false; }
default IViewRowAttributes getAttributes() { throw new EntityNotFoundException("Row does not support attributes"); }
// @formatter:on
//
// IncludedView
// @formatter:off
default ViewId getIncludedViewId() { return null; }
// @formatter:on
//
// Single column row
// @formatter:off
/** @return true if frontend shall display one single column */
default boolean isSingleColumn() { return false; }
/** @return text to be displayed if {@link #isSingleColumn()} */
default ITranslatableString getSingleColumnCaption() { return TranslatableStrings.empty(); }
// @formatter:on
/** @return a stream of given row and all it's included rows recursively */
default Stream<IViewRow> streamRecursive()
{
return this.getIncludedRows()
.stream()
.map(includedRow -> includedRow.streamRecursive())
.reduce(Stream.of(this), Stream::concat);
}
}
| 4,541
|
Java
|
.java
|
metasfresh/metasfresh-webui-api-legacy
| 30
| 32
| 244
|
2016-04-14T13:03:48Z
|
2023-11-20T07:20:19Z
|
35e515fba0872df77e01cf0212d604d7d92b3ea5908516ba4071d5c5a3a8708f
|
[] |
[
1337,
428,
51,
34443,
51,
1726,
51,
1857,
51,
1090,
64,
222,
222,
485,
1401,
51,
3851,
51,
20808,
64,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
2255,
51,
1880,
64,
222,
222,
485,
785,
51,
2193,
51,
2297,
51,
6190,
51,
41989,
64,
222,
485,
785,
51,
2193,
51,
2297,
51,
6190,
51,
15026,
1225,
64,
222,
222,
485,
428,
51,
34443,
51,
110,
54,
61,
115,
51,
799,
28786,
37297,
671,
64,
222,
485,
428,
51,
34443,
51,
110,
54,
61,
115,
51,
1794,
37297,
9634,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
11453,
51,
2234,
9941,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
1090,
51,
1089,
2368,
51,
2061,
2368,
638,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
3537,
51,
18176,
1707,
51,
3112,
625,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
3537,
51,
18176,
1707,
51,
3112,
1233,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
3537,
51,
18176,
1707,
51,
1279,
51,
3275,
2045,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
3537,
51,
9662,
51,
3112,
1195,
3778,
638,
64,
222,
485,
428,
51,
34443,
51,
1726,
51,
1857,
51,
3537,
51,
9662,
51,
1089,
4836,
3135,
2116,
64,
222,
485,
13243,
51,
10082,
64,
222,
222,
1127,
222,
338,
38269,
81,
222,
338,
3294,
321,
33214,
50,
1399,
48909,
50,
1256,
222,
338,
12947,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
59,
3294,
321,
34723,
222,
338,
12947,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
55,
451,
341,
222,
338,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
222,
338,
1196,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
222,
338,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
43817,
50,
55,
51,
53,
51,
935,
4513,
222,
338,
607,
81,
42,
222,
588,
222,
222,
942,
2586,
457,
1089,
2368,
222,
128,
222,
221,
325,
6222,
3116,
222,
221,
325,
496,
14565,
63,
1739,
222,
221,
3112,
625,
19832,
492,
222,
221,
4412,
458,
11295,
492,
222,
221,
325,
496,
14565,
63,
286,
499,
221,
1555,
457,
1089,
2368,
638,
24097,
365,
222,
221,
128,
376,
221,
620,
4119,
2368,
638,
51,
2368,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
7132,
2720,
1200,
1840,
1536,
51,
376,
338,
41720,
341,
2720,
1200,
1840,
1536,
44256,
451,
2221,
1200,
12016,
625,
480,
2720,
1200,
2502,
51,
376,
338,
7158,
2038,
904,
11887,
1532,
11658,
727,
664,
4632,
11309,
52,
11288,
480,
347,
708,
1152,
477,
1431,
1118,
813,
2720,
1200,
4668,
12016,
625,
4203,
451,
2221,
1200,
12016,
625,
51,
376,
338,
376,
338,
496,
620,
2720,
1200,
1840,
1536,
376,
588,
222,
221,
3112,
1233,
640,
3112,
1233,
492,
499,
221,
325,
222,
221,
325,
17650,
222,
221,
903,
65,
671,
67,
49087,
4128,
492,
499,
221,
1350,
376,
338,
496,
620,
331,
2010,
642,
619,
3429,
456,
2531,
451,
477,
2720,
1200,
3844,
5717,
858,
67,
376,
338,
282,
18381,
341,
2720,
1421,
350,
707,
67,
1710,
396,
707,
67,
2102,
49,
341,
24248,
3429,
1200,
804,
458,
3105,
1222,
607,
3305,
100,
3275,
100,
5986,
4037,
376,
588,
222,
221,
1089,
2368,
20484,
2199,
2541,
3367,
640,
20484,
2199,
2541,
3367,
492,
499,
221,
1555,
17262,
640,
23413,
1482,
20808,
4810,
10082,
1175,
910,
22759,
49,
1175,
17262,
14327,
2811,
5972,
1543,
943,
46,
222,
221,
128,
376,
221,
620,
640,
20484,
2199,
2541,
3367,
941,
38984,
20808,
45,
19216,
49,
14327,
2811,
5972,
1543,
943,
312,
222,
221,
130,
499,
221,
1555,
648,
640,
23413,
1482,
1438,
4810,
10082,
1175,
910,
22759,
49,
1175,
648,
14327,
2811,
5972,
1543,
943,
46,
222,
221,
128,
376,
221,
620,
640,
20484,
2199,
2541,
3367,
941,
38984,
1438,
45,
19216,
49,
14327,
2811,
5972,
1543,
943,
312,
222,
221,
130,
499,
221,
1555,
1922,
640,
23413,
1482,
4718,
4810,
10082,
1175,
910,
22759,
49,
1175,
1922,
14327,
2811,
5972,
1543,
943,
46,
222,
221,
128,
376,
221,
620,
640,
20484,
2199,
2541,
3367,
941,
38984,
4718,
45,
19216,
49,
14327,
2811,
5972,
1543,
943,
312,
222,
221,
130,
499,
221,
1555,
2210,
640,
23413,
1482,
20587,
4810,
10082,
1175,
910,
22759,
49,
1175,
3411,
2045,
2379,
13107,
46,
222,
221,
128,
376,
221,
620,
640,
20484,
2199,
2541,
3367,
941,
38984,
20587,
45,
19216,
49,
2379,
13107,
312,
222,
221,
130,
499,
221,
1555,
3531,
65,
671,
49,
6222,
1195,
3778,
638,
67,
640,
3778,
2439,
1103,
20484,
365,
222,
221,
128,
376,
221,
620,
45369,
51,
1048,
492,
222,
221,
130,
499,
221,
1555,
3531,
65,
671,
49,
4340,
4836,
3135,
2116,
67,
640,
1089,
4836,
3135,
2116,
1103,
20484,
365,
222,
221,
128,
376,
221,
620,
45369,
51,
1048,
492,
222,
221,
130,
499,
221,
325,
222,
221,
325,
12441,
105,
12861,
327,
4931,
46,
222,
221,
325,
496,
14565,
63,
1739,
222,
221,
1555,
7380,
1907,
2041,
457,
1089,
2368,
67,
640,
29437,
7264,
365,
320,
461,
29634,
51,
1048,
492,
339,
222,
221,
325,
496,
14565,
63,
286,
499,
221,
325,
222,
221,
325,
18198,
222,
221,
325,
496,
14565,
63,
1739,
222,
221,
1555,
1922,
1421,
5097,
365,
320,
461,
920,
64,
339,
222,
221,
1555,
457,
1089,
2368,
5097,
640,
5097,
365,
320,
1440,
556,
7276,
9941,
459,
2368,
1976,
666
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
222,
338,
1196,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
222,
338,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
43817,
50,
55,
51,
53,
51,
935,
4513,
222,
338,
607,
81,
42,
222,
588,
222,
222,
942,
2586,
457,
1089,
2368,
222,
128,
222,
221,
325,
6222,
3116,
222,
221,
325,
496,
14565,
63,
1739,
222,
221,
3112,
625,
19832,
492,
222,
221,
4412,
458,
11295,
492,
222,
221,
325,
496,
14565,
63,
286,
499,
221,
1555,
457,
1089,
2368,
638,
24097,
365,
222,
221,
128,
376,
221,
620,
4119,
2368,
638,
51,
2368,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
7132,
2720,
1200,
1840,
1536,
51,
376,
338,
41720,
341,
2720,
1200,
1840,
1536,
44256,
451,
2221,
1200,
12016,
625,
480,
2720,
1200,
2502,
51,
376,
338,
7158,
2038,
904,
11887,
1532,
11658,
727,
664,
4632,
11309,
52,
11288,
480,
347,
708,
1152,
477,
1431,
1118,
813,
2720,
1200,
4668,
12016,
625,
4203,
451,
2221,
1200,
12016,
625,
51,
376,
338,
376,
338,
496,
620,
2720,
1200,
1840,
1536,
376,
588,
222,
221,
3112,
1233,
640,
3112,
1233,
492,
499,
221,
325,
222,
221,
325,
17650,
222,
221,
903,
65,
671,
67,
49087,
4128,
492,
499,
221,
1350,
376,
338,
496,
620,
331,
2010,
642,
619,
3429,
456,
2531,
451,
477,
2720,
1200,
3844,
5717,
858,
67,
376,
338,
282,
18381,
341,
2720,
1421,
350,
707,
67,
1710,
396,
707,
67,
2102,
49,
341,
24248,
3429,
1200,
804,
458,
3105,
1222,
607,
3305,
100,
3275,
100
] | 4,037,493,347,880,535,000
| true
| false
| false
| false
|
[
221,
1350,
376,
338,
7132,
2720,
1200,
1840,
1536,
51,
376,
338,
41720,
341,
2720,
1200,
1840,
1536,
44256,
451,
2221,
1200,
12016,
625,
480,
2720,
1200,
2502,
51,
376,
338,
7158,
2038,
904,
11887,
1532,
11658,
727,
664,
4632,
11309,
52,
11288,
480,
347,
708,
1152,
477,
1431,
1118,
813,
2720,
1200,
4668,
12016,
625,
4203,
451,
2221,
1200,
12016,
625,
51,
376,
338,
376,
338,
496,
620,
2720,
1200,
1840,
1536,
376,
588,
222,
221,
3112,
1233,
640,
3112,
1233,
492,
499,
221,
325,
222,
221,
325,
17650,
222,
221,
903,
65,
671,
67,
49087,
4128,
492,
499
] | 1,807,669,269,984,823,300
| true
|
WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
public interface IViewRow
{
// Document info
// @formatter:off
DocumentId getId();
boolean isProcessed();
// @formatter:on
default IViewRowType getType()
{
return DefaultRowType.Row;
}
/**
* Gets row's document path.
* Usually the row's document path consist of view's WindowId and row's ID.
* But there are views which mix data from multiple windows/tables and in that case this method will use row's actual WindowId instead of view's WindowId.
*
* @return row's document path
*/
DocumentPath getDocumentPath();
//
// Fields
Set<String> getFieldNames();
|
this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
public interface IViewRow
{
// Document info
// @formatter:off
DocumentId getId();
boolean isProcessed();
// @formatter:on
default IViewRowType getType()
{
return DefaultRowType.Row;
}
/**
* Gets row's document path.
* Usually the row's document path consist of view's WindowId and row's ID.
* But there are views which mix data from multiple windows/tables and in that case this method will use row's actual WindowId instead of view's WindowId.
*
* @return row's document path
*/
DocumentPath getDocumentPath();
//
// Fields
Set<String> getFieldNames();
|
// @formatter:off
DocumentId getId();
boolean isProcessed();
// @formatter:on
default IViewRowType getType()
{
return DefaultRowType.Row;
}
/**
* Gets row's document path.
* Usually the row's document path consist of view's WindowId and row's ID.
* But there are views which mix data from multiple windows/tables and in that case this method will use row's actual WindowId instead of view's WindowId.
*
* @return row's document path
*/
DocumentPath getDocumentPath();
//
// Fields
Set<String> getFieldNames();
|
/**
* Gets row's document path.
* Usually the row's document path consist of view's WindowId and row's ID.
* But there are views which mix data from multiple windows/tables and in that case this method will use row's actual WindowId instead of view's WindowId.
*
* @return row's document path
*/
DocumentPath getDocumentPath();
//
// Fields
Set<String> getFieldNames();
|
/**
* @return a map with an entry for each of this row's fields.<br>
* Where the row has <code>null</code> values, the respective entry's value is {@link #NULL_JSON_
|
AmpMEItemFeaturePanel.java
|
/FileExtraction/Java_unseen/devgateway_amp/amp/WEB-INF/src/org/dgfoundation/amp/onepager/components/features/items/AmpMEItemFeaturePanel.java
|
/**
* Copyright (c) 2011 Development Gateway (www.developmentgateway.org)
*/
package org.dgfoundation.amp.onepager.components.features.items;
import java.util.HashSet;
import java.util.Set;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.ChoiceRenderer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.dgfoundation.amp.onepager.OnePagerUtil;
import org.dgfoundation.amp.onepager.components.features.AmpFeaturePanel;
import org.dgfoundation.amp.onepager.components.fields.AmpAjaxLinkField;
import org.dgfoundation.amp.onepager.components.fields.AmpCategorySelectFieldPanel;
import org.dgfoundation.amp.onepager.components.fields.AmpIndicatorGroupField;
import org.dgfoundation.amp.onepager.components.fields.AmpSelectFieldPanel;
import org.dgfoundation.amp.onepager.translation.TranslatedChoiceRenderer;
import org.dgfoundation.amp.onepager.translation.TranslatorUtil;
import org.digijava.module.aim.dbentity.AmpIndicator;
import org.digijava.module.aim.dbentity.AmpIndicatorRiskRatings;
import org.digijava.module.aim.dbentity.AmpIndicatorValue;
import org.digijava.module.aim.dbentity.IndicatorActivity;
import org.digijava.module.aim.util.MEIndicatorsUtil;
import org.digijava.module.categorymanager.dbentity.AmpCategoryValue;
import org.digijava.module.categorymanager.util.CategoryConstants;
/**
* @author aartimon@dginternational.org
* @since Feb 10, 2011
*/
public class AmpMEItemFeaturePanel extends AmpFeaturePanel<IndicatorActivity> {
/**
* @param id
* @param fmName
* @throws Exception
*/
public AmpMEItemFeaturePanel(String id, String fmName, final IModel<IndicatorActivity> conn,
IModel<AmpIndicator> indicator, final IModel<Set<AmpIndicatorValue>> values){
super(id, fmName, true);
if (values.getObject() == null)
values.setObject(new HashSet<AmpIndicatorValue>());
final Label indicatorNameLabel = new Label("indicatorName", new PropertyModel<String>(indicator, "name"));
add(indicatorNameLabel);
String indCodeString = "";
if (indicator.getObject().getCode() != null && indicator.getObject().getCode().trim().compareTo("") != 0)
indCodeString = " - " + indicator.getObject().getCode();
final Label indicatorCodeLabel = new Label("indicatorCode", new Model<String>(indCodeString));
add(indicatorCodeLabel);
final IModel<AmpCategoryValue> logFrameModel = new PropertyModel<>(conn, "logFrame");
try {
AmpCategorySelectFieldPanel logframe = new AmpCategorySelectFieldPanel("logframe", CategoryConstants.LOGFRAME_KEY, logFrameModel, "Logframe Category", true, true);
add(logframe);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
final AmpSelectFieldPanel<AmpIndicatorRiskRatings> riskSelect = new AmpSelectFieldPanel("risk",
new PropertyModel<>(conn, "risk"), MEIndicatorsUtil.getAllIndicatorRisks(), "Risk", false, false,
new TranslatedChoiceRenderer<AmpIndicatorRiskRatings>(), false);
add(riskSelect);
final AmpIndicatorValue baseVal = new AmpIndicatorValue(AmpIndicatorValue.BASE);
final AmpIndicatorValue targetVal = new AmpIndicatorValue(AmpIndicatorValue.TARGET);
final AmpIndicatorValue revisedVal = new AmpIndicatorValue(AmpIndicatorValue.REVISED);
final AmpIndicatorValue currentVal = new AmpIndicatorValue(AmpIndicatorValue.ACTUAL);
final Model<Boolean> valuesSet = new Model<Boolean>(false);
for (AmpIndicatorValue val : values.getObject()){
switch (val.getValueType()) {
case AmpIndicatorValue.BASE:
val.copyValuesTo(baseVal);
break;
case AmpIndicatorValue.TARGET:
val.copyValuesTo(targetVal);
valuesSet.setObject(true);
break;
case AmpIndicatorValue.REVISED:
val.copyValuesTo(revisedVal);
break;
case AmpIndicatorValue.ACTUAL:
val.copyValuesTo(currentVal);
break;
default:
break;
}
}
final AmpIndicatorGroupField base = new AmpIndicatorGroupField("base", new PropertyModel(baseVal, "value"), new PropertyModel(baseVal, "valueDate"), new PropertyModel(baseVal, "comment"), "Base Value", "Base", true);
base.setOutputMarkupId(true);
add(base);
final AmpIndicatorGroupField target = new AmpIndicatorGroupField("target", new PropertyModel(targetVal, "value"), new PropertyModel(targetVal, "valueDate"), new PropertyModel(targetVal, "comment"), "Target Value", "Target", true);
target.setIgnorePermissions(true);
if (valuesSet.getObject()){
target.setEnabled(false);
}
else
target.setEnabled(true);
target.setOutputMarkupId(true);
add(target);
final AmpIndicatorGroupField revised = new AmpIndicatorGroupField("revised", new PropertyModel(revisedVal, "value"), new PropertyModel(revisedVal, "valueDate"), new PropertyModel(revisedVal, "comment"), "Revised Value", "Revised", false);
if (valuesSet.getObject())
revised.setVisibilityAllowed(true);
else
revised.setVisibilityAllowed(false);
revised.setOutputMarkupId(true);
add(revised);
final AmpIndicatorGroupField current = new AmpIndicatorGroupField("current", new PropertyModel(currentVal, "value"), new PropertyModel(currentVal, "valueDate"), new PropertyModel(currentVal, "comment"), "Current Value", "Current", true);
current.setOutputMarkupId(true);
add(current);
AmpAjaxLinkField setValue = new AmpAjaxLinkField("setValues", "Set Value", "Set Value") {
@Override
protected void onConfigure() {
super.onConfigure();
this.getButton().add(new AttributeAppender("class", new Model("mon_eval_button"), " "));
}
@Override
protected void onClick(AjaxRequestTarget art) {
Set<AmpIndicatorValue> vals = values.getObject();
vals.clear();
AmpIndicatorValue tmp = (AmpIndicatorValue) baseVal.clone();
tmp.setIndicatorConnection(conn.getObject());
tmp.setIndValId(null); //for hibernate to think it's a new object
vals.add(tmp);
tmp = (AmpIndicatorValue) revisedVal.clone();
tmp.setIndicatorConnection(conn.getObject());
tmp.setIndValId(null); //for hibernate to think it's a new object
vals.add(tmp);
tmp = (AmpIndicatorValue) targetVal.clone();
tmp.setIndicatorConnection(conn.getObject());
tmp.setIndValId(null); //for hibernate to think it's a new object
vals.add(tmp);
tmp = (AmpIndicatorValue) currentVal.clone();
tmp.setIndicatorConnection(conn.getObject());
tmp.setIndValId(null); //for hibernate to think it's a new object
vals.add(tmp);
if (!valuesSet.getObject()){
target.setEnabled(false);
revised.setVisibilityAllowed(true);
valuesSet.setObject(true);
art.add(target);
}
art.add(base.getParent());
art.appendJavaScript(OnePagerUtil.getToggleChildrenJS(this.getParent()));
art.appendJavaScript(OnePagerUtil.getClickToggle2JS(this.getParent()));
}
};
add(setValue);
}
}
| 8,109
|
Java
|
.java
|
devgateway/amp
| 8
| 4
| 31
|
2015-11-10T23:22:20Z
|
2024-05-09T09:02:32Z
|
c9a19956978fc081fbabd7a178d0bef2ae099abaaec690f891401161e76ad71b
|
[] |
[
1350,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
54,
54,
15606,
19405,
327,
1516,
51,
12194,
10419,
51,
1107,
46,
222,
588,
222,
1337,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
5977,
51,
3053,
64,
222,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
222,
485,
1105,
51,
2121,
51,
43892,
51,
6837,
51,
19620,
1123,
2937,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
20505,
51,
2230,
34380,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
19202,
51,
935,
51,
6404,
51,
2186,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
19202,
51,
935,
51,
618,
51,
13853,
6470,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
1184,
51,
78,
1262,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
1184,
51,
1262,
64,
222,
485,
1105,
51,
2121,
51,
43892,
51,
1184,
51,
1667,
1262,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3597,
17554,
1747,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
5977,
51,
23696,
4249,
3686,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
4169,
51,
23696,
19620,
2375,
1195,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
4169,
51,
23696,
4236,
1926,
1195,
3686,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
4169,
51,
23696,
12474,
1582,
1195,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
3545,
51,
4169,
51,
23696,
1926,
1195,
3686,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
7521,
51,
48793,
13853,
6470,
64,
222,
485,
1105,
51,
12592,
19076,
51,
778,
51,
677,
23591,
51,
7521,
51,
23234,
1747,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
5700,
51,
1219,
2244,
51,
23696,
12474,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
5700,
51,
1219,
2244,
51,
23696,
12474,
31592,
45795,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
5700,
51,
1219,
2244,
51,
23696,
12474,
899,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
5700,
51,
1219,
2244,
51,
12474,
3697,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
5700,
51,
1058,
51,
1043,
48319,
1747,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
3168,
4031,
51,
1219,
2244,
51,
23696,
4236,
899,
64,
222,
485,
1105,
51,
5690,
110,
1874,
51,
1663,
51,
3168,
4031,
51,
1058,
51,
4236,
5238,
64,
222,
222,
1350,
222,
338,
496,
2133,
331,
521,
21563,
69,
105,
1542,
15563,
51,
1107,
222,
338,
496,
8152,
25136,
244,
54,
53,
49,
244,
55,
53,
54,
54,
222,
588,
222,
942,
462,
41499,
1043,
1114,
4249,
3686,
2041,
41499,
4249,
3686,
65,
12474,
3697,
67,
320,
36197,
1041,
294,
338,
496,
772,
828,
294,
338,
496,
772,
28922,
577,
294,
338,
496,
5124,
3284,
294,
588,
303,
581,
41499,
1043,
1114,
4249,
3686,
45,
671,
828,
49,
910,
28922,
577,
49,
1175,
457,
1262,
65,
12474,
3697,
67,
4580,
49,
343,
457,
1262,
65,
23696,
12474,
67,
18391,
49,
1175,
457,
1262,
65,
903,
65,
23696,
12474,
899,
2023,
2102,
1528,
310,
2615,
45,
333,
49,
28922,
577,
49,
878,
312,
2776,
434,
327,
2857,
51,
19717,
365,
630,
762,
46,
343,
2102,
51,
489,
976,
45,
909,
14253,
65,
23696,
12474,
899,
19504,
2776,
1175,
9305,
18391,
577,
2186,
299,
556,
9305,
459,
18368,
577,
411,
556,
6484,
1262,
65,
671,
1579,
18368,
49,
332,
444,
2992,
310,
1035,
45,
18368,
577,
2186,
312,
603,
910,
4873,
1241,
671,
299,
5127,
310,
434,
327,
18368,
51,
19717,
941,
24202,
365,
882,
762,
979,
18391,
51,
19717,
941,
24202,
941,
5475,
941,
23879,
18001,
882,
244,
53,
46,
343,
4873,
1241,
671,
299,
332,
449,
332,
494,
18391,
51,
19717,
941,
24202,
492,
2776,
1175,
9305,
18391,
1241,
2186,
299,
556,
9305,
459,
18368,
1241,
411,
556,
3707,
65,
671,
1579,
572,
1241,
671,
894,
310,
1035,
45,
18368,
1241,
2186,
312,
603,
1175,
457,
1262,
65,
23696,
4236,
899,
67,
1264,
2163,
1262,
299,
556,
6484,
1262,
11530,
3795,
49,
332,
769,
2163,
742,
310,
1614,
320,
343,
41499,
4236,
1926,
1195,
3686,
1264,
1763,
299,
556,
41499,
4236,
1926,
1195,
3686,
459,
769,
1763,
411,
9954,
5238,
51,
3612,
13215,
100,
3319,
49,
1264,
2163,
1262,
49,
332,
1353,
1763,
9954,
411,
878,
49,
878,
312,
343,
1035,
45,
769,
1763,
312,
310,
339,
2385,
327,
1002,
503,
46,
320,
343,
4101,
51,
750,
45,
106,
51,
7724,
1046,
503,
312,
310,
339,
603,
1175,
41499,
1926,
1195,
3686,
65,
23696,
12474,
31592,
45795,
67,
19916,
1926,
299,
556,
41499,
1926,
1195,
3686,
459,
24514,
411,
419,
556,
6484,
1262,
11530,
3795,
49,
332,
24514,
2132,
21447,
48319,
1747,
51,
13912,
12474,
87,
316,
5532,
1046,
332,
31592,
411,
920,
49,
920,
49,
419,
556,
3574,
11671,
13853,
6470,
65,
23696,
12474,
31592,
45795,
17951,
920,
312,
310,
1035,
45,
24514,
1926,
312,
603,
1175,
41499,
12474,
899,
1712,
1420,
299,
556,
41499,
12474,
899,
45,
23696,
12474,
899,
51,
6185,
312,
310,
1175,
41499,
12474,
899,
1780,
1420,
299,
556,
41499,
12474,
899,
45,
23696,
12474,
899,
51,
9688,
312,
310,
1175,
41499,
12474,
899,
14105,
8628,
1420,
299,
556,
41499,
12474,
899,
45,
23696,
12474,
899,
51,
632,
18482,
312,
310,
1175,
41499,
12474,
899,
1565,
1420,
299,
556,
41499,
12474,
899,
45,
23696,
12474,
899,
51,
3833,
4456,
312,
2776,
1175,
3707,
65,
4718,
67,
2102,
903,
299,
556,
3707,
65,
4718,
1579,
1886,
312,
603,
456,
327,
23696,
12474,
899,
928,
518,
2102,
51,
19717,
13059,
6455,
3593,
327,
718,
51,
6693,
638,
1177,
320,
343,
1152,
41499,
12474,
899,
51,
6185,
63,
419,
928,
51,
3014,
3367,
724,
45,
1460,
1420,
312,
419,
1644,
64,
343,
1152,
41499,
12474,
899,
51,
9688,
63,
419,
928,
51,
3014,
3367,
724,
45,
2000,
1420,
312,
419,
2102,
903,
51,
489,
976
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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1114,
4249,
3686,
45,
671,
828,
49,
910,
28922,
577,
49,
1175,
457,
1262,
65,
12474,
3697,
67,
4580,
49,
343,
457,
1262,
65,
23696,
12474,
67,
18391,
49,
1175,
457,
1262,
65,
903,
65,
23696,
12474,
899,
2023,
2102,
1528,
310,
2615,
45,
333,
49,
28922,
577,
49,
878,
312,
2776,
434,
327,
2857,
51,
19717,
365,
630,
762,
46,
343,
2102,
51,
489,
976,
45,
909,
14253,
65,
23696,
12474,
899,
19504,
2776,
1175,
9305,
18391,
577,
2186,
299,
556,
9305,
459,
18368,
577,
411,
556,
6484,
1262,
65,
671,
1579,
18368,
49,
332,
444,
2992,
310,
1035,
45,
18368,
577,
2186,
312,
603,
910,
4873,
1241,
671,
299,
5127,
310,
434,
327,
18368,
51,
19717,
941,
24202,
365,
882,
762,
979,
18391,
51,
19717,
941,
24202,
941,
5475,
941,
23879,
18001,
882,
244,
53,
46,
343,
4873,
1241,
671,
299,
332,
449,
332,
494,
18391,
51,
19717,
941,
24202,
492,
2776,
1175,
9305,
18391,
1241,
2186,
299,
556,
9305,
459,
18368,
1241,
411,
556,
3707,
65,
671,
1579,
572,
1241,
671,
894,
310,
1035,
45,
18368,
1241,
2186,
312,
603,
1175,
457,
1262,
65,
23696,
4236,
899,
67,
1264,
2163,
1262,
299,
556,
6484,
1262,
11530,
3795,
49,
332,
769,
2163,
742,
310,
1614,
320,
343,
41499,
4236,
1926,
1195,
3686,
1264,
1763,
299,
556,
41499,
4236,
1926,
1195,
3686,
459,
769,
1763,
411,
9954,
5238,
51,
3612,
13215,
100,
3319,
49,
1264,
2163,
1262,
49,
332,
1353,
1763,
9954,
411,
878,
49,
878,
312,
343,
1035,
45,
769,
1763,
312,
310,
339,
2385,
327,
1002,
503,
46,
320,
343,
4101,
51
] | 7,558,253,960,278,337,000
| true
| false
| false
| false
|
[
18368,
51,
19717,
941,
24202,
365,
882,
762,
979,
18391,
51,
19717,
941,
24202,
941,
5475,
941,
23879,
18001,
882,
244,
53,
46,
343,
4873,
1241,
671,
299,
332,
449,
332,
494,
18391,
51,
19717,
941,
24202,
492,
2776,
1175,
9305,
18391,
1241,
2186,
299,
556,
9305,
459,
18368,
1241,
411,
556,
3707,
65,
671,
1579,
572,
1241,
671,
894,
310,
1035,
45,
18368,
1241,
2186,
312,
603,
1175,
457,
1262,
65,
23696,
4236,
899,
67,
1264,
2163,
1262,
299,
556,
6484,
1262,
11530,
3795,
49,
332,
769,
2163,
742,
310,
1614,
320,
343,
41499,
4236,
1926,
1195,
3686,
1264
] | -3,121,046,641,198,878,000
| true
|
FeaturePanel extends AmpFeaturePanel<IndicatorActivity> {
/**
* @param id
* @param fmName
* @throws Exception
*/
public AmpMEItemFeaturePanel(String id, String fmName, final IModel<IndicatorActivity> conn,
IModel<AmpIndicator> indicator, final IModel<Set<AmpIndicatorValue>> values){
super(id, fmName, true);
if (values.getObject() == null)
values.setObject(new HashSet<AmpIndicatorValue>());
final Label indicatorNameLabel = new Label("indicatorName", new PropertyModel<String>(indicator, "name"));
add(indicatorNameLabel);
String indCodeString = "";
if (indicator.getObject().getCode()!= null && indicator.getObject().getCode().trim().compareTo("")!= 0)
indCodeString = " - " + indicator.getObject().getCode();
final Label indicatorCodeLabel = new Label("indicatorCode", new Model<String>(indCodeString));
add(indicatorCodeLabel);
final IModel<AmpCategoryValue> logFrameModel = new PropertyModel<>(conn, "logFrame");
try {
AmpCategorySelectFieldPanel log
|
IndicatorActivity> conn,
IModel<AmpIndicator> indicator, final IModel<Set<AmpIndicatorValue>> values){
super(id, fmName, true);
if (values.getObject() == null)
values.setObject(new HashSet<AmpIndicatorValue>());
final Label indicatorNameLabel = new Label("indicatorName", new PropertyModel<String>(indicator, "name"));
add(indicatorNameLabel);
String indCodeString = "";
if (indicator.getObject().getCode()!= null && indicator.getObject().getCode().trim().compareTo("")!= 0)
indCodeString = " - " + indicator.getObject().getCode();
final Label indicatorCodeLabel = new Label("indicatorCode", new Model<String>(indCodeString));
add(indicatorCodeLabel);
final IModel<AmpCategoryValue> logFrameModel = new PropertyModel<>(conn, "logFrame");
try {
AmpCategorySelectFieldPanel log
|
Object(new HashSet<AmpIndicatorValue>());
final Label indicatorNameLabel = new Label("indicatorName", new PropertyModel<String>(indicator, "name"));
add(indicatorNameLabel);
String indCodeString = "";
if (indicator.getObject().getCode()!= null && indicator.getObject().getCode().trim().compareTo("")!= 0)
indCodeString = " - " + indicator.getObject().getCode();
final Label indicatorCodeLabel = new Label("indicatorCode", new Model<String>(indCodeString));
add(indicatorCodeLabel);
final IModel<AmpCategoryValue> logFrameModel = new PropertyModel<>(conn, "logFrame");
try {
AmpCategorySelectFieldPanel log
|
indicator.getObject().getCode()!= null && indicator.getObject().getCode().trim().compareTo("")!= 0)
indCodeString = " - " + indicator.getObject().getCode();
final Label indicatorCodeLabel = new Label("indicatorCode", new Model<String>(indCodeString));
add(indicatorCodeLabel);
final IModel<AmpCategoryValue> logFrameModel = new PropertyModel<>(conn, "logFrame");
try {
AmpCategorySelectFieldPanel log
|
frame = new AmpCategorySelectFieldPanel("logframe", CategoryConstants.LOGFRAME_KEY, logFrameModel, "Logframe Category", true, true);
add(logframe);
} catch (Exception e) {
logger.
|
SchemeTagger.java
|
/FileExtraction/Java_unseen/kevinkrouse_j/src/org/armedbear/j/mode/scheme/SchemeTagger.java
|
/*
* SchemeTagger.java
*
* Copyright (C) 1998-2002 Peter Graves
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.armedbear.j.mode.scheme;
import org.armedbear.j.Mode;
import java.lang.StringBuilder;
import org.armedbear.j.Line;
import org.armedbear.j.LocalTag;
import org.armedbear.j.Position;
import org.armedbear.j.SystemBuffer;
import org.armedbear.j.Tagger;
import org.armedbear.j.mode.lisp.LispTag;
import java.util.ArrayList;
public final class SchemeTagger extends Tagger
{
// States.
private static final int NEUTRAL = 0;
private static final int DEFUN = 1;
protected Position pos;
protected String token;
protected Position tokenStart;
private static final Mode schemeMode = SchemeMode.getMode();
public SchemeTagger(SystemBuffer buffer)
{
super(buffer);
}
public void run()
{
ArrayList<LocalTag> tags = new ArrayList<LocalTag>();
pos = new Position(buffer.getFirstLine(), 0);
token = null;
tokenStart = null;
int state = NEUTRAL;
while (!pos.atEnd()) {
char c = pos.getChar();
if (Character.isWhitespace(c)) {
pos.skipWhitespace();
continue;
}
if (c == '\\') {
// Escape.
if (pos.getOffset() < pos.getLineLength() - 1) {
pos.skip(2);
continue;
}
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (c == '\"') {
pos.skipQuote();
continue;
}
if (c == ';') {
// Comment.
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (schemeMode.isIdentifierStart(c)) {
gatherToken();
if (state == DEFUN) {
LocalTag tag = new LispTag(token, tokenStart);
tags.add(tag);
state = NEUTRAL;
} else if (token.equals("define"))
state = DEFUN;
continue;
}
pos.next();
}
buffer.setTags(tags);
}
private void gatherToken()
{
tokenStart = new Position(pos);
StringBuilder sb = new StringBuilder();
char c;
while (schemeMode.isIdentifierPart(c = pos.getChar())) {
sb.append(c);
if (!pos.next())
break;
}
token = sb.toString();
}
}
| 3,467
|
Java
|
.java
|
kevinkrouse/j
| 10
| 2
| 0
|
2012-04-16T00:43:46Z
|
2023-01-05T00:18:06Z
|
a4c76096b0d53521c99136e98c2e7d62aecf3532492bcb3ba134648151873a42
|
[] |
[
1127,
222,
338,
38329,
2649,
892,
51,
1874,
222,
338,
222,
338,
2657,
327,
72,
46,
244,
54,
62,
62,
61,
50,
55,
53,
53,
55,
37561,
8102,
7777,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
222,
338,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
588,
222,
222,
1337,
1105,
51,
301,
1987,
47037,
51,
111,
51,
2832,
51,
13634,
64,
222,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
2116,
64,
222,
485,
1401,
51,
1600,
51,
20859,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
1829,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
3340,
2649,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
2746,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
1615,
2030,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
2649,
892,
64,
222,
485,
1105,
51,
301,
1987,
47037,
51,
111,
51,
2832,
51,
15893,
51,
81,
8702,
2649,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
222,
942,
1175,
462,
38329,
2649,
892,
2041,
413,
7076,
222,
128,
303,
453,
18607,
51,
303,
964,
924,
1175,
648,
8949,
1086,
87,
744,
299,
244,
53,
64,
303,
964,
924,
1175,
648,
2295,
6445,
280,
299,
244,
54,
64,
465,
2532,
11943,
3423,
64,
303,
2532,
910,
2421,
64,
303,
2532,
11943,
2421,
2148,
64,
465,
964,
924,
1175,
10750,
12872,
2116,
299,
38329,
2116,
51,
390,
2116,
492,
465,
581,
38329,
2649,
892,
45,
1615,
2030,
3129,
46,
303,
320,
310,
2615,
45,
2683,
312,
303,
339,
465,
581,
782,
1441,
365,
303,
320,
310,
5068,
65,
3340,
2649,
67,
5957,
299,
556,
5068,
65,
3340,
2649,
2938,
310,
3423,
299,
556,
11943,
45,
2683,
51,
25628,
1829,
1046,
244,
53,
312,
310,
2421,
299,
762,
64,
310,
2421,
2148,
299,
762,
64,
310,
648,
1621,
299,
8949,
1086,
87,
744,
64,
310,
2236,
1445,
985,
51,
288,
2117,
1177,
320,
343,
1370,
300,
299,
3423,
51,
390,
2674,
492,
343,
434,
327,
6891,
51,
316,
31627,
45,
104,
509,
320,
419,
3423,
51,
5969,
31627,
492,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
17257,
704,
320,
419,
453,
535,
10959,
51,
419,
434,
327,
985,
51,
390,
3468,
365,
350,
3423,
51,
42918,
2396,
365,
449,
244,
54,
46,
320,
547,
3423,
51,
5969,
45,
55,
312,
547,
4056,
64,
419,
339,
419,
7118,
2371,
1829,
299,
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
42833,
704,
320,
419,
3423,
51,
5969,
17117,
492,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
13052,
704,
320,
419,
453,
14523,
51,
419,
7118,
2371,
1829,
299,
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
13634,
2116,
51,
316,
5551,
2148,
45,
104,
509,
320,
419,
20174,
1781,
492,
419,
434,
327,
1311,
630,
2295,
6445,
46,
320,
547,
7099,
2649,
2621,
299,
556,
517,
8702,
2649,
45,
1977,
49,
2421,
2148,
312,
547,
5957,
51,
688,
45,
2159,
312,
547,
1621,
299,
8949,
1086,
87,
744,
64,
419,
339,
832,
434,
327,
1977,
51,
3591,
459,
1252,
2152,
547,
1621,
299,
2295,
6445,
64,
419,
4056,
64,
343,
339,
343,
3423,
51,
1995,
492,
310,
339,
310,
3129,
51,
489,
6763,
45,
3981,
312,
303,
339,
465,
964,
782,
20174,
1781,
365,
303,
320,
310,
2421,
2148,
299,
556,
11943,
45,
985,
312,
310,
9705,
6127,
299,
556,
9705,
492,
310,
1370,
300,
64,
310,
2236,
327,
13634,
2116,
51,
316,
5551,
2655,
45,
104,
299,
3423,
51,
390,
2674,
5183,
320,
343,
6127,
51,
1713,
45,
104,
312,
343,
434,
1445,
985,
51,
1995,
1177,
419,
1644,
64,
310,
339,
310,
2421,
299,
6127,
51,
3127,
492,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 839
|
[
2615,
45,
2683,
312,
303,
339,
465,
581,
782,
1441,
365,
303,
320,
310,
5068,
65,
3340,
2649,
67,
5957,
299,
556,
5068,
65,
3340,
2649,
2938,
310,
3423,
299,
556,
11943,
45,
2683,
51,
25628,
1829,
1046,
244,
53,
312,
310,
2421,
299,
762,
64,
310,
2421,
2148,
299,
762,
64,
310,
648,
1621,
299,
8949,
1086,
87,
744,
64,
310,
2236,
1445,
985,
51,
288,
2117,
1177,
320,
343,
1370,
300,
299,
3423,
51,
390,
2674,
492,
343,
434,
327,
6891,
51,
316,
31627,
45,
104,
509,
320,
419,
3423,
51,
5969,
31627,
492,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
17257,
704,
320,
419,
453,
535,
10959,
51,
419,
434,
327,
985,
51,
390,
3468,
365,
350,
3423,
51,
42918,
2396,
365,
449,
244,
54,
46,
320,
547,
3423,
51,
5969,
45,
55,
312,
547,
4056,
64,
419,
339,
419,
7118,
2371,
1829,
299,
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
42833,
704,
320,
419,
3423,
51,
5969,
17117,
492,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
13052,
704,
320,
419,
453,
14523,
51,
419,
7118,
2371,
1829,
299,
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
13634,
2116,
51,
316,
5551,
2148,
45,
104,
509,
320,
419,
20174,
1781,
492,
419,
434,
327,
1311,
630,
2295,
6445,
46,
320,
547,
7099,
2649,
2621,
299,
556,
517,
8702,
2649,
45,
1977,
49,
2421,
2148,
312,
547,
5957,
51,
688,
45,
2159,
312,
547,
1621,
299,
8949,
1086,
87
] | -6,694,663,873,888,914,000
| true
| false
| false
| false
|
[
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
42833,
704,
320,
419,
3423,
51,
5969,
17117,
492,
419,
4056,
64,
343,
339,
343,
434,
327,
104,
630,
13052,
704,
320,
419,
453,
14523,
51,
419,
7118,
2371,
1829,
299,
3423,
51,
22998,
1829,
492,
419,
434,
327,
46584,
630,
762,
46,
547,
1644,
64,
419,
3423,
51,
23061,
45,
46584,
49,
244,
53,
312,
419,
4056,
64,
343,
339,
343,
434,
327,
13634
] | -8,305,548,836,067,965,000
| true
|
super(buffer);
}
public void run()
{
ArrayList<LocalTag> tags = new ArrayList<LocalTag>();
pos = new Position(buffer.getFirstLine(), 0);
token = null;
tokenStart = null;
int state = NEUTRAL;
while (!pos.atEnd()) {
char c = pos.getChar();
if (Character.isWhitespace(c)) {
pos.skipWhitespace();
continue;
}
if (c == '\\') {
// Escape.
if (pos.getOffset() < pos.getLineLength() - 1) {
pos.skip(2);
continue;
}
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (c == '\"') {
pos.skipQuote();
continue;
}
if (c == ';') {
// Comment.
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (scheme
|
null;
int state = NEUTRAL;
while (!pos.atEnd()) {
char c = pos.getChar();
if (Character.isWhitespace(c)) {
pos.skipWhitespace();
continue;
}
if (c == '\\') {
// Escape.
if (pos.getOffset() < pos.getLineLength() - 1) {
pos.skip(2);
continue;
}
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (c == '\"') {
pos.skipQuote();
continue;
}
if (c == ';') {
// Comment.
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (scheme
|
}
if (c == '\\') {
// Escape.
if (pos.getOffset() < pos.getLineLength() - 1) {
pos.skip(2);
continue;
}
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (c == '\"') {
pos.skipQuote();
continue;
}
if (c == ';') {
// Comment.
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (scheme
|
pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (c == '\"') {
pos.skipQuote();
continue;
}
if (c == ';') {
// Comment.
Line nextLine = pos.getNextLine();
if (nextLine == null)
break;
pos.moveTo(nextLine, 0);
continue;
}
if (scheme
|
Mode.isIdentifierStart(c)) {
gatherToken();
if (state == DEFUN) {
LocalTag tag = new LispTag(token, tokenStart);
tags.add(tag);
state = NEUTR
|
AdmissionManager.java
|
/FileExtraction/Java_unseen/junoemr_junoemr/src/main/java/org/oscarehr/PMmodule/service/AdmissionManager.java
|
/**
*
* Copyright (c) 2005-2012. Centre for Research on Inner City Health, St. Michael's Hospital, Toronto. All Rights Reserved.
* This software is published under the GPL GNU General Public License.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* This software was written for
* Centre for Research on Inner City Health, St. Michael's Hospital,
* Toronto, Ontario, Canada
*/
package org.oscarehr.PMmodule.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.oscarehr.PMmodule.dao.ClientReferralDAO;
import org.oscarehr.PMmodule.dao.ProgramClientStatusDAO;
import org.oscarehr.PMmodule.dao.ProgramDao;
import org.oscarehr.PMmodule.dao.ProgramQueueDao;
import org.oscarehr.PMmodule.dao.VacancyDao;
import org.oscarehr.PMmodule.exception.AdmissionException;
import org.oscarehr.PMmodule.exception.AlreadyAdmittedException;
import org.oscarehr.PMmodule.exception.ProgramFullException;
import org.oscarehr.PMmodule.exception.ServiceRestrictionException;
import org.oscarehr.PMmodule.model.AdmissionSearchBean;
import org.oscarehr.PMmodule.model.ClientReferral;
import org.oscarehr.PMmodule.model.Program;
import org.oscarehr.PMmodule.model.ProgramClientRestriction;
import org.oscarehr.PMmodule.model.ProgramQueue;
import org.oscarehr.PMmodule.model.Vacancy;
import org.oscarehr.common.dao.AdmissionDao;
import org.oscarehr.common.model.Admission;
import org.oscarehr.common.model.BedDemographic;
import org.oscarehr.common.model.JointAdmission;
import org.oscarehr.common.model.RoomDemographic;
import org.oscarehr.managers.BedManager;
import org.oscarehr.managers.BedDemographicManager;
import org.oscarehr.managers.RoomManager;
import org.oscarehr.managers.RoomDemographicManager;
import org.oscarehr.util.LoggedInInfo;
import org.oscarehr.util.SpringUtils;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;
import oscar.log.LogAction;
@Transactional
public class AdmissionManager {
private AdmissionDao dao;
private ProgramDao programDao;
private ProgramQueueDao programQueueDao;
private ClientReferralDAO clientReferralDAO;
private BedDemographicManager bedDemographicManager;
private ProgramClientStatusDAO programClientStatusDAO;
private ClientRestrictionManager clientRestrictionManager;
private RoomManager roomManager;
private BedManager bedManager;
private RoomDemographicManager roomDemographicManager;
public List<Admission> getAdmissions_archiveView(String programId, Integer demographicNo) {
return dao.getAdmissions_archiveView(Integer.valueOf(programId), demographicNo);
}
public Admission getAdmission(String programId, Integer demographicNo) {
return dao.getAdmission(Integer.valueOf(programId), demographicNo);
}
public Admission getCurrentAdmission(String programId, Integer demographicNo) {
return dao.getCurrentAdmission(Integer.valueOf(programId), demographicNo);
}
public List<Admission> getAdmissionsByFacility(Integer demographicNo, Integer facilityId) {
return dao.getAdmissionsByFacility(demographicNo, facilityId);
}
public List<Admission> getCurrentAdmissionsByFacility(Integer demographicNo, Integer facilityId) {
return dao.getCurrentAdmissionsByFacility(demographicNo, facilityId);
}
public List<Admission> getAdmissions() {
return dao.getAdmissions();
}
public List<Admission> getAdmissions(Integer demographicNo) {
return dao.getAdmissions(demographicNo);
}
public List<Admission> getCurrentAdmissions(Integer demographicNo) {
return dao.getCurrentAdmissions(demographicNo);
}
public Admission getCurrentBedProgramAdmission(Integer demographicNo) {
return dao.getCurrentBedProgramAdmission(programDao, demographicNo);
}
public List<Admission> getCurrentServiceProgramAdmission(Integer demographicNo) {
return dao.getCurrentServiceProgramAdmission(programDao, demographicNo);
}
public Admission getCurrentExternalProgramAdmission(Integer demographicNo) {
return dao.getCurrentExternalProgramAdmission(programDao, demographicNo);
}
public Admission getCurrentCommunityProgramAdmission(Integer demographicNo) {
return dao.getCurrentCommunityProgramAdmission(programDao, demographicNo);
}
public List<Admission> getCurrentAdmissionsByProgramId(String programId) {
return dao.getCurrentAdmissionsByProgramId(Integer.valueOf(programId));
}
public Admission getAdmission(Long id) {
return dao.getAdmission(id.intValue());
}
public Admission getAdmission(Integer id) {
return dao.getAdmission(id);
}
public void saveAdmission(Admission admission) {
dao.saveAdmission(admission);
}
/*public void processAdmissionToExternal(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, false, null, false);
}
*/
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, false, null, false,null);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, boolean tempAdmission) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, tempAdmission, null, false,null);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, boolean tempAdmission,List<Integer> dependents) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, tempAdmission, null, false,dependents);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, boolean tempAdmission, boolean overrideRestriction) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, tempAdmission, null, overrideRestriction,null);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, Date admissionDate) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, false, admissionDate, false,null);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, boolean tempAdmission,List<Integer> dependents, Date admissionDate) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
processAdmission(demographicNo, providerNo, program, dischargeNotes, admissionNotes, tempAdmission, admissionDate, false,dependents);
}
public void processAdmission(Integer demographicNo, String providerNo, Program program, String dischargeNotes, String admissionNotes, boolean tempAdmission, Date admissionDate, boolean overrideRestriction, List<Integer> dependents) throws ProgramFullException, AdmissionException, ServiceRestrictionException {
// check if there's a service restriction in place on this individual for this program
if (!overrideRestriction) {
ProgramClientRestriction restrInPlace = clientRestrictionManager.checkClientRestriction(program.getId(), demographicNo, new Date());
if (restrInPlace != null) {
throw new ServiceRestrictionException("service restriction in place", restrInPlace);
}
}
boolean fromTransfer=false;
boolean automaticDischarge=false;
// If admitting to bed program, discharge from old bed program
if (program.getType().equalsIgnoreCase("bed") && !tempAdmission) {
Admission fullAdmission = getCurrentBedProgramAdmission(demographicNo);
// community?
if (fullAdmission != null) {
Program oldProgram=programDao.getProgram(fullAdmission.getProgramId());
Program newProgram=programDao.getProgram(program.getId());
fromTransfer=(oldProgram.getFacilityId()==newProgram.getFacilityId());
//discharge from old bed program to a new bed program which is in the different facility
//This is called automatic discharge.
if(!fromTransfer)
automaticDischarge = true;
//processDischarge(new Integer(fullAdmission.getProgramId().intValue()), new Integer(demographicNo), dischargeNotes, "", null, fromTransfer);
processDischarge(new Integer(fullAdmission.getProgramId().intValue()), new Integer(demographicNo), dischargeNotes, "", null,null, fromTransfer,automaticDischarge);
} else {
fullAdmission = getCurrentCommunityProgramAdmission(demographicNo);
if (fullAdmission != null) {
processDischarge(new Integer(fullAdmission.getProgramId().intValue()), new Integer(demographicNo), dischargeNotes, "0",admissionDate);
}
}
}
// Can only be in a single temporary bed program.
if (tempAdmission && getTemporaryAdmission(demographicNo) != null) {
throw new AdmissionException("Already in a temporary program.");
}
// Create/Save admission object
Admission newAdmission = new Admission();
if (admissionDate != null) {
newAdmission.setAdmissionDate(admissionDate);
} else {
newAdmission.setAdmissionDate(new Date());
}
newAdmission.setAdmissionNotes(admissionNotes);
newAdmission.setAdmissionStatus(Admission.STATUS_CURRENT);
newAdmission.setClientId(demographicNo);
newAdmission.setProgramId(program.getId());
newAdmission.setProviderNo(providerNo);
newAdmission.setTeamId(null);
newAdmission.setTemporaryAdmission(tempAdmission);
newAdmission.setAdmissionFromTransfer(fromTransfer);
//keep the client status if he was in the same program with it.
Integer clientStatusId = dao.getLastClientStatusFromAdmissionByProgramIdAndClientId(Integer.valueOf(program.getId()),demographicNo);
//check if the client status is valid/existed in program_clientStatus
if(programClientStatusDAO.getProgramClientStatus(clientStatusId.toString()) == null|| clientStatusId==0)
clientStatusId = null;
newAdmission.setClientStatusId(clientStatusId);
saveAdmission(newAdmission);
// Clear them from the queue, Update their referral
ProgramQueue pq = programQueueDao.getActiveProgramQueue(program.getId().longValue(), (long) demographicNo);
if (pq != null) {
pq.setStatus(ProgramQueue.STATUS_ADMITTED);
programQueueDao.saveProgramQueue(pq);
// is there a referral
if (pq.getReferralId() != null && pq.getReferralId().longValue() > 0) {
ClientReferral referral = clientReferralDAO.getClientReferral(pq.getReferralId());
referral.setStatus(ClientReferral.STATUS_CURRENT);
referral.setCompletionDate(new Date());
referral.setCompletionNotes(admissionNotes);
clientReferralDAO.saveClientReferral(referral);
if(referral.getVacancyId()!=null){
//change vacancy's status
VacancyDao vacancyDao= SpringUtils.getBean(VacancyDao.class);
Vacancy v = vacancyDao.find(referral.getVacancyId());
if(v!=null) {
v.setStatus("filled");
vacancyDao.saveEntity(v);
}
}
}
}
//if they are in a service program linked to this bed program, discharge them from that service program
//TODO:
if(program.getType().equalsIgnoreCase("Bed")) {
List<Program> programs = programDao.getLinkedServicePrograms(newAdmission.getProgramId(),demographicNo);
for(Program p:programs) {
//discharge them from this program
this.processDischarge(p.getId(), demographicNo,"", "");
}
}
//For the clients dependents
if (dependents != null){
for(Integer l : dependents){
processAdmission(new Integer(l.intValue()), providerNo,program,dischargeNotes,admissionNotes,tempAdmission,newAdmission.getAdmissionDate(),true,null);
}
}
//Once the patient is admitted to this program, the vacancy
}
public void processInitialAdmission(Integer demographicNo, String providerNo, Program program, String admissionNotes, Date admissionDate) throws ProgramFullException, AlreadyAdmittedException, ServiceRestrictionException {
// see if there's room first
if (program.getNumOfMembers().intValue() >= program.getMaxAllowed().intValue()) {
throw new ProgramFullException();
}
// check if there's a service restriction in place on this individual for this program
ProgramClientRestriction restrInPlace = clientRestrictionManager.checkClientRestriction(program.getId(), demographicNo, new Date());
if (restrInPlace != null) {
throw new ServiceRestrictionException("service restriction in place", restrInPlace);
}
Admission admission = getCurrentAdmission(String.valueOf(program.getId()), demographicNo);
if (admission != null) {
throw new AlreadyAdmittedException();
}
Admission newAdmission = new Admission();
if (admissionDate == null) {
newAdmission.setAdmissionDate(new Date());
} else {
newAdmission.setAdmissionDate(admissionDate);
}
newAdmission.setAdmissionNotes(admissionNotes);
newAdmission.setAdmissionStatus(Admission.STATUS_CURRENT);
newAdmission.setClientId(demographicNo);
newAdmission.setProgramId(program.getId());
newAdmission.setProviderNo(providerNo);
newAdmission.setTeamId(null);
saveAdmission(newAdmission);
}
public Admission getTemporaryAdmission(Integer demographicNo) {
return dao.getTemporaryAdmission(demographicNo);
}
public List<Admission> getCurrentTemporaryProgramAdmission(Integer demographicNo) {
Admission admission = dao.getTemporaryAdmission(demographicNo);
if (admission != null) {
List<Admission> results = new ArrayList<Admission>();
results.add(admission);
return results;
}
return null;
}
public boolean isDependentInDifferentProgramFromHead(Integer demographicNo, List<JointAdmission> dependentList){
if(demographicNo == null || dependentList == null || dependentList.isEmpty()){
return false;
}
Integer[] dependentIds = new Integer[dependentList.size()];
for(int i=0; i < dependentList.size(); i++ ){
dependentIds[i] = new Integer(dependentList.get(i).getClientId().intValue());
}
//Check whether all family members are under same bed program -> if not, display error message.
Integer headProgramId = null;
Integer dependentProgramId = null;
Admission headAdmission = getCurrentBedProgramAdmission(demographicNo);
if(headAdmission != null){
headProgramId = headAdmission.getProgramId();
}else{
headProgramId = null;
}
for(int i=0; dependentIds != null && i < dependentIds.length; i++ ){
Admission dependentAdmission = getCurrentBedProgramAdmission(dependentIds[i]);
if(dependentAdmission != null){
dependentProgramId = dependentAdmission.getProgramId();
}else{
dependentProgramId = null;
}
if( headProgramId != null && dependentProgramId != null ){
if( headProgramId.intValue() != dependentProgramId.intValue() ){
//Display message notifying that the dependent is under different bed program than family head -> cannot assign room/bed
return true;
}
}else if(headProgramId != null && dependentProgramId == null){
return true;
}else if(headProgramId == null){
return true;
}
}
return false;
}
public List search(AdmissionSearchBean searchBean) {
return dao.search(searchBean);
}
public void processDischarge(Integer programId, Integer demographicNo, String dischargeNotes, String radioDischargeReason) throws AdmissionException {
processDischarge(programId, demographicNo, dischargeNotes, radioDischargeReason,null,null, false, false);
}
public void processDischarge(Integer programId, Integer demographicNo, String dischargeNotes, String radioDischargeReason, Date dischargeDate) throws AdmissionException {
processDischarge(programId, demographicNo, dischargeNotes, radioDischargeReason, dischargeDate, null, false, false);
}
public void processDischarge(Integer programId, Integer demographicNo, String dischargeNotes, String radioDischargeReason,Date dischargeDate, List<Integer> dependents, boolean fromTransfer, boolean automaticDischarge) throws AdmissionException {
Admission fullAdmission = getCurrentAdmission(String.valueOf(programId), demographicNo);
Program program=programDao.getProgram(programId);
Integer facilityId=null;
if (program!=null) facilityId=(int)program.getFacilityId();
if (fullAdmission == null) {
throw new AdmissionException("Admission Record not found");
}
if(dischargeDate == null)
fullAdmission.setDischargeDate(new Date());
else
fullAdmission.setDischargeDate(dischargeDate);
fullAdmission.setDischargeNotes(dischargeNotes);
fullAdmission.setAdmissionStatus(Admission.STATUS_DISCHARGED);
fullAdmission.setRadioDischargeReason(radioDischargeReason);
fullAdmission.setDischargeFromTransfer(fromTransfer);
fullAdmission.setAutomaticDischarge(automaticDischarge);
saveAdmission(fullAdmission);
if(roomManager != null && roomManager.isRoomOfDischargeProgramAssignedToClient(demographicNo, programId)){
if(roomDemographicManager != null){
RoomDemographic roomDemographic = roomDemographicManager.getRoomDemographicByDemographic(demographicNo, facilityId);
if(roomDemographic != null){
roomDemographicManager.deleteRoomDemographic(roomDemographic);
}
}
}
if(bedManager != null && bedManager.isBedOfDischargeProgramAssignedToClient(demographicNo, programId)){
if(bedDemographicManager != null){
BedDemographic bedDemographic = bedDemographicManager.getBedDemographicByDemographic(demographicNo, facilityId);
if(bedDemographic != null){
bedDemographicManager.deleteBedDemographic(bedDemographic);
}
}
}
if (dependents != null){
for(Integer l:dependents){
processDischarge(programId,new Integer(l.intValue()),dischargeNotes,radioDischargeReason, dischargeDate, null, fromTransfer, automaticDischarge);
}
}
}
public void processDischargeToCommunity(Integer communityProgramId, Integer demographicNo, String providerNo, String notes, String radioDischargeReason, Date dischargeDate) throws AdmissionException {
processDischargeToCommunity(communityProgramId,demographicNo,providerNo,notes,radioDischargeReason,null,dischargeDate);
}
public void processDischargeToCommunity(Integer communityProgramId, Integer demographicNo, String providerNo, String notes, String radioDischargeReason,List<Integer> dependents,Date dischargeDate) throws AdmissionException {
Admission currentBedAdmission = getCurrentBedProgramAdmission(demographicNo);
Program program=programDao.getProgram(communityProgramId);
Integer facilityId=null;
if (program!=null) facilityId=(int)program.getFacilityId();
if (currentBedAdmission != null) {
processDischarge(currentBedAdmission.getProgramId(), demographicNo, notes, radioDischargeReason);
BedDemographic bedDemographic = bedDemographicManager.getBedDemographicByDemographic(demographicNo, facilityId);
if (bedDemographic != null) {
bedDemographicManager.deleteBedDemographic(bedDemographic);
}
}
Admission currentCommunityAdmission = getCurrentCommunityProgramAdmission(demographicNo);
if (currentCommunityAdmission != null) {
processDischarge(currentCommunityAdmission.getProgramId(), demographicNo, notes, radioDischargeReason);
}
// Create and save admission object
Admission admission = new Admission();
admission.setAdmissionDate(new Date());
admission.setAdmissionNotes(notes);
admission.setAdmissionStatus(Admission.STATUS_CURRENT);
admission.setClientId(demographicNo);
admission.setProgramId(communityProgramId);
admission.setProviderNo(providerNo);
admission.setTeamId(null);
admission.setTemporaryAdmission(false);
admission.setRadioDischargeReason(radioDischargeReason);
admission.setClientStatusId(null);
saveAdmission(admission);
if (dependents != null){
for(Integer l:dependents){
processDischargeToCommunity(communityProgramId,new Integer(l.intValue()),providerNo, notes, radioDischargeReason,null);
}
}
}
@Required
public void setAdmissionDao(AdmissionDao dao) {
this.dao = dao;
}
@Required
public void setProgramDao(ProgramDao programDao) {
this.programDao = programDao;
}
@Required
public void setProgramQueueDao(ProgramQueueDao dao) {
this.programQueueDao = dao;
}
@Required
public void setClientReferralDAO(ClientReferralDAO dao) {
this.clientReferralDAO = dao;
}
@Required
public void setBedDemographicManager(BedDemographicManager bedDemographicManager) {
this.bedDemographicManager = bedDemographicManager;
}
@Required
public void setProgramClientStatusDAO(ProgramClientStatusDAO programClientStatusDAO) {
this.programClientStatusDAO = programClientStatusDAO;
}
@Required
public void setClientRestrictionManager(ClientRestrictionManager clientRestrictionManager) {
this.clientRestrictionManager = clientRestrictionManager;
}
@Required
public void setRoomManager(RoomManager roomManager) {
this.roomManager = roomManager;
}
@Required
public void setBedManager(BedManager bedManager) {
this.bedManager= bedManager;
}
@Required
public void setRoomDemographicManager(RoomDemographicManager roomDemographicManager) {
this.roomDemographicManager = roomDemographicManager;
}
public boolean isActiveInCurrentFacility(LoggedInInfo loggedInInfo, int demographicId)
{
List<Admission> results=getCurrentAdmissionsByFacility(demographicId, loggedInInfo.getCurrentFacility().getId());
if (results!=null && results.size()>0) return(true);
return(false);
}
public List getActiveAnonymousAdmissions() {
return dao.getActiveAnonymousAdmissions();
}
public boolean wasInProgram(Integer programId, Integer clientId) {
if(dao.getAdmission(programId, clientId)!=null)
return true;
else
return false;
}
public List<Admission> findAdmissionsByProgramAndDate(LoggedInInfo loggedInInfo, Integer programNo, Date day, int startIndex, int numToReturn) {
List<Admission> results = dao.findAdmissionsByProgramAndDate(programNo,day, startIndex, numToReturn);
for(Admission result:results) {
LogAction.addLogSynchronous(loggedInInfo,"AdmissionManager.findAdmissionsByProgramAndDate", "admission id=" + result.getId());
}
return results;
}
public Integer findAdmissionsByProgramAndDateAsCount(LoggedInInfo loggedInInfo, Integer programNo, Date day) {
Integer count= dao.findAdmissionsByProgramAndDateAsCount(programNo,day);
return count;
}
}
| 24,787
|
Java
|
.java
|
junoemr/junoemr
| 11
| 6
| 39
|
2018-06-06T17:33:56Z
|
2024-02-09T16:12:24Z
|
a3d205ad841ca802c9b0d7bd3a7adcbb419d428fb186ea3675f5804b4e07fc4f
|
[] |
[
1350,
222,
338,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
58,
50,
55,
53,
54,
55,
51,
15072,
287,
456,
18687,
563,
29323,
17145,
19256,
49,
1277,
51,
29099,
1200,
16563,
21069,
49,
25694,
8565,
51,
3381,
12902,
11921,
51,
222,
338,
1369,
2951,
458,
9582,
1549,
341,
23508,
6994,
6153,
5062,
1196,
51,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
222,
338,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
338,
222,
338,
1369,
2951,
1616,
6658,
456,
222,
338,
15072,
287,
456,
18687,
563,
29323,
17145,
19256,
49,
1277,
51,
29099,
1200,
16563,
21069,
49,
222,
338,
25694,
8565,
49,
565,
585,
3454,
49,
48190,
222,
588,
222,
222,
1337,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
2140,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
13974,
51,
1503,
2099,
26155,
12909,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
13974,
51,
5756,
1503,
1551,
12909,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
13974,
51,
5756,
8924,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
13974,
51,
5756,
4098,
8924,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
13974,
51,
41943,
10367,
8924,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
3918,
51,
1785,
1722,
1002,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
3918,
51,
16365,
1785,
13786,
1002,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
3918,
51,
5756,
4737,
1002,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
3918,
51,
1201,
30725,
1002,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
1785,
1722,
3209,
5358,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
1503,
2099,
26155,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
5756,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
5756,
1503,
30725,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
5756,
4098,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
7464,
1663,
51,
1184,
51,
41943,
10367,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
13974,
51,
1785,
1722,
8924,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
1785,
1722,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
23349,
11576,
14166,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
14090,
1785,
1722,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
8423,
11576,
14166,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
23349,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
23349,
11576,
14166,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
8423,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
8423,
11576,
14166,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
1058,
51,
25469,
1139,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
1058,
51,
12427,
2769,
64,
222,
485,
1105,
51,
4140,
51,
9580,
51,
5802,
51,
4341,
51,
5425,
64,
222,
485,
1105,
51,
4140,
51,
6561,
51,
4341,
51,
23416,
64,
222,
222,
485,
28385,
301,
51,
769,
51,
1353,
1728,
64,
222,
222,
69,
23416,
222,
942,
462,
3604,
1722,
1590,
320,
499,
221,
2072,
3604,
1722,
8924,
27471,
64,
222,
221,
2072,
9937,
8924,
3477,
8924,
64,
222,
221,
2072,
9937,
4098,
8924,
3477,
4098,
8924,
64,
222,
221,
2072,
5680,
2099,
26155,
12909,
2060,
2099,
26155,
12909,
64,
222,
221,
2072,
46904,
11576,
14166,
1590,
23131,
11576,
14166,
1590,
64,
222,
221,
2072,
9937,
1503,
1551,
12909,
3477,
1503,
1551,
12909,
64,
222,
221,
2072,
5680,
30725,
1590,
2060,
30725,
1590,
64,
222,
221,
2072,
19583,
1590,
8358,
1590,
64,
222,
221,
2072,
46904,
1590,
23131,
1590,
64,
222,
221,
2072,
19583,
11576,
14166,
1590,
8358,
11576,
14166,
1590,
64,
465,
581,
1701,
65,
1785,
1722,
67,
640,
1785,
3086,
100,
8945,
1089,
45,
671,
3477,
625,
49,
4418,
10891,
14166,
2042,
46,
320,
376,
221,
620,
27471,
51,
390,
1785,
3086,
100,
8945,
1089,
45,
3078,
51,
9169,
45,
5801,
625,
490,
10891,
14166,
2042,
312,
222,
221,
130,
3038,
221,
942,
3604,
1722,
640,
1785,
1722,
45,
671,
3477,
625,
49,
4418,
10891,
14166,
2042,
46,
320,
376,
221,
620,
27471,
51,
390,
1785,
1722,
45,
3078,
51,
9169,
45,
5801,
625,
490,
10891,
14166,
2042,
312,
222,
221,
130,
499,
221,
942,
3604,
1722,
23403,
1785,
1722,
45,
671,
3477,
625,
49,
4418,
10891,
14166,
2042,
46,
320,
376,
221,
620,
27471,
51,
12344,
1785,
1722,
45,
3078,
51,
9169,
45,
5801,
625,
490,
10891,
14166,
2042,
312,
222,
221,
130,
15662,
221,
942,
1701,
65,
1785,
1722,
67,
640,
1785,
3086,
1103,
37695,
45,
3078
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
2297,
51,
1184,
51,
1785,
1722,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
23349,
11576,
14166,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
14090,
1785,
1722,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
8423,
11576,
14166,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
23349,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
23349,
11576,
14166,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
8423,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
35276,
51,
8423,
11576,
14166,
1590,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
1058,
51,
25469,
1139,
64,
222,
485,
1105,
51,
519,
12818,
3943,
51,
1058,
51,
12427,
2769,
64,
222,
485,
1105,
51,
4140,
51,
9580,
51,
5802,
51,
4341,
51,
5425,
64,
222,
485,
1105,
51,
4140,
51,
6561,
51,
4341,
51,
23416,
64,
222,
222,
485,
28385,
301,
51,
769,
51,
1353,
1728,
64,
222,
222,
69,
23416,
222,
942,
462,
3604,
1722,
1590,
320,
499,
221,
2072,
3604,
1722,
8924,
27471,
64,
222,
221,
2072,
9937,
8924,
3477,
8924,
64,
222,
221,
2072,
9937,
4098,
8924,
3477,
4098,
8924,
64,
222,
221,
2072,
5680,
2099,
26155,
12909,
2060,
2099,
26155,
12909,
64,
222,
221,
2072,
46904,
11576,
14166,
1590,
23131,
11576,
14166,
1590,
64,
222,
221,
2072,
9937,
1503,
1551,
12909,
3477,
1503,
1551,
12909,
64,
222,
221,
2072,
5680,
30725,
1590,
2060,
30725,
1590,
64,
222,
221,
2072,
19583,
1590,
8358,
1590,
64,
222,
221,
2072,
46904,
1590,
23131,
1590,
64,
222,
221,
2072,
19583,
11576,
14166,
1590,
8358,
11576,
14166,
1590,
64,
465,
581,
1701,
65,
1785,
1722,
67,
640,
1785,
3086,
100,
8945,
1089,
45
] | -7,041,126,774,211,791,000
| true
| false
| false
| false
|
[
5425,
64,
222,
485,
1105,
51,
4140,
51,
6561,
51,
4341,
51,
23416,
64,
222,
222,
485,
28385,
301,
51,
769,
51,
1353,
1728,
64,
222,
222,
69,
23416,
222,
942,
462,
3604,
1722,
1590,
320,
499,
221,
2072,
3604,
1722,
8924,
27471,
64,
222,
221,
2072,
9937,
8924,
3477,
8924,
64,
222,
221,
2072,
9937,
4098,
8924,
3477,
4098,
8924,
64,
222,
221,
2072,
5680,
2099,
26155,
12909,
2060,
2099,
26155,
12909,
64,
222,
221,
2072,
46904,
11576,
14166,
1590,
23131,
11576,
14166,
1590,
64,
222,
221,
2072,
9937,
1503,
1551,
12909,
3477,
1503,
1551,
12909,
64,
222,
221
] | 912,494,114,880,234,100
| true
|
.common.model.Admission;
import org.oscarehr.common.model.BedDemographic;
import org.oscarehr.common.model.JointAdmission;
import org.oscarehr.common.model.RoomDemographic;
import org.oscarehr.managers.BedManager;
import org.oscarehr.managers.BedDemographicManager;
import org.oscarehr.managers.RoomManager;
import org.oscarehr.managers.RoomDemographicManager;
import org.oscarehr.util.LoggedInInfo;
import org.oscarehr.util.SpringUtils;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;
import oscar.log.LogAction;
@Transactional
public class AdmissionManager {
private AdmissionDao dao;
private ProgramDao programDao;
private ProgramQueueDao programQueueDao;
private ClientReferralDAO clientReferralDAO;
private BedDemographicManager bedDemographicManager;
private ProgramClientStatusDAO programClientStatusDAO;
|
model.RoomDemographic;
import org.oscarehr.managers.BedManager;
import org.oscarehr.managers.BedDemographicManager;
import org.oscarehr.managers.RoomManager;
import org.oscarehr.managers.RoomDemographicManager;
import org.oscarehr.util.LoggedInInfo;
import org.oscarehr.util.SpringUtils;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;
import oscar.log.LogAction;
@Transactional
public class AdmissionManager {
private AdmissionDao dao;
private ProgramDao programDao;
private ProgramQueueDao programQueueDao;
private ClientReferralDAO clientReferralDAO;
private BedDemographicManager bedDemographicManager;
private ProgramClientStatusDAO programClientStatusDAO;
|
.oscarehr.managers.RoomDemographicManager;
import org.oscarehr.util.LoggedInInfo;
import org.oscarehr.util.SpringUtils;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;
import oscar.log.LogAction;
@Transactional
public class AdmissionManager {
private AdmissionDao dao;
private ProgramDao programDao;
private ProgramQueueDao programQueueDao;
private ClientReferralDAO clientReferralDAO;
private BedDemographicManager bedDemographicManager;
private ProgramClientStatusDAO programClientStatusDAO;
|
Required;
import org.springframework.transaction.annotation.Transactional;
import oscar.log.LogAction;
@Transactional
public class AdmissionManager {
private AdmissionDao dao;
private ProgramDao programDao;
private ProgramQueueDao programQueueDao;
private ClientReferralDAO clientReferralDAO;
private BedDemographicManager bedDemographicManager;
private ProgramClientStatusDAO programClientStatusDAO;
|
private ClientRestrictionManager clientRestrictionManager;
private RoomManager roomManager;
private BedManager bedManager;
private RoomDemographicManager roomDemographicManager;
public List<Admission> getAdmissions_archiveView(
|
SessionForm.java
|
/FileExtraction/Java_unseen/intranda_goobi-workflow/src/main/java/de/sub/goobi/forms/SessionForm.java
|
package de.sub.goobi.forms;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.goobi.beans.Browser;
import org.goobi.beans.SessionInfo;
import org.goobi.beans.User;
import org.goobi.goobiScript.GoobiScriptManager;
import org.goobi.managedbeans.LoginBean;
import org.omnifaces.cdi.Push;
import org.omnifaces.cdi.PushContext;
import de.sub.goobi.config.ConfigurationHelper;
import de.sub.goobi.helper.Helper;
import de.sub.goobi.helper.exceptions.DAOException;
import de.sub.goobi.persistence.managers.UserManager;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.log4j.Log4j2;
/**
* This file is part of the Goobi Application - a Workflow tool for the support of mass digitization.
*
* Visit the websites for more information. - https://goobi.io - https://www.intranda.com - https://github.com/intranda/goobi-workflow
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions
* of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to
* link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and
* conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the library, but you are not obliged to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Die Klasse SessionForm für den überblick über die aktuell offenen Sessions
*
* @author Steffen Hankiewicz
* @author Maurice Mueller
* @version 1.00 - 16.01.2005
* @version 2.00 - 03.05.2021
*/
@Log4j2
@Named("SessionForm")
@ApplicationScoped
public class SessionForm implements Serializable {
/**
* The version id for serializing processes
*/
private static final long serialVersionUID = 8457947420232054227L;
/**
* The constant string to indicate that a user is logged out
*/
public static final String LOGGED_OUT = " - ausgeloggt - ";
/**
* The constant string to indicate that a user is not logged in until now
*/
public static final String NOT_LOGGED_IN = " - ";
/**
* The list of current sessions (represented by SessionInfo objects)
*/
private List<SessionInfo> sessions = Collections.synchronizedList(new ArrayList<>());
/**
* The formatter that is used for time representation strings
*/
private SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm:ss");
/**
* The formatter that is used for date representation strings
*/
@Setter
private SimpleDateFormat dateFormatter = new SimpleDateFormat("EEEE', ' dd. MMMM yyyy");
/**
* The request object of the current session
*/
@Inject
private HttpServletRequest request;
/**
* A message that can be shown when a user should be logged out.
*/
@Getter
private String logoutMessage = "";
@Getter
private String sessionListErrorTime = "";
@Inject
@Push
PushContext adminMessageChannel;
@Inject
@Getter
private GoobiScriptManager gsm;
/**
* Returns a list of all currently existing sessions, represented by a list of SessionInfo objects
*
* @return The list of SessionInfo objects
*/
public List<SessionInfo> getSessions() {
if (this.sessions != null) {
this.removeAbandonedSessions(false);
return this.sessions;
} else {
return new ArrayList<>();
}
}
/**
* Filters the sessions by real user sessions. All sessions that contain a name unequal to "-" are returned.
*
* @return The list of sessions with real users
*/
private List<SessionInfo> filterRealUserSessions() {
List<SessionInfo> realUserSessions = new ArrayList<>();
for (int index = 0; index < this.sessions.size(); index++) {
if (!SessionForm.NOT_LOGGED_IN.equals(this.sessions.get(index).getUserName())) {
realUserSessions.add(this.sessions.get(index));
}
}
return realUserSessions;
}
/**
* Returns the SessionInfo object with the specified id
*
* @param id The id of the requested SessionInfo object
* @return The SessionInfo object with that id
*/
public SessionInfo getSessionInfoById(String id) {
for (SessionInfo element : this.sessions) {
if (element.getSessionId().equals(id)) {
return element;
}
}
return null;
}
/**
* Returns the number of currently existing sessions.
*
* @return The number of sessions
*/
public int getNumberOfSessions() {
if (this.sessions != null) {
this.removeAbandonedSessions(false);
return this.sessions.size();
} else {
return 0;
}
}
/**
* Returns the number of currently existing sessions. The list of sessions is filtered for real user sessions.
*
* @return The number of real user sessions
*/
public int getNumberOfRealUserSessions() {
if (this.sessions != null) {
return this.filterRealUserSessions().size();
} else {
return 0;
}
}
/**
* Adds a new session to the list of current sessions
*
* @param newSession The new session to add to the other sessions
*/
private void addSession(HttpSession newSession) {
SessionInfo sessionInfo = new SessionInfo();
long now = System.currentTimeMillis();
sessionInfo.setSession(newSession);
sessionInfo.setSessionId(newSession.getId());
sessionInfo.setSessionCreatedTimestamp(now);
sessionInfo.setSessionCreatedFormatted(this.timeFormatter.format(now));
sessionInfo.setLastAccessTimestamp(now);
sessionInfo.setLastAccessFormatted(this.timeFormatter.format(now));
sessionInfo.setUserName(NOT_LOGGED_IN);
sessionInfo.setUserId(0);
sessionInfo.setUserTimeout(newSession.getMaxInactiveInterval());
if (this.request == null) {
this.sessions.add(sessionInfo);
return;
}
String address = this.request.getHeader("x-forwarded-for");
if (address == null) {
address = this.request.getRemoteAddr();
}
sessionInfo.setUserIpAddress(address);
String browserName = this.request.getHeader("User-Agent");
if (browserName == null) {
browserName = "-";
}
List<String> monitoringChecks = ConfigurationHelper.getInstance().getExcludeMonitoringAgentNames();
for (String agent : monitoringChecks) {
if (browserName.contains(agent)) {
return;
}
}
sessionInfo.setBrowserName(browserName);
Browser browser = Browser.parseBrowser(browserName);
sessionInfo.setBrowserIconFileName(Browser.getIconFileName(browser));
this.sessions.add(sessionInfo);
}
/**
* Updates the time information about a session
*
* @param updatedSession The concerning session to update
*/
public void updateSessionLastAccess(HttpSession updatedSession) {
if (this.sessions == null || updatedSession == null) {
return;
}
String id = updatedSession.getId();
SessionInfo knownSession = this.getSessionInfoById(id);
if (knownSession == null) {
this.addSession(updatedSession);
return;
}
long now = System.currentTimeMillis();
knownSession.setLastAccessTimestamp(now);
knownSession.setLastAccessFormatted(this.timeFormatter.format(now));
// This is needed to remove out-of-timeout-sessions
this.removeAbandonedSessions(true);
}
/**
* Updates the user information about a session in dependence of a certain user
*
* @param updatedSession The session to update
* @param updatedUser The concerning user
*/
public void updateSessionUserName(HttpSession updatedSession, User updatedUser) {
if (this.sessions == null || updatedSession == null) {
return;
}
String id = updatedSession.getId();
SessionInfo knownSession = this.getSessionInfoById(id);
if (knownSession == null) {
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Created new session for user.");
SessionInfo newSession = new SessionInfo();
newSession.setUserName(LOGGED_OUT);
newSession.setUserId(0);
newSession.setSessionId("-1");
this.sessions.add(newSession);
this.removeAbandonedSessions(true);
return;
}
if (updatedUser == null) {
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Following user will be logged out:");
SessionForm.logUserInformation(knownSession);
knownSession.setUserName(LOGGED_OUT);
updatedSession.setAttribute("User", LOGGED_OUT);
knownSession.setUserId(0);
this.removeAbandonedSessions(true);
return;
}
log.trace(LoginBean.LOGIN_LOG_PREFIX + "Session already exists and will be overwritten with new session.");
String name = updatedUser.getNachVorname();
int timeout = updatedUser.getSessiontimeout();
knownSession.setUserName(name);
updatedSession.setAttribute("User", name);
knownSession.setUserId(updatedUser.getId());
knownSession.setUserTimeout(timeout);
updatedSession.setMaxInactiveInterval(timeout);
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Removing old sessions...");
this.removeAbandonedSessions(true);
log.trace(LoginBean.LOGIN_LOG_PREFIX + "Sessions list is up to date.");
}
/**
* Removes all unused sessions. All sessions where the user is null, the user has no name, the user is logged out or the IP address is null, are
* unused.
*
* @param logKeptSessions Must be true to log all sessions (kept and removed) and must be false to only log removed sessions.
*/
private void removeAbandonedSessions(boolean logKeptSessions) {
int index = 0;
while (index < this.sessions.size()) {
SessionInfo session = this.sessions.get(index);
String userName = session.getUserName();
long userTimeout = (session.getUserTimeout());
long loginTimestamp = (session.getLastAccessTimestamp());
long now = System.currentTimeMillis();
long sessionDuration = (now - loginTimestamp) / 1000;
String counter = (index + 1) + "/" + this.sessions.size();
StringBuilder message = new StringBuilder();
message.append("Session " + counter);
message.append("\n- login name: " + userName);
message.append("\n- browser: " + session.getBrowserName());
message.append("\n- ip address: " + session.getUserIpAddress());
message.append("\n- timeout: " + userTimeout + " seconds");
message.append("\n- last access: " + sessionDuration + " seconds");
message.append("\n- session id: " + session.getSessionId());
boolean overTimeout = sessionDuration > userTimeout;
// sessionDuration > 0 is needed to not remove the login screen while the user logs in
boolean loggedOut = LOGGED_OUT.equals(userName) || (NOT_LOGGED_IN.equals(userName) && sessionDuration > 0);
boolean noAddress = session.getUserIpAddress() == null;
if (overTimeout || loggedOut || noAddress) {
if (overTimeout) {
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Following user will be logged out because timeout is exceeded:");
log.debug(LoginBean.LOGIN_LOG_PREFIX + "User name: " + session.getUserName());
}
message.append("\nSession " + counter + " will be removed because timeout is exceeded or session is abandoned.");
log.trace(message.toString());
this.sessions.remove(index);
} else {
message.append("\nSession " + counter + " is valid and is kept in the sessions list.");
if (logKeptSessions) {
log.trace(message.toString());
}
index++;
}
}
}
/**
* Prints the login name, the first name and the last name of the user in the given session object to the debug log output. If the user is
* unknown, no log is printed.
*
* @param session The object that contains the session information and the user information
*/
public static void logUserInformation(SessionInfo session) {
try {
User user = UserManager.getUserById(session.getUserId());
if (user == null) {
return;
}
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Login name: " + user.getLogin());
log.debug(LoginBean.LOGIN_LOG_PREFIX + "First name: " + user.getVorname());
log.debug(LoginBean.LOGIN_LOG_PREFIX + "Last name: " + user.getNachname());
} catch (DAOException daoException) {
log.trace(daoException);
}
}
/**
* Returns the current time, formatted as HH:MM:SS
*
* @return The current time as string representation
*/
public String getCurrentTime() {
return timeFormatter.format(new Date());
}
/**
* Returns the current date and time in dependence of the current locale settings
*
* @return The formatted date string
*/
public String getDate() {
if (dateFormatter == null) {
Locale language = Locale.ENGLISH;
SpracheForm sf = Helper.getLanguageBean();
if (sf != null) {
language = sf.getLocale();
}
dateFormatter = new SimpleDateFormat("EEEE', ' dd. MMMM yyyy", language);
}
return dateFormatter.format(new Date());
}
/**
* Sets the logout message
*
* @param message The new logout message
*/
public void setLogoutMessage(String message) {
this.logoutMessage = message;
this.publishAdminMessage();
}
public String sendLogoutMessage() {
return "admin";
}
public void publishAdminMessage() {
adminMessageChannel.send("update");
}
}
| 15,988
|
Java
|
.java
|
intranda/goobi-workflow
| 52
| 25
| 2
|
2016-01-28T12:30:02Z
|
2024-05-08T13:59:52Z
|
74483599ca6a6d971a3c3470b18982e0417e9e2b4efea9a8aa96ccdebdc5001f
|
[] |
[
1337,
428,
51,
1133,
51,
41608,
6539,
51,
8543,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
897,
51,
41033,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
222,
485,
3698,
51,
19269,
51,
1834,
51,
2743,
21791,
64,
222,
485,
3698,
51,
10287,
51,
8836,
64,
222,
485,
3698,
51,
10287,
51,
11061,
64,
222,
485,
3698,
51,
10010,
51,
544,
51,
18804,
64,
222,
485,
3698,
51,
10010,
51,
544,
51,
2233,
3152,
64,
222,
222,
485,
1105,
51,
41608,
6539,
51,
9580,
51,
9611,
64,
222,
485,
1105,
51,
41608,
6539,
51,
9580,
51,
3152,
1139,
64,
222,
485,
1105,
51,
41608,
6539,
51,
9580,
51,
1259,
64,
222,
485,
1105,
51,
41608,
6539,
51,
41608,
6539,
3223,
51,
76,
623,
6539,
3223,
1590,
64,
222,
485,
1105,
51,
41608,
6539,
51,
12268,
9580,
51,
5333,
5358,
64,
222,
485,
1105,
51,
437,
115,
344,
2576,
51,
104,
1351,
51,
8101,
64,
222,
485,
1105,
51,
437,
115,
344,
2576,
51,
104,
1351,
51,
8101,
1237,
64,
222,
222,
485,
428,
51,
1133,
51,
41608,
6539,
51,
1180,
51,
2339,
2775,
64,
222,
485,
428,
51,
1133,
51,
41608,
6539,
51,
4328,
51,
2775,
64,
222,
485,
428,
51,
1133,
51,
41608,
6539,
51,
4328,
51,
11453,
51,
12909,
1002,
64,
222,
485,
428,
51,
1133,
51,
41608,
6539,
51,
10782,
51,
35276,
51,
1259,
1590,
64,
222,
485,
13243,
51,
11722,
64,
222,
485,
13243,
51,
16923,
64,
222,
485,
13243,
51,
4334,
51,
769,
57,
111,
51,
1353,
57,
111,
55,
64,
222,
222,
1350,
222,
338,
1369,
822,
458,
1760,
451,
341,
590,
623,
6539,
6700,
449,
331,
21275,
4572,
456,
341,
2208,
451,
12777,
17121,
1668,
51,
222,
338,
1676,
338,
23319,
341,
35419,
456,
1851,
2490,
51,
449,
1698,
574,
41608,
6539,
51,
735,
449,
1698,
574,
1516,
51,
13210,
16932,
51,
527,
449,
1698,
574,
951,
51,
527,
52,
13210,
16932,
52,
41608,
6539,
50,
9888,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
341,
7834,
222,
338,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
6367,
4345,
244,
58,
62,
222,
338,
38849,
17693,
49,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
15067,
222,
338,
1676,
338,
6130,
318,
477,
4277,
924,
1266,
575,
22530,
642,
1623,
7912,
458,
9046,
331,
17011,
1409,
4148,
563,
477,
4277,
51,
23245,
49,
341,
5974,
480,
5496,
222,
338,
451,
341,
6994,
6153,
5062,
1196,
6399,
341,
9859,
16619,
51,
2915,
331,
7472,
3773,
49,
341,
5550,
7649,
502,
451,
477,
4277,
7651,
863,
6504,
391,
222,
338,
2572,
477,
4277,
642,
16403,
7912,
391,
13909,
619,
15020,
49,
23270,
451,
341,
3553,
5974,
451,
3301,
16403,
7912,
49,
480,
391,
1948,
480,
222,
338,
11915,
341,
14341,
15020,
1549,
5974,
451,
1390,
11704,
49,
3961,
708,
863,
2353,
18457,
49,
456,
2531,
12258,
16403,
2313,
49,
341,
5974,
480,
222,
338,
5496,
451,
341,
3553,
451,
708,
2313,
51,
2262,
16403,
2313,
458,
331,
2313,
1532,
458,
666,
12015,
664,
575,
4148,
563,
477,
4277,
51,
1691,
863,
5370,
477,
222,
338,
4277,
49,
863,
1648,
12385,
477,
3773,
391,
1390,
1522,
451,
341,
4277,
49,
1294,
863,
904,
666,
1541,
393,
3899,
391,
764,
1278,
51,
1691,
863,
764,
666,
15873,
391,
764,
1278,
49,
3081,
477,
222,
338,
3773,
7627,
664,
1390,
1522,
51,
222,
338,
1676,
338,
15326,
1242,
48537,
6555,
1260,
9620,
5554,
18507,
103,
1461,
18507,
4044,
18571,
359,
629,
2143,
41117,
377,
20843,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
696,
1387,
656,
314,
127,
222,
338,
496,
2133,
507,
9815,
584,
507,
359,
28935,
222,
338,
496,
1687,
244,
54,
51,
53,
53,
449,
244,
54,
59,
51,
53,
54,
51,
55,
53,
53,
58,
222,
338,
496,
1687,
244,
55,
51,
53,
53,
449,
244,
53,
56,
51,
53,
58,
51,
55,
53,
55,
54,
222,
588,
222,
222,
69,
1353,
57,
111,
55,
222,
69,
11061,
459,
3152,
1260,
678,
222,
69,
2743,
21791,
222,
942,
462,
6555,
1260,
4584,
19182,
320,
465,
1041,
294,
338,
906,
1522,
828,
456,
4569,
6206,
13209,
294,
588,
303,
964,
924,
1175,
1964,
19896,
299,
244,
61,
57,
58,
60,
62,
57,
60,
57,
55,
53,
55,
56,
55,
53,
58,
57,
55,
55,
60,
81,
64,
465,
1041,
294,
338,
906,
8100,
821,
391,
14197,
708,
331,
1275,
458,
12950,
986,
294,
588,
303,
581,
924,
1175,
910,
5784,
35311,
100,
4256,
299,
332,
449,
34607,
769,
1855,
449,
7216,
465,
1041,
294,
338,
906,
8100,
821,
391,
14197,
708,
331,
1275,
458,
666,
12950,
347,
6234,
2483,
294,
588,
303,
581,
924,
1175,
910,
2387,
100,
3612,
35311,
100,
540,
299,
332,
449,
7216,
465,
1041,
294,
338,
906,
1168,
451,
1565,
20987,
327,
27970,
337,
829,
6555,
1139,
4706,
46,
294,
588,
303,
964,
1701,
65,
3152,
1139,
67,
20987,
299,
15490,
51,
34508,
739,
45,
909,
5068,
13366,
1052,
465,
1041,
294,
338,
906,
14975,
708,
458,
1674,
456,
1153,
10323,
5872,
294,
588,
303,
964,
27194,
1153,
8748,
299,
556,
27194,
459,
13009,
63,
2861,
63,
441,
742,
465,
1041,
294,
338,
906,
14975,
708
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
17011,
1409,
4148,
563,
477,
4277,
51,
23245,
49,
341,
5974,
480,
5496,
222,
338,
451,
341,
6994,
6153,
5062,
1196,
6399,
341,
9859,
16619,
51,
2915,
331,
7472,
3773,
49,
341,
5550,
7649,
502,
451,
477,
4277,
7651,
863,
6504,
391,
222,
338,
2572,
477,
4277,
642,
16403,
7912,
391,
13909,
619,
15020,
49,
23270,
451,
341,
3553,
5974,
451,
3301,
16403,
7912,
49,
480,
391,
1948,
480,
222,
338,
11915,
341,
14341,
15020,
1549,
5974,
451,
1390,
11704,
49,
3961,
708,
863,
2353,
18457,
49,
456,
2531,
12258,
16403,
2313,
49,
341,
5974,
480,
222,
338,
5496,
451,
341,
3553,
451,
708,
2313,
51,
2262,
16403,
2313,
458,
331,
2313,
1532,
458,
666,
12015,
664,
575,
4148,
563,
477,
4277,
51,
1691,
863,
5370,
477,
222,
338,
4277,
49,
863,
1648,
12385,
477,
3773,
391,
1390,
1522,
451,
341,
4277,
49,
1294,
863,
904,
666,
1541,
393,
3899,
391,
764,
1278,
51,
1691,
863,
764,
666,
15873,
391,
764,
1278,
49,
3081,
477,
222,
338,
3773,
7627,
664,
1390,
1522,
51,
222,
338,
1676,
338,
15326,
1242,
48537,
6555,
1260,
9620,
5554,
18507,
103,
1461,
18507,
4044,
18571,
359,
629,
2143,
41117,
377,
20843,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
696,
1387,
656,
314,
127,
222,
338,
496,
2133,
507,
9815,
584,
507,
359,
28935,
222,
338,
496,
1687,
244,
54,
51,
53,
53,
449,
244,
54,
59,
51,
53,
54,
51,
55,
53,
53,
58,
222,
338,
496,
1687,
244,
55,
51,
53,
53,
449,
244,
53,
56,
51,
53,
58,
51,
55,
53,
55,
54,
222,
588,
222,
222,
69,
1353,
57,
111,
55,
222,
69,
11061,
459,
3152,
1260,
678,
222,
69,
2743,
21791,
222,
942,
462,
6555,
1260,
4584,
19182,
320,
465,
1041,
294,
338,
906,
1522,
828,
456,
4569,
6206
] | -8,030,977,859,108,837,000
| true
| false
| false
| false
|
[
391,
764,
1278,
51,
1691,
863,
764,
666,
15873,
391,
764,
1278,
49,
3081,
477,
222,
338,
3773,
7627,
664,
1390,
1522,
51,
222,
338,
1676,
338,
15326,
1242,
48537,
6555,
1260,
9620,
5554,
18507,
103,
1461,
18507,
4044,
18571,
359,
629,
2143,
41117,
377,
20843,
222,
338,
1676,
338,
496,
2133,
6678,
505,
291,
696,
1387,
656,
314,
127,
222,
338,
496,
2133,
507,
9815,
584,
507,
359,
28935,
222,
338,
496,
1687,
244,
54,
51,
53,
53,
449,
244,
54,
59,
51,
53,
54,
51,
55,
53,
53,
58,
222,
338,
496,
1687,
244,
55,
51,
53,
53
] | -3,982,010,551,824,625,700
| true
|
combined work based on this library. Thus, the terms and conditions
* of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to
* link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and
* conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the library, but you are not obliged to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Die Klasse SessionForm für den überblick über die aktuell offenen Sessions
*
* @author Steffen Hankiewicz
* @author Maurice Mueller
* @version 1.00 - 16.01.2005
* @version 2.00
|
to produce an executable, regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and
* conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the library, but you are not obliged to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Die Klasse SessionForm für den überblick über die aktuell offenen Sessions
*
* @author Steffen Hankiewicz
* @author Maurice Mueller
* @version 1.00 - 16.01.2005
* @version 2.00
|
the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the library, but you are not obliged to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Die Klasse SessionForm für den überblick über die aktuell offenen Sessions
*
* @author Steffen Hankiewicz
* @author Maurice Mueller
* @version 1.00 - 16.01.2005
* @version 2.00
|
to do so. If you do not wish to do so, delete this
* exception statement from your version.
*
* Die Klasse SessionForm für den überblick über die aktuell offenen Sessions
*
* @author Steffen Hankiewicz
* @author Maurice Mueller
* @version 1.00 - 16.01.2005
* @version 2.00
|
- 03.05.2021
*/
@Log4j2
@Named("SessionForm")
@ApplicationScoped
public class SessionForm implements Serializable {
/**
* The version id for serializing
|
TableBuilder.java
|
/FileExtraction/Java_unseen/tonihele_OpenKeeper/src/toniarts/openkeeper/gui/nifty/table/TableBuilder.java
|
/*
* Copyright (C) 2014-2015 OpenKeeper
*
* OpenKeeper is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenKeeper is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenKeeper. If not, see <http://www.gnu.org/licenses/>.
*/
package toniarts.openkeeper.gui.nifty.table;
import de.lessvoid.nifty.builder.ControlBuilder;
/**
* Builder for table
*
* @author Toni Helenius <helenius.toni@gmail.com>
*/
public class TableBuilder extends ControlBuilder {
public TableBuilder(final String id, final TableColumn... columns) {
super(id, "table");
// Add the columns
set("colCount", String.valueOf(columns.length));
int i = 0;
for (TableColumn col : columns) {
set("col" + i, col.toString());
i++;
}
// Some default settings
set("horizontal", "off");
set("viewConverterClass", TableRowViewConverter.class.getName());
}
public void displayItems(final int displayItems) {
set("displayItems", String.valueOf(displayItems));
}
public void selectionModeSingle() {
set("selectionMode", "Single");
}
public void selectionModeMultiple() {
set("selectionMode", "Multiple");
}
public void selectionModeDisabled() {
set("selectionMode", "Disabled");
}
public void showVerticalScrollbar() {
set("vertical", "on");
}
public void hideVerticalScrollbar() {
set("vertical", "off");
}
public void optionalVerticalScrollbar() {
set("vertical", "optional");
}
}
| 2,099
|
Java
|
.java
|
tonihele/OpenKeeper
| 424
| 41
| 72
|
2014-08-03T18:35:18Z
|
2024-03-09T10:00:41Z
|
32022869e8b909721b8da68a5f385feeb843f0ee76a2db7b5025340e0ad3a5fa
|
[] |
[
1127,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
57,
50,
55,
53,
54,
58,
3944,
27345,
222,
338,
222,
338,
3944,
27345,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
3944,
27345,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
3944,
27345,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
292,
25615,
29183,
51,
1693,
14985,
51,
8472,
51,
115,
25315,
51,
1292,
64,
222,
222,
485,
428,
51,
2290,
1134,
51,
115,
25315,
51,
4179,
51,
2436,
1812,
64,
222,
222,
1350,
222,
338,
7963,
456,
1877,
222,
338,
222,
338,
496,
2133,
413,
25615,
4025,
291,
3279,
350,
311,
1688,
3279,
51,
955,
110,
69,
7265,
51,
527,
67,
222,
588,
222,
942,
462,
5565,
1812,
2041,
7822,
1812,
320,
465,
581,
5565,
1812,
45,
3242,
910,
828,
49,
1175,
5565,
2154,
1198,
6165,
46,
320,
310,
2615,
45,
333,
49,
332,
1292,
742,
603,
453,
2242,
341,
6165,
310,
758,
459,
770,
1552,
411,
910,
51,
9169,
45,
6173,
51,
1340,
894,
310,
648,
613,
299,
244,
53,
64,
310,
456,
327,
39615,
956,
518,
6165,
46,
320,
343,
758,
459,
770,
39,
494,
613,
49,
956,
51,
3127,
1052,
343,
613,
3348,
310,
339,
603,
453,
4202,
1263,
4086,
310,
758,
459,
10634,
411,
332,
1739,
742,
310,
758,
459,
1090,
6521,
1359,
411,
5565,
2368,
1089,
6521,
51,
842,
51,
5175,
1052,
303,
339,
465,
581,
782,
2540,
3648,
45,
3242,
648,
2540,
3648,
46,
320,
310,
758,
459,
2784,
3648,
411,
910,
51,
9169,
45,
2784,
3648,
894,
303,
339,
465,
581,
782,
7818,
2116,
6284,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
6284,
742,
303,
339,
465,
581,
782,
7818,
2116,
11727,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11727,
742,
303,
339,
465,
581,
782,
7818,
2116,
11698,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11698,
742,
303,
339,
465,
581,
782,
2539,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
286,
742,
303,
339,
465,
581,
782,
10618,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
1739,
742,
303,
339,
465,
581,
782,
5316,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
5311,
742,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 495
|
[
222,
485,
428,
51,
2290,
1134,
51,
115,
25315,
51,
4179,
51,
2436,
1812,
64,
222,
222,
1350,
222,
338,
7963,
456,
1877,
222,
338,
222,
338,
496,
2133,
413,
25615,
4025,
291,
3279,
350,
311,
1688,
3279,
51,
955,
110,
69,
7265,
51,
527,
67,
222,
588,
222,
942,
462,
5565,
1812,
2041,
7822,
1812,
320,
465,
581,
5565,
1812,
45,
3242,
910,
828,
49,
1175,
5565,
2154,
1198,
6165,
46,
320,
310,
2615,
45,
333,
49,
332,
1292,
742,
603,
453,
2242,
341,
6165,
310,
758,
459,
770,
1552,
411,
910,
51,
9169,
45,
6173,
51,
1340,
894,
310,
648,
613,
299,
244,
53,
64,
310,
456,
327,
39615,
956,
518,
6165,
46,
320,
343,
758,
459,
770,
39,
494,
613,
49,
956,
51,
3127,
1052,
343,
613,
3348,
310,
339,
603,
453,
4202,
1263,
4086,
310,
758,
459,
10634,
411,
332,
1739,
742,
310,
758,
459,
1090,
6521,
1359,
411,
5565,
2368,
1089,
6521,
51,
842,
51,
5175,
1052,
303,
339,
465,
581,
782,
2540,
3648,
45,
3242,
648,
2540,
3648,
46,
320,
310,
758,
459,
2784,
3648,
411,
910,
51,
9169,
45,
2784,
3648,
894,
303,
339,
465,
581,
782,
7818,
2116,
6284,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
6284,
742,
303,
339,
465,
581,
782,
7818,
2116,
11727,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11727,
742,
303,
339,
465,
581,
782,
7818,
2116,
11698,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11698,
742,
303,
339,
465,
581,
782,
2539,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
286,
742,
303,
339,
465,
581,
782,
10618,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
1739,
742,
303,
339,
465,
581,
782,
5316,
11916,
36458,
365,
320,
310,
758,
459,
10160,
411,
332,
5311,
742
] | -6,104,082,072,153,939,000
| true
| false
| false
| false
|
[
6521,
1359,
411,
5565,
2368,
1089,
6521,
51,
842,
51,
5175,
1052,
303,
339,
465,
581,
782,
2540,
3648,
45,
3242,
648,
2540,
3648,
46,
320,
310,
758,
459,
2784,
3648,
411,
910,
51,
9169,
45,
2784,
3648,
894,
303,
339,
465,
581,
782,
7818,
2116,
6284,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
6284,
742,
303,
339,
465,
581,
782,
7818,
2116,
11727,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11727,
742,
303,
339,
465,
581,
782,
7818,
2116,
11698,
365,
320,
310,
758,
459,
8402,
2116,
411,
332,
11698,
742,
303,
339,
465,
581
] | -2,601,574,355,906,059,300
| true
|
import de.lessvoid.nifty.builder.ControlBuilder;
/**
* Builder for table
*
* @author Toni Helenius <helenius.toni@gmail.com>
*/
public class TableBuilder extends ControlBuilder {
public TableBuilder(final String id, final TableColumn... columns) {
super(id, "table");
// Add the columns
set("colCount", String.valueOf(columns.length));
int i = 0;
for (TableColumn col : columns) {
set("col" + i, col.toString());
i++;
}
// Some default settings
set("horizontal", "off");
set("viewConverterClass", TableRowViewConverter.class.getName());
}
public void displayItems(final int displayItems) {
set("displayItems", String.valueOf(displayItems));
}
public void selectionModeSingle() {
set("selectionMode", "Single");
}
public void selectionModeMultiple() {
set("selectionMode", "Multiple");
}
public void selectionModeDisabled() {
set("selectionMode", "Disabled");
}
public
|
class TableBuilder extends ControlBuilder {
public TableBuilder(final String id, final TableColumn... columns) {
super(id, "table");
// Add the columns
set("colCount", String.valueOf(columns.length));
int i = 0;
for (TableColumn col : columns) {
set("col" + i, col.toString());
i++;
}
// Some default settings
set("horizontal", "off");
set("viewConverterClass", TableRowViewConverter.class.getName());
}
public void displayItems(final int displayItems) {
set("displayItems", String.valueOf(displayItems));
}
public void selectionModeSingle() {
set("selectionMode", "Single");
}
public void selectionModeMultiple() {
set("selectionMode", "Multiple");
}
public void selectionModeDisabled() {
set("selectionMode", "Disabled");
}
public
|
int i = 0;
for (TableColumn col : columns) {
set("col" + i, col.toString());
i++;
}
// Some default settings
set("horizontal", "off");
set("viewConverterClass", TableRowViewConverter.class.getName());
}
public void displayItems(final int displayItems) {
set("displayItems", String.valueOf(displayItems));
}
public void selectionModeSingle() {
set("selectionMode", "Single");
}
public void selectionModeMultiple() {
set("selectionMode", "Multiple");
}
public void selectionModeDisabled() {
set("selectionMode", "Disabled");
}
public
|
ConverterClass", TableRowViewConverter.class.getName());
}
public void displayItems(final int displayItems) {
set("displayItems", String.valueOf(displayItems));
}
public void selectionModeSingle() {
set("selectionMode", "Single");
}
public void selectionModeMultiple() {
set("selectionMode", "Multiple");
}
public void selectionModeDisabled() {
set("selectionMode", "Disabled");
}
public
|
void showVerticalScrollbar() {
set("vertical", "on");
}
public void hideVerticalScrollbar() {
set("vertical", "off");
}
public void optionalVerticalScrollbar() {
set("vertical", "optional");
|
Hamburg.java
|
/FileExtraction/Java_unseen/texttechnologylab_GerParCor/Java/src/main/java/org/texttechnologylab/parliament/crawler/divisions/germany/Hamburg.java
|
package org.texttechnologylab.parliament.crawler.divisions.germany;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.texttechnologylab.utilities.helper.FileUtils;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
/**
* Class for Parsing Minutes of Hamburg
* @author Giuseppe Abrami
* @date 2021-12-01
*/
public class Hamburg {
public static void main(String[] args) throws IOException {
String sBaseURL = "https://www.buergerschaft-hh.de";
String outPath = args[0];
new File(outPath).mkdir();
AtomicBoolean hasError = new AtomicBoolean(false);
int a=37;
int iPeriode = 22;
while(!hasError.get()) {
new File(outPath+""+iPeriode).mkdir();
Map<String, String> params = new HashMap<>();
params.put("DokumentenArtId", "2");
params.put("LegislaturPeriodenNummer", ""+iPeriode);
params.put("DokumentenNummer", ""+a);
params.put("AFHTOKE", "W2fLQQ4EhRSHTX4Ioe+zAH2V28HvsSrNOXRrKpZUSk/K7ozL19h/0z95qmklTMSqr30Yr74sGBfrNDjHxK0aD89y6jz46jSWjtOAw4Up09iUS3rO25DIcBLbBgyIv9t8oGO1cM6233OLBIQ7Twg1R0+wm/X2Vwp41ETg7Vc8tK9XUwex1iu3j5V77PKd/L8VcUtaMFu7xGPyGb376HftthcD2nJY6hQubvTbIdmC5j2ebE8cQ35PQe9XkAPYvT0vaeaN38gBBdMeFI980NGbtb1twrWEORaomOzI+zHEQMJMwqiVgz7b/j5UxGsZVDiTApD1nk9k1To=");
Map<String, String> cookies = new HashMap<>(0);
cookies.put("ASP.NET_SessionId", "0u05ocgjqa4h2kt1drpzlanl");
cookies.put("cookieokay", "true");
cookies.put("HASH_ASP.NET_SessionId", "6B54B4C4762559FB936CC1645AAE92CBEB63812E");
try {
Document pDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer").followRedirects(true).cookies(cookies).data(params).post();
Document dataDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer/1").cookies(cookies).data(params).followRedirects(true).get();
try {
Thread.sleep(1000l);
}
catch (Exception e){
System.out.println(e.getMessage());
}
AtomicReference<String> sURI = new AtomicReference<>("");
AtomicReference<String> sName = new AtomicReference<>("");
AtomicReference<String> sDatum = new AtomicReference<>("");
dataDocument.select("table#parldokresult tr").stream().forEach(d -> {
System.out.println(d.text());
d.select("td").stream().forEach(d1 -> {
d1.select("a").stream().forEach(href->{
if(href.attr("href").endsWith(".pdf")){
sURI.set(href.attr("href"));
}
});
if (d1.attr("headers").equals("result-nummer")) {
sName.set(d1.text());
}
if (d1.attr("headers").equals("result-datum")) {
sDatum.set(d1.text());
}
if(sDatum.get().length()>0 && sName.get().length()>0 && sURI.get().length()>0){
String tName = sName.get();
tName = tName.substring(tName.indexOf("/")+1);
File dFile = new File(outPath+""+iPeriode+"/"+tName+"_"+sDatum.get()+".pdf");
try {
if(!dFile.exists()) {
FileUtils.downloadFile(dFile, sBaseURL + "" + sURI.get());
hasError.set(false);
}
} catch (IOException e) {
hasError.set(true);
throw new RuntimeException(e);
}
finally {
sDatum.set("");
sName.set("");
sURI.set("");
}
}
});
});
a++;
// System.out.println(dataDocument);
} catch (Exception e) {
System.out.println(e.getMessage());
hasError.set(true);
}
}
}
}
| 4,680
|
Java
|
.java
|
texttechnologylab/GerParCor
| 20
| 7
| 1
|
2022-01-13T16:54:26Z
|
2024-03-15T00:38:39Z
|
018f3c92d1561557a69c107cc084d5d780b394b5899b81d65197de8609fb09c9
|
[] |
[
1337,
1105,
51,
897,
19151,
4809,
51,
587,
46226,
51,
33407,
51,
526,
14726,
51,
892,
11412,
64,
222,
222,
485,
1105,
51,
773,
48610,
51,
79,
30567,
64,
222,
485,
1105,
51,
773,
48610,
51,
5484,
51,
3112,
64,
222,
485,
1105,
51,
897,
19151,
4809,
51,
16092,
51,
4328,
51,
39463,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
4718,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
3580,
64,
222,
222,
1350,
222,
338,
1727,
456,
39119,
7535,
3699,
451,
696,
30788,
108,
222,
338,
496,
2133,
590,
110,
558,
117,
367,
418,
858,
12417,
222,
338,
496,
787,
244,
55,
53,
55,
54,
50,
54,
55,
50,
53,
54,
222,
588,
222,
942,
462,
696,
30788,
108,
320,
465,
581,
924,
782,
2594,
45,
671,
1197,
2194,
46,
2589,
6300,
320,
603,
910,
328,
1778,
2427,
299,
332,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
884,
603,
910,
986,
1233,
299,
2194,
96,
53,
988,
310,
556,
2050,
45,
560,
1233,
566,
10211,
492,
310,
16181,
4718,
47552,
299,
556,
16181,
4718,
45,
1886,
312,
310,
648,
331,
66,
56,
60,
64,
310,
648,
613,
1852,
110,
421,
299,
244,
55,
55,
64,
310,
2236,
3848,
2057,
943,
51,
390,
1177,
320,
1083,
556,
2050,
45,
560,
1233,
48,
1033,
48,
110,
1852,
110,
421,
566,
10211,
492,
1083,
3531,
65,
671,
49,
910,
67,
2822,
299,
556,
8329,
6984,
343,
2822,
51,
543,
459,
73,
29030,
291,
5281,
625,
411,
332,
55,
742,
343,
2822,
51,
543,
459,
12290,
316,
4520,
324,
7762,
291,
2585,
2322,
411,
3347,
48,
110,
1852,
110,
421,
312,
343,
2822,
51,
543,
459,
73,
29030,
291,
2585,
2322,
411,
3347,
48,
102,
312,
343,
2822,
51,
543,
459,
5999,
77,
1425,
2241,
411,
332,
92,
55,
107,
81,
14626,
57,
44007,
10187,
1971,
93,
57,
12092,
106,
48,
127,
10968,
55,
91,
55,
61,
77,
4876,
27336,
2593,
9735,
119,
44500,
95,
2062,
112,
52,
80,
60,
21037,
81,
54,
62,
109,
52,
53,
127,
62,
58,
118,
4785,
113,
89,
2758,
13652,
56,
53,
38760,
60,
57,
120,
3947,
2197,
9116,
111,
39319,
80,
53,
102,
73,
61,
62,
126,
59,
30661,
57,
59,
111,
5696,
23834,
84,
12549,
57,
1405,
53,
62,
110,
2062,
56,
119,
84,
55,
58,
1740,
104,
5165,
103,
71,
4701,
31810,
62,
121,
61,
116,
7001,
54,
44183,
59,
55,
56,
56,
1767,
10037,
86,
60,
10328,
108,
54,
87,
53,
48,
13900,
52,
93,
55,
91,
5180,
57,
54,
1235,
108,
60,
31811,
61,
121,
80,
62,
93,
33079,
346,
54,
20537,
56,
111,
58,
91,
60,
60,
8890,
105,
52,
81,
61,
31811,
90,
1371,
13148,
122,
60,
125,
76,
5019,
36706,
56,
60,
59,
77,
726,
368,
104,
73,
55,
115,
37408,
59,
109,
86,
375,
123,
27327,
625,
114,
72,
58,
111,
55,
891,
74,
61,
104,
86,
56,
58,
27824,
106,
62,
46629,
1910,
94,
123,
89,
53,
123,
3657,
8385,
56,
61,
108,
5117,
105,
1451,
1836,
62,
61,
53,
7493,
103,
7180,
54,
4176,
119,
4656,
776,
102,
437,
44441,
78,
48,
127,
1692,
86,
24814,
34369,
16384,
91,
6756,
60,
103,
52,
111,
58,
28244,
33509,
36869,
2844,
89,
3825,
73,
54,
19893,
62,
112,
54,
724,
31503,
1083,
3531,
65,
671,
49,
910,
67,
21006,
299,
556,
8329,
11530,
53,
312,
343,
21006,
51,
543,
459,
28142,
51,
4782,
100,
34462,
411,
332,
53,
122,
53,
58,
561,
32201,
9503,
57,
109,
55,
4455,
54,
3529,
31718,
6889,
113,
742,
343,
21006,
51,
543,
459,
9532,
1273,
414,
411,
332,
1527,
742,
343,
21006,
51,
543,
459,
15622,
100,
28142,
51,
4782,
100,
34462,
411,
332,
59,
71,
58,
57,
71,
57,
72,
57,
60,
59,
55,
58,
58,
62,
9547,
62,
56,
59,
2218,
54,
59,
57,
58,
2162,
74,
62,
55,
72,
4671,
71,
59,
56,
61,
54,
55,
74,
742,
1083,
1614,
320,
419,
6222,
317,
3112,
299,
990,
30567,
51,
3532,
459,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
1912,
10762,
11446,
120,
45,
1527,
566,
21304,
45,
21304,
566,
624,
45,
2155,
566,
1545,
492,
2125,
6222,
727,
3112,
299,
990,
30567,
51,
3532,
459,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
52,
54,
1912,
21304,
45,
21304,
566,
624,
45,
2155,
566,
10762,
11446,
120,
45,
1527,
566,
390,
492,
2125,
1614,
320,
547,
7806,
51,
7860,
45,
54,
53,
53,
53,
113,
312,
419,
339,
419,
2385,
327,
1002,
503,
1528,
547,
1189,
51,
560,
51,
3962,
45,
106,
51,
7724,
1052,
419,
339,
2125,
16181,
3580,
65,
671,
67,
328,
6344,
299,
556,
16181,
3580,
65,
9486,
742,
419,
16181,
3580,
65,
671,
67,
328,
577,
299,
556,
16181,
3580,
65,
9486,
742,
419,
16181,
3580,
65,
671,
67,
328,
22850,
299,
556,
16181,
3580,
65,
9486,
742,
419,
727,
3112,
51,
1632,
459,
1292,
40,
587,
1400,
1273,
1285,
573,
1912,
2255,
941,
5388,
45,
105,
984,
320,
547,
1189,
51,
560,
51,
3962,
45,
105,
51,
897,
1052,
3704,
362,
51,
1632,
459,
689,
1912,
2255,
941,
5388,
45,
105,
54,
984,
320,
6205,
362,
54,
51,
1632,
459,
102,
1912,
2255,
941,
5388,
45,
6935,
8974,
1031,
434,
45,
6935,
51,
2456,
459,
6935,
1912,
20982,
5804,
4710,
21133,
1396,
328,
6344,
51,
489,
45,
6935,
51,
2456,
459,
6935,
2992,
1031,
339,
733,
1141,
6205,
434,
327,
105,
54,
51,
2456,
459,
5090,
1912,
3591,
459,
1285,
50,
43927,
2152,
320,
1031,
328,
577,
51,
489,
45,
105,
54,
51,
897,
1052,
733,
339,
733,
434,
327,
105,
54,
51,
2456,
459,
5090,
1912,
3591,
459,
1285,
50,
23912,
2152,
320,
1031,
328,
22850,
51,
489,
45,
105,
54,
51,
897
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
48,
127,
1692,
86,
24814,
34369,
16384,
91,
6756,
60,
103,
52,
111,
58,
28244,
33509,
36869,
2844,
89,
3825,
73,
54,
19893,
62,
112,
54,
724,
31503,
1083,
3531,
65,
671,
49,
910,
67,
21006,
299,
556,
8329,
11530,
53,
312,
343,
21006,
51,
543,
459,
28142,
51,
4782,
100,
34462,
411,
332,
53,
122,
53,
58,
561,
32201,
9503,
57,
109,
55,
4455,
54,
3529,
31718,
6889,
113,
742,
343,
21006,
51,
543,
459,
9532,
1273,
414,
411,
332,
1527,
742,
343,
21006,
51,
543,
459,
15622,
100,
28142,
51,
4782,
100,
34462,
411,
332,
59,
71,
58,
57,
71,
57,
72,
57,
60,
59,
55,
58,
58,
62,
9547,
62,
56,
59,
2218,
54,
59,
57,
58,
2162,
74,
62,
55,
72,
4671,
71,
59,
56,
61,
54,
55,
74,
742,
1083,
1614,
320,
419,
6222,
317,
3112,
299,
990,
30567,
51,
3532,
459,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
1912,
10762,
11446,
120,
45,
1527,
566,
21304,
45,
21304,
566,
624,
45,
2155,
566,
1545,
492,
2125,
6222,
727,
3112,
299,
990,
30567,
51,
3532,
459,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
52,
54,
1912,
21304,
45,
21304,
566,
624,
45,
2155,
566,
10762,
11446,
120,
45,
1527,
566,
390,
492,
2125,
1614,
320,
547,
7806,
51,
7860,
45,
54,
53,
53,
53,
113,
312,
419,
339,
419,
2385,
327,
1002,
503,
1528,
547,
1189,
51,
560,
51,
3962,
45,
106,
51,
7724,
1052,
419,
339,
2125,
16181,
3580,
65,
671,
67,
328,
6344,
299,
556,
16181,
3580,
65,
9486,
742,
419,
16181,
3580,
65,
671,
67,
328,
577,
299,
556,
16181,
3580,
65,
9486,
742
] | 8,356,423,789,464,586,000
| true
| false
| false
| false
|
[
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
1912,
10762,
11446,
120,
45,
1527,
566,
21304,
45,
21304,
566,
624,
45,
2155,
566,
1545,
492,
2125,
6222,
727,
3112,
299,
990,
30567,
51,
3532,
459,
662,
574,
1516,
51,
716,
284,
8002,
25493,
50,
10441,
51,
305,
52,
587,
1400,
1273,
52,
105,
29030,
291,
43927,
52,
54,
1912,
21304,
45,
21304,
566,
624,
45,
2155,
566,
10762,
11446,
120,
45,
1527,
566,
390,
492,
2125,
1614,
320,
547,
7806,
51,
7860,
45,
54,
53,
53,
53,
113,
312,
419
] | 507,951,615,967,826,050
| true
|
+zHEQMJMwqiVgz7b/j5UxGsZVDiTApD1nk9k1To=");
Map<String, String> cookies = new HashMap<>(0);
cookies.put("ASP.NET_SessionId", "0u05ocgjqa4h2kt1drpzlanl");
cookies.put("cookieokay", "true");
cookies.put("HASH_ASP.NET_SessionId", "6B54B4C4762559FB936CC1645AAE92CBEB63812E");
try {
Document pDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer").followRedirects(true).cookies(cookies).data(params).post();
Document dataDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer/1").cookies(cookies).data(params).followRedirects(true).get();
try {
Thread.sleep(1000l);
|
_SessionId", "0u05ocgjqa4h2kt1drpzlanl");
cookies.put("cookieokay", "true");
cookies.put("HASH_ASP.NET_SessionId", "6B54B4C4762559FB936CC1645AAE92CBEB63812E");
try {
Document pDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer").followRedirects(true).cookies(cookies).data(params).post();
Document dataDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer/1").cookies(cookies).data(params).followRedirects(true).get();
try {
Thread.sleep(1000l);
|
4B4C4762559FB936CC1645AAE92CBEB63812E");
try {
Document pDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer").followRedirects(true).cookies(cookies).data(params).post();
Document dataDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer/1").cookies(cookies).data(params).followRedirects(true).get();
try {
Thread.sleep(1000l);
|
.buergerschaft-hh.de/parldok/dokumentennummer").followRedirects(true).cookies(cookies).data(params).post();
Document dataDocument = Jsoup.connect("https://www.buergerschaft-hh.de/parldok/dokumentennummer/1").cookies(cookies).data(params).followRedirects(true).get();
try {
Thread.sleep(1000l);
|
}
catch (Exception e){
System.out.println(e.getMessage());
}
AtomicReference<String> sURI = new AtomicReference<>("");
AtomicReference<String> sName = new AtomicReference<>("");
|
SessionMap.java
|
/FileExtraction/Java_unseen/open-xchange_appsuite-middleware/com.openexchange.sessiond/src/com/openexchange/sessiond/impl/util/SessionMap.java
|
/*
* @copyright Copyright (c) OX Software GmbH, Germany <info@open-xchange.com>
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
*
* Any use of the work other than as authorized under this license or copyright law is prohibited.
*
*/
package com.openexchange.sessiond.impl.util;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.openexchange.session.Session;
import com.openexchange.sessiond.impl.container.SessionControl;
/**
* {@link SessionMap} - The thread-safe map for session identifier mappings and more.
*
* @author <a href="mailto:thorben.betten@open-xchange.com">Thorben Betten</a>
*/
public final class SessionMap<S extends SessionControl> {
private final ConcurrentMap<String, S> sessionIdMap;
private final ConcurrentMap<String, S> alternativeIdMap;
/**
* Initializes a new {@link SessionMap}.
*/
public SessionMap() {
this(1024);
}
/**
* Initializes a new {@link SessionMap}.
*
* @param initialCapacity The initial map's capacity
*/
public SessionMap(final int initialCapacity) {
super();
sessionIdMap = new ConcurrentHashMap<String, S>(initialCapacity, 0.75f, 1);
alternativeIdMap = new ConcurrentHashMap<String, S>(initialCapacity, 0.75f, 1);
}
// -------------------------------------------------------------------------------
/**
* Gets the map's size.
*
* @return The size
*/
public int size() {
return sessionIdMap.size();
}
// -------------------------------------------------------------------------------
/**
* Checks for presence of a session associated with given session identifier.
*
* @param sessionId The session identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsBySessionId(final String sessionId) {
return sessionIdMap.containsKey(sessionId);
}
/**
* Checks for presence of a session associated with given alternative identifier.
*
* @param altId The alternative identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsByAlternativeId(final String altId) {
return alternativeIdMap.containsKey(altId);
}
// -------------------------------------------------------------------------------
/**
* Gets the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The associated session or <code>null</code> if absent
*/
public S getBySessionId(final String sessionId) {
return sessionIdMap.get(sessionId);
}
/**
* Gets the session associated with specified alternative identifier.
*
* @param altId The alternative identifier
* @return The associated session or <code>null</code> if absent
*/
public S getByAlternativeId(final String altId) {
return alternativeIdMap.get(altId);
}
// -------------------------------------------------------------------------------
/**
* Puts specified session into this map.
*
* @param sessionId The session identifier
* @param session The session to put
* @return The session already associated with given session identifier that has been replaced or <code>null</code> if nothing replaced
*/
public S putBySessionId(final String sessionId, final S session) {
S prev = sessionIdMap.put(sessionId, session);
if (null != prev) {
String prevAltId = (String) prev.getSession().getParameter(Session.PARAM_ALTERNATIVE_ID);
if (null != prevAltId) {
alternativeIdMap.remove(prevAltId);
}
}
String altId = (String) session.getSession().getParameter(Session.PARAM_ALTERNATIVE_ID);
if (null != altId) {
alternativeIdMap.put(altId, session);
}
return prev;
}
// -------------------------------------------------------------------------------
/**
* Puts specified session into this map if no session is already associated with given session identifier.
*
* @param sessionId The session identifier
* @param session The session to put
* @return The session already associated with given session identifier or <code>null</code> on successful put
*/
public S putIfAbsentBySessionId(final String sessionId, final S session) {
S prev = sessionIdMap.putIfAbsent(sessionId, session);
if (null != prev) {
return prev;
}
String altId = (String) session.getSession().getParameter(Session.PARAM_ALTERNATIVE_ID);
if (null != altId) {
alternativeIdMap.put(altId, session);
}
return null;
}
// -------------------------------------------------------------------------------
/**
* Removes the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The possibly removed session or <code>null</code>
*/
public S removeBySessionId(final String sessionId) {
S session = sessionIdMap.remove(sessionId);
if (null != session) {
final String altId = (String) session.getSession().getParameter(Session.PARAM_ALTERNATIVE_ID);
if (null != altId) {
alternativeIdMap.remove(altId);
}
}
return session;
}
// -------------------------------------------------------------------------------
/**
* Returns an unmodifable {@link Collection} view of the sessions contained in this map.
*
* @return The unmodifable {@link Collection} view of the sessions contained in this map
*/
public Collection<S> values() {
return Collections.unmodifiableCollection(sessionIdMap.values());
}
/**
* Returns an unmodifable {@link Collection} view of the session identifiers contained in this map.
*
* @return The unmodifable {@link Collection} view of the sessions identifiers contained in this map
*/
public Set<String> keys() {
return Collections.unmodifiableSet(sessionIdMap.keySet());
}
}
| 7,078
|
Java
|
.java
|
open-xchange/appsuite-middleware
| 11
| 8
| 0
|
2018-11-16T10:18:56Z
|
2022-11-14T14:03:46Z
|
75759e1fb690b402ce302b52244b16db3de909f4e3e5afef17e080d25ec284d1
|
[] |
[
1127,
222,
338,
496,
11793,
2657,
327,
104,
46,
565,
93,
3870,
34723,
49,
44851,
350,
1357,
69,
1693,
50,
125,
2357,
51,
527,
67,
222,
338,
496,
2094,
418,
21156,
50,
56,
51,
53,
222,
338,
222,
338,
1369,
1361,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
565,
93,
2013,
25280,
51,
244,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
500,
576,
50,
56,
51,
53,
51,
2787,
4513,
222,
338,
222,
338,
6213,
813,
451,
341,
1409,
1623,
2806,
641,
23760,
1549,
477,
3553,
575,
5550,
4940,
458,
552,
43814,
51,
222,
338,
222,
588,
222,
222,
1337,
785,
51,
1693,
11435,
51,
2867,
105,
51,
3126,
51,
1058,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
18705,
8263,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
18705,
1225,
64,
222,
485,
785,
51,
1693,
11435,
51,
2867,
51,
3152,
64,
222,
485,
785,
51,
1693,
11435,
51,
2867,
105,
51,
3126,
51,
2646,
51,
3152,
2436,
64,
222,
222,
1350,
222,
338,
3105,
1222,
6555,
1225,
130,
449,
906,
3682,
50,
4779,
2010,
456,
3541,
7262,
22720,
480,
1851,
51,
222,
338,
222,
338,
496,
2133,
350,
102,
995,
366,
16951,
63,
48966,
10596,
51,
8644,
2495,
69,
1693,
50,
125,
2357,
51,
527,
432,
1047,
290,
10596,
19181,
2495,
396,
102,
67,
222,
588,
222,
942,
1175,
462,
6555,
1225,
65,
88,
2041,
6555,
2436,
67,
320,
465,
964,
1175,
22219,
1225,
65,
671,
49,
377,
67,
32963,
1225,
64,
303,
964,
1175,
22219,
1225,
65,
671,
49,
377,
67,
15541,
625,
1225,
64,
465,
1041,
294,
338,
21010,
331,
556,
3105,
1222,
6555,
1225,
4037,
294,
588,
303,
581,
6555,
1225,
365,
320,
310,
477,
45,
54,
53,
55,
57,
312,
303,
339,
465,
1041,
294,
338,
21010,
331,
556,
3105,
1222,
6555,
1225,
4037,
294,
338,
294,
338,
496,
772,
2838,
13126,
906,
2838,
2010,
1200,
13821,
294,
588,
303,
581,
6555,
1225,
45,
3242,
648,
2838,
13126,
46,
320,
310,
2615,
492,
310,
32963,
1225,
299,
556,
22219,
8263,
65,
671,
49,
377,
1579,
4353,
13126,
49,
244,
53,
51,
60,
58,
107,
49,
244,
54,
312,
310,
15541,
625,
1225,
299,
556,
22219,
8263,
65,
671,
49,
377,
1579,
4353,
13126,
49,
244,
53,
51,
60,
58,
107,
49,
244,
54,
312,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
7132,
341,
2010,
1200,
1354,
51,
294,
338,
294,
338,
496,
620,
906,
1354,
294,
588,
303,
581,
648,
1354,
365,
320,
310,
461,
32963,
1225,
51,
911,
492,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
17269,
456,
20822,
451,
331,
3541,
5764,
642,
2716,
3541,
7262,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
620,
350,
707,
67,
1527,
396,
707,
67,
434,
3774,
331,
3541,
458,
5041,
64,
5897,
350,
707,
67,
1886,
396,
707,
67,
294,
588,
303,
581,
1922,
4326,
1103,
34462,
45,
3242,
910,
32963,
46,
320,
310,
461,
32963,
1225,
51,
15927,
45,
30590,
312,
303,
339,
465,
1041,
294,
338,
17269,
456,
20822,
451,
331,
3541,
5764,
642,
2716,
15541,
7262,
51,
294,
338,
294,
338,
496,
772,
3390,
625,
906,
15541,
7262,
294,
338,
496,
620,
350,
707,
67,
1527,
396,
707,
67,
434,
3774,
331,
3541,
458,
5041,
64,
5897,
350,
707,
67,
1886,
396,
707,
67,
294,
588,
303,
581,
1922,
4326,
1103,
34111,
625,
45,
3242,
910,
3390,
625,
46,
320,
310,
461,
15541,
625,
1225,
51,
15927,
45,
3853,
625,
312,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
3541,
7262,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
620,
906,
5764,
3541,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
40096,
294,
588,
303,
581,
377,
40310,
34462,
45,
3242,
910,
32963,
46,
320,
310,
461,
32963,
1225,
51,
390,
45,
30590,
312,
303,
339,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
15541,
7262,
51,
294,
338,
294,
338,
496,
772,
3390,
625,
906,
15541,
7262,
294,
338,
496,
620,
906,
5764,
3541,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
40096,
294,
588,
303,
581,
377,
40310,
34111,
625,
45,
3242,
910,
3390,
625,
46,
320,
310,
461,
15541,
625,
1225,
51,
390,
45,
3853,
625,
312,
303,
339,
499,
453,
6549,
12117,
465,
1041,
294,
338,
13952,
120,
3205,
3541,
2012,
477,
2010,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
772,
3541,
906,
3541,
391,
4180,
294,
338,
496,
620,
906,
3541,
3443,
5764,
642,
2716,
3541,
7262,
708,
1421,
2602,
14180,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
7572,
14180,
294,
588,
303,
581,
377,
4180,
1103,
34462,
45,
3242,
910,
32963,
49,
1175,
377,
3541,
46,
320,
310,
377,
7329,
299,
32963,
1225,
51,
543,
45,
30590,
49,
3541,
312,
310,
434,
327,
1710,
882,
7329,
46,
320,
343,
910,
7329,
12963,
625,
299,
327,
671,
46,
7329,
51,
25942,
941,
17745,
45,
3152,
51,
7608,
100,
10489,
23498,
100,
798,
312,
343,
434,
327,
1710,
882,
7329,
12963,
625,
46,
320,
419,
15541,
625,
1225,
51,
2564,
45,
5599,
12963,
625
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
32963,
1225,
51,
911,
492,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
17269,
456,
20822,
451,
331,
3541,
5764,
642,
2716,
3541,
7262,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
620,
350,
707,
67,
1527,
396,
707,
67,
434,
3774,
331,
3541,
458,
5041,
64,
5897,
350,
707,
67,
1886,
396,
707,
67,
294,
588,
303,
581,
1922,
4326,
1103,
34462,
45,
3242,
910,
32963,
46,
320,
310,
461,
32963,
1225,
51,
15927,
45,
30590,
312,
303,
339,
465,
1041,
294,
338,
17269,
456,
20822,
451,
331,
3541,
5764,
642,
2716,
15541,
7262,
51,
294,
338,
294,
338,
496,
772,
3390,
625,
906,
15541,
7262,
294,
338,
496,
620,
350,
707,
67,
1527,
396,
707,
67,
434,
3774,
331,
3541,
458,
5041,
64,
5897,
350,
707,
67,
1886,
396,
707,
67,
294,
588,
303,
581,
1922,
4326,
1103,
34111,
625,
45,
3242,
910,
3390,
625,
46,
320,
310,
461,
15541,
625,
1225,
51,
15927,
45,
3853,
625,
312,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
3541,
7262,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
620,
906,
5764,
3541,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
40096,
294,
588,
303,
581,
377,
40310,
34462,
45,
3242,
910,
32963,
46,
320,
310,
461,
32963,
1225,
51,
390,
45,
30590,
312,
303,
339,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
15541,
7262,
51,
294,
338,
294,
338,
496,
772,
3390,
625,
906,
15541,
7262,
294,
338,
496,
620,
906,
5764,
3541,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
40096,
294,
588,
303,
581,
377,
40310,
34111,
625,
45,
3242,
910,
3390,
625,
46,
320,
310,
461,
15541,
625,
1225,
51
] | 1,232,886,711,503,642,600
| true
| false
| false
| false
|
[
45,
3242,
910,
3390,
625,
46,
320,
310,
461,
15541,
625,
1225,
51,
15927,
45,
3853,
625,
312,
303,
339,
465,
453,
6549,
12117,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
3541,
7262,
51,
294,
338,
294,
338,
496,
772,
32963,
906,
3541,
7262,
294,
338,
496,
620,
906,
5764,
3541,
575,
350,
707,
67,
1710,
396,
707,
67,
434,
40096,
294,
588,
303,
581,
377,
40310,
34462,
45,
3242,
910,
32963,
46,
320,
310,
461,
32963,
1225,
51,
390,
45,
30590,
312,
303,
339,
465,
1041,
294,
338,
7132,
341,
3541,
5764,
642,
3205,
15541,
7262
] | 8,350,765,490,435,697,000
| true
|
sessionIdMap.size();
}
// -------------------------------------------------------------------------------
/**
* Checks for presence of a session associated with given session identifier.
*
* @param sessionId The session identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsBySessionId(final String sessionId) {
return sessionIdMap.containsKey(sessionId);
}
/**
* Checks for presence of a session associated with given alternative identifier.
*
* @param altId The alternative identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsByAlternativeId(final String altId) {
return alternativeIdMap.containsKey(altId);
}
// -------------------------------------------------------------------------------
/**
* Gets the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The associated session or <code>null</code> if absent
*/
public S getBySessionId(final String sessionId) {
return sessionIdMap.get(sessionId);
}
/**
* Gets the session associated with specified alternative identifier
|
a session is present; otherwise <code>false</code>
*/
public boolean containsBySessionId(final String sessionId) {
return sessionIdMap.containsKey(sessionId);
}
/**
* Checks for presence of a session associated with given alternative identifier.
*
* @param altId The alternative identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsByAlternativeId(final String altId) {
return alternativeIdMap.containsKey(altId);
}
// -------------------------------------------------------------------------------
/**
* Gets the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The associated session or <code>null</code> if absent
*/
public S getBySessionId(final String sessionId) {
return sessionIdMap.get(sessionId);
}
/**
* Gets the session associated with specified alternative identifier
|
given alternative identifier.
*
* @param altId The alternative identifier
* @return <code>true</code> if such a session is present; otherwise <code>false</code>
*/
public boolean containsByAlternativeId(final String altId) {
return alternativeIdMap.containsKey(altId);
}
// -------------------------------------------------------------------------------
/**
* Gets the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The associated session or <code>null</code> if absent
*/
public S getBySessionId(final String sessionId) {
return sessionIdMap.get(sessionId);
}
/**
* Gets the session associated with specified alternative identifier
|
(final String altId) {
return alternativeIdMap.containsKey(altId);
}
// -------------------------------------------------------------------------------
/**
* Gets the session associated with specified session identifier.
*
* @param sessionId The session identifier
* @return The associated session or <code>null</code> if absent
*/
public S getBySessionId(final String sessionId) {
return sessionIdMap.get(sessionId);
}
/**
* Gets the session associated with specified alternative identifier
|
.
*
* @param altId The alternative identifier
* @return The associated session or <code>null</code> if absent
*/
public S getByAlternativeId(final String altId) {
return alternativeIdMap.
|
PhoneNumberBlockedEntity.java
|
/FileExtraction/Java_unseen/sergio11_bullkeeper_app/domain/src/main/java/sanchez/sanchez/sergio/domain/models/PhoneNumberBlockedEntity.java
|
package sanchez.sanchez.sergio.domain.models;
import java.io.Serializable;
import java.util.Date;
/**
* Phone Number Blocked Entity
*/
public final class PhoneNumberBlockedEntity implements Serializable {
/**
* Identity
*/
private String identity;
/**
* Blocked At
*/
private Date blockedAt;
/**
* Prefix
*/
private String prefix;
/**
* Number
*/
private String number;
/**
* Phone Number
*/
private String phoneNumber;
/**
* Terminal
*/
private String terminal;
/**
* Kid
*/
private String kid;
/**
*
*/
public PhoneNumberBlockedEntity(){}
/**
*
* @param identity
* @param blockedAt
* @param prefix
* @param number
* @param phoneNumber
* @param terminal
* @param kid
*/
public PhoneNumberBlockedEntity(final String identity, final Date blockedAt, final String prefix,
final String number, final String phoneNumber, final String terminal,
final String kid) {
this.identity = identity;
this.blockedAt = blockedAt;
this.prefix = prefix;
this.number = number;
this.phoneNumber = phoneNumber;
this.terminal = terminal;
this.kid = kid;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Date getBlockedAt() {
return blockedAt;
}
public void setBlockedAt(Date blockedAt) {
this.blockedAt = blockedAt;
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getTerminal() {
return terminal;
}
public void setTerminal(String terminal) {
this.terminal = terminal;
}
public String getKid() {
return kid;
}
public void setKid(String kid) {
this.kid = kid;
}
@Override
public String toString() {
return "PhoneNumberBlockedEntity{" +
"identity='" + identity + '\'' +
", blockedAt=" + blockedAt +
", prefix='" + prefix + '\'' +
", number='" + number + '\'' +
", phoneNumber='" + phoneNumber + '\'' +
", terminal='" + terminal + '\'' +
", kid='" + kid + '\'' +
'}';
}
}
| 2,876
|
Java
|
.java
|
sergio11/bullkeeper_app
| 10
| 1
| 6
|
2018-06-01T17:53:24Z
|
2024-03-08T20:42:23Z
|
9e3c877ec8e27832f979b6fb2225f0bb1b1293051bf388ad766cd45b1d7982c3
|
[] |
[
1337,
24069,
1075,
127,
51,
17813,
1075,
127,
51,
528,
30323,
51,
4136,
51,
3404,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
485,
1401,
51,
1058,
51,
1563,
64,
222,
222,
1350,
222,
338,
18989,
5132,
6579,
337,
7276,
222,
588,
222,
942,
1175,
462,
18989,
1936,
33111,
2234,
4584,
19182,
320,
465,
1041,
294,
338,
15900,
294,
588,
303,
964,
910,
10645,
64,
465,
1041,
294,
338,
6579,
337,
4612,
294,
588,
303,
964,
2833,
23593,
1094,
64,
465,
1041,
294,
338,
28724,
294,
588,
303,
964,
910,
5216,
64,
465,
1041,
294,
338,
5132,
294,
588,
303,
964,
910,
1470,
64,
465,
1041,
294,
338,
18989,
5132,
294,
588,
303,
964,
910,
43859,
64,
465,
1041,
294,
338,
21796,
294,
588,
303,
964,
910,
10733,
64,
465,
1041,
294,
338,
1242,
333,
294,
588,
303,
964,
910,
45682,
64,
465,
1041,
294,
338,
294,
588,
303,
581,
18989,
1936,
33111,
2234,
47421,
465,
1041,
294,
338,
294,
338,
496,
772,
10645,
294,
338,
496,
772,
23593,
1094,
294,
338,
496,
772,
5216,
294,
338,
496,
772,
1470,
294,
338,
496,
772,
43859,
294,
338,
496,
772,
10733,
294,
338,
496,
772,
45682,
294,
588,
303,
581,
18989,
1936,
33111,
2234,
45,
3242,
910,
10645,
49,
1175,
2833,
23593,
1094,
49,
1175,
910,
5216,
49,
1908,
1175,
910,
1470,
49,
1175,
910,
43859,
49,
1175,
910,
10733,
49,
1908,
1175,
910,
45682,
46,
320,
310,
477,
51,
8552,
299,
10645,
64,
310,
477,
51,
26946,
1094,
299,
23593,
1094,
64,
310,
477,
51,
4271,
299,
5216,
64,
310,
477,
51,
2188,
299,
1470,
64,
310,
477,
51,
29860,
299,
43859,
64,
310,
477,
51,
16908,
299,
10733,
64,
310,
477,
51,
35889,
299,
45682,
64,
303,
339,
465,
581,
910,
640,
6741,
365,
320,
310,
461,
10645,
64,
303,
339,
465,
581,
782,
758,
6741,
45,
671,
10645,
46,
320,
310,
477,
51,
8552,
299,
10645,
64,
303,
339,
465,
581,
2833,
640,
33111,
1094,
365,
320,
310,
461,
23593,
1094,
64,
303,
339,
465,
581,
782,
758,
33111,
1094,
45,
1563,
23593,
1094,
46,
320,
310,
477,
51,
26946,
1094,
299,
23593,
1094,
64,
303,
339,
465,
581,
910,
640,
5429,
365,
320,
310,
461,
5216,
64,
303,
339,
465,
581,
782,
758,
5429,
45,
671,
5216,
46,
320,
310,
477,
51,
4271,
299,
5216,
64,
303,
339,
465,
581,
910,
640,
1936,
365,
320,
310,
461,
1470,
64,
303,
339,
465,
581,
782,
758,
1936,
45,
671,
1470,
46,
320,
310,
477,
51,
2188,
299,
1470,
64,
303,
339,
465,
581,
910,
640,
25263,
365,
320,
310,
461,
43859,
64,
303,
339,
465,
581,
782,
758,
25263,
45,
671,
43859,
46,
320,
310,
477,
51,
29860,
299,
43859,
64,
303,
339,
465,
581,
910,
640,
14527,
365,
320,
310,
461,
10733,
64,
303,
339,
465,
581,
782,
758,
14527,
45,
671,
10733,
46,
320,
310,
477,
51,
16908,
299,
10733,
64,
303,
339,
465,
581,
910,
640,
80,
333,
365,
320,
310,
461,
45682,
64,
303,
339,
465,
581,
782,
758,
80,
333,
45,
671,
45682,
46,
320,
310,
477,
51,
35889,
299,
45682,
64,
303,
339,
465,
496,
1806,
303,
581,
910,
11349,
365,
320,
310,
461,
332,
25263,
33111,
2234,
2382,
494,
419,
332,
8552,
19050,
494,
10645,
494,
31267,
494,
419,
3021,
23593,
1094,
366,
494,
23593,
1094,
494,
419,
3021,
5216,
19050,
494,
5216,
494,
31267,
494,
419,
3021,
1470,
19050,
494,
1470,
494,
31267,
494,
419,
3021,
43859,
19050,
494,
43859,
494,
31267,
494,
419,
3021,
10733,
19050,
494,
10733,
494,
31267,
494,
419,
3021,
45682,
19050,
494,
45682,
494,
31267,
494,
419,
45464,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 611
|
[
303,
964,
910,
43859,
64,
465,
1041,
294,
338,
21796,
294,
588,
303,
964,
910,
10733,
64,
465,
1041,
294,
338,
1242,
333,
294,
588,
303,
964,
910,
45682,
64,
465,
1041,
294,
338,
294,
588,
303,
581,
18989,
1936,
33111,
2234,
47421,
465,
1041,
294,
338,
294,
338,
496,
772,
10645,
294,
338,
496,
772,
23593,
1094,
294,
338,
496,
772,
5216,
294,
338,
496,
772,
1470,
294,
338,
496,
772,
43859,
294,
338,
496,
772,
10733,
294,
338,
496,
772,
45682,
294,
588,
303,
581,
18989,
1936,
33111,
2234,
45,
3242,
910,
10645,
49,
1175,
2833,
23593,
1094,
49,
1175,
910,
5216,
49,
1908,
1175,
910,
1470,
49,
1175,
910,
43859,
49,
1175,
910,
10733,
49,
1908,
1175,
910,
45682,
46,
320,
310,
477,
51,
8552,
299,
10645,
64,
310,
477,
51,
26946,
1094,
299,
23593,
1094,
64,
310,
477,
51,
4271,
299,
5216,
64,
310,
477,
51,
2188,
299,
1470,
64,
310,
477,
51,
29860,
299,
43859,
64,
310,
477,
51,
16908,
299,
10733,
64,
310,
477,
51,
35889,
299,
45682,
64,
303,
339,
465,
581,
910,
640,
6741,
365,
320,
310,
461,
10645,
64,
303,
339,
465,
581,
782,
758,
6741,
45,
671,
10645,
46,
320,
310,
477,
51,
8552,
299,
10645,
64,
303,
339,
465,
581,
2833,
640,
33111,
1094,
365,
320,
310,
461,
23593,
1094,
64,
303,
339,
465,
581,
782,
758,
33111,
1094,
45,
1563,
23593,
1094,
46,
320,
310,
477,
51,
26946,
1094,
299,
23593,
1094,
64,
303,
339,
465,
581,
910,
640,
5429,
365,
320,
310,
461,
5216,
64,
303,
339,
465,
581,
782,
758,
5429,
45,
671,
5216,
46,
320,
310,
477,
51,
4271,
299,
5216,
64,
303,
339,
465,
581,
910,
640,
1936,
365,
320,
310,
461,
1470,
64,
303,
339,
465,
581,
782,
758,
1936,
45,
671,
1470
] | -1,052,034,533,792,264,400
| true
| false
| false
| false
|
[
2188,
299,
1470,
64,
310,
477,
51,
29860,
299,
43859,
64,
310,
477,
51,
16908,
299,
10733,
64,
310,
477,
51,
35889,
299,
45682,
64,
303,
339,
465,
581,
910,
640,
6741,
365,
320,
310,
461,
10645,
64,
303,
339,
465,
581,
782,
758,
6741,
45,
671,
10645,
46,
320,
310,
477,
51,
8552,
299,
10645,
64,
303,
339,
465,
581,
2833,
640,
33111,
1094,
365,
320,
310,
461,
23593,
1094,
64,
303,
339,
465,
581,
782,
758,
33111,
1094,
45,
1563,
23593,
1094,
46,
320,
310,
477,
51,
26946,
1094,
299,
23593,
1094,
64,
303,
339,
465,
581,
910
] | 6,148,712,646,114,876,000
| true
|
private String phoneNumber;
/**
* Terminal
*/
private String terminal;
/**
* Kid
*/
private String kid;
/**
*
*/
public PhoneNumberBlockedEntity(){}
/**
*
* @param identity
* @param blockedAt
* @param prefix
* @param number
* @param phoneNumber
* @param terminal
* @param kid
*/
public PhoneNumberBlockedEntity(final String identity, final Date blockedAt, final String prefix,
final String number, final String phoneNumber, final String terminal,
final String kid) {
this.identity = identity;
this.blockedAt = blockedAt;
this.prefix = prefix;
this.number = number;
this.phoneNumber = phoneNumber;
this.terminal = terminal;
this.kid = kid;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Date getBlockedAt() {
return blockedAt;
}
public void setBlockedAt(Date blockedAt) {
this.blockedAt = blockedAt;
}
public String
|
param identity
* @param blockedAt
* @param prefix
* @param number
* @param phoneNumber
* @param terminal
* @param kid
*/
public PhoneNumberBlockedEntity(final String identity, final Date blockedAt, final String prefix,
final String number, final String phoneNumber, final String terminal,
final String kid) {
this.identity = identity;
this.blockedAt = blockedAt;
this.prefix = prefix;
this.number = number;
this.phoneNumber = phoneNumber;
this.terminal = terminal;
this.kid = kid;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Date getBlockedAt() {
return blockedAt;
}
public void setBlockedAt(Date blockedAt) {
this.blockedAt = blockedAt;
}
public String
|
, final String prefix,
final String number, final String phoneNumber, final String terminal,
final String kid) {
this.identity = identity;
this.blockedAt = blockedAt;
this.prefix = prefix;
this.number = number;
this.phoneNumber = phoneNumber;
this.terminal = terminal;
this.kid = kid;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Date getBlockedAt() {
return blockedAt;
}
public void setBlockedAt(Date blockedAt) {
this.blockedAt = blockedAt;
}
public String
|
number = number;
this.phoneNumber = phoneNumber;
this.terminal = terminal;
this.kid = kid;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Date getBlockedAt() {
return blockedAt;
}
public void setBlockedAt(Date blockedAt) {
this.blockedAt = blockedAt;
}
public String
|
getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getNumber() {
return number;
}
public void setNumber(String number
|
ImageHelper.java
|
/FileExtraction/Java_unseen/mdsecresearch_BurpSuiteSharpener/src/main/java/com/irsdl/generic/ImageHelper.java
|
// Released under AGPL see LICENSE for more information
// Developed by Soroush Dalili (@irsdl)
package com.irsdl.generic;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import static org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace;
public class ImageHelper {
public static Image scaleImageToWidth(BufferedImage image, int width) {
if (image == null)
return null;
int height = (int) (Math.floor((image.getHeight() * width) / (double) image.getWidth()));
if (image.getWidth() > width) {
return image.getScaledInstance(width, height, Image.SCALE_AREA_AVERAGING);
} else {
return image.getScaledInstance(width, height, Image.SCALE_SMOOTH);
}
}
public static Image scaleImageToWidth2(BufferedImage image, int width) {
if (image == null)
return null;
int height = (int) (Math.floor((image.getHeight() * width) / (double) image.getWidth()));
BufferedImage resizedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = resizedImage.createGraphics();
graphics2D.drawImage(image, 0, 0, width, height, null);
graphics2D.dispose();
return resizedImage;
}
public static BufferedImage loadImageResource(String filename) {
return loadImageResource(UIHelper.class, filename);
}
public static BufferedImage loadImageResource(Class claz, String filePath) {
URL imageURLMain = null;
if (!filePath.startsWith("/")) {
imageURLMain = claz.getResource("/" + filePath);
}
if (imageURLMain == null) {
imageURLMain = claz.getResource(filePath);
}
if (imageURLMain != null) {
Image original = new ImageIcon(imageURLMain).getImage();
ImageIcon originalIcon = new ImageIcon(original);
BufferedImage bufferedImage = new BufferedImage(originalIcon.getIconWidth(), originalIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.drawImage(originalIcon.getImage(), null, null);
return bufferedImage;
}
return null;
}
public static BufferedImage loadImageFile(String filePath) {
BufferedImage bufferedImage = null;
File file = new File(filePath);
if (file.exists() && file.isFile()) {
try {
Image original = new ImageIcon(filePath).getImage();
ImageIcon originalIcon = new ImageIcon(original);
bufferedImage = new BufferedImage(originalIcon.getIconWidth(), originalIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) bufferedImage.getGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.drawImage(originalIcon.getImage(), null, null);
} catch (Exception e) {
System.err.println(e.getMessage() + "\r\n" + getStackTrace(e));
}
}
return bufferedImage;
}
// https://alvinalexander.com/java/java-copy-image-to-clipboard-example/
// code below from exampledepot.com
//This method writes an image to the system clipboard.
//otherwise it returns null.
public static void setClipboard(Image image) {
ImageSelection imgSel = new ImageSelection(image);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel, null);
}
// This class is used to hold an image while on the clipboard.
static class ImageSelection implements Transferable {
private final Image image;
public ImageSelection(Image image) {
this.image = image;
}
// Returns supported flavors
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[]{DataFlavor.imageFlavor};
}
// Returns true if flavor is supported
public boolean isDataFlavorSupported(DataFlavor flavor) {
return DataFlavor.imageFlavor.equals(flavor);
}
// Returns image
public Object getTransferData(DataFlavor flavor)
throws UnsupportedFlavorException, IOException {
if (!DataFlavor.imageFlavor.equals(flavor)) {
throw new UnsupportedFlavorException(flavor);
}
return image;
}
}
}
| 4,833
|
Java
|
.java
|
mdsecresearch/BurpSuiteSharpener
| 507
| 46
| 24
|
2021-01-07T15:34:57Z
|
2023-06-05T08:39:05Z
|
980fca2b9864b42267e92adffd3acdb4d5deaf46d06aedceec62a57405e8df98
|
[] |
[
325,
48926,
1549,
418,
21156,
2337,
7621,
456,
1851,
2490,
222,
325,
43572,
337,
829,
377,
25046,
1391,
493,
298,
5711,
11933,
495,
18688,
46,
222,
222,
1337,
785,
51,
495,
18688,
51,
9957,
64,
222,
222,
485,
3698,
51,
5934,
7737,
222,
485,
1401,
51,
8236,
7737,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
768,
35402,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
8580,
463,
64,
222,
485,
1401,
51,
8236,
51,
18176,
28786,
1036,
51,
16737,
35402,
1002,
64,
222,
485,
1401,
51,
8236,
51,
915,
51,
17640,
1675,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1317,
51,
2427,
64,
222,
222,
485,
924,
1105,
51,
2121,
51,
8381,
51,
1600,
56,
51,
3918,
51,
1002,
2769,
51,
390,
8432,
64,
222,
222,
942,
462,
4393,
2775,
320,
303,
581,
924,
4393,
5271,
1675,
724,
2627,
45,
17640,
1675,
1802,
49,
648,
1882,
46,
320,
310,
434,
327,
915,
630,
762,
46,
343,
461,
762,
64,
603,
648,
2401,
299,
327,
429,
46,
327,
5728,
51,
9157,
1181,
915,
51,
22361,
365,
338,
1882,
46,
536,
327,
2640,
46,
1802,
51,
21398,
5086,
310,
434,
327,
915,
51,
21398,
365,
868,
1882,
46,
320,
343,
461,
1802,
51,
18721,
1192,
1250,
1825,
45,
1660,
49,
2401,
49,
4393,
51,
19952,
100,
27568,
100,
70,
1986,
44512,
312,
310,
339,
832,
320,
343,
461,
1802,
51,
18721,
1192,
1250,
1825,
45,
1660,
49,
2401,
49,
4393,
51,
19952,
100,
88,
2414,
32691,
312,
310,
339,
303,
339,
465,
581,
924,
4393,
5271,
1675,
724,
2627,
55,
45,
17640,
1675,
1802,
49,
648,
1882,
46,
320,
310,
434,
327,
915,
630,
762,
46,
343,
461,
762,
64,
603,
648,
2401,
299,
327,
429,
46,
327,
5728,
51,
9157,
1181,
915,
51,
22361,
365,
338,
1882,
46,
536,
327,
2640,
46,
1802,
51,
21398,
5086,
310,
44182,
44587,
1675,
299,
556,
44182,
45,
1660,
49,
2401,
49,
44182,
51,
2333,
100,
1860,
100,
7832,
312,
310,
16054,
55,
73,
18343,
55,
73,
299,
44587,
1675,
51,
1315,
8524,
492,
310,
18343,
55,
73,
51,
37719,
45,
915,
49,
244,
53,
49,
244,
53,
49,
1882,
49,
2401,
49,
762,
312,
310,
18343,
55,
73,
51,
19904,
492,
310,
461,
44587,
1675,
64,
303,
339,
465,
581,
924,
44182,
2480,
1675,
2305,
45,
671,
4891,
46,
320,
310,
461,
2480,
1675,
2305,
45,
2299,
2775,
51,
842,
49,
4891,
312,
303,
339,
465,
581,
924,
44182,
2480,
1675,
2305,
45,
1359,
1553,
1392,
49,
910,
18030,
46,
320,
310,
3846,
1802,
2427,
4370,
299,
762,
64,
603,
434,
1445,
14735,
51,
13907,
4229,
2152,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
4229,
39,
494,
18030,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
630,
762,
46,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
45,
14735,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
882,
762,
46,
320,
343,
4393,
4732,
299,
556,
4393,
2930,
45,
915,
2427,
4370,
566,
25414,
492,
343,
4393,
2930,
4732,
2930,
299,
556,
4393,
2930,
45,
7351,
312,
343,
44182,
31703,
1675,
299,
556,
44182,
45,
7351,
2930,
51,
390,
2930,
2627,
1046,
4732,
2930,
51,
390,
2930,
3041,
1046,
44182,
51,
2333,
100,
1860,
100,
45914,
312,
343,
16054,
55,
73,
504,
299,
327,
8524,
55,
73,
46,
31703,
1675,
51,
390,
8524,
492,
343,
504,
51,
489,
12177,
11213,
45,
12177,
33404,
51,
3319,
100,
39362,
25126,
1410,
49,
39195,
33404,
51,
5986,
100,
39362,
25126,
100,
586,
312,
343,
504,
51,
37719,
45,
7351,
2930,
51,
25414,
1046,
762,
49,
762,
312,
343,
461,
31703,
1675,
64,
310,
339,
310,
461,
762,
64,
303,
339,
465,
581,
924,
44182,
2480,
1675,
991,
45,
671,
18030,
46,
320,
310,
44182,
31703,
1675,
299,
762,
64,
310,
2050,
822,
299,
556,
2050,
45,
14735,
312,
603,
434,
327,
781,
51,
4678,
365,
979,
822,
51,
41746,
1177,
320,
343,
1614,
320,
419,
4393,
4732,
299,
556,
4393,
2930,
45,
14735,
566,
25414,
492,
419,
4393,
2930,
4732,
2930,
299,
556,
4393,
2930,
45,
7351,
312,
419,
31703,
1675,
299,
556,
44182,
45,
7351,
2930,
51,
390,
2930,
2627,
1046,
4732,
2930,
51,
390,
2930,
3041,
1046,
44182,
51,
2333,
100,
1860,
100,
45914,
312,
419,
16054,
55,
73,
504,
299,
327,
8524,
55,
73,
46,
31703,
1675,
51,
390,
8524,
492,
419,
504,
51,
489,
12177,
11213,
45,
12177,
33404,
51,
3319,
100,
39362,
25126,
1410,
49,
39195,
33404,
51,
5986,
100,
39362,
25126,
100,
586,
312,
419,
504,
51,
37719,
45,
7351,
2930,
51,
25414,
1046,
762,
49,
762,
312,
343,
339,
2385,
327,
1002,
503,
46,
320,
419,
1189,
51,
549,
51,
3962,
45,
106,
51,
7724,
365,
494,
2724,
119,
97,
115,
39,
494,
640,
8432,
45,
106,
894,
343,
339,
310,
339,
310,
461,
31703,
1675,
64,
303,
339,
465,
453,
1698,
574,
298,
13785,
23836,
19184,
51,
527,
52,
1874,
52,
1874,
50,
3014,
50,
915,
50,
471,
50,
27766,
50,
2783,
52,
303,
453,
1361,
4834,
664,
2301,
9086,
385,
51,
527,
303,
453,
2287,
1431,
19411,
619,
1802,
391,
341,
2684,
27528,
51,
303,
453,
31867,
580,
3235,
762,
51,
303,
581,
924,
782,
758,
25946,
45,
1675,
1802,
46,
320,
310,
4393,
5385,
4838,
15475,
299,
556,
4393,
5385,
45,
915,
312,
310,
34045,
51,
13729,
24291,
941,
29967,
25946,
941,
489,
8048,
45,
1296,
15475,
49,
762,
312,
303,
339,
4054,
453,
1369,
462,
458,
1674,
391,
7649,
619,
1802,
2236,
563,
341,
27528,
51,
303,
924,
462,
4393,
5385,
4584,
17873,
463,
320,
310,
964,
1175,
4393,
1802,
64,
603,
581,
4393,
5385,
45,
1675,
1802,
46,
320,
343,
477,
51,
915,
299,
1802,
64,
310,
339,
603,
453,
3777,
5430,
2040,
45996,
310,
581,
2426,
35402,
1197,
640,
8580,
768,
2151,
45996,
365,
320,
343,
461,
556,
2426,
35402,
14161,
768,
35402,
51,
915,
35402,
1274,
310,
339,
603,
453,
3777,
878,
434,
36440,
458,
5430,
310,
581,
1922,
458,
768,
35402,
10330,
45,
768,
35402,
36440,
46,
320,
343
] |
[
[
1,
1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1,024
|
[
581,
924,
4393,
5271,
1675,
724,
2627,
55,
45,
17640,
1675,
1802,
49,
648,
1882,
46,
320,
310,
434,
327,
915,
630,
762,
46,
343,
461,
762,
64,
603,
648,
2401,
299,
327,
429,
46,
327,
5728,
51,
9157,
1181,
915,
51,
22361,
365,
338,
1882,
46,
536,
327,
2640,
46,
1802,
51,
21398,
5086,
310,
44182,
44587,
1675,
299,
556,
44182,
45,
1660,
49,
2401,
49,
44182,
51,
2333,
100,
1860,
100,
7832,
312,
310,
16054,
55,
73,
18343,
55,
73,
299,
44587,
1675,
51,
1315,
8524,
492,
310,
18343,
55,
73,
51,
37719,
45,
915,
49,
244,
53,
49,
244,
53,
49,
1882,
49,
2401,
49,
762,
312,
310,
18343,
55,
73,
51,
19904,
492,
310,
461,
44587,
1675,
64,
303,
339,
465,
581,
924,
44182,
2480,
1675,
2305,
45,
671,
4891,
46,
320,
310,
461,
2480,
1675,
2305,
45,
2299,
2775,
51,
842,
49,
4891,
312,
303,
339,
465,
581,
924,
44182,
2480,
1675,
2305,
45,
1359,
1553,
1392,
49,
910,
18030,
46,
320,
310,
3846,
1802,
2427,
4370,
299,
762,
64,
603,
434,
1445,
14735,
51,
13907,
4229,
2152,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
4229,
39,
494,
18030,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
630,
762,
46,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
45,
14735,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
882,
762,
46,
320,
343,
4393,
4732,
299,
556,
4393,
2930,
45,
915,
2427,
4370,
566,
25414,
492,
343,
4393,
2930,
4732,
2930,
299,
556,
4393,
2930,
45,
7351,
312,
343,
44182,
31703,
1675,
299,
556,
44182,
45,
7351,
2930,
51,
390,
2930,
2627,
1046,
4732,
2930,
51,
390,
2930,
3041,
1046,
44182,
51,
2333,
100,
1860,
100,
45914,
312,
343,
16054,
55,
73,
504,
299,
327,
8524,
55,
73
] | 6,461,646,979,500,083,000
| true
| false
| false
| false
|
[
339,
465,
581,
924,
44182,
2480,
1675,
2305,
45,
1359,
1553,
1392,
49,
910,
18030,
46,
320,
310,
3846,
1802,
2427,
4370,
299,
762,
64,
603,
434,
1445,
14735,
51,
13907,
4229,
2152,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
4229,
39,
494,
18030,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
630,
762,
46,
320,
343,
1802,
2427,
4370,
299,
1553,
1392,
51,
17633,
45,
14735,
312,
310,
339,
603,
434,
327,
915,
2427,
4370,
882,
762,
46,
320,
343,
4393,
4732,
299,
556,
4393,
2930,
45,
915,
2427,
4370,
566,
25414,
492,
343,
4393
] | -27,997,685,473,705,904
| true
|
public static Image scaleImageToWidth2(BufferedImage image, int width) {
if (image == null)
return null;
int height = (int) (Math.floor((image.getHeight() * width) / (double) image.getWidth()));
BufferedImage resizedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = resizedImage.createGraphics();
graphics2D.drawImage(image, 0, 0, width, height, null);
graphics2D.dispose();
return resizedImage;
}
public static BufferedImage loadImageResource(String filename) {
return loadImageResource(UIHelper.class, filename);
}
public static BufferedImage loadImageResource(Class claz, String filePath) {
URL imageURLMain = null;
if (!filePath.startsWith("/")) {
imageURLMain = claz.getResource("/" + filePath);
}
if (imageURLMain == null) {
imageURLMain = claz.getResource(filePath);
}
if (imageURLMain!= null) {
Image original = new ImageIcon(imageURLMain).getImage();
Image
|
) image.getWidth()));
BufferedImage resizedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = resizedImage.createGraphics();
graphics2D.drawImage(image, 0, 0, width, height, null);
graphics2D.dispose();
return resizedImage;
}
public static BufferedImage loadImageResource(String filename) {
return loadImageResource(UIHelper.class, filename);
}
public static BufferedImage loadImageResource(Class claz, String filePath) {
URL imageURLMain = null;
if (!filePath.startsWith("/")) {
imageURLMain = claz.getResource("/" + filePath);
}
if (imageURLMain == null) {
imageURLMain = claz.getResource(filePath);
}
if (imageURLMain!= null) {
Image original = new ImageIcon(imageURLMain).getImage();
Image
|
, 0, width, height, null);
graphics2D.dispose();
return resizedImage;
}
public static BufferedImage loadImageResource(String filename) {
return loadImageResource(UIHelper.class, filename);
}
public static BufferedImage loadImageResource(Class claz, String filePath) {
URL imageURLMain = null;
if (!filePath.startsWith("/")) {
imageURLMain = claz.getResource("/" + filePath);
}
if (imageURLMain == null) {
imageURLMain = claz.getResource(filePath);
}
if (imageURLMain!= null) {
Image original = new ImageIcon(imageURLMain).getImage();
Image
|
}
public static BufferedImage loadImageResource(Class claz, String filePath) {
URL imageURLMain = null;
if (!filePath.startsWith("/")) {
imageURLMain = claz.getResource("/" + filePath);
}
if (imageURLMain == null) {
imageURLMain = claz.getResource(filePath);
}
if (imageURLMain!= null) {
Image original = new ImageIcon(imageURLMain).getImage();
Image
|
Icon originalIcon = new ImageIcon(original);
BufferedImage bufferedImage = new BufferedImage(originalIcon.getIconWidth(), originalIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D
|
CommandThug.java
|
/FileExtraction/Java_unseen/Ph1Lou_WereWolfPlugin/src/main/java/fr/ph1lou/werewolfplugin/commands/roles/neutral/thug/CommandThug.java
|
package fr.ph1lou.werewolfplugin.commands.roles.neutral.thug;
import fr.ph1lou.werewolfapi.annotations.RoleCommand;
import fr.ph1lou.werewolfapi.basekeys.Prefix;
import fr.ph1lou.werewolfapi.basekeys.RoleBase;
import fr.ph1lou.werewolfapi.commands.ICommandRole;
import fr.ph1lou.werewolfapi.enums.StatePlayer;
import fr.ph1lou.werewolfapi.events.UpdateNameTagEvent;
import fr.ph1lou.werewolfapi.events.roles.thug.ThugEvent;
import fr.ph1lou.werewolfapi.game.WereWolfAPI;
import fr.ph1lou.werewolfapi.player.interfaces.IPlayerWW;
import fr.ph1lou.werewolfapi.player.utils.Formatter;
import fr.ph1lou.werewolfapi.role.interfaces.IAffectedPlayers;
import fr.ph1lou.werewolfapi.role.interfaces.IPower;
import fr.ph1lou.werewolfapi.role.interfaces.IRole;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.UUID;
@RoleCommand(key = "werewolf.roles.thug.command",
roleKeys = RoleBase.THUG,
argNumbers = 1,
requiredPower = true)
public class CommandThug implements ICommandRole {
@Override
public void execute(WereWolfAPI game, IPlayerWW playerWW, String[] args) {
IRole thug = playerWW.getRole();
Player playerArg = Bukkit.getPlayer(args[0]);
if (playerArg == null) {
playerWW.sendMessageWithKey(Prefix.RED, "werewolf.check.offline_player");
return;
}
UUID argUUID = playerArg.getUniqueId();
IPlayerWW playerWW1 = game.getPlayerWW(argUUID).orElse(null);
if (playerWW1 == null || !playerWW1.isState(StatePlayer.ALIVE)) {
playerWW.sendMessageWithKey(Prefix.RED, "werewolf.check.player_not_found");
return;
}
if (((IAffectedPlayers) thug).getAffectedPlayers().contains(playerWW1)) {
playerWW.sendMessageWithKey(Prefix.RED, "werewolf.check.already_get_power");
return;
}
((IPower) thug).setPower(false);
ThugEvent thugEvent = new ThugEvent(playerWW, playerWW1);
Bukkit.getPluginManager().callEvent(thugEvent);
if (thugEvent.isCancelled()) {
playerWW.sendMessageWithKey(Prefix.RED, "werewolf.check.cancel");
return;
}
((IAffectedPlayers) thug).clearAffectedPlayer();
((IAffectedPlayers) thug).addAffectedPlayer(playerWW1);
playerWW.sendMessageWithKey(Prefix.YELLOW, "werewolf.roles.thug.perform", Formatter.player(playerWW1.getName()));
playerWW1.sendMessageWithKey(Prefix.RED, "werewolf.roles.thug.alert");
Bukkit.getPluginManager().callEvent(new UpdateNameTagEvent(playerWW1));
}
}
| 2,607
|
Java
|
.java
|
Ph1Lou/WereWolfPlugin
| 21
| 14
| 1
|
2020-02-22T11:52:53Z
|
2024-03-16T20:41:09Z
|
9f37309318b6ae975864061e6cb71e71bc3355015bac00ce67d04fe4c442de5c
|
[] |
[
1337,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
2809,
51,
7626,
51,
9716,
51,
14662,
51,
368,
905,
64,
222,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
8839,
51,
4555,
2037,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
1460,
3519,
51,
5429,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
1460,
3519,
51,
4555,
1778,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
7626,
51,
1122,
38987,
4555,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
20767,
51,
1095,
3516,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
5070,
51,
2346,
577,
2649,
1167,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
5070,
51,
9716,
51,
368,
905,
51,
1047,
905,
1167,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
3642,
51,
92,
767,
92,
24599,
2571,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
3857,
51,
11204,
51,
2046,
1842,
18872,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
3857,
51,
2324,
51,
8748,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
7851,
505,
1576,
17670,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
2046,
2139,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
3914,
2652,
64,
222,
485,
1105,
51,
20402,
51,
982,
17120,
64,
222,
485,
1105,
51,
20402,
51,
2244,
51,
3516,
64,
222,
222,
485,
1401,
51,
1058,
51,
7604,
64,
222,
222,
69,
4555,
2037,
45,
697,
299,
332,
4533,
412,
24599,
51,
9716,
51,
368,
905,
51,
2514,
411,
310,
4218,
5044,
299,
13936,
1778,
51,
1797,
18716,
49,
310,
1657,
14847,
299,
244,
54,
49,
310,
2147,
6790,
299,
878,
46,
222,
942,
462,
5730,
1047,
905,
4584,
37608,
4555,
320,
465,
496,
1806,
303,
581,
782,
5755,
45,
92,
767,
92,
24599,
2571,
4204,
49,
457,
3516,
18872,
4376,
18872,
49,
910,
1197,
2194,
46,
320,
603,
457,
4555,
379,
905,
299,
4376,
18872,
51,
390,
4555,
492,
603,
9306,
4376,
1782,
299,
2755,
17120,
51,
32872,
45,
1150,
96,
53,
2004,
603,
434,
327,
3857,
1782,
630,
762,
46,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
1571,
51,
23687,
100,
3857,
742,
343,
461,
64,
310,
339,
310,
14286,
1657,
7604,
299,
4376,
1782,
51,
390,
34245,
492,
310,
457,
3516,
18872,
4376,
18872,
54,
299,
4204,
51,
32872,
18872,
45,
645,
7604,
566,
26628,
45,
1710,
312,
603,
434,
327,
3857,
18872,
54,
630,
762,
1293,
673,
3857,
18872,
54,
51,
316,
1095,
45,
1095,
3516,
51,
744,
5765,
509,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
1571,
51,
3857,
100,
1226,
100,
6271,
742,
343,
461,
64,
310,
339,
603,
434,
8587,
7851,
505,
1576,
17670,
46,
379,
905,
566,
390,
39401,
17670,
941,
4766,
45,
3857,
18872,
54,
509,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
1571,
51,
22425,
100,
390,
100,
7404,
742,
343,
461,
64,
310,
339,
6934,
1849,
2046,
2139,
46,
379,
905,
566,
489,
6790,
45,
1886,
312,
603,
967,
905,
1167,
379,
905,
1167,
299,
556,
967,
905,
1167,
45,
3857,
18872,
49,
4376,
18872,
54,
312,
603,
2755,
17120,
51,
390,
43417,
941,
1872,
1167,
45,
368,
905,
1167,
312,
603,
434,
327,
368,
905,
1167,
51,
316,
23092,
1177,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
1571,
51,
8158,
742,
343,
461,
64,
310,
339,
603,
1849,
7851,
505,
1576,
17670,
46,
379,
905,
566,
3830,
39401,
3516,
492,
310,
1849,
7851,
505,
1576,
17670,
46,
379,
905,
566,
688,
39401,
3516,
45,
3857,
18872,
54,
312,
603,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
38076,
49,
332,
4533,
412,
24599,
51,
9716,
51,
368,
905,
51,
14426,
411,
47436,
51,
3857,
45,
3857,
18872,
54,
51,
5175,
5086,
603,
4376,
18872,
54,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
9716,
51,
368,
905,
51,
4805,
742,
603,
2755,
17120,
51,
390,
43417,
941,
1872,
1167,
45,
909,
4013,
577,
2649,
1167,
45,
3857,
18872,
54,
894,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
] | 802
|
[
3857,
51,
11204,
51,
2046,
1842,
18872,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
3857,
51,
2324,
51,
8748,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
7851,
505,
1576,
17670,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
2046,
2139,
64,
222,
485,
4953,
51,
853,
54,
335,
122,
51,
4533,
412,
24599,
1256,
51,
4315,
51,
11204,
51,
3914,
2652,
64,
222,
485,
1105,
51,
20402,
51,
982,
17120,
64,
222,
485,
1105,
51,
20402,
51,
2244,
51,
3516,
64,
222,
222,
485,
1401,
51,
1058,
51,
7604,
64,
222,
222,
69,
4555,
2037,
45,
697,
299,
332,
4533,
412,
24599,
51,
9716,
51,
368,
905,
51,
2514,
411,
310,
4218,
5044,
299,
13936,
1778,
51,
1797,
18716,
49,
310,
1657,
14847,
299,
244,
54,
49,
310,
2147,
6790,
299,
878,
46,
222,
942,
462,
5730,
1047,
905,
4584,
37608,
4555,
320,
465,
496,
1806,
303,
581,
782,
5755,
45,
92,
767,
92,
24599,
2571,
4204,
49,
457,
3516,
18872,
4376,
18872,
49,
910,
1197,
2194,
46,
320,
603,
457,
4555,
379,
905,
299,
4376,
18872,
51,
390,
4555,
492,
603,
9306,
4376,
1782,
299,
2755,
17120,
51,
32872,
45,
1150,
96,
53,
2004,
603,
434,
327,
3857,
1782,
630,
762,
46,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412,
24599,
51,
1571,
51,
23687,
100,
3857,
742,
343,
461,
64,
310,
339,
310,
14286,
1657,
7604,
299,
4376,
1782,
51,
390,
34245,
492,
310,
457,
3516,
18872,
4376,
18872,
54,
299,
4204,
51,
32872,
18872,
45,
645,
7604,
566,
26628,
45,
1710,
312,
603,
434,
327,
3857,
18872,
54
] | 7,594,164,945,313,312,000
| true
| false
| false
| false
|
[
49,
310,
1657,
14847,
299,
244,
54,
49,
310,
2147,
6790,
299,
878,
46,
222,
942,
462,
5730,
1047,
905,
4584,
37608,
4555,
320,
465,
496,
1806,
303,
581,
782,
5755,
45,
92,
767,
92,
24599,
2571,
4204,
49,
457,
3516,
18872,
4376,
18872,
49,
910,
1197,
2194,
46,
320,
603,
457,
4555,
379,
905,
299,
4376,
18872,
51,
390,
4555,
492,
603,
9306,
4376,
1782,
299,
2755,
17120,
51,
32872,
45,
1150,
96,
53,
2004,
603,
434,
327,
3857,
1782,
630,
762,
46,
320,
343,
4376,
18872,
51,
19693,
1569,
971,
45,
5429,
51,
7106,
49,
332,
4533,
412
] | 7,318,085,495,870,163,000
| true
|
player.interfaces.IPlayerWW;
import fr.ph1lou.werewolfapi.player.utils.Formatter;
import fr.ph1lou.werewolfapi.role.interfaces.IAffectedPlayers;
import fr.ph1lou.werewolfapi.role.interfaces.IPower;
import fr.ph1lou.werewolfapi.role.interfaces.IRole;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.UUID;
@RoleCommand(key = "werewolf.roles.thug.command",
roleKeys = RoleBase.THUG,
argNumbers = 1,
requiredPower = true)
public class CommandThug implements ICommandRole {
@Override
public void execute(WereWolfAPI game, IPlayerWW playerWW, String[] args) {
IRole thug = playerWW.getRole();
Player playerArg = Bukkit.getPlayer(args[0]);
if (playerArg == null) {
playerWW.sendMessageWithKey(Prefix.RED, "werew
|
;
import fr.ph1lou.werewolfapi.role.interfaces.IPower;
import fr.ph1lou.werewolfapi.role.interfaces.IRole;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.UUID;
@RoleCommand(key = "werewolf.roles.thug.command",
roleKeys = RoleBase.THUG,
argNumbers = 1,
requiredPower = true)
public class CommandThug implements ICommandRole {
@Override
public void execute(WereWolfAPI game, IPlayerWW playerWW, String[] args) {
IRole thug = playerWW.getRole();
Player playerArg = Bukkit.getPlayer(args[0]);
if (playerArg == null) {
playerWW.sendMessageWithKey(Prefix.RED, "werew
|
kkit;
import org.bukkit.entity.Player;
import java.util.UUID;
@RoleCommand(key = "werewolf.roles.thug.command",
roleKeys = RoleBase.THUG,
argNumbers = 1,
requiredPower = true)
public class CommandThug implements ICommandRole {
@Override
public void execute(WereWolfAPI game, IPlayerWW playerWW, String[] args) {
IRole thug = playerWW.getRole();
Player playerArg = Bukkit.getPlayer(args[0]);
if (playerArg == null) {
playerWW.sendMessageWithKey(Prefix.RED, "werew
|
,
argNumbers = 1,
requiredPower = true)
public class CommandThug implements ICommandRole {
@Override
public void execute(WereWolfAPI game, IPlayerWW playerWW, String[] args) {
IRole thug = playerWW.getRole();
Player playerArg = Bukkit.getPlayer(args[0]);
if (playerArg == null) {
playerWW.sendMessageWithKey(Prefix.RED, "werew
|
olf.check.offline_player");
return;
}
UUID argUUID = playerArg.getUniqueId();
IPlayerWW playerWW1 = game.getPlayerWW(argUUID).orElse(null);
if (playerWW1
|
Messages.java
|
/FileExtraction/Java_unseen/AlessioDP_LastLoginAPI/common/src/main/java/com/alessiodp/lastloginapi/common/configuration/data/Messages.java
|
package com.alessiodp.lastloginapi.common.configuration.data;
import com.alessiodp.core.common.configuration.ConfigOption;
import com.alessiodp.core.common.configuration.ConfigurationFile;
import com.alessiodp.lastloginapi.common.LastLoginPlugin;
import java.util.List;
public abstract class Messages extends ConfigurationFile {
// LastLoginAPI messages
@ConfigOption(path = "lastloginapi.update-available")
public static String LLAPI_UPDATEAVAILABLE;
@ConfigOption(path = "lastloginapi.configuration-outdated")
public static String LLAPI_CONFIGURATION_OUTDATED;
@ConfigOption(path = "lastloginapi.no-permission")
public static String LLAPI_NOPERMISSION;
@ConfigOption(path = "lastloginapi.common-messages.invalid-command")
public static String LLAPI_COMMON_INVALIDCMD;
@ConfigOption(path = "lastloginapi.common-messages.configuration-reloaded")
public static String LLAPI_COMMON_CONFIGRELOAD;
@ConfigOption(path = "lastloginapi.syntax.wrong-message")
public static String LLAPI_SYNTAX_WRONGMESSAGE;
@ConfigOption(path = "lastloginapi.syntax.player")
public static String LLAPI_SYNTAX_PLAYER;
@ConfigOption(path = "lastloginapi.syntax.unknown")
public static String LLAPI_SYNTAX_UNKNOWN;
// Commands messages
@ConfigOption(path = "commands.info.header")
public static String CMD_INFO_HEADER;
@ConfigOption(path = "commands.info.text")
public static List<String> CMD_INFO_TEXT;
@ConfigOption(path = "commands.info.footer")
public static String CMD_INFO_FOOTER;
@ConfigOption(path = "commands.info.player-not-found")
public static String CMD_INFO_PLAYERNOTFOUND;
@ConfigOption(path = "commands.version.updated")
public static String CMD_VERSION_UPDATED;
@ConfigOption(path = "commands.version.outdated")
public static String CMD_VERSION_OUTDATED;
// Help messages
@ConfigOption(path = "help.header")
public static String HELP_HEADER;
@ConfigOption(path = "help.footer")
public static String HELP_FOOTER;
@ConfigOption(path = "help.perform-command")
public static String HELP_PERFORM_COMMAND;
@ConfigOption(path = "help.console-help.header")
public static String HELP_CONSOLEHELP_HEADER;
@ConfigOption(path = "help.console-help.command")
public static String HELP_CONSOLEHELP_COMMAND;
@ConfigOption(path = "help.commands.help")
public static String HELP_CMD_HELP;
@ConfigOption(path = "help.commands.info")
public static String HELP_CMD_INFO;
@ConfigOption(path = "help.commands.reload")
public static String HELP_CMD_RELOAD;
@ConfigOption(path = "help.commands.version")
public static String HELP_CMD_VERSION;
@ConfigOption(path = "help.command-descriptions.help")
public static String HELP_CMD_DESCRIPTIONS_HELP;
@ConfigOption(path = "help.command-descriptions.info")
public static String HELP_CMD_DESCRIPTIONS_INFO;
@ConfigOption(path = "help.command-descriptions.reload")
public static String HELP_CMD_DESCRIPTIONS_RELOAD;
@ConfigOption(path = "help.command-descriptions.version")
public static String HELP_CMD_DESCRIPTIONS_VERSION;
protected Messages(LastLoginPlugin plugin) {
super(plugin);
}
}
| 3,084
|
Java
|
.java
|
AlessioDP/LastLoginAPI
| 11
| 1
| 6
|
2019-04-08T21:17:12Z
|
2023-03-27T04:59:34Z
|
d5a060c3fa867c4adba6a43aed0f119c7ab9cc0e054530cee4fbf8505b6cba5c
|
[] |
[
1337,
785,
51,
1572,
441,
3571,
117,
51,
2153,
3632,
1256,
51,
2297,
51,
5990,
51,
624,
64,
222,
222,
485,
785,
51,
1572,
441,
3571,
117,
51,
1284,
51,
2297,
51,
5990,
51,
1081,
2846,
64,
222,
485,
785,
51,
1572,
441,
3571,
117,
51,
1284,
51,
2297,
51,
5990,
51,
2339,
991,
64,
222,
485,
785,
51,
1572,
441,
3571,
117,
51,
2153,
3632,
1256,
51,
2297,
51,
3283,
5333,
4168,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
5560,
462,
22617,
2041,
8149,
991,
320,
222,
221,
325,
11321,
5333,
2571,
5231,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
1896,
50,
7249,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
8760,
25390,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
5990,
50,
560,
2599,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
35637,
100,
4256,
73,
8153,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
1365,
50,
9207,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
83,
13349,
21795,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
2297,
50,
6296,
51,
5798,
50,
2514,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
22092,
100,
8614,
8193,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
2297,
50,
6296,
51,
5990,
50,
287,
5907,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
22092,
100,
6196,
632,
5703,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
19696,
50,
1454,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
46764,
9570,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
3857,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
19409,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
6887,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
14165,
64,
26000,
221,
325,
24194,
5231,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
2127,
678,
222,
221,
942,
924,
910,
23411,
100,
1608,
100,
10862,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
897,
678,
222,
221,
942,
924,
1701,
65,
671,
67,
23411,
100,
1608,
100,
6025,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
4813,
678,
222,
221,
942,
924,
910,
23411,
100,
1608,
100,
1380,
42530,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
3857,
50,
1226,
50,
6271,
678,
222,
221,
942,
924,
910,
23411,
100,
1608,
100,
19409,
3922,
13189,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1687,
51,
6379,
678,
222,
221,
942,
924,
910,
23411,
100,
4539,
100,
44086,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1687,
51,
560,
2599,
678,
222,
221,
942,
924,
910,
23411,
100,
4539,
100,
4256,
73,
8153,
64,
26000,
221,
325,
16899,
5231,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
2127,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
10862,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
4813,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
1380,
42530,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
14426,
50,
2514,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
3703,
5071,
100,
12251,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
4482,
50,
4771,
51,
2127,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
42439,
31504,
100,
10862,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
4482,
50,
4771,
51,
2514,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
42439,
31504,
100,
12251,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
7626,
51,
4771,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
31504,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
7626,
51,
1357,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
1608,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
7626,
51,
12998,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
632,
5703,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
7626,
51,
1687,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
4539,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
2514,
50,
34171,
51,
4771,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
17519,
88,
100,
31504,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
2514,
50,
34171,
51,
1357,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
17519,
88,
100,
1608,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
2514,
50,
34171,
51,
12998,
678,
222,
221,
942,
924,
910,
37867,
85,
100,
8193,
100,
17519,
88,
100,
632,
5703,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
4771,
51,
2514,
50,
34171,
51,
1687,
678,
222,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
942,
924,
910,
14325,
2571,
100,
35637,
100,
4256,
73,
8153,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
1365,
50,
9207,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
83,
13349,
21795,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
2297,
50,
6296,
51,
5798,
50,
2514,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
22092,
100,
8614,
8193,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
2297,
50,
6296,
51,
5990,
50,
287,
5907,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
22092,
100,
6196,
632,
5703,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
19696,
50,
1454,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
46764,
9570,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
3857,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
19409,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
6887,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
14165,
64,
26000,
221,
325,
24194,
5231,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
2127,
678,
222,
221,
942,
924,
910,
23411,
100,
1608,
100,
10862,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
7626,
51,
1357,
51,
897,
678,
222,
221,
942,
924,
1701,
65
] | 8,152,434,412,425,729,000
| true
| false
| false
| false
|
[
100,
6196,
632,
5703,
64,
3038,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
19696,
50,
1454,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
46764,
9570,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
3857,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
19409,
64,
222,
221,
69,
1081,
2846,
45,
1005,
299,
332,
2153,
3632,
1256,
51,
8147,
51,
6887,
678,
222,
221,
942,
924,
910,
14325,
2571,
100,
3692,
43161,
100,
14165,
64,
26000,
221
] | 472,417,535,315,906,800
| true
|
Option(path = "lastloginapi.update-available")
public static String LLAPI_UPDATEAVAILABLE;
@ConfigOption(path = "lastloginapi.configuration-outdated")
public static String LLAPI_CONFIGURATION_OUTDATED;
@ConfigOption(path = "lastloginapi.no-permission")
public static String LLAPI_NOPERMISSION;
@ConfigOption(path = "lastloginapi.common-messages.invalid-command")
public static String LLAPI_COMMON_INVALIDCMD;
@ConfigOption(path = "lastloginapi.common-messages.configuration-reloaded")
public static String LLAPI_COMMON_CONFIGRELOAD;
@ConfigOption(path = "lastloginapi.syntax.wrong-message")
public static String LLAPI_SYNTAX_WRONGMESSAGE;
@ConfigOption(path = "lastloginapi.syntax.player")
public static String LLAPI_SYNTAX_PLAYER;
@ConfigOption(path = "lastloginapi.syntax.unknown")
public static String LLAPI_SYNTAX_UNKNOWN;
|
CONFIGURATION_OUTDATED;
@ConfigOption(path = "lastloginapi.no-permission")
public static String LLAPI_NOPERMISSION;
@ConfigOption(path = "lastloginapi.common-messages.invalid-command")
public static String LLAPI_COMMON_INVALIDCMD;
@ConfigOption(path = "lastloginapi.common-messages.configuration-reloaded")
public static String LLAPI_COMMON_CONFIGRELOAD;
@ConfigOption(path = "lastloginapi.syntax.wrong-message")
public static String LLAPI_SYNTAX_WRONGMESSAGE;
@ConfigOption(path = "lastloginapi.syntax.player")
public static String LLAPI_SYNTAX_PLAYER;
@ConfigOption(path = "lastloginapi.syntax.unknown")
public static String LLAPI_SYNTAX_UNKNOWN;
|
messages.invalid-command")
public static String LLAPI_COMMON_INVALIDCMD;
@ConfigOption(path = "lastloginapi.common-messages.configuration-reloaded")
public static String LLAPI_COMMON_CONFIGRELOAD;
@ConfigOption(path = "lastloginapi.syntax.wrong-message")
public static String LLAPI_SYNTAX_WRONGMESSAGE;
@ConfigOption(path = "lastloginapi.syntax.player")
public static String LLAPI_SYNTAX_PLAYER;
@ConfigOption(path = "lastloginapi.syntax.unknown")
public static String LLAPI_SYNTAX_UNKNOWN;
|
_CONFIGRELOAD;
@ConfigOption(path = "lastloginapi.syntax.wrong-message")
public static String LLAPI_SYNTAX_WRONGMESSAGE;
@ConfigOption(path = "lastloginapi.syntax.player")
public static String LLAPI_SYNTAX_PLAYER;
@ConfigOption(path = "lastloginapi.syntax.unknown")
public static String LLAPI_SYNTAX_UNKNOWN;
|
// Commands messages
@ConfigOption(path = "commands.info.header")
public static String CMD_INFO_HEADER;
@ConfigOption(path = "commands.info.text")
public static List<
|
ChatMessageTest.java
|
/FileExtraction/Java_unseen/V0G3L_treff_/client/app/src/test/java/org/pispeb/treffpunkt/client/data/entities/ChatMessageTest.java
|
package org.pispeb.treffpunkt.client.data.entities;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Created by matth on 11.03.2018.
*/
public class ChatMessageTest extends AbstractEntityTest{
protected ChatMessage message2 =
new ChatMessage(ids[0], messageStrings[0], ids[1], names[0], date1);
protected ChatMessage message3 =
new ChatMessage(ids[0], messageStrings[0], ids[1], names[0], date1);
@Test
public void getMessageId() throws Exception {
assertEquals(0, message1.getMessageId());
}
@Test
public void setMessageId() throws Exception {
message2.setMessageId(1);
assertEquals(1, message2.getMessageId());
}
@Test
public void getGroupId() throws Exception {
assertEquals(69, message1.getGroupId());
}
@Test
public void setGroupId() throws Exception {
message2.setGroupId(9997);
assertEquals(9997, message2.getGroupId());
}
@Test
public void getContent() throws Exception {
assertEquals("Hallo", message1.getContent());
}
@Test
public void setContent() throws Exception {
message2.setContent("NEIN");
//Getter is already tested
assertEquals("NEIN", message2.getContent());
}
@Test
public void getUserId() throws Exception {
assertEquals(88, message1.getUserId());
}
@Test
public void setUserId() throws Exception {
message2.setUserId(99143);
assertEquals(99143, message2.getUserId());
}
@Test
public void getUsername() throws Exception {
assertEquals("Hans", message1.getUsername());
}
@Test
public void setUsername() throws Exception {
message2.setUsername("Wurst");
assertEquals("Wurst", message2.getUsername());
}
@Test
public void getTimeSent() throws Exception {
assertEquals(date1, message1.getTimeSent());
}
@Test
public void setTimeSent() throws Exception {
message2.setTimeSent(date2);
assertEquals(date2, message2.getTimeSent());
}
@Test
public void equalContent() throws Exception {
assertTrue("same message", message1.equalContent(message1));
assertTrue("different messages", message1.equalContent(message3));
}
@Test
public void equals() throws Exception {
assertTrue("same message", message1.equals(message1));
assertTrue("different messages", message1.equals(message3));
}
}
| 2,515
|
Java
|
.java
|
V0G3L/treff.
| 9
| 0
| 0
|
2017-11-03T12:43:57Z
|
2018-09-26T00:05:48Z
|
a36ca12b14f8ac1c913dd7bd01089dcf018debbc6ecfadef6eafdb2c888375d9
|
[] |
[
1337,
1105,
51,
29781,
367,
103,
51,
5325,
505,
117,
32293,
51,
1598,
51,
624,
51,
9259,
64,
222,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
222,
485,
924,
1105,
51,
3946,
51,
3285,
7737,
222,
222,
1350,
222,
338,
6956,
829,
2525,
368,
563,
244,
54,
54,
51,
53,
56,
51,
55,
53,
54,
61,
51,
222,
588,
222,
942,
462,
16083,
1193,
1024,
2041,
7406,
2234,
1024,
128,
465,
2532,
16083,
1193,
1492,
55,
299,
343,
556,
16083,
1193,
45,
3653,
96,
53,
636,
1492,
9634,
96,
53,
636,
9673,
96,
54,
636,
4492,
96,
53,
636,
2361,
54,
312,
465,
2532,
16083,
1193,
1492,
56,
299,
343,
556,
16083,
1193,
45,
3653,
96,
53,
636,
1492,
9634,
96,
53,
636,
9673,
96,
54,
636,
4492,
96,
53,
636,
2361,
54,
312,
465,
496,
1024,
303,
581,
782,
40451,
625,
365,
2589,
3284,
320,
310,
3803,
45,
53,
49,
1492,
54,
51,
7724,
625,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
41348,
365,
2589,
3284,
320,
310,
1492,
55,
51,
28901,
625,
45,
54,
312,
310,
3803,
45,
54,
49,
1492,
55,
51,
7724,
625,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
19794,
365,
2589,
3284,
320,
310,
3803,
45,
59,
62,
49,
1492,
54,
51,
390,
19794,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
19794,
365,
2589,
3284,
320,
310,
1492,
55,
51,
489,
19794,
45,
62,
62,
62,
60,
312,
310,
3803,
45,
62,
62,
62,
60,
49,
1492,
55,
51,
390,
19794,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
36828,
365,
2589,
3284,
320,
310,
3803,
459,
36013,
335,
411,
1492,
54,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
1795,
365,
2589,
3284,
320,
310,
1492,
55,
51,
29480,
459,
3585,
540,
742,
310,
453,
11722,
458,
3443,
10116,
310,
3803,
459,
3585,
540,
411,
1492,
55,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
10223,
365,
2589,
3284,
320,
310,
3803,
45,
61,
61,
49,
1492,
54,
51,
41301,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
10223,
365,
2589,
3284,
320,
310,
1492,
55,
51,
489,
10223,
45,
62,
62,
54,
57,
56,
312,
310,
3803,
45,
62,
62,
54,
57,
56,
49,
1492,
55,
51,
41301,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
8655,
365,
2589,
3284,
320,
310,
3803,
459,
77,
711,
411,
1492,
54,
51,
38225,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
8655,
365,
2589,
3284,
320,
310,
1492,
55,
51,
489,
8655,
459,
92,
324,
289,
742,
310,
3803,
459,
92,
324,
289,
411,
1492,
55,
51,
38225,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
45940,
10486,
365,
2589,
3284,
320,
310,
3803,
45,
787,
54,
49,
1492,
54,
51,
11960,
10486,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
1061,
10486,
365,
2589,
3284,
320,
310,
1492,
55,
51,
34453,
10486,
45,
787,
55,
312,
310,
3803,
45,
787,
55,
49,
1492,
55,
51,
11960,
10486,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
5058,
1795,
365,
2589,
3284,
320,
310,
9396,
459,
8813,
1492,
411,
1492,
54,
51,
2247,
1795,
45,
1454,
54,
894,
310,
9396,
459,
23645,
5231,
411,
1492,
54,
51,
2247,
1795,
45,
1454,
56,
894,
303,
339,
465,
496,
1024,
303,
581,
782,
12432,
365,
2589,
3284,
320,
310,
9396,
459,
8813,
1492,
411,
1492,
54,
51,
3591,
45,
1454,
54,
894,
310,
9396,
459,
23645,
5231,
411,
1492,
54,
51,
3591,
45,
1454,
56,
894,
303,
339,
222,
222,
130
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 604
|
[
1492,
56,
299,
343,
556,
16083,
1193,
45,
3653,
96,
53,
636,
1492,
9634,
96,
53,
636,
9673,
96,
54,
636,
4492,
96,
53,
636,
2361,
54,
312,
465,
496,
1024,
303,
581,
782,
40451,
625,
365,
2589,
3284,
320,
310,
3803,
45,
53,
49,
1492,
54,
51,
7724,
625,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
41348,
365,
2589,
3284,
320,
310,
1492,
55,
51,
28901,
625,
45,
54,
312,
310,
3803,
45,
54,
49,
1492,
55,
51,
7724,
625,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
19794,
365,
2589,
3284,
320,
310,
3803,
45,
59,
62,
49,
1492,
54,
51,
390,
19794,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
19794,
365,
2589,
3284,
320,
310,
1492,
55,
51,
489,
19794,
45,
62,
62,
62,
60,
312,
310,
3803,
45,
62,
62,
62,
60,
49,
1492,
55,
51,
390,
19794,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
36828,
365,
2589,
3284,
320,
310,
3803,
459,
36013,
335,
411,
1492,
54,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
1795,
365,
2589,
3284,
320,
310,
1492,
55,
51,
29480,
459,
3585,
540,
742,
310,
453,
11722,
458,
3443,
10116,
310,
3803,
459,
3585,
540,
411,
1492,
55,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
10223,
365,
2589,
3284,
320,
310,
3803,
45,
61,
61,
49,
1492,
54,
51,
41301,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
10223,
365,
2589,
3284,
320,
310,
1492,
55,
51,
489,
10223,
45,
62,
62,
54,
57,
56,
312,
310,
3803,
45,
62,
62,
54,
57,
56,
49,
1492,
55,
51,
41301,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
8655,
365,
2589,
3284,
320,
310,
3803,
459,
77,
711
] | 5,421,733,108,956,228,000
| true
| false
| false
| false
|
[
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
36828,
365,
2589,
3284,
320,
310,
3803,
459,
36013,
335,
411,
1492,
54,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
1795,
365,
2589,
3284,
320,
310,
1492,
55,
51,
29480,
459,
3585,
540,
742,
310,
453,
11722,
458,
3443,
10116,
310,
3803,
459,
3585,
540,
411,
1492,
55,
51,
16618,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
640,
10223,
365,
2589,
3284,
320,
310,
3803,
45,
61,
61,
49,
1492,
54,
51,
41301,
1052,
303,
339,
465,
496,
1024,
303,
581,
782,
758,
10223
] | -8,585,870,776,247,804,000
| true
|
message3 =
new ChatMessage(ids[0], messageStrings[0], ids[1], names[0], date1);
@Test
public void getMessageId() throws Exception {
assertEquals(0, message1.getMessageId());
}
@Test
public void setMessageId() throws Exception {
message2.setMessageId(1);
assertEquals(1, message2.getMessageId());
}
@Test
public void getGroupId() throws Exception {
assertEquals(69, message1.getGroupId());
}
@Test
public void setGroupId() throws Exception {
message2.setGroupId(9997);
assertEquals(9997, message2.getGroupId());
}
@Test
public void getContent() throws Exception {
assertEquals("Hallo", message1.getContent());
}
@Test
public void setContent() throws Exception {
message2.setContent("NEIN");
//Getter is already tested
assertEquals("NEIN", message2.getContent());
}
@Test
public void getUserId() throws Exception {
assertEquals(88, message1.getUserId());
}
@Test
public void setUserId
|
());
}
@Test
public void setMessageId() throws Exception {
message2.setMessageId(1);
assertEquals(1, message2.getMessageId());
}
@Test
public void getGroupId() throws Exception {
assertEquals(69, message1.getGroupId());
}
@Test
public void setGroupId() throws Exception {
message2.setGroupId(9997);
assertEquals(9997, message2.getGroupId());
}
@Test
public void getContent() throws Exception {
assertEquals("Hallo", message1.getContent());
}
@Test
public void setContent() throws Exception {
message2.setContent("NEIN");
//Getter is already tested
assertEquals("NEIN", message2.getContent());
}
@Test
public void getUserId() throws Exception {
assertEquals(88, message1.getUserId());
}
@Test
public void setUserId
|
assertEquals(69, message1.getGroupId());
}
@Test
public void setGroupId() throws Exception {
message2.setGroupId(9997);
assertEquals(9997, message2.getGroupId());
}
@Test
public void getContent() throws Exception {
assertEquals("Hallo", message1.getContent());
}
@Test
public void setContent() throws Exception {
message2.setContent("NEIN");
//Getter is already tested
assertEquals("NEIN", message2.getContent());
}
@Test
public void getUserId() throws Exception {
assertEquals(88, message1.getUserId());
}
@Test
public void setUserId
|
());
}
@Test
public void getContent() throws Exception {
assertEquals("Hallo", message1.getContent());
}
@Test
public void setContent() throws Exception {
message2.setContent("NEIN");
//Getter is already tested
assertEquals("NEIN", message2.getContent());
}
@Test
public void getUserId() throws Exception {
assertEquals(88, message1.getUserId());
}
@Test
public void setUserId
|
() throws Exception {
message2.setUserId(99143);
assertEquals(99143, message2.getUserId());
}
@Test
public void getUsername() throws Exception {
assertEquals("Hans
|
BaseSetOperateOnDiffActionTest.java
|
/FileExtraction/Java_unseen/uyuni-project_uyuni/java/code/src/com/redhat/rhn/frontend/action/common/test/BaseSetOperateOnDiffActionTest.java
|
/*
* Copyright (c) 2009--2012 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
* implied, including the implied warranties of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
* along with this software; if not, see
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* Red Hat trademarks are not licensed under GPLv2. No permission is
* granted to use or replicate Red Hat trademarks that are incorporated
* in this software or its documentation.
*/
package com.redhat.rhn.frontend.action.common.test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.redhat.rhn.domain.kickstart.KickstartData;
import com.redhat.rhn.domain.kickstart.test.KickstartDataTest;
import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.domain.token.ActivationKey;
import com.redhat.rhn.domain.token.ActivationKeyFactory;
import com.redhat.rhn.domain.token.test.ActivationKeyTest;
import com.redhat.rhn.frontend.action.kickstart.ActivationKeysSubmitAction;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.taglibs.ListDisplayTag;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.testing.RhnPostMockStrutsTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.junit.jupiter.api.Test;
/**
* BaseSetOperateOnDiffActionTest
*/
public class BaseSetOperateOnDiffActionTest extends RhnPostMockStrutsTestCase {
// We use activation keys <-> to kickstart profile to test this.
// I wanted to make sure we had a specific test class that was tied
// to this baseclass since its complex and needs tests geared towards
// it.
@Test
public void testSelectAll() throws Exception {
KickstartData ksdata = KickstartDataTest.createKickstartWithOptions(user.getOrg());
for (int i = 0; i < 5; i++) {
ActivationKey key = ActivationKeyFactory.createNewKey(user,
TestUtils.randomString());
ActivationKeyFactory.save(key);
TestUtils.flushAndEvict(key);
}
assertTrue((ksdata.getDefaultRegTokens() == null ||
ksdata.getDefaultRegTokens().isEmpty()));
setRequestPathInfo("/kickstart/ActivationKeysSubmit");
addSelectedItem(ActivationKeyTest.createTestActivationKey(user,
ServerFactoryTest.createTestServer(user)).getId());
addDispatchCall(ListDisplayTag.SELECT_ALL_KEY);
actionPerform();
assertTrue(
RhnSetDecl.KICKSTART_ACTIVATION_KEYS.get(user).getElements().size() >= 5);
clearRequestParameters();
addRequestParameter(RequestContext.KICKSTART_ID, ksdata.getId().toString());
addDispatchCall(ActivationKeysSubmitAction.UPDATE_METHOD);
actionPerform();
verifyActionMessage("kickstart_activation_keys.added");
assertTrue((ksdata.getDefaultRegTokens() != null &&
!ksdata.getDefaultRegTokens().isEmpty()));
}
}
| 3,121
|
Java
|
.java
|
uyuni-project/uyuni
| 398
| 165
| 434
|
2018-08-02T12:31:20Z
|
2024-05-09T07:43:52Z
|
ca4a0493f78cbc19d058e8c5846a8678de5f21f703ba00175dc0682b19c4c46a
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
62,
306,
55,
53,
54,
55,
4777,
30044,
49,
6367,
51,
222,
338,
222,
338,
1369,
2951,
458,
14391,
391,
863,
1549,
341,
6994,
6153,
5062,
1196,
49,
222,
338,
1522,
244,
55,
327,
21156,
123,
55,
566,
5825,
458,
4452,
9345,
456,
477,
2951,
49,
3927,
575,
222,
338,
4506,
49,
6252,
341,
4506,
13085,
710,
753,
451,
7934,
575,
8114,
222,
338,
4800,
418,
7848,
7763,
51,
2469,
1414,
1178,
6589,
331,
1948,
451,
23508,
123,
55,
222,
338,
7979,
642,
477,
2951,
64,
434,
666,
49,
2337,
222,
338,
1930,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
1477,
50,
4205,
52,
43817,
50,
55,
51,
53,
51,
2787,
51,
222,
338,
222,
338,
4777,
30044,
16712,
5525,
904,
666,
14391,
1549,
23508,
123,
55,
51,
3155,
6504,
458,
222,
338,
11495,
391,
813,
575,
33145,
4777,
30044,
16712,
5525,
708,
904,
26356,
751,
222,
338,
347,
477,
2951,
575,
2840,
4349,
51,
222,
588,
222,
1337,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
1160,
51,
2297,
51,
881,
64,
222,
222,
485,
924,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
16980,
51,
6553,
64,
222,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
30492,
1384,
51,
47297,
1384,
768,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
30492,
1384,
51,
881,
51,
47297,
1384,
768,
1024,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1805,
51,
881,
51,
2077,
2232,
1024,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
17576,
971,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
17576,
971,
2232,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
881,
51,
17576,
971,
1024,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
1160,
51,
30492,
1384,
51,
17576,
5044,
7468,
1728,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
48901,
51,
38989,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
2159,
8828,
51,
739,
3948,
2649,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4031,
51,
119,
12704,
489,
51,
87,
12704,
903,
5495,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4280,
51,
87,
12704,
3176,
3672,
2026,
16566,
7246,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4280,
51,
32384,
64,
222,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
1024,
64,
222,
222,
1350,
222,
338,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
222,
588,
222,
942,
462,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
2041,
578,
12704,
3176,
3672,
2026,
16566,
7246,
320,
465,
453,
2726,
813,
13626,
5050,
350,
415,
391,
30275,
1384,
6283,
391,
913,
477,
51,
303,
453,
457,
13583,
391,
1949,
3673,
1019,
5069,
331,
2835,
913,
462,
708,
1616,
43975,
303,
453,
391,
477,
1712,
842,
4577,
2840,
8667,
480,
5669,
3326,
3244,
1961,
22095,
303,
453,
580,
51,
303,
496,
1024,
303,
581,
782,
913,
1926,
1947,
365,
2589,
3284,
320,
603,
1242,
1246,
1384,
768,
32060,
624,
299,
1242,
1246,
1384,
768,
1024,
51,
1315,
47297,
1384,
38274,
45,
514,
51,
390,
6512,
1052,
310,
456,
327,
429,
613,
299,
244,
53,
64,
613,
350,
244,
58,
64,
613,
2002,
320,
343,
35619,
971,
1221,
299,
35619,
971,
2232,
51,
42594,
971,
45,
514,
49,
547,
40098,
51,
3917,
671,
1052,
343,
35619,
971,
2232,
51,
2882,
45,
697,
312,
343,
40098,
51,
9327,
2199,
17606,
3607,
45,
697,
312,
310,
339,
310,
9396,
1181,
5532,
624,
51,
13729,
3357,
10915,
365,
630,
762,
1293,
419,
32060,
624,
51,
13729,
3357,
10915,
941,
6401,
5086,
310,
758,
1123,
1233,
1139,
4229,
30492,
1384,
52,
17576,
5044,
7468,
742,
310,
1035,
34677,
45,
17576,
971,
1024,
51,
1315,
1024,
17576,
971,
45,
514,
49,
419,
4242,
2232,
1024,
51,
1315,
1024,
2077,
45,
514,
3445,
7068,
1052,
310,
1035,
7184,
1869,
45,
739,
3948,
2649,
51,
4635,
100,
2335,
100,
3319,
312,
310,
2146,
18901,
492,
310,
9396,
45,
343,
578,
12704,
903,
5495,
51,
80,
12305,
7393,
100,
20526,
2909,
100,
21784,
51,
390,
45,
514,
566,
4661,
120,
941,
911,
365,
2394,
244,
58,
312,
310,
4250,
1123,
3694,
492,
310,
1035,
1123,
3026,
45,
38989,
51,
80,
12305,
7393,
100,
798,
49,
32060,
624,
51,
7068,
941,
3127,
1052,
310,
1035,
7184,
1869,
45,
17576,
5044,
7468,
1728,
51,
8760,
100,
9545,
312,
310,
2146,
18901,
492,
310,
6152,
1728,
1193,
459,
30492,
1384,
100,
15380,
100,
3519,
51,
11051,
742,
310,
9396,
1181,
5532,
624,
51,
13729,
3357,
10915,
365,
882,
762,
979,
419,
673,
5532,
624,
51,
13729,
3357,
10915,
941,
6401,
5086,
465,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 814
|
[
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1805,
51,
881,
51,
2077,
2232,
1024,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
17576,
971,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
17576,
971,
2232,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4136,
51,
1977,
51,
881,
51,
17576,
971,
1024,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
1160,
51,
30492,
1384,
51,
17576,
5044,
7468,
1728,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
48901,
51,
38989,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
12717,
51,
2159,
8828,
51,
739,
3948,
2649,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4031,
51,
119,
12704,
489,
51,
87,
12704,
903,
5495,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4280,
51,
87,
12704,
3176,
3672,
2026,
16566,
7246,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4280,
51,
32384,
64,
222,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
1024,
64,
222,
222,
1350,
222,
338,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
222,
588,
222,
942,
462,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
2041,
578,
12704,
3176,
3672,
2026,
16566,
7246,
320,
465,
453,
2726,
813,
13626,
5050,
350,
415,
391,
30275,
1384,
6283,
391,
913,
477,
51,
303,
453,
457,
13583,
391,
1949,
3673,
1019,
5069,
331,
2835,
913,
462,
708,
1616,
43975,
303,
453,
391,
477,
1712,
842,
4577,
2840,
8667,
480,
5669,
3326,
3244,
1961,
22095,
303,
453,
580,
51,
303,
496,
1024,
303,
581,
782,
913,
1926,
1947,
365,
2589,
3284,
320,
603,
1242,
1246,
1384,
768,
32060,
624,
299,
1242,
1246,
1384,
768,
1024
] | 2,894,525,660,302,095,400
| true
| false
| false
| false
|
[
12704,
51,
4280,
51,
87,
12704,
3176,
3672,
2026,
16566,
7246,
64,
222,
485,
785,
51,
23672,
51,
119,
12704,
51,
4280,
51,
32384,
64,
222,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
1024,
64,
222,
222,
1350,
222,
338,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
222,
588,
222,
942,
462,
3787,
903,
6425,
351,
1501,
7849,
1728,
1024,
2041,
578,
12704,
3176,
3672,
2026,
16566,
7246,
320,
465,
453,
2726,
813,
13626,
5050,
350,
415,
391,
30275,
1384,
6283,
391,
913,
477,
51,
303,
453,
457,
13583,
391,
1949,
3673,
1019,
5069,
331,
2835
] | 4,641,814,293,964,482,000
| true
|
com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.domain.token.ActivationKey;
import com.redhat.rhn.domain.token.ActivationKeyFactory;
import com.redhat.rhn.domain.token.test.ActivationKeyTest;
import com.redhat.rhn.frontend.action.kickstart.ActivationKeysSubmitAction;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.taglibs.ListDisplayTag;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.testing.RhnPostMockStrutsTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.junit.jupiter.api.Test;
/**
* BaseSetOperateOnDiffActionTest
*/
public class BaseSetOperateOnDiffActionTest extends RhnPostMockStrutsTestCase {
// We use activation keys <-> to kickstart profile to test this.
// I wanted to make sure we had a specific
|
import com.redhat.rhn.domain.token.test.ActivationKeyTest;
import com.redhat.rhn.frontend.action.kickstart.ActivationKeysSubmitAction;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.taglibs.ListDisplayTag;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.testing.RhnPostMockStrutsTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.junit.jupiter.api.Test;
/**
* BaseSetOperateOnDiffActionTest
*/
public class BaseSetOperateOnDiffActionTest extends RhnPostMockStrutsTestCase {
// We use activation keys <-> to kickstart profile to test this.
// I wanted to make sure we had a specific
|
.struts.RequestContext;
import com.redhat.rhn.frontend.taglibs.ListDisplayTag;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.testing.RhnPostMockStrutsTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.junit.jupiter.api.Test;
/**
* BaseSetOperateOnDiffActionTest
*/
public class BaseSetOperateOnDiffActionTest extends RhnPostMockStrutsTestCase {
// We use activation keys <-> to kickstart profile to test this.
// I wanted to make sure we had a specific
|
hn.testing.RhnPostMockStrutsTestCase;
import com.redhat.rhn.testing.TestUtils;
import org.junit.jupiter.api.Test;
/**
* BaseSetOperateOnDiffActionTest
*/
public class BaseSetOperateOnDiffActionTest extends RhnPostMockStrutsTestCase {
// We use activation keys <-> to kickstart profile to test this.
// I wanted to make sure we had a specific
|
test class that was tied
// to this baseclass since its complex and needs tests geared towards
// it.
@Test
public void testSelectAll() throws Exception {
KickstartData ksdata = KickstartDataTest
|
Coordinate.java
|
/FileExtraction/Java_unseen/Exopandora_WorldHandler/src/main/java/exopandora/worldhandler/builder/argument/Coordinate.java
|
package exopandora.worldhandler.builder.argument;
import javax.annotation.Nullable;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.commands.arguments.coordinates.LocalCoordinates;
import net.minecraft.commands.arguments.coordinates.WorldCoordinate;
public abstract class Coordinate<T extends Number>
{
protected T value;
protected Type type;
protected Coordinate(T value)
{
this(value, Type.ABSOLUTE);
}
protected Coordinate(T value, Type type)
{
this.value = value;
this.type = type;
}
public void setValue(T value)
{
this.value = value;
}
public T getValue()
{
return this.value;
}
public void setType(Type type)
{
this.type = type;
}
public Type getType()
{
return this.type;
}
@Nullable
public String serialize()
{
if(this.value == null)
{
return null;
}
if(this.zero().equals(this.value) && !Type.ABSOLUTE.equals(this.type))
{
return this.type.getPrefix();
}
return this.type.getPrefix() + this.value.toString();
}
public abstract T zero();
public static class Ints extends Coordinate<Integer>
{
public static final Ints ZERO = new Ints();
public Ints()
{
super(0);
}
public Ints(Integer value)
{
super(value);
}
public Ints(Type type)
{
super(0, type);
}
public Ints(Integer value, Type type)
{
super(value, type);
}
@Override
public Integer zero()
{
return 0;
}
@Nullable
public static Ints parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.Ints((int) LocalCoordinates.readDouble(reader, 0), Coordinate.Type.LOCAL);
}
else
{
WorldCoordinate wc = WorldCoordinate.parseInt(reader);
return new Coordinate.Ints((int) wc.get(0), wc.isRelative() ? Coordinate.Type.RELATIVE : Coordinate.Type.ABSOLUTE);
}
}
catch(CommandSyntaxException e)
{
return null;
}
}
}
public static class Doubles extends Coordinate<Double>
{
public static final Doubles ZERO = new Doubles();
public Doubles()
{
super(0.0D);
}
public Doubles(Double value)
{
super(value);
}
public Doubles(Type type)
{
super(0.0D, type);
}
public Doubles(Double value, Type type)
{
super(value, type);
}
@Override
public Double zero()
{
return 0.0D;
}
@Nullable
public static Doubles parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.Doubles(LocalCoordinates.readDouble(reader, 0), Coordinate.Type.LOCAL);
}
else
{
WorldCoordinate wc = WorldCoordinate.parseInt(reader);
return new Coordinate.Doubles(wc.get(0), wc.isRelative() ? Coordinate.Type.RELATIVE : Coordinate.Type.ABSOLUTE);
}
}
catch(CommandSyntaxException e)
{
return null;
}
}
}
public static enum Type
{
ABSOLUTE(""),
RELATIVE("~"),
LOCAL("^");
private final String prefix;
private Type(String prefix)
{
this.prefix = prefix;
}
public String getPrefix()
{
return this.prefix;
}
}
}
| 3,297
|
Java
|
.java
|
Exopandora/WorldHandler
| 10
| 7
| 0
|
2016-04-27T21:57:57Z
|
2024-05-08T17:07:15Z
|
6d7064bd859980640cdf847e5ea8c46d6edd5edce2d70546243e8ac3598b868d
|
[] |
[
1337,
557,
539,
382,
7298,
51,
5879,
4543,
51,
4179,
51,
2686,
64,
222,
222,
485,
3698,
51,
4341,
51,
6825,
64,
222,
222,
485,
785,
51,
25290,
761,
51,
103,
867,
358,
2506,
51,
671,
3314,
64,
222,
485,
785,
51,
25290,
761,
51,
103,
867,
358,
2506,
51,
11453,
51,
2037,
6651,
1002,
64,
222,
222,
485,
3723,
51,
8654,
51,
7626,
51,
8306,
51,
17891,
51,
3340,
18583,
64,
222,
485,
3723,
51,
8654,
51,
7626,
51,
8306,
51,
17891,
51,
6719,
17048,
64,
222,
222,
942,
5560,
462,
31729,
65,
89,
2041,
5132,
67,
222,
128,
222,
221,
5332,
413,
804,
64,
222,
221,
5332,
2782,
847,
64,
3038,
221,
5332,
31729,
45,
89,
804,
46,
222,
221,
128,
376,
221,
597,
45,
872,
49,
2782,
51,
1336,
18616,
9323,
312,
222,
221,
130,
3038,
221,
5332,
31729,
45,
89,
804,
49,
2782,
847,
46,
222,
221,
128,
376,
221,
597,
51,
872,
299,
804,
64,
376,
221,
597,
51,
700,
299,
847,
64,
222,
221,
130,
3038,
221,
942,
782,
27609,
45,
89,
804,
46,
222,
221,
128,
376,
221,
597,
51,
872,
299,
804,
64,
222,
221,
130,
3038,
221,
942,
413,
21517,
365,
222,
221,
128,
376,
221,
620,
477,
51,
872,
64,
222,
221,
130,
3038,
221,
942,
782,
758,
638,
45,
638,
847,
46,
222,
221,
128,
376,
221,
597,
51,
700,
299,
847,
64,
222,
221,
130,
3038,
221,
942,
2782,
24097,
365,
222,
221,
128,
376,
221,
620,
477,
51,
700,
64,
222,
221,
130,
3038,
221,
69,
6825,
222,
221,
942,
910,
12747,
365,
222,
221,
128,
376,
221,
344,
45,
597,
51,
872,
630,
762,
46,
376,
221,
128,
374,
221,
620,
762,
64,
376,
221,
130,
4102,
221,
344,
45,
597,
51,
6187,
941,
3591,
45,
597,
51,
872,
46,
979,
673,
638,
51,
1336,
18616,
9323,
51,
3591,
45,
597,
51,
700,
509,
376,
221,
128,
374,
221,
620,
477,
51,
700,
51,
390,
5429,
492,
376,
221,
130,
4102,
221,
620,
477,
51,
700,
51,
390,
5429,
365,
494,
477,
51,
872,
51,
3127,
492,
222,
221,
130,
3038,
221,
942,
5560,
413,
5953,
492,
3038,
221,
942,
924,
462,
719,
1448,
2041,
31729,
65,
3078,
67,
222,
221,
128,
376,
221,
942,
924,
1175,
719,
1448,
20013,
299,
556,
719,
1448,
492,
4102,
221,
942,
719,
1448,
365,
376,
221,
128,
374,
221,
5282,
45,
53,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
3078,
804,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
638,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
53,
49,
847,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
3078,
804,
49,
2782,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
49,
847,
312,
376,
221,
130,
4102,
221,
69,
1806,
376,
221,
942,
4418,
5953,
365,
376,
221,
128,
374,
221,
620,
244,
53,
64,
376,
221,
130,
4102,
221,
69,
6825,
376,
221,
942,
924,
719,
1448,
3203,
45,
671,
821,
46,
376,
221,
128,
374,
221,
1287,
374,
221,
128,
621,
221,
671,
3314,
6201,
299,
556,
910,
3314,
45,
819,
312,
13699,
221,
344,
45,
6321,
51,
3389,
2248,
365,
979,
6201,
51,
20106,
365,
630,
25380,
704,
621,
221,
128,
596,
221,
620,
556,
31729,
51,
42388,
1181,
429,
46,
7099,
18583,
51,
870,
4090,
45,
6321,
49,
244,
53,
490,
31729,
51,
638,
51,
11150,
312,
621,
221,
130,
621,
221,
728,
621,
221,
128,
596,
221,
6719,
17048,
22370,
299,
10914,
17048,
51,
11824,
45,
6321,
312,
596,
221,
620,
556,
31729,
51,
42388,
1181,
429,
46,
22370,
51,
390,
45,
53,
490,
22370,
51,
316,
11776,
365,
1037,
31729,
51,
638,
51,
16466,
13828,
518,
31729,
51,
638,
51,
1336,
18616,
9323,
312,
621,
221,
130,
374,
221,
130,
374,
221,
5639,
45,
2037,
6651,
1002,
503,
46,
374,
221,
128,
621,
221,
620,
762,
64,
374,
221,
130,
376,
221,
130,
222,
221,
130,
3038,
221,
942,
924,
462,
6938,
120,
2041,
31729,
65,
4090,
67,
222,
221,
128,
376,
221,
942,
924,
1175,
6938,
120,
20013,
299,
556,
6938,
120,
492,
4102,
221,
942,
6938,
120,
365,
376,
221,
128,
374,
221,
5282,
45,
53,
51,
53,
73,
312,
376,
221,
130,
4102,
221,
942,
6938,
120,
45,
4090,
804,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
312,
376,
221,
130,
4102,
221,
942,
6938,
120,
45,
638,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
53,
51,
53,
73,
49,
847,
312,
376,
221,
130,
4102,
221,
942,
6938,
120,
45,
4090,
804,
49,
2782,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
49,
847,
312,
376,
221,
130,
4102,
221,
69,
1806,
376,
221,
942,
6938,
5953,
365,
376,
221,
128,
374,
221,
620,
244,
53,
51,
53,
73,
64,
376,
221,
130,
4102,
221,
69,
6825,
376,
221,
942,
924,
6938,
120,
3203,
45,
671,
821,
46,
376,
221,
128,
374,
221,
1287,
374,
221,
128,
621,
221,
671,
3314,
6201,
299,
556,
910,
3314,
45,
819,
312,
13699,
221,
344,
45,
6321,
51,
3389,
2248,
365,
979,
6201,
51,
20106,
365,
630,
25380,
704,
621,
221,
128,
596,
221,
620,
556,
31729,
51,
15388,
45,
3340,
18583,
51,
870,
4090,
45,
6321,
49,
244,
53,
490,
31729,
51,
638,
51,
11150,
312,
621,
221,
130,
621,
221,
728,
621,
221,
128,
596,
221,
6719,
17048,
22370,
299,
10914,
17048,
51,
11824,
45,
6321,
312,
596,
221,
620,
556,
31729,
51,
15388,
45,
12916,
51,
390,
45,
53,
490,
22370,
51,
316,
11776,
365,
1037,
31729,
51,
638,
51,
16466,
13828,
518,
31729,
51,
638,
51,
1336,
18616,
9323,
312,
621,
221,
130,
374,
221,
130,
374,
221,
5639,
45,
2037,
6651,
1002,
503,
46,
374,
221,
128,
621,
221,
620,
762,
64,
374,
221,
130,
376,
221,
130,
222,
221,
130,
3038,
221,
942,
924,
3858,
2782,
222,
221,
128,
376,
221,
1336,
18616,
9323,
46265,
376,
221,
16466,
13828,
459,
131,
2132,
376,
221,
11150,
29336,
742,
4102,
221,
2072,
1175,
910,
5216,
64
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
3591,
45,
597,
51,
700,
509,
376,
221,
128,
374,
221,
620,
477,
51,
700,
51,
390,
5429,
492,
376,
221,
130,
4102,
221,
620,
477,
51,
700,
51,
390,
5429,
365,
494,
477,
51,
872,
51,
3127,
492,
222,
221,
130,
3038,
221,
942,
5560,
413,
5953,
492,
3038,
221,
942,
924,
462,
719,
1448,
2041,
31729,
65,
3078,
67,
222,
221,
128,
376,
221,
942,
924,
1175,
719,
1448,
20013,
299,
556,
719,
1448,
492,
4102,
221,
942,
719,
1448,
365,
376,
221,
128,
374,
221,
5282,
45,
53,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
3078,
804,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
638,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
53,
49,
847,
312,
376,
221,
130,
4102,
221,
942,
719,
1448,
45,
3078,
804,
49,
2782,
847,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
49,
847,
312,
376,
221,
130,
4102,
221,
69,
1806,
376,
221,
942,
4418,
5953,
365,
376,
221,
128,
374,
221,
620,
244,
53,
64,
376,
221,
130,
4102,
221,
69,
6825,
376,
221,
942,
924,
719,
1448,
3203,
45,
671,
821,
46,
376,
221,
128,
374,
221,
1287,
374,
221,
128,
621,
221,
671,
3314,
6201,
299,
556,
910,
3314,
45,
819,
312,
13699,
221,
344,
45,
6321,
51,
3389,
2248,
365,
979,
6201,
51,
20106,
365,
630,
25380,
704,
621,
221,
128,
596,
221,
620,
556,
31729,
51,
42388,
1181,
429,
46,
7099,
18583,
51,
870,
4090,
45,
6321,
49,
244,
53,
490,
31729,
51,
638,
51,
11150,
312,
621,
221,
130,
621,
221,
728,
621,
221,
128,
596,
221,
6719,
17048,
22370,
299,
10914,
17048,
51,
11824,
45,
6321,
312,
596,
221,
620,
556,
31729,
51,
42388
] | -1,983,292,205,312,592,400
| true
| false
| false
| false
|
[
847,
46,
376,
221,
128,
374,
221,
5282,
45,
872,
49,
847,
312,
376,
221,
130,
4102,
221,
69,
1806,
376,
221,
942,
4418,
5953,
365,
376,
221,
128,
374,
221,
620,
244,
53,
64,
376,
221,
130,
4102,
221,
69,
6825,
376,
221,
942,
924,
719,
1448,
3203,
45,
671,
821,
46,
376,
221,
128,
374,
221,
1287,
374,
221,
128,
621,
221,
671,
3314,
6201,
299,
556,
910,
3314,
45,
819,
312,
13699,
221,
344,
45,
6321,
51,
3389,
2248,
365,
979,
6201,
51,
20106,
365,
630,
25380,
704,
621,
221,
128,
596,
221,
620,
556,
31729,
51
] | 8,306,418,758,696,097,000
| true
|
.equals(this.type))
{
return this.type.getPrefix();
}
return this.type.getPrefix() + this.value.toString();
}
public abstract T zero();
public static class Ints extends Coordinate<Integer>
{
public static final Ints ZERO = new Ints();
public Ints()
{
super(0);
}
public Ints(Integer value)
{
super(value);
}
public Ints(Type type)
{
super(0, type);
}
public Ints(Integer value, Type type)
{
super(value, type);
}
@Override
public Integer zero()
{
return 0;
}
@Nullable
public static Ints parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.
|
public static class Ints extends Coordinate<Integer>
{
public static final Ints ZERO = new Ints();
public Ints()
{
super(0);
}
public Ints(Integer value)
{
super(value);
}
public Ints(Type type)
{
super(0, type);
}
public Ints(Integer value, Type type)
{
super(value, type);
}
@Override
public Integer zero()
{
return 0;
}
@Nullable
public static Ints parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.
|
ts(Integer value)
{
super(value);
}
public Ints(Type type)
{
super(0, type);
}
public Ints(Integer value, Type type)
{
super(value, type);
}
@Override
public Integer zero()
{
return 0;
}
@Nullable
public static Ints parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.
|
type)
{
super(value, type);
}
@Override
public Integer zero()
{
return 0;
}
@Nullable
public static Ints parse(String string)
{
try
{
StringReader reader = new StringReader(string);
if(reader.canRead() && reader.peek() == '^')
{
return new Coordinate.
|
Ints((int) LocalCoordinates.readDouble(reader, 0), Coordinate.Type.LOCAL);
}
else
{
WorldCoordinate wc = WorldCoordinate.parseInt(reader);
return new Coordinate.Ints
|
BuoniOrdineVO.java
|
/FileExtraction/Java_unseen/IstitutoCentraleCatalogoUnicoBiblio_SBNWeb-Open/SbnWebCommon/src/vo/it/iccu/sbn/ejb/vo/acquisizioni/BuoniOrdineVO.java
|
/*******************************************************************************
* Copyright (C) 2019 ICCU - Istituto Centrale per il Catalogo Unico
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package it.iccu.sbn.ejb.vo.acquisizioni;
import it.iccu.sbn.ejb.vo.SerializableVO;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaCombo;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaTerna;
import java.sql.Timestamp;
import java.util.List;
public class BuoniOrdineVO extends SerializableVO {
/**
*
*/
private static final long serialVersionUID = 7042482317707366879L;
private String ticket;
private Integer progressivo=0;
private String utente;
private String codPolo;
private int IDBuonoOrd;
private int IDBil;
private String codBibl;
private String denoBibl;
private String numBuonoOrdine;
private String dataBuonoOrdine;
private String statoBuonoOrdine;
private StrutturaCombo fornitore;
private FornitoreVO anagFornitore;
private StrutturaTerna bilancio;
private double importo;
private String importoStr;
private List<OrdiniVO> listaOrdiniBuono;
private String tipoVariazione;
private boolean flag_canc=false;
private ConfigurazioneBOVO configurazione;
private Timestamp dataUpd;
private boolean salvaEffettuato=false; // x evitare il controllo di validazione sullo stato= stampato
private boolean gestBil=true;
//costruttore
public BuoniOrdineVO ()
{
//this.fornitore = new StrutturaCombo("","");
//this.bilancio = new StrutturaTerna("","","");
}
;
public BuoniOrdineVO (String codP, String codB, String num, String data, String stato, StrutturaCombo forn, StrutturaTerna bil, double imp, String tipoVar)
throws Exception {
this.codPolo = codP;
this.codBibl = codB;
this.numBuonoOrdine = num;
this.dataBuonoOrdine = data;
this.statoBuonoOrdine = stato;
this.fornitore = forn;
this.bilancio = bil;
this.importo = imp;
this.tipoVariazione=tipoVar;
}
public String getChiave() {
String chiave=getCodBibl()+ "|" + getNumBuonoOrdine();
chiave=chiave.trim();
return chiave;
}
public String getChiaveBilancio() {
String chiaveBil=getBilancio().getCodice1()+ "|" + getBilancio().getCodice2()+ "|" + getBilancio().getCodice3();
return chiaveBil;
}
public String getChiaveBil() {
String chiaveBil=getBilancio().getCodice1()+ "|" + getBilancio().getCodice2();
return chiaveBil;
}
public StrutturaTerna getBilancio() {
return bilancio;
}
public void setBilancio(StrutturaTerna bilancio) {
this.bilancio = bilancio;
}
public String getCodBibl() {
return codBibl;
}
public void setCodBibl(String codBibl) {
this.codBibl = codBibl;
}
public String getCodPolo() {
return codPolo;
}
public void setCodPolo(String codPolo) {
this.codPolo = codPolo;
}
public String getDataBuonoOrdine() {
return dataBuonoOrdine;
}
public void setDataBuonoOrdine(String dataBuonoOrdine) {
this.dataBuonoOrdine = dataBuonoOrdine;
}
public StrutturaCombo getFornitore() {
return fornitore;
}
public void setFornitore(StrutturaCombo fornitore) {
this.fornitore = fornitore;
}
public List<OrdiniVO> getListaOrdiniBuono() {
return listaOrdiniBuono;
}
public void setListaOrdiniBuono(List<OrdiniVO> listaOrdiniBuono) {
this.listaOrdiniBuono = listaOrdiniBuono;
}
public String getNumBuonoOrdine() {
return numBuonoOrdine;
}
public void setNumBuonoOrdine(String numBuonoOrdine) {
this.numBuonoOrdine = trimAndSet(numBuonoOrdine);
}
public String getStatoBuonoOrdine() {
return statoBuonoOrdine;
}
public void setStatoBuonoOrdine(String statoBuonoOrdine) {
this.statoBuonoOrdine = statoBuonoOrdine;
}
public String getTipoVariazione() {
return tipoVariazione;
}
public void setTipoVariazione(String tipoVariazione) {
this.tipoVariazione = tipoVariazione;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public Integer getProgressivo() {
return progressivo;
}
public void setProgressivo(Integer progressivo) {
this.progressivo = progressivo;
}
public String getUtente() {
return utente;
}
public void setUtente(String utente) {
this.utente = utente;
}
public boolean isFlag_canc() {
return flag_canc;
}
public void setFlag_canc(boolean flag_canc) {
this.flag_canc = flag_canc;
}
public int getIDBil() {
return IDBil;
}
public void setIDBil(int bil) {
IDBil = bil;
}
public int getIDBuonoOrd() {
return IDBuonoOrd;
}
public void setIDBuonoOrd(int buonoOrd) {
IDBuonoOrd = buonoOrd;
}
public double getImporto() {
return importo;
}
public void setImporto(double importo) {
this.importo = importo;
}
public String getImportoStr() {
return importoStr;
}
public void setImportoStr(String importoStr) {
this.importoStr = importoStr;
}
public FornitoreVO getAnagFornitore() {
return anagFornitore;
}
public void setAnagFornitore(FornitoreVO anagFornitore) {
this.anagFornitore = anagFornitore;
}
public String getDenoBibl() {
return denoBibl;
}
public void setDenoBibl(String denoBibl) {
this.denoBibl = denoBibl;
}
public ConfigurazioneBOVO getConfigurazione() {
return configurazione;
}
public void setConfigurazione(ConfigurazioneBOVO configurazione) {
this.configurazione = configurazione;
}
public Timestamp getDataUpd() {
return dataUpd;
}
public void setDataUpd(Timestamp dataUpd) {
this.dataUpd = dataUpd;
}
public boolean isSalvaEffettuato() {
return salvaEffettuato;
}
public void setSalvaEffettuato(boolean salvaEffettuato) {
this.salvaEffettuato = salvaEffettuato;
}
public boolean isGestBil() {
return gestBil;
}
public void setGestBil(boolean gestBil) {
this.gestBil = gestBil;
}
}
| 6,411
|
Java
|
.java
|
IstitutoCentraleCatalogoUnicoBiblio/SBNWeb-Open
| 9
| 7
| 0
|
2019-03-11T09:49:50Z
|
2023-07-04T11:46:55Z
|
77c3220fb0428fab86b384365dba897d2e3d1d0a0ea62518c0b381f7b88b0557
|
[] |
[
28683,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
62,
457,
2218,
90,
449,
457,
289,
302,
1318,
15072,
119,
1572,
1313,
6245,
25257,
116,
1703,
5701,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
9582,
222,
338,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
39664,
222,
1337,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
64,
222,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
12644,
6834,
64,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
8989,
64,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
89,
42618,
64,
222,
222,
485,
1401,
51,
2622,
51,
7477,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
2755,
25615,
15536,
501,
6834,
2041,
19182,
6834,
320,
222,
221,
1350,
376,
338,
376,
588,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
60,
53,
57,
55,
57,
61,
55,
56,
54,
60,
60,
53,
60,
56,
59,
59,
61,
60,
62,
81,
64,
222,
221,
2072,
910,
14724,
64,
222,
221,
2072,
4418,
6551,
10072,
66,
53,
64,
222,
221,
2072,
910,
8196,
9231,
64,
222,
221,
2072,
910,
7075,
3785,
335,
64,
222,
221,
2072,
648,
2502,
982,
10004,
15536,
64,
222,
221,
2072,
648,
457,
2015,
354,
64,
222,
221,
2072,
910,
7075,
30369,
113,
64,
222,
221,
2072,
910,
5554,
116,
30369,
113,
64,
222,
221,
2072,
910,
1952,
982,
10004,
15536,
501,
64,
222,
221,
2072,
910,
727,
982,
10004,
15536,
501,
64,
222,
221,
2072,
910,
6339,
116,
982,
10004,
15536,
501,
64,
222,
221,
2072,
6718,
19770,
5684,
8989,
456,
24686,
705,
64,
222,
221,
2072,
2643,
24686,
705,
6834,
619,
500,
1580,
24686,
705,
64,
222,
221,
2072,
6718,
19770,
5684,
89,
42618,
23440,
1981,
735,
64,
222,
221,
2072,
2082,
1220,
116,
64,
222,
221,
2072,
910,
1220,
116,
2026,
64,
222,
221,
2072,
1701,
65,
15536,
5942,
6834,
67,
16332,
15536,
5942,
982,
10004,
64,
222,
221,
2072,
910,
12671,
1901,
923,
15807,
64,
222,
221,
2072,
1922,
4666,
100,
104,
1981,
66,
1886,
64,
222,
221,
2072,
23930,
10048,
3199,
6834,
8545,
10048,
64,
222,
221,
2072,
18367,
727,
1405,
105,
64,
222,
221,
2072,
1922,
11460,
5335,
33460,
383,
13389,
6599,
66,
1886,
64,
453,
837,
7064,
302,
605,
6245,
3518,
335,
2090,
2101,
10048,
38379,
335,
6339,
116,
66,
26161,
6599,
222,
221,
2072,
1922,
244,
16854,
71,
354,
66,
1527,
64,
3067,
221,
325,
352,
484,
322,
39952,
222,
221,
942,
2755,
25615,
15536,
501,
6834,
1423,
376,
221,
128,
376,
221,
325,
597,
51,
999,
24686,
705,
299,
556,
6718,
19770,
5684,
8989,
459,
1479,
742,
376,
221,
325,
597,
51,
30491,
1981,
735,
299,
556,
6718,
19770,
5684,
89,
42618,
459,
41097,
742,
376,
221,
130,
222,
221,
64,
222,
221,
942,
2755,
25615,
15536,
501,
6834,
327,
671,
7075,
85,
49,
910,
7075,
71,
49,
910,
1952,
49,
910,
727,
49,
244,
910,
6339,
116,
49,
6718,
19770,
5684,
8989,
456,
115,
49,
6718,
19770,
5684,
89,
42618,
23440,
49,
244,
2082,
1378,
49,
910,
12671,
1901,
46,
222,
221,
5124,
3284,
320,
20166,
221,
597,
51,
10777,
3785,
335,
299,
7075,
85,
64,
376,
221,
597,
51,
10777,
30369,
113,
299,
7075,
71,
64,
376,
221,
597,
51,
1538,
982,
10004,
15536,
501,
299,
1952,
64,
376,
221,
597,
51,
624,
982,
10004,
15536,
501,
299,
727,
64,
376,
221,
597,
51,
4611,
116,
982,
10004,
15536,
501,
299,
6339,
116,
64,
376,
221,
597,
51,
999,
24686,
705,
299,
456,
115,
64,
376,
221,
597,
51,
30491,
1981,
735,
299,
23440,
64,
376,
221,
597,
51,
485,
116,
299,
1378,
64,
376,
221,
597,
51,
14354,
1901,
923,
15807,
66,
14354,
1901,
64,
222,
222,
130,
222,
221,
942,
910,
640,
40929,
808,
365,
320,
376,
221,
671,
25644,
808,
66,
11641,
450,
30369,
113,
19218,
332,
17329,
494,
44866,
982,
10004,
15536,
501,
492,
376,
221,
15171,
808,
66,
15171,
808,
51,
5475,
492,
376,
221,
620,
25644,
808,
64,
222,
221,
130,
222,
221,
942,
910,
640,
40929,
808,
71,
354,
1981,
735,
365,
320,
376,
221,
671,
25644,
808,
71,
354,
66,
33465,
354,
1981,
735,
941,
11641,
450,
584,
54,
19218,
332,
17329,
494,
640,
71,
354,
1981,
735,
941,
11641,
450,
584,
55,
19218,
332,
17329,
494,
244,
640,
71,
354,
1981,
735,
941,
11641,
450,
584,
56,
492,
376,
221,
620,
25644,
808,
71,
354,
64,
222,
221,
130,
222,
221,
942,
910,
640,
40929,
808,
71,
354,
365,
320,
376,
221,
671,
25644,
808,
71,
354,
66,
33465,
354,
1981,
735,
941,
11641,
450,
584,
54,
19218,
332,
17329,
494,
640,
71,
354,
1981,
735,
941,
11641,
450,
584,
55,
492,
376,
221,
620,
25644,
808,
71,
354,
64,
222,
221,
130,
499,
221,
942,
6718,
19770,
5684,
89,
42618,
640,
71,
354,
1981,
735,
365,
320,
376,
221,
620,
23440,
1981,
735,
64,
222,
221,
130,
222,
221,
942,
782,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
338,
1676,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
39664,
222,
1337,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
64,
222,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
12644,
6834,
64,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
8989,
64,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
89,
42618,
64,
222,
222,
485,
1401,
51,
2622,
51,
7477,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
2755,
25615,
15536,
501,
6834,
2041,
19182,
6834,
320,
222,
221,
1350,
376,
338,
376,
588,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
60,
53,
57,
55,
57,
61,
55,
56,
54,
60,
60,
53,
60,
56,
59,
59,
61,
60,
62,
81,
64,
222,
221,
2072,
910,
14724,
64,
222,
221,
2072,
4418,
6551,
10072,
66,
53,
64,
222,
221,
2072,
910,
8196,
9231,
64,
222,
221,
2072,
910,
7075,
3785,
335,
64,
222,
221,
2072,
648,
2502,
982,
10004,
15536,
64,
222,
221,
2072,
648,
457,
2015
] | 6,637,678,176,777,887,000
| true
| false
| false
| false
|
[
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
8989,
64,
222,
485,
580,
51,
314,
9816,
51,
5692,
115,
51,
106,
11663,
51,
2103,
51,
348,
9362,
445,
13131,
51,
2297,
51,
2026,
19770,
5684,
89,
42618,
64,
222,
222,
485,
1401,
51,
2622,
51,
7477,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
942,
462,
2755,
25615,
15536,
501,
6834,
2041,
19182,
6834,
320,
222,
221,
1350,
376,
338,
376,
588,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
60,
53,
57,
55,
57,
61,
55,
56,
54,
60,
60,
53,
60,
56,
59,
59
] | -7,920,369,313,284,549,000
| true
|
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package it.iccu.sbn.ejb.vo.acquisizioni;
import it.iccu.sbn.ejb.vo.SerializableVO;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaCombo;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaTerna;
import java.sql.Timestamp;
import java.util.List;
public class BuoniOrdineVO extends SerializableVO {
/**
*
*/
private static final long serialVersionUID = 7042482317707366
|
more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package it.iccu.sbn.ejb.vo.acquisizioni;
import it.iccu.sbn.ejb.vo.SerializableVO;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaCombo;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaTerna;
import java.sql.Timestamp;
import java.util.List;
public class BuoniOrdineVO extends SerializableVO {
/**
*
*/
private static final long serialVersionUID = 7042482317707366
|
.sbn.ejb.vo.acquisizioni;
import it.iccu.sbn.ejb.vo.SerializableVO;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaCombo;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaTerna;
import java.sql.Timestamp;
import java.util.List;
public class BuoniOrdineVO extends SerializableVO {
/**
*
*/
private static final long serialVersionUID = 7042482317707366
|
izioni.common.StrutturaCombo;
import it.iccu.sbn.ejb.vo.acquisizioni.common.StrutturaTerna;
import java.sql.Timestamp;
import java.util.List;
public class BuoniOrdineVO extends SerializableVO {
/**
*
*/
private static final long serialVersionUID = 7042482317707366
|
879L;
private String ticket;
private Integer progressivo=0;
private String utente;
private String codPolo;
private int IDBuonoOrd;
private int IDB
|
SimpleTransactionIdSupplierTests.java
|
/FileExtraction/Java_unseen/SolarNetwork_nifty-modbus/tcp/src/test/java/net/solarnetwork/io/modbus/tcp/test/SimpleTransactionIdSupplierTests.java
|
/* ==================================================================
* SimpleTransactionIdSupplierTests.java - 29/11/2022 2:14:19 pm
*
* Copyright 2022 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
*/
package net.solarnetwork.io.modbus.tcp.test;
import static net.solarnetwork.io.modbus.tcp.SimpleTransactionIdSupplier.INSTANCE;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.solarnetwork.io.modbus.tcp.SimpleTransactionIdSupplier;
import net.solarnetwork.io.modbus.tcp.TcpModbusMessage;
/**
* Test cases for the {@link SimpleTransactionIdSupplier} class.
*
* <p>
* This class is annotated with {@code @ResourceLock} to work with the static
* counter within {@link SimpleTransactionIdSupplier}.
* </p>
*
* @author matt
* @version 1.0
*/
@ResourceLock(value = "net.solarnetwork.io.modbus.tcp.SimpleTransactionIdSupplier")
public class SimpleTransactionIdSupplierTests {
private static final Logger log = LoggerFactory.getLogger(SimpleTransactionIdSupplierTests.class);
@BeforeEach
public void setup() {
INSTANCE.reset();
}
@Test
public void lastIdAfterReset() {
assertThat("After reset next ID is 1", INSTANCE.nextId(), is(equalTo(1)));
}
@Test
public void firstIdAfterReset() {
assertThat("After reset first ID is 1", INSTANCE.getAsInt(), is(equalTo(1)));
}
@Test
public void idsIncrement() {
int next = INSTANCE.nextId();
for ( int i = 0; i < 10; i++ ) {
assertThat(String.format("ID %d incremented", i), INSTANCE.getAsInt(), is(equalTo(next++)));
}
}
@Test
public void idsWrap() {
INSTANCE.set(TcpModbusMessage.MAX_TRANSACTION_ID);
assertThat("Get largest possible ID", INSTANCE.getAsInt(),
is(equalTo(TcpModbusMessage.MAX_TRANSACTION_ID)));
for ( int i = 1; i <= 10; i++ ) {
assertThat(String.format("ID %d wrap incremented", i), INSTANCE.getAsInt(), is(equalTo(i)));
}
}
private static final AtomicInteger COUNTER = new AtomicInteger();
private static final class IdTaker implements Runnable {
private final int iterations;
private final int taskId = COUNTER.incrementAndGet();
private final List<Integer> ids = new ArrayList<>(50);
private IdTaker(int iterations) {
super();
this.iterations = iterations;
}
@Override
public void run() {
log.info("Task {} starting with {} iterations", taskId, iterations);
for ( int i = 0; i < iterations; i++ ) {
ids.add(INSTANCE.getAsInt());
}
log.info("Task {} finished with {} iterations", taskId, iterations);
}
}
@Test
public void threaded_wrapped_noDuplicates() throws Exception {
final int iterations = 1000;
final int taskCount = 4;
// make sure we wrap
INSTANCE.set(TcpModbusMessage.MAX_TRANSACTION_ID - 500);
ExecutorService s = Executors.newFixedThreadPool(taskCount);
List<IdTaker> tasks = new ArrayList<>(taskCount);
try {
for ( int i = 0; i < taskCount; i++ ) {
IdTaker task = new IdTaker(iterations);
tasks.add(task);
s.submit(task);
}
} finally {
s.shutdown();
s.awaitTermination(1, TimeUnit.MINUTES);
}
// merge all collected IDds into a single set; there should be taskCount * iterations values
Set<Integer> allIds = new TreeSet<>();
for ( IdTaker task : tasks ) {
assertThat(String.format("Task %d collected all ids", task.taskId), task.ids,
hasSize(iterations));
allIds.addAll(task.ids);
}
log.info("Collected {} total IDs", allIds.size());
assertThat("No duplicate ids collected", allIds, hasSize(taskCount * iterations));
}
}
| 4,847
|
Java
|
.java
|
SolarNetwork/nifty-modbus
| 24
| 4
| 0
|
2022-11-28T05:50:48Z
|
2024-04-24T20:08:47Z
|
6b50e0b83118122ee936bf1327bb528e8b756d076e8f01aff5a48a3bdc8b8003
|
[] |
[
1127,
12058,
66,
222,
338,
7169,
4331,
625,
17612,
4485,
51,
1874,
449,
244,
55,
62,
52,
54,
54,
52,
55,
53,
55,
55,
244,
55,
63,
54,
57,
63,
54,
62,
15705,
222,
338,
222,
338,
2657,
244,
55,
53,
55,
55,
18764,
301,
4723,
51,
1317,
12798,
12653,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
222,
338,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
222,
338,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
49,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
222,
338,
244,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
15067,
222,
338,
12058,
66,
222,
588,
222,
222,
1337,
3723,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
881,
64,
222,
222,
485,
924,
3723,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
5302,
4331,
625,
17612,
51,
12457,
64,
222,
485,
924,
1105,
51,
28777,
51,
11947,
3285,
51,
17427,
64,
222,
485,
924,
1105,
51,
28777,
51,
17349,
51,
38066,
64,
222,
485,
924,
1105,
51,
28777,
51,
17349,
51,
2057,
1269,
64,
222,
485,
924,
1105,
51,
28777,
51,
17349,
51,
316,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
903,
64,
222,
485,
1401,
51,
1058,
51,
3371,
903,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
25815,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
38628,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
27785,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
6238,
51,
17122,
3078,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
32361,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
1024,
64,
222,
485,
1105,
51,
3946,
51,
14127,
51,
1256,
51,
13502,
51,
2305,
4645,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
485,
3723,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
5302,
4331,
625,
17612,
64,
222,
485,
3723,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
18570,
2590,
4906,
1193,
64,
222,
222,
1350,
222,
338,
2128,
6819,
456,
341,
3105,
1222,
7169,
4331,
625,
17612,
130,
462,
51,
222,
338,
1676,
338,
350,
117,
67,
222,
338,
1369,
462,
458,
30404,
642,
3105,
707,
496,
2305,
4645,
130,
391,
1409,
642,
341,
924,
222,
338,
7035,
4824,
3105,
1222,
7169,
4331,
625,
17612,
4037,
222,
338,
594,
117,
67,
222,
338,
222,
338,
496,
2133,
2525,
121,
222,
338,
496,
1687,
244,
54,
51,
53,
222,
588,
222,
69,
2305,
4645,
45,
872,
299,
332,
1317,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
5302,
4331,
625,
17612,
678,
222,
942,
462,
7169,
4331,
625,
17612,
4485,
320,
499,
221,
2072,
924,
1175,
7145,
1264,
299,
21818,
51,
10588,
45,
5302,
4331,
625,
17612,
4485,
51,
842,
312,
499,
221,
69,
32361,
222,
221,
942,
782,
4721,
365,
320,
376,
221,
12457,
51,
4558,
492,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
2419,
625,
5131,
7334,
365,
320,
376,
221,
17427,
459,
5131,
5672,
2371,
2502,
458,
244,
54,
411,
39948,
51,
1995,
625,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
1950,
625,
5131,
7334,
365,
320,
376,
221,
17427,
459,
5131,
5672,
1950,
2502,
458,
244,
54,
411,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
9673,
13814,
365,
320,
376,
221,
429,
2371,
299,
39948,
51,
1995,
625,
492,
376,
221,
999,
327,
648,
613,
299,
244,
53,
64,
613,
350,
244,
54,
53,
64,
613,
1065,
848,
320,
374,
221,
17427,
45,
671,
51,
1664,
459,
798,
925,
105,
11902,
337,
411,
613,
490,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
1995,
1065,
4254,
376,
221,
130,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
9673,
10007,
365,
320,
376,
221,
12457,
51,
489,
45,
18570,
2590,
4906,
1193,
51,
3470,
100,
30867,
100,
798,
312,
376,
221,
17427,
459,
953,
22936,
4222,
2502,
411,
39948,
51,
38984,
1438,
1046,
621,
221,
316,
45,
38066,
45,
18570,
2590,
4906,
1193,
51,
3470,
100,
30867,
100,
798,
4254,
376,
221,
999,
327,
648,
613,
299,
244,
54,
64,
613,
2527,
244,
54,
53,
64,
613,
1065,
848,
320,
374,
221,
17427,
45,
671,
51,
1664,
459,
798,
925,
105,
9817,
11902,
337,
411,
613,
490,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
110,
4254,
376,
221,
130,
222,
221,
130,
499,
221,
2072,
924,
1175,
42034,
45978,
2933,
299,
556,
42034,
492,
499,
221,
2072,
924,
1175,
462,
4949,
89,
5218,
4584,
18662,
320,
1332,
221,
2072,
1175,
648,
17700,
64,
376,
221,
2072,
1175,
648,
42263,
299,
45978,
2933,
51,
12128,
35335,
492,
376,
221,
2072,
1175,
1701,
65,
3078,
67,
9673,
299,
556,
5068,
11530,
58,
53,
312,
1332,
221,
2072,
4949,
89,
5218,
45,
429,
17700,
46,
320,
374,
221,
5282,
492,
374,
221,
597,
51,
22540,
299,
17700,
64,
376,
221,
130,
1332,
221,
69,
1806,
376,
221,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
30404,
642,
3105,
707,
496,
2305,
4645,
130,
391,
1409,
642,
341,
924,
222,
338,
7035,
4824,
3105,
1222,
7169,
4331,
625,
17612,
4037,
222,
338,
594,
117,
67,
222,
338,
222,
338,
496,
2133,
2525,
121,
222,
338,
496,
1687,
244,
54,
51,
53,
222,
588,
222,
69,
2305,
4645,
45,
872,
299,
332,
1317,
51,
35796,
4599,
51,
735,
51,
1820,
4906,
51,
9379,
51,
5302,
4331,
625,
17612,
678,
222,
942,
462,
7169,
4331,
625,
17612,
4485,
320,
499,
221,
2072,
924,
1175,
7145,
1264,
299,
21818,
51,
10588,
45,
5302,
4331,
625,
17612,
4485,
51,
842,
312,
499,
221,
69,
32361,
222,
221,
942,
782,
4721,
365,
320,
376,
221,
12457,
51,
4558,
492,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
2419,
625,
5131,
7334,
365,
320,
376,
221,
17427,
459,
5131,
5672,
2371,
2502,
458,
244,
54,
411,
39948,
51,
1995,
625,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
1950,
625,
5131,
7334,
365,
320,
376,
221,
17427,
459,
5131,
5672,
1950,
2502,
458,
244,
54,
411,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
9673,
13814,
365,
320,
376,
221,
429,
2371,
299,
39948,
51,
1995,
625,
492,
376,
221,
999,
327,
648,
613,
299,
244,
53,
64,
613,
350,
244,
54,
53,
64,
613,
1065,
848,
320,
374,
221,
17427,
45,
671,
51,
1664,
459,
798,
925,
105,
11902,
337,
411,
613,
490,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
1995,
1065,
4254,
376,
221,
130,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
9673,
10007,
365,
320,
376,
221,
12457,
51,
489,
45,
18570,
2590,
4906,
1193,
51
] | -5,480,925,620,641,860,000
| true
| false
| false
| false
|
[
625,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
1950,
625,
5131,
7334,
365,
320,
376,
221,
17427,
459,
5131,
5672,
1950,
2502,
458,
244,
54,
411,
39948,
51,
38984,
1438,
1046,
458,
45,
38066,
45,
54,
4254,
222,
221,
130,
499,
221,
69,
1024,
222,
221,
942,
782,
9673,
13814,
365,
320,
376,
221,
429,
2371,
299,
39948,
51,
1995,
625,
492,
376,
221,
999,
327,
648,
613,
299,
244,
53,
64,
613,
350,
244,
54,
53,
64,
613,
1065,
848,
320,
374,
221,
17427,
45,
671,
51,
1664
] | 2,148,763,684,411,985,000
| true
|
annotated with {@code @ResourceLock} to work with the static
* counter within {@link SimpleTransactionIdSupplier}.
* </p>
*
* @author matt
* @version 1.0
*/
@ResourceLock(value = "net.solarnetwork.io.modbus.tcp.SimpleTransactionIdSupplier")
public class SimpleTransactionIdSupplierTests {
private static final Logger log = LoggerFactory.getLogger(SimpleTransactionIdSupplierTests.class);
@BeforeEach
public void setup() {
INSTANCE.reset();
}
@Test
public void lastIdAfterReset() {
assertThat("After reset next ID is 1", INSTANCE.nextId(), is(equalTo(1)));
}
@Test
public void firstIdAfterReset() {
assertThat("After reset first ID is 1", INSTANCE.getAsInt(), is(equalTo(1)));
}
@Test
public void idsIncrement() {
int next = INSTANCE.nextId();
for ( int i = 0; i < 10; i++ ) {
assertThat(String.format
|
Lock(value = "net.solarnetwork.io.modbus.tcp.SimpleTransactionIdSupplier")
public class SimpleTransactionIdSupplierTests {
private static final Logger log = LoggerFactory.getLogger(SimpleTransactionIdSupplierTests.class);
@BeforeEach
public void setup() {
INSTANCE.reset();
}
@Test
public void lastIdAfterReset() {
assertThat("After reset next ID is 1", INSTANCE.nextId(), is(equalTo(1)));
}
@Test
public void firstIdAfterReset() {
assertThat("After reset first ID is 1", INSTANCE.getAsInt(), is(equalTo(1)));
}
@Test
public void idsIncrement() {
int next = INSTANCE.nextId();
for ( int i = 0; i < 10; i++ ) {
assertThat(String.format
|
);
@BeforeEach
public void setup() {
INSTANCE.reset();
}
@Test
public void lastIdAfterReset() {
assertThat("After reset next ID is 1", INSTANCE.nextId(), is(equalTo(1)));
}
@Test
public void firstIdAfterReset() {
assertThat("After reset first ID is 1", INSTANCE.getAsInt(), is(equalTo(1)));
}
@Test
public void idsIncrement() {
int next = INSTANCE.nextId();
for ( int i = 0; i < 10; i++ ) {
assertThat(String.format
|
Id(), is(equalTo(1)));
}
@Test
public void firstIdAfterReset() {
assertThat("After reset first ID is 1", INSTANCE.getAsInt(), is(equalTo(1)));
}
@Test
public void idsIncrement() {
int next = INSTANCE.nextId();
for ( int i = 0; i < 10; i++ ) {
assertThat(String.format
|
("ID %d incremented", i), INSTANCE.getAsInt(), is(equalTo(next++)));
}
}
@Test
public void idsWrap() {
INSTANCE.set(TcpModbusMessage.
|
ExportProvider.java
|
/FileExtraction/Java_unseen/felixb_callmeter/CallMeter3G/src/main/java/de/ub0r/android/callmeter/data/ExportProvider.java
|
package de.ub0r.android.callmeter.data;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import java.io.File;
import java.io.FileNotFoundException;
import de.ub0r.android.logg0r.Log;
public class ExportProvider extends ContentProvider {
/**
* Tag for output.
*/
private static final String TAG = "ExportProvider";
/**
* Authority.
*/
public static final String AUTHORITY = DataProvider.PACKAGE + ".export";
/**
* Mime type for export.
*/
public static final String EXPORT_MIMETYPE = "application/android.callmeter.export";
/**
* {@link Uri} for export Content.
*/
public static final Uri EXPORT_RULESET_URI = Uri.parse("content://" + AUTHORITY + "/ruleset");
/**
* {@link Uri} for export Content.
*/
public static final Uri EXPORT_LOGS_URI = Uri.parse("content://" + AUTHORITY + "/logs");
/**
* {@link Uri} for export Content.
*/
public static final Uri EXPORT_NUMGROUPS_URI = Uri.parse("content://" + AUTHORITY
+ "/numgroups");
/**
* {@link Uri} for export Content.
*/
public static final Uri EXPORT_HOURGROUPS_URI = Uri.parse("content://" + AUTHORITY
+ "/hourgroups");
/**
* Filename for the actual export file.
*/
public static final String EXPORT_RULESET_FILE = "ruleset.xml";
/**
* Filename for the actual logs file.
*/
public static final String EXPORT_LOGS_FILE = "logs.xml";
/**
* Filename for the actual number groups file.
*/
public static final String EXPORT_NUMGROUPS_FILE = "numgroups.xml";
/**
* Filename for the actual hour groups file.
*/
public static final String EXPORT_HOURGROUPS_FILE = "hourgroups.xml";
/**
* {@link UriMatcher}.
*/
private static final UriMatcher URI_MATCHER;
/**
* Internal id: export.
*/
private static final int EXPORT_RULESET = 200;
/**
* Internal id: export.
*/
private static final int EXPORT_LOGS = 201;
/**
* Internal id: export.
*/
private static final int EXPORT_NUMGROUPS = 202;
/**
* Internal id: export.
*/
private static final int EXPORT_HOURGROUPS = 203;
static {
URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
URI_MATCHER.addURI(AUTHORITY, "ruleset", EXPORT_RULESET);
URI_MATCHER.addURI(AUTHORITY, "logs", EXPORT_LOGS);
URI_MATCHER.addURI(AUTHORITY, "numgroups", EXPORT_NUMGROUPS);
URI_MATCHER.addURI(AUTHORITY, "hourgroups", EXPORT_HOURGROUPS);
}
public static File getExportDirectory(final Context context) {
return context.getExternalFilesDir(null);
}
@Override
public boolean onCreate() {
return true;
}
@Override
public String getType(@NonNull final Uri uri) {
switch (URI_MATCHER.match(uri)) {
case EXPORT_RULESET:
case EXPORT_LOGS:
case EXPORT_NUMGROUPS:
case EXPORT_HOURGROUPS:
return EXPORT_MIMETYPE;
default:
throw new IllegalArgumentException("Unknown URI: " + uri);
}
}
@Override
public Cursor query(@NonNull final Uri uri, final String[] projection, final String selection,
final String[] selectionArgs, final String sortOrder) {
Log.d(TAG, "export uri: ", uri);
String fn;
final int uid = URI_MATCHER.match(uri);
switch (uid) {
case EXPORT_RULESET:
fn = EXPORT_RULESET_FILE;
break;
case EXPORT_LOGS:
fn = EXPORT_LOGS_FILE;
break;
case EXPORT_NUMGROUPS:
fn = EXPORT_NUMGROUPS_FILE;
break;
case EXPORT_HOURGROUPS:
fn = EXPORT_HOURGROUPS_FILE;
break;
default:
throw new IllegalArgumentException("Unknown Uri " + uri);
}
final int l = projection.length;
Object[] retArray = new Object[l];
for (int i = 0; i < l; i++) {
if (projection[i].equals(OpenableColumns.DISPLAY_NAME)) {
retArray[i] = fn;
} else if (projection[i].equals(OpenableColumns.SIZE)) {
final File d = Environment.getExternalStorageDirectory();
final File f = new File(d, DataProvider.PACKAGE + File.separator + fn);
retArray[i] = f.length();
}
}
final MatrixCursor ret = new MatrixCursor(projection, 1);
ret.addRow(retArray);
Log.d(TAG, "query(): ", ret.getCount());
return ret;
}
@Override
public ParcelFileDescriptor openFile(@NonNull final Uri uri, @NonNull final String mode)
throws FileNotFoundException {
Log.d(TAG, "openFile(", uri.toString(), ")");
final File d = getExportDirectory(getContext());
String fn = null;
if (uri.equals(EXPORT_RULESET_URI)) {
fn = EXPORT_RULESET_FILE;
} else if (uri.equals(EXPORT_LOGS_URI)) {
fn = EXPORT_LOGS_FILE;
} else if (uri.equals(EXPORT_NUMGROUPS_URI)) {
fn = EXPORT_NUMGROUPS_FILE;
} else if (uri.equals(EXPORT_HOURGROUPS_URI)) {
fn = EXPORT_HOURGROUPS_FILE;
}
if (fn == null) {
return null;
}
final File f = new File(d, fn);
Log.d(TAG, "export file ", f);
return ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY);
}
@Override
public int delete(@NonNull final Uri uri, final String selection, final String[] selectionArgs) {
throw new IllegalStateException("Unsupported operation: delete(" + uri + ")");
}
@Override
public Uri insert(@NonNull final Uri uri, final ContentValues values) {
throw new IllegalStateException("Unsupported operation: insert(" + uri + ")");
}
@Override
public int update(@NonNull final Uri uri, final ContentValues values, final String selection,
final String[] selectionArgs) {
throw new IllegalStateException("Unsupported operation: update(" + uri + ")");
}
}
| 6,591
|
Java
|
.java
|
felixb/callmeter
| 48
| 39
| 36
|
2013-10-23T06:08:13Z
|
2020-08-13T17:26:11Z
|
f8ed8f7b12d79c82a4d92ab76ddc4642f1c05e68ac5b88ec8ea364c721955b5a
|
[] |
[
1337,
428,
51,
375,
53,
119,
51,
4048,
51,
1872,
12354,
51,
624,
64,
222,
222,
485,
2616,
51,
1304,
51,
1795,
2588,
64,
222,
485,
2616,
51,
1304,
51,
1795,
3367,
64,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
1304,
51,
5729,
11947,
64,
222,
485,
2616,
51,
4617,
51,
7424,
64,
222,
485,
2616,
51,
4617,
51,
4181,
7424,
64,
222,
485,
2616,
51,
1317,
51,
5729,
64,
222,
485,
2616,
51,
519,
51,
6342,
64,
222,
485,
2616,
51,
519,
51,
18402,
33719,
64,
222,
485,
2616,
51,
6390,
51,
2981,
463,
7633,
64,
222,
485,
2616,
51,
3608,
51,
4341,
51,
10082,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
27322,
64,
222,
222,
485,
428,
51,
375,
53,
119,
51,
4048,
51,
769,
108,
53,
119,
51,
1353,
64,
222,
222,
942,
462,
14715,
2588,
2041,
6261,
2588,
320,
465,
1041,
294,
338,
9147,
456,
1716,
51,
294,
588,
303,
964,
924,
1175,
910,
19318,
299,
332,
6171,
2588,
884,
465,
1041,
294,
338,
6265,
562,
51,
294,
588,
303,
581,
924,
1175,
910,
10761,
21811,
299,
2426,
2588,
51,
15803,
494,
4956,
1376,
884,
465,
1041,
294,
338,
47006,
847,
456,
4184,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
14036,
2333,
299,
332,
3180,
52,
4048,
51,
1872,
12354,
51,
1376,
884,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
25618,
2710,
100,
6344,
299,
14433,
51,
2228,
459,
1304,
35398,
494,
10761,
21811,
494,
2450,
5286,
489,
742,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
3612,
88,
100,
6344,
299,
14433,
51,
2228,
459,
1304,
35398,
494,
10761,
21811,
494,
2450,
8310,
742,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
5511,
9781,
88,
100,
6344,
299,
14433,
51,
2228,
459,
1304,
35398,
494,
10761,
21811,
343,
494,
2450,
1538,
6353,
742,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
30539,
9781,
88,
100,
6344,
299,
14433,
51,
2228,
459,
1304,
35398,
494,
10761,
21811,
343,
494,
2450,
11343,
6353,
742,
465,
1041,
294,
338,
38005,
456,
341,
4668,
4184,
822,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
25618,
2710,
100,
3555,
299,
332,
5286,
489,
51,
2608,
884,
465,
1041,
294,
338,
38005,
456,
341,
4668,
8831,
822,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
3612,
88,
100,
3555,
299,
332,
8310,
51,
2608,
884,
465,
1041,
294,
338,
38005,
456,
341,
4668,
1470,
8374,
822,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
5511,
9781,
88,
100,
3555,
299,
332,
1538,
6353,
51,
2608,
884,
465,
1041,
294,
338,
38005,
456,
341,
4668,
12039,
8374,
822,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
30539,
9781,
88,
100,
3555,
299,
332,
11343,
6353,
51,
2608,
884,
465,
1041,
294,
338,
3105,
1222,
14433,
11947,
4037,
294,
588,
303,
964,
924,
1175,
14433,
11947,
7417,
100,
15896,
546,
64,
465,
1041,
294,
338,
11540,
828,
63,
4184,
51,
294,
588,
303,
964,
924,
1175,
648,
2800,
3640,
100,
25618,
2710,
299,
244,
55,
53,
53,
64,
465,
1041,
294,
338,
11540,
828,
63,
4184,
51,
294,
588,
303,
964,
924,
1175,
648,
2800,
3640,
100,
3612,
88,
299,
244,
55,
53,
54,
64,
465,
1041,
294,
338,
11540,
828,
63,
4184,
51,
294,
588,
303,
964,
924,
1175,
648,
2800,
3640,
100,
5511,
9781,
88,
299,
244,
55,
53,
55,
64,
465,
1041,
294,
338,
11540,
828,
63,
4184,
51,
294,
588,
303,
964,
924,
1175,
648,
2800,
3640,
100,
30539,
9781,
88,
299,
244,
55,
53,
56,
64,
465,
924,
320,
310,
7417,
100,
15896,
546,
299,
556,
14433,
11947,
45,
5729,
11947,
51,
2593,
100,
15896,
312,
310,
7417,
100,
15896,
546,
51,
688,
6344,
45,
9039,
21811,
49,
332,
5286,
489,
411,
2800,
3640,
100,
25618,
2710,
312,
310,
7417,
100,
15896,
546,
51,
688,
6344,
45,
9039,
21811,
49,
332,
8310,
411,
2800,
3640,
100,
3612,
88,
312,
310,
7417,
100,
15896,
546,
51,
688,
6344,
45,
9039,
21811,
49,
332,
1538,
6353,
411,
2800,
3640,
100,
5511,
9781,
88,
312,
310,
7417,
100,
15896,
546,
51,
688,
6344,
45,
9039,
21811,
49,
332,
11343,
6353,
411,
2800,
3640,
100,
30539,
9781,
88,
312,
303,
339,
465,
581,
924,
2050,
640,
6171,
4562,
45,
3242,
7063,
1637,
46,
320,
310,
461,
1637,
51,
390,
8392,
3852,
2995,
45,
1710,
312,
303,
339,
465,
496,
1806,
303,
581,
1922,
16456,
365,
320,
310,
461,
878,
64,
303,
339,
465,
496,
1806,
303,
581,
910,
24097,
4810,
10082,
1175,
14433,
8219,
46,
320,
310,
3593,
327,
6344,
100,
15896,
546,
51,
2892,
45,
3469,
509,
320,
343,
1152,
2800,
3640,
100,
25618,
2710,
63,
343,
1152,
2800,
3640,
100,
3612,
88,
63,
343,
1152,
2800,
3640,
100,
5511,
9781,
88,
63,
343,
1152,
2800,
3640,
100,
30539,
9781,
88,
63,
419,
461,
2800,
3640,
100,
14036,
2333,
64,
343,
1263,
63,
419,
1440,
556,
12134,
459,
5850,
7417,
63,
332,
494,
8219,
312,
310,
339,
303,
339,
465,
496,
1806,
303,
581,
22697,
2487,
4810,
10082,
1175,
14433,
8219,
49,
1175,
910,
1197,
15477,
49,
1175,
910,
7818,
49,
733,
1175,
910,
1197,
7818,
3097,
49,
1175,
910,
3873,
2888,
46,
320,
310,
2681,
51,
105,
45,
6545,
49,
332,
1376,
8219,
63,
3021,
8219,
312,
310,
910,
2788,
64,
310,
1175,
648,
12379,
299,
7417,
100,
15896,
546,
51,
2892,
45,
3469,
312,
603,
3593,
327,
1909,
46,
320,
343,
1152,
2800,
3640,
100,
25618,
2710,
63,
419,
2788,
299,
2800,
3640,
100,
25618,
2710,
100,
3555,
64,
419,
1644,
64,
343,
1152,
2800,
3640,
100,
3612,
88,
63,
419,
2788,
299,
2800,
3640,
100,
3612,
88,
100,
3555,
64,
419,
1644,
64,
343,
1152
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
53,
119,
51,
4048,
51,
1872,
12354,
51,
624,
64,
222,
222,
485,
2616,
51,
1304,
51,
1795,
2588,
64,
222,
485,
2616,
51,
1304,
51,
1795,
3367,
64,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
1304,
51,
5729,
11947,
64,
222,
485,
2616,
51,
4617,
51,
7424,
64,
222,
485,
2616,
51,
4617,
51,
4181,
7424,
64,
222,
485,
2616,
51,
1317,
51,
5729,
64,
222,
485,
2616,
51,
519,
51,
6342,
64,
222,
485,
2616,
51,
519,
51,
18402,
33719,
64,
222,
485,
2616,
51,
6390,
51,
2981,
463,
7633,
64,
222,
485,
2616,
51,
3608,
51,
4341,
51,
10082,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
27322,
64,
222,
222,
485,
428,
51,
375,
53,
119,
51,
4048,
51,
769,
108,
53,
119,
51,
1353,
64,
222,
222,
942,
462,
14715,
2588,
2041,
6261,
2588,
320,
465,
1041,
294,
338,
9147,
456,
1716,
51,
294,
588,
303,
964,
924,
1175,
910,
19318,
299,
332,
6171,
2588,
884,
465,
1041,
294,
338,
6265,
562,
51,
294,
588,
303,
581,
924,
1175,
910,
10761,
21811,
299,
2426,
2588,
51,
15803,
494,
4956,
1376,
884,
465,
1041,
294,
338,
47006,
847,
456,
4184,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
14036,
2333,
299,
332,
3180,
52,
4048,
51,
1872,
12354,
51,
1376,
884,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
25618,
2710,
100,
6344,
299,
14433,
51,
2228,
459,
1304,
35398,
494,
10761,
21811,
494,
2450,
5286,
489,
742,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433,
2800,
3640,
100,
3612,
88,
100,
6344,
299,
14433
] | -1,221,484,587,706,763,500
| true
| false
| false
| false
|
[
6261,
2588,
320,
465,
1041,
294,
338,
9147,
456,
1716,
51,
294,
588,
303,
964,
924,
1175,
910,
19318,
299,
332,
6171,
2588,
884,
465,
1041,
294,
338,
6265,
562,
51,
294,
588,
303,
581,
924,
1175,
910,
10761,
21811,
299,
2426,
2588,
51,
15803,
494,
4956,
1376,
884,
465,
1041,
294,
338,
47006,
847,
456,
4184,
51,
294,
588,
303,
581,
924,
1175,
910,
2800,
3640,
100,
14036,
2333,
299,
332,
3180,
52,
4048,
51,
1872,
12354,
51,
1376,
884,
465,
1041,
294,
338,
3105,
1222,
14433,
130,
456,
4184,
6261,
51,
294,
588,
303,
581,
924,
1175,
14433
] | -5,927,766,842,547,125,000
| true
|
0r.android.callmeter.data;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import java.io.File;
import java.io.FileNotFoundException;
import de.ub0r.android.logg0r.Log;
public class ExportProvider extends ContentProvider {
/**
* Tag for output.
*/
private static final String TAG = "ExportProvider";
/**
* Authority.
*/
public static final String AUTHORITY = DataProvider.PACKAGE + ".export";
/**
* Mime type for export.
*/
public static final String EXPORT_MIMETYPE = "application/android.callmeter.export";
/**
* {@link Uri} for export Content.
*/
public static final Uri
|
database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import java.io.File;
import java.io.FileNotFoundException;
import de.ub0r.android.logg0r.Log;
public class ExportProvider extends ContentProvider {
/**
* Tag for output.
*/
private static final String TAG = "ExportProvider";
/**
* Authority.
*/
public static final String AUTHORITY = DataProvider.PACKAGE + ".export";
/**
* Mime type for export.
*/
public static final String EXPORT_MIMETYPE = "application/android.callmeter.export";
/**
* {@link Uri} for export Content.
*/
public static final Uri
|
android.support.annotation.NonNull;
import java.io.File;
import java.io.FileNotFoundException;
import de.ub0r.android.logg0r.Log;
public class ExportProvider extends ContentProvider {
/**
* Tag for output.
*/
private static final String TAG = "ExportProvider";
/**
* Authority.
*/
public static final String AUTHORITY = DataProvider.PACKAGE + ".export";
/**
* Mime type for export.
*/
public static final String EXPORT_MIMETYPE = "application/android.callmeter.export";
/**
* {@link Uri} for export Content.
*/
public static final Uri
|
ContentProvider {
/**
* Tag for output.
*/
private static final String TAG = "ExportProvider";
/**
* Authority.
*/
public static final String AUTHORITY = DataProvider.PACKAGE + ".export";
/**
* Mime type for export.
*/
public static final String EXPORT_MIMETYPE = "application/android.callmeter.export";
/**
* {@link Uri} for export Content.
*/
public static final Uri
|
EXPORT_RULESET_URI = Uri.parse("content://" + AUTHORITY + "/ruleset");
/**
* {@link Uri} for export Content.
*/
public static final Uri EXPORT_LOGS_URI = Uri
|
Data.java
|
/FileExtraction/Java_unseen/link-it_govway/core/src/org/openspcoop2/core/tracciamento/Data.java
|
/*
* GovWay - A customizable API Gateway
* https://govway.org
*
* Copyright (c) 2005-2024 Link.it srl (https://link.it).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3, as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openspcoop2.core.tracciamento;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/** <p>Java class for data complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="data">
* <sequence>
* <element name="date-time" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0" maxOccurs="1"/>
* <element name="sorgente" type="{http://www.openspcoop2.org/core/tracciamento}TipoData" minOccurs="0" maxOccurs="1"/>
* </sequence>
* </complexType>
* </pre>
*
* @version $Rev$, $Date$
*
* @author Poli Andrea (poli@link.it)
* @author $Author$
* */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "data",
propOrder = {
"dateTime",
"sorgente"
}
)
@XmlRootElement(name = "data")
public class Data extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
public Data() {
super();
}
public java.util.Date getDateTime() {
return this.dateTime;
}
public void setDateTime(java.util.Date dateTime) {
this.dateTime = dateTime;
}
public TipoData getSorgente() {
return this.sorgente;
}
public void setSorgente(TipoData sorgente) {
this.sorgente = sorgente;
}
private static final long serialVersionUID = 1L;
@javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(org.openspcoop2.utils.jaxb.DateTime2String.class)
@javax.xml.bind.annotation.XmlSchemaType(name="dateTime")
@XmlElement(name="date-time",required=false,nillable=false,type=java.lang.String.class)
protected java.util.Date dateTime;
@XmlElement(name="sorgente",required=false,nillable=false)
protected TipoData sorgente;
}
| 2,683
|
Java
|
.java
|
link-it/govway
| 48
| 8
| 18
|
2018-06-25T07:52:40Z
|
2024-05-08T13:23:36Z
|
802d3894e3b701fece88994d50f0ec16cec70eb6708db0ff608e529dfa9865d2
|
[] |
[
1127,
222,
338,
590,
1558,
17963,
449,
418,
3137,
6776,
2347,
19405,
1676,
338,
1698,
574,
7202,
3094,
51,
1107,
222,
338,
1676,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
58,
50,
55,
53,
55,
57,
6130,
51,
302,
328,
1796,
327,
662,
574,
1222,
51,
302,
566,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
56,
49,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
588,
222,
1337,
1105,
51,
1693,
438,
352,
539,
55,
51,
1284,
51,
378,
31632,
9805,
64,
222,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
41079,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
9794,
638,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
17093,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
4069,
1325,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
40002,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
499,
222,
1350,
350,
117,
67,
5445,
462,
456,
727,
8667,
847,
51,
222,
338,
1676,
338,
350,
117,
67,
1338,
2434,
5379,
10299,
15834,
341,
2816,
1813,
14561,
4824,
477,
462,
51,
222,
338,
1676,
338,
350,
1023,
67,
222,
338,
568,
2176,
64,
46990,
655,
366,
624,
30424,
1855,
64,
222,
338,
4238,
221,
43,
2176,
64,
7543,
43,
1855,
64,
222,
338,
10883,
221,
43,
2176,
64,
2559,
655,
366,
787,
50,
1021,
39,
847,
15469,
544,
574,
1516,
51,
124,
56,
51,
1107,
52,
55,
53,
53,
54,
52,
29064,
130,
21670,
39,
1865,
34827,
366,
53,
39,
1788,
34827,
366,
54,
9697,
43,
1855,
64,
222,
338,
10883,
221,
43,
2176,
64,
2559,
655,
366,
120,
1107,
9231,
39,
847,
15469,
544,
574,
1516,
51,
1693,
438,
352,
539,
55,
51,
1107,
52,
1284,
52,
378,
31632,
9805,
130,
11437,
768,
39,
1865,
34827,
366,
53,
39,
1788,
34827,
366,
54,
9697,
43,
1855,
64,
222,
338,
4238,
221,
43,
2176,
6532,
7543,
43,
1855,
64,
222,
338,
568,
2176,
6532,
46990,
43,
1855,
64,
222,
338,
594,
1023,
67,
222,
338,
1676,
338,
496,
1687,
417,
14911,
15730,
417,
1563,
41,
222,
338,
1676,
338,
496,
2133,
14358,
110,
4262,
25706,
327,
3435,
110,
69,
1222,
51,
302,
46,
222,
338,
496,
2133,
417,
4372,
41,
222,
338,
588,
222,
222,
69,
4411,
9794,
638,
45,
4411,
41079,
51,
6457,
46,
222,
69,
40002,
45,
444,
299,
332,
624,
411,
5246,
7030,
2888,
299,
320,
682,
221,
39,
21670,
411,
682,
221,
39,
120,
1107,
9231,
39,
353,
339,
222,
46,
222,
222,
69,
4411,
4069,
1325,
45,
444,
299,
332,
624,
678,
222,
222,
942,
462,
2426,
2041,
1105,
51,
1693,
438,
352,
539,
55,
51,
2324,
51,
9580,
51,
1778,
5358,
1569,
625,
4584,
19182,
1737,
14427,
463,
320,
353,
581,
2426,
365,
320,
303,
2615,
492,
353,
339,
736,
581,
1401,
51,
1058,
51,
1563,
640,
4861,
365,
320,
303,
461,
477,
51,
21670,
64,
353,
339,
736,
581,
782,
758,
4861,
45,
1874,
51,
1058,
51,
1563,
32826,
46,
320,
303,
477,
51,
21670,
299,
32826,
64,
353,
339,
736,
581,
38393,
768,
43543,
1107,
9231,
365,
320,
303,
461,
477,
51,
120,
1107,
9231,
64,
353,
339,
736,
581,
782,
758,
88,
1107,
9231,
45,
11437,
768,
328,
1107,
9231,
46,
320,
303,
477,
51,
120,
1107,
9231,
299,
328,
1107,
9231,
64,
353,
339,
736,
964,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
36091,
496,
10775,
51,
2608,
51,
2555,
51,
4341,
51,
27351,
51,
4411,
5445,
638,
4433,
45,
1107,
51,
1693,
438,
352,
539,
55,
51,
2324,
51,
8954,
103,
51,
4861,
55,
671,
51,
842,
46,
353,
496,
10775,
51,
2608,
51,
2555,
51,
4341,
51,
26886,
638,
45,
444,
366,
21670,
678,
353,
496,
17093,
45,
444,
366,
787,
50,
1021,
411,
3662,
66,
1886,
49,
115,
747,
463,
66,
1886,
49,
700,
66,
1874,
51,
1600,
51,
671,
51,
842,
46,
353,
2532,
1401,
51,
1058,
51,
1563,
32826,
64,
736,
496,
17093,
45,
444,
366,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 821
|
[
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
588,
222,
1337,
1105,
51,
1693,
438,
352,
539,
55,
51,
1284,
51,
378,
31632,
9805,
64,
222,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
41079,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
9794,
638,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
17093,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
4411,
4069,
1325,
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
40002,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
499,
222,
1350,
350,
117,
67,
5445,
462,
456,
727,
8667,
847,
51,
222,
338,
1676,
338,
350,
117,
67,
1338,
2434,
5379,
10299,
15834,
341,
2816,
1813,
14561,
4824,
477,
462,
51,
222,
338,
1676,
338,
350,
1023,
67,
222,
338,
568,
2176,
64,
46990,
655,
366,
624,
30424,
1855,
64,
222,
338,
4238,
221,
43,
2176,
64,
7543,
43,
1855,
64,
222,
338,
10883,
221,
43,
2176,
64,
2559,
655,
366,
787,
50,
1021,
39,
847,
15469,
544,
574,
1516,
51,
124,
56,
51,
1107,
52,
55,
53,
53,
54,
52,
29064,
130,
21670,
39,
1865,
34827,
366,
53,
39,
1788,
34827,
366,
54,
9697,
43,
1855,
64,
222,
338,
10883,
221,
43,
2176,
64,
2559,
655,
366,
120,
1107,
9231,
39,
847,
15469,
544,
574,
1516
] | -848,848,855,665,277,600
| true
| false
| false
| false
|
[
64,
222,
485,
3698,
51,
2608,
51,
2555,
51,
4341,
51,
40002,
64,
222,
485,
1401,
51,
735,
51,
12644,
64,
499,
222,
1350,
350,
117,
67,
5445,
462,
456,
727,
8667,
847,
51,
222,
338,
1676,
338,
350,
117,
67,
1338,
2434,
5379,
10299,
15834,
341,
2816,
1813,
14561,
4824,
477,
462,
51,
222,
338,
1676,
338,
350,
1023,
67,
222,
338,
568,
2176,
64,
46990,
655,
366,
624,
30424,
1855,
64,
222,
338,
4238,
221,
43,
2176,
64,
7543,
43,
1855,
64,
222,
338,
10883,
221,
43,
2176,
64,
2559,
655,
366,
787,
50,
1021,
39,
847,
15469
] | 7,652,557,196,743,522,000
| true
|
useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openspcoop2.core.tracciamento;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/** <p>Java class for data complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="data">
* <sequence>
* <element name="date-time" type="{
|
GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openspcoop2.core.tracciamento;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/** <p>Java class for data complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="data">
* <sequence>
* <element name="date-time" type="{
|
javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/** <p>Java class for data complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="data">
* <sequence>
* <element name="date-time" type="{
|
;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/** <p>Java class for data complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="data">
* <sequence>
* <element name="date-time" type="{
|
http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0" maxOccurs="1"/>
* <element name="sorgente" type="{http://www
|
ImportTmxPage.java
|
/FileExtraction/Java_unseen/heartsome_tmxeditor8/database/net.heartsome.cat.database.ui.tm/src/net/heartsome/cat/database/ui/tm/wizard/ImportTmxPage.java
|
/**
* ImportWizardTmxPage.java
*
* Version information :
*
* Date:Oct 20, 2011
*
* Copyright notice :
* 本文件及其附带的相关文件包含机密信息,仅限瀚特盛科技有限公司指定的,与本项目有关的内部人员和客户联络人员查阅和使用。
* 如果您不是本保密声明中指定的收件者,请立即销毁本文件,禁止对本文件或根据本文件中的内容采取任何其他行动,
* 包括但不限于:泄露本文件中的信息、以任何方式制作本文件全部或部分内容之副本、将本文件或其相关副本提供给任何其他人。
*/
package net.heartsome.cat.database.ui.tm.wizard;
import net.heartsome.cat.common.bean.DatabaseModelBean;
import net.heartsome.cat.common.core.exception.ImportException;
import net.heartsome.cat.database.bean.TMPreferenceConstants;
import net.heartsome.cat.database.service.DatabaseService;
import net.heartsome.cat.database.ui.tm.Activator;
import net.heartsome.cat.database.ui.tm.resource.Messages;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jason
* @version
* @since JDK1.6
*/
public class ImportTmxPage extends WizardPage {
Logger logger = LoggerFactory.getLogger(ImportTmxPage.class);
private Text tmxFileText;
private DatabaseModelBean dbModel;
/**
* Create the wizard.
*/
public ImportTmxPage(DatabaseModelBean dbModel) {
super("wizardPage");
setTitle(Messages.getString("wizard.ImportTmxPage.title"));
setDescription(Messages.getString("wizard.ImportTmxPage.desc"));
setImageDescriptor(Activator.getImageDescriptor("images/dialog/import-tmx-logo.png"));
this.dbModel = dbModel;
}
/**
* Create contents of the wizard.
*
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(3, false));
Label lblTmx = new Label(container, SWT.NONE);
lblTmx.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false,
1, 1));
lblTmx.setText(Messages.getString("wizard.ImportTmxPage.lblTmx"));
tmxFileText = new Text(container, SWT.BORDER | SWT.READ_ONLY);
tmxFileText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false, 1, 1));
tmxFileText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String tmxFile = getTMXFile();
if (tmxFile == null) {
setErrorMessage(Messages.getString("wizard.ImportTmxPage.msg1"));
setPageComplete(false);
} else {
setErrorMessage(null);
setPageComplete(true);
}
}
});
Button tmxFileBorwserBtn = new Button(container, SWT.NONE);
tmxFileBorwserBtn.setText(Messages.getString("wizard.ImportTmxPage.tmxFileBorwserBtn"));
tmxFileBorwserBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FileDialog dlg = new FileDialog(getShell());
String[] filterExt = { "*.tmx" };
dlg.setFilterExtensions(filterExt);
String path = dlg.open();
if (path != null) {
tmxFileText.setText(path);
}
}
});
setControl(container);
}
/**
* 执行导入
*
* @param tmxFile
* @param tbxFile
* @param dbMetaData
* @param monitor
* ;
* @throws InterruptedException
*/
public void executeImport(String tmxFile, IProgressMonitor monitor)
throws InterruptedException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
monitor.beginTask("", 100);
monitor.setTaskName(Messages.getString("wizard.ImportTmxPage.task1"));
int tmxResult = -10;
StringBuffer resultMessage = new StringBuffer();
String message = "";
if (tmxFile != null) {
try {
tmxResult = DatabaseService.importTmxWithFile(dbModel
.toDbMetaData(), tmxFile, new SubProgressMonitor(monitor,
100), getTmxImportStrategy(), isNeedCheckContext());
} catch (ImportException e) {
message = e.getMessage();
}
if (!message.equals("")) {
final String _message = message;
Display.getDefault().asyncExec(new Runnable() {
public void run() {
setErrorMessage(_message);
}
});
throw new InterruptedException();
}
}
if (tmxResult != DatabaseService.SUCCESS) {
if (tmxResult == DatabaseService.FAILURE_1) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg1"));
} else if (tmxResult == DatabaseService.FAILURE_2) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg2"));
} else if (tmxResult == DatabaseService.FAILURE_3) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg3"));
} else if (tmxResult == DatabaseService.FAILURE_4) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg4"));
} else if (tmxResult == DatabaseService.FAILURE) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg5"));
} else if (tmxResult == DatabaseService.CANCEL) {
resultMessage.append(Messages.getString("wizard.ImportTmxPage.msg6"));
}
if (!resultMessage.toString().equals("")) {
final String _message = resultMessage.toString();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
setErrorMessage(_message);
}
});
}
throw new InterruptedException();
}
monitor.done();
}
public String getTMXFile() {
String file = tmxFileText.getText().trim();
if (file == null || file.length() == 0) {
return null;
}
return file;
}
/**
* 从首选项中读取导入策略
*
* @return ;
*/
public int getTmxImportStrategy() {
IPreferenceStore ps = Activator.getDefault().getPreferenceStore();
return ps.getInt(TMPreferenceConstants.TM_UPDATE);
}
/**
* 判断在导入的时候是否需要检查上下文
*
* @return ;
*/
public boolean isNeedCheckContext() {
return false;
}
}
| 6,623
|
Java
|
.java
|
heartsome/tmxeditor8
| 67
| 47
| 7
|
2014-06-03T17:56:38Z
|
2020-10-13T06:40:43Z
|
88a5c9a97f6436cbea29f2b9c0da94425ffa1f7375d2d74bbbbd167ba69d2513
|
[] |
[
1350,
222,
338,
9274,
22934,
89,
7796,
1983,
51,
1874,
222,
338,
222,
338,
3050,
2490,
518,
222,
338,
222,
338,
2833,
63,
16203,
244,
55,
53,
49,
244,
55,
53,
54,
54,
222,
338,
222,
338,
2657,
5410,
518,
222,
338,
41769,
6162,
12325,
7319,
34994,
19595,
1096,
19797,
6162,
17723,
8225,
11732,
7853,
1140,
21848,
10975,
199,
246,
272,
10688,
3274,
273,
23732,
17046,
3052,
10975,
24853,
45570,
1140,
8933,
5207,
14582,
3052,
6830,
1096,
28877,
36426,
4496,
18827,
15527,
17395,
36426,
8010,
24017,
4496,
4707,
1469,
1676,
338,
16991,
15978,
16174,
5207,
9109,
11732,
32051,
3011,
45570,
11586,
3821,
6548,
1140,
6311,
14458,
12886,
27376,
5725,
247,
5207,
6162,
1140,
30458,
17195,
4317,
5207,
6162,
7668,
15871,
5207,
6162,
10194,
12339,
22486,
4798,
21555,
15481,
3677,
5947,
1140,
1676,
338,
244,
25410,
11065,
3065,
10975,
5024,
3111,
3428,
250,
6407,
148,
5207,
6162,
10194,
7853,
2626,
3463,
21555,
14133,
7657,
4636,
5207,
6162,
30309,
7668,
16807,
12339,
7478,
44019,
5207,
2626,
6832,
5207,
6162,
7668,
7319,
19797,
44019,
5207,
14411,
12862,
21555,
15481,
5499,
1469,
222,
588,
222,
1337,
3723,
51,
15894,
6074,
51,
2612,
51,
4617,
51,
1726,
51,
6565,
51,
21862,
64,
222,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
2297,
51,
12455,
51,
3969,
1262,
5358,
64,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
2297,
51,
1284,
51,
3918,
51,
4214,
1002,
64,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
4617,
51,
12455,
51,
11777,
3592,
5238,
64,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
4617,
51,
2140,
51,
3969,
1201,
64,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
4617,
51,
1726,
51,
6565,
51,
39293,
64,
222,
485,
3723,
51,
15894,
6074,
51,
2612,
51,
4617,
51,
1726,
51,
6565,
51,
3157,
51,
6389,
64,
222,
222,
485,
1105,
51,
8327,
51,
1284,
51,
4700,
51,
78,
5291,
8538,
64,
222,
485,
1105,
51,
8327,
51,
1284,
51,
4700,
51,
1898,
5291,
8538,
64,
222,
485,
1105,
51,
8327,
51,
1284,
51,
4700,
51,
1736,
5291,
8538,
64,
222,
485,
1105,
51,
8327,
51,
111,
1179,
51,
29565,
51,
2046,
3592,
2796,
64,
222,
485,
1105,
51,
8327,
51,
111,
1179,
51,
21862,
51,
22934,
1983,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
5696,
89,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
5070,
51,
14498,
1167,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
5070,
51,
14498,
2239,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
5070,
51,
5385,
4433,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
5070,
51,
5385,
1167,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
3106,
51,
3567,
768,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
3106,
51,
48532,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
1732,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
14377,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
3948,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
28045,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
2186,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
1049,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
222,
1350,
222,
338,
496,
2133,
990,
3293,
222,
338,
496,
1687,
222,
338,
496,
8152,
33047,
54,
51,
59,
222,
588,
222,
942,
462,
9274,
89,
7796,
1983,
2041,
42591,
1983,
320,
222,
221,
3716,
4101,
299,
21818,
51,
10588,
45,
4214,
89,
7796,
1983,
51,
842,
312,
222,
221,
2072,
3336,
292,
7796,
991,
1049,
64,
222,
221,
2072,
6728,
1262,
5358,
3100,
1262,
64,
499,
221,
1350,
376,
338,
2673,
341,
30020,
51,
376,
588,
222,
221,
942,
9274,
89,
7796,
1983,
45,
3969,
1262,
5358,
3100,
1262,
46,
320,
376,
221,
5282,
459,
21862,
1983,
742,
376,
221,
17359,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
1333,
2992,
376,
221,
28190,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
3817,
2992,
376,
221,
25886,
4336,
45,
39293,
51,
25414,
4336,
459,
2266,
52,
5962,
52,
485,
50,
6565,
125,
50,
5383,
51,
1665,
2992,
376,
221,
597,
51,
1219,
1262,
299,
3100,
1262,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
2673,
7321,
451,
341,
30020,
51,
376,
338,
4517,
338,
496,
772,
2952,
376,
588,
222,
221,
942,
782,
1506,
2436,
45,
14377,
2952,
46,
320,
376,
221,
14377,
3863,
299,
556,
26431,
45,
2562,
49,
26294,
51,
3305,
312,
376,
221,
2646,
51,
20113,
45,
909,
7877,
2362,
45,
56,
49,
920,
894,
1332,
221,
2186,
16382,
89,
7796,
299,
556,
9305,
45,
2646,
49,
26294,
51,
8476,
312,
376,
221,
10703,
89,
7796,
51,
20113,
768,
45,
909,
7877,
768,
45,
5696,
89,
51,
6517,
49,
26294,
51,
16562,
49,
920,
49,
920,
49,
596,
54,
49,
244,
54,
894,
376,
221,
10703,
89,
7796,
51,
6619,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
10703,
89,
7796,
2992,
1332,
221,
6565,
125,
991,
1049,
299,
556,
3336,
45,
2646,
49,
26294,
51,
33396,
542,
26294,
51,
4423,
100,
13003,
312,
376,
221,
6565,
125,
991,
1049,
51,
20113,
768,
45,
909,
7877,
768,
45,
5696,
89,
51,
23356,
49,
26294,
51,
16562,
49,
878,
49,
621,
221,
1886,
49,
244,
54,
49,
244,
54,
894,
376,
221,
6565,
125,
991,
1049,
51,
688,
14498,
2239,
45,
909,
19936,
2239,
365,
320,
2556,
221,
942,
782,
5370,
1049,
45,
14498,
1167,
503,
46,
320,
621,
221,
671,
292,
7796,
991,
299,
640,
9043,
93,
991,
492,
621,
221,
344,
327,
6565,
125,
991,
630,
762,
46,
320,
596,
221,
489,
14472,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
2093,
54,
2992,
596,
221,
489,
1983,
7375,
45,
1886,
312,
621,
221,
130,
832,
320,
596,
221,
489,
14472,
45,
1710,
312,
596,
221,
489,
1983,
7375,
45,
1527,
312,
621,
221,
130,
374,
221,
130,
376,
221,
1933,
1332,
221,
1732,
292,
7796
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
222,
1350,
222,
338,
496,
2133,
990,
3293,
222,
338,
496,
1687,
222,
338,
496,
8152,
33047,
54,
51,
59,
222,
588,
222,
942,
462,
9274,
89,
7796,
1983,
2041,
42591,
1983,
320,
222,
221,
3716,
4101,
299,
21818,
51,
10588,
45,
4214,
89,
7796,
1983,
51,
842,
312,
222,
221,
2072,
3336,
292,
7796,
991,
1049,
64,
222,
221,
2072,
6728,
1262,
5358,
3100,
1262,
64,
499,
221,
1350,
376,
338,
2673,
341,
30020,
51,
376,
588,
222,
221,
942,
9274,
89,
7796,
1983,
45,
3969,
1262,
5358,
3100,
1262,
46,
320,
376,
221,
5282,
459,
21862,
1983,
742,
376,
221,
17359,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
1333,
2992,
376,
221,
28190,
45,
6389,
51,
7080,
459,
21862,
51,
4214,
89,
7796,
1983,
51,
3817,
2992,
376,
221,
25886,
4336,
45,
39293,
51,
25414,
4336,
459,
2266,
52,
5962,
52,
485,
50,
6565,
125,
50,
5383,
51,
1665,
2992,
376,
221,
597,
51,
1219,
1262,
299,
3100,
1262,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
2673,
7321,
451,
341,
30020,
51,
376,
338,
4517,
338,
496,
772,
2952,
376,
588,
222,
221,
942,
782,
1506,
2436,
45,
14377,
2952,
46,
320,
376,
221,
14377,
3863,
299,
556,
26431,
45,
2562,
49,
26294,
51,
3305,
312,
376,
221,
2646,
51,
20113,
45,
909,
7877,
2362,
45,
56,
49,
920,
894,
1332,
221,
2186,
16382,
89,
7796,
299,
556,
9305,
45,
2646,
49,
26294,
51,
8476,
312,
376,
221,
10703,
89,
7796,
51,
20113,
768,
45,
909,
7877,
768,
45,
5696,
89,
51,
6517,
49,
26294,
51,
16562,
49,
920,
49,
920,
49,
596,
54,
49,
244,
54,
894,
376,
221,
10703,
89,
7796,
51
] | 5,687,117,871,615,271,000
| true
| false
| false
| false
|
[
2992,
376,
221,
25886,
4336,
45,
39293,
51,
25414,
4336,
459,
2266,
52,
5962,
52,
485,
50,
6565,
125,
50,
5383,
51,
1665,
2992,
376,
221,
597,
51,
1219,
1262,
299,
3100,
1262,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
2673,
7321,
451,
341,
30020,
51,
376,
338,
4517,
338,
496,
772,
2952,
376,
588,
222,
221,
942,
782,
1506,
2436,
45,
14377,
2952,
46,
320,
376,
221,
14377,
3863,
299,
556,
26431,
45,
2562,
49,
26294,
51,
3305,
312,
376,
221,
2646,
51,
20113,
45,
909,
7877,
2362,
45,
56,
49,
920,
894,
1332,
221,
2186,
16382
] | -7,592,541,966,856,941,000
| true
|
slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jason
* @version
* @since JDK1.6
*/
public class ImportTmxPage extends WizardPage {
Logger logger = LoggerFactory.getLogger(ImportTmxPage.class);
private Text tmxFileText;
private DatabaseModelBean dbModel;
/**
* Create the wizard.
*/
public ImportTmxPage(DatabaseModelBean dbModel) {
super("wizardPage");
setTitle(Messages.getString("wizard.ImportTmxPage.title"));
setDescription(Messages.getString("wizard.ImportTmxPage.desc"));
setImageDescriptor(Activator.getImageDescriptor("images/dialog/import-tmx-logo.png"));
this.dbModel = dbModel;
}
/**
* Create contents of the wizard.
*
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(3, false));
Label lbl
|
Logger logger = LoggerFactory.getLogger(ImportTmxPage.class);
private Text tmxFileText;
private DatabaseModelBean dbModel;
/**
* Create the wizard.
*/
public ImportTmxPage(DatabaseModelBean dbModel) {
super("wizardPage");
setTitle(Messages.getString("wizard.ImportTmxPage.title"));
setDescription(Messages.getString("wizard.ImportTmxPage.desc"));
setImageDescriptor(Activator.getImageDescriptor("images/dialog/import-tmx-logo.png"));
this.dbModel = dbModel;
}
/**
* Create contents of the wizard.
*
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(3, false));
Label lbl
|
mxPage(DatabaseModelBean dbModel) {
super("wizardPage");
setTitle(Messages.getString("wizard.ImportTmxPage.title"));
setDescription(Messages.getString("wizard.ImportTmxPage.desc"));
setImageDescriptor(Activator.getImageDescriptor("images/dialog/import-tmx-logo.png"));
this.dbModel = dbModel;
}
/**
* Create contents of the wizard.
*
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(3, false));
Label lbl
|
"));
setImageDescriptor(Activator.getImageDescriptor("images/dialog/import-tmx-logo.png"));
this.dbModel = dbModel;
}
/**
* Create contents of the wizard.
*
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(3, false));
Label lbl
|
Tmx = new Label(container, SWT.NONE);
lblTmx.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false,
1, 1));
lblTmx.
|
QueryResultServiceTestUtil.java
|
/FileExtraction/Java_unseen/diqube_diqube/diqube-itest/src/test/java/org/diqube/itest/util/QueryResultServiceTestUtil.java
|
/**
* diqube: Distributed Query Base.
*
* Copyright (C) 2015 Bastian Gloeckle
*
* This file is part of diqube.
*
* diqube is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diqube.itest.util;
import java.io.Closeable;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.thrift.TException;
import org.apache.thrift.TMultiplexedProcessor;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.server.TNonblockingServer;
import org.apache.thrift.server.TServer;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TTransportException;
import org.diqube.itest.control.ServerControl.ServerAddr;
import org.diqube.itest.util.ClusterFlattenServiceTestUtil.TestClusterFlattenService;
import org.diqube.remote.query.KeepAliveServiceConstants;
import org.diqube.remote.query.QueryResultServiceConstants;
import org.diqube.remote.query.thrift.KeepAliveService;
import org.diqube.remote.query.thrift.QueryResultService;
import org.diqube.remote.query.thrift.QueryService;
import org.diqube.remote.query.thrift.RQueryException;
import org.diqube.remote.query.thrift.RQueryStatistics;
import org.diqube.remote.query.thrift.RResultTable;
import org.diqube.thrift.base.thrift.RUUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Util class which opens a {@link QueryResultService} in this process in order to receive results from calling a
* {@link QueryService} on a diqube-server.
*
* @author Bastian Gloeckle
*/
public class QueryResultServiceTestUtil {
private static final Logger logger = LoggerFactory.getLogger(QueryResultServiceTestUtil.class);
public static TestQueryResultService createQueryResultService() {
short port = 5200; // TODO find port dynamically.
TMultiplexedProcessor multiProcessor = new TMultiplexedProcessor();
TestQueryResultService res = new TestQueryResultService(new ServerAddr("127.0.0.1", port));
QueryResultServiceImpl serviceImpl = new QueryResultServiceImpl(res);
multiProcessor.registerProcessor(QueryResultServiceConstants.SERVICE_NAME,
new QueryResultService.Processor<QueryResultService.Iface>(serviceImpl));
multiProcessor.registerProcessor(KeepAliveServiceConstants.SERVICE_NAME,
new KeepAliveService.Processor<KeepAliveService.Iface>(new KeepAliveService.Iface() {
@Override
public void ping() throws TException {
// noop.
}
}));
TNonblockingServerSocket transport;
try {
transport = new TNonblockingServerSocket(new InetSocketAddress("127.0.0.1", port));
} catch (TTransportException e) {
throw new RuntimeException("Could not open transport for result service", e);
}
TNonblockingServer.Args args = new TNonblockingServer.Args(transport);
args.processor(multiProcessor);
args.transportFactory(new TFramedTransport.Factory());
// no integrity check for everything.
args.protocolFactory(new TCompactProtocol.Factory());
TNonblockingServer thriftServer = new TNonblockingServer(args);
Thread serverThread = new Thread(() -> thriftServer.serve(), "Test-QueryResultService-serverthread");
res.setThriftServer(thriftServer);
res.setServerThread(serverThread);
serverThread.start();
return res;
}
public static class TestQueryResultService implements Closeable {
private TServer thriftServer;
private Thread serverThread;
private Map<Short, RResultTable> intermediateUpdates = new ConcurrentHashMap<>();
private RResultTable finalUpdate = null;
private RQueryException exception = null;
private RQueryStatistics stats = null;
private ServerAddr thisServicesAddr;
/* package */ TestQueryResultService(ServerAddr thisServicesAddr) {
this.thisServicesAddr = thisServicesAddr;
}
/**
* Checks if there was an exception in the meantime and throws it.
*/
public boolean check() throws RuntimeException {
if (exception != null)
throw new RuntimeException("Exception while executing a query: " + exception.getMessage());
return true;
}
@Override
public void close() throws IOException {
thriftServer.stop();
try {
serverThread.join(1000);
} catch (InterruptedException e) {
throw new IOException("Interrupted while waiting for test thread to shut down.", e);
}
if (serverThread.isAlive())
throw new IOException("Could not shutdown test server thread.");
}
private void setThriftServer(TServer thriftServer) {
this.thriftServer = thriftServer;
}
private void setServerThread(Thread serverThread) {
this.serverThread = serverThread;
}
public Map<Short, RResultTable> getIntermediateUpdates() {
return intermediateUpdates;
}
public RResultTable getFinalUpdate() {
return finalUpdate;
}
public RQueryStatistics getStats() {
return stats;
}
public ServerAddr getThisServicesAddr() {
return thisServicesAddr;
}
public RQueryException getException() {
return exception;
}
}
/**
* Internal implementation of {@link QueryResultService} which forwards all data to {@link TestClusterFlattenService}.
*/
private static class QueryResultServiceImpl implements QueryResultService.Iface {
private TestQueryResultService res;
public QueryResultServiceImpl(TestQueryResultService res) {
this.res = res;
}
@Override
public void partialUpdate(RUUID queryRUuid, RResultTable partialResult, short percentComplete) throws TException {
logger.trace("Received partial update ({} %): {}", percentComplete, partialResult);
res.intermediateUpdates.put(percentComplete, partialResult);
}
@Override
public void queryResults(RUUID queryRUuid, RResultTable finalResult) throws TException {
logger.trace("Received final update: {}", finalResult);
res.finalUpdate = finalResult;
}
@Override
public void queryException(RUUID queryRUuid, RQueryException exceptionThrown) throws TException {
logger.trace("Received exception: {}", exceptionThrown.getMessage(), exceptionThrown);
res.exception = exceptionThrown;
}
@Override
public void queryStatistics(RUUID queryRuuid, RQueryStatistics stats) throws TException {
logger.trace("Received stats: {}", stats);
res.stats = stats;
}
}
}
| 7,197
|
Java
|
.java
|
diqube/diqube
| 18
| 1
| 76
|
2015-07-10T13:34:28Z
|
2022-12-10T01:28:19Z
|
1c41803c84b76e407ff6b8f481f964ec9d883902d4873b72e3b049da32487262
|
[] |
[
1350,
222,
338,
2090,
118,
3514,
63,
22775,
6662,
3787,
51,
222,
338,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
58,
570,
36949,
590,
335,
106,
473,
293,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
2090,
118,
3514,
51,
222,
338,
222,
338,
2090,
118,
3514,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
222,
338,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
1105,
51,
1351,
118,
3514,
51,
302,
464,
51,
1058,
64,
222,
222,
485,
1401,
51,
735,
51,
41741,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1317,
51,
30922,
34871,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1401,
51,
1058,
51,
8349,
51,
18705,
8263,
64,
222,
222,
485,
1105,
51,
2121,
51,
14645,
51,
89,
1002,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
9043,
2530,
1927,
337,
6872,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
5732,
51,
89,
13073,
5519,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
1805,
51,
89,
3921,
22807,
2077,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
1805,
51,
89,
2077,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
9618,
51,
89,
2163,
105,
10003,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
9618,
51,
89,
3921,
22807,
2077,
5270,
64,
222,
485,
1105,
51,
2121,
51,
14645,
51,
9618,
51,
89,
10003,
1002,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
302,
464,
51,
2452,
51,
2077,
2436,
51,
2077,
6774,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
302,
464,
51,
1058,
51,
4619,
38851,
1201,
37370,
51,
1024,
4619,
38851,
1201,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
44809,
1201,
5238,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
34726,
1201,
5238,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
44809,
1201,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
34726,
1201,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
1643,
1201,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
87,
1643,
1002,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
87,
1643,
13487,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
7004,
51,
1234,
51,
14645,
51,
87,
1413,
1617,
64,
222,
485,
1105,
51,
1351,
118,
3514,
51,
14645,
51,
1460,
51,
14645,
51,
87,
7604,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
12172,
57,
111,
51,
19580,
64,
222,
222,
1350,
222,
338,
7292,
462,
1532,
28057,
331,
3105,
1222,
6662,
1413,
1201,
130,
347,
477,
2183,
347,
2554,
391,
7776,
3300,
664,
8294,
331,
222,
338,
3105,
1222,
6662,
1201,
130,
563,
331,
2090,
118,
3514,
50,
1805,
51,
222,
338,
222,
338,
496,
2133,
570,
36949,
590,
335,
106,
473,
293,
222,
588,
222,
942,
462,
6662,
1413,
1201,
37370,
320,
353,
964,
924,
1175,
7145,
4101,
299,
21818,
51,
10588,
45,
34726,
1201,
37370,
51,
842,
312,
736,
581,
924,
2128,
34726,
1201,
1506,
34726,
1201,
365,
320,
303,
4514,
2618,
299,
244,
58,
55,
53,
53,
64,
453,
4314,
2309,
2618,
22530,
51,
465,
413,
11013,
1927,
337,
6872,
6973,
6872,
299,
556,
413,
11013,
1927,
337,
6872,
492,
465,
2128,
34726,
1201,
755,
299,
556,
2128,
34726,
1201,
45,
909,
4242,
6774,
459,
54,
55,
60,
51,
53,
51,
53,
51,
54,
411,
2618,
894,
303,
6662,
1413,
22806,
2733,
3499,
299,
556,
6662,
1413,
22806,
45,
595,
312,
465,
6973,
6872,
51,
3334,
6872,
45,
34726,
1201,
5238,
51,
12748,
100,
2491,
49,
310,
556,
6662,
1413,
1201,
51,
6872,
65,
34726,
1201,
51,
78,
1179,
1579,
2140,
3499,
894,
303,
6973,
6872,
51,
3334,
6872,
45,
44809,
1201,
5238,
51,
12748,
100,
2491,
49,
310,
556,
19135,
18897,
1201,
51,
6872,
65,
44809,
1201,
51,
78,
1179,
1579,
909,
19135,
18897,
1201,
51,
78,
1179,
365,
320,
633,
496,
1806,
633,
581,
782,
16993,
365,
2589,
413,
1002,
320,
343,
453,
28981,
51,
633,
339,
310,
10542,
465,
413,
3921,
22807,
2077,
5270,
11350,
64,
303,
1614,
320,
416,
11350,
299,
556,
413,
3921,
22807,
2077,
5270,
45,
909,
36499,
34871,
459,
54,
55,
60,
51,
53,
51,
53,
51,
54,
411,
2618,
894,
303,
339,
2385,
327,
89,
10003,
1002,
503,
46,
320,
416,
1440,
556,
13383,
459,
9752,
666,
2177,
11350,
456,
1074,
2733,
411,
503,
312,
303,
339,
303,
413,
3921,
22807,
2077,
51,
3097,
2194,
299,
556,
413,
3921,
22807,
2077,
51,
3097,
45,
9618,
312,
303,
2194,
51,
10093,
45,
6870,
6872,
312,
303,
2194,
51,
9618,
2232,
45,
909,
413,
2163,
105,
10003,
51,
2232,
1052,
303,
453,
1307,
20171,
1524,
456,
9010,
51,
303,
2194,
51,
5732,
2232,
45,
909,
413,
13073,
5519,
51,
2232,
1052,
303,
413,
3921,
22807,
2077,
23703,
2077,
299,
556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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1201,
130,
563,
331,
2090,
118,
3514,
50,
1805,
51,
222,
338,
222,
338,
496,
2133,
570,
36949,
590,
335,
106,
473,
293,
222,
588,
222,
942,
462,
6662,
1413,
1201,
37370,
320,
353,
964,
924,
1175,
7145,
4101,
299,
21818,
51,
10588,
45,
34726,
1201,
37370,
51,
842,
312,
736,
581,
924,
2128,
34726,
1201,
1506,
34726,
1201,
365,
320,
303,
4514,
2618,
299,
244,
58,
55,
53,
53,
64,
453,
4314,
2309,
2618,
22530,
51,
465,
413,
11013,
1927,
337,
6872,
6973,
6872,
299,
556,
413,
11013,
1927,
337,
6872,
492,
465,
2128,
34726,
1201,
755,
299,
556,
2128,
34726,
1201,
45,
909,
4242,
6774,
459,
54,
55,
60,
51,
53,
51,
53,
51,
54,
411,
2618,
894,
303,
6662,
1413,
22806,
2733,
3499,
299,
556,
6662,
1413,
22806,
45,
595,
312,
465,
6973,
6872,
51,
3334,
6872,
45,
34726,
1201,
5238,
51,
12748,
100,
2491,
49,
310,
556,
6662,
1413,
1201,
51,
6872,
65,
34726,
1201,
51,
78,
1179,
1579,
2140,
3499,
894,
303,
6973,
6872,
51,
3334,
6872,
45,
44809,
1201,
5238,
51,
12748,
100,
2491,
49,
310,
556,
19135,
18897,
1201,
51,
6872,
65,
44809,
1201,
51,
78,
1179,
1579,
909,
19135,
18897,
1201,
51,
78,
1179,
365,
320,
633,
496,
1806,
633,
581,
782,
16993,
365,
2589,
413,
1002,
320,
343,
453,
28981,
51,
633,
339,
310,
10542,
465,
413,
3921,
22807,
2077,
5270,
11350,
64,
303,
1614,
320,
416,
11350,
299,
556,
413,
3921,
22807,
2077,
5270,
45,
909,
36499,
34871,
459,
54,
55,
60,
51,
53,
51,
53,
51,
54,
411,
2618,
894,
303,
339,
2385,
327,
89,
10003,
1002,
503,
46,
320,
416,
1440,
556,
13383,
459,
9752,
666,
2177,
11350,
456,
1074,
2733,
411,
503,
312,
303,
339,
303,
413,
3921,
22807,
2077,
51,
3097,
2194,
299,
556,
413,
3921
] | 6,192,288,807,648,888,000
| true
| false
| false
| false
|
[
556,
6662,
1413,
1201,
51,
6872,
65,
34726,
1201,
51,
78,
1179,
1579,
2140,
3499,
894,
303,
6973,
6872,
51,
3334,
6872,
45,
44809,
1201,
5238,
51,
12748,
100,
2491,
49,
310,
556,
19135,
18897,
1201,
51,
6872,
65,
44809,
1201,
51,
78,
1179,
1579,
909,
19135,
18897,
1201,
51,
78,
1179,
365,
320,
633,
496,
1806,
633,
581,
782,
16993,
365,
2589,
413,
1002,
320,
343,
453,
28981,
51,
633,
339,
310,
10542,
465,
413,
3921,
22807,
2077,
5270,
11350,
64,
303,
1614,
320,
416,
11350,
299,
556,
413,
3921,
22807,
2077,
5270,
45,
909,
36499,
34871,
459,
54
] | 6,166,859,689,724,284,000
| true
|
Service} on a diqube-server.
*
* @author Bastian Gloeckle
*/
public class QueryResultServiceTestUtil {
private static final Logger logger = LoggerFactory.getLogger(QueryResultServiceTestUtil.class);
public static TestQueryResultService createQueryResultService() {
short port = 5200; // TODO find port dynamically.
TMultiplexedProcessor multiProcessor = new TMultiplexedProcessor();
TestQueryResultService res = new TestQueryResultService(new ServerAddr("127.0.0.1", port));
QueryResultServiceImpl serviceImpl = new QueryResultServiceImpl(res);
multiProcessor.registerProcessor(QueryResultServiceConstants.SERVICE_NAME,
new QueryResultService.Processor<QueryResultService.Iface>(serviceImpl));
multiProcessor.registerProcessor(KeepAliveServiceConstants.SERVICE_NAME,
new KeepAliveService.Processor<KeepAliveService.Iface>(new KeepAliveService.Iface() {
@Override
public void ping() throws TException {
// noop.
}
}));
TNonblockingServerSocket transport;
try {
transport = new TNonblockingServerSocket(new InetSocketAddress("1
|
public static TestQueryResultService createQueryResultService() {
short port = 5200; // TODO find port dynamically.
TMultiplexedProcessor multiProcessor = new TMultiplexedProcessor();
TestQueryResultService res = new TestQueryResultService(new ServerAddr("127.0.0.1", port));
QueryResultServiceImpl serviceImpl = new QueryResultServiceImpl(res);
multiProcessor.registerProcessor(QueryResultServiceConstants.SERVICE_NAME,
new QueryResultService.Processor<QueryResultService.Iface>(serviceImpl));
multiProcessor.registerProcessor(KeepAliveServiceConstants.SERVICE_NAME,
new KeepAliveService.Processor<KeepAliveService.Iface>(new KeepAliveService.Iface() {
@Override
public void ping() throws TException {
// noop.
}
}));
TNonblockingServerSocket transport;
try {
transport = new TNonblockingServerSocket(new InetSocketAddress("1
|
TestQueryResultService(new ServerAddr("127.0.0.1", port));
QueryResultServiceImpl serviceImpl = new QueryResultServiceImpl(res);
multiProcessor.registerProcessor(QueryResultServiceConstants.SERVICE_NAME,
new QueryResultService.Processor<QueryResultService.Iface>(serviceImpl));
multiProcessor.registerProcessor(KeepAliveServiceConstants.SERVICE_NAME,
new KeepAliveService.Processor<KeepAliveService.Iface>(new KeepAliveService.Iface() {
@Override
public void ping() throws TException {
// noop.
}
}));
TNonblockingServerSocket transport;
try {
transport = new TNonblockingServerSocket(new InetSocketAddress("1
|
new QueryResultService.Processor<QueryResultService.Iface>(serviceImpl));
multiProcessor.registerProcessor(KeepAliveServiceConstants.SERVICE_NAME,
new KeepAliveService.Processor<KeepAliveService.Iface>(new KeepAliveService.Iface() {
@Override
public void ping() throws TException {
// noop.
}
}));
TNonblockingServerSocket transport;
try {
transport = new TNonblockingServerSocket(new InetSocketAddress("1
|
27.0.0.1", port));
} catch (TTransportException e) {
throw new RuntimeException("Could not open transport for result service", e);
}
TNonblockingServer.Args args = new TNon
|
ExperimentConfiguration.java
|
/FileExtraction/Java_unseen/SmartDataAnalytics_DL-Learner/scripts/src/main/java/org/dllearner/experiments/ExperimentConfiguration.java
|
/**
* Copyright (C) 2007-2011, Jens Lehmann
*
* This file is part of DL-Learner.
*
* DL-Learner is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* DL-Learner is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.dllearner.experiments;
import com.jamonapi.MonKeyImp;
import com.jamonapi.Monitor;
import com.jamonapi.MonitorComposite;
import com.jamonapi.MonitorFactory;
import org.apache.log4j.Logger;
import org.dllearner.utilities.JamonMonitorLogger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* An experiment has a certain configuration. In an iterated experiment or a
* experiment row a parameter can be altered or influenced by previous
* experiments with the same configuration. If you do not have an iterated
* experiment (or better only 1 iteration) set sizeOfResultVector to 1
*
* @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
*
*/
public class ExperimentConfiguration {
private static final Logger logger = Logger.getLogger(ExperimentConfiguration.class);
public final String experimentName;
public final int sizeOfResultVector;
protected List<MonitorComposite> mcs = new ArrayList<>();
protected Map<String, MonitorComposite> mcsMap = new HashMap<>();
protected Map<MonitorComposite, String> mcsMapRev = new HashMap<>();
/**
* sets sizeOfResultVector to 1, meaning no iterated experiments
*
* @param experimentName
*/
public ExperimentConfiguration(String experimentName) {
this(experimentName, 1);
}
public ExperimentConfiguration(String experimentName, int sizeOfResultVector) {
this.experimentName = experimentName;
this.sizeOfResultVector = sizeOfResultVector;
}
@Override
public String toString() {
return this.experimentName + " with " + sizeOfResultVector + " iterations";
}
public List<TableRowColumn> getTableRows() {
List<TableRowColumn> l = new ArrayList<>();
if (sizeOfResultVector == 1) {
Monitor[] monitors = new Monitor[mcs.size()];
for (int i = 0; i < monitors.length; i++) {
monitors[i] = mcs.get(i).getMonitors()[0];
}
l.add(new TableRowColumn(monitors, experimentName, ""));
} else {
for (MonitorComposite mc : mcs) {
l.add(new TableRowColumn(mc.getMonitors(), experimentName, getRev(mc)));
}
}
return l;
}
private MonitorComposite get(MonKeyImp m) {
return mcsMap.get(mon(m).getLabel());
}
private String getRev(MonitorComposite mc) {
return mcsMapRev.get(mc);
}
private void put(MonKeyImp m, MonitorComposite mc) {
mcsMap.put(mon(m).getLabel(), mc);
}
private void putRev(MonitorComposite mc, MonKeyImp m) {
mcsMapRev.put(mc, m.getLabel());
}
public void init(List<MonKeyImp> monkeys) {
for (MonKeyImp monKeyImp : monkeys) {
init(monKeyImp);
}
}
public void init(MonKeyImp oldMonkey) {
Monitor[] marr = new Monitor[sizeOfResultVector];
for (int i = 0; i < sizeOfResultVector; i++) {
MonKeyImp newMonKey = mon(oldMonkey, i);
if (newMonKey.getUnits().equals(JamonMonitorLogger.MS)) {
marr[i] = MonitorFactory.getTimeMonitor(newMonKey);
} else {
marr[i] = MonitorFactory.getMonitor(newMonKey);
}
}
MonitorComposite m = new MonitorComposite(marr);
mcs.add(m);
put(oldMonkey, m);
putRev(m, oldMonkey);
}
protected MonKeyImp mon(MonKeyImp monkey) {
MonKeyImp m = (monkey.getLabel().startsWith(experimentName)) ? monkey : new MonKeyImp(experimentName
+ "_" + monkey.getLabel(), monkey.getUnits());
return m;
}
protected MonKeyImp mon(MonKeyImp oldMonkey, int index) {
// narrensicher
MonKeyImp newMonkey = mon(oldMonkey);
return new MonKeyImp(newMonkey.getLabel() + "_" + index, newMonkey.getUnits());
}
public void add(MonKeyImp monkey, int index, double value) {
try {
get(monkey).getMonitors()[index].add(value);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
logger.error("index too big, is: "+index+" max = " + get(monkey).getMonitors().length);
}
}
public Monitor start(MonKeyImp monkey, int index) {
return get(monkey).getMonitors()[index].start();
}
}
| 4,614
|
Java
|
.java
|
SmartDataAnalytics/DL-Learner
| 150
| 34
| 30
|
2014-08-06T18:29:54Z
|
2023-07-07T21:46:40Z
|
5c7d2e29d8b522f759a32d71699b2adf68c86dbf3cc98bfdd23c3a6ae9ccfae1
|
[] |
[
1350,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
53,
60,
50,
55,
53,
54,
54,
49,
990,
1249,
4684,
10677,
1039,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
27629,
50,
1494,
23647,
51,
222,
338,
222,
338,
27629,
50,
1494,
23647,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
27629,
50,
1494,
23647,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
1105,
51,
3679,
1784,
1403,
51,
32124,
64,
222,
222,
485,
785,
51,
20756,
286,
1256,
51,
3554,
971,
1915,
64,
222,
485,
785,
51,
20756,
286,
1256,
51,
8538,
64,
222,
485,
785,
51,
20756,
286,
1256,
51,
8538,
14377,
64,
222,
485,
785,
51,
20756,
286,
1256,
51,
8538,
2232,
64,
222,
485,
1105,
51,
2121,
51,
769,
57,
111,
51,
3716,
64,
222,
485,
1105,
51,
3679,
1784,
1403,
51,
16092,
51,
79,
44220,
8538,
3716,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
1350,
222,
338,
2262,
9715,
1421,
331,
9464,
3505,
51,
719,
619,
3881,
751,
9715,
575,
331,
222,
338,
9715,
2720,
331,
3416,
902,
545,
39877,
575,
43308,
8996,
829,
4575,
222,
338,
26454,
642,
341,
2454,
3505,
51,
1691,
863,
764,
666,
1178,
619,
3881,
751,
222,
338,
9715,
327,
290,
6106,
1773,
244,
54,
13403,
46,
758,
1354,
1436,
1413,
2880,
391,
244,
54,
222,
338,
1676,
338,
496,
2133,
47943,
36949,
696,
1042,
28635,
350,
3120,
28635,
69,
285,
1664,
1567,
51,
13579,
50,
293,
658,
28574,
51,
305,
67,
222,
338,
1676,
588,
222,
942,
462,
21400,
2339,
320,
222,
221,
2072,
924,
1175,
7145,
4101,
299,
7145,
51,
10588,
45,
10398,
2339,
51,
842,
312,
499,
221,
942,
1175,
910,
9715,
577,
64,
222,
221,
942,
1175,
648,
1354,
1436,
1413,
2880,
64,
499,
221,
5332,
1701,
65,
8538,
14377,
67,
364,
1766,
299,
556,
5068,
6984,
222,
221,
5332,
3531,
65,
671,
49,
16645,
14377,
67,
364,
1766,
1225,
299,
556,
8329,
6984,
222,
221,
5332,
3531,
65,
8538,
14377,
49,
910,
67,
364,
1766,
1225,
14911,
299,
556,
8329,
6984,
499,
221,
1350,
376,
338,
6930,
1354,
1436,
1413,
2880,
391,
244,
54,
49,
14290,
1307,
3881,
751,
26454,
376,
338,
4517,
338,
496,
772,
9715,
577,
376,
588,
222,
221,
942,
21400,
2339,
45,
671,
9715,
577,
46,
320,
376,
221,
597,
45,
10963,
577,
49,
244,
54,
312,
222,
221,
130,
499,
221,
942,
21400,
2339,
45,
671,
9715,
577,
49,
648,
1354,
1436,
1413,
2880,
46,
320,
376,
221,
597,
51,
10963,
577,
299,
9715,
577,
64,
376,
221,
597,
51,
911,
1436,
1413,
2880,
299,
1354,
1436,
1413,
2880,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
910,
11349,
365,
320,
376,
221,
620,
477,
51,
10963,
577,
494,
332,
642,
332,
494,
1354,
1436,
1413,
2880,
494,
332,
17700,
884,
222,
221,
130,
499,
221,
942,
1701,
65,
17322,
2154,
67,
640,
1617,
7264,
365,
320,
376,
221,
739,
65,
17322,
2154,
67,
475,
299,
556,
5068,
6984,
376,
221,
344,
327,
911,
1436,
1413,
2880,
630,
244,
54,
46,
320,
374,
221,
8538,
1197,
9315,
120,
299,
556,
16645,
96,
114,
1766,
51,
911,
22061,
374,
221,
999,
327,
429,
613,
299,
244,
53,
64,
613,
350,
9315,
120,
51,
1340,
64,
613,
2002,
320,
621,
221,
8243,
120,
96,
110,
98,
299,
364,
1766,
51,
390,
45,
110,
566,
390,
8538,
120,
8577,
53,
988,
374,
221,
130,
374,
221,
113,
51,
688,
45,
909,
5565,
2368,
2154,
45,
8243,
120,
49,
9715,
577,
49,
36995,
1332,
221,
130,
832,
320,
374,
221,
999,
327,
8538,
14377,
16544,
518,
364,
1766,
46,
320,
621,
221,
113,
51,
688,
45,
909,
5565,
2368,
2154,
45,
6070,
51,
390,
8538,
120,
1046,
9715,
577,
49,
640,
14911,
45,
6070,
4254,
374,
221,
130,
376,
221,
130,
1332,
221,
620,
475,
64,
222,
221,
130,
499,
221,
2072,
16645,
14377,
640,
45,
3554,
971,
1915,
364,
46,
320,
376,
221,
620,
364,
1766,
1225,
51,
390,
45,
1231,
45,
114,
566,
38885,
1052,
222,
221,
130,
499,
221,
2072,
910,
640,
14911,
45,
8538,
14377,
16544,
46,
320,
376,
221,
620,
364,
1766,
1225,
14911,
51,
390,
45,
6070,
312,
222,
221,
130,
499,
221,
2072,
782,
4180,
45,
3554,
971,
1915,
364,
49,
16645,
14377,
16544,
46,
320,
376,
221,
114,
1766,
1225,
51,
543,
45,
1231,
45,
114,
566,
38885,
1046,
16544,
312,
222,
221,
130,
499,
221,
2072,
782,
4180,
14911,
45,
8538,
14377,
16544,
49,
5913,
971,
1915,
364,
46,
320,
376,
221,
114,
1766,
1225,
14911,
51,
543,
45,
6070,
49,
364,
51,
38885,
1052,
222,
221,
130,
499,
221,
942,
782,
3238,
45,
739,
65,
3554,
971,
1915,
67,
3797,
3519,
46,
320,
376,
221,
999,
327,
3554,
971,
1915,
3797,
971,
1915,
518,
3797,
3519,
46,
320,
374,
221,
1683,
45,
1231,
971,
1915,
312,
376,
221,
130,
222,
221,
130,
499,
221,
942,
782,
3238,
45,
3554,
971,
1915,
3627,
3554,
697,
46,
320,
376,
221,
8538,
1197,
364,
865,
299,
556,
16645,
96,
911,
1436,
1413,
2880,
988,
376,
221,
999,
327,
429,
613,
299,
244,
53,
64,
613,
350,
1354,
1436,
1413,
2880,
64,
613,
2002,
320
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
1225,
64,
222,
222,
1350,
222,
338,
2262,
9715,
1421,
331,
9464,
3505,
51,
719,
619,
3881,
751,
9715,
575,
331,
222,
338,
9715,
2720,
331,
3416,
902,
545,
39877,
575,
43308,
8996,
829,
4575,
222,
338,
26454,
642,
341,
2454,
3505,
51,
1691,
863,
764,
666,
1178,
619,
3881,
751,
222,
338,
9715,
327,
290,
6106,
1773,
244,
54,
13403,
46,
758,
1354,
1436,
1413,
2880,
391,
244,
54,
222,
338,
1676,
338,
496,
2133,
47943,
36949,
696,
1042,
28635,
350,
3120,
28635,
69,
285,
1664,
1567,
51,
13579,
50,
293,
658,
28574,
51,
305,
67,
222,
338,
1676,
588,
222,
942,
462,
21400,
2339,
320,
222,
221,
2072,
924,
1175,
7145,
4101,
299,
7145,
51,
10588,
45,
10398,
2339,
51,
842,
312,
499,
221,
942,
1175,
910,
9715,
577,
64,
222,
221,
942,
1175,
648,
1354,
1436,
1413,
2880,
64,
499,
221,
5332,
1701,
65,
8538,
14377,
67,
364,
1766,
299,
556,
5068,
6984,
222,
221,
5332,
3531,
65,
671,
49,
16645,
14377,
67,
364,
1766,
1225,
299,
556,
8329,
6984,
222,
221,
5332,
3531,
65,
8538,
14377,
49,
910,
67,
364,
1766,
1225,
14911,
299,
556,
8329,
6984,
499,
221,
1350,
376,
338,
6930,
1354,
1436,
1413,
2880,
391,
244,
54,
49,
14290,
1307,
3881,
751,
26454,
376,
338,
4517,
338,
496,
772,
9715,
577,
376,
588,
222,
221,
942,
21400,
2339,
45,
671,
9715,
577,
46,
320,
376,
221,
597,
45,
10963,
577,
49,
244,
54,
312,
222,
221,
130,
499,
221,
942,
21400,
2339,
45,
671,
9715,
577,
49,
648,
1354,
1436,
1413,
2880,
46,
320,
376,
221,
597,
51,
10963,
577,
299,
9715,
577,
64,
376,
221,
597,
51,
911,
1436,
1413,
2880,
299,
1354,
1436,
1413,
2880,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
910,
11349,
365,
320
] | 5,277,806,833,000,179,000
| true
| false
| false
| false
|
[
67,
364,
1766,
299,
556,
5068,
6984,
222,
221,
5332,
3531,
65,
671,
49,
16645,
14377,
67,
364,
1766,
1225,
299,
556,
8329,
6984,
222,
221,
5332,
3531,
65,
8538,
14377,
49,
910,
67,
364,
1766,
1225,
14911,
299,
556,
8329,
6984,
499,
221,
1350,
376,
338,
6930,
1354,
1436,
1413,
2880,
391,
244,
54,
49,
14290,
1307,
3881,
751,
26454,
376,
338,
4517,
338,
496,
772,
9715,
577,
376,
588,
222,
221,
942,
21400,
2339,
45,
671,
9715,
577,
46,
320,
376,
221,
597,
45,
10963,
577,
49,
244,
54,
312,
222,
221,
130,
499,
221,
942,
21400,
2339
] | 6,027,378,943,034,326,000
| true
|
.Map;
/**
* An experiment has a certain configuration. In an iterated experiment or a
* experiment row a parameter can be altered or influenced by previous
* experiments with the same configuration. If you do not have an iterated
* experiment (or better only 1 iteration) set sizeOfResultVector to 1
*
* @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
*
*/
public class ExperimentConfiguration {
private static final Logger logger = Logger.getLogger(ExperimentConfiguration.class);
public final String experimentName;
public final int sizeOfResultVector;
protected List<MonitorComposite> mcs = new ArrayList<>();
protected Map<String, MonitorComposite> mcsMap = new HashMap<>();
protected Map<MonitorComposite, String> mcsMapRev = new HashMap<>();
/**
* sets sizeOfResultVector to 1, meaning no iterated experiments
*
* @param experimentName
*/
public ExperimentConfiguration(String experimentName) {
this(experimentName, 1);
}
public ExperimentConfiguration
|
iterated
* experiment (or better only 1 iteration) set sizeOfResultVector to 1
*
* @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
*
*/
public class ExperimentConfiguration {
private static final Logger logger = Logger.getLogger(ExperimentConfiguration.class);
public final String experimentName;
public final int sizeOfResultVector;
protected List<MonitorComposite> mcs = new ArrayList<>();
protected Map<String, MonitorComposite> mcsMap = new HashMap<>();
protected Map<MonitorComposite, String> mcsMapRev = new HashMap<>();
/**
* sets sizeOfResultVector to 1, meaning no iterated experiments
*
* @param experimentName
*/
public ExperimentConfiguration(String experimentName) {
this(experimentName, 1);
}
public ExperimentConfiguration
|
*/
public class ExperimentConfiguration {
private static final Logger logger = Logger.getLogger(ExperimentConfiguration.class);
public final String experimentName;
public final int sizeOfResultVector;
protected List<MonitorComposite> mcs = new ArrayList<>();
protected Map<String, MonitorComposite> mcsMap = new HashMap<>();
protected Map<MonitorComposite, String> mcsMapRev = new HashMap<>();
/**
* sets sizeOfResultVector to 1, meaning no iterated experiments
*
* @param experimentName
*/
public ExperimentConfiguration(String experimentName) {
this(experimentName, 1);
}
public ExperimentConfiguration
|
> mcs = new ArrayList<>();
protected Map<String, MonitorComposite> mcsMap = new HashMap<>();
protected Map<MonitorComposite, String> mcsMapRev = new HashMap<>();
/**
* sets sizeOfResultVector to 1, meaning no iterated experiments
*
* @param experimentName
*/
public ExperimentConfiguration(String experimentName) {
this(experimentName, 1);
}
public ExperimentConfiguration
|
(String experimentName, int sizeOfResultVector) {
this.experimentName = experimentName;
this.sizeOfResultVector = sizeOfResultVector;
}
@Override
public String toString() {
|
CommandHistory.java
|
/FileExtraction/Java_unseen/integratedmodelling_klab/klab.tools/src/main/java/org/integratedmodelling/klab/clitool/console/CommandHistory.java
|
/*******************************************************************************
* Copyright (C) 2007, 2016:
*
* - Ferdinando Villa <ferdinando.villa@bc3research.org>
* - integratedmodelling.org
* - any other authors listed in @author annotations
*
* All rights reserved. This file is part of the k.LAB software suite,
* meant to enable modular, collaborative, integrated
* development of interoperable data and model components. For
* details, see http://integratedmodelling.org.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Affero General Public License
* Version 3 or any later version.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose. See the
* Affero General Public License for more details.
*
* You should have received a copy of the Affero General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* The license is also available at: https://www.gnu.org/licenses/agpl.html
*******************************************************************************/
package org.integratedmodelling.klab.clitool.console;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.exceptions.KlabIOException;
import org.integratedmodelling.klab.utils.collections.ImmutableList;
/**
* Command history array. Use like any list of strings but call append() to add
* a line, which will bring any existing line to the front of the list instead
* of adding another copy, and transparently persist the history to the history
* file in .thinklab/client.history. Calling add() will throw an exception.
*
* @author ferdinando.villa
*
*/
public class CommandHistory extends ImmutableList<String> {
List<String> history = new ArrayList<>();
HashSet<String> commands = new HashSet<>();
File historyFile;
int currentPosition = -1;
/**
* Return the current position (0 = most recent) or -1 if there is no history.
*
* @return
*/
int getPosition() {
return currentPosition;
}
public CommandHistory() {
historyFile = new File(Configuration.INSTANCE.getDataPath() + File.separator + "client-history.txt");
if (historyFile.exists()) {
readHistory();
}
}
/**
* Pass the file name for the history (will be put in SHOME/.thinklab).
*
* @param fileName
*/
public CommandHistory(String fileName) {
historyFile = new File(Configuration.INSTANCE.getDataPath() + File.separator + fileName);
if (historyFile.exists()) {
readHistory();
}
}
private void readHistory() {
try {
history = FileUtils.readLines(historyFile);
for (String h : history) {
commands.add(h);
}
} catch (IOException e) {
throw new KlabIOException(e);
}
}
private void writeHistory() {
try {
FileUtils.writeLines(historyFile, history);
} catch (IOException e) {
throw new KlabIOException(e);
}
}
/**
* Add a line or bring it to the forefront if it already exists, saving the
* resulting history right away.
*
* @param line
*/
public void append(String line) {
line = line.trim();
if (commands.contains(line)) {
List<String> ll = new ArrayList<>();
for (String s : history) {
if (!s.equals(line)) {
ll.add(s);
}
}
history = ll;
} else {
commands.add(line);
}
history.add(0, line);
currentPosition = -1;
writeHistory();
}
@Override
public int size() {
return history.size();
}
@Override
public boolean contains(Object o) {
return history.contains(o);
}
@Override
public Iterator<String> iterator() {
return history.iterator();
}
@Override
public Object[] toArray() {
return history.toArray();
}
@Override
public <T> T[] toArray(T[] a) {
return history.toArray(a);
}
@Override
public String get(int index) {
return history.get(index);
}
public String getPrevious() {
return currentPosition > 0 ? history.get(--currentPosition) : null;
}
public String getNext() {
return currentPosition < (history.size() - 1) ? history.get(++currentPosition) : null;
}
}
| 4,511
|
Java
|
.java
|
integratedmodelling/klab
| 10
| 5
| 8
|
2021-10-19T11:31:20Z
|
2024-05-09T08:53:52Z
|
1ba4bf4814c8efb2c42547ea117285a98febf17df759f333c24fe568d707620e
|
[] |
[
28683,
222,
338,
244,
2657,
327,
72,
46,
244,
55,
53,
53,
60,
49,
244,
55,
53,
54,
59,
63,
222,
338,
5357,
338,
283,
449,
525,
15675,
285,
5917,
694,
6815,
350,
1036,
37431,
5917,
51,
123,
6815,
69,
3611,
56,
17752,
51,
1107,
67,
222,
338,
283,
449,
27583,
2832,
39359,
51,
1107,
222,
338,
283,
449,
1364,
1623,
14656,
14034,
347,
496,
2133,
14711,
222,
338,
222,
338,
283,
3381,
4760,
5225,
51,
1369,
822,
458,
1760,
451,
341,
851,
51,
9796,
2951,
13270,
49,
222,
338,
283,
16941,
391,
5362,
46175,
49,
21357,
1372,
49,
27583,
1676,
338,
283,
8230,
451,
1447,
6169,
463,
727,
480,
1573,
6361,
51,
2643,
222,
338,
283,
4261,
49,
2337,
1930,
574,
8006,
751,
2832,
39359,
51,
1107,
51,
222,
338,
29836,
338,
283,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
283,
5370,
580,
1549,
341,
5974,
451,
341,
30994,
6153,
5062,
1196,
1676,
338,
283,
3050,
244,
56,
575,
1364,
6146,
1522,
51,
222,
338,
222,
338,
283,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
283,
1294,
2895,
1364,
14319,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
283,
42713,
3478,
575,
34195,
456,
331,
8445,
11673,
51,
244,
2819,
341,
222,
338,
283,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
5357,
338,
281,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
30994,
6153,
5062,
1196,
222,
338,
281,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
281,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
338,
281,
906,
3553,
458,
2353,
3322,
840,
63,
1698,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
500,
576,
51,
935,
222,
13533,
13214,
222,
1337,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
592,
302,
1071,
51,
4482,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
39463,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2339,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
11453,
51,
80,
4809,
6860,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2324,
51,
9777,
51,
41989,
64,
222,
222,
1350,
222,
338,
5730,
8172,
1437,
51,
4443,
2144,
1364,
1168,
451,
5872,
1294,
1495,
5507,
365,
391,
1035,
222,
338,
331,
1646,
49,
1532,
1118,
18020,
1364,
4917,
1646,
391,
341,
8442,
451,
341,
1168,
4203,
222,
338,
451,
7178,
4691,
1948,
49,
480,
13554,
651,
23609,
341,
8172,
391,
341,
8172,
222,
338,
822,
347,
657,
16454,
4809,
52,
1598,
51,
6503,
51,
22890,
1035,
365,
1118,
1440,
619,
3773,
51,
222,
338,
1676,
338,
496,
2133,
315,
15675,
285,
5917,
51,
123,
6815,
222,
338,
222,
588,
222,
942,
462,
5730,
6713,
2041,
29634,
65,
671,
67,
320,
499,
221,
739,
65,
671,
67,
8172,
299,
556,
5068,
6984,
222,
221,
17163,
65,
671,
67,
6364,
299,
556,
14253,
6984,
222,
221,
991,
8172,
991,
64,
222,
221,
429,
1565,
2746,
299,
449,
54,
64,
499,
221,
1350,
376,
338,
2762,
341,
1565,
2764,
327,
53,
299,
4665,
8303,
46,
575,
449,
54,
434,
2038,
458,
1307,
8172,
51,
376,
338,
4517,
338,
496,
620,
376,
588,
222,
221,
429,
640,
2746,
365,
320,
376,
221,
620,
1565,
2746,
64,
222,
221,
130,
499,
221,
942,
5730,
6713,
365,
320,
376,
221,
6503,
991,
299,
556,
2050,
45,
2339,
51,
12457,
51,
11574,
1233,
365,
494,
2050,
51,
12640,
494,
332,
1598,
50,
6503,
51,
2787,
742,
376,
221,
344,
327,
6503,
991,
51,
4678,
1177,
320,
374,
221,
870,
6713,
492,
376,
221,
130,
222,
221,
130,
499,
221,
1350,
376,
338,
14159,
341,
822,
655,
456,
341,
8172,
327,
11119,
545,
4180,
347,
377,
8452,
4735,
16454,
4809,
566,
376,
338,
4517,
338,
496,
772,
11221,
376,
588,
222,
221,
942,
5730,
6713,
45,
671,
11221,
46,
320,
376,
221,
6503,
991,
299,
556,
2050,
45,
2339,
51,
12457,
51,
11574,
1233,
365,
494,
2050,
51,
12640,
494,
11221,
312,
376,
221,
344,
327,
6503,
991,
51,
4678,
1177,
320,
374,
221,
870,
6713,
492,
376,
221,
130,
222,
221,
130,
499,
221,
2072,
782,
1511,
6713,
365,
320,
376,
221,
1287,
320,
374,
221,
6503,
299,
36423,
51,
870,
8690,
45,
6503,
991,
312,
374,
221,
999,
327,
671,
439,
518,
8172,
46,
320,
621,
221,
7626,
51,
688,
45,
109,
312,
374,
221,
130,
376,
221,
130,
2385,
327,
6860,
503,
46,
320,
374,
221,
5267,
556,
1242,
4809,
6860,
45,
106,
312,
376,
221,
130,
222,
221,
130,
499,
221,
2072,
782,
2886,
6713,
365,
320,
376,
221,
1287,
320,
374,
221,
39463,
51,
1838,
8690,
45,
6503,
991,
49,
8172,
312,
376,
221,
130,
2385,
327,
6860,
503,
46,
320,
374,
221,
5267,
556,
1242,
4809,
6860,
45,
106,
312,
376,
221,
130,
222,
221,
130,
499,
221,
1350,
376,
338,
2242,
331,
1646,
575,
18020,
580,
391,
341,
16886,
40774,
434,
580,
3443,
5394,
49,
17091,
341,
376,
338,
14341,
8172,
2109,
12025,
51,
376,
338,
4517,
338,
496,
772,
1646,
376,
588,
222,
221,
942,
782,
5507,
45,
671,
1646,
46,
320,
1332,
221,
948,
299,
1646,
51,
5475,
492,
1332,
221,
344,
327,
7626,
51,
4766,
45,
948,
509,
320,
374,
221,
739,
65,
671,
67,
9599,
299,
556,
5068,
6984,
374,
221,
999,
327,
671,
328,
518,
8172,
46,
320,
621,
221,
344,
1445,
120,
51,
3591,
45,
948,
509,
320,
596,
221,
629,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1196,
456,
1851,
4261,
51,
222,
338,
5357,
338,
281,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
30994,
6153,
5062,
1196,
222,
338,
281,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
281,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
338,
281,
906,
3553,
458,
2353,
3322,
840,
63,
1698,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
52,
500,
576,
51,
935,
222,
13533,
13214,
222,
1337,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
592,
302,
1071,
51,
4482,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
39463,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2339,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
11453,
51,
80,
4809,
6860,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2324,
51,
9777,
51,
41989,
64,
222,
222,
1350,
222,
338,
5730,
8172,
1437,
51,
4443,
2144,
1364,
1168,
451,
5872,
1294,
1495,
5507,
365,
391,
1035,
222,
338,
331,
1646,
49,
1532,
1118,
18020,
1364,
4917,
1646,
391,
341,
8442,
451,
341,
1168,
4203,
222,
338,
451,
7178,
4691,
1948,
49,
480,
13554,
651,
23609,
341,
8172,
391,
341,
8172,
222,
338,
822,
347,
657,
16454,
4809,
52,
1598,
51,
6503,
51,
22890,
1035,
365
] | -1,311,949,214,887,271,700
| true
| false
| false
| false
|
[
17163,
64,
222,
485,
1401,
51,
1058,
51,
5740,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
39463,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2339,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
11453,
51,
80,
4809,
6860,
64,
222,
485,
1105,
51,
8006,
751,
2832,
39359,
51,
112,
4809,
51,
2324,
51,
9777,
51,
41989,
64,
222,
222,
1350,
222,
338,
5730,
8172,
1437,
51,
4443,
2144,
1364,
1168,
451,
5872,
1294,
1495,
5507,
365,
391
] | -8,698,478,488,444,881,000
| true
|
License for more details.
*
* You should have received a copy of the Affero General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* The license is also available at: https://www.gnu.org/licenses/agpl.html
*******************************************************************************/
package org.integratedmodelling.klab.clitool.console;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.exceptions.KlabIOException;
import org.integratedmodelling.klab.utils.collections.ImmutableList;
/**
* Command history array. Use like any list of strings but call append() to
|
- Suite 330, Boston, MA 02111-1307, USA.
* The license is also available at: https://www.gnu.org/licenses/agpl.html
*******************************************************************************/
package org.integratedmodelling.klab.clitool.console;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.exceptions.KlabIOException;
import org.integratedmodelling.klab.utils.collections.ImmutableList;
/**
* Command history array. Use like any list of strings but call append() to
|
******/
package org.integratedmodelling.klab.clitool.console;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.exceptions.KlabIOException;
import org.integratedmodelling.klab.utils.collections.ImmutableList;
/**
* Command history array. Use like any list of strings but call append() to
|
HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.exceptions.KlabIOException;
import org.integratedmodelling.klab.utils.collections.ImmutableList;
/**
* Command history array. Use like any list of strings but call append() to
|
add
* a line, which will bring any existing line to the front of the list instead
* of adding another copy, and transparently persist the history to the history
* file in.thinklab/client.history. Calling add()
|
AsrSignalSpeechTest.java
|
/FileExtraction/Java_unseen/RestComm_media-core/control/mgcp/src/test/java/org/restcomm/media/core/control/mgcp/pkg/au/asr/AsrSignalSpeechTest.java
|
/*
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2017, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.restcomm.media.core.control.mgcp.pkg.au.asr;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyListOf;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.List;
import java.util.Map;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.restcomm.media.core.control.mgcp.pkg.MgcpEvent;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnCode;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnParameters;
import org.restcomm.media.core.control.mgcp.pkg.au.SignalParameters;
import org.restcomm.media.core.drivers.asr.AsrDriverException;
import org.restcomm.media.core.drivers.asr.UnknownAsrDriverException;
import org.restcomm.media.core.resource.dtmf.detector.DtmfEvent;
import org.restcomm.media.core.spi.listener.TooManyListenersException;
/**
* @author gdubina
* @author anikiforov
*/
public class AsrSignalSpeechTest extends AsrSignalBaseTest {
@Before
public void before() throws TooManyListenersException {
super.before();
}
@After
public void after() {
super.after();
}
@Test
public void testCollectWithIncludeEndInputKey() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
detectorObserver.onDtmfEvent(new DtmfEvent("1")); // should be ignored
speakRecognizedText("one");
speakRecognizedText("two");
speakRecognizedText("three");
detectorObserver.onDtmfEvent(new DtmfEvent("#"));
waitForFinalResponse();
// then
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(4)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), firstEvent.getParameter("rc"));
assertEquals("one", getArsResult(firstEvent));
final MgcpEvent secondEvent = events.get(1);
assertEquals("two", getArsResult(secondEvent));
final MgcpEvent thirdEvent = events.get(2);
assertEquals("three", getArsResult(thirdEvent));
final MgcpEvent fourthEvent = events.get(3);
assertEquals(String.valueOf(ReturnCode.SUCCESS.code()), fourthEvent.getParameter("rc"));
assertEquals("one" + System.lineSeparator() + "two" + System.lineSeparator() + "three", getArsResult(fourthEvent));
}
@Test
public void testCollectWithEndInputKeyAndResponseAfterIt() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
Thread.sleep(EPSILON_IN_MILLISECONDS);
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, never()).onEvent(eq(asr), eventCaptor.capture());
speechDetectorListener.onVoiceActivityDetected();
detectorObserver.onDtmfEvent(new DtmfEvent("1")); // should be ignored
detectorObserver.onDtmfEvent(new DtmfEvent("#"));
asrEngineListener.onSpeechRecognized("text", true);
waitForFinalResponse();
// then
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(2)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), firstEvent.getParameter("rc"));
assertEquals("text", getArsResult(firstEvent));
final MgcpEvent secondEvent = events.get(1);
assertEquals(String.valueOf(ReturnCode.SUCCESS.code()), secondEvent.getParameter("rc"));
assertEquals("text", getArsResult(secondEvent));
}
@Test
public void testCollectWithUnknownDriver() throws Exception {
// given
final Map<String, String> parameters = generateTestParameters(true);
doThrow(new UnknownAsrDriverException("null")).when(asrEngine).configure(anyString(), anyString(), anyListOf(String.class));
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
assertEquals(String.valueOf(ReturnCode.PROVISIONING_ERROR.code()), events.get(0).getParameter("rc"));
}
@Test
public void testCollectWithDriverError() throws Exception {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
Thread.sleep(EPSILON_IN_MILLISECONDS);
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, never()).onEvent(eq(asr), eventCaptor.capture());
speakRecognizedText("text");
asrEngineListener.onDriverError(new AsrDriverException("test purposes"));
// then
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(2)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), events.get(0).getParameter("rc"));
assertEquals(String.valueOf(ReturnCode.PROVISIONING_ERROR.code()), events.get(1).getParameter("rc"));
}
@Test
public void testAsrCancelNoResult() throws InterruptedException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
asr.cancel();
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
assertEquals(String.valueOf(ReturnCode.NO_SPEECH.code()), eventCaptor.getValue().getParameter("rc"));
}
@Test
public void testAsrCancelWithResult() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speakRecognizedText("text");
asr.cancel();
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(2)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), firstEvent.getParameter("rc"));
assertEquals("text", new String(Hex.decodeHex(firstEvent.getParameter(ReturnParameters.ASR_RESULT.symbol()).toCharArray())));
final MgcpEvent secondEvent = events.get(1);
assertEquals(String.valueOf(ReturnCode.SUCCESS.code()), secondEvent.getParameter("rc"));
}
@Test
public void testFirstInputTimeout() throws InterruptedException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
Thread.sleep(MRT_IN_MILLISECONDS + EPSILON_IN_MILLISECONDS);
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.NO_SPEECH.code()), firstEvent.getParameter("rc"));
}
@Test
public void testMrtNoResult() throws InterruptedException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speechDetectorListener.onVoiceActivityDetected();
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
speakUnrecognizedText(MRT_IN_MILLISECONDS);
verify(observer, never()).onEvent(eq(asr), eventCaptor.capture());
waitForFinalResponse();
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.NO_SPEECH.code()), firstEvent.getParameter("rc"));
}
@Test
public void testMrtWithResult() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speakRecognizedText("text");
Thread.sleep(MRT_IN_MILLISECONDS + EPSILON_IN_MILLISECONDS);
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(2)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), firstEvent.getParameter("rc"));
assertEquals("text", getArsResult(firstEvent));
final MgcpEvent secondEvent = events.get(1);
assertEquals(String.valueOf(ReturnCode.SUCCESS.code()), secondEvent.getParameter("rc"));
assertEquals("text", getArsResult(secondEvent));
}
@Test
public void testPstWithResult() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speakRecognizedText("text");
Thread.sleep(PST_IN_MILLISECONDS + EPSILON_IN_MILLISECONDS);
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(2)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.PARTIAL_SUCCESS.code()), firstEvent.getParameter("rc"));
assertEquals("text", getArsResult(firstEvent));
final MgcpEvent secondEvent = events.get(1);
assertEquals(String.valueOf(ReturnCode.SUCCESS.code()), secondEvent.getParameter("rc"));
assertEquals("text", getArsResult(secondEvent));
}
@Test
public void testNoPartialResultWithoutParameter() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters();
parameters.put(SignalParameters.INPUT.symbol(), "SPEECH");
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speakRecognizedText("text");
waitForInterimResponse();
// then
verify(observer, never()).onEvent(eq(asr), eventCaptor.capture());
}
@Test
public void testNoPartialResultWithParameterFalse() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(false);
parameters.put(SignalParameters.INPUT.symbol(), "SPEECH");
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
speakRecognizedText("text");
waitForInterimResponse();
// then
verify(observer, never()).onEvent(eq(asr), eventCaptor.capture());
}
@Test
public void testAsrWithTooLongHotWord() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
String hotWords = "Telestax’s RestcommONE platform is changing the way real-time communications are developed and delivered. "
+ "It is fast becoming the platform of choice for rapidly building enterprise class real-time messaging, voice and video applications. "
+ "Our platform is scalable, highly available and the only WebRTC platform that supports cloud, on premise and hybrid deployment configurations.";
parameters.put(SignalParameters.HOT_WORDS.symbol(), Hex.encodeHexString(hotWords.getBytes()));
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.VARIABLE_VALUE_OUT_OF_RANGE.code()), firstEvent.getParameter("rc"));
}
@Test
public void testAsrWithTooManyHotWords() throws InterruptedException, DecoderException {
// given
final Map<String, String> parameters = generateTestParameters(true);
final String hotWords = "zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,"
+ "sixteen,seventeen,eighteen,nineteen,twenty,twenty one,twenty two,twenty three,twenty four,"
+ "twenty five,twenty six,twenty seven,twenty eight,twenty nine,"
+ "thirty,thirty one,thirty two,thirty three,thirty four,thirty five,thirty six,thirty seven,"
+ "thirty eight,thirty nine,"
+ "fourty,fourty one,fourty two,fourty three,fourty four,fourty five,fourty six,fourty seven,"
+ "fourty eight,fourty nine,fifty";
parameters.put(SignalParameters.HOT_WORDS.symbol(), Hex.encodeHexString(hotWords.getBytes()));
final AsrSignal asr = generateAsrSignal(parameters);
// when
final ArgumentCaptor<MgcpEvent> eventCaptor = ArgumentCaptor.forClass(MgcpEvent.class);
asr.observe(observer);
asr.execute();
// then
verify(asrEngine, times(1)).activate();
verify(detector, times(1)).activate();
verify(player, never()).activate();
verify(observer, times(1)).onEvent(eq(asr), eventCaptor.capture());
final List<MgcpEvent> events = eventCaptor.getAllValues();
final MgcpEvent firstEvent = events.get(0);
assertEquals(String.valueOf(ReturnCode.VARIABLE_VALUE_OUT_OF_RANGE.code()), firstEvent.getParameter("rc"));
}
private static String getArsResult(final MgcpEvent event) throws DecoderException {
return new String(Hex.decodeHex(event.getParameter(ReturnParameters.ASR_RESULT.symbol()).toCharArray()));
}
}
| 19,052
|
Java
|
.java
|
RestComm/media-core
| 159
| 122
| 175
|
2012-08-17T17:45:39Z
|
2024-01-09T14:52:11Z
|
f9abf08013eef7f555d4b51283f43daae562aab005c7bb2a95918869b6cd476b
|
[] |
[
1127,
222,
338,
22493,
520,
668,
49,
3944,
6391,
7594,
2780,
31174,
222,
338,
2657,
244,
55,
53,
54,
54,
50,
55,
53,
54,
60,
49,
22493,
289,
668,
6367,
480,
10139,
13356,
222,
338,
829,
341,
496,
17589,
2621,
51,
1676,
338,
222,
338,
1369,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
16227,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
51,
54,
451,
222,
338,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
2951,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
222,
338,
16227,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
16227,
6153,
5062,
222,
338,
1196,
7979,
642,
477,
2951,
64,
434,
666,
49,
2886,
391,
341,
7834,
222,
338,
3870,
7120,
49,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
222,
338,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
49,
575,
2337,
341,
525,
12084,
4769,
63,
1930,
574,
1516,
51,
2569,
107,
51,
1107,
51,
222,
588,
222,
222,
1337,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
25895,
64,
222,
222,
485,
924,
1105,
51,
3946,
51,
3285,
51,
4993,
64,
222,
485,
924,
1105,
51,
15524,
51,
17349,
51,
1831,
23791,
64,
222,
485,
924,
1105,
51,
15524,
51,
17349,
51,
1831,
671,
64,
222,
485,
924,
1105,
51,
15524,
51,
17349,
51,
3705,
64,
222,
485,
924,
1105,
51,
15524,
51,
17076,
51,
1428,
6562,
64,
222,
485,
924,
1105,
51,
15524,
51,
17076,
51,
18453,
64,
222,
485,
924,
1105,
51,
15524,
51,
17076,
51,
5598,
64,
222,
485,
924,
1105,
51,
15524,
51,
17076,
51,
6970,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
1105,
51,
2121,
51,
8381,
51,
12786,
51,
11718,
1002,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
12786,
51,
7038,
51,
10226,
64,
222,
485,
1105,
51,
3946,
51,
5131,
64,
222,
485,
1105,
51,
3946,
51,
5670,
64,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
485,
1105,
51,
15524,
51,
3501,
38813,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
16588,
2217,
1167,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
2907,
1241,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
2907,
3694,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
10765,
3694,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
5850,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
3157,
51,
2654,
10599,
51,
19111,
51,
73,
6565,
107,
1167,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
10787,
51,
9447,
51,
20564,
7445,
14625,
1002,
64,
222,
222,
1350,
222,
338,
496,
2133,
22004,
375,
5245,
222,
338,
496,
2133,
619,
1567,
344,
290,
1558,
222,
588,
222,
942,
462,
2915,
119,
10765,
22023,
1024,
2041,
2915,
119,
10765,
1778,
1024,
320,
465,
496,
5670,
303,
581,
782,
2688,
365,
2589,
37325,
7445,
14625,
1002,
320,
310,
2615,
51,
5566,
492,
303,
339,
465,
496,
5131,
303,
581,
782,
2703,
365,
320,
310,
2615,
51,
5497,
492,
303,
339,
465,
496,
1024,
303,
581,
782,
913,
7942,
1569,
8518,
2117,
1630,
971,
365,
2589,
24683,
49,
35027,
1002,
320,
310,
453,
2716,
310,
1175,
3531,
65,
671,
49,
910,
67,
3406,
299,
4468,
1024,
3694,
45,
1527,
312,
310,
1175,
2915,
119,
10765,
641,
119,
299,
4468,
1482,
119,
10765,
45,
5173,
312,
603,
453,
1429,
310,
1175,
7115,
38813,
65,
16588,
2217,
1167,
67,
1708,
38813,
299,
7115,
38813,
51,
999,
1359,
45,
16588,
2217,
1167,
51,
842,
312,
603,
641,
119,
51,
24275,
45,
21250,
312,
310,
641,
119,
51,
4540,
492,
603,
24337,
9136,
51,
286,
73,
6565,
107,
1167,
45,
909,
493,
6565,
107,
1167,
459,
54,
2992,
453,
1414,
545,
10308,
310,
24528,
454,
11276,
1049,
459,
677,
742,
310,
24528,
454,
11276,
1049,
459,
8295,
742,
310,
24528,
454,
11276,
1049,
459,
12199,
742,
310,
24337,
9136,
51,
286,
73,
6565,
107,
1167,
45,
909,
493,
6565,
107,
1167,
4139,
2992,
603,
25115,
9795,
1416,
492,
603,
453,
1636,
310,
6152,
45,
19111,
49,
6524,
45,
54,
3445,
11433,
492,
310,
6152,
45,
3857,
49,
7162,
4269,
11433,
492,
310,
6152,
45,
21250,
49,
6524,
45,
57,
3445,
286,
1167,
45,
3705,
45,
25895,
490,
1708,
38813,
51,
14120,
1052,
603,
1175,
1701,
65,
16588,
2217,
1167,
67,
5233,
299,
1708,
38813,
51,
13912,
3367,
492,
310,
1175,
507,
32564,
1167,
1950,
1167,
299,
5233,
51,
390,
45,
53,
312,
310,
3803,
45,
671,
51,
9169,
45,
2907,
1241,
51,
4200,
47042,
100,
6696,
51,
707,
6198,
1950,
1167,
51,
17745,
459,
918,
2992,
310,
3803,
459,
677,
411,
640,
3437,
120,
1413,
45,
2251,
1167,
894,
310,
1175,
507,
32564,
1167,
3118,
1167,
299,
5233,
51,
390,
45,
54,
312,
310,
3803,
459,
8295,
411,
640,
3437,
120,
1413,
45,
3109,
1167,
894,
310,
1175,
507,
32564,
1167,
10999,
1167,
299,
5233,
51,
390,
45,
55,
312,
310,
3803,
459,
12199,
411,
640,
3437,
120,
1413,
45,
14148,
1167,
894,
310,
1175,
507,
32564,
1167,
36635,
1167,
299,
5233,
51,
390,
45,
56,
312,
310,
3803
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
17076,
51,
6970,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
222,
485,
1105,
51,
2121,
51,
8381,
51,
12786,
51,
11718,
1002,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
12786,
51,
7038,
51,
10226,
64,
222,
485,
1105,
51,
3946,
51,
5131,
64,
222,
485,
1105,
51,
3946,
51,
5670,
64,
222,
485,
1105,
51,
3946,
51,
1024,
64,
222,
485,
1105,
51,
15524,
51,
3501,
38813,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
16588,
2217,
1167,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
2907,
1241,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
2907,
3694,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
10765,
3694,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
5850,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
3157,
51,
2654,
10599,
51,
19111,
51,
73,
6565,
107,
1167,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
10787,
51,
9447,
51,
20564,
7445,
14625,
1002,
64,
222,
222,
1350,
222,
338,
496,
2133,
22004,
375,
5245,
222,
338,
496,
2133,
619,
1567,
344,
290,
1558,
222,
588,
222,
942,
462,
2915,
119,
10765,
22023,
1024,
2041,
2915,
119,
10765,
1778,
1024,
320,
465,
496,
5670,
303,
581,
782,
2688
] | 3,639,894,456,064,093,700
| true
| false
| false
| false
|
[
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
2452,
51,
9080,
2217,
51,
4662,
51,
4474,
51,
10765,
3694,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
18146,
51,
25895,
51,
5850,
1482,
119,
6641,
1002,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
3157,
51,
2654,
10599,
51,
19111,
51,
73,
6565,
107,
1167,
64,
222,
485,
1105,
51,
4756,
4870,
51,
3453,
51,
1284,
51,
10787,
51
] | 6,648,910,231,110,439,000
| true
|
Mockito.verify;
import java.util.List;
import java.util.Map;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.restcomm.media.core.control.mgcp.pkg.MgcpEvent;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnCode;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnParameters;
import org.restcomm.media.core.control.mgcp.pkg.au.SignalParameters;
import org.restcomm.media.core.drivers.asr.AsrDriverException;
import org.restcomm.media.core.drivers.asr.UnknownAsrDriverException;
import org.restcomm.media.core.resource.dtmf.detector.DtmfEvent;
import org.restcomm.media.core.spi.
|
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.restcomm.media.core.control.mgcp.pkg.MgcpEvent;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnCode;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnParameters;
import org.restcomm.media.core.control.mgcp.pkg.au.SignalParameters;
import org.restcomm.media.core.drivers.asr.AsrDriverException;
import org.restcomm.media.core.drivers.asr.UnknownAsrDriverException;
import org.restcomm.media.core.resource.dtmf.detector.DtmfEvent;
import org.restcomm.media.core.spi.
|
MgcpEvent;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnCode;
import org.restcomm.media.core.control.mgcp.pkg.au.ReturnParameters;
import org.restcomm.media.core.control.mgcp.pkg.au.SignalParameters;
import org.restcomm.media.core.drivers.asr.AsrDriverException;
import org.restcomm.media.core.drivers.asr.UnknownAsrDriverException;
import org.restcomm.media.core.resource.dtmf.detector.DtmfEvent;
import org.restcomm.media.core.spi.
|
import org.restcomm.media.core.control.mgcp.pkg.au.SignalParameters;
import org.restcomm.media.core.drivers.asr.AsrDriverException;
import org.restcomm.media.core.drivers.asr.UnknownAsrDriverException;
import org.restcomm.media.core.resource.dtmf.detector.DtmfEvent;
import org.restcomm.media.core.spi.
|
listener.TooManyListenersException;
/**
* @author gdubina
* @author anikiforov
*/
public class AsrSignalSpeechTest extends AsrSignalBaseTest {
@Before
public void before
|
Viewer_UE3_Texture2D_871.java
|
/FileExtraction/Java_unseen/wattostudios_GameExtractor/src/org/watto/ge/plugin/viewer/Viewer_UE3_Texture2D_871.java
|
/*
* Application: Game Extractor
* Author: wattostudios
* Website: http://www.watto.org
* Copyright: Copyright (c) 2002-2020 wattostudios
*
* License Information:
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
* published by the Free Software Foundation; either version 2 of the License, or (at your option) any later versions. This
* program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranties
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.gnu.org for more
* details. For further information on this application, refer to the authors' website.
*/
package org.watto.ge.plugin.viewer;
import java.io.File;
import org.watto.ErrorLogger;
import org.watto.SingletonManager;
import org.watto.component.PreviewPanel;
import org.watto.component.PreviewPanel_Image;
import org.watto.datatype.Archive;
import org.watto.datatype.ImageResource;
import org.watto.datatype.Resource;
import org.watto.ge.helper.FieldValidator;
import org.watto.ge.helper.ImageFormatReader;
import org.watto.ge.plugin.ArchivePlugin;
import org.watto.ge.plugin.ExporterPlugin;
import org.watto.ge.plugin.ViewerPlugin;
import org.watto.ge.plugin.archive.PluginGroup_UE3;
import org.watto.ge.plugin.archive.Plugin_UE3_871;
import org.watto.ge.plugin.archive.datatype.UnrealProperty;
import org.watto.ge.plugin.exporter.Exporter_LZO_SingleBlock;
import org.watto.ge.plugin.exporter.Exporter_ZLib;
import org.watto.io.FileManipulator;
import org.watto.io.FilenameSplitter;
import org.watto.io.buffer.ByteBuffer;
/**
**********************************************************************************************
**********************************************************************************************
**/
public class Viewer_UE3_Texture2D_871 extends ViewerPlugin {
/**
**********************************************************************************************
**********************************************************************************************
**/
public Viewer_UE3_Texture2D_871() {
super("UE3_Texture2D_871", "Unreal Engine 3 Version 871 Texture Image");
setExtensions("texture2d"); // MUST BE LOWER CASE
setGames("Unreal Engine 3 Version 871",
"Killing Floor 2");
setPlatforms("PC");
setStandardFileFormat(false);
}
/**
**********************************************************************************************
**********************************************************************************************
**/
@Override
public boolean canWrite(PreviewPanel panel) {
return false;
}
/**
**********************************************************************************************
**********************************************************************************************
**/
@Override
public int getMatchRating(FileManipulator fm) {
try {
int rating = 0;
ArchivePlugin readPlugin = Archive.getReadPlugin();
if (readPlugin instanceof Plugin_UE3_871) {
rating += 50;
}
if (FieldValidator.checkExtension(fm, extensions)) {
rating += 25;
}
else {
rating = 0;
}
return rating;
}
catch (Throwable t) {
return 0;
}
}
/**
**********************************************************************************************
Reads a resource from the FileManipulator, and generates a PreviewPanel for it. The FileManipulator
is an extracted temp file, not the original archive!
**********************************************************************************************
**/
@Override
public PreviewPanel read(FileManipulator fm) {
try {
ImageResource imageResource = readThumbnail(fm);
if (imageResource == null) {
return null;
}
PreviewPanel_Image preview = new PreviewPanel_Image(imageResource);
return preview;
}
catch (Throwable t) {
logError(t);
return null;
}
}
/**
**********************************************************************************************
Reads a resource from the FileManipulator, and generates a Thumbnail for it (generally, only
an Image ViewerPlugin will do this, but others can do it if they want). The FileManipulator is
an extracted temp file, not the original archive!
**********************************************************************************************
**/
@SuppressWarnings("static-access")
@Override
public ImageResource readThumbnail(FileManipulator fm) {
try {
ArchivePlugin readPlugin = Archive.getReadPlugin();
if (!(readPlugin instanceof PluginGroup_UE3)) {
return null;
}
PluginGroup_UE3 ue3Plugin = (PluginGroup_UE3) readPlugin;
// 4 - File ID Number? (incremental from 0) (thie is NOT an ID into the Names Directory!)
fm.skip(4);
// for each property (until Property Name ID = "None")
// 8 - Property Name ID
// 8 - Property Type ID
// 8 - Property Length
// X - Property Data
UnrealProperty[] properties = ue3Plugin.readProperties(fm);
// Lets check here to see that we have a valid format and width/height for the image data
String imageFormat = null;
int imageWidth = 0;
int imageHeight = 0;
String textureFilename = null;
int numProperties = properties.length;
for (int p = 0; p < numProperties; p++) {
UnrealProperty property = properties[p];
String name = property.getName();
if (name.equals("Format")) {
long formatNameID = (Long) property.getValue();
String formatName = ue3Plugin.getName(formatNameID);
if (formatName != null) {
if (formatName.equals("PF_DXT5")) {
imageFormat = "DXT5";
}
else if (formatName.equals("PF_DXT1")) {
imageFormat = "DXT1";
}
else if (formatName.equals("PF_DXT3")) {
imageFormat = "DXT3";
}
else if (formatName.equals("PF_G8")) {
imageFormat = "G8";
}
else if (formatName.equals("PF_A8R8G8B8")) {
imageFormat = "ARGB";
}
else {
ErrorLogger.log("[Viewer_UE3_Texture2D_871] Unsupported Image Format: " + formatName);
return null;
}
}
}
else if (name.equals("SizeX")) {
imageWidth = (Integer) property.getValue();
}
else if (name.equals("SizeY")) {
imageHeight = (Integer) property.getValue();
}
else if (name.equals("TextureFileCacheName")) {
textureFilename = (String) property.getValue();
}
}
if (imageFormat == null || imageWidth == 0 || imageHeight == 0) {
return null;
}
// 4 - null
// 4 - Unknown
// 4 - Unknown
// 4 - Unknown
fm.skip(16);
// X - PNG Image
long currentOffset = fm.getOffset();
ImageResource imageResource = new Viewer_PNG_PNG().readThumbnail(fm);
if (imageResource != null) {
return imageResource;
}
else {
fm.seek(currentOffset);
}
// 4 - Number of Mipmaps (10)
int numMipmaps = fm.readInt();
FieldValidator.checkRange(numMipmaps, 0, 50);
for (int m = 0; m < numMipmaps; m++) {
// 4 - Location Flag (33/17=External File, 0=This File)
int imageLocation = fm.readInt();
// 4 - Decompressed File Length (in External File)
int extDecompLength = fm.readInt();
// 4 - Compressed File Length (in External File)
int extCompLength = fm.readInt();
// 4 - File Offset (in External File)
int extOffset = fm.readInt();
if (imageLocation == 0) {
// we've found an image, it's in this archive at the current pointer position
// X - Pixel data
byte[] pixels = fm.readBytes(extCompLength);
// 4 - Image Width
imageWidth = fm.readInt();
FieldValidator.checkWidth(imageWidth);
// 4 - Image Height
imageHeight = fm.readInt();
FieldValidator.checkHeight(imageHeight);
// wrap the pixels in a FileManipulator for processing further down
fm.close();
fm = new FileManipulator(new ByteBuffer(pixels));
break; // exit the loop - we have an image to view
}
// 4 - Image Width
imageWidth = fm.readInt();
FieldValidator.checkWidth(imageWidth);
// 4 - Image Height
imageHeight = fm.readInt();
FieldValidator.checkHeight(imageHeight);
if (extOffset != -1 && extCompLength != -1 && extDecompLength != 0) {
// we've found an image, it's in the external archive
// Find the external
Resource selected = (Resource) SingletonManager.get("CurrentResource");
if (selected == null) {
return null;
}
// Check that we can find the external textureFilename
File textureFile = new File(FilenameSplitter.getDirectory(selected.getSource()) + File.separator + textureFilename + ".tfc");
if (!textureFile.exists()) {
return null;
}
long textureFileLength = textureFile.length();
FieldValidator.checkLength(extDecompLength);
FieldValidator.checkLength(extCompLength, textureFileLength);
FieldValidator.checkOffset(extOffset, textureFileLength);
// open the TextureFile for processing
fm.close();
fm = new FileManipulator(textureFile, false);
fm.seek(extOffset);
break; // exit the loop - we have an image to view
}
}
currentOffset = fm.getOffset();
if (fm.readByte() == -63 && fm.readByte() == -125 && fm.readByte() == 42 && fm.readByte() == -98) {
// the Unreal Header - the data is compressed?
long arcSize = fm.getLength();
// 2 - null
fm.skip(2);
// 2 - Compression Type? (1=ZLib, 2 = LZO, 4=LZX) (https://github.com/gildor2/UModel/blob/master/Unreal/UnCore.h)
short compressionType = fm.readShort();
if (compressionType != 1 && compressionType != 2) {
// unsupported compression
ErrorLogger.log("[Viewer_UE3_Texture2D_871] Unsupported compression: " + compressionType);
return null;
}
// 4 - Compressed Length
fm.skip(4);
// 4 - Decompressed Length
int decompLength = fm.readInt();
FieldValidator.checkLength(decompLength);
byte[] fileData = new byte[decompLength];
// get the decomp and comp lengths for each block
int decompWritePos = 0;
int maxNumBlocks = 1000; // hard limit of 1000 blocks for a compressed file
int realNumBlocks = 0;
int[] decompBlocks = new int[maxNumBlocks];
int[] compBlocks = new int[maxNumBlocks];
while (decompWritePos < decompLength) {
// 4 - Compressed Block Length
int compBlock = fm.readInt();
FieldValidator.checkLength(compBlock, arcSize);
compBlocks[realNumBlocks] = compBlock;
// 4 - Decompressed Block Length
int decompBlock = fm.readInt();
FieldValidator.checkLength(decompBlock);
decompBlocks[realNumBlocks] = decompBlock;
decompWritePos += decompBlock;
realNumBlocks++;
}
// reset the write position for the decompressed data
decompWritePos = 0;
for (int d = 0; d < realNumBlocks; d++) {
int decompBlock = decompBlocks[d];
int compBlock = compBlocks[d];
// X - Compressed File Data
ExporterPlugin exporter = null;
if (compressionType == 1) {
exporter = Exporter_ZLib.getInstance();
((Exporter_ZLib) exporter).open(fm, compBlock, decompBlock);
}
else if (compressionType == 2) {
exporter = Exporter_LZO_SingleBlock.getInstance();
((Exporter_LZO_SingleBlock) exporter).setForceDecompress(true); // LZO is used, want to force it, there are no "raw" blocks in the image
((Exporter_LZO_SingleBlock) exporter).open(fm, compBlock, decompBlock);
}
for (int b = 0; b < decompBlock; b++) {
if (exporter.available()) { // make sure we read the next bit of data, if required
fileData[decompWritePos++] = (byte) exporter.read();
}
}
}
// open the decompressed file data for processing
fm.close();
fm = new FileManipulator(new ByteBuffer(fileData));
}
else {
// raw data - we already have this in an FM, so just return the pointer to the start
fm.seek(currentOffset);
}
// Now process the image data into a real image
imageResource = null;
if (imageFormat.equals("DXT5")) {
imageResource = ImageFormatReader.readDXT5(fm, imageWidth, imageHeight);
}
else if (imageFormat.equals("DXT1")) {
imageResource = ImageFormatReader.readDXT1(fm, imageWidth, imageHeight);
}
else if (imageFormat.equals("DXT3")) {
imageResource = ImageFormatReader.readDXT3(fm, imageWidth, imageHeight);
}
else if (imageFormat.equals("G8")) {
imageResource = ImageFormatReader.read8BitPaletted(fm, imageWidth, imageHeight);
}
else if (imageFormat.equals("ARGB")) {
imageResource = ImageFormatReader.readARGB(fm, imageWidth, imageHeight);
}
else {
return null;// should not get here
}
imageResource.setProperty("ImageFormat", imageFormat);
fm.close();
return imageResource;
}
catch (
Throwable t) {
logError(t);
return null;
}
}
/**
**********************************************************************************************
**********************************************************************************************
**/
@Override
public void write(PreviewPanel preview, FileManipulator fm) {
}
}
| 14,387
|
Java
|
.java
|
wattostudios/GameExtractor
| 76
| 6
| 2
|
2020-06-03T13:56:47Z
|
2024-02-23T22:15:48Z
|
2e0cbdd544bd7300d6c04020b5492bc6361db30ba60964b73da434f8fd864548
|
[] |
[
1127,
222,
338,
6700,
63,
244,
6067,
15269,
290,
222,
338,
6265,
63,
981,
360,
288,
471,
32755,
3963,
222,
338,
24858,
63,
665,
1930,
574,
1516,
51,
47901,
471,
51,
1107,
222,
338,
2657,
63,
283,
2657,
327,
104,
46,
244,
55,
53,
53,
55,
50,
55,
53,
55,
53,
360,
288,
471,
32755,
3963,
222,
338,
222,
338,
1196,
10422,
63,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
7058,
51,
1369,
222,
338,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
13085,
710,
753,
222,
338,
451,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
840,
1930,
574,
1516,
51,
10627,
51,
1107,
456,
1851,
222,
338,
4261,
51,
2643,
9710,
2490,
563,
477,
3039,
49,
5293,
391,
341,
14656,
44,
9581,
51,
222,
588,
222,
222,
1337,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
11441,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1105,
51,
47901,
471,
51,
943,
3716,
64,
222,
485,
1105,
51,
47901,
471,
51,
15948,
1590,
64,
222,
485,
1105,
51,
47901,
471,
51,
2307,
51,
10621,
3686,
64,
222,
485,
1105,
51,
47901,
471,
51,
2307,
51,
10621,
3686,
100,
1675,
64,
222,
485,
1105,
51,
47901,
471,
51,
24502,
51,
13800,
64,
222,
485,
1105,
51,
47901,
471,
51,
24502,
51,
1675,
2305,
64,
222,
485,
1105,
51,
47901,
471,
51,
24502,
51,
2305,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
4328,
51,
1195,
7069,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
4328,
51,
1675,
2222,
3314,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
13800,
4168,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
22465,
4168,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
12512,
4168,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
4168,
1582,
100,
2018,
56,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
4168,
100,
2018,
56,
100,
61,
60,
54,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
24502,
51,
1079,
4571,
1667,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
19987,
51,
22465,
100,
81,
28761,
100,
6284,
2246,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
19987,
51,
22465,
100,
95,
6518,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
991,
29482,
7901,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
10246,
34841,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
2683,
51,
21042,
64,
222,
222,
1350,
222,
4241,
12825,
6372,
222,
222,
4241,
12825,
6372,
222,
15722,
222,
942,
462,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
2041,
41834,
4168,
320,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570,
353,
581,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
365,
320,
303,
2615,
459,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
411,
332,
1079,
4571,
10092,
244,
56,
3050,
244,
61,
60,
54,
13507,
4393,
742,
303,
758,
7460,
459,
8288,
55,
105,
742,
453,
22462,
6761,
41758,
17485,
465,
758,
26953,
459,
1079,
4571,
10092,
244,
56,
3050,
244,
61,
60,
54,
411,
310,
332,
80,
9217,
26912,
244,
55,
742,
303,
758,
39372,
459,
3446,
742,
303,
758,
8109,
991,
2222,
45,
1886,
312,
353,
339,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570,
353,
496,
1806,
353,
581,
1922,
902,
2553,
45,
10621,
3686,
7992,
46,
320,
303,
461,
920,
64,
353,
339,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570,
353,
496,
1806,
353,
581,
648,
640,
3683,
13868,
45,
991,
29482,
7901,
28922,
46,
320,
303,
1614,
320,
1704,
648,
17051,
299,
244,
53,
64,
1704,
28973,
4168,
1511,
4168,
299,
28973,
51,
390,
2248,
4168,
492,
416,
434,
327,
870,
4168,
5118,
11029,
100,
2018,
56,
100,
61,
60,
54,
46,
320,
310,
17051,
1475,
244,
58,
53,
64,
416,
339,
1704,
434,
327,
1195,
7069,
51,
1571,
4823,
45,
12398,
49,
11612,
509,
320,
310,
17051,
1475,
244,
55,
58,
64,
416,
339,
416,
832,
320,
310,
17051,
299,
244,
53,
64,
416,
339,
1704,
461,
17051,
64,
465,
339,
303,
2385,
327,
14080,
292,
46,
320,
416,
461,
244,
53,
64,
303,
339,
353,
339,
736,
1041,
353,
17854,
12825,
13494,
353,
29513,
331,
2885,
664,
341,
2050,
29482,
7901,
49,
480,
18073,
331,
21087,
3686,
456,
580,
51,
906,
2050,
29482,
7901,
353,
458,
619,
20112,
1798,
822,
49,
666,
341,
4732,
13647,
38,
353,
17854,
12825,
13494,
353,
12570,
353,
496,
1806,
353,
581,
21087,
3686,
1511,
45,
991,
29482,
7901,
28922,
46,
320,
303,
1614,
320,
1704,
4393,
2305,
1802,
2305,
299,
1511,
24330,
45,
12398,
312,
1704,
434,
327,
915,
2305,
630,
762,
46,
320,
310,
461,
762,
64,
416,
339,
1704,
21087,
3686,
100,
1675,
13314,
299,
556,
21087,
3686,
100,
1675,
45,
915,
2305,
312,
1704,
461,
13314,
64,
465,
339,
303,
2385,
327,
14080,
292,
46,
320,
416,
1264,
943,
45,
121,
312,
416,
461,
762,
64,
303,
339,
353,
339,
736,
1041,
353,
17854,
12825,
13494,
353,
29513,
331,
2885,
664,
341,
2050,
29482,
7901,
49,
480,
18073,
331,
41479,
8085,
456,
580,
327,
2195,
1266,
49,
1773,
353,
619,
4393,
41834,
4168,
1118,
764,
477,
49,
1294,
10739,
902,
764,
580,
434,
2974,
2660,
566,
906,
2050,
29482,
7901,
458,
353,
619,
20112,
1798,
822,
49,
666,
341,
4732,
13647,
38,
353,
17854,
12825,
13494,
353,
12570,
736,
496,
14030,
459,
1592,
50,
3575,
678,
353,
496,
1806,
353,
581,
4393,
2305,
1511,
24330,
45
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
47901,
471,
51,
319,
51,
2809,
51,
12512,
4168,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
4168,
1582,
100,
2018,
56,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
4168,
100,
2018,
56,
100,
61,
60,
54,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
8945,
51,
24502,
51,
1079,
4571,
1667,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
19987,
51,
22465,
100,
81,
28761,
100,
6284,
2246,
64,
222,
485,
1105,
51,
47901,
471,
51,
319,
51,
2809,
51,
19987,
51,
22465,
100,
95,
6518,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
991,
29482,
7901,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
10246,
34841,
64,
222,
485,
1105,
51,
47901,
471,
51,
735,
51,
2683,
51,
21042,
64,
222,
222,
1350,
222,
4241,
12825,
6372,
222,
222,
4241,
12825,
6372,
222,
15722,
222,
942,
462,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
2041,
41834,
4168,
320,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570,
353,
581,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
365,
320,
303,
2615,
459,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
411,
332,
1079,
4571,
10092,
244,
56,
3050,
244,
61,
60,
54,
13507,
4393,
742,
303,
758,
7460,
459,
8288,
55,
105,
742,
453,
22462,
6761,
41758,
17485,
465,
758,
26953,
459,
1079,
4571,
10092,
244,
56,
3050,
244,
61,
60,
54,
411,
310,
332,
80,
9217,
26912,
244,
55,
742,
303,
758,
39372,
459,
3446,
742,
303,
758,
8109,
991,
2222,
45,
1886,
312,
353,
339,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570
] | -5,383,030,295,449,973,000
| true
| false
| false
| false
|
[
222,
4241,
12825,
6372,
222,
222,
4241,
12825,
6372,
222,
15722,
222,
942,
462,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
2041,
41834,
4168,
320,
736,
1041,
353,
17854,
12825,
13494,
4070,
17854,
12825,
13494,
353,
12570,
353,
581,
41834,
100,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
365,
320,
303,
2615,
459,
2018,
56,
100,
4900,
55,
73,
100,
61,
60,
54,
411,
332,
1079,
4571,
10092,
244,
56,
3050,
244,
61,
60,
54,
13507,
4393,
742,
303,
758,
7460,
459,
8288,
55,
105,
742,
453,
22462,
6761,
41758,
17485,
465
] | -7,837,209,602,359,593,000
| true
|
watto.ge.plugin.ViewerPlugin;
import org.watto.ge.plugin.archive.PluginGroup_UE3;
import org.watto.ge.plugin.archive.Plugin_UE3_871;
import org.watto.ge.plugin.archive.datatype.UnrealProperty;
import org.watto.ge.plugin.exporter.Exporter_LZO_SingleBlock;
import org.watto.ge.plugin.exporter.Exporter_ZLib;
import org.watto.io.FileManipulator;
import org.watto.io.FilenameSplitter;
import org.watto.io.buffer.ByteBuffer;
/**
**********************************************************************************************
**********************************************************************************************
**/
public class Viewer_UE3_Texture2D_871 extends ViewerPlugin {
/**
**********************************************************************************************
**********************************************************************************************
**/
public Viewer_UE3_Texture2D_871() {
super("UE3_Texture2D_871", "Unreal Engine 3 Version 871 Texture Image");
setExtensions("texture2d"); // MUST BE LOWER CASE
|
;
import org.watto.ge.plugin.archive.datatype.UnrealProperty;
import org.watto.ge.plugin.exporter.Exporter_LZO_SingleBlock;
import org.watto.ge.plugin.exporter.Exporter_ZLib;
import org.watto.io.FileManipulator;
import org.watto.io.FilenameSplitter;
import org.watto.io.buffer.ByteBuffer;
/**
**********************************************************************************************
**********************************************************************************************
**/
public class Viewer_UE3_Texture2D_871 extends ViewerPlugin {
/**
**********************************************************************************************
**********************************************************************************************
**/
public Viewer_UE3_Texture2D_871() {
super("UE3_Texture2D_871", "Unreal Engine 3 Version 871 Texture Image");
setExtensions("texture2d"); // MUST BE LOWER CASE
|
plugin.exporter.Exporter_ZLib;
import org.watto.io.FileManipulator;
import org.watto.io.FilenameSplitter;
import org.watto.io.buffer.ByteBuffer;
/**
**********************************************************************************************
**********************************************************************************************
**/
public class Viewer_UE3_Texture2D_871 extends ViewerPlugin {
/**
**********************************************************************************************
**********************************************************************************************
**/
public Viewer_UE3_Texture2D_871() {
super("UE3_Texture2D_871", "Unreal Engine 3 Version 871 Texture Image");
setExtensions("texture2d"); // MUST BE LOWER CASE
|
**********************************************************************************************
**********************************************************************************************
**/
public class Viewer_UE3_Texture2D_871 extends ViewerPlugin {
/**
**********************************************************************************************
**********************************************************************************************
**/
public Viewer_UE3_Texture2D_871() {
super("UE3_Texture2D_871", "Unreal Engine 3 Version 871 Texture Image");
setExtensions("texture2d"); // MUST BE LOWER CASE
|
setGames("Unreal Engine 3 Version 871",
"Killing Floor 2");
setPlatforms("PC");
setStandardFileFormat(false);
}
/**
**********************************************************************************************
**********************************************************************************************
**/
|
ApplicationCollection.java
|
/FileExtraction/Java_unseen/xframium_xframium-java/framework/src/org/xframium/integrations/perfectoMobile/rest/bean/ApplicationCollection.java
|
/*******************************************************************************
* xFramium
*
* Copyright 2016 by Moreland Labs, Ltd. (http://www.morelandlabs.com)
*
* Some open source application is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* Some open source application is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with xFramium. If not, see <http://www.gnu.org/licenses/>.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*******************************************************************************/
package org.xframium.integrations.perfectoMobile.rest.bean;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.xframium.integrations.rest.bean.AbstractBean;
import org.xframium.integrations.rest.bean.Bean.BeanDescriptor;
// TODO: Auto-generated Javadoc
/**
* The Class ApplicationCollection.
*/
@BeanDescriptor( beanName="response" )
public class ApplicationCollection extends AbstractBean
{
/** The execution id. */
@FieldDescriptor ( )
private String executionId;
/** The report key. */
@FieldDescriptor ( )
private String reportKey;
/** The status. */
@FieldDescriptor ( )
private String status;
/** The return value. */
@FieldDescriptor ( )
private String returnValue;
/** The application map. */
private Map<String,String> applicationMap;
/**
* Gets the execution id.
*
* @return the execution id
*/
public String getExecutionId()
{
return executionId;
}
/**
* Sets the execution id.
*
* @param executionId the new execution id
*/
public void setExecutionId( String executionId )
{
this.executionId = executionId;
}
/**
* Gets the report key.
*
* @return the report key
*/
public String getReportKey()
{
return reportKey;
}
/**
* Sets the report key.
*
* @param reportKey the new report key
*/
public void setReportKey( String reportKey )
{
this.reportKey = reportKey;
}
/**
* Gets the status.
*
* @return the status
*/
public String getStatus()
{
return status;
}
/**
* Sets the status.
*
* @param status the new status
*/
public void setStatus( String status )
{
this.status = status;
}
/**
* Gets the return value.
*
* @return the return value
*/
public String getReturnValue()
{
return returnValue;
}
/**
* Sets the return value.
*
* @param returnValue the new return value
*/
public void setReturnValue( String returnValue )
{
this.returnValue = returnValue;
}
/**
* Gets the applications.
*
* @return the applications
*/
public Collection<String> getApplications()
{
if ( applicationMap == null )
parseApplications();
return applicationMap.values();
}
/**
* Parses the applications.
*/
private void parseApplications()
{
applicationMap = new HashMap<String,String>( 20 );
String workingValue = returnValue;
workingValue = workingValue.replace( '[', ' ' ).replace( ']', ' ' ).trim();
String[] allApps = workingValue.split( "," );
for ( String app : allApps )
{
String trimmedApp = app.trim();
applicationMap.put( trimmedApp.toLowerCase(), trimmedApp );
}
}
/**
* Gets the application.
*
* @param applicationName the application name
* @return the application
*/
public String getApplication( String applicationName )
{
if ( applicationMap == null )
parseApplications();
return applicationMap.get( applicationName.toLowerCase() );
}
}
| 4,105
|
Java
|
.java
|
xframium/xframium-java
| 12
| 18
| 2
|
2016-05-15T00:32:34Z
|
2019-02-16T12:40:47Z
|
2a59b8c27856bb5631b74283eb399c35df0934cdd24465271ae75dbf53543acf
|
[] |
[
28683,
222,
338,
837,
75,
4344,
3892,
222,
338,
222,
338,
2657,
244,
55,
53,
54,
59,
829,
12662,
6836,
42256,
49,
19534,
51,
327,
544,
574,
1516,
51,
7047,
6836,
17897,
51,
527,
46,
222,
338,
222,
338,
4202,
2177,
1932,
3039,
458,
3760,
2951,
63,
863,
902,
14081,
1676,
338,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1676,
338,
1196,
641,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1676,
338,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
5357,
338,
4202,
2177,
1932,
3039,
458,
2744,
347,
341,
9850,
708,
580,
1118,
1676,
338,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
1676,
338,
451,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
5357,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
837,
75,
4344,
3892,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
496,
2094,
23508,
50,
56,
51,
53,
48,
350,
544,
574,
438,
4601,
51,
1107,
52,
4205,
52,
21156,
50,
56,
51,
53,
48,
67,
222,
13533,
13214,
222,
1337,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
47454,
116,
11359,
51,
4756,
51,
12455,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5597,
5358,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5358,
51,
5358,
4336,
64,
222,
222,
325,
4314,
63,
7998,
50,
6413,
990,
20888,
222,
1350,
222,
338,
906,
1727,
6700,
2272,
51,
222,
588,
222,
69,
5358,
4336,
45,
15999,
577,
366,
2003,
39,
848,
222,
942,
462,
6700,
2272,
2041,
7406,
5358,
222,
128,
3038,
221,
1350,
906,
6111,
828,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
6111,
625,
64,
3038,
221,
1350,
906,
3652,
1221,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
3652,
971,
64,
3038,
221,
1350,
906,
2302,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
2302,
64,
3038,
221,
1350,
906,
461,
804,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
34174,
64,
3038,
221,
1350,
906,
3039,
2010,
51,
588,
222,
221,
2072,
3531,
65,
671,
49,
671,
67,
3039,
1225,
64,
499,
221,
1350,
376,
338,
7132,
341,
6111,
828,
51,
376,
338,
376,
338,
496,
620,
341,
6111,
828,
376,
588,
222,
221,
942,
910,
640,
6141,
625,
365,
222,
221,
128,
376,
221,
620,
6111,
625,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
9023,
341,
6111,
828,
51,
376,
338,
376,
338,
496,
772,
6111,
625,
341,
556,
6111,
828,
376,
588,
222,
221,
942,
782,
758,
6141,
625,
45,
910,
6111,
625,
848,
222,
221,
128,
376,
221,
597,
51,
10526,
625,
299,
6111,
625,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
7132,
341,
3652,
1221,
51,
376,
338,
376,
338,
496,
620,
341,
3652,
1221,
376,
588,
222,
221,
942,
910,
640,
4158,
971,
365,
222,
221,
128,
376,
221,
620,
3652,
971,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
9023,
341,
3652,
1221,
51,
376,
338,
376,
338,
496,
772,
3652,
971,
341,
556,
3652,
1221,
376,
588,
222,
221,
942,
782,
758,
4158,
971,
45,
910,
3652,
971,
848,
222,
221,
128,
376,
221,
597,
51,
3755,
971,
299,
3652,
971,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
7132,
341,
2302,
51,
376,
338,
376,
338,
496,
620,
341,
2302,
376,
588,
222,
221,
942,
910,
43257,
365,
222,
221,
128,
376,
221,
620,
2302,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
9023,
341,
2302,
51,
376,
338,
376,
338,
496,
772,
2302,
341,
556,
2302,
376,
588,
222,
221,
942,
782,
48910,
45,
910,
2302,
848,
222,
221,
128,
376,
221,
597,
51,
1535,
299,
2302,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
7132,
341,
461,
804,
51,
376,
338,
376,
338,
496,
620,
341,
461,
804,
376,
588,
222,
221,
942,
910,
640,
18296,
365,
222,
221,
128,
376,
221,
620,
34174,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
9023,
341,
461,
804,
51,
376,
338,
376,
338,
496,
772,
34174,
341,
556,
461,
804,
376,
588,
222,
221,
942,
782,
758,
18296,
45,
910,
34174,
848,
222,
221,
128,
376,
221,
597,
51,
28414,
299,
34174,
64,
222,
221,
130,
3038,
221,
1350,
376,
338,
7132,
341,
9275,
51,
376,
338,
376,
338,
496,
620,
341,
9275,
376,
588,
222,
221,
942,
7380,
65,
671,
67,
640,
18944,
365,
222,
221,
128,
376,
221,
344,
327,
3039,
1225,
630,
762,
848,
374,
221,
2228,
18944,
492,
376,
221,
620,
3039,
1225,
51,
2857,
492,
222,
221,
130,
26000,
221,
1350,
376,
338,
44280,
341,
9275,
51,
376,
588,
222,
221,
2072,
782,
3203,
18944,
365,
222,
221,
128,
376,
221,
3180,
1225,
299,
556,
8329,
65,
671,
49,
671,
1579,
244,
55,
53,
1110,
4102,
221,
671,
4757,
899,
299,
34174,
64,
376,
221,
13601,
899,
299,
4757,
899,
51,
3249,
45,
13202,
389,
349,
349,
6824,
3249,
45,
349,
16261,
349,
349,
6824,
5475,
492,
376,
221,
671,
1197,
1187,
17105,
299,
4757,
899,
51,
3045,
45,
17708,
1110,
4102,
221,
999,
327,
910,
1142,
518,
1187,
17105,
848,
376,
221,
128,
374,
221,
671,
41513,
1306,
299,
1142,
51,
5475,
492,
374,
221,
3180,
1225,
51,
543,
45,
41513,
1306,
51,
10498,
1046,
41513,
1306,
1110,
376,
221,
130,
222,
221,
130,
3038,
221,
1350,
376,
338,
7132,
341,
3039,
51,
376,
338,
376,
338,
496,
772,
3039,
577,
341,
3039,
655,
376,
338,
496,
620,
341,
3039,
376,
588,
222,
221,
942,
910,
640,
2743,
45,
910,
3039,
577,
848,
222,
221
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
2489,
46,
1364,
6146,
1522,
51,
222,
338,
5357,
338,
4202,
2177,
1932,
3039,
458,
2744,
347,
341,
9850,
708,
580,
1118,
1676,
338,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
1676,
338,
451,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
5357,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
837,
75,
4344,
3892,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
222,
338,
496,
2094,
23508,
50,
56,
51,
53,
48,
350,
544,
574,
438,
4601,
51,
1107,
52,
4205,
52,
21156,
50,
56,
51,
53,
48,
67,
222,
13533,
13214,
222,
1337,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
47454,
116,
11359,
51,
4756,
51,
12455,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5597,
5358,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5358,
51,
5358,
4336,
64,
222,
222,
325,
4314,
63,
7998,
50,
6413,
990,
20888,
222,
1350,
222,
338,
906,
1727,
6700,
2272,
51,
222,
588,
222,
69,
5358,
4336,
45,
15999,
577,
366,
2003,
39,
848,
222,
942,
462,
6700,
2272,
2041,
7406,
5358,
222,
128,
3038,
221,
1350,
906,
6111,
828,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
6111,
625,
64,
3038,
221,
1350,
906,
3652,
1221,
51,
588,
222,
221,
69,
45392,
327,
848,
222,
221,
2072,
910,
3652,
971,
64,
3038,
221,
1350
] | 4,057,522,731,857,803,000
| true
| false
| false
| false
|
[
12455,
64,
222,
222,
485,
1401,
51,
1058,
51,
2272,
64,
222,
485,
1401,
51,
1058,
51,
8263,
64,
222,
485,
1401,
51,
1058,
51,
1225,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5597,
5358,
64,
222,
485,
1105,
51,
2088,
4344,
3892,
51,
37486,
51,
4756,
51,
12455,
51,
5358,
51,
5358,
4336,
64,
222,
222,
325,
4314,
63,
7998,
50,
6413,
990,
20888,
222,
1350,
222,
338,
906,
1727,
6700,
2272,
51,
222,
588,
222,
69,
5358,
4336,
45,
15999,
577,
366,
2003,
39,
848,
222,
942,
462,
6700,
2272
] | 3,281,936,820,511,450,000
| true
|
option) any later version.
*
* Some open source application is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with xFramium. If not, see <http://www.gnu.org/licenses/>.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*******************************************************************************/
package org.xframium.integrations.perfectoMobile.rest.bean;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.xframium.integrations.rest.bean.AbstractBean;
import org.xframium.integrations.rest.bean.Bean.BeanDescriptor;
// TODO: Auto-generated Javadoc
/**
* The Class ApplicationCollection.
*/
@BeanDescriptor( beanName="response" )
public class ApplicationCollection
|
the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with xFramium. If not, see <http://www.gnu.org/licenses/>.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*******************************************************************************/
package org.xframium.integrations.perfectoMobile.rest.bean;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.xframium.integrations.rest.bean.AbstractBean;
import org.xframium.integrations.rest.bean.Bean.BeanDescriptor;
// TODO: Auto-generated Javadoc
/**
* The Class ApplicationCollection.
*/
@BeanDescriptor( beanName="response" )
public class ApplicationCollection
|
licenses/>.
*
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
*******************************************************************************/
package org.xframium.integrations.perfectoMobile.rest.bean;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.xframium.integrations.rest.bean.AbstractBean;
import org.xframium.integrations.rest.bean.Bean.BeanDescriptor;
// TODO: Auto-generated Javadoc
/**
* The Class ApplicationCollection.
*/
@BeanDescriptor( beanName="response" )
public class ApplicationCollection
|
bean;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.xframium.integrations.rest.bean.AbstractBean;
import org.xframium.integrations.rest.bean.Bean.BeanDescriptor;
// TODO: Auto-generated Javadoc
/**
* The Class ApplicationCollection.
*/
@BeanDescriptor( beanName="response" )
public class ApplicationCollection
|
extends AbstractBean
{
/** The execution id. */
@FieldDescriptor ( )
private String executionId;
/** The report key. */
@FieldDescriptor ( )
private String reportKey;
/**
|
ImageScaler.java
|
/FileExtraction/Java_unseen/tonysparks_seventh/src/seventh/shared/ImageScaler.java
|
/*
* see license.txt
*/
package seventh.shared;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
/**
* @author Tony
*
*/
public class ImageScaler {
/**
*
*/
public ImageScaler() {
// TODO Auto-generated constructor stub
}
static enum ScaleType {
AXIS_POSITION,
AXIS_LEGS,
AXIS_DEATH1,
AXIS_DEATH2,
ALLIED_POSITION,
ALLIED_LEGS,
ALLIED_DEATH1,
ALLIED_DEATH2,
;
}
/**
* @param args
*/
public static void main(String[] args) throws Exception {
ScaleType type = ScaleType.AXIS_POSITION;
File imageFile = null;
File destFile = null;
float scale = 1.0f;
int xOffset = 0;
int yOffset = 0;
int width = 0;
int height = 0;
switch(type) {
case AXIS_DEATH1: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\axis_death_01.png");
scale = 0.60f;
width = 512;
height = 256;
break;
}
case AXIS_DEATH2: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\axis_death_02.png");
scale = 0.60f;
width = 512;
height = 256;
break;
}
case AXIS_POSITION: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\axis_positions.png");
scale = 0.77f; // TODO: 0.616f take ((77% * 256) * 80%)
xOffset = -5;
yOffset = -5;
width = 256;
height = 256;
break;
}
case AXIS_LEGS: {
imageFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk.png");
destFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk_scaled.png");
scale = 0.77f;
xOffset = 0;
yOffset = 0;
width = 512;
height = 256;
break;
}
case ALLIED_DEATH1: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\allied_death_01.png");
scale = 0.60f;
width = 512;
height = 256;
break;
}
case ALLIED_DEATH2: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\allied_death_02.png");
scale = 0.60f;
width = 512;
height = 256;
break;
}
case ALLIED_POSITION: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\allied_positions.png");
scale = 0.77f;
xOffset = -5;
yOffset = -5;
width = 256;
height = 256;
break;
}
case ALLIED_LEGS: {
break;
}
}
BufferedImage image = ImageIO.read(imageFile);
BufferedImage scaledImage = new BufferedImage(width, height, BufferedImage.TRANSLUCENT);
Graphics2D g = (Graphics2D) scaledImage.getGraphics();
g.scale(scale, scale);
g.drawImage(image, xOffset, yOffset, null);
ImageIO.write(scaledImage, "png", destFile == null ? imageFile:destFile);
}
}
| 3,756
|
Java
|
.java
|
tonysparks/seventh
| 49
| 30
| 7
|
2014-05-05T22:57:09Z
|
2019-11-27T01:44:13Z
|
1ea0a9ffa36a531813769c97eea7f09cce0381fab82a8ab09017a0122f277b77
|
[] |
[
1127,
222,
338,
2337,
3553,
51,
2787,
1676,
588,
222,
1337,
427,
672,
109,
51,
4206,
64,
222,
222,
485,
1401,
51,
8236,
51,
8524,
55,
73,
64,
222,
485,
1401,
51,
8236,
51,
915,
51,
17640,
1675,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
222,
485,
3698,
51,
915,
735,
51,
1675,
2354,
64,
222,
222,
1350,
222,
338,
496,
2133,
413,
4373,
222,
338,
222,
588,
222,
942,
462,
4393,
36863,
320,
465,
1041,
294,
338,
5402,
588,
303,
581,
4393,
36863,
365,
320,
310,
453,
4314,
7998,
50,
6413,
4389,
11674,
303,
339,
465,
924,
3858,
19521,
638,
320,
310,
23329,
1309,
100,
19646,
49,
310,
23329,
1309,
100,
833,
11139,
49,
310,
23329,
1309,
100,
869,
3356,
54,
49,
310,
23329,
1309,
100,
869,
3356,
55,
49,
2776,
6066,
7925,
100,
19646,
49,
310,
6066,
7925,
100,
833,
11139,
49,
310,
6066,
7925,
100,
869,
3356,
54,
49,
310,
6066,
7925,
100,
869,
3356,
55,
49,
2776,
2098,
303,
339,
2205,
1041,
294,
338,
496,
772,
2194,
294,
588,
303,
581,
924,
782,
2594,
45,
671,
1197,
2194,
46,
2589,
3284,
320,
2776,
19521,
638,
847,
299,
19521,
638,
51,
31795,
100,
19646,
64,
37364,
2050,
1802,
991,
299,
762,
64,
310,
2050,
3481,
991,
299,
762,
64,
310,
1916,
5271,
299,
244,
54,
51,
53,
107,
64,
310,
648,
837,
3468,
299,
244,
53,
64,
310,
648,
553,
3468,
299,
244,
53,
64,
310,
648,
1882,
299,
244,
53,
64,
310,
648,
2401,
299,
244,
53,
64,
2776,
3593,
45,
700,
46,
320,
343,
1152,
23329,
1309,
100,
869,
3356,
54,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
5167,
100,
22638,
100,
53,
54,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
59,
53,
107,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
23329,
1309,
100,
869,
3356,
55,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
5167,
100,
22638,
100,
53,
55,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
59,
53,
107,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
23329,
1309,
100,
19646,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
5167,
100,
16784,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
453,
4314,
63,
244,
53,
51,
59,
54,
59,
107,
4843,
1849,
60,
60,
42,
338,
244,
55,
58,
59,
46,
338,
244,
61,
53,
20609,
9011,
837,
3468,
299,
449,
58,
64,
419,
553,
3468,
299,
449,
58,
64,
419,
1882,
299,
244,
55,
58,
59,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
23329,
1309,
100,
833,
11139,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
51,
1665,
742,
419,
3481,
991,
299,
244,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
100,
18290,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
9011,
837,
3468,
299,
244,
53,
64,
419,
553,
3468,
299,
244,
53,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
6066,
7925,
100,
869,
3356,
54,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
298,
3048,
100,
22638,
100,
53,
54,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
59,
53,
107,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
6066,
7925,
100,
869,
3356,
55,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
298,
3048,
100,
22638,
100,
53,
55,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
59,
53,
107,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
6066,
7925,
100,
19646,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
298,
3048,
100,
16784,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
419,
837,
3468,
299,
449,
58,
64,
419,
553,
3468,
299,
449,
58,
64,
419,
1882,
299,
244,
55,
58,
59,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
6066,
7925,
100,
833,
11139,
63,
320,
419,
1644,
64,
343,
339,
28885,
339,
47826,
44182,
1802,
299,
4393,
2354,
51,
870,
45,
915,
991,
312,
310,
44182,
23291,
1675,
299,
556,
44182,
45,
1660,
49,
2401,
49,
44182,
51,
41722,
13725,
1456,
312,
310,
16054,
55,
73,
504,
299,
327,
8524,
55,
73,
46,
23291,
1675,
51,
390,
8524,
492,
47826,
504,
51,
3826,
45,
3826,
49,
5271,
312,
310,
504,
51,
37719,
45,
915,
49,
837,
3468,
49,
553,
3468,
49,
762,
312,
2776,
4393,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,009
|
[
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
59,
53,
107,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
23329,
1309,
100,
19646,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750,
296,
672,
109,
1750,
3527,
1750,
23196,
1750,
3857,
1750,
5167,
100,
16784,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
453,
4314,
63,
244,
53,
51,
59,
54,
59,
107,
4843,
1849,
60,
60,
42,
338,
244,
55,
58,
59,
46,
338,
244,
61,
53,
20609,
9011,
837,
3468,
299,
449,
58,
64,
419,
553,
3468,
299,
449,
58,
64,
419,
1882,
299,
244,
55,
58,
59,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
23329,
1309,
100,
833,
11139,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
51,
1665,
742,
419,
3481,
991,
299,
244,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
100,
18290,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
9011,
837,
3468,
299,
244,
53,
64,
419,
553,
3468,
299,
244,
53,
64,
419,
1882,
299,
244,
58,
54,
55,
64,
419,
2401,
299,
244,
55,
58,
59,
64,
419,
1644,
64,
343,
339,
343,
1152,
6066,
7925,
100,
869,
3356,
54,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
2929,
1750
] | -3,015,214,304,440,306,700
| true
| false
| false
| false
|
[
833,
11139,
63,
320,
419,
1802,
991,
299,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
51,
1665,
742,
419,
3481,
991,
299,
244,
556,
2050,
459,
72,
16397,
3715,
1750,
89,
4373,
1750,
13050,
1750,
10792,
8337,
9012,
284,
1750,
1024,
1750,
5167,
100,
11941,
1750,
5167,
100,
2358,
120,
100,
11941,
100,
18290,
51,
1665,
742,
419,
5271,
299,
244,
53,
51,
60,
60,
107,
64,
9011,
837,
3468,
299,
244,
53,
64,
419,
553,
3468,
299
] | -1,896,545,319,939,854,000
| true
|
.png");
scale = 0.60f;
width = 512;
height = 256;
break;
}
case AXIS_POSITION: {
imageFile = new File("C:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\axis_positions.png");
scale = 0.77f; // TODO: 0.616f take ((77% * 256) * 80%)
xOffset = -5;
yOffset = -5;
width = 256;
height = 256;
break;
}
case AXIS_LEGS: {
imageFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk.png");
destFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk_scaled.png");
scale = 0.77f;
xOffset = 0;
yOffset =
|
:\\Users\\Tony\\git\\seventh\\assets\\gfx\\player\\axis_positions.png");
scale = 0.77f; // TODO: 0.616f take ((77% * 256) * 80%)
xOffset = -5;
yOffset = -5;
width = 256;
height = 256;
break;
}
case AXIS_LEGS: {
imageFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk.png");
destFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk_scaled.png");
scale = 0.77f;
xOffset = 0;
yOffset =
|
256) * 80%)
xOffset = -5;
yOffset = -5;
width = 256;
height = 256;
break;
}
case AXIS_LEGS: {
imageFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk.png");
destFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk_scaled.png");
scale = 0.77f;
xOffset = 0;
yOffset =
|
LEGS: {
imageFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk.png");
destFile = new File("C:\\Users\\Tony\\Desktop\\SpriteSheetPacker\\Test\\axis_walk\\axis_legs_walk_scaled.png");
scale = 0.77f;
xOffset = 0;
yOffset =
|
0;
width = 512;
height = 256;
break;
}
case ALLIED_DEATH1: {
imageFile = new File("C:\\Users\\Tony\\git\\
|
CycleDetection.java
|
/FileExtraction/Java_unseen/joney000_Java-Competitive-Programming/Algorithms/CycleDetection.java
|
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/*
* Author : joney_000[developer.jaswant@gmail.com]
* Algorithm : DFS or similar
* Platform : Codeforces
* Ref : Cycle detection in forest
*/
class A{
private InputStream inputStream ;
private OutputStream outputStream ;
private FastReader in ;
private PrintWriter out ;
private final int BUFFER = 100005;
private int auxInts[] = new int[BUFFER];
private long auxLongs[] = new long[1];
private double auxDoubles[] = new double[1];
private char auxChars[] = new char[1];
private final long mod = 1000000000+7;
private final int INF = Integer.MAX_VALUE;
private final long INF_L = Long.MAX_VALUE / 10;
public A(){}
public A(boolean stdIO)throws FileNotFoundException{
// stdIO = false;
if(stdIO){
inputStream = System.in;
outputStream = System.out;
}else{
inputStream = new FileInputStream("input.txt");
outputStream = new FileOutputStream("output.txt");
}
in = new FastReader(inputStream);
out = new PrintWriter(outputStream);
}
final int MAXN = (int)1e5;
// adj representation of graph
LinkedList <Integer>[] adj = new LinkedList[MAXN + 1];
boolean vis[] = new boolean[MAXN+1]; // to mark visited
int n, m;
void run()throws Exception{
n = i(); m = i();
clear(n);
for(int e = 1; e <= m; e++){
int u = i(); int v = i();
adj[u].add(v); // directed graph
}
LinkedList<Integer>[] adj0 = getCopy(adj, n); // maintaining mutability
boolean isCycle = false;
for(int i = 1; i <= n; i++){
if(!vis[i]){
isCycle = isCycle | isCycle(i, adj0); //PS: Not connected Graph: i.e. forest containing disconnected components
if(isCycle){
break;
}
}
}
if(isCycle){
out.write("yes cycle\n");
}else {
out.write("no cycle\n");
}
}
void clear(int n){
for(int i = 1; i <= n; i++){
adj[i] = new LinkedList<Integer>();
}
}
// Maintain immutability
LinkedList<Integer>[] getCopy(LinkedList<Integer>[] adj, int n)throws Exception{
LinkedList<Integer> adjCopy[] = new LinkedList[n + 1];
for(int i = 1; i <= n; i++){
adjCopy[i] = new LinkedList<Integer>();
for(int x: adj[i]){
adjCopy[i].add(x);
}
}
return adjCopy;
}
// int []depth = new int[MAXN + 1];
boolean isCycle(int root, LinkedList<Integer>[] adj)throws Exception{
LinkedList <Integer> queue = new LinkedList<Integer>(); //the stack
int currentDepth = 0; // level
queue.add(root);
vis[root] = true;
while(!queue.isEmpty()){
int u = queue.getLast(); //top
//depth[u]= currentDepth;
if(adj[u].size() > 0){
int v = adj[u].removeFirst();
if(!vis[v]){
queue.add(v);
currentDepth++;
vis[v] = true;
}else {
return true;
}
}else{
int v = queue.removeLast();
currentDepth--;
}
}
return false;
}
long gcd(long a, long b){
if(b == 0)return a;
return gcd(b, a % b);
}
long lcm(long a, long b){
if(a == 0 || b == 0)return 0;
return (a * b)/gcd(a, b);
}
long mulMod(long a, long b, long mod){
if(a == 0 || b == 0)return 0;
if(b == 1)return a;
long ans = mulMod(a, b/2, mod);
ans = (ans * 2) % mod;
if(b % 2 == 1)ans = (a + ans)% mod;
return ans;
}
long pow(long a, long b, long mod){
if(b == 0)return 1;
if(b == 1)return a;
long ans = pow(a, b/2, mod);
ans = (ans * ans);
if(ans >= mod)ans %= mod;
if(b % 2 == 1)ans = (a * ans);
if(ans >= mod)ans %= mod;
return ans;
}
// 20*20 nCr Pascal Table
long[][] ncrTable(){
long ncr[][] = new long[21][21];
for(int i = 0; i <= 20; i++){
ncr[i][0] = ncr[i][i] = 1L;
}
for(int j = 0; j <= 20; j++){
for(int i = j + 1; i <= 20; i++){
ncr[i][j] = ncr[i-1][j] + ncr[i-1][j-1];
}
}
return ncr;
}
int i()throws Exception{
return in.nextInt();
}
int[] is(int n)throws Exception{
for(int i=1 ; i <= n ;i++)auxInts[i] = in.nextInt();
return auxInts;
}
long l()throws Exception{
return in.nextLong();
}
long[] ls(int n)throws Exception{
for(int i=1 ; i <= n ;i++)auxLongs[i] = in.nextLong();
return auxLongs;
}
double d()throws Exception{
return in.nextDouble();
}
double[] ds(int n)throws Exception{
for(int i=1 ; i <= n ;i++)auxDoubles[i] = in.nextDouble();
return auxDoubles;
}
char c()throws Exception{
return in.nextCharacter();
}
char[] cs(int n)throws Exception{
for(int i=1 ; i <= n ;i++)auxChars[i] = in.nextCharacter();
return auxChars;
}
String s()throws Exception{
return in.nextLine();
}
BigInteger bi()throws Exception{
return in.nextBigInteger();
}
private void closeResources(){
out.flush();
out.close();
return;
}
// IMP: roundoff upto 2 digits
// double roundOff = Math.round(a * 100.0) / 100.0;
// or
// System.out.printf("%.2f", val);
// print upto 2 digits after decimal
// val = ((long)(val * 100.0))/100.0;
public static void main(String[] args) throws java.lang.Exception{
A driver = new A(true);
driver.run();
driver.closeResources();
}
}
class FastReader{
private boolean finished = false;
private InputStream stream;
private byte[] buf = new byte[4 * 1024];
private int curChar;
private int numChars;
private SpaceCharFilter filter;
public FastReader(InputStream stream){
this.stream = stream;
}
public int read(){
if (numChars == -1){
throw new InputMismatchException ();
}
if (curChar >= numChars){
curChar = 0;
try{
numChars = stream.read (buf);
} catch (IOException e){
throw new InputMismatchException ();
}
if (numChars <= 0){
return -1;
}
}
return buf[curChar++];
}
public int peek(){
if (numChars == -1){
return -1;
}
if (curChar >= numChars){
curChar = 0;
try{
numChars = stream.read (buf);
} catch (IOException e){
return -1;
}
if (numChars <= 0){
return -1;
}
}
return buf[curChar];
}
public int nextInt(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
int res = 0;
do{
if(c==','){
c = read();
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
} while (!isSpaceChar (c));
return res * sgn;
}
public long nextLong(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
long res = 0;
do{
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
} while (!isSpaceChar (c));
return res * sgn;
}
public String nextString(){
int c = read ();
while (isSpaceChar (c))
c = read ();
StringBuilder res = new StringBuilder ();
do{
res.appendCodePoint (c);
c = read ();
} while (!isSpaceChar (c));
return res.toString ();
}
public boolean isSpaceChar(int c){
if (filter != null){
return filter.isSpaceChar (c);
}
return isWhitespace (c);
}
public static boolean isWhitespace(int c){
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private String readLine0(){
StringBuilder buf = new StringBuilder ();
int c = read ();
while (c != '\n' && c != -1){
if (c != '\r'){
buf.appendCodePoint (c);
}
c = read ();
}
return buf.toString ();
}
public String nextLine(){
String s = readLine0 ();
while (s.trim ().length () == 0)
s = readLine0 ();
return s;
}
public String nextLine(boolean ignoreEmptyLines){
if (ignoreEmptyLines){
return nextLine ();
}else{
return readLine0 ();
}
}
public BigInteger nextBigInteger(){
try{
return new BigInteger (nextString ());
} catch (NumberFormatException e){
throw new InputMismatchException ();
}
}
public char nextCharacter(){
int c = read ();
while (isSpaceChar (c))
c = read ();
return (char) c;
}
public double nextDouble(){
int c = read ();
while (isSpaceChar (c))
c = read ();
int sgn = 1;
if (c == '-'){
sgn = -1;
c = read ();
}
double res = 0;
while (!isSpaceChar (c) && c != '.'){
if (c == 'e' || c == 'E'){
return res * Math.pow (10, nextInt ());
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
res *= 10;
res += c - '0';
c = read ();
}
if (c == '.'){
c = read ();
double m = 1;
while (!isSpaceChar (c)){
if (c == 'e' || c == 'E'){
return res * Math.pow (10, nextInt ());
}
if (c < '0' || c > '9'){
throw new InputMismatchException ();
}
m /= 10;
res += (c - '0') * m;
c = read ();
}
}
return res * sgn;
}
public boolean isExhausted(){
int value;
while (isSpaceChar (value = peek ()) && value != -1)
read ();
return value == -1;
}
public String next(){
return nextString ();
}
public SpaceCharFilter getFilter(){
return filter;
}
public void setFilter(SpaceCharFilter filter){
this.filter = filter;
}
public interface SpaceCharFilter{
public boolean isSpaceChar(int ch);
}
}
class Pair implements Comparable<Pair>{
public int a;
public int b;
public Pair(){
this.a = 0;
this.b = 0;
}
public Pair(int a,int b){
this.a = a;
this.b = b;
}
public int compareTo(Pair p){
if(this.a == p.a){
return this.b - p.b;
}
return this.a - p.a;
}
@Override
public String toString(){
return "a = " + this.a + " b = " + this.b;
}
}
| 10,794
|
Java
|
.java
|
joney000/Java-Competitive-Programming
| 102
| 27
| 0
|
2016-11-29T05:22:00Z
|
2024-02-20T10:27:51Z
|
5162203b0c6d4b40469d9ec68e9ab2f2546e38fe095b24143bad71eceb1d85e5
|
[] |
[
485,
1401,
51,
1058,
7737,
222,
485,
1401,
51,
1600,
7737,
222,
485,
1401,
51,
735,
7737,
222,
485,
1401,
51,
3851,
7737,
222,
222,
1127,
222,
338,
6265,
283,
518,
614,
7310,
100,
53,
53,
53,
96,
8641,
51,
18526,
13455,
69,
7265,
51,
527,
98,
222,
338,
24608,
518,
41275,
575,
6735,
222,
338,
11329,
244,
518,
4420,
39186,
222,
338,
7911,
981,
518,
44706,
13926,
347,
37107,
222,
588,
222,
222,
842,
418,
128,
244,
4070,
964,
18994,
34583,
2098,
353,
964,
35998,
43109,
2098,
353,
964,
15934,
3314,
347,
2098,
353,
964,
47163,
986,
2098,
4070,
964,
1175,
648,
44206,
299,
244,
54,
53,
53,
53,
53,
58,
64,
4070,
964,
648,
283,
38430,
120,
1197,
299,
556,
648,
96,
8455,
988,
353,
964,
1964,
280,
11072,
3967,
120,
1197,
299,
556,
1964,
96,
54,
988,
353,
964,
2082,
11072,
15388,
1197,
299,
556,
2082,
96,
54,
988,
353,
964,
1370,
280,
11072,
16356,
1197,
299,
556,
1370,
96,
54,
988,
353,
964,
1175,
1964,
2065,
299,
244,
54,
53,
53,
53,
53,
53,
53,
53,
53,
53,
48,
60,
64,
353,
964,
1175,
648,
244,
47199,
244,
299,
4418,
51,
3470,
100,
5986,
64,
353,
964,
1175,
1964,
47199,
100,
81,
244,
299,
6374,
51,
3470,
100,
5986,
536,
244,
54,
53,
64,
736,
581,
418,
47421,
353,
581,
418,
45,
4412,
1248,
2354,
46,
5124,
47493,
128,
303,
453,
1248,
2354,
299,
920,
64,
303,
434,
45,
1550,
2354,
1528,
416,
34583,
299,
1189,
51,
285,
64,
416,
43109,
299,
1189,
51,
560,
64,
303,
339,
728,
128,
416,
34583,
299,
556,
34075,
459,
1151,
51,
2787,
742,
416,
43109,
299,
556,
37000,
459,
2051,
51,
2787,
742,
303,
339,
303,
347,
299,
556,
15934,
3314,
45,
43317,
312,
303,
986,
299,
556,
47163,
45,
2051,
1880,
312,
353,
339,
736,
1175,
648,
7490,
83,
299,
327,
429,
46,
54,
106,
58,
64,
353,
453,
22052,
10323,
451,
4023,
353,
21057,
350,
3078,
36648,
22052,
299,
556,
21057,
96,
3470,
83,
494,
244,
54,
988,
353,
1922,
3084,
1197,
299,
556,
1922,
96,
3470,
83,
48,
54,
988,
453,
391,
3658,
21316,
21248,
648,
329,
49,
364,
64,
736,
782,
1441,
365,
5124,
3284,
128,
303,
329,
299,
613,
492,
364,
299,
613,
492,
18081,
4250,
45,
115,
312,
465,
456,
45,
429,
503,
299,
244,
54,
64,
503,
2527,
364,
64,
503,
9258,
416,
648,
1064,
299,
613,
492,
648,
373,
299,
613,
492,
416,
22052,
96,
122,
1015,
688,
45,
123,
312,
453,
36632,
4023,
303,
339,
303,
21057,
65,
3078,
36648,
22052,
53,
299,
640,
4014,
45,
16431,
49,
329,
312,
244,
453,
38775,
4047,
3478,
303,
1922,
458,
16113,
299,
920,
64,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
434,
3848,
1893,
96,
110,
31465,
310,
458,
16113,
299,
458,
16113,
542,
458,
16113,
45,
110,
49,
22052,
53,
312,
453,
4259,
63,
3204,
9485,
6478,
63,
613,
51,
106,
51,
37107,
6663,
33552,
6361,
4488,
434,
45,
316,
16113,
1528,
633,
1644,
64,
310,
339,
416,
339,
303,
339,
465,
434,
45,
316,
16113,
1528,
416,
986,
51,
1838,
459,
7150,
14790,
97,
115,
742,
303,
339,
728,
320,
416,
986,
51,
1838,
459,
1365,
14790,
97,
115,
742,
303,
339,
353,
339,
4070,
782,
4250,
45,
429,
329,
1528,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
303,
339,
353,
339,
736,
453,
30373,
524,
3987,
2294,
3478,
353,
21057,
65,
3078,
36648,
640,
4014,
45,
20535,
65,
3078,
36648,
22052,
49,
648,
329,
46,
5124,
3284,
128,
303,
21057,
65,
3078,
67,
22052,
4014,
1197,
299,
556,
21057,
96,
115,
494,
244,
54,
988,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
4014,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
416,
456,
45,
429,
837,
63,
22052,
96,
110,
31465,
310,
22052,
4014,
96,
110,
1015,
688,
45,
125,
312,
416,
339,
303,
339,
303,
461,
22052,
4014,
64,
5246,
339,
736,
453,
648,
1627,
6333,
299,
556,
648,
96,
3470,
83,
494,
244,
54,
988,
736,
1922,
458,
16113,
45,
429,
3070,
49,
21057,
65,
3078,
36648,
22052,
46,
5124,
3284,
128,
465,
21057,
350,
3078,
67,
5535,
299,
556,
21057,
65,
3078,
2938,
453,
1402,
4154,
3751,
648,
1565,
8036,
299,
244,
53,
64,
453,
3215,
303,
5535,
51,
688,
45,
2405,
312,
303,
3084,
96,
2405,
98,
299,
878,
64,
2205,
2236,
3848,
3941,
51,
6401,
13059,
28540,
648,
1064,
299,
5535,
51,
20164,
492,
453,
1412,
416,
453,
6333,
96,
122,
7813,
1565,
8036,
64,
416,
434,
45,
16431,
96,
122,
1015,
911,
365,
868,
244,
53,
1528,
310,
648,
373,
299,
22052,
96,
122,
1015,
2564,
3485,
492,
310,
434,
3848,
1893,
96,
123,
31465,
633,
5535,
51,
688,
45,
123,
312,
633,
1565,
8036,
3348,
633,
3084,
96,
123,
98,
299,
878,
64,
4488,
339,
728,
320,
295,
461,
878,
64,
310,
339,
416,
339,
728,
128,
310,
648,
373,
299,
5535,
51,
2564,
3283,
492,
310,
1565,
8036,
10606,
416,
339,
303,
339,
303,
461,
920,
64,
353,
339,
736,
1964,
43384,
45,
3239,
331,
49,
1964,
342,
1528,
303,
434,
45,
103,
630,
244,
53,
46,
620,
331,
64,
303,
461,
43384,
45,
103,
49,
331,
925,
342,
312,
353,
339,
736,
1964,
475,
4112,
45,
3239,
331,
49,
1964,
342,
1528,
303,
434,
45,
102,
630,
244,
53,
1293,
342,
630,
244,
53,
46,
620,
244,
53,
64,
303,
461,
327,
102,
338,
342,
4201,
45985,
45,
102,
49,
342,
312,
353,
339,
736,
1964,
17472,
2590,
45,
3239,
331,
49,
1964,
342,
49,
1964,
2065,
1528,
303,
434,
45,
102,
630,
244,
53,
1293,
342,
630,
244,
53,
46,
620,
244,
53,
64,
303,
434,
45,
103,
630,
244,
54,
46,
620,
331,
64,
303,
1964,
12187,
299,
17472,
2590,
45,
102,
49,
342,
52,
55,
49,
2065,
312,
303,
12187,
299,
327,
711,
338,
244,
55,
46,
925,
2065,
64,
303,
434
] |
[
[
1,
1,
1,
1,
1,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
122,
1015,
688,
45,
123,
312,
453,
36632,
4023,
303,
339,
303,
21057,
65,
3078,
36648,
22052,
53,
299,
640,
4014,
45,
16431,
49,
329,
312,
244,
453,
38775,
4047,
3478,
303,
1922,
458,
16113,
299,
920,
64,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
434,
3848,
1893,
96,
110,
31465,
310,
458,
16113,
299,
458,
16113,
542,
458,
16113,
45,
110,
49,
22052,
53,
312,
453,
4259,
63,
3204,
9485,
6478,
63,
613,
51,
106,
51,
37107,
6663,
33552,
6361,
4488,
434,
45,
316,
16113,
1528,
633,
1644,
64,
310,
339,
416,
339,
303,
339,
465,
434,
45,
316,
16113,
1528,
416,
986,
51,
1838,
459,
7150,
14790,
97,
115,
742,
303,
339,
728,
320,
416,
986,
51,
1838,
459,
1365,
14790,
97,
115,
742,
303,
339,
353,
339,
4070,
782,
4250,
45,
429,
329,
1528,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
303,
339,
353,
339,
736,
453,
30373,
524,
3987,
2294,
3478,
353,
21057,
65,
3078,
36648,
640,
4014,
45,
20535,
65,
3078,
36648,
22052,
49,
648,
329,
46,
5124,
3284,
128,
303,
21057,
65,
3078,
67,
22052,
4014,
1197,
299,
556,
21057,
96,
115,
494,
244,
54,
988,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
4014,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
416,
456,
45,
429,
837,
63,
22052,
96,
110,
31465,
310,
22052,
4014,
96,
110,
1015,
688,
45,
125,
312,
416,
339,
303,
339,
303,
461,
22052,
4014,
64,
5246,
339,
736,
453,
648,
1627,
6333,
299,
556,
648,
96,
3470,
83,
494,
244,
54,
988,
736,
1922,
458,
16113,
45,
429
] | 384,670,124,835,514,430
| true
| false
| false
| false
|
[
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
303,
339,
353,
339,
736,
453,
30373,
524,
3987,
2294,
3478,
353,
21057,
65,
3078,
36648,
640,
4014,
45,
20535,
65,
3078,
36648,
22052,
49,
648,
329,
46,
5124,
3284,
128,
303,
21057,
65,
3078,
67,
22052,
4014,
1197,
299,
556,
21057,
96,
115,
494,
244,
54,
988,
303,
456,
45,
429,
613,
299,
244,
54,
64,
613,
2527,
329,
64,
613,
9258,
416,
22052,
4014,
96,
110,
98,
299,
556,
21057,
65,
3078,
2938,
416,
456
] | 2,002,593,223,485,790,500
| true
|
[u].add(v); // directed graph
}
LinkedList<Integer>[] adj0 = getCopy(adj, n); // maintaining mutability
boolean isCycle = false;
for(int i = 1; i <= n; i++){
if(!vis[i]){
isCycle = isCycle | isCycle(i, adj0); //PS: Not connected Graph: i.e. forest containing disconnected components
if(isCycle){
break;
}
}
}
if(isCycle){
out.write("yes cycle\n");
}else {
out.write("no cycle\n");
}
}
void clear(int n){
for(int i = 1; i <= n; i++){
adj[i] = new LinkedList<Integer>();
}
}
// Maintain immutability
LinkedList<Integer>[] getCopy(LinkedList<Integer>[] adj, int n)throws Exception{
LinkedList<Integer> adjCopy[] = new LinkedList[n + 1];
for(int i = 1; i <= n; i++){
adjCopy[i] = new LinkedList<Integer>();
for
|
n; i++){
if(!vis[i]){
isCycle = isCycle | isCycle(i, adj0); //PS: Not connected Graph: i.e. forest containing disconnected components
if(isCycle){
break;
}
}
}
if(isCycle){
out.write("yes cycle\n");
}else {
out.write("no cycle\n");
}
}
void clear(int n){
for(int i = 1; i <= n; i++){
adj[i] = new LinkedList<Integer>();
}
}
// Maintain immutability
LinkedList<Integer>[] getCopy(LinkedList<Integer>[] adj, int n)throws Exception{
LinkedList<Integer> adjCopy[] = new LinkedList[n + 1];
for(int i = 1; i <= n; i++){
adjCopy[i] = new LinkedList<Integer>();
for
|
}
}
}
if(isCycle){
out.write("yes cycle\n");
}else {
out.write("no cycle\n");
}
}
void clear(int n){
for(int i = 1; i <= n; i++){
adj[i] = new LinkedList<Integer>();
}
}
// Maintain immutability
LinkedList<Integer>[] getCopy(LinkedList<Integer>[] adj, int n)throws Exception{
LinkedList<Integer> adjCopy[] = new LinkedList[n + 1];
for(int i = 1; i <= n; i++){
adjCopy[i] = new LinkedList<Integer>();
for
|
int i = 1; i <= n; i++){
adj[i] = new LinkedList<Integer>();
}
}
// Maintain immutability
LinkedList<Integer>[] getCopy(LinkedList<Integer>[] adj, int n)throws Exception{
LinkedList<Integer> adjCopy[] = new LinkedList[n + 1];
for(int i = 1; i <= n; i++){
adjCopy[i] = new LinkedList<Integer>();
for
|
(int x: adj[i]){
adjCopy[i].add(x);
}
}
return adjCopy;
}
// int []depth = new int[MAXN + 1];
boolean isCycle(int
|
PdlTester.java
|
/FileExtraction/Java_unseen/wesen_nmedit/libs/jpdl/test/net/sf/nmedit/jpdl/PdlTester.java
|
package net.sf.nmedit.jpdl;
import junit.framework.*;
public class PdlTester extends TestCase
{
protected void setUp()
{
System.out.println("");
}
private String testpdl = null;
public String getTestPdlFileName()
{
if (testpdl == null)
{
// get location of test.pdl
testpdl = getClass().getClassLoader().getResource("test.pdl").getFile();
}
return testpdl;
}
public void testDecode()
throws Exception
{
try {
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream stream = new BitStream();
Packet packet = new Packet();
stream.append(0xf0, 8);
stream.append(0x33, 8);
stream.append( 0, 1);
stream.append(0x16, 5);
stream.append( 0, 2);
stream.append(0x06, 8);
stream.append( 0, 1);
stream.append( 15, 7);
stream.append( 0, 1);
stream.append(0x7f, 7);
stream.append( 0, 1);
stream.append( 16, 7);
stream.append( 0, 1);
stream.append( 127, 7);
stream.append(0xf7, 8);
p.getPacketParser("Sysex").parse(stream, packet);
Assert.assertEquals(0x16, packet.getVariable("cc"));
Assert.assertEquals(0, packet.getVariable("slot"));
Assert.assertEquals("ACK", packet.getPacket("data").getName());
Assert.assertEquals(15, packet.getPacket("data")
.getVariable("pid1"));
Assert.assertEquals(16, packet.getPacket("data")
.getVariable("pid2"));
Assert.assertEquals(127, packet.getPacket("data")
.getVariable("checksum"));
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
public void testEncode()
throws Exception
{
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream bstream = new BitStream();
IntStream istream = new IntStream();
istream.append(0x16);
istream.append(3);
istream.append(4);
istream.append(5);
istream.append(6);
p.getPacketParser("Sysex").generate(istream, bstream);
Assert.assertEquals(0xf0, bstream.getInt(8));
Assert.assertEquals(0x33, bstream.getInt(8));
Assert.assertEquals(0, bstream.getInt(1));
Assert.assertEquals(0x16, bstream.getInt(5));
Assert.assertEquals(3, bstream.getInt(2));
Assert.assertEquals(0x06, bstream.getInt(8));
Assert.assertEquals(4, bstream.getInt(8));
Assert.assertEquals(0x7f, bstream.getInt(8));
Assert.assertEquals(5, bstream.getInt(8));
Assert.assertEquals(6, bstream.getInt(8));
Assert.assertEquals(0xf7, bstream.getInt(8));
}
public void testGreedy()
throws Exception
{
try {
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream stream = new BitStream();
Packet packet = new Packet();
stream.append(1, 8);
stream.append(2, 8);
stream.append(3, 8);
stream.append(4, 8);
stream.append(5, 8);
stream.append(6, 8);
p.getPacketParser("Variable").parse(stream, packet);
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
class TestTracer implements Tracer
{
public void trace(String msg)
{
System.out.println("TRACE: " + msg);
}
}
}
| 3,259
|
Java
|
.java
|
wesen/nmedit
| 13
| 9
| 0
|
2011-09-11T23:42:26Z
|
2019-11-23T19:25:59Z
|
5a871ceeda111d9567c39f48c7c128d2c55a17f14ba22147e8efc7186190c05b
|
[] |
[
1337,
3723,
51,
6463,
51,
115,
1987,
302,
51,
11558,
3679,
64,
222,
222,
485,
36678,
51,
2863,
7737,
222,
222,
942,
462,
466,
3679,
18574,
2041,
19189,
222,
128,
303,
2532,
782,
14544,
365,
303,
320,
222,
221,
1615,
51,
560,
51,
3962,
10928,
303,
339,
2205,
964,
910,
913,
117,
3679,
299,
762,
64,
2205,
581,
910,
640,
1024,
85,
3679,
6793,
365,
303,
320,
310,
434,
327,
881,
117,
3679,
630,
762,
46,
310,
320,
343,
453,
640,
3913,
451,
913,
51,
117,
3679,
343,
913,
117,
3679,
299,
27042,
941,
43936,
941,
17633,
459,
881,
51,
117,
3679,
1912,
22184,
492,
310,
339,
310,
461,
913,
117,
3679,
64,
303,
339,
2205,
581,
782,
913,
11869,
365,
222,
221,
5124,
3284,
303,
320,
222,
221,
1287,
320,
3281,
15653,
317,
299,
556,
15653,
45,
38824,
85,
3679,
6793,
1052,
3281,
317,
51,
558,
24024,
45,
909,
2128,
24024,
1052,
48889,
7600,
1880,
3458,
299,
556,
7600,
1880,
492,
3281,
18706,
6892,
299,
556,
18706,
492,
48889,
3458,
51,
1713,
45,
53,
2088,
53,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
53,
125,
56,
56,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
54,
312,
3281,
3458,
51,
1713,
45,
53,
125,
54,
59,
49,
244,
58,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
55,
312,
3281,
3458,
51,
1713,
45,
53,
125,
53,
59,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
54,
312,
3281,
3458,
51,
1713,
45,
280,
54,
58,
49,
244,
60,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
54,
312,
3281,
3458,
51,
1713,
45,
53,
125,
60,
107,
49,
244,
60,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
54,
312,
3281,
3458,
51,
1713,
45,
280,
54,
59,
49,
244,
60,
312,
3281,
3458,
51,
1713,
45,
283,
53,
49,
244,
54,
312,
3281,
3458,
51,
1713,
45,
244,
54,
55,
60,
49,
244,
60,
312,
3281,
3458,
51,
1713,
45,
53,
2088,
60,
49,
244,
61,
312,
48889,
317,
51,
390,
6839,
2837,
459,
16719,
19570,
1912,
2228,
45,
2255,
49,
6892,
312,
48889,
3187,
51,
4993,
45,
53,
125,
54,
59,
49,
6892,
51,
390,
3836,
459,
1172,
2992,
3281,
3187,
51,
4993,
45,
53,
49,
6892,
51,
390,
3836,
459,
9054,
2992,
3281,
3187,
51,
4993,
459,
3289,
411,
6892,
51,
390,
6839,
459,
624,
1912,
5175,
1052,
3281,
3187,
51,
4993,
45,
54,
58,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
6336,
54,
2992,
3281,
3187,
51,
4993,
45,
54,
59,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
6336,
55,
2992,
3281,
3187,
51,
4993,
45,
54,
55,
60,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
21034,
2992,
222,
221,
130,
222,
221,
5639,
45,
1002,
503,
46,
320,
3281,
503,
51,
9428,
492,
3281,
1440,
503,
64,
222,
221,
130,
303,
339,
465,
581,
782,
913,
10806,
365,
222,
221,
5124,
3284,
303,
320,
222,
221,
5519,
317,
299,
556,
15653,
45,
38824,
85,
3679,
6793,
1052,
222,
221,
117,
51,
558,
24024,
45,
909,
2128,
24024,
1052,
3038,
221,
4596,
1880,
342,
2255,
299,
556,
7600,
1880,
492,
222,
221,
1438,
1880,
8535,
1070,
299,
556,
2871,
1880,
492,
3038,
221,
35871,
51,
1713,
45,
53,
125,
54,
59,
312,
222,
221,
35871,
51,
1713,
45,
56,
312,
222,
221,
35871,
51,
1713,
45,
57,
312,
222,
221,
35871,
51,
1713,
45,
58,
312,
222,
221,
35871,
51,
1713,
45,
59,
312,
499,
221,
117,
51,
390,
6839,
2837,
459,
16719,
19570,
1912,
5555,
45,
35871,
49,
342,
2255,
312,
3038,
221,
3285,
51,
4993,
45,
53,
2088,
53,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
53,
125,
56,
56,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
53,
49,
342,
2255,
51,
15384,
45,
54,
894,
222,
221,
3285,
51,
4993,
45,
53,
125,
54,
59,
49,
342,
2255,
51,
15384,
45,
58,
894,
222,
221,
3285,
51,
4993,
45,
56,
49,
342,
2255,
51,
15384,
45,
55,
894,
222,
221,
3285,
51,
4993,
45,
53,
125,
53,
59,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
57,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
53,
125,
60,
107,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
58,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
59,
49,
342,
2255,
51,
15384,
45,
61,
894,
222,
221,
3285,
51,
4993,
45,
53,
2088,
60,
49,
342,
2255,
51,
15384,
45,
61,
894,
303,
339,
465,
581,
782,
913,
76,
39989,
365,
222,
221,
5124,
3284,
303,
320,
222,
221,
1287,
320,
3281,
15653,
317,
299,
556,
15653,
45,
38824,
85,
3679,
6793,
1052,
3281,
317,
51,
558,
24024,
45,
909,
2128,
24024,
1052,
48889,
7600,
1880,
3458,
299,
556,
7600,
1880,
492,
3281,
18706,
6892,
299,
556,
18706,
492,
48889,
3458,
51,
1713,
45,
54,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
55,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
56,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
57,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
58,
49,
244,
61,
312,
3281,
3458,
51,
1713,
45,
59,
49,
244,
61,
312,
48889,
317,
51,
390,
6839,
2837,
459,
3836,
1912,
2228,
45,
2255,
49,
6892,
312,
222,
221,
130,
222,
221,
5639,
45,
1002,
503,
46,
320,
3281,
503,
51,
9428,
492,
3281,
1440,
503,
64,
222,
221,
130,
303,
339,
465,
462,
2128,
24024,
4584,
1588,
8234,
303,
320,
222,
221,
942,
782,
8266,
45,
671,
3141,
46,
222,
221,
128,
3281,
1189,
51,
560,
51,
3962,
459,
13180,
63,
332,
494,
3141,
312,
222,
221,
130,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,007
|
[
49,
244,
60,
312,
3281,
3458,
51,
1713,
45,
53,
2088,
60,
49,
244,
61,
312,
48889,
317,
51,
390,
6839,
2837,
459,
16719,
19570,
1912,
2228,
45,
2255,
49,
6892,
312,
48889,
3187,
51,
4993,
45,
53,
125,
54,
59,
49,
6892,
51,
390,
3836,
459,
1172,
2992,
3281,
3187,
51,
4993,
45,
53,
49,
6892,
51,
390,
3836,
459,
9054,
2992,
3281,
3187,
51,
4993,
459,
3289,
411,
6892,
51,
390,
6839,
459,
624,
1912,
5175,
1052,
3281,
3187,
51,
4993,
45,
54,
58,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
6336,
54,
2992,
3281,
3187,
51,
4993,
45,
54,
59,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
6336,
55,
2992,
3281,
3187,
51,
4993,
45,
54,
55,
60,
49,
6892,
51,
390,
6839,
459,
624,
678,
621,
221,
51,
390,
3836,
459,
21034,
2992,
222,
221,
130,
222,
221,
5639,
45,
1002,
503,
46,
320,
3281,
503,
51,
9428,
492,
3281,
1440,
503,
64,
222,
221,
130,
303,
339,
465,
581,
782,
913,
10806,
365,
222,
221,
5124,
3284,
303,
320,
222,
221,
5519,
317,
299,
556,
15653,
45,
38824,
85,
3679,
6793,
1052,
222,
221,
117,
51,
558,
24024,
45,
909,
2128,
24024,
1052,
3038,
221,
4596,
1880,
342,
2255,
299,
556,
7600,
1880,
492,
222,
221,
1438,
1880,
8535,
1070,
299,
556,
2871,
1880,
492,
3038,
221,
35871,
51,
1713,
45,
53,
125,
54,
59,
312,
222,
221,
35871,
51,
1713,
45,
56,
312,
222,
221,
35871,
51,
1713,
45,
57,
312,
222,
221,
35871,
51,
1713,
45,
58,
312,
222,
221,
35871,
51,
1713,
45,
59,
312,
499,
221,
117,
51,
390,
6839,
2837,
459,
16719,
19570,
1912,
5555,
45,
35871,
49,
342,
2255,
312,
3038,
221,
3285,
51,
4993
] | -110,869,587,049,235,970
| true
| false
| false
| false
|
[
2992,
222,
221,
130,
222,
221,
5639,
45,
1002,
503,
46,
320,
3281,
503,
51,
9428,
492,
3281,
1440,
503,
64,
222,
221,
130,
303,
339,
465,
581,
782,
913,
10806,
365,
222,
221,
5124,
3284,
303,
320,
222,
221,
5519,
317,
299,
556,
15653,
45,
38824,
85,
3679,
6793,
1052,
222,
221,
117,
51,
558,
24024,
45,
909,
2128,
24024,
1052,
3038,
221,
4596,
1880,
342,
2255,
299,
556,
7600,
1880,
492,
222,
221,
1438,
1880,
8535,
1070,
299,
556,
2871,
1880,
492,
3038,
221,
35871,
51,
1713,
45,
53,
125,
54,
59,
312,
222,
221,
35871,
51,
1713
] | -6,281,838,551,547,560,000
| true
|
, 7);
stream.append(0xf7, 8);
p.getPacketParser("Sysex").parse(stream, packet);
Assert.assertEquals(0x16, packet.getVariable("cc"));
Assert.assertEquals(0, packet.getVariable("slot"));
Assert.assertEquals("ACK", packet.getPacket("data").getName());
Assert.assertEquals(15, packet.getPacket("data")
.getVariable("pid1"));
Assert.assertEquals(16, packet.getPacket("data")
.getVariable("pid2"));
Assert.assertEquals(127, packet.getPacket("data")
.getVariable("checksum"));
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
public void testEncode()
throws Exception
{
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream bstream = new BitStream();
IntStream istream = new IntStream();
istream.append(0x16);
istream.append
|
Assert.assertEquals(0, packet.getVariable("slot"));
Assert.assertEquals("ACK", packet.getPacket("data").getName());
Assert.assertEquals(15, packet.getPacket("data")
.getVariable("pid1"));
Assert.assertEquals(16, packet.getPacket("data")
.getVariable("pid2"));
Assert.assertEquals(127, packet.getPacket("data")
.getVariable("checksum"));
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
public void testEncode()
throws Exception
{
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream bstream = new BitStream();
IntStream istream = new IntStream();
istream.append(0x16);
istream.append
|
pid1"));
Assert.assertEquals(16, packet.getPacket("data")
.getVariable("pid2"));
Assert.assertEquals(127, packet.getPacket("data")
.getVariable("checksum"));
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
public void testEncode()
throws Exception
{
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream bstream = new BitStream();
IntStream istream = new IntStream();
istream.append(0x16);
istream.append
|
"));
}
catch(Exception e) {
e.printStackTrace();
throw e;
}
}
public void testEncode()
throws Exception
{
Protocol p = new Protocol(getTestPdlFileName());
p.useTracer(new TestTracer());
BitStream bstream = new BitStream();
IntStream istream = new IntStream();
istream.append(0x16);
istream.append
|
(3);
istream.append(4);
istream.append(5);
istream.append(6);
p.getPacketParser("Sysex").generate(istream, bstream);
Assert.assertEquals
|
ProcessCreationWizardPage.java
|
/FileExtraction/Java_unseen/bonitasoft_bonita-studio/bundles/plugins/org.bonitasoft.studio.diagram/src/org/bonitasoft/studio/model/process/diagram/part/ProcessCreationWizardPage.java
|
/*
* Copyright (C) 2009 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.model.process.diagram.part;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
/**
* @generated
*/
public class ProcessCreationWizardPage extends WizardNewFileCreationPage {
/**
* @generated
*/
private final String fileExtension;
/**
* @generated
*/
public ProcessCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
super(pageName, selection);
this.fileExtension = fileExtension;
}
/**
* Override to create files with this extension.
*
* @generated
*/
protected String getExtension() {
return fileExtension;
}
/**
* @generated
*/
public URI getURI() {
return URI.createPlatformResourceURI(getFilePath().toString(), false);
}
/**
* @generated
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
if (fileName != null) {
path = path.append(fileName);
}
return path;
}
/**
* @generated
*/
public void createControl(Composite parent) {
super.createControl(parent);
setFileName(ProcessDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
setPageComplete(validatePage());
}
/**
* @generated
*/
protected boolean validatePage() {
if (!super.validatePage()) {
return false;
}
String extension = getExtension();
if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
setErrorMessage(NLS.bind(Messages.ProcessCreationWizardPageExtensionError, extension));
return false;
}
return true;
}
}
| 2,637
|
Java
|
.java
|
bonitasoft/bonita-studio
| 79
| 43
| 1
|
2013-07-12T08:06:21Z
|
2024-05-06T13:07:47Z
|
be500b533162fc6d1efdb5a163fefee891d35269ef7470117099d81ffccfe1d6
|
[] |
[
1127,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
53,
62,
40329,
9756,
14993,
377,
51,
70,
51,
222,
338,
40329,
9756,
14993,
49,
244,
56,
54,
559,
359,
590,
695,
808,
535,
2961,
361,
449,
244,
56,
61,
53,
53,
53,
590,
1594,
926,
293,
222,
338,
1676,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
55,
51,
53,
451,
341,
1196,
49,
575,
222,
338,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
1676,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
1105,
51,
4848,
23915,
22582,
51,
13086,
51,
1184,
51,
2441,
51,
28902,
51,
2068,
64,
222,
222,
485,
1105,
51,
8327,
51,
1284,
51,
4700,
51,
78,
1233,
64,
222,
485,
1105,
51,
8327,
51,
1284,
51,
4700,
51,
1233,
64,
222,
485,
1105,
51,
8327,
51,
37246,
51,
2297,
51,
1058,
51,
6344,
64,
222,
485,
1105,
51,
8327,
51,
111,
1179,
51,
1090,
502,
51,
1309,
378,
693,
4117,
5385,
64,
222,
485,
1105,
51,
8327,
51,
30082,
51,
1058,
51,
18349,
64,
222,
485,
1105,
51,
8327,
51,
28519,
51,
12081,
51,
14377,
64,
222,
485,
1105,
51,
8327,
51,
1726,
51,
41463,
51,
22934,
1827,
991,
12614,
1983,
64,
222,
222,
1350,
222,
338,
496,
6413,
222,
588,
222,
942,
462,
6849,
12614,
22934,
1983,
2041,
42591,
1827,
991,
12614,
1983,
320,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
2072,
1175,
910,
822,
4823,
64,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
6849,
12614,
22934,
1983,
45,
671,
1957,
577,
49,
457,
30741,
5385,
7818,
49,
910,
822,
4823,
46,
320,
376,
221,
5282,
45,
1655,
577,
49,
7818,
312,
376,
221,
597,
51,
781,
4823,
299,
822,
4823,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
20667,
391,
1506,
2293,
642,
477,
5122,
51,
376,
338,
4517,
338,
496,
6413,
376,
588,
222,
221,
5332,
910,
640,
4823,
365,
320,
376,
221,
620,
822,
4823,
64,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
7417,
640,
6344,
365,
320,
376,
221,
620,
7417,
51,
1315,
6851,
2305,
6344,
45,
390,
9141,
941,
3127,
1046,
920,
312,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
5332,
457,
1233,
640,
9141,
365,
320,
376,
221,
78,
1233,
1536,
299,
640,
2894,
33589,
492,
376,
221,
344,
327,
1005,
630,
762,
46,
320,
374,
221,
1005,
299,
556,
5404,
10928,
14062,
10012,
50,
18349,
50,
54,
41,
376,
221,
130,
376,
221,
671,
11221,
299,
640,
6793,
492,
376,
221,
344,
327,
10452,
882,
762,
46,
320,
374,
221,
1005,
299,
1536,
51,
1713,
45,
10452,
312,
376,
221,
130,
376,
221,
620,
1536,
64,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
782,
1506,
2436,
45,
14377,
2952,
46,
320,
376,
221,
5282,
51,
1315,
2436,
45,
2562,
312,
376,
221,
489,
6793,
45,
2877,
24544,
4836,
1747,
51,
390,
10186,
6793,
45,
47770,
33589,
1046,
640,
6793,
1046,
640,
4823,
5086,
376,
221,
489,
1983,
7375,
45,
4647,
1983,
1052,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
5332,
1922,
6051,
1983,
365,
320,
376,
221,
344,
1445,
5282,
51,
4647,
1983,
1177,
320,
374,
221,
620,
920,
64,
376,
221,
130,
376,
221,
671,
5122,
299,
640,
4823,
492,
376,
221,
344,
327,
6749,
882,
762,
979,
673,
390,
9141,
941,
3127,
941,
20982,
459,
3128,
494,
5122,
509,
320,
374,
221,
489,
14472,
45,
18349,
51,
2555,
45,
6389,
51,
2877,
12614,
22934,
1983,
4823,
943,
49,
5122,
894,
374,
221,
620,
920,
64,
376,
221,
130,
376,
221,
620,
878,
64,
222,
221,
130,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 758
|
[
1175,
910,
822,
4823,
64,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
6849,
12614,
22934,
1983,
45,
671,
1957,
577,
49,
457,
30741,
5385,
7818,
49,
910,
822,
4823,
46,
320,
376,
221,
5282,
45,
1655,
577,
49,
7818,
312,
376,
221,
597,
51,
781,
4823,
299,
822,
4823,
64,
222,
221,
130,
499,
221,
1350,
376,
338,
20667,
391,
1506,
2293,
642,
477,
5122,
51,
376,
338,
4517,
338,
496,
6413,
376,
588,
222,
221,
5332,
910,
640,
4823,
365,
320,
376,
221,
620,
822,
4823,
64,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
7417,
640,
6344,
365,
320,
376,
221,
620,
7417,
51,
1315,
6851,
2305,
6344,
45,
390,
9141,
941,
3127,
1046,
920,
312,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
5332,
457,
1233,
640,
9141,
365,
320,
376,
221,
78,
1233,
1536,
299,
640,
2894,
33589,
492,
376,
221,
344,
327,
1005,
630,
762,
46,
320,
374,
221,
1005,
299,
556,
5404,
10928,
14062,
10012,
50,
18349,
50,
54,
41,
376,
221,
130,
376,
221,
671,
11221,
299,
640,
6793,
492,
376,
221,
344,
327,
10452,
882,
762,
46,
320,
374,
221,
1005,
299,
1536,
51,
1713,
45,
10452,
312,
376,
221,
130,
376,
221,
620,
1536,
64,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
782,
1506,
2436,
45,
14377,
2952,
46,
320,
376,
221,
5282,
51,
1315,
2436,
45,
2562,
312,
376,
221,
489,
6793,
45,
2877,
24544,
4836,
1747,
51,
390,
10186,
6793,
45,
47770,
33589,
1046,
640,
6793,
1046,
640,
4823,
5086,
376,
221,
489,
1983,
7375,
45,
4647,
1983,
1052,
222,
221,
130,
499,
221,
1350
] | 8,967,206,365,679,338,000
| true
| false
| false
| false
|
[
5332,
457,
1233,
640,
9141,
365,
320,
376,
221,
78,
1233,
1536,
299,
640,
2894,
33589,
492,
376,
221,
344,
327,
1005,
630,
762,
46,
320,
374,
221,
1005,
299,
556,
5404,
10928,
14062,
10012,
50,
18349,
50,
54,
41,
376,
221,
130,
376,
221,
671,
11221,
299,
640,
6793,
492,
376,
221,
344,
327,
10452,
882,
762,
46,
320,
374,
221,
1005,
299,
1536,
51,
1713,
45,
10452,
312,
376,
221,
130,
376,
221,
620,
1536,
64,
222,
221,
130,
499,
221,
1350,
222,
221,
47,
496,
6413,
222,
221,
1975,
222,
221,
942,
782,
1506,
2436,
45,
14377
] | -5,833,805,538,090,655,000
| true
|
final String fileExtension;
/**
* @generated
*/
public ProcessCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
super(pageName, selection);
this.fileExtension = fileExtension;
}
/**
* Override to create files with this extension.
*
* @generated
*/
protected String getExtension() {
return fileExtension;
}
/**
* @generated
*/
public URI getURI() {
return URI.createPlatformResourceURI(getFilePath().toString(), false);
}
/**
* @generated
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
if (fileName!= null) {
path = path.append(fileName);
}
return path;
}
/**
* @generated
*/
public void createControl(Composite
|
.fileExtension = fileExtension;
}
/**
* Override to create files with this extension.
*
* @generated
*/
protected String getExtension() {
return fileExtension;
}
/**
* @generated
*/
public URI getURI() {
return URI.createPlatformResourceURI(getFilePath().toString(), false);
}
/**
* @generated
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
if (fileName!= null) {
path = path.append(fileName);
}
return path;
}
/**
* @generated
*/
public void createControl(Composite
|
/**
* @generated
*/
public URI getURI() {
return URI.createPlatformResourceURI(getFilePath().toString(), false);
}
/**
* @generated
*/
protected IPath getFilePath() {
IPath path = getContainerFullPath();
if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
if (fileName!= null) {
path = path.append(fileName);
}
return path;
}
/**
* @generated
*/
public void createControl(Composite
|
protected IPath getFilePath() {
IPath path = getContainerFullPath();
if (path == null) {
path = new Path(""); //$NON-NLS-1$
}
String fileName = getFileName();
if (fileName!= null) {
path = path.append(fileName);
}
return path;
}
/**
* @generated
*/
public void createControl(Composite
|
parent) {
super.createControl(parent);
setFileName(ProcessDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
setPageComplete(validatePage());
}
/**
|
DictionaryOpenHelper.java
|
/FileExtraction/Java_unseen/ispedals_FloatingJapaneseDictionary/floatingJapaneseDictionary/src/main/java/pedals/is/floatingjapanesedictionary/dictionarysearcher/DictionaryOpenHelper.java
|
/*
* Source code Copyright 2013 Balloonguy
* This file is part of FloatingJapaneseDictionary.
FloatingJapaneseDictionary is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FloatingJapaneseDictionary is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FloatingJapaneseDictionary. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------------
The dictionary definitions include material from the JMdict (EDICT, etc.) dictionary
files in accordance with the licence provisions of the Electronic Dictionaries Research Group.
See http://www.csse.monash.edu.au/~jwb/edict.html and http://www.edrdg.org/
*/
package pedals.is.floatingjapanesedictionary.dictionarysearcher;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DictionaryOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 60;
private static final String DATABASE_NAME = "testwords.db";
public DictionaryOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dict (kanji TEXT, kana TEXT, entry TEXT);");
db.execSQL("insert into dict values('軍車','ぐんしゃ','(n) tank (military vehicle)');");
db.execSQL("insert into dict values(NULL,'どーなつ','ドーナツ /(n) doughnut/(P)/');");
db.execSQL("insert into dict values(NULL,'ちゃんばら','(n,abbr) sword fight/sword play');");
db.execSQL("insert into dict values('踞る','うずくまる','(v5r,vi,uk) to crouch/to squat/to cower/(P)');");
}
@Override
public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {
db.execSQL("DROP TABLE IF EXISTS dict;");
onCreate(db);
}
}
| 2,316
|
Java
|
.java
|
ispedals/FloatingJapaneseDictionary
| 19
| 7
| 2
|
2013-08-23T22:05:01Z
|
2017-09-18T22:24:09Z
|
71cab35c9b4377ea61e9c3ee545b309708ce0d6e0174f69f6b99a709bd4a5423
|
[] |
[
1127,
222,
338,
244,
6391,
1361,
2657,
244,
55,
53,
54,
56,
26136,
335,
805,
14007,
222,
338,
244,
1369,
822,
458,
1760,
451,
38756,
79,
30517,
7874,
51,
465,
38756,
79,
30517,
7874,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
303,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
303,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
55,
451,
341,
1196,
49,
575,
303,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
465,
38756,
79,
30517,
7874,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
303,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
303,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
303,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
465,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
303,
7979,
642,
38756,
79,
30517,
7874,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
465,
26091,
1577,
303,
906,
9575,
13190,
2323,
7053,
664,
341,
990,
82,
2734,
327,
1363,
12272,
49,
5795,
7475,
9575,
303,
2293,
347,
35997,
642,
341,
39850,
552,
17872,
451,
341,
27480,
314,
6366,
27741,
18687,
7072,
51,
303,
2819,
1930,
574,
1516,
51,
1766,
296,
51,
1231,
936,
51,
7619,
51,
4474,
25433,
111,
12205,
52,
337,
3607,
51,
935,
480,
1930,
574,
1516,
51,
337,
5344,
108,
51,
1107,
52,
1676,
588,
222,
1337,
28207,
3561,
51,
316,
51,
20702,
111,
386,
2617,
1265,
26654,
51,
11738,
1925,
284,
64,
222,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
4617,
51,
14123,
51,
25912,
3969,
64,
222,
485,
2616,
51,
4617,
51,
14123,
51,
25912,
2981,
2775,
64,
222,
222,
942,
462,
10448,
2981,
2775,
2041,
24846,
2981,
2775,
320,
499,
221,
2072,
924,
1175,
648,
26255,
100,
4539,
299,
244,
59,
53,
64,
222,
221,
2072,
924,
1175,
910,
26255,
100,
2491,
299,
332,
881,
4094,
51,
1219,
884,
499,
221,
942,
10448,
2981,
2775,
45,
1237,
1637,
46,
320,
1332,
221,
5282,
45,
1834,
49,
26255,
100,
2491,
49,
762,
49,
26255,
100,
4539,
312,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
16456,
45,
25912,
3969,
3100,
46,
320,
1332,
221,
1219,
51,
2510,
3566,
459,
1315,
1877,
5473,
327,
10646,
4459,
13421,
49,
851,
5505,
13421,
49,
3429,
13421,
312,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
482,
31603,
259,
31603,
256,
1216,
720,
262,
16282,
3950,
900,
249,
1216,
45,
115,
46,
45549,
327,
114,
47246,
18428,
34924,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
45,
3305,
1969,
20137,
2712,
6605,
14769,
1216,
11537,
5698,
256,
32947,
536,
45,
115,
46,
362,
3986,
22287,
13953,
85,
4201,
912,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
45,
3305,
1969,
28666,
900,
249,
16282,
25737,
10079,
1216,
45,
115,
49,
24313,
46,
328,
1131,
30503,
52,
120,
1131,
4677,
912,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
482,
33715,
276,
3811,
1216,
10435,
34454,
12253,
9910,
3811,
1216,
45,
123,
58,
119,
49,
4811,
49,
3434,
46,
391,
25162,
2032,
52,
471,
29644,
288,
52,
471,
300,
2139,
13953,
85,
34924,
742,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
563,
15486,
45,
25912,
3969,
3100,
49,
648,
1657,
54,
49,
648,
1657,
55,
46,
320,
1332,
221,
1219,
51,
2510,
3566,
459,
12472,
4934,
5515,
12141,
5473,
26305,
376,
221,
20217,
45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64,
222,
485,
2616,
51,
4617,
51,
14123,
51,
25912,
2981,
2775,
64,
222,
222,
942,
462,
10448,
2981,
2775,
2041,
24846,
2981,
2775,
320,
499,
221,
2072,
924,
1175,
648,
26255,
100,
4539,
299,
244,
59,
53,
64,
222,
221,
2072,
924,
1175,
910,
26255,
100,
2491,
299,
332,
881,
4094,
51,
1219,
884,
499,
221,
942,
10448,
2981,
2775,
45,
1237,
1637,
46,
320,
1332,
221,
5282,
45,
1834,
49,
26255,
100,
2491,
49,
762,
49,
26255,
100,
4539,
312,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
16456,
45,
25912,
3969,
3100,
46,
320,
1332,
221,
1219,
51,
2510,
3566,
459,
1315,
1877,
5473,
327,
10646,
4459,
13421,
49,
851,
5505,
13421,
49,
3429,
13421,
312,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
482,
31603,
259,
31603,
256,
1216,
720,
262,
16282,
3950,
900,
249,
1216,
45,
115,
46,
45549,
327,
114,
47246,
18428,
34924,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
45,
3305,
1969,
20137,
2712,
6605,
14769,
1216,
11537,
5698,
256,
32947,
536,
45,
115,
46,
362,
3986,
22287,
13953,
85,
4201,
912,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
45,
3305,
1969,
28666,
900,
249,
16282,
25737,
10079,
1216,
45,
115,
49,
24313,
46,
328,
1131,
30503,
52,
120,
1131,
4677,
912,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
482,
33715,
276,
3811,
1216,
10435,
34454,
12253,
9910,
3811,
1216
] | 2,785,603,841,915,543,000
| true
| false
| false
| false
|
[
320,
1332,
221,
1219,
51,
2510,
3566,
459,
1315,
1877,
5473,
327,
10646,
4459,
13421,
49,
851,
5505,
13421,
49,
3429,
13421,
312,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
482,
31603,
259,
31603,
256,
1216,
720,
262,
16282,
3950,
900,
249,
1216,
45,
115,
46,
45549,
327,
114,
47246,
18428,
34924,
742,
376,
221,
1219,
51,
2510,
3566,
459,
3233,
2012,
5473,
2102,
45,
3305,
1969,
20137,
2712,
6605,
14769,
1216,
11537,
5698,
256,
32947,
536,
45,
115,
46,
362,
3986,
22287,
13953,
85,
4201,
912,
742,
376,
221,
1219,
51,
2510,
3566,
459
] | -2,778,665,059,399,079,400
| true
|
html and http://www.edrdg.org/
*/
package pedals.is.floatingjapanesedictionary.dictionarysearcher;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DictionaryOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 60;
private static final String DATABASE_NAME = "testwords.db";
public DictionaryOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dict (kanji TEXT, kana TEXT, entry TEXT);");
db.execSQL("insert into dict values('軍車','ぐんしゃ','(n) tank (military vehicle)');");
db.execSQL("insert into dict values(NULL,'どーなつ','ドーナツ /(n) doughnut/(P)/');");
db.execSQL("
|
Database;
import android.database.sqlite.SQLiteOpenHelper;
public class DictionaryOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 60;
private static final String DATABASE_NAME = "testwords.db";
public DictionaryOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dict (kanji TEXT, kana TEXT, entry TEXT);");
db.execSQL("insert into dict values('軍車','ぐんしゃ','(n) tank (military vehicle)');");
db.execSQL("insert into dict values(NULL,'どーなつ','ドーナツ /(n) doughnut/(P)/');");
db.execSQL("
|
"testwords.db";
public DictionaryOpenHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dict (kanji TEXT, kana TEXT, entry TEXT);");
db.execSQL("insert into dict values('軍車','ぐんしゃ','(n) tank (military vehicle)');");
db.execSQL("insert into dict values(NULL,'どーなつ','ドーナツ /(n) doughnut/(P)/');");
db.execSQL("
|
{
db.execSQL("create table dict (kanji TEXT, kana TEXT, entry TEXT);");
db.execSQL("insert into dict values('軍車','ぐんしゃ','(n) tank (military vehicle)');");
db.execSQL("insert into dict values(NULL,'どーなつ','ドーナツ /(n) doughnut/(P)/');");
db.execSQL("
|
insert into dict values(NULL,'ちゃんばら','(n,abbr) sword fight/sword play');");
db.execSQL("insert into dict values('踞る','うずくまる','
|
TranslationManager.java
|
/FileExtraction/Java_unseen/Rubicon-Bot_Rubicon/src/main/java/fun/rubicon/core/translation/TranslationManager.java
|
/*
* Copyright (c) 2018 Rubicon Bot Development Team
* Licensed under the GPL-3.0 license.
* The full license text is available in the LICENSE file provided with this project.
*/
package fun.rubicon.core.translation;
import fun.rubicon.RubiconBot;
import fun.rubicon.core.entities.RubiconUser;
import fun.rubicon.util.Logger;
import net.dv8tion.jda.core.entities.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* Manages translation bundles.
*
* @author tr808axm
*/
public class TranslationManager {
private final List<TranslationLocale> translationLocaleList;
private final TranslationLocale defaultTranslationLocale;
public TranslationManager() {
defaultTranslationLocale = new TranslationLocale(this, new Locale("en", "US"), "English (United States)") {
@Override
public String getTranslationOrDefault(String key) {
if (getResourceBundle().containsKey(key))
return getResourceBundle().getString(key);
else {
Logger.error("TranslationLocale for '" + key + "' missing in default locale " + getLocaleCode());
return "Missing translation.";
}
}
};
List<TranslationLocale> translationLocales = new ArrayList<>();
translationLocales.add(defaultTranslationLocale);
translationLocales.add(new TranslationLocale(this, new Locale("de", "DE"), "German (Germany)"));
translationLocales.add(new TranslationLocale(this, new Locale("de", "AT"), "German (Austria)"));
translationLocales.add(new TranslationLocale(this, new Locale("en", "US"), "English (America)"));
translationLocales.add(new TranslationLocale(this, new Locale("es", "ES"), "Spanish (Spain)"));
translationLocales.add(new TranslationLocale(this, new Locale("fi", "FI"), "Finnish (Finland)"));
translationLocales.add(new TranslationLocale(this, new Locale("fr", "FR"), "French (France)"));
translationLocales.add(new TranslationLocale(this, new Locale("hu", "HU"), "Hungarian (Hungary)"));
translationLocales.add(new TranslationLocale(this, new Locale("it", "IT"), "Italian (Italy)"));
translationLocales.add(new TranslationLocale(this, new Locale("no", "NO"), "Norwegian (Norway)"));
translationLocales.add(new TranslationLocale(this, new Locale("pt", "BR"), "Portuguese (Brasilia)"));
translationLocales.add(new TranslationLocale(this, new Locale("pt", "PT"), "Portuguese (Portugal)"));
translationLocaleList = Collections.unmodifiableList(translationLocales);
RubiconBot.getCommandManager().registerCommandHandler(new LanguageCommandHandler(this));
}
public TranslationLocale getDefaultTranslationLocale() {
return defaultTranslationLocale;
}
public TranslationLocale getTranslationLocaleByLocale(Locale locale) {
for (TranslationLocale translationLocale : translationLocaleList)
if (translationLocale.getLocale().equals(locale))
return translationLocale;
return null;
}
public TranslationLocale getTranslationLocaleByLocaleOrDefault(Locale locale) {
TranslationLocale found = getTranslationLocaleByLocale(locale);
return found == null ? defaultTranslationLocale : found;
}
public TranslationLocale getUserLocale(User user) {
String languageTag = RubiconUser.fromUser(user).getLanguage();
try {
Locale locale = Locale.forLanguageTag(languageTag);
TranslationLocale translationLocale = getTranslationLocaleByLocale(locale);
translationLocale.getResourceBundle();
return getTranslationLocaleByLocale(locale);
} catch (Exception ex) {
return defaultTranslationLocale;
}
}
public List<TranslationLocale> getLocales() {
return translationLocaleList;
}
}
| 3,997
|
Java
|
.java
|
Rubicon-Bot/Rubicon
| 13
| 8
| 3
|
2017-11-16T17:27:31Z
|
2018-07-10T18:30:27Z
|
09373f44562e677f9b0d67bb85c26a74330a4197e5ce99a15a1f3c82c1f5d5a7
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
54,
61,
244,
44865,
1584,
17099,
15606,
12653,
222,
338,
4773,
1549,
341,
23508,
50,
56,
51,
53,
3553,
51,
222,
338,
906,
3559,
3553,
1367,
458,
3322,
347,
341,
7621,
822,
3961,
642,
477,
2091,
51,
222,
588,
222,
222,
1337,
3350,
51,
20761,
1584,
51,
1284,
51,
7521,
64,
222,
222,
485,
3350,
51,
20761,
1584,
51,
39339,
1584,
9037,
64,
222,
485,
3350,
51,
20761,
1584,
51,
1284,
51,
9259,
51,
39339,
1584,
1259,
64,
222,
485,
3350,
51,
20761,
1584,
51,
1058,
51,
3716,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1284,
51,
9259,
51,
1259,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
222,
1350,
222,
338,
4795,
8541,
13194,
36461,
51,
222,
338,
222,
338,
496,
2133,
573,
61,
53,
61,
668,
114,
222,
588,
222,
942,
462,
27307,
1590,
320,
303,
964,
1175,
1701,
65,
12687,
9459,
67,
13194,
9459,
739,
64,
303,
964,
1175,
27307,
9459,
1263,
12687,
9459,
64,
465,
581,
27307,
1590,
365,
320,
310,
1263,
12687,
9459,
299,
556,
27307,
9459,
45,
597,
49,
556,
23239,
459,
291,
411,
332,
2062,
2132,
332,
23543,
327,
28713,
18607,
14589,
320,
343,
496,
1806,
343,
581,
910,
640,
12687,
13637,
45,
671,
1221,
46,
320,
419,
434,
327,
17633,
4775,
941,
15927,
45,
697,
509,
547,
461,
42083,
4775,
941,
7080,
45,
697,
312,
419,
832,
320,
547,
7145,
51,
750,
459,
12687,
9459,
456,
6121,
494,
1221,
494,
5343,
5839,
347,
1263,
11262,
332,
494,
640,
9459,
1241,
1052,
547,
461,
332,
9095,
13194,
12984,
419,
339,
343,
339,
310,
1487,
310,
1701,
65,
12687,
9459,
67,
13194,
45251,
299,
556,
5068,
6984,
310,
13194,
45251,
51,
688,
45,
1555,
12687,
9459,
312,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
305,
411,
332,
869,
2132,
332,
24013,
1607,
327,
24013,
11412,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
305,
411,
332,
741,
2132,
332,
24013,
1607,
327,
70,
695,
13597,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
291,
411,
332,
2062,
2132,
332,
23543,
327,
29501,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
326,
411,
332,
959,
2132,
332,
6492,
1729,
327,
2184,
524,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
5517,
411,
332,
1836,
2132,
332,
5387,
44998,
327,
5387,
6836,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
2197,
411,
332,
4016,
2132,
332,
75,
20183,
327,
6089,
743,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
8290,
411,
332,
22532,
2132,
332,
77,
3292,
36303,
327,
77,
3292,
692,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
302,
411,
332,
799,
2132,
332,
1029,
34862,
327,
1029,
3282,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
1365,
411,
332,
2593,
2132,
332,
31501,
1399,
108,
2560,
327,
31501,
3094,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
404,
411,
332,
4768,
2132,
332,
3451,
905,
359,
296,
327,
4364,
321,
36351,
46,
2992,
310,
13194,
45251,
51,
688,
45,
909,
27307,
9459,
45,
597,
49,
556,
23239,
459,
404,
411,
332,
3674,
2132,
332,
3451,
905,
359,
296,
327,
3451,
46482,
46,
2992,
310,
13194,
9459,
739,
299,
15490,
51,
40234,
739,
45,
7521,
45251,
312,
603,
44865,
1584,
9037,
51,
390,
2037,
1590,
941,
3334,
43612,
45,
909,
6638,
43612,
45,
597,
894,
303,
339,
465,
581,
27307,
9459,
23916,
12687,
9459,
365,
320,
310,
461,
1263,
12687,
9459,
64,
303,
339,
465,
581,
27307,
9459,
640,
12687,
9459,
1103,
9459,
45,
9459,
11262,
46,
320,
310,
456,
327,
12687,
9459,
13194,
9459,
518,
13194,
9459,
739,
46,
343,
434,
327,
7521,
9459,
51,
46090,
941,
3591,
45,
6925,
509,
419,
461,
13194,
9459,
64,
310,
461,
762,
64,
303,
339,
465,
581,
27307,
9459,
640,
12687,
9459,
1103,
9459,
13637,
45,
9459,
11262,
46,
320,
310,
27307,
9459,
2448,
299,
640,
12687,
9459,
1103,
9459,
45,
6925,
312,
310,
461,
2448,
630,
762,
1037,
1263,
12687,
9459,
518,
2448,
64,
303,
339,
465,
581,
27307,
9459,
18868,
9459,
45,
1259,
1275,
46,
320,
310,
910,
2940,
2649,
299,
44865,
1584,
1259,
51,
1097,
1259,
45,
514,
566,
390,
5980,
492,
310,
1614,
320,
343,
23239,
11262,
299,
23239,
51,
999,
5980,
2649,
45,
4210,
2649,
312,
343,
27307,
9459,
13194,
9459,
299,
640,
12687,
9459,
1103,
9459,
45,
6925,
312,
343,
13194,
9459,
51,
17633,
4775,
492,
343,
461,
640,
12687,
9459,
1103,
9459,
45,
6925,
312,
310,
339,
2385,
327,
1002,
557,
46,
320,
343,
461,
1263,
12687,
9459,
64,
310,
339,
303,
339,
465,
581,
1701,
65,
12687,
9459,
67,
640,
45251,
365,
320,
310,
461,
13194,
9459,
739,
64,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 897
|
[
244,
55,
53,
54,
61,
244,
44865,
1584,
17099,
15606,
12653,
222,
338,
4773,
1549,
341,
23508,
50,
56,
51,
53,
3553,
51,
222,
338,
906,
3559,
3553,
1367,
458,
3322,
347,
341,
7621,
822,
3961,
642,
477,
2091,
51,
222,
588,
222,
222,
1337,
3350,
51,
20761,
1584,
51,
1284,
51,
7521,
64,
222,
222,
485,
3350,
51,
20761,
1584,
51,
39339,
1584,
9037,
64,
222,
485,
3350,
51,
20761,
1584,
51,
1284,
51,
9259,
51,
39339,
1584,
1259,
64,
222,
485,
3350,
51,
20761,
1584,
51,
1058,
51,
3716,
64,
222,
485,
3723,
51,
8698,
61,
9106,
51,
111,
1830,
51,
1284,
51,
9259,
51,
1259,
64,
222,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
485,
1401,
51,
1058,
51,
4293,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
222,
1350,
222,
338,
4795,
8541,
13194,
36461,
51,
222,
338,
222,
338,
496,
2133,
573,
61,
53,
61,
668,
114,
222,
588,
222,
942,
462,
27307,
1590,
320,
303,
964,
1175,
1701,
65,
12687,
9459,
67,
13194,
9459,
739,
64,
303,
964,
1175,
27307,
9459,
1263,
12687,
9459,
64,
465,
581,
27307,
1590,
365,
320,
310,
1263,
12687,
9459,
299,
556,
27307,
9459,
45,
597,
49,
556,
23239,
459,
291,
411,
332,
2062,
2132,
332,
23543,
327,
28713,
18607,
14589,
320,
343,
496,
1806,
343,
581,
910,
640,
12687,
13637,
45,
671,
1221,
46,
320,
419,
434,
327,
17633,
4775,
941,
15927,
45,
697,
509,
547,
461,
42083,
4775,
941,
7080,
45,
697,
312,
419,
832,
320,
547,
7145,
51,
750,
459,
12687,
9459,
456,
6121,
494,
1221,
494,
5343,
5839,
347,
1263,
11262,
332,
494,
640,
9459,
1241,
1052,
547,
461,
332,
9095,
13194,
12984,
419,
339,
343,
339,
310,
1487,
310,
1701,
65,
12687
] | 5,251,922,796,425,263,000
| true
| false
| false
| false
|
[
36461,
51,
222,
338,
222,
338,
496,
2133,
573,
61,
53,
61,
668,
114,
222,
588,
222,
942,
462,
27307,
1590,
320,
303,
964,
1175,
1701,
65,
12687,
9459,
67,
13194,
9459,
739,
64,
303,
964,
1175,
27307,
9459,
1263,
12687,
9459,
64,
465,
581,
27307,
1590,
365,
320,
310,
1263,
12687,
9459,
299,
556,
27307,
9459,
45,
597,
49,
556,
23239,
459,
291,
411,
332,
2062,
2132,
332,
23543,
327,
28713,
18607,
14589,
320,
343,
496,
1806,
343,
581,
910,
640,
12687,
13637,
45,
671,
1221,
46,
320,
419,
434,
327,
17633,
4775,
941,
15927,
45,
697,
509,
547
] | 242,427,291,195,456,640
| true
|
2018 Rubicon Bot Development Team
* Licensed under the GPL-3.0 license.
* The full license text is available in the LICENSE file provided with this project.
*/
package fun.rubicon.core.translation;
import fun.rubicon.RubiconBot;
import fun.rubicon.core.entities.RubiconUser;
import fun.rubicon.util.Logger;
import net.dv8tion.jda.core.entities.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* Manages translation bundles.
*
* @author tr808axm
*/
public class TranslationManager {
private final List<TranslationLocale> translationLocaleList;
private final TranslationLocale defaultTranslationLocale;
public TranslationManager() {
defaultTranslationLocale = new TranslationLocale(this, new Locale("en", "US"), "English (United States)") {
@Override
public String getTranslationOrDefault(String key) {
if (getResourceBundle().containsKey(key))
|
core.translation;
import fun.rubicon.RubiconBot;
import fun.rubicon.core.entities.RubiconUser;
import fun.rubicon.util.Logger;
import net.dv8tion.jda.core.entities.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* Manages translation bundles.
*
* @author tr808axm
*/
public class TranslationManager {
private final List<TranslationLocale> translationLocaleList;
private final TranslationLocale defaultTranslationLocale;
public TranslationManager() {
defaultTranslationLocale = new TranslationLocale(this, new Locale("en", "US"), "English (United States)") {
@Override
public String getTranslationOrDefault(String key) {
if (getResourceBundle().containsKey(key))
|
jda.core.entities.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
/**
* Manages translation bundles.
*
* @author tr808axm
*/
public class TranslationManager {
private final List<TranslationLocale> translationLocaleList;
private final TranslationLocale defaultTranslationLocale;
public TranslationManager() {
defaultTranslationLocale = new TranslationLocale(this, new Locale("en", "US"), "English (United States)") {
@Override
public String getTranslationOrDefault(String key) {
if (getResourceBundle().containsKey(key))
|
bundles.
*
* @author tr808axm
*/
public class TranslationManager {
private final List<TranslationLocale> translationLocaleList;
private final TranslationLocale defaultTranslationLocale;
public TranslationManager() {
defaultTranslationLocale = new TranslationLocale(this, new Locale("en", "US"), "English (United States)") {
@Override
public String getTranslationOrDefault(String key) {
if (getResourceBundle().containsKey(key))
|
return getResourceBundle().getString(key);
else {
Logger.error("TranslationLocale for '" + key + "' missing in default locale " + getLocaleCode());
return "Missing translation.";
}
}
};
List<Translation
|
CATWrapper.java
|
/FileExtraction/Java_unseen/hltfbk_CROMER/src/eu/fbk/textpro/wrapper/CATWrapper.java
|
package eu.fbk.textpro.wrapper;
import java.io.*;
/**
* Created by IntelliJ IDEA.
* User: cgirardi
* Date: 21/12/13
* Time: 10.06
*/
public class CATWrapper {
private String tokens;
private String sessionid;
private byte[] page;
public CATWrapper(String sessionid) {
this.sessionid = sessionid;
}
public void analyze(String text, String lang) {
StringBuffer tokens = new StringBuffer();
File rawtextfile = new File("/tmp/" + sessionid + ".txt");
OutputStreamWriter tokfile = null;
try {
int tokenstart = 0;
String[] lines = text.split("\n");
tokfile = new OutputStreamWriter(new FileOutputStream(rawtextfile.getCanonicalPath() + ".tok"), "UTF8");
tokfile.write("# FILE: \n# FIELDS: token\ttokenstart\n");
int sentence = 1;
for( String line : lines) {
if (line.matches("<token t?_?id=.*</token>")) {
String token = line.replaceFirst("<\\/token>","").replaceFirst("<token t?_?id=.+>","");
//System.err.println(token+"\t"+tokenstart);
if (line.contains(" sentence=\""+ sentence +"\"") ) {
tokfile.write("\n");
sentence++;
}
tokfile.write(token+"\t"+tokenstart+"\n");
tokenstart = tokenstart + token.length()+1;
if (token.length() > 1 ||
(token.length() == 1 && Character.isLetterOrDigit(token.charAt(0)))) {
tokens.append(" ").append(token.toLowerCase());
} else {
tokens.append(" #");
}
}
}
tokfile.close();
FileInputStream in = new FileInputStream(new File(rawtextfile.getCanonicalPath() + ".tok"));
page = new byte[in.available()];
DataInputStream datain = new DataInputStream (in);
datain.readFully (page);
datain.close ();
//System.err.println("PAGE: " + new String(page, "UTF8"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
this.tokens = tokens.toString().replaceAll("( #)+"," #").trim();
}
public String getTokens() {
return tokens;
}
public String getTxpFile() throws UnsupportedEncodingException {
//System.err.println("PAGE: " + new String(page, "UTF8"));
return new String(page, "UTF8");
}
}
| 2,731
|
Java
|
.java
|
hltfbk/CROMER
| 9
| 1
| 1
|
2013-10-24T06:36:06Z
|
2015-01-14T10:03:21Z
|
4d271ac9a4e190f2d761693cb3ede96a32a4f724666e01b7e813b6e3a6043ef1
|
[] |
[
1337,
14604,
51,
4365,
112,
51,
897,
529,
51,
5106,
64,
222,
222,
485,
1401,
51,
735,
7737,
222,
222,
1350,
222,
338,
6956,
829,
46017,
47468,
51,
222,
338,
2694,
63,
21901,
495,
723,
110,
222,
338,
2833,
63,
244,
55,
54,
52,
54,
55,
52,
54,
56,
222,
338,
3734,
63,
244,
54,
53,
51,
53,
59,
222,
588,
222,
942,
462,
27615,
4687,
320,
303,
964,
910,
7960,
64,
303,
964,
910,
3541,
333,
64,
303,
964,
3447,
1197,
1957,
64,
4054,
581,
27615,
4687,
45,
671,
3541,
333,
46,
320,
310,
477,
51,
2867,
333,
299,
3541,
333,
64,
303,
339,
465,
581,
782,
23024,
45,
671,
1367,
49,
910,
7285,
46,
320,
310,
21917,
7960,
299,
556,
21917,
492,
310,
2050,
5096,
897,
781,
299,
556,
2050,
4229,
2887,
5694,
494,
3541,
333,
494,
4956,
2787,
742,
310,
35998,
3989,
20029,
781,
299,
762,
64,
310,
1614,
320,
343,
648,
2421,
1384,
299,
244,
53,
64,
343,
910,
1197,
5452,
299,
1367,
51,
3045,
5564,
115,
742,
343,
20029,
781,
299,
556,
35998,
3989,
45,
909,
37000,
45,
1312,
897,
781,
51,
47905,
1233,
365,
494,
4956,
13628,
2132,
332,
6266,
61,
742,
343,
20029,
781,
51,
1838,
4139,
10961,
63,
788,
115,
40,
16922,
25888,
63,
2421,
97,
121,
1977,
1384,
97,
115,
742,
1819,
648,
15492,
299,
244,
54,
64,
343,
456,
45,
910,
1646,
518,
5452,
46,
320,
419,
434,
327,
948,
51,
8936,
10379,
1977,
292,
68,
100,
68,
333,
66,
3440,
396,
1977,
67,
2152,
320,
547,
910,
2421,
299,
1646,
51,
3249,
3485,
10379,
30098,
1977,
9603,
1033,
566,
3249,
3485,
10379,
1977,
292,
68,
100,
68,
333,
23136,
48,
67,
1479,
742,
547,
453,
1615,
51,
549,
51,
3962,
45,
1977,
44043,
121,
5141,
1977,
1384,
312,
547,
434,
327,
948,
51,
4766,
459,
15492,
29633,
48,
15492,
34552,
1508,
678,
848,
320,
733,
20029,
781,
51,
1838,
5564,
115,
742,
733,
15492,
3348,
547,
339,
547,
20029,
781,
51,
1838,
45,
1977,
44043,
121,
5141,
1977,
1384,
44043,
115,
742,
3704,
2421,
1384,
299,
2421,
1384,
494,
2421,
51,
1340,
19218,
54,
64,
547,
434,
327,
1977,
51,
1340,
365,
868,
244,
54,
1293,
1031,
327,
1977,
51,
1340,
365,
630,
244,
54,
979,
15045,
51,
316,
17658,
1543,
21521,
45,
1977,
51,
15602,
45,
53,
7775,
320,
733,
7960,
51,
1713,
459,
18267,
1713,
45,
1977,
51,
10498,
1052,
547,
339,
832,
320,
733,
7960,
51,
1713,
459,
607,
742,
547,
339,
419,
339,
343,
339,
343,
20029,
781,
51,
2698,
492,
1083,
34075,
347,
299,
556,
34075,
45,
909,
2050,
45,
1312,
897,
781,
51,
47905,
1233,
365,
494,
4956,
13628,
2992,
343,
1957,
299,
556,
3447,
96,
285,
51,
7249,
22061,
343,
2426,
6989,
727,
285,
299,
556,
2426,
6989,
327,
285,
312,
343,
727,
285,
51,
870,
32250,
327,
1655,
312,
343,
727,
285,
51,
2698,
8840,
343,
453,
1615,
51,
549,
51,
3962,
459,
12913,
63,
332,
494,
556,
910,
45,
1655,
49,
332,
6266,
61,
2992,
603,
339,
2385,
327,
27322,
503,
46,
320,
343,
503,
51,
9428,
492,
310,
339,
2385,
327,
16737,
42302,
503,
46,
320,
343,
503,
51,
9428,
492,
310,
339,
2385,
327,
6860,
503,
46,
320,
343,
503,
51,
9428,
492,
310,
339,
310,
477,
51,
8433,
299,
7960,
51,
3127,
941,
23355,
21858,
607,
7308,
1479,
607,
1912,
5475,
492,
303,
339,
465,
581,
910,
640,
10915,
365,
320,
310,
461,
7960,
64,
303,
339,
465,
581,
910,
640,
6739,
117,
991,
365,
2589,
18082,
42302,
320,
310,
453,
1615,
51,
549,
51,
3962,
459,
12913,
63,
332,
494,
556,
910,
45,
1655,
49,
332,
6266,
61,
2992,
310,
461,
556,
910,
45,
1655,
49,
332,
6266,
61,
742,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 629
|
[
723,
110,
222,
338,
2833,
63,
244,
55,
54,
52,
54,
55,
52,
54,
56,
222,
338,
3734,
63,
244,
54,
53,
51,
53,
59,
222,
588,
222,
942,
462,
27615,
4687,
320,
303,
964,
910,
7960,
64,
303,
964,
910,
3541,
333,
64,
303,
964,
3447,
1197,
1957,
64,
4054,
581,
27615,
4687,
45,
671,
3541,
333,
46,
320,
310,
477,
51,
2867,
333,
299,
3541,
333,
64,
303,
339,
465,
581,
782,
23024,
45,
671,
1367,
49,
910,
7285,
46,
320,
310,
21917,
7960,
299,
556,
21917,
492,
310,
2050,
5096,
897,
781,
299,
556,
2050,
4229,
2887,
5694,
494,
3541,
333,
494,
4956,
2787,
742,
310,
35998,
3989,
20029,
781,
299,
762,
64,
310,
1614,
320,
343,
648,
2421,
1384,
299,
244,
53,
64,
343,
910,
1197,
5452,
299,
1367,
51,
3045,
5564,
115,
742,
343,
20029,
781,
299,
556,
35998,
3989,
45,
909,
37000,
45,
1312,
897,
781,
51,
47905,
1233,
365,
494,
4956,
13628,
2132,
332,
6266,
61,
742,
343,
20029,
781,
51,
1838,
4139,
10961,
63,
788,
115,
40,
16922,
25888,
63,
2421,
97,
121,
1977,
1384,
97,
115,
742,
1819,
648,
15492,
299,
244,
54,
64,
343,
456,
45,
910,
1646,
518,
5452,
46,
320,
419,
434,
327,
948,
51,
8936,
10379,
1977,
292,
68,
100,
68,
333,
66,
3440,
396,
1977,
67,
2152,
320,
547,
910,
2421,
299,
1646,
51,
3249,
3485,
10379,
30098,
1977,
9603,
1033,
566,
3249,
3485,
10379,
1977,
292,
68,
100,
68,
333,
23136,
48,
67,
1479,
742,
547,
453,
1615,
51,
549,
51,
3962,
45,
1977,
44043,
121,
5141,
1977,
1384,
312,
547,
434,
327,
948,
51,
4766,
459,
15492,
29633,
48,
15492,
34552,
1508,
678,
848,
320,
733,
20029,
781,
51,
1838,
5564,
115,
742,
733,
15492,
3348,
547,
339,
547,
20029,
781,
51,
1838,
45
] | 3,337,507,733,371,386,000
| true
| false
| false
| false
|
[
897,
781,
51,
47905,
1233,
365,
494,
4956,
13628,
2132,
332,
6266,
61,
742,
343,
20029,
781,
51,
1838,
4139,
10961,
63,
788,
115,
40,
16922,
25888,
63,
2421,
97,
121,
1977,
1384,
97,
115,
742,
1819,
648,
15492,
299,
244,
54,
64,
343,
456,
45,
910,
1646,
518,
5452,
46,
320,
419,
434,
327,
948,
51,
8936,
10379,
1977,
292,
68,
100,
68,
333,
66,
3440,
396,
1977,
67,
2152,
320,
547,
910,
2421,
299,
1646,
51,
3249,
3485,
10379,
30098,
1977,
9603,
1033,
566,
3249,
3485,
10379,
1977,
292,
68,
100,
68,
333,
23136,
48,
67,
1479,
742
] | -2,736,134,611,054,992,400
| true
|
ardi
* Date: 21/12/13
* Time: 10.06
*/
public class CATWrapper {
private String tokens;
private String sessionid;
private byte[] page;
public CATWrapper(String sessionid) {
this.sessionid = sessionid;
}
public void analyze(String text, String lang) {
StringBuffer tokens = new StringBuffer();
File rawtextfile = new File("/tmp/" + sessionid + ".txt");
OutputStreamWriter tokfile = null;
try {
int tokenstart = 0;
String[] lines = text.split("\n");
tokfile = new OutputStreamWriter(new FileOutputStream(rawtextfile.getCanonicalPath() + ".tok"), "UTF8");
tokfile.write("# FILE: \n# FIELDS: token\ttokenstart\n");
int sentence = 1;
for( String line : lines) {
if (line.matches("<token t?_?id=.*</token>")) {
String token = line.replaceFirst("<\\/token>","").replaceFirst("<token t?_?id=.+>","");
|
public CATWrapper(String sessionid) {
this.sessionid = sessionid;
}
public void analyze(String text, String lang) {
StringBuffer tokens = new StringBuffer();
File rawtextfile = new File("/tmp/" + sessionid + ".txt");
OutputStreamWriter tokfile = null;
try {
int tokenstart = 0;
String[] lines = text.split("\n");
tokfile = new OutputStreamWriter(new FileOutputStream(rawtextfile.getCanonicalPath() + ".tok"), "UTF8");
tokfile.write("# FILE: \n# FIELDS: token\ttokenstart\n");
int sentence = 1;
for( String line : lines) {
if (line.matches("<token t?_?id=.*</token>")) {
String token = line.replaceFirst("<\\/token>","").replaceFirst("<token t?_?id=.+>","");
|
/" + sessionid + ".txt");
OutputStreamWriter tokfile = null;
try {
int tokenstart = 0;
String[] lines = text.split("\n");
tokfile = new OutputStreamWriter(new FileOutputStream(rawtextfile.getCanonicalPath() + ".tok"), "UTF8");
tokfile.write("# FILE: \n# FIELDS: token\ttokenstart\n");
int sentence = 1;
for( String line : lines) {
if (line.matches("<token t?_?id=.*</token>")) {
String token = line.replaceFirst("<\\/token>","").replaceFirst("<token t?_?id=.+>","");
|
textfile.getCanonicalPath() + ".tok"), "UTF8");
tokfile.write("# FILE: \n# FIELDS: token\ttokenstart\n");
int sentence = 1;
for( String line : lines) {
if (line.matches("<token t?_?id=.*</token>")) {
String token = line.replaceFirst("<\\/token>","").replaceFirst("<token t?_?id=.+>","");
|
//System.err.println(token+"\t"+tokenstart);
if (line.contains(" sentence=\""+ sentence +"\"") ) {
tokfile.write("\n");
sentence++;
}
tokfile.write(
|
UcpAttribute.java
|
/FileExtraction/Java_unseen/ericsson-mts_mts/src/main/java/com/devoteam/srit/xmlloader/ucp/data/UcpAttribute.java
|
/*
* Copyright 2012 Devoteam http://www.devoteam.com
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This file is part of Multi-Protocol Test Suite (MTS).
*
* Multi-Protocol Test Suite (MTS) is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the
* License.
*
* Multi-Protocol Test Suite (MTS) is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Multi-Protocol Test Suite (MTS).
* If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.devoteam.srit.xmlloader.ucp.data;
import com.devoteam.srit.xmlloader.core.utils.dictionaryElement.Attribute;
import com.devoteam.srit.xmlloader.core.utils.gsm.GSMConversion;
import gp.utils.arrays.*;
import java.util.Vector;
/**
*
* @author Benjamin Bouvier
*/
public class UcpAttribute extends Attribute
{
public UcpAttribute()
{}
@Override
public void setValue(Object value) throws Exception {
this.value = value;
value_q = true;
}
@Override
public Array getArray() throws Exception
{
SupArray array = new SupArray();
if(getValueQuality())
{
if(getValue() instanceof Vector)//for imbricate attribute or list of xser
{
UcpAttribute att = null;
for(int i = 0; i < ((Vector<UcpAttribute>)getValue()).size(); i++)
{
att = ((Vector<UcpAttribute>)getValue()).get(i);
array.addLast(att.getArray());
//NO NEED to add SEP here, because for imbricate att, added just after each att value
}
if(att instanceof UcpXser)
{
array.addLast(UcpMessage.SEP);
}
}
else if(getValue() instanceof String)
{
String byteStr = new String(((String)getValue()).getBytes());
byteStr = new String(GSMConversion.toGsmCharset(byteStr));
if((getFormat() != null) && getFormat().equalsIgnoreCase("encodedString"))
{
array.addLast(new DefaultArray(
DefaultArray.toHexString(
new DefaultArray(byteStr.getBytes())).toUpperCase()
.getBytes()));
}
else
{
array.addLast(new DefaultArray(byteStr.getBytes()));
}
array.addLast(UcpMessage.SEP);
}
}
return array;
}
@Override
public UcpAttribute clone()
{
UcpAttribute clone = new UcpAttribute();
clone.setName(getName());
clone.setFormat(getFormat());
clone.setLength(getLength());
clone.setMandatory(isMandatory());
clone.setOccurenceAttribute(getOccurenceAttribute());
clone.setNotApplicable(getNotApplicable());
if(getValueQuality())
{
if(getValue() instanceof Vector)
{
try {
clone.setValue(new Vector<UcpAttribute>());
}
catch (Exception ex)
{}
for(int i = 0; i < ((Vector)getValue()).size(); i++)
{
((Vector<UcpAttribute>)clone.getValue()).add(((Vector<UcpAttribute>)getValue()).get(i));
}
}
}
return clone;
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append("Attribute: ").append(name);// + ", format " + format + ", length " + length;
if(isMandatory())
{
str.append(", mandatory ");
}
if(occurenceAttribute != null)
{
str.append(" , occurence attribute ").append(occurenceAttribute);// + ", occurence " + occurence;
}
if(getValueQuality())
{
str.append(", value ");
if(getValue() instanceof Vector)
str.append("\r\n");
str.append(getValue());
}
if((str.charAt(str.length()-1) != '\n') && (str.charAt(str.length()-2) != '\r'))
str.append("\r\n");
return str.toString();
}
}
| 4,704
|
Java
|
.java
|
ericsson-mts/mts
| 61
| 38
| 34
|
2017-12-11T20:00:25Z
|
2023-11-02T17:32:18Z
|
468963e9232aeceaf2d2bb5092d05a489348ba1a57e7f3ab1b7c2abc32ecb36d
|
[] |
[
1127,
1676,
338,
2657,
244,
55,
53,
54,
55,
12798,
1721,
424,
1930,
574,
1516,
51,
1920,
1721,
424,
51,
527,
222,
338,
4103,
2387,
23740,
1895,
35234,
8995,
2387,
11988,
1895,
8968,
10961,
30441,
51,
222,
338,
1676,
338,
1676,
338,
1369,
822,
458,
1760,
451,
10497,
50,
5519,
2128,
25280,
327,
3911,
88,
566,
222,
338,
1676,
338,
10497,
50,
5519,
2128,
25280,
327,
3911,
88,
46,
458,
3760,
2951,
63,
863,
902,
14081,
222,
338,
580,
480,
52,
290,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
222,
338,
1196,
51,
222,
338,
1676,
338,
10497,
50,
5519,
2128,
25280,
327,
3911,
88,
46,
458,
2744,
347,
341,
9850,
708,
580,
1118,
222,
338,
545,
6386,
49,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
1676,
338,
451,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
1676,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
10497,
50,
5519,
2128,
25280,
327,
3911,
88,
566,
222,
338,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
338,
1676,
588,
222,
222,
1337,
785,
51,
1920,
1721,
424,
51,
120,
1204,
51,
2608,
4579,
51,
1027,
117,
51,
624,
64,
222,
222,
485,
785,
51,
1920,
1721,
424,
51,
120,
1204,
51,
2608,
4579,
51,
1284,
51,
2324,
51,
11738,
1325,
51,
2230,
64,
222,
485,
785,
51,
1920,
1721,
424,
51,
120,
1204,
51,
2608,
4579,
51,
1284,
51,
2324,
51,
108,
1752,
51,
76,
5632,
14346,
64,
222,
485,
15612,
51,
2324,
51,
23694,
7737,
222,
485,
1401,
51,
1058,
51,
2880,
64,
222,
222,
1350,
222,
338,
222,
338,
496,
2133,
17669,
39168,
570,
663,
123,
2506,
222,
588,
222,
942,
462,
650,
2217,
2230,
2041,
9958,
222,
128,
40391,
581,
650,
2217,
2230,
365,
303,
2172,
19530,
496,
1806,
303,
581,
782,
27609,
45,
976,
804,
46,
2589,
3284,
320,
310,
477,
51,
872,
299,
804,
64,
310,
804,
100,
118,
299,
878,
64,
303,
339,
2205,
496,
1806,
303,
581,
2647,
640,
1280,
365,
2589,
3284,
303,
320,
310,
14668,
1280,
1437,
299,
556,
14668,
1280,
492,
603,
434,
45,
6693,
15555,
1177,
310,
320,
343,
434,
45,
6693,
365,
5118,
4126,
32563,
999,
3987,
858,
7332,
3895,
575,
1168,
451,
837,
528,
343,
320,
419,
650,
2217,
2230,
3725,
299,
762,
64,
419,
456,
45,
429,
613,
299,
244,
53,
64,
613,
350,
1849,
2880,
65,
90,
2217,
2230,
5111,
6693,
4269,
911,
492,
613,
2002,
419,
320,
547,
3725,
299,
1849,
2880,
65,
90,
2217,
2230,
5111,
6693,
4269,
390,
45,
110,
312,
547,
1437,
51,
688,
3283,
45,
3150,
51,
390,
1280,
1052,
547,
453,
2593,
8949,
1363,
391,
1035,
5508,
85,
2464,
49,
3318,
456,
3987,
858,
7332,
3725,
49,
3654,
2277,
2703,
2531,
3725,
804,
419,
339,
12949,
434,
45,
3150,
5118,
650,
2217,
93,
528,
46,
419,
320,
547,
1437,
51,
688,
3283,
45,
90,
2217,
1193,
51,
40038,
312,
419,
339,
343,
339,
343,
832,
434,
45,
6693,
365,
5118,
910,
46,
343,
320,
419,
910,
3447,
2026,
299,
556,
910,
7738,
671,
46,
6693,
4269,
19682,
1052,
419,
3447,
2026,
299,
556,
910,
45,
76,
5632,
14346,
51,
471,
76,
1752,
26052,
45,
2278,
2026,
894,
2125,
434,
1181,
390,
2222,
365,
882,
762,
46,
979,
640,
2222,
941,
18993,
459,
12631,
671,
2152,
419,
320,
547,
1437,
51,
688,
3283,
45,
909,
4119,
1280,
45,
733,
4119,
1280,
51,
471,
33075,
45,
1031,
556,
4119,
1280,
45,
2278,
2026,
51,
19682,
22293,
18068,
365,
733,
657,
19682,
5086,
419,
339,
419,
832,
419,
320,
547,
1437,
51,
688,
3283,
45,
909,
4119,
1280,
45,
2278,
2026,
51,
19682,
5086,
419,
339,
419,
1437,
51,
688,
3283,
45,
90,
2217,
1193,
51,
40038,
312,
343,
339,
310,
339,
2776,
461,
1437,
64,
303,
339,
465,
496,
1806,
303,
581,
650,
2217,
2230,
7905,
365,
303,
320,
310,
650,
2217,
2230,
7905,
299,
556,
650,
2217,
2230,
492,
603,
7905,
51,
15779,
45,
5175,
1052,
310,
7905,
51,
489,
2222,
45,
390,
2222,
1052,
310,
7905,
51,
489,
2396,
45,
30031,
1052,
310,
7905,
51,
489,
21764,
45,
316,
21764,
1052,
310,
7905,
51,
489,
11352,
27236,
388,
2230,
45,
390,
11352,
27236,
388,
2230,
1052,
310,
7905,
51,
489,
1355,
45738,
45,
390,
1355,
45738,
1052,
2776,
434,
45,
6693,
15555,
1177,
310,
320,
343,
434,
45,
6693,
365,
5118,
4126,
46,
343,
320,
419,
1614,
320,
547,
7905,
51,
11534,
45,
909,
4126,
65,
90,
2217,
2230,
19504,
419,
339,
419,
2385,
327,
1002,
557,
46,
419,
2172,
2125,
456,
45,
429,
613,
299,
244,
53,
64,
613,
350,
1849,
2880,
46,
6693,
4269,
911,
492,
613,
2002,
419,
320,
547,
1849,
2880,
65,
90,
2217,
2230,
5111,
6371,
51,
6693,
4269,
688,
7738,
2880,
65,
90,
2217,
2230,
5111,
6693,
4269,
390,
45,
110,
894,
419,
339,
343,
339,
310,
339,
603,
461,
7905,
64,
303,
339,
465,
496,
1806,
303,
581,
910,
11349,
365,
303,
320,
310,
9705,
615,
299,
556,
9705,
492,
603,
615,
51,
1713,
459,
2230,
63,
18267,
1713,
45,
444,
19219,
494,
3021,
2224,
332,
494,
2224,
494,
3021,
3124,
332,
494,
3124,
64,
310,
434,
45,
316,
21764,
1177,
310,
320,
343,
615,
51,
1713,
10803,
22982,
7173,
310,
339,
603,
434,
45,
19437,
27236,
388,
2230,
882,
762,
46,
310,
320,
343,
615,
51,
1713,
459,
1737,
4817,
27236,
388,
3895,
18267,
1713,
45,
19437,
27236,
388,
2230,
19219,
494,
3021,
4817,
27236,
388,
332,
494,
4817,
27236,
388,
64,
310,
339,
603,
434,
45,
6693,
15555,
1177,
310,
320,
343,
615,
51,
1713,
10803,
804,
7173,
343,
434,
45,
6693,
365,
5118,
4126,
46,
419,
615,
51,
1713,
5564,
119,
97,
115,
742,
343,
615,
51,
1713,
45,
6693,
1052,
310,
339,
310,
434,
1181,
484,
51,
15602,
45,
484,
51,
1340,
17681,
54,
46,
882,
3243,
115
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
320,
547,
1437,
51,
688,
3283,
45,
909,
4119,
1280,
45,
2278,
2026,
51,
19682,
5086,
419,
339,
419,
1437,
51,
688,
3283,
45,
90,
2217,
1193,
51,
40038,
312,
343,
339,
310,
339,
2776,
461,
1437,
64,
303,
339,
465,
496,
1806,
303,
581,
650,
2217,
2230,
7905,
365,
303,
320,
310,
650,
2217,
2230,
7905,
299,
556,
650,
2217,
2230,
492,
603,
7905,
51,
15779,
45,
5175,
1052,
310,
7905,
51,
489,
2222,
45,
390,
2222,
1052,
310,
7905,
51,
489,
2396,
45,
30031,
1052,
310,
7905,
51,
489,
21764,
45,
316,
21764,
1052,
310,
7905,
51,
489,
11352,
27236,
388,
2230,
45,
390,
11352,
27236,
388,
2230,
1052,
310,
7905,
51,
489,
1355,
45738,
45,
390,
1355,
45738,
1052,
2776,
434,
45,
6693,
15555,
1177,
310,
320,
343,
434,
45,
6693,
365,
5118,
4126,
46,
343,
320,
419,
1614,
320,
547,
7905,
51,
11534,
45,
909,
4126,
65,
90,
2217,
2230,
19504,
419,
339,
419,
2385,
327,
1002,
557,
46,
419,
2172,
2125,
456,
45,
429,
613,
299,
244,
53,
64,
613,
350,
1849,
2880,
46,
6693,
4269,
911,
492,
613,
2002,
419,
320,
547,
1849,
2880,
65,
90,
2217,
2230,
5111,
6371,
51,
6693,
4269,
688,
7738,
2880,
65,
90,
2217,
2230,
5111,
6693,
4269,
390,
45,
110,
894,
419,
339,
343,
339,
310,
339,
603,
461,
7905,
64,
303,
339,
465,
496,
1806,
303,
581,
910,
11349,
365,
303,
320,
310,
9705,
615,
299,
556,
9705,
492,
603,
615,
51,
1713,
459,
2230,
63,
18267,
1713,
45,
444,
19219,
494,
3021,
2224,
332,
494,
2224,
494,
3021,
3124,
332,
494,
3124,
64,
310,
434,
45,
316,
21764,
1177,
310,
320,
343,
615,
51,
1713,
10803,
22982,
7173,
310,
339,
603,
434,
45,
19437,
27236,
388,
2230,
882,
762,
46,
310,
320,
343,
615,
51,
1713
] | -1,702,947,654,448,417,300
| true
| false
| false
| false
|
[
65,
90,
2217,
2230,
19504,
419,
339,
419,
2385,
327,
1002,
557,
46,
419,
2172,
2125,
456,
45,
429,
613,
299,
244,
53,
64,
613,
350,
1849,
2880,
46,
6693,
4269,
911,
492,
613,
2002,
419,
320,
547,
1849,
2880,
65,
90,
2217,
2230,
5111,
6371,
51,
6693,
4269,
688,
7738,
2880,
65,
90,
2217,
2230,
5111,
6693,
4269,
390,
45,
110,
894,
419,
339,
343,
339,
310,
339,
603,
461,
7905,
64,
303,
339,
465,
496,
1806,
303,
581,
910,
11349,
365,
303,
320,
310,
9705,
615,
299,
556,
9705,
492,
603,
615,
51,
1713,
459,
2230,
63,
18267
] | -8,781,573,430,873,113,000
| true
|
{
array.addLast(new DefaultArray(byteStr.getBytes()));
}
array.addLast(UcpMessage.SEP);
}
}
return array;
}
@Override
public UcpAttribute clone()
{
UcpAttribute clone = new UcpAttribute();
clone.setName(getName());
clone.setFormat(getFormat());
clone.setLength(getLength());
clone.setMandatory(isMandatory());
clone.setOccurenceAttribute(getOccurenceAttribute());
clone.setNotApplicable(getNotApplicable());
if(getValueQuality())
{
if(getValue() instanceof Vector)
{
try {
clone.setValue(new Vector<UcpAttribute>());
}
catch (Exception ex)
{}
for(int i = 0; i < ((Vector)getValue()).size(); i++)
{
((Vector<UcpAttribute>)clone.getValue()).add(((Vector<UcpAttribute>)getValue()).get(i));
}
}
}
return clone;
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append("Attribute: ").
|
{
UcpAttribute clone = new UcpAttribute();
clone.setName(getName());
clone.setFormat(getFormat());
clone.setLength(getLength());
clone.setMandatory(isMandatory());
clone.setOccurenceAttribute(getOccurenceAttribute());
clone.setNotApplicable(getNotApplicable());
if(getValueQuality())
{
if(getValue() instanceof Vector)
{
try {
clone.setValue(new Vector<UcpAttribute>());
}
catch (Exception ex)
{}
for(int i = 0; i < ((Vector)getValue()).size(); i++)
{
((Vector<UcpAttribute>)clone.getValue()).add(((Vector<UcpAttribute>)getValue()).get(i));
}
}
}
return clone;
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append("Attribute: ").
|
OccurenceAttribute(getOccurenceAttribute());
clone.setNotApplicable(getNotApplicable());
if(getValueQuality())
{
if(getValue() instanceof Vector)
{
try {
clone.setValue(new Vector<UcpAttribute>());
}
catch (Exception ex)
{}
for(int i = 0; i < ((Vector)getValue()).size(); i++)
{
((Vector<UcpAttribute>)clone.getValue()).add(((Vector<UcpAttribute>)getValue()).get(i));
}
}
}
return clone;
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append("Attribute: ").
|
<UcpAttribute>());
}
catch (Exception ex)
{}
for(int i = 0; i < ((Vector)getValue()).size(); i++)
{
((Vector<UcpAttribute>)clone.getValue()).add(((Vector<UcpAttribute>)getValue()).get(i));
}
}
}
return clone;
}
@Override
public String toString()
{
StringBuilder str = new StringBuilder();
str.append("Attribute: ").
|
append(name);// + ", format " + format + ", length " + length;
if(isMandatory())
{
str.append(", mandatory ");
}
if(occurenceAttribute!= null)
{
str.append
|
FormatTable.java
|
/FileExtraction/Java_unseen/kevinkrouse_j/src/org/armedbear/j/FormatTable.java
|
/*
* FormatTable.java
*
* Copyright (C) 1998-2002 Peter Graves
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.armedbear.j;
import java.awt.Color;
import java.awt.Font;
import java.util.ArrayList;
public final class FormatTable
{
private static final Preferences preferences = Editor.preferences();
private String modeName;
private ArrayList<FormatTableEntry> list;
private FormatTableEntry[] array;
private boolean initialized;
public FormatTable(String modeName)
{
this.modeName = modeName;
list = new ArrayList<FormatTableEntry>();
}
public synchronized final void setModeName(String s)
{
modeName = s;
}
public synchronized FormatTableEntry lookup(int format)
{
if (array != null) {
try {
return array[format];
}
catch (ArrayIndexOutOfBoundsException e) {
Log.error(e);
// Fall through...
}
}
if (!initialized) {
initialized = true;
boolean ok = true;
int largest = -1;
for (int i = list.size()-1; i >= 0; i--) {
final FormatTableEntry entry = list.get(i);
final int f = entry.getFormat();
if (f < 0) {
ok = false;
break;
}
if (f > largest)
largest = f;
}
if (ok && largest < 128) {
array = new FormatTableEntry[largest+1];
for (int i = list.size()-1; i >= 0; i--) {
FormatTableEntry entry = list.get(i);
array[entry.getFormat()] = entry;
}
list = null; // We don't need it any more.
try {
return array[format];
}
catch (ArrayIndexOutOfBoundsException e) {
Log.error(e);
return null;
}
} else
Debug.bug("FormatTableEntry.lookup unable to build array");
}
if (list != null) {
for (int i = list.size()-1; i >= 0; i--) {
FormatTableEntry entry = list.get(i);
if (entry.getFormat() == format)
return entry;
}
}
return null;
}
public synchronized void addEntryFromPrefs(int format, String thing)
{
addEntryFromPrefs(format, thing, null);
}
public synchronized void addEntryFromPrefs(int format, String thing, String fallback)
{
// Color.
Color color = null;
String key;
if (modeName != null) {
// "JavaMode.color.comment"
key = modeName + ".color." + thing;
color = preferences.getColorProperty(key);
}
if (color == null) {
// "color.comment"
key = "color." + thing;
color = preferences.getColorProperty(key);
}
// Use fallback if there's no entry for thing.
if (color == null && fallback != null) {
if (modeName != null) {
key = modeName + ".color." + fallback;
color = preferences.getColorProperty(key);
}
if (color == null) {
key = "color." + fallback;
color = preferences.getColorProperty(key);
}
}
if (color == null) {
color = DefaultTheme.getColor(modeName, thing);
if (color == null && fallback != null) {
color = DefaultTheme.getColor(modeName, fallback);
if (color == null)
color = DefaultTheme.getColor("text");
}
}
// Style.
int style = -1;
String value = null;
if (modeName != null) {
// "JavaMode.style.comment"
key = modeName + ".style." + thing;
value = preferences.getStringProperty(key);
}
if (value == null) {
// "style.comment"
key = "style." + thing;
value = preferences.getStringProperty(key);
}
// Use fallback if there's no entry for thing.
if (value == null && fallback != null) {
if (modeName != null) {
key = modeName + ".style." + fallback;
value = preferences.getStringProperty(key);
}
if (value == null) {
key = "style." + fallback;
value = preferences.getStringProperty(key);
}
}
if (value != null) {
try {
style = Integer.parseInt(value);
}
catch (NumberFormatException e) {}
}
if (style != Font.PLAIN && style != Font.BOLD && style != Font.ITALIC) {
style = DefaultTheme.getStyle(modeName, thing);
if (style < 0) {
if (fallback != null)
style = DefaultTheme.getStyle(modeName, fallback);
if (style < 0)
style = Font.PLAIN;
}
}
addEntry(format, thing, color, style);
}
// Only called from synchronized methods.
private void addEntry(int format, String name, Color color, int style)
{
FormatTableEntry entry = new FormatTableEntry(format, color, style);
int index = indexOf(format);
if (index >= 0)
list.set(index, entry);
else
list.add(entry);
}
// Only called from synchronized methods.
private int indexOf(int format)
{
for (int i = 0; i < list.size(); i++) {
FormatTableEntry entry = list.get(i);
if (entry.getFormat() == format)
return i;
}
return -1;
}
}
| 6,583
|
Java
|
.java
|
kevinkrouse/j
| 10
| 2
| 0
|
2012-04-16T00:43:46Z
|
2023-01-05T00:18:06Z
|
c1b2081aa02a194d5ff398b9352b198f2dec1e36f4dd469ca0e97837e2c28e26
|
[] |
[
1127,
222,
338,
10288,
1617,
51,
1874,
222,
338,
222,
338,
2657,
327,
72,
46,
244,
54,
62,
62,
61,
50,
55,
53,
53,
55,
37561,
8102,
7777,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
222,
338,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
588,
222,
222,
1337,
1105,
51,
301,
1987,
47037,
51,
111,
64,
222,
222,
485,
1401,
51,
8236,
51,
1530,
64,
222,
485,
1401,
51,
8236,
51,
3728,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
222,
942,
1175,
462,
10288,
1617,
222,
128,
303,
964,
924,
1175,
38440,
23333,
299,
11419,
51,
22561,
492,
465,
964,
910,
2945,
577,
64,
303,
964,
5068,
65,
2222,
32934,
67,
1168,
64,
303,
964,
10288,
32934,
1197,
1437,
64,
303,
964,
1922,
8777,
64,
465,
581,
10288,
1617,
45,
671,
2945,
577,
46,
303,
320,
310,
477,
51,
2832,
577,
299,
2945,
577,
64,
310,
1168,
299,
556,
5068,
65,
2222,
32934,
2938,
303,
339,
465,
581,
13436,
1175,
782,
758,
2116,
577,
45,
671,
328,
46,
303,
320,
310,
2945,
577,
299,
328,
64,
303,
339,
465,
581,
13436,
10288,
32934,
11478,
45,
429,
2224,
46,
303,
320,
310,
434,
327,
977,
882,
762,
46,
320,
343,
1614,
320,
419,
461,
1437,
96,
1664,
988,
343,
339,
343,
2385,
327,
45849,
35787,
503,
46,
320,
419,
2681,
51,
750,
45,
106,
312,
419,
453,
36845,
3939,
1198,
343,
339,
310,
339,
310,
434,
1445,
16150,
46,
320,
343,
8777,
299,
878,
64,
343,
1922,
3847,
299,
878,
64,
343,
648,
22936,
299,
449,
54,
64,
343,
456,
327,
429,
613,
299,
1168,
51,
911,
17681,
54,
64,
613,
2394,
244,
53,
64,
613,
15344,
320,
419,
1175,
10288,
32934,
3429,
299,
1168,
51,
390,
45,
110,
312,
419,
1175,
648,
315,
299,
3429,
51,
390,
2222,
492,
419,
434,
327,
107,
350,
244,
53,
46,
320,
547,
3847,
299,
920,
64,
547,
1644,
64,
419,
339,
419,
434,
327,
107,
868,
22936,
46,
547,
22936,
299,
315,
64,
343,
339,
343,
434,
327,
1273,
979,
22936,
350,
244,
54,
55,
61,
46,
320,
419,
1437,
299,
556,
10288,
32934,
96,
43690,
48,
54,
988,
419,
456,
327,
429,
613,
299,
1168,
51,
911,
17681,
54,
64,
613,
2394,
244,
53,
64,
613,
15344,
320,
547,
10288,
32934,
3429,
299,
1168,
51,
390,
45,
110,
312,
547,
1437,
96,
3054,
51,
390,
2222,
7688,
299,
3429,
64,
419,
339,
419,
1168,
299,
762,
64,
453,
2726,
2818,
1348,
1868,
580,
1364,
1851,
51,
419,
1614,
320,
547,
461,
1437,
96,
1664,
988,
419,
339,
419,
2385,
327,
45849,
35787,
503,
46,
320,
547,
2681,
51,
750,
45,
106,
312,
547,
461,
762,
64,
419,
339,
343,
339,
832,
419,
8093,
51,
1468,
459,
2222,
32934,
51,
10124,
17043,
391,
1984,
1437,
742,
310,
339,
310,
434,
327,
687,
882,
762,
46,
320,
343,
456,
327,
429,
613,
299,
1168,
51,
911,
17681,
54,
64,
613,
2394,
244,
53,
64,
613,
15344,
320,
419,
10288,
32934,
3429,
299,
1168,
51,
390,
45,
110,
312,
419,
434,
327,
3054,
51,
390,
2222,
365,
630,
2224,
46,
547,
461,
3429,
64,
343,
339,
310,
339,
310,
461,
762,
64,
303,
339,
465,
581,
13436,
782,
1035,
2717,
1811,
20042,
45,
429,
2224,
49,
910,
7928,
46,
303,
320,
310,
1035,
2717,
1811,
20042,
45,
1664,
49,
7928,
49,
762,
312,
303,
339,
465,
581,
13436,
782,
1035,
2717,
1811,
20042,
45,
429,
2224,
49,
910,
7928,
49,
910,
17148,
46,
303,
320,
310,
453,
5459,
51,
310,
5459,
1989,
299,
762,
64,
310,
910,
1221,
64,
310,
434,
327,
2832,
577,
882,
762,
46,
320,
343,
453,
332,
5445,
2116,
51,
1507,
51,
3666,
39,
343,
1221,
299,
2945,
577,
494,
4956,
1507,
3128,
494,
7928,
64,
343,
1989,
299,
23333,
51,
24849,
1667,
45,
697,
312,
310,
339,
310,
434,
327,
1507,
630,
762,
46,
320,
343,
453,
332,
1507,
51,
3666,
39,
343,
1221,
299,
332,
1507,
3128,
494,
7928,
64,
343,
1989,
299,
23333,
51,
24849,
1667,
45,
697,
312,
310,
339,
310,
453,
4443,
17148,
434,
2038,
1200,
1307,
3429,
456,
7928,
51,
310,
434,
327,
1507,
630,
762,
979,
17148,
882,
762,
46,
320,
343,
434,
327,
2832,
577,
882,
762,
46,
320,
419,
1221,
299,
2945,
577,
494,
4956,
1507,
3128,
494,
17148,
64,
419,
1989,
299,
23333,
51,
24849,
1667,
45,
697,
312,
343,
339,
343,
434,
327,
1507,
630,
762,
46,
320,
419,
1221,
299,
332,
1507,
3128,
494,
17148,
64,
419,
1989,
299,
23333,
51,
24849,
1667,
45,
697,
312,
343,
339,
310,
339,
310,
434,
327,
1507,
630,
762,
46,
320,
343,
1989,
299,
4119,
6537,
51,
24849,
45,
2832,
577,
49,
7928,
312,
343,
434,
327,
1507,
630,
762,
979,
17148,
882,
762,
46,
320,
419,
1989,
299,
4119,
6537,
51,
24849,
45,
2832,
577,
49,
17148,
312,
419,
434,
327,
1507,
630,
762,
46,
547,
1989,
299,
4119,
6537,
51,
24849,
459,
897,
742,
343,
339,
310,
339,
603,
453,
11643,
51,
310,
648,
1435,
299,
449,
54,
64,
310,
910,
804,
299,
762,
64,
310,
434,
327,
2832,
577,
882,
762,
46,
320,
343,
453,
332
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
280,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
588,
222,
222,
1337,
1105,
51,
301,
1987,
47037,
51,
111,
64,
222,
222,
485,
1401,
51,
8236,
51,
1530,
64,
222,
485,
1401,
51,
8236,
51,
3728,
64,
222,
485,
1401,
51,
1058,
51,
7119,
64,
222,
222,
942,
1175,
462,
10288,
1617,
222,
128,
303,
964,
924,
1175,
38440,
23333,
299,
11419,
51,
22561,
492,
465,
964,
910,
2945,
577,
64,
303,
964,
5068,
65,
2222,
32934,
67,
1168,
64,
303,
964,
10288,
32934,
1197,
1437,
64,
303,
964,
1922,
8777,
64,
465,
581,
10288,
1617,
45,
671,
2945,
577,
46,
303,
320,
310,
477,
51,
2832,
577,
299,
2945,
577,
64,
310,
1168,
299,
556,
5068,
65,
2222,
32934,
2938,
303,
339,
465,
581,
13436,
1175,
782,
758,
2116,
577,
45,
671,
328,
46,
303,
320,
310,
2945,
577,
299,
328,
64,
303,
339,
465,
581,
13436,
10288,
32934,
11478,
45,
429,
2224,
46,
303,
320,
310,
434,
327,
977,
882,
762,
46,
320,
343,
1614,
320,
419,
461,
1437,
96,
1664,
988,
343,
339,
343,
2385,
327,
45849,
35787,
503,
46,
320,
419,
2681,
51,
750,
45,
106,
312,
419,
453,
36845,
3939,
1198,
343,
339,
310,
339,
310,
434,
1445,
16150
] | 7,676,247,654,402,545,000
| true
| false
| false
| false
|
[
303,
964,
924,
1175,
38440,
23333,
299,
11419,
51,
22561,
492,
465,
964,
910,
2945,
577,
64,
303,
964,
5068,
65,
2222,
32934,
67,
1168,
64,
303,
964,
10288,
32934,
1197,
1437,
64,
303,
964,
1922,
8777,
64,
465,
581,
10288,
1617,
45,
671,
2945,
577,
46,
303,
320,
310,
477,
51,
2832,
577,
299,
2945,
577,
64,
310,
1168,
299,
556,
5068,
65,
2222,
32934,
2938,
303,
339,
465,
581,
13436,
1175,
782,
758,
2116,
577,
45,
671,
328,
46,
303,
320,
310,
2945,
577,
299,
328,
64,
303,
339,
465,
581,
13436,
10288,
32934,
11478,
45,
429,
2224
] | 6,540,711,716,393,096,000
| true
|
,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.armedbear.j;
import java.awt.Color;
import java.awt.Font;
import java.util.ArrayList;
public final class FormatTable
{
private static final Preferences preferences = Editor.preferences();
private String modeName;
private ArrayList<FormatTableEntry> list;
private FormatTableEntry[] array;
private boolean initialized;
public FormatTable(String modeName)
{
this.modeName = modeName;
list = new ArrayList<FormatTableEntry>();
}
public synchronized final void setModeName(String s)
{
modeName = s;
}
public synchronized FormatTableEntry lookup(int format
|
General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.armedbear.j;
import java.awt.Color;
import java.awt.Font;
import java.util.ArrayList;
public final class FormatTable
{
private static final Preferences preferences = Editor.preferences();
private String modeName;
private ArrayList<FormatTableEntry> list;
private FormatTableEntry[] array;
private boolean initialized;
public FormatTable(String modeName)
{
this.modeName = modeName;
list = new ArrayList<FormatTableEntry>();
}
public synchronized final void setModeName(String s)
{
modeName = s;
}
public synchronized FormatTableEntry lookup(int format
|
, USA.
*/
package org.armedbear.j;
import java.awt.Color;
import java.awt.Font;
import java.util.ArrayList;
public final class FormatTable
{
private static final Preferences preferences = Editor.preferences();
private String modeName;
private ArrayList<FormatTableEntry> list;
private FormatTableEntry[] array;
private boolean initialized;
public FormatTable(String modeName)
{
this.modeName = modeName;
list = new ArrayList<FormatTableEntry>();
}
public synchronized final void setModeName(String s)
{
modeName = s;
}
public synchronized FormatTableEntry lookup(int format
|
private static final Preferences preferences = Editor.preferences();
private String modeName;
private ArrayList<FormatTableEntry> list;
private FormatTableEntry[] array;
private boolean initialized;
public FormatTable(String modeName)
{
this.modeName = modeName;
list = new ArrayList<FormatTableEntry>();
}
public synchronized final void setModeName(String s)
{
modeName = s;
}
public synchronized FormatTableEntry lookup(int format
|
)
{
if (array!= null) {
try {
return array[format];
}
catch (ArrayIndexOutOfBoundsException e) {
Log.error(e);
// Fall through...
}
}
if (!initialized
|
AbstractMultiSheetSpreadSheetWriter.java
|
/FileExtraction/Java_unseen/waikato-datamining_adams-base/adams-spreadsheet/src/main/java/adams/data/io/output/AbstractMultiSheetSpreadSheetWriter.java
|
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* AbstractMultiSheetSpreadSheetWriter.java
* Copyright (C) 2013-2015 University of Waikato, Hamilton, New Zealand
*/
package adams.data.io.output;
import adams.core.io.FileUtils;
import adams.data.spreadsheet.SpreadSheet;
import org.apache.commons.io.output.WriterOutputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
/**
* Ancestor for spreadsheet writers that can write multiple sheets into
* a single document.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision$
*/
public abstract class AbstractMultiSheetSpreadSheetWriter
extends AbstractSpreadSheetWriter
implements MultiSheetSpreadSheetWriter {
/** for serialization. */
private static final long serialVersionUID = -9004877579871173007L;
/** The prefix for the sheet names. */
protected String m_SheetPrefix;
/**
* Adds options to the internal list of options.
*/
@Override
public void defineOptions() {
super.defineOptions();
m_OptionManager.add(
"sheet-prefix", "sheetPrefix",
getDefaultSheetPrefix());
}
/**
* Returns the default missing value.
*
* @return the default for missing values
*/
protected String getDefaultSheetPrefix() {
return "Sheet";
}
/**
* Sets the prefix for sheet names.
*
* @param value the prefix
*/
public void setSheetPrefix(String value) {
m_SheetPrefix = value;
reset();
}
/**
* Returns the prefix for sheet names
*
* @return the prefix
*/
public String getSheetPrefix() {
return m_SheetPrefix;
}
/**
* Returns the tip text for this property.
*
* @return tip text for this property suitable for
* displaying in the explorer/experimenter gui
*/
public String sheetPrefixTipText() {
return "The prefix for sheet names.";
}
/**
* Returns whether the writer supports writing multiple sheets.
*
* @return true if it can write multiple sheets
*/
public boolean canWriteMultiple() {
return true;
}
/**
* Performs the actual writing. The caller must ensure that the writer gets
* closed.
*
* @param content the spreadsheet to write
* @param writer the writer to write the spreadsheet to
* @return true if successfully written
*/
@Override
protected boolean doWrite(SpreadSheet content, Writer writer) {
return doWrite(new SpreadSheet[]{content}, writer);
}
/**
* Performs the actual writing. The caller must ensure that the output stream
* gets closed.
*
* @param content the spreadsheet to write
* @param out the output stream to write the spreadsheet to
* @return true if successfully written
*/
@Override
protected boolean doWrite(SpreadSheet content, OutputStream out) {
return doWrite(new SpreadSheet[]{content}, out);
}
/**
* Performs the actual writing. The caller must ensure that the writer gets
* closed.
* <br><br>
* Default implementation returns always false.
*
* @param content the spreadsheet to write
* @param filename the file to write the spreadsheet to
* @return true if successfully written
*/
protected boolean doWrite(SpreadSheet[] content, String filename) {
return false;
}
/**
* Performs the actual writing. The caller must ensure that the writer gets
* closed.
* <br><br>
* Default implementation returns always false.
*
* @param content the spreadsheet to write
* @param writer the writer to write the spreadsheet to
* @return true if successfully written
*/
protected boolean doWrite(SpreadSheet[] content, Writer writer) {
return false;
}
/**
* Performs the actual writing. The caller must ensure that the output stream
* gets closed.
* <br><br>
* Default implementation returns always false.
*
* @param content the spreadsheet to write
* @param out the output stream to write the spreadsheet to
* @return true if successfully written
*/
protected boolean doWrite(SpreadSheet[] content, OutputStream out) {
return false;
}
/**
* Writes the spreadsheets to the specified file.
*
* @param content the content to write
* @param file the file to write to
* @return true if successfully written
*/
@Override
public boolean write(SpreadSheet[] content, File file) {
return write(content, file.getAbsolutePath());
}
/**
* Writes the spreadsheets to the given file.
*
* @param content the spreadsheet to write
* @param filename the file to write the spreadsheet to
* @return true if successfully written
*/
@Override
public boolean write(SpreadSheet[] content, String filename) {
boolean result;
BufferedWriter writer;
OutputStream output;
FileOutputStream fos;
FileWriter fw;
result = true;
preWriteFile(filename);
writer = null;
fw = null;
fos = null;
try {
switch (getOutputType()) {
case FILE:
result = doWrite(content, filename);
break;
case STREAM:
output = new FileOutputStream(filename, false);
result = doWrite(content, output);
break;
case WRITER:
writer = new BufferedWriter(new FileWriter(filename, false));
result = doWrite(content, writer);
break;
default:
throw new IllegalStateException("Unhandled output type: " + getOutputType());
}
}
catch (Exception e) {
result = false;
e.printStackTrace();
}
finally {
FileUtils.closeQuietly(writer);
FileUtils.closeQuietly(fw);
FileUtils.closeQuietly(fos);
}
return result;
}
/**
* Writes the spreadsheets to the given output stream. The caller
* must ensure that the stream gets closed.
*
* @param content the spreadsheet to write
* @param stream the output stream to write the spreadsheet to
* @return true if successfully written
*/
@Override
public boolean write(SpreadSheet[] content, OutputStream stream) {
switch (getOutputType()) {
case FILE:
throw new IllegalStateException("Can only write to files!");
case STREAM:
return doWrite(content, stream);
case WRITER:
return doWrite(content, new OutputStreamWriter(stream));
default:
throw new IllegalStateException("Unhandled output type: " + getOutputType());
}
}
/**
* Writes the spreadsheets to the given writer. The caller
* must ensure that the writer gets closed.
*
* @param content the spreadsheet to write
* @param writer the writer to write the spreadsheet to
* @return true if successfully written
*/
@Override
public boolean write(SpreadSheet[] content, Writer writer) {
switch (getOutputType()) {
case FILE:
throw new IllegalStateException("Can only write to files!");
case STREAM:
return doWrite(content, new WriterOutputStream(writer));
case WRITER:
return doWrite(content, writer);
default:
throw new IllegalStateException("Unhandled output type: " + getOutputType());
}
}
}
| 7,965
|
Java
|
.java
|
waikato-datamining/adams-base
| 17
| 4
| 0
|
2017-09-01T22:51:51Z
|
2024-05-08T02:22:17Z
|
b78bb4882344d166178161b97a0f43878716bad8cc906509fe6503ddfa59e308
|
[] |
[
1127,
222,
338,
280,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
280,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
280,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
280,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
280,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
280,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
280,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
280,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
280,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
280,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1350,
222,
338,
7406,
6230,
8337,
33518,
8337,
3989,
51,
1874,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
56,
50,
55,
53,
54,
58,
11451,
451,
643,
102,
1567,
6599,
49,
696,
20915,
955,
49,
3153,
18682,
298,
382,
222,
588,
222,
1337,
26177,
51,
624,
51,
735,
51,
2051,
64,
222,
222,
485,
26177,
51,
1284,
51,
735,
51,
39463,
64,
222,
485,
26177,
51,
624,
51,
35126,
51,
33518,
8337,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
2051,
51,
3989,
8783,
64,
222,
222,
485,
1401,
51,
735,
51,
17640,
3989,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
8783,
64,
222,
485,
1401,
51,
735,
51,
36202,
64,
222,
485,
1401,
51,
735,
51,
8783,
64,
222,
485,
1401,
51,
735,
51,
8783,
3989,
64,
222,
485,
1401,
51,
735,
51,
3989,
64,
222,
222,
1350,
222,
338,
2262,
24641,
456,
41015,
2889,
502,
708,
902,
2886,
4632,
45598,
2012,
222,
338,
331,
4005,
1840,
51,
222,
338,
1676,
338,
496,
2133,
244,
33868,
367,
538,
327,
8829,
367,
538,
840,
27884,
1567,
6599,
8078,
1449,
8078,
20181,
46,
222,
338,
496,
1687,
417,
14021,
41,
222,
588,
222,
942,
5560,
462,
7406,
6230,
8337,
33518,
8337,
3989,
353,
2041,
7406,
33518,
8337,
3989,
353,
4584,
10497,
8337,
33518,
8337,
3989,
320,
736,
1041,
456,
22672,
51,
588,
353,
964,
924,
1175,
1964,
19896,
299,
449,
62,
53,
53,
57,
61,
60,
60,
58,
60,
62,
61,
60,
54,
54,
60,
56,
53,
53,
60,
81,
64,
4070,
1041,
906,
5216,
456,
341,
13068,
4492,
51,
588,
353,
2532,
910,
364,
100,
8337,
5429,
64,
736,
1041,
682,
338,
15444,
2089,
391,
341,
3584,
1168,
451,
2089,
51,
682,
588,
353,
496,
1806,
353,
581,
782,
5623,
2045,
365,
320,
303,
2615,
51,
1252,
2045,
492,
465,
364,
100,
2846,
1590,
51,
688,
45,
3281,
332,
7161,
50,
4271,
411,
332,
7161,
5429,
411,
3281,
23916,
8337,
5429,
1052,
353,
339,
736,
1041,
682,
338,
3777,
341,
1263,
5839,
804,
51,
682,
338,
682,
338,
496,
620,
221,
221,
1402,
1263,
456,
5839,
2102,
682,
588,
353,
2532,
910,
23916,
8337,
5429,
365,
320,
303,
461,
332,
8337,
884,
353,
339,
736,
1041,
682,
338,
9023,
341,
5216,
456,
13068,
4492,
51,
682,
338,
682,
338,
496,
772,
804,
221,
1402,
5216,
682,
588,
353,
581,
782,
758,
8337,
5429,
45,
671,
804,
46,
320,
303,
364,
100,
8337,
5429,
299,
804,
64,
303,
5672,
492,
353,
339,
736,
1041,
682,
338,
3777,
341,
5216,
456,
13068,
4492,
682,
338,
682,
338,
496,
620,
221,
221,
1402,
5216,
682,
588,
353,
581,
910,
640,
8337,
5429,
365,
320,
303,
461,
364,
100,
8337,
5429,
64,
353,
339,
736,
1041,
682,
338,
3777,
341,
8318,
1367,
456,
477,
2821,
51,
682,
338,
682,
338,
496,
620,
4238,
221,
3976,
1367,
456,
477,
2821,
19653,
456,
682,
338,
2052,
221,
221,
2784,
318,
347,
341,
46230,
52,
346,
481,
468,
1422,
17390,
682,
588,
353,
581,
910,
13068,
5429,
6251,
1049,
365,
320,
303,
461,
332,
1338,
5216,
456,
13068,
4492,
12984,
353,
339,
736,
1041,
682,
338,
3777,
4962,
341,
7294,
9568,
4144,
4632,
45598,
51,
682,
338,
9075,
338,
496,
620,
221,
221,
1527,
434,
580,
902,
2886,
4632,
45598,
682,
588,
353,
581,
1922,
902,
2553,
11727,
365,
320,
303,
461,
878,
64,
353,
339,
736,
1041,
682,
338,
44772,
341,
4668,
4144,
51,
906,
13099,
2315,
7197,
708,
341,
7294,
8572,
682,
338,
8791,
51,
682,
338,
682,
338,
496,
772,
1813,
221,
1402,
41015,
391,
2886,
682,
338,
496,
772,
7294,
221,
1402,
7294,
391,
2886,
341,
41015,
391,
682,
338,
496,
620,
221,
221,
1527,
434,
7519,
6658,
682,
588,
353,
496,
1806,
353,
2532,
1922,
764,
2553,
45,
33518,
8337,
1813,
49,
26244,
7294,
46,
320,
303,
461,
764,
2553,
45,
909,
5034,
870,
8337,
14161,
1304,
855,
7294,
312,
353,
339,
736,
1041,
682,
338,
44772,
341,
4668,
4144,
51,
906,
13099,
2315,
7197,
708,
341,
1716,
3458,
682,
338,
8572,
8791,
51,
682,
338,
682,
338,
496,
772,
1813,
221,
1402,
41015,
391,
2886,
682,
338,
496,
772,
986,
221,
221,
1402,
1716,
3458,
391,
2886,
341,
41015,
391,
682,
338,
496,
620,
221,
221,
1527,
434,
7519,
6658,
682,
588,
353,
496,
1806,
353,
2532,
1922,
764,
2553,
45,
33518,
8337,
1813,
49,
35998,
986,
46,
320,
303,
461,
764,
2553,
45,
909,
5034,
870,
8337,
14161,
1304,
855,
986,
312,
353,
339,
736,
1041,
682,
338,
44772,
341,
4668,
4144,
51,
906,
13099,
2315,
7197,
708,
341,
7294,
8572,
682,
338,
8791,
51,
682,
338,
350,
858,
789,
858,
67,
682,
338,
4119,
4753,
3235,
5198,
920,
51,
682,
338,
682,
338,
496,
772,
1813,
221,
1402,
41015,
391,
2886,
682,
338,
496,
772,
4891,
221,
1402,
822,
391,
2886,
341,
41015,
391,
682,
338,
496,
620,
221,
221,
1527,
434,
7519,
6658,
682,
588,
353,
2532,
1922,
764,
2553,
45,
33518,
8337,
1197,
1813,
49,
910,
4891,
46,
320,
303,
461,
920,
64,
353,
339,
736,
1041,
682,
338,
44772,
341
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
382,
222,
588,
222,
1337,
26177,
51,
624,
51,
735,
51,
2051,
64,
222,
222,
485,
26177,
51,
1284,
51,
735,
51,
39463,
64,
222,
485,
26177,
51,
624,
51,
35126,
51,
33518,
8337,
64,
222,
485,
1105,
51,
2121,
51,
8381,
51,
735,
51,
2051,
51,
3989,
8783,
64,
222,
222,
485,
1401,
51,
735,
51,
17640,
3989,
64,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
8783,
64,
222,
485,
1401,
51,
735,
51,
36202,
64,
222,
485,
1401,
51,
735,
51,
8783,
64,
222,
485,
1401,
51,
735,
51,
8783,
3989,
64,
222,
485,
1401,
51,
735,
51,
3989,
64,
222,
222,
1350,
222,
338,
2262,
24641,
456,
41015,
2889,
502,
708,
902,
2886,
4632,
45598,
2012,
222,
338,
331,
4005,
1840,
51,
222,
338,
1676,
338,
496,
2133,
244,
33868,
367,
538,
327,
8829,
367,
538,
840,
27884,
1567,
6599,
8078,
1449,
8078,
20181,
46,
222,
338,
496,
1687,
417,
14021,
41,
222,
588,
222,
942,
5560,
462,
7406,
6230,
8337,
33518,
8337,
3989,
353,
2041,
7406,
33518,
8337,
3989,
353,
4584,
10497,
8337,
33518,
8337,
3989,
320,
736,
1041,
456,
22672,
51,
588,
353,
964,
924,
1175,
1964,
19896,
299,
449,
62,
53,
53,
57,
61,
60,
60,
58,
60,
62,
61,
60,
54,
54,
60,
56,
53,
53,
60,
81,
64,
4070,
1041,
906,
5216,
456,
341,
13068,
4492,
51,
588,
353,
2532,
910,
364,
100,
8337,
5429,
64,
736,
1041,
682,
338,
15444,
2089,
391,
341,
3584,
1168,
451,
2089,
51,
682,
588,
353,
496,
1806,
353,
581,
782,
5623,
2045,
365,
320,
303,
2615,
51,
1252,
2045,
492,
465,
364,
100,
2846,
1590,
51,
688,
45,
3281,
332,
7161,
50,
4271,
411,
332,
7161,
5429,
411,
3281,
23916,
8337,
5429,
1052,
353,
339,
736,
1041
] | -4,881,818,457,065,454,000
| true
| false
| false
| false
|
[
6599,
8078,
1449,
8078,
20181,
46,
222,
338,
496,
1687,
417,
14021,
41,
222,
588,
222,
942,
5560,
462,
7406,
6230,
8337,
33518,
8337,
3989,
353,
2041,
7406,
33518,
8337,
3989,
353,
4584,
10497,
8337,
33518,
8337,
3989,
320,
736,
1041,
456,
22672,
51,
588,
353,
964,
924,
1175,
1964,
19896,
299,
449,
62,
53,
53,
57,
61,
60,
60,
58,
60,
62,
61,
60,
54,
54,
60,
56,
53,
53,
60,
81,
64,
4070,
1041,
906,
5216,
456,
341,
13068,
4492,
51,
588,
353,
2532,
910,
364,
100,
8337,
5429,
64,
736,
1041,
682,
338,
15444,
2089,
391,
341
] | -7,960,218,974,791,312,000
| true
|
and
*/
package adams.data.io.output;
import adams.core.io.FileUtils;
import adams.data.spreadsheet.SpreadSheet;
import org.apache.commons.io.output.WriterOutputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
/**
* Ancestor for spreadsheet writers that can write multiple sheets into
* a single document.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision$
*/
public abstract class AbstractMultiSheetSpreadSheetWriter
extends AbstractSpreadSheetWriter
implements MultiSheetSpreadSheetWriter {
/** for serialization. */
private static final long serialVersionUID = -9004877579871173007L;
/** The prefix for the sheet names. */
protected String m_SheetPrefix;
/**
* Adds options to the
|
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
/**
* Ancestor for spreadsheet writers that can write multiple sheets into
* a single document.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision$
*/
public abstract class AbstractMultiSheetSpreadSheetWriter
extends AbstractSpreadSheetWriter
implements MultiSheetSpreadSheetWriter {
/** for serialization. */
private static final long serialVersionUID = -9004877579871173007L;
/** The prefix for the sheet names. */
protected String m_SheetPrefix;
/**
* Adds options to the
|
Writer;
import java.io.Writer;
/**
* Ancestor for spreadsheet writers that can write multiple sheets into
* a single document.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision$
*/
public abstract class AbstractMultiSheetSpreadSheetWriter
extends AbstractSpreadSheetWriter
implements MultiSheetSpreadSheetWriter {
/** for serialization. */
private static final long serialVersionUID = -9004877579871173007L;
/** The prefix for the sheet names. */
protected String m_SheetPrefix;
/**
* Adds options to the
|
ato dot ac dot nz)
* @version $Revision$
*/
public abstract class AbstractMultiSheetSpreadSheetWriter
extends AbstractSpreadSheetWriter
implements MultiSheetSpreadSheetWriter {
/** for serialization. */
private static final long serialVersionUID = -9004877579871173007L;
/** The prefix for the sheet names. */
protected String m_SheetPrefix;
/**
* Adds options to the
|
internal list of options.
*/
@Override
public void defineOptions() {
super.defineOptions();
m_OptionManager.add(
"sheet-prefix", "sheetPrefix",
getDefaultSheetPrefix());
}
/**
|
Stochastics.java
|
/FileExtraction/Java_unseen/zrna-research_akso/axoloti/src/main/java/generatedobjects/Stochastics.java
|
/**
* Copyright (C) 2013, 2014 Johannes Taelman
*
* This file is part of Axoloti.
*
* Axoloti is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* Axoloti is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* Axoloti. If not, see <http://www.gnu.org/licenses/>.
*/
package generatedobjects;
import axoloti.object.AxoObject;
import axoloti.object.inlet.InletBool32Rising;
import axoloti.object.outlet.OutletFrac32;
import axoloti.object.outlet.OutletFrac32Bipolar;
import axoloti.object.outlet.OutletFrac32Buffer;
import axoloti.object.outlet.OutletInt32;
import axoloti.object.parameter.ParameterInt32Box;
import static generatedobjects.GenTools.writeAxoObject;
/**
*
* @author Johannes Taelman
*/
class Stochastics extends GenTools {
static void generateAll() {
String catName = "rand";
writeAxoObject(catName, createRand());
writeAxoObject(catName, createRandTrigger());
writeAxoObject(catName, createRandTriggerI());
// objs.add(CreatekNoisePoissonOsc1());
// objs.add(CreatekNoisePoissonOsc2());
// objs.add(CreatekNoisePoissonOsc3());
// objs.add(CreatekNoisePoissonOsc4());
// objs.add(CreateNoisePoissonOsc1());
// objs.add(CreateNoisePoissonOsc2());
// objs.add(CreateNoisePoissonOsc3());
// objs.add(CreateNoisePoissonOsc4());
}
static AxoObject createRand() {
AxoObject o = new AxoObject("uniform f", "uniform distributed (white) noise, k-rate generation. Range -64..64");
o.outlets.add(new OutletFrac32("wave", "white noise"));
o.sKRateCode = "outlet_wave = (int32_t)(GenerateRandomNumber())>>4;";
return o;
}
static AxoObject createRandTrigger() {
AxoObject o = new AxoObject("uniform f trig", "uniform distributed (white) noise, triggered generation. Range -64..64");
o.inlets.add(new InletBool32Rising("trig", "trigger"));
o.outlets.add(new OutletFrac32Bipolar("rand", "random number"));
o.sLocalData = "int32_t val;\n"
+ "int ntrig;\n";
o.sInitCode = "val = (int32_t)(GenerateRandomNumber())>>4;\n"
+ "ntrig = 0;\n";
o.sKRateCode = " if ((inlet_trig>0) && !ntrig) { val = (int32_t)(GenerateRandomNumber())>>4; ntrig=1;}\n"
+ " else if (!(inlet_trig>0)) ntrig=0;\n"
+ " outlet_rand= val;\n";
return o;
}
static AxoObject createRandTriggerI() {
AxoObject o = new AxoObject("uniform i", "uniform distributed (white) noise, k-rate generation. Range 0..(n-1)");
o.inlets.add(new InletBool32Rising("trig", "trigger"));
o.params.add(new ParameterInt32Box("max", 0, 1 << 16));
o.outlets.add(new OutletInt32("v", "random value"));
o.sLocalData = "int32_t val;\n"
+ "int ntrig;\n";
o.sInitCode = ""
+ "val = 0;\n"
+ "ntrig = 0;\n";
o.sKRateCode = " if ((inlet_trig>0) && !ntrig) {\n"
+ " if (param_max) \n"
+ " val = (int32_t)(GenerateRandomNumber()% (param_max));\n"
+ " else val = 0;\n"
+ " ntrig=1;\n"
+ " }\n"
+ " else if (!(inlet_trig>0)) ntrig=0;\n"
+ " outlet_v = val;\n";
return o;
}
static AxoObject createNoisePoissonOsc1() {
AxoObject o = new AxoObject("poisson1~", "Poisson noise generator 1");
o.outlets.add(new OutletFrac32Buffer("wave", "poisson noise"));
o.sSRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave = ((!(tmp&0x7F000000))+ (!(tmp&0x007F0000)) + (!(tmp&0x00007F00)) + (!(tmp&0x0000007F)))<<25;}\n";
return o;
}
static AxoObject createNoisePoissonOsc2() {
AxoObject o = new AxoObject("poisson2~", "Poisson noise generator 2");
o.outlets.add(new OutletFrac32Buffer("wave", "poisson noise"));
o.sSRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave = ((!(tmp&0xFF000000))+ (!(tmp&0x00FF0000)) + (!(tmp&0x0000FF00)) + (!(tmp&0x000000FF)))<<25;}\n";
return o;
}
static AxoObject createNoisePoissonOsc3() {
AxoObject o = new AxoObject("poisson3~", "Poisson noise generator 3");
o.outlets.add(new OutletFrac32Buffer("wave", "poisson noise"));
o.sSRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave = ((!(tmp&0x0001FF))+ (!(tmp&0x03FE00)) + (!(tmp&0x7FC0000)))<<25;}\n";
return o;
}
static AxoObject createNoisePoissonOsc4() {
AxoObject o = new AxoObject("poisson4~", "Poisson noise generator 4");
o.outlets.add(new OutletFrac32Buffer("wave", "poisson noise"));
o.sSRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave= ((!(tmp&0x000003FF))+ (!(tmp&0x000FFC00)) + (!(tmp&0x3FF00000)))<<25;}\n";
return o;
}
static AxoObject createkNoisePoissonOsc1() {
AxoObject o = new AxoObject("poisson1", "Poisson noise generator 1");
o.outlets.add(new OutletFrac32("wave", "poisson noise"));
o.sKRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave= ((!(tmp&0x7F000000))+ (!(tmp&0x007F0000)) + (!(tmp&0x00007F00)) + (!(tmp&0x0000007F)))<<25;}\n";
return o;
}
static AxoObject createkNoisePoissonOsc2() {
AxoObject o = new AxoObject("poisson2", "Poisson noise generator 2");
o.outlets.add(new OutletFrac32("wave", "poisson noise"));
o.sKRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave= ((!(tmp&0xFF000000))+ (!(tmp&0x00FF0000)) + (!(tmp&0x0000FF00)) + (!(tmp&0x000000FF)))<<25;}\n";
return o;
}
static AxoObject createkNoisePoissonOsc3() {
AxoObject o = new AxoObject("poisson3", "Poisson noise generator 3");
o.outlets.add(new OutletFrac32("wave", "poisson noise"));
o.sKRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave= ((!(tmp&0x0001FF))+ (!(tmp&0x03FE00)) + (!(tmp&0x7FC0000)))<<25;}\n";
return o;
}
static AxoObject createkNoisePoissonOsc4() {
AxoObject o = new AxoObject("poisson4", "Poisson noise generator 4");
o.outlets.add(new OutletFrac32("wave", "poisson noise"));
o.sKRateCode = "{ int32_t x->tmp = GenerateRandomNumber();\n"
+ "outlet_wave= ((!(tmp&0x000003FF))+ (!(tmp&0x000FFC00)) + (!(tmp&0x3FF00000)))<<25;}\n";
return o;
}
}
| 7,060
|
Java
|
.java
|
zrna-research/akso
| 20
| 6
| 24
|
2020-09-08T00:24:21Z
|
2020-11-02T07:04:29Z
|
64bacd63044ee6b89708039ffaaace3f87beb89d123f4341608a580486b1c347
|
[] |
[
1350,
222,
338,
2657,
327,
72,
46,
244,
55,
53,
54,
56,
49,
244,
55,
53,
54,
57,
990,
6899,
1039,
326,
413,
15462,
1607,
222,
338,
222,
338,
1369,
822,
458,
1760,
451,
17150,
116,
2537,
110,
51,
222,
338,
222,
338,
17150,
116,
2537,
110,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
1549,
341,
222,
338,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
341,
7834,
3870,
222,
338,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
222,
338,
1522,
51,
222,
338,
222,
338,
17150,
116,
2537,
110,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
2979,
222,
338,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
8114,
4800,
222,
338,
418,
7848,
7763,
51,
2819,
341,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
7979,
642,
222,
338,
17150,
116,
2537,
110,
51,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
1337,
4741,
5754,
64,
222,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
5046,
116,
976,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
285,
749,
51,
402,
749,
5964,
56,
55,
87,
12500,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
71,
658,
23602,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
2030,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
1438,
56,
55,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
5616,
51,
3026,
1438,
56,
55,
1723,
64,
222,
485,
924,
4741,
5754,
51,
5154,
7926,
51,
1838,
5046,
116,
976,
64,
222,
222,
1350,
222,
338,
222,
338,
496,
2133,
990,
6899,
1039,
326,
413,
15462,
1607,
222,
588,
222,
842,
6433,
399,
652,
1339,
2041,
9928,
7926,
320,
465,
924,
782,
4468,
1947,
365,
320,
310,
910,
10558,
577,
299,
332,
6458,
884,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
78,
1052,
222,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
54,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
55,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
56,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
57,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
24408,
3785,
29284,
34705,
54,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
24408,
3785,
29284,
34705,
55,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
24408,
3785,
29284,
34705,
56,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
24408,
3785,
29284,
34705,
57,
1052,
303,
339,
465,
924,
17150,
116,
976,
1506,
27301,
365,
320,
310,
17150,
116,
976,
356,
299,
556,
17150,
116,
976,
459,
10670,
315,
411,
332,
10670,
2744,
327,
4911,
46,
15553,
49,
851,
50,
3343,
11753,
51,
13112,
449,
59,
57,
516,
59,
57,
742,
310,
356,
51,
560,
14756,
51,
688,
45,
909,
4322,
749,
40474,
56,
55,
459,
14255,
411,
332,
4911,
15553,
2992,
310,
356,
51,
120,
80,
5595,
1241,
299,
332,
560,
749,
100,
14255,
299,
327,
429,
56,
55,
100,
121,
2516,
10513,
6124,
1936,
1177,
2023,
57,
37942,
310,
461,
356,
64,
303,
339,
465,
924,
17150,
116,
976,
1506,
27301,
7903,
365,
320,
310,
17150,
116,
976,
356,
299,
556,
17150,
116,
976,
459,
10670,
315,
45935,
411,
332,
10670,
2744,
327,
4911,
46,
15553,
49,
16782,
11753,
51,
13112,
449,
59,
57,
516,
59,
57,
742,
310,
356,
51,
285,
14756,
51,
688,
45,
909,
719,
749,
5964,
56,
55,
87,
12500,
459,
35082,
411,
332,
7513,
2992,
310,
356,
51,
560,
14756,
51,
688,
45,
909,
4322,
749,
40474,
56,
55,
71,
658,
23602,
459,
6458,
411,
332,
3917,
1470,
2992,
310,
356,
51,
120,
3340,
768,
299,
332,
429,
56,
55,
100,
121,
928,
8884,
115,
39,
419,
494,
332,
429,
25163,
867,
8884,
115,
884,
310,
356,
51,
120,
3588,
1241,
299,
332,
718,
299,
327,
429,
56,
55,
100,
121,
2516,
10513,
6124,
1936,
1177,
2023,
57,
8884,
115,
39,
419,
494,
332,
585,
867,
299,
244,
53,
8884,
115,
884,
310,
356,
51,
120,
80,
5595,
1241,
299,
332,
280,
434,
1849,
285,
749,
100,
35082,
67,
53,
46,
979,
673,
585,
867,
46,
320,
928,
299,
327,
429,
56,
55,
100,
121,
2516,
10513,
6124,
1936,
1177,
2023,
57,
64,
25163,
867,
66,
54,
64,
4127,
115,
39,
419,
494,
332,
280,
832,
434,
11014,
285,
749,
100,
35082,
67,
53,
509,
25163,
867,
66,
53,
8884,
115,
39,
419,
494,
332,
280,
986,
749,
100,
6458,
66,
928,
8884,
115,
884,
310,
461,
356,
64,
303,
339,
465,
924,
17150,
116,
976,
1506,
27301,
7903,
78,
365,
320,
310,
17150,
116,
976,
356,
299,
556,
17150,
116,
976,
459,
10670,
613,
411,
332,
10670,
2744,
327,
4911,
46,
15553,
49,
851,
50,
3343,
11753,
51,
13112,
244,
53,
516,
45,
115,
50,
54,
13365,
310,
356,
51,
285,
14756,
51,
688,
45,
909,
719,
749,
5964,
56,
55,
87,
12500,
459,
35082,
411,
332,
7513,
2992,
310,
356,
51,
2155,
51,
688,
45,
909,
10922,
1438,
56,
55,
1723,
459,
1472,
411,
244,
53,
49,
244,
54,
1281,
244,
54,
59,
894,
310,
356,
51,
560,
14756,
51,
688,
45,
909,
4322,
749,
1438,
56,
55,
459,
123,
411,
332,
3917,
804,
2992,
310,
356,
51,
120,
3340,
768,
299,
332,
429,
56,
55,
100,
121,
928,
8884,
115,
39,
419,
494,
332,
429,
25163,
867,
8884,
115,
884,
310,
356,
51
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1107,
52,
4205,
28699,
222,
588,
222,
1337,
4741,
5754,
64,
222,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
5046,
116,
976,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
285,
749,
51,
402,
749,
5964,
56,
55,
87,
12500,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
71,
658,
23602,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
40474,
56,
55,
2030,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
560,
749,
51,
35401,
1438,
56,
55,
64,
222,
485,
3405,
116,
2537,
110,
51,
1491,
51,
5616,
51,
3026,
1438,
56,
55,
1723,
64,
222,
485,
924,
4741,
5754,
51,
5154,
7926,
51,
1838,
5046,
116,
976,
64,
222,
222,
1350,
222,
338,
222,
338,
496,
2133,
990,
6899,
1039,
326,
413,
15462,
1607,
222,
588,
222,
842,
6433,
399,
652,
1339,
2041,
9928,
7926,
320,
465,
924,
782,
4468,
1947,
365,
320,
310,
910,
10558,
577,
299,
332,
6458,
884,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
78,
1052,
222,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
54,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
55,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
56,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
57,
1052,
222,
325,
370,
35257,
51,
688,
45,
1940,
24408
] | 7,168,743,112,688,782,000
| true
| false
| false
| false
|
[
1350,
222,
338,
222,
338,
496,
2133,
990,
6899,
1039,
326,
413,
15462,
1607,
222,
588,
222,
842,
6433,
399,
652,
1339,
2041,
9928,
7926,
320,
465,
924,
782,
4468,
1947,
365,
320,
310,
910,
10558,
577,
299,
332,
6458,
884,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
1052,
310,
2886,
5046,
116,
976,
45,
2612,
577,
49,
1506,
27301,
7903,
78,
1052,
222,
222,
325,
370,
35257,
51,
688,
45,
1940,
112,
24408,
3785,
29284,
34705,
54,
1052,
222,
325,
370,
35257
] | 5,517,885,889,735,598,000
| true
|
org/licenses/>.
*/
package generatedobjects;
import axoloti.object.AxoObject;
import axoloti.object.inlet.InletBool32Rising;
import axoloti.object.outlet.OutletFrac32;
import axoloti.object.outlet.OutletFrac32Bipolar;
import axoloti.object.outlet.OutletFrac32Buffer;
import axoloti.object.outlet.OutletInt32;
import axoloti.object.parameter.ParameterInt32Box;
import static generatedobjects.GenTools.writeAxoObject;
/**
*
* @author Johannes Taelman
*/
class Stochastics extends GenTools {
static void generateAll() {
String catName = "rand";
writeAxoObject(catName, createRand());
writeAxoObject(catName, createRandTrigger());
writeAxoObject(catName, createRandTriggerI());
// objs.add(CreatekNoisePoissonOsc1());
// objs
|
i.object.outlet.OutletFrac32;
import axoloti.object.outlet.OutletFrac32Bipolar;
import axoloti.object.outlet.OutletFrac32Buffer;
import axoloti.object.outlet.OutletInt32;
import axoloti.object.parameter.ParameterInt32Box;
import static generatedobjects.GenTools.writeAxoObject;
/**
*
* @author Johannes Taelman
*/
class Stochastics extends GenTools {
static void generateAll() {
String catName = "rand";
writeAxoObject(catName, createRand());
writeAxoObject(catName, createRandTrigger());
writeAxoObject(catName, createRandTriggerI());
// objs.add(CreatekNoisePoissonOsc1());
// objs
|
import axoloti.object.outlet.OutletInt32;
import axoloti.object.parameter.ParameterInt32Box;
import static generatedobjects.GenTools.writeAxoObject;
/**
*
* @author Johannes Taelman
*/
class Stochastics extends GenTools {
static void generateAll() {
String catName = "rand";
writeAxoObject(catName, createRand());
writeAxoObject(catName, createRandTrigger());
writeAxoObject(catName, createRandTriggerI());
// objs.add(CreatekNoisePoissonOsc1());
// objs
|
/**
*
* @author Johannes Taelman
*/
class Stochastics extends GenTools {
static void generateAll() {
String catName = "rand";
writeAxoObject(catName, createRand());
writeAxoObject(catName, createRandTrigger());
writeAxoObject(catName, createRandTriggerI());
// objs.add(CreatekNoisePoissonOsc1());
// objs
|
.add(CreatekNoisePoissonOsc2());
// objs.add(CreatekNoisePoissonOsc3());
// objs.add(CreatekNoisePoissonOsc4());
// objs.add(CreateNoise
|
ErrorComponentImpl.java
|
/FileExtraction/Java_unseen/Etisalat-Egypt_Rodan/src/intruder/ss7/gateway/src/main/java/com/rodan/intruder/ss7/gateway/handler/model/error/ErrorComponentImpl.java
|
/*
* Etisalat Egypt, Open Source
* Copyright 2021, Etisalat Egypt and individual contributors
* by the @authors tag.
*
* This program is free software: you can redistribute it and/or modify
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
/**
* @author Ayman ElSherif
*/
package com.rodan.intruder.ss7.gateway.handler.model.error;
import com.rodan.intruder.ss7.entities.dialog.Ss7MapDialog;
import com.rodan.intruder.ss7.entities.event.model.error.ErrorComponent;
import com.rodan.intruder.ss7.entities.event.model.error.details.NetworkResource;
import com.rodan.intruder.ss7.gateway.dialog.Ss7MapDialogImpl;
import lombok.Builder;
import lombok.Getter;
import lombok.ToString;
import org.mobicents.protocols.ss7.map.api.MAPDialog;
@Getter @ToString(callSuper = true)
public class ErrorComponentImpl extends ErrorComponent {
private Ss7MapDialogImpl ss7Dialog;
private long invokeId;
@Builder
public ErrorComponentImpl(String remoteAddress, long errorCode, boolean isEmParameterless, boolean isEmExtensionContainer,
boolean isEmFacilityNotSup, boolean isEmSMDeliveryFailure, boolean isEmSystemFailure,
NetworkResource networkResource, com.rodan.intruder.ss7.entities.event.model.error.details.AdditionalNetworkResource additionalNetworkResource,
boolean isEmUnknownSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.UnknownSubscriberDiagnostic unknownSubscriberDiagnostic,
boolean isEmAbsentSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberReason absentSubscriberReason,
boolean isEmAbsentSubscriberSM, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM absentSubscriberDiagnosticSM,
com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM additionalAbsentSubscriberSMDiagnostic,
boolean isEmSubscriberBusyForMtSms, boolean isEmCallBarred, com.rodan.intruder.ss7.entities.event.model.error.details.CallBarringCause callBarringCause,
boolean isEmUnauthorizedLCSClient, com.rodan.intruder.ss7.entities.event.model.error.details.UnauthorizedLCSClientDiagnostic unauthorizedLCSClientDiagnostic,
boolean isEmPositionMethodFailure, com.rodan.intruder.ss7.entities.event.model.error.details.PositionMethodFailureDiagnostic positionMethodFailureDiagnostic,
MAPDialog mapDialog, long invokeId) {
super(remoteAddress, errorCode, isEmParameterless, isEmExtensionContainer, isEmFacilityNotSup, isEmSMDeliveryFailure, isEmSystemFailure, networkResource, additionalNetworkResource, isEmUnknownSubscriber, unknownSubscriberDiagnostic, isEmAbsentSubscriber, absentSubscriberReason, isEmAbsentSubscriberSM, absentSubscriberDiagnosticSM, additionalAbsentSubscriberSMDiagnostic, isEmSubscriberBusyForMtSms, isEmCallBarred, callBarringCause, isEmUnauthorizedLCSClient, unauthorizedLCSClientDiagnostic, isEmPositionMethodFailure, positionMethodFailureDiagnostic);
this.ss7Dialog = Ss7MapDialogImpl.builder().jss7Dialog(mapDialog).build();
this.invokeId = invokeId;
}
@Override
public Ss7MapDialog getDialog() {
return ss7Dialog;
}
@Override
public long getInvokeId() {
return invokeId;
}
}
| 4,036
|
Java
|
.java
|
Etisalat-Egypt/Rodan
| 93
| 29
| 1
|
2021-11-29T14:06:49Z
|
2022-01-13T08:48:40Z
|
5f3505958a914cfdec7eb949a4b4d35f86b69dcb6854fc5ec09ba88fcfe10b07
|
[] |
[
1127,
222,
338,
535,
28447,
298,
288,
535,
4701,
404,
49,
3944,
6391,
222,
338,
2657,
244,
55,
53,
55,
54,
49,
535,
28447,
298,
288,
535,
4701,
404,
480,
10139,
13356,
222,
338,
829,
341,
496,
17589,
2621,
51,
222,
338,
222,
338,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
56,
451,
222,
338,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
2056,
222,
588,
222,
222,
1350,
222,
338,
496,
2133,
418,
126,
1607,
10421,
1207,
284,
344,
222,
588,
222,
222,
1337,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
10419,
51,
4543,
51,
1184,
51,
750,
64,
222,
222,
485,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
5962,
51,
30904,
60,
1225,
3742,
64,
222,
485,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
943,
1735,
64,
222,
485,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
4723,
2305,
64,
222,
485,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
10419,
51,
5962,
51,
30904,
60,
1225,
3742,
3499,
64,
222,
485,
13243,
51,
1812,
64,
222,
485,
13243,
51,
11722,
64,
222,
485,
13243,
51,
4602,
64,
222,
485,
1105,
51,
6010,
314,
10753,
51,
31406,
51,
441,
60,
51,
1130,
51,
1256,
51,
5847,
3742,
64,
222,
222,
69,
11722,
496,
4602,
45,
1872,
11086,
299,
878,
46,
222,
942,
462,
3099,
1735,
3499,
2041,
3099,
1735,
320,
303,
964,
377,
120,
60,
1225,
3742,
3499,
10073,
60,
3742,
64,
303,
964,
1964,
11324,
625,
64,
465,
496,
1812,
303,
581,
3099,
1735,
3499,
45,
671,
6564,
2455,
49,
1964,
28943,
49,
1922,
458,
12306,
3026,
2290,
49,
1922,
458,
12306,
4823,
2894,
49,
4997,
1922,
458,
12306,
37695,
1355,
6202,
49,
1922,
458,
12306,
5632,
14990,
7966,
49,
1922,
458,
12306,
1615,
7966,
49,
4997,
8187,
2305,
4017,
2305,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
11644,
4723,
2305,
5408,
4723,
2305,
49,
4997,
1922,
458,
12306,
5850,
16671,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
5850,
16671,
24031,
8675,
16671,
24031,
49,
4997,
1922,
458,
12306,
28738,
16671,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
10457,
40096,
16671,
10457,
49,
4997,
1922,
458,
12306,
28738,
16671,
5632,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
40096,
16671,
24031,
5632,
49,
4997,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
5408,
28738,
16671,
5632,
24031,
49,
4997,
1922,
458,
12306,
16671,
27521,
1580,
32041,
28297,
49,
1922,
458,
12306,
1869,
2914,
1116,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
1869,
71,
865,
318,
19198,
1495,
71,
865,
318,
19198,
49,
4997,
1922,
458,
12306,
21566,
81,
3765,
1503,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
21566,
81,
3765,
1503,
24031,
725,
12989,
81,
3765,
1503,
24031,
49,
4997,
1922,
458,
12306,
2746,
1885,
7966,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
2746,
1885,
7966,
24031,
2764,
1885,
7966,
24031,
49,
4997,
23709,
3742,
2010,
3742,
49,
1964,
11324,
625,
46,
320,
310,
2615,
45,
7004,
2455,
49,
28943,
49,
458,
12306,
3026,
2290,
49,
458,
12306,
4823,
2894,
49,
458,
12306,
37695,
1355,
6202,
49,
458,
12306,
5632,
14990,
7966,
49,
458,
12306,
1615,
7966,
49,
4017,
2305,
49,
5408,
4723,
2305,
49,
458,
12306,
5850,
16671,
49,
8675,
16671,
24031,
49,
458,
12306,
28738,
16671,
49,
40096,
16671,
10457,
49,
458,
12306,
28738,
16671,
5632,
49,
40096,
16671,
24031,
5632,
49,
5408,
28738,
16671,
5632,
24031,
49,
458,
12306,
16671,
27521,
1580,
32041,
28297,
49,
458,
12306,
1869,
2914,
1116,
49,
1495,
71,
865,
318,
19198,
49,
458,
12306,
21566,
81,
3765,
1503,
49,
725,
12989,
81,
3765,
1503,
24031,
49,
458,
12306,
2746,
1885,
7966,
49,
2764,
1885,
7966,
24031,
312,
310,
477,
51,
441,
60,
3742,
299,
377,
120,
60,
1225,
3742,
3499,
51,
4179,
941,
111,
441,
60,
3742,
45,
1130,
3742,
566,
1848,
492,
310,
477,
51,
7845,
625,
299,
11324,
625,
64,
303,
339,
465,
496,
1806,
303,
581,
377,
120,
60,
1225,
3742,
640,
3742,
365,
320,
310,
461,
10073,
60,
3742,
64,
303,
339,
465,
496,
1806,
303,
581,
1964,
640,
8737,
625,
365,
320,
310,
461,
11324,
625,
64,
303,
339,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 973
|
[
3499,
45,
671,
6564,
2455,
49,
1964,
28943,
49,
1922,
458,
12306,
3026,
2290,
49,
1922,
458,
12306,
4823,
2894,
49,
4997,
1922,
458,
12306,
37695,
1355,
6202,
49,
1922,
458,
12306,
5632,
14990,
7966,
49,
1922,
458,
12306,
1615,
7966,
49,
4997,
8187,
2305,
4017,
2305,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
11644,
4723,
2305,
5408,
4723,
2305,
49,
4997,
1922,
458,
12306,
5850,
16671,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
5850,
16671,
24031,
8675,
16671,
24031,
49,
4997,
1922,
458,
12306,
28738,
16671,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
10457,
40096,
16671,
10457,
49,
4997,
1922,
458,
12306,
28738,
16671,
5632,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
40096,
16671,
24031,
5632,
49,
4997,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
5408,
28738,
16671,
5632,
24031,
49,
4997,
1922,
458,
12306,
16671,
27521,
1580,
32041,
28297,
49,
1922,
458,
12306,
1869,
2914,
1116,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
1869,
71,
865,
318,
19198,
1495,
71,
865,
318,
19198,
49,
4997,
1922,
458,
12306,
21566,
81,
3765,
1503,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
21566,
81,
3765,
1503,
24031
] | 3,749,764,476,249,376,000
| true
| false
| false
| false
|
[
28738,
16671,
5632,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
40096,
16671,
24031,
5632,
49,
4997,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51,
750,
51,
3972,
51,
28738,
16671,
24031,
5632,
5408,
28738,
16671,
5632,
24031,
49,
4997,
1922,
458,
12306,
16671,
27521,
1580,
32041,
28297,
49,
1922,
458,
12306,
1869,
2914,
1116,
49,
785,
51,
309,
17225,
51,
13210,
29892,
51,
441,
60,
51,
9259,
51,
1585,
51,
1184,
51
] | 3,835,155,447,964,441,600
| true
|
Impl(String remoteAddress, long errorCode, boolean isEmParameterless, boolean isEmExtensionContainer,
boolean isEmFacilityNotSup, boolean isEmSMDeliveryFailure, boolean isEmSystemFailure,
NetworkResource networkResource, com.rodan.intruder.ss7.entities.event.model.error.details.AdditionalNetworkResource additionalNetworkResource,
boolean isEmUnknownSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.UnknownSubscriberDiagnostic unknownSubscriberDiagnostic,
boolean isEmAbsentSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberReason absentSubscriberReason,
boolean isEmAbsentSubscriberSM, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM absentSubscriberDiagnosticSM,
com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM additionalAbsentSubscriberSMDiagnostic,
boolean isEmSubscriberBusyForMtSms, boolean isEmCallBarred, com.rodan.intruder.ss7.entities.event.model.
|
rodan.intruder.ss7.entities.event.model.error.details.AdditionalNetworkResource additionalNetworkResource,
boolean isEmUnknownSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.UnknownSubscriberDiagnostic unknownSubscriberDiagnostic,
boolean isEmAbsentSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberReason absentSubscriberReason,
boolean isEmAbsentSubscriberSM, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM absentSubscriberDiagnosticSM,
com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM additionalAbsentSubscriberSMDiagnostic,
boolean isEmSubscriberBusyForMtSms, boolean isEmCallBarred, com.rodan.intruder.ss7.entities.event.model.
|
error.details.UnknownSubscriberDiagnostic unknownSubscriberDiagnostic,
boolean isEmAbsentSubscriber, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberReason absentSubscriberReason,
boolean isEmAbsentSubscriberSM, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM absentSubscriberDiagnosticSM,
com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM additionalAbsentSubscriberSMDiagnostic,
boolean isEmSubscriberBusyForMtSms, boolean isEmCallBarred, com.rodan.intruder.ss7.entities.event.model.
|
AbsentSubscriberSM, com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM absentSubscriberDiagnosticSM,
com.rodan.intruder.ss7.entities.event.model.error.details.AbsentSubscriberDiagnosticSM additionalAbsentSubscriberSMDiagnostic,
boolean isEmSubscriberBusyForMtSms, boolean isEmCallBarred, com.rodan.intruder.ss7.entities.event.model.
|
error.details.CallBarringCause callBarringCause,
boolean isEmUnauthorizedLCSClient, com.rodan.intruder.ss7.entities.event.model.error.details.UnauthorizedLCSClientDiagnostic
|
SelfMarryAcceptRequest.java
|
/FileExtraction/Java_unseen/GeorgH93_MarriageMaster/MarriageMaster/src/at/pcgamingfreaks/MarriageMaster/Bukkit/Management/Requests/SelfMarryAcceptRequest.java
|
/*
* Copyright (C) 2022 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package at.pcgamingfreaks.MarriageMaster.Bukkit.Management.Requests;
import at.pcgamingfreaks.Bukkit.Message.Message;
import at.pcgamingfreaks.Bukkit.Message.Sender.SendMethod;
import at.pcgamingfreaks.MarriageMaster.Bukkit.API.AcceptPendingRequest;
import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarriedEvent;
import at.pcgamingfreaks.MarriageMaster.Bukkit.API.Events.MarryEvent;
import at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer;
import at.pcgamingfreaks.MarriageMaster.Bukkit.Database.MarriageData;
import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
import at.pcgamingfreaks.MarriageMaster.Placeholder.Placeholders;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SelfMarryAcceptRequest extends AcceptPendingRequest
{
private static Message messageSelfBroadcastMarriage, messageSelfMarried, messageSelfPlayerCalledOff, messageSelfYouCalledOff, messageSelfPlayerMarryOff;
public static void loadMessages(MarriageMaster plugin)
{
messageSelfMarried = plugin.getLanguage().getMessage("Ingame.Marry.Self.Married").placeholders(Placeholders.PLAYER_NAME);
messageSelfYouCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.YouCalledOff");
messageSelfPlayerMarryOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfPlayerCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerCalledOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfBroadcastMarriage = plugin.getLanguage().getMessage("Ingame.Marry.Self.Broadcast").placeholders(Placeholders.PLAYER1_NAME).placeholders(Placeholders.PLAYER2_NAME);
if (!plugin.getConfiguration().isMarryAnnouncementEnabled()) messageSelfBroadcastMarriage.setSendMethod(SendMethod.DISABLED);
}
public static void unLoadMessages()
{
messageSelfBroadcastMarriage = messageSelfMarried = messageSelfPlayerCalledOff = messageSelfYouCalledOff = messageSelfPlayerMarryOff = null;
}
private final String surname;
public SelfMarryAcceptRequest(@NotNull MarriagePlayer hasToAccept, @NotNull MarriagePlayer sender, @Nullable String surname)
{
super(hasToAccept, sender);
this.surname = surname;
}
@Override
public void onAccept()
{
if(getPlayersThatCanCancel().length == 0 || !getPlayersThatCanCancel()[0].isOnline() || !getPlayerThatHasToAccept().isOnline()) return;
MarriagePlayer player1 = getPlayersThatCanCancel()[0], player2 = getPlayerThatHasToAccept();
MarryEvent marryEvent = new MarryEvent(player1, player2, player1.getPlayerOnline(), surname);
Bukkit.getPluginManager().callEvent(marryEvent);
if(!marryEvent.isCancelled())
{
MarriageData marriage = new MarriageData(getPlayersThatCanCancel()[0], getPlayerThatHasToAccept(), getPlayersThatCanCancel()[0], surname);
MarriageMaster.getInstance().getDatabase().cachedMarry(marriage);
player2.send(messageSelfMarried, player1);
player1.send(messageSelfMarried, player2);
messageSelfBroadcastMarriage.broadcast(player1, player2);
MarriageMaster.getInstance().getServer().getPluginManager().callEvent(new MarriedEvent(marriage));
}
}
@Override
public void onDeny()
{
if(getPlayersThatCanCancel().length == 0 || !getPlayersThatCanCancel()[0].isOnline() || !getPlayerThatHasToAccept().isOnline()) return;
MarriagePlayer p1 = getPlayersThatCanCancel()[0], p2 = getPlayerThatHasToAccept();
p2.send(messageSelfYouCalledOff);
p1.send(messageSelfPlayerCalledOff, p2);
}
@Override
public void onCancel(@NotNull MarriagePlayer player)
{
if(getPlayersThatCanCancel().length == 0 || !getPlayersThatCanCancel()[0].isOnline() || !getPlayerThatHasToAccept().isOnline()) return;
MarriagePlayer p1 = getPlayersThatCanCancel()[0], p2 = getPlayerThatHasToAccept();
p1.send(messageSelfYouCalledOff);
p2.send(messageSelfPlayerCalledOff, p1);
}
@Override
protected void onDisconnect(@NotNull MarriagePlayer player)
{
if(player.equals(getPlayersThatCanCancel()[0]))
{
getPlayerThatHasToAccept().send(messageSelfPlayerMarryOff, player);
}
else
{
getPlayersThatCanCancel()[0].send(messageSelfPlayerMarryOff, player);
}
}
}
| 4,931
|
Java
|
.java
|
GeorgH93/MarriageMaster
| 102
| 89
| 83
|
2014-02-13T15:21:57Z
|
2024-05-07T22:08:51Z
|
32ca893ecedad4cff7c7ebe12c7c3075a2ca59c127ee3aa136d7cee95645f34c
|
[] |
[
1127,
222,
338,
280,
2657,
327,
72,
46,
244,
55,
53,
55,
55,
7203,
1107,
77,
62,
56,
222,
338,
222,
338,
280,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
280,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
222,
338,
280,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
222,
338,
280,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
280,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
280,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
280,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
280,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
280,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
280,
7979,
642,
477,
3477,
51,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
8596,
51,
10343,
64,
222,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
982,
17120,
51,
1193,
51,
1193,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
982,
17120,
51,
1193,
51,
10455,
51,
4878,
1885,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
2571,
51,
7082,
10710,
1123,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
2571,
51,
5015,
51,
5695,
14055,
1167,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
2571,
51,
5015,
51,
82,
11066,
1167,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
2571,
51,
5695,
39113,
3516,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
3969,
51,
5695,
39113,
768,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
982,
17120,
51,
5695,
39113,
8801,
64,
222,
485,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
18378,
51,
9194,
19484,
64,
222,
222,
485,
1105,
51,
20402,
51,
982,
17120,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
6825,
64,
222,
222,
942,
462,
6617,
82,
11066,
7082,
1123,
2041,
16209,
10710,
1123,
222,
128,
222,
221,
2072,
924,
4587,
1492,
8183,
16985,
5695,
39113,
49,
1492,
8183,
5695,
14055,
49,
1492,
8183,
3516,
9406,
2542,
49,
1492,
8183,
4296,
9406,
2542,
49,
1492,
8183,
3516,
82,
11066,
2542,
64,
499,
221,
942,
924,
782,
2480,
6389,
45,
5695,
39113,
8801,
3985,
46,
222,
221,
128,
376,
221,
1454,
8183,
5695,
14055,
2281,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
5695,
14055,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
4296,
9406,
2542,
665,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
4296,
9406,
2542,
742,
376,
221,
1454,
8183,
3516,
82,
11066,
2542,
283,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
3516,
2542,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
3516,
9406,
2542,
280,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
3516,
9406,
2542,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
16985,
5695,
39113,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
16985,
1912,
47235,
45,
9194,
19484,
51,
19409,
54,
100,
2491,
566,
47235,
45,
9194,
19484,
51,
19409,
55,
100,
2491,
312,
376,
221,
344,
1445,
2809,
51,
38309,
941,
316,
82,
11066,
26073,
31033,
4006,
1177,
1492,
8183,
16985,
5695,
39113,
51,
489,
4878,
1885,
45,
4878,
1885,
51,
30883,
312,
222,
221,
130,
499,
221,
942,
924,
782,
725,
3028,
6389,
365,
222,
221,
128,
376,
221,
1454,
8183,
16985,
5695,
39113,
299,
1492,
8183,
5695,
14055,
299,
1492,
8183,
3516,
9406,
2542,
299,
1492,
8183,
4296,
9406,
2542,
299,
1492,
8183,
3516,
82,
11066,
2542,
299,
762,
64,
222,
221,
130,
499,
221,
2072,
1175,
910,
328,
21051,
64,
499,
221,
942,
6617,
82,
11066,
7082,
1123,
4810,
4936,
8369,
39113,
3516,
1421,
724,
7082,
49,
496,
4936,
8369,
39113,
3516,
7056,
49,
496,
6825,
910,
328,
21051,
46,
222,
221,
128,
376,
221,
5282,
45,
2057,
724,
7082,
49,
7056,
312,
376,
221,
597,
51,
37084,
299,
328,
21051,
64,
222,
221,
130,
499,
221,
69,
1806,
222,
221,
942,
782,
563,
7082,
365,
222,
221,
128,
376,
221,
344,
45,
390,
17670,
4987,
4460,
7034,
941,
1340,
630,
244,
53,
1293,
673,
390,
17670,
4987,
4460,
7034,
8577,
53,
1015,
316,
14097,
365,
1293,
673,
32872,
4987,
4008,
724,
7082,
941,
316,
14097,
1177,
461,
64,
376,
221,
5695,
39113,
3516,
4376,
54,
299,
640,
17670,
4987,
4460,
7034,
8577,
53,
636,
4376,
55,
299,
640,
3516,
4987,
4008,
724,
7082,
492,
376,
221,
82,
11066,
1167,
364,
11066,
1167,
299,
556,
507,
11066,
1167,
45,
3857,
54,
49,
4376,
55,
49,
4376,
54,
51,
32872,
14097,
1046,
328,
21051,
312,
376,
221,
982,
17120,
51,
390,
43417,
941,
1872,
1167,
45,
114,
11066,
1167,
312,
376,
221,
344,
3848,
114,
11066,
1167,
51,
316,
23092,
1177,
376,
221,
128,
374,
221,
5695,
39113,
768,
11633,
39113,
299,
556,
8369,
39113,
768,
45,
390,
17670,
4987,
4460,
7034,
8577,
53,
636,
640,
3516,
4987,
4008,
724,
7082,
1046,
640,
17670,
4987,
4460,
7034,
8577,
53,
636,
328,
21051,
312,
374,
221,
5695,
39113,
8801,
51,
7432,
941,
390,
3969,
941,
10570,
82,
11066,
45
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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,
840,
51,
1982,
108,
9439,
107,
1268,
120,
51,
5695,
39113,
8801,
51,
18378,
51,
9194,
19484,
64,
222,
222,
485,
1105,
51,
20402,
51,
982,
17120,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
485,
1105,
51,
15575,
51,
8839,
51,
6825,
64,
222,
222,
942,
462,
6617,
82,
11066,
7082,
1123,
2041,
16209,
10710,
1123,
222,
128,
222,
221,
2072,
924,
4587,
1492,
8183,
16985,
5695,
39113,
49,
1492,
8183,
5695,
14055,
49,
1492,
8183,
3516,
9406,
2542,
49,
1492,
8183,
4296,
9406,
2542,
49,
1492,
8183,
3516,
82,
11066,
2542,
64,
499,
221,
942,
924,
782,
2480,
6389,
45,
5695,
39113,
8801,
3985,
46,
222,
221,
128,
376,
221,
1454,
8183,
5695,
14055,
2281,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
5695,
14055,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
4296,
9406,
2542,
665,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
4296,
9406,
2542,
742,
376,
221,
1454,
8183,
3516,
82,
11066,
2542,
283,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
3516,
2542,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
3516,
9406,
2542,
280,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
3516,
9406,
2542,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
16985,
5695,
39113,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51
] | 5,745,931,322,053,743,000
| true
| false
| false
| false
|
[
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
5695,
14055,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
4296,
9406,
2542,
665,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
4296,
9406,
2542,
742,
376,
221,
1454,
8183,
3516,
82,
11066,
2542,
283,
299,
3985,
51,
390,
5980,
941,
7724,
459,
402,
3642,
51,
82,
11066,
51,
8183,
51,
3516,
2542,
1912,
47235,
45,
9194,
19484,
51,
19409,
100,
2491,
312,
376,
221,
1454,
8183,
3516,
9406,
2542,
280
] | -50,859,225,161,958,060
| true
|
MarriageData;
import at.pcgamingfreaks.MarriageMaster.Bukkit.MarriageMaster;
import at.pcgamingfreaks.MarriageMaster.Placeholder.Placeholders;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SelfMarryAcceptRequest extends AcceptPendingRequest
{
private static Message messageSelfBroadcastMarriage, messageSelfMarried, messageSelfPlayerCalledOff, messageSelfYouCalledOff, messageSelfPlayerMarryOff;
public static void loadMessages(MarriageMaster plugin)
{
messageSelfMarried = plugin.getLanguage().getMessage("Ingame.Marry.Self.Married").placeholders(Placeholders.PLAYER_NAME);
messageSelfYouCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.YouCalledOff");
messageSelfPlayerMarryOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfPlayerCalledOff
|
.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SelfMarryAcceptRequest extends AcceptPendingRequest
{
private static Message messageSelfBroadcastMarriage, messageSelfMarried, messageSelfPlayerCalledOff, messageSelfYouCalledOff, messageSelfPlayerMarryOff;
public static void loadMessages(MarriageMaster plugin)
{
messageSelfMarried = plugin.getLanguage().getMessage("Ingame.Marry.Self.Married").placeholders(Placeholders.PLAYER_NAME);
messageSelfYouCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.YouCalledOff");
messageSelfPlayerMarryOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfPlayerCalledOff
|
riage, messageSelfMarried, messageSelfPlayerCalledOff, messageSelfYouCalledOff, messageSelfPlayerMarryOff;
public static void loadMessages(MarriageMaster plugin)
{
messageSelfMarried = plugin.getLanguage().getMessage("Ingame.Marry.Self.Married").placeholders(Placeholders.PLAYER_NAME);
messageSelfYouCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.YouCalledOff");
messageSelfPlayerMarryOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfPlayerCalledOff
|
plugin.getLanguage().getMessage("Ingame.Marry.Self.Married").placeholders(Placeholders.PLAYER_NAME);
messageSelfYouCalledOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.YouCalledOff");
messageSelfPlayerMarryOff = plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfPlayerCalledOff
|
= plugin.getLanguage().getMessage("Ingame.Marry.Self.PlayerCalledOff").placeholders(Placeholders.PLAYER_NAME);
messageSelfBroadcastMarriage = plugin.getLanguage().getMessage("Ingame.Marry.
|
MainActivity.java
|
/FileExtraction/Java_unseen/emanuele-f_RemoteCapture/app/src/main/java/com/emanuelef/remote_capture/MainActivity.java
|
/*
This file is part of RemoteCapture.
RemoteCapture is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RemoteCapture is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RemoteCapture. If not, see <http://www.gnu.org/licenses/>.
Copyright 2019 by Emanuele Faranda
*/
package com.emanuelef.remote_capture;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.Uri;
import android.net.VpnService;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.AsyncTaskLoader;
import androidx.loader.content.Loader;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import androidx.viewpager.widget.ViewPager;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import java.util.List;
import cat.ereza.customactivityoncrash.config.CaocConfig;
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks<List<AppDescriptor>>, AppStateListener {
SharedPreferences mPrefs;
Menu mMenu;
int mFilterUid;
boolean mOpenAppsWhenDone;
List<AppDescriptor> mInstalledApps;
AppState mState;
StatusFragment mStatusFragment;
ConnectionsFragment mConnectionsFragment;
private static final int REQUEST_CODE_VPN = 2;
private static final int MENU_ITEM_APP_SELECTOR_IDX = 0;
public static final int OPERATION_SEARCH_LOADER = 23;
/* App state handling: ready -> starting -> running -> stopping -> ready */
enum AppState {
ready,
starting,
running,
stopping
}
public class MainPagerAdapter extends FragmentPagerAdapter {
public MainPagerAdapter(FragmentManager fm) {
super(fm);
}
@NonNull
@Override
public Fragment getItem(int position) {
if (position == 0) {
return new StatusFragment();
} else {
return new ConnectionsFragment();
}
}
@Override
public CharSequence getPageTitle(int position) {
if (position == 0) {
return getResources().getString(R.string.status_view);
} else {
return getResources().getString(R.string.connections_view);
}
}
@Override
public int getCount() {
return 2;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFilterUid = CaptureService.getUidFilter();
mOpenAppsWhenDone = false;
mInstalledApps = null;
mStatusFragment = null;
mConnectionsFragment = null;
CaocConfig.Builder.create()
.errorDrawable(R.drawable.ic_app_crash)
.apply();
setContentView(R.layout.main_activity);
ViewPager viewPager = (ViewPager) findViewById(R.id.main_viewpager);
MainPagerAdapter pagerAdapter = new MainPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState != null) {
mConnectionsFragment = (ConnectionsFragment) getSupportFragmentManager().getFragment(savedInstanceState, "ConnectionsFragment");
}
startLoadingApps();
LocalBroadcastManager bcast_man = LocalBroadcastManager.getInstance(this);
/* Register for service status */
bcast_man.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String status = intent.getStringExtra(CaptureService.SERVICE_STATUS_KEY);
if (status != null) {
if (status.equals(CaptureService.SERVICE_STATUS_STARTED) && (mState == AppState.starting)) {
appStateRunning();
} else if (status.equals(CaptureService.SERVICE_STATUS_STOPPED)) {
appStateReady();
}
}
}
}, new IntentFilter(CaptureService.ACTION_SERVICE_STATUS));
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if(mConnectionsFragment != null)
getSupportFragmentManager().putFragment(outState, "ConnectionsFragment", mConnectionsFragment);
}
@Override
public void appStateReady() {
mState = AppState.ready;
if (mStatusFragment != null)
mStatusFragment.appStateReady();
mMenu.getItem(MENU_ITEM_APP_SELECTOR_IDX).setEnabled(true);
}
@Override
public void appStateStarting() {
mState = AppState.starting;
if (mStatusFragment != null)
mStatusFragment.appStateStarting();
mMenu.getItem(MENU_ITEM_APP_SELECTOR_IDX).setEnabled(false);
}
@Override
public void appStateRunning() {
mState = AppState.running;
mMenu.getItem(MENU_ITEM_APP_SELECTOR_IDX).setEnabled(false);
if (mStatusFragment != null)
mStatusFragment.appStateRunning();
if (mConnectionsFragment != null)
mConnectionsFragment.reset();
}
@Override
public void appStateStopping() {
mState = AppState.stopping;
if (mStatusFragment != null)
mStatusFragment.appStateStopping();
mMenu.getItem(MENU_ITEM_APP_SELECTOR_IDX).setEnabled(false);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.settings_menu, menu);
mMenu = menu;
recheckFragments();
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(intent);
return true;
} else if (id == R.id.action_show_app_filter) {
openAppSelector();
return true;
} else if (id == R.id.action_about) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/emanuele-f/RemoteCapture"));
startActivity(browserIntent);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_VPN && resultCode == RESULT_OK) {
Intent intent = new Intent(MainActivity.this, CaptureService.class);
Bundle bundle = new Bundle();
bundle.putInt(Prefs.PREF_UID_FILTER, mFilterUid);
intent.putExtra("settings", bundle);
Log.d("Main", "onActivityResult -> start CaptureService");
startService(intent);
}
}
@NonNull
@Override
public Loader<List<AppDescriptor>> onCreateLoader(int id, @Nullable Bundle args) {
return new AsyncTaskLoader<List<AppDescriptor>>(this) {
@Nullable
@Override
public List<AppDescriptor> loadInBackground() {
Log.d("AppsLoader", "Loading APPs...");
return Utils.getInstalledApps(getContext());
}
};
}
@Override
public void onLoadFinished(@NonNull Loader<List<AppDescriptor>> loader, List<AppDescriptor> data) {
Log.d("AppsLoader", data.size() + " APPs loaded");
mInstalledApps = data;
if (mFilterUid != -1) {
/* An filter is active, try to set the corresponding app image */
AppDescriptor app = findAppByUid(mFilterUid);
if (app != null)
setSelectedAppIcon(app);
}
if (mOpenAppsWhenDone)
openAppSelector();
}
@Override
public void onLoaderReset(@NonNull Loader<List<AppDescriptor>> loader) {
}
AppDescriptor findAppByUid(int uid) {
if (mInstalledApps == null)
return (null);
for (int i = 0; i < mInstalledApps.size(); i++) {
AppDescriptor app = mInstalledApps.get(i);
if (app.getUid() == uid) {
return (app);
}
}
return (null);
}
/* Try to determine the current app state */
private void setAppState() {
boolean is_active = CaptureService.isServiceActive();
if (!is_active)
appStateReady();
else
appStateRunning();
}
public void toggleService() {
if (CaptureService.isServiceActive()) {
CaptureService.stopService();
appStateStopping();
} else {
Intent vpnPrepareIntent = VpnService.prepare(MainActivity.this);
if (vpnPrepareIntent != null)
startActivityForResult(vpnPrepareIntent, REQUEST_CODE_VPN);
else
onActivityResult(REQUEST_CODE_VPN, RESULT_OK, null);
appStateStarting();
}
}
void setStatusFragment(StatusFragment screen) {
mStatusFragment = screen;
recheckFragments();
}
void setConnectionsFragment(ConnectionsFragment view) {
mConnectionsFragment = view;
recheckFragments();
}
private void recheckFragments() {
/* Must wait for the fragments to properly update them */
if((mStatusFragment != null) && (mConnectionsFragment != null) && (mMenu != null)) {
// Possibly set an initial app state
setAppState();
}
}
AppState getState() {
return(mState);
}
private void startLoadingApps() {
LoaderManager lm = LoaderManager.getInstance(this);
Loader<List<AppDescriptor>> loader = lm.getLoader(OPERATION_SEARCH_LOADER);
Log.d("startLoadingApps", "Loader? " + Boolean.toString(loader != null));
if(loader==null)
loader = lm.initLoader(OPERATION_SEARCH_LOADER, null, this);
else
loader = lm.restartLoader(OPERATION_SEARCH_LOADER, null, this);
loader.forceLoad();
}
private void setSelectedAppIcon(AppDescriptor app) {
// clone the drawable to avoid a "zoom-in" effect when clicked
mMenu.getItem(MENU_ITEM_APP_SELECTOR_IDX).setIcon(app.getIcon().getConstantState().newDrawable());
}
private void openAppSelector() {
if(mInstalledApps == null) {
/* The applications loader has not finished yet. */
mOpenAppsWhenDone = true;
return;
}
mOpenAppsWhenDone = false;
AppsView apps = new AppsView(this, mInstalledApps);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.app_filter);
builder.setView(apps);
final AlertDialog alert = builder.create();
apps.setSelectedAppListener(new AppsView.OnSelectedAppListener() {
@Override
public void onSelectedApp(AppDescriptor app) {
mFilterUid = app.getUid();
setSelectedAppIcon(app);
// dismiss the dialog
alert.cancel();
}
});
alert.show();
}
}
| 12,422
|
Java
|
.java
|
emanuele-f/RemoteCapture
| 18
| 3
| 3
|
2019-09-08T20:12:26Z
|
2020-01-06T18:17:20Z
|
022ae640d0f168caf8224991fa2534f421b05323baadad65e16fb4b9f620299a
|
[] |
[
1127,
303,
1369,
822,
458,
1760,
451,
13598,
11882,
51,
465,
13598,
11882,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
303,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
641,
9582,
829,
303,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
1196,
49,
575,
303,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
465,
13598,
11882,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
303,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
303,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
303,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
465,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
303,
7979,
642,
13598,
11882,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
465,
2657,
244,
55,
53,
54,
62,
829,
535,
1607,
359,
293,
38683,
16932,
222,
1975,
222,
222,
1337,
785,
51,
37055,
359,
293,
107,
51,
7004,
100,
14120,
64,
222,
222,
485,
2616,
51,
1304,
51,
16985,
12715,
64,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
1304,
51,
8770,
64,
222,
485,
2616,
51,
1304,
51,
8770,
2365,
64,
222,
485,
2616,
51,
1304,
51,
32235,
64,
222,
485,
2616,
51,
1317,
51,
5729,
64,
222,
485,
2616,
51,
1317,
51,
29679,
1201,
64,
222,
222,
485,
10484,
51,
4341,
51,
10082,
64,
222,
485,
10484,
51,
4341,
51,
6825,
64,
222,
485,
10484,
51,
32355,
51,
745,
51,
40628,
64,
222,
485,
10484,
51,
32355,
51,
745,
51,
35181,
64,
222,
485,
10484,
51,
9883,
51,
745,
51,
5763,
64,
222,
485,
10484,
51,
9883,
51,
745,
51,
36955,
64,
222,
485,
10484,
51,
9883,
51,
745,
51,
5763,
17554,
4433,
64,
222,
485,
10484,
51,
4579,
51,
745,
51,
4903,
1590,
64,
222,
485,
10484,
51,
4579,
51,
1304,
51,
41858,
4903,
64,
222,
485,
10484,
51,
4579,
51,
1304,
51,
4903,
64,
222,
485,
10484,
51,
1717,
17060,
4031,
51,
1304,
51,
3340,
16985,
1590,
64,
222,
485,
10484,
51,
29565,
51,
14366,
1590,
64,
222,
485,
10484,
51,
1090,
23591,
51,
3872,
51,
42566,
64,
222,
222,
485,
2616,
51,
519,
51,
4775,
64,
222,
485,
2616,
51,
1058,
51,
1353,
64,
222,
485,
2616,
51,
1090,
51,
2689,
64,
222,
485,
2616,
51,
1090,
51,
2689,
16646,
64,
222,
485,
2616,
51,
1090,
51,
6362,
64,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
10558,
51,
767,
6224,
51,
3005,
6904,
286,
28328,
51,
1180,
51,
15041,
561,
1081,
64,
222,
222,
942,
462,
37570,
2041,
36463,
4584,
12400,
1590,
51,
4903,
17742,
65,
739,
65,
1306,
4336,
16713,
2013,
1095,
2239,
320,
303,
42116,
364,
20042,
64,
303,
9999,
364,
2689,
64,
303,
648,
364,
2365,
18233,
64,
303,
1922,
364,
2981,
17105,
5797,
9114,
64,
303,
1701,
65,
1306,
4336,
67,
364,
23309,
17105,
64,
303,
2013,
1095,
364,
1095,
64,
303,
5415,
5763,
364,
1551,
5763,
64,
303,
9475,
120,
5763,
364,
16798,
5763,
64,
465,
964,
924,
1175,
648,
27723,
100,
3535,
100,
43444,
299,
244,
55,
64,
303,
964,
924,
1175,
648,
48584,
100,
10938,
100,
6876,
100,
4635,
776,
100,
19995,
299,
244,
53,
64,
303,
581,
924,
1175,
648,
41711,
2909,
100,
17884,
100,
5703,
546,
299,
244,
55,
56,
64,
465,
1276,
2013,
1621,
9946,
63,
8768,
984,
8074,
984,
3991,
984,
32035,
984,
8768,
244,
588,
303,
3858,
2013,
1095,
320,
310,
8768,
49,
310,
8074,
49,
310,
3991,
49,
310,
32035,
303,
339,
465,
581,
462,
6697,
17554,
4433,
2041,
18666,
17554,
4433,
320,
310,
581,
6697,
17554,
4433,
45,
36955,
28922,
46,
320,
343,
2615,
45,
12398,
312,
310,
339,
603,
496,
10082,
310,
496,
1806,
310,
581,
18666,
26779,
45,
429,
2764,
46,
320,
343,
434,
327,
2719,
630,
244,
53,
46,
320,
419,
461,
556,
5415,
5763,
492,
343,
339,
832,
320,
419,
461,
556,
9475,
120,
5763,
492,
343,
339,
310,
339,
603,
496,
1806,
310,
581,
36572,
640,
1983,
3188,
45,
429,
2764,
46,
320,
343,
434,
327,
2719,
630,
244,
53,
46,
320,
419,
461,
640,
6061,
941,
7080,
45,
87,
51,
819,
51,
1535,
100,
1090,
312,
343,
339,
832,
320,
419,
461,
640,
6061,
941,
7080,
45,
87,
51,
819,
51,
16707,
100,
1090,
312,
343,
339,
310,
339,
6934,
496,
1806,
310,
581,
648,
640,
1552,
365,
320,
343,
461,
244,
55,
64,
310,
339,
303,
339,
465,
496,
1806,
303,
2532,
782,
16456,
45,
4775,
19902,
46,
320,
310,
2615,
51,
20217,
45,
20731,
312,
603,
364,
2365,
18233,
299,
30237,
1201,
51,
390,
18233,
2365,
492,
310,
364,
2981,
17105,
5797,
9114,
299,
920,
64,
310,
364,
23309,
17105,
299,
762,
64,
310,
364,
1551,
5763,
299,
762,
64,
310,
364,
16798,
5763,
299,
762,
64,
603,
38060,
561,
1081,
51,
1812,
51,
1315,
365,
419,
657,
750,
14439,
45,
87,
51,
16926,
51,
314,
100,
745,
100,
28328,
46,
419,
657,
4740,
492,
603,
31090,
45,
87,
51,
3106,
51,
1850,
100,
6904,
312,
603,
4340,
17554,
2221,
17554,
299,
327,
42566,
46,
15510,
45,
87,
51,
333,
51,
1850,
100,
1090,
23591,
312,
310,
6697,
17554,
4433,
40110,
4433,
299,
556,
6697,
17554,
4433,
45,
390,
4417,
36955,
1052,
310,
2221,
17554,
51,
43226,
45,
23591,
4433,
312,
603,
364,
20042,
299,
42838,
1590,
51,
13729,
32235,
45,
597,
312,
603,
434,
327,
20731,
882,
762,
46,
320,
343,
364,
16798,
5763,
299,
327,
16798,
5763,
46,
640,
4417,
36955,
941,
390,
5763,
45,
20731,
49,
332,
16798,
5763,
742,
310,
339,
603,
1496,
7077,
17105,
492,
603,
7099,
16985,
1590,
342,
2420,
100,
1607,
299,
7099,
16985,
1590,
51,
7432,
45,
597,
312,
603,
1276,
7017,
456,
2733,
2302,
588,
310,
342,
2420,
100,
1607,
51,
3334,
12715,
45,
909,
37177,
12715,
365,
320,
343,
496,
1806,
343,
581,
782,
563,
11709,
45,
1237,
1637,
49,
11790,
8935,
46,
320,
419,
910,
2302,
299,
8935,
51,
7080,
9124,
45,
11882,
1201,
51,
12748,
100,
5965,
100,
3319,
312,
2125,
434
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
51,
819,
51,
1535,
100,
1090,
312,
343,
339,
832,
320,
419,
461,
640,
6061,
941,
7080,
45,
87,
51,
819,
51,
16707,
100,
1090,
312,
343,
339,
310,
339,
6934,
496,
1806,
310,
581,
648,
640,
1552,
365,
320,
343,
461,
244,
55,
64,
310,
339,
303,
339,
465,
496,
1806,
303,
2532,
782,
16456,
45,
4775,
19902,
46,
320,
310,
2615,
51,
20217,
45,
20731,
312,
603,
364,
2365,
18233,
299,
30237,
1201,
51,
390,
18233,
2365,
492,
310,
364,
2981,
17105,
5797,
9114,
299,
920,
64,
310,
364,
23309,
17105,
299,
762,
64,
310,
364,
1551,
5763,
299,
762,
64,
310,
364,
16798,
5763,
299,
762,
64,
603,
38060,
561,
1081,
51,
1812,
51,
1315,
365,
419,
657,
750,
14439,
45,
87,
51,
16926,
51,
314,
100,
745,
100,
28328,
46,
419,
657,
4740,
492,
603,
31090,
45,
87,
51,
3106,
51,
1850,
100,
6904,
312,
603,
4340,
17554,
2221,
17554,
299,
327,
42566,
46,
15510,
45,
87,
51,
333,
51,
1850,
100,
1090,
23591,
312,
310,
6697,
17554,
4433,
40110,
4433,
299,
556,
6697,
17554,
4433,
45,
390,
4417,
36955,
1052,
310,
2221,
17554,
51,
43226,
45,
23591,
4433,
312,
603,
364,
20042,
299,
42838,
1590,
51,
13729,
32235,
45,
597,
312,
603,
434,
327,
20731,
882,
762,
46,
320,
343,
364,
16798,
5763,
299,
327,
16798,
5763,
46,
640,
4417,
36955,
941,
390,
5763,
45,
20731,
49,
332,
16798,
5763,
742,
310,
339,
603,
1496,
7077,
17105,
492,
603,
7099,
16985,
1590,
342,
2420,
100,
1607,
299,
7099,
16985,
1590,
51,
7432,
45,
597,
312,
603,
1276,
7017,
456,
2733,
2302,
588,
310,
342,
2420,
100,
1607,
51,
3334,
12715,
45,
909,
37177,
12715,
365,
320,
343,
496,
1806,
343,
581,
782,
563,
11709,
45,
1237,
1637,
49,
11790,
8935,
46,
320,
419,
910,
2302
] | 7,844,680,107,694,039,000
| true
| false
| false
| false
|
[
4340,
17554,
2221,
17554,
299,
327,
42566,
46,
15510,
45,
87,
51,
333,
51,
1850,
100,
1090,
23591,
312,
310,
6697,
17554,
4433,
40110,
4433,
299,
556,
6697,
17554,
4433,
45,
390,
4417,
36955,
1052,
310,
2221,
17554,
51,
43226,
45,
23591,
4433,
312,
603,
364,
20042,
299,
42838,
1590,
51,
13729,
32235,
45,
597,
312,
603,
434,
327,
20731,
882,
762,
46,
320,
343,
364,
16798,
5763,
299,
327,
16798,
5763,
46,
640,
4417,
36955,
941,
390,
5763,
45,
20731,
49,
332,
16798,
5763,
742,
310,
339,
603,
1496,
7077,
17105,
492,
603,
7099,
16985,
1590,
342,
2420,
100
] | -8,769,289,744,679,316,000
| true
|
.string.status_view);
} else {
return getResources().getString(R.string.connections_view);
}
}
@Override
public int getCount() {
return 2;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFilterUid = CaptureService.getUidFilter();
mOpenAppsWhenDone = false;
mInstalledApps = null;
mStatusFragment = null;
mConnectionsFragment = null;
CaocConfig.Builder.create()
.errorDrawable(R.drawable.ic_app_crash)
.apply();
setContentView(R.layout.main_activity);
ViewPager viewPager = (ViewPager) findViewById(R.id.main_viewpager);
MainPagerAdapter pagerAdapter = new MainPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState!= null) {
mConnectionsFragment = (ConnectionsFragment) getSupportFragmentManager().getFragment(savedInstanceState, "ConnectionsFragment");
}
startLoadingApps();
LocalBroadcastManager bcast_
|
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFilterUid = CaptureService.getUidFilter();
mOpenAppsWhenDone = false;
mInstalledApps = null;
mStatusFragment = null;
mConnectionsFragment = null;
CaocConfig.Builder.create()
.errorDrawable(R.drawable.ic_app_crash)
.apply();
setContentView(R.layout.main_activity);
ViewPager viewPager = (ViewPager) findViewById(R.id.main_viewpager);
MainPagerAdapter pagerAdapter = new MainPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState!= null) {
mConnectionsFragment = (ConnectionsFragment) getSupportFragmentManager().getFragment(savedInstanceState, "ConnectionsFragment");
}
startLoadingApps();
LocalBroadcastManager bcast_
|
= null;
mConnectionsFragment = null;
CaocConfig.Builder.create()
.errorDrawable(R.drawable.ic_app_crash)
.apply();
setContentView(R.layout.main_activity);
ViewPager viewPager = (ViewPager) findViewById(R.id.main_viewpager);
MainPagerAdapter pagerAdapter = new MainPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState!= null) {
mConnectionsFragment = (ConnectionsFragment) getSupportFragmentManager().getFragment(savedInstanceState, "ConnectionsFragment");
}
startLoadingApps();
LocalBroadcastManager bcast_
|
ViewPager viewPager = (ViewPager) findViewById(R.id.main_viewpager);
MainPagerAdapter pagerAdapter = new MainPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState!= null) {
mConnectionsFragment = (ConnectionsFragment) getSupportFragmentManager().getFragment(savedInstanceState, "ConnectionsFragment");
}
startLoadingApps();
LocalBroadcastManager bcast_
|
man = LocalBroadcastManager.getInstance(this);
/* Register for service status */
bcast_man.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String status
|
TimetableActivity.java
|
/FileExtraction/Java_unseen/Varun-garg_GBU_Timetables/app/src/main/java/com/varun/gbu_timetables/TimetableActivity.java
|
package com.varun.gbu_timetables;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.varun.gbu_timetables.data.model.TimeTableBasic;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Type;
import java.util.HashSet;
public class TimetableActivity extends AppCompatActivity {
private final int MY_PERMISSIONS_REQUEST_WRITE_STORAGE = 123;
HashSet<TimeTableBasic> existing_data;
SharedPreferences prefs;
Gson gson = new Gson();
String existing_TAG = "favourites";
String json;
Type favourites_type = new TypeToken<HashSet<TimeTableBasic>>() {
}.getType();
SharedPreferences.Editor editor;
String message = "";
private TimeTableBasic myclass;
private final String myclass_TAG = "myclass";
private Boolean isFABOpen = false;
private FloatingActionButton fab_main, fab_fav, fab_myclass, fab_share;
private int saved_theme;
public static File SaveBitmapasPNG(Bitmap bitmap, String dir) {
OutputStream os = null;
try {
File file = new File(dir, "image" + System.currentTimeMillis() + ".png");
os = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
bitmap.recycle();
return file;
} catch (IOException e) {
bitmap.recycle();
Log.e("combineImages", "problem combining images", e);
return null;
}
}
private void reload() {
json = prefs.getString(existing_TAG, null);
existing_data = gson.fromJson(json, favourites_type);
if (existing_data == null)
existing_data = new HashSet<>();
}
public TimeTableBasic getCurrentBasic() {
String Title = getIntent().getExtras().getString("Timetable_title");
String Type = getIntent().getExtras().getString("Type");
Long Id = null;
if (Type.equals("Section")) {
Id = getIntent().getExtras().getLong("Section_id");
} else if (Type.equals("Faculty")) {
Id = getIntent().getExtras().getLong("Faculty_id");
}
TimeTableBasic info = new TimeTableBasic();
info.setTitle(Title);
info.setId(Id);
info.setType(Type);
return info;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
saved_theme = Utility.ThemeTools.getThemeId(getApplicationContext());
setTheme(saved_theme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_timetable);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
editor = prefs.edit();
final String stored_mode = prefs.getString(getString(R.string.pref_tt_display_type_key), "0");
if (savedInstanceState == null) {
if (stored_mode.equals("0"))
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new TimetableFragmentPager())
.commit();
else //1
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new TimetableFragmentSinglePage())
.commit();
}
final TimeTableBasic info = getCurrentBasic();
reload();
final Drawable fav_yes = Utility.ThemeTools.FavouriteIcon.getFavYes(getApplicationContext());
final Drawable fav_no = Utility.ThemeTools.FavouriteIcon.getFavNo(getApplicationContext());
final Drawable share = Utility.ThemeTools.getShareIconDrawable(getApplicationContext());
final Drawable myclass_yes = Utility.ThemeTools.MyClassIcon.getMyClassYes(getApplicationContext());
final Drawable myclass_no = Utility.ThemeTools.MyClassIcon.getMyClassNo(getApplicationContext());
fab_main = findViewById(R.id.fab_main);
fab_fav = findViewById(R.id.fab_favr);
fab_myclass = findViewById(R.id.fab_myclass);
fab_share = findViewById(R.id.fab_share);
fab_main.setImageDrawable(Utility.ThemeTools.FabIcon.getfabup(getApplicationContext()));
fab_main.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!isFABOpen) {
showFABMenu();
} else {
closeFABMenu();
}
}
});
if (existing_data.contains(info)) {
fab_fav.setImageDrawable(fav_yes);
} else {
fab_fav.setImageDrawable(fav_no);
}
fab_fav.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TimeTableBasic info = getCurrentBasic();
reload();
if (existing_data.contains(info)) {
existing_data.remove(info);
message = "Removed from Favourites";
fab_fav.setImageDrawable(fav_no);
} else {
existing_data.add(info);
message = "Added to Favourites";
fab_fav.setImageDrawable(fav_yes);
}
json = gson.toJson(existing_data);
editor.putString(existing_TAG, json);
editor.apply();
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
}
});
if (getCurrentBasic().equals(gson.fromJson(prefs.getString(myclass_TAG, ""), TimeTableBasic.class)))
fab_myclass.setImageDrawable(myclass_yes);
else
fab_myclass.setImageDrawable(myclass_no);
fab_myclass.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
final TimeTableBasic setmyclass;
final TimeTableBasic currentBasic = getCurrentBasic();
reload();
String myclass_json = prefs.getString(myclass_TAG, "");
if (myclass_json.length() > 1) {
setmyclass = gson.fromJson(myclass_json, TimeTableBasic.class);
} else {
setmyclass = null;
}
if (setmyclass == null) {
myclass = currentBasic;
message = "MyClass set";
fab_myclass.setImageDrawable(myclass_yes);
json = gson.toJson(myclass);
editor.putString(myclass_TAG, json);
editor.apply();
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
} else {
if (currentBasic.equals(setmyclass)) {
myclass = null;
message = "Current MyClass Removed";
fab_myclass.setImageDrawable(myclass_no);
json = gson.toJson(myclass);
editor.putString(myclass_TAG, json);
editor.apply();
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
} else {
//Replace existing class with current class,Prompt user to confirm the action
AlertDialog.Builder builder;
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// builder = new AlertDialog.Builder(TimetableActivity.this, android.R.style.Theme_Material_Dialog_Alert);
//} else {
builder = new AlertDialog.Builder(TimetableActivity.this);
//}
builder.setTitle("Replace Current MyClass")
.setMessage("There is an existing MyClass, This will replace current Myclass")
.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
myclass = currentBasic;
json = gson.toJson(myclass);
message = "MyClass Replaced";
fab_myclass.setImageDrawable(myclass_yes);
editor.putString(myclass_TAG, json);
editor.apply();
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// no need to do anything here
}
})
//.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
}
}
});
fab_share.setImageDrawable(share);
fab_share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ContextCompat.checkSelfPermission(TimetableActivity.this, Manifest.permission.READ_MEDIA_IMAGES)
== PackageManager.PERMISSION_GRANTED) {
File png;
if (stored_mode.equals("0"))
png = SaveBitmapasPNG(BitmapfromView(findViewById(R.id.timetable_pager), null), Environment.getExternalStorageDirectory().getAbsolutePath());
else
// // png = SaveBitmapasPNG(BitmapfromView(findViewById(R.id.timetable_table), findViewById(R.id.timetable_faculty_data)), Environment.getExternalStorageDirectory().getAbsolutePath());
png = SaveBitmapasPNG(BitmapfromView(findViewById(R.id.timetable_table), null), Environment.getExternalStorageDirectory().getAbsolutePath());
if (png == null)
return;
try {
Uri imageURI = FileProvider.getUriForFile(TimetableActivity.this, TimetableActivity.this.getApplicationContext().getPackageName() + ".fileprovider", png);
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/*");
sharingIntent.putExtra(Intent.EXTRA_STREAM, imageURI);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));
} catch (Exception e) {
Log.e("PNG_Share", "onClick: " + e.getMessage());
e.printStackTrace();
}
} else {
ActivityCompat.requestPermissions(TimetableActivity.this,
new String[]{Manifest.permission.READ_MEDIA_IMAGES},
MY_PERMISSIONS_REQUEST_WRITE_STORAGE);
}
}
});
}
@SuppressLint("MissingSuperCall")
@Override
public void onRequestPermissionsResult(int requestCode,
String[] permissions, int[] grantResults) {
if (requestCode == MY_PERMISSIONS_REQUEST_WRITE_STORAGE) {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
fab_share.performClick();
} else {
Toast.makeText(this, "Need permission to add background image", Toast.LENGTH_SHORT).show();
}
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Respond to the action bar's Up/Home button
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
private void showFABMenu() {
isFABOpen = true;
fab_fav.animate().translationY(-getResources().getDimension(R.dimen.fab_margin_1));
fab_myclass.animate().translationY(-getResources().getDimension(R.dimen.fab_margin_2));
fab_share.animate().translationY(-getResources().getDimension(R.dimen.fab_margin_3));
fab_main.animate().rotation(180);
}
private void closeFABMenu() {
isFABOpen = false;
fab_fav.animate().translationY(0);
fab_myclass.animate().translationY(0);
fab_main.animate().rotation(0);
fab_share.animate().translationY(0);
}
public Bitmap BitmapfromView(View view1, @Nullable View view2) {
int height, width;
if (view2 != null) {
height = view1.getHeight() + view2.getHeight();
width = Math.max(view1.getWidth(), view2.getWidth());
} else {
height = view1.getHeight();
width = view1.getWidth();
}
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Drawable Backgrounddrawable = view1.getBackground();
if (Backgrounddrawable != null)
Backgrounddrawable.draw(canvas);
else {
if (saved_theme == R.style.LightTheme)
canvas.drawColor(getResources().getColor(R.color.main_activity_bg));
else
canvas.drawColor(getResources().getColor(R.color.main_activity_bg_dark));
}
view1.draw(canvas);
if (view2 != null) {
canvas.translate(0, view1.getHeight());
view2.draw(canvas);
}
return bitmap;
}
}
| 15,647
|
Java
|
.java
|
Varun-garg/GBU_Timetables
| 9
| 11
| 6
|
2014-04-19T07:44:10Z
|
2023-12-02T10:46:42Z
|
c5e8f887c45dd710c30311c195e4058a56bfc8bf509c1cf706a218389ebf2d03
|
[] |
[
1337,
785,
51,
887,
330,
51,
108,
716,
100,
1021,
11288,
64,
222,
222,
485,
2616,
51,
12061,
64,
222,
485,
2616,
51,
4341,
51,
10689,
20331,
64,
222,
485,
2616,
51,
1304,
51,
41956,
64,
222,
485,
2616,
51,
1304,
51,
8770,
64,
222,
485,
2616,
51,
1304,
51,
32235,
64,
222,
485,
2616,
51,
1304,
51,
4921,
51,
42759,
64,
222,
485,
2616,
51,
7027,
51,
9384,
64,
222,
485,
2616,
51,
7027,
51,
8521,
64,
222,
485,
2616,
51,
7027,
51,
16926,
51,
14439,
64,
222,
485,
2616,
51,
1317,
51,
5729,
64,
222,
485,
2616,
51,
519,
51,
4775,
64,
222,
485,
2616,
51,
519,
51,
6342,
64,
222,
485,
2616,
51,
29565,
51,
14366,
1590,
64,
222,
485,
2616,
51,
1058,
51,
1353,
64,
222,
485,
2616,
51,
1090,
51,
6362,
64,
222,
485,
2616,
51,
1090,
51,
1089,
64,
222,
485,
2616,
51,
3872,
51,
15030,
64,
222,
222,
485,
10484,
51,
4341,
51,
6825,
64,
222,
485,
10484,
51,
32355,
51,
745,
51,
40628,
64,
222,
485,
10484,
51,
32355,
51,
745,
51,
35181,
64,
222,
485,
10484,
51,
32355,
51,
3872,
51,
14155,
64,
222,
485,
10484,
51,
1284,
51,
745,
51,
3697,
6823,
64,
222,
485,
10484,
51,
1284,
51,
1304,
51,
1237,
6823,
64,
222,
485,
10484,
51,
1284,
51,
1304,
51,
991,
2588,
64,
222,
222,
485,
785,
51,
2193,
51,
4048,
51,
5025,
51,
20702,
1160,
1654,
51,
23500,
35321,
64,
222,
485,
785,
51,
2193,
51,
4048,
51,
5025,
51,
4654,
25053,
51,
46524,
64,
222,
485,
785,
51,
2193,
51,
19968,
51,
33548,
64,
222,
485,
785,
51,
2193,
51,
19968,
51,
9069,
51,
638,
1781,
64,
222,
485,
785,
51,
887,
330,
51,
108,
716,
100,
1021,
11288,
51,
624,
51,
1184,
51,
1061,
1617,
7114,
64,
222,
222,
485,
1401,
51,
735,
51,
991,
64,
222,
485,
1401,
51,
735,
51,
991,
8783,
64,
222,
485,
1401,
51,
735,
51,
6860,
64,
222,
485,
1401,
51,
735,
51,
8783,
64,
222,
485,
1401,
51,
1600,
51,
9069,
51,
638,
64,
222,
485,
1401,
51,
1058,
51,
17163,
64,
222,
222,
942,
462,
3734,
1292,
3697,
2041,
36463,
320,
465,
964,
1175,
648,
20135,
100,
28689,
88,
100,
7921,
100,
3230,
100,
20722,
299,
244,
54,
55,
56,
64,
303,
14253,
65,
1061,
1617,
7114,
67,
4917,
100,
624,
64,
303,
42116,
31581,
64,
303,
33317,
35202,
299,
556,
33317,
492,
303,
910,
4917,
100,
6545,
299,
332,
14225,
534,
4160,
884,
303,
910,
2379,
64,
303,
2782,
36566,
4160,
100,
700,
299,
556,
2782,
1781,
65,
17163,
65,
1061,
1617,
7114,
35616,
320,
303,
12349,
10276,
492,
303,
42116,
51,
4836,
7020,
64,
303,
910,
1492,
299,
5127,
303,
964,
3734,
1617,
7114,
1690,
842,
64,
303,
964,
1175,
910,
1690,
842,
100,
6545,
299,
332,
1791,
842,
884,
303,
964,
5080,
458,
48931,
2981,
299,
920,
64,
303,
964,
38756,
35321,
36806,
100,
1850,
49,
36806,
100,
14225,
49,
36806,
100,
1791,
842,
49,
36806,
100,
6085,
64,
303,
964,
648,
7533,
100,
4679,
64,
465,
581,
924,
2050,
9908,
9384,
321,
17185,
45,
9384,
15601,
49,
910,
4937,
46,
320,
310,
35998,
2355,
299,
762,
64,
310,
1614,
320,
343,
2050,
822,
299,
556,
2050,
45,
1537,
49,
332,
915,
39,
494,
1189,
51,
17217,
365,
494,
4956,
1665,
742,
343,
2355,
299,
556,
37000,
45,
781,
312,
343,
15601,
51,
12456,
45,
9384,
51,
22489,
2222,
51,
17185,
49,
244,
54,
53,
53,
49,
2355,
312,
343,
15601,
51,
46088,
492,
343,
461,
822,
64,
310,
339,
2385,
327,
6860,
503,
46,
320,
1083,
15601,
51,
46088,
492,
343,
2681,
51,
106,
459,
20225,
9622,
411,
332,
14239,
42602,
5753,
411,
503,
312,
343,
461,
762,
64,
310,
339,
303,
339,
465,
964,
782,
17074,
365,
320,
310,
2379,
299,
31581,
51,
7080,
45,
12736,
100,
6545,
49,
762,
312,
310,
4917,
100,
624,
299,
35202,
51,
23862,
45,
1279,
49,
36566,
4160,
100,
700,
312,
310,
434,
327,
12736,
100,
624,
630,
762,
46,
343,
4917,
100,
624,
299,
556,
14253,
6984,
303,
339,
465,
581,
3734,
1617,
7114,
23403,
7114,
365,
320,
310,
910,
1994,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459,
1061,
1292,
100,
1333,
742,
310,
910,
2782,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459,
638,
742,
310,
6374,
4949,
299,
762,
64,
310,
434,
327,
638,
51,
3591,
459,
5434,
2152,
320,
343,
4949,
299,
640,
8770,
941,
390,
32775,
941,
33192,
459,
5434,
100,
333,
742,
310,
339,
832,
434,
327,
638,
51,
3591,
459,
7784,
31123,
2152,
320,
343,
4949,
299,
640,
8770,
941,
390,
32775,
941,
33192,
459,
7784,
31123,
100,
333,
742,
310,
339,
603,
3734,
1617,
7114,
3116,
299,
556,
3734,
1617,
7114,
492,
310,
3116,
51,
17359,
45,
3188,
312,
310,
3116,
51,
21603,
45,
625,
312,
310,
3116,
51,
26646,
45,
638,
312,
310,
461,
3116,
64,
303,
339,
465,
496,
1806,
303,
2532,
782,
16456,
45,
4775,
19902,
46,
320,
310,
7533,
100,
4679,
299,
23194,
51,
6537,
7926,
51,
390,
6537,
625,
45,
36160,
1052,
310,
758,
6537,
45,
9047,
100,
4679,
312,
603,
2615,
51,
20217,
45,
20731,
312,
603,
31090,
45,
87,
51,
3106,
51,
6904,
100,
47988,
312,
310,
36614,
20049,
299,
15510,
45,
87,
51,
333,
51,
15671,
312,
310,
758,
4417,
21540,
45,
15671,
312,
603,
640,
4417,
21540,
941,
489,
3948,
4325,
4637,
4006,
45,
1527,
312,
310,
640,
4417,
21540,
941,
489,
3948,
4404,
15148,
4006,
45,
1527,
312,
310,
640,
4417,
21540,
941,
489,
3948,
4637,
1482,
1405,
4006,
45,
1527,
312,
603,
31581,
299,
42838,
1590,
51,
13729,
32235,
45,
36160,
1052,
310,
7020,
299,
31581,
51,
3189,
492,
603,
1175,
910,
7129,
100,
2832,
299,
31581,
51,
7080,
45,
7080,
45,
87,
51,
819,
51,
13471,
100,
2269,
100,
2784,
100,
700,
100,
697,
490,
332,
53,
742,
603,
434,
327,
20731,
630,
762,
46,
320,
1083,
434,
327,
22175,
100,
2832,
51,
3591,
459,
53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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
1791,
842,
884,
303,
964,
5080,
458,
48931,
2981,
299,
920,
64,
303,
964,
38756,
35321,
36806,
100,
1850,
49,
36806,
100,
14225,
49,
36806,
100,
1791,
842,
49,
36806,
100,
6085,
64,
303,
964,
648,
7533,
100,
4679,
64,
465,
581,
924,
2050,
9908,
9384,
321,
17185,
45,
9384,
15601,
49,
910,
4937,
46,
320,
310,
35998,
2355,
299,
762,
64,
310,
1614,
320,
343,
2050,
822,
299,
556,
2050,
45,
1537,
49,
332,
915,
39,
494,
1189,
51,
17217,
365,
494,
4956,
1665,
742,
343,
2355,
299,
556,
37000,
45,
781,
312,
343,
15601,
51,
12456,
45,
9384,
51,
22489,
2222,
51,
17185,
49,
244,
54,
53,
53,
49,
2355,
312,
343,
15601,
51,
46088,
492,
343,
461,
822,
64,
310,
339,
2385,
327,
6860,
503,
46,
320,
1083,
15601,
51,
46088,
492,
343,
2681,
51,
106,
459,
20225,
9622,
411,
332,
14239,
42602,
5753,
411,
503,
312,
343,
461,
762,
64,
310,
339,
303,
339,
465,
964,
782,
17074,
365,
320,
310,
2379,
299,
31581,
51,
7080,
45,
12736,
100,
6545,
49,
762,
312,
310,
4917,
100,
624,
299,
35202,
51,
23862,
45,
1279,
49,
36566,
4160,
100,
700,
312,
310,
434,
327,
12736,
100,
624,
630,
762,
46,
343,
4917,
100,
624,
299,
556,
14253,
6984,
303,
339,
465,
581,
3734,
1617,
7114,
23403,
7114,
365,
320,
310,
910,
1994,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459,
1061,
1292,
100,
1333,
742,
310,
910,
2782,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459,
638,
742,
310,
6374,
4949,
299,
762,
64,
310,
434,
327,
638,
51,
3591,
459,
5434,
2152,
320,
343,
4949,
299,
640,
8770,
941,
390,
32775,
941,
33192,
459,
5434,
100,
333,
742,
310,
339,
832,
434,
327,
638,
51,
3591,
459,
7784,
31123,
2152,
320,
343,
4949,
299,
640
] | -8,006,573,713,481,433,000
| true
| false
| false
| false
|
[
343,
461,
762,
64,
310,
339,
303,
339,
465,
964,
782,
17074,
365,
320,
310,
2379,
299,
31581,
51,
7080,
45,
12736,
100,
6545,
49,
762,
312,
310,
4917,
100,
624,
299,
35202,
51,
23862,
45,
1279,
49,
36566,
4160,
100,
700,
312,
310,
434,
327,
12736,
100,
624,
630,
762,
46,
343,
4917,
100,
624,
299,
556,
14253,
6984,
303,
339,
465,
581,
3734,
1617,
7114,
23403,
7114,
365,
320,
310,
910,
1994,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459,
1061,
1292,
100,
1333,
742,
310,
910,
2782,
299,
640,
8770,
941,
390,
32775,
941,
7080,
459
] | 3,856,104,185,361,734,000
| true
|
myclass";
private Boolean isFABOpen = false;
private FloatingActionButton fab_main, fab_fav, fab_myclass, fab_share;
private int saved_theme;
public static File SaveBitmapasPNG(Bitmap bitmap, String dir) {
OutputStream os = null;
try {
File file = new File(dir, "image" + System.currentTimeMillis() + ".png");
os = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
bitmap.recycle();
return file;
} catch (IOException e) {
bitmap.recycle();
Log.e("combineImages", "problem combining images", e);
return null;
}
}
private void reload() {
json = prefs.getString(existing_TAG, null);
existing_data = gson.fromJson(json, favourites_type);
if (existing_data == null)
existing_data = new HashSet<>();
}
public TimeTableBasic getCurrentBasic() {
String Title = getIntent().getExtras().getString("Timetable_title");
String Type = getIntent().getExtras().getString("
|
bitmap, String dir) {
OutputStream os = null;
try {
File file = new File(dir, "image" + System.currentTimeMillis() + ".png");
os = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, os);
bitmap.recycle();
return file;
} catch (IOException e) {
bitmap.recycle();
Log.e("combineImages", "problem combining images", e);
return null;
}
}
private void reload() {
json = prefs.getString(existing_TAG, null);
existing_data = gson.fromJson(json, favourites_type);
if (existing_data == null)
existing_data = new HashSet<>();
}
public TimeTableBasic getCurrentBasic() {
String Title = getIntent().getExtras().getString("Timetable_title");
String Type = getIntent().getExtras().getString("
|
.CompressFormat.PNG, 100, os);
bitmap.recycle();
return file;
} catch (IOException e) {
bitmap.recycle();
Log.e("combineImages", "problem combining images", e);
return null;
}
}
private void reload() {
json = prefs.getString(existing_TAG, null);
existing_data = gson.fromJson(json, favourites_type);
if (existing_data == null)
existing_data = new HashSet<>();
}
public TimeTableBasic getCurrentBasic() {
String Title = getIntent().getExtras().getString("Timetable_title");
String Type = getIntent().getExtras().getString("
|
return null;
}
}
private void reload() {
json = prefs.getString(existing_TAG, null);
existing_data = gson.fromJson(json, favourites_type);
if (existing_data == null)
existing_data = new HashSet<>();
}
public TimeTableBasic getCurrentBasic() {
String Title = getIntent().getExtras().getString("Timetable_title");
String Type = getIntent().getExtras().getString("
|
Type");
Long Id = null;
if (Type.equals("Section")) {
Id = getIntent().getExtras().getLong("Section_id");
} else if (Type.equals("Faculty")) {
Id = get
|
JsonLocation.java
|
/FileExtraction/Java_unseen/olvid-io_olvid-android/obv_messenger/app/src/main/java/io/olvid/messenger/databases/entity/jsons/JsonLocation.java
|
/*
* Olvid for Android
* Copyright © 2019-2024 Olvid SAS
*
* This file is part of Olvid for Android.
*
* Olvid is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* Olvid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Olvid. If not, see <https://www.gnu.org/licenses/>.
*/
package io.olvid.messenger.databases.entity.jsons;
import android.content.Context;
import android.location.Location;
import androidx.annotation.Nullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.jetbrains.annotations.NotNull;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import io.olvid.messenger.R;
import io.olvid.messenger.customClasses.LocationShareQuality;
@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonLocation {
@JsonIgnore
public static final int TYPE_SEND = 1;
@JsonIgnore
public static final int TYPE_SHARING = 2;
@JsonIgnore
public static final int TYPE_END_SHARING = 3;
// -- message metadata --
public int type;
public long timestamp; // location timestamp
// -- sharing message fields --
public Long count; // null if not sharing
public Integer quality; // one of QUALITY_PRECISE, QUALITY_BALANCED, or QUALITY_POWER_SAVE for sharing. Null for TYPE_SEND
// public Long sharingInterval; // null if not sharing (else in ms)
public Long sharingExpiration; // can be null if endless sharing (else in ms)
// -- location --
public double latitude;
public double longitude;
// -- optional metadata --
public Double altitude; // meters (default value null)
public Float precision; // meters (default value null)
public String address; // (default value empty string or null)
public JsonLocation() {
}
@JsonIgnore
public JsonLocation(int type, @Nullable Long sharingExpiration, @Nullable LocationShareQuality quality, @Nullable Long count, double latitude, double longitude, Double altitude, Float precision, long timestamp) {
this.latitude = latitude;
this.longitude = longitude;
this.altitude = altitude;
this.precision = precision;
this.timestamp = timestamp;
this.type = type;
this.count = count;
this.sharingExpiration = sharingExpiration;
this.quality = (quality == null) ? null : quality.value;
}
public static JsonLocation startSharingLocationMessage(@Nullable Long sharingExpiration, LocationShareQuality quality, @NotNull Location location) {
return new JsonLocation(
TYPE_SHARING,
sharingExpiration,
quality,
1L,
location.getLatitude(),
location.getLongitude(),
location.hasAltitude() ? location.getAltitude() : null,
location.hasAccuracy() ? location.getAccuracy() : null,
location.getTime()
);
}
public static JsonLocation updateSharingLocationMessage(@NotNull JsonLocation originalJsonLocation, @NotNull Location location) {
return new JsonLocation(
TYPE_SHARING,
originalJsonLocation.getSharingExpiration(),
originalJsonLocation.getShareQuality(),
originalJsonLocation.getCount() + 1,
location.getLatitude(),
location.getLongitude(),
location.hasAltitude() ? location.getAltitude() : null,
location.hasAccuracy() ? location.getAccuracy() : null,
location.getTime()
);
}
public static JsonLocation endOfSharingLocationMessage(@NotNull Long count) {
JsonLocation endOfSharingJsonLocation = new JsonLocation();
endOfSharingJsonLocation.type = TYPE_END_SHARING;
endOfSharingJsonLocation.count = count;
return endOfSharingJsonLocation;
}
public static JsonLocation sendLocationMessage(@NotNull Location location) {
return new JsonLocation(
TYPE_SEND,
null,
null,
null,
location.getLatitude(),
location.getLongitude(),
location.hasAltitude() ? location.getAltitude() : null,
location.hasAccuracy() ? location.getAccuracy() : null,
location.getTime()
);
}
// ----- sharing message metadata -----
@JsonProperty("c")
public Long getCount() {
return count;
}
@JsonProperty("c")
public void setCount(Long count) {
this.count = count;
}
@JsonProperty("se")
public Long getSharingExpiration() {
return sharingExpiration;
}
@JsonProperty("se")
public void setSharingExpiration(Long sharingExpiration) {
this.sharingExpiration = sharingExpiration;
}
@JsonIgnore
@Nullable
public LocationShareQuality getShareQuality() {
if (quality == null) {
return null;
}
return LocationShareQuality.fromValue(quality);
}
@JsonProperty("q")
public Integer getQuality() {
return quality;
}
@JsonProperty("q")
public void setQuality(Integer quality) {
this.quality = quality;
}
// @JsonProperty("i")
// public Long getSharingInterval() {
// return sharingInterval;
// }
//
// @JsonProperty("i")
// public void setSharingInterval(Long sharingInterval) {
// this.sharingInterval = sharingInterval;
// }
// -- message metadata --
@JsonProperty("t")
public int getType() {
return type;
}
@JsonProperty("t")
public void setType(int type) {
this.type = type;
}
@JsonProperty("ts")
public long getTimestamp() {
return timestamp;
}
@JsonProperty("ts")
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
// ----- location -----
@JsonProperty("long")
public double getLongitude() {
return longitude;
}
@JsonProperty("long")
public void setLongitude(double longitude) {
this.longitude = longitude;
}
@JsonProperty("lat")
public double getLatitude() {
return latitude;
}
@JsonProperty("lat")
public void setLatitude(double latitude) {
this.latitude = latitude;
}
// ----- optional metadata -----
@JsonProperty("alt")
public Double getAltitude() {
return altitude;
}
@JsonProperty("alt")
public void setAltitude(Double altitude) {
this.altitude = altitude;
}
@JsonProperty("prec")
public Float getPrecision() {
return precision;
}
@JsonProperty("prec")
public void setPrecision(Float accuracy) {
this.precision = accuracy;
}
@JsonProperty("add")
public String getAddress() {
return address;
}
@JsonProperty("add")
public void setAddress(String address) {
this.address = address;
}
////////////
// formatters
private final static DecimalFormatSymbols decimalSymbols = new DecimalFormatSymbols(Locale.US);
private final static DecimalFormat truncated5 = new DecimalFormat("#0.00000", decimalSymbols);
private final static DecimalFormat truncated1 = new DecimalFormat("#0.0", decimalSymbols);
private final static DecimalFormat truncated0 = new DecimalFormat("#0", decimalSymbols);
@JsonIgnore
public String getLocationMessageBody() {
StringBuilder stringBuilder = new StringBuilder();
if (this.address != null && !this.address.isEmpty()) {
stringBuilder.append(address);
stringBuilder.append("\n\n");
}
stringBuilder.append("https://maps.google.com/?q=");
stringBuilder.append(this.getTruncatedLatitudeString());
stringBuilder.append("+");
stringBuilder.append(this.getTruncatedLongitudeString());
return stringBuilder.toString();
}
// create an android Location object from jsonLocation content
@JsonIgnore
public Location getAsLocation() {
Location location = new Location("");
location.setLatitude(latitude);
location.setLongitude(longitude);
location.setAltitude(altitude != null ? altitude : 0);
return location;
}
@JsonIgnore
public String getTruncatedLatitudeString() {
return truncated5.format(latitude);
}
@JsonIgnore
public String getTruncatedLongitudeString() {
return truncated5.format(longitude);
}
@JsonIgnore
public String getTruncatedPrecisionString(Context context) {
if (precision == null) {
return "-";
}
return context.getString(R.string.xx_meters, truncated1.format(precision));
}
@JsonIgnore
public String getTruncatedAltitudeString(Context context) {
if (altitude == null) {
return "-";
}
return context.getString(R.string.xx_meters, truncated0.format(altitude));
}
}
| 9,584
|
Java
|
.java
|
olvid-io/olvid-android
| 149
| 14
| 16
|
2021-12-31T09:01:02Z
|
2024-05-06T19:17:00Z
|
209cc5235162387a0688a91014f37485d42314f00474bcbe2f604c7426097f1e
|
[] |
[
1127,
222,
338,
244,
30066,
3866,
456,
8107,
222,
338,
244,
2657,
14416,
244,
55,
53,
54,
62,
50,
55,
53,
55,
57,
30066,
3866,
38245,
222,
338,
222,
338,
244,
1369,
822,
458,
1760,
451,
30066,
3866,
456,
8107,
51,
222,
338,
222,
338,
244,
30066,
3866,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
222,
338,
244,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
49,
1522,
244,
56,
49,
222,
338,
244,
641,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
244,
30066,
3866,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
244,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
244,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
222,
338,
244,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
222,
338,
244,
7979,
642,
30066,
3866,
51,
244,
1691,
666,
49,
2337,
350,
662,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
222,
588,
222,
222,
1337,
3377,
51,
381,
3866,
51,
45345,
51,
23398,
51,
2244,
51,
1279,
120,
64,
222,
222,
485,
2616,
51,
1304,
51,
1237,
64,
222,
485,
2616,
51,
2665,
51,
2941,
64,
222,
222,
485,
10484,
51,
4341,
51,
6825,
64,
222,
222,
485,
785,
51,
15066,
51,
13353,
51,
4341,
51,
32164,
64,
222,
485,
785,
51,
15066,
51,
13353,
51,
4341,
51,
32164,
3303,
64,
222,
485,
785,
51,
15066,
51,
13353,
51,
4341,
51,
10255,
64,
222,
222,
485,
1105,
51,
15575,
51,
8839,
51,
4936,
64,
222,
222,
485,
1401,
51,
897,
51,
7701,
2222,
64,
222,
485,
1401,
51,
897,
51,
7701,
2222,
19882,
64,
222,
485,
1401,
51,
1058,
51,
9459,
64,
222,
222,
485,
3377,
51,
381,
3866,
51,
45345,
51,
87,
64,
222,
485,
3377,
51,
381,
3866,
51,
45345,
51,
3005,
8038,
51,
2941,
10338,
15555,
64,
222,
222,
69,
32164,
3303,
45,
3634,
5850,
299,
878,
46,
222,
942,
462,
5890,
2941,
320,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
19581,
299,
244,
54,
64,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
2526,
802,
1410,
299,
244,
55,
64,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
3298,
100,
2526,
802,
1410,
299,
244,
56,
64,
465,
453,
790,
1492,
5057,
790,
303,
581,
648,
847,
64,
303,
581,
1964,
6356,
64,
453,
3913,
6356,
303,
453,
790,
21710,
1492,
3844,
790,
303,
581,
6374,
2409,
64,
453,
762,
434,
666,
21710,
303,
581,
4418,
13118,
64,
453,
1611,
451,
1931,
4456,
2932,
100,
2896,
4264,
825,
49,
1931,
4456,
2932,
100,
34734,
48589,
49,
575,
1931,
4456,
2932,
100,
21333,
100,
24351,
456,
21710,
51,
9286,
456,
11405,
100,
19581,
222,
325,
283,
581,
6374,
21710,
5766,
64,
453,
762,
434,
666,
21710,
327,
728,
347,
6753,
46,
303,
581,
6374,
21710,
23859,
64,
453,
902,
545,
762,
434,
962,
2290,
21710,
327,
728,
347,
6753,
46,
303,
453,
790,
3913,
790,
303,
581,
2082,
20913,
64,
303,
581,
2082,
20471,
64,
303,
453,
790,
5316,
5057,
790,
303,
581,
6938,
3390,
4933,
64,
453,
33958,
327,
1555,
804,
762,
46,
303,
581,
8182,
12612,
64,
453,
33958,
327,
1555,
804,
762,
46,
303,
581,
910,
2983,
64,
453,
327,
1555,
804,
3517,
821,
575,
762,
46,
465,
581,
5890,
2941,
365,
320,
303,
339,
465,
496,
32164,
303,
581,
5890,
2941,
45,
429,
847,
49,
496,
6825,
6374,
21710,
23859,
49,
496,
6825,
10642,
10338,
15555,
13118,
49,
496,
6825,
6374,
2409,
49,
2082,
20913,
49,
2082,
20471,
49,
6938,
3390,
4933,
49,
8182,
12612,
49,
1964,
6356,
46,
320,
310,
477,
51,
16487,
299,
20913,
64,
310,
477,
51,
17202,
299,
20471,
64,
310,
477,
51,
47554,
299,
3390,
4933,
64,
310,
477,
51,
15409,
299,
12612,
64,
310,
477,
51,
5627,
299,
6356,
64,
310,
477,
51,
700,
299,
847,
64,
310,
477,
51,
1016,
299,
2409,
64,
310,
477,
51,
24756,
23859,
299,
21710,
23859,
64,
310,
477,
51,
13752,
299,
327,
13752,
630,
762,
46,
1037,
762,
518,
13118,
51,
872,
64,
303,
339,
465,
581,
924,
5890,
2941,
1496,
40095,
2941,
1193,
4810,
6825,
6374,
21710,
23859,
49,
10642,
10338,
15555,
13118,
49,
496,
4936,
10642,
3913,
46,
320,
310,
461,
556,
5890,
2941,
45,
419,
11405,
100,
2526,
802,
1410,
49,
419,
21710,
23859,
49,
419,
13118,
49,
372,
54,
81,
49,
419,
3913,
51,
390,
27437,
1046,
419,
3913,
51,
390,
27998,
1046,
419,
3913,
51,
2057,
12963,
4933,
365,
1037,
3913,
51,
390,
12963,
4933,
365,
518,
762,
49,
419,
3913,
51,
2057,
26620,
365,
1037,
3913,
51,
390,
26620,
365,
518,
762,
49,
419,
3913,
51,
11960,
365,
310,
1110,
303,
339,
465,
581,
924,
5890,
2941,
1991,
40095,
2941,
1193,
4810,
4936,
5890,
2941,
4732,
2541,
2941,
49,
496,
4936,
10642,
3913,
46,
320,
310,
461,
556,
5890,
2941,
45,
419,
11405,
100,
2526,
802,
1410,
49,
419,
4732,
2541,
2941,
51,
390,
40095,
23859,
1046,
419,
4732,
2541,
2941,
51,
390,
10338,
15555,
1046,
419,
4732,
2541,
2941,
51,
32931,
365,
494,
244,
54,
49,
419,
3913,
51,
390,
27437,
1046,
419,
3913,
51,
390,
27998,
1046,
419,
3913,
51,
2057,
12963,
4933,
365,
1037,
3913,
51,
390,
12963,
4933,
365,
518,
762,
49,
419,
3913,
51,
2057,
26620,
365,
1037,
3913,
51,
390,
26620,
365,
518,
762,
49,
419,
3913,
51,
11960,
365,
310,
1110,
303,
339,
465,
581,
924,
5890,
2941,
962,
1436,
40095,
2941,
1193,
4810,
4936,
6374,
2409,
46,
320,
310,
5890,
2941,
962,
1436,
40095,
2541,
2941,
299,
556,
5890,
2941,
492,
310,
962,
1436,
40095,
2541,
2941,
51,
700,
299,
11405,
100,
3298,
100,
2526,
802,
1410,
64,
310,
962,
1436,
40095,
2541,
2941,
51,
1016,
299,
2409,
64,
310,
461,
962,
1436,
40095,
2541,
2941,
64,
303,
339,
465,
581,
924,
5890,
2941,
3256,
2941,
1193,
4810,
4936,
10642,
3913,
46,
320,
310,
461,
556,
5890,
2941,
45,
419,
11405,
100,
19581
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
222,
485,
3377,
51,
381,
3866,
51,
45345,
51,
87,
64,
222,
485,
3377,
51,
381,
3866,
51,
45345,
51,
3005,
8038,
51,
2941,
10338,
15555,
64,
222,
222,
69,
32164,
3303,
45,
3634,
5850,
299,
878,
46,
222,
942,
462,
5890,
2941,
320,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
19581,
299,
244,
54,
64,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
2526,
802,
1410,
299,
244,
55,
64,
303,
496,
32164,
303,
581,
924,
1175,
648,
11405,
100,
3298,
100,
2526,
802,
1410,
299,
244,
56,
64,
465,
453,
790,
1492,
5057,
790,
303,
581,
648,
847,
64,
303,
581,
1964,
6356,
64,
453,
3913,
6356,
303,
453,
790,
21710,
1492,
3844,
790,
303,
581,
6374,
2409,
64,
453,
762,
434,
666,
21710,
303,
581,
4418,
13118,
64,
453,
1611,
451,
1931,
4456,
2932,
100,
2896,
4264,
825,
49,
1931,
4456,
2932,
100,
34734,
48589,
49,
575,
1931,
4456,
2932,
100,
21333,
100,
24351,
456,
21710,
51,
9286,
456,
11405,
100,
19581,
222,
325,
283,
581,
6374,
21710,
5766,
64,
453,
762,
434,
666,
21710,
327,
728,
347,
6753,
46,
303,
581,
6374,
21710,
23859,
64,
453,
902,
545,
762,
434,
962,
2290,
21710,
327,
728,
347,
6753,
46,
303,
453,
790,
3913,
790,
303,
581,
2082,
20913,
64,
303,
581,
2082,
20471,
64,
303,
453,
790,
5316,
5057,
790,
303,
581,
6938,
3390,
4933,
64,
453,
33958,
327,
1555,
804,
762,
46,
303,
581,
8182,
12612,
64,
453,
33958,
327,
1555,
804,
762,
46,
303,
581,
910,
2983,
64,
453,
327,
1555,
804,
3517,
821,
575,
762,
46,
465,
581,
5890,
2941,
365,
320,
303,
339,
465,
496,
32164,
303,
581,
5890,
2941,
45,
429,
847,
49,
496,
6825,
6374,
21710,
23859,
49,
496,
6825,
10642,
10338,
15555,
13118,
49,
496
] | 6,374,393,496,009,976,000
| true
| false
| false
| false
|
[
100,
34734,
48589,
49,
575,
1931,
4456,
2932,
100,
21333,
100,
24351,
456,
21710,
51,
9286,
456,
11405,
100,
19581,
222,
325,
283,
581,
6374,
21710,
5766,
64,
453,
762,
434,
666,
21710,
327,
728,
347,
6753,
46,
303,
581,
6374,
21710,
23859,
64,
453,
902,
545,
762,
434,
962,
2290,
21710,
327,
728,
347,
6753,
46,
303,
453,
790,
3913,
790,
303,
581,
2082,
20913,
64,
303,
581,
2082,
20471,
64,
303,
453,
790,
5316,
5057,
790,
303,
581,
6938,
3390,
4933,
64,
453,
33958,
327,
1555,
804,
762,
46,
303,
581,
8182,
12612,
64,
453,
33958,
327,
1555
] | -2,694,490,144,722,872,300
| true
|
import io.olvid.messenger.R;
import io.olvid.messenger.customClasses.LocationShareQuality;
@JsonIgnoreProperties(ignoreUnknown = true)
public class JsonLocation {
@JsonIgnore
public static final int TYPE_SEND = 1;
@JsonIgnore
public static final int TYPE_SHARING = 2;
@JsonIgnore
public static final int TYPE_END_SHARING = 3;
// -- message metadata --
public int type;
public long timestamp; // location timestamp
// -- sharing message fields --
public Long count; // null if not sharing
public Integer quality; // one of QUALITY_PRECISE, QUALITY_BALANCED, or QUALITY_POWER_SAVE for sharing. Null for TYPE_SEND
// public Long sharingInterval; // null if not sharing (else in ms)
public Long sharingExpiration; // can be null if endless sharing (else in ms)
// -- location --
public double latitude;
public double longitude;
// -- optional metadata --
public Double altitude; // meters (default value null)
public Float precision; // meters (default
|
final int TYPE_SEND = 1;
@JsonIgnore
public static final int TYPE_SHARING = 2;
@JsonIgnore
public static final int TYPE_END_SHARING = 3;
// -- message metadata --
public int type;
public long timestamp; // location timestamp
// -- sharing message fields --
public Long count; // null if not sharing
public Integer quality; // one of QUALITY_PRECISE, QUALITY_BALANCED, or QUALITY_POWER_SAVE for sharing. Null for TYPE_SEND
// public Long sharingInterval; // null if not sharing (else in ms)
public Long sharingExpiration; // can be null if endless sharing (else in ms)
// -- location --
public double latitude;
public double longitude;
// -- optional metadata --
public Double altitude; // meters (default value null)
public Float precision; // meters (default
|
--
public int type;
public long timestamp; // location timestamp
// -- sharing message fields --
public Long count; // null if not sharing
public Integer quality; // one of QUALITY_PRECISE, QUALITY_BALANCED, or QUALITY_POWER_SAVE for sharing. Null for TYPE_SEND
// public Long sharingInterval; // null if not sharing (else in ms)
public Long sharingExpiration; // can be null if endless sharing (else in ms)
// -- location --
public double latitude;
public double longitude;
// -- optional metadata --
public Double altitude; // meters (default value null)
public Float precision; // meters (default
|
_BALANCED, or QUALITY_POWER_SAVE for sharing. Null for TYPE_SEND
// public Long sharingInterval; // null if not sharing (else in ms)
public Long sharingExpiration; // can be null if endless sharing (else in ms)
// -- location --
public double latitude;
public double longitude;
// -- optional metadata --
public Double altitude; // meters (default value null)
public Float precision; // meters (default
|
value null)
public String address; // (default value empty string or null)
public JsonLocation() {
}
@JsonIgnore
public JsonLocation(int type, @Nullable Long sharingExpiration, @Nullable LocationShareQuality quality, @
|
GlobalContext.java
|
/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace-archive/Admin/src/ims/admin/forms/exportfiledialog/GlobalContext.java
|
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.forms.exportfiledialog;
import java.io.Serializable;
public final class GlobalContext extends ims.framework.FormContext implements Serializable
{
private static final long serialVersionUID = 1L;
public GlobalContext(ims.framework.Context context)
{
super(context);
Core = new CoreContext(context);
}
public final class CoreContext implements Serializable
{
private static final long serialVersionUID = 1L;
private CoreContext(ims.framework.Context context)
{
this.context = context;
}
public boolean getYesNoDialogMessageIsNotNull()
{
return !cx_CoreYesNoDialogMessage.getValueIsNull(context);
}
public String getYesNoDialogMessage()
{
return (String)cx_CoreYesNoDialogMessage.getValue(context);
}
private ims.framework.ContextVariable cx_CoreYesNoDialogMessage = new ims.framework.ContextVariable("Core.YesNoDialogMessage", "_cv_Core.YesNoDialogMessage");
private ims.framework.Context context;
}
public CoreContext Core;
}
| 2,670
|
Java
|
.java
|
IMS-MAXIMS/openMAXIMS
| 61
| 50
| 23
|
2014-06-12T12:04:02Z
|
2020-07-31T09:34:49Z
|
62a1c0deba623a207c742a54817fc81c528fe1af3f9fb9fdbd6679e23ff40d1d
|
[] |
[
325,
19989,
8689,
222,
16802,
42053,
607,
222,
16802,
244,
2657,
327,
72,
46,
350,
55,
53,
54,
57,
67,
244,
350,
2348,
88,
7490,
2348,
88,
67,
22768,
607,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
281,
607,
222,
16802,
244,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
2281,
607,
222,
16802,
244,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
981,
607,
222,
16802,
244,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
10094,
607,
244,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
2052,
607,
222,
16802,
244,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
2281,
607,
222,
16802,
244,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
1485,
607,
222,
16802,
244,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
7223,
607,
222,
16802,
42053,
607,
222,
16802,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
607,
222,
16802,
244,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
283,
607,
222,
16802,
42053,
607,
222,
325,
19989,
8689,
222,
16802,
10207,
77,
222,
325,
1369,
1361,
1616,
4741,
829,
11489,
39305,
643,
290,
21100,
1493,
457,
2758,
15606,
10584,
327,
1687,
244,
54,
51,
61,
53,
1984,
244,
58,
53,
53,
60,
51,
55,
58,
60,
58,
54,
46,
222,
325,
2657,
327,
72,
46,
244,
54,
62,
62,
58,
50,
55,
53,
54,
57,
457,
2758,
7490,
2348,
88,
51,
3381,
4760,
5225,
51,
222,
325,
18226,
63,
4103,
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
2317,
51,
8543,
51,
1376,
781,
5962,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
222,
942,
1175,
462,
6566,
1237,
2041,
3987,
120,
51,
2863,
51,
1260,
1237,
4584,
19182,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
942,
6566,
1237,
45,
16178,
51,
2863,
51,
1237,
1637,
46,
222,
221,
128,
376,
221,
5282,
45,
1834,
312,
1332,
221,
2869,
299,
556,
7357,
1237,
45,
1834,
312,
222,
221,
130,
222,
221,
942,
1175,
462,
7357,
1237,
4584,
19182,
222,
221,
128,
376,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
1332,
221,
2072,
7357,
1237,
45,
16178,
51,
2863,
51,
1237,
1637,
46,
376,
221,
128,
374,
221,
597,
51,
1834,
299,
1637,
64,
1332,
221,
130,
1332,
221,
942,
1922,
640,
10933,
2042,
3742,
1193,
25183,
365,
376,
221,
128,
374,
221,
620,
673,
10009,
100,
2869,
10933,
2042,
3742,
1193,
51,
6693,
10418,
45,
1834,
312,
376,
221,
130,
376,
221,
942,
910,
640,
10933,
2042,
3742,
1193,
365,
376,
221,
128,
374,
221,
620,
327,
671,
46,
10009,
100,
2869,
10933,
2042,
3742,
1193,
51,
6693,
45,
1834,
312,
376,
221,
130,
1332,
221,
2072,
3987,
120,
51,
2863,
51,
1237,
3836,
15746,
100,
2869,
10933,
2042,
3742,
1193,
299,
556,
3987,
120,
51,
2863,
51,
1237,
3836,
459,
2869,
51,
10933,
2042,
3742,
1193,
411,
7302,
4167,
100,
2869,
51,
10933,
2042,
3742,
1193,
742,
1332,
221,
2072,
3987,
120,
51,
2863,
51,
1237,
1637,
64,
222,
221,
130,
499,
221,
942,
7357,
1237,
7357,
64,
222,
130,
222
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 584
|
[
418,
7848,
7763,
51,
244,
2819,
341,
1485,
607,
222,
16802,
244,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
7223,
607,
222,
16802,
42053,
607,
222,
16802,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
607,
222,
16802,
244,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
283,
607,
222,
16802,
42053,
607,
222,
325,
19989,
8689,
222,
16802,
10207,
77,
222,
325,
1369,
1361,
1616,
4741,
829,
11489,
39305,
643,
290,
21100,
1493,
457,
2758,
15606,
10584,
327,
1687,
244,
54,
51,
61,
53,
1984,
244,
58,
53,
53,
60,
51,
55,
58,
60,
58,
54,
46,
222,
325,
2657,
327,
72,
46,
244,
54,
62,
62,
58,
50,
55,
53,
54,
57,
457,
2758,
7490,
2348,
88,
51,
3381,
4760,
5225,
51,
222,
325,
18226,
63,
4103,
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
2317,
51,
8543,
51,
1376,
781,
5962,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
222,
942,
1175,
462,
6566,
1237,
2041,
3987,
120,
51,
2863,
51,
1260,
1237,
4584,
19182,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
942,
6566,
1237,
45,
16178,
51,
2863,
51,
1237,
1637,
46,
222,
221,
128,
376,
221,
5282,
45,
1834,
312,
1332,
221,
2869,
299,
556,
7357,
1237,
45,
1834,
312,
222,
221,
130,
222,
221,
942,
1175,
462,
7357,
1237,
4584,
19182,
222,
221,
128,
376,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
1332,
221,
2072,
7357,
1237,
45,
16178,
51,
2863,
51,
1237,
1637,
46,
376,
221,
128,
374,
221,
597,
51,
1834,
299,
1637,
64,
1332,
221,
130,
1332,
221,
942
] | 6,325,433,449,748,942,000
| true
| false
| false
| false
|
[
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
2317,
51,
8543,
51,
1376,
781,
5962,
64,
222,
222,
485,
1401,
51,
735,
51,
12644,
64,
222,
222,
942,
1175,
462,
6566,
1237,
2041,
3987,
120,
51,
2863,
51,
1260,
1237,
4584,
19182,
222,
128,
222,
221,
2072,
924,
1175,
1964,
19896,
299,
244,
54,
81,
64,
499,
221,
942,
6566,
1237,
45,
16178,
51,
2863,
51,
1237,
1637,
46,
222,
221,
128,
376,
221,
5282,
45,
1834,
312,
1332,
221,
2869,
299,
556,
7357,
1237,
45,
1834,
312,
222,
221,
130,
222,
221,
942,
1175
] | 5,431,010,917,342,637,000
| true
|
A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.forms.exportfiledialog;
import java.io.Serializable;
public final class GlobalContext extends ims.framework.FormContext implements Serializable
{
private static final long serialVersionUID = 1L;
public GlobalContext(ims.framework.Context context)
{
super(context);
Core = new CoreContext(context);
}
public final
|
program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.forms.exportfiledialog;
import java.io.Serializable;
public final class GlobalContext extends ims.framework.FormContext implements Serializable
{
private static final long serialVersionUID = 1L;
public GlobalContext(ims.framework.Context context)
{
super(context);
Core = new CoreContext(context);
}
public final
|
version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.admin.forms.exportfiledialog;
import java.io.Serializable;
public final class GlobalContext extends ims.framework.FormContext implements Serializable
{
private static final long serialVersionUID = 1L;
public GlobalContext(ims.framework.Context context)
{
super(context);
Core = new CoreContext(context);
}
public final
|
NOT MODIFY the content of this file
package ims.admin.forms.exportfiledialog;
import java.io.Serializable;
public final class GlobalContext extends ims.framework.FormContext implements Serializable
{
private static final long serialVersionUID = 1L;
public GlobalContext(ims.framework.Context context)
{
super(context);
Core = new CoreContext(context);
}
public final
|
class CoreContext implements Serializable
{
private static final long serialVersionUID = 1L;
private CoreContext(ims.framework.Context context)
{
this.context = context;
}
public
|
CorrespondenceDetails.java
|
/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace-archive/Correspondence/src/ims/correspondence/domain/CorrespondenceDetails.java
|
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
// This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
// Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file
package ims.correspondence.domain;
// Generated from form domain impl
public interface CorrespondenceDetails extends ims.domain.DomainInterface
{
// Generated from form domain interface definition
/**
* list all discharge categories for a template
*/
public ims.correspondence.vo.TemplateCategoryVo listTemplateDischargeCategories(ims.admin.vo.ReportTemplateVo templateFilterVo);
// Generated from form domain interface definition
/**
* save the document details
*/
public ims.correspondence.vo.CorrespondenceDetailsVo saveCorrespondenceDetails(ims.correspondence.vo.CorrespondenceDetailsVo voDocDetail, ims.vo.LookupInstVo pasEventType) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException;
// Generated from form domain interface definition
/**
* list Signatories (Consultants and NCHDs)
*/
public ims.core.vo.MedicLiteVoCollection listSignatories(String medicName);
// Generated from form domain interface definition
/**
* list referral GPs
*/
public ims.core.vo.GpShortVoCollection listReferralGps(ims.core.vo.GP voGpFilter);
// Generated from form domain interface definition
/**
* get PAS Event details
*/
public ims.core.vo.PasEventVo getPasEvent(ims.core.admin.pas.vo.PASEventRefVo pasEventRefVo);
// Generated from form domain interface definition
/**
* get the report query and template selected
*/
public String[] getReportAndTemplate(Integer nReportId, Integer nTemplateIs) throws ims.domain.exceptions.DomainInterfaceException;
// Generated from form domain interface definition
/**
* get document report query to retrieve
*/
public ims.correspondence.vo.DocReportVo getReport(Integer nReportQueryId);
// Generated from form domain interface definition
/**
* get full patient details
*/
public ims.core.vo.Patient getPatient(ims.core.vo.PatientShort voPatient) throws ims.domain.exceptions.StaleObjectException;
// Generated from form domain interface definition
/**
* getDocument
*/
public ims.core.vo.DocumentVo getDocument(ims.core.vo.DocumentVo filter);
// Generated from form domain interface definition
public ims.correspondence.vo.CorrespondenceDetailsVo getCorrespondenceDetails(ims.correspondence.vo.CorrespondenceDetailsRefVo voCorrespDetRefVo);
// Generated from form domain interface definition
public ims.correspondence.vo.CorrespondenceDetailsVo getCorrespondenceDetailsByPasEvent(ims.core.admin.pas.vo.PASEventRefVo voPasEventRef);
// Generated from form domain interface definition
public ims.correspondence.vo.CorrespondenceStatusHistoryVoCollection getCorrespondenceStatusHistory(ims.correspondence.vo.CorrespondenceDetailsRefVo voCorrespDetRef);
// Generated from form domain interface definition
/**
* get patient locally
*/
public ims.core.vo.Patient getPatientLocal(ims.core.patient.vo.PatientRefVo patientRefVo);
// Generated from form domain interface definition
public ims.core.vo.DocumentVo getCurrentDocument(ims.correspondence.vo.CorrespondenceDetailsRefVo voRefCorrecpondenceDetail);
// Generated from form domain interface definition
public ims.admin.vo.ReportTemplateVoCollection listTemplates(Boolean activeOnly, Integer voMedicId, Integer voLocationId, Integer voServiceId);
// Generated from form domain interface definition
/**
* get email information for appuser
*/
public ims.admin.vo.UserEmailAccountVo getEmailAppUser(Integer appUserId);
}
| 5,142
|
Java
|
.java
|
IMS-MAXIMS/openMAXIMS
| 61
| 50
| 23
|
2014-06-12T12:04:02Z
|
2020-07-31T09:34:49Z
|
ce6c57ebfaa182091c94e454f33973610e4463e2360004964135f70ef9650ec7
|
[] |
[
325,
19989,
8689,
222,
16802,
42053,
607,
222,
16802,
244,
2657,
327,
72,
46,
350,
55,
53,
54,
57,
67,
244,
350,
2348,
88,
7490,
2348,
88,
67,
22768,
607,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
3760,
2951,
63,
863,
902,
14081,
580,
480,
52,
290,
5370,
281,
607,
222,
16802,
244,
580,
1549,
341,
5974,
451,
341,
6994,
30994,
6153,
5062,
1196,
641,
2281,
607,
222,
16802,
244,
9582,
829,
341,
7834,
3870,
7120,
49,
3173,
1522,
244,
56,
451,
341,
981,
607,
222,
16802,
244,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
10094,
607,
244,
222,
16802,
42053,
607,
222,
16802,
244,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
2052,
607,
222,
16802,
244,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
2281,
607,
222,
16802,
244,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
1485,
607,
222,
16802,
244,
6994,
30994,
6153,
5062,
1196,
456,
1851,
4261,
51,
7223,
607,
222,
16802,
42053,
607,
222,
16802,
244,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
30994,
6153,
5062,
1196,
607,
222,
16802,
244,
7979,
642,
477,
3477,
51,
244,
1691,
666,
49,
2337,
350,
544,
574,
1516,
51,
10627,
51,
1107,
52,
4205,
28699,
283,
607,
222,
16802,
42053,
607,
222,
325,
19989,
8689,
222,
16802,
10207,
77,
222,
325,
1369,
1361,
1616,
4741,
829,
11489,
39305,
643,
290,
21100,
1493,
457,
2758,
15606,
10584,
327,
1687,
244,
54,
51,
61,
53,
1984,
244,
58,
53,
53,
60,
51,
55,
58,
60,
58,
54,
46,
222,
325,
2657,
327,
72,
46,
244,
54,
62,
62,
58,
50,
55,
53,
54,
57,
457,
2758,
7490,
2348,
88,
51,
3381,
4760,
5225,
51,
222,
325,
18226,
63,
4103,
2387,
24110,
341,
1813,
451,
477,
822,
222,
222,
1337,
3987,
120,
51,
13984,
10280,
961,
51,
4136,
64,
222,
222,
325,
13046,
664,
2252,
5900,
9951,
222,
942,
2586,
28412,
10280,
961,
4375,
2041,
3987,
120,
51,
4136,
51,
5048,
3058,
222,
128,
222,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
1168,
1187,
1236,
13260,
12851,
456,
331,
3098,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
3455,
4236,
12536,
1168,
3455,
1744,
13260,
13779,
45,
16178,
51,
2317,
51,
2103,
51,
4158,
3455,
12536,
3098,
2365,
12536,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
4166,
341,
1840,
4261,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
4375,
12536,
4166,
13822,
10280,
961,
4375,
45,
16178,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
4375,
12536,
9180,
4234,
5295,
49,
3987,
120,
51,
2103,
51,
10138,
3245,
12536,
4368,
15241,
46,
2589,
3987,
120,
51,
4136,
51,
11453,
51,
5048,
3058,
1002,
49,
3987,
120,
51,
4136,
51,
11453,
51,
520,
1572,
976,
1002,
49,
3987,
120,
51,
4136,
51,
11453,
51,
10186,
971,
28030,
1002,
64,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
1168,
7443,
738,
753,
327,
24078,
2392,
480,
508,
1424,
21187,
46,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
8676,
314,
13662,
12536,
2272,
1168,
3399,
738,
753,
45,
671,
32424,
577,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
1168,
2505,
26155,
19498,
120,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
39214,
6881,
12536,
2272,
1168,
2099,
26155,
76,
1088,
45,
16178,
51,
1284,
51,
2103,
51,
8456,
9180,
39214,
2365,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
37174,
3916,
4261,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
26831,
1167,
12536,
640,
26831,
1167,
45,
16178,
51,
1284,
51,
2317,
51,
18939,
51,
2103,
51,
85,
3221,
672,
2099,
12536,
4368,
1167,
2099,
12536,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
341,
3652,
2487,
480,
3098,
4337,
222,
221,
1975,
222,
221,
942,
910,
1197,
640,
4158,
2199,
3455,
45,
3078,
329,
4158,
625,
49,
4418,
329,
3455,
1640,
46,
2589,
3987,
120,
51,
4136,
51,
11453,
51,
5048,
3058,
1002,
64,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
1840,
3652,
2487,
391,
10857,
1676,
221,
1975,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
4234,
4158,
12536,
640,
4158,
45,
3078,
329,
4158,
1643,
625,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
3559,
18019,
4261,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
18754,
640,
18754,
45,
16178,
51,
1284,
51,
2103,
51,
18754,
6881,
9180,
18754,
46,
2589,
3987,
120,
51,
4136,
51,
11453,
51,
520,
1572,
976,
1002,
64,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
3112,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
3112,
12536,
640,
3112,
45,
16178,
51,
1284,
51,
2103,
51,
3112,
12536,
2785,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
4375,
12536,
640,
13822,
10280,
961,
4375,
45,
16178,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
4375,
2099,
12536,
9180,
13822,
438,
2150,
2099,
12536,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
4375,
12536,
640,
13822,
10280,
961,
4375,
1103,
26831,
1167,
45,
16178,
51,
1284,
51,
2317,
51,
18939,
51,
2103,
51,
85,
3221,
672,
2099,
12536,
9180,
26831,
1167,
2099,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
942,
3987,
120,
51,
13984,
10280,
961,
51,
2103,
51,
13822,
10280,
961,
1551
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
120,
51,
2103,
51,
10138,
3245,
12536,
4368,
15241,
46,
2589,
3987,
120,
51,
4136,
51,
11453,
51,
5048,
3058,
1002,
49,
3987,
120,
51,
4136,
51,
11453,
51,
520,
1572,
976,
1002,
49,
3987,
120,
51,
4136,
51,
11453,
51,
10186,
971,
28030,
1002,
64,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
1168,
7443,
738,
753,
327,
24078,
2392,
480,
508,
1424,
21187,
46,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
8676,
314,
13662,
12536,
2272,
1168,
3399,
738,
753,
45,
671,
32424,
577,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
1168,
2505,
26155,
19498,
120,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
39214,
6881,
12536,
2272,
1168,
2099,
26155,
76,
1088,
45,
16178,
51,
1284,
51,
2103,
51,
8456,
9180,
39214,
2365,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
37174,
3916,
4261,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
26831,
1167,
12536,
640,
26831,
1167,
45,
16178,
51,
1284,
51,
2317,
51,
18939,
51,
2103,
51,
85,
3221,
672,
2099,
12536,
4368,
1167,
2099,
12536,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
341,
3652,
2487,
480,
3098,
4337,
222,
221,
1975,
222,
221,
942,
910,
1197,
640,
4158,
2199,
3455,
45,
3078,
329,
4158,
625,
49,
4418,
329,
3455,
1640,
46,
2589,
3987,
120,
51,
4136,
51,
11453,
51,
5048,
3058,
1002,
64,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
1840,
3652,
2487,
391,
10857,
1676,
221,
1975,
222,
221,
942,
3987,
120,
51
] | 1,377,556,454,885,677,600
| true
| false
| false
| false
|
[
9180,
39214,
2365,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
37174,
3916,
4261,
222,
221,
1975,
222,
221,
942,
3987,
120,
51,
1284,
51,
2103,
51,
26831,
1167,
12536,
640,
26831,
1167,
45,
16178,
51,
1284,
51,
2317,
51,
18939,
51,
2103,
51,
85,
3221,
672,
2099,
12536,
4368,
1167,
2099,
12536,
312,
499,
221,
325,
13046,
664,
2252,
5900,
2586,
5658,
222,
221,
1350,
222,
221,
47,
640,
341,
3652,
2487,
480,
3098,
4337,
222,
221,
1975,
222,
221,
942,
910,
1197,
640,
4158,
2199,
3455,
45,
3078,
329
] | -7,460,063,803,994,939,000
| true
|
s.vo.LookupInstVo pasEventType) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException;
// Generated from form domain interface definition
/**
* list Signatories (Consultants and NCHDs)
*/
public ims.core.vo.MedicLiteVoCollection listSignatories(String medicName);
// Generated from form domain interface definition
/**
* list referral GPs
*/
public ims.core.vo.GpShortVoCollection listReferralGps(ims.core.vo.GP voGpFilter);
// Generated from form domain interface definition
/**
* get PAS Event details
*/
public ims.core.vo.PasEventVo getPasEvent(ims.core.admin.pas.vo.PASEventRefVo pasEventRefVo);
// Generated from form domain interface definition
/**
* get the report query and template selected
*/
public String[] getReportAndTemplate(Integer n
|
from form domain interface definition
/**
* list Signatories (Consultants and NCHDs)
*/
public ims.core.vo.MedicLiteVoCollection listSignatories(String medicName);
// Generated from form domain interface definition
/**
* list referral GPs
*/
public ims.core.vo.GpShortVoCollection listReferralGps(ims.core.vo.GP voGpFilter);
// Generated from form domain interface definition
/**
* get PAS Event details
*/
public ims.core.vo.PasEventVo getPasEvent(ims.core.admin.pas.vo.PASEventRefVo pasEventRefVo);
// Generated from form domain interface definition
/**
* get the report query and template selected
*/
public String[] getReportAndTemplate(Integer n
|
// Generated from form domain interface definition
/**
* list referral GPs
*/
public ims.core.vo.GpShortVoCollection listReferralGps(ims.core.vo.GP voGpFilter);
// Generated from form domain interface definition
/**
* get PAS Event details
*/
public ims.core.vo.PasEventVo getPasEvent(ims.core.admin.pas.vo.PASEventRefVo pasEventRefVo);
// Generated from form domain interface definition
/**
* get the report query and template selected
*/
public String[] getReportAndTemplate(Integer n
|
voGpFilter);
// Generated from form domain interface definition
/**
* get PAS Event details
*/
public ims.core.vo.PasEventVo getPasEvent(ims.core.admin.pas.vo.PASEventRefVo pasEventRefVo);
// Generated from form domain interface definition
/**
* get the report query and template selected
*/
public String[] getReportAndTemplate(Integer n
|
ReportId, Integer nTemplateIs) throws ims.domain.exceptions.DomainInterfaceException;
// Generated from form domain interface definition
/**
* get document report query to retrieve
*/
public ims.
|
MsgDemoMapDao.java
|
/FileExtraction/Java_unseen/junoemr_junoemr/src/main/java/org/oscarehr/common/dao/MsgDemoMapDao.java
|
/**
* Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved.
* This software is published under the GPL GNU General Public License.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* This software was written for the
* Department of Family Medicine
* McMaster University
* Hamilton
* Ontario, Canada
*/
package org.oscarehr.common.dao;
import java.util.List;
import javax.persistence.Query;
import org.oscarehr.common.model.MsgDemoMap;
import org.springframework.stereotype.Repository;
@Repository
public class MsgDemoMapDao extends AbstractDao<MsgDemoMap>{
public MsgDemoMapDao() {
super(MsgDemoMap.class);
}
public List<MsgDemoMap> findByDemographicNo(Integer demographicNo) {
String sql = "select x from MsgDemoMap x where x.demographic_no=?1";
Query query = entityManager.createQuery(sql);
query.setParameter(1,demographicNo);
@SuppressWarnings("unchecked")
List<MsgDemoMap> results = query.getResultList();
return results;
}
public List<MsgDemoMap> findByMessageId(Integer messageId) {
String sql = "select x from MsgDemoMap x where x.messageID=?1";
Query query = entityManager.createQuery(sql);
query.setParameter(1,messageId);
@SuppressWarnings("unchecked")
List<MsgDemoMap> results = query.getResultList();
return results;
}
@SuppressWarnings("unchecked")
public List<Object[]> getMessagesAndDemographicsByMessageId(Integer messageId) {
String sql = "FROM MsgDemoMap m, Demographic d " +
"WHERE m.messageID = :msgId " +
"AND d.DemographicNo = m.demographic_no " +
"ORDER BY d.LastName, d.FirstName";
Query query = entityManager.createQuery(sql);
query.setParameter("msgId", messageId);
return query.getResultList();
}
public List<Object[]> getMapAndMessagesByDemographicNo(Integer demoNo) {
// TODO Auto-generated method stub
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
return query.getResultList();
}
public List<Object[]> getMapAndMessagesByDemographicNoAndType(Integer demoNo, Integer type) {
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"AND m.type = :type ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
query.setParameter("type", type);
return query.getResultList();
}
public void remove(Integer messageID, Integer demographicNo ) {
String sql = "select x from MsgDemoMap x where x.messageID = :id and x.demographic_no = :demoNo";
Query query = entityManager.createQuery(sql);
query.setParameter("id", messageID);
query.setParameter("demoNo", demographicNo);
List<MsgDemoMap> list = query.getResultList();
for( MsgDemoMap demoMap : list ) {
this.remove(demoMap.getId());
}
}
/**
* Get the number of new (unread) messages associated with a demographic.
* @param demographicNo demographic to search against
* @param status status to use for filtering
* @return number of new messages
*/
public Integer getNumMessagesWithStatus(int demographicNo, String status)
{
String sql = "SELECT x FROM MsgDemoMap x, MessageList ml " +
"WHERE x.id = ml.message " +
"AND x.demographic_no = :demographicNo " +
"AND ml.status=:status";
Query query = entityManager.createQuery(sql);
query.setParameter("demographicNo", demographicNo);
query.setParameter("status", status);
List<MsgDemoMap> numMessages = query.getResultList();
return numMessages.size();
}
}
| 4,659
|
Java
|
.java
|
junoemr/junoemr
| 11
| 6
| 39
|
2018-06-06T17:33:56Z
|
2024-02-09T16:12:24Z
|
87086b58174168a66b8c9abdfcc6661ddc2ba0871baaa6687cdc6f3d311de496
|
[] |
[
1350,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
54,
50,
55,
53,
53,
55,
51,
24481,
451,
37865,
14340,
32703,
49,
22545,
8801,
11451,
51,
3381,
12902,
11921,
51,
222,
338,
1369,
2951,
458,
9582,
1549,
341,
23508,
6994,
6153,
5062,
1196,
51,
222,
338,
1369,
3477,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
222,
338,
5370,
580,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
641,
9582,
829,
341,
7834,
3870,
7120,
64,
3173,
1522,
244,
55,
222,
338,
451,
341,
1196,
49,
575,
327,
288,
1390,
2489,
46,
1364,
6146,
1522,
51,
222,
338,
222,
338,
1369,
3477,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
222,
338,
1294,
4213,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
222,
338,
7934,
575,
8114,
4800,
418,
7848,
7763,
51,
2819,
341,
222,
338,
6994,
6153,
5062,
1196,
456,
1851,
4261,
51,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
222,
338,
7979,
642,
477,
3477,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
222,
338,
7120,
49,
6367,
4345,
244,
58,
62,
38849,
17693,
449,
25280,
244,
56,
56,
53,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
54,
50,
54,
56,
53,
60,
49,
15067,
51,
222,
338,
222,
338,
1369,
2951,
1616,
6658,
456,
341,
222,
338,
24481,
451,
37865,
14340,
32703,
222,
338,
22545,
8801,
11451,
222,
338,
696,
20915,
955,
222,
338,
565,
585,
3454,
49,
48190,
222,
588,
222,
1337,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
13974,
64,
222,
222,
485,
1401,
51,
1058,
51,
739,
64,
222,
222,
485,
3698,
51,
10782,
51,
1643,
64,
222,
222,
485,
1105,
51,
519,
12818,
3943,
51,
2297,
51,
1184,
51,
4104,
11576,
1225,
64,
222,
485,
1105,
51,
4140,
51,
19017,
51,
3231,
64,
222,
222,
69,
3231,
222,
942,
462,
17596,
11576,
1225,
8924,
2041,
7406,
8924,
65,
4104,
11576,
1225,
4194,
499,
221,
942,
17596,
11576,
1225,
8924,
365,
320,
376,
221,
5282,
45,
4104,
11576,
1225,
51,
842,
312,
222,
221,
130,
3038,
221,
942,
1701,
65,
4104,
11576,
1225,
67,
34093,
11576,
14166,
2042,
45,
3078,
10891,
14166,
2042,
46,
320,
376,
221,
671,
5576,
299,
332,
1632,
837,
664,
17596,
11576,
1225,
837,
2174,
837,
51,
6418,
14166,
100,
1365,
28061,
54,
884,
294,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
294,
221,
1234,
51,
31887,
45,
54,
49,
6418,
14166,
2042,
312,
603,
496,
14030,
459,
18362,
678,
310,
1701,
65,
4104,
11576,
1225,
67,
3300,
299,
2487,
51,
23946,
739,
492,
310,
461,
3300,
64,
222,
221,
130,
3038,
221,
942,
1701,
65,
4104,
11576,
1225,
67,
34093,
41348,
45,
3078,
48557,
46,
320,
376,
221,
671,
5576,
299,
332,
1632,
837,
664,
17596,
11576,
1225,
837,
2174,
837,
51,
1454,
798,
28061,
54,
884,
294,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
294,
221,
1234,
51,
31887,
45,
54,
49,
1454,
625,
312,
603,
496,
14030,
459,
18362,
678,
310,
1701,
65,
4104,
11576,
1225,
67,
3300,
299,
2487,
51,
23946,
739,
492,
310,
461,
3300,
64,
222,
221,
130,
499,
221,
69,
14030,
459,
18362,
678,
222,
221,
942,
1701,
65,
976,
16420,
640,
6389,
2199,
11576,
7027,
1103,
41348,
45,
3078,
48557,
46,
320,
376,
221,
671,
5576,
299,
332,
9077,
17596,
11576,
1225,
364,
49,
17451,
14166,
362,
332,
494,
621,
221,
39,
17013,
364,
51,
1454,
798,
299,
518,
2093,
625,
332,
494,
9011,
332,
3362,
362,
51,
11576,
14166,
2042,
299,
364,
51,
6418,
14166,
100,
1365,
332,
494,
419,
332,
9359,
6944,
362,
51,
22837,
49,
362,
51,
20690,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
2093,
625,
411,
48557,
312,
310,
461,
2487,
51,
23946,
739,
492,
303,
339,
499,
221,
942,
1701,
65,
976,
16420,
640,
1225,
2199,
6389,
1103,
11576,
14166,
2042,
45,
3078,
10891,
2042,
46,
320,
3281,
453,
4314,
7998,
50,
6413,
1431,
11674,
376,
221,
671,
5576,
299,
332,
9077,
17596,
11576,
1225,
2010,
49,
4587,
30602,
364,
332,
494,
621,
221,
39,
17013,
364,
51,
333,
299,
2010,
51,
1454,
798,
332,
494,
621,
221,
39,
3362,
2010,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
332,
494,
621,
221,
39,
9359,
6944,
364,
51,
787,
21733,
49,
364,
51,
333,
21733,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
6418,
2042,
411,
10891,
2042,
312,
376,
221,
620,
2487,
51,
23946,
739,
492,
221,
18081,
339,
2776,
581,
1701,
65,
976,
16420,
640,
1225,
2199,
6389,
1103,
11576,
14166,
2042,
2199,
638,
45,
3078,
10891,
2042,
49,
4418,
847,
46,
320,
33016,
376,
221,
671,
5576,
299,
332,
9077,
17596,
11576,
1225,
2010,
49,
4587,
30602,
364,
332,
494,
621,
221,
39,
17013,
364,
51,
333,
299,
2010,
51,
1454,
798,
332,
494,
621,
221,
39,
3362,
2010,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
332,
494,
621,
221,
39,
3362,
364,
51,
700,
299,
518,
700,
17062,
6944,
364,
51,
787,
21733,
49,
364,
51,
333,
21733,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
6418,
2042,
411,
10891,
2042,
312,
419,
2487,
51,
31887,
459,
700,
411,
847,
312,
376,
221,
620,
2487,
51,
23946,
739,
492,
221,
18081,
339,
2776,
581,
782,
3365,
45,
3078,
1492,
798,
49,
4418,
10891,
14166,
2042,
848,
320,
343,
910,
5576,
299,
332,
1632,
837,
664,
17596,
11576,
1225,
837,
2174,
837,
51,
1454,
798,
299,
518,
333,
480,
837,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
884,
343,
6662,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
343,
2487,
51,
31887,
459,
333,
411,
1492,
798,
312,
343,
2487,
51,
31887,
459,
6418,
2042,
411,
10891,
14166,
2042,
312,
6455,
1701,
65,
4104,
11576,
1225,
67,
1168,
299,
2487,
51,
23946,
739,
492,
343,
456,
45,
17596,
11576,
1225,
10891,
1225,
518,
1168
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
]
] | 1,024
|
[
2042,
46,
320,
3281,
453,
4314,
7998,
50,
6413,
1431,
11674,
376,
221,
671,
5576,
299,
332,
9077,
17596,
11576,
1225,
2010,
49,
4587,
30602,
364,
332,
494,
621,
221,
39,
17013,
364,
51,
333,
299,
2010,
51,
1454,
798,
332,
494,
621,
221,
39,
3362,
2010,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
332,
494,
621,
221,
39,
9359,
6944,
364,
51,
787,
21733,
49,
364,
51,
333,
21733,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
6418,
2042,
411,
10891,
2042,
312,
376,
221,
620,
2487,
51,
23946,
739,
492,
221,
18081,
339,
2776,
581,
1701,
65,
976,
16420,
640,
1225,
2199,
6389,
1103,
11576,
14166,
2042,
2199,
638,
45,
3078,
10891,
2042,
49,
4418,
847,
46,
320,
33016,
376,
221,
671,
5576,
299,
332,
9077,
17596,
11576,
1225,
2010,
49,
4587,
30602,
364,
332,
494,
621,
221,
39,
17013,
364,
51,
333,
299,
2010,
51,
1454,
798,
332,
494,
621,
221,
39,
3362,
2010,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
332,
494,
621,
221,
39,
3362,
364,
51,
700,
299,
518,
700,
17062,
6944,
364,
51,
787,
21733,
49,
364,
51,
333,
21733,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
6418,
2042,
411,
10891,
2042,
312,
419,
2487,
51,
31887,
459,
700,
411,
847,
312,
376,
221,
620,
2487,
51,
23946,
739,
492,
221,
18081,
339,
2776,
581,
782,
3365,
45,
3078,
1492,
798,
49,
4418,
10891,
14166,
2042,
848,
320,
343,
910,
5576,
299,
332,
1632,
837,
664,
17596,
11576,
1225,
837,
2174,
837,
51,
1454,
798,
299,
518,
333,
480,
837,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
884,
343,
6662,
2487,
299,
4436,
1590
] | 845,681,882,873,980,300
| true
| false
| false
| false
|
[
494,
621,
221,
39,
17013,
364,
51,
333,
299,
2010,
51,
1454,
798,
332,
494,
621,
221,
39,
3362,
2010,
51,
6418,
14166,
100,
1365,
299,
518,
6418,
2042,
332,
494,
621,
221,
39,
3362,
364,
51,
700,
299,
518,
700,
17062,
6944,
364,
51,
787,
21733,
49,
364,
51,
333,
21733,
884,
376,
221,
1643,
2487,
299,
4436,
1590,
51,
45587,
45,
2622,
312,
376,
221,
1234,
51,
31887,
459,
6418,
2042,
411,
10891,
2042,
312,
419,
2487,
51,
31887,
459,
700,
411,
847,
312,
376,
221,
620,
2487,
51,
23946,
739,
492,
221,
18081,
339,
2776,
581,
782
] | 1,698,325,055,466,084,400
| true
|
No) {
// TODO Auto-generated method stub
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
return query.getResultList();
}
public List<Object[]> getMapAndMessagesByDemographicNoAndType(Integer demoNo, Integer type) {
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"AND m.type = :type ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
query.setParameter("type", type);
return query.getResultList();
}
public void
|
_no = :demoNo " +
"ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
return query.getResultList();
}
public List<Object[]> getMapAndMessagesByDemographicNoAndType(Integer demoNo, Integer type) {
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"AND m.type = :type ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
query.setParameter("type", type);
return query.getResultList();
}
public void
|
query.getResultList();
}
public List<Object[]> getMapAndMessagesByDemographicNoAndType(Integer demoNo, Integer type) {
String sql = "FROM MsgDemoMap map, MessageTbl m " +
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"AND m.type = :type ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
query.setParameter("type", type);
return query.getResultList();
}
public void
|
+
"WHERE m.id = map.messageID " +
"AND map.demographic_no = :demoNo " +
"AND m.type = :type ORDER BY m.date DESC, m.id DESC";
Query query = entityManager.createQuery(sql);
query.setParameter("demoNo", demoNo);
query.setParameter("type", type);
return query.getResultList();
}
public void
|
remove(Integer messageID, Integer demographicNo ) {
String sql = "select x from MsgDemoMap x where x.messageID = :id and x.demographic_no = :demoNo";
Query query = entityManager
|
MemoryMonitor.java
|
/FileExtraction/Java_unseen/corretto_corretto-11/test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/MemoryMonitor.java
|
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package nsk.monitoring.share;
import java.lang.management.*;
import javax.management.*;
import javax.management.openmbean.*;
import java.util.*;
import nsk.share.*;
/**
* <code>MemoryMonitor</code> class is a wrapper of <code>MemoryMXBean</code> and
* <code>MemoryPoolMXBean</code> interfaces. Depending on command line arguments,
* an instance of this class redirects invocations to the
* <code>MemoryMXBean</code> (or <code>MemoryPoolMXBean</code>) interface. If
* <code>-testMode="directly"</code> option is set, this instance directly
* invokes corresponding method of the <code>MemoryMXBean</code> (or
* <code>MemoryPoolMXBean</code>) interface. If <code>-testMode="server"</code>
* option is set it will make invocations via MBeanServer.
*
* @see ArgumentHandler
*/
public class MemoryMonitor extends Monitor implements NotificationListener,
NotificationFilter {
// Constants to define type of memory that will be allocated in
// MemoryMonitor. For heap memory objects will be allocated; for nonheap
// type classes will be loaded; for mixed type -- both (objects will be
// allocated and classes will be loaded).
public final static String HEAP_TYPE = "heap";
public final static String NONHEAP_TYPE = "nonheap";
public final static String MIXED_TYPE = "mixed";
// Names of the attributes of MemoryMXBean
private final static String POOL_TYPE = "Type";
private final static String POOL_RESET_PEAK = "resetPeakUsage";
private final static String POOL_PEAK = "PeakUsage";
private final static String POOL_VALID = "Valid";
private final static String POOL_U = "Usage";
private final static String UT = "UsageThreshold";
private final static String UT_COUNT = "UsageThresholdCount";
private final static String UT_SUPPORT = "UsageThresholdSupported";
private final static String UT_EXCEEDED = "UsageThresholdExceeded";
private final static String POOL_CU = "CollectionUsage";
private final static String CT = "CollectionUsageThreshold";
private final static String CT_COUNT = "CollectionUsageThresholdCount";
private final static String CT_SUPPORT = "CollectionUsageThresholdSupported";
private final static String CT_EXCEEDED = "CollectionUsageThresholdExceeded";
// Varibales to store options that are passed to the test
private static String memory;
private static int mode;
private static boolean isNotification;
private static boolean isUsageThreshold;
private static volatile boolean passed = true;
private Polling polling = new Polling();
static {
Monitor.logPrefix = "MemoryMonitor > ";
}
/**
* Creates a new <code>MemoryMonitor</code> object.
*
* @param log <code>Log</code> object to print info to.
* @param handler <code>ArgumentHandler</code> object that saves
* all info about test's arguments.
*
*/
public MemoryMonitor(Log log, ArgumentHandler handler) {
super(log, handler);
memory = handler.getTestedMemory();
mode = getTestMode();
isNotification = (handler.MON_NOTIF.equals(handler.getMonitoring()));
isUsageThreshold = (handler.TH_USAGE.equals(handler.getThreshold()));
String s = "\t(This setting is used in lowmem* tests only)";
display("Memory:\t" + handler.getTestedMemory() + s);
display("Monitoring:\t" + handler.getMonitoring() + s);
display("Threshold:\t" + handler.getThreshold() + s);
display("Timeout:\t" + handler.getTimeout() + s);
}
/**
* Returns <code>true</code> if no failures were revealed during the test,
* <code>false</code> otherwise.
*
* @return <code>true</code> if no failures were revealed during the test,
* <code>false</code> otherwise.
*
*/
public boolean getPassedStatus() {
return passed;
}
/**
* Enables memory monitoring.
* <p>
* If notification type of monitoring is chosen, the method adds {@link
* javax.management.NotificationListener
* <code>javax.management.NotificationListener</code>} to enables low
* memory detection support. If monitoring type is polling, a new thread
* that manages the low memory detection is started.
*
* @throws InstanceNotFoundException The MemoryMXBean is not registered on
* the server.
*/
public void enableMonitoring() throws InstanceNotFoundException {
if (isNotification) {
switch (mode) {
case DIRECTLY_MODE:
MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
NotificationEmitter emitter = (NotificationEmitter) mbean;
emitter.addNotificationListener(this, this, null);
break;
case SERVER_MODE:
case PROXY_MODE:
getMBeanServer().addNotificationListener(mbeanObjectName,
this, this, null);
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} else {
// Polling
// Start a thread that will manage all test modes
polling.start();
}
} // enableMonitoring()
/**
* Disables memory monitoring.
* <p>
* If monitoring type is polling, the thread that manages the low memory
* detection is stopped.
*/
public void disableMonitoring() {
if (!isNotification) {
// Stop polling thread
polling.goOn = false;
}
} // disableMonitoring()
/**
* Updates thresholds. Thresholds values for all pools will be greater
* than <code>used</code> value.
* <p>
* If <code>usage</code> thresholds are chosen, the method updates just
* pools that support usage thresholds. If <code>collection</code>
* thresholds are chosen, the method updates memory pools that support
* collection usage thresholds.
*
* This method is synchronized because it may be invoked from
* <code>handleNotification</code> which is potentially done from
* multiple threads.
*/
public synchronized void updateThresholds() {
if (isUsageThreshold) {
updateUsageThresholds();
} else {
updateCollectionThresholds();
}
}
/**
* Reset thresholds. Thresholds values for all pools will be 1.
* If <code>usage</code> thresholds are chosen, the method updates just
* pools that support usage thresholds. If <code>collection</code>
* thresholds are chosen, the method updates memory pools that support
* collection usage thresholds.
*
* This method is synchronized because it may be invoked from
* multiple threads.
*/
public synchronized void resetThresholds(MemoryType type) {
List pools = getMemoryPoolMBeans();
for (int i = 0; i < pools.size(); i++) {
Object pool = pools.get(i);
if (isUsageThresholdSupported(pool)) {
if (getType(pool).equals(type)) {
setUsageThreshold(pool, 1);
}
}
}
}
/**
* The method is invoked before sending the notification to the listener.
*
* @param notification The notification to be sent.
* @return <i>true</i> if the notification has to be sent to the listener;
* <i>false</i> otherwise.
*
* @see javax.management.NotificationFilter
*/
public boolean isNotificationEnabled(Notification notification) {
String type = notification.getType();
String usage = MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED;
String collection = MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED;
if (isUsageThreshold) {
return type.equals(usage);
} else {
return type.equals(collection);
}
} // isNotificationEnabled()
/**
* The method is invoked when a JMX notification occurs.
*
* @param notification The notification to be sent.
* @param handback An opaque object which helps the listener to associate
* information regarding the MBean emitter.
* @see javax.management.NotificationListener
*/
public void handleNotification(Notification notification, Object handback) {
CompositeData data = (CompositeData) notification.getUserData();
MemoryNotificationInfo mn = MemoryNotificationInfo.from(data);
display(mn.getCount() + " notification \"" + notification.getMessage()
+ "\" is caught on " + (new Date(notification.getTimeStamp()))
+ " by " + mn.getPoolName() + " (" + mn.getUsage() + ")");
updateThresholds();
} // handleNotification()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#resetPeakUsage
* <code>MemoryPoolMXBean.resetPeakUsage()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
*/
public void resetPeakUsage(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
directPool.resetPeakUsage();
break;
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
try {
getMBeanServer().invoke(serverPool, POOL_RESET_PEAK,
null, null);
} catch (Exception e) {
e.printStackTrace(logger.getOutStream());
throw new Failure(e);
}
break;
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
proxyPool.resetPeakUsage();
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} // resetPeakUsage()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getPeakUsage
* <code>MemoryPoolMXBean.getPeakUsage()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>MemoryUsage</code> object representing the peak memory
* usage; <code>null</code> otherwise.
*/
public MemoryUsage getPeakUsage(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getPeakUsage();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getMemoryUsageAttribute(serverPool, POOL_PEAK);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getPeakUsage();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getPeakUsage()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getUsage
* <code>MemoryPoolMXBean.getUsage()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>MemoryUsage</code> object; or <code>null</code> if this
* pool not valid.
*/
public MemoryUsage getUsage(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getUsage();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getUsageOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getUsage();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getUsage()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getCollectionUsage
* <code>MemoryPoolMXBean.getCollectionUsage()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>MemoryUsage</code> object; or <code>null</code> if this
* method is not supported.
*/
public MemoryUsage getCollectionUsage(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getCollectionUsage();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getCollectionUsageOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getCollectionUsage();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getCollectionUsage()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#isValid
* <code>MemoryPoolMXBean.isValid()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>true</code> if the memory pool is valid in the running
* JVM; <code>null</code> otherwise.
*/
public boolean isValid(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.isValid();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getBooleanAttribute(serverPool, POOL_VALID);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.isValid();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // isValid()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#isUsageThresholdSupported
* <code>MemoryPoolMXBean.isUsageThresholdSupported()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>true</code> if the memory pool supports usage threshold;
* <code>null</code> otherwise.
*/
public boolean isUsageThresholdSupported(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.isUsageThresholdSupported();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return isUsageThresholdSupportedOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.isUsageThresholdSupported();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // isUsageThresholdSupported()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#isCollectionUsageThresholdSupported
* <code>MemoryPoolMXBean.isCollectionUsageThresholdSupported()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>true</code> if the memory pool supports collection
* usage threshold; <code>null</code> otherwise.
*/
public boolean isCollectionThresholdSupported(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.isCollectionUsageThresholdSupported();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return isCollectionThresholdSupportedOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.isCollectionUsageThresholdSupported();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // isCollectionThresholdSupported()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#isUsageThresholdExceeded
* <code>MemoryPoolMXBean.isUsageThresholdExceeded()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>true</code> if the memory usage of this pool reaches or
* exceeds the threshold value; <code>null</code> otherwise.
*/
public boolean isUsageThresholdExceeded(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.isUsageThresholdExceeded();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return isUsageThresholdExceededOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.isUsageThresholdExceeded();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // isUsageThresholdExceeded()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#isCollectionUsageThresholdExceeded
* <code>MemoryPoolMXBean.isCollectionUsageThresholdExceeded()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return a <code>true</code> if the memory usage of this pool reaches or
* exceeds the collection usage threshold value in the most recent
* collection; <code>null</code> otherwise.
*/
public boolean isCollectionThresholdExceeded(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.isCollectionUsageThresholdExceeded();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return isCollectionThresholdExceededOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.isCollectionUsageThresholdExceeded();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // isCollectionThresholdExceeded()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getUsageThreshold
* <code>MemoryPoolMXBean.getUsageThreshold()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return the usage threshold value of this memory pool in bytes.
*/
public long getUsageThreshold(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getUsageThreshold();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getUsageThresholdOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getUsageThreshold();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getUsageThreshold()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getCollectionUsageThreshold
* <code>MemoryPoolMXBean.getCollectionUsageThreshold()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return the collection usage threshold value of this memory pool in
* bytes.
*/
public long getCollectionThreshold(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getCollectionUsageThreshold();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getCollectionThresholdOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getCollectionUsageThreshold();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getCollectionThreshold()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getUsageThresholdCount
* <code>MemoryPoolMXBean.getUsageThresholdCount()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return number of times that the memory usage has crossed its usage
* threshold value.
*/
public long getUsageThresholdCount(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getUsageThresholdCount();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getUsageThresholdCountOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getUsageThresholdCount();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getUsageThresholdCount()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getCollectionUsageThresholdCount
* <code>MemoryPoolMXBean.getCollectionUsageThresholdCount()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return number of times that the memory usage has crossed its collection
* usage threshold value.
*/
public long getCollectionThresholdCount(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getCollectionUsageThresholdCount();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getCollectionThresholdCountOnServer(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getCollectionUsageThresholdCount();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getCollectionThresholdCount()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#setUsageThreshold
* <code>MemoryPoolMXBean.setUsageThreshold()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @param threshold the new threshold value.
*/
public void setUsageThreshold(Object poolObject, long threshold) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
directPool.setUsageThreshold(threshold);
break;
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
setUsageThresholdOnServer(serverPool, threshold);
break;
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
proxyPool.setUsageThreshold(threshold);
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} // setUsageThreshold()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#setCollectionUsageThreshold
* <code>MemoryPoolMXBean.setCollectionUsageThreshold()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @param threshold the new collection usage threshold value.
*/
public void setCollectionThreshold(Object poolObject, long threshold) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
directPool.setCollectionUsageThreshold(threshold);
break;
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
setCollectionThresholdOnServer(serverPool, threshold);
break;
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
proxyPool.setCollectionUsageThreshold(threshold);
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} // setCollectionThreshold()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getName
* <code>MemoryPoolMXBean.getName()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return the name of the memory pool.
*/
public String getName(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getName();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return serverPool.toString();
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getName();
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getName()
/**
* Redirects the invocation to {@link
* java.lang.management.MemoryPoolMXBean#getType
* <code>MemoryPoolMXBean.getType()</code>}.
*
* @param poolObject reference to the pool. The pool may be specified
* either by <code>ObjectName</code>, or
* <code>MemoryPoolMXBean</code>.
* @return the name of the memory pool.
*/
public MemoryType getType(Object poolObject) {
switch (mode) {
case DIRECTLY_MODE:
MemoryPoolMXBean directPool = (MemoryPoolMXBean) poolObject;
return directPool.getType();
case SERVER_MODE:
ObjectName serverPool = (ObjectName) poolObject;
return getType(serverPool);
case PROXY_MODE:
MemoryPoolMXBean proxyPool = (MemoryPoolMXBean) poolObject;
return proxyPool.getType();
default:
throw new TestBug("Unknown testMode " + mode);
}
}
/**
* Redirects the invocation to {@link
* java.lang.management.ManagementFactory#getMemoryPoolMXBeans
* <code>ManagementFactory.getMemoryPoolMXBeans()</code>}.
*
* @return a list of <code>MemoryPoolMXBean</code> objects.
*/
public List<? extends Object> getMemoryPoolMBeans() {
switch (mode) {
case DIRECTLY_MODE:
return ManagementFactory.getMemoryPoolMXBeans();
case SERVER_MODE: {
ObjectName[] names = getMemoryPoolMXBeansOnServer();
ArrayList<ObjectName> list = new ArrayList<ObjectName>();
for (int i = 0; i < names.length; i++) {
list.add(names[i]);
}
return list;
}
case PROXY_MODE: {
ObjectName[] names = getMemoryPoolMXBeansOnServer();
ArrayList<MemoryPoolMXBean> list = new ArrayList<MemoryPoolMXBean>();
for (int i = 0; i < names.length; i++) {
list.add(getProxy(names[i]));
}
return list;
}
default:
throw new TestBug("Unknown testMode " + mode);
}
} // getMemoryPoolMXBeans()
// **********************************************************************
//
// Private methods
//
// **********************************************************************
private MemoryPoolMXBean getProxy(ObjectName objectName) {
try {
MemoryPoolMXBean proxy = (MemoryPoolMXBean) ManagementFactory.newPlatformMXBeanProxy(
getMBeanServer(),
objectName.toString(),
MemoryPoolMXBean.class);
return proxy;
} catch (Exception e) {
throw new Failure(e);
}
}
// Sets new usage threasholds in all pools that match the tested memory and
// support low memory detetion. A new value will be greater than used value
// for the pool.
private void updateUsageThresholds() {
switch (mode) {
case DIRECTLY_MODE:
// we can use the same code here for direct and proxy modes
case PROXY_MODE:
List poolsMBean = ManagementFactory.getMemoryPoolMXBeans();
for (int i = 0; i < poolsMBean.size(); i++) {
MemoryPoolMXBean pool = (MemoryPoolMXBean) poolsMBean.get(i);
if (!pool.isUsageThresholdSupported()) {
continue;
}
MemoryType mt = pool.getType();
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
// Yes! We got the pool that
// 1. supports usage threshold
// 2. has type that match tested type
// So, update the pool with new threshold
long oldT = pool.getUsageThreshold();
MemoryUsage usage = pool.getUsage();
long newT = newThreshold(usage, oldT, pool.getName());
try {
pool.setUsageThreshold(newT);
} catch (IllegalArgumentException e) {
/*
* Max value might have changed since the call to newThreshold()
* above. If it has fallen below the value of newT, which is certainly
* possible, an exception like this one will be thrown from
* sun.management.MemoryPoolImpl.setUsageThreshold():
*
* java.lang.IllegalArgumentException: Invalid threshold: 48332800 > max (47251456).
*
* We don't know the max value at the time of the failed call, and it
* might have changed since the call once more. So there is no point
* trying to detect whether the IllegalArgumentException had been
* justified, we cannot know it at this point.
*
* The best we can do is log the fact and continue.
*/
displayInfo("setUsageThreshold() failed with " + e + ", ignoring... ",
pool,
"current usage after the call to setUsageThreshold(): ", getUsage(pool),
"threshold: ", newT);
continue;
}
displayInfo("Usage threshold is set", pool, "usage: ", pool.getUsage(), "threshold: ", pool.getUsageThreshold());
if (pool.getUsageThreshold() != newT) {
complain("Cannot reset usage threshold from " + oldT
+ " to " + newT + " in pool " + pool.getName() + " "
+ pool.getUsageThreshold());
passed = false;
}
} // for i
break;
case SERVER_MODE:
ObjectName[] pools = getMemoryPoolMXBeansOnServer();
for (int i = 0; i < pools.length; i++) {
if (!isUsageThresholdSupportedOnServer(pools[i])) {
continue;
}
MemoryType mt = getType(pools[i]);
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
// Yes! We got the pool that
// 1. supports usage threshold
// 2. has type that match tested type
// So, update the pool with new threshold
long oldT = getUsageThreshold(pools[i]);
long newT = newThreshold(getUsageOnServer(pools[i]), oldT,
pools[i].toString());
try {
setUsageThresholdOnServer(pools[i], newT);
} catch (Failure e) {
/*
* Max value might have changed since the call to newThreshold()
* above. If it has fallen below the value of newT, which is certainly
* possible, an exception like this one will be thrown from
* sun.management.MemoryPoolImpl.setUsageThreshold():
*
* java.lang.IllegalArgumentException: Invalid threshold: 48332800 > max (47251456).
*
* and we'll catch Failure here as a result (it'll be thrown by
* Monitor.setLongAttribute).
*
* We don't know the max value at the time of the failed call, and it
* might have changed since the call once more. So there is no point
* trying to detect whether the IllegalArgumentException had been
* justified, we cannot know it at this point.
*
* The best we can do is log the fact and continue.
*/
displayInfo("setUsageThresholdOnServer() failed with " + e + ", ignoring... ",
pools[i],
"current usage after the call to setUsageThresholdOnServer(): ", getUsageOnServer(pools[i]),
"threshold: ", newT);
continue;
}
displayInfo("Usage threshold is set", null, "pool: ", pools[i], "usage:", getUsageOnServer(pools[i]));
if (getUsageThreshold(pools[i]) != newT) {
complain("Cannot reset usage threshold from " + oldT + " to "
+ newT + " in pool " + pools[i].toString());
passed = false;
}
} // for i
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} // updateUsageThresholds()
// Sets new collection usage threasholds in all pools that match the tested
// memory and support low memory detetion. A new value will be greater than
// used value for the pool.
private void updateCollectionThresholds() {
switch (mode) {
case DIRECTLY_MODE:
// we can use the same code here for direct and proxy modes
case PROXY_MODE:
List poolsMBean = ManagementFactory.getMemoryPoolMXBeans();
for (int i = 0; i < poolsMBean.size(); i++) {
MemoryPoolMXBean pool = (MemoryPoolMXBean) poolsMBean.get(i);
if (!pool.isCollectionUsageThresholdSupported()) {
continue;
}
MemoryType mt = pool.getType();
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
// Yes! We got the pool that
// 1. supports collection threshold
// 2. has type that match tested type
// So, update the pool with new threshold
long oldT = pool.getCollectionUsageThreshold();
MemoryUsage usage = pool.getUsage();
long newT = newThreshold(usage, oldT, pool.getName());
try {
pool.setCollectionUsageThreshold(newT);
} catch (IllegalArgumentException e) {
/*
* Max value might have changed since the call to newThreshold()
* above. If it has fallen below the value of newT, which is certainly
* possible, an exception like this one will be thrown from
* sun.management.MemoryPoolImpl.setCollectionUsageThreshold():
*
* java.lang.IllegalArgumentException: Invalid threshold: 48332800 > max (47251456).
*
* We don't know the max value at the time of the failed call, and it
* might have changed since the call once more. So there is no point
* trying to detect whether the IllegalArgumentException had been
* justified, we cannot know it at this point.
*
* The best we can do is log the fact and continue.
*/
displayInfo("setCollectionUsageThreshold() failed with " + e + ", ignoring... ",
pool,
"current usage after the call to setCollectionUsageThreshold(): ", getUsage(pool),
"threshold: ", newT);
continue;
}
displayInfo("Collection threshold is set", pool, "usage: ", getUsage(pool), "threshold: ", newT);
if (pool.getCollectionUsageThreshold() != newT) {
complain("Cannot reset collection threshold from " + oldT
+ " to " + newT + " in pool " + pool.getName() + " "
+ pool.getCollectionUsageThreshold());
passed = false;
}
} // for i
break;
case SERVER_MODE:
ObjectName[] pools = getMemoryPoolMXBeansOnServer();
for (int i = 0; i < pools.length; i++) {
if (!isCollectionThresholdSupportedOnServer(pools[i])) {
continue;
}
MemoryType mt = getType(pools[i]);
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
// Yes! We got the pool that
// 1. supports usage threshold
// 2. has type that match tested type
// So, update the pool with new threshold
long oldT = getCollectionThresholdOnServer(pools[i]);
long newT = newThreshold(getUsageOnServer(pools[i]), oldT,
pools[i].toString());
try {
setCollectionThresholdOnServer(pools[i], newT);
} catch (Failure e) {
/*
* Max value might have changed since the call to newThreshold()
* above. If it has fallen below the value of newT, which is certainly
* possible, an exception like this one will be thrown from
* sun.management.MemoryPoolImpl.setCollectionUsageThreshold():
*
* java.lang.IllegalArgumentException: Invalid threshold: 48332800 > max (47251456).
*
* and we'll catch Failure here as a result (it'll be thrown by
* Monitor.setLongAttribute).
*
* We don't know the max value at the time of the failed call, and it
* might have changed since the call once more. So there is no point
* trying to detect whether the IllegalArgumentException had been
* justified, we cannot know it at this point.
*
* The best we can do is log the fact and continue.
*/
displayInfo("setCollectionThresholdOnServer() failed with " + e + ", ignoring... ",
pools[i],
"current usage after the call to setCollectionThresholdOnServer(): ", getUsageOnServer(pools[i]),
"threshold: ", newT);
continue;
}
displayInfo("Collection threshold is set", pools[i], "usage: ", getUsageOnServer(pools[i]), "threshold: ", newT);
if (getCollectionThresholdOnServer(pools[i]) != newT) {
complain("Cannot reset collaction threshold from " + oldT
+ " to " + newT + " in pool " + pools[i].toString());
passed = false;
}
} // for i
break;
default:
throw new TestBug("Unknown testMode " + mode);
}
} // updateCollectionThresholds()
// Calculates a new value of threshold based on MemoryUsage and old value of
// the threshold. New one will be not less than previous one.
private long newThreshold(MemoryUsage mu, long oldT, String poolName) {
long newT = mu.getCommitted() / 2 + mu.getUsed() / 2;
long max = mu.getMax();
if (newT < oldT) {
newT = mu.getCommitted() / 2 + oldT / 2;
}
if ((max > -1) && (newT > max)) {
newT = max;
}
displayInfo("Changing threshold", poolName, null, null, "new threshold: ", newT);
return newT;
}
// **********************************************************************
//
// Methods to work with MBean server in SERVER_MODE
//
// **********************************************************************
// Returns usage threshold value of the pool MBean that is accessed via
// MBeanServer
private long getUsageThresholdOnServer(ObjectName pool) {
return getLongAttribute(pool, UT);
}
// Returns collection threshold value of the pool MBean that is accessed via
// MBeanServer
private long getCollectionThresholdOnServer(ObjectName pool) {
return getLongAttribute(pool, CT);
}
// Sets new usage threshold value for the pool MBean that is accessed via
// MBeanServer
private void setUsageThresholdOnServer(ObjectName pool, long value) {
setLongAttribute(pool, UT, value);
}
// Sets new collection threshold value for the pool MBean that is accessed
// via MBeanServer
private void setCollectionThresholdOnServer(ObjectName pool, long value) {
setLongAttribute(pool, CT, value);
}
// Returns MemoryType of the pool MBean that is accessed via MBeanServer.
private MemoryType getType(ObjectName pool) {
try {
Object value = getMBeanServer().getAttribute(pool, POOL_TYPE);
if (value instanceof MemoryType) {
return (MemoryType) value;
} else if (value instanceof String) {
String name = (String) value;
return MemoryType.valueOf(name);
} else {
return null;
}
} catch (Exception e) {
e.printStackTrace(logger.getOutStream());
throw new Failure(e);
}
}
// Returns MemoryUsage of the pool MBean that is accessed via MBeanServer
private MemoryUsage getUsageOnServer(ObjectName pool) {
return getMemoryUsageAttribute(pool, POOL_U);
}
// Returns collection usage of the pool MBean that is accessed via
// MBeanServer
private MemoryUsage getCollectionUsageOnServer(ObjectName pool) {
return getMemoryUsageAttribute(pool, POOL_CU);
}
// Returns if usage threshold is supported in the pool
private boolean isUsageThresholdSupportedOnServer(ObjectName pool) {
return getBooleanAttribute(pool, UT_SUPPORT);
}
// Returns if collection threshold is supported in the pool
private boolean isCollectionThresholdSupportedOnServer(ObjectName pool) {
return getBooleanAttribute(pool, CT_SUPPORT);
}
// Returns if usage threshold is exceeded in the pool
private boolean isUsageThresholdExceededOnServer(ObjectName pool) {
return getBooleanAttribute(pool, UT_EXCEEDED);
}
// Returns if collection threshold is exceeded in the pool
private boolean isCollectionThresholdExceededOnServer(ObjectName pool) {
return getBooleanAttribute(pool, CT_EXCEEDED);
}
// Returns the usage threshold count of the pool
private long getUsageThresholdCountOnServer(ObjectName pool) {
return getLongAttribute(pool, UT_COUNT);
}
// Returns the collection threshold count of the pool.
private long getCollectionThresholdCountOnServer(ObjectName pool) {
return getLongAttribute(pool, CT_COUNT);
}
private final StringBuffer buffer = new StringBuffer(1000);
/**
* Display information about execution ignoring OOM.
*/
private void displayInfo(String message, Object pool, String message1, Object n1, String message2, long n2) {
try {
buffer.delete(0, buffer.length());
buffer.append(message);
if (pool != null) {
buffer.append(", pool: ");
buffer.append(pool.toString());
}
buffer.append(", ");
buffer.append(message1);
buffer.append(n1);
if (message2 != null) {
buffer.append(", ");
buffer.append(message2);
buffer.append(n2);
}
display(buffer.toString());
} catch (OutOfMemoryError e) {
// Ignore.
}
}
/**
* Display information about execution ignoring OOM.
*/
private void displayInfo(String message, MemoryPoolMXBean pool, String message1, Object n1, String message2, Object n2) {
try {
buffer.delete(0, buffer.length());
buffer.append(message);
if (pool != null) {
buffer.append(", pool: ");
buffer.append(pool.getName());
}
buffer.append(", ");
buffer.append(message1);
buffer.append(n1);
if (message2 != null) {
buffer.append(", ");
buffer.append(message2);
buffer.append(n2);
}
display(buffer.toString());
} catch (OutOfMemoryError e) {
// Ignore.
}
}
// Returns all MemoryPoolMXBeans that are registered on the MBeanServer
private ObjectName[] getMemoryPoolMXBeansOnServer() {
// Get all registered MBeans on the server
ObjectName filterName = null;
try {
filterName = new ObjectName(
ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE + ",*");
Set<ObjectName> filteredSet = getMBeanServer().queryNames(filterName, null);
return filteredSet.toArray(new ObjectName[0]);
} catch(Exception e) {
return new ObjectName[0];
}
} // getMemoryPoolMXBeansOnServer()
// **********************************************************************
//
// Class to implement polling mechanism of monitoring
//
// **********************************************************************
class Polling extends Thread {
final static long WAIT_TIME = 100; // Milliseconds
Object object = new Object();
long[] thresholdCounts;
boolean goOn = true;
public void run() {
try {
if (isUsageThreshold) {
pollUsageThresholds();
} else {
pollCollectionThresholds();
}
} catch (Failure e) {
complain("Unexpected " + e + " in Polling thread");
e.printStackTrace(logger.getOutStream());
passed = false;
}
} // run()
private void pollUsageThresholds() {
switch (mode) {
case DIRECTLY_MODE:
// we can use the same code here for direct and proxy modes
case PROXY_MODE:
List poolsMBean = ManagementFactory.getMemoryPoolMXBeans();
// Create an array to store all threshold values
thresholdCounts = new long[poolsMBean.size()];
for (int i = 0; i < thresholdCounts.length; i++) {
thresholdCounts[i] = 0;
}
while (goOn) {
synchronized (object) {
try {
object.wait(WAIT_TIME);
} catch (InterruptedException e) {
// Stop the thread
return;
}
} // synchronized
for (int i = 0; i < poolsMBean.size(); i++) {
MemoryPoolMXBean pool = (MemoryPoolMXBean) poolsMBean.get(i);
MemoryType mt = pool.getType();
if (!pool.isUsageThresholdSupported()) {
continue;
}
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
boolean exceeded;
// The exception is not documented, but it may be
// erroneously thrown
try {
exceeded = pool.isUsageThresholdExceeded();
} catch (IllegalArgumentException e) {
complain("Unexpected exception while retrieving "
+ "isUsageThresholdExceeded() for pool "
+ pool.getName());
e.printStackTrace(logger.getOutStream());
passed = false;
continue;
}
if (!exceeded
|| pool.getUsageThresholdCount() == thresholdCounts[i]) {
continue;
}
// Yes! We got the pool that
// 1. supports usage threshold
// 2. has type that match tested type
// 3. its threshold is exceeded
// So, update all thresholds
long c = pool.getUsageThresholdCount();
if (c <= thresholdCounts[i]) {
complain("Usage threshold count is not greater "
+ "than previous one: " + c + " < "
+ thresholdCounts[i] + " in pool "
+ pool.getName());
passed = false;
}
thresholdCounts[i] = c;
displayInfo("Crossing is noticed", pool, "usage: ", pool.getUsage(), "count: ", c);
updateThresholds();
} // for i
} // while
break;
case SERVER_MODE:
ObjectName[] pools = getMemoryPoolMXBeansOnServer();
// Create an array to store all threshold values
thresholdCounts = new long[pools.length];
for (int i = 0; i < thresholdCounts.length; i++) {
thresholdCounts[i] = 0;
}
while (goOn) {
synchronized (object) {
try {
object.wait(WAIT_TIME);
} catch (InterruptedException e) {
// Stop the thread
return;
}
} // synchronized
for (int i = 0; i < pools.length; i++) {
MemoryType mt = getType(pools[i]);
if (!isUsageThresholdSupportedOnServer(pools[i])) {
continue;
}
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
boolean exceeded;
// The exception is not documented, but it may be
// erroneously thrown
try {
exceeded = isUsageThresholdExceededOnServer(pools[i]);
} catch (Failure e) {
complain("Unexpected exception while retrieving "
+ "isUsageThresholdExceeded() for pool "
+ pools[i].toString());
e.printStackTrace(logger.getOutStream());
passed = false;
continue;
}
if (!exceeded
|| getUsageThresholdCount(pools[i]) == thresholdCounts[i]) {
continue;
}
// Yes! We got the pool that
// 1. supports usage threshold
// 2. has type that match tested type
// 3. its threshold is exceeded
// So, update all thresholds
long c = getUsageThresholdCount(pools[i]);
if (c <= thresholdCounts[i]) {
complain("Usage threshold count is not greater "
+ "than previous one: " + c + " < "
+ thresholdCounts[i] + " in pool "
+ pools[i].toString());
passed = false;
}
thresholdCounts[i] = c;
displayInfo("Crossing is noticed", null, "pool: ", pools[i], "usage: ", getUsageOnServer(pools[i]));
updateThresholds();
} // for i
} // while
break;
default:
throw new TestBug("Unknown testMode " + mode);
} // switch
} // pollUsageThresholds()
private void pollCollectionThresholds() {
switch (mode) {
case DIRECTLY_MODE:
// we can use the same code here for direct and proxy modes
case PROXY_MODE:
List poolsMBean = ManagementFactory.getMemoryPoolMXBeans();
// Create an array to store all threshold values
thresholdCounts = new long[poolsMBean.size()];
for (int i = 0; i < thresholdCounts.length; i++) {
thresholdCounts[i] = 0;
}
while (goOn) {
synchronized (object) {
try {
object.wait(WAIT_TIME);
} catch (InterruptedException e) {
// Stop the thread
return;
}
} // synchronized
for (int i = 0; i < poolsMBean.size(); i++) {
MemoryPoolMXBean pool = (MemoryPoolMXBean) poolsMBean.get(i);
MemoryType mt = pool.getType();
if (!pool.isCollectionUsageThresholdSupported()) {
continue;
}
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
boolean exceeded;
// The exception is not documented, but it may be
// erroneously thrown
try {
exceeded = pool.isCollectionUsageThresholdExceeded();
} catch (IllegalArgumentException e) {
complain("Unexpected exception while retrieving "
+ "isCollectionUsageThresholdExceeded()"
+ " for pool " + pool.getName());
e.printStackTrace(logger.getOutStream());
passed = false;
continue;
}
if (!exceeded
|| pool.getCollectionUsageThresholdCount()
== thresholdCounts[i]) {
continue;
}
// Yes! We got thet pool that
// 1. supports collection usage threshold
// 2. has type that match tested type
// 3. its threshold is exceeded
// So, update all thresholds
long c = pool.getCollectionUsageThresholdCount();
if (c <= thresholdCounts[i]) {
complain("Collection usage threshold count is "
+ "not greater than previous one: " + c
+ " < " + thresholdCounts[i] + " in pool "
+ pool.getName());
passed = false;
}
thresholdCounts[i] = c;
displayInfo("Crossing is noticed", pool, "usage: ", pool.getUsage(), "count: ", c);
updateThresholds();
} // for i
} // while
break;
case SERVER_MODE:
ObjectName[] pools = getMemoryPoolMXBeansOnServer();
// Create an array to store all threshold values
thresholdCounts = new long[pools.length];
for (int i = 0; i < thresholdCounts.length; i++) {
thresholdCounts[i] = 0;
}
while (goOn) {
synchronized (object) {
try {
object.wait(WAIT_TIME);
} catch (InterruptedException e) {
// Stop the thread
return;
}
} // synchronized
for (int i = 0; i < pools.length; i++) {
MemoryType mt = getType(pools[i]);
if (!isCollectionThresholdSupportedOnServer(pools[i])) {
continue;
}
if ((!mt.equals(MemoryType.HEAP)
|| !memory.equals(HEAP_TYPE))
&& (!mt.equals(MemoryType.NON_HEAP)
|| !memory.equals(NONHEAP_TYPE))
&& !memory.equals(MIXED_TYPE)) {
continue;
}
boolean exceeded;
// The exception is not documented, but it may be
// erroneously thrown
try {
exceeded = isCollectionThresholdExceededOnServer(pools[i]);
} catch (Failure e) {
complain("Unexpected exception while retrieving "
+ "isCollectionUsageThresholdExceeded() "
+ "for pool " + pools[i].toString());
e.printStackTrace(logger.getOutStream());
passed = false;
continue;
}
if (!exceeded
|| getCollectionThresholdCountOnServer(pools[i])
== thresholdCounts[i]) {
continue;
}
// Yes! We got thet pool that
// 1. supports collection usage threshold
// 2. has type that match tested type
// 3. its threshold is exceeded
// So, update all thresholds
long c = getCollectionThresholdCountOnServer(pools[i]);
if (c <= thresholdCounts[i]) {
complain("Collection usage threshold count is "
+ "not greater than previous one: " + c
+ " < " + thresholdCounts[i] + " in pool "
+ pools[i].toString());
passed = false;
}
thresholdCounts[i] = c;
displayInfo("Crossing is noticed", pools[i], "usage: ", getUsageOnServer(pools[i]), "count: ", c);
updateThresholds();
} // for i
} // while
break;
default:
throw new TestBug("Unknown testMode " + mode);
} // switch
} // pollCollectionThresholds()
} // class Polling
} // MemoryMonitor
| 68,642
|
Java
|
.java
|
corretto/corretto-11
| 662
| 105
| 31
|
2019-02-11T20:13:52Z
|
2024-05-09T07:01:40Z
|
e617c002f963e6e184336752aaa77870e9ad3545f2481cca817d7dd4c75be36f
|
[] |
[
1127,
222,
338,
2657,
327,
104,
46,
244,
55,
53,
53,
56,
49,
244,
55,
53,
54,
61,
49,
17980,
480,
52,
290,
2840,
25094,
51,
3381,
4760,
5225,
51,
222,
338,
4103,
2387,
23740,
1895,
35234,
8995,
2387,
11988,
1895,
8968,
10961,
30441,
51,
222,
338,
222,
338,
1369,
1361,
458,
3760,
2951,
64,
863,
902,
14081,
580,
480,
52,
290,
5370,
580,
222,
338,
1549,
341,
5974,
451,
341,
6994,
6153,
5062,
1196,
1522,
244,
55,
1773,
49,
641,
222,
338,
9582,
829,
341,
7834,
3870,
7120,
51,
222,
338,
222,
338,
1369,
1361,
458,
2744,
347,
341,
9850,
708,
580,
1118,
545,
6386,
49,
1294,
4213,
222,
338,
2979,
9345,
64,
2895,
4462,
341,
4506,
14319,
451,
7934,
575,
222,
338,
8114,
4800,
418,
7848,
7763,
51,
244,
2819,
341,
6994,
6153,
5062,
1196,
222,
338,
1522,
244,
55,
456,
1851,
4261,
327,
102,
1948,
458,
5976,
347,
341,
7621,
822,
708,
222,
338,
20854,
297,
4850,
477,
1361,
566,
222,
338,
222,
338,
2469,
1414,
1178,
6589,
331,
1948,
451,
341,
6994,
6153,
5062,
1196,
1522,
222,
338,
244,
55,
7979,
642,
477,
1409,
64,
434,
666,
49,
2886,
391,
341,
7834,
3870,
7120,
49,
222,
338,
6367,
4345,
244,
58,
54,
34113,
1277,
49,
33316,
26912,
49,
25006,
49,
13083,
244,
53,
55,
54,
54,
53,
50,
54,
56,
53,
54,
15067,
51,
222,
338,
222,
338,
5304,
7272,
17980,
49,
244,
58,
53,
53,
17980,
27004,
3094,
49,
4777,
21100,
2432,
6868,
49,
10562,
244,
62,
57,
53,
59,
58,
15067,
222,
338,
575,
7739,
19955,
51,
11116,
51,
527,
434,
863,
1868,
5408,
2490,
575,
1178,
1364,
222,
338,
10034,
51,
222,
588,
222,
1337,
329,
2009,
51,
20638,
51,
6085,
64,
222,
222,
485,
1401,
51,
1600,
51,
9343,
7737,
222,
485,
3698,
51,
9343,
7737,
222,
485,
3698,
51,
9343,
51,
1693,
114,
12455,
7737,
222,
485,
1401,
51,
1058,
7737,
222,
222,
485,
329,
2009,
51,
6085,
7737,
222,
222,
1350,
222,
338,
350,
707,
67,
5030,
8538,
396,
707,
67,
462,
458,
331,
7780,
451,
350,
707,
67,
5030,
11747,
5358,
396,
707,
67,
480,
222,
338,
350,
707,
67,
5030,
4227,
11747,
5358,
396,
707,
67,
14099,
51,
5412,
4034,
563,
2035,
1646,
4228,
49,
222,
338,
619,
1998,
451,
477,
462,
41960,
4712,
32530,
391,
341,
222,
338,
350,
707,
67,
5030,
11747,
5358,
396,
707,
67,
327,
290,
350,
707,
67,
5030,
4227,
11747,
5358,
396,
707,
5111,
2586,
51,
1691,
222,
338,
350,
707,
13115,
881,
2116,
366,
7241,
651,
14287,
707,
67,
2489,
458,
758,
49,
477,
1998,
7045,
222,
338,
48028,
8475,
1431,
451,
341,
350,
707,
67,
5030,
11747,
5358,
396,
707,
67,
327,
290,
222,
338,
350,
707,
67,
5030,
4227,
11747,
5358,
396,
707,
5111,
2586,
51,
1691,
350,
707,
13115,
881,
2116,
366,
1805,
14287,
707,
67,
222,
338,
2489,
458,
758,
580,
1118,
1949,
4712,
32530,
4745,
507,
5358,
2077,
51,
222,
338,
222,
338,
496,
2987,
7115,
1985,
222,
588,
222,
942,
462,
11366,
8538,
2041,
16645,
4584,
14387,
2239,
49,
310,
14387,
2365,
320,
465,
453,
14072,
391,
5623,
847,
451,
4137,
708,
1118,
545,
15659,
347,
303,
453,
11366,
8538,
51,
2643,
15116,
4137,
4706,
1118,
545,
15659,
64,
456,
3000,
14338,
303,
453,
847,
6052,
1118,
545,
3906,
64,
456,
11188,
847,
790,
4354,
327,
5754,
1118,
545,
303,
453,
15659,
480,
6052,
1118,
545,
3906,
566,
303,
581,
1175,
924,
910,
47464,
100,
2333,
299,
332,
14338,
884,
303,
581,
1175,
924,
910,
11893,
32758,
100,
2333,
299,
332,
3804,
14338,
884,
303,
581,
1175,
924,
910,
507,
6588,
1363,
100,
2333,
299,
332,
20873,
884,
303,
453,
34956,
451,
341,
5437,
451,
11366,
11747,
5358,
303,
964,
1175,
924,
910,
5277,
1767,
100,
2333,
299,
332,
638,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
13879,
100,
1321,
7418,
299,
332,
4558,
34418,
6786,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
1321,
7418,
299,
332,
34418,
6786,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
5924,
299,
332,
2320,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
90,
299,
332,
6786,
884,
303,
964,
1175,
924,
910,
28555,
299,
332,
6786,
10699,
884,
303,
964,
1175,
924,
910,
28555,
100,
7516,
299,
332,
6786,
10699,
1552,
884,
303,
964,
1175,
924,
910,
28555,
100,
14135,
299,
332,
6786,
10699,
10330,
884,
303,
964,
1175,
924,
910,
28555,
100,
1478,
1973,
28617,
299,
332,
6786,
10699,
28707,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
12565,
299,
332,
2272,
6786,
884,
303,
964,
1175,
924,
910,
26086,
299,
332,
2272,
6786,
10699,
884,
303,
964,
1175,
924,
910,
26086,
100,
7516,
299,
332,
2272,
6786,
10699,
1552,
884,
303,
964,
1175,
924,
910,
26086,
100,
14135,
299,
332,
2272,
6786,
10699,
10330,
884,
303,
964,
1175,
924,
910,
26086,
100,
1478,
1973,
28617,
299,
332,
2272,
6786,
10699,
28707,
884,
303,
453,
7352,
947,
4952,
391,
2989,
2089,
708,
904,
5424,
391,
341,
913,
303,
964,
924,
910,
4137,
64,
303,
964,
924,
648,
2945,
64,
303,
964,
924,
1922,
458,
6258,
64,
303,
964,
924,
1922,
458,
6786,
10699,
64,
303,
964,
924,
12014,
1922,
5424,
299,
878,
64,
303,
964,
14358,
2943,
28770,
299,
556,
14358,
2943,
492,
465,
924,
320,
310,
16645,
51,
769,
5429,
299,
332,
5030,
8538,
280,
868,
7216,
303,
339,
465,
1041,
294,
338,
9308,
331,
556,
350,
707,
67,
5030,
8538,
396,
707,
67,
1319,
51,
294,
338,
294,
338,
496,
772,
1264,
350,
707,
67,
1353,
396,
707,
67,
1319,
391,
1489,
3116,
391,
51,
294,
338,
496,
772,
4908,
350,
707,
67,
3501,
1985,
396,
707,
67,
1319,
708,
30030,
294,
338,
370,
1187,
3116,
2645,
913,
1200,
4228,
51,
294,
338,
294,
588,
303,
581,
11366,
8538,
45,
1353,
1264,
49,
7115,
1985,
4908,
46,
320,
310,
2615,
45,
769,
49,
4908,
312,
603,
4137,
299,
4908,
51,
38824,
337,
5030,
492,
310,
2945,
299,
640,
1024,
2116,
492,
310,
458,
6258,
299,
327,
4543,
51,
10522,
100,
3922,
2971,
51,
3591,
45,
4543,
51,
390,
22991,
5086,
310,
458
] |
[
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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4227,
11747,
5358,
396,
707,
5111,
2586,
51,
1691,
222,
338,
350,
707,
13115,
881,
2116,
366,
7241,
651,
14287,
707,
67,
2489,
458,
758,
49,
477,
1998,
7045,
222,
338,
48028,
8475,
1431,
451,
341,
350,
707,
67,
5030,
11747,
5358,
396,
707,
67,
327,
290,
222,
338,
350,
707,
67,
5030,
4227,
11747,
5358,
396,
707,
5111,
2586,
51,
1691,
350,
707,
13115,
881,
2116,
366,
1805,
14287,
707,
67,
222,
338,
2489,
458,
758,
580,
1118,
1949,
4712,
32530,
4745,
507,
5358,
2077,
51,
222,
338,
222,
338,
496,
2987,
7115,
1985,
222,
588,
222,
942,
462,
11366,
8538,
2041,
16645,
4584,
14387,
2239,
49,
310,
14387,
2365,
320,
465,
453,
14072,
391,
5623,
847,
451,
4137,
708,
1118,
545,
15659,
347,
303,
453,
11366,
8538,
51,
2643,
15116,
4137,
4706,
1118,
545,
15659,
64,
456,
3000,
14338,
303,
453,
847,
6052,
1118,
545,
3906,
64,
456,
11188,
847,
790,
4354,
327,
5754,
1118,
545,
303,
453,
15659,
480,
6052,
1118,
545,
3906,
566,
303,
581,
1175,
924,
910,
47464,
100,
2333,
299,
332,
14338,
884,
303,
581,
1175,
924,
910,
11893,
32758,
100,
2333,
299,
332,
3804,
14338,
884,
303,
581,
1175,
924,
910,
507,
6588,
1363,
100,
2333,
299,
332,
20873,
884,
303,
453,
34956,
451,
341,
5437,
451,
11366,
11747,
5358,
303,
964,
1175,
924,
910,
5277,
1767,
100,
2333,
299,
332,
638,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
13879,
100,
1321,
7418,
299,
332,
4558,
34418,
6786,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
1321,
7418,
299,
332,
34418,
6786,
884,
303,
964,
1175,
924,
910,
5277,
1767,
100,
5924,
299,
332,
2320,
884,
303
] | 7,279,389,657,051,572,000
| true
| false
| false
| false
|
[
11366,
8538,
51,
2643,
15116,
4137,
4706,
1118,
545,
15659,
64,
456,
3000,
14338,
303,
453,
847,
6052,
1118,
545,
3906,
64,
456,
11188,
847,
790,
4354,
327,
5754,
1118,
545,
303,
453,
15659,
480,
6052,
1118,
545,
3906,
566,
303,
581,
1175,
924,
910,
47464,
100,
2333,
299,
332,
14338,
884,
303,
581,
1175,
924,
910,
11893,
32758,
100,
2333,
299,
332,
3804,
14338,
884,
303,
581,
1175,
924,
910,
507,
6588,
1363,
100,
2333,
299,
332,
20873,
884,
303,
453,
34956,
451,
341,
5437,
451,
11366,
11747,
5358,
303,
964,
1175,
924,
910,
5277,
1767,
100,
2333,
299
] | 4,701,283,303,706,038,000
| true
|
class redirects invocations to the
* <code>MemoryMXBean</code> (or <code>MemoryPoolMXBean</code>) interface. If
* <code>-testMode="directly"</code> option is set, this instance directly
* invokes corresponding method of the <code>MemoryMXBean</code> (or
* <code>MemoryPoolMXBean</code>) interface. If <code>-testMode="server"</code>
* option is set it will make invocations via MBeanServer.
*
* @see ArgumentHandler
*/
public class MemoryMonitor extends Monitor implements NotificationListener,
NotificationFilter {
// Constants to define type of memory that will be allocated in
// MemoryMonitor. For heap memory objects will be allocated; for nonheap
// type classes will be loaded; for mixed type -- both (objects will be
// allocated and classes will be loaded).
public final static String HEAP_TYPE = "heap";
public final static String NONHEAP_TYPE = "nonheap";
public final static String MIXED_TYPE = "mixed";
// Names of the attributes of MemoryMXBean
private final static String POOL_TYPE =
|
instance directly
* invokes corresponding method of the <code>MemoryMXBean</code> (or
* <code>MemoryPoolMXBean</code>) interface. If <code>-testMode="server"</code>
* option is set it will make invocations via MBeanServer.
*
* @see ArgumentHandler
*/
public class MemoryMonitor extends Monitor implements NotificationListener,
NotificationFilter {
// Constants to define type of memory that will be allocated in
// MemoryMonitor. For heap memory objects will be allocated; for nonheap
// type classes will be loaded; for mixed type -- both (objects will be
// allocated and classes will be loaded).
public final static String HEAP_TYPE = "heap";
public final static String NONHEAP_TYPE = "nonheap";
public final static String MIXED_TYPE = "mixed";
// Names of the attributes of MemoryMXBean
private final static String POOL_TYPE =
|
it will make invocations via MBeanServer.
*
* @see ArgumentHandler
*/
public class MemoryMonitor extends Monitor implements NotificationListener,
NotificationFilter {
// Constants to define type of memory that will be allocated in
// MemoryMonitor. For heap memory objects will be allocated; for nonheap
// type classes will be loaded; for mixed type -- both (objects will be
// allocated and classes will be loaded).
public final static String HEAP_TYPE = "heap";
public final static String NONHEAP_TYPE = "nonheap";
public final static String MIXED_TYPE = "mixed";
// Names of the attributes of MemoryMXBean
private final static String POOL_TYPE =
|
MemoryMonitor. For heap memory objects will be allocated; for nonheap
// type classes will be loaded; for mixed type -- both (objects will be
// allocated and classes will be loaded).
public final static String HEAP_TYPE = "heap";
public final static String NONHEAP_TYPE = "nonheap";
public final static String MIXED_TYPE = "mixed";
// Names of the attributes of MemoryMXBean
private final static String POOL_TYPE =
|
"Type";
private final static String POOL_RESET_PEAK = "resetPeakUsage";
private final static String POOL_PEAK = "PeakUsage";
private final static String POOL_VALID = "Valid";
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.