query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
listlengths 3
101
| negative_scores
listlengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
TODO Autogenerated method stub | @Override
public void onTaskFail() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onGetSearchResultsTaskComplete(List<User> tutors) {
this.mList = tutors;
this.mMap.getList(tutors);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
String [] conArr = {"아시아_서울","아시아_북경","아시아_타이페이",
"아메리카_뉴욕","아메리카_시카고","유럽_이스탄불",
"유럽_런던","아메리카_상파올로","아프리카_아크라"};
List conti = new ArrayList<>();
List conData = new ArrayList<>();
for (String cc : conArr) {
String [] ccArr = cc.split("_");
ArrayList now;
if(conti.contains(ccArr[0]))
{
now = (ArrayList)(conData.get(conti.indexOf(ccArr[0])));
}else{
now = new ArrayList();
conti.add(ccArr[0]);
conData.add(now);
}
now.add(ccArr[1]);
}
System.out.println(conti);
System.out.println(conData);
SetTvl [] arr = {
new SetTvl("뉴욕", 7, 500),
new SetTvl("이스탄불", 3, 300),
new SetTvl("타이페이", 2, 100),
new SetTvl("서울", 1, 80),
new SetTvl("이스탄불", 3, 260),
new SetTvl("런던", 6, 400),
new SetTvl("상파울로", 6, 600)
};
Set index = new HashSet<>();
for (SetTvl tvl : arr) {
Iterator it = index.iterator();
boolean res = true;
while(it.hasNext())
{
SetTvl com = (SetTvl)it.next();
if(com.name.equals(tvl.name))
{
res = false;
if(com.money>tvl.money)
{
it.remove();
res = true;
}
}
}
if(res)
index.add(tvl);
}
System.out.println(index);
String [] gogo = {"이스탄불","타이페이","상파울로","런던"};
ArrayList goList = new ArrayList<>();
for (Object conDataList : conData) {
ArrayList ar = new ArrayList();
goList.add(ar);
for (Object con: (ArrayList)conDataList) {
String sss = (String)con;
for (String gg : gogo) {
if(sss.equals(gg))
ar.add(sss);
}
}
if(ar.size()==0)
goList.remove(ar);
}
System.out.println(goList);
int ttMoney=0,ttday=0;
for (Object ggList : goList) {
for (Object obj : (ArrayList)ggList) {
Iterator it = index.iterator();
while(it.hasNext())
{
SetTvl com = (SetTvl)it.next();
if(com.name.equals(obj))
{
ttMoney+=com.money;
ttday+=com.day;
}
}
}
ttday++;
}
ttday--;
System.out.println("총경비:"+ttMoney);
System.out.println("총여행일:"+ttday);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
Code to open the main menu | public void actionPerformed(ActionEvent arg0)
{
MainMenu main = new MainMenu();
main.frame.setVisible(true);
setVisible(false);
dispose();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void openMenu() {\r\n\t\tmenu.click();\r\n\t}",
"@Override\n\t\tpublic void openMenu() {\n\t\t}",
"private void mainMenu() {\r\n System.out.println(\"Canteen Management System\");\r\n System.out.println(\"-----------------------\");\r\n System.out.println(\"1. Show Menu\");\r\n System.out.println(\"2. Employee Login\");\r\n System.out.println(\"3. Vendor Login\");\r\n System.out.println(\"4. Exit\");\r\n mainMenuDetails();\r\n }",
"public static void openMainMenu() {\r\n\t\tif(!STATUS.equals(Gamestatus.STOPPED)) return;\r\n\t\tgui.setMenu(new MainMenu(), true);\r\n\t}",
"private void mainMenu() {\n System.out.println(\"Canteen Management System\");\n System.out.println(\"-----------------------\");\n System.out.println(\"1. Show Menu\");\n System.out.println(\"2.AcceptReject\");\n System.out.println(\"3.place orders\");\n System.out.println(\"4.show orders\");\n System.out.println(\"5. Exit\");\n mainMenuDetails();\n }",
"public static void activateMenu() {\n instance.getMenu().show();\n }",
"private void goToMenu() {\n\t\tgame.setScreen(new MainMenuScreen(game));\n\n\t}",
"@FXML protected void MainMenuButtonClicked(ActionEvent event) {\n this.mainMenuCB.launchMainMenu();\r\n }",
"default public void clickMenu() {\n\t\tremoteControlAction(RemoteControlKeyword.MENU);\n\t}",
"private void goToMenu() {\n game.setScreen(new MainMenuScreen(game));\n\n }",
"public void gotoMenu() {\n try {\n MenuClienteController menu = (MenuClienteController) replaceSceneContent(\"MenuCliente.fxml\");\n menu.setApp(this);\n } catch (Exception ex) {\n Logger.getLogger(IndieAirwaysClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void openMenu() {\r\n\t\tJFrame current_frame = this;\r\n\t\tContainer content_pane = getContentPane();\r\n\t\ttop_panel = new PicPanel(\"trials.png\");\r\n\t\tmiddle_panel = new PicPanel(\"trials2.png\");\r\n\t\tlower_panel = new PicPanel(\"trials3.png\");\r\n\t\t//add panels to the content pane\r\n\t\tcontent_pane.add(top_panel);\r\n\t\tcontent_pane.add(middle_panel);\r\n\t\tcontent_pane.add(lower_panel);\r\n\t\t//*******\r\n\t\tJLabel control_keys_label = createLabel(\"controlkeys.png\");\r\n\t\tmiddle_panel.add(control_keys_label);\r\n\t\t//****\r\n\t\tJButton return_button = createButton(\"returntomenu.png\");\r\n\t\treturn_button.addActionListener(new ActionListener(){\r\n\t\t public void actionPerformed(ActionEvent e){\r\n\t\t \tcurrent_frame.dispose();\r\n\t\t \tStartMenuScreen start_menu = new StartMenuScreen();\r\n\t\t }\r\n\t\t});\r\n\t\tlower_panel.add(return_button);\r\n\t}",
"IMenu getMainMenu();",
"public void pressMainMenu() {\n }",
"@Override\r\n\tpublic void menu() {\n\t\tSystem.out.println(\"go to menu\");\r\n\t\t\r\n\t}",
"static void mainMenu ()\r\n \t{\r\n \t\tfinal byte width = 45; //Menu is 45 characters wide.\r\n \t\tString label [] = {\"Welcome to my RedGame 2 compiler\"};\r\n \t\t\r\n \t\tMenu front = new Menu(label, \"Main Menu\", (byte) width);\r\n \t\t\r\n \t\tMenu systemTests = systemTests(); //Gen a test object.\r\n \t\tMenu settings = settings(); //Gen a setting object.\r\n \t\t\r\n \t\tfront.addOption (systemTests);\r\n \t\tfront.addOption (settings);\r\n \t\t\r\n \t\tfront.select();\r\n \t\t//The program should exit after this menu has returned. CLI-specific\r\n \t\t//exit operations should be here:\r\n \t\t\r\n \t\tprint (\"\\nThank you for using my program.\");\r\n \t}",
"public void mainMenu() {\n\t\t// main menu\n\t\tdisplayOptions();\n\t\twhile (true) {\n\t\t\tString choice = ValidInputReader.getValidString(\n\t\t\t\t\t\"Main menu, enter your choice:\",\n\t\t\t\t\t\"^[aAcCrRpPeEqQ?]$\").toUpperCase();\n\t\t\tif (choice.equals(\"A\")) {\n\t\t\t\taddPollingPlace();\n\t\t\t} else if (choice.equals(\"C\")) {\n\t\t\t\tcloseElection();\n\t\t\t} else if (choice.equals(\"R\")) {\n\t\t\t\tresults();\n\t\t\t} else if (choice.equals(\"P\")) {\n\t\t\t\tperPollingPlaceResults();\n\t\t\t} else if (choice.equals(\"E\")) {\n\t\t\t\teliminate();\n\t\t\t} else if (choice.equals(\"?\")) {\n\t\t\t\tdisplayOptions();\n\t\t\t} else if (choice.equals(\"Q\")) {\n\t\t\t\tSystem.out.println(\"Goodbye.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"void clickFmFromMenu();",
"public void menu() {\n\t\tstate.menu();\n\t}",
"public void mainMenu() {\n Game.stage.setScene(mainMenuScene);\n Game.stage.show();\n }",
"public void showMenu() {\n menuController.showMenuPanel();\n }",
"void clickAmFromMenu();",
"public static void launch() {\r\n\t\tint choice = EXIT;\r\n\t\tdo {\r\n\t\t\tchoice = displayMenu();\r\n\t\t\texecuteMenuItem(choice);\r\n\t\t} while (choice != EXIT);\r\n\t}",
"public void menu() {\n m.add(\"Go adventuring!!\", this::goAdventuring );\n m.add(\"Display information about your character\", this::displayCharacter );\n m.add(\"Visit shop\", this::goShopping);\n m.add (\"Exit game...\", this::exitGame);\n }",
"@FXML\n private void switchToMainMenu() throws IOException {\n // TODO = possibly set other menu switchers\n pause();\n mainMenuSwitcher.switchMenu();\n }",
"private void goToMenu() {\n Intent intentProfile = new Intent(PregonesActivosActivity.this, MenuInicial.class);\n PregonesActivosActivity.this.startActivity(intentProfile);\n }",
"public void initMenu(){\n\t}",
"public void menu(){\n super.goToMenuScreen();\n }",
"public void openLoginMenu()\n {\n login.drawMainMenu();\n }",
"public static void main(String[] args){\n\n main_menu();\n\n }",
"private void setMenu() {\n\n if (tree.isEmpty() || !treeGrid.anySelected()) {\n mainMenu.setItems(newMenuItem, new MenuItemSeparator(), settingMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem);\n } else if (treeGrid.getSelectedRecord() == null) {\n mainMenu.setItems(renameMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem);\n } else if (treeGrid.getSelectedRecords().length > 1) {\n ListGridRecord[] selectedNode = treeGrid.getSelectedRecords();\n if (isSameExtension(selectedNode, Extension.FP)) {\n mainMenu.setItems(deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem, exportMenuItem);\n } else if (isSameExtension(selectedNode, Extension.FPS)) {\n mainMenu.setItems(newFPItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else if (isSameExtension(selectedNode, Extension.BPS)) {\n mainMenu.setItems(newBPItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else if (isSameExtension(selectedNode, Extension.SCSS)) {\n mainMenu.setItems(newSCSItem, deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n } else {\n mainMenu.setItems(deleteMenu, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, progMenuItem);\n }\n } else if (tree.isFolder(treeGrid.getSelectedRecord())) {\n mainMenu.setItems(newMenuItem, deleteMenu, renameMenuItem, copyMenuItem, pasteMenuItem, searchMenuItem, correlationDiagramMenuItem, progMenuItem, downloadMenuItem,\n copyPathMenuItem);\n } else {\n FileTreeNode selectedNode = (FileTreeNode) treeGrid.getSelectedRecord();\n VMResource resource = selectedNode.getResource();\n if (resource instanceof VMDirectory) {\n return;\n }\n Extension extension = ((VMFile) resource).getExtension();\n if (extension == null) {\n mainMenu.setItems(openWithMenuItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n } else\n switch (extension) {\n case ARC:\n mainMenu.setItems(newBPSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FM:\n mainMenu.setItems(newFMCItem, newTCItem, newFPSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FMC:\n mainMenu.setItems(deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case TC:\n mainMenu.setItems(newTCItem, newFPSItem, deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem,\n copyPathMenuItem);\n break;\n case FPS:\n mainMenu.setItems(newFPItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case FP:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, exportMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case BPS:\n mainMenu.setItems(newBPItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case BP:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case SCSS:\n mainMenu.setItems(newSCSItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n case SCS:\n mainMenu.setItems(newSPQLItem, deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem,\n correlationDiagramMenuItem, copyPathMenuItem);\n break;\n default:\n mainMenu.setItems(deleteMenu, renameMenuItem, historyMenuItem, copyMenuItem, pasteMenuItem, downloadMenuItem, searchMenuItem, correlationDiagramMenuItem,\n copyPathMenuItem);\n break;\n }\n }\n }",
"public void Open() {\r\n\t click();\r\n\t }",
"private void displayMenu() {\n\t\tint option = MenuView.getMenuOption(\n\t\t\t\"Welcome \" + movieGoer.getName() + \"!\",\n\t\t\t\"View movie showtimes\",\n\t\t\t\"Book a ticket\",\n\t\t\t\"View movie details\",\n\t\t\t\"List top 5 movies\",\n\t\t\t\"View booking history\",\n\t\t\t\"Exit\"\n\t\t);\n\t\t\n\t\tswitch (option) {\n\t\t\tcase 1:\n\t\t\t\tNavigationController.load(new ShowTimeController());\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\tNavigationController.load(new BookingController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\tNavigationController.load(new MovieController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\tNavigationController.load(new TopMoviesController());\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 5:\n\t\t\t\tNavigationController.load(new BookingHistoryController(movieGoer));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 6:\n\t\t\t\tNavigationController.goBack();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private void goToShop() {\n shopMenu.runMenu();\n }",
"private static void showMenu() {\n System.out.println(\"1. Dodaj zadanie\");\n System.out.println(\"2. Wykonaj zadanie.\");\n System.out.println(\"3. Zamknij program\");\n }",
"public void showMainMenu() {\r\n\t\tmenu.setThreadSuspended(false);\r\n\t\tmenu.setVisible(true);\r\n\t\tsetVisible(false);\r\n\t\tsetVisible(true);\r\n\t}",
"protected void showSystemMenu() {\n windowMenu.doClick(0);\n }",
"public void clickOnMenu() {\n\t\tgetAndroidmenubtn().isPresent();\n\t\tgetAndroidmenubtn().click();\n\t\twaitForPageToLoad();\n\t}",
"public void mainMenu() {\n\n System.out.println(\"\\n HOTEL RESERVATION SYSTEM\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.println(\" COMMANDS:\");\n System.out.println(\" - View Tables\\t\\t(1)\");\n System.out.println(\" - Add Records\\t\\t(2)\");\n System.out.println(\" - Update Records\\t(3)\");\n System.out.println(\" - Delete Records\\t(4)\");\n System.out.println(\" - Search Records\\t(5)\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.print(\" > \");\n }",
"public static void openMenuMain(Player p)\n\t{\n\t\tInventory inv = Bukkit.createInventory(null, 9 * 1, \"§cMenu\");\n\n\t\tItemStack warps = new ItemStack(Material.COMPASS);\n\t\tItemMeta warpsmeta = warps.getItemMeta();\n\t\twarpsmeta.setDisplayName(\"§6Warps\");\n\t\twarps.setItemMeta(warpsmeta);\n\n\t\tItemStack aach = new ItemStack(Material.PRISMARINE_CRYSTALS);\n\t\tItemMeta aachmeta = aach.getItemMeta();\n\t\taachmeta.setDisplayName(\"§6Achievements (\" + getAchievementsPercentage(p) + \"%)\");\n\t\taach.setItemMeta(aachmeta);\n\n\t\tItemStack audio = new ItemStack(Material.PRISMARINE_SHARD);\n\t\tItemMeta audiometa = audio.getItemMeta();\n\t\taudiometa.setDisplayName(\"§6Audio\");\n\t\taudio.setItemMeta(audiometa);\n\n\t\tinv.setItem(0, warps);\n\t\tinv.setItem(7, audio);\n\t\tinv.setItem(8, aach);\n\n\t\tp.openInventory(inv);\n\t}",
"private static void displayMainMenu() {\n\t\tSystem.out.println(\"\\t Main Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"au <username> : Registers as a new user \\n\"\n\t\t\t\t+ \"du <username> : De-registers a existing user \\n\"\n\t\t\t\t+ \"li <username> : To login \\n\"\n\t\t\t\t+ \"qu : To exit \\n\"\n\t\t\t\t+\"====================================\\n\");\n\t}",
"public static void menu() {\n\t\tSystem.out.println(\"Menu:\");\n\t\tSystem.out.println(\"1: Create\");\n\t\tSystem.out.println(\"2: Merge\");\n\t\tSystem.out.println(\"3: Collection\");\n\t\tSystem.out.println(\"4: Upgrades\");\n\t\tSystem.out.println(\"5: Sell\");\n\t\tSystem.out.println(\"6: Identify Crystal\");\n\t\tSystem.out.println(\"\");\n\t}",
"@FXML\n private void menu(){\n\n // Runs mid menu\n MidGameMenu.menuMethod();\n\n Main.gang.setMoving(false);\n Main.main.getMenuWindow().showAndWait();\n }",
"public static void openMenu(int menuID){\n\t\tprevScreen = screenNumber;\n\t\tif (menuID != ID_ACTION_MOVE_MENU && menuID != ID_ACTION_ATTACK_MENU && menuID != ID_ACTION_MENU){\n\t\t\tgui.setNormalOrtho();\n\t\t}\n\t\t\n\t\tgui.setMenuButtonSelected(0);\n\t\t\n\t\tif (menuID == ID_SUB_MENU){\n\t\t\tstartGameBoard(player.getCurLevel());\n\t\t\tString[] info = Map.loadMapInfo(player.getCurLevel());\n\t\t\tgui.setMapInfo(info);\n\t\t}\n\t\t\n\t\tif (menuID == ID_INVENTORY_MENU && screenNumber != ID_INVENTORY_ACTION_MENU){\n\t\t\tgui.setItemsToDisplay(player.getBag().getAllItems());\n\t\t\tgui.setMoney(player.getMoney());\n\t\t\tgui.setItemSelected(0);\n\t\t}\n\t\t\n\t\tif (menuID == ID_SHOP_MENU){\n\t\t\tgui.setMoney(player.getMoney());\n\t\t\tshop.loadAllItems(player.getCharacterAverageLevel());\n\t\t\tshopItems = shop.getItemsInShop();\n\t\t\tgui.setItemsToDisplay(shopItems);\n\t\t\tgui.setItemSelected(0);\n\t\t}\n\t\t\n\t\tif (menuID == ID_CHARACTER_MENU){\n\t\t\tgui.setCharactersToDisplay(player.getCharacters());\n\t\t\tSystem.out.println(player.getCharacters().length);\n\t\t\tgui.setItemSelected(0);\n\t\t}\n\t\tscreenNumber = menuID;\n\t\tgui.setScreenID(screenNumber);\n\t}",
"public startingMenu() {\r\n initComponents();\r\n }",
"void Menu();",
"public void menu()\r\n\t{\r\n\t\t//TODO\r\n\t\t//Exits for now\r\n\t\tSystem.exit(0);\r\n\t}",
"@Override\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\n\t\thome = new MenuItem(\"Home Page\");\n\t\thome.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) {\n\t\t\t\tApplication_Navigator.loadVista(Application_Navigator.CREDENTIALS);\n\n\t\t\t}\n\t\t}); \n\n\t\t\n\t\tnewuser = new MenuItem(\"New User\");\n\t\tnewuser.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) {\n\t\t\t\tSystem.out.println(\"Calling New User window\");\n\t\t\t\tApplication_Navigator.loadVista(Application_Navigator.NEWUSER);\n\t\t\t}\n\t\t}); \n\t\t\n\t\t\n\t\texit = new MenuItem(\"Exit Application\");\n\t\texit.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) {\n\t\t\t\tSystem.out.println(\"quitting\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}); \n\n\t\t\n\t\tMain.getItems().add(home);\n\t\n\t\tMain.getItems().add(newuser);\n\n\t\tMain.getItems().add(exit);\n\t\t\n\n\t\t//---------------------------- Actions Menu Drop down --------------------------------\n\n\t\thistory = new MenuItem(\"View History\");\n\t\thistory.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) { \t\n\t\t\t\t// open the default web browser for the HTML page\n\t\t\t\ttry {\n\t\t\t\t\tURL webURL = new URL(\"http://webdevelopmentdev.azurewebsites.net/\");\n\t\t\t\t\tDesktop.getDesktop().browse(webURL.toURI());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (URISyntaxException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}); \n\n\t\tActions.getItems().add(history);\n\n\t\tbrowser = new MenuItem(\"View Browser\");\n\t\tbrowser.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) {\n\t\t\t\tSystem.out.println(\"Inside the browser\");\n\n\t\t\t\tApplication_Navigator.loadVista(Application_Navigator.BROWSER);\n\t\t\t}\n\t\t}); \n\n\t\tActions.getItems().add(browser);\n\t\tbrowser.setDisable(true);\n\t\t\n\t\tissue = new MenuItem(\"Report Issue\");\n\t\tissue.setOnAction(new EventHandler<ActionEvent>() {\n\t\t\tpublic void handle(ActionEvent t) {\n\t\t\t\tApplication_Navigator.loadVista(Application_Navigator.ISSUE);\n\t\t\t}\n\t\t}); \n\n\t\tActions.getItems().add(issue);\n\n\t\tStartConnection();\n\t}",
"public static void main(String[] args) throws IOException {\n\n\n Menu.displayMenu();\n }",
"public int openStartUpMenu()\n {\n int option;\n startMenu.drawMainMenu();\n option = input.getIntInput();\n return option;\n }",
"static void DisplayMainMenu()\n {\n \tSystem.out.println(\"******\");\n \tSystem.out.println(\"Menu\");\n \tSystem.out.println(\"******\");\n \tSystem.out.println(\"Enter Selection\");\n \tSystem.out.println(\"1) Send Message\");\n \tSystem.out.println(\"2) Receive Message\");\n \tSystem.out.println(\"3) Run regression test\");\n }",
"public static void main(String[] args) {\n mainMenu();\n }",
"public static void WriteMainMenu(){\r\n System.out.println(\"\\n=================Welcome to McDonalds=================\");\r\n System.out.println(\"1. Take Order \\n2. Edit McDonalds Menu \\n3. Exit application \");\r\n }",
"public static void mainMenu() \n\t{\n\t\t// display menu\n\t\tSystem.out.print(\"\\nWhat would you like to do?\" +\n\t\t\t\t\"\\n1. Enter a new pizza order (password required)\" +\n\t\t\t\t\"\\n2. Change information of a specific order (password required)\" +\n\t\t\t\t\"\\n3. Display details for all pizzas of a specific size (s/m/l)\" +\n\t\t\t\t\"\\n4. Statistics of today's pizzas\" +\n\t\t\t\t\"\\n5. Quit\" +\n\t\t\t\t\"\\nPlease enter your choice: \");\t\n\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tOpenscreen.open(\"/admin_main/first_main.fxml\");\r\n\t\t\t}",
"public abstract void displayMenu();",
"private void displayMenu()\r\n {\r\n System.out.println();\r\n System.out.println(\"--------- Main Menu -------------\");\r\n System.out.println(\"(1) Search Cars\");\r\n System.out.println(\"(2) Add Car\");\r\n System.out.println(\"(3) Delete Car\");\r\n System.out.println(\"(4) Exit System\");\r\n System.out.println(\"(5) Edit Cars\");\r\n }",
"public static void openOptionMenu() {\r\n\t\tif(!STATUS.equals(Gamestatus.STOPPED)) return;\r\n\t\tgui.setMenu(new OptionMenu(), true);\r\n\t}",
"private void mainMenuDetails() {\r\n try {\r\n System.out.println(\"Enter your choice:\");\r\n int menuOption = option.nextInt();\r\n switch (menuOption) {\r\n case 1:\r\n showFullMenu();\r\n break;\r\n case 2:\r\n empLogin();\r\n break;\r\n case 3:\r\n venLogin();\r\n // sub menu should not be this\r\n break;\r\n case 4:\r\n Runtime.getRuntime().halt(0);\r\n default:\r\n System.out.println(\"Choose either 1,2,3\");\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n System.out.println(\"enter a valid value\");\r\n }\r\n option.nextLine();\r\n mainMenu();\r\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main_web, menu);\n \t\treturn true;\n \t}",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch(id){\n case R.id.dates:\n getdatemenu();\n break;\n case R.id.keys:\n getkeymenu();\n break;\n case R.id.list:\n getlistmenu();\n case android.R.id.home:\n Intent goHome = new Intent(this,MainActivity.class);\n boolean foundHome = navigateUpTo(goHome);\n\n\n }\n\n\n\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t//a partir de aqui comenzar a llamar a los layouts \t\t\n\t\tcurrent_location();\n\t\t\n\t\t\n\t\t\n\t\treturn true;\n\t}",
"public void onMenuOpen() {\n String initialDirectory = getInitialDirectory();\n System.out.println(initialDirectory);\n File file = FileChooserHelper.showOpenDialog(initialDirectory, this);\n\n if (file == null || !file.exists() || !file.isFile()) {\n return;\n }\n\n handleMenuOpen(file.getAbsolutePath());\n }",
"private static void returnMenu() {\n\t\t\r\n\t}",
"public void list_of_menu_items() {\n\t\tdriver.findElement(open_menu_link).click();\n\t}",
"@Override\n\tpublic void goToMainMenu() {\n\t\tfinish();\n\t}",
"void printMainMenu(){\n\t\tSystem.out.println(\"\\n\\nMarketo Music\");\n\t\tSystem.out.println(\"Main Menu\");\n\t\tSystem.out.println(\"1. Create Playlist: create <playlist name>\");\n\t\tSystem.out.println(\"2. Edit Playlist: edit <playlist id>\");\n\t\tSystem.out.println(\"3. Print Song: song <song id>\");\n\t\tSystem.out.println(\"4. Print Playlist: playlist <playlist id>\");\n\t\tSystem.out.println(\"5. Print All Songs or Playlists: print song/playlist\");\n\t\tSystem.out.println(\"6. Search Song: search artist/title <string of words to be searched>\");\n\t\tSystem.out.println(\"7. Sort songs: sort artist/title\");\n\t\tSystem.out.println(\"8. Quit: quit\");\n\t\tSystem.out.print(\"Enter a Command : \");\n\t}",
"public static void main(String[] args) {\n InitStart.Init();\r\n new MainMenuView().displayMenu();\r\n\r\n }",
"public static void startMenu() {\n\t\tSystem.out.println(\"|**********************************|\");\n\t\tSystem.out.println(\"| |\");\n\t\tSystem.out.println(\"| Welcome to the Anny BankingApp! |\");\n\t\tSystem.out.println(\"| |\");\n\t\tSystem.out.println(\"************************************\");\n\n\t\tSystem.out.println(\"Please select your option:\");\n\t\tSystem.out.println(\"\\t[c]reate a new Account\");\n\t\tSystem.out.println(\"\\t[l]ogin to Your Account!\");\n\t\tSystem.out.println(\"\\t[a]dmin Menu\");\n\t\tSystem.out.println(\"\\t[e]mployee Menu\");\n\t\tSystem.out.println(\"\\t[o]Log Out\");\n\n\t\t//create variable to grab the input\n\t\tString option =scan.nextLine();\n\n\n\t\t//this switch case will based on chioce the users made////can be lowercase or uppercase letter\n\n\t\tswitch(option.toLowerCase()) {\n\t\tcase \"c\":\n\t\t\tcreateNewAccount();\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\t\tloginToAccount();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"a\":\n\t\t\tadminMenu();\n\t\t\tbreak;\n\t\tcase \"e\":\n\t\t\temployeeMenu();\n\t\t\tbreak;\n\t\tcase \"o\":\n\t\t\tSystem.out.println(\"You Successfully logged out, back to main menu!!!\");\n\t\t\tstartMenu();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Try again\");\n\t\t\tstartMenu();//Return to startmenu if choice not match\n\t\t\tbreak;\n\t\t}\n\n\t}",
"private void launchMain() {\n\t\tfinal Intent i = new Intent(this, MainActivity.class);\n\t\tstartActivity(i);\n\t}",
"public static void main(String[] args) \n\t{\n\t\tMenu();// calls menu method\n\t}",
"public void showStartMenu() {\n\t\tframe = new JFrame(\"Starting menu\");\n\t\tframe.setPreferredSize(new Dimension(700, 500));\n\t\tframe.pack();\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.add(this);\n\t\tframe.setVisible(true);\n\t\tframe.setLocationRelativeTo(null);\n\t}",
"private static void printMainMenu() {\n\t\tprintln(\"Main Menu:\");\n\t\tprintln(\"\\tI: Import Movie <Title>\");\n\t\tprintln(\"\\tD: Delete Movie <Title>\");\n\t\tprintln(\"\\tS: Sort Movies\");\n\t\tprintln(\"\\tA: Sort Actors\");\n\t\tprintln(\"\\tQ: Quit\");\n\t}",
"public static void main(String[] args) {\n Menu();\n }",
"private MenuBar setupMenu () {\n MenuBar mb = new MenuBar ();\n Menu fileMenu = new Menu (\"File\");\n openXn = makeMenuItem (\"Open Connection\", OPEN_CONNECTION);\n closeXn = makeMenuItem (\"Close Connection\", CLOSE_CONNECTION);\n closeXn.setEnabled (false);\n MenuItem exit = makeMenuItem (\"Exit\", EXIT_APPLICATION);\n fileMenu.add (openXn);\n fileMenu.add (closeXn);\n fileMenu.addSeparator ();\n fileMenu.add (exit);\n\n Menu twMenu = new Menu (\"Tw\");\n getWksp = makeMenuItem (\"Get Workspace\", GET_WORKSPACE);\n getWksp.setEnabled (false);\n twMenu.add (getWksp);\n\n mb.add (fileMenu);\n mb.add (twMenu);\n return mb;\n }",
"private void initMenuBar() {\r\n\t\t// file menu\r\n\t\tJMenu fileMenu = new JMenu(\"File\");\r\n\t\tfileMenu.setMnemonic(KeyEvent.VK_F);\r\n\t\tadd(fileMenu);\r\n\r\n\t\tJMenuItem fileNewMenuItem = new JMenuItem(new NewAction(parent, main));\r\n\t\tfileNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileNewMenuItem);\r\n\t\tJMenuItem fileOpenMenuItem = new JMenuItem(new OpenAction(parent, main));\r\n\t\tfileOpenMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileOpenMenuItem);\r\n\r\n\t\tJMenuItem fileSaveMenuItem = new JMenuItem(new SaveAction(main));\r\n\t\tfileSaveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileSaveMenuItem);\r\n\t\tJMenuItem fileSaveAsMenuItem = new JMenuItem(new SaveAsAction(main));\r\n\t\tfileSaveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileSaveAsMenuItem);\r\n\r\n\t\tfileMenu.addSeparator();\r\n\t\tfileMenu.add(recentMenu);\r\n\t\tfileMenu.addSeparator();\r\n\r\n\t\tJMenuItem exitMenuItem = new JMenuItem(new ExitAction(main));\r\n\t\texitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(exitMenuItem);\r\n\r\n\t\t// tools menu\r\n\t\tJMenu toolsMenu = new JMenu(\"Application\");\r\n\t\ttoolsMenu.setMnemonic(KeyEvent.VK_A);\r\n\t\tadd(toolsMenu);\r\n\r\n\t\tJMenuItem defineCategoryMenuItem = new JMenuItem(\r\n\t\t\t\tnew DefineCategoryAction());\r\n\t\tdefineCategoryMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_C, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(defineCategoryMenuItem);\r\n\t\tJMenuItem defineBehaviorNetworkMenuItem = new JMenuItem(\r\n\t\t\t\tnew DefineBehaviorNetworkAction());\r\n\t\tdefineBehaviorNetworkMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_B, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(defineBehaviorNetworkMenuItem);\r\n\t\tJMenuItem startSimulationMenuItem = new JMenuItem(\r\n\t\t\t\tnew StartSimulationAction(main));\r\n\t\tstartSimulationMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_E, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(startSimulationMenuItem);\r\n\r\n\t\t// help menu\r\n\t\tJMenu helpMenu = new JMenu(\"Help\");\r\n\t\thelpMenu.setMnemonic(KeyEvent.VK_H);\r\n\t\tadd(helpMenu);\r\n\r\n\t\tJMenuItem helpMenuItem = new JMenuItem(new HelpAction(parent));\r\n\t\thelpMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\thelpMenu.add(helpMenuItem);\r\n\r\n\t\t// JCheckBoxMenuItem clock = new JCheckBoxMenuItem(new\r\n\t\t// ScheduleSaveAction(parent));\r\n\t\t// helpMenu.add(clock);\r\n\t\thelpMenu.addSeparator();\r\n\t\tJMenuItem showMemItem = new JMenuItem(new ShowMemAction(parent));\r\n\t\thelpMenu.add(showMemItem);\r\n\r\n\t\tJMenuItem aboutMenuItem = new JMenuItem(new AboutAction(parent));\r\n\t\thelpMenu.add(aboutMenuItem);\r\n\t}",
"public void mainMenu(View view) {\n\t\t\n\t\t// Temporary save if any changes are made, so we can display\n\t\t// to the user later.\n\t\tLockedDocument mlocked = mObjects.getLockedDoc();\n\t\tif (mlocked != null) {\n\t\t\tmlocked.setTitle(text1.getText().toString());\n\t\t\tmlocked.setContents(text2.getText().toString());\n\t\t}\n \tIntent intent = new Intent().setClass(this, CollaboratorAndroidActivity.class);\n \tstartActivity(intent);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_page, menu);\n return true;\n }",
"@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.mnuMain:\n startActivity(new Intent(getApplicationContext(), MainMenuActivity.class));\n return true;\n case R.id.mnuExit:\n finish();\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_window, menu);\n MenuItem m = menu.add(2,4,9,\"Debug Service\");\n m.setCheckable(true);\n m.setChecked(GRClient.getInstance().isDebug());\n\n menu.add(3,9,1, (isSocalConnected) ? \"Sign Out\" : \"Sign In\");\n menu.add(3,8,100,\"Send Feedback\");\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n getMenuInflater().inflate(R.menu.main, menu);\n return true;\n }",
"public static void f_menu(){\n System.out.println(\"_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/\");\n System.out.println(\"_/_/_/_/_/_/softvectorwhith/_/_/_/_/_/_/\");\n System.out.println(\"/_/_/_/version 1.0 2020-oct-29_/_/_/_/_/\");\n System.out.println(\"/_/maked by Andres Felipe Torres Lopez_/\");\n System.out.println(\"_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/\");\n }",
"public static void mainMenu() throws InterruptedException {\n\n // Calling the delay method to slow down the speed of the menu presentation\n delay();\n\n //Displaying the menu options by using the system out method\n System.out.println(\"Menu Main: \\n\");\n System.out.println(\"1 - Create a project\");\n System.out.println(\"2 - View projects\");\n System.out.println(\"3 - Completed projects\");\n System.out.println(\"4 - Customer information\");\n System.out.println(\"5 - Architect information\");\n System.out.println(\"6 - Project Manager Information\");\n System.out.println(\"7 - Structural Engineer Information\");\n System.out.println(\"8 - Past Due projects\\n\");\n System.out.println(\"0 - Exit\\n\");\n }",
"public static void main(String[] args) {\n Graphics.graphicsMainMenu();\r\n //Print main menu\r\n Menu.mainMenu();\r\n }",
"@Override\n\tpublic void showmenu() {\n\t\t\n\t\tint choice;\n \n System.out.println(\"请选择1.查询 2.退出\");\n choice=console.nextInt();\n \n switch (choice){\n \n case 1:\n Menu.searchMenu();\n break;\n default:\n \tSystem.out.println(\"感谢您使用本系统 欢迎下次使用!\");\n System.exit(0);\n }\n \n \n\t}",
"@Override\n\tpublic void setUpMenu() {\n\t\t\n\t}",
"public Menu createToolsMenu();",
"public void menu()\n {\n CMenu cMenu = new CMenu();\n window.dispose();\n }",
"@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n \r\n \tint id = item.getItemId();\r\n switch (id) {\r\n case R.id.action_settings:\r\n \topenSettings();\r\n return true;\r\n case R.id.action_about:\r\n \topenAbout();\r\n \treturn true;\r\n case R.id.action_exit:\r\n \tExit();\r\n \treturn true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }",
"public void init() {\n\t\tMenu menu = new Menu();\n\t\tmenu.register();\n\n\t\t// Application.getInstance().getGUILog().showMessage(\"Show a popup the proper\n\t\t// way !\");\n\n\t\t// final ActionsConfiguratorsManager manager =\n\t\t// ActionsConfiguratorsManager.getInstance();\n\n\t\t// final MDAction action = new ExampleAction();\n\t\t// Adding action to main menu\n\t\t// manager.addMainMenuConfigurator(new MainMenuConfigurator(action));\n\t\t// Adding action to main toolbar\n\t\t// manager.addMainToolbarConfigurator(new MainToolbarConfigurator(action));\n\n\t\t// pluginDir = getDescriptor().getPluginDirectory().getPath();\n\n\t\t// Creating submenu in the MagicDraw main menu\n\t\t// ActionsConfiguratorsManager manager =\n\t\t// ActionsConfiguratorsManager.getInstance();\n\t\t// manager.addMainMenuConfigurator(new\n\t\t// MainMenuConfigurator(getSubmenuActions()));\n\n\t\t/**\n\t\t * @Todo: load project options (@see myplugin.generator.options.ProjectOptions)\n\t\t * from ProjectOptions.xml and take ejb generator options\n\t\t */\n\n\t\t// for test purpose only:\n\t\t// GeneratorOptions ejbOptions = new GeneratorOptions(\"c:/temp\", \"ejbclass\",\n\t\t// \"templates\", \"{0}.java\", true, \"ejb\");\n\t\t// ProjectOptions.getProjectOptions().getGeneratorOptions().put(\"EJBGenerator\",\n\t\t// ejbOptions);\n\n\t\t// ejbOptions.setTemplateDir(pluginDir + File.separator +\n\t\t// ejbOptions.getTemplateDir()); //apsolutna putanja\n\t}",
"@FXML\n void openMenuWindow() {\n window.setTitle(\"Timelines: Menu\");\n window.setScene(menuScene);\n window.show();\n window.requestFocus();\n\n messageLabel.setVisible(true);\n }",
"public void initMenu() {\n\t\t\r\n\t\treturnToGame = new JButton(\"Return to Game\");\r\n\t\treturnToGame.setBounds(900, 900, 0, 0);\r\n\t\treturnToGame.setBackground(Color.BLACK);\r\n\t\treturnToGame.setForeground(Color.WHITE);\r\n\t\treturnToGame.setVisible(false);\r\n\t\treturnToGame.addActionListener(this);\r\n\t\t\r\n\t\treturnToStart = new JButton(\"Main Menu\");\r\n\t\treturnToStart.setBounds(900, 900, 0, 0);\r\n\t\treturnToStart.setBackground(Color.BLACK);\r\n\t\treturnToStart.setForeground(Color.WHITE);\r\n\t\treturnToStart.setVisible(false);\r\n\t\treturnToStart.addActionListener(this);\r\n\t\t\r\n\t\t//add(menubackground);\r\n\t\tadd(returnToGame);\r\n\t\tadd(returnToStart);\r\n\t}",
"public void main_menu()\n\t{\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.println(\"Please Select an option\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.print(\"1.Add 2.Update 3.Delete 4.Exit\\n\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tchoice=me.nextInt();\n\t\tthis.check_choice(choice);\n\t}",
"public static void f_menu() {\n System.out.println(\"----------------------------------------\");\n System.out.println(\"--------------DIGITALSOFT---------------\");\n System.out.println(\"-----version:1.0------28/04/2020.-------\");\n System.out.println(\"-----Angel Manuel Correa Rivera---------\");\n System.out.println(\"----------------------------------------\");\n }",
"public void onMenuNew() {\n handleMenuOpen(null);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.landing_main, menu);\n return true;\n }",
"public void aboutInit(MenuItem menuItem){\n Intent aboutUsIntent = new Intent(MainActivity.this, about.class);\n startActivity(aboutUsIntent);\n }",
"void onMenuItemClicked();",
"private void displayMenu() {\n\t\tSystem.out.println(\"********Loan Approval System***********\");\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\n\t\t\t\t\"Choose the following options:\\n(l)Load Applicaitons\\n(s)Set the Budget\\n(m)Make a decision\\n(p)Print\\n(u)Update the application\");\n\n\t}",
"public void setMenu() {\n\t \n\t\ttop = new JPanel(new FlowLayout(FlowLayout.LEFT));\n\t add(top, BorderLayout.CENTER);\n\t \n\t lPro = new JLabel(\"Projects: \");\n\t top.add(lPro);\n\t \n\t cPro = new JComboBox();\n\t getProject();\n\t\ttop.add(cPro);\n\t\t\n\t\tview = new JButton(\"View Sample\");\n\t\ttop.add(view);\n\t\t\n\t\tbottom = new JPanel(new FlowLayout(FlowLayout.CENTER));\n\t\tadd(bottom, BorderLayout.SOUTH);\n\t\t\n\t\tcancel = new JButton(\"Cancel\");\n\t\tbottom.add(cancel);\n\t\t\n\t\tdownload = new JButton(\"Download\");\n\t\tbottom.add(download);\n\t\t\n\t\tsetActionListener();\t\n\t}",
"private void initMenu()\n {\n bar = new JMenuBar();\n fileMenu = new JMenu(\"File\");\n crawlerMenu = new JMenu(\"Crawler\"); \n aboutMenu = new JMenu(\"About\");\n \n bar.add(fileMenu);\n bar.add(crawlerMenu);\n bar.add(aboutMenu);\n \n exit = new JMenuItem(\"Exit\");\n preferences = new JMenuItem(\"Preferences\");\n author = new JMenuItem(\"Author\");\n startCrawlerItem = new JMenuItem(\"Start\");\n stopCrawlerItem = new JMenuItem(\"Stop\");\n newIndexItem = new JMenuItem(\"New index\");\n openIndexItem = new JMenuItem(\"Open index\");\n \n stopCrawlerItem.setEnabled(false);\n \n fileMenu.add(newIndexItem);\n fileMenu.add(openIndexItem);\n fileMenu.add(exit);\n aboutMenu.add(author);\n crawlerMenu.add(startCrawlerItem);\n crawlerMenu.add(stopCrawlerItem);\n crawlerMenu.add(preferences);\n \n author.addActionListener(this);\n preferences.addActionListener(this);\n exit.addActionListener(this);\n startCrawlerItem.addActionListener(this);\n stopCrawlerItem.addActionListener(this);\n newIndexItem.addActionListener(this);\n openIndexItem.addActionListener(this);\n \n frame.setJMenuBar(bar);\n }"
]
| [
"0.82457787",
"0.8107773",
"0.78354716",
"0.7723811",
"0.76942116",
"0.7498663",
"0.73903656",
"0.7335353",
"0.7246232",
"0.7203071",
"0.71943647",
"0.71941257",
"0.7191522",
"0.71879625",
"0.7185557",
"0.71697325",
"0.7138299",
"0.7136769",
"0.7131131",
"0.70869464",
"0.70667046",
"0.7041619",
"0.70271915",
"0.7000655",
"0.7000046",
"0.6923965",
"0.6915718",
"0.69086915",
"0.688276",
"0.68769944",
"0.6856179",
"0.6846825",
"0.6824426",
"0.68013847",
"0.67982906",
"0.67871535",
"0.67634374",
"0.67579126",
"0.67333615",
"0.67256016",
"0.67208636",
"0.66921216",
"0.6686403",
"0.66832775",
"0.6681092",
"0.66805017",
"0.66776735",
"0.66634995",
"0.665694",
"0.66512245",
"0.66503",
"0.66299707",
"0.6618845",
"0.66187525",
"0.66108495",
"0.6599455",
"0.6595051",
"0.6581648",
"0.6576574",
"0.6566557",
"0.6556534",
"0.65546817",
"0.655231",
"0.6533306",
"0.65284795",
"0.6527583",
"0.6525526",
"0.65231466",
"0.65040535",
"0.6500731",
"0.64883935",
"0.64806",
"0.64711076",
"0.6470201",
"0.64678013",
"0.64640844",
"0.6460459",
"0.64574677",
"0.64554965",
"0.64537126",
"0.6448832",
"0.64481735",
"0.6445866",
"0.6445696",
"0.6444461",
"0.64433026",
"0.6442539",
"0.6442501",
"0.64416265",
"0.6438544",
"0.6435995",
"0.6435868",
"0.6435768",
"0.6432302",
"0.6426539",
"0.64253926",
"0.6424561",
"0.64192176",
"0.64168483",
"0.6412828",
"0.6408837"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
Semaphore sem = new Semaphore(1);
new Thread(new IncThread(sem,"A")).start();;
new Thread(new DecThread(sem,"B")).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
use the defined one above | @Override
public String getJmxBeanName() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void use()\n\t{\n\t}",
"public abstract String use();",
"void use();",
"private stendhal() {\n\t}",
"public void reuse() {}",
"protected void onFirstUse() {}",
"protected Doodler() {\n\t}",
"public contrustor(){\r\n\t}",
"private SingleTon() {\n\t}",
"protected FanisamBato(){\n\t}",
"Reuse getReuse();",
"@Override\n\tpublic void anular() {\n\n\t}",
"private TMCourse() {\n\t}",
"protected abstract void switchOnCustom();",
"default void beforeUse() {\n\t}",
"private Infer() {\n\n }",
"private MetallicityUtils() {\n\t\t\n\t}",
"Petunia() {\r\n\t\t}",
"@Override // see item.java\n\tpublic void useItem() {\n\n\t}",
"private MApi() {}",
"protected void init() {\n // to override and use this method\n }",
"private Aliyun() {\n\t\tsuper();\n\t}",
"public void use(Context context)\n {\n useImplementation.use(context);\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private Rekenhulp()\n\t{\n\t}",
"private UsineJoueur() {}",
"Reproducible newInstance();",
"private void init() {\n\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void intializeSpecific() {\n\r\n\t}",
"@Override\n\tint use() {\n\t\treturn (int)(primaryStat*1.2);\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private Util() { }",
"@Override\n protected void init() {\n }",
"private Utils() {\n\t}",
"private Utils() {\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"public void use(Player player) {\n\n\t}",
"java.lang.String getHowToUse();",
"java.lang.String getHowToUse();",
"@Override\n public void perish() {\n \n }",
"public void themesa()\n {\n \n \n \n \n }",
"@Override\n protected void initialize() {\n\n \n }",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"private Utils() {}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"private FlyWithWings(){\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void init() {}",
"public void init() {\r\n\t\t// to override\r\n\t}",
"private static class <init> extends l\n{\n\n public int noteOp(Context context, String s, int i, String s1)\n {\n return AppOpsManagerCompat23.noteOp(context, s, i, s1);\n }",
"private XhtmlUtils()\n\t{\n\t}",
"Shared shared();",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"private StickFactory() {\n\t}",
"@Override\n void init() {\n }",
"protected Alias() {\n }",
"private Globals() {\n\n\t}",
"Traditional createTraditional();",
"public static void thisDemo() {\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"private LOCFacade() {\r\n\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void smell() {\n\t\t\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"private static void oneUserExample()\t{\n\t}",
"@Override\n\t\tpublic void init() {\n\t\t}",
"protected LibReference() {\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tpublic void apply() {\n\t\t\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"private Platform() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"private test5() {\r\n\t\r\n\t}",
"@Override\n public void init() {}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void init() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"protected void _init(){}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}"
]
| [
"0.6684896",
"0.64218044",
"0.6397143",
"0.6056177",
"0.6052283",
"0.5663442",
"0.56346786",
"0.55168134",
"0.5500472",
"0.53968364",
"0.53968203",
"0.5392529",
"0.53870314",
"0.53778195",
"0.5361843",
"0.5349944",
"0.53486633",
"0.533972",
"0.53325415",
"0.5331153",
"0.5329827",
"0.53069067",
"0.53048384",
"0.52821004",
"0.5277147",
"0.5270895",
"0.5269315",
"0.52677697",
"0.5241242",
"0.522625",
"0.5213049",
"0.52122104",
"0.52032673",
"0.5195992",
"0.5192751",
"0.5192751",
"0.518996",
"0.5176782",
"0.51761675",
"0.51761675",
"0.5175255",
"0.51670974",
"0.5164012",
"0.5162276",
"0.5162276",
"0.5162276",
"0.5162276",
"0.515844",
"0.515844",
"0.515844",
"0.515844",
"0.515844",
"0.515844",
"0.51556927",
"0.5146604",
"0.51452947",
"0.51436627",
"0.51315063",
"0.5131377",
"0.5123683",
"0.51077473",
"0.510766",
"0.51051617",
"0.5104978",
"0.5101221",
"0.50973326",
"0.5096042",
"0.50953144",
"0.5095108",
"0.5091746",
"0.5091746",
"0.5091746",
"0.50873953",
"0.50873953",
"0.50783795",
"0.50699425",
"0.5063455",
"0.5063136",
"0.50621766",
"0.50567883",
"0.50552076",
"0.5051535",
"0.50451064",
"0.5041646",
"0.5041646",
"0.5036762",
"0.50352526",
"0.5035135",
"0.50327784",
"0.50273013",
"0.50246",
"0.502363",
"0.50208163",
"0.5020127",
"0.501941",
"0.5013361",
"0.50086164",
"0.50086164",
"0.50086164",
"0.50086164",
"0.50086164"
]
| 0.0 | -1 |
Set the domainname toplevel folder for the metrics. Default is "com.j256". | public void setJmxDomainName(String jmxDomainName) {
this.jmxDomainName = jmxDomainName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setSystabIOFolderName(String name){\n this.folderName = name + \"\\\\\"; // Append the \\\\ to get inside the folder\n }",
"void setSystabRegFolderName(String name){\n this.folderName = name + \"\\\\\"; // Append the \\\\ to get inside the folder\n }",
"public void setPublicUserDirectoryName(final String value) {\n setProperty(PUBLIC_USER_DIRECTORY_NAME_KEY, value);\n }",
"public void setDomain(String value) {\n\t\tapp.setSetting(\"domain\", value);\n\t}",
"public void updateLabtainersPath(){\n labsPath = new File(labtainerPath + File.separator + \"labs\");\n labChooser.setCurrentDirectory(labsPath); \n }",
"public void setDomainNameValue(YangString domainNameValue)\n throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"domain-name\",\n domainNameValue,\n childrenNames());\n }",
"public void setDomain(String domain) {\r\n this.domain = domain;\r\n }",
"public void setRootDir(String rootDir);",
"public void changeDomain(String newDomain);",
"public String getDomainNm() {\n return this.domainNm;\n }",
"public void setDomain(String domain) {\n setProperty(DOMAIN, domain);\n }",
"public void setUserPrincipalRoot(String val) {\n userPrincipalRoot = val;\n }",
"public Builder setDirName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n dirName_ = value;\n onChanged();\n return this;\n }",
"public void setHarvestedDataDir(String val) {\n\n\t\tthis.harvestedDataDir = val;\n\n\t}",
"private String getJmxDomain() {\n return \"metrics.session.\" + configuration.getNamespace();\n }",
"public void setDomainNm(String domainNm) {\n this.domainNm = domainNm;\n }",
"@Override\n\tpublic String getDirName() {\n\t\treturn StringUtils.substringBeforeLast(getLocation(), \"/\");\n\t}",
"void setAppRootDirectory(String rootDir);",
"protected void setDomain(String domain) {\n this.domain = domain;\n }",
"private void setLastDir( String name, File last ) {\r\n\t\tif ( last.isDirectory() ) {\r\n\t\t\tprefs.put( PREFS_KEY+name, last.getAbsolutePath() );\r\n\t\t} else {\r\n\t\t\tprefs.put( PREFS_KEY+name, last.getParentFile().getAbsolutePath());\r\n\t\t}\r\n\t}",
"public void setFolderName(String folderName) {\n mArgs.putString(ARG_NAME, folderName);\n }",
"public void addDomainName() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"domain-name\",\n null,\n childrenNames());\n }",
"public void setBaseURL(final String url) {\r\n String location = url;\r\n //-- remove filename if necessary:\r\n if (location != null) { \r\n int idx = location.lastIndexOf('/');\r\n if (idx < 0) idx = location.lastIndexOf('\\\\');\r\n if (idx >= 0) {\r\n int extIdx = location.indexOf('.', idx);\r\n if (extIdx > 0) {\r\n location = location.substring(0, idx);\r\n }\r\n }\r\n }\r\n \r\n try {\r\n _resolver.setBaseURL(new URL(location));\r\n } catch (MalformedURLException except) {\r\n // try to parse the url as an absolute path\r\n try {\r\n LOG.info(Messages.format(\"mapping.wrongURL\", location));\r\n _resolver.setBaseURL(new URL(\"file\", null, location));\r\n } catch (MalformedURLException except2) { }\r\n }\r\n }",
"public JwkProviderBuilder forDomain(String domain) {\n this.url = normalizeDomain(domain);\n return this;\n }",
"private void renameOriginalDomainConfig() {\n File domXml = getDASDomainXML();\n movedDomXml = new File(domXml.getParentFile(), \"domain.xml.moved\");\n report(\"moved-domain\", domXml.renameTo(movedDomXml));\n }",
"@Override\n \tprotected void setApplicationName(String applicationName)\n \t{\n \t\tsuper.setApplicationName(applicationName);\n \n \t\tPropertiesAndDirectories.setApplicationName(applicationName);\n \t}",
"public void setBaseURL(String val) {\n\n\t\tbaseURL = val;\n\n\t}",
"public static void setRootDir() {\n for(int i = 0; i < rootDir.length; i++){\n Character temp = (char) (65 + i);\n Search.rootDir[i] = temp.toString() + \":\\\\\\\\\";\n }\n }",
"public void customRootDir() {\n //Be careful with case when res is false which means dir is not valid.\n boolean res = KOOM.getInstance().setRootDir(this.getCacheDir().getAbsolutePath());\n }",
"protected void setBaseNameFromName(String name) {\n int lastDot = name.lastIndexOf(\".\");\n this.baseName = (lastDot == -1) ? name : name.substring(0, lastDot);\n }",
"public Builder setBaseDirectoryName(String val) {\n mBaseDirectoryName = val;\n return this;\n }",
"public void setFullDomainNameValue(YangString fullDomainNameValue)\n throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"full-domain-name\",\n fullDomainNameValue,\n childrenNames());\n }",
"public void setDomainNameValue(String domainNameValue) throws JNCException {\n setDomainNameValue(new YangString(domainNameValue));\n }",
"public void setHostPrincipalRoot(String val) {\n hostPrincipalRoot = val;\n }",
"public URL getRootDirURL() {\n\t\treturn null;\n\t}",
"public String getDomainLabel() {\n return domainLabel;\n }",
"protected String getDomain() {\n return \"\";\n }",
"public void setRootName(String aRootName) {\n\t\tthis.rootName = aRootName;\n\n\t\tint colonPos = this.rootName.indexOf(':');\n\n\t\tif (colonPos != -1) {\n\t\t\tthis.prefix = this.rootName.substring(0, colonPos);\n\t\t}\n\t\telse {\n\t\t\tthis.prefix = null;\n\t\t}\n\t}",
"public void setDomainName(java.lang.String domainName) {\r\n this.domainName = domainName;\r\n }",
"static String getDefaultConfigurationFileName() {\n // This is a file calles 'jmx-scandir.xml' located\n // in the user directory.\n final String user = System.getProperty(\"user.home\");\n final String defconf = user+File.separator+\"jmx-scandir.xml\";\n return defconf;\n }",
"IParser setServerBaseUrl(String theUrl);",
"public static String getOutputFolderName() {\n\t\treturn PropertiesFile.getSystemRoot()+PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t}",
"public void setShHarvestedDataDir(String val) {\n\n\t\tthis.shHarvestedDataDir = val;\n\n\t}",
"public String getLocalRepositoryRootFolder() {\n\t\tString userFolder = IdatrixPropertyUtil.getProperty(\"idatrix.local.reposity.root\",getRepositoryRootFolder() );\n\t\tint index = userFolder.indexOf(\"://\");\n\t\tif(index > -1 ) {\n\t\t\tuserFolder = userFolder.substring(index+3);\n\t\t}\n\t\treturn userFolder;\n\t}",
"public void setDomain(Domain domain) {\n this.domain = domain;\n }",
"public void setDomain(Domain domain) {\n this.domain = domain;\n }",
"public static String getTestSetFolderURL() {\n\n\t\treturn baseURL + login_required_string + \"/rest/domains/\" + domain + \"/projects/\" + project + \"/test-set-folders\";\n\t}",
"public String getDomain() {\r\n return domain;\r\n }",
"public String getMetricsDbNameWithMetadataUrlPrefix() {\n StringBuilder sb = new StringBuilder(config.getMetadataUrlPrefix());\n sb.append(\"_\");\n sb.append(config.getOptional(\"kylin.metrics.influx-db\", \"KYLIN_METRICS\"));\n return sb.toString();\n }",
"String getDomain();",
"String getRootServerBaseUrl();",
"String getPackageName() {\n final int lastSlash = name.lastIndexOf('/');\n final String parentPath = name.substring(0, lastSlash);\n return parentPath.replace('/', '.');\n }",
"public String getPublicUserDirectoryName() {\n return getStringProperty(PUBLIC_USER_DIRECTORY_NAME_KEY);\n }",
"public static void refreshDomain()\n\t{\n\t API_APP_INFO = \"https://\"+DOMAIN+\"/api/a/iGET/app/oinfo?app_key=\";\n\t API_LOG_DEVICE_INFO = \"https://\"+DOMAIN+\"/api/a/POST/mobile/LogInstall?type=0\";\n\t API_GCM_REGISTER = \"https://\"+DOMAIN+\"/api/a/POST/Push/RegisterDevice\";\n\t API_EXCHANGE_TOKEN = \"https://\"+DOMAIN+\"/api/a/GET/me/exchangetoken?\";\n\t}",
"private String nameFolder() {\n\t\tString stringUrl = url.toString();\n\t\tint position1 = stringUrl.indexOf(\"://www.\"); \t\t\t\t // position of first \":\"\n\t\tint position2; \t\t\t\t\t\t \t\t\t\t\t // position before the country's suffix\n\n\t\ttry {\n\t\t\t// case link is something \"http://listofrandomwords.com/\"\n\t\t\tif (position1 == -1) {\n\t\t\t\tposition1 = stringUrl.indexOf(\"://\"); \t\t\t\t\t // position of \":\"\n\t\t\t\tposition2 = stringUrl.indexOf(\".\", 6);\t\t\t\t\t\t// position of first \".\"\n\t\t\t\treturn stringUrl.substring(position1 + 3, position2); \t// position + 3 = first letter of domain\n\t\t\t} else {\n\t\t\t\tposition2 = stringUrl.indexOf(\".\", 12);\t\t\t\t\t\t// position of second \".\"\n\t\t\t\treturn stringUrl.substring(position1 + 7, position2);\t\t// position + 7 = first letter of domain\n\t\t\t}\n\t\t} catch (StringIndexOutOfBoundsException e) {\n\t\t\tRandom ran = new Random();\n\t\t\treturn RANDOM_WORDS[ran.nextInt(RANDOM_WORDS.length - 1)];\n\t\t}\n\t}",
"@Override\n public String domain() {\n return null;\n }",
"public void setSupregname( java.lang.String newValue ) {\n __setCache(\"supregname\", newValue);\n }",
"public void setResourcename(java.lang.String newResourcename) {\n\tresourcename = newResourcename;\n}",
"@Override\n public void setUrl(String url) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Directory manager \" + directoryManager);\n }\n try {\n super.setUrl(directoryManager.replacePath(url));\n } catch (Exception e) {\n LOGGER.error(\"Exception thrown when setting URL \", e);\n throw new IllegalStateException(e);\n }\n }",
"java.lang.String getDirName();",
"public void setConfigName (String folder, String configName) {\n this.configName = folder + \"/\" + configName + \".yml\";\n }",
"@Override\n\tpublic void setParrentFolder(String parrentFolder) {\n\t\t\n\t}",
"public void setDistDbName(String dbName) {\n\t\tthis.setMsgItem(\"dist_db_name\", dbName);\n\t\tdistDbName = dbName;\n\t}",
"public void setDomainName(java.lang.String domainName) {\n this.domainName = domainName;\n }",
"public void setPathname(String s) {this.pathname = s;}",
"protected void setName(String name) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"a7eb4750-e93f-41a2-ab4f-3fcf8cb1f39b\");\n if (name != null && getPlatform() == PLATFORM_FAT && !name.contains(\"/\")) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6d8baf11-928b-4d13-a982-c28e6d5c3bb7\");\n name = name.replace('\\\\', '/');\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"e80bbe2d-caf4-4e25-b64c-8fef2f2969dd\");\n this.name = name;\n }",
"void setHostname(String hostname);",
"public void setServiceGroupName(java.lang.String param){\n localServiceGroupNameTracker = true;\n \n this.localServiceGroupName=param;\n \n\n }",
"protected String getRootName() {\r\n\t\treturn ROOT_NAME;\r\n\t}",
"public String getDomainName(){\n return this.domainName;\n }",
"public String getDomain() {\n return domain;\n }",
"public String getDomain() {\n return domain;\n }",
"public String getFolderName() {\n return folderName;\n }",
"@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}",
"@Override\r\n\t\tpublic void setDir(String dir)\r\n\t\t\t{\n\t\t\t\t\r\n\t\t\t}",
"public void setPrincipalRoot(String val) {\n principalRoot = val;\n }",
"private String setFolderPath(int selection) {\n\t\tString directory = \"\";\n\t\tswitch (selection) {\n\t\tcase 1:\n\t\t\tdirectory = \"\\\\art\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdirectory = \"\\\\mikons_1\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdirectory = \"\\\\mikons_2\";\n\t\t\tbreak;\n\t\t}\n\t\treturn directory;\n\t}",
"@Override\n\tpublic final native String getDomain() /*-{\n return this.domain;\n\t}-*/;",
"private void updateDisplayName() {\n String path;\n FileObject webRoot = ProjectWebRootQuery.getWebRoot(styleSheet);\n if(webRoot == null) {\n path = styleSheet.getNameExt();\n } else {\n path = FileUtil.getRelativePath(webRoot, styleSheet);\n }\n setDisplayName(path);\n }",
"public void setGroupPrincipalRoot(String val) {\n groupPrincipalRoot = val;\n }",
"public String getDomain() {\n\t\treturn domain;\n\t}",
"public void setJNDIName(String newValue);",
"public static void setBaseURL() {\n\n\t\tRestAssured.baseURI = DataReader.dataReader(\"baseURL\");\n\t}",
"public void setFileName(String filename)\n\t{\n\t\tsuper.setFileName(filename);\n\t\t\n\t\t//#CM702602\n\t\t// Generate the path name of Working data File. \n\t\tworkingDataFileName = wFileName.replaceAll(\"\\\\\\\\send\\\\\\\\\", \"\\\\\\\\recv\\\\\\\\\");\n\t}",
"public static void set_RootDir(String v) throws RuntimeException\n {\n UmlCom.send_cmd(CmdFamily.javaSettingsCmd, JavaSettingsCmd._setJavaRootdirCmd, v);\n UmlCom.check();\n \n _root = v;\n }",
"public void setName(String name) {\n Preconditions.checkArgument(!Strings.isNullOrEmpty(name));\n if (!(this instanceof ConfigValueNode))\n if (name.indexOf('.') >= 0 || name.indexOf('/') >= 0) {\n throw new RuntimeException(\n \"Invalid name string. Name cannot contain (.) or (/)\");\n }\n this.name = name;\n }",
"public Path getRepositoryGroupBaseDir();",
"public MBeanDomainData(String domainName) {\n this.domainName = domainName;\n }",
"protected DiscoveryVOSConfig() {\n\t\tsuper(BRANCH_ROOT + \".DiscoveryVOS.com.discoveryVOS.\".replace('.', File.separatorChar));\n\t}",
"public String getDomain() {\n return getProperty(DOMAIN);\n }",
"public void addFullDomainName() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"full-domain-name\",\n null,\n childrenNames());\n }",
"public void setNameGroup(int num)\n\t{\n\t\tsetGroup(_Prefix + HardZone.NAME.toString(), num);\n\t}",
"@JsonProperty(\"domain\")\n public void setDomain(String domain) {\n this.domain = domain;\n }",
"public static void setLastDir(String lastDir) {\n setProperty(\"lastdir\", lastDir);\n }",
"protected void setRootPath(String root) {\n this.root = new File(root);\n this.appsDir = new File(this.root, APPS_ROOT);\n this.m2Dir = new File(M2_ROOT);\n }",
"public void setVenuePrincipalRoot(String val) {\n venuePrincipalRoot = val;\n }",
"public String normalizeDomainName( final String name );",
"public void setDomain(String domain) {\n this.domain = domain == null ? null : domain.trim();\n }",
"private void createJavaWebStartPath() {\n String[] onlyFolderNames = new String[] {\n mInstance.getJavaWebStartPath(),\n mModuleName\n };\n\n mJavaWebStartPath = StringUtils.makeFilePath (onlyFolderNames, false);\n }",
"public void setNameSpace(String namespace) {\n this.namespace = namespace;\n }"
]
| [
"0.59381825",
"0.5747886",
"0.54091454",
"0.52417415",
"0.51485777",
"0.5129982",
"0.5103",
"0.50870365",
"0.5073741",
"0.5072245",
"0.50082314",
"0.498287",
"0.49588928",
"0.4948668",
"0.49472407",
"0.49280474",
"0.49262777",
"0.49082264",
"0.48982134",
"0.48945656",
"0.4874713",
"0.48722973",
"0.48531348",
"0.4843634",
"0.48402742",
"0.48269194",
"0.48230276",
"0.48040178",
"0.47869328",
"0.47819552",
"0.47653246",
"0.4755161",
"0.47510922",
"0.47406954",
"0.4729635",
"0.47277656",
"0.47203344",
"0.47180346",
"0.47140002",
"0.47135964",
"0.47047558",
"0.4695508",
"0.4692708",
"0.46917695",
"0.46861514",
"0.46861514",
"0.46832514",
"0.46668586",
"0.46597373",
"0.46507815",
"0.46456465",
"0.46422306",
"0.4641877",
"0.46418154",
"0.46393812",
"0.46368504",
"0.46352512",
"0.46213827",
"0.4621196",
"0.4619945",
"0.46141142",
"0.4612369",
"0.45930186",
"0.4583488",
"0.45769984",
"0.45673096",
"0.45656195",
"0.4563572",
"0.45563918",
"0.4552472",
"0.45504615",
"0.45504615",
"0.454846",
"0.4546478",
"0.4546365",
"0.45359734",
"0.45355788",
"0.4521099",
"0.45113477",
"0.45057112",
"0.450217",
"0.44987378",
"0.4484658",
"0.44842777",
"0.4476131",
"0.44756818",
"0.4475314",
"0.44587332",
"0.44554597",
"0.4454685",
"0.4453225",
"0.44384766",
"0.44322586",
"0.4430511",
"0.44304866",
"0.4430175",
"0.4428129",
"0.44257167",
"0.44197986",
"0.4413494"
]
| 0.44305286 | 93 |
Overrides the default init method. Ensures that the Properties instance variable is set to the intended properties file. | public void init() {
this.properties = loadProperties("/project3.properties");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void init(String propFilePath) {\n properties = new Properties();\n try {\n properties.load(new FileInputStream(new File(propFilePath)));\n } catch (FileNotFoundException e1) {\n logger.error(\"External properties file not found!\", e1);\n System.exit(1);\n } catch (IOException e2) {\n logger.error(\"Error while reading External properties file!\", e2);\n System.exit(1);\n }\n }",
"private void initProperties()\r\n {\r\n try\r\n {\r\n properties.load(new FileInputStream(propertiesURL));\r\n }\r\n catch (IOException ex)\r\n {\r\n log.log(DEBUG,\"\"+ex);\r\n } \r\n }",
"public void init(Properties properties) throws IOException;",
"private void init() {\n\t\tif ( PropertiesConfigurationFilename == null ) {\n\t\t\tlogger.info(\"config.properties is default\");\n\t\t\tconfigProp = createDefaultProperties();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tlogger.info(\"config.properties is \"+ PropertiesConfigurationFilename.getAbsolutePath());\n\t\t\t\tconfigProp = new PropertiesConfiguration();\n\t\t\t\tconfigProp.load(PropertiesConfigurationFilename);\n\t\t\t} catch (ConfigurationException e) {\n\t\t\t\tlogger.error(\"Unable to open config file: \" + PropertiesConfigurationFilename.getAbsolutePath(), e);\n\t\t\t\tlogger.info(\"config.properties is default\");\n\t\t\t\tconfigProp = createDefaultProperties();\n\t\t\t}\n\t\t}\n\n\n\t\t// Load the locale information\n\t\tString locale = configProp.getString(\"locale\");\n\n\t\tconfigProp.setProperty(\"zmMsg\", ResourceBundle.getBundle(\"ZmMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zhMsg\", ResourceBundle.getBundle(\"ZhMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"ajxMsg\", ResourceBundle.getBundle(\"AjxMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"i18Msg\", ResourceBundle.getBundle(\"I18nMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zsMsg\", ResourceBundle.getBundle(\"ZsMsg\", new Locale(locale)));\n\n\t}",
"public void init(java.util.Properties props) {\r\n }",
"public DetectionProperties() throws Exception {\n super(DetectionProperties.class.getResourceAsStream(PROPERTIES_FILE_NAME));\n }",
"public void init()\n {\n try\n {\n userPasswordsProperties = new Properties();\n userPasswordsProperties.load(new FileInputStream(userPasswordsPropertiesFileName));\n log.info(\"Successfully initialized. UsersPasswords property file is: \" + userPasswordsPropertiesFileName);\n }\n catch (Exception e)\n {\n throw new IllegalArgumentException(\"UserNamesPropertyFile name: \" + userPasswordsPropertiesFileName + \" not valid. Error: \" + e);\n }\n \n }",
"public void init(Properties props) ;",
"public static void init() throws Exception\r\n\t{\r\n\t\tinit(PROPERTY_FILE, \"Properties\", new String[0]);\r\n\t}",
"public TestBase() {\n try {\n properties = new Properties();\n FileInputStream fileInputStream = new FileInputStream(\"F:/LearningStuff/PracticalWork\" +\n \"/Frameworks/DataDrivenFrameworkSelenium/src/main/resources/config/config.properties\");\n properties.load(fileInputStream);\n } catch (FileNotFoundException f) {\n f.printStackTrace();\n } catch (IOException i) {\n i.printStackTrace();\n }\n }",
"private void initializeProperties(String propertiesFilename) throws IOException {\n this.properties = new Properties();\n\n // Set defaults for 'standard' operation.\n // properties.setProperty(FILENAME_KEY, clientHome + \"/bmo-data.tsv\");\n properties.setProperty(BMO_URI_KEY,\n \"http://www.buildingmanageronline.com/members/mbdev_export.php/download.txt\");\n\n FileInputStream stream = null;\n try {\n stream = new FileInputStream(propertiesFilename);\n properties.load(stream);\n System.out.println(\"Loading data input client properties from: \" + propertiesFilename);\n }\n catch (IOException e) {\n System.out.println(propertiesFilename\n + \" not found. Using default data input client properties.\");\n throw e;\n }\n finally {\n if (stream != null) {\n stream.close();\n }\n }\n trimProperties(properties);\n }",
"public void init(){\n\t\tif(prop==null){\r\n\t\t\tprop=new Properties();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileInputStream fs = new FileInputStream(System.getProperty(\"user.dir\")+\"//src//test//resources//projectconfig.properties\");\r\n\t\t\t\tprop.load(fs);\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static synchronized void initialize(String prop) {\n\t\tFileInputStream is=null;\n\t\tproperties = new Properties();\n\t\ttry {\n\t\t\tis = new FileInputStream(prop);\n\t\t\tif (is == null) {\n\t\t\t System.out.println(\"The prop is null.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tproperties.load(is);\n\t\t} \n\t\tcatch (IOException e) {\n\t\t System.out.println(\"properties loading fails.\");\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\tfinally{\n\t\t\t\ttry{\n\t\t\t\t\tif(is!=null)\n\t\t\t\t\t\tis.close();\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex){\n\t\t\t\t System.out.println(\"properties loading fails for runtime exception.\");\n\t\t\t\t\tthrow new RuntimeException(ex);\n\t\t\t}\n\t\t}\n\t}",
"public\n YutilProperties()\n {\n super(new Properties());\n }",
"public PropertiesUtil() {\n\t\t// Read properties file.\n\n\t\tproperties = new Properties();\n\t\ttry {\n\t\t\tproperties.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(\"variables.properties\"));\n\t\t\tlog.info(\"variables.properties file loaded successfully\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"variables.properties file not found: \", e);\n\t\t}\n\t}",
"private PropertiesLoader() {\r\n\t\t// not instantiable\r\n\t}",
"public TestProperties() {\n\t\tthis.testProperties = new Properties();\n\t}",
"public ServerProperties() {\n try {\n initializeProperties();\n }\n catch (Exception e) {\n System.out.println(\"Error initializing server properties.\");\n }\n }",
"public TestBase()\r\n\t{\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFile file = new File(\"src\\\\test\\\\resources\\\\intellicus.properties\");\r\n\t\t\tFileInputStream fis = new FileInputStream(file);\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"@PostConstruct\n\tpublic void init() {\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(new ClassPathResource(\"/META-INF/build-info.properties\"));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Unable to load build.properties\", e);\n\t\t\tprops = new Properties();\n\t\t}\n\t}",
"public static void init(String propfile) throws Exception\r\n\t{\r\n\t\tinit(propfile, \"Properties\", new String[0]);\r\n\t}",
"public Properties() {\n\n\t\tconfig = new java.util.Properties();\n\n\t\ttry {\n\t\t\tInputStream input = new FileInputStream(new File(\n\t\t\t\t\t\"ConfigurationFile.txt\"));\n\t\t\tconfig.load(input);\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public PSBeanProperties()\n {\n loadProperties();\n }",
"void loadPropertiesFile()\n\t{\n\t\tlogger.info(\"Fetching the properties files\");\n\t\t\n\t\tconfigProp=new Properties(); \n\t\ttry{\tconfigProp.load(loadFile(\"Config.properties\"));\t\t} \n\t\tcatch (IOException e){\tAssert.assertTrue(\"Cannot initialise the Config properties file, Check if the file is corrupted\", false);\t}\t\t\t\n\t}",
"@Override\n public void init(Properties properties) {\n super.init(properties);\n String categoriesFilePath = properties.getProperty(\"categoriesFilePath\", \"\");\n String gemetFilePath = properties.getProperty(\"gemetFilePath\", \"\");\n String lang = properties.getProperty(\"lang\", \"\");\n\n for (Locale l: Locale.getAvailableLocales()) {\n if (l.getLanguage().equalsIgnoreCase(lang)) {\n locale = l;\n break;\n }\n }\n\n ContextInitializer initializer = new ContextInitializer(ontCtx,\n categoriesFilePath, gemetFilePath);\n initializer.initialize();\n\n }",
"public PropertiesDocument() {\n\t\tthis.documentBuilderFactory = DocumentBuilderFactory.newInstance();\n try {\n\t\t\tthis.documentBuilder = documentBuilderFactory.newDocumentBuilder();\n\t\t} catch (ParserConfigurationException e) {\n\t\t\t// Exception with default configuration\n\t\t\te.printStackTrace();\n\t\t}\n this.properties = new Properties();\n\t}",
"public PropertyManager() {\n propFileName = System.getProperty(\"user.home\") + File.separator +\n defPropFile;\n\n recentResult = loadPropertyFile(propFileName);\n }",
"public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public final Properties init() throws FileNotFoundException, IOException{\n /*\n Your properties file must be in the deployed .war file in WEB-INF/classes/tokens. It is there automatically\n if you have it in Source Packages/java/tokens when you build. That is how this will read it in without defining a root location\n https://stackoverflow.com/questions/2395737/java-relative-path-of-a-file-in-a-java-web-application\n */\n String fileLoc =TinyTokenManager.class.getResource(Constant.PROPERTIES_FILE_NAME).toString();\n fileLoc = fileLoc.replace(\"file:\", \"\");\n setFileLocation(fileLoc);\n InputStream input = new FileInputStream(propFileLocation);\n props.load(input);\n input.close();\n currentAccessToken = props.getProperty(\"access_token\");\n currentRefreshToken = props.getProperty(\"refresh_token\");\n currentS3AccessID = props.getProperty(\"s3_access_id\");\n currentS3Secret = props.getProperty(\"s3_secret\");\n currentS3BucketName = props.getProperty(\"s3_bucket_name\");\n currentS3Region = Region.US_WEST_2;\n apiSetting = props.getProperty(\"open_api_cors\");\n return props;\n }",
"public void init() {\n\t\tProperties prop = new Properties();\n\t\tInputStream propStream = this.getClass().getClassLoader().getResourceAsStream(\"db.properties\");\n\n\t\ttry {\n\t\t\tprop.load(propStream);\n\t\t\tthis.host = prop.getProperty(\"host\");\n\t\t\tthis.port = prop.getProperty(\"port\");\n\t\t\tthis.dbname = prop.getProperty(\"dbname\");\n\t\t\tthis.schema = prop.getProperty(\"schema\");\n\t\t\tthis.passwd=prop.getProperty(\"passwd\");\n\t\t\tthis.user=prop.getProperty(\"user\");\n\t\t} catch (IOException e) {\n\t\t\tString message = \"ERROR: db.properties file could not be found\";\n\t\t\tSystem.err.println(message);\n\t\t\tthrow new RuntimeException(message, e);\n\t\t}\n\t}",
"private static void loadPropertiesFile() {\n checkNotNull(propertyFileName, \"propertyFileName cannot be null\");\n String currentDir = new File(\"\").getAbsolutePath();\n propertyFile = currentDir + \"/\" + propertyFileName;\n File propFile = new File(propertyFile);\n try {\n propFile.createNewFile();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n\n props = new Properties();\n try {\n FileInputStream fis = new FileInputStream(propertyFile);\n props.load(fis);\n fis.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }",
"public static void initialize()\n\t{\n\t\t/* Start to listen for file changes */\n\t\ttry\n\t\t{\n\t\t\t// We have to load the internal one initially to figure out where the external data directory is...\n\t\t\tURL resource = PropertyWatcher.class.getClassLoader().getResource(PROPERTIES_FILE);\n\t\t\tif (resource != null)\n\t\t\t{\n\t\t\t\tconfig = new File(resource.toURI());\n\t\t\t\tloadProperties(false);\n\n\t\t\t\t// Then check if there's another version in the external data directory\n\t\t\t\tString path = get(ServerProperty.CONFIG_PATH);\n\t\t\t\tif (!StringUtils.isEmpty(path))\n\t\t\t\t{\n\t\t\t\t\tFile potential = new File(path);\n\t\t\t\t\tif (potential.exists() && potential.isFile())\n\t\t\t\t\t{\n\t\t\t\t\t\t// Use it\n\t\t\t\t\t\tLogger.getLogger(\"\").log(Level.INFO, \"Using external config.properties: \" + potential.getAbsolutePath());\n\t\t\t\t\t\tconfig = potential;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Finally, load it properly. This is either the original file or the external file.\n\t\t\t\tloadProperties(true);\n\n\t\t\t\t// Then watch whichever file exists for changes\n\t\t\t\tFileAlterationObserver observer = new FileAlterationObserver(config.getParentFile());\n\t\t\t\tmonitor = new FileAlterationMonitor(1000L);\n\t\t\t\tobserver.addListener(new FileAlterationListenerAdaptor()\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFileChange(File file)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (file.equals(config))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tloadProperties(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tmonitor.addObserver(observer);\n\t\t\t\tmonitor.start();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}",
"public BaseTest() {\n\n String path = System.getProperty(\"user.dir\") + \"/src/test/resources/config.properties\";\n prop = new Properties();\n /** Stream to read the spreadsheet. */\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(path);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n try {\n prop.load(fis);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }",
"private void initializeProperties () throws Exception {\n String userHome = System.getProperty(\"user.home\");\n String userDir = System.getProperty(\"user.dir\");\n String hackyHome = userHome + \"/.hackystat\";\n String sensorBaseHome = hackyHome + \"/sensorbase\"; \n String propFile = userHome + \"/.hackystat/sensorbase/sensorbase.properties\";\n this.properties = new Properties();\n // Set defaults\n properties.setProperty(ADMIN_EMAIL_KEY, \"[email protected]\");\n properties.setProperty(ADMIN_PASSWORD_KEY, \"[email protected]\");\n properties.setProperty(CONTEXT_ROOT_KEY, \"sensorbase\");\n properties.setProperty(DB_DIR_KEY, sensorBaseHome + \"/db\");\n properties.setProperty(DB_IMPL_KEY, \"org.hackystat.sensorbase.db.derby.DerbyImplementation\");\n properties.setProperty(HOSTNAME_KEY, \"localhost\");\n properties.setProperty(LOGGING_LEVEL_KEY, \"INFO\");\n properties.setProperty(SMTP_HOST_KEY, \"mail.hawaii.edu\");\n properties.setProperty(PORT_KEY, \"9876\");\n properties.setProperty(XML_DIR_KEY, userDir + \"/xml\");\n properties.setProperty(TEST_INSTALL_KEY, \"false\");\n properties.setProperty(TEST_DOMAIN_KEY, \"hackystat.org\");\n FileInputStream stream = null;\n try {\n stream = new FileInputStream(propFile);\n properties.load(stream);\n System.out.println(\"Loading SensorBase properties from: \" + propFile);\n }\n catch (IOException e) {\n System.out.println(propFile + \" not found. Using default sensorbase properties.\");\n }\n finally {\n if (stream != null) {\n stream.close();\n }\n }\n // Now add to System properties. Since the Mailer class expects to find this stuff on the \n // System Properties, we will add everything to it. In general, however, clients should not\n // use the System Properties to get at these values, since that precludes running several\n // SensorBases in a single JVM. And just is generally bogus. \n Properties systemProperties = System.getProperties();\n systemProperties.putAll(properties);\n System.setProperties(systemProperties);\n }",
"public FileServicePropertiesProperties() {\n }",
"public Properties initProperties() {\r\n\t\tprop = new Properties();\r\n\t\ttry {\r\n\t\t\tFileInputStream fis = new FileInputStream(\"./src/main/java/com/automation/qe/config/config.properties\");\r\n\t\t\tprop.load(fis);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn prop;\r\n\t}",
"public LoadTestProperties() {\n }",
"@PostConstruct\n\tpublic void loadProperties() {\n\t\tproperties.put(PropertyKey.TRANSLATION_FILE_STORE, \"C:\\\\development\\\\projects\\\\mega-translator\\\\store\");\n\t}",
"public BaseTest() {\n\t\t\n\t\tprop= new Properties();\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fle= new FileInputStream(\"C:\\\\Users\\\\19175\\\\eclipse-workspace\\\\com.toyota\\\\src\\\\test\\\\java\\\\Config\\\\config.properties\"); // Path of the Properties file\n\t\t\tprop.load(fle);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }",
"@SuppressWarnings(\"unchecked\")\n private void loadProperties()\n {\n File f = getPropertiesFile();\n if (!f.exists())\n return;\n \n m_props = (Map<String, Object>) PSConfigUtils.loadObjectFromFile(f);\n }",
"public BaseClass() {\n\t\t \n\t try {\n\t\t\t \n\t\t\t prop=new Properties();\n\t\t\t \n\t\t\tString path=System.getProperty(\"user.dir\");\n\t\t\t \n\t\t\t // FileInputStream is the pre-defined class\n\t\t\tFileInputStream ip=new FileInputStream(path+\"\\\\src\\\\main\\\\java\\\\com\\\\demoQA\\\\config\\\\Config.Properties\");\n\t\t\t prop.load(ip);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t\t \n\t }",
"public CMProps(final Properties p, final String filename) {\n super(p);\n final char c = Thread.currentThread().getThreadGroup().getName().charAt(0);\n if (props[c] == null)\n props[c] = this;\n\n try {\n this.load(new ByteArrayInputStream(new CMFile(filename, null).raw()));\n loaded = true;\n } catch (final IOException e) {\n loaded = false;\n }\n }",
"public PropertyManager(String propFileName) {\n if ((propFileName != null) && (propFileName.length() > 0)) {\n this.propFileName = propFileName;\n recentResult = loadPropertyFile(propFileName);\n }\n }",
"private AuditYamlConfigurationLoader(Properties properties)\n {\n this.properties = new Properties(properties);\n }",
"public Properties(){\n\n }",
"public PropertyParser(Properties props)\n\t{\n\t\t_props = props;\n\t}",
"public void init(Properties properties) throws ExtensionException {\n\t}",
"public\n YutilProperties(InputStream in)\n {\n super(new Properties());\n setPropertiesDefaults(in);\n }",
"private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }",
"public DataInputClientProperties(String propertiesFilename) throws IOException {\n if (propertiesFilename == null) {\n initializeProperties();\n }\n else {\n initializeProperties(propertiesFilename);\n }\n }",
"private PropertyUtil(){\n\t\ttry{\n\t\t\tloadURL();\n\t\t\tRuntime.getRuntime().addShutdownHook(new UtilShutdownHook());\n\t\t}catch(IOException ioe){\n\t\t\tLOGGER.error(\"Unable to load Property File\\n\"+ioe);\n\t\t}\n\t\tLOGGER.debug(\"INSTANTIATED\");\n\t}",
"public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }",
"public PropertiesWriter() {\r\n }",
"protected void initialise() {\r\n loadDefaultConfig();\r\n loadCustomConfig();\r\n loadSystemConfig();\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(\"--- Scope properties ---\");\r\n for (Iterator i = properties.keySet().iterator(); i.hasNext(); ) {\r\n String key = (String) i.next();\r\n Object value = properties.get(key);\r\n LOG.debug(key + \" = \" + value);\r\n }\r\n LOG.debug(\"------------------------\");\r\n }\r\n }",
"public Properties initForRuntime() {\n initProperties();\n return this;\n }",
"private static synchronized void setProperties(\n final String strPropertiesFilename) {\n if (msbPropertiesLoaded) {\n Verbose.warning(\"Properties already loaded; ignoring request\");\n\n return;\n }\n\n File oFile = new File(strPropertiesFilename);\n\n if (!oFile.exists()) {\n // Try to get it from jar file\n ClassLoader classLoader = Thread.currentThread()\n .getContextClassLoader();\n final InputStream input;\n\n if (classLoader == null) {\n classLoader = Class.class.getClassLoader();\n }\n input = classLoader\n .getResourceAsStream('/' + strPropertiesFilename);\n PropertyDef.setProperties(input, null);\n } else {\n PropertyDef.setProperties(new File(strPropertiesFilename), null,\n false);\n }\n if (strPropertiesFilename == DEFAULT_PROPERTIES_FILENAME) {\n oFile = new File(CUSTOMER_PROPERTIES_FILENAME);\n if (oFile.exists() && oFile.isFile()) {\n PropertyDef.addProperties(oFile);\n }\n }\n AdaptiveReplicationTool.msbPropertiesLoaded = true;\n }",
"@Override\n public void initialize(Map<String, String> propertyValues) {\n // Set the configurable properties\n properties.setValues(propertyValues);\n }",
"public PropertyReader(String propertyFileName)\r\n\t{\r\n\t\tthis.propertyFileName = propertyFileName;\r\n\t}",
"public void setupProperties() {\n // left empty for subclass to override\n }",
"@Override\n public Properties loadProperties(String filename) {\n return testProperties;\n }",
"public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}",
"public static void loadPropertyFile() {\r\n\t\t\r\n\t\tif (loaded) {\r\n\t\t\tthrow new IllegalStateException(\"Properties have already been loaded!\"); \r\n\t\t}\r\n\t\tloaded = true; \r\n\t\t\r\n\t\t// if property file was specified, use it instead of standard property\r\n\t\t// file\r\n\r\n\t\tString file = STANDARD_PROPERTY_FILE;\r\n\r\n\t\tif (System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE) != null\r\n\t\t\t\t&& System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE)\r\n\t\t\t\t\t\t.length() != 0) {\r\n\t\t\tfile = System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE);\r\n\t\t}\r\n\r\n\t\t// load property file\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tprops.load(ClassLoader.getSystemResourceAsStream(file));\r\n\t\t\tSystem.setProperties(props);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t}\r\n\r\n\t}",
"public PropertyParser()\n\t{\n\t\tthis(System.getProperties());\n\t}",
"private PropertiesHelper() {\n throw new AssertionError(\"Cannot instantiate this class\");\n }",
"private ConfigProperties() {\n\n }",
"private void loadProperties() {\n\t\tInputStream propsFile;\n\t\tProperties tempProp = new Properties();\n\n\t\ttry {\n\t\t\t//propsFile = new FileInputStream(\"plugins\\\\balloonplugin\\\\BalloonSegmentation.properties\");\n\t\t\tpropsFile = getClass().getResourceAsStream(\"/BalloonSegmentation.properties\");\n\t\t\ttempProp.load(propsFile);\n\t\t\tpropsFile.close();\n\n\t\t\t// load properties\n\t\t\tinit_channel = Integer.parseInt(tempProp.getProperty(\"init_channel\"));\t\t\t\t// initial channel selected for segmenting the cell architecture 1 - red, 2 - green, 3 - blue\n\t\t\tinit_max_pixel = Integer.parseInt(tempProp.getProperty(\"init_max_pixel\"));\t\t\t// initial max pixel intensity used for finding the doundaries of the colony of cells\n\t\t\tinit_HL = Integer.parseInt(tempProp.getProperty(\"init_HL\"));\t\t\t\t\t\t// initial H*L factor used finding seeds in the population\n\t\t\tinit_min_I = Integer.parseInt(tempProp.getProperty(\"init_min_I\"));\t\t\t\t\t// initial pixel intensity when balloon algorithm starts\n\t\t\tinit_max_I = Integer.parseInt(tempProp.getProperty(\"init_max_I\"));\t\t\t\t\t// final pixel intensity when balloon algorithm stops\n\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tIJ.error(\"I/O Exception: cannot read .properties file\");\n\t\t}\n\t}",
"public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}",
"private void initializeProperties() throws IOException {\n String userHome = org.wattdepot.util.logger.WattDepotUserHome.getHomeString();\n String wattDepotHome = userHome + \"/.wattdepot\";\n String clientHome = wattDepotHome + \"/client\";\n String propFile = clientHome + \"/datainput.properties\";\n initializeProperties(propFile);\n }",
"public Properties() \r\n\t{\r\n\t\tsuper();\r\n\t\tthis.port = 1234;\r\n\t\tthis.ip = \"127.0.0.1\";\r\n\t}",
"public Properties init() {\n // init nested properties starting from the bottom ones\n initProperties();\n initLayout();\n return this;\n }",
"public Properties init_prop() {\n\t\tprop = new Properties();\n\t\tString path = null;\n\t\tString env = null;\n\n\t\ttry {\n\n\t\t\tenv = System.getProperty(\"env\");\n\t\t\tSystem.out.println(\"Running on Envirnment: \" + env);\n\n\t\t\tif (env == null) {\n\t\t\t\tSystem.out.println(\"Default Envirnment: \" + \"PROD\");\n\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\n\t\t\t} else {\n\t\t\t\tswitch (env) {\n\t\t\t\tcase \"qa\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.qa.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dev\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.dev.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"stage\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.stage.properties\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"prod\":\n\t\t\t\t\tpath = \"D:\\\\Rupali\\\\Workspace\\\\HubSpotFramework\\\\src\\\\main\\\\java\\\\com\\\\qa\\\\hubspot\\\\config\\\\Config.prod.properties\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Please Pass the Correct Env Value...\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFileInputStream finput = new FileInputStream(path);\n\t\t\tprop.load(finput);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn prop;\n\t}",
"public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }",
"public MutablePropertiesPropertySource(File propertiesLocation) {\n this(propertiesLocation, 0);\n }",
"public Config(Properties props) {\n entries = (Properties)props.clone();\n }",
"public void init(Properties props) {\n\t\tString url = props.getProperty(EWARP_CONFIG_URL);\n\t\tif (url != null) {\n\t\t\tInputStream in = null;\n\t\t\ttry {\n\t\t\t\t// TODO consider other loading options, e.g. through WebHelper using ServletContext\n\t\t\t\tin = loadResource(url);\n\t\t\t\tProperties externalProps = new Properties();\n\t\t\t\texternalProps.load(in);\n\t\t\t}\n\t\t\tcatch (Throwable t) {\n\t\t\t\tlog.warn(\"failed to load external runtime configuration from \" + url + \": \" + t.getMessage());\n\t\t\t\t// TODO check another property, whether to bail out, \n\t\t\t\t// if external configuration can not be found\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tif (in != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tin.close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Throwable t) {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcreateLifecycleInterceptor(props);\n\n\t\t// give interceptor a change to modify properties\n\t\truntimeProps = interceptor.configure(props);\n\t\t\n\t\t// log configuration\n\t\tif (log.isDebugEnabled()) {\n\t\t\tList<String> params = new ArrayList<String>();\n\t\t\tfor (Object key : runtimeProps.keySet()) {\n\t\t\t\tparams.add(key.toString());\n\t\t\t}\n\t\t\tif (params.size() > 0) {\n\t\t\t\tCollections.sort(params);\n\t\t\t\tlog.debug(\"=============== configuration ==============\");\n\t\t\t\tfor (String name : params) {\n\t\t\t\t\tString value = runtimeProps.getProperty(name);\n\t\t\t\t\tlog.debug(name + \"=\" + value);\n\t\t\t\t}\n\t\t\t\tlog.debug(\"============================================\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// init from properties\n\t\tList<String> args = new ArrayList<String>();\n\t\tconfigureErjang(runtimeProps, args);\n\t\truntimeArgs = (String[]) args.toArray(new String[args.size()]);\n\t}",
"public void initialize(final InputStream stream) throws IOException\n {\n // load up the properties\n final Properties props = new Properties();\n props.load(stream);\n initialize(props);\n }",
"@SneakyThrows\n public ApplicationProperties(final String propertiesFilePath) {\n this.properties = new Properties();\n this.properties.load(new FileInputStream(propertiesFilePath));\n }",
"public static void loadProperties() {\r\n\t\tif (!isLoaded) {\r\n\t\t\tnew BCProperties() ;\r\n\t\t\tisLoaded = true ;\r\n\t\t}\r\n\t}",
"@Test\n public void testCreateFromProperties_Properties() throws Exception {\n System.out.println(\"createFromProperties\");\n Properties props = new Properties();\n props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(propertiesName));\n EngineConfiguration result = EngineConfiguration.createFromProperties(props);\n assertProperties(result);\n }",
"@Override\r\n\tpublic void setPropFile(Properties prop) {\n\t\t\r\n\t}",
"public Config(File confDir, Properties props) throws IOException {\n FileInputStream input = new FileInputStream(new File(confDir, PROPERTIES_FILE));\n Properties p = new Properties();\n p.load(input);\n entries = new Properties(p); // Set the file values as defaults for our properties\n // Now copy in our passed in properties\n for (String key : props.stringPropertyNames()) entries.setProperty(key, props.getProperty(key));\n input.close();\n }",
"@BeforeSuite\n\tpublic void propertiesFileReader(){\n\t\tif(prop == null){\t\t\t\n\t\t\tprop = new Properties();\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * if(strEnvironment.equalsIgnoreCase(\"qa\")){ prop.load(new\n\t\t\t\t * FileInputStream(qaProperty)); }else\n\t\t\t\t * if(strEnvironment.equalsIgnoreCase(\"stage\")){ prop.load(new\n\t\t\t\t * FileInputStream(stagProperty)); }else\n\t\t\t\t * if(strEnvironment.equalsIgnoreCase(\"prod\")){ prop.load(new\n\t\t\t\t * FileInputStream(prodProperty)); }\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\tif(strEnvironment.equalsIgnoreCase(\"qa\")) \n\t\t\t\t\tFileUtils.copyFile(new File(qaProperty), new File(defaultProperty));\n\t\t\t\tif(strEnvironment.equalsIgnoreCase(\"stage\"))\n\t\t\t\t\tFileUtils.copyFile(new File(stagProperty), new File(defaultProperty));\n\t\t\t\tif(strEnvironment.equalsIgnoreCase(\"prod\"))\n\t\t\t\t\tFileUtils.copyFile(new File(prodProperty), new File(defaultProperty));\n\t\t\t\t\n\t\t\t\tprop.load(new FileInputStream(defaultProperty));\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"user + pass [\"+prop.getProperty(\"username\")+\"===\"+prop.getProperty(\"password\"));\n\t\t\t\t\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public GlobalSetup(){\n\t\t\n\t\tpropertyData = new Properties();\n\t\t\n\t\ttry{\n\t\t\tInputStream propertyPath = new FileInputStream(\"src/test/resources/properties/categoriesData.properties\");\n\t\t\tpropertyData.load(propertyPath);\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}",
"private PropertiesUtils() {}",
"protected BaseTestObject()\n {\n\n fProp = new Properties(); // empty properties object\n fLog = TestLogger.getInstance(); // default level is DEBUG\n\n }",
"private void loadPropertyFile(InputStream stream) throws IOException{\n\t\tproperties = new Properties();\n\t\tproperties.load(stream);\n\t}",
"private mxPropertiesManager()\n\t{\n\t}",
"public static void basefn() throws IOException {\r\n\t\t//Below line creates an object of Properties called 'prop'\r\n\t\tprop = new Properties(); \r\n\t\t\r\n\t\t//Below line creates an object of FileInputStream called 'fi'. Give the path of the properties file which you have created\r\n\t\tFileInputStream fi = new FileInputStream(\"D:\\\\Java\\\\workspace\\\\Buffalocart\\\\src\\\\test\\\\resources\\\\config.properties\");\r\n\t\t\r\n\t\t//Below line of code will load the property file\r\n\t\tprop.load(fi);\t\t\t\t\r\n\t}",
"void load() {\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(propertyFile);\n\t\t\tfinal Properties newProperties = new Properties();\n\t\t\tnewProperties.load(fis);\n\t\t\ttimeLastRead = propertyFile.lastModified();\n\t\t\tproperties = newProperties;\n\t\t\tfis.close();\n\t\t} catch (final Exception e) {\n\t\t\tlogger.info(\"Property file \" + propertyFile + \" \" + e.getMessage());\n\t\t}\n\t}",
"public ConfigsUtils() {\r\n mConfig = new Properties();\r\n try {\r\n mConfig.load(new FileInputStream(CONFIG_FILE_PATH));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public GMailProperties(final String filepath, final String charsetName) throws FileNotFoundException, IOException {\r\n this.properties = new PropertyStorage(filepath, charsetName);\r\n }",
"@Override\n\tpublic void afterPropertiesSet() throws Exception {\n\t\tinit();\n\t}",
"public static synchronized void initProjectProperties() {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties\");\n try {\n String projectPropertiesFilename = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_PROPERTIES_DIRECTORY\n + File.separator\n + QVCSConstants.QVCS_SERVED_PROJECTNAME_PREFIX + getTestProjectName() + \".properties\";\n File projectPropertiesFile = new File(projectPropertiesFilename);\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties project properties file name: [\" + projectPropertiesFilename + \"]\");\n\n if (projectPropertiesFile.exists()) {\n // If the properties file exists, delete it, so we can create a fresh one.\n projectPropertiesFile.delete();\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.initProjectProperties deleting existing property file.\");\n }\n // Make sure the properties directory exists...\n if (!projectPropertiesFile.getParentFile().exists()) {\n projectPropertiesFile.getParentFile().mkdirs();\n }\n\n // Make sure the property file exists. (This should create it.)\n if (projectPropertiesFile.createNewFile()) {\n AbstractProjectProperties projectProperties = ProjectPropertiesFactory.getProjectPropertiesFactory().buildProjectProperties(getTestProjectName(), QVCSConstants.QVCS_SERVED_PROJECT_TYPE);\n\n // This is where the archives go...\n String projectLocation = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_PROJECTS_DIRECTORY\n + File.separator\n + getTestProjectName();\n\n File archiveLocation = new File (projectLocation);\n String canonicalArchiveLocation = archiveLocation.getCanonicalPath();\n\n // This the root directory for the archives for this project.\n projectProperties.setArchiveLocation(canonicalArchiveLocation);\n\n // Make sure the directory exists.\n File projectDirectory = new File(projectLocation);\n projectDirectory.mkdirs();\n\n // Set the project info for the reference copies\n projectProperties.setCreateReferenceCopyFlag(false);\n\n // Set the ignore case flag.\n projectProperties.setIgnoreCaseFlag(true);\n\n projectProperties.setDirectoryContentsInitializedFlag(true);\n\n projectProperties.saveProperties();\n }\n } catch (IOException e) {\n Logger.getLogger(TestHelper.class.getName()).log(Level.SEVERE, null, e);\n }\n }",
"protected SftpPropertyLoad(final String bundleFileName) {\n\n\t\tthis.bundleFileName = bundleFileName;\n\n\t\tfinal Resource res = new ClassPathResource(StringUtil.replace(bundleFileName, \".\", \"/\") + \".properties\");\n\t\tfinal EncodedResource encodedResource = new EncodedResource(res, \"UTF-8\");\n\n\t\ttry {\n\t\t\tprops = PropertiesLoaderUtils.loadProperties(encodedResource);\n\t\t} catch (IOException e) {\n\t\t\tthrow new WebRuntimeException(e);\n\t\t}\n\t}",
"private void init (Properties props) throws FileNotFoundException {\n\t\t\n\t\tport = Integer.parseInt (props.getProperty (AposNtrip.PROP_PORT));\n\t\tString userName = props.getProperty (AposNtrip.PROP_USERNAME);\n\t\tString password = props.getProperty (AposNtrip.PROP_PASSWORD);\n\t\tString mountPoint = props.getProperty (AposNtrip.PROP_MOUNTPOINT);\n\t\t\n\t\tbyte[] encodedPassword = ( userName + \":\" + password ).getBytes();\n\t Base64 encoder = new Base64 ();\n\t basicAuthentication = encoder.encode( encodedPassword );\n\t\n\t expectedRequest = \"GET /\" + mountPoint + \" HTTP/1.0\";\n\t expectedUserAgent = \"User-Agent: .*\";\n\t expectedAuthorisation = \"Authorization: Basic \" + (new String (basicAuthentication));\n\t expectedLocation = props.getProperty (PROP_EXPECTED_LOCATION);\n\t \n\t System.out.println (\"AposNtripCasterMock: expectedRequest=\" + expectedRequest);\n\t System.out.println (\"AposNtripCasterMock: expectedUserAgent=\" + expectedUserAgent);\n\t System.out.println (\"AposNtripCasterMock: expectedAuthorisation=\" + expectedAuthorisation);\n\t \n\t String fileName = props.getProperty (PROP_INPUT_DATA_FILE);\n\t\tURL url = Thread.currentThread ().getContextClassLoader ().getResource (fileName);\n\t\t\n\t\tif (url == null)\n\t\t\tthrow new FileNotFoundException (fileName);\n\t\t\n\t\tinputDataFile = new File (url.getFile ());\n\t}",
"private void initializeTestProperties(InputStream is)\n throws IOException, MissingRequiredTestPropertyException\n {\n testProperties.load(is);\n \n // TODO This method should perform validation, i.e. make sure that properties\n // that are required for Java are set when they should be set, etc. We\n // should fail as soon as we have a test.properties file that doesn't make sense\n // (at load time) rather than waiting until we try to load a property that is broken\n setLanguage(getRequiredStringProperty(BUILD_LANGUAGE));\n setPerformCodeCoverage(getOptionalBooleanProperty(PERFORM_CODE_COVERAGE, false));\n setMaxDrainOutputInBytes(getOptionalIntegerProperty(MAX_DRAIN_OUTPUT_IN_BYTES, DEFAULT_MAX_DRAIN_OUTPUT_IN_BYTES));\n setJavaSourceVersion(getOptionalStringProperty(SOURCE_VERSION, DEFAULT_JAVA_SOURCE_VERSION));\n setTestRunnerInTestfileDir(getOptionalBooleanProperty(RUN_IN_TESTFILES_DIR, false));\n setLdLibraryPath(getOptionalStringProperty(LD_LIBRARY_PATH));\n setVmArgs(getOptionalStringProperty(VM_ARGS));\n \n setMakeCommand(getOptionalStringProperty(MAKE_COMMAND, DEFAULT_MAKE_COMMAND));\n setMakefileName(getOptionalStringProperty(MAKE_FILENAME));\n setStudentMakefileName(getOptionalStringProperty(STUDENT_MAKE_FILENAME));\n\n // XXX For legacy reasons, the test.properties file used to support:\n // test.timeout.testProcess\n // This was the timeout for the entire process from back when we tried to run\n // each test case in a separate thread.\n // Now instead we just use:\n // test.timeout.testCase\n // So we're going to ignore test.timeout.testProcess because it's almost certainly\n // going to be too long.\n\n // If no individual test timeout is specified, then use the default.\n // Note that we ignore test.timeout.testProcess since we're not timing out\n // the entire process anymore.\n setTestTimeoutInSeconds(getOptionalIntegerProperty(TEST_TIMEOUT, DEFAULT_PROCESS_TIMEOUT));\n }",
"public MutablePropertiesPropertySource(File propertiesLocation, int defaultOrdinal) {\n super(propertiesLocation.toString(), defaultOrdinal);\n try {\n this.file = propertiesLocation;\n refresh();\n } catch (Exception e) {\n LOG.log(Level.SEVERE, \"Cannot convert file to URL: \" + propertiesLocation, e);\n }\n }",
"public PropertiesPlus(File propertiesFile) throws IOException\n\t{\n\t\tsuper();\n\t\tpropertyFile = propertiesFile; \n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\tdateFormatGMT_MS.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\tload(new FileReader(propertiesFile));\n\t}",
"public ApplicationResourceProperties() {\n }"
]
| [
"0.7875511",
"0.77031136",
"0.7594402",
"0.7523673",
"0.738174",
"0.73661685",
"0.7299976",
"0.7269883",
"0.71849483",
"0.7077284",
"0.70635784",
"0.70573145",
"0.7053719",
"0.70532525",
"0.70347786",
"0.7034393",
"0.6981653",
"0.69714546",
"0.696331",
"0.6892075",
"0.68756735",
"0.68569195",
"0.6812765",
"0.6802855",
"0.6778881",
"0.67397565",
"0.6730778",
"0.6720118",
"0.67071724",
"0.6698186",
"0.6697395",
"0.6684694",
"0.6674374",
"0.66664034",
"0.66641915",
"0.66570985",
"0.66513586",
"0.66481096",
"0.6628512",
"0.66188747",
"0.6618541",
"0.6613308",
"0.6611542",
"0.6606567",
"0.6597174",
"0.6596627",
"0.6596484",
"0.6592431",
"0.6590033",
"0.6574244",
"0.6558166",
"0.65569",
"0.65549237",
"0.65196687",
"0.6518758",
"0.6514227",
"0.65129435",
"0.6501702",
"0.64775896",
"0.64740676",
"0.64693695",
"0.64514273",
"0.6447782",
"0.6444412",
"0.6432243",
"0.6426933",
"0.64259094",
"0.64193267",
"0.6410831",
"0.6401776",
"0.6399156",
"0.6376666",
"0.63679904",
"0.6367821",
"0.6364663",
"0.63487804",
"0.6343836",
"0.6331371",
"0.63267446",
"0.6325135",
"0.63227284",
"0.63172615",
"0.6313623",
"0.6311788",
"0.63062704",
"0.6294065",
"0.62483007",
"0.62001544",
"0.61945194",
"0.61906064",
"0.6190117",
"0.61896104",
"0.61805606",
"0.6180195",
"0.61735225",
"0.61719644",
"0.6168715",
"0.61583686",
"0.6144366",
"0.61436814"
]
| 0.7356781 | 6 |
Handles HTTP GET requests. | public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
// add properties to the request as an attribute
request.setAttribute("properties", this.properties);
// Forward to a JSP
RequestDispatcher dispatcher = getServletContext()
.getRequestDispatcher("/project3-properties.jsp");
dispatcher.forward(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"public void doGet( )\n {\n \n }",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Override\nprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response\n )\n throws ServletException\n , IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n\n }"
]
| [
"0.7151432",
"0.714443",
"0.710912",
"0.7108925",
"0.71071106",
"0.7071738",
"0.70669526",
"0.70426875",
"0.70337105",
"0.701473",
"0.7011211",
"0.6929938",
"0.6917358",
"0.6917358",
"0.6909027",
"0.69000846",
"0.6893172",
"0.6888916",
"0.687581",
"0.687581",
"0.68631727",
"0.6863068",
"0.6859907",
"0.6859907",
"0.68548334",
"0.68548334",
"0.6826636",
"0.6826636",
"0.6826636",
"0.6819847",
"0.68065697",
"0.6785196",
"0.67727274",
"0.67678154",
"0.675747",
"0.6750743",
"0.6750632",
"0.6745245",
"0.6742821",
"0.6742821",
"0.67400247",
"0.67261064",
"0.67215586",
"0.67215586",
"0.6717715",
"0.6717715",
"0.6711075",
"0.6703719",
"0.6697486",
"0.6674968",
"0.6672517",
"0.66712904",
"0.66712904",
"0.6671265",
"0.66689456",
"0.6668452",
"0.6656537",
"0.6649777",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6649554",
"0.6645222",
"0.6645036",
"0.6638046",
"0.66370445",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66282827",
"0.66269463",
"0.6621652",
"0.66194147",
"0.661605",
"0.66145104",
"0.6606258",
"0.6603661",
"0.6603661",
"0.6603661"
]
| 0.0 | -1 |
Executes the calculateRoot() function and asks the user whether or not it wants to calculate a new root | private static void executeProgram() throws IllegalArgumentException {
while(true) {
calculateRoot();
sc = new Scanner(System.in);
System.out.print("Do you want to enter another equation? :");
String answer = sc.next();
if(answer.equalsIgnoreCase("no")) {
System.out.println("Good bye!!!");
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void calculateRoot() throws IllegalArgumentException {\n\t\tdouble[] userInputs = getInputs();\n\t\tdouble value = Main.root(userInputs[0], userInputs[1], userInputs[2]);\n\t\tSystem.out.println(\"The root value is: \" + value);\n\t}",
"private void squareRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.squareRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n double a = scanner.nextDouble();\n double b = scanner.nextDouble();\n double c = scanner.nextDouble();\n\n double determinant = b * b - 4 * a * c;\n\n double root1;\n double root2;\n\n\n\n // two real and distinct roots\n root1 = (-b + Math.sqrt(determinant)) / (2 * a);\n root2 = (-b - Math.sqrt(determinant)) / (2 * a);\n\n if (root2 < root1) {\n System.out.println(root2 + \" \" + root1);\n } else {\n System.out.println(root1 + \" \" + root2);\n }\n\n\n\n }",
"private void sqrtOperands() {\n\t\tif (text_Operand1.getText().isEmpty()) {\n\t\t\ttext_Operand3.setText(\"5\");\n\t\t}\n\t\tif (unaryOperandIssues())\n\t\t\treturn;\n\n\t\tif (text_Operand1.getText() != \"\")\n\t\t\tif (text_Operand1.getText().charAt(0) == '-') {\n\t\t\t\tlabel_errOperand1.setText(\"Negative Input not Allowed\");\n\t\t\t\ttext_Result.setText(\"\");\n\t\t\t\ttext_Resulterr.setText(\"\");\n\t\t\t\tlabel_Result.setText(\"\");\n\t\t\t\tlabel_errResult.setText(\"\");\n\t\t\t\treturn;\n\t\t\t}\n\t\tif (text_Operand1.getText().isEmpty()) {\n\t\t\ttext_Operand1.setText(\"0.0\");\n\t\t}\n\t\t// Check to see if both operands are defined and valid\n\n\t\t// Check to see if both operands are defined and valid\n\t\t// without doing the computation\n\n\t\tif (text_Operand2.getLength() != 0) {\n\t\t\ttext_Operand2.setText(\"\");\n\t\t\tlabel_errOperand2.setText(\"Second Input not Required.\");\n\t\t}\n\t\tif (text_Operand4.getLength() != 0) {\n\t\t\ttext_Operand4.setText(\"\");\n\t\t\tlabel_errOperand4.setText(\"Second Input not Required.\");\n\n\t\t}\n\n\t\t// If the operands are defined and valid, request the business logic method to\n\t\t// do the Square Root and return the\n\t\t// result as a String. If there is a problem with the actual computation, an\n\t\t// empty string is returned\n\t\tString theAnswer = perform.squareroot(); // Call the business logic Root method\n\t\tlabel_errResult.setText(\"\"); // Reset any result error messages from before\n\t\tString theAnswer1 = perform.squareroot1(); // Call the business logic Square Root method\n\t\tlabel_errResulterr.setText(\"\"); // Reset any result error messages from before\n\t\tif (theAnswer.length() > 0 || theAnswer1.length() > 0) { // Check the returned String to see if it is okay\n\t\t\ttext_Result.setText(theAnswer); // If okay, display it in the result field and\n\t\t\tlabel_Result.setText(\"Square Root\"); // change the title of the field to \"Square Root\".\n\t\t\tlabel_Result.setLayoutX(40);\n\t\t\tlabel_Result.setLayoutY(345);\n\t\t\ttext_Resulterr.setText(theAnswer1); // If okay, display it in the result field and\n\t\t\tcomboBoxRes.getSelectionModel().select(\"\\u221A\" + comboBox1.getSelectionModel().getSelectedItem());\n\t\t\t// change the title of the field to \"Square Root\"\n\t\t} else { // Some error occurred while doing the Square Root.\n\t\t\ttext_Result.setText(\"\"); // Do not display a result if there is an error.\n\t\t\tlabel_Result.setText(\"Result\"); // Reset the result label if there is an error.\n\t\t\tlabel_errResult.setText(perform.getResultErrorMessage()); // Display the error message.\n\t\t\ttext_Resulterr.setText(\"\"); // Do not display a result if there is an error.\n\t\t\t// Reset the result label if there is an error.\n\t\t\tlabel_errResulterr.setText(perform.getResulterrErrorMessage()); // Display the error message.\n\t\t}\n\t}",
"private void cubeRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.cubeRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t//Reading input from the user\n\t\tSystem.out.println(\"Enter the number to find sqaure root of\");\n\t\tdouble num=AlgorithmUtility.userDouble();\n\t\t\n\t\t//Method 1- using static function of AlgorithmUtility class of\n\t\t//com.bridgelabz.util package\n\t\tdouble res=AlgorithmUtility.squareRoot(num);\n\t\t\n\t\tSystem.out.println(\"The square root of the given number using Newton's Method is: \"+ res);\n\t}",
"public static void main(String args[]) {\n\t\t\n\t\t//declare the variables of equation ax*x + b*x + c = 0 \n\t\tdouble a,b,c;\n\t\t\n\t\t//define scanner variable x as\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\t//initiate the value to command line input\n\t\tSystem.out.println (\"give value of x^2 coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\ta = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of x coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\tb = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of contant\");\n\t\t\n\t\t//now add input to variable a \n\t\tc = scan.nextDouble();\n \n //declare discriminant of the equation as b^2 - 4*a*c\n double d = Math.pow(b, 2.0) - 4.0*a*c;\n \n //apply the rules for quadratic equations\n //if d =0.0 then roots are equal\n if (d == 0.0) {\n \t\n \t//the root in these situation is -b/2a\n \tSystem.out.println(\"the equation has \"+(-1.0*b/(2.0*a)) + \" as only real root\");\n }\n else if (d >=0.0) {\n \t\n \t//the root in this situation is (-b +- d^0.5)/2a\n \t//the first root is x1\n \tdouble x1 = (-1.0*b + Math.pow(d, 0.5))/(2.0*a);\n \t\n \t//the second root is x2\n \tdouble x2 = (-1.0*b - Math.pow(d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(x1) + \" and \"+(x2) +\" as two real roots\");\n }\n else {\n \t\n \t//the root in this situation are complex (-b +- d^0.5i)/2a\n \t//the real part of root is r\n \tdouble real = (-1.0*b)/(2.0*a);\n \t\n \t//the complex part of root is c\n \tdouble com = (Math.pow(-1.0*d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(real) + \"+\"+(com) +\"i and \"+real+\"-\"+com+\"i as two complex root\" );\n }\n\t}",
"public static void main(String[] args){\n\t\tSimpleCalculator calc = new SimpleCalculator();\n\t\tboolean a=true;\n\t\tdouble number = 0.0;\n\t\tString checker = \"\";\n\t\twhile(a){\n\t\t\tSystem.out.println(\"Result: \" + number);\n\t\t\tSystem.out.println(\"Enter an operation or 'q' to end the program.\");\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\ttry{\n\t\t\t\tchecker= scan.next();\n\t\t\t\tif (checker.equals(\"q\")){\n\t\t\t\t\ta=false;\n\t\t\t\t}\n\t\t\t\telse if (!checker.equals(\"+\")&& !checker.equals(\"-\")&& !checker.equals(\"*\") && !checker.equals(\"/\")&&\n\t\t\t\t\t\t!checker.equals(\"%\")){\n\t\t\t\t\tthrow new UnknownOperatorException();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(UnknownOperatorException e){\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t\tif(a&&(checker.equals(\"+\")|| checker.equals(\"-\")|| checker.equals(\"*\") || checker.equals(\"/\")||\n\t\t\t\t\tchecker.equals(\"%\"))){\n\t\t\t\ttry{\n\t\t\t\t\tSystem.out.println(\"Please enter a number: \");\n\t\t\t\t\tnumber= scan.nextDouble();\n\t\t\t\t\tif (checker.equals(\"/\")&&(number==0)){\n\t\t\t\t\t\tthrow new ArithmeticException();\n\t\t\t\t\t}\n\t\t\t\t\tcalc.calcSetter(number, checker);\n\t\t\t\t\tnumber =calc.CalcLogic();\n\t\t\t\t}\n\t\t\t\tcatch(InputMismatchException exceptionObj){\n\t\t\t\t\tSystem.out.println(\"That is not a number! Please try again!\");\n\t\t\t\t\tScanner scan2 = new Scanner(System.in);\n\t\t\t\t\tnumber = scan2.nextDouble();\n\t\t\t\t}\n\t\t\t\tcatch(ArithmeticException e){\n\t\t\t\t\tSystem.out.println(\"Cannot divide by zero!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public static void main(String[] args) {\n int r1 = 45_000; // a root ~45,000 means c is ~2,000,000,000, which is close to the maximum integer 2^31 - 1\n int r2 = -45_000;\n System.out.println(\"For the equation x^2 - 4x + 3 = 0, the possible solutions are:\");\n Set<Integer> result = roots(1, -r1-r2, r1*r2);\n System.out.println(result);\n }",
"private QuestionNode askQuestionsHelper(QuestionNode root) {\r\n if (root.left == null || root.right == null) {\r\n if (yesTo(\"Would your object happen to be \" + root.data + \"?\") == true) {\r\n System.out.println(\"Great, I got it right!\");\r\n } else {\r\n System.out.print(\"What is the name of your object? \");\r\n String object = console.nextLine();\r\n QuestionNode leaf = new QuestionNode(object);\r\n System.out.println(\"Please give me a yes/no question that\");\r\n System.out.println(\"distinguishes between your object\");\r\n System.out.print(\"and mine--> \");\r\n String question = console.nextLine();\r\n QuestionNode branch = new QuestionNode(question);\r\n if (yesTo(\"And what is the answer for your object?\") == true) {\r\n branch.left = leaf;\r\n branch.right = root;\r\n } else {\r\n branch.left = root;\r\n branch.right = leaf;\r\n }\r\n root = branch;\r\n }\r\n } else {\r\n if (yesTo(root.data)) {\r\n root.left = askQuestionsHelper(root.left);\r\n } else {\r\n root.right = askQuestionsHelper(root.right);\r\n }\r\n }\r\n return root;\r\n }",
"public void setRoot(typekey.CalcRoutineParamName value);",
"private QuestionNode askQuestionsInternal(QuestionNode root) {\r\n if(root.isLeafNode()) { // leaf node\r\n if(!(yesTo(\"Would your object happen to be \" +\r\n root.data + \"?\"))) {\r\n System.out.print(\"What is the name of your object? \");\r\n String answer = console.nextLine();\r\n System.out.println(\"Please give me a yes/no question that \");\r\n System.out.println(\"distinguishes between your object \");\r\n System.out.print(\"and mine--> \");\r\n String ques = console.nextLine();\r\n QuestionNode answerQuestionNode =\r\n new QuestionNode(answer);\r\n QuestionNode originalAnsQuestionNode =\r\n new QuestionNode(root.data);\r\n if(yesTo(\"And what is the answer for your object?\")){\r\n root = new QuestionNode(ques, answerQuestionNode,\r\n originalAnsQuestionNode);\r\n } else {\r\n root = new QuestionNode(ques,\r\n originalAnsQuestionNode,\r\n answerQuestionNode);\r\n }\r\n } else {\r\n System.out.print(\"Great, I got it right!\");\r\n System.out.println();\r\n }\r\n return root;\r\n } else { // recur down the tree based on user response.\r\n if(yesTo(root.data)) {\r\n root.left = askQuestionsInternal(root.left);\r\n } else {\r\n root.right = askQuestionsInternal(root.right);\r\n }\r\n return root;\r\n }\r\n }",
"public abstract void bepaalGrootte();",
"public void doMenu(){\n Scanner readinput = new Scanner(System.in); // needed to read the user's input\r\n System.out.println(\"Using Red Black Tree. 9 for list of commands\");\r\n while (this.userinput != -1) {\r\n \r\n this.update(); // every loop, print diagram of the tree\r\n \r\n System.out.print(\"Option: \");\r\n this.userinput = readinput.nextInt(); // input. Await user.\r\n \r\n switch(this.userinput){ // checks and matches the input to available functions\r\n \r\n case 9:\r\n System.out.println(\"\\nAvailable commands:\"\r\n + \"\\n'0': create a new empty root\"\r\n + \"\\n'-1': quits the program\"\r\n + \"\\n'1': recursively inserts new node with value\"\r\n + \"\\n'2': remove a node\"\r\n + \"\\n'3': print information about the tree\"\r\n + \"\\n'4': print information about a node\"\r\n + \"\\n'9': print this help section\"\r\n );\r\n break;\r\n \r\n case -1: // quit.\r\n System.out.println(\"Stopping.\");\r\n break;\r\n \r\n case 0: // Empty all\r\n System.out.print(\"Removing all.\");\r\n this.root = null;\r\n break;\r\n \r\n case 1: // insere objeto no conteúdo do nó.\r\n System.out.print(\">>> New Value: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.insertElement(this.root, userinput2);\r\n break;\r\n \r\n case 2: //remover certo valor\r\n System.out.print(\">>> Value to be removed: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.remove(root, userinput2);\r\n break;\r\n \r\n case 3: // imprimir informações da árvore\r\n\r\n //this.calculateNodes(root);\r\n System.out.println(\"Pre Order NLR:\");\r\n this.traversePreOrder(root);\r\n System.out.println(\"\\nPost Order LRN:\");\r\n this.traversePostOrder(root);\r\n System.out.println(\"\\nIn Order LNR:\");\r\n this.traverseInOrder(root);\r\n System.out.println(\"\\n[!] Finished printing tree information\\n\");\r\n break;\r\n \r\n case 4: \r\n System.out.print(\">>> Value of node to be fetched: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.info(this.fetch(root, userinput2));\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n }",
"public static void main(String[] args)\r\n {\r\n // TODO Auto-generated method stub\r\n \r\n //declare all variables\r\n //denom, discrim, coef_A, coef_B, coef_C, discrimSqrt, complexFlag, singleRootFlag, rootOne, rootTwo, complexDisplay\r\n \r\n //Display a title\r\n //Method: printTitle\r\n \r\n //Get the coefficients from the user. Use three times\r\n //Method: promptForCoef\r\n \r\n //Calculate the denominator of the quadratic formula\r\n //Method: calcDenom\r\n \r\n //Calculate the discriminant\r\n //Method: calcDiscrim\r\n \r\n //Determine if the discriminant shows complexity\r\n //Check if it is a negative number. It is complex if it is negative\r\n //set complexFlag to true\r\n \r\n //Otherwise determine if the discriminant shows one root\r\n //Check if the discriminant equals 0. One root if it equals 0\r\n //Calculate the square root of the discriminant\r\n //set singleRootFlag to true\r\n //Calculate the one root\r\n //Method: calcRoot\r\n \r\n //Otherwise there is two roots\r\n //Calculate both roots; use calcRoot for both\r\n //IMPORTANT!!! Input discrimSqrt as negative for the second root\r\n //Method: calcRoot\r\n \r\n //Display the table\r\n //Begin by displaying the title of the table\r\n //Method: displayTableTitle\r\n //Next display the sub-titles\r\n //Method: displaySubTitles\r\n //Then display the data pieces for the table. There will be three for the three coefficients.\r\n //Method: displayDataLine\r\n \r\n //Check if there is a complexFlag. If true display a line saying that the roots are complex\r\n //Method: displayDataLine\r\n //Otherwise check if there is a singleRootFlag. If true display the single root\r\n //Method: displayDataLine\r\n //Otherwise display both roots on separate lines\r\n //Method: displayDataLine\r\n //Finally display a single line to end the table\r\n //Method: displayLine\r\n \r\n //End program\r\n //Method: displayProgramEnd\r\n\r\n }",
"@Test\n public void test1DigitalRootMethod() {\n final int expected = 7;\n final int number = 16;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public void askQuestions() {\r\n overallRoot = askQuestionsHelper(overallRoot);\r\n }",
"public void setIsRoot(boolean value)\n\t{\n\t\tisRoot = value;\n\t}",
"public boolean isValidateRoot() {\n/* 246 */ return true;\n/* */ }",
"public boolean isValidateRoot() {\n/* 463 */ return true;\n/* */ }",
"public void actionPerformed(ActionEvent event) {\n\t\tif (m_pjRoot==null)\n\t\t\treturn;\n\t\tObject source = event.getSource();\n\t\tif (source == m_bReset) {\n\t\t\tm_pjRoot.init();\n\t\t\tm_pjRoot.computeGraph();\n\t\t\tm_pjRoot.findRoot();\n\t\t\tm_pjRoot.m_graph.update(m_pjRoot.m_graph);\n\t\t\tm_pjRoot.m_root.update(m_pjRoot.m_root);\n\t\t}\n\t}",
"public boolean isRoot() {\n return term.isRoot();\n }",
"void setROOT(amdocs.iam.pd.webservices.productrelations.checkproducteligibilityoutput.CheckProductEligibilityOutput root);",
"private void Button_SqaureRootActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_SqaureRootActionPerformed\n // TODO add your handling code here:\n }",
"public static void main(String[] args) {\n\n System.out.println(\"------------------------------------\");\n //making a simple console calculator\n Scanner sc = new Scanner(System.in);\n double x, y;\n double result = 0;\n\n System.out.println(\"1. Addition\");\n System.out.println(\"2. Subtraction\");\n System.out.println(\"3. Multiplying\");\n System.out.println(\"4. Division\"); //HW\n System.out.print(\"Enter the operation: \");\n int operation = sc.nextInt();\n\n System.out.print(\"Enter first number: \");\n x = sc.nextInt();\n System.out.print(\"Enter second number: \");\n y = sc.nextInt();\n\n //simple\n if (operation == 1) {\n result = x + y;\n } else if (operation == 2) {\n result = x - y;\n } else if (operation == 3) {\n result = x * y;\n } else if (operation == 4 && y != 0) {\n result = x / y;\n } else {\n System.out.println(\"Wrong operation!\");\n }\n \n System.out.println(\"Result: \" + result);\n }",
"public void root(Node n) {}",
"protected abstract RootVertex<D> getRoot(R root);",
"public static void main(String[] args) {\n double numA;\n double numB;\n double numC;\n double delta;\n\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter number a: \");\n numA = sc.nextDouble();\n System.out.print(\"Enter number b: \");\n numB = sc.nextDouble();\n System.out.print(\"Enter number c: \");\n numC = sc.nextDouble();\n delta = Math.pow(numB,2) - (4*numA*numC);\n\n if (numA == 0){\n if (numB == 0){\n if (numC == 0){\n System.out.println(\"Equation countless solutions\");\n }else {\n System.out.println(\"Equation has no solution\");;\n }\n }else {\n System.out.println(\"Equation has 1 solution x = \" + (-numB/numA));\n }\n }else {\n if (delta < 0){\n System.out.println(\"Equation has no solution\");\n }else if (delta == 0){\n System.out.println(\"Equation has 1 solution x = \" + (-numB/(2*numA)));\n }else {\n System.out.println(\"Equation has 2 solutions x1 = \" + (-numB+Math.sqrt(delta))/(2*numA));\n System.out.println(\"Equation has 2 solutions x2 = \" + (-numB-Math.sqrt(delta))/(2*numA));\n }\n }\n }",
"public double squareRoot (double firstNumber){\n\t\tif (firstNumber < 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Invalid Input \", \"Error message\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn -1111.1111;\n\t\t}\n\t\tdouble result = Math.sqrt(firstNumber);\n\t\treturn result;\n\t}",
"void setROOT(amdocs.iam.pd.webservices.quotation.getquoteinput.GetQuoteInput root);",
"public void askQuestions() {\r\n finalRoot = askQuestionsInternal(finalRoot);\r\n }",
"public static void main(String[] args) {\n TreeNode node1 = new TreeNode(4);\n TreeNode node2 = new TreeNode(1);\n TreeNode node3 = new TreeNode(12);\n TreeNode node4 = new TreeNode(3);\n TreeNode node5 = new TreeNode(2);\n TreeNode node6 = new TreeNode(5);\n TreeNode node7 = new TreeNode(3);\n\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node3.right = node7;\n\n\n /*\n * 1\n * 3 2\n */\n TreeNode node11 = new TreeNode(1);\n TreeNode node21 = new TreeNode(3);\n TreeNode node31 = new TreeNode(2);\n\n node11.left = node21;\n node11.right = node31;\n\n /*\n * 1\n * 3 3\n */\n TreeNode node12 = new TreeNode(1);\n TreeNode node22 = new TreeNode(3);\n TreeNode node32 = new TreeNode(3);\n\n node12.left = node22;\n node12.right = node32;\n\n System.out.println(isRoot2SubTreeOfRoot1(node1, node11));\n System.out.println(isRoot2SubTreeOfRoot1(node1, node12));\n }",
"public boolean isValidBST(TreeNode root) {\n\n if(root == null){\n return true;\n }\n\n return helper(root, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);\n\n }",
"public int startUp(){\n\n while(!valid) {\n input = JOptionPane.showInputDialog(\"Enter an infix numerical expression between 3 & 20 characters.\");\n if(validCheck(input)){\n valid = true;\n }\n else{\n JOptionPane.showMessageDialog(null, \"Invalid Expression. Please Enter Again.\",\n \"Input error\", JOptionPane.ERROR_MESSAGE);3*3\n }\n }\n\n String postfix = processInfix(inputArray);\n double result = processPostfix(processInfix(inputArray));\n JOptionPane.showMessageDialog(null, \"The resulting expression is as follows: \"\n + \"\\nInfix: \" + this.input + \"\\nPostfix: \" + postfix + \"\\nResult: \" + result,\n \"Result\", JOptionPane.PLAIN_MESSAGE);\n\n //Try again GUI. Returns 1 if NO and 0 if YES\n int n = JOptionPane.showConfirmDialog(\n null,\n \"Would you like to try again?\",\n \"A Question For Thee\",\n JOptionPane.YES_NO_OPTION);\n\n return n;\n\n }",
"default boolean isRoot() {\n if (isEmpty()){\n return false;\n }\n\n TreeNode treeNode = getTreeNode();\n return treeNode.getLeftValue() == 1;\n }",
"public static void menu (Scanner scanner){\n\t\t\t\n\t\t\tSystem.out.print(\"Please enter a starting node: \");\n\t\t\t\n\t\t\tString input = scanner.nextLine();\n\t\t\t\n\t\t\t\n\t\t\tif (input.toLowerCase().matches(\"exit\") ||\n\t\t\t\tinput.toLowerCase().matches(\"exit \") ){\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nGoodbye!\");\n\t\t\t\treturn; // exit\n\t\t\t\t\n\t\t\t} else if (distance.isEmpty() || inputMap.isEmpty()){\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nPlease check data files. Not enough data to complete\"\n\t\t\t\t\t\t+ \" calculations. Once files have been added, please restart the\"\n\t\t\t\t\t\t+ \" program. Thank you.\");\n\t\t\t\treturn; // exit\n\t\t\t\t\n\t\t\t} else if (inputNodes.contains(input.toUpperCase())) {\n\t\t\t\n\t\t\t\t// process user input\n\t\t\t\tprocessUserInput(input.toUpperCase());\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nThe node you requested is not a valid start node or\"\n\t\t\t\t\t\t+ \" was not found. Please try again.\\n\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Recursive call\n\t\t\tmenu(scanner);\n\t\t\t\n\t\t}",
"public static void main(String[] args) {\r\n //UserFriendlyCalculator\r\n /*\r\n Ahmad Elmasri\r\n 01/03/2017\r\n Version 0.1\r\n This is a simple calculator with a GUI and runs one of two \r\n calculations with code set in place to catch invalid input\r\n */\r\n \r\n //CODE\r\n \r\n //Panel objects\r\n JFrame calculator = new JFrame(\"Calculator\");\r\n JPanel panel = new JPanel();//holds all interactive elements\r\n \r\n //Button Objects\r\n JButton submitNameButton = new JButton(\"Submit\");\r\n JButton startButton = new JButton();\r\n JButton squarePyramidProblem = new JButton(\"Square Based \"\r\n + \"Pyramid Area and Volume\");\r\n JButton submitAnswer = new JButton(\"Submit Answer\");\r\n JButton quadraticFormula = new JButton(\"Quadratic Roots Calculator\");\r\n \r\n //Label objects. User output and information\r\n JLabel intro = new JLabel(\"Hi there! I'm a simple calculator!\");\r\n JLabel nameAsker= new JLabel(\"What is your name?\");\r\n JTextField inputField = new JTextField();//Where user puts in answers\r\n JLabel noNameMessage = new JLabel(\"Hey there, you don't have a name!\");\r\n JLabel anyMessage = new JLabel();//all purpose messenger\r\n JLabel formulaViewer = new JLabel();\r\n JLabel userGuide = new JLabel(\"Press Submit after typing your name.\");\r\n \r\n \r\n //Initializing the GUI's traits and making it visible\r\n calculator.setVisible(true);\r\n panel.setLayout(null);//Ensures layout is coder influenced and not default\r\n calculator.setSize(500,500);\r\n \r\n //Setting the size and location of the buttons\r\n startButton.setBounds(50,50,50,50);\r\n squarePyramidProblem.setBounds(100,200,300,25);\r\n submitAnswer.setBounds(100,200,200,25);\r\n submitNameButton.setBounds(100,200,100,100);\r\n quadraticFormula.setBounds(100,225,300,25);\r\n \r\n \r\n //Setting size and location of labels and the textfield \r\n intro.setBounds(100,-200,200,500);\r\n formulaViewer.setBounds(100,75,500,500);\r\n nameAsker.setBounds(100,-425,200,1000);\r\n noNameMessage.setBounds(100,-85,200,500);// first 2 are xy, second 2 are size in xy\r\n inputField.setBounds(100,100,200,25);\r\n userGuide.setBounds(100,120,300,50);\r\n \r\n \r\n \r\n //Adds objects to the panel\r\n calculator.add(panel);\r\n panel.add(formulaViewer);\r\n panel.add(inputField);\r\n panel.add(nameAsker);//makes it interactive w/ users & coders\r\n panel.add(submitNameButton);\r\n panel.add(intro);\r\n panel.add(startButton);\r\n panel.add(squarePyramidProblem);\r\n panel.add(submitAnswer);\r\n panel.add(anyMessage);\r\n panel.add(noNameMessage);\r\n panel.add(userGuide);\r\n panel.add(quadraticFormula);\r\n \r\n //sets which objects are seen at the start screen\r\n squarePyramidProblem.setVisible(false);\r\n submitAnswer.setVisible(false);\r\n panel.setVisible(true);\r\n submitNameButton.setVisible(true);\r\n intro.setVisible(true);\r\n nameAsker.setVisible(true);\r\n inputField.setVisible(true);\r\n startButton.setVisible(false);//makes it invisible\r\n noNameMessage.setVisible(false);\r\n userGuide.setVisible(true);\r\n quadraticFormula.setVisible(false);\r\n \r\n//============================================================================== \r\n submitNameButton.addActionListener(new ActionListener(){ \r\n @Override\r\n public void actionPerformed(java.awt.event.ActionEvent e) { \r\n String name = inputField.getText(); \r\n //checks if there is no user input\r\n if(name.isEmpty()){\r\n \r\n // No name entered\r\n panel.repaint();\r\n calculator.repaint();//updates the screen (needs to be done periodically)\r\n anyMessage.setVisible(false);\r\n noNameMessage.setVisible(true);\r\n \r\n \r\n //name entered \r\n }else{\r\n //Starts the program and opens up the main menu for users\r\n nameAsker.setVisible(false);\r\n anyMessage.setText(\"Hello there, \" + name +\"!\" );\r\n userGuide.setText(\"Press the Start button to get started\");\r\n anyMessage.setBounds(100,-100,500,500);\r\n userGuide.setBounds(100,50,300,50);\r\n panel.repaint();\r\n calculator.repaint();\r\n noNameMessage.setVisible(false);\r\n anyMessage.setVisible(true);\r\n startButton.setText(\"Start\");\r\n startButton.setBounds(100,175,100,25);\r\n startButton.setVisible(true);\r\n submitNameButton.setVisible(false);\r\n intro.setVisible(false);\r\n \r\n }\r\n } \r\n }); \r\n \r\n//============================================================================== \r\n //start button is pressed\r\n startButton.addActionListener(new ActionListener(){\r\n @Override\r\n public void actionPerformed(java.awt.event.ActionEvent d) {\r\n anyMessage.setText(\"What kind of problem do you want to solve?\");\r\n formulaViewer.setVisible(false);\r\n submitAnswer.setVisible(false);\r\n squarePyramidProblem.setVisible(true);\r\n quadraticFormula.setVisible(true);\r\n calculator.repaint();\r\n panel.repaint();\r\n anyMessage.setVisible(true);\r\n numberOfClicks = \"Zero\";\r\n inputField.setText(\"\");\r\n userGuide.setText(\"Press a button to choose your problem\");\r\n //moves on to the main menu and shows options\r\n }\r\n });\r\n \r\n //============================================================================= \r\n //The square pyramid button is pressed\r\n squarePyramidProblem.addActionListener(new ActionListener(){\r\n @Override\r\n public void actionPerformed(java.awt.event.ActionEvent d) {\r\n anyMessage.setVisible(true);\r\n submitAnswer.setVisible(true);\r\n squarePyramidProblem.setVisible(false);\r\n quadraticFormula.setVisible(false);\r\n formulaViewer.setText(\"Volume Formula :(l\\u00B2*h)/3\" \r\n + \"\\n Area Formula: a\\u00B2 + 2(a)*\\u221A((a\\u00B2/4) + h\\u00B2)\");\r\n formulaViewer.setVisible(true);\r\n anyMessage.setText(\"What is the base length?\");\r\n calculator.repaint();\r\n panel.repaint();\r\n inputField.setText(\"\");\r\n userGuide.setText(\"Press the start button at anytime to go back\");\r\n problemType = \"Pyramid\";//changes the problem type to something else\r\n \r\n }\r\n });\r\n \r\n//==============================================================================\r\n //user submits their answer\r\n submitAnswer.addActionListener(new ActionListener(){\r\n @Override\r\n public void actionPerformed(java.awt.event.ActionEvent d) {\r\n //initializes the format and prepares objects for later use\r\n NumberFormat decimal = NumberFormat.getNumberInstance(); \r\n decimal.setMinimumFractionDigits( 3 );\r\n decimal.setMaximumFractionDigits( 3 );\r\n calculator.repaint();\r\n panel.repaint();\r\n anyMessage.setVisible(true);\r\n submitAnswer.setVisible(true);\r\n //The user selected pyramids \r\n if(problemType.equals(\"Pyramid\")){\r\n if(numberOfClicks.equals(\"Zero\")){\r\n while(true){\r\n try{\r\n //gets the values and stores them in the static double\r\n base = Double.parseDouble(inputField.getText());\r\n inputField.setText(\"\");\r\n numberOfClicks = \"One\";\r\n anyMessage.setText(\"What is the base height?\");\r\n break;\r\n \r\n }catch(Exception e){\r\n //not a number\r\n anyMessage.setText(\"No or not a number, try again\");\r\n break;\r\n }\r\n } \r\n //Second run to get the height\r\n }else if(numberOfClicks.equals(\"One\")){\r\n while(true){\r\n try{\r\n height = Double.parseDouble(inputField.getText());\r\n volume = (Math.pow(base, 2)*height) / 3;\r\n inputField.setText(\"\");\r\n area = Math.pow(base, 2) + (2*base)* \r\n ( Math.sqrt( Math.pow(base, 2)/4 + Math.pow(height, 2)) );\r\n anyMessage.setText(\"Your volume is \" + decimal.format(volume) \r\n + \"m\\u00B3\" + \" and your area is\" + decimal.format(area)\r\n + \"m\\u00B2\");\r\n break;//everything is formatted and outputted then printed\r\n \r\n }catch(Exception e){\r\n anyMessage.setText(\"No input or not a number, try again \");\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n \r\n \r\n // if the user selects quadratic it begins the a value collection\r\n else if(problemType.equals(\"Quadratic\")){\r\n if(numberOfClicks.equals(\"Zero\")){\r\n while(true){\r\n try{\r\n aValue = Double.parseDouble(inputField.getText());\r\n inputField.setText(\"\");\r\n numberOfClicks = \"One\";\r\n anyMessage.setText(\"What is the b value?\");\r\n break;\r\n \r\n }catch(Exception e){\r\n anyMessage.setText(\"No input or not a number, try again\");\r\n break;\r\n }\r\n } \r\n //second run for the b value\r\n }else if(numberOfClicks.equals(\"One\")){\r\n while(true){\r\n try{\r\n bValue = Double.parseDouble(inputField.getText());\r\n inputField.setText(\"\");\r\n numberOfClicks = \"Two\";\r\n anyMessage.setText(\"What is the c value?\");\r\n break;\r\n \r\n }catch(Exception e){\r\n anyMessage.setText(\"No input or not a number, try again\");\r\n break;\r\n }\r\n }\r\n }else if(numberOfClicks.equals(\"Two\")){\r\n while(true){\r\n cValue = Double.parseDouble(inputField.getText()); \r\n try{\r\n double discriminant = (Math.pow(bValue, 2) - 4*aValue*cValue);\r\n \r\n if( discriminant > 0){\r\n quadraticResult1 = (-bValue + Math.sqrt((Math.pow(bValue, 2)\r\n + (-4* aValue * cValue)))) / (2 * aValue);\r\n quadraticResult2 = (-bValue - Math.sqrt((Math.pow(bValue, 2) \r\n + (-4* aValue * cValue)))) / (2 * aValue);\r\n smallerRoot = Math.min(quadraticResult1, quadraticResult2);\r\n largerRoot = Math.max(quadraticResult1, quadraticResult2);\r\n anyMessage.setText(\"Root 1 is \" + decimal.format(smallerRoot)\r\n + \"and Root 2 is \" + decimal.format(largerRoot) );\r\n break;\r\n \r\n }else if( discriminant == 0){\r\n quadraticResult1 = (-bValue + Math.sqrt((Math.pow(bValue, 2)\r\n + (-4* aValue * cValue)))) / (2 * aValue);\r\n anyMessage.setText(\"The only root is \" + quadraticResult1);\r\n break;\r\n \r\n }else{\r\n anyMessage.setText(\"Sorry, no real roots. Try again\");\r\n break;\r\n }\r\n \r\n }catch(Exception e){\r\n anyMessage.setText(\"No input or not a number, try again \");\r\n break;\r\n }\r\n }\r\n }\r\n \r\n \r\n \r\n \r\n \r\n }\r\n }\r\n });\r\n//==============================================================================\r\n//the quadratic button\r\nquadraticFormula.addActionListener(new ActionListener(){ \r\n @Override\r\n public void actionPerformed(java.awt.event.ActionEvent e) { \r\n calculator.repaint();\r\n panel.repaint();\r\n anyMessage.setVisible(true);\r\n submitAnswer.setVisible(true);\r\n quadraticFormula.setVisible(false);\r\n squarePyramidProblem.setVisible(false);\r\n formulaViewer.setText(\"Quadratic Formula :-b + \" \r\n + \"\\u221A(b\\u00B2 + 4(a)(c))/2\");\r\n formulaViewer.setVisible(true);\r\n anyMessage.setText(\"What is the a value?\");\r\n inputField.setText(\"\");\r\n userGuide.setText(\"Press the start button at anytime to go back\");\r\n calculator.repaint();\r\n panel.repaint();\r\n problemType = \"Quadratic\";//changes to quadratic mode which has other roles\r\n\r\n } \r\n }); \r\n \r\n \r\n \r\n \r\n\r\n \r\n }",
"public void execute() {\n if (commandArgument.length != 1) {\n System.out.println(\"tree: requires no user input\");\n }\n else {\n this.treeTraversal(userFileSystem.getRootDir(), 0);\n }\n }",
"public static void main(String[] args) {\n Calculator newCalc = new Calculator();\n Calculator triangleCalc = new Calculator();\n Calculator newCalc1 = new Calculator();\n\n Scanner newScan = new Scanner(System.in);\n Scanner scanNew = new Scanner(System.in);\n Scanner scanner = new Scanner(System.in);\n\n int tryAgain;\n int whichShape;\n do {\n do {\n System.out.println(\"Press [1] to build a Triangle \\n Press [2] to Build a Square or Rectangle \\n Press [3] for Circle \\n Press [4] for Trapezoid\");\n whichShape = newScan.nextInt();\n if (whichShape < 1 || whichShape > 4) {\n System.out.println(\" Try again Please enter 1-3\");\n } else\n switch (whichShape) {\n case 1:\n System.out.println(\"Please Enter the Base dimensions of your Triangle\");\n double baseNum = scanNew.nextDouble();\n System.out.println(\"Please Enter the Height of your Triangle \");\n double triHeight = scanNew.nextDouble();\n System.out.println(\"The Area of your Triangle is \" + newCalc.calculateTriangle(triHeight, baseNum) + \"\\n\\n\");\n break;\n\n case 2:\n System.out.println(\"Please enter the Shape you want to build \\n Square or Rectangle\");\n String shapeName = scanner.nextLine();\n System.out.println(\"Please enter the Length of your shape\");\n Double shapeLength = newScan.nextDouble();\n System.out.println((\"Please Enter Your shapes Height\"));\n System.out.println(\"\\n The area of your shape is \" + triangleCalc.calculateArea(shapeName, shapeLength, scanNew.nextDouble()) + \"\\n\\n\");\n break;\n\n case 3:\n System.out.println(\"Please Enter the Radius of your Circle\");\n double cirRadius = scanNew.nextDouble();\n newCalc1.calculateCircle(cirRadius);\n break;\n case 4:\n System.out.println(\"Please Enter the Base1 dimensions of your Trapezoid\");\n double trapBase1 = scanNew.nextDouble();\n System.out.println(\"Please Enter the Base2 of your Triangle \");\n double trapBase2 = scanNew.nextDouble();\n System.out.println(\"Please enter the Height of your Trapezoid\");\n double trapHeight = scanNew.nextDouble();\n System.out.println(\"The Area of your Trapezoid is \" + newCalc1.trapazoid(trapBase1, trapBase2, trapHeight) + \"\\n\\n\\n\");\n break;\n\n }\n\n\n } while (whichShape < 1 || whichShape > 4);\n\n System.out.println(\"Do you want to build another Shape \\n [1] For yes \\n [2] For no\");\n tryAgain = newScan.nextInt();\n\n } while (tryAgain == 1);\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\r\n System.out.println(\"Enter a, b, c: \");\r\n int a = input.nextInt(), b = input.nextInt(), c = input.nextInt();\r\n\r\n // 创建对象+调用构造方法\r\n QuadraticEquation qe = new QuadraticEquation(a, b, c);\r\n\r\n // 获取判别式结果\r\n double judge = qe.getDiscriminant();\r\n\r\n if (judge > 1){\r\n System.out.printf(\"%.3f %.3f\\n\", qe.getRoot1(), qe.getRoot2());\r\n } else if (judge < 0.0001 && judge > -0.0001){\r\n System.out.printf(\"%.3f\\n\", qe.getRoot1());\r\n } else {\r\n System.out.printf(\"The equation has no roots\");\r\n }\r\n }",
"public void Calculation(){\n if(Symbol.equals(\"+\"))\n {\n AnswerHalf = AnswerHalf + ButtonValue;\n }\n else if(Symbol.equals(\"-\"))\n {\n AnswerHalf = AnswerHalf - ButtonValue;\n }\n else if(Symbol.equals(\"*\"))\n {\n AnswerHalf = AnswerHalf * ButtonValue;\n }\n else if(Symbol.equals(\"/\"))\n {\n AnswerHalf = AnswerHalf/ButtonValue;\n }\n printAnswer = Double.toString(AnswerHalf);\n AfterEqual = 1;\n SymbolMark = 0;\n c = 0;\n AfterAnswer = 0;\n TFCalcBox.setText(printAnswer);\n }",
"public void updateRoot(MachineState theState) {\n ;\n }",
"public static void main(String[] args) {\n Scanner scn =new Scanner(System.in);\n boolean b=true;\n while(b)\n {\n \n char ch=scn.next().charAt(0);\n \n if(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='%')\n {\n\t int N1 =scn.nextInt();\n\t int N2 =scn.nextInt();\n\t calculator(ch,N1,N2);\n }\n else if(ch!='X'&&ch=='x')\n\t {System.out.println(\"try again\");}\n else\n\tbreak;\n }\n }",
"public Type evaluateRootType() {\n\t\t\tNode parsedTreeNode = this.parsedTree.get(); // Gets the Node from the Optional\n //ensures that tree is valid before analyzing it\n if (TypeUtilities.isTreeValid(parsedTreeNode)) {\n \treturn traverseTree(parsedTreeNode);\n }\n throw new UndeterminableTypeException(\"Input Tree was Invalid.\");\n }",
"@Override\n public boolean shouldContinueSwitchedRootFound() {\n return false;\n }",
"static double sqrt(double number) {\n\t\tdouble answer = number / 2;\r\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative square roots\"); \r\n=======\n\tpublic static double sqrt(int number) { //gonna be honest here: idk??\r\n\t\tint div = number*number;\r\n\t\tif(number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no square roots of negative numbers\");\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\t}\r\n\t\twhile (((answer * answer) - number) >= .005 || ((answer * answer) - number) <= -.005) {\r\n\t\t\tanswer = 0.5 * (number / answer + answer);\r\n\t\t}\r\n\t\treturn round2(answer);\r\n\t}\r\n\t\r\n\tpublic static String quadForm(int a, int b, int c) { //need round2 so uhhhhh\r\n\t\tif(b == 0) {\r\n\t\t\tSystem.out.println(round2(c));\r\n\t\t}\r\n\r\n\t\tif(discriminant(a, b, c) == 0) {\r\n\t\t\treturn(\"Roots: \" + round2((b * -1) / (2 *a)));\t\r\n\t\t}\r\n\t\t\r\n\t\tif(discriminant(a, b, c) > 0) {\r\n\t\t\treturn(\"Roots: \" + round2(b * -1) + (sqrt(b * b - (4 * a * c))));\r\n\t\t}\r\n\t\t\r\n\t\treturn(\"no real roots\");\r\n\t}\r\n}",
"public boolean checkRoot() {\n\t\t\treturn (this.getParent().getHeight() == -1);\n\t\t}",
"public abstract void squareRootThis();",
"public static void squareRoot()\n\t{\n\t\tSystem.out.println(\"enter a non-negative number\");\n\t\tint c = scanner.nextInt();\n\t\tdouble epsilon = 1e-15; \n\t\tdouble t = c;\n\t\t\n\t\t while (Math.abs(t - c/t) > epsilon*t) \n\t\t\t{\n\t\t t = (c/t + t) / 2.0;\n\t\t } \n\t\tSystem.out.println(t);\n\t}",
"public boolean formResult()\r\n {\r\n if (operator.equals(\"+\") && validOperands())\r\n {\r\n add();\r\n }\r\n else if (operator.equals(\"-\") && validOperands())\r\n {\r\n subtract();\r\n }\r\n else if (operator.equals(\"\\u00D7\") && validOperands())\r\n {\r\n multiply();\r\n }\r\n else if (operator.equals(\"\\u00F7\") && validOperands())\r\n {\r\n String[] test = rightOperand.split(\"\\\\+|-\");\r\n \r\n if (test[0].equals(\"0\")) {\r\n clear();\r\n return false;\r\n }\r\n divide();\r\n }\r\n return true;\r\n }",
"public int display(){\n return display(root);\n\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Welcome to the calculator. What operation would you like to do?(+,-,*,/)\");\n\t\tString answer = input.next();\n\t\t\n\t\tif (answer.equals(\"add\") || answer.equals(\"Add\") || answer.equals(\"+\")) \n\t\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to add?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat add1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number you want to add\");\n\t\t\t\tfloat add2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat addanswer = add1 + add2;\n\t\t\t\tSystem.out.println(addanswer);\n\t\t\t\t}\n\t\telse if(answer.equals(\"minus\") || answer.equals(\"-\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to subtract?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat sub1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat sub2 = input.nextFloat();\n\t\t\t\t\t\n\t\t\t\tfloat subanswer = sub1 - sub2;\n\t\t\t\tSystem.out.println(subanswer);\n\t\t\t}\n\t\telse if(answer.equals(\"multiply\") || answer.equals(\"x\") || answer.equals(\"*\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to multiply?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat mul1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat mul2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat mulanswer = mul1 * mul2;\n\t\t\t\tSystem.out.println(mulanswer);\n\t\t\t}\n\t\telse if(answer.equals(\"divide\") || answer.equals(\"/\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to divide?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat div1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat div2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat divanswer = div1 / div2;\n\t\t\t\tSystem.out.println(divanswer);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please try again.\");\n\t\t\t}\n\t\tinput.close();\n\t\t}",
"public double cubeRoot(double n){\n //Create a variable \"n1\" which takes all value of n in the positive form\n double n1;\n if(n<0){\n n1 = n*-1;\n }\n else{\n n1 = n;\n }\n\n //Set start and end to the binary search\n double start = 0;\n double end = n1;\n\n //Set precision (error accepted)\n double e = 0.0000001;\n\n //find the cube root of n\n while(true){\n //Calculate root\n root = (start+end)/2;\n\n //Identify error\n double error = diff(n1,root);\n\n //if error is less than or equal to e, then root is our solution\n if(error<=e){\n //if n is negative then return neg mid\n if(n<0){\n root = (Math.round(root*100.0)/100.0)*-1;\n return root;\n }\n\n else{\n root = (Math.round(root*100.0)/100.0);\n return root;\n }\n\n }\n\n\n //if root*root*root is greater than n, then end = root, end the loop\n if ((root*root*root)>n1){\n end = root;\n }\n //if root*root*root is less than n, then start = root; keep searching from root to n\n if ((root*root*root)<n1){\n start = root;\n }\n }\n\n\n\n }",
"public boolean isValidateRoot()\r\n\t{\r\n\t\treturn(true);\r\n\t}",
"private void askUser(){\n\t\tprintln(\"Enter the values to compute Pythagorean Theorem: \");\n\t\tprint(\"a: \");\n\t\tint a = readInt();\n\t\tprint(\"b: \");\n\t\tint b = readInt();\n\t\tcomputePythagorean(a, b);\n\t}",
"public static void main(String[] args) \r\n {\r\n \tScanner input = new Scanner(System.in); \r\n \tSystem.out.println(\"Input your expression of fractions.\"); //prompts user input \r\n \tString inputString = input.nextLine();\r\n // TODO: Read the input from the user and call produceAnswer with an equation\r\n //user input\r\n \twhile (inputString.equals(\"quit\") == false) {\r\n \t\tString answer = produceAnswer(inputString);\r\n \t\tSystem.out.println(answer);\r\n \t\tSystem.out.println(\"Input your expression.\");\r\n \t\tinputString = input.nextLine(); \r\n \t}\r\n \tinput.close();\r\n }",
"public static void main(String[] args) {\n\t\trunTests();\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Hello, I am a calculator.\");\n\t\twhile(true){\n\t\t\tSystem.out.println(\" Please enter a math problem to begin.\");\n\t\t\tString formula = scan.nextLine();\n\t\t\tif (formula.toLowerCase().equals(\"stop\")) {\n\t\t\t\tSystem.out.println(\"Stopping\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(formula.equals(\"Exit\") || formula.equals(\"exit\")) {\n\t\t\t\tSystem.out.println(\"Exiting\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tCalculator calc = new Calculator();\n\t\t\tString result = calc.computeResult(formula);\n\t\t\tif(result == \"paren\"){\n\t\t\t\tSystem.out.println(\"You have unfinished parentheses. Please try your equation again\");\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint resultAsNum = Integer.parseInt(result);\n\t\t\t\tSystem.out.println(\"Result = \" + resultAsNum);\n\t\t\t}\n\t\t}\n\t}",
"public boolean isRoot(int numTokens) {\n return cat.equals(Rule.rootCat) && ((start == 0 && end == numTokens) || (start == -1));\n }",
"public static void main(String[] args){\n\t\tcreatetree t=new createtree();\n\t\tt.binaryinsert(10);\n\t\tt.binaryinsert(20);\n\t\tt.binaryinsert(40);\n\t\tboolean r=checkbalance(t.root);\n\t\tSystem.out.println(r);\n\t\n\t}",
"public static void main(String[] args) {\n \n Scanner myScanner; //declare scanner\n myScanner= new Scanner (System.in );\n System.out.print(\"Enter a double, and I print its cube root: \");//user inputs integer that they want to find cubed root of\n \n int x= myScanner.nextInt () ;\n \n double guess = x/3; //makes guess equal to the selected integer/3\n double guess1 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess2 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess3 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess4 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess5 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n \n \n //output\n System.out.println (\"The cube root is \"+guess5+\":\");\n System.out.println (guess5+\"*\"+guess5+\"*\"+guess5+\"= \"+(guess5*guess5*guess5));\n \n }",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tTreeNode root = new TreeNode(5);\n\t\troot.left = new TreeNode(3);\n\t\troot.right = new TreeNode(7);\n\t\tinOrder(root);\n\t\tSystem.out.println();\n\t\tsum(root);\n\t\tinOrder(root);\n\t}",
"public static void main(String[] args) {\n\n Scanner tc = new Scanner(System.in);\n\n double a, b, c = 0;\n String soma = \"+\";\n String subtração = \"-\";\n String multiplicação = \"*\";\n String divisão = \"/\";\n String potência = \"^\";\n String raiz = \"~\";\n String operação = \"\";\n System.out.println(\"Qual operação deseja fazer ?\");\n operação = tc.nextLine();\n System.out.println(\"insira um numero ó mortal\");\n a = tc.nextDouble();\n System.out.println(\"insira um numero ó mortal\");\n b = tc.nextDouble();\n ;\n if (operação == null ? soma == null : operação.equals(soma)) {\n c = a + b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? subtração == null : operação.equals(subtração)) {\n c = a - b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? multiplicação == null : operação.equals(multiplicação)) {\n c = a * b;\n System.out.println(\"o resultado é \" + c);\n }\n else \n c = a/b;\n \n System.out.println(\"o resultado é \" + c);\n }",
"public void work(RootNode root) throws Exception;",
"public static void main(String[] args) \r\n\t{\r\n\t\tSystem.out.println(squareRoot(90));\r\n\t\t\r\n\t\t\r\n\t}",
"public void go() {\n Counter counter = new Counter();\n UserInput userInput = new UserInput();\n System.out.println(\"Input the x: \");\n int x = userInput.lengthInput();\n mainLogger.info(\"The user has entered {} as x\", x);\n mainLogger.info(\"Answer of the equation is: {}\", counter.wholeAnswer(x));\n }",
"@Test\n public void test20() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n Complex complex1 = complex0.tan();\n Complex complex2 = complex0.log();\n Complex complex3 = complex2.atan();\n Complex complex4 = (Complex)complex2.readResolve();\n Complex complex5 = complex1.tan();\n Complex complex6 = complex0.atan();\n Complex complex7 = complex3.sin();\n Complex complex8 = complex0.negate();\n Complex complex9 = complex6.createComplex(2846.5, 0.0);\n Complex complex10 = complex0.add(complex1);\n Complex complex11 = complex1.sqrt1z();\n boolean boolean0 = complex6.equals(complex10);\n Complex complex12 = complex3.sqrt();\n double double0 = complex2.getArgument();\n Complex complex13 = complex1.sinh();\n try { \n complex9.nthRoot((-4646));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -4,646\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"private static double root( double A, double B, double C ) throws IllegalArgumentException {\n\t if (A == 0) {\n\t throw new IllegalArgumentException(\"A can't be zero.\");\n\t }\n\t else {\n\t double disc = B*B - 4*A*C;\n\t if (disc < 0)\n\t throw new IllegalArgumentException(\"Discriminant < zero.\");\n\t return (-B + Math.sqrt(disc)) / (2*A);\n\t }\n\t}",
"public static void main(String[] args) {\n\t Scanner s = new Scanner(System.in);\n \tSystem.out.println(\"Welcome to the Frac Calc Calculator\");\n \tSystem.out.print(\"Enter an expression: \");\n \tString expression = s.nextLine();\n \twhile(!expression.equalsIgnoreCase(\"quit\")) {\n \tSystem.out.println(produceAnswer(expression));\n \tSystem.out.print(\"Enter an expression: \");\n \texpression = s.nextLine();\n \t}\n\n }",
"@Test\n public void test2DigitalRootMethod() {\n final int expected = 6;\n final int number = 942;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public void checkTree() {\r\n checkTreeFromNode(treeRoot);\r\n }",
"public abstract boolean isRoot(Position<E> p);",
"private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }",
"amdocs.iam.pd.webservices.productrelations.checkproducteligibilityoutput.CheckProductEligibilityOutput addNewROOT();",
"@Test\n public void test3DigitalRootMethod() {\n final int expected = 6;\n final int number = 132189;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"private boolean SetRootOfSynset() {\t\t\r\n\t\tthis.roots = new ArrayList<ISynsetID>();\r\n\t\tISynset\tsynset = null;\r\n\t\tIterator<ISynset> iterator = null;\r\n\t\tList<ISynsetID> hypernyms =\tnull;\r\n\t\tList<ISynsetID>\thypernym_instances = null;\r\n\t\titerator = dict.getSynsetIterator(POS.NOUN);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\titerator = this.dict.getSynsetIterator(POS.VERB);\r\n\t\twhile(iterator.hasNext())\r\n\t\t{\r\n\t\t\tsynset = iterator.next();\r\n \t\t\thypernyms =\tsynset.getRelatedSynsets(Pointer.HYPERNYM);\t\t\t\t\t// !!! if any of these point back (up) to synset then we have an inf. loop !!!\r\n \t\t\thypernym_instances = synset.getRelatedSynsets(Pointer.HYPERNYM_INSTANCE);\r\n \t\t\tif(hypernyms.isEmpty() && hypernym_instances.isEmpty())\r\n \t\t\t{\r\n\t\t\t\tthis.roots.add(synset.getID());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( this.roots.size() > 0 );\r\n\t}",
"private void promptForLatitude()\n {\n boolean success = false;\n\n while (!success) {\n try {\n // display user prompt\n System.out.println(\"\");\n System.out.println(\"Please enter the latitude (in degrees) for your location:\");\n String latitudeString = System.console().readLine();\n latitude = Double.parseDouble(latitudeString);\n success = true;\n } catch (Exception ex) {\n System.err.println(\"***************************************************\");\n System.err.println(\"[ERROR] Invalid latitude entry. Please try again.\");\n System.err.println(\"***************************************************\");\n success = false;\n }\n }\n }",
"public String generateRootResult()\n\t{\n\t\tString result = \"\";\n\t\tresult = result + rootWord + \" \";\n\n\t\treturn result;\n\t}",
"@Test\n public void test4DigitalRootMethod() {\n final int expected = 2;\n final int number = 493193;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"static double root(double x, int n) {\n double err = Double.MAX_VALUE;\n\n double l = 1;\n double r = x;\n\n if (x >= 0 && x <= 1){\n l = x;\n r = 1;\n }\n\n double cur = (l + r)/2;\n\n while (err > OK_ERROR) {\n\n\n double powerNum = Math.pow(cur, n);\n\n err = Math.abs(powerNum - x);\n\n if (powerNum > x) {\n r = cur;\n } else {\n l = cur;\n }\n\n cur = (l + r)/2;\n }\n\n return cur;\n }",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);//true\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n\n // 1\n // / \\\n // 2 2\n // / \\\n // 3 3\n // / /\n // 4 4\n TreeNode root2 = new TreeNode(1);//false\n root2.left = new TreeNode(2);\n root2.right = new TreeNode(2);\n root2.left.left = new TreeNode(3);\n root2.right.right = new TreeNode(3);\n root2.left.left.left = new TreeNode(4);\n root2.right.right.left = new TreeNode(4);\n System.out.println(new Solution().isBalanced(root2));\n }",
"public int calculate() {\n \ttraversal(root);\n \tif(!calResult.isEmpty()){\n \t\tint answer = Integer.parseInt(calResult.pop());\n \t\treturn answer;\n \t}\n return 0;\n }",
"public void buildTree() throws RuntimeException, DivideByZero {\r\n // define local variable to count number of times an operator \r\n // is pushed into it's associated stack. This will be use to \r\n // count register values\r\n int i = 0;\r\n\r\n // split postfix expression enterend into the textbox into tokens using \r\n // StringTokenizer. Delimeters are used so that different inputs \r\n // can be parsed without spaces being necessary \r\n StringTokenizer token = new StringTokenizer(inputExpression, \" */+-\", true);\r\n\r\n // while loop to build tree out of the postfix expression\r\n while (token.hasMoreTokens()) {\r\n // get the next token in series\r\n String nextItem = token.nextToken();\r\n\r\n // use selection statements to determine if the next token\r\n // in the String is an operand, operator, or unknown\r\n if (nextItem.matches(\"[0-9]+\")) {\r\n // push operand to associated stack\r\n operandStk.push(nextItem);\r\n \r\n // push operand to AssemblyCode class\r\n assemblyCode.pushStack(nextItem);\r\n\r\n } else if (nextItem.equals(\"*\") || nextItem.equals(\"/\")\r\n || nextItem.equals(\"+\") || nextItem.equals(\"-\")) {\r\n // push current operator to operators stack\r\n operatorStk.push(nextItem);\r\n // call the getNodes() method to perform operation\r\n getNodes(i);\r\n // count each time an operator is pushed so registers can be counted\r\n i++;\r\n } else if (!nextItem.equals(\" \")){ \r\n // set class variable to equal invalid character\r\n invalidToken = nextItem; \r\n // throw exception if illegal operator or operand is parsed\r\n throw new RuntimeException();\r\n }\r\n } // end while loop\r\n }",
"public static void checkFromUser() {\n\t\tif (askUser(\"Please type y to execute program and any other key to stop\").contentEquals(\"y\")) {\n\t\t\tSystem.out.println(\"Continuing\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Terminating program\");\n\t\t\tSystem.exit(0); \n\t\t}\n\t\tSystem.out.println(\"Calculating the greatest house income, the greatest income after expenditure and greatest savings from the given 3 families\");\n\t}",
"public void calculate() {\n\n InputHelper inputHelper = new InputHelper();\n String firstNumber = inputHelper.getInput(\"Write first number: \");\n String secondNumber = inputHelper.getInput(\"Write second number: \");\n String action = inputHelper.getInput(\"What action you want to do ( + - * /): \");\n\n while (!firstNumber.equals(\"0\") || !secondNumber.equals(\"0\") || !action.equals(\"0\")) {\n try {\n switch (action) {\n case \"+\":\n System.out.println(\"The result is: \" + (Double.valueOf(firstNumber) + Double.valueOf(secondNumber)));\n break;\n case \"-\":\n System.out.println(\"The result is: \" + (Double.valueOf(firstNumber) - Double.valueOf(secondNumber)));\n break;\n case \"*\":\n System.out.println(\"The result is: \" + (Double.valueOf(firstNumber) * Double.valueOf(secondNumber)));\n break;\n case \"/\":\n System.out.println(\"The result is: \" + (Double.valueOf(firstNumber) / Double.valueOf(secondNumber)));\n break;\n default:\n System.out.println(\"You've entered a wrong action!\");\n }\n } catch (NumberFormatException e) {\n System.out.println(\"You've entered not a number!\");\n }\n\n firstNumber = inputHelper.getInput(\"Write first number: \");\n secondNumber = inputHelper.getInput(\"Write second number: \");\n action = inputHelper.getInput(\"What action you want to do ( + - * /): \");\n\n }\n }",
"static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}",
"public static void main(String[] args) {\r\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\t//welcomes user to the math tutor\r\n\t\tSystem.out.println(\"Hi, I am Pi, your personal math tutor. Today we will be practicing basic arthmetics\");\r\n\t\tSystem.out.println(\"What is your name?\");\r\n\t\tString name = sc.nextLine();\r\n\r\n\t\t//generates the numbers\r\n\t\tint firstDigit = (int)(Math.random()*10)+1;\r\n\t\tint secondDigit = (int)(Math.random()*10)+1;\r\n\t\tint operator = (int)(Math.random()*4)+1;\r\n\t\tdouble answer;\r\n\r\n\t\t//assigns operator\r\n\t\tswitch (operator) \r\n\t\t{ \r\n\t\tcase 1: System.out.println(name + \" What is \" + firstDigit + \"+\" + secondDigit + \"?\");\r\n\t\t\tdouble userAnswerA = sc.nextInt();\r\n\t\t\tdouble correctAnswerA = firstDigit + secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerA == correctAnswerA)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerA + \".\");\r\n\t\tbreak;\r\n\r\n\t\tcase 2: System.out.println(name + \" What is \" + firstDigit + \"-\" + secondDigit + \"?\"); \r\n\t\t\tdouble userAnswerS = sc.nextInt();\r\n\t\t\tdouble correctAnswerS = firstDigit - secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerS == correctAnswerS)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerS + \".\");\r\n\t\tbreak;\r\n\r\n\t\tcase 3: System.out.println(name + \" What is \" + firstDigit + \"/\" + secondDigit + \"?\"); \r\n\t\t\tdouble userAnswerD = sc.nextInt();\r\n\t\t\tdouble correctAnswerD = firstDigit / secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerD == correctAnswerD)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerD + \".\");\r\n\t\tbreak;\r\n\t\tcase 4: System.out.println(name + \" What is \" + firstDigit + \"*\" + secondDigit + \"?\");\r\n\t\t\tdouble userAnswerM = sc.nextInt();\r\n\t\t\tdouble correctAnswerM = firstDigit * secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerM == correctAnswerM)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerM + \".\");\r\n\t\tbreak;\r\n\t\t}\r\n\r\n\r\n\r\n\t}",
"public static void main(String[] args) {\n\n\t\t// initiating the scanner\n\t\tScanner operation = new Scanner(System.in);\n\n\t\t// creating object for calc\n\t\tCalc calc = new Calc();\n\t\tboolean isProceed = true;\n\t\twhile (isProceed) {\n\t\t\t// getting the first variable value\n\t\t\tSystem.out.println(\"Enter an integer\");\n\t\t\tint a = operation.nextInt();\n\t\t\tcalc.setA(a);\n\n\t\t\t// getting the second variable value\n\t\t\tSystem.out.println(\"Enter next integer\");\n\t\t\tint b = operation.nextInt();\n\t\t\tcalc.setB(b);\n\n\t\t\t// getting the operator value\n\t\t\tSystem.out.println(\"Enter type of operation. It should be only + or - or * or /\");\n\t\t\tString c = operation.next();\n\n\t\t\tswitch (c) {\n\t\t\tcase \"+\":\n\t\t\t\tcalc.add(a, b);\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tcalc.sub();\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tcalc.mult();\n\t\t\t\tbreak;\n\t\t\tcase \"/\":\n\t\t\t\tcalc.div();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"No operation is matching. Please reenter values\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.println(\" \");\n\t\t\t\n\t\t\t// getting user consent to proceed\n\t\t\tSystem.out.println(\"You want to make an other calculation ? Y / N\");\n\t\t\tString proceedBool = operation.next();\n\t\t\tif(proceedBool.equalsIgnoreCase(\"y\")) {\n\t\t\t\tisProceed = true;\n\t\t\t} else {\n\t\t\t\tisProceed = false;\n\t\t\t}\n\t\t}\n\t}",
"public double getSpecificRootLength() {return specificRootLength;}",
"@Test\n \tpublic void whereClauseForNodeRoot() {\n \t\tnode23.setRoot(true);\n \t\tcheckWhereCondition(\"_rank23.root IS TRUE\");\n \t}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tSystem.out.println(\"Enter the numbers you want to add to Splay Tree. Press any alphabet once you are done inputting the numbers. The tree will be print in PreOrderTraversal after every insert\");\n\n\t\tScanner input = new Scanner(System.in);\n\t\tSplayTreeMain sTree=null;\n\t\twhile(input.hasNextInt())\n\t\t{\n\t\t\tif(sTree == null)\n\t\t\t{\n\t\t\t\tsTree = new SplayTreeMain();\n\t\t\t}\n\t\t\tsTree.add(input.nextInt());\n\t\t\tSystem.out.println(sTree);\n\t\t}\n\n\t\tSystem.out.println(\"Please enter the menu options listed i.e numbers 1 for add, 2 for remove, 3 for find, 4 for leafcount, 5 for leafSum, 6 for preOrderTraversal, 7 for exit\");\n\t\tString skipString = input.next();\n\t\twhile(input.hasNextInt())\n\t\t{\n\t\t\tint menuOption = input.nextInt();\n\n\t\t\tif(menuOption== 1)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the add operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.add(a);\n\t\t\t\tSystem.out.println(\"Tree after the add operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 2)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number you want to be removed\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the remove operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.remove(a);\n\t\t\t\tSystem.out.println(\"Tree after the remove operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 3)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Enter the number you want to be checked for its existence\");\n\t\t\t\tint a = input.nextInt();\n\t\t\t\t//int b = input.nextInt();\n\t\t\t\tSystem.out.println(\"Tree before the find operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t\tsTree.find(a);\n\t\t\t\tSystem.out.println(\"Tree after the find operation\");\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption== 4)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Leaf count of the tree is \"+sTree.leafCount());\n\t\t\t}\n\t\t\telse if(menuOption == 5)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Leaf sum of the tree is \"+sTree.leafSum());\n\t\t\t}\n\t\t\telse if(menuOption == 6)\n\t\t\t{\n\t\t\t\tSystem.out.println(sTree);\n\t\t\t}\n\t\t\telse if(menuOption == 7)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Thank You, Have a great day!!\");\n\t\t\t\tinput.close();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println(\"Please enter the menu options listed i.e numbers 1 for add, 2 for remove, 3 for find, 4 for leafcount, 5 for leafSum, 6 for preOrderTraversal, 7 for exit\");\n\n\t\t}\n\n\t}",
"@Test\n public void test16() throws Throwable {\n Complex complex0 = new Complex(0.0, 236.4);\n Complex complex1 = complex0.asin();\n Complex complex2 = complex1.atan();\n Complex complex3 = complex0.sin();\n Complex complex4 = (Complex)complex0.readResolve();\n double double0 = complex0.abs();\n Complex complex5 = complex0.log();\n Complex complex6 = complex1.sin();\n Complex complex7 = complex0.cos();\n String string0 = complex3.toString();\n Complex complex8 = complex1.multiply(complex2);\n try { \n complex3.nthRoot((-1));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -1\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static void main(String[] args) {\n intro();\n Scanner input = new Scanner(System.in);\n while( exit != true) {\n System.out.println(\"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\");\n System.out.print(\"Please enter an operation ( +, -, /, *, = or Q to quit.) : \");\n String operator = input.nextLine();\n operator = getOperation(operator);\n if (operator.equals(\"Q\") || operator.equals(\"q\")) {\n exit = true;\n break;\n }\n int flag;\n if (operator.equals(\"+\")) {\n flag = 1;\n }\n else if (operator.equals(\"-\")) {\n flag = 2;\n }\n else if (operator.equals(\"/\")) {\n flag = 3;\n }\n else if (operator.equals(\"*\")) {\n flag = 4;\n }\n else {\n flag = 5;\n }\n System.out.print(\"Please enter a fraction (a/b) or integer (a): \");\n String fr1 = input.nextLine();\n Fraction f1 = getFraaction(fr1);\n System.out.print(\"Please enter a fraction (a/b) or integer (a): \");\n String fr2 = input.nextLine();\n Fraction f2 = getFraaction(fr2);\n Fraction fr3;\n switch (flag) {\n case 1: {\n fr3 = f1.add(f2);\n System.out.println(fr1.toString() + \" \" + operator + \" \" + fr2.toString() + \" = \" + fr3.toString());\n break;\n }\n case 2: {\n fr3 = f1.subtract(f2);\n System.out.println(fr1.toString() + \" \" + operator + \" \" + fr2.toString() + \" = \" + fr3.toString());\n break;\n }\n case 3: {\n fr3 = f1.divide(f2);\n System.out.println(fr1.toString() + \" \" + operator + \" \" + fr2.toString() + \" = \" + fr3.toString());\n break;\n }\n case 4: {\n fr3 = f1.multiply(f2);\n System.out.println(fr1.toString() + \" \" + operator + \" \" + fr2.toString() + \" = \" + fr3.toString());\n break;\n }\n case 5: {\n boolean bol = f1.equals(f2);\n System.out.println(fr1.toString() + \" \" + operator + \" \" + fr2.toString() + \" is \" + bol);\n break;\n }\n }\n }\n\n }",
"@Test\n public void test36() throws Throwable {\n Complex complex0 = new Complex((-699.847402808), (-699.847402808));\n Complex complex1 = complex0.tanh();\n Complex complex2 = complex1.sqrt1z();\n Complex complex3 = complex0.tanh();\n Complex complex4 = complex0.sin();\n int int0 = complex0.hashCode();\n Complex complex5 = complex1.exp();\n boolean boolean0 = complex1.equals(complex1);\n Complex complex6 = complex1.log();\n Complex complex7 = complex6.add(complex0);\n double double0 = complex7.getArgument();\n Complex complex8 = complex1.atan();\n Complex complex9 = complex0.cosh();\n Complex complex10 = complex7.subtract(complex1);\n Complex complex11 = complex8.conjugate();\n Complex complex12 = complex7.add(complex0);\n double double1 = complex0.abs();\n Complex complex13 = complex7.multiply(0.0);\n Complex complex14 = complex11.multiply(complex13);\n Complex complex15 = complex11.sqrt1z();\n Complex complex16 = complex8.tan();\n double double2 = complex12.getArgument();\n Complex complex17 = complex0.divide(complex12);\n try { \n complex12.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public void refresh()\n\t{\n\t\tnum1 = -1;\n\t\tnum2 = -1;\n\t\tnum3 = -1;\n\t\tnum1Label.setText(\"\");\n\t\tnum2Label.setText(\"\");\n\t\tnum3Label.setText(\"\");\n\t\t\n\t\tcheckEquationButton.setEnabled(false);\n\t\t\n\t\toperationSign = getOperation(levelChosen);\n\t\t\n\t\t//Choosing the number range for each level\n\t\tfor(int i = 0; i < 9; i++)\n\t\t{\n\t\t\tif(levelChosen == 0 || levelChosen == 1 || levelChosen == 3)\n\t\t\t{\n\t\t\t\trandomNumList[i] = getRandomNum(1,9);\n\t\t\t}// end if\n\t\t\telse if(levelChosen == 2)\n\t\t\t{\n\t\t\t\trandomNumList[i] = getRandomNum(1,12);\n\t\t\t}// end else if\n\t\t}\n\t\t\n\t\toperationLabel.setText(\"\"+operationSign (operationSign));\n\t\t\n\t\t//Randomly picks three numbers that are different from each other to use to make a viable equation\n\t\tint temp = getRandomNum(0,8);\n\t\tint temp2 = getRandomNum(0,8);\n\t\tint temp3 = getRandomNum(0,8);\n\t\twhile(temp == temp2)\n\t\t{\n\t\t\ttemp2 = getRandomNum(0,8);\n\t\t}// end while loop\n\t\t\n\t\twhile(temp2 == temp3)\n\t\t{\n\t\t\ttemp3 = getRandomNum(0,8);\n\t\t}// end while loop\n\t\t\n\t\t// will make sure there will be at least one viable equation\n\t\tswitch (operationSign)\n\t\t{\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\trandomNumList[temp] = randomNumList[temp2] + randomNumList[temp3];\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\trandomNumList[temp] = randomNumList[temp2] * randomNumList[temp3];\n\t\t}// end case statements\n\t\t\n\t\tfor(int i = 0; i < 9; i++)\n\t\t{\n\t\t\tinitButton(i);\n\t\t}//end for \n\t}",
"public static double calcRoot( double coef_B, double discrimSqrt, double denom ) \r\n {\n return 0;\r\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tfloat a, b, c;\r\n\t\tSystem.out.println(\"Fill a, b, c: \");\r\n\t\ta = sc.nextFloat();\r\n\t\tb = sc.nextFloat();\r\n\t\tc = sc.nextFloat();\r\n\t\tfloat delta = (float) (Math.pow(b, 2) - 4 * a * c);\r\n\t\tif (delta < 0) {\r\n\t\t\tSystem.out.println(\"The equation has no solution!\");\r\n\t\t} else {\r\n\t\t\tif (delta == 0) {\r\n\t\t\t\tfloat x = -b / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution x = \" + x);\r\n\t\t\t} else {\r\n\t\t\t\tdouble x1 = (-b - Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tdouble x2 = (-b + Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution X1 = \" + x1);\r\n\t\t\t\tSystem.out.println(\"Solution X2 = \" + x2);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public void execute() throws XMLBuildException {\r\n\t\tlog.debug(\"ROOT EXECUTE g is a \" + root.getClass().getName());\r\n\t\tif (root != null) {\r\n\t\t\tlog.debug(\"root not null \");\r\n\t\t\t//root.execute();\r\n\t\t\tlog.debug(\"done execute\");\r\n\t\t} else {\r\n log.error(\"root null\", new Exception());\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n if (args.length > 0) {\r\n input = args[0];\r\n inputl = input.length() - 1;\r\n }\r\n \r\n mbt(new Node(input.charAt(inputl)));\r\n System.out.print(inorder(root));\r\n System.out.print(\"=\" + calculate(root));\r\n \r\n javax.swing.SwingUtilities.invokeLater(new Runnable() {\r\n public void run() {\r\n GUI.createAndShowGUI();\r\n }\r\n });\r\n }",
"public static void main(String[] args) {\n \n Scanner myScanner;\n myScanner = new Scanner( System.in);\n System.out.print(\n \"Enter the number you would like cubed : \");\n \n //Accept user input\n \n double x = myScanner.nextDouble();\n \n //Random guess that the root is x/3\n \n double guess=x/3;\n \n //First guess\n double guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n //Second guess\n guess=(2*guess1*guess1*guess1+x)/(3*guess1*guess1);\n \n //third guess\n guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n //fourth guess\n guess=(2*guess1*guess1*guess1+x)/(3*guess1*guess1);\n \n //fifth guess\n guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n \n System.out.print(\"The cube root is \"+(guess)+\" \");\n \n \n }",
"public void startCalc(View v){\n\t\tdouble v1, v2, v3, v4;\n\t\t\n\t\t//Reset any non-inputted strings to 0.0, get varNum\n\t\tstringToZero();\n\t\t\n\t\t//If user input numbers for all boxes, jump out\n\t\tif(varNum == 0)\n\t\t\treturn;\n\t\t\n\t\t//Gathering all variables\n\t\ttry{\n\t\t\t\n\t\t\tv1 = Double.parseDouble(var1.getText().toString());\n\t\t\tv2 = Double.parseDouble(var2.getText().toString());\n\t\t\tv3 = Double.parseDouble(var3.getText().toString());\n\t\t\tv4 = Double.parseDouble(var4.getText() .toString());\n\t\t\t\n\t\t} catch(NumberFormatException e){\n\t\t\t//Builds and displays a dialog\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setMessage(\"You did not enter a number in one of the text fields\");\n\t\t builder.setTitle(\"Error\");\n\t\t \n\t\t AlertDialog dialog = builder.create();\n\t\t dialog.show();\n\t\t \n\t\t //Clean up solved variable text box\n\t\t\tif(varNum == 1)\n\t\t\t\t((TextView)findViewById(R.id.varfield1)).setText(\"\");\n\t\t\telse if(varNum == 2)\n\t\t\t\t((TextView)findViewById(R.id.varfield2)).setText(\"\");\n\t\t\telse if(varNum == 3)\n\t\t\t\t((TextView)findViewById(R.id.varfield3)).setText(\"\");\n\t\t\telse if(varNum == 4)\n\t\t\t\t((TextView)findViewById(R.id.varfield4)).setText(\"\");\n\t\t return;\n\t\t}\n\t\t\n\t\t//Use CalcSelector class\n\t\tString result = CalcSelector.calc(v1, v2, v3, v4, eqNum, varNum);\n\t\t\n\t\t//Fix divide by zero weirdness\n\t\tif(result.equals(\"NaN\")){\n\t\t\t\n\t\t\t//Builds and displays a dialog\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setMessage(\"Uh-Oh you divided by zero! Check your input again.\");\n\t\t builder.setTitle(\"Error\");\n\t\t \n\t\t AlertDialog dialog = builder.create();\n\t\t dialog.show();\n\t\t \n\t\t //Set answer and units to 0 and N/A\n\t\t\t((TextView)findViewById(R.id.ans)).setText(\"0\");\n\t\t\t((TextView)findViewById(R.id.units)).setText(\"N/A\");\n\t\t}\n\t\telse{\n\t\t\t//Set answer and Units\n\t\t\t((TextView)findViewById(R.id.ans)).setText(result);\n\t\t\t((TextView)findViewById(R.id.units)).setText(CalcSelector.getUnits());\n\t\t\t\n\t\t\t//Clean up solved variable text box\n\t\t\tif(varNum == 1)\n\t\t\t\t((TextView)findViewById(R.id.varfield1)).setText(\"\");\n\t\t\telse if(varNum == 2)\n\t\t\t\t((TextView)findViewById(R.id.varfield2)).setText(\"\");\n\t\t\telse if(varNum == 3)\n\t\t\t\t((TextView)findViewById(R.id.varfield3)).setText(\"\");\n\t\t\telse if(varNum == 4)\n\t\t\t\t((TextView)findViewById(R.id.varfield4)).setText(\"\");\n\t\t}\n\t}"
]
| [
"0.7144431",
"0.6252229",
"0.61956704",
"0.6071576",
"0.57352924",
"0.5667315",
"0.5609237",
"0.5605483",
"0.551991",
"0.5444036",
"0.53955245",
"0.5377315",
"0.5363388",
"0.5356632",
"0.5340301",
"0.5253022",
"0.52474624",
"0.51988876",
"0.5179596",
"0.5155445",
"0.51523596",
"0.5149328",
"0.5139244",
"0.5130967",
"0.5128164",
"0.51256776",
"0.51229966",
"0.5121398",
"0.5112948",
"0.5109059",
"0.5102123",
"0.50831395",
"0.50820243",
"0.5075877",
"0.5074943",
"0.5069561",
"0.5068056",
"0.50581765",
"0.50309074",
"0.49991176",
"0.4988698",
"0.49880508",
"0.4986395",
"0.4984588",
"0.4972009",
"0.49706408",
"0.49604207",
"0.49603143",
"0.4944108",
"0.49390674",
"0.4937976",
"0.49379396",
"0.4932001",
"0.49267253",
"0.49106064",
"0.49083918",
"0.49067673",
"0.4899959",
"0.48979548",
"0.4890711",
"0.48900825",
"0.48796806",
"0.48736113",
"0.48590603",
"0.48417756",
"0.4839809",
"0.48334393",
"0.48304483",
"0.48297286",
"0.4821433",
"0.48176852",
"0.4815966",
"0.48091042",
"0.48069426",
"0.4802576",
"0.4802564",
"0.48006204",
"0.47972283",
"0.4792683",
"0.47880045",
"0.4770384",
"0.47696277",
"0.47676462",
"0.47645247",
"0.47639972",
"0.47627088",
"0.47606897",
"0.47522882",
"0.47518906",
"0.47428778",
"0.47411594",
"0.47384757",
"0.47233132",
"0.47172162",
"0.47169077",
"0.4711367",
"0.47076753",
"0.47028762",
"0.4702055",
"0.4700668"
]
| 0.6725839 | 1 |
Calculates the root based on the user inputs and prints out the root value if no exceptions are thrown | private static void calculateRoot() throws IllegalArgumentException {
double[] userInputs = getInputs();
double value = Main.root(userInputs[0], userInputs[1], userInputs[2]);
System.out.println("The root value is: " + value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n double a = scanner.nextDouble();\n double b = scanner.nextDouble();\n double c = scanner.nextDouble();\n\n double determinant = b * b - 4 * a * c;\n\n double root1;\n double root2;\n\n\n\n // two real and distinct roots\n root1 = (-b + Math.sqrt(determinant)) / (2 * a);\n root2 = (-b - Math.sqrt(determinant)) / (2 * a);\n\n if (root2 < root1) {\n System.out.println(root2 + \" \" + root1);\n } else {\n System.out.println(root1 + \" \" + root2);\n }\n\n\n\n }",
"private void squareRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.squareRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}",
"public static void main(String[] args) {\n int r1 = 45_000; // a root ~45,000 means c is ~2,000,000,000, which is close to the maximum integer 2^31 - 1\n int r2 = -45_000;\n System.out.println(\"For the equation x^2 - 4x + 3 = 0, the possible solutions are:\");\n Set<Integer> result = roots(1, -r1-r2, r1*r2);\n System.out.println(result);\n }",
"public static void main(String args[]) {\n\t\t\n\t\t//declare the variables of equation ax*x + b*x + c = 0 \n\t\tdouble a,b,c;\n\t\t\n\t\t//define scanner variable x as\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\t//initiate the value to command line input\n\t\tSystem.out.println (\"give value of x^2 coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\ta = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of x coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\tb = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of contant\");\n\t\t\n\t\t//now add input to variable a \n\t\tc = scan.nextDouble();\n \n //declare discriminant of the equation as b^2 - 4*a*c\n double d = Math.pow(b, 2.0) - 4.0*a*c;\n \n //apply the rules for quadratic equations\n //if d =0.0 then roots are equal\n if (d == 0.0) {\n \t\n \t//the root in these situation is -b/2a\n \tSystem.out.println(\"the equation has \"+(-1.0*b/(2.0*a)) + \" as only real root\");\n }\n else if (d >=0.0) {\n \t\n \t//the root in this situation is (-b +- d^0.5)/2a\n \t//the first root is x1\n \tdouble x1 = (-1.0*b + Math.pow(d, 0.5))/(2.0*a);\n \t\n \t//the second root is x2\n \tdouble x2 = (-1.0*b - Math.pow(d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(x1) + \" and \"+(x2) +\" as two real roots\");\n }\n else {\n \t\n \t//the root in this situation are complex (-b +- d^0.5i)/2a\n \t//the real part of root is r\n \tdouble real = (-1.0*b)/(2.0*a);\n \t\n \t//the complex part of root is c\n \tdouble com = (Math.pow(-1.0*d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(real) + \"+\"+(com) +\"i and \"+real+\"-\"+com+\"i as two complex root\" );\n }\n\t}",
"private void sqrtOperands() {\n\t\tif (text_Operand1.getText().isEmpty()) {\n\t\t\ttext_Operand3.setText(\"5\");\n\t\t}\n\t\tif (unaryOperandIssues())\n\t\t\treturn;\n\n\t\tif (text_Operand1.getText() != \"\")\n\t\t\tif (text_Operand1.getText().charAt(0) == '-') {\n\t\t\t\tlabel_errOperand1.setText(\"Negative Input not Allowed\");\n\t\t\t\ttext_Result.setText(\"\");\n\t\t\t\ttext_Resulterr.setText(\"\");\n\t\t\t\tlabel_Result.setText(\"\");\n\t\t\t\tlabel_errResult.setText(\"\");\n\t\t\t\treturn;\n\t\t\t}\n\t\tif (text_Operand1.getText().isEmpty()) {\n\t\t\ttext_Operand1.setText(\"0.0\");\n\t\t}\n\t\t// Check to see if both operands are defined and valid\n\n\t\t// Check to see if both operands are defined and valid\n\t\t// without doing the computation\n\n\t\tif (text_Operand2.getLength() != 0) {\n\t\t\ttext_Operand2.setText(\"\");\n\t\t\tlabel_errOperand2.setText(\"Second Input not Required.\");\n\t\t}\n\t\tif (text_Operand4.getLength() != 0) {\n\t\t\ttext_Operand4.setText(\"\");\n\t\t\tlabel_errOperand4.setText(\"Second Input not Required.\");\n\n\t\t}\n\n\t\t// If the operands are defined and valid, request the business logic method to\n\t\t// do the Square Root and return the\n\t\t// result as a String. If there is a problem with the actual computation, an\n\t\t// empty string is returned\n\t\tString theAnswer = perform.squareroot(); // Call the business logic Root method\n\t\tlabel_errResult.setText(\"\"); // Reset any result error messages from before\n\t\tString theAnswer1 = perform.squareroot1(); // Call the business logic Square Root method\n\t\tlabel_errResulterr.setText(\"\"); // Reset any result error messages from before\n\t\tif (theAnswer.length() > 0 || theAnswer1.length() > 0) { // Check the returned String to see if it is okay\n\t\t\ttext_Result.setText(theAnswer); // If okay, display it in the result field and\n\t\t\tlabel_Result.setText(\"Square Root\"); // change the title of the field to \"Square Root\".\n\t\t\tlabel_Result.setLayoutX(40);\n\t\t\tlabel_Result.setLayoutY(345);\n\t\t\ttext_Resulterr.setText(theAnswer1); // If okay, display it in the result field and\n\t\t\tcomboBoxRes.getSelectionModel().select(\"\\u221A\" + comboBox1.getSelectionModel().getSelectedItem());\n\t\t\t// change the title of the field to \"Square Root\"\n\t\t} else { // Some error occurred while doing the Square Root.\n\t\t\ttext_Result.setText(\"\"); // Do not display a result if there is an error.\n\t\t\tlabel_Result.setText(\"Result\"); // Reset the result label if there is an error.\n\t\t\tlabel_errResult.setText(perform.getResultErrorMessage()); // Display the error message.\n\t\t\ttext_Resulterr.setText(\"\"); // Do not display a result if there is an error.\n\t\t\t// Reset the result label if there is an error.\n\t\t\tlabel_errResulterr.setText(perform.getResulterrErrorMessage()); // Display the error message.\n\t\t}\n\t}",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int[] numbers = new int [5];\n\n for (int i = 0; i < 5; i ++) {\n System.out.print(i+1 + \". \");\n numbers[i]=input.nextInt();\n }\n for(int num : numbers){\n int rootNumber = num / num;\n System.out.println(rootNumber + \"\\t\");\n }\n }",
"public static void main(String[] args) {\n \n Scanner myScanner; //declare scanner\n myScanner= new Scanner (System.in );\n System.out.print(\"Enter a double, and I print its cube root: \");//user inputs integer that they want to find cubed root of\n \n int x= myScanner.nextInt () ;\n \n double guess = x/3; //makes guess equal to the selected integer/3\n double guess1 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess2 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess3 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess4 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n double guess5 = (guess*guess*guess+x)/(3*guess*guess);//reassigns value to guess\n \n \n //output\n System.out.println (\"The cube root is \"+guess5+\":\");\n System.out.println (guess5+\"*\"+guess5+\"*\"+guess5+\"= \"+(guess5*guess5*guess5));\n \n }",
"private static void executeProgram() throws IllegalArgumentException {\n\t\twhile(true) {\n\t\t\tcalculateRoot();\n\t\t\tsc = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Do you want to enter another equation? :\");\n\t\t\tString answer = sc.next();\n\t\t\tif(answer.equalsIgnoreCase(\"no\")) {\n\t\t\t\tSystem.out.println(\"Good bye!!!\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"static double root(double x, int n) {\n double err = Double.MAX_VALUE;\n\n double l = 1;\n double r = x;\n\n if (x >= 0 && x <= 1){\n l = x;\n r = 1;\n }\n\n double cur = (l + r)/2;\n\n while (err > OK_ERROR) {\n\n\n double powerNum = Math.pow(cur, n);\n\n err = Math.abs(powerNum - x);\n\n if (powerNum > x) {\n r = cur;\n } else {\n l = cur;\n }\n\n cur = (l + r)/2;\n }\n\n return cur;\n }",
"private void cubeRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.cubeRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}",
"public static void squareRoot()\n\t{\n\t\tSystem.out.println(\"enter a non-negative number\");\n\t\tint c = scanner.nextInt();\n\t\tdouble epsilon = 1e-15; \n\t\tdouble t = c;\n\t\t\n\t\t while (Math.abs(t - c/t) > epsilon*t) \n\t\t\t{\n\t\t t = (c/t + t) / 2.0;\n\t\t } \n\t\tSystem.out.println(t);\n\t}",
"private static double root( double A, double B, double C ) throws IllegalArgumentException {\n\t if (A == 0) {\n\t throw new IllegalArgumentException(\"A can't be zero.\");\n\t }\n\t else {\n\t double disc = B*B - 4*A*C;\n\t if (disc < 0)\n\t throw new IllegalArgumentException(\"Discriminant < zero.\");\n\t return (-B + Math.sqrt(disc)) / (2*A);\n\t }\n\t}",
"public String generateRootResult()\n\t{\n\t\tString result = \"\";\n\t\tresult = result + rootWord + \" \";\n\n\t\treturn result;\n\t}",
"public int display(){\n return display(root);\n\n }",
"public static void main(String[] args) {\n\t\t\n\t\t//Reading input from the user\n\t\tSystem.out.println(\"Enter the number to find sqaure root of\");\n\t\tdouble num=AlgorithmUtility.userDouble();\n\t\t\n\t\t//Method 1- using static function of AlgorithmUtility class of\n\t\t//com.bridgelabz.util package\n\t\tdouble res=AlgorithmUtility.squareRoot(num);\n\t\t\n\t\tSystem.out.println(\"The square root of the given number using Newton's Method is: \"+ res);\n\t}",
"static double sqrt(double number) {\n\t\tdouble answer = number / 2;\r\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative square roots\"); \r\n=======\n\tpublic static double sqrt(int number) { //gonna be honest here: idk??\r\n\t\tint div = number*number;\r\n\t\tif(number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no square roots of negative numbers\");\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\t}\r\n\t\twhile (((answer * answer) - number) >= .005 || ((answer * answer) - number) <= -.005) {\r\n\t\t\tanswer = 0.5 * (number / answer + answer);\r\n\t\t}\r\n\t\treturn round2(answer);\r\n\t}\r\n\t\r\n\tpublic static String quadForm(int a, int b, int c) { //need round2 so uhhhhh\r\n\t\tif(b == 0) {\r\n\t\t\tSystem.out.println(round2(c));\r\n\t\t}\r\n\r\n\t\tif(discriminant(a, b, c) == 0) {\r\n\t\t\treturn(\"Roots: \" + round2((b * -1) / (2 *a)));\t\r\n\t\t}\r\n\t\t\r\n\t\tif(discriminant(a, b, c) > 0) {\r\n\t\t\treturn(\"Roots: \" + round2(b * -1) + (sqrt(b * b - (4 * a * c))));\r\n\t\t}\r\n\t\t\r\n\t\treturn(\"no real roots\");\r\n\t}\r\n}",
"public static void main(String[] args) {\n\t\tdouble x1,x2,y1,y2;\n\t\tint sqaureRoot;\n\t\tx1=5;\n\t\tx2=6;\n\t\ty1=8;\n\t\ty2=3;\n\t\tsqaureRoot=(int)((x1+x2)*(x1+x2))+(int)((y1+y2)*(y1+y2));\n\t\tSystem.out.println(sqaureRoot);\n\t}",
"public static void main(String[] args)\r\n {\r\n // TODO Auto-generated method stub\r\n \r\n //declare all variables\r\n //denom, discrim, coef_A, coef_B, coef_C, discrimSqrt, complexFlag, singleRootFlag, rootOne, rootTwo, complexDisplay\r\n \r\n //Display a title\r\n //Method: printTitle\r\n \r\n //Get the coefficients from the user. Use three times\r\n //Method: promptForCoef\r\n \r\n //Calculate the denominator of the quadratic formula\r\n //Method: calcDenom\r\n \r\n //Calculate the discriminant\r\n //Method: calcDiscrim\r\n \r\n //Determine if the discriminant shows complexity\r\n //Check if it is a negative number. It is complex if it is negative\r\n //set complexFlag to true\r\n \r\n //Otherwise determine if the discriminant shows one root\r\n //Check if the discriminant equals 0. One root if it equals 0\r\n //Calculate the square root of the discriminant\r\n //set singleRootFlag to true\r\n //Calculate the one root\r\n //Method: calcRoot\r\n \r\n //Otherwise there is two roots\r\n //Calculate both roots; use calcRoot for both\r\n //IMPORTANT!!! Input discrimSqrt as negative for the second root\r\n //Method: calcRoot\r\n \r\n //Display the table\r\n //Begin by displaying the title of the table\r\n //Method: displayTableTitle\r\n //Next display the sub-titles\r\n //Method: displaySubTitles\r\n //Then display the data pieces for the table. There will be three for the three coefficients.\r\n //Method: displayDataLine\r\n \r\n //Check if there is a complexFlag. If true display a line saying that the roots are complex\r\n //Method: displayDataLine\r\n //Otherwise check if there is a singleRootFlag. If true display the single root\r\n //Method: displayDataLine\r\n //Otherwise display both roots on separate lines\r\n //Method: displayDataLine\r\n //Finally display a single line to end the table\r\n //Method: displayLine\r\n \r\n //End program\r\n //Method: displayProgramEnd\r\n\r\n }",
"@Test\n public void test1DigitalRootMethod() {\n final int expected = 7;\n final int number = 16;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public static void main(String[] args){\n\t\tSimpleCalculator calc = new SimpleCalculator();\n\t\tboolean a=true;\n\t\tdouble number = 0.0;\n\t\tString checker = \"\";\n\t\twhile(a){\n\t\t\tSystem.out.println(\"Result: \" + number);\n\t\t\tSystem.out.println(\"Enter an operation or 'q' to end the program.\");\n\t\t\tScanner scan = new Scanner(System.in);\n\t\t\ttry{\n\t\t\t\tchecker= scan.next();\n\t\t\t\tif (checker.equals(\"q\")){\n\t\t\t\t\ta=false;\n\t\t\t\t}\n\t\t\t\telse if (!checker.equals(\"+\")&& !checker.equals(\"-\")&& !checker.equals(\"*\") && !checker.equals(\"/\")&&\n\t\t\t\t\t\t!checker.equals(\"%\")){\n\t\t\t\t\tthrow new UnknownOperatorException();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(UnknownOperatorException e){\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t\tif(a&&(checker.equals(\"+\")|| checker.equals(\"-\")|| checker.equals(\"*\") || checker.equals(\"/\")||\n\t\t\t\t\tchecker.equals(\"%\"))){\n\t\t\t\ttry{\n\t\t\t\t\tSystem.out.println(\"Please enter a number: \");\n\t\t\t\t\tnumber= scan.nextDouble();\n\t\t\t\t\tif (checker.equals(\"/\")&&(number==0)){\n\t\t\t\t\t\tthrow new ArithmeticException();\n\t\t\t\t\t}\n\t\t\t\t\tcalc.calcSetter(number, checker);\n\t\t\t\t\tnumber =calc.CalcLogic();\n\t\t\t\t}\n\t\t\t\tcatch(InputMismatchException exceptionObj){\n\t\t\t\t\tSystem.out.println(\"That is not a number! Please try again!\");\n\t\t\t\t\tScanner scan2 = new Scanner(System.in);\n\t\t\t\t\tnumber = scan2.nextDouble();\n\t\t\t\t}\n\t\t\t\tcatch(ArithmeticException e){\n\t\t\t\t\tSystem.out.println(\"Cannot divide by zero!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public static void main(String[] args) {\r\n\r\n\r\n Scanner input = new Scanner(System.in);\r\n\r\n try {\r\n int x = input.nextInt();\r\n int y = input.nextInt();\r\n System.out.println(x/y);\r\n } catch (ArithmeticException | InputMismatchException e){\r\n if ( e instanceof ArithmeticException){\r\n System.out.println(\"java.lang.ArithmeticException: / by zero\");\r\n } else if ( e instanceof InputMismatchException){\r\n System.out.println(\"java.util.InputMismatchException\");\r\n }\r\n } input.close();\r\n }",
"public static void main(String[] args) {\n double numA;\n double numB;\n double numC;\n double delta;\n\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter number a: \");\n numA = sc.nextDouble();\n System.out.print(\"Enter number b: \");\n numB = sc.nextDouble();\n System.out.print(\"Enter number c: \");\n numC = sc.nextDouble();\n delta = Math.pow(numB,2) - (4*numA*numC);\n\n if (numA == 0){\n if (numB == 0){\n if (numC == 0){\n System.out.println(\"Equation countless solutions\");\n }else {\n System.out.println(\"Equation has no solution\");;\n }\n }else {\n System.out.println(\"Equation has 1 solution x = \" + (-numB/numA));\n }\n }else {\n if (delta < 0){\n System.out.println(\"Equation has no solution\");\n }else if (delta == 0){\n System.out.println(\"Equation has 1 solution x = \" + (-numB/(2*numA)));\n }else {\n System.out.println(\"Equation has 2 solutions x1 = \" + (-numB+Math.sqrt(delta))/(2*numA));\n System.out.println(\"Equation has 2 solutions x2 = \" + (-numB-Math.sqrt(delta))/(2*numA));\n }\n }\n }",
"public double cubeRoot(double n){\n //Create a variable \"n1\" which takes all value of n in the positive form\n double n1;\n if(n<0){\n n1 = n*-1;\n }\n else{\n n1 = n;\n }\n\n //Set start and end to the binary search\n double start = 0;\n double end = n1;\n\n //Set precision (error accepted)\n double e = 0.0000001;\n\n //find the cube root of n\n while(true){\n //Calculate root\n root = (start+end)/2;\n\n //Identify error\n double error = diff(n1,root);\n\n //if error is less than or equal to e, then root is our solution\n if(error<=e){\n //if n is negative then return neg mid\n if(n<0){\n root = (Math.round(root*100.0)/100.0)*-1;\n return root;\n }\n\n else{\n root = (Math.round(root*100.0)/100.0);\n return root;\n }\n\n }\n\n\n //if root*root*root is greater than n, then end = root, end the loop\n if ((root*root*root)>n1){\n end = root;\n }\n //if root*root*root is less than n, then start = root; keep searching from root to n\n if ((root*root*root)<n1){\n start = root;\n }\n }\n\n\n\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\r\n System.out.println(\"Enter a, b, c: \");\r\n int a = input.nextInt(), b = input.nextInt(), c = input.nextInt();\r\n\r\n // 创建对象+调用构造方法\r\n QuadraticEquation qe = new QuadraticEquation(a, b, c);\r\n\r\n // 获取判别式结果\r\n double judge = qe.getDiscriminant();\r\n\r\n if (judge > 1){\r\n System.out.printf(\"%.3f %.3f\\n\", qe.getRoot1(), qe.getRoot2());\r\n } else if (judge < 0.0001 && judge > -0.0001){\r\n System.out.printf(\"%.3f\\n\", qe.getRoot1());\r\n } else {\r\n System.out.printf(\"The equation has no roots\");\r\n }\r\n }",
"public void print_root(){\r\n\t\tfor(int id = 0; id < label.length; id++){\r\n\t\t\tSystem.out.printf(\"\"%d \"\", find(id));\r\n\t\t}\r\n\t\tSystem.out.printf(\"\"\\n\"\");\r\n\t}",
"public static void main(String[] args) {\n \n Scanner myScanner;\n myScanner = new Scanner( System.in);\n System.out.print(\n \"Enter the number you would like cubed : \");\n \n //Accept user input\n \n double x = myScanner.nextDouble();\n \n //Random guess that the root is x/3\n \n double guess=x/3;\n \n //First guess\n double guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n //Second guess\n guess=(2*guess1*guess1*guess1+x)/(3*guess1*guess1);\n \n //third guess\n guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n //fourth guess\n guess=(2*guess1*guess1*guess1+x)/(3*guess1*guess1);\n \n //fifth guess\n guess1=(2*guess*guess*guess+x)/(3*guess*guess);\n \n \n System.out.print(\"The cube root is \"+(guess)+\" \");\n \n \n }",
"public double squareRoot (double firstNumber){\n\t\tif (firstNumber < 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Invalid Input \", \"Error message\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn -1111.1111;\n\t\t}\n\t\tdouble result = Math.sqrt(firstNumber);\n\t\treturn result;\n\t}",
"public static void main(String[] args) {\n\n System.out.println(\"------------------------------------\");\n //making a simple console calculator\n Scanner sc = new Scanner(System.in);\n double x, y;\n double result = 0;\n\n System.out.println(\"1. Addition\");\n System.out.println(\"2. Subtraction\");\n System.out.println(\"3. Multiplying\");\n System.out.println(\"4. Division\"); //HW\n System.out.print(\"Enter the operation: \");\n int operation = sc.nextInt();\n\n System.out.print(\"Enter first number: \");\n x = sc.nextInt();\n System.out.print(\"Enter second number: \");\n y = sc.nextInt();\n\n //simple\n if (operation == 1) {\n result = x + y;\n } else if (operation == 2) {\n result = x - y;\n } else if (operation == 3) {\n result = x * y;\n } else if (operation == 4 && y != 0) {\n result = x / y;\n } else {\n System.out.println(\"Wrong operation!\");\n }\n \n System.out.println(\"Result: \" + result);\n }",
"public static void main(String[] args) {\n\n Scanner tc = new Scanner(System.in);\n\n double a, b, c = 0;\n String soma = \"+\";\n String subtração = \"-\";\n String multiplicação = \"*\";\n String divisão = \"/\";\n String potência = \"^\";\n String raiz = \"~\";\n String operação = \"\";\n System.out.println(\"Qual operação deseja fazer ?\");\n operação = tc.nextLine();\n System.out.println(\"insira um numero ó mortal\");\n a = tc.nextDouble();\n System.out.println(\"insira um numero ó mortal\");\n b = tc.nextDouble();\n ;\n if (operação == null ? soma == null : operação.equals(soma)) {\n c = a + b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? subtração == null : operação.equals(subtração)) {\n c = a - b;\n System.out.println(\"o resultado é \" + c);\n } else if (operação == null ? multiplicação == null : operação.equals(multiplicação)) {\n c = a * b;\n System.out.println(\"o resultado é \" + c);\n }\n else \n c = a/b;\n \n System.out.println(\"o resultado é \" + c);\n }",
"public static void main(String[] args) \r\n\t{\r\n\t\tSystem.out.println(squareRoot(90));\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\tint a, b, c;\r\n\t\tSystem.out.println(\"Quadratic equation \\tax^2+bx+c=0\");\r\n\t\tSystem.out.println();\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter the value of a: \");\r\n\t\ta = input.nextInt();\r\n\t\tSystem.out.print(\"Enter the value of b: \");\r\n\t\tb = input.nextInt();\r\n\t\tSystem.out.print(\"Enter the value of c: \");\r\n\t\tc = input.nextInt();\r\n\t\tif(b<0 && c<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 %dx %d\", a, b, c);\r\n\t\t}else if(c<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 + %dx %d\", a, b, c);\r\n\t\t}else if(b<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 %dx + %d\", a, b, c);\r\n\t\t}else {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 + %dx + %d\", a, b, c);\r\n\t\t}\r\n\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"\\nQr = b^2 - 4ac\");\r\n\t\tint x;\r\n\t\tx = (int) (Math.pow(b, 2) - 4*a*c);\r\n\t\tSystem.out.printf(\"Qr = %d\", x);\r\n\t\tSystem.out.print(\"\\n\\nRoots of the equqtion are: \");\r\n\t\tif(x<0) {\r\n\t\t\tSystem.out.println(\"Imaginary/complex\");\r\n\t\t}else if(x==0) {\r\n\t\t\tSystem.out.println(\"Real and equal\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"Real and distinct\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}",
"public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n double x = s.nextDouble();\n double y = s.nextDouble();\n double a = s.nextDouble();\n double b = s.nextDouble();\n \n DecimalFormat df = new DecimalFormat(\"#.000000000000\");\n double dp = x*a + y*b;\n double el =Math.sqrt(a*a + b*b);\n //double mel = dp/Double.valueOf(df.format(el*el));\n double mel = dp/(el*el);\n double as = mel*a;\n double bs = mel*b;\n double n = (x-mel*a)/(-1*b);\n //System.out.println(dp + \" \" + el + \" \" + mel + \" \" + as + \" \" + bs + \" \" + n);\n System.out.println(mel);\n System.out.println(n);\n }",
"public int root(){\n\t\tRandom r1=new Random();\n\t\tint r2= r1.nextInt((9) + 1) + 1;\n\t\treturn r2*100;\n\t}",
"@Test\n public void test3DigitalRootMethod() {\n final int expected = 6;\n final int number = 132189;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n \n System.out.println(\"Enter a side length for your cube:\");\n double s = scan.nextDouble();\n \n if (s > 0)\n {\n double volume = Math.pow(s, 3);\n System.out.println(\"Volume:\" + volume);\n }\n \n else\n System.out.println(\"Invalid entry\");\n \n \n /** Objective #2: Write an application to determine the number of solutuions to a quadratic equation, \n * The program accepts a, b and c from a user, and tells the user how many solutions, if any, exist\n * \n * Precodition: The user enters numbers, and not a special characters or letters\n * Postcondition: If there are two solutions, the program outputs \"two solutions.\" If there is \n * one solution, the program outputs \"one solution\" and if there are\n * no solutions, the program outputs \"no solution\"\n */\n \n System.out.println(\"Enter a:\");\n double a = scan.nextDouble();\n \n System.out.println(\"Enter b:\");\n double b = scan.nextDouble();\n \n System.out.println(\"Enter c:\");\n double c = scan.nextDouble();\n \n double discriminant = b*b - 4*a*c;\n if (discriminant <= 0)\n System.out.println(\"No real solutions.\");\n else if (discriminant == 0)\n System.out.println(\"One solution.\");\n else\n System.out.println(\"Two solutions.\");\n \n \n \n \n }",
"public static void main(String[] args) {\n TreeNode root = build(1, build(2, null, build(1)), build(3));\n System.out.println(new SumRootToLeaf().sum(root));\n }",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(1);\n root.right = new TreeNode(4);\n root.left.right = new TreeNode(2);\n\n System.out.println(kthSmallest(root, 1));\n }",
"public void buildTree() throws RuntimeException, DivideByZero {\r\n // define local variable to count number of times an operator \r\n // is pushed into it's associated stack. This will be use to \r\n // count register values\r\n int i = 0;\r\n\r\n // split postfix expression enterend into the textbox into tokens using \r\n // StringTokenizer. Delimeters are used so that different inputs \r\n // can be parsed without spaces being necessary \r\n StringTokenizer token = new StringTokenizer(inputExpression, \" */+-\", true);\r\n\r\n // while loop to build tree out of the postfix expression\r\n while (token.hasMoreTokens()) {\r\n // get the next token in series\r\n String nextItem = token.nextToken();\r\n\r\n // use selection statements to determine if the next token\r\n // in the String is an operand, operator, or unknown\r\n if (nextItem.matches(\"[0-9]+\")) {\r\n // push operand to associated stack\r\n operandStk.push(nextItem);\r\n \r\n // push operand to AssemblyCode class\r\n assemblyCode.pushStack(nextItem);\r\n\r\n } else if (nextItem.equals(\"*\") || nextItem.equals(\"/\")\r\n || nextItem.equals(\"+\") || nextItem.equals(\"-\")) {\r\n // push current operator to operators stack\r\n operatorStk.push(nextItem);\r\n // call the getNodes() method to perform operation\r\n getNodes(i);\r\n // count each time an operator is pushed so registers can be counted\r\n i++;\r\n } else if (!nextItem.equals(\" \")){ \r\n // set class variable to equal invalid character\r\n invalidToken = nextItem; \r\n // throw exception if illegal operator or operand is parsed\r\n throw new RuntimeException();\r\n }\r\n } // end while loop\r\n }",
"protected abstract RootVertex<D> getRoot(R root);",
"@Test\n public void test4DigitalRootMethod() {\n final int expected = 2;\n final int number = 493193;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public void printRoot()\r\n\t{\r\n\t\tSystem.out.println(\"Root is:\"+root.data);\r\n\t}",
"public int calculate() {\n \ttraversal(root);\n \tif(!calResult.isEmpty()){\n \t\tint answer = Integer.parseInt(calResult.pop());\n \t\treturn answer;\n \t}\n return 0;\n }",
"public static double root(double a, double b, double c, int eps) {\n if (a == 0 && b == 0)\n return Double.NaN;\n else if (a == 0)\n return -c / b;\n else {\n double sqb = sq(b);\n double ac = 4*a*c;\n if (almost_equals(sqb,ac) || sqb > ac) \n return (-b + eps * sqrt_safe(sqb-ac)) / (2 * a);\n return Double.NaN; \n }\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tfloat a, b, c;\r\n\t\tSystem.out.println(\"Fill a, b, c: \");\r\n\t\ta = sc.nextFloat();\r\n\t\tb = sc.nextFloat();\r\n\t\tc = sc.nextFloat();\r\n\t\tfloat delta = (float) (Math.pow(b, 2) - 4 * a * c);\r\n\t\tif (delta < 0) {\r\n\t\t\tSystem.out.println(\"The equation has no solution!\");\r\n\t\t} else {\r\n\t\t\tif (delta == 0) {\r\n\t\t\t\tfloat x = -b / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution x = \" + x);\r\n\t\t\t} else {\r\n\t\t\t\tdouble x1 = (-b - Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tdouble x2 = (-b + Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution X1 = \" + x1);\r\n\t\t\t\tSystem.out.println(\"Solution X2 = \" + x2);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(2);\n\t\tTreeNode left = new TreeNode(0);\n\t\tTreeNode right = new TreeNode(0);\n\t\troot.left = left;\n\t\troot.right = right;\n\t\tSystem.out.println(sumRootToLeaf.sumNumbers(root));\n\t}",
"@Test\n public void test16() throws Throwable {\n Complex complex0 = new Complex(0.0, 236.4);\n Complex complex1 = complex0.asin();\n Complex complex2 = complex1.atan();\n Complex complex3 = complex0.sin();\n Complex complex4 = (Complex)complex0.readResolve();\n double double0 = complex0.abs();\n Complex complex5 = complex0.log();\n Complex complex6 = complex1.sin();\n Complex complex7 = complex0.cos();\n String string0 = complex3.toString();\n Complex complex8 = complex1.multiply(complex2);\n try { \n complex3.nthRoot((-1));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -1\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static void main(String[] args) {\n try{\n //Peticion de datos al usuario\n System.out.println(\"Resolución de la ecuación cuadrática\");\n System.out.println(\"------------------------------------\");\n System.out.println();\n System.out.println(\"Indique el valor de A: \");\n a = input.nextDouble();\n System.out.println(\"Indique el valor de B: \");\n b = input.nextDouble();\n System.out.println(\"Indique el valor de C: \");\n c = input.nextDouble();\n \n //Resolucion de la ecuacion y obtencion de los dos posibles resultados\n resultado1 = (-b + Math.sqrt(Math.pow(b, 2) - (4*a*c))) / (2*a);\n resultado2 = (-b - Math.sqrt(Math.pow(b, 2) - (4*a*c))) / (2*a);\n \n //Se muestra por consola los valores obtenidos de X\n System.out.println(\"Resolución #1: \\n\" + \"X = \" + resultado1);\n System.out.println(\"Resolución #2: \\n\" + \"X = \" + resultado2);\n }catch(InputMismatchException ex){\n System.out.println(\"ERROR. Los valores introducidos han de ser numéricos\");\n }\n \n \n }",
"public static double equation() {\n Scanner userInput = new Scanner(System.in);\n System.out.print(\"Please enter a value for x: \");\n double x = userInput.nextDouble();\n double output = (x * Math.pow(Math.exp(1), -x)) + Math.sqrt(1 - Math.pow(Math.exp(1), -x));\n System.out.print(\"The answer to the equation xe^-x + sqrt(1-(e^-x)) \");\n\tSystem.out.println(\" with that x is: \");\n return output;\n }",
"int main()\n{\n int num;\n int q,r,sum;\n cin>>num;\n q=num/10;\n r=num%10;\n sum=q+r;\n cout<<\"Alice must go in path-\";\n cout<<sum;\n}",
"public static void main(String[] args) {\n Scanner entrada=new Scanner(System.in);\n \n double x;\n double y;\n double z;\n double m;\n \n System.out.println(\"Ingrese el valor de la variable X: \");\n x = entrada.nextDouble();\n System.out.println(\"Ingrese el valor de la variable Y: \");\n y = entrada.nextDouble();\n System.out.println(\"Ingreese el valor de la variable Z: \");\n z = entrada.nextDouble();\n \n m = ((x+(y/z))/(x-(y/z)));\n \n System.out.println(\"El valor de m en base a las variables: \");\n System.out.printf(\"x= %f\\n\", x);\n System.out.printf(\"y= %f\\n\", y);\n System.out.printf(\"z= %f\\n\", z);\n System.out.println(\"Da como resultado:\");\n System.out.printf(\"m= %f\", m); \n}",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(1);\n root.right = new TreeNode(2);/*\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(11);*/\n\n Solution solution = new Solution();\n int minimumDifference = solution.getMinimumDifference(root);\n System.out.println(minimumDifference);\n\n }",
"public double getSpecificRootLength() {return specificRootLength;}",
"private int eval(ExpressionNodes root)\n\t {\n\t \tif (root.right == null && root.left == null) \n\t \t{\n\t \t\t\tint leaf = Integer.parseInt(root.data);\n\t \t\t\treturn leaf; \n\t \t}\n\t \t\n\t \t// if the node is an operator // \n\t \telse \n\t \t{\n\t \t\t\tint op1 = eval(root.left); \n\t \t\t\tint op2 = eval(root.right);\n\t \n\t \t\n\t\t\t \tString operator = root.data; // initialize operator string \n\t\t\t \tint n = 0; // initialize the integer that will be returned \n\t\t\t \t\n\t\t\t \t// switch case to conduct for the different operators \n\t\t\t \tswitch(operator) \n\t\t\t \t{\n\t\t\t\t case \"+\":\n\t\t\t\t \tn = op1 + op2; \n\t\t\t\t \tbreak;\n\t\t\t\t \t\n\t\t\t\t case \"-\":\n\t\t\t\t n = op1 - op2; \n\t\t\t\t break;\n\t\t\t\t \n\t\t\t\t case \"*\":\n\t\t\t\t n = op1 * op2; \n\t\t\t\t break;\n\t\t\t\t \n\t\t\t\t case \"/\":\n\t\t\t\t n = op1 / op2; \n\t\t\t\t break;\n\t\t\t \t}\n\t\t\t \t\n\t\t\t \treturn n; \n\t \t}\n\t\t\t\n\t }",
"int sumRootToLeafNumbers();",
"public static void main(String[] args) {\n addNode(3);\n Node ans = lowestCommonAncestorFast(root.left, root.left.right.right);\n System.out.print(ans.val);\n }",
"public static void main(String[] args) {\n\t\tTree tree = null;\n\t\tdouble totalrounds = 0;\n\t\tdouble average = 0;\n\t\t// rand = new Random();\n\t\tInputList inputs;\n\t\tRandom rand = new Random();\n\t\tdouble varSum = 0;\n\t\tdouble[] var = new double[(int) iterations];\n\t\tswitch (CHOICE) {\n\t\tcase 1:\n\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\ttree.markNode((int) (Math.random() * N), rounds);\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\ttree = new Tree(N);\n\t\t\t\tinputs = new InputList(N);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (tree.markedNodes() < N) {\n\t\t\t\t\trounds++;\n\t\t\t\t\tint s = inputs.pop(index);\n\t\t\t\t\ttree.markNode(s, rounds);\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\t\t\tbreak;\n\t\t/*\n\t\t * case 3: for (int i = 0; i < iterations; i++) { int rounds = 0; tree =\n\t\t * new Tree(N); Integer[] nodeSelect; while (tree.markedNodes() < N) {\n\t\t * rounds++; nodeSelect = tree.unmarkedArray(); int select =\n\t\t * rand.nextInt(nodeSelect.length);\n\t\t * tree.markNode(nodeSelect[select].intValue(), rounds); } totalrounds\n\t\t * += rounds; } average = totalrounds / iterations; System.out.println(\n\t\t * \"Average: \" + average);\n\t\t * \n\t\t * \n\t\t * break;\n\t\t */\n\t\tcase 3:\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tint rounds = 0;\n\t\t\t\tTreeR3 treeR3 = new TreeR3(N);\t\t\t\t\n\t\t\t\tInputList2 input = new InputList2(treeR3, N);\n\t\t\t\twhile (treeR3.markedNodes() < N) {\t\t\t\t\t\n\t\t\t\t\trounds++;\n\t\t\t\t\ttreeR3.markNode(input.pop(), rounds);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar[i] = rounds;\n\t\t\t\ttotalrounds += rounds;\n\t\t\t}\n\t\t\taverage = totalrounds / iterations;\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Average: \" + average);\n\n\t\t\t\n\t\t\t\n\t\t\tvarSum = 0;\n\t\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\t\tvar[i] = Math.pow(var[i] - average, 2);\n\t\t\t\tvarSum += var[i];\n\t\t\t}\n\t\t\tvarSum = varSum / iterations;\n\t\t\tSystem.out.println(\"Deviation: \" + Math.sqrt(varSum));\n\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"@Test\n public void test2DigitalRootMethod() {\n final int expected = 6;\n final int number = 942;\n assertEquals(expected, kata4.digitalRoot(number));\n }",
"public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }",
"static void myMethod(){\r\n\t\t\r\n\t\tSystem.out.println(\"enter a divisor : \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint value = sc.nextInt();\r\n\t\tif(value==0){\r\n\t\t\ttry {\r\n\t\t\t\tthrow new DivideByZeroException();\r\n\t\t\t} catch (DivideByZeroException e) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t\tSystem.out.println(\"Divisor cant be 0.\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tSystem.out.println(10/value);\r\n\t\t}\r\n\t}",
"public Type evaluateRootType() {\n\t\t\tNode parsedTreeNode = this.parsedTree.get(); // Gets the Node from the Optional\n //ensures that tree is valid before analyzing it\n if (TypeUtilities.isTreeValid(parsedTreeNode)) {\n \treturn traverseTree(parsedTreeNode);\n }\n throw new UndeterminableTypeException(\"Input Tree was Invalid.\");\n }",
"public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tBinaryTreeNode<Integer> root=takeInputLevelWise();\n\t\tprintDiagonal(root);\n\n\t}",
"public static void main(String[] args){\n\t\tSystem.out.println(1/1+1/2+1/3+1/4+1/5+1/6+1/7+1/8+1/9+1/10);\n\t\t//Computes the sum of 1/1+1/2+...+1/10 correctly.\n\t\tSystem.out.println(1/1.0+1/2.0+1/3.0+1/4.0+1/5.0+1/6.0+1/7.0+1/8.0+1/9.0+1/10.0);\n\t\t\t\t\n\t\t/* The second method prints a correct value because it is understood\n\t\t * to be a floating point. The values from the first method are truncated to\n\t\t * \"1+0+0+....+0\" respectively. */\n\t\n\t\t}",
"public int eval() \n\t { \n\t \treturn eval(root);\n\t }",
"public static void main(String[] args){\n\n// BinaryTree binaryTree = new BinaryTree(1);\n// binaryTree.insert(\"L\", 2);\n// binaryTree.insert(\"LL\", 4);\n// binaryTree.insert(\"LR\", 5);\n// binaryTree.insert(\"R\", 3);\n// binaryTree.getHeight(binaryTree.root);\n// System.out.println(binaryTree.maxDiameter);\n\n Scanner in = new Scanner(System.in);\n int T = in.nextInt();\n int X = in.nextInt();\n BinaryTree binaryTree = new BinaryTree(X);\n for(int j=0;j<T-1;j++){\n String where = in.next();\n int k = in.nextInt();\n binaryTree.insert(where, k);\n }\n binaryTree.getHeight(binaryTree.root);\n// binaryTree.traverse(binaryTree.root);\n System.out.println(binaryTree.maxDiameter);\n }",
"public static void main(String[] args) {\n \n root = null; // Start with an empty tree. \n \n // Insert 1023 random items into the tree\n \n for (int i = 0; i < 1023; i++)\n treeInsert(Math.random()); \n \n // compute and output the average depth of all the leaves in the tree and the maximum depth of all the leaves.\n \n int leafCount = countLeaves(root);\n int depthSum = sumOfDepths(root,0);\n int depthMax = maximumDepth(root,0);\n double averageDepth = ((double)depthSum) / leafCount;\n \n // Display the results.\n \n System.out.println(\"Number of leaves: \" + leafCount);\n System.out.println(\"Average depth: \" + averageDepth);\n System.out.println(\"Maximum depth: \" + depthMax);\n\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"--------------------------------Binary search Tree---------------------------------------\");\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\n\t\tBSTTree bstTree = new BSTTree();\n\t\t\n\t\tinput = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the list of nodes(Integer) to insert into tree with comma seperated (eg: 1,2,3): \");\n\t\t\n\t\t//Code for getting user node as Input value\n\t\t/*\n\t\t * String treeNodes = input.nextLine(); String[] nodes = treeNodes.split(\",\");\n\t\t * for (String value : nodes) { bstTree.insert(Integer.parseInt(value.trim()));\n\t\t * }\n\t\t */\n\t\t\n\t\t\t\t\n\t\t/*\n\t\t * bstTree.insert(25); bstTree.insert(20); bstTree.insert(15);\n\t\t * bstTree.insert(27); bstTree.insert(30); bstTree.insert(29);\n\t\t * bstTree.insert(26); bstTree.insert(22); bstTree.insert(32);\n\t\t * bstTree.insert(17);\n\t\t */\n\t\t\n\t\t\n\t\tbstTree.insert(100);\n\t\tbstTree.insert(58); \n\t\tbstTree.insert(30); \n\t\tbstTree.insert(47); \n\t\tbstTree.insert(25);\n\t\tbstTree.insert(39);\n\t\tbstTree.insert(125);\n\t\tbstTree.insert(111);\n\t\tbstTree.insert(137);\n\t\tbstTree.insert(110);\n\t\tbstTree.insert(120);\n\t\tbstTree.insert(130);\n\t\tbstTree.insert(140);\n\t\tbstTree.insert(109);\n\t\tbstTree.insert(121);\n\t\tbstTree.insert(119);\n\t\t\n\t\tSystem.out.println(\"Nodes are inserted into the tree\");\t\t\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\n\t\tfor(;;) {\n\t\t\tSystem.out.println(\"1. Insert Node into Tree\");\n\t\t\tSystem.out.println(\"2. In order Traversal\");\n\t\t\tSystem.out.println(\"3. Pre order Traversal\");\n\t\t\tSystem.out.println(\"4. Post order Traversal\");\n\t\t\tSystem.out.println(\"5. Find minimum value of tree\");\n\t\t\tSystem.out.println(\"6. Find maximum value of the tree\");\n\t\t\tSystem.out.println(\"7. Height of the tree\");\n\t\t\tSystem.out.println(\"8. Search Node in tree\");\n\t\t\tSystem.out.println(\"9. Delete Node in tree\");\n\t\t\tSystem.out.println(\"10. Find path between root and node\");\n\t\t\tSystem.out.println(\"Exit\");\n\t\t\tSystem.out.println(\"Enter your option : \");\t\t\t\n\t\t\tint inputOption = Integer.parseInt(input.nextLine());\t\t\t\n\t\t\tswitch(inputOption) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println(\"Enter the node value to insert into tree : \");\n\t\t\t\tString value = input.nextLine();\n\t\t\t\tbstTree.insert(Integer.parseInt(value.trim()));\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(\"In Order Traversal : \");\n\t\t\t\tbstTree.traverseInOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(\"Pre Order Traversal : \");\n\t\t\t\tbstTree.traversePreOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.print(\"Post Order Traversal : \");\n\t\t\t\tbstTree.traversePostOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tSystem.out.println(bstTree != null && bstTree.getMinimum()!=null ? \"Minimum value in the tree : \" + bstTree.getMinimum().getData() : \"Empty Tree\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 6:\t\t\t\t\n\t\t\t\tSystem.out.println(bstTree != null && bstTree.getMaximum()!= null ? \"Maximum value in the tree : \" + bstTree.getMaximum().getData() : \"Empty tree\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tSystem.out.println(\"Height of the Binary Search Tree : \" + bstTree.getHeight());\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tSystem.out.println(\"Enter the node o search in the tree : \");\n\t\t\t\tint searchNode = Integer.parseInt(input.nextLine());\t\n\t\t\t\tif(null!=bstTree.getNode(searchNode)) {\n\t\t\t\t\tSystem.out.println(\"Data \" + bstTree.getNode(searchNode) +\" is available\");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"Data \" + searchNode + \" is not available\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tSystem.out.println(\"Enter the node to be deleted\");\n\t\t\t\tint deleteNode = Integer.parseInt(input.nextLine());\n\t\t\t\tbstTree.delete(deleteNode);\n\t\t\t\tSystem.out.println(\"Node Deleted Successfully\");\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\tSystem.out.println(\"Enter the node to get the path : \");\n\t\t\t\tint node = Integer.parseInt(input.nextLine());\n\t\t\t\tbstTree.getPath(node);\n\t\t\t\tSystem.out.println();\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"\\t\\t\\t\\tThank you!\");\n\t\t\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t}",
"public static void main (String[] args){\n\tScanner in = new Scanner(System.in);\n\t\n\tSystem.out.print(\"Enter the first number: \");\n\tint n1 = in.nextInt();\n\t\n\tSystem.out.print(\"Enter the second numer: \");\n\tint n2 = in.nextInt();\n\t\n\tint ans = n1 + n2;\n\tSystem.out.printf(\"%d + %d = %d\\n\", n1, n2, ans);\n\t\n\tans = n1 - n2;\n\tSystem.out.printf(\"%d - %d = %d\\n\", n1, n2, ans);\n\t\n\tans = n1 * n2;\n\tSystem.out.printf(\"%d * %d = %d\\n\", n1, n2, ans);\n\t\n\tans = n1 / n2;\n\tSystem.out.printf(\"%d / %d = %d\\n\", n1, n2, ans);\n\t\n\tin.close();\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Welcome to the calculator. What operation would you like to do?(+,-,*,/)\");\n\t\tString answer = input.next();\n\t\t\n\t\tif (answer.equals(\"add\") || answer.equals(\"Add\") || answer.equals(\"+\")) \n\t\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to add?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat add1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number you want to add\");\n\t\t\t\tfloat add2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat addanswer = add1 + add2;\n\t\t\t\tSystem.out.println(addanswer);\n\t\t\t\t}\n\t\telse if(answer.equals(\"minus\") || answer.equals(\"-\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to subtract?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat sub1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat sub2 = input.nextFloat();\n\t\t\t\t\t\n\t\t\t\tfloat subanswer = sub1 - sub2;\n\t\t\t\tSystem.out.println(subanswer);\n\t\t\t}\n\t\telse if(answer.equals(\"multiply\") || answer.equals(\"x\") || answer.equals(\"*\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to multiply?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat mul1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat mul2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat mulanswer = mul1 * mul2;\n\t\t\t\tSystem.out.println(mulanswer);\n\t\t\t}\n\t\telse if(answer.equals(\"divide\") || answer.equals(\"/\"))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"What numbers would you like to divide?\");\n\t\t\t\tSystem.out.println(\"Type your first number\");\n\t\t\t\tfloat div1 = input.nextFloat();\n\t\t\t\tSystem.out.println(\"Type the second number\");\n\t\t\t\tfloat div2 = input.nextFloat();\n\t\t\t\t\n\t\t\t\tfloat divanswer = div1 / div2;\n\t\t\t\tSystem.out.println(divanswer);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please try again.\");\n\t\t\t}\n\t\tinput.close();\n\t\t}",
"public void root(Node n) {}",
"public static void main(String[] args) {\n\t\tScanner p1 = new Scanner(System.in);\n\t\tSystem.out.println(\"a의 값을 입력하시오.\");\n\t\tdouble a = p1.nextDouble();\n\t\tSystem.out.println(\"b의 값을 입력하시오.\");\n\t\tdouble b = p1.nextDouble();\n\t\tSystem.out.println(\"c의 값을 입력하시오.\");\n\t\tdouble c = p1.nextDouble();\n\t\t\n\t\tdouble determinant;\n\t\tdouble x1, x2;\n\t\t\n\t\tSystem.out.println(\"a=\" + a + \" b=\" + b + \" c=\" + c);\n\t\tdeterminant = b*b - 4.0*a*c;\n\t\tx1 = (-b + Math.sqrt(determinant))/(2.0*a);\n\t\tx2 = (-b - Math.sqrt(determinant))/(2.0*a);\n\t\t\n\t\tif (a == 0) \n\t\t{\n\t\t\tSystem.out.println(\"오류: 이차항의 계수가 0이므로, 이차방정식을 풀 수 없습니다.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (determinant < 0)\n\t\t\t{ \n\t\t\t\tSystem.out.println(\"오류: 실근이 존재하지 않으므로, 이차방정식을 풀 수 없습니다.\");\n\t\t\t\t\n\t\t\t}else \n\t\t\t{ \n\t\t\t\tSystem.out.println(\"The solution is either \" + x1 + \" or \" + x2);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String args[])throws IOException\n {\n\n\n try\n {\n FileReader in = new FileReader(\"d:/test.txt\");//Will get error if not handled ot thrown (IOException thrown above)\n // char ch = in.read();\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //Will get error if not handled ot thrown\n System.out.println(\"Please enter numerator : \");\n int numerator = Integer.parseInt(br.readLine());\n System.out.println(\"Please enter denominator\");\n int denominator = Integer.parseInt(br.readLine());\n /*BufferedReader Exception Handling*/\n // System.out.println(\"Please enter numerator : \");\n // int numerator = scanner.nextInt();\n // System.out.println(\"Please enter denominator : \");\n // int denominator = scanner.nextInt();\n\n System.out.println(\"The quotient is : \" + (numerator/denominator));\n }\n //Catch blok statements are cumpolsary\n catch(ArithmeticException ae)\n {\n System.out.println(\"Cannot divide by zero\");\n throw ae;\n // ae.printStackTrace();\n }\n /*Should be the last clause\n - will be executed even if exception occurs or not.\n - We write a CLEANUP CODE in the finally block\n - Finally block is used to free the resources\n - for example, file connections or jdbc connections (We have to close each connection)\n - in a networking program, you have to close the 'socket'\n - Finally block will be executed whether error occurs or not\n - Final block will be executed even if there is a 'return' statement in a method above the same\n */\n finally\n {\n System.out.println(\"In finally block\");\n }\n }",
"@Test\n public void test28() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n double double0 = complex0.abs();\n Complex complex1 = (Complex)complex0.readResolve();\n try { \n complex0.nthRoot((-504));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -504\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public double sqRoot(double num) {\n double base = 0;\n while (base < num) {\n base++;\n if ((base * base) == num) {\n return base;\n }\n }\n\n double termInSequence = ((base * base) + num) / (2 * base);\n for (int i = 0; i < 10; i++) {\n termInSequence = ((termInSequence * termInSequence) + num) / (2 * termInSequence);\n }\n return Double.parseDouble(String.format(\"%.9f\", termInSequence));\n }",
"public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n\n System.out.println(\"Input first number: \");\n int inputNumber1 = scanner.nextInt();\n\n System.out.println(\"Input second number: \");\n int inputNumber2 = scanner.nextInt();\n\n System.out.println(inputNumber1 + \" x \" + inputNumber2 + \" = \" + inputNumber1 * inputNumber2);\n\n\n // 1.5 Write a Java program that takes a number as input and prints its multiplication table upto 10.\n\n System.out.println(\"Input a number: \");\n int number1 = scanner.nextInt();\n\n for (int i = 0; i < 10; i++) {\n System.out.println(number1 + \" x \" + (i + 1) + \" = \" + (number1 * (i + 1)));\n }\n\n // 1.6 print the area and perimeter of a circle.\n\n double radius = 7.5;\n\n double perimeter = 2 * Math.PI * radius;\n double area = Math.PI * radius * radius;\n\n System.out.println(\"Perimeter is = \" + perimeter);\n System.out.println(\"Area is = \" + area);\n\n // 1.7 Write a Java program to convert temperature from Fahrenheit to Celsius degree.\n\n System.out.println(\"Input a degree in Fahrenheit:\");\n\n double fahrenheit = scanner.nextDouble();\n\n double celsius = ((fahrenheit - 32) * 5 / 9);\n\n System.out.println(fahrenheit + \" degree Fahrenheit is equal to \" + celsius + \" in Celsius\");\n\n // 1.8 Write a Java program that reads a number in inches, converts it to meters.\n\n System.out.println(\"Input a value for inch: \");\n\n double inch = scanner.nextDouble();\n double meters = inch * 0.0254;\n\n System.out.println(inch + \" inch is \" + meters + \" meters\");\n\n // 1.9 Write a Java program to get a number from the user and print whether it is positive or negative.\n\n System.out.print(\"Input a number: \");\n\n int num = scanner.nextInt();\n\n if (num > 0) {\n System.out.println(\"Number is positive\");\n } else if (num < 0) {\n System.out.println(\"Number is negative\");\n } else {\n System.out.println(\"Number is zero\");\n }\n\n // 1.10 Take three numbers from the user and print the greatest number.\n\n System.out.print(\"Input the 1st number: \");\n int num1 = scanner.nextInt();\n\n System.out.println(\"Input the 2nd number: \");\n int num2 = scanner.nextInt();\n\n System.out.println(\"Input the 3rd number: \");\n int num3 = scanner.nextInt();\n\n if ((num1 > num2) && (num1 > num3))\n System.out.println(\"The greatest: \" + num1);\n\n if ((num2 > num1) && (num2 > num3))\n System.out.println(\"The greatest: \" + num2);\n\n if ((num3 > num1) && (num3 > num2))\n System.out.println(\"The greatest: \" + num3);\n\n // 1.11 Write a program in Java to input 5 numbers from the keyboard and find their sum and average.\n\n System.out.println(\"Input the 5 numbers : \");\n\n int num5, sum = 0;\n\n for (int i = 0; i < 5; i++) {\n num5 = scanner.nextInt();\n sum = sum + num5;\n }\n\n int average = sum / 5;\n System.out.println(\"The sum of 5 no is : \" + sum + \"\\nThe Average is : \" + average);\n\n // 1.12 Write a program Check Whether Number is Even or Odd\n\n System.out.println(\"Input: \");\n int num6 = scanner.nextInt();\n\n System.out.println(\"Input: \");\n int num7 = scanner.nextInt();\n\n if (num6 % 2 == 0) {\n System.out.println(\"Even\");\n }\n if (num7 % 2 == 0) {\n System.out.println(\"Even\");\n } else {\n System.out.println(\"Odd\");\n }\n }",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\t\tTreeNode root = new TreeNode(5);\n\t\troot.left = new TreeNode(3);\n\t\troot.right = new TreeNode(7);\n\t\tinOrder(root);\n\t\tSystem.out.println();\n\t\tsum(root);\n\t\tinOrder(root);\n\t}",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t \n while(true){\n int flag = 0, N2 = 0, N1 = 0,N3=0;\n char ch = scn.next().charAt(0);\n if (ch == 'x'|| ch == 'X')\n {\n System.out.println(ch);\n return;\n }\n else if(ch== '+') flag = 1;\n else if (ch =='-')flag = 1;\n else if (ch =='*')flag = 1;\n else if(ch =='%')flag = 1;\n else if(ch =='/')flag = 1;\n \n if(flag!=1)System.out.println(\"Invalid operation. Try again.\");\n else\n {\n N1 = scn.nextInt();\n N2 = scn.nextInt();\n if(ch == '+') N3 = N2+ N1;\n else if (ch =='-')N3 =N2-N1;\n else if (ch =='*')N3 = N2*N1;\n else if(ch =='%')N3 = N2%N1;\n else if(ch =='/')N3 = N2/N1;\n System.out.println(N3);\n }\n }\n\t}",
"public void startCalc(View v){\n\t\tdouble v1, v2, v3, v4;\n\t\t\n\t\t//Reset any non-inputted strings to 0.0, get varNum\n\t\tstringToZero();\n\t\t\n\t\t//If user input numbers for all boxes, jump out\n\t\tif(varNum == 0)\n\t\t\treturn;\n\t\t\n\t\t//Gathering all variables\n\t\ttry{\n\t\t\t\n\t\t\tv1 = Double.parseDouble(var1.getText().toString());\n\t\t\tv2 = Double.parseDouble(var2.getText().toString());\n\t\t\tv3 = Double.parseDouble(var3.getText().toString());\n\t\t\tv4 = Double.parseDouble(var4.getText() .toString());\n\t\t\t\n\t\t} catch(NumberFormatException e){\n\t\t\t//Builds and displays a dialog\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setMessage(\"You did not enter a number in one of the text fields\");\n\t\t builder.setTitle(\"Error\");\n\t\t \n\t\t AlertDialog dialog = builder.create();\n\t\t dialog.show();\n\t\t \n\t\t //Clean up solved variable text box\n\t\t\tif(varNum == 1)\n\t\t\t\t((TextView)findViewById(R.id.varfield1)).setText(\"\");\n\t\t\telse if(varNum == 2)\n\t\t\t\t((TextView)findViewById(R.id.varfield2)).setText(\"\");\n\t\t\telse if(varNum == 3)\n\t\t\t\t((TextView)findViewById(R.id.varfield3)).setText(\"\");\n\t\t\telse if(varNum == 4)\n\t\t\t\t((TextView)findViewById(R.id.varfield4)).setText(\"\");\n\t\t return;\n\t\t}\n\t\t\n\t\t//Use CalcSelector class\n\t\tString result = CalcSelector.calc(v1, v2, v3, v4, eqNum, varNum);\n\t\t\n\t\t//Fix divide by zero weirdness\n\t\tif(result.equals(\"NaN\")){\n\t\t\t\n\t\t\t//Builds and displays a dialog\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setMessage(\"Uh-Oh you divided by zero! Check your input again.\");\n\t\t builder.setTitle(\"Error\");\n\t\t \n\t\t AlertDialog dialog = builder.create();\n\t\t dialog.show();\n\t\t \n\t\t //Set answer and units to 0 and N/A\n\t\t\t((TextView)findViewById(R.id.ans)).setText(\"0\");\n\t\t\t((TextView)findViewById(R.id.units)).setText(\"N/A\");\n\t\t}\n\t\telse{\n\t\t\t//Set answer and Units\n\t\t\t((TextView)findViewById(R.id.ans)).setText(result);\n\t\t\t((TextView)findViewById(R.id.units)).setText(CalcSelector.getUnits());\n\t\t\t\n\t\t\t//Clean up solved variable text box\n\t\t\tif(varNum == 1)\n\t\t\t\t((TextView)findViewById(R.id.varfield1)).setText(\"\");\n\t\t\telse if(varNum == 2)\n\t\t\t\t((TextView)findViewById(R.id.varfield2)).setText(\"\");\n\t\t\telse if(varNum == 3)\n\t\t\t\t((TextView)findViewById(R.id.varfield3)).setText(\"\");\n\t\t\telse if(varNum == 4)\n\t\t\t\t((TextView)findViewById(R.id.varfield4)).setText(\"\");\n\t\t}\n\t}",
"public void print()\r\n {\r\n print(root);\r\n }",
"public static void main(String[] args)\n\t{\n\t\tScanner in = new Scanner(System.in);\n\t\tStringBuilder answers = new StringBuilder();\n\n\t\tanswers.append(\"PERFECTION OUTPUT\\n\");\n\t\ttry\n\t\t{\n\t\t\tint value;\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tvalue = in.nextInt();\n\t\t\t\tif (value == 0) break;\n\n\t\t\t\tanswers.append(solve(value));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tanswers.append(\"END OF OUTPUT\");\n\n\t\tSystem.out.println(answers);\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tsolve();\nBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\nStringBuilder sb=new StringBuilder();\nwhile(true){\n\tint K=Integer.parseInt(br.readLine());\n\tif(K==-1)break;\n\tsb.append(calculate[K]+\"\\n\");\n}\n\tSystem.out.println(sb);\n\t}",
"public static void main(String[] args) {\n\t\tNode root=BTreePrinterTest.test6();\n\t\tBTreePrinter.printNode(root);\n\t\tPoint result= recurse(root);\n\t\tSystem.out.println(result.y);\n\t}",
"public static void main(String[] args) {\n\t\tCalculator calculator = new Calculator();\n\t\tint result = calculator.add(4).add(5).subtract(3).out();\n\t\tif(calculator.isError)\n\t\t\tSystem.out.println(\"0으로 나눌 수 없습니다.\");\n\t\telse\n\t\t\tSystem.out.print(result);\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n //Get value of a\n System.out.print(\"Enter the value of a: \");\n double a = scanner.nextDouble();\n\n //Get value of b\n System.out.print(\"Enter the value of b: \");\n double b = scanner.nextDouble();\n\n //Get value of c\n System.out.print(\"Enter the value of c: \");\n double c = scanner.nextDouble();\n\n //solve for the discriminant (b^2 - 4 * a * c)\n double discriminant = Math.pow(b, 2) - (4 * a * c);\n\n //if the discriminant is negative than exit the program\n if (discriminant < 0) {\n System.out.println(\"Discriminant is negative\");\n return;\n }\n\n //solve for the first value of x1\n //(-b + sqrt(discriminant)) / 2 * a\n double x1 = (-b + Math.sqrt(discriminant)) / 2 * a;\n\n //solve for the first value of x2\n //(-b - sqrt(discriminant)) / 2 * a\n double x2 = (-b - Math.sqrt(discriminant)) / 2 * a;\n\n //output the results\n System.out.println(\"The first value of x: \" + x1);\n System.out.println(\"The second value of x \" + x2);\n\n //_________________________________________________________________\n // harmonic series formula\n System.out.print(\"Enter a number n: \");\n double n = scanner.nextInt();\n double sum = 0;\n for (double i = 1; i <= n; i++) {\n sum = sum + (1 / i);\n }\n System.out.println(\"The answer is: \" + sum);\n\n // __________________________________________________________\n //Finding average of int array\n System.out.print(\"Enter the number of values you want to average: \");\n int[] ages = new int[scanner.nextInt()]; //get size of the array & create array of that size\n //add the user's values to the array\n for (int i = 0; i < ages.length; i++) {\n System.out.print(\"Enter the next age: \");\n ages[i] = scanner.nextInt();\n }\n\n double sum2 = 0;\n for (int i = 0; i < ages.length; i++) {\n sum2 += ages[i];\n }\n\n double average = sum2 / ages.length;\n System.out.println(\"The average age of \" + ages.length + \" kids is: \" + average);\n\n\n //__________________________________________________________\n //Printing out the array\n System.out.print(\"Enter array size: \");\n int[] numbers = new int[scanner.nextInt()];\n for (int i = 0; i < numbers.length; i++) {\n System.out.print(\"Enter the next number: \");\n numbers[i] = scanner.nextInt();\n }\n //System.out.println(Arrays.toString(numbers));\n\n // Alternative way\n String numberArray = \"[\"; // Concatenating the values to this string\n for (int i = 0; i < numbers.length; i++) {\n if (i != numbers.length - 1) {\n numberArray += numbers[i] + \", \";\n } else {\n numberArray += numbers[i] + \"]\";\n }\n }\n System.out.println(numberArray);\n\n\n }",
"public static double getRadius(){\n Scanner kb = new Scanner(System.in);\n double radius = 0;\n\n System.out.println(\"Please enter in the radius: \");\n radius = kb.nextDouble();\n\n // if they don't enter in a number\n if(radius == 0){\n System.out.println(\"Please enter in a number: \");\n radius = kb.nextDouble();\n return radius;\n }\n\n // if negative number\n if(radius < 0){\n System.out.println(\"The radius must be greater than zero. \\nPlease enter the radius: \");\n radius = kb.nextDouble();\n return radius;\n }\n\n return radius;\n }",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter first Value: \");\n\t\tdouble a = scan.nextDouble();\n\t\tSystem.out.println(\"Enter second Value: \");\n\t\tdouble b = scan.nextDouble();\n\t\tSystem.out.println(\"Enter operation you would like to perform (Example +, - , *, /): \");\n\t\tString s = scan.next();\n\t\tscan.close();\n\t\tdouble ans;\n\t\t\n\t\tif(s.equals(\"+\")){\n\t\t\tans = a+b;\n\t\t}\n\t\telse if(s.equals(\"-\")){\n\t\t\tans = a-b;\n\t\t}\n\t\telse if(s.equals(\"*\")){\n\t\t\tans = a*b;\n\t\t}\n\t\telse if(s.equals(\"/\")){\n\t\t\tans = a/b;\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Invalid Operation\");\n\t\t\tans = 0;\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tSystem.out.printf(\"%.3f %s %.3f = %.3f\",a,s,b,ans);\n\n\n\n\n\t}",
"public static void main(String[] args) {\n\n\t\tTreeNode<Integer> root = takeTreeInputLevelWise();\n\t\tTreeNode<Integer> ans = maxSumNode(root);\n\t\tSystem.out.println(ans.data);\n\t}",
"public static void main(String[] args) {\n\t\tScanner ent = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Informe o valor de A:\");\r\n\t\tdouble a = ent.nextDouble();\r\n\r\n\t\tif (a == 0) {\r\n\t\t\tSystem.out.println(\"A equação não é de segundo grau\");\r\n\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Insira o valor de B: \");\r\n\t\t\tdouble b = ent.nextDouble();\r\n\r\n\t\t\tSystem.out.println(\"Insira o valor de C: \");\r\n\t\t\tdouble c = ent.nextDouble();\r\n\r\n\t\t\tdouble delta = (b * b) - (4 * a * c);\r\n\r\n\t\t\tif (delta == 0) {\r\n\t\t\t\tSystem.out.println(\"A equação não é de segundo grau\");\r\n\r\n\t\t\t} else if (delta < 0) {\r\n\t\t\t\tSystem.out.println(\"A equação não possui raizes\");\r\n\r\n\t\t\t} else {\r\n\t\t\t\tdouble raiz1 = (-b + Math.sqrt(delta) / (2 * a));\r\n\t\t\t\tdouble raiz2 = (-b - Math.sqrt(delta) / (2 * a));\r\n\t\t\t\tSystem.out.println(\"Raiz 1: \" + raiz1);\r\n\t\t\t\tSystem.out.println(\"Raiz 2: \" + raiz2);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tent.close();\r\n\r\n\t}",
"public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }",
"public static void main(String[] args) {\r\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\t//welcomes user to the math tutor\r\n\t\tSystem.out.println(\"Hi, I am Pi, your personal math tutor. Today we will be practicing basic arthmetics\");\r\n\t\tSystem.out.println(\"What is your name?\");\r\n\t\tString name = sc.nextLine();\r\n\r\n\t\t//generates the numbers\r\n\t\tint firstDigit = (int)(Math.random()*10)+1;\r\n\t\tint secondDigit = (int)(Math.random()*10)+1;\r\n\t\tint operator = (int)(Math.random()*4)+1;\r\n\t\tdouble answer;\r\n\r\n\t\t//assigns operator\r\n\t\tswitch (operator) \r\n\t\t{ \r\n\t\tcase 1: System.out.println(name + \" What is \" + firstDigit + \"+\" + secondDigit + \"?\");\r\n\t\t\tdouble userAnswerA = sc.nextInt();\r\n\t\t\tdouble correctAnswerA = firstDigit + secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerA == correctAnswerA)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerA + \".\");\r\n\t\tbreak;\r\n\r\n\t\tcase 2: System.out.println(name + \" What is \" + firstDigit + \"-\" + secondDigit + \"?\"); \r\n\t\t\tdouble userAnswerS = sc.nextInt();\r\n\t\t\tdouble correctAnswerS = firstDigit - secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerS == correctAnswerS)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerS + \".\");\r\n\t\tbreak;\r\n\r\n\t\tcase 3: System.out.println(name + \" What is \" + firstDigit + \"/\" + secondDigit + \"?\"); \r\n\t\t\tdouble userAnswerD = sc.nextInt();\r\n\t\t\tdouble correctAnswerD = firstDigit / secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerD == correctAnswerD)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerD + \".\");\r\n\t\tbreak;\r\n\t\tcase 4: System.out.println(name + \" What is \" + firstDigit + \"*\" + secondDigit + \"?\");\r\n\t\t\tdouble userAnswerM = sc.nextInt();\r\n\t\t\tdouble correctAnswerM = firstDigit * secondDigit;\r\n\r\n\t\t//checks the user's answer\r\n\t\tif (userAnswerM == correctAnswerM)\r\n\t\t\tSystem.out.println (\"Good job! You got the right answer!\");\r\n\t\telse\t\r\n\t\t\tSystem.out.println(\"Sorry that's the wrong answer. You should have gotten \" + correctAnswerM + \".\");\r\n\t\tbreak;\r\n\t\t}\r\n\r\n\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tScanner input=new Scanner(System.in);\n\t\tdouble a;\n\t\tSystem.out.print(\"b=:\");\n\t\ta=input.nextDouble();\n\t\tdouble b;\n\t\tSystem.out.print(\"b=:\");\n\t\tb=input.nextDouble();\n\t\tdouble c;\n\t\tSystem.out.print(\"c=:\");\n\t\tc=input.nextDouble();\n\t double deta=b*b-4*a*c;\n\t\tif(deta>0) {\n\t\t\tdouble x1=(-b+Math.sqrt(deta))/(2*a);\n\t\t\tdouble x2=(-b-Math.sqrt(deta))/(2*a);\n\t\t\tSystem.out.println(\"x1=\"+x1+\" \"+\"x2=\"+x2);\n\t\t}\n\t\telse if(deta==0)\n\t\t\tSystem.out.println(\"x=\"+(-b/(2*a)));\n\t\telse\n\t\t\tSystem.out.println(\"ÎÞʵÊý¸ù\");\n\t\t\n\t\t\n\n\t\t\n\t}",
"public void go() {\n Counter counter = new Counter();\n UserInput userInput = new UserInput();\n System.out.println(\"Input the x: \");\n int x = userInput.lengthInput();\n mainLogger.info(\"The user has entered {} as x\", x);\n mainLogger.info(\"Answer of the equation is: {}\", counter.wholeAnswer(x));\n }",
"public static void main(String[] args) {\n Calculator calc=new Calculator();\r\n double operand1,operand2,result=0;\r\n operand1=calc.getOperand1();\r\n operand2=calc.getOperand2();\r\n String op;\r\n op=calc.getOperator();\r\n try\r\n {\r\n \r\n switch(op)\r\n {\r\n case \"+\": Add add=new Add();\r\n result=add.doOperation(operand1, operand2);\r\n break;\r\n case \"-\": Subract sub=new Subract();\r\n result=sub.doOperation(operand1, operand2);\r\n break;\r\n case \"*\": Multiply mul=new Multiply();\r\n result=mul.doOperation(operand1, operand2);\r\n break;\r\n case \"/\": Division div =new Division();\r\n if(operand2==0)\r\n {\r\n \tthrow new ArithmeticException();\r\n }\r\n result=div.doOperation(operand1, operand2);\r\n break;\r\n default: throw new Exception(\"Invalid operation\");\r\n }\r\n \r\n\t }\r\n catch(ArithmeticException e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n }\r\n \r\n catch(Exception e)\r\n {\r\n \t System.out.println(e);\r\n \t \r\n } \r\n finally\r\n {\r\n \t System.exit(0);\r\n }\r\n System.out.print(result);\r\n \r\n}",
"public static double root(double a, double b, Function f, double... args)\n {\n return root(1e-15, 1000, a, b, 0, f, args);\n }",
"public static void main(String[] args) {\n\t\tres = 0;\n\t\tNode root = new Node(1);\n\t\troot.left = new Node(2);\n\t\troot.left.left = new Node(1);\n\t\troot.left.right = new Node(2);\n\t\troot.right = new Node(-1);\n\t\troot.right.left = new Node(3);\n\t\troot.right.left.left = new Node(2);\n\t\troot.right.left.right = new Node(5);\n\n\t\tint k = 3;\n\t\tSystem.out.printf(\"No of paths with sum \" + \"equals to %d are: %d\\n\", k, printCount(root, k));\n\n\t}",
"public static void main(String[] args) {\n TreeNode node1 = new TreeNode(4);\n TreeNode node2 = new TreeNode(1);\n TreeNode node3 = new TreeNode(12);\n TreeNode node4 = new TreeNode(3);\n TreeNode node5 = new TreeNode(2);\n TreeNode node6 = new TreeNode(5);\n TreeNode node7 = new TreeNode(3);\n\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node3.right = node7;\n\n\n /*\n * 1\n * 3 2\n */\n TreeNode node11 = new TreeNode(1);\n TreeNode node21 = new TreeNode(3);\n TreeNode node31 = new TreeNode(2);\n\n node11.left = node21;\n node11.right = node31;\n\n /*\n * 1\n * 3 3\n */\n TreeNode node12 = new TreeNode(1);\n TreeNode node22 = new TreeNode(3);\n TreeNode node32 = new TreeNode(3);\n\n node12.left = node22;\n node12.right = node32;\n\n System.out.println(isRoot2SubTreeOfRoot1(node1, node11));\n System.out.println(isRoot2SubTreeOfRoot1(node1, node12));\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"Enter numerator : \");\n\t\tint x = sc.nextInt();\n\t\tSystem.out.print(\"Enter denominator : \");\n\t\tint y = sc.nextInt();\n\t\tdivide(x, y);\n\t}",
"public static void main (String [] args) {\n\nScanner myScanner = new Scanner( System.in ); //declaring the instance of scanner and creating an instance of calling input from STDIN\nSystem.out.print( \"Enter the square side measurement of pyramid: \" ); //prompt user to enter measurement of square side of pyramid\ndouble squareSide = myScanner.nextDouble(); //accept user input\n\n\nSystem.out.print( \"Enter the height of pyramid: \" ); //prompt user to enter measurement of height of pyramid\ndouble height = myScanner.nextDouble(); //accept user input\n\n\ndouble volume = (squareSide*squareSide*height)/3;\n\n\n System.out.println(\"The volume inside the pyramid is: \"+ volume + \".\");\n\n\n }",
"public static void main(String[] args) {\n\t\ttry {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tString inp = in.readLine();\n\t\t\n\t\twhile(!inp.isEmpty()) \n\t\t{\n\t\t\tint testCases = Integer.parseInt(inp);\n\t\t\twhile(testCases>0)\n\t\t\t{\n\t\t\t\tint inp1 = Integer.parseInt(in.readLine());\n\t\t\t\tfloat exprsn = (((((inp1*567)/9)+7492)*235)/47) - 498;\n\t\t\t\tint exprsnInt = (int) (exprsn/10);\n\t\t\t\tSystem.out.println(Math.abs((exprsnInt%10)));\n\t\t\t\ttestCases--;\n\t\t\t}\n\t\t}\n\t}\n\tcatch(Exception e){\n\t\t\n\t}\n\n}",
"@Override\n\tpublic int evalTree() {\n\t\tint num;\n\t\tExpressionTree left, right;\n\t\t\n\t\ttry {\n\t\t\tnum = Integer.parseInt(EMPTY + this.getValue());\n\n\t\t\treturn num;\n\t\t}\n\n\t\tcatch (NumberFormatException n) {\n\t\t\tleft = new ExpressionTree(getLeft());\n\t\t\tright = new ExpressionTree(getRight());\n\t\t\tif(TIMES_SIGN.equals(this.getValue()))\n\t\t\t\treturn left.evalTree() * right.evalTree();\n\t\t\telse\n\t\t\t\treturn left.evalTree() + right.evalTree();\n\t\t}\n\t}",
"public void doMenu(){\n Scanner readinput = new Scanner(System.in); // needed to read the user's input\r\n System.out.println(\"Using Red Black Tree. 9 for list of commands\");\r\n while (this.userinput != -1) {\r\n \r\n this.update(); // every loop, print diagram of the tree\r\n \r\n System.out.print(\"Option: \");\r\n this.userinput = readinput.nextInt(); // input. Await user.\r\n \r\n switch(this.userinput){ // checks and matches the input to available functions\r\n \r\n case 9:\r\n System.out.println(\"\\nAvailable commands:\"\r\n + \"\\n'0': create a new empty root\"\r\n + \"\\n'-1': quits the program\"\r\n + \"\\n'1': recursively inserts new node with value\"\r\n + \"\\n'2': remove a node\"\r\n + \"\\n'3': print information about the tree\"\r\n + \"\\n'4': print information about a node\"\r\n + \"\\n'9': print this help section\"\r\n );\r\n break;\r\n \r\n case -1: // quit.\r\n System.out.println(\"Stopping.\");\r\n break;\r\n \r\n case 0: // Empty all\r\n System.out.print(\"Removing all.\");\r\n this.root = null;\r\n break;\r\n \r\n case 1: // insere objeto no conteúdo do nó.\r\n System.out.print(\">>> New Value: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.insertElement(this.root, userinput2);\r\n break;\r\n \r\n case 2: //remover certo valor\r\n System.out.print(\">>> Value to be removed: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.remove(root, userinput2);\r\n break;\r\n \r\n case 3: // imprimir informações da árvore\r\n\r\n //this.calculateNodes(root);\r\n System.out.println(\"Pre Order NLR:\");\r\n this.traversePreOrder(root);\r\n System.out.println(\"\\nPost Order LRN:\");\r\n this.traversePostOrder(root);\r\n System.out.println(\"\\nIn Order LNR:\");\r\n this.traverseInOrder(root);\r\n System.out.println(\"\\n[!] Finished printing tree information\\n\");\r\n break;\r\n \r\n case 4: \r\n System.out.print(\">>> Value of node to be fetched: \");\r\n this.userinput2 = readinput.nextInt();\r\n this.info(this.fetch(root, userinput2));\r\n break;\r\n \r\n \r\n }\r\n \r\n }\r\n \r\n }"
]
| [
"0.67452973",
"0.6622272",
"0.64164555",
"0.6222294",
"0.61842805",
"0.61658055",
"0.61275566",
"0.61224544",
"0.61031413",
"0.6091469",
"0.6078314",
"0.6042578",
"0.59784776",
"0.59731305",
"0.59657323",
"0.5909205",
"0.58746564",
"0.5853394",
"0.5832592",
"0.5832285",
"0.57562035",
"0.57450163",
"0.5744399",
"0.5724236",
"0.5713211",
"0.57066816",
"0.56888413",
"0.56805044",
"0.5680407",
"0.56794965",
"0.5663325",
"0.56434715",
"0.5616755",
"0.5615315",
"0.55924284",
"0.5544526",
"0.55281615",
"0.55240875",
"0.5515303",
"0.5507559",
"0.5501015",
"0.5476677",
"0.54554456",
"0.54488075",
"0.5440699",
"0.54387265",
"0.54379255",
"0.53896505",
"0.5386241",
"0.5381256",
"0.5380353",
"0.534846",
"0.5348144",
"0.53417474",
"0.533477",
"0.53324646",
"0.53318244",
"0.5327362",
"0.531399",
"0.53122103",
"0.53100467",
"0.5302279",
"0.52962726",
"0.5292189",
"0.52902645",
"0.52866864",
"0.52810293",
"0.5279778",
"0.5278385",
"0.52782714",
"0.5277619",
"0.5271266",
"0.5270701",
"0.5269925",
"0.52629197",
"0.5250313",
"0.5249815",
"0.52479476",
"0.52450514",
"0.52310395",
"0.52188206",
"0.5217286",
"0.5214829",
"0.5214276",
"0.5213685",
"0.5212502",
"0.52115005",
"0.5209491",
"0.5206775",
"0.5199561",
"0.51981735",
"0.51953804",
"0.5195349",
"0.5193136",
"0.5187793",
"0.5187684",
"0.5185305",
"0.5185154",
"0.51824254",
"0.517777"
]
| 0.84976894 | 0 |
Allows the user to enter three double values and return an array of double with datatype checking | private static double[] getInputs() {
double[] inputs = new double[SIZE];
int counter = 0;
do {
try {
System.out.print("Enter the " + (counter + 1) + " value: ");
sc = new Scanner(System.in);
double value = sc.nextDouble();
inputs[counter] = value;
counter += 1;
} catch (InputMismatchException e) {
System.out.println("Invalid datatype " + e + " please try again!");
}
} while (counter != SIZE);
//sc.close();
return inputs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Object[] getScriptOfValuesAsDouble() {\r\n\t\tArrayList valueDouble;\r\n\t\tvalueDouble = new ArrayList<Double>();\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (var.getType().equals(\"double\") || var.getType().equals(\"int\")) {\r\n\r\n\t\t\t\tif (var.getValue() != null && !var.getValue().equals(\"\") && !var.getValue().equals(\"NaN\")) {\r\n\r\n\t\t\t\t\tvalueDouble.add(var.getValue());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalueDouble.add(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tObject[] values = new Object[valueDouble.size()];\r\n\t\tint i = 0;\r\n\t\tfor (Object d : valueDouble) {\r\n\t\t\tif (d == null) {\r\n\t\t\t\td = 0.0;\r\n\t\t\t}\r\n\r\n\t\t\tvalues[i] = d;\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn values;\r\n\r\n\t}",
"public abstract double[] toDoubleArray();",
"public static double[] readDoubles() {\n return readAllDoubles();\n }",
"public abstract double[] getasDouble(int tuple);",
"public double[] getDoubleList();",
"public void get_InputValues(){\r\n\tA[1]=-0.185900;\r\n\tA[2]=-0.85900;\r\n\tA[3]=-0.059660;\r\n\tA[4]=-0.077373;\r\n\tB[1]=30.0;\r\n\tB[2]=19.2;\r\n\tB[3]=13.8;\r\n\tB[4]=22.5;\r\n\tC[1]=4.5;\r\n\tC[2]=12.5;\r\n\tC[3]=27.5;\r\n\tD[1]=16.0;\r\n\tD[2]=10.0;\r\n\tD[3]=7.0;\r\n\tD[4]=5.0;\r\n\tD[5]=4.0;\r\n\tD[6]=3.0;\r\n\t\r\n}",
"private double[] parseDoubleArray(String[] array) {\r\n double[] result = new double[array.length];\r\n for (int i = 0; i < result.length; i++) {\r\n try {\r\n result[i] = Double.parseDouble(array[i]);\r\n } catch (NumberFormatException e) {\r\n System.out.println(\"Received invalid data \" + array[i] + \", exiting program\");\r\n System.exit(0);\r\n }\r\n }\r\n return result;\r\n }",
"private double[] getUserInputFromUIControls() {\n\t\tHBox n0 = (HBox) uicontrols.getChildren().get(0);\n\t\tHBox n1 = (HBox) uicontrols.getChildren().get(1);\n\t\tHBox n2 = (HBox) uicontrols.getChildren().get(2);\n\t\tHBox n3 = (HBox) uicontrols.getChildren().get(3);\n\t\tTextField t0 = (TextField) n0.getChildren().get(1);\n\t\tTextField t1 = (TextField) n1.getChildren().get(1);\n\t\tTextField t2 = (TextField) n2.getChildren().get(1);\n\t\tTextField t3 = (TextField) n3.getChildren().get(1);\n\t\tdouble[] retval = new double[9];\n\t\tretval[8] = 9;\n\t\ttry {\n\t\t\tretval[0] = Double.parseDouble(t0.getText());\n\t\t\tretval[8] = 10.0;\n\t\t\tretval[1] = Double.parseDouble(t1.getText());\n\t\t} catch(Exception e) {\n\t\t\treturn retval;\n\t\t}\n\t\tString[] date = t2.getText().split(\"-\");\n\t\tif (date.length != 3) {\n\t\t\tretval[8] = 11.0;\n\t\t\treturn retval;\n\t\t}\n\t\ttry {\n\t\t\tretval[2] = floor(Double.parseDouble(date[0]));\n\t\t\tretval[3] = floor(Double.parseDouble(date[1]));\n\t\t\tretval[4] = floor(Double.parseDouble(date[2]));\n\t\t} catch(Exception e) {\n\t\t\tretval[8] = 11.0;\n\t\t\treturn retval;\n\t\t}\n\t\tString[] time = t3.getText().split(\":\");\n\t\tif (time.length != 3) {\n\t\t\tretval[8] = 12.0;\n\t\t\treturn retval;\n\t\t}\n\t\ttry {\n\t\t\tretval[5] = floor(Double.parseDouble(time[0]));\n\t\t\tretval[6] = floor(Double.parseDouble(time[1]));\n\t\t\tretval[7] = floor(Double.parseDouble(time[2]));\n\t\t} catch(Exception e) {\n\t\t\tretval[8] = 12.0;\n\t\t\treturn retval;\n\t\t}\n\t\tretval[8] = 0.0;\n\t\tif (retval[0] == 90.0) {\n\t\t\tretval[0] = 89.9999999;\n\t\t} else if (retval[0] == -90.0) {\n\t\t\tretval[0] = -89.9999999;\n\t\t}\n\t\treturn retval;\n\t}",
"double[][] asDouble();",
"double getDoubleValue3();",
"public double[] makeDouble(String[] vals){\n try {\n double[] result = new double[vals.length - 1];\n\n for (int i = 0; i < vals.length - 1; i++) {\n vals[i] = vals[i].replace(\",\", \".\");\n result[i] = Double.parseDouble(vals[i]);\n }\n return result;\n }catch (Exception e){\n System.out.println(e);\n }\n return null;\n }",
"public abstract void read_double_array(double[] value, int offset, int\nlength);",
"public static double[] parseDouble(String val[]) {\n\t\t\n\t\tif (val != null) {\n\t\t\tdouble ret[] = new double[val.length];\n\t\n\t\t\tfor (int i = 0; i < val.length; i++) {\n\t\t\t\tret[i] = parseDouble(val[i]);\n\t\t\t}\n\t\n\t\t\treturn ret;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"private Data[] getDoubles(double value, int npoints, int nattributes)\n\t{\n\t\tData[] data = new Data[npoints];\n\t\tfor (int i = 0; i < npoints; i++)\n\t\t\tdata[i] = nattributes == 1 ? new DataDouble(value)\n\t\t: new DataArrayOfDoubles(new double[] { value, value });\n\t\t\treturn data;\n\t}",
"public double getValue(double[] parameters);",
"public double[] getAsDoubles() {\n return (double[])data;\n }",
"public double[] getDoubleArray(String property, double[] defaultValue)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\tif (value == null)\n\t\t{\n\t\t\tif (defaultValue == null)\n\t\t\t{\n\t\t\t\taddRequestedProperty(property, \"null\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\taddRequestedProperty(property, Arrays.toString(defaultValue));\n\t\t\treturn defaultValue;\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tScanner in = new Scanner(value.trim().replaceAll(\",\", \" \"));\n\t\t\tArrayListDouble dbl = new ArrayListDouble();\n\t\t\twhile (in.hasNext())\n\t\t\t\tdbl.add(in.nextDouble());\n\t\t\tin.close();\n\n\t\t\treturn dbl.toArray();\n\t\t}\n\t\tcatch (NumberFormatException ex)\n\t\t{\n\t\t\tthrow new PropertiesPlusException(String.format(\n\t\t\t\t\t\"%s = %s cannot be converted to type double[]\", property, value));\n\t\t}\n\t}",
"public static double[] readDoubleVector(DataInputStream input) throws IOException {\n int length = input.readInt();\n\n double[] ret = new double[length];\n\n for (int i = 0; i < length; i++) {\n double value = input.readDouble();\n ret[i] = value;\n }\n\n return ret;\n }",
"public double[] getDoubles()\r\n {\r\n return resultDoubles;\r\n }",
"private static double[] toArray(ArrayList<Double> dbls) {\n double[] r = new double[dbls.size()];\n int i = 0;\n for( double d:dbls ) r[i++] = d;\n return r;\n }",
"public double[] getDoubleArray(String name)\r\n throws NumberFormatException\r\n {\r\n String[] data = getString(name).split(\",\");\r\n double[] value = new double[data.length];\r\n for( int i=0; i<data.length; i++ )\r\n value[i] = Double.parseDouble(data[i].trim());\r\n \r\n return value;\r\n }",
"public double[] getDoubleArray (String variable){\r\n if (matlabEng==null) return null;\r\n double[][] returnValue = matlabEng.engGetArray(id,variable);\r\n return returnValue[0];\r\n}",
"public static double[] stringToDouble(String[] dataArray){\n\t\t\n\t\tint entries = dataArray.length;\n\t\tdouble[] returnData = new double[entries];\n\t\t\n\t\tfor (int i = 0; i < entries ; i++) {\n\t\t\treturnData[i] = Double.parseDouble(dataArray[i]);\n\n\t\t}\n\t\treturn returnData;\n\t}",
"public double[] getValues(String nodeType, int index)\r\n {\r\n\treturn getValues(nodeType, new NodeFilter()\r\n\t { public final boolean accept(Node n) { return true; }},\r\n\t\t\t index);\r\n }",
"public double[] getAllInputValues(){\r\n\t\treturn realValues[0];\r\n\t}",
"public static double[] parseDoubleAndFilterComma(String val[]) {\n\t\t\n\t\tif (val != null) {\n\t\t\tdouble ret[] = new double[val.length];\n\t\n\t\t\tfor (int i = 0; i < val.length; i++) {\n\t\t\t\tif (val[i] != null) {\n\t\t\t\t\tval[i] = val[i].replaceAll(\",\", \"\");\n\t\t\t\t}\n\t\t\t\tret[i] = parseDouble(val[i]);\n\t\t\t}\n\t\n\t\t\treturn ret;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"public double[] getValues(Array2D input) {\n\t\treturn listToDArray( getValuesD(input) );\n\t}",
"public static double[] convertToDouble(JPEGCategory input) {\n\n\t\tdouble[] values = new double[input.getRunlength() + 1];\n\t\tfor (int i = 0; i < input.getRunlength(); i++) {\n\t\t\tvalues[i] = 0;\n\t\t}\n\t\tif (values.length > 1)\n\t\t\tvalues[values.length - 1] = input.getCoeff();\n\t\telse\n\t\t\tvalues[0] = input.getCoeff();\n\t\treturn values;\n\t}",
"public double outputFor(double [] X);",
"private double[] toDoubleArray(float[] arr) {\n\t\tif (arr == null)\n\t\t\treturn null;\n\t\tint n = arr.length;\n\t\tdouble[] outputFloat = new double[n];\n\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\toutputFloat[i] = (double) arr[i];\n\n\t\t}\n\t\treturn outputFloat;\n\t}",
"double readDouble();",
"public static double[] inputData(Scanner console, String c) {\n\t\tSystem.out.println(\"Please enter in the monthly data for \" + c + \". \");\n\t\tdouble[] newArray = new double[months];\n\n\t\tfor (int i = 0; i < months; i++) {\n\t\t\tSystem.out.println(monthsList[i] + \": \");\n\t\t\tnewArray[i] = console.nextDouble();\n\t\t}\n\t\tSystem.out.println();\n\t\treturn newArray;\n\t}",
"public double[] getDoubleArray(final String key) {\n return getDoubleArray(key, ArrayUtils.EMPTY_DOUBLE_ARRAY);\n }",
"@Override\n\tpublic double[] toDoubleArray() {\n\t\treturn null;\n\t}",
"public Double[] getNumbers() throws IOException {\n List<String> numbersStrs= Files.readAllLines(Paths.get(\"C:\\\\Users\\\\user\\\\Desktop\\\\Software construction git repo\\\\calculator\\\\src\\\\java\\\\com\\\\kelaniya\\\\uni\\\\numbers.txt\"));\n double number1=Integer.parseInt(numbersStrs.get(0));\n double number2=Integer.parseInt(numbersStrs.get(1));\n return new Double[] {number1,number2};\n\n }",
"public void readDoubleArray(int row, int col, Scanner sc) {\r\n\t\tdouble[][] b=new double[row][col];\r\n\t\tSystem.out.println(\"enter\"+row*col+\"elements\");\r\n\t\ttry{\r\n\t\t\tfor(int i=0;i<row;i++){\r\n\t\t\t\tfor(int j=0;j<col;j++){\r\n\t\t\t\t\tb[i][j]=sc.nextDouble();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"Enter double data type only\");\r\n\t\t}\r\n\t}",
"public double[] ds() {\n double rval[] = new double[size()];\n for (int i = 0; i < rval.length; i++) {\n rval[i] = get(i) == null ? Double.NaN : get(i).doubleValue();\n }\n\n return rval;\n }",
"public double[] getDoubleArray(final String key, final double... defaultValue) {\n return get(double[].class, key, defaultValue);\n }",
"public double[] getDoubleArray(String property)\n\tthrows PropertiesPlusException\n\t{\n\t\tString value = getProperty(property);\n\t\tif (value == null)\n\t\t\treturn null;\n\t\ttry\n\t\t{\n\t\t\tScanner in = new Scanner(value.trim().replaceAll(\",\", \" \"));\n\t\t\tArrayListDouble dbl = new ArrayListDouble();\n\t\t\twhile (in.hasNext())\n\t\t\t\tdbl.add(in.nextDouble());\n\t\t\tin.close();\n\n\t\t\treturn dbl.toArray();\n\t\t}\n\t\tcatch (NumberFormatException ex)\n\t\t{\n\t\t\tthrow new PropertiesPlusException(String.format(\n\t\t\t\t\t\"%s = %s cannot be converted to type double[]\", property, value));\n\t\t}\n\t}",
"double getDoubleValue1();",
"public ArrayDouble getRecordValues(State state) {\n return new ArrayDouble(opensimSimulationJNI.ExpressionBasedPointToPointForce_getRecordValues(swigCPtr, this, State.getCPtr(state), state), true);\n }",
"double getDoubleValue2();",
"Double getDoubleValue();",
"public double[] getDoubleArray() {\r\n\t\treturn (value.getDoubleArray());\r\n\t}",
"public Object[] getScriptOfValuesAsInt() {\r\n\t\tArrayList valueDouble;\r\n\t\tvalueDouble = new ArrayList<Integer>();\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (var.getType().equals(\"double\") || var.getType().equals(\"int\")) {\r\n\r\n\t\t\t\tif (var.getValue() != null && !var.getValue().equals(\"\")) {\r\n\r\n\t\t\t\t\tvalueDouble.add(var.getValue());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalueDouble.add(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tObject[] values = new Object[valueDouble.size()];\r\n\t\tint i = 0;\r\n\t\tfor (Object d : valueDouble) {\r\n\t\t\tif (d == null) {\r\n\t\t\t\td = 0;\r\n\t\t\t}\r\n\t\t\tvalues[i] = d;\r\n\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn values;\r\n\r\n\t}",
"public abstract double read_double();",
"private static double[] randomDoubles(int elements) {\n double[] array = new double[elements];\n for (int i = 0; i < array.length; i++) {\n double chance = Math.random();\n if (chance < 0.25) \n array[i] = Math.random() * (1000);\t\n else if (chance <= 0.50)\n array[i] = Math.random() * (1001);\t\n else if (chance <= 0.75)\n array[i] = Math.random() * (1002);\n else\n array[i] = Math.random() * (1003);\t\n }\n return array;\n }",
"private List<Double> double2List(final double[] array) {\n\t\tList<Double> result = new ArrayList<Double>();\n\t\tfor (double n : array) {\n\t\t\tresult.add(new Double(n));\n\t\t}\n\t\treturn result;\n\t}",
"private Data[] getFloats(double value, int npoints, int nattributes)\n\t{\n\t\tData[] data = new Data[npoints];\n\t\tfor (int i = 0; i < npoints; i++)\n\t\t\tdata[i] = nattributes == 1 ? new DataFloat((float) value)\n\t\t: new DataArrayOfFloats(new float[] { (float) value,\n\t\t\t\t(float) value });\n\t\t\treturn data;\n\t}",
"public static ListaVinculada<Double> stringtodoublearray(ListaVinculada<String> coleccion){\n ListaVinculada<Double> coleccionD = new ListaVinculada<>();\n for (String dato : coleccion) {\n coleccionD.add(Double.parseDouble(dato));\n }\n return coleccionD;\n }",
"void writeDoubles(double[] d, int off, int len) throws IOException;",
"public static double method1(double[] numbers, Scanner input) {\r\n double sum = 0;\r\n System.out.print(\"enter the numbers: \");\r\n for (int i = 0; i < numbers.length; i++) {\r\n numbers[i] = input.nextDouble();\r\n sum += numbers[i];\r\n }\r\n\r\n return (sum / numbers.length);\r\n }",
"public double[] getValues(String nodeType, NodeFilter nf, int index)\r\n {\r\n\tfinal Node[] nodes = getNodes(nodeType, nf);\r\n\tfinal double[] result = new double[nodes.length];\r\n\r\n\tfor (int i=0; i<nodes.length; i++)\r\n\t result[i] = nodes[i].getValue(index);\r\n\treturn result;\r\n }",
"@Test\n public void testTimescales_IDoubleArray_double()\n {\n IDoubleArray T = null;\n double tau = 0.0;\n MarkovModelUtilities instance = new MarkovModelUtilities();\n IDoubleArray expResult = null;\n IDoubleArray result = instance.timescales(T, tau);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}",
"private double getTextToDouble(JTextField text) {\n try {\n Double.parseDouble(text.getText());\n\n } catch (NumberFormatException e) {\n JOptionPane.showMessageDialog(null, \"Input format for : \" + text.getText() + \" is illegal! Input number!\"\n , \"Error message\", JOptionPane.ERROR_MESSAGE);\n }\n return Double.parseDouble(text.getText());\n\n }",
"public double[] toArray() {\n\t\treturn new double[] {x, y, z};\n\t}",
"double evaluate(double[] argument);",
"public static double getValidDouble() {\n\n // This keeps looping until double input is received.\n while (!scnr.hasNextDouble()) {\n scnr.nextLine(); // clear the buffer\n System.out.print(\"Please enter an value! \");\n }\n\n double doubleNum = scnr.nextDouble();\n scnr.nextLine();\n\n return doubleNum;\n }",
"public static List<Double> asList(double[] array) {\n\t\treturn new DoubleArrayList(array);\n\t}",
"double[] getReferenceValues();",
"public static double[] stringToDoubleArray(String s, String div){\n\t\tString[] ugh = s.split(div);\n\t\tdouble[] output = new double[ugh.length];\n\t\tfor (int i=0; i<ugh.length; i++){\n\t\t\toutput[i]=parseDouble(ugh[i]);\n\t\t}\n\t\treturn output;\n\t}",
"public abstract Double getDataValue();",
"public abstract double readAsDbl(int offset);",
"public Iterable<Double> getDoubles(String key);",
"public double[] getValues(String nodeType, String fieldName)\r\n {\r\n\tfinal int index = getAttributes(nodeType).getAttributeIndex(fieldName);\r\n\treturn getValues(nodeType, index);\r\n }",
"public static List<Double> toList(final double[] array) {\n List<Double> list = new ArrayList<Double>(array.length);\n for (int i = 0; i < array.length; i++) {\n list.add(array[i]);\n }\n return list;\n }",
"private static List<Double> parse_line_double(String line, int d) throws Exception {\n\t List<Double> ans = new ArrayList<Double>();\n\t StringTokenizer st = new StringTokenizer(line, \" \");\n\t if (st.countTokens() != d) {\n\t throw new Exception(\"Bad line: [\" + line + \"]\");\n\t }\n\t while (st.hasMoreElements()) {\n\t String s = st.nextToken();\n\t try {\n\t ans.add(Double.parseDouble(s));\n\t } catch (Exception ex) {\n\t throw new Exception(\"Bad Integer in \" + \"[\" + line + \"]. \" + ex.getMessage());\n\t }\n\t }\n\t return ans;\n\t }",
"public List<Double> getAsDoubleList(String itemName, List<Double> defaultValue);",
"public boolean isDouble();",
"public FCMResult [] getResults(double[][] inputs) throws Exception{\n FCMResult [] result = new FCMResult[inputs.length];\n for (int i = 0; i < result.length; i++) {\n result[i] = getSingleResult(inputs[i]);\n }\n return result;\n }",
"public double[] get(int $param_int_1, int $param_int_2, double[] $param_arrayOf_double_3) {\n java.lang.Object $__result = null;\n try {\n if ($__directInvocation)\n $__result = super.get( $param_int_1, $param_int_2, $param_arrayOf_double_3);\n else {\n java.util.ArrayList<Object> $__params = new java.util.ArrayList<Object>();\n String $__method = \"public double[] boofcv.struct.image.InterleavedF64.get(int,int,double[])\";\n $__params.add($param_int_1);\n $__params.add($param_int_2);\n $__params.add($param_arrayOf_double_3);\n $__result = $__client.onRPC($__method, $__params);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return ((double[]) $__result);\n }",
"public native double[] __doubleArrayMethod( long __swiftObject, double[] arg );",
"public double getDoubleValue() {\n\t\treturn Double.parseDouble(userInput);\n\t}",
"public org.astrogrid.stc.coords.v1_10.beans.Double3Type[] xgetPointArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(POINT$0, targetList);\n org.astrogrid.stc.coords.v1_10.beans.Double3Type[] result = new org.astrogrid.stc.coords.v1_10.beans.Double3Type[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }",
"protected abstract void setValues(double[] values);",
"public TemperatureDifferenceCalculator(double[] list)\n {\n data = list;\n }",
"public double[] asArray() {\n final double[] result = new double[COMPONENTS];\n asArray(result);\n return result;\n }",
"public void set(double[] ad);",
"public double[] toDoubleArray(double[] array) {\n\t\tif (array == null) {\n\t\t\tarray = new double[point.length];\n\t\t}\n\t\tSystem.arraycopy(point, 0, array, 0, point.length);\n\t\treturn array;\n\t}",
"private void testDoubleArray() {\n\t\tMessage message = Message.createMessage(getId(), \"Triggers\");\n\n\t\tdouble array[] = { 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9 };\n\t\tmessage.setPayload(array);\n\n\t\tSystem.out.println(\"Client: [\" + getClientName() + \"] sending test double array\");\n\t\tsend(message);\n\t}",
"Double getValue();",
"public static double average (double ... numbers)\r\n\t{",
"public static Double[] getDoublesFromString(String valueString, String delimiter) {\n // first, check if not null array was provided\n if (valueString == null) {\n return null;\n }\n // split string into array of tokens\n String[] valuesArray = valueString.split(delimiter);\n Double[] output = new Double[valuesArray.length];\n // for each of tokens, try to parse into double\n for (int i = 0; i < valuesArray.length; i++) {\n output[i] = getDoubleFromString(valuesArray[i]);\n }\n return output;\n }",
"private double[] limits(double a, double b, double c) {\n\t\tif (a > 1.0 || a < 0.0) {\n\t\t\tif (a > 1.0) {\n\t\t\t\ta = 1.0;\n\t\t\t} else {\n\t\t\t\ta = 0.0;\n\t\t\t}\n\t\t}\n\t\tif (b > 1.0 || b < 0.0) {\n\t\t\tif (b > 1.0) {\n\t\t\t\tb = 1.0;\n\t\t\t} else {\n\t\t\t\tb = 0.0;\n\t\t\t}\n\t\t}\n\t\tif (c > 1.0 || c < 0.0) {\n\t\t\tif (c > 1.0) {\n\t\t\t\tc = 1.0;\n\t\t\t} else {\n\t\t\t\tc = 0.0;\n\t\t\t}\n\t\t}\n\n\t\treturn new double[] { a, b, c };\n\t}",
"public static PointD[] fillData() {\n ArrayList<PointD> vals = new ArrayList();\n while (scn.hasNextLine()) {\n String[] xandy = scn.nextLine().split(\"\\\\s*,\\\\s*\");\n vals.add(new PointD(Double.parseDouble(xandy[0]), Double.parseDouble(xandy[1])));\n }\n PointD[] vals2 = new PointD[vals.size()];\n for (int x = 0; x < vals.size(); x++) {\n vals2[x] = vals.get(x);\n }\n return vals2;\n }",
"@Override protected void readDoublesIntoBuf(MathGate mathGate, double[] buffer) {\r\n\t\tif (myMathExpr != null) {\r\n\t\t\tmathGate.parseAndEvalExprToDoubleVec(myMathExpr, buffer);\r\n\t\t} else {\r\n\t\t\ttheLogger.debug(\"No expression found.\");\r\n\t\t}\r\n\t}",
"public Snippet visit(CoercionToDoubleExpression n, Snippet argu) {\n\t Snippet _ret= new Snippet(\"\",\"\",null,false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t _ret = n.expression.accept(this, argu);\n\t _ret.returnTemp = \"(\" + \"double\" + \")\" + _ret.returnTemp;\n\t\t\t_ret.expType = new X10Double();\n\t return _ret;\n\t }",
"public static Double[] convertirTableau(ArrayList<Double> valeurs) {\n\t\tDouble[] tab = new Double[valeurs.size()];\n\t\tfor(int i = 0; i <valeurs.size(); i++) {\n\t\t\ttab[i] = valeurs.get(i);\n\t\t}\n\t\treturn tab;\n\t}",
"public double getDouble(String prompt) {\n do {\n try {\n String item = getToken(prompt);\n double f = Double.parseDouble(item);\n return f;\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Please input a number \");\n }\n } while (true);\n }",
"public double getDouble(String prompt) {\n do {\n try {\n String item = getToken(prompt);\n double f = Double.parseDouble(item);\n return f;\n }\n catch (NumberFormatException nfe) {\n System.out.println(\"Please input a number \");\n }\n } while (true);\n }",
"public void setInputs(ArrayList<Double> inputs)\n {\n this.inputs = inputs;\n }",
"public static double[][] stringToDouble(String[][] dataArray){\n\t\t\n\t\tint rows = dataArray.length;\n\t\tint cols = dataArray[0].length;\n\t\t\n\t\tdouble[][] returnData = new double[rows][cols];\n\t\t\n\t\tfor (int i = 0; i < rows ; i++) {\n\t\t\tfor (int j = 0; j < cols ; j++) {\n\t\t\t\treturnData[i][j] = Double.parseDouble(dataArray[i][j]);\n\t\t\t}\n\t\t}\n\t\treturn returnData;\n\t}",
"public static Spliterator.OfDouble spliterator(double[] paramArrayOfdouble, int paramInt1, int paramInt2, int paramInt3) {\n/* 371 */ checkFromToBounds(((double[])Objects.requireNonNull((T)paramArrayOfdouble)).length, paramInt1, paramInt2);\n/* 372 */ return new DoubleArraySpliterator(paramArrayOfdouble, paramInt1, paramInt2, paramInt3);\n/* */ }",
"public org.apache.spark.ml.param.ParamPair<double[]> w (java.util.List<java.lang.Double> value) { throw new RuntimeException(); }",
"public void setArray(double[] paramArrayOfDouble)\n/* */ {\n/* 725 */ if (paramArrayOfDouble == null) {\n/* 726 */ setNullArray();\n/* */ }\n/* */ else {\n/* 729 */ setArrayGeneric(paramArrayOfDouble.length);\n/* */ \n/* 731 */ this.elements = new Object[this.length];\n/* */ \n/* 733 */ for (int i = 0; i < this.length; i++) {\n/* 734 */ this.elements[i] = Double.valueOf(paramArrayOfDouble[i]);\n/* */ }\n/* */ }\n/* */ }",
"public abstract double getasDouble(int tuple, int val);",
"public static void arrayInputs(double[] array, int arraySize) {\r\n Scanner input = new Scanner(System.in);\r\n System.out.println(\"Please enter \" + arraySize + \" variables: \");\r\n for (int x = 0; x < arraySize; x++) {\r\n array[x] = input.nextDouble();\r\n }\r\n arrayAverage(array, arraySize);\r\n }",
"public static double readDouble() {\n try {\n return scanner.nextDouble();\n }\n catch (InputMismatchException e) {\n String token = scanner.next();\n throw new InputMismatchException(\"attempts to read a 'double' value from standard input, \"\n + \"but the next token is \\\"\" + token + \"\\\"\");\n }\n catch (NoSuchElementException e) {\n throw new NoSuchElementException(\"attempts to read a 'double' value from standard input, \"\n + \"but no more tokens are available\");\n }\n }",
"public double[] getValues(String nodeType, NodeFilter nf, String fieldName)\r\n {\r\n\tfinal int index = getAttributes(nodeType).getAttributeIndex(fieldName);\r\n\treturn getValues(nodeType, nf, index);\r\n }"
]
| [
"0.69733083",
"0.6777918",
"0.67564243",
"0.6686361",
"0.6608317",
"0.6547952",
"0.6515843",
"0.64117414",
"0.6406656",
"0.6381335",
"0.63456553",
"0.6244769",
"0.6221729",
"0.6184726",
"0.6148417",
"0.6142775",
"0.6054733",
"0.60193765",
"0.6016646",
"0.5970983",
"0.59660184",
"0.591787",
"0.5873127",
"0.58623457",
"0.5839239",
"0.58053166",
"0.5796148",
"0.57754964",
"0.57373315",
"0.57316405",
"0.56948805",
"0.5691945",
"0.56887954",
"0.568257",
"0.5671341",
"0.5660436",
"0.56566024",
"0.56548184",
"0.5642801",
"0.56289506",
"0.5627323",
"0.56259614",
"0.56157565",
"0.561091",
"0.55886436",
"0.55862826",
"0.55825907",
"0.5573094",
"0.5566196",
"0.55614555",
"0.5558805",
"0.552262",
"0.55003375",
"0.54593587",
"0.545753",
"0.5451697",
"0.54500294",
"0.54476196",
"0.54342747",
"0.5433144",
"0.5429783",
"0.5429425",
"0.54171216",
"0.54111886",
"0.54098135",
"0.54087985",
"0.54080045",
"0.5406507",
"0.5396465",
"0.53911084",
"0.5371618",
"0.5369206",
"0.536132",
"0.5352089",
"0.5346854",
"0.533459",
"0.5332952",
"0.5331334",
"0.5326097",
"0.53224385",
"0.5322015",
"0.53193176",
"0.531067",
"0.5306943",
"0.53025234",
"0.5296291",
"0.5285315",
"0.5285171",
"0.528334",
"0.5276155",
"0.5276155",
"0.52739644",
"0.5265935",
"0.5265888",
"0.5261834",
"0.5258145",
"0.5252931",
"0.5247016",
"0.5246895",
"0.5240336"
]
| 0.6561817 | 5 |
Returns the larger of the two roots of the quadratic equation Axx + Bx + C = 0, provided it has any roots. If A == 0 or if the discriminant, BB 4AC, is negative, then an exception of type IllegalArgumentException is thrown. | private static double root( double A, double B, double C ) throws IllegalArgumentException {
if (A == 0) {
throw new IllegalArgumentException("A can't be zero.");
}
else {
double disc = B*B - 4*A*C;
if (disc < 0)
throw new IllegalArgumentException("Discriminant < zero.");
return (-B + Math.sqrt(disc)) / (2*A);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void solve(double a, double b, double c) {\n double d = Math.pow(b, 2) - 4 * a * c;\n if (Double.isInfinite(1 / d)) {\n System.out.println(\"x1,2 = \" + (-b + Math.sqrt(d)) / (2 * a));\n } else if (d > 0) {\n System.out.println(\"x1 = \" + (-b + Math.sqrt(d)) / (2 * a));\n System.out.println(\"x2 = \" + (-b - Math.sqrt(d)) / (2 * a));\n } else {\n System.out.println(\"Error! Discriminant is less than zero!\");\n }\n }",
"public static void main(String[] args) {\n double numA;\n double numB;\n double numC;\n double delta;\n\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter number a: \");\n numA = sc.nextDouble();\n System.out.print(\"Enter number b: \");\n numB = sc.nextDouble();\n System.out.print(\"Enter number c: \");\n numC = sc.nextDouble();\n delta = Math.pow(numB,2) - (4*numA*numC);\n\n if (numA == 0){\n if (numB == 0){\n if (numC == 0){\n System.out.println(\"Equation countless solutions\");\n }else {\n System.out.println(\"Equation has no solution\");;\n }\n }else {\n System.out.println(\"Equation has 1 solution x = \" + (-numB/numA));\n }\n }else {\n if (delta < 0){\n System.out.println(\"Equation has no solution\");\n }else if (delta == 0){\n System.out.println(\"Equation has 1 solution x = \" + (-numB/(2*numA)));\n }else {\n System.out.println(\"Equation has 2 solutions x1 = \" + (-numB+Math.sqrt(delta))/(2*numA));\n System.out.println(\"Equation has 2 solutions x2 = \" + (-numB-Math.sqrt(delta))/(2*numA));\n }\n }\n }",
"public static double calcRoot( double coef_B, double discrimSqrt, double denom ) \r\n {\n return 0;\r\n }",
"public int solve(int A, int B, int C) {\n int lcm = (B * C) / gcd(B, C);\n return A / lcm;\n }",
"public static Set<Integer> roots(int a, int b, int c) {\n assert ((b*b) - (4*a*c)) >= 0; // Check for complex numbers.\n Set<Integer> solutions = new HashSet<Integer>();\n int x1 = (int)(-b + Math.sqrt((b*b)-(4*a*(long)c))) / (2*a);\n int x2 = (int)(-b - Math.sqrt((b*b)-(4*a*(long)c))) / (2*a);\n // Check if the integer part of x1 solves the equation.\n if (a * x1 * x1 + b * x1 + c == 0)\n solutions.add(x1);\n // Check if the integer part of x2 solves the equation.\n if (a * x2 * x2 + b * x2 + c == 0)\n solutions.add(x2);\n return solutions;\n }",
"public static double root(double a, double b, double c, int eps) {\n if (a == 0 && b == 0)\n return Double.NaN;\n else if (a == 0)\n return -c / b;\n else {\n double sqb = sq(b);\n double ac = 4*a*c;\n if (almost_equals(sqb,ac) || sqb > ac) \n return (-b + eps * sqrt_safe(sqb-ac)) / (2 * a);\n return Double.NaN; \n }\n }",
"public static void equation(int a, int b, int c) {\n\t\tint D = b * b - 4 * a * c;\n\t\tif (D < 0) {\n\t\t\tSystem.out.println(\"There isn\\t any real roots\");\n\t\t} else {\n\t\t\tdouble x1 = (-b + Math.sqrt(D)) / (2.0 * a);\n\t\t\tdouble x2 = (-b - Math.sqrt(D)) / (2.0 * a);\n\t\t\tSystem.out.println(\"x1: \" + x1 + \" x2: \" + x2);\n\t\t}\n\t}",
"public static void main(String args[]) {\n\t\t\n\t\t//declare the variables of equation ax*x + b*x + c = 0 \n\t\tdouble a,b,c;\n\t\t\n\t\t//define scanner variable x as\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\t//initiate the value to command line input\n\t\tSystem.out.println (\"give value of x^2 coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\ta = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of x coefficient\");\n\t\t\n\t\t//now add input to variable a \n\t\tb = scan.nextDouble();\n\n //initiate the value to command line input\n\t\tSystem.out.println (\"give value of contant\");\n\t\t\n\t\t//now add input to variable a \n\t\tc = scan.nextDouble();\n \n //declare discriminant of the equation as b^2 - 4*a*c\n double d = Math.pow(b, 2.0) - 4.0*a*c;\n \n //apply the rules for quadratic equations\n //if d =0.0 then roots are equal\n if (d == 0.0) {\n \t\n \t//the root in these situation is -b/2a\n \tSystem.out.println(\"the equation has \"+(-1.0*b/(2.0*a)) + \" as only real root\");\n }\n else if (d >=0.0) {\n \t\n \t//the root in this situation is (-b +- d^0.5)/2a\n \t//the first root is x1\n \tdouble x1 = (-1.0*b + Math.pow(d, 0.5))/(2.0*a);\n \t\n \t//the second root is x2\n \tdouble x2 = (-1.0*b - Math.pow(d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(x1) + \" and \"+(x2) +\" as two real roots\");\n }\n else {\n \t\n \t//the root in this situation are complex (-b +- d^0.5i)/2a\n \t//the real part of root is r\n \tdouble real = (-1.0*b)/(2.0*a);\n \t\n \t//the complex part of root is c\n \tdouble com = (Math.pow(-1.0*d, 0.5))/(2.0*a);\n \tSystem.out.println(\"the equation has \"+(real) + \"+\"+(com) +\"i and \"+real+\"-\"+com+\"i as two complex root\" );\n }\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n double a = scanner.nextDouble();\n double b = scanner.nextDouble();\n double c = scanner.nextDouble();\n\n double determinant = b * b - 4 * a * c;\n\n double root1;\n double root2;\n\n\n\n // two real and distinct roots\n root1 = (-b + Math.sqrt(determinant)) / (2 * a);\n root2 = (-b - Math.sqrt(determinant)) / (2 * a);\n\n if (root2 < root1) {\n System.out.println(root2 + \" \" + root1);\n } else {\n System.out.println(root1 + \" \" + root2);\n }\n\n\n\n }",
"public static double quadraticPos(double a, double b, double c) {\n\t\tdouble root1 = ((b*-1) + Math.sqrt(b*b-4*a*c))/(2*a);\r\n\t\treturn root1;\r\n\t\t\r\n\t}",
"static final public double[] quadraticSolver(\r\n\t\t\tdouble a, double b, double c\r\n\t) {\r\n\t\tfinal double r = (b * b) - (4.0 * a * c);\r\n\t\tif (r < 0.0)\r\n\t\t\treturn null;\r\n\t\tfinal double q = -0.5 * (b + (Math.signum(b) * Math.sqrt(r)));\r\n\t\treturn new double[] { q / a, c / q };\r\n\t}",
"public static void main(String[] args) {\n int r1 = 45_000; // a root ~45,000 means c is ~2,000,000,000, which is close to the maximum integer 2^31 - 1\n int r2 = -45_000;\n System.out.println(\"For the equation x^2 - 4x + 3 = 0, the possible solutions are:\");\n Set<Integer> result = roots(1, -r1-r2, r1*r2);\n System.out.println(result);\n }",
"public void linearEquation(double a, double b, double c){\n //if a = b = 0; x can be any real value\n this.a = a;\n this.b = b;\n this.c = c;\n if(a == 0 && b==0 && c==0) {\n System.out.println(\"Infinite solution\");\n\n }\n\n else {\n x = (c-b)/a;\n\n //if a = 0, x is undefined\n System.out.println(x);\n if(a==0){\n System.out.println(\"No solution\");\n }\n\n\n }\n }",
"public int solve(int[] A) {\n\n\t\tint gcd = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tgcd = GCD(gcd, A[i]);\n\t\t}\n\n\t\tif (gcd > 1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n\t\tint x;\n\t\tint x1;\n\t\tint x2;\n\t\tint disc;\n\t\tSystem.out.println(\"Resolvons Ax2 + Bx + C = 0\");\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"Donnez A : \");\n\t\tint A = sc.nextInt();\n\t\tSystem.out.print(\"Donnez B : \");\n\t\tint B = sc.nextInt();\n\t\tSystem.out.print(\"Donnez C : \");\n\t\tint C = sc.nextInt();\n\t\tdisc = (B*B)-4*A*C;\n\t\tif(A==0 && B==0 && C==0) {\n\t\t\tSystem.out.println(\"tout reel est solution\");\n\t\t}\n\t\telse if(A==0 && B==0) {\n\t\t\tSystem.out.println(\"Pas de solution\");\n\t\t}\n\t\telse if(A==0) {\n\t\t\tx=-C/B;\n\t\t\tSystem.out.println(\"la solution est :\"+x);\n\t\t}\n\t\telse if (disc<0) {\n\t\t\tSystem.out.println(\"Pas de solution le discriminant est negatif\");\n\t\t}\n\t\telse {\n\t\t\tx1=(-B + (int)Math.sqrt(disc))/(2*A);\n\t\t\tx2=(-B - (int)Math.sqrt(disc))/(2*A);\n\t\t\t\n\t\t\tSystem.out.println(\"Les solutions sont : x1 = \"+x1+ \" et x2 = \"+x2);\n\n\t\t\t\n\t\t}\n\t}",
"@Test\n public void test28() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n double double0 = complex0.abs();\n Complex complex1 = (Complex)complex0.readResolve();\n try { \n complex0.nthRoot((-504));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -504\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static double calcDiscrim( double coef_A, double coef_B, double coef_C )\r\n {\n return 0;\r\n }",
"public int solve(ArrayList<Integer> A) {\n int n = A.size();\n \t\n \tvis = new boolean[n];\n\t\tG = new ArrayList[n];\n\t\t\n\t\t// making the graph\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tG[i] = new ArrayList<Integer>();\n\t\t}\n\t\t\n\t\t// adding edges to graph\n \tfor(int i=0; i<n; i++){\n \t int par = A.get(i);\n \t\tif(par != -1){\n \t\t\tG[i].add(par);\n \t\t\tG[par].add(i);\n \t\t}\n \t}\n \t\n \t//filling vis array to 0\n \tArrays.fill(vis, false);\n \t\n \t//running first dfs to find the farthest node from root.\n \t//It will be stored in variable root.\n \tans=0;\n \tdfs(0 , 0);\n \t\n \t//running second dfs to find the farthest node from TreeNode node (as found in last dfs).\n \t//This distance will be stored in variable ans.\n \tArrays.fill(vis, false);\n \tans = 0;\n \tdfs(node , 0);\n \t\n \t//ans is the required result\n \treturn ans;\n }",
"public boolean geq(Inatnum a) throws Exception {\n\t\tif((this.isZero() &&a.isZero())==true) {return true;}//if our first value is zero and our a value is zero then return true\n\t\tif((this.isZero())==false&&a.isZero()==true) {return true;}// if our first value isnt zero and our a value is then return true\n\t\tif((this.isZero())==true&&a.isZero()==false) {return false;}//if our first value is zero and our a value is not then return false\n\t\telse {return this.pred().geq(a.pred());\t}}",
"public static double root2b(double a, double b, double c,int eps) {\n if (a == 0 && b == 0) \n return Double.NaN; \n else if (a == 0) \n return -c/(2*b);\n else {\n double sqb = sq(b);\n double ac = a*c;\n if (almost_equals(sqb,ac) || sqb > ac) \n return (-b + eps*sqrt_safe(sqb-ac))/a;\n return Double.NaN; \n } \n }",
"public abstract GF2nElement solveQuadraticEquation()\n throws RuntimeException;",
"public static BigDecimal sqrt(BigDecimal A, final int SCALE) {\n BigDecimal x0 = new BigDecimal(\"0\");\n BigDecimal x1 = new BigDecimal(Math.sqrt(A.doubleValue()));\n while (!x0.equals(x1)) {\n x0 = x1;\n x1 = A.divide(x0, SCALE, ROUND_HALF_UP);\n x1 = x1.add(x0);\n x1 = x1.divide(TWO, SCALE, ROUND_HALF_UP);\n }\n return x1;\n }",
"public int solution(int[] A) {\n Arrays.sort(A);\n int max = Integer.MIN_VALUE;\n max = Math.max(max,A[0]*A[1]*A[A.length-1]);\n max = Math.max(max,A[A.length-3]*A[A.length-2]*A[A.length-1]);\n return max;\n }",
"private static void calculateRoot() throws IllegalArgumentException {\n\t\tdouble[] userInputs = getInputs();\n\t\tdouble value = Main.root(userInputs[0], userInputs[1], userInputs[2]);\n\t\tSystem.out.println(\"The root value is: \" + value);\n\t}",
"@Test\n public void test16() throws Throwable {\n Complex complex0 = new Complex(0.0, 236.4);\n Complex complex1 = complex0.asin();\n Complex complex2 = complex1.atan();\n Complex complex3 = complex0.sin();\n Complex complex4 = (Complex)complex0.readResolve();\n double double0 = complex0.abs();\n Complex complex5 = complex0.log();\n Complex complex6 = complex1.sin();\n Complex complex7 = complex0.cos();\n String string0 = complex3.toString();\n Complex complex8 = complex1.multiply(complex2);\n try { \n complex3.nthRoot((-1));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -1\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\r\n System.out.println(\"Enter a, b, c: \");\r\n int a = input.nextInt(), b = input.nextInt(), c = input.nextInt();\r\n\r\n // 创建对象+调用构造方法\r\n QuadraticEquation qe = new QuadraticEquation(a, b, c);\r\n\r\n // 获取判别式结果\r\n double judge = qe.getDiscriminant();\r\n\r\n if (judge > 1){\r\n System.out.printf(\"%.3f %.3f\\n\", qe.getRoot1(), qe.getRoot2());\r\n } else if (judge < 0.0001 && judge > -0.0001){\r\n System.out.printf(\"%.3f\\n\", qe.getRoot1());\r\n } else {\r\n System.out.printf(\"The equation has no roots\");\r\n }\r\n }",
"public int solution(int[] A) {\n\t\tif (A.length == 1)\n\t\t\treturn Math.abs(A[0]);\n\n\t\tint result = -1;\n\t\tint left, right;\n\t\tint sumAll = 0;\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tsumAll = sumAll + A[i];\n\t\t}\n\n\t\tfor (int i = 1; i < A.length; i++) {\n\t\t\tleft = 0;\n\t\t\tright = 0;\n\t\t\tfor (int j = 0; j < i; j++) {\n\t\t\t\tleft = left + A[j];\n\t\t\t}\n\t\t\tright = sumAll - left;\n\t\t\tint value = Math.abs(left - right);\n\t\t\tif (result == -1 || value < result)\n\t\t\t\tresult = value;\n\t\t}\n\t\treturn result;\n\t}",
"public static void main(String[] args) {\n\t\tint a, b, c;\r\n\t\tSystem.out.println(\"Quadratic equation \\tax^2+bx+c=0\");\r\n\t\tSystem.out.println();\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter the value of a: \");\r\n\t\ta = input.nextInt();\r\n\t\tSystem.out.print(\"Enter the value of b: \");\r\n\t\tb = input.nextInt();\r\n\t\tSystem.out.print(\"Enter the value of c: \");\r\n\t\tc = input.nextInt();\r\n\t\tif(b<0 && c<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 %dx %d\", a, b, c);\r\n\t\t}else if(c<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 + %dx %d\", a, b, c);\r\n\t\t}else if(b<0) {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 %dx + %d\", a, b, c);\r\n\t\t}else {\r\n\t\t\tSystem.out.printf(\"Equation = %dx^2 + %dx + %d\", a, b, c);\r\n\t\t}\r\n\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"\\nQr = b^2 - 4ac\");\r\n\t\tint x;\r\n\t\tx = (int) (Math.pow(b, 2) - 4*a*c);\r\n\t\tSystem.out.printf(\"Qr = %d\", x);\r\n\t\tSystem.out.print(\"\\n\\nRoots of the equqtion are: \");\r\n\t\tif(x<0) {\r\n\t\t\tSystem.out.println(\"Imaginary/complex\");\r\n\t\t}else if(x==0) {\r\n\t\t\tSystem.out.println(\"Real and equal\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"Real and distinct\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\t}",
"static double[] solve(double[][] A, double[] b) {\n int m = A.length; // == b.length == var num\n if (m != A[0].length) {\n return notSquare(A, b); // A and b is from row echelon form\n } else {\n if (compareWithZero(A[m - 1][m - 1]) != 0) {\n double[] solutionsArray = new double[m];\n for (int i = m - 1; i >= 0; i--) {\n double sum = 0;\n for (int j = m - 1; j > i; j--) {\n sum += solutionsArray[j] * A[i][j];\n }\n solutionsArray[i] = (b[i] - sum) / A[i][i];\n }\n System.out.println(\"YES\");\n return solutionsArray;\n } else {\n if (compareWithZero(b[b.length - 1]) == 0) {\n double[][] Anew = withoutLastRow(A);\n double[] bnew = withoutLastElem(b);\n return solve(Anew, bnew);\n } else {\n System.out.println(\"NO\");\n return new double[0];\n }\n }\n }\n }",
"static double sqrt(double number) {\n\t\tdouble answer = number / 2;\r\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative square roots\"); \r\n=======\n\tpublic static double sqrt(int number) { //gonna be honest here: idk??\r\n\t\tint div = number*number;\r\n\t\tif(number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no square roots of negative numbers\");\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\t}\r\n\t\twhile (((answer * answer) - number) >= .005 || ((answer * answer) - number) <= -.005) {\r\n\t\t\tanswer = 0.5 * (number / answer + answer);\r\n\t\t}\r\n\t\treturn round2(answer);\r\n\t}\r\n\t\r\n\tpublic static String quadForm(int a, int b, int c) { //need round2 so uhhhhh\r\n\t\tif(b == 0) {\r\n\t\t\tSystem.out.println(round2(c));\r\n\t\t}\r\n\r\n\t\tif(discriminant(a, b, c) == 0) {\r\n\t\t\treturn(\"Roots: \" + round2((b * -1) / (2 *a)));\t\r\n\t\t}\r\n\t\t\r\n\t\tif(discriminant(a, b, c) > 0) {\r\n\t\t\treturn(\"Roots: \" + round2(b * -1) + (sqrt(b * b - (4 * a * c))));\r\n\t\t}\r\n\t\t\r\n\t\treturn(\"no real roots\");\r\n\t}\r\n}",
"public static int longIncrSubsq(int[] A) {\n int[] L = new int[A.length];\n // init\n for (int i = 0; i < A.length; i++) {\n boolean hasGreaterItem = false;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n hasGreaterItem = true;\n break;\n }\n }\n if (!hasGreaterItem) {\n L[i] = 1;\n }\n }\n // recursive\n int maxL = 0;\n for (int i = A.length - 1; i >= 0; i--) {\n if (L[i] != 1) {\n int maxGreaterL = 0;\n for (int j = i + 1; j < A.length; j++) {\n if (A[j] > A[i]) {\n if (L[j] > maxGreaterL) {\n maxGreaterL = L[j];\n }\n }\n }\n L[i] = 1 + maxGreaterL;\n }\n if (L[i] > maxL)\n maxL = L[i];\n }\n return maxL;\n }",
"public static void solveQuadraticEquation() {\n }",
"@Test\n public void test07() throws Throwable {\n RegulaFalsiSolver regulaFalsiSolver0 = new RegulaFalsiSolver(0.15, 0.0, 1315.10543666213);\n Asinh asinh0 = new Asinh();\n AllowedSolution allowedSolution0 = AllowedSolution.ABOVE_SIDE;\n // Undeclared exception!\n try { \n regulaFalsiSolver0.solve(0, (UnivariateRealFunction) asinh0, 2.479773539153719E-5, 2209.1881, 0.0, allowedSolution0);\n } catch(IllegalStateException e) {\n //\n // illegal state: maximal count (0) exceeded: evaluations\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.BaseAbstractUnivariateRealSolver\", e);\n }\n }",
"public static void quadEquation(final int a, final int b, final int c) {\n /*\n quadratic roots.\n */\n double r1;\n double r2;\n final int t = 4;\n r1 = (-b + Math.sqrt((b * b) - (t * a * c))) / (2 * a);\n r2 = (-b - Math.sqrt((b * b) - (t * a * c))) / (2 * a);\n System.out.println(r1 + \" \" + r2);\n }",
"@Test\n public void test03() throws Throwable {\n RegulaFalsiSolver regulaFalsiSolver0 = new RegulaFalsiSolver(0.0, (-2623.33457), 0.0);\n Gaussian gaussian0 = new Gaussian();\n AllowedSolution allowedSolution0 = AllowedSolution.BELOW_SIDE;\n double double0 = regulaFalsiSolver0.solve(1253, (UnivariateRealFunction) gaussian0, (-979.1), (-347.4), 0.0, allowedSolution0);\n double double1 = regulaFalsiSolver0.doSolve();\n }",
"public int solution(int[] A) {\n int sumLeft = 0;\n int sumRight = 0;\n int diff = 0;\n int min = 0;\n \n if(A.length==0)\n return 0;\n for(int i=0; i<A.length; i++)\n sumLeft += A[i]; \n \n for(int j=0; j<A.length; j++){\n sumRight += A[j];\n sumLeft -= A[j];\n diff = Math.abs(sumRight-sumLeft);\n \n if(min==0)\n min = diff;\n min = Math.min(min, diff);\n }\n return min;\n }",
"public static String quadForm(double a, double b, double c) {\n\t\tdouble root1 = (\t(-1*b)\t+\t(sqrt\t( exponent(b, 2)\t-(4*a*c)\t)))\t/2*a;\r\n\t\tdouble root2 = (\t(-1*b)\t-\t(sqrt\t( exponent(b, 2)\t-(4*a*c)\t)))\t/2*a;\r\n\t\tif (discriminant(a, b, c)<0) return (\"No real roots.\");\r\n\t\tif (discriminant(a, b, c)==0) {\r\n\t\treturn (round2(root1)+\"\");\r\n\t\t}\r\n\t\telse {\r\n\t\treturn (root1 + \" and \" + root2);\r\n\t\t}\r\n\t}",
"public int verify() {\n\t\tString[] expressions = strEquation.split(\"=\");\n\t\tif (expressions.length == 2) {\n\t\t\tint left = evaluateExpression(expressions[0]);\n\t\t\tint right = evaluateExpression(expressions[1]);\n\t\t\tif (left == right && left != Integer.MAX_VALUE) return left;\n\t\t}\n\t\treturn Integer.MAX_VALUE;\n\t}",
"@Test\n public void test00() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Abs abs0 = new Abs();\n AllowedSolution allowedSolution0 = AllowedSolution.BELOW_SIDE;\n double double0 = illinoisSolver0.solve(1166, (UnivariateRealFunction) abs0, 0.0, 0.0, allowedSolution0);\n }",
"@Test\n public void test34() throws Throwable {\n Complex complex0 = new Complex(11.0, 11.0);\n double double0 = complex0.abs();\n Complex complex1 = complex0.sqrt1z();\n Complex complex2 = complex0.tanh();\n List<Complex> list0 = complex2.nthRoot(266);\n Complex complex3 = complex0.sinh();\n Complex complex4 = complex3.multiply(0.11764700710773468);\n Complex complex5 = complex3.log();\n Complex complex6 = complex2.conjugate();\n Complex complex7 = complex3.log();\n Complex complex8 = complex0.sinh();\n boolean boolean0 = complex0.equals(complex2);\n Complex complex9 = complex4.conjugate();\n Complex complex10 = complex0.tan();\n double double1 = complex3.getImaginary();\n Complex complex11 = complex0.cosh();\n Complex complex12 = complex7.tan();\n Complex complex13 = complex3.multiply(complex6);\n try { \n complex10.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static int jacobi(BigInteger A, BigInteger B)\n {\n BigInteger a, b, v;\n long k = 1;\n\n k = 1;\n\n // test trivial cases\n if (B.equals(ZERO))\n {\n a = A.abs();\n return a.equals(ONE) ? 1 : 0;\n }\n\n if (!A.testBit(0) && !B.testBit(0))\n {\n return 0;\n }\n\n a = A;\n b = B;\n\n if (b.signum() == -1)\n { // b < 0\n b = b.negate(); // b = -b\n if (a.signum() == -1)\n {\n k = -1;\n }\n }\n\n v = ZERO;\n while (!b.testBit(0))\n {\n v = v.add(ONE); // v = v + 1\n b = b.divide(BigInteger.valueOf(2)); // b = b/2\n }\n\n if (v.testBit(0))\n {\n k = k * jacobiTable[a.intValue() & 7];\n }\n\n if (a.signum() < 0)\n { // a < 0\n if (b.testBit(1))\n {\n k = -k; // k = -k\n }\n a = a.negate(); // a = -a\n }\n\n // main loop\n while (a.signum() != 0)\n {\n v = ZERO;\n while (!a.testBit(0))\n { // a is even\n v = v.add(ONE);\n a = a.divide(BigInteger.valueOf(2));\n }\n if (v.testBit(0))\n {\n k = k * jacobiTable[b.intValue() & 7];\n }\n\n if (a.compareTo(b) < 0)\n { // a < b\n // swap and correct intermediate result\n BigInteger x = a;\n a = b;\n b = x;\n if (a.testBit(1) && b.testBit(1))\n {\n k = -k;\n }\n }\n a = a.subtract(b);\n }\n\n return b.equals(ONE) ? (int)k : 0;\n }",
"public static double[] getRealRoots(double a, double b, double c) {\n\t\tdouble d = sqr(b) - 4 * a * c;\n\t\tif (d < 0) {\n\t\t\treturn null;\t// complex roots\n\t\t}\n\t\tdouble dr = Math.sqrt(d);\t\n\t\tdouble x1 = (-b - dr) / (2 * a);\n\t\tdouble x2 = (-b + dr) / (2 * a);\n\t\treturn new double[] {x1, x2};\n\t}",
"public ComplexNumberPair solve()\n {\n double realRoot;\n double imaginaryRoot;\n boolean isImaginary = false;\n\n // Value underneath the square root\n double discriminant = Math.pow(b, 2) - (4 * a * c);\n\n // Case 1: discriminant is equal to zero\n if (discriminant == 0)\n {\n realRoot = -b / (2 * a);\n imaginaryRoot = 0;\n }\n // Case 2: discriminant is positive\n else if (discriminant > 0)\n {\n realRoot = -b / (2 * a);\n imaginaryRoot = Math.sqrt(discriminant) / (2 * a);\n }\n // Case 3: discriminant is negative\n else\n {\n realRoot = -b / (2 * a);\n // Flip the sign of the negative discriminant\n imaginaryRoot = Math.sqrt(-discriminant) / (2 * a);\n isImaginary = true;\n }\n\n ComplexNumberPair complexNumberPair = new ComplexNumberPair(new ComplexNumber(realRoot, imaginaryRoot, isImaginary), new ComplexNumber(realRoot, -imaginaryRoot, isImaginary));\n\n return complexNumberPair;\n }",
"public static double discriminant(double a, double b, double c) {\n double result = b * b - 4.0 * a * c;\n return result;\n }",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n scan.useLocale(Locale.ENGLISH);\n System.out.print(\"Enter A: \");\n double A = scan.nextDouble();\n System.out.print(\"Enter B: \");\n double B = scan.nextDouble();\n System.out.print(\"Enter x: \");\n double x = scan.nextDouble();\n System.out.print(\"Enter y: \");\n double y = scan.nextDouble();\n System.out.print(\"Enter z: \");\n double z = scan.nextDouble();\n\n double minSize = Math.min(A,B);\n double maxSize = Math.max(A,B);\n double minBrick = Math.min(Math.min(x,y),z);\n double midBrick = Math.min(Math.max(x,y),z);\n\n if (A*B>=minBrick*midBrick) {\n if (minSize>=minBrick || maxSize>=midBrick) {\n System.out.println(\"True\");\n }\n } else {\n System.out.println(\"False\");\n }\n }",
"public static double discriminant(double a, double b, double c) {\n\t\treturn (b * b) - (4 * a * c);\r\n\t}",
"private static int greatestCommonDivisor(int alpha, int beta){\n\n\t\talpha = Math.abs(alpha); // take absolute values of operands\n\t\tbeta = Math.abs(beta);\n\t\n\t\tif (beta == 0) // base case\n\t \treturn alpha;\n\t\telse{ // induction step\n\t\t\tint remainder = alpha % beta;\n\t\t\n\t\t\treturn greatestCommonDivisor(beta, remainder);\n\t }\n }",
"private static void solve() {\n\t\tList<Integer> rgtMax= new ArrayList<>();\n\t\tList<Integer> lftMax= new ArrayList<>();\n\t\t\n\t\tpopulateRgtMax(rgtMax);\n\t\tpopulateLftMax(lftMax);\n\t\t\t\t\n\t\tint area=findMaxArea(lftMax,rgtMax);\n\t\tSystem.out.println(area);\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner p1 = new Scanner(System.in);\n\t\tSystem.out.println(\"a의 값을 입력하시오.\");\n\t\tdouble a = p1.nextDouble();\n\t\tSystem.out.println(\"b의 값을 입력하시오.\");\n\t\tdouble b = p1.nextDouble();\n\t\tSystem.out.println(\"c의 값을 입력하시오.\");\n\t\tdouble c = p1.nextDouble();\n\t\t\n\t\tdouble determinant;\n\t\tdouble x1, x2;\n\t\t\n\t\tSystem.out.println(\"a=\" + a + \" b=\" + b + \" c=\" + c);\n\t\tdeterminant = b*b - 4.0*a*c;\n\t\tx1 = (-b + Math.sqrt(determinant))/(2.0*a);\n\t\tx2 = (-b - Math.sqrt(determinant))/(2.0*a);\n\t\t\n\t\tif (a == 0) \n\t\t{\n\t\t\tSystem.out.println(\"오류: 이차항의 계수가 0이므로, 이차방정식을 풀 수 없습니다.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (determinant < 0)\n\t\t\t{ \n\t\t\t\tSystem.out.println(\"오류: 실근이 존재하지 않으므로, 이차방정식을 풀 수 없습니다.\");\n\t\t\t\t\n\t\t\t}else \n\t\t\t{ \n\t\t\t\tSystem.out.println(\"The solution is either \" + x1 + \" or \" + x2);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tfloat a, b, c;\r\n\t\tSystem.out.println(\"Fill a, b, c: \");\r\n\t\ta = sc.nextFloat();\r\n\t\tb = sc.nextFloat();\r\n\t\tc = sc.nextFloat();\r\n\t\tfloat delta = (float) (Math.pow(b, 2) - 4 * a * c);\r\n\t\tif (delta < 0) {\r\n\t\t\tSystem.out.println(\"The equation has no solution!\");\r\n\t\t} else {\r\n\t\t\tif (delta == 0) {\r\n\t\t\t\tfloat x = -b / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution x = \" + x);\r\n\t\t\t} else {\r\n\t\t\t\tdouble x1 = (-b - Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tdouble x2 = (-b + Math.sqrt(delta)) / 2 * a;\r\n\t\t\t\tSystem.out.println(\"Solution X1 = \" + x1);\r\n\t\t\t\tSystem.out.println(\"Solution X2 = \" + x2);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public int maxProduct(final List<Integer> A) {\n if (A.size() == 0) {\n return 0;\n }\n int[] posProduct = new int[A.size()];\n int[] negProduct = new int[A.size()];\n int[] maxProduct = new int[A.size()];\n posProduct[0] = negProduct[0] = maxProduct[0] = A.get(0);\n for (int i = 1;i < A.size();i++) {\n int a = posProduct[i-1] * A.get(i);\n int b = negProduct[i-1] * A.get(i);\n posProduct[i] = Math.max(Math.max(a, b), A.get(i));\n negProduct[i] = Math.min(Math.min(a, b), A.get(i));\n maxProduct[i] = Math.max(posProduct[i], maxProduct[i-1]);\n }\n // for(int i=0;i<A.size();i++)\n // {\n // System.out.print(\" |\"+posProduct[i]);\n // }\n // System.out.println();\n // for(int i=0;i<A.size();i++)\n // {\n // System.out.print(\" |\"+negProduct[i]);\n // }\n // System.out.println();\n return maxProduct[A.size()-1];\n }",
"private RealMatrix solutionClosestToPrevious(RealMatrix solutionA, RealMatrix solutionB) {\r\n double solADistance = Math.sqrt(\r\n Math.pow(solutionA.getEntry(0, 0) - previousPosition.getEntry(0, 0), 2) +\r\n Math.pow(solutionA.getEntry(1, 0) - previousPosition.getEntry(1, 0), 2) +\r\n Math.pow(solutionA.getEntry(2, 0) - previousPosition.getEntry(2, 0), 2)\r\n );\r\n double solBDistance = Math.sqrt(\r\n Math.pow(solutionB.getEntry(0, 0) - previousPosition.getEntry(0, 0), 2) +\r\n Math.pow(solutionB.getEntry(1, 0) - previousPosition.getEntry(1, 0), 2) +\r\n Math.pow(solutionB.getEntry(2, 0) - previousPosition.getEntry(2, 0), 2)\r\n );\r\n\r\n if(solADistance <= solBDistance) {\r\n return solutionA;\r\n }\r\n else {\r\n return solutionB;\r\n }\r\n }",
"public int solution(int[] A) {\n int sum = sum(A);\n int stackingSum = 0;\n int diff = Integer.MAX_VALUE;\n\n for (int i = 0; i < A.length; i++) {\n stackingSum = stackingSum + A[i];\n sum = sum - A[i];\n System.out.println(Math.abs(stackingSum - sum));\n int expr = Math.abs(stackingSum - sum);\n\n if (diff > expr) {\n diff = expr;\n }\n }\n\n return diff;\n }",
"static double area(double AB, double BC, double CA) {\n double s = 0.5 * perimeter(AB, BC, CA); // semiperimeter\n return Math.sqrt(s) * Math.sqrt(s - AB) * Math.sqrt(s - BC) * Math.sqrt(s - CA);\n }",
"public static double Ctolerance(double costC,double costS,double per)\r\n\t{\n\t\tdouble C=costC;\r\n\t\tdouble S=costS;\r\n\t\tdouble a=0.0;\r\n\t\tdouble b=0.0;\r\n\t\tdouble c=0.0;\r\n\t\tdouble Per=per;\r\n\t\ta=S;\r\n\t\tb=-(2*Per+1)*(C+S);\r\n\t\tc=C;\r\n\t\tdouble x1;\r\n\t\tdouble x2;\r\n\t\tx1=(-b+Math.sqrt(b*b-4*a*c))/(2*a);\r\n\t\tx2=(-b-Math.sqrt(b*b-4*a*c))/(2*a);\r\n\t\tif(x1<x2)\r\n\t\t\treturn x1;\r\n\t\telse \r\n\t\t\treturn x2;\r\n\t}",
"java.math.BigDecimal getMaximum();",
"public int solution(int[] A) {\n int L = A.length;\n int[] B = new int[L+1];\n for(int i=0; i<L; i++) {\n int t = A[i];\n B[t-1] = t;\n }\n for(int j=0; j<L; j++) {\n if(B[j] == 0) {\n return j+1;\n }\n }\n return 0;\n }",
"public static void main(String[] args) {\n\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint A = scan.nextInt();\r\n\t\tint B = scan.nextInt();\r\n\t\tlong x = scan.nextInt();\r\n\t\tlong y = scan.nextInt();\r\n\t\tlong z = scan.nextInt();\r\n\t\t\r\n\t\tlong requiredA = x * 2 + y;\r\n\t\tlong requiredB = y + z * 3;\r\n\t\t\r\n\t\tlong neededA = Math.max(0, requiredA - A);\r\n\t\tlong neededB = Math.max(0, requiredB - B);\r\n\t\tSystem.out.print(neededA + neededB);\r\n\t}",
"public static double calculateArea (Point2D.Double A, Point2D.Double B, Point2D.Double C) {\n\n\t\tPoint2D.Double P1 = A; \n\t\tPoint2D.Double P2 = B; \n\t\tPoint2D.Double P3 = C;\n\n\t\tdouble a = Math.sqrt( Math.pow((P2.getX() - P1.getX()),2) + Math.pow((P2.getY() - P1.getY()),2) ); //lado que une A y B\n\t\tdouble b = Math.sqrt( Math.pow((P3.getX() - P2.getX()),2) + Math.pow((P3.getY() - P2.getY()),2) ); //lado que une B y C\n\t\tdouble c = Math.sqrt( Math.pow((P3.getX() - P1.getX()),2) + Math.pow((P3.getY() - P1.getY()),2) ); //lado que une A y C\n\n\t\tdouble area = Math.sqrt( (a+b+c) * (a+b-c) * (b+c-a) * (c+a-b) ) / 4;\n\n\t\treturn area;\n\t}",
"@Test\n public void test06() throws Throwable {\n Complex complex0 = new Complex(2517.9465, 2517.9465);\n double double0 = complex0.getReal();\n Complex complex1 = complex0.negate();\n String string0 = complex1.toString();\n Complex complex2 = (Complex)complex1.readResolve();\n Complex complex3 = complex0.negate();\n Complex complex4 = complex0.acos();\n Complex complex5 = complex4.multiply(complex0);\n Complex complex6 = complex0.multiply(0.11764700710773468);\n Complex complex7 = complex6.conjugate();\n int int0 = complex0.hashCode();\n Complex complex8 = complex6.asin();\n boolean boolean0 = complex1.isInfinite();\n List<Complex> list0 = complex6.nthRoot(4276);\n Complex complex9 = complex6.log();\n Complex complex10 = new Complex(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY);\n Complex complex11 = complex6.sqrt1z();\n Complex complex12 = complex6.sqrt();\n double double1 = complex10.getArgument();\n // Undeclared exception!\n try { \n complex12.nthRoot(4276);\n } catch(TooManyResourcesException e) {\n //\n // Loop has been executed more times than the allowed 10000\n //\n assertThrownBy(\"org.evosuite.runtime.LoopCounter\", e);\n }\n }",
"public double squareRoot (double firstNumber){\n\t\tif (firstNumber < 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Invalid Input \", \"Error message\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn -1111.1111;\n\t\t}\n\t\tdouble result = Math.sqrt(firstNumber);\n\t\treturn result;\n\t}",
"private double solveQuadraticInside(Location location) {\n\t\tint iPlus = imposeBorder(location.i + 1, _iSize);\r\n\t\tint iMinus = imposeBorder(location.i - 1, _iSize);\r\n\t\tint jPlus = imposeBorder(location.j + 1, _iSize);\r\n\t\tint jMinus = imposeBorder(location.j - 1, _iSize);\r\n\t\t//\r\n\t\tdouble ux1 = -_levelSet[iPlus][location.j];\r\n\t\tdouble ux2 = -_levelSet[iMinus][location.j];\r\n\t\tdouble uy1 = -_levelSet[location.i][jPlus];\r\n\t\tdouble uy2 = -_levelSet[location.i][jMinus];\r\n\t\t//\r\n\t\tdouble ux = Math.min(ux1, ux2);\r\n\t\tdouble uy = Math.min(uy1, uy2);\r\n\t\t// TODO pre-compute\r\n\t\tdouble f = _dx / F;\r\n\t\t//\r\n\t\t// solve the quadratic equation\r\n\t\tdouble a = 2;\r\n\t\tdouble b = -2 * (ux + uy);\r\n\t\tdouble c = ScalarMath.square(ux) + ScalarMath.square(uy)\r\n\t\t\t\t- ScalarMath.square(f);\r\n\t\tdouble delta = ScalarMath.square(b) - 4 * a * c;\r\n\t\t// extraordinary solutions\r\n\t\tdouble u;\r\n\t\tif (Double.isInfinite(ux) | Double.isInfinite(uy) | delta < 0) {\r\n\t\t\tif (Double.isInfinite(ux))\r\n\t\t\t\tu = uy;\r\n\t\t\telse if (Double.isInfinite(uy))\r\n\t\t\t\tu = ux;\r\n\t\t\telse\r\n\t\t\t\t// the case where (delta < 0), which produces a\r\n\t\t\t\t// imaginary root\r\n\t\t\t\tu = Math.min(ux, uy);\r\n\t\t\treturn -(u + f);\r\n\t\t}\r\n\t\tdouble sol1 = (-b + Math.sqrt(delta)) / (2 * a);\r\n\t\tdouble sol2 = (-b - Math.sqrt(delta)) / (2 * a);\r\n\t\treturn -(Math.max(sol1, sol2));\r\n\t}",
"public int trap(final int[] A) \n {\n int res = 0;\n for(int i=1; i<A.length-1; i++)\n {\n int left = A[i];\n for(int j=0; j<i; j++)\n {\n left = Math.max(A[j], left);\n }\n \n int right = A[i];\n for(int j=i+1; j<A.length; j++)\n {\n right = Math.max(A[j], right);\n }\n \n res+=Math.min(left, right)- A[i];\n }\n return res;\n }",
"@Test\n public void test05() throws Throwable {\n RegulaFalsiSolver regulaFalsiSolver0 = new RegulaFalsiSolver(0.0, 0.0);\n Exp exp0 = new Exp();\n AllowedSolution allowedSolution0 = AllowedSolution.ABOVE_SIDE;\n // Undeclared exception!\n try { \n regulaFalsiSolver0.solve(1626, (UnivariateRealFunction) exp0, (double) 1626, 0.0, allowedSolution0);\n } catch(IllegalArgumentException e) {\n //\n // endpoints do not specify an interval: [1,626, 0]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }",
"@Test\n public void test04() throws Throwable {\n Complex complex0 = new Complex((-15.276), Double.POSITIVE_INFINITY);\n int int0 = complex0.hashCode();\n Complex complex1 = complex0.sqrt1z();\n Complex complex2 = complex0.sin();\n Complex complex3 = complex2.sqrt();\n String string0 = complex0.toString();\n Complex complex4 = complex2.atan();\n String string1 = complex0.toString();\n Complex complex5 = complex0.log();\n Complex complex6 = complex0.asin();\n List<Complex> list0 = complex2.nthRoot(27);\n double double0 = complex2.abs();\n Complex complex7 = (Complex)complex0.readResolve();\n }",
"public static int borderSolution(int[] A) {\n int bordersNum = 0;\n for (int i = 0; i < A.length - 1; i++) {\n if (bordersNum > 10000000) return -1;\n for (int j = i + 1; j < A.length; j++) {\n int min1 = i - A[i];\n int max1 = i + A[i];\n int max2 = j + A[j];\n int min2 = j - A[j];\n if (!(min2 > max1)) {\n if (min1 >= min2 || max1 <= max2) {\n bordersNum++;\n continue;\n }\n }\n if (!(min2 > max1)) {\n if (min2 >= min1 || max2 <= max1) {\n bordersNum++;\n continue;\n }\n }\n }\n }\n\n return bordersNum;\n }",
"public int solution(int[] A) {\n \n Arrays.sort(A);\n \n for(int i=0; i<A.length - 2;i++) {\n if(checkForTriangleProperty(A, i)) { return 1; }\n }\n \n return 0;\n }",
"private double solveQuadraticOutside(Location location) {\n\t\tint iPlus = imposeBorder(location.i + 1, _iSize);\r\n\t\tint iMinus = imposeBorder(location.i - 1, _iSize);\r\n\t\tint jPlus = imposeBorder(location.j + 1, _iSize);\r\n\t\tint jMinus = imposeBorder(location.j - 1, _iSize);\r\n\t\t//\r\n\t\tdouble ux1 = _levelSet[iPlus][location.j];\r\n\t\tdouble ux2 = _levelSet[iMinus][location.j];\r\n\t\tdouble uy1 = _levelSet[location.i][jPlus];\r\n\t\tdouble uy2 = _levelSet[location.i][jMinus];\r\n\t\t//\r\n\t\tdouble ux = Math.min(ux1, ux2);\r\n\t\tdouble uy = Math.min(uy1, uy2);\r\n\t\t// TODO pre-compute\r\n\t\tdouble f = _dx / F;\r\n\t\t//\r\n\t\t// solve the quadratic equation\r\n\t\tdouble a = 2;\r\n\t\tdouble b = -2 * (ux + uy);\r\n\t\tdouble c = ScalarMath.square(ux) + ScalarMath.square(uy)\r\n\t\t\t\t- ScalarMath.square(f);\r\n\t\tdouble delta = ScalarMath.square(b) - 4 * a * c;\r\n\t\t// extraordinary solutions\r\n\t\tdouble u;\r\n\t\tif (Double.isInfinite(ux) | Double.isInfinite(uy) | delta < 0) {\r\n\t\t\tif (Double.isInfinite(ux))\r\n\t\t\t\tu = uy;\r\n\t\t\telse if (Double.isInfinite(uy))\r\n\t\t\t\tu = ux;\r\n\t\t\telse\r\n\t\t\t\t// the case where (delta < 0), which produces a\r\n\t\t\t\t// imaginary root\r\n\t\t\t\tu = Math.min(ux, uy);\r\n\t\t\treturn u + f;\r\n\t\t}\r\n\t\tdouble sol1 = (-b + Math.sqrt(delta)) / (2 * a);\r\n\t\tdouble sol2 = (-b - Math.sqrt(delta)) / (2 * a);\r\n\t\treturn Math.max(sol1, sol2);\r\n\t}",
"@Test\n public void test36() throws Throwable {\n Complex complex0 = new Complex((-699.847402808), (-699.847402808));\n Complex complex1 = complex0.tanh();\n Complex complex2 = complex1.sqrt1z();\n Complex complex3 = complex0.tanh();\n Complex complex4 = complex0.sin();\n int int0 = complex0.hashCode();\n Complex complex5 = complex1.exp();\n boolean boolean0 = complex1.equals(complex1);\n Complex complex6 = complex1.log();\n Complex complex7 = complex6.add(complex0);\n double double0 = complex7.getArgument();\n Complex complex8 = complex1.atan();\n Complex complex9 = complex0.cosh();\n Complex complex10 = complex7.subtract(complex1);\n Complex complex11 = complex8.conjugate();\n Complex complex12 = complex7.add(complex0);\n double double1 = complex0.abs();\n Complex complex13 = complex7.multiply(0.0);\n Complex complex14 = complex11.multiply(complex13);\n Complex complex15 = complex11.sqrt1z();\n Complex complex16 = complex8.tan();\n double double2 = complex12.getArgument();\n Complex complex17 = complex0.divide(complex12);\n try { \n complex12.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"private Proof mulLeftZero(Expression a) {\n Variable x = var(\"x\");\n Proof equalitySymConvert = equalitySymConvert(faxm8Gen(zero(), x));\n Proof faxm6gen = faxm6Gen(multi(zero(), x));\n Proof axm2convert = faxm2Convert(equalitySymConvert, faxm6gen);\n Proof axm2convertOnce = faxm2ConvertOnce(zero(), equalitySymConvert(axm2convert));\n return inductConclusion(x, a, faxm7Gen(zero()), axm2convertOnce);\n }",
"public boolean almostZero(double a);",
"@Test\n public void test20() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n Complex complex1 = complex0.tan();\n Complex complex2 = complex0.log();\n Complex complex3 = complex2.atan();\n Complex complex4 = (Complex)complex2.readResolve();\n Complex complex5 = complex1.tan();\n Complex complex6 = complex0.atan();\n Complex complex7 = complex3.sin();\n Complex complex8 = complex0.negate();\n Complex complex9 = complex6.createComplex(2846.5, 0.0);\n Complex complex10 = complex0.add(complex1);\n Complex complex11 = complex1.sqrt1z();\n boolean boolean0 = complex6.equals(complex10);\n Complex complex12 = complex3.sqrt();\n double double0 = complex2.getArgument();\n Complex complex13 = complex1.sinh();\n try { \n complex9.nthRoot((-4646));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -4,646\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"public static void main(String[] args)\n {\n Scanner scan = new Scanner(System.in);\n \n System.out.println(\"Enter a side length for your cube:\");\n double s = scan.nextDouble();\n \n if (s > 0)\n {\n double volume = Math.pow(s, 3);\n System.out.println(\"Volume:\" + volume);\n }\n \n else\n System.out.println(\"Invalid entry\");\n \n \n /** Objective #2: Write an application to determine the number of solutuions to a quadratic equation, \n * The program accepts a, b and c from a user, and tells the user how many solutions, if any, exist\n * \n * Precodition: The user enters numbers, and not a special characters or letters\n * Postcondition: If there are two solutions, the program outputs \"two solutions.\" If there is \n * one solution, the program outputs \"one solution\" and if there are\n * no solutions, the program outputs \"no solution\"\n */\n \n System.out.println(\"Enter a:\");\n double a = scan.nextDouble();\n \n System.out.println(\"Enter b:\");\n double b = scan.nextDouble();\n \n System.out.println(\"Enter c:\");\n double c = scan.nextDouble();\n \n double discriminant = b*b - 4*a*c;\n if (discriminant <= 0)\n System.out.println(\"No real solutions.\");\n else if (discriminant == 0)\n System.out.println(\"One solution.\");\n else\n System.out.println(\"Two solutions.\");\n \n \n \n \n }",
"public int trap(int[] A) {\n \n int len = A.length;\n if (len <= 1) return 0;\n \n int[] leftHighest = new int[len];\n int[] rightHighest = new int[len];\n \n int max = -1;\n for (int i = 1; i < len; i++) {\n if (A[i - 1] > max) {\n max = A[i - 1];\n }\n leftHighest[i] = max;\n }\n \n max = -1;\n for (int i = len - 2; i >= 0; i--) {\n if (A[i + 1] > max) {\n max = A[i + 1];\n }\n rightHighest[i] = max;\n }\n \n int water = 0;\n for (int i = 1; i < len - 1; i++) {\n int cur = Math.min(leftHighest[i], rightHighest[i]) - A[i];\n if (cur > 0) water += cur;\n }\n \n return water;\n }",
"public int canCompleteCircuit(final List<Integer> A, final List<Integer> B) {\n int fuel = 0;\n int cost = 0;\n\n for (int i = 0; i < A.size(); i++) {\n fuel += A.get(i);\n cost += B.get(i);\n }\n if (fuel < cost) {\n return -1;\n }\n\n fuel = 0;\n cost = 0;\n\n int start = -1;\n\n for (int i = 0; i < A.size(); i++) {\n\n if(fuel == 0 && cost == 0 && A.get(i) >= B.get(i)) {\n start = i;\n }\n fuel += A.get(i);\n cost += B.get(i);\n\n\n if (fuel < cost) {\n fuel = 0;\n cost = 0;\n }\n }\n\n return start;\n }",
"public int solution(int[] A) {\n if(A.length == 2) return 0;\n\n int minLength2 = A[0] + A[1];\n int min2Index = 0;\n\n int minLength3 = Integer.MAX_VALUE;\n int min3Index = 0;\n\n for (int i = 2; i < A.length; i++) {\n int length2 = A[i-1] + A[i];\n if (length2<minLength2){\n minLength2 = length2;\n min2Index = i-1;\n }\n\n int length3 = length2 + A[i-2];\n if(length3 < minLength3){\n minLength3 = length3;\n min3Index = i-2;\n }\n }\n\n if(minLength2*3 == minLength3*2) return Math.min(min2Index, min3Index);\n else return minLength2*3 < minLength3*2 ? min2Index:min3Index;\n }",
"public int solution(int[] A)\n {\n \n if(A.length == 0 && A.length == 1)\n return 0;\n \n int currentOneSum = 0;\n int totalOneSum = 0;\n int currentZeros = 0;\n \n for (int i = 0; i < A.length; i++)\n \n if(A[i] == 1)\n \n currentOneSum++;\n \n if(A[i] == 0 || i == A.length-1)\n \n totalOneSum += currentZeros * currentOneSum;\n currentOneSum = 0;\n currentZeros++;\n \n return Math.abs(totalOneSum) <= Math.pow(10,9) ? totalOneSum : -1;\n \n }",
"@Test\n public void test10() throws Throwable {\n UnivariateRealFunction univariateRealFunction0 = null;\n double double0 = 0.0;\n // Undeclared exception!\n try { \n UnivariateRealSolverUtils.bracket((UnivariateRealFunction) null, 0.0, (-2444.9), 0.0);\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // function is null\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }",
"@Test(expected=IllegalArgumentException.class)\n\tpublic void testZerosException() throws IllegalArgumentException {\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( 0, MaxDiTre.max(0, 0, 0) );\n\t}",
"public int maxProduct(int[] A) {\n if(A == null || A.length == 0){\n return 0;\n }\n int maxLocal = A[0];\n int minLocal = A[0];\n int maxGlobal = A[0];\n for(int i=1; i<A.length; i++){\n int temp = maxLocal;\n maxLocal = Math.max(A[i], Math.max(maxLocal*A[i], minLocal*A[i]));\n minLocal = Math.min(A[i], Math.min(temp*A[i], minLocal*A[i]));\n maxGlobal = Math.max(maxGlobal, maxLocal);\n }\n return maxGlobal;\n }",
"@Test\r\n\tpublic void testGreatestCommonDivisorCalculation() {\r\n\r\n\t\tGreatestCommonDivisor testGcd = new GreatestCommonDivisor();\r\n\t\tint testGcdOne = testGcd.greatestCommonDivisorCalculation(21, 180);\r\n\t\tint testGcdTwo = testGcd.greatestCommonDivisorCalculation(5, 10);\r\n\t\tint testGcdTree = testGcd.greatestCommonDivisorCalculation(37, 77);\r\n\t\tint testGcdFour = testGcd.greatestCommonDivisorCalculation(30, 77);\r\n\r\n\t\tAssert.assertEquals(3, testGcdOne);\r\n\t\tAssert.assertEquals(5, testGcdTwo);\r\n\t\tAssert.assertEquals(1, testGcdTree);\r\n\t\tAssert.assertNotEquals(4, testGcdFour);\r\n\t}",
"public int maximumGap(final List<Integer> A) {\n int len = A.size();\n if (len == 0) {\n return -1;\n }\n int result = -1;\n for (int i = 0; i < len; i++) {\n for (int j = len - 1; j >= i; j--) {\n if (A.get(i) <= A.get(j)) {\n result = Math.max(result, j - i);\n }\n }\n }\n return result;\n }",
"public static void main(String[] args) {\n System.out.println(\"Absolute: \");\n System.out.println(Math.abs(-123));\n System.out.println(StrictMath.abs(-123));\n\n System.out.println(\"Cube root: \");\n System.out.println(Math.cbrt(27));\n\n System.out.println(\"Exact decrement \");\n System.out.println(Math.decrementExact(7));\n //System.out.println(Math.decrementExact(Integer.MIN_VALUE));// throw exception\n int i = Integer.MIN_VALUE;\n System.out.println(i--);\n\n System.out.println(\"Random: \" + Math.random()*1000);\n }",
"@Test\n public void test09() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.LEFT_SIDE;\n // Undeclared exception!\n try { \n illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, (-1672.701), (-4.26431539230972), (-8.575998569792264E-17), allowedSolution0);\n } catch(IllegalArgumentException e) {\n //\n // function values at endpoints do not have different signs, endpoints: [-1,672.701, -4.264], values: [-1, -1]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }",
"public boolean almostZero(Coordinates a);",
"public int solution(int[] A) {\n int N = A.length;\r\n int[] s1 = new int[N];\r\n int[] s2 = new int[N];\r\n \r\n for (int i = 1; i < N - 1; i++)\r\n {\r\n s1[i] = Math.max(0, s1[i - 1] + A[i]);\r\n }\r\n \r\n for (int i = N - 2; i > 0; i--)\r\n {\r\n s2[i] = Math.max(0, s2[i + 1] + A[i]);\r\n }\r\n \r\n int max = 0;\r\n \r\n for (int i = 1; i < N - 1; i++)\r\n {\r\n max = Math.max(max, s1[i - 1] + s2[i + 1]);\r\n }\r\n \r\n return max;\r\n }",
"public static double computeHeightOfTriangle(CPoint A, CPoint B, CPoint C){\n\t\tdouble angle = computeAngleOrient(A,B,C);\n\t\tdouble norme_AC = Math.sqrt(Math.pow(C.getX() - A.getX(), 2)+Math.pow(C.getY() - A.getY(), 2));\n\t\tdouble height = Math.sin(angle*(Math.PI/180))*norme_AC;\n\t\treturn height;\n\t}",
"public static int maxSub0(int[] A) {\n int maxNow = 0;\n int maxAll = 0;\n int size = A.length;\n for (int i = 0; i < size; i++) {\n maxNow = Math.max(0, maxNow + A[i]);\n maxAll = Math.max(maxAll, maxNow);\n }\n return maxAll;\n }",
"@Test\r\n public void test() {\r\n String[][] equations = { { \"a\", \"b\" }, { \"b\", \"c\" } },\r\n queries = { { \"a\", \"c\" }, { \"b\", \"a\" }, { \"a\", \"e\" }, { \"a\", \"a\" }, { \"x\", \"x\" } };\r\n double[] values = { 2.0, 3.0 };\r\n assertArrayEquals(new double[] { 6.0, 0.5, -1.0, 1.0, -1.0 }, calcEquation(equations, values, queries),\r\n Double.MIN_NORMAL);\r\n }",
"public static void main(String[] args) {\n\t\tEquation eq = new Equation();\n\t\teq.process(\"A = [ 2, -2, 0, 3, 4; 4, -1, 0, 1, -1; 0, 5, 0, 0, -1; 3, 2, -3, 4, 3; 7, -2, 0, 9, -5 ]\");\n\t\tDMatrixRMaj A = eq.lookupDDRM(\"A\");\n\t\t\n\t\tSystem.out.println(\"<==== A ====>\");\n\t\tSystem.out.println(A);\n\t\tSystem.out.println(\"Det(A): \" + CommonOps_DDRM.det(A));\n\t\t\n\t\tDMatrixRMaj C = cofactor(A);\n\t\teq.alias(C, \"C\");\n\t\t\n\t\tdouble det = A.get(3, 2) * C.get(3, 2);\n\t\t\n\t\tSystem.out.println(\"Column[\" + 2 + \"] has 4 zeros entries\");\n\t\tSystem.out.println(\"Det(A) = A[3][2] * cofactors[3][2]: \" + det);\n\t\t\n\t\n\t\tSystem.out.println(\"<==== adj(A) ====>\");\n\t\tSystem.out.println(C);\n\t\t\n\t\t\n\t\teq.process(\"AI = inv(A)\");\n\t\teq.process(\"AC = inv(det(A)) * C'\");\n\t\t\n\t\t\n\t\tSystem.out.println(\"<==== inv(A) ====>\");\n\t\tSystem.out.println(eq.lookupDDRM(\"AI\"));\n\t\t\n\t\tSystem.out.println(\"<==== 1 / det(A) * adj(A) ====>\");\n\t\tSystem.out.println(eq.lookupDDRM(\"AC\"));\n\t\t\n\t\tSystem.out.println(\"inv(A) == 1 / det(A) * adj(A): \" + MatrixFeatures.isIdentical(eq.lookupDDRM(\"AI\"), eq.lookupDDRM(\"AC\"), 0.00000001));\n\t\t\n\t\t\n\t}",
"public static ZeroKnowledgeProof createProof(final BigInteger a0, final BigInteger b0)\n\t{\n\t\tfinal EcPoint A0 = curve.multiply(g, a0);\n\t\tfinal EcPoint B0 = curve.multiply(h, b0);\n\t\t\n\t\t// Chose random points\n\t\tfinal BigInteger r1 = RandomNumberGenerator.generateRandomInteger(curve.getR());\n\t\tfinal BigInteger r2 = RandomNumberGenerator.generateRandomInteger(curve.getR());\n\t\t\n\t\t// Compute powers\n\t\tfinal EcPoint p1 = curve.multiply(g, r1);\n\t\tfinal EcPoint p2 = curve.multiply(h, r2);\n\t\tfinal EcPoint sum = curve.addPoints(p1, p2);\n\t\t\n\t\t// Compute c\n\t\tfinal byte[] input = Parse.concatenate(g, h, sum);\n\t\tfinal MessageDigest digest;\n\t\ttry {\n\t\t\tdigest = MessageDigest.getInstance(HASH_ALGORITHM);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new RuntimeException(\"Should not happen\");\n\t\t}\n\t\tfinal BigInteger c = new BigInteger(1, digest.digest(input)).mod(curve.getR());\n\t\t\n\t\t// Compute sa and sb\n\t\tfinal BigInteger sa = (r1.subtract(c.multiply(a0))).mod(curve.getR());\n\t\tfinal BigInteger sb = (r2.subtract(c.multiply(b0))).mod(curve.getR());\n\t\t\n\t\treturn new ZeroKnowledgeProof(A0, B0, c, sa, sb);\n\t}",
"public int solution(int[] A) {\n\n\t\tif (A == null || A.length == 1) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tint indexResult = -1;\n\t\tdouble minResult = Double.MAX_VALUE, result = 0;\n\n\t\tfor (int i = 0; i < A.length - 1; i++) {\n\t\t\tif(i + 2 < A.length) {\n\t\t\t\tresult = (A[i] + A[i + 1] + A[i + 2]) / 3.0;\n\t\t\t\tif(result < minResult) {\n\t\t\t\t\tminResult = result;\n\t\t\t\t\tindexResult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult = (A[i] + A[i + 1]) / 2.0;\n\t\t\tif(result < minResult) {\n\t\t\t\tminResult = result;\n\t\t\t\tindexResult = i;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\treturn indexResult;\n\t}",
"@Test\n public void test24() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Asin asin0 = new Asin();\n // Undeclared exception!\n try { \n illinoisSolver0.solve((-2213), (UnivariateRealFunction) asin0, 0.008336750013465571, (-2468.32548668046), 0.008336750013465571);\n } catch(IllegalStateException e) {\n //\n // illegal state: maximal count (-2,213) exceeded: evaluations\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.BaseAbstractUnivariateRealSolver\", e);\n }\n }",
"@Test\n public void test10() throws Throwable {\n RegulaFalsiSolver regulaFalsiSolver0 = new RegulaFalsiSolver(1601.9);\n Acos acos0 = new Acos();\n // Undeclared exception!\n try { \n regulaFalsiSolver0.solve(1023, (UnivariateRealFunction) acos0, (double) 1023, (double) 1023, 0.0);\n } catch(IllegalArgumentException e) {\n //\n // endpoints do not specify an interval: [1,023, 1,023]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }",
"static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}",
"@Test\n\tpublic void parenthesses_should_notbalanced_expr()\n\t{\n\t\tString result=\"\";String expr=\"\";\n\t\t\n\t\texpr=\"(a+b(a+c)\";\n\t\t result=com.bridgelabz.util.DataStructure.BalanaceParenthes(expr);\n\t\tassertTrue(\"not balanced\", result!=\"balaced\");\n\t}",
"private static int sign(S2Point a, S2Point b, S2Point c, S2Point aCrossB) {\n // assert (isUnitLength(a) && isUnitLength(b) && isUnitLength(c));\n int ccw = triage(aCrossB, c);\n if (ccw == 0) {\n ccw = S2Predicates.Sign.expensive(a, b, c, true);\n }\n return ccw;\n }",
"@Test\n public void test08() throws Throwable {\n RegulaFalsiSolver regulaFalsiSolver0 = new RegulaFalsiSolver(152.236924);\n Sinc sinc0 = new Sinc();\n AllowedSolution allowedSolution0 = AllowedSolution.BELOW_SIDE;\n // Undeclared exception!\n try { \n regulaFalsiSolver0.solve(3, (UnivariateRealFunction) sinc0, 152.236924, 152.236924, 0.0, allowedSolution0);\n } catch(IllegalArgumentException e) {\n //\n // endpoints do not specify an interval: [152.237, 152.237]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }",
"private void squareRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.squareRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}",
"public int findMax(){\n return nilaiMaks(this.root);\n }"
]
| [
"0.5717322",
"0.5688104",
"0.5662179",
"0.5548329",
"0.55185044",
"0.55138737",
"0.5498572",
"0.5401063",
"0.53912383",
"0.53789675",
"0.5366946",
"0.5324955",
"0.5268471",
"0.52422804",
"0.513478",
"0.5128831",
"0.5122914",
"0.51201516",
"0.50718486",
"0.5031747",
"0.50290877",
"0.5015627",
"0.50013673",
"0.49548018",
"0.4928623",
"0.49084243",
"0.49016273",
"0.4899796",
"0.48794928",
"0.48698175",
"0.48521087",
"0.4844007",
"0.4795209",
"0.47948733",
"0.47813234",
"0.47650284",
"0.47380432",
"0.47253844",
"0.47171077",
"0.46820202",
"0.46804857",
"0.46656162",
"0.46564737",
"0.46554002",
"0.46479118",
"0.46412033",
"0.46410415",
"0.46277297",
"0.46100843",
"0.46094653",
"0.4603493",
"0.45874175",
"0.45748603",
"0.45667517",
"0.45388854",
"0.4535221",
"0.4530193",
"0.45286787",
"0.45263088",
"0.4516429",
"0.45120645",
"0.45091912",
"0.44985652",
"0.44894785",
"0.4472207",
"0.446264",
"0.44566247",
"0.44513318",
"0.44500214",
"0.44450533",
"0.4435608",
"0.44336084",
"0.44177735",
"0.4406142",
"0.44056153",
"0.439054",
"0.43848464",
"0.4378285",
"0.43751466",
"0.43661803",
"0.43656573",
"0.4357513",
"0.43551603",
"0.43532372",
"0.4349571",
"0.4342177",
"0.43299365",
"0.43283907",
"0.43261495",
"0.43247995",
"0.43225205",
"0.43168235",
"0.43063298",
"0.4286328",
"0.4285098",
"0.42844158",
"0.4282366",
"0.42821032",
"0.4280326",
"0.427495"
]
| 0.7112945 | 0 |
a constructor of the class | public Paint(){
triangles = new ArrayList<>();
rectangles = new ArrayList<>();
circles = new ArrayList<>();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"private Instantiation(){}",
"public CyanSus() {\n\n }",
"public Clade() {}",
"public Pasien() {\r\n }",
"protected abstract void construct();",
"public PSRelation()\n {\n }",
"public Pitonyak_09_02() {\r\n }",
"public Curso() {\r\n }",
"public Chauffeur() {\r\n\t}",
"defaultConstructor(){}",
"public Supercar() {\r\n\t\t\r\n\t}",
"public Chick() {\n\t}",
"public _355() {\n\n }",
"private void __sep__Constructors__() {}",
"public CSSTidier() {\n\t}",
"public Achterbahn() {\n }",
"private TMCourse() {\n\t}",
"public Lanceur() {\n\t}",
"public Orbiter() {\n }",
"public Classe() {\r\n }",
"public Cohete() {\n\n\t}",
"public Carrera(){\n }",
"public prueba()\r\n {\r\n }",
"public Coche() {\n super();\n }",
"public AntrianPasien() {\r\n\r\n }",
"Reproducible newInstance();",
"public Trening() {\n }",
"public Parser()\n {\n //nothing to do\n }",
"public TTau() {}",
"public Aanbieder() {\r\n\t\t}",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}",
"ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}",
"public SlanjePoruke() {\n }",
"public Anschrift() {\r\n }",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"public Alojamiento() {\r\n\t}",
"public Phl() {\n }",
"public Libro() {\r\n }",
"public Cgg_jur_anticipo(){}",
"public Mitarbeit() {\r\n }",
"void DefaultConstructor(){}",
"public Rol() {}",
"public Magazzino() {\r\n }",
"public Car(){\n\t\t\n\t}",
"public ChaCha()\n\t{\n\t\tsuper();\n\t}",
"public Excellon ()\n {}",
"private SingleObject()\r\n {\r\n }",
"public Tigre() {\r\n }",
"public Tbdtokhaihq3() {\n super();\n }",
"public RngObject() {\n\t\t\n\t}",
"public Corso() {\n\n }",
"public Genret() {\r\n }",
"public Odontologo() {\n }",
"public Method() {\n }",
"public Demo() {\n\t\t\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"public Person() {\n\t\t\n\t}",
"public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}",
"private ATCres() {\r\n // prevent to instantiate this class\r\n }",
"public Parameters() {\n\t}",
"public Carrinho() {\n\t\tsuper();\n\t}",
"public Mannschaft() {\n }",
"public CMN() {\n\t}",
"public Factory() {\n\t\tsuper();\n\t}",
"public SgaexpedbultoImpl()\n {\n }",
"public ClassTemplate() {\n\t}",
"public Livro() {\n\n\t}",
"public Self__1() {\n }",
"public Data() {\n \n }",
"public EnsembleLettre() {\n\t\t\n\t}",
"public TV() {\r\n\t}",
"public Soil()\n\t{\n\n\t}",
"public Tarifa() {\n ;\n }",
"public ExamMB() {\n }",
"public Data() {\n }",
"public Data() {\n }",
"public Job() {\n\t\t\t\n\t\t}",
"public Basic() {}",
"public Vector() {\n construct();\n }",
"public JSFOla() {\n }",
"public MonHoc() {\n }",
"public ObjectFactory() {\n\t}",
"public Calculator() {\r\n\t\t/*\r\n\t\t * Constructor - Method name which has the same class name is called a Consatructor\r\n\t\t */\r\n\t\tSystem.out.println(\"Calling constructor\");\r\n\t}",
"public Construct() {\n\tprefixes = new StringBuilder();\n\tvariables = new StringBuilder();\n\twheres = new StringBuilder();\n }",
"public Bicycle() {\n // You can also call another constructor:\n // this(1, 50, 5, \"Bontrager\");\n System.out.println(\"Bicycle.Bicycle- no arguments\");\n gear = 1;\n cadence = 50;\n speed = 5;\n name = \"Bontrager\";\n }",
"public Book() {\n\t\t// Default constructor\n\t}",
"private Cat() {\n\t\t\n\t}",
"protected Betaling()\r\n\t{\r\n\t\t\r\n\t}",
"public lo() {}",
"private Node() {\n\n }",
"private Sequence() {\n this(\"<Sequence>\", null, null);\n }",
"public Tbdcongvan36() {\n super();\n }",
"private R() {\n\n }",
"public DetArqueoRunt () {\r\n\r\n }",
"public Chant(){}",
"public Catelog() {\n super();\n }",
"public AFMV() {\r\n }",
"public ObjectFactory() {\r\n\t}"
]
| [
"0.8598358",
"0.8490459",
"0.779069",
"0.75916266",
"0.74338543",
"0.7402439",
"0.73899066",
"0.73786867",
"0.73710835",
"0.736356",
"0.73510695",
"0.7349147",
"0.73327464",
"0.7320386",
"0.7284455",
"0.72843355",
"0.7260016",
"0.7250978",
"0.7246011",
"0.7228862",
"0.72135246",
"0.7212598",
"0.72050625",
"0.71962965",
"0.7168693",
"0.7164923",
"0.71450454",
"0.71375483",
"0.71274894",
"0.7111143",
"0.7110846",
"0.7110221",
"0.71016353",
"0.709786",
"0.70929563",
"0.7090128",
"0.7088986",
"0.70840037",
"0.70780975",
"0.7076947",
"0.7067623",
"0.70507026",
"0.70473355",
"0.70423955",
"0.7032942",
"0.7030098",
"0.70288575",
"0.70275575",
"0.7025054",
"0.7021237",
"0.70036566",
"0.70034814",
"0.6997157",
"0.6995703",
"0.699496",
"0.6992073",
"0.6970675",
"0.6961982",
"0.695459",
"0.69495475",
"0.69470567",
"0.6931275",
"0.6930754",
"0.6926373",
"0.69262725",
"0.69262385",
"0.69085205",
"0.69074196",
"0.69046026",
"0.6900651",
"0.6898171",
"0.68925405",
"0.68879384",
"0.68830645",
"0.68784046",
"0.6873518",
"0.68695796",
"0.6868337",
"0.6868337",
"0.6866889",
"0.6866854",
"0.686482",
"0.6864467",
"0.6857658",
"0.6855929",
"0.68551046",
"0.6854488",
"0.6844626",
"0.68433833",
"0.6842415",
"0.6839897",
"0.6838442",
"0.6834942",
"0.6832214",
"0.68303674",
"0.68289626",
"0.6820073",
"0.6819346",
"0.6816154",
"0.68155855",
"0.6815443"
]
| 0.0 | -1 |
adds a triangle to the arrayList of the triangles | public void addTriangle(Triangle triangle){
triangles.add(triangle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);",
"void addTriangle(AbstractTriangle t);",
"public void add(final Vector3d vertex) {\n\t\tcurrentRow[rowIndex] = vertex;\n\t\tif (rowIndex > 0 && lastRow != null) {\n\t\t\tfinal Vector3d edge1 = lastRow[rowIndex - 1];\n\t\t\tfinal Vector3d edge2 = lastRow[rowIndex];\n\t\t\tfinal Vector3d edge3 = currentRow[rowIndex];\n\t\t\tfinal Vector3d edge4 = currentRow[rowIndex - 1];\n\t\t\tfinal Triangle t1 = reverseOrder ? makeTriangle(edge1, edge3, edge2)\n\t\t\t\t\t: makeTriangle(edge1, edge2, edge3);\n\t\t\tfinal Triangle t2 = reverseOrder ? makeTriangle(edge1, edge4, edge3)\n\t\t\t\t\t: makeTriangle(edge1, edge3, edge4);\n\t\t\ttriangs.add(t1);\n\t\t\ttriangs.add(t2);\n\t\t}\n\t\trowIndex++;\n\t\tif (rowIndex >= currentRow.length) {\n\t\t\tlastRow = currentRow;\n\t\t\tcurrentRow = new Vector3d[currentRow.length];\n\t\t\trowIndex = 0;\n\t\t}\n\t}",
"public Triangles()\n {\n this.triangles = new ArrayList<>();\n }",
"void add(Polygon3 polygon)\n\t\t{\n\t\t\tPolygon3[] shapes2 = new Polygon3[shapes.length+1];\n\t\t\tfor(int i=0; i<shapes.length; i++)\n\t\t\t{\n\t\t\t\tshapes2[i] = shapes[i];\n\t\t\t}\n\t\t\tshapes2[shapes.length] = polygon;\n\t\t\tshapes = new Polygon3[shapes2.length];\n\t\t\tfor(int i=0; i<shapes2.length; i++)\n\t\t\t{\n\t\t\t shapes[i] = shapes2[i];\n\t\t\t}\n\t\t\t\n\t\t}",
"@Override\n public void onDrawFrame(GL10 gl) {\n // Clear color and depth buffers using clear-value set earlier\n gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);\n \n // You OpenGL|ES rendering code here\n // ......\n gl.glLoadIdentity(); // Reset model-view matrix\n gl.glTranslatef(-((float) triangles.get(5)[0].x()+1.0f),-((float) triangles.get(5)[0].y()+1.0f),0.0f);\n Log.i(\"dd\",\"\"+triangles.get(0)[0].x() + \" \"+ triangles.get(0)[0].y()+\" \"+ triangles.get(0)[0].z());\n for(int i=0;i<triangles.size();i++){\n \t\n \tfloat[] vertices=new float[] {\n \t\t(float) triangles.get(i)[0].x(),(float) triangles.get(i)[0].y(),(float) triangles.get(i)[0].z()\t , //first point\n \t\t(float) triangles.get(i)[1].x(),(float) triangles.get(i)[1].y(),(float) triangles.get(i)[1].z()\t , //second point\n \t\t(float) triangles.get(i)[2].x(),(float) triangles.get(i)[2].y(),(float) triangles.get(i)[2].z()\t //third point\n \t };\n \t triangle=new Triangle(vertices);\n \t triangle.draw(gl); // Draw triangle \n }\n /* gl.glLoadIdentity(); // Reset model-view matrix\n gl.glTranslatef(-5.0f,-6.0f,-2.0f);\n float[] vertices = { // Vertices of the triangle\n \t 5.0f, 6.0f, 1.0f, // 0. top\n \t 3.0f, 0.0f, 0.0f, // 1. left-bottom\n \t 7.0f, 0.0f, 0.0f // 2. right-bottom\n \t };\n triangle=new Triangle(vertices);\n triangle.draw(gl); */\n\n }",
"public void convertInTriangles(final @NotNull Vertex... polygon)\n {\n if ((polygon == null) || (polygon.length < 3))\n {\n return;\n }\n\n final int length = polygon.length;\n final Vertex first = polygon[0];\n\n for (int i = 2; i < length; i++)\n {\n this.triangles.add(new Triangle(first, polygon[i - 1], polygon[i]));\n }\n }",
"private void drawTriangle(double newVal) {\n\n triangle.getPoints().clear();\n triangle.getPoints().addAll(getEndX(), getEndY(), getEndX() - Point.RADIUS / 2.0,\n getEndY() + Point.RADIUS * 5 / 4.0 * (newVal) / (getAbsMax()), getEndX() + Point.RADIUS / 2.0,\n getEndY() + Point.RADIUS * 5 / 4.0 * (newVal) / getAbsMax());\n\n }",
"public TriangleObject (double[][][] t) {\n\tfor (double[][] i: t) {\n Triangle in = new Triangle(i);\n\t\ttriangles.add(in); //You need to instantiate a new triangle to satsify this ^^\n\t}\n }",
"public static ArrayList<Triangle> Triangulation(ArrayList<Point> points){\n\t\t\n\t\t\n\t\t\n\t\tpoints.sort(new PointComperator());\n\t\tpoints.add(MainFrame.buutomLeft);\n\t\tStack<Point> CH= new Stack<Point>();\n\t\tArrayList<Triangle> T=new ArrayList<Triangle>();\n\t\tCH.push(MainFrame.buutomLeft);\n\t\tCH.push(points.get(0));\n\t\tCH.push(points.get(1));\n\t\t\n\t\tfor (int i = 0; i < points.size(); i++) {\n\t\t\tPoint curr=points.get(i);\n\t\t\tif(Orient(CH.get(CH.size()-2),CH.peek(), curr))\n\t\t\t{\n\t\t\t\tT.add(new Triangle(curr, CH.peek(), MainFrame.buutomLeft));\n\t\t\t\tCH.push(curr);\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tT.add(new Triangle(CH.peek(), curr, MainFrame.buutomLeft));\n\n\t\t\t\twhile(!Orient(CH.get(CH.size()-2),CH.peek(),curr)) {\n\t\t\t\t\tPoint temp = CH.pop();\n\t\t\t\t\tT.add(new Triangle(temp, CH.peek(), curr));\n\t\t\t\t}\n\t\t\t\tCH.push(curr);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn T;\n\t}",
"public MyGLRenderer(Context context, ArrayList<Point_dt[]> triangles) {\n this.context = context;\n this.triangles=triangles;\n\n }",
"public void triangulo() {\n fill(0);\n stroke(255);\n strokeWeight(5);\n triangle(width/2, 50, height+100, 650, 350, 650);\n //(width/2, height-100, 350, 150, 900, 150);\n }",
"public Triangle() {\n\t\tsuper.addPoint(new java.awt.Point(0,1));\n\t\tsuper.addPoint(new java.awt.Point(1,0));\n\t\tsuper.addPoint(new java.awt.Point(2,1));\n\t}",
"public Triangle (int tipX, int tipY, int height, String orientation){\n super.points = new ArrayList();\n x1 = tipX;\n y1 = tipY;\n this.height = height;\n defineVertexes(orientation);\n definePoints();\n }",
"public static int addPolygon(final DoubleList output, final double[][] input) {\n // create a square polygon\n // first triangle\n addPoint(output, input[RIGHT_TOP]);\n addPoint(output, input[LEFT_TOP]);\n addPoint(output, input[LEFT_BOTTOM]);\n // second triangle\n addPoint(output, input[LEFT_BOTTOM]);\n addPoint(output, input[RIGHT_BOTTOM]);\n addPoint(output, input[RIGHT_TOP]);\n // end add\n return GL2.GL_TRIANGLES;\n }",
"public ArrayList<Triangle> getOccluderVertexData();",
"public void addVertex();",
"public void addVertices(int n);",
"public Triangle(\n IPoint firstPoint,\n IPoint secondPoint,\n IPoint thirdPoint,\n IPrimitive parent)\n {\n super(parent);\n this.addVertex(firstPoint);\n this.addVertex(secondPoint);\n this.addVertex(thirdPoint);\n\n }",
"public Triangle() {\n // initialize vertex byte buffer for shape coordinates\n ByteBuffer bb = ByteBuffer.allocateDirect(\n // (number of coordinate values * 4 bytes per float)\n triangleCoords.length * 4);\n // use the device hardware's native byte order\n bb.order(ByteOrder.nativeOrder());\n\n // create a floating point buffer from the ByteBuffer\n vertexBuffer = bb.asFloatBuffer();\n // add the coordinates to the FloatBuffer\n vertexBuffer.put(triangleCoords);\n // set the buffer to read the first coordinate\n vertexBuffer.position(0);\n\n // prepare shaders and OpenGL program\n int vertexShader = MyGLRenderer.loadShader(\n GLES20.GL_VERTEX_SHADER, vertexShaderCode);\n int fragmentShader = MyGLRenderer.loadShader(\n GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode);\n\n mProgram = GLES20.glCreateProgram(); // create empty OpenGL Program\n GLES20.glAttachShader(mProgram, vertexShader); // add the vertex shader to program\n GLES20.glAttachShader(mProgram, fragmentShader); // add the fragment shader to program\n GLES20.glLinkProgram(mProgram); // create OpenGL program executables\n\n }",
"public Triangle (int x, int y, int z){ \r\n \r\n \r\n }",
"void addArrow() {\n Drawer.getInstance().addElem(this);\n Drawer.getInstance().addElem(triangle);\n }",
"public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}",
"public Triangle() { \n super(\"Triangle: \");\n this.setP1(new Point());\n this.setP2(new Point());\n this.setP3(new Point());\n }",
"void AddQuad(Quadruple quad)\n {\n Quadruple.add(nextQuad, quad);\n nextQuad++;\n }",
"void add(int vertex);",
"@Override\n\tpublic String toString() {\n\t\treturn \"(Triangle \"+verts+\")\" ;\n\t}",
"public void add(Polygon p) {\n for (int i = 0; i < p.size(); i++)\n add(p.get(i).xyz.x, p.get(i).xyz.y, p.get(i).xyz.z);\n }",
"public Triangle(ITriangle triangleToCopy, IPrimitive parent)\n {\n super(triangleToCopy, parent);\n\n }",
"public static List<List<Integer>> pascalTriangle(int rows){\n\t\tList<List<Integer>> triangle = new ArrayList<>();\n\t\t\n\t\tif(rows<=0) {\n\t\t\treturn triangle;\n\t\t}\n\t\t\n\t\tList<Integer> firstRow = new ArrayList<>();\n\t\tfirstRow.add(1);\n\t\ttriangle.add(firstRow);\n\n\t\tfor(int i=1; i<rows;i++) {\n\t\t\tList<Integer> row = new ArrayList<>();\n\t\t\trow.add(1);//first element should always be 1\n\t\t\tList<Integer> previous = triangle.get(i-1);\n\t\t\tfor(int j = 1; j<i; j++) {\n\t\t\t\t// add the top and topLeft diagonal value\n\t\t\t\tint value = previous.get(j-1) + previous.get(j);\n\t\t\t\trow.add(value);\n\t\t\t}\n\t\t\trow.add(1);//last element should always be 1\n\t\t\ttriangle.add(row);\n\t\t}\n\t\treturn triangle;\n\t}",
"public TriangleList(int numTriangles, int numVertices) {\n\t\tindices = BufferUtil.newIntBuffer(numTriangles * 3); //3 vertex index (v1,v2,v3)\n\t\tpositions = BufferUtil.newDoubleBuffer(numVertices * 3); //3 components (x,y,z)\n\t\tnormals = BufferUtil.newFloatBuffer(numVertices * 3); //3 components (x,y,z)\n\t}",
"public void makeLine() {\n \t\tList<Pellet> last_two = new LinkedList<Pellet>();\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 2));\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 1));\n \n \t\tPrimitive line = new Primitive(GL_LINES, last_two);\n \t\tMain.geometry.add(line);\n \n \t\tActionTracker.newPolygonLine(line);\n \t}",
"public Triangle() {}",
"public Triangle(int x1, int y1, int x2, int y2, int x3, int y3, String name){\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n this.x3 = x3;\n this.y3 = y3;\n this.name = name;\n \n \n }",
"Triangle(int x, int y, int z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }",
"public static int addPolygon(final DoubleList output, final double[][] input,\n final int v1, final int v2, final int v3, final int v4) {\n // create a square polygon\n // first triangle\n addPoint(output, input[v1]);\n addPoint(output, input[v2]);\n addPoint(output, input[v3]);\n // second triangle\n addPoint(output, input[v3]);\n addPoint(output, input[v4]);\n addPoint(output, input[v1]);\n // end add\n return GL2.GL_TRIANGLES;\n }",
"public Triangle( Triangle tri ) {\n super(\"Triangle: \");\n this.setP1( new Point( tri.getP1() ) );\n this.setP2( new Point( tri.getP2() ) );\n this.setP3( new Point( tri.getP3() ) );\n }",
"public void setupTriangles(VrState state);",
"public Triangle() {\n setPointsAs0();\n S = 0;\n }",
"private Polygon createTriangle(Point a, Point b, Point c) {\n Polygon p = new Polygon();\n p.addPoint(a.x, a.y);\n p.addPoint(b.x, b.y);\n p.addPoint(c.x, c.y);\n\n return p;\n }",
"public void triangle(){\n Shape triangle = new Shape();\n triangle.addPoint(new Point(0,0));\n triangle.addPoint(new Point(6,0));\n triangle.addPoint(new Point(3,6));\n for (Point p : triangle.getPoints()){\n System.out.println(p);\n }\n double peri = getPerimeter(triangle);\n System.out.println(\"perimeter = \"+peri);\n }",
"private void drawTriangle(GL2 gl2, int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)\n {\n gl2.glBegin(GL2.GL_TRIANGLES);\n gl2.glColor3f(r, g, b);\n gl2.glVertex2f(x1, y1);\n gl2.glVertex2f(x2, y2);\n gl2.glVertex2f(x3, y3);\n gl2.glEnd();\n }",
"void add(Vertex vertex);",
"void addVertex(Vertex v);",
"@Override\r\n public void generateDisplayList(GL2 gl, GLU glu) {\r\n ArrayList<double[]> triangle = null;\r\n\r\n /*\r\n * List of all vertices describing the contour of the border, as well as the\r\n * vertices color and texture coordinates.\r\n */\r\n ArrayList<double[]> borderTriangle = null;\r\n\r\n // Get a denominator for the display list\r\n displayList = gl.glGenLists(1);\r\n\r\n // Create the display list\r\n gl.glNewList(displayList, GL2.GL_COMPILE);\r\n // Store the current OpenGL attribute states\r\n gl.glPushAttrib(GL2.GL_ALL_ATTRIB_BITS);\r\n\r\n /*\r\n * Set the alpha value of the colors. The opacity of the whole object\r\n * (opacity) always has a higher priority.\r\n */\r\n if (opacity < 1) {\r\n fillColor.setAlpha(opacity);\r\n borderColor.setAlpha(opacity);\r\n } else {\r\n fillColor.setAlpha(fillOpacity);\r\n borderColor.setAlpha(1);\r\n }\r\n\r\n // Don't draw if the dimensions are too small\r\n if (sideLength > 0) {\r\n\r\n // Create a list storing the triangles vertices\r\n triangle = new ArrayList<double[]>();\r\n\r\n // Check if the triangle will be rendered with a texture applied on it\r\n if (texture != null) {\r\n\r\n // Calculate the triangles contour\r\n calculateContour(triangle, null);\r\n\r\n // Set the triangles color to white (because of texture)\r\n applyColor(triangle, new Color(Color.WHITE));\r\n\r\n // Map the texture to the triangle\r\n applyTexture(triangle, texture.getImageTexCoords());\r\n\r\n // Enable texture support\r\n texture.enable();\r\n\r\n // Draw the textured triangle\r\n TessellatedPolygon poly = new TessellatedPolygon();\r\n poly.init(gl, glu);\r\n poly.beginPolygon();\r\n poly.beginContour();\r\n poly.renderContour(triangle);\r\n poly.endContour();\r\n poly.endPolygon();\r\n poly.end();\r\n poly = null;\r\n\r\n // Disable texture support\r\n texture.disable();\r\n } else {\r\n\r\n // Check if the triangle will be rendered with a border\r\n if (borderWidth > 0) {\r\n\r\n // Create a list storing the borders vertices\r\n borderTriangle = new ArrayList<double[]>(1);\r\n\r\n // Calculate the triangles contour and the contour of the border\r\n calculateContour(triangle, null);\r\n calculateContour(triangle, borderTriangle);\r\n\r\n // Apply the border color\r\n applyColor(triangle, borderColor);\r\n applyColor(borderTriangle, borderColor);\r\n\r\n // Don't apply any texture\r\n applyTexture(triangle, null);\r\n applyTexture(borderTriangle, null);\r\n\r\n // Draw the border\r\n TessellatedPolygon poly = new TessellatedPolygon();\r\n poly.init(gl, glu);\r\n poly.setWindingRule(GLU.GLU_TESS_WINDING_ODD);\r\n poly.beginPolygon();\r\n poly.beginContour();\r\n poly.renderContour(triangle);\r\n poly.endContour();\r\n poly.beginContour();\r\n poly.renderContour(borderTriangle);\r\n poly.endContour();\r\n poly.endPolygon();\r\n poly.end();\r\n\r\n // Apply the fill color\r\n applyColor(borderTriangle, fillColor);\r\n\r\n // Draw the inner triangle\r\n poly.init(gl, glu);\r\n poly.beginPolygon();\r\n poly.beginContour();\r\n poly.renderContour(borderTriangle);\r\n poly.endContour();\r\n poly.endPolygon();\r\n poly.end();\r\n poly = null;\r\n } else {\r\n\r\n // Calculate the contour of the triangle\r\n calculateContour(triangle, null);\r\n\r\n // Apply the fill color to the triangle\r\n applyColor(triangle, fillColor);\r\n\r\n // Don't apply any texture\r\n applyTexture(triangle, null);\r\n\r\n // Draw the triangle without border\r\n TessellatedPolygon poly = new TessellatedPolygon();\r\n poly.init(gl, glu);\r\n poly.beginPolygon();\r\n poly.beginContour();\r\n poly.renderContour(triangle);\r\n poly.endContour();\r\n poly.endPolygon();\r\n poly.end();\r\n poly = null;\r\n }\r\n }\r\n }\r\n\r\n // Restore the OpenGL attribute states\r\n gl.glPopAttrib();\r\n gl.glEndList();\r\n }",
"Triangle(){\n side1 = 1.0;\n side2 = 1.0;\n side3 = 1.0;\n }",
"Triangle (double side1, double side2, double side3){\n this.side1 = side1;\n this.side2 = side2;\n this.side3 = side3;\n }",
"public Triangle (double x1,double y1,double x2, double y2,double x3,double y3)\r\n {\r\n v1 = new Point(x1,y1);\r\n v2 = new Point(x2,y2);\r\n v3 = new Point(x3,y3);\r\n }",
"@Override\n public void addVertex(List<V> phmapVertices, TimeFrame tf) {\n for (V v : phmapVertices) {\n addVertex(v,tf);\n }\n }",
"public Triangle( Point p1, Point p2, Point p3 ) {\n super(\"Triangle: \");\n this.setP1(p1);\n this.setP2(p2);\n this.setP3(p3);\n }",
"public void addToList(Vertex newVertex)\n\t{\n\t\tadjacencyList.add(newVertex);\n\t\tupdateIndegree();\n\t}",
"TriangleChecker(int x, int y, int z) {\n triangle = new Triangle(x, y, z);\n }",
"public static List<List<Integer>> triangleTriplets(List<Integer> data) {\n\t\tList<List<Integer>> output = new ArrayList<>();\n\t\tif (data == null || data.size() < 3) {\n\t\t\treturn output;\n\t\t}\n\t\tdata.sort( (a, b) -> a - b);\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = i + 1; j < data.size(); j++) {\n\t\t\t\tfor (int k = j + 1; k < data.size(); k++) {\n\t\t\t\t\tint a = data.get(i);\n\t\t\t\t\tint b = data.get(j);\n\t\t\t\t\tint c = data.get(k);\n\t\t\t\t\tif (isTriangle(a, b, c)) {\n\t\t\t\t\t\toutput.add(Arrays.asList(a, b, c));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}",
"public Triangle(IPoint firstPoint, IPoint secondPoint, IPoint thirdPoint)\n {\n this(firstPoint, secondPoint, thirdPoint, null);\n\n }",
"public void draw() {\n // añadimos el programa al entorno de opengl\n GLES20.glUseProgram(mProgram);\n\n // obtenemos el identificador de los sombreados del los vertices a vPosition\n positionHandle = GLES20.glGetAttribLocation(mProgram, \"vPosition\");\n\n // habilitamos el manejo de los vertices del triangulo\n GLES20.glEnableVertexAttribArray(positionHandle);\n\n // Preparamos los datos de las coordenadas del triangulo\n GLES20.glVertexAttribPointer(positionHandle, COORDS_PER_VERTEX,\n GLES20.GL_FLOAT, false,\n vertexStride, vertexBuffer);\n\n // Obtenemos el identificador del color del sombreado de los fragmentos\n colorHandle = GLES20.glGetUniformLocation(mProgram, \"vColor\");\n\n // Establecemos el color para el dibujo del triangulo\n GLES20.glUniform4fv(colorHandle, 1, color, 0);\n\n // SE dibuja el triangulo\n GLES20.glDrawArrays(GLES20.GL_LINE_LOOP, 0, vertexCount);\n\n // Deshabilitamos el arreglo de los vertices (que dibuje una sola vez)\n GLES20.glDisableVertexAttribArray(positionHandle);\n }",
"public void addSegment()\n { \n Location tail = new Location();\n \n if(up)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()+15);\n }\n else if(down)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()-15);\n }\n else if(left)\n {\n tail.setA(list.get(0).getA()+15);\n tail.setB(list.get(0).getB());\n }\n else if(right)\n {\n tail.setA(list.get(0).getA()-15);\n tail.setB(list.get(0).getB());\n } \n \n ArrayList<Location> temp = new ArrayList<Location>();\n \n \n temp.add(tail);\n \n for(int i=0 ; i<list.size() ; i++)\n {\n temp.add(list.get(i));\n }\n list = temp; \n }",
"protected abstract Triangle makeTriangle(final Vector3d edge1, final Vector3d edge2,\n\t\t\tfinal Vector3d edge3);",
"private void addToLineItem(LineItem newLineItem) {\r\n LineItem[] tempItems = new LineItem[lineItems.length + 1];\r\n System.arraycopy(lineItems, 0, tempItems, 0, lineItems.length);\r\n tempItems[lineItems.length] = newLineItem;\r\n lineItems = tempItems;\r\n }",
"void DrawTriangle(int triangleSize, int startx, int starty, int size, String[] labels,GamePanel gamePanel) {\n int index=0;\n for (int i = 0; i < triangleSize; i++) {\n int start = (int) Math.round(startx - (i * size * Math.sqrt(3) / 2) / 2);\n for (int j = 0; j < i + 1; j++) {\n HexButton button = new HexButton(labels[index]);\n button.setNumber( Integer.parseInt(labels[index]) - 1);\n index++;\n button.setBounds((int) Math.round(start + (j * size * Math.sqrt(3) / 2)), i * (size * 3 / 4) + starty, 100, 100);\n button.addActionListener(gamePanel);\n this.add(button);\n }\n }\n }",
"public void addPoints(int i, List<Point2D> points);",
"private static void addTriangle(Hull3f sphere, Point3f p1, Point3f p2,\n Point3f p3, float resolution) {\n if ((p1.distance(p2) < resolution) || (p2.distance(p3) < resolution) || (p3.distance(p1) < resolution)) {\n Triangle3f t;\n t = new Triangle3f(p1, p2, p3);\n sphere.getTriangles().add(t);\n } else {\n Point3f p12;\n p12 = new Point3f(p1);\n p12.add(p2);\n Point3fLogic.normalize(p12);\n Point3f p23;\n p23 = new Point3f(p2);\n p23.add(p3);\n Point3fLogic.normalize(p23);\n Point3f p31;\n p31 = new Point3f(p3);\n p31.add(p1);\n Point3fLogic.normalize(p31);\n addTriangle(sphere, p1, p12, p31, resolution);\n addTriangle(sphere, p2, p23, p12, resolution);\n addTriangle(sphere, p3, p31, p23, resolution);\n addTriangle(sphere, p12, p23, p31, resolution);\n }\n }",
"public Paint(){\n triangles = new ArrayList<>();\n rectangles = new ArrayList<>();\n circles = new ArrayList<>();\n }",
"public void addToUniverse(final Universe uni) {\n\t\tfor (Triangle t : getTriangles())\n\t\t\tuni.add(t);\n\t}",
"public static ArrayList<Integer[]> compactForwardAlgorithmTriangles(ArrayList<Integer>[] graph) {\n Set<Pair<Integer, ArrayList<Integer>>> pairs = Utils.getSortedArrays(graph);\n Map<Integer, Integer> etas = Utils.getEtasMap(pairs);\n\n // sort adjacency arrays according to eta\n pairs.forEach(p -> p.getSecond().sort(Comparator.comparing(etas::get)));\n\n\n\n int triangleCount = 0;\n ArrayList<Integer[]> triangles = new ArrayList();\n\n\n // main part, in which we actually count triangles\n Iterator<Pair<Integer, ArrayList<Integer>>> iterator = pairs.iterator();\n while (iterator.hasNext()) {\n Pair<Integer, ArrayList<Integer>> pair = iterator.next();\n Integer v = pair.getFirst();\n ArrayList<Integer> v_neighbors = graph[v];\n\n for (int u : v_neighbors) {\n if (etas.get(u) > etas.get(v)) {\n ArrayList<Integer> u_neighbors = graph[u];\n\n Iterator<Integer> uIterator = u_neighbors.iterator(), vIterator = v_neighbors.iterator();\n\n if (uIterator.hasNext() && vIterator.hasNext()) {\n Integer u_ = uIterator.next(), v_ = vIterator.next();\n while (uIterator.hasNext() && vIterator.hasNext() && etas.get(u_) < etas.get(v)\n && etas.get(v_) < etas.get(v)) {\n if (etas.get(u_) < etas.get(v_))\n u_ = uIterator.next();\n else if (etas.get(u_) > etas.get(v_))\n v_ = vIterator.next();\n else {\n Integer[] triangle = new Integer[3];\n\n triangle[0] = u;\n triangle[1] = v;\n triangle[2] = u_;\n triangles.add(triangle);\n\n\n triangleCount++;\n\n u_ = uIterator.next();\n v_ = vIterator.next();\n\n }\n }\n\n }\n }\n }\n }\n return triangles;\n }",
"public Triangle copy()\r\n {\r\n return new Triangle (v1.getX(),v1.getY(),v2.getX(),v2.getY(),v3.getX(),v3.getY());\r\n }",
"Triangle(int height) {\r\n\t this.height = height;\r\n\t}",
"public Polygon getTriangle() {\n\n Matrix4 normalProjection = new Matrix4().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n\n spriteDebugger.setProjectionMatrix(normalProjection);\n spriteDebugger.begin(ShapeRenderer.ShapeType.Line);\n spriteDebugger.polygon(getLine().getVertices());\n spriteDebugger.setColor(Color.PURPLE);\n spriteDebugger.end();\n\n spriteDebugger.end();\n return getLine();\n }",
"private void _drawTriangle(Graphics2D g, Triangle t, TriangleMesh tMesh) {\r\n // Get triangle data\r\n Vector3f a = tMesh.getVertex(t.getA()).getPosition();\r\n Vector3f b = tMesh.getVertex(t.getB()).getPosition();\r\n Vector3f c = tMesh.getVertex(t.getC()).getPosition();\r\n // Draw edges of the triangle with provided algorithm\r\n String algorithm = RenderApplication.properties.getProperty(\"draw.algorithm\");\r\n if(algorithm.equals(\"Bresenham\")) {\r\n drawRasterLine(g, new Vector2f(a.x, a.y), new Vector2f(b.x, b.y));\r\n drawRasterLine(g, new Vector2f(b.x, b.y), new Vector2f(c.x, c.y));\r\n drawRasterLine(g, new Vector2f(c.x, c.y), new Vector2f(a.x, a.y));\r\n } else if (algorithm.equals(\"Scanline\")) {\r\n ArrayList<Vector2f> vertices = new ArrayList<>();\r\n // This drawing algorithm also draws lines between vertices with Bresenham\r\n vertices.addAll(drawRasterLine(g, new Vector2f(a.x, a.y), new Vector2f(b.x, b.y)));\r\n vertices.addAll(drawRasterLine(g, new Vector2f(b.x, b.y), new Vector2f(c.x, c.y)));\r\n vertices.addAll(drawRasterLine(g, new Vector2f(c.x, c.y), new Vector2f(a.x, a.y)));\r\n // Actual Scanline algorithm\r\n drawScanlines(g, vertices);\r\n // Clear vertices for next iteration\r\n vertices.clear();\r\n } else {\r\n // Draw the 'standard' way with drawLine from framework\r\n drawLine(g, new Vector2f(a.x, a.y), new Vector2f(b.x, b.y), Color.RED);\r\n drawLine(g, new Vector2f(b.x, b.y), new Vector2f(c.x, c.y), Color.RED);\r\n drawLine(g, new Vector2f(c.x, c.y), new Vector2f(a.x, a.y), Color.RED);\r\n }\r\n\r\n }",
"private void addRow() {\n\t\t\n\t\tArrayList<Invader> lastRow = enemyArray.get(enemyArray.size() - 1);\n\t\tArrayList<Invader> newRow = new ArrayList<Invader>();\n\t\t\t\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tnewRow.add(new Invader(\n\t\t\t\t\tlastRow.get(i).getX(),\n\t\t\t\t\tlastRow.get(i).getY() + 40,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\t2));\n\t\t}\n\t\t\n\t\tenemyArray.add(newRow);\n\t}",
"public Triangle (double x1,double y1,double x2, double y2)\r\n {\r\n v1 = new Point(x1,y1);\r\n v2 = new Point(x2,y2);\r\n v3 = new Point(0,0);\r\n }",
"public void triangles(int n, boolean isRGBTri) {\n\t\tdouble height = n / 2 * Math.sqrt(NUM_TRIANGLE_SIDES); // height of triangle\n\t\tint startX = n/2;\n\n\t\tfor (int y = 0; y < this.getPictureWidth(); y += n) {\n\t\t\tthis.drawColumn(startX, 0, n, (int) height, isRGBTri);\n\t\t\tstartX += n;\n\t\t}\n\t}",
"int addVertex(Vector position);",
"public static InterleavedVertexBuffer createInterleavedLeftTriangleWithColor() {\n InterleavedVertexBuffer.Builder left = new InterleavedVertexBuffer.Builder(BufferUsage.STATIC);\n left.add(\"a_Pos\", new VerticesData(BufferTestUtil.createTriangleData(0.5f, 0.5f, -0.5f, 0)));\n left.add(\"a_Color\", new ColorData(BufferTestUtil.createColors()));\n return left.build();\n }",
"@FXML\r\n private void crearTriangulo(ActionEvent event) {\n \r\n double x[] = {100, 150, 50};\r\n double y[] = {100, 210, 210, 50};\r\n \r\n g.setFill(Color.GOLD);\r\n g.fillPolygon(x, y, 3);\r\n }",
"private void createList(String[] toAdd) {\n FixData fixedList;\n for (int i = 0; i < toAdd.length; ++i) {\n fixedList = new FixData(toAdd[i]);\n if (pickAdjacent(fixedList))\n this.head = createListWrap(this.head, fixedList);\n else\n fixedList = null;\n }\n }",
"public Triangle(float c0X, float c0Y, float c1X, float c1Y, float c2X, float c2Y, float r, float g, float b) {\n triangleCoords[0] = c0X;\n triangleCoords[1] = c0Y;\n triangleCoords[2] = 0;\n triangleCoords[3] = c1X;\n triangleCoords[4] = c1Y;\n triangleCoords[5] = 0;\n triangleCoords[6] = c2X;\n triangleCoords[7] = c2Y;\n triangleCoords[8] = 0;\n color[0] = r;\n color[1] = g;\n color[2] = b;\n centerX = (c0X+c1X) / 2.0f;\n centerY = (float)(c0Y - ((c1X-c0X)/(Math.sqrt(3)*2.0f)));\n\n // initialize vertex byte buffer for shape coordinates\n ByteBuffer bb = ByteBuffer.allocateDirect(\n // (number of coordinate values * 4 bytes per float)\n triangleCoords.length * 4);\n // use the device hardware's native byte order\n bb.order(ByteOrder.nativeOrder());\n\n // create a floating point buffer from the ByteBuffer\n vertexBuffer = bb.asFloatBuffer();\n // add the coordinates to the FloatBuffer\n vertexBuffer.put(triangleCoords);\n // set the buffer to read the first coordinate\n vertexBuffer.position(0);\n\n\n // The drawn object (This triangle) needs to claim shaders for vertex and fragment, so it can be drawn\n int vertexShader = MyGLRenderer.loadShader(GLES20.GL_VERTEX_SHADER,\n vertexShaderCode);\n int fragmentShader = MyGLRenderer.loadShader(GLES20.GL_FRAGMENT_SHADER,\n fragmentShaderCode);\n\n // create empty OpenGL ES Program ( = one openGL procedure responsible for drawing this shape)\n mProgram = GLES20.glCreateProgram();\n\n // add the vertex shader to program\n GLES20.glAttachShader(mProgram, vertexShader);\n\n // add the fragment shader to program\n GLES20.glAttachShader(mProgram, fragmentShader);\n\n // creates OpenGL ES program executables\n GLES20.glLinkProgram(mProgram);\n }",
"public void addVertices(int num){ \n this.nrVertices += num;\n }",
"private List<TriangleBatch> loadTriangles(URL filePath) {\r\n\t\ttriangleStrips = new ArrayList<TriangleBatch>();\r\n\t\tFile fi;\r\n\t\ttry {\r\n\t\t\tfi = new File(filePath.toURI());\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (fi == null || !fi.canRead()) {\r\n\t\t\t\tthrow new OMTException(\"Can't open ABEMesh! \" + fi.toString(), null);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tFileInputStream file = new FileInputStream(fi);\r\n\t\t\t\r\n\t\t\t//read number of points (stored as unsigned int)\r\n\t\t\tbyte[] numberOfPoints = new byte[BitMath.sizeOfUnsignedInt];\r\n\t\t\tfile.read(numberOfPoints);\r\n\t\t\tnumOfPoints = BitMath.convertByteArrayToInt(numberOfPoints);\r\n\t\t\t\r\n\t\t\t//read points\r\n\t\t\t//3 floats for normals followed by 3 floats for coordinates per point\r\n\t\t\tpoints = new byte[BitMath.sizeOfFloat * 6 * numOfPoints];\r\n\t\t\tfile.read(points);\r\n\r\n\t\t\t\r\n\t\t\t//read number of triangle strips\r\n\t\t\tbyte[] numberOfTriangleStrips = new byte[BitMath.sizeOfUnsignedInt];\r\n\t\t\tfile.read(numberOfTriangleStrips);\r\n\t\t\t\r\n\t\t\tthis.processNormalsAndVertices();\r\n\t\t\t\r\n\t\t\t//read triangle strips\r\n\t\t\tint numberOfTriStrips = BitMath.convertByteArrayToInt(numberOfTriangleStrips);\r\n\r\n\t\t\tfor (int i = 0; i < numberOfTriStrips; i++) {\r\n\t\t\t\t\r\n\t\t\t\t//read number of points in the strip\r\n\t\t\t\tbyte[] numberOfPointsInStrip = new byte[BitMath.sizeOfUnsignedShort];\r\n\t\t\t\tfile.read(numberOfPointsInStrip);\r\n\t\t\t\t\r\n\t\t\t\t//read point indicies\r\n\t\t\t\tint numberOfPtsInStrip = BitMath.convertByteArrayToInt(numberOfPointsInStrip);\r\n\t\t\t\tbyte[] triangles = new byte[BitMath.sizeOfUnsignedInt * numberOfPtsInStrip];\r\n\t\t\t\tfile.read(triangles);\r\n\t\t\t\t\r\n\t\t\t\tif (numberOfPtsInStrip > 0) {\r\n\t\t\t\t\ttriangleStrips.add(createTriangleStrip(numberOfPtsInStrip, triangles));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t} catch (URISyntaxException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn triangleStrips;\r\n\t}",
"public Triangle(Triangle tri){\n this(tri.width, tri.height, tri.perpendicular, tri.getX(), tri.getY());\n }",
"public native VertexList append(VertexNode vertex);",
"public Triangle(Point a, Point b, Point c){\n this.a=a;\n this.b=b;\n this.c=c;\n }",
"public Triangle() {\n this(0,0,0,0,0);\n }",
"public static void drawTriangle(double[] x, double[] y, double[] z) {\n int[][] coord = new int[2][4];\n int i;\n \n coord[0][0] = (int) (this_size.width * x[0]);\n coord[0][1] = (int) (this_size.width * y[0]);\n coord[0][2] = (int) (this_size.width * z[0]);\n coord[0][3] = (int) (this_size.width * x[0]);\n \n coord[1][0] = (int) (this_size.height * x[1]);\n coord[1][1] = (int) (this_size.height * y[1]);\n coord[1][2] = (int) (this_size.height * z[1]);\n coord[1][3] = (int) (this_size.height * x[1]);\n \n this_graphics.drawPolygon(coord[0], coord[1], 4);\n }",
"void addLine(int index, Coordinate start, Coordinate end);",
"public PointList calculateTrianglePoints(Rectangle r)\r\n\t{\r\n\t\tPointList points = new PointList(3);\r\n\t\t\r\n\t\tpoints.addPoint(new Point(r.x + (r.width-1) / 2, r.y));\r\n\t\tpoints.addPoint(new Point(r.x, r.y + r.height-1));\r\n\t\tpoints.addPoint(new Point(r.x + r.width-1, r.y + r.height-1));\r\n\r\n\t\treturn points;\r\n\t}",
"public void addPoly(Polygon p) {\r\n\t// DEPRECATED\r\n\t\tif (p!=null) {\r\n\t\t\tPolygon[] npols = new Polygon[this.pols.length+1];// + 1 new Poly\r\n\t\t\tfor (int i=0; i<this.pols.length; i++) {\r\n\t\t\t\tnpols[i]=this.pols[i];\t\r\n\t\t\t};\r\n\t\t\tnpols[npols.length-1]=p;// the last new element\r\n\t\t\tthis.pols=npols;\r\n\t\t}\r\n\t\tthis.QuickSort(0, this.pols.length-1);\r\n\t}",
"public Triangle(Point p1, Point p2, Point p3) {\n this.p1 = p1;\n this.p2 = p2;\n this.p3 = p3;\n this.path = buildPath();\n }",
"public Triangle()\n {\n\n this(new Point(-0.5f, (float)-Math.tan(Math.PI / 6), 0f), new Point(\n 0.5f,\n (float)-Math.tan(Math.PI / 6),\n 0f), new Point(0f, (float)Math.sqrt(0.75)\n + (float)-Math.tan(Math.PI / 6), 0f));\n }",
"public Triangle(IPrimitive parent)\n {\n this(new Point(-0.5f, (float)-Math.tan(Math.PI / 6), 0f), new Point(\n 0.5f,\n (float)-Math.tan(Math.PI / 6),\n 0f), new Point(0f, (float)Math.sqrt(0.75)\n + (float)-Math.tan(Math.PI / 6), 0f), parent);\n\n }",
"public List<ga_Triangle2D> tesselatePolygon(ga_Polygon poly);",
"public void makeTriangleBox(int offsetX, int offsetY, int myWidth, int myHeight, int numTriHorizontal, int numTriVertical, int collRect, float[][] verts) {\n //Top Triangles\n for (int i = 0; i < numTriHorizontal; i++) {\n verts[i][0] = (i*myWidth/numTriHorizontal) + offsetX;\n verts[i][1] = offsetY;\n verts[i][2] = ((i+1)*(myWidth/numTriHorizontal)) + offsetX;\n verts[i][3] = offsetY;\n verts[i][4] = (myWidth/(2*numTriHorizontal)) + (i*myWidth/numTriHorizontal) + offsetX;\n if(i%2==0) {\n verts[i][5] = (float) ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)) + offsetY;\n } else {\n verts[i][5] = (float)((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)) + offsetY;\n }\n\n }\n\n //Left Triangles\n\n for (int i = numTriHorizontal; i < (numTriVertical + numTriHorizontal); i++) {\n verts[i][0] = offsetX;\n verts[i][1] = offsetY + ((i-numTriHorizontal) * (myWidth/numTriHorizontal));\n verts[i][2] = offsetX;\n verts[i][3] = offsetY + ((i-(numTriHorizontal-1)) * (myWidth/numTriHorizontal));\n if(i%2==0) {\n verts[i][4] = offsetX + (float) ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal));\n } else {\n verts[i][4] = offsetX + (float) ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal));\n }\n verts[i][5] = offsetY + ((i-numTriHorizontal) * (myWidth/numTriHorizontal)) + myWidth/(2*numTriHorizontal);\n\n }\n\n\n //Right Triangles\n for(int i=numTriVertical+numTriHorizontal; i<(2*numTriVertical)+numTriHorizontal; i++) {\n verts[i][0] = width-offsetX;\n verts[i][1] = offsetY + ((i-(numTriVertical+numTriHorizontal)) * (myWidth/numTriHorizontal));\n verts[i][2] = width-offsetX;\n verts[i][3] = offsetY + ((i-(numTriVertical+(numTriHorizontal-1))) * (myWidth/numTriHorizontal));\n if(i%2==0) {\n verts[i][4] = width-(offsetX + (float) ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)));\n } else {\n verts[i][4] = width-(offsetX + (float) ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)));\n }\n verts[i][5] = offsetY + ((i-(numTriVertical+numTriHorizontal)) * (myWidth/numTriHorizontal)) + myWidth/(2*numTriHorizontal);\n\n }\n\n //Bottom Triangles\n for(int i=(2*numTriVertical)+numTriHorizontal; i<(2*numTriVertical)+(2*numTriHorizontal); i++) {\n verts[i][0] = ((i-((2*numTriVertical)+numTriHorizontal))*myWidth/numTriHorizontal) + offsetX;\n verts[i][1] = (height-100) - offsetY;\n verts[i][2] = ((i-((2*numTriVertical)+numTriHorizontal) +1)*(myWidth/numTriHorizontal)) + offsetX;\n verts[i][3] = (height-100) - offsetY;\n verts[i][4] = (myWidth/(2*numTriHorizontal)) + ((i-((2*numTriVertical)+numTriHorizontal))*myWidth/numTriHorizontal) + offsetX;\n if(i%2==0) {\n verts[i][5] = (float)((height-100) - ( ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)) + offsetY));\n } else {\n verts[i][5] = (float)((height-100) - ( ((Math.sqrt(3) / 2) * (myWidth / numTriHorizontal)) + offsetY));\n }\n\n }\n\n }",
"void drawShape() {\n System.out.println(\"Drawing Triangle\");\n this.color.addColor();\n }",
"public interface ITriangleMesh {\n /**\n * Add a new vertex (given by position) to the vertex list. The new vertex is\n * appended to the end of the list.\n */\n int addVertex(Vector position);\n\n /**\n * Index in vertex list.\n */\n Vertex getVertex(int index);\n\n int getNumberOfVertices();\n\n /**\n * Add a new triangle to the mesh with the vertex indices a, b, c. The index\n * of the first vertex is 0.\n */\n void addTriangle(int vertexIndex1, int vertexIndex2, int vertexIndex3);\n\n /**\n * Add a new triangle to the mesh with the vertex indices a, b, c. The index\n * of the first vertex is 0.\n */\n void addTriangle(AbstractTriangle t);\n\n int getNumberOfTriangles();\n\n AbstractTriangle getTriangle(int triangleIndex);\n\n /**\n * Clear mesh - remove all triangles and vertices.\n */\n void clear();\n\n /**\n * Compute the triangles normals.\n */\n void computeTriangleNormals();\n\n\n Vector getTextureCoordinate(int index);\n\n /**\n * Add texture coordinate to mesh.\n */\n void addTextureCoordinate(Vector t);\n\n /**\n * Return the number of texture coordinates in the mesh.\n */\n int getNumberOfTextureCoordinates();\n\n /**\n * Set color to all triangles and all vertices of the mesh.\n */\n void setColor(Vector color);\n}",
"public Triangle() {\n\t\tsuper();\n\t\tthis.base = 0;\n\t\tthis.height = 0;\n\t\t\n\t}",
"public Triangle(){\n\t\tside1=1.0;\n\t\tside2=1.0;\n\t\tside3=1.0;\n\t}",
"public boolean addVertex(T vert);",
"private static Object[] fillTriangleAttrArray(NamedNodeMap attr) {\n ArrayList<Object> attrList = new ArrayList<>();\n attrList.add(attr.getNamedItem(SIDE_A) == null ?\n null : new BigDecimal(attr.getNamedItem(SIDE_A).getNodeValue()));\n attrList.add(attr.getNamedItem(SIDE_B) == null ?\n null : new BigDecimal(attr.getNamedItem(SIDE_B).getNodeValue()));\n attrList.add(attr.getNamedItem(SIDE_C) == null ?\n null : new BigDecimal(attr.getNamedItem(SIDE_C).getNodeValue()));\n\n if (attr.getNamedItem(TYPE) != null) {\n String triangleTypeAttr = attr.getNamedItem(TYPE).getNodeValue();\n switch (triangleTypeAttr) {\n case ISOSCELES_TYPE:\n attrList.add(Triangle.TYPE_ISOSCELES);\n break;\n case EQUILATERAL_TYPE:\n attrList.add(Triangle.TYPE_EQUILATERAL);\n break;\n default:\n attrList.add(Triangle.TYPE_COMMON);\n break;\n }\n }\n\n return attrList.toArray();\n }",
"@Override\n\tpublic void undo() {\n\t\tfor (IShape shape : temp) {\n\t\t\tlist.add(shape);\n\t\t}\n\t}",
"public String toString() {\n\treturn triangles.toString(); \n }",
"public void triangulate() {\n // Save the outline and calculate normals\n outline = new Vector<PlanarEdge>();\n for (PlanarEdge e : subdivision.getEdges()) {\n if (e.isRealEdge()) {\n outline.add(e);\n }\n }\n // Calculate outline normals\n outline_normals = new Vector3f[outline.size()];\n for (PlanarEdge e : outline) {\n TriangulationVertex vert = (TriangulationVertex) e.getDestination();\n // Normal 1\n Vector3f normal1 = new Vector3f(vert.getOutGoingEdge()\n .getDestination().getPoint())\n .subtractLocal(vert.getPoint()).normalizeLocal();\n // Vector3f normal1 = new\n // Vector3f(vert.getOutGoingEdge().getDestination().getPoint()).subtractLocal(vert.getPoint());\n normal1.z = -normal1.x;\n normal1.x = normal1.y;\n normal1.y = normal1.z;\n normal1.z = 0;\n // Normal 2\n Vector3f normal2 = new Vector3f(vert.getPoint()).subtractLocal(\n vert.getInGoingEdge().getOrigin().getPoint())\n .normalizeLocal();\n // Vector3f normal2 = new\n // Vector3f(vert.getPoint()).subtractLocal(vert.getInGoingEdge().getOrigin().getPoint());\n normal2.z = -normal2.x;\n normal2.x = normal2.y;\n normal2.y = normal2.z;\n normal2.z = 0;\n normal1.addLocal(normal2).normalizeLocal();\n\n outline_normals[vert.getIndex()] = normal1;\n }\n\n // Calculate the triangulation of the surface.\n surface = subdivision.triangulate();\n }"
]
| [
"0.77143115",
"0.7269588",
"0.64817435",
"0.6375298",
"0.6134307",
"0.6127812",
"0.60905176",
"0.60453963",
"0.5915255",
"0.5903569",
"0.58782727",
"0.57939285",
"0.5784365",
"0.5762488",
"0.56951416",
"0.56890345",
"0.5682309",
"0.56791675",
"0.5597297",
"0.55951065",
"0.55882895",
"0.5522217",
"0.5513326",
"0.5507852",
"0.5498274",
"0.5489194",
"0.5488914",
"0.54886603",
"0.54622364",
"0.545798",
"0.5454406",
"0.54432684",
"0.5440569",
"0.5418867",
"0.5412659",
"0.5390189",
"0.5379863",
"0.5376713",
"0.5369684",
"0.53603804",
"0.534286",
"0.53374153",
"0.5325299",
"0.53191894",
"0.53165644",
"0.5315123",
"0.5310228",
"0.53008664",
"0.52969366",
"0.5294488",
"0.52898437",
"0.52816254",
"0.5257642",
"0.52444685",
"0.52433246",
"0.52392274",
"0.52392155",
"0.52340394",
"0.52104753",
"0.51987255",
"0.5190462",
"0.5184504",
"0.51818013",
"0.5174736",
"0.51708066",
"0.5165816",
"0.5163267",
"0.51540434",
"0.51451063",
"0.5144381",
"0.5140499",
"0.51385003",
"0.51342845",
"0.51304436",
"0.5127311",
"0.5126689",
"0.5125332",
"0.51231927",
"0.51217043",
"0.51207596",
"0.5117637",
"0.5105776",
"0.5100226",
"0.5090236",
"0.5084016",
"0.5080914",
"0.50779283",
"0.5063069",
"0.5060838",
"0.50573397",
"0.5051424",
"0.50460273",
"0.50434065",
"0.50369066",
"0.5034067",
"0.50268435",
"0.5017313",
"0.50170964",
"0.50135714",
"0.5012507"
]
| 0.7878825 | 0 |
adds a circle to the arrayList of the circles | public void addCircle(Circle circle){
circles.add(circle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addCircle() {\n\t\tdouble r = getRadius();\n\t\tadd(new GOval(getWidth() / 2.0 - r, getHeight() / 2.0 - r, 2 * r, 2 * r));\n\t}",
"public CircleOfFifths(){fillArrayLists();}",
"private void addCircleToGrid() {\n for (int rowCount = 0; rowCount < ROW; rowCount++) {\n for (int colCount = 0; colCount < COL; colCount++) {\n Circle circle = new Circle(32, Paint.valueOf(\"black\"));\n addHandlerForCircle(circle);\n\n grid.add(circle, colCount, rowCount);\n GridPane.setHgrow(circle, Priority.ALWAYS);\n GridPane.setVgrow(circle, Priority.ALWAYS);\n GridPane.setHalignment(circle, HPos.CENTER);\n GridPane.setValignment(circle, VPos.CENTER);\n }\n }\n }",
"public CircleComponent()\n {\n circles = new ArrayList<>();\n circleCounter = 0;\n\n }",
"public void addLineVehicles(Circle c)\r\n {\r\n this.all_line_vehicles.add(c);\r\n return;\r\n }",
"private void painterJPanelMouseDragged(MouseEvent event) {\n // Circle to add to the ArrayList\n Circle newCircle;\n if (event.isMetaDown()) {\n // erase circle if right mouse button is pressed\n newCircle = new Circle(circleDiameter, event.getPoint(),\n this.getBackground());\n } else {\n // draw circle if left mouse button is pressed\n newCircle = new Circle(circleDiameter, event.getPoint(),\n circleColor);\n }\n\n circleArrayList.add(newCircle);\n\n repaint(); // repaint this PainterJPanel\n\n }",
"private void addColoredCircle(int row, int col, Color c) {\n\t\tdouble size = CIRCLE_RADIUS * 2;\n\t\tGOval oval = new GOval(size, size);\n\t\toval.setFilled(true);\n\t\toval.setColor(c);\n\t\tadd(oval, col - CIRCLE_RADIUS, row - CIRCLE_RADIUS);\n\t}",
"private void drawCircle(int radius) {\n if (mCircle != null) {\n mCircle.remove();\n }\n // We defined a new circle center options with location and radius\n mCircleOptions.center(new LatLng(mLocation.getLatitude(), mLocation.getLongitude())).radius(radius); // In meters\n // We add here to the map the new circle\n mCircle = mGoogleMap.addCircle(mCircleOptions);\n }",
"public static void addCircle(Image image, int x, int y, int radius, int red, int green, int blue){\n\t\tfor(int i = radius-y;i<radius+y;i++)\n\t\t\tfor(int j = radius-x; j < radius+x; j++)\n\t\t\t\tif((i-y)*(i-y)+(j-x)*(j-x)<=radius*radius)\n\t\t\t\t\timage.setPixel(j,i,red,green,blue);\n\t}",
"public void drawCircle() {\n mMap.clear();\n // Generate the points\n mMap.addPolygon(new PolygonOptions().addAll(points).strokeWidth(5).strokeColor(Color.RED).fillColor(Color.TRANSPARENT));\n // Create and return the polygon\n for (int i=0;i<points.size();i++){\n Log.v(\"DrawCircle\",\"drwaakmdaskfmlsmn\"+points.get(i));\n }\n\n\n\n }",
"public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Iterator<Circle> circleIterator = circleArrayList.iterator();\n Circle drawCircle;\n\n // iterate through the ArrayList\n while (circleIterator.hasNext()) {\n drawCircle = circleIterator.next();\n drawCircle.draw(g); // draw each circle\n }\n\n }",
"private void updateRadiusCircle(){\n if(mRadiusCircle != null) {\n mRadiusCircle.setVisible(false);\n }\n mRadiusCircle = mMap.addCircle(new CircleOptions()\n .center(new LatLng(mCurrentLoc.latitude, mCurrentLoc.longitude))\n .radius(mRadius * METERS_PER_MILE)\n .strokeColor(Color.BLUE)\n .fillColor(BLUE_COLOR));\n mRadiusCircle.setVisible(true);\n }",
"private ArrayList<Figure> getCircleData(){\n\n ArrayList<Figure> getCircleData = new ArrayList<>();\n\n getCircleData.add(new Circle(\"First circle\", Color.GREEN, 2, 2));\n getCircleData.add(new Circle(\"Second circle\", Color.RED, 3, 3));\n getCircleData.add(new Circle(\"Third circle\", Color.YELLOW, 8, 8));\n getCircleData.add(new Circle(\"Fourth circle\", Color.BLUE, 7, 7));\n getCircleData.add(new Circle(\"Fifth circle\", Color.YELLOW, 8, 8));\n getCircleData.add(new Circle(\"Sixth circle\", Color.RED, 1, 1));\n getCircleData.add(new Circle(\"Seventh circle\", Color.BLUE, 4, 4));\n\n return getCircleData;\n\n }",
"public void addShape(Shapes obj) {\n \tthis.listShapes.add(obj);\n W.repaint();\n }",
"public void addToPane(ObservableList<Node> sceneGraph){\n for(MonsterSprite monsterSprite: monsterSprites){\n\n Circle circle = monsterSprite.getCircle();\n System.out.println(\"Adding circle to pane: \" + circle.getCenterX() + \" \" + circle.getCenterY() + \" \" + radius);\n sceneGraph.add(circle);\n }\n }",
"private void positionCircles_()\n\t{\n\t\tIterator<PVCircle> it = circles.iterator();\n\t\tint indx = 0;\n\t\tRandom rng = new Random();\n\t\twhile (it.hasNext())\n\t\t{\t\n\t\t\tPVCircle currCircle = it.next();\n\t\t\t//currCircle.setRadius(MAX_RADIUS * (double) currCircle.getWeight() / totalWeight);\n\t\t\tboolean collision = true;\n\t\t\tint loopCount = 0;\n\t\t\twhile(collision && loopCount < 100)\n\t\t\t{\n\t\t\t\tcurrCircle.setPosition(res_x * rng.nextDouble(), res_y * rng.nextDouble());\n\t\t\t\tcollision = checkCollision(currCircle, indx, indx);\n\t\t\t\tloopCount++;\n\t\t\t}\n\t\t\tif(loopCount == 100)\n\t\t\t{\n\t\t\t\t//Log.d(\"position\", \"Circle too big to fit\");\n\t\t\t\tit.remove();\n\t\t\t}\n\t\t\telse indx++;\n\t\t}\n\t}",
"public static void getCircle(BufferedImage image, Dimension fieldSize, ColoredPoint pos[], int centerX, int centerY, int radius, int color)\n {\n int index = 0;\n // For every pixel within the square from (x - r, y - r) (x + r, y + r)\n for(int x = centerX - radius; x < centerX + radius; x++)\n {\n for(int y = centerY - radius; y < centerY + radius; y++)\n {\n // If the pixel is outside the field dimensions\n if(x < 0 || y < 0 || x >= fieldSize.width || y >= fieldSize.height)\n {\n continue;\n }\n\n // If the pixel is within the circle of radius p_radius, add it\n // to the list\n int d = distance(x, y, centerX, centerY);\n if(d < radius)\n {\n // Sets the new color of the pixel\n pos[index] = new ColoredPoint(x, y, color);\n index++;\n }\n }\n }\n }",
"public void makeCircle(List list, Level level) {\n Block block = Block.get(20);\n \n for (Iterator<Location> i = list.iterator(); i.hasNext();) {\n Location loc = i.next();\n Block current = level.getBlock(loc);\n \n if(current.getId() == 0) {\n level.setBlock(loc, block);\n }\n }\n }",
"public PseudoCircle( List<Point2D> ps){\n for( Point2D x: ps){\n this.addPoint(x);\n }\n }",
"private void createCircle(double x, double y) {\r\n GOval circle = new GOval(x, y, DIAMETR, DIAMETR);\r\n circle.setFilled(true);\r\n circle.setFillColor(Color.BLACK);\r\n add(circle);\r\n }",
"public static void addCircle(MapLocation center, float size, float desire) {\n switch (circleCount) {\n case 0:\n Z1c_desire = desire;\n Z1c_center = center;\n Z1c_size = size;\n circleCount++;\n break;\n case 1:\n Z2c_desire = desire;\n Z2c_center = center;\n Z2c_size = size;\n circleCount++;\n break;\n case 2:\n Z3c_desire = desire;\n Z3c_center = center;\n Z3c_size = size;\n circleCount++;\n break;\n case 3:\n Z4c_desire = desire;\n Z4c_center = center;\n Z4c_size = size;\n circleCount++;\n break;\n case 4:\n Z5c_desire = desire;\n Z5c_center = center;\n Z5c_size = size;\n circleCount++;\n break;\n case 5:\n Z6c_desire = desire;\n Z6c_center = center;\n Z6c_size = size;\n circleCount++;\n break;\n case 6:\n Z7c_desire = desire;\n Z7c_center = center;\n Z7c_size = size;\n circleCount++;\n break;\n case 7:\n Z8c_desire = desire;\n Z8c_center = center;\n Z8c_size = size;\n circleCount++;\n break;\n case 8:\n Z9c_desire = desire;\n Z9c_center = center;\n Z9c_size = size;\n circleCount++;\n break;\n case 9:\n Z10c_desire = desire;\n Z10c_center = center;\n Z10c_size = size;\n circleCount++;\n break;\n case 10:\n Z11c_desire = desire;\n Z11c_center = center;\n Z11c_size = size;\n circleCount++;\n break;\n case 11:\n Z12c_desire = desire;\n Z12c_center = center;\n Z12c_size = size;\n circleCount++;\n break;\n case 12:\n Z13c_desire = desire;\n Z13c_center = center;\n Z13c_size = size;\n circleCount++;\n break;\n case 13:\n Z14c_desire = desire;\n Z14c_center = center;\n Z14c_size = size;\n circleCount++;\n break;\n case 14:\n Z15c_desire = desire;\n Z15c_center = center;\n Z15c_size = size;\n circleCount++;\n break;\n case 15:\n Z16c_desire = desire;\n Z16c_center = center;\n Z16c_size = size;\n circleCount++;\n break;\n case 16:\n Z17c_desire = desire;\n Z17c_center = center;\n Z17c_size = size;\n circleCount++;\n break;\n case 17:\n Z18c_desire = desire;\n Z18c_center = center;\n Z18c_size = size;\n circleCount++;\n break;\n case 18:\n Z19c_desire = desire;\n Z19c_center = center;\n Z19c_size = size;\n circleCount++;\n break;\n case 19:\n Z20c_desire = desire;\n Z20c_center = center;\n Z20c_size = size;\n circleCount++;\n break;\n }\n }",
"public void add(Coord obj) {\n\t\tif (index > itemcount)\n\t\t\tthrow new RuntimeException(\"Liste ist voll\");\n\t\tarray[index++] = obj;\n\t}",
"public void add(Coord c){\r\n\t\tcoords.add(c);\r\n\t}",
"public void add(Shape c) {\n\t\tc.centerXProperty().addListener(doubleListener);\n\t\tc.centerYProperty().addListener(doubleListener);\n\t\tc.radiusProperty().addListener(doubleListener);\n\t\tc.colorProperty().addListener(colorListener);\n\t\tc.widthProperty().addListener(doubleListener);\n\t\tc.heightProperty().addListener(doubleListener);\n\t\tc.arcWidthProperty().addListener(doubleListener);\n\t\tc.arcHeightProperty().addListener(doubleListener);\n\t\tc.textProperty().addListener(textListener);\n\t\tc.typeProperty().addListener(typeListener);\n\t\tc.deleteProperty().addListener(deleteListener);\n\t\tdrawData.add(c);\n\t}",
"public void addSquaresToList(){\r\n int i = 0;\r\n while(i<8){\r\n sqList.add(new Square(0+(i*50),0,50,\"red\"));\r\n i++;\r\n } \r\n \r\n }",
"private void generateCircles()\r\n\t{\t\r\n\t\tdouble diameter = 0.0;\r\n\t\tdouble x = 0.0;\r\n\t\tdouble y = 0.0;\r\n\t\tcircles = new ArrayList<Ellipse2D.Double>();\r\n\t\t\r\n\t\tfor (int count = 0; count < 1000; count++)\r\n\t\t{\r\n\t\t\tdiameter = Math.random() * (MAX_DIAMETER - MIN_DIAMETER) + MIN_DIAMETER;\r\n\t\t\tx = getRandomDouble((diameter), (width - diameter));\r\n\t\t\ty = getRandomDouble((diameter), (height - diameter));\t\t\r\n\t\t\tcircles.add (new Ellipse2D.Double (x, y, diameter, diameter));\r\n\t\t}\r\n\t}",
"static void testCircle(){\n List<Circle> cArr = new ArrayList<>(Arrays.asList(new Circle(new Point(0, 0), new Point(0, 1)),\n new Circle(new Point(0,0),new Point(0,4)),\n new Circle(new Point(0,0),new Point(0,2))));\n\n System.out.println(cArr);\n System.out.printf(\"Circle class->%b\\n\", cArr.toString().equals(\n \"[[radius = 1.00, area = 3.14, perimeter = 6.28], \" +\n \"[radius = 4.00, area = 50.27, perimeter = 25.13], \" +\n \"[radius = 2.00, area = 12.57, perimeter = 12.57]]\"));\n }",
"public org.chartacaeli.model.Circle[] getCircle() {\n org.chartacaeli.model.Circle[] array = new org.chartacaeli.model.Circle[0];\n return this.circleList.toArray(array);\n }",
"public ShapeComponent drawCircle()\n\t{\n\t\tShapeComponent circleComponent = new ShapeComponent(radius*2, radius*2, \n\t\t\t\t\"circle\");\n\t\treturn circleComponent;\n\t}",
"public void generatePointsOnCircle(int lineAmount, Circle circle) {\n for (int i = 0; i < lineAmount; ++i) {\n\n // cosinus = ankathete / hypo | sinus = gegenkathete / hypo\n final double angle = Math.toRadians(((double) i / lineAmount) * 360d);\n\n // generating new point and declaring calulated coordinates to it\n onCirclePoints.add(new Point2D.Double(Math.cos(angle) * circle.getRadius() + circle.getMidpoint().getX(),\n Math.sin(angle) * circle.getRadius() + circle.getMidpoint().getY()));\n }\n }",
"public void addSquaresToList()\n {\n int i = 0;\n int size = 50;\n int spacing = 0;\n int interval = size + spacing;\n\n while (i < 8)\n {\n sqList.add(new Square(interval * i, 0, size, \"red\"));\n i++;\n }\n }",
"public void addExcludeCircle(MapLocation center, float radius) {\n if (first == null) {\n return;\n }\n\n\n\n // If the first point is excluded, rotate until first point is not excluded\n Boundary current = first;\n Boundary prev = null;\n boolean firstIter = true;\n while (current != null) {\n // On first iter, test first point is valid\n if (firstIter) {\n if (current.begin.distanceTo(center) <= radius + bodyRadius) {\n // first point is excluded\n // TODO\n }\n }\n // Now, first point is valid\n\n switch (current.type) {\n case ARC: {\n ArcBoundary currentArc = (ArcBoundary)current;\n // get intersection points\n MapLocation[] intersections = getCircleIntersections(currentArc.begin, strideRadius,\n center, bodyRadius + radius);\n // Select intersection points on the current arc, in order\n MapLocation[] selectedIntersections = selectArcIntersections(currentArc, intersections);\n // Test each segment\n MapLocation segmentBegin = currentArc.begin;\n for (MapLocation segmentEnd : selectedIntersections) {\n MapLocation segmentMiddle = getArcSegmentMiddle(currentArc, segmentBegin, segmentEnd);\n if (segmentMiddle.distanceTo(center) <= radius + bodyRadius) {\n // this segment intersects\n }\n\n segmentBegin = segmentEnd;\n }\n\n }\n break;\n case LINE: {\n\n }\n break;\n }\n\n prev = current;\n current = current.next;\n firstIter = false;\n }\n }",
"public org.astrogrid.stc.region.v1_10.beans.SmallCircleType addNewSmallCircle()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.astrogrid.stc.region.v1_10.beans.SmallCircleType target = null;\n target = (org.astrogrid.stc.region.v1_10.beans.SmallCircleType)get_store().add_element_user(SMALLCIRCLE$2);\n return target;\n }\n }",
"public OccList add( Occ occ )\n {\n final int oldCapacity = data.length;\n if ( size >= oldCapacity ) {\n final Occ[] oldData = data;\n final int newCapacity = Calcul.nextSquare( oldCapacity );\n data = new Occ[ newCapacity ];\n System.arraycopy( oldData, 0, data, 0, oldCapacity );\n // add occ \n for (int i=oldCapacity; i < newCapacity; i++) data[i] = new Occ();\n }\n data[size].set( occ );\n // connect occurrencies, maybe used for toString()\n if ( size > 0 ) {\n data[ size-1 ].next( data[ size ] );\n data[ size ].prev( data[ size-1 ] );\n }\n size++;\n return this;\n }",
"@Override\n public void draw() {\n drawAPI.drawCircle(radius, x, y); \n }",
"public void addArc(Arc<T> newArc){\n for(Arc<T> arc : arcs){\n if(arc.getDepart().getId() == newArc.getDepart().getId() && arc.getArrivee().getId() == newArc.getArrivee().getId()){\n return;\n }\n }\n arcs.add(newArc);\n }",
"@Override\n public void onDraw(final Canvas canv) {\n \t\n for (CircleArea circle : mCircles) {\n \t\n \tmCirclePaint.setColor(Color.GRAY);\n \tcanv.drawCircle(circle.centerX, circle.centerY, circle.radius+2, mCirclePaint);\n \tmCirclePaint.setColor(0xFFBFFFEF);\n canv.drawCircle(circle.centerX, circle.centerY, circle.radius, mCirclePaint);\n \n \n if(circle.isFinal){\n \tmCirclePaint.setColor(Color.GRAY);\n \tmCirclePaint.setStyle(Paint.Style.STROKE);\n \tmCirclePaint.setStrokeWidth(2);\n \tcanv.drawCircle(circle.centerX, circle.centerY, circle.radius-3, mCirclePaint);\n \tmCirclePaint.setStrokeWidth(40);\n \tmCirclePaint.setStyle(Paint.Style.FILL);\n }\n if(circle == this.initial){\n \tmCirclePaint.setColor(Color.BLACK);\n \tPath path = new Path();\n \tpath.moveTo(circle.centerX-circle.radius,circle.centerY);\n \tpath.lineTo(circle.centerX-circle.radius*2,(float) (circle.centerY - circle.radius/1.5));\n \tpath.lineTo(circle.centerX-circle.radius*2, (float) (circle.centerY+ circle.radius/1.5));\n \n \tcanv.drawPath(path, mCirclePaint);\n }\n \n \n mCirclePaint.setTextSize(23);\n mCirclePaint.setColor(Color.BLACK);\n canv.drawText(circle.id,circle.centerX-12,circle.centerY+8,mCirclePaint);\n }\n \n if(mLines.size() >= 1){\n \tmCirclePaint.setStrokeWidth(1);\n \tif(mode == 2 || mode == 3){\n\t \tfor(int i=0;i<mLines.size();i++){\n\t \n\t \t\t\n\t\t \t\t\n\t \t\t\tif(mLines.get(i).circleEnd != null){\n\t \t\t\t\t\n\n\t\t \t\t\tmCirclePaint.setColor(Color.BLACK);\n\t\t\t \tmCirclePaint.setStrokeWidth(1);\n\t\t\t \t\n\t\t\t \tint points[] = this.getPoints(\n\t\t\t \t\t\tmLines.get(i).circleStart.centerX,\n\t\t\t \t\t\tmLines.get(i).circleStart.centerY,\n\t\t\t \t\t\tmLines.get(i).circleEnd.centerX, \n\t\t\t \t\t\tmLines.get(i).circleEnd.centerY);\n\t\t\t \t\n\t\t\t \tcanv.drawLine(\n\t\t\t \t\t\tpoints[0],points[1],points[2],points[3], \n\t\t\t \t\t\tmCirclePaint);\n\t\t\t \t\n\t\t\t \tcanv.drawCircle(points[2], points[3], 4, mCirclePaint);\n\t\t\t \t\n\t\t\t \t//int rectPoints[] = this.rectBound(points);\n\t\t\t \t//RectF rectF = new RectF(rectPoints[0],rectPoints[1],rectPoints[2],rectPoints[3]);\n\t\t\t \tint rectPoints[] = {\n\t\t\t \t\t\tmLines.get(i).circleStart.centerX,\n\t\t\t \t\t\tmLines.get(i).circleStart.centerY,\n\t\t\t \t\t\tmLines.get(i).circleEnd.centerX, \n\t\t\t \t\t\tmLines.get(i).circleEnd.centerY};\n\t\t\t \t\n\t\t\t \t\t\t /*Path path = new Path();\n\t\t\t \t\t\t RectF oval = new RectF();\n\t\t\t \t\t\t \n\t\t\t \t\t\t mCirclePaint.setStyle(Style.STROKE);\n\t\t\t \t\t\t mCirclePaint.setColor(Color.BLACK);\n\t\t\t \t\t\t oval.set(rectPoints[0]-60,rectPoints[1],rectPoints[0],rectPoints[1]+60);\n\t\t\t \t\t\t path.arcTo(oval,250,-230,true);\n\t\t\t \t\t\t canv.drawPath(path, mCirclePaint);\n\t\t\t \t\t\t \n\t\t\t \t\t\t mCirclePaint.setStyle(Style.FILL);*/\n\t\t\t \t\t\t \n\t\t\t \t\n\t\t\t \tif(mLines.get(i).name != null){\n\t\t\t\t \tmCirclePaint.setTextSize(20);\n\t\t\t\t \t\n\t\t\t\t \tmLines.get(i).textCoordsX = (points[0]+points[2])/2;\n\t\t\t\t \tmLines.get(i).textCoordsY = (points[1]+points[3])/2;\n\t\t\t\t \tmCirclePaint.setColor(Color.BLUE);\n\t\t\t\t canv.drawText(mLines.get(i).name,mLines.get(i).textCoordsX-5,mLines.get(i).textCoordsY+3,mCirclePaint);\n\t\t\t\t mCirclePaint.setColor(Color.BLACK);\n\t\t\t\t \n\t\t\t\t mCirclePaint.setTextSize(12);\n\t\t\t \t}\n\t\t\t \t\n\t\t\t \t\n\t\t \t\t}\n\t\t \t\telse{\n\t\t \t\t\tcanv.drawLine(\n\t\t \t \t\t\tmLines.get(mLines.size()-1).startX, \n\t\t \t \t\t\tmLines.get(mLines.size()-1).startY,\n\t\t \t \t\t\tmLines.get(mLines.size()-1).endX, \n\t\t \t \t\t\tmLines.get(mLines.size()-1).endY, \n\t\t \t \t\t\tmCirclePaint);\n\t\t \t\t}\n\t \t\t}\n\t \t\t\n\t \t\t\n\t \t\n\t \t\n\t \n\t \t\n \t}\n \telse if(mode == 1 || mode ==0){\n \t\tfor(int i=0;i<mLines.size();i++){\n\t \tmCirclePaint.setColor(Color.BLACK);\n\t \tmCirclePaint.setStrokeWidth(1);\n\t \tint points[] = this.getPoints(\n\t \t\t\tmLines.get(i).circleStart.centerX,\n\t \t\t\tmLines.get(i).circleStart.centerY,\n\t \t\t\tmLines.get(i).circleEnd.centerX, \n\t \t\t\tmLines.get(i).circleEnd.centerY);\n\t \t\n\t \tcanv.drawLine(\n\t \t\t\tpoints[0],points[1],points[2],points[3], \n\t \t\t\tmCirclePaint);\n\t \t\n\t \tmCirclePaint.setTextSize(20);\n\t \t\n\n\t \t\n\t \tcanv.drawCircle(points[2], points[3], 4, mCirclePaint);\n\t \tmLines.get(i).textCoordsX = (points[0]+points[2])/2;\n\t \tmLines.get(i).textCoordsY = (points[1]+points[3])/2;\n\t \tmCirclePaint.setColor(Color.BLUE);\n\t canv.drawText(mLines.get(i).name,mLines.get(i).textCoordsX-5,mLines.get(i).textCoordsY+3,mCirclePaint);\n\t mCirclePaint.setColor(Color.BLACK);\n\t \n\t mCirclePaint.setTextSize(12);\n\t }\t\n \t}\n }\n \n }",
"public void getCircles() {\n\t\tlong startTime = System.nanoTime();\n\t\tif (circleImage != null) {\n\t\t\tcircleFrame.getContentPane().remove(circleImage);\n\t\t}\n//\t\tcircles = ProcessOpenCV.getCircles(cannyMat, cannyImage.getWidth()/5);\n\t\tcircles = ProcessOpenCV.getCircles(zoomImage.getImage(), cannyImage.getWidth()/4);\n\t\tcircleImage = new SignImage(cannyImage.getWidth(), cannyImage.getHeight() );\n\t\tcircleImage.setCircles(circles);\n\t\tcircleFrame.getContentPane().add(circleImage);\n\t\tcircleFrame.setSize(lineImage.getWidth(), lineImage.getHeight());\n//\t\tcircleFrame.setVisible(true);\t\n\t}",
"void add(Shape aShape);",
"public static int addCircleBorder(final DoubleList output, final double x, final double y, final double radius, final Border border, final double thickness) {\n // calculate metrics\n final double innerRadius = radius;\n final double outerRadius = radius + thickness;\n // draw an arc all of the way around\n for (int i = CIRCLE_POINTS.length - 1; i >= 0; i--) {\n final int a = normalizeIndex(i);\n // inner vertex\n addPoint(output, x + (CIRCLE_POINTS[a][X] * innerRadius), y + (CIRCLE_POINTS[a][Y] * innerRadius));\n // outer vertex\n addPoint(output, x + (CIRCLE_POINTS[a][X] * outerRadius), y + (CIRCLE_POINTS[a][Y] * outerRadius));\n }\n // end add\n return GL2.GL_QUAD_STRIP;\n }",
"public void add(Shape shapes) {\n\t\tshapesList.add(shapes);\n\t}",
"private void createScaledCirclePoints(float scaling) {\n\t\tfor (MyCircle circle : circlesList) {\n\t\t\tfloat point[] = { (float) circle.getCenterX(),\n\t\t\t\t\t(float) circle.getCenterY() };\n\t\t\tscaleAndRotateMatrix.mapPoints(point);\n\t\t\tscaledCircleList.add(new MyCircle((int) point[0], (int) point[1],\n\t\t\t\t\t(int) (circle.getRadius() * scaling)));\n\t\t}\n\t}",
"public void add(GPointsArray pts) {\n\t\tfor (int i = 0; i < pts.getNPoints(); i++) {\n\t\t\tpoints.add(new GPoint(pts.get(i)));\n\t\t}\n\t}",
"private ArrayList<ArrayList<Coord>> findCircles() {\n\t\tArrayList<ArrayList<Coord>> circs = new ArrayList<ArrayList<Coord>>();\n\t\twhile(currentLevel.size()>0) {\n\t\t\tcurrentCircle.add(currentLevel.remove(0));\n\t\t\trecurseCircle(currentCircle.get(0));\n\t\t\tArrayList<Coord> adds = new ArrayList<Coord>();\n\t\t\tfor(Coord c:currentCircle){\n\t\t\t\tadds.add(c);\n\t\t\t}\n\t\t\tcircs.add(adds);\n\t\t\tcurrentLevel.removeAll(currentCircle);\n\t\t\tcurrentCircle.clear();\n\t\t}\n\t\treturn circs;\n\t}",
"public void add(RadarContent p) {\n expandArray();\n arrProfiles[length - 1] = p;\n }",
"public void agregar_linea(RecyclingImageView c)\n {\n array_lineas.add(c);\n }",
"private void DrawCircle(GL2 gl, int xC, int yC, int radius) {\n gl.glPointSize(10.0f);\n gl.glColor3d(1, 2, 1);\n gl.glBegin(GL2.GL_POINTS);\n\n gl.glVertex2d(xC, yC);\n\n int x = radius, y = 0, d = -4 * radius + 5;\n draw8SymmetricCurves(gl, xC, yC, x, y);\n while (y <= x) {\n if (d < 0) {\n d = d + ((2 * y + 3) * 4);\n y++;\n } else {\n d += ((-2 * x + 2 * y + 5) * 4);\n x--;\n y++;\n }\n draw8SymmetricCurves(gl, xC, yC, x, y);\n }\n gl.glEnd();\n }",
"public ClientSideImageMap addCircleArea(AbstractLink link, int x, int y, int radius)\r\n\t{\r\n\t\tareas.add(link);\r\n\r\n\t\tlink.add(new Area(circleCoordinates(x, y, radius), CIRCLE));\r\n\r\n\t\treturn this;\r\n\t}",
"private void circle(){\n\t\tsquareCollison();\n\t\tsetMoveSpeed(10);\n\t}",
"private void recurseCircle(Coord c) {\n\t\tfor(Coord c1:currentLevel) {\n\t\t\tif(isTouching(c,c1) && !currentCircle.contains(c1)){\n\t\t\t\tcurrentCircle.add(c1);\n\t\t\t\trecurseCircle(c1);\n\t\t\t}\n\t\t}\n\n\t}",
"public Coordinate getCircle();",
"public Dial addPosition(int angle) {\n if (!dialPositions.contains(angle)) {\n this.dialPositions.add(angle);\n if (dialPosition == -1) {\n dialPosition = 0;\n }\n repaint();\n }\n return this;\n }",
"private void setCircle() {\n\t\tlayout_Circle=new Circle[][] {{null, null, null, null, null, null, null, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, null, finishCircle, null, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, null, pos80, null, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, pos7_1, pos70, pos71, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, pos6_2, pos6_1, pos60, pos61, pos62, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, pos5_3, pos5_2, pos5_1, pos50, pos51, pos52, pos53, null, null},\n\t\t\t \t\t\t\t\t\t {null, pos4_4, pos4_3, pos4_2, pos4_1, pos40, pos41, pos42, pos43, pos44, null},\n\t\t\t \t\t\t\t\t\t {null, null, pos3_3, pos3_2, pos3_1, pos30, pos31, pos32, pos33, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, pos2_2, pos2_1, pos20, pos21, pos22, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, pos1_1, pos10, pos11, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, null, startCircle, null, null, null, null, null},\n\t\t\t \t\t\t\t\t\t {null, null, null, null, null, null, null, null, null, null, null}};\n\t}",
"public void add(Ball b) {\r\n balls.add(b);\r\n }",
"private void clear() {\n\t\tremoveAll();\n\t\taddCircle();\n\t}",
"public void add(Shape s)\n {\n shapes.add(s);\n }",
"public void addPoints(int i, List<Point2D> points);",
"private void newCircle()\n {\n setMinimumSize(null);\n\n //Generate a new circle\n panel.generateNewCircle();\n\n //Calculate the circle properties and setup the text area with their values\n generateTextArea();\n\n //Repack the frame to fit everything perfectly\n pack();\n\n setMinimumSize(getSize());\n }",
"public void addPoints(List<Point2D> points);",
"static public void addPersona(Persona c) { //metodo para añadir a lista y actualizar la lista en tiempo real\r\n listaPersona.add(c);\r\n listaG.setListaGrafica();\r\n \r\n \r\n \r\n }",
"public void calling() {\n\t\tCircle tc = new Circle(new Coordinate(-73, 42), 0);\n\t\tif (PaintShapes.painting && logger.isDebugEnabled()) {\n\t\t\tPaintShapes.paint.color = PaintShapes.paint.redTranslucence;\n\t\t\tPaintShapes.paint.addCircle(tc);\n\t\t\tPaintShapes.paint.myRepaint();\n\t\t}\n\t\t\n//\t\tMap<Double, Coordinate>angle_coordinate=new HashMap<Double, Coordinate>();\n//\t\tLinkedList<double[]>coverangle=new LinkedList<double[]>();\n//\t\tMap<Double[], Coordinate[]>uncoverArc=new HashMap<Double[], Coordinate[]>();\n//\t\tdouble a1[]=new double[2];\n//\t\ta1[0]=80;\n//\t\ta1[1]=100;\n//\t\tangle_coordinate.put(a1[0], new Coordinate(1, 0));\n//\t\tangle_coordinate.put(a1[1], new Coordinate(0, 1));\n//\t\tcoverangle.add(a1);\n//\t\tdouble a2[]=new double[2];\n//\t\ta2[0]=0;\n//\t\ta2[1]=30;\n//\t\tangle_coordinate.put(a2[0], new Coordinate(2, 0));\n//\t\tangle_coordinate.put(a2[1], new Coordinate(0, 2));\n//\t\tcoverangle.add(a2);\n//\t\tdouble a3[]=new double[2];\n//\t\ta3[0]=330;\n//\t\ta3[1]=360;\n//\t\tangle_coordinate.put(a3[0], new Coordinate(3, 0));\n//\t\tangle_coordinate.put(a3[1], new Coordinate(7, 7));\n//\t\tcoverangle.add(a3);\n//\t\tdouble a4[]=new double[2];\n//\t\ta4[0]=20;\n//\t\ta4[1]=90;\n//\t\tangle_coordinate.put(a4[0], new Coordinate(4, 0));\n//\t\tangle_coordinate.put(a4[1], new Coordinate(0, 4));\n//\t\tcoverangle.add(a4);\n//\t\tdouble a5[]=new double[2];\n//\t\ta5[0]=180;\n//\t\ta5[1]=240;\n//\t\tangle_coordinate.put(a5[0], new Coordinate(5, 0));\n//\t\tangle_coordinate.put(a5[1], new Coordinate(0, 5));\n//\t\tcoverangle.add(a5);\n//\t\tdouble a6[]=new double[2];\n//\t\ta6[0]=270;\n//\t\ta6[1]=300;\n//\t\tangle_coordinate.put(a6[0], new Coordinate(6, 0));\n//\t\tangle_coordinate.put(a6[1], new Coordinate(0, 6));\n//\t\tcoverangle.add(a6);\n//\t\tdouble a7[]=new double[2];\n//\t\ta7[0]=360;\n//\t\ta7[1]=360;\n//\t\tangle_coordinate.put(a7[0], new Coordinate(7, 7));\n//\t\tangle_coordinate.put(a7[1], new Coordinate(7, 7));\n//\t\tcoverangle.add(a7);\n//\t\t// sort the cover arc\n//\t\tint minindex = 0;\n//\t\tfor (int j = 0; j < coverangle.size() - 1; j++) {\n//\t\t\tminindex = j;\n//\t\t\tfor (int k = j + 1; k < coverangle.size(); k++) {\n//\t\t\t\tif (coverangle.get(minindex)[0] > coverangle.get(k)[0]) {\n//\t\t\t\t\tminindex = k;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tdouble tem[] = new double[2];\n//\t\t\ttem = coverangle.get(j);\n//\t\t\tcoverangle.set(j, coverangle.get(minindex));\n//\t\t\tcoverangle.set(minindex, tem);\n//\t\t}\n//\t\tfor(int ii=0;ii<coverangle.size();ii++){\n//\t\t\tdouble aa[]=coverangle.get(ii);\n//\t\t\tSystem.out.println(aa[0]+\" \"+aa[1]);\n//\t\t}\n//\t\tSystem.out.println(\"----------------------------\");\n//\t\t// find the uncover arc\n//\t\tint startposition = 0;\n//\t\twhile (startposition < coverangle.size() - 1) {\n//\t\t\tdouble coverArc[] = coverangle.get(startposition);\n//\t\t\tboolean stop = false;\n//\t\t\tint m = 0;\n//\t\t\tfor (m = startposition + 1; m < coverangle.size() && !stop; m++) {\n//\t\t\t\tdouble bb[] = coverangle.get(m);\n//\t\t\t\tif (bb[0] <= coverArc[1]) {\n//\t\t\t\t\tcoverArc[0] = Math.min(coverArc[0], bb[0]);\n//\t\t\t\t\tcoverArc[1] = Math.max(coverArc[1], bb[1]);\n//\t\t\t\t} else {\n//\t\t\t\t\tCoordinate uncover[]=new Coordinate[2];\n//\t\t\t\t\t//record the consistant uncover angle\n//\t\t\t\t\tDouble[] uncoverA=new Double[2];\n//\t\t\t\t\tuncoverA[0]=coverArc[1];\n//\t\t\t\t\tuncoverA[1]=bb[0];\n//\t\t\t\t\tIterator<Map.Entry<Double, Coordinate>> entries = angle_coordinate\n//\t\t\t\t\t\t\t.entrySet().iterator();\n//\t\t\t\t\twhile (entries.hasNext()) {\n//\t\t\t\t\t\tMap.Entry<Double, Coordinate> entry = entries.next();\n//\t\t\t\t\t\tif (entry.getKey() == coverArc[1])\n//\t\t\t\t\t\t\tuncover[0] = entry.getValue();\n//\t\t\t\t\t\telse if (entry.getKey() == bb[0])\n//\t\t\t\t\t\t\tuncover[1] = entry.getValue();\n//\t\t\t\t\t}\n//\t\t\t\t\tuncoverArc.put(uncoverA, uncover);\n//\t\t\t\t\tstartposition = m;\n//\t\t\t\t\tstop = true;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tif(m==coverangle.size()){\n//\t\t\t\tstartposition=m;\n//\t\t\t}\n//\t\t}\n//\t\n//\t\tSystem.out.println(uncoverArc.entrySet().size());\n//\t\tint n=uncoverArc.entrySet().size();\n//\t\tint k=2;\n//\t\twhile(n>0){\n//\t\t\tIterator<Map.Entry<Double[],Coordinate[]>>it=uncoverArc.entrySet().iterator();\n//\t\t\tMap.Entry<Double[], Coordinate[]>newneighbor=it.next();\n//\t\t\tSystem.out.println(newneighbor.getKey()[0]+\" \"+newneighbor.getValue()[0]);\n//\t\t\tSystem.out.println(newneighbor.getKey()[1]+\" \"+newneighbor.getValue()[1]);\n//\t\t uncoverArc.remove(newneighbor.getKey());\n//\t\t \n//\t\tif(k==2){\n//\t\tDouble[] a8=new Double[2];\n//\t\ta8[0]=(double)450;\n//\t\ta8[1]=(double)500;\n//\t\tCoordinate a9[]=new Coordinate[2];\n//\t\ta9[0]=new Coordinate(9, 0);\n//\t\ta9[1]=new Coordinate(0, 9);\n//\t\tuncoverArc.put(a8, a9);\n//\t\tk++;\n//\t\t}\n//\t\tn=uncoverArc.entrySet().size();\n//\t\tSystem.out.println(\"new size=\"+uncoverArc.entrySet().size());\n//\t\t}\n//\t\t\t\n\t\t\t\n\t\t\n\t\t/***************new test*************************************/\n//\t\tCoordinate startPoint=new Coordinate(500, 500);\n//\t\tLinkedList<VQP>visitedcircle_Queue=new LinkedList<VQP>();\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(500, 500), 45));\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(589, 540), 67));\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(500, 550), 95));\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(439, 560), 124));\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(460, 478), 69));\n//\t\tvisitedcircle_Queue.add(new VQP(new Coordinate(580, 580), 70));\n//\t\tIterator<VQP>testiterator=visitedcircle_Queue.iterator();\n//\t\twhile(testiterator.hasNext()){\n//\t\t\tVQP m1=testiterator.next();\n//\t\t\tCircle tm=new Circle(m1.getCoordinate(), m1.getRadius());\n//\t\t\tif (PaintShapes.painting && logger.isDebugEnabled()) {\n//\t\t\t\tPaintShapes.paint.color = PaintShapes.paint.redTranslucence;\n//\t\t\t\tPaintShapes.paint.addCircle(tm);\n//\t\t\t\tPaintShapes.paint.myRepaint();\n//\t\t\t}\n//\t\t\t\n//\t\t}\n//\t\tdouble coverradius=calculateIncircle(startPoint, visitedcircle_Queue);\n//\t\tCircle incircle=new Circle(startPoint, coverradius);\n//\t\tif (PaintShapes.painting && logger.isDebugEnabled()) {\n//\t\t\tPaintShapes.paint.color = PaintShapes.paint.blueTranslucence;\n//\t\t\tPaintShapes.paint.addCircle(incircle);\n//\t\t\tPaintShapes.paint.myRepaint();\n//\t\t}\n//\t\t/***************end test*************************************/\n\t\tEnvelope envelope = new Envelope(-79.76259, -71.777491,\n\t\t\t\t40.477399, 45.015865);\n\t\tdouble area=envelope.getArea();\n\t\tdouble density=57584/area;\n\t\tSystem.out.println(\"density=\"+density);\n\t\tSystem.out.println(\"end calling!\");\n\t}",
"public void AddAnimal(int amount, float xPos, float yPos)\n {\n for (int i = 0; i < amount; i++)\n {\n Animal newAnimal = new Animal(xPos, yPos, birds.size());\n birds.add(newAnimal);\n }\n }",
"public void add(Color c) {\r\n\t this.colors.add(c);\r\n }",
"private void tail(int centerX, int centerY, int radiusX, int radiusY, float angle) {\n Arc arc = new Arc();\n arc.setFill(getColor());\n arc.setType(ArcType.ROUND);\n arc.setRadiusX(radiusX);\n arc.setRadiusY(radiusY);\n arc.setCenterX(centerX);\n arc.setCenterY(centerY);\n arc.setStartAngle(angle);\n arc.setLength(90.0F);\n add(arc);\n }",
"public void drawCircle(int RGB, int startX, int startY, int radius) {\n\t\tfor (int i = 0; i < 360; i++) {\n\t\t\tfloat x_off = (radius / 2) * (float) Math.cos(i * Math.PI / 180);\n\t\t\tfloat y_off = (radius / 2) * (float) Math.sin(i * Math.PI / 180);\n\t\t\tdrawPixel(RGB, (int) (startX + (radius / 2) + x_off), (int) (startY\n\t\t\t\t\t+ (radius / 2) + y_off));\n\t\t}\n\t}",
"private static Circle createCircle(String[] input) {\r\n int px = Integer.parseInt(input[1]);\r\n int py = Integer.parseInt(input[2]);\r\n int vx = Integer.parseInt(input[3]);\r\n int vy = Integer.parseInt(input[4]);\r\n boolean isFilled = Boolean.parseBoolean(input[5]);\r\n int diameter = Integer.parseInt(input[6]);\r\n float r = (float) Integer.parseInt(input[7]) / 255.0f;\r\n float g = (float) Integer.parseInt(input[8]) / 255.0f;\r\n float b = (float) Integer.parseInt(input[9]) / 255.0f;\r\n int insertionTime = Integer.parseInt(input[10]);\r\n boolean isFlashing = Boolean.parseBoolean(input[11]);\r\n float r1 = (float) Integer.parseInt(input[12]) / 255.0f;\r\n float g1 = (float) Integer.parseInt(input[13]) / 255.0f;\r\n float b1 = (float) Integer.parseInt(input[14]) / 255.0f;\r\n return new Circle(insertionTime, px, py, vx, vy, diameter, new Color(r, g, b, 1), isFilled,\r\n isFlashing, new Color(r1, g1, b1, 1));\r\n }",
"public Circle(Circle circle) {\n this.center = circle.center;\n this.radius = circle.radius;\n }",
"@Override\n\tpublic void redo() {\n\t\tthis.list.add(shape);\n\n\t}",
"public void addCarro(Carro c){\n\t\tfor (int i = 0; i < carros.length; i++) {\n\t\t\tfor (int j = 0; j < carros[i].length; j++) {\n\t\t\t\tif(carros[i][j].getPlaca().equals(\"-VAZIO-\")){\n\t\t\t\t\tcarros[i][j] = c;\n\t\t\t\t\tSystem.out.println(\"O seu carro estara na vaga \" + (i*10) + j);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void setCircle(BufferedImage image, Dimension fieldSize, int x, int y, int radius, int color)\n {\n // Creates a new array of position\n ColoredPoint p_points[] = new ColoredPoint[10000];\n\n // Fills the array with every pixel in the circle around the mouse\n getCircle(image, fieldSize, p_points, x, y, radius, color);\n\n // For every pixel recorded\n for(ColoredPoint p : p_points)\n {\n // If the pixel is null, the end of the list has been reached\n if(p == null)\n {\n break;\n }\n image.setRGB(p.x, p.y, p.c);\n }\n }",
"public void drawCircle(Graphics g, int x, int y, int rad) {\n if (n == 5) {\n g.fillOval(x+25, y+25, rad, rad);\n }else if (n==6) {\n g.fillOval(x+18, y+18, rad, rad);\n }else {\n g.fillOval(x+14, y+14, rad, rad);\n }\n }",
"SimpleCircle(double newRadius){\n\t\tradius=newRadius;\n\t}",
"public void removeCircle(List list, Level level) {\n Block block = Block.get(0);\n \n for (Iterator<Location> i = list.iterator(); i.hasNext();) {\n Location loc = i.next();\n Block current = level.getBlock(loc);\n \n if(current.getId() == 20) {\n level.setBlock(loc, block);\n }\n }\n }",
"public void agregar_producto(RecyclingImageView c)\n {\n array_productos.add(c);\n }",
"private static void calculateRadiusforCircle()\r\n\t{\r\n\t\tsensorRadius = Math.sqrt((double) averageDensity / (double) numberOfSensors);\r\n\t\tsensorRadius = sensorRadius * unitSizeForCircle;\r\n\t\tnoOfCellRowsCoulmns = (int) (unitSizeForSquare / sensorRadius);\r\n\t\tcell = new Cell[noOfCellRowsCoulmns + 2][noOfCellRowsCoulmns + 3];\r\n\t\tinitializeCell(noOfCellRowsCoulmns + 2, noOfCellRowsCoulmns + 3);\r\n\t}",
"public void drawCircle(double radius,LatLng place, GoogleMap map){\n CircleOptions circleOptions = new CircleOptions();\n circleOptions.center(place);\n circleOptions.radius(radius);\n circleOptions.strokeColor(Color.BLACK);\n circleOptions.fillColor(0x30000000);\n circleOptions.strokeWidth(1);\n circle=map.addCircle(circleOptions);\n }",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public void add(GPoint[] pts) {\n\t\tfor (int i = 0; i < pts.length; i++) {\n\t\t\tpoints.add(new GPoint(pts[i]));\n\t\t}\n\t}",
"void add(Point point) {\n\t\tpoints[posit]=point;\n\t\tposit++;\n\t\t//if method add is applied, size should also change\n\t\tsize++;\n\t}",
"SimpleCircle(double newRadius) {\n\t\tradius = newRadius;\n\t}",
"public static boolean incrementNextCircle() {\n\t\tblockContext.nextCircle++;\n\n\t\tif (blockContext.nextCircle < blockContext.nCircles) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}",
"@Override\n public boolean isCircle() {\n return mIsCircle;\n }",
"public void addRound(ArrayList<Move> round) {\r\n\t\tfor (Move move : round) {\r\n\t\t\tadd(move);\r\n\t\t}\r\n\r\n\t\tint lastIndex = offsets.size() - 1;\r\n\t\toffsets.add(round.size() + offsets.get(lastIndex)); // accumulate the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// index\r\n\t}",
"public Circle getCircle(){\n return circleObj;\n }",
"public void append(CPoint cpoint) {\n\tcplist.add(cpoint);\n }",
"public static void addVectorCircle(MapLocation center, float size, float baseDesire, float distanceDesire) {\n switch (vectorCircleCount) {\n case 0:\n Z1vc_baseDesire = baseDesire + (distanceDesire * size);\n Z1vc_distanceDesire = -distanceDesire;\n Z1vc_center = center;\n Z1vc_size = size;\n vectorCircleCount++;\n break;\n case 1:\n Z2vc_baseDesire = baseDesire + (distanceDesire * size);\n Z2vc_distanceDesire = -distanceDesire;\n Z2vc_center = center;\n Z2vc_size = size;\n vectorCircleCount++;\n break;\n case 2:\n Z3vc_baseDesire = baseDesire + (distanceDesire * size);\n Z3vc_distanceDesire = -distanceDesire;\n Z3vc_center = center;\n Z3vc_size = size;\n vectorCircleCount++;\n break;\n case 3:\n Z4vc_baseDesire = baseDesire + (distanceDesire * size);\n Z4vc_distanceDesire = -distanceDesire;\n Z4vc_center = center;\n Z4vc_size = size;\n vectorCircleCount++;\n break;\n case 4:\n Z5vc_baseDesire = baseDesire + (distanceDesire * size);\n Z5vc_distanceDesire = -distanceDesire;\n Z5vc_center = center;\n Z5vc_size = size;\n vectorCircleCount++;\n break;\n case 5:\n Z6vc_baseDesire = baseDesire + (distanceDesire * size);\n Z6vc_distanceDesire = -distanceDesire;\n Z6vc_center = center;\n Z6vc_size = size;\n vectorCircleCount++;\n break;\n case 6:\n Z7vc_baseDesire = baseDesire + (distanceDesire * size);\n Z7vc_distanceDesire = -distanceDesire;\n Z7vc_center = center;\n Z7vc_size = size;\n vectorCircleCount++;\n break;\n case 7:\n Z8vc_baseDesire = baseDesire + (distanceDesire * size);\n Z8vc_distanceDesire = -distanceDesire;\n Z8vc_center = center;\n Z8vc_size = size;\n vectorCircleCount++;\n break;\n case 8:\n Z9vc_baseDesire = baseDesire + (distanceDesire * size);\n Z9vc_distanceDesire = -distanceDesire;\n Z9vc_center = center;\n Z9vc_size = size;\n vectorCircleCount++;\n break;\n case 9:\n Z10vc_baseDesire = baseDesire + (distanceDesire * size);\n Z10vc_distanceDesire = -distanceDesire;\n Z10vc_center = center;\n Z10vc_size = size;\n vectorCircleCount++;\n break;\n case 10:\n Z11vc_baseDesire = baseDesire + (distanceDesire * size);\n Z11vc_distanceDesire = -distanceDesire;\n Z11vc_center = center;\n Z11vc_size = size;\n vectorCircleCount++;\n break;\n case 11:\n Z12vc_baseDesire = baseDesire + (distanceDesire * size);\n Z12vc_distanceDesire = -distanceDesire;\n Z12vc_center = center;\n Z12vc_size = size;\n vectorCircleCount++;\n break;\n case 12:\n Z13vc_baseDesire = baseDesire + (distanceDesire * size);\n Z13vc_distanceDesire = -distanceDesire;\n Z13vc_center = center;\n Z13vc_size = size;\n vectorCircleCount++;\n break;\n case 13:\n Z14vc_baseDesire = baseDesire + (distanceDesire * size);\n Z14vc_distanceDesire = -distanceDesire;\n Z14vc_center = center;\n Z14vc_size = size;\n vectorCircleCount++;\n break;\n case 14:\n Z15vc_baseDesire = baseDesire + (distanceDesire * size);\n Z15vc_distanceDesire = -distanceDesire;\n Z15vc_center = center;\n Z15vc_size = size;\n vectorCircleCount++;\n break;\n case 15:\n Z16vc_baseDesire = baseDesire + (distanceDesire * size);\n Z16vc_distanceDesire = -distanceDesire;\n Z16vc_center = center;\n Z16vc_size = size;\n vectorCircleCount++;\n break;\n case 16:\n Z17vc_baseDesire = baseDesire + (distanceDesire * size);\n Z17vc_distanceDesire = -distanceDesire;\n Z17vc_center = center;\n Z17vc_size = size;\n vectorCircleCount++;\n break;\n case 17:\n Z18vc_baseDesire = baseDesire + (distanceDesire * size);\n Z18vc_distanceDesire = -distanceDesire;\n Z18vc_center = center;\n Z18vc_size = size;\n vectorCircleCount++;\n break;\n case 18:\n Z19vc_baseDesire = baseDesire + (distanceDesire * size);\n Z19vc_distanceDesire = -distanceDesire;\n Z19vc_center = center;\n Z19vc_size = size;\n vectorCircleCount++;\n break;\n case 19:\n Z20vc_baseDesire = baseDesire + (distanceDesire * size);\n Z20vc_distanceDesire = -distanceDesire;\n Z20vc_center = center;\n Z20vc_size = size;\n vectorCircleCount++;\n break;\n }\n }",
"public static String nestedCircle (double x, double y, double radius, double diff, Draw page, String radiusList) {\r\n\t \r\n\t //Base case \r\n\t\tif((Math.round(radius * 100.0) / 100.0 <= 0.0)) {\r\n\t\t\t return \"0.0]\";\r\n\t\t}\r\n\t\t\r\n\t\t//Base Case when RadiusList is empty\r\n\t\tif(radiusList.isEmpty()) {\r\n\t\t\t\r\n\t\t\t//Adds opening bracket to list\r\n\t\t\tradiusList += \"[\";\r\n\t\t\t\r\n\t\t\t//Recursive Call\r\n\t\t\treturn radiusList + nestedCircle(x, y, radius, diff, page, radiusList);\r\n\t\t}\r\n\t\t\r\n\t\telse {\r\n\t\t\tpage.circle(x, y, radius);\r\n\t\t\t//Rounds to two decimal places, separating coordinates by comma's\r\n\t radiusList = Math.round(radius * 100.0) / 100.0 + \", \";\r\n\t \r\n\t //Recursive Call\r\n\t\t\treturn radiusList + nestedCircle(x, y, radius-diff, diff, page, radiusList);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\r\n\t}",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public void addShape(final Shape theShape) {\n if (myWidth > 0) {\n final Drawing newDrawing = new Drawing(theShape, myColor, myWidth);\n if (myDrawingArray.isEmpty()) {\n firePropertyChange(ARRAY_STRING, null, NOT_EMPTY_STRING);\n }\n myDrawingArray.add(newDrawing);\n repaint();\n } \n }",
"public void add(List<IShape> component)\n\t{\n\t\tfilterShapes(component);\n\t\tfilterGroups(component);\n\t}",
"@Override\n public void run() {\n XYChart.Data<Number, Number> data = new XYChart.Data<>(-x, y);\n data.setNode(new Circle(5, javafx.scene.paint.Color.GREY));\n series.getData().add(data);\n lineChart.getData().add(series);\n }",
"public Paint(){\n triangles = new ArrayList<>();\n rectangles = new ArrayList<>();\n circles = new ArrayList<>();\n }",
"private void createCircleImages(){\n offScreenCircles = new Image[8];\n try {\n offScreenCircles[0] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleDown.png\"));\n offScreenCircles[1] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftDown.png\"));\n offScreenCircles[2] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeft.png\"));\n offScreenCircles[3] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftUp.png\"));\n offScreenCircles[4] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleUp.png\"));\n offScreenCircles[5] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightUp.png\"));\n offScreenCircles[6] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRight.png\"));\n offScreenCircles[7] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightDown.png\"));\n } catch (IOException ex) {\n System.out.println(\"Bild konnte nicht geladen werden!\");\n }\n activeOffScreenCircle = offScreenCircles[0];\n }",
"public static void addBalls() {\n\t\tfor (int i = 0; i < numberOfBalls; i++) {\n\t\t\tPanel.balls.add(new Ball());\n\t\t}\n\t}",
"public void addShape(Shape shape)\n {\n shapes.add(shape);\n }",
"public void addPoint(int points){\n\t\tthis.fidelityCard.point += points;\t\t\n\t}",
"public Circle drawCircle(GoogleMap map, LatLng latLng){\n map.clear();\n return map.addCircle(new CircleOptions()\n .center(latLng)\n .strokeColor(Color.BLUE)\n .strokeWidth(1)\n .radius(0)\n .fillColor(Color.parseColor(\"#500084d3\")));\n }",
"private void addItems() {\n for (int i = 0; i < 10; i++) {\n double offset = i/60d;\n mClusterManager.addItem(new CrumbClusterItem(new Crumb(new LatLng(5,-5 + offset))));\n }\n Log.d(TAG, \"All items added to map\");\n }",
"public Circle(double radius){\n this.radius = radius;\n }",
"public CirclePoint(int pnts, int x, int y, int r, double rotate, double rotatex, double rotatey, double scale) {\n this.pnts = pnts;\n int x_;\n int y_;\n pts = new Vector2D[pnts];\n for (int i = 0; i < pnts; i++) {\n // what is happening is the MU.rotate(), MU.rotatex(), MU.rotatey() and MU.zoom() each return a vector2D which are all multiplied together\n //to give a single point on a circle.\n //see MU.rotate(), MU.rotatex(), MU.rotatey() and MU.zoom() for details on the functions.\n //the x_ and y_ value will be a coordinate on the screen\n x_ = (int) (x + r * MU.rotate(i, pnts, rotate).getX() * MU.rotatex(rotatex).getX() * MU.rotatey(rotatey).getX() * MU.zoom(scale).getX());\n y_ = (int) (y + r * MU.rotate(i, pnts, rotate).getY() * MU.rotatex(rotatex).getY() * MU.rotatey(rotatey).getY() * MU.zoom(scale).getY());\n pts[i] = new Vector2D(x_, y_);\n }\n }"
]
| [
"0.75801575",
"0.6619484",
"0.65995806",
"0.6482145",
"0.6424847",
"0.63441896",
"0.62891173",
"0.62163",
"0.6143995",
"0.61233944",
"0.61041474",
"0.6051938",
"0.59873635",
"0.59487504",
"0.59348685",
"0.59117264",
"0.58814764",
"0.58712196",
"0.5847475",
"0.58419734",
"0.58353233",
"0.5765451",
"0.57320946",
"0.57288176",
"0.5722411",
"0.57110345",
"0.5690842",
"0.56712687",
"0.5634367",
"0.5625475",
"0.5619687",
"0.56152916",
"0.56042194",
"0.5566206",
"0.55546165",
"0.554968",
"0.55454946",
"0.55427605",
"0.5518751",
"0.5478395",
"0.5474366",
"0.5473504",
"0.54668784",
"0.5460012",
"0.544074",
"0.54398847",
"0.5428776",
"0.5405221",
"0.5390624",
"0.53902316",
"0.53810936",
"0.53809273",
"0.53774995",
"0.53747207",
"0.53740627",
"0.5352767",
"0.5352105",
"0.53384715",
"0.53373647",
"0.53342223",
"0.5332359",
"0.5328197",
"0.53252095",
"0.5321547",
"0.5316864",
"0.5315443",
"0.5312919",
"0.5312117",
"0.5302658",
"0.52938235",
"0.52915716",
"0.5288299",
"0.5285295",
"0.52835906",
"0.5281464",
"0.5273434",
"0.5267772",
"0.526333",
"0.5260555",
"0.52583784",
"0.5255218",
"0.52507466",
"0.52447957",
"0.52334994",
"0.52290744",
"0.52246886",
"0.5217328",
"0.52151614",
"0.52060753",
"0.5186876",
"0.5186355",
"0.51820654",
"0.51815695",
"0.51791704",
"0.5147927",
"0.5145537",
"0.5144075",
"0.51400185",
"0.5129149",
"0.5128673"
]
| 0.81789935 | 0 |
adds a rectangle to the arrayList of the rectangles | public void addRectangle(Rectangle rectangle){
rectangles.add(rectangle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addRectangle(MyRectangle rectangle) {\n rectangles[numberOfRectangles++] = rectangle;\n }",
"private void addRectanglesToGrid(GridPane grid, List<Rectangle> rectangles) {\r\n if (!grid.getChildren().isEmpty())\r\n grid.getChildren().clear();\r\n for (int i = 0; i < gridSize * gridSize; i++)\r\n grid.add(rectangles.get(i), i % gridSize, i / gridSize);\r\n }",
"void addRects() {\n ArrayList<Rect> current_path_rects = new ArrayList<>();\n for (int i = 0; i < path_points.get(paths.size()-1).size()-1; i ++) {\n int x1 = path_points.get(paths.size()-1).get(i).get(0);\n int y1 = path_points.get(paths.size()-1).get(i).get(1);\n int x2 = path_points.get(paths.size()-1).get(i+1).get(0);\n int y2 = path_points.get(paths.size()-1).get(i+1).get(1);\n Rect rect = new Rect();\n // Find correct x/y coords to set up for rect\n if (x1 <= x2) {\n if (y1 > y2) {\n int temp_y1 = y1;\n y1 = y2;\n y2 = temp_y1;\n }\n }\n else {\n int temp_x1 = x1;\n x1 = x2;\n x2 = temp_x1;\n if (y1 > y2) {\n int temp_y1 = y1;\n y1 = y2;\n y2 = temp_y1;\n }\n }\n // If rectangle is too small, collision will be hard\n // Make small rectangle into bigger rectangle\n ArrayList<Integer> adjusted_coords = adjustCoords(x1, y1, x2, y2);\n rect.set(adjusted_coords.get(0), adjusted_coords.get(1), adjusted_coords.get(2), adjusted_coords.get(3));\n current_path_rects.add(rect);\n }\n paths_rects.add(current_path_rects);\n }",
"@Test @Graded(description=\"testAddRectangle\", marks=12)\n\tpublic void testAddRectangle() {\n\t\tRectangle r = new Rectangle(30, 5);\n\t\tlist1.add(r);\n\t\tassertEquals(5, list1.currentSize());\n\t\tassertEquals(5, list1.currentCapacity());\n\t\tassertNotNull(list1.get(0));\n\t\tassertEquals(\"10 by 5\", list1.get(0).toString());\n\t\tassertNotNull(list1.get(1));\n\t\tassertEquals(\"70 by 10\", list1.get(1).toString());\n\t\tassertNotNull(list1.get(2));\n\t\tassertEquals(\"20 by 20\", list1.get(2).toString());\n\t\tassertNotNull(list1.get(3));\n\t\tassertEquals(\"90 by 50\", list1.get(3).toString());\n\t\tassertNotNull(list1.get(4));\n\t\tassertEquals(\"30 by 5\", list1.get(4).toString());\n\n\t\tr.width = (1);\n\t\t// we wanted to add an instance copy of the object\n\t\tassertEquals(\"30 by 5\", list1.get(4).toString());\n\n\t\t// adding 6th item should have \"grown\" the list\n\t\tr = new Rectangle(100);\n\n\t\t// add test will pass after you correctly implement grow()\n\t\tlist1.add(r);\n\t\tassertEquals(6, list1.currentSize());\n\t\tassertEquals(15, list1.currentCapacity());\n\t\tassertNotNull(list1.get(0));\n\t\tassertEquals(\"10 by 5\", list1.get(0).toString());\n\t\tassertNotNull(list1.get(1));\n\t\tassertEquals(\"70 by 10\", list1.get(1).toString());\n\t\tassertNotNull(list1.get(2));\n\t\tassertEquals(\"20 by 20\", list1.get(2).toString());\n\t\tassertNotNull(list1.get(3));\n\t\tassertEquals(\"90 by 50\", list1.get(3).toString());\n\t\tassertNotNull(list1.get(4));\n\t\tassertEquals(\"30 by 5\", list1.get(4).toString());\n\t\tassertNotNull(list1.get(5));\n\t\tassertEquals(\"100 by 100\", list1.get(5).toString());\n\n\t\tr.width = (888);\n\t\t// we wanted to add an instance copy of the object\n\t\tassertEquals(\"100 by 100\", list1.get(5).toString());\n\t\tcurrentMethodName = new Throwable().getStackTrace()[0].getMethodName();\n\n\t}",
"private void createRectangles() {\r\n rectangles.clear();\r\n for (int i = 0; i < gridSize * gridSize; i++) {\r\n Rectangle r = new Rectangle(rectangleSize, rectangleSize, Color.BLUE);\r\n r.setStroke(Color.BLACK);\r\n rectangles.add(r);\r\n }\r\n }",
"void createRectangles();",
"void buildRectangles(){\n background(255);\n for(int i=0;i<arr.length;i++){\n noStroke();\n Rect r=new Rect(40+i*80,400,75,-arr[i]*20,color1);\n createRectangle(r,color1);\n }\n }",
"public static void addRectangle(Image image, int x, int y, int width, int height, int red, int green, int blue){\n\t\tint minX=Math.max(x,0);\n\t\tint minY=Math.max(y,0);\n\t\tint widthMax=Math.min(x+width,image.width());\n\t\tint heightMax=Math.min(y+height,image.height());\n\t\tfor(int i = minY;i<heightMax;i++)\n\t\t\tfor(int j = minX; j < widthMax; j++)\n\t\t\t\timage.setPixel(j,i,red,green,blue);\n\t}",
"public void test_addLorg_eclipse_swt_graphics_Rectangle() {\n\tfinal int COUNT = 60000000;\n\t\n\tRectangle r1 = new Rectangle(1, 2, 3, 4);\n\tRectangle r2 = new Rectangle(3, 3, 2, 2);\n\n\tPerformanceMeter meter = createMeter();\n\tmeter.start();\n\tfor (int i = 0; i < COUNT; i++) {\n\t\tr1.add(r2);\n\t}\n\tmeter.stop();\n\t\n\tdisposeMeter(meter);\n}",
"private void generateNewRect() {\n\t\t\n\t\tif(rectengleList.size() < getLevel()){\n\t\tRandom mRandom = new Random();\n\t\tint height = getHeight();\n\t\tint width = getWidth();\n\n\t\tint cx = (int) ((mRandom.nextInt() % (width * 0.8)) + (width * 0.1));\n\t\tint cy = (int) ((mRandom.nextInt() % (height * 0.8)) + (height * 0.1));\n\t\tint hw = (int) (mRandom.nextInt() % (width * 0.4) + width * 0.2) / 2;\n\t\tint hh = (int) (mRandom.nextInt() % (height * 0.4) + height * 0.2) / 2;\n\n\t\tint color = (0x00252525 | mRandom.nextInt()) & 0x00FFFFFF | 0x77000000;\n\t\t\n\t\t\n\t\trectengleList.add(new ColoredRect(color, cx - hw, cy - hh, cx + hw, cy\n\t\t\t\t+ hh));\n\t\t}\n\t\telse{\n\t\t\trectengleList.clear();\t\t\t\n\t\t}\n\t}",
"private void resizeRectangle() {\r\n Rectangle r;\r\n for (Rectangle rectangle : rectangles) {\r\n r = rectangle;\r\n r.setHeight(rectangleSize);\r\n r.setWidth(rectangleSize);\r\n }\r\n }",
"public void addRectangleFromSnake(ISnake snake, Color color) {\n Point head = snake.getHead();\n Stack<Point> coords = new Stack<Point>();\n for (Point p : snake.getCoordinates()) {\n if ((p.getX() != head.getX()) || (p.getY() != head.getY())) {\n coords.push(p);\n }\n }\n coords.push(head);\n rectangles.push(new RectangleData(color, String.valueOf(snake.getPriority()), coords));\n numOfSnakes++;\n }",
"private static void addRectangle(String[] input) throws NumberFormatException, IncorrectParametersException{\n if (input.length == 5){\n try{\n int x1 = Integer.parseInt(input[1]); \n int y1 = Integer.parseInt(input[2]);\n int x2 = Integer.parseInt(input[3]); \n int y2 = Integer.parseInt(input[4]);\n try{\n canvas.createRectangle(x1, y1, x2, y2);\n System.out.println(canvas.render());\n } catch (NullPointerException ex) {\n System.out.println(\"Initialise a new canvas first!\");\n }\n } catch (NumberFormatException ex) {\n System.out.println(\"HELP: to create a new rectangle enter `R x1 y1 x2 y2`, with (x1,y1) being the upper left corner and (x2,y2) the lower right one.\");\n }\n } else {\n System.out.println(\"HELP: to create a new rectangle enter `R x1 y1 x2 y2`, with (x1,y1) being the upper left corner and (x2,y2) the lower right one.\");\n throw new IncorrectParametersException(\"\");\n }\n }",
"void drawRectangle(int index,int[] color){\n Rect r;\n background(255);\n for(int i=0;i<arr.length;i++){\n if(i!=index) {\n noStroke();\n r=new Rect(40 + i * 80, 400, 75, -arr[i] * 20, color1);\n createRectangle(r, color1);\n }else{\n noStroke();\n r=new Rect(40 + i* 80, 400, 75, -arr[i] * 20, color);\n createRectangle(r, color);\n }\n }\n }",
"void addBounds(int x, int y, int width, int height);",
"public void addShape(Shapes obj) {\n \tthis.listShapes.add(obj);\n W.repaint();\n }",
"public void addSquaresToList()\n {\n int i = 0;\n int size = 50;\n int spacing = 0;\n int interval = size + spacing;\n\n while (i < 8)\n {\n sqList.add(new Square(interval * i, 0, size, \"red\"));\n i++;\n }\n }",
"public void addSquaresToList(){\r\n int i = 0;\r\n while(i<8){\r\n sqList.add(new Square(0+(i*50),0,50,\"red\"));\r\n i++;\r\n } \r\n \r\n }",
"protected void createRect()\r\n\t{\r\n\t\trect = new Rectangle(getX(),getY(),width,height);\r\n\t}",
"public void fillRectangle(RectangleShape rectangle);",
"public void addClipRect(final BoundaryRectangle r) {\n\t\tif (savedClipRect != null)\n\t\t\tsavedClipRect.add(r);\n\t\telse if (r==null)\n\t\t\tsavedClipRect = null;\n\t\telse\n\t\t\tsavedClipRect = new BoundaryRectangle(r);\t\n\t}",
"private void setCollision(){\n\t\tMapObjects mapObjects = map.getLayers().get(\"COLLISION\").getObjects();\n\t\tfor (int ii = 0; ii < mapObjects.getCount(); ++ii){\n\t\t\tRectangleMapObject rectangle_map_object = (RectangleMapObject) mapObjects.get(ii);\n\t\t\tareaCollision.add(new Rectangle(rectangle_map_object.getRectangle()));\n\t\t}\n\t}",
"public ClientSideImageMap addRectangleArea(AbstractLink link, int x1, int y1, int x2, int y2)\r\n\t{\r\n\t\tareas.add(link);\r\n\t\tlink.add(new Area(rectangleCoordinates(x1, y1, x2, y2), RECTANGLE));\r\n\t\treturn this;\r\n\t}",
"public abstract List<PaintObjectWriting> deleteRectangle(\n final Rectangle _r, List<PaintObjectWriting> _l);",
"public void colorBarrenRectangles() {\n\n ListIterator<Integer[]> iterator = allRectangles.listIterator();\n while (iterator.hasNext()) {\n\n Integer[] rectangle = iterator.next();\n\n for (int i = rectangle[0]; i <= rectangle[2]; i++) {\n for (int j = rectangle[1]; j <= rectangle[3]; j++) {\n mColor[i][j] = 1;\n }\n }\n }\n }",
"public void createRectangle(double x, double y, double width, double height) {\r\n GRect rectangle = new GRect(x, y, width, height);\r\n rectangle.setFilled(true);\r\n rectangle.setFillColor(Color.GRAY);\r\n rectangle.setColor(Color.WHITE);\r\n add(rectangle);\r\n }",
"private ArrayList<Figure> getRectangleData(){\n\n ArrayList<Figure> getRectangleData = new ArrayList<>();\n\n getRectangleData.add(new Rectangle(\"First rectangle\", Color.RED, 2, 3));\n getRectangleData.add(new Rectangle(\"Second rectangle\", Color.GREEN, 1, 2));\n getRectangleData.add(new Rectangle(\"Third rectangle\", Color.BLUE, 7, 4));\n getRectangleData.add(new Rectangle(\"Fourth rectangle\", Color.YELLOW, 5, 8));\n getRectangleData.add(new Rectangle(\"Fifth rectangle\", Color.GREEN, 9, 4));\n getRectangleData.add(new Rectangle(\"Sixth rectangle\", Color.YELLOW, 8, 9));\n getRectangleData.add(new Rectangle(\"Seventh rectangle\", Color.BLUE, 1, 8));\n getRectangleData.add(new Rectangle(\"Eighth rectangle\", Color.BLUE, 1, 8));\n\n return getRectangleData;\n }",
"void createRectangle(Rect r, int[] color){\n noStroke();\n fill(color[0],color[1],color[2]);\n rect(r.x,r.y,r.width,r.height);\n }",
"@java.lang.SuppressWarnings({\"ReferenceEquality\"})\n private void mergeRect(org.chromium.components.paint_preview.common.proto.PaintPreview.RectProto value) {\n value.getClass();\n if (rect_ != null &&\n rect_ != org.chromium.components.paint_preview.common.proto.PaintPreview.RectProto.getDefaultInstance()) {\n rect_ =\n org.chromium.components.paint_preview.common.proto.PaintPreview.RectProto.newBuilder(rect_).mergeFrom(value).buildPartial();\n } else {\n rect_ = value;\n }\n bitField0_ |= 0x00000001;\n }",
"public static void main(String [] args) {\n\t\tArrayList <Rectangle >rec_list = new ArrayList(); \r\n\t\t\r\n\t\t//create a new Scanner to read input \r\n\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\t// declare variable for while loop\r\n\t\tint num = 0;\r\n\t\t//while loop to display menu options \r\n\t\twhile (num==0) {\r\n\t\t\t//print menu\r\n\t\t\tSystem.out.println(\"\\n## Rectangle Program ##\");\r\n\t\t\tSystem.out.println(\"\\n1. Enter rectangle details\");\r\n\t\t\tSystem.out.println(\"2. Show all rectangles\");\r\n\t\t\tSystem.out.println(\"3. Exit program\");\r\n\t\t\tSystem.out.println(\"\\nPlease enter your option: \");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**try statement to take input, \r\n\t\t\t*create Rectangle and add it to the list */\r\n\t\t\ttry {\t\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\t// if user enters \"1\"\r\n\t\t\t\tif (num==1) {\t\r\n\t\t\t\t\tSystem.out.println(\"\\nPleasExceptione enter rectangle`s height and width (in cm): \");\r\n\t\t\t\t\tfloat height = input.nextFloat();\r\n\t\t\t\t\tfloat width = input.nextFloat();\r\n\t\t\t\t\t// if user entered negative numbers \r\n\t\t\t\t\tif (height <0 || width<0) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid input. Please enter positive float numbers\");\r\n\t\t\t\t\t\tnum = 0;}\r\n\t\t\t\t\telse{ \t\t\r\n\t\t\t\t\t\t//create new Rectangle object \r\n\t\t\t\t\t\tRectangle new_rec = new Rectangle(height, width);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//add rectangle to list \r\n\t\t\t\t\t\trec_list.add(new_rec);\r\n\t\t\t\t\t\tSystem.out.println(\"The rectangle was successfully created!\");\r\n\t\t\t\t\t\tnum = 0; }// continue - show menu \r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if user enters \"2\"\r\n\t\t\t\tif (num==2) {\r\n\t\t\t\t\t//sort ArrayList\r\n\t\t\t\t\tCollections.sort(rec_list);\r\n\t\t\t\t\t//print result \r\n\t\t\t\t\tfor(Rectangle o:rec_list) {\r\n\t\t\t\t\t\tSystem.out.println(o);\r\n\t\t\t\t\t\tnum = 0;\r\n\t\t\t\t\t\t}\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t// if user enters \"3\"\r\n\t\t\t\tif (num==3) {\r\n\t\t\t\t\tSystem.out.println(\"Thanks, Bye!\");\r\n\t\t\t\t\t//terminate program \r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if program continues operation \t\t\t\t\r\n\t\t\t\tif (num ==0){\r\n\t\t\t\t\tSystem.out.println(\"We continue\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if user entered any other input \r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"You should enter integer from 1 to 3\");\r\n\t\t\t\t\tnum = 0; // continue - show menu \r\n\t\t\t\t\t} \r\n\t\t\t}\r\n\t\t\t\t//catch exception if input is not a positive float number \r\n\t\t\tcatch (InputMismatchException ex) {\r\n\t\t\t\tSystem.out.println(\"Invalid input. Please enter correct input\");\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tnum=0;// continue - show menu \r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//catch exception if Rectangle cannot be added to the list \r\n\t\t\tcatch (Exception ex) {\r\n\t\t\t\tSystem.out.println(\"A problem appeared while adding rectangle to array list\");\r\n\t\t\t\tnum = 0;// continue - show menu \r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t}",
"void fireRectangleAdded(Rectangle newArea) {\n Rectangle candidate = null;\n int delta = Integer.MAX_VALUE;\n // Search for an already existing rectangle, closest to the new one.\n for (Rectangle rectangle : originalAreas) {\n if (!rectangle.contains(newArea)) {\n int cDelta = newArea.y - rectangle.y;\n if (candidate == null || cDelta > 0 && cDelta < delta) {\n candidate = rectangle;\n delta = cDelta;\n }\n }\n }\n \n for (Iterator<AreaUpdatedListener> iterator = listeners.iterator(); iterator.hasNext();) {\n AreaUpdatedListener listener = iterator.next();\n listener.rectangleAdded(newArea, candidate);\n }\n }",
"public void addSegment()\n { \n Location tail = new Location();\n \n if(up)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()+15);\n }\n else if(down)\n {\n tail.setA(list.get(0).getA());\n tail.setB(list.get(0).getB()-15);\n }\n else if(left)\n {\n tail.setA(list.get(0).getA()+15);\n tail.setB(list.get(0).getB());\n }\n else if(right)\n {\n tail.setA(list.get(0).getA()-15);\n tail.setB(list.get(0).getB());\n } \n \n ArrayList<Location> temp = new ArrayList<Location>();\n \n \n temp.add(tail);\n \n for(int i=0 ; i<list.size() ; i++)\n {\n temp.add(list.get(i));\n }\n list = temp; \n }",
"public void add(Coord obj) {\n\t\tif (index > itemcount)\n\t\t\tthrow new RuntimeException(\"Liste ist voll\");\n\t\tarray[index++] = obj;\n\t}",
"public void add(DrawEvent currentEvent) {\n DrawShape shape = currentEvent.getShape();\n if (size() > 0) {\n if (shape.getX() < bounds.x) {\n bounds.x = shape.getX();\n bounds.width += bounds.x - shape.getX();\n }\n if (shape.getY() < bounds.y) {\n bounds.y = shape.getY();\n bounds.height += bounds.y - shape.getY();\n }\n } else {\n bounds.x = shape.getX();\n bounds.y = shape.getY();\n bounds.width = shape.getWidth();\n bounds.height = shape.getHeight();\n }\n super.addElement(currentEvent);\n }",
"private void addRenderPieces(Text text) {\n Rectangle rectangle = new Rectangle();\n rectangle.setX(text.getX());\n rectangle.setY(text.getY());\n rectangle.setWidth(text.getLayoutBounds().getWidth());\n rectangle.setHeight(lineHeight);\n rectangle.setFill(Color.VIOLET);\n rectangle.toBack();\n root.getChildren().add(rectangle);\n renderPieces.add(rectangle);\n }",
"static void deleteLastRectangle(){\n System.out.println(coloredRectangles.size());\n coloredRectangles.remove(coloredRectangles.size() - 1);\n //revalidate();\n }",
"private void paintDirtyRectanglesImmediately() {\n if ( rectangles.size() > 0 ) {\n Rectangle unionRectangle = RectangleUtils.union( rectangles );\n this.repaintArea = transformManager.transform( unionRectangle );\n paintImmediately( repaintArea );\n rectangles.clear();\n }\n }",
"public void add(Renderable e) {\n array[upperBound] = e;\n\n upperBound = (upperBound + 1) % array.length;\n }",
"public void drawRect(float x, float y, float width, float height) {\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x1, y1, 0F, 0F,\n x2, y1, 1F, 0F,\n x2, y2, 1F, 1F,\n x1, y2, 0F, 1F\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }",
"public RectangleAdapter(Shapes rect) {\n super(rect);\n //this.rect = (Rectangle)rect;\n }",
"private void populateRooms(){\n\n for(int i = 0; i<squares.size(); i++){\n for(int j = 0; j<squares.get(i).size(); j++){\n if(squares.get(i).get(j) != null) {\n getRoom(squares.get(i).get(j).getColor()).addSquare(squares.get(i).get(j));\n squares.get(i).get(j).setRoom(getRoom(squares.get(i).get(j).getColor()));\n\n }\n }\n }\n }",
"private void drawIntoRect(Graphics2D g2, BufferedImage image, Rectangle rect) {\r\n\t\tfor (int j = rect.y; j < rect.y + rect.height; j++) {\r\n\t\t\tfor (int k = rect.x; k < rect.x + rect.width; k++) {\r\n\t\t\t\tint x = xoff + Tile.toScreenX(k, j); \r\n\t\t\t\tint y = yoff + Tile.toScreenY(k, j); \r\n\t\t\t\tg2.drawImage(image, x - 1, y - image.getHeight(), null);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void displayRectangles() {\n\n\n int arr[] = IntStream.of(findDuplicates(TricolourController.BloodCells)).distinct().toArray(); //takes only the unique values from the array\n int arrWhite[] = IntStream.of(findDuplicates(TricolourController.WhiteCells)).distinct().toArray();\n int rIndex = 0;\n int lIndex = 0;\n int numCells = 0;\n\n for(int num : arrWhite) {\n System.out.println(num);\n }\n\n for(int j=0; j < arr.length - 1; j++) {\n for (int i = 0; i < TricolourController.BloodCells.length; i++) {\n if (TricolourController.BloodCells[i] == arr[j]) {\n int x = i % width, y = i / width;\n if (r[rIndex] == null) {\n r[rIndex] = new Rectangle(x, y, 1, 1);\n numCells++;\n }\n else {\n if (x > r[rIndex].getX() + r[rIndex].getWidth()) r[rIndex].setWidth(x - r[rIndex].getX());\n if (x < r[rIndex].getX()) {\n r[rIndex].setWidth(r[rIndex].getX() + r[rIndex].getWidth() - x);\n r[rIndex].setX(x);\n }\n if (y > r[rIndex].getY() + r[rIndex].getHeight()) r[rIndex].setHeight(y - r[rIndex].getY());\n }\n }\n }\n if (r[rIndex] != null) {\n r[rIndex].setFill(Color.TRANSPARENT);\n if(r[rIndex].getWidth() * r[rIndex].getHeight() > 2500) {\n r[rIndex].setStroke(Color.BLUE);\n }\n else r[rIndex].setStroke(Color.DARKGREEN);\n\n r[rIndex].setTranslateX(ImageViewTri.getLayoutX());\n r[rIndex].setTranslateY(ImageViewTri.getLayoutY());\n ((Pane) ImageViewTri.getParent()).getChildren().add(r[rIndex++]);\n RedCellText.setText(String.valueOf(numCells));\n }\n l[lIndex] = new Label();\n l[lIndex].setText(String.valueOf(numCells));\n l[lIndex].setTextFill(Color.BLACK);\n l[lIndex].setTranslateX(r[rIndex - 1].getX());\n l[lIndex].setTranslateY(r[rIndex - 1].getY());\n\n ((Pane) ImageViewTri.getParent()).getChildren().add(l[lIndex++]);\n }\n\n//Handles the white cell rectangles.\n int whitenumcells = 0;\n for(int j=0; j < arrWhite.length - 1; j++) {\n for (int i = 0; i < TricolourController.WhiteCells.length; i++) {\n if (TricolourController.WhiteCells[i] == arrWhite[j]) {\n int x = i % width, y = i / width;\n if (r[rIndex] == null) {\n r[rIndex] = new Rectangle(x, y, 1, 1);\n whitenumcells++;\n }\n else {\n if (x > r[rIndex].getX() + r[rIndex].getWidth()) r[rIndex].setWidth(x - r[rIndex].getX());\n if (x < r[rIndex].getX()) {\n r[rIndex].setWidth(r[rIndex].getX() + r[rIndex].getWidth() - x);\n r[rIndex].setX(x);\n }\n if (y > r[rIndex].getY() + r[rIndex].getHeight()) r[rIndex].setHeight(y - r[rIndex].getY());\n }\n }\n }\n if (r[rIndex] != null) {\n r[rIndex].setFill(Color.TRANSPARENT);\n r[rIndex].setStroke(Color.YELLOW);\n\n r[rIndex].setTranslateX(ImageViewTri.getLayoutX());\n r[rIndex].setTranslateY(ImageViewTri.getLayoutY());\n ((Pane) ImageViewTri.getParent()).getChildren().add(r[rIndex++]);\n WhiteCellText.setText(String.valueOf(whitenumcells));\n }\n l[lIndex] = new Label();\n l[lIndex].setText(String.valueOf(whitenumcells));\n l[lIndex].setTextFill(Color.BLACK);\n l[lIndex].setTranslateX(r[rIndex - 1].getX());\n l[lIndex].setTranslateY(r[rIndex - 1].getY());\n\n ((Pane) ImageViewTri.getParent()).getChildren().add(l[lIndex++]);\n }\n }",
"public void add(WorldObject obj) {\n\troomList.add(obj);\n}",
"public static void addAngledRectangle(MapLocation start, Direction dir, MapLocation end, float avoidwidth, float desire, float speed) {\n Direction left;\n MapLocation leftStart;\n MapLocation leftEnd;\n MapLocation rightEnd;\n float x1;\n float y1;\n switch (angledRectangleCount) {\n case 0:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z1_p21x = Float.sum(rightEnd.x, x1);\n Z1_p21y = Float.sum(rightEnd.y, y1);\n Z1_p41x = Float.sum(leftStart.x, x1);\n Z1_p41y = Float.sum(leftStart.y, y1);\n Z1_dotsection2 = -Float.sum(x1 * Z1_p21x, y1 * Z1_p21y);\n Z1_dotsection4 = -Float.sum(x1 * Z1_p41x, y1 * Z1_p41y);\n Z1_p21MagSquared = Float.sum(Z1_dotsection2, Float.sum(Z1_p21x * Z1_p21x, Z1_p21y * Z1_p21y));\n Z1_p41MagSquared = Float.sum(Z1_dotsection4, Float.sum(Z1_p41x * Z1_p41x, Z1_p41y * Z1_p41y));\n Z1_desire = desire;\n Z1_center = start.add(dir, speed * 0.5f);\n Z1_maxdist = Z1_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 1:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z2_p21x = Float.sum(rightEnd.x, x1);\n Z2_p21y = Float.sum(rightEnd.y, y1);\n Z2_p41x = Float.sum(leftStart.x, x1);\n Z2_p41y = Float.sum(leftStart.y, y1);\n Z2_dotsection2 = -Float.sum(x1 * Z2_p21x, y1 * Z2_p21y);\n Z2_dotsection4 = -Float.sum(x1 * Z2_p41x, y1 * Z2_p41y);\n Z2_p21MagSquared = Float.sum(Z2_dotsection2, Float.sum(Z2_p21x * Z2_p21x, Z2_p21y * Z2_p21y));\n Z2_p41MagSquared = Float.sum(Z2_dotsection4, Float.sum(Z2_p41x * Z2_p41x, Z2_p41y * Z2_p41y));\n Z2_desire = desire;\n Z2_center = start.add(dir, speed * 0.5f);\n Z2_maxdist = Z2_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 2:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z3_p21x = Float.sum(rightEnd.x, x1);\n Z3_p21y = Float.sum(rightEnd.y, y1);\n Z3_p41x = Float.sum(leftStart.x, x1);\n Z3_p41y = Float.sum(leftStart.y, y1);\n Z3_dotsection2 = -Float.sum(x1 * Z3_p21x, y1 * Z3_p21y);\n Z3_dotsection4 = -Float.sum(x1 * Z3_p41x, y1 * Z3_p41y);\n Z3_p21MagSquared = Float.sum(Z3_dotsection2, Float.sum(Z3_p21x * Z3_p21x, Z3_p21y * Z3_p21y));\n Z3_p41MagSquared = Float.sum(Z3_dotsection4, Float.sum(Z3_p41x * Z3_p41x, Z3_p41y * Z3_p41y));\n Z3_desire = desire;\n Z3_center = start.add(dir, speed * 0.5f);\n Z3_maxdist = Z3_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 3:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z4_p21x = Float.sum(rightEnd.x, x1);\n Z4_p21y = Float.sum(rightEnd.y, y1);\n Z4_p41x = Float.sum(leftStart.x, x1);\n Z4_p41y = Float.sum(leftStart.y, y1);\n Z4_dotsection2 = -Float.sum(x1 * Z4_p21x, y1 * Z4_p21y);\n Z4_dotsection4 = -Float.sum(x1 * Z4_p41x, y1 * Z4_p41y);\n Z4_p21MagSquared = Float.sum(Z4_dotsection2, Float.sum(Z4_p21x * Z4_p21x, Z4_p21y * Z4_p21y));\n Z4_p41MagSquared = Float.sum(Z4_dotsection4, Float.sum(Z4_p41x * Z4_p41x, Z4_p41y * Z4_p41y));\n Z4_desire = desire;\n Z4_center = start.add(dir, speed * 0.5f);\n Z4_maxdist = Z4_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 4:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z5_p21x = Float.sum(rightEnd.x, x1);\n Z5_p21y = Float.sum(rightEnd.y, y1);\n Z5_p41x = Float.sum(leftStart.x, x1);\n Z5_p41y = Float.sum(leftStart.y, y1);\n Z5_dotsection2 = -Float.sum(x1 * Z5_p21x, y1 * Z5_p21y);\n Z5_dotsection4 = -Float.sum(x1 * Z5_p41x, y1 * Z5_p41y);\n Z5_p21MagSquared = Float.sum(Z5_dotsection2, Float.sum(Z5_p21x * Z5_p21x, Z5_p21y * Z5_p21y));\n Z5_p41MagSquared = Float.sum(Z5_dotsection4, Float.sum(Z5_p41x * Z5_p41x, Z5_p41y * Z5_p41y));\n Z5_desire = desire;\n Z5_center = start.add(dir, speed * 0.5f);\n Z5_maxdist = Z5_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 5:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z6_p21x = Float.sum(rightEnd.x, x1);\n Z6_p21y = Float.sum(rightEnd.y, y1);\n Z6_p41x = Float.sum(leftStart.x, x1);\n Z6_p41y = Float.sum(leftStart.y, y1);\n Z6_dotsection2 = -Float.sum(x1 * Z6_p21x, y1 * Z6_p21y);\n Z6_dotsection4 = -Float.sum(x1 * Z6_p41x, y1 * Z6_p41y);\n Z6_p21MagSquared = Float.sum(Z6_dotsection2, Float.sum(Z6_p21x * Z6_p21x, Z6_p21y * Z6_p21y));\n Z6_p41MagSquared = Float.sum(Z6_dotsection4, Float.sum(Z6_p41x * Z6_p41x, Z6_p41y * Z6_p41y));\n Z6_desire = desire;\n Z6_center = start.add(dir, speed * 0.5f);\n Z6_maxdist = Z6_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 6:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z7_p21x = Float.sum(rightEnd.x, x1);\n Z7_p21y = Float.sum(rightEnd.y, y1);\n Z7_p41x = Float.sum(leftStart.x, x1);\n Z7_p41y = Float.sum(leftStart.y, y1);\n Z7_dotsection2 = -Float.sum(x1 * Z7_p21x, y1 * Z7_p21y);\n Z7_dotsection4 = -Float.sum(x1 * Z7_p41x, y1 * Z7_p41y);\n Z7_p21MagSquared = Float.sum(Z7_dotsection2, Float.sum(Z7_p21x * Z7_p21x, Z7_p21y * Z7_p21y));\n Z7_p41MagSquared = Float.sum(Z7_dotsection4, Float.sum(Z7_p41x * Z7_p41x, Z7_p41y * Z7_p41y));\n Z7_desire = desire;\n Z7_center = start.add(dir, speed * 0.5f);\n Z7_maxdist = Z7_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 7:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z8_p21x = Float.sum(rightEnd.x, x1);\n Z8_p21y = Float.sum(rightEnd.y, y1);\n Z8_p41x = Float.sum(leftStart.x, x1);\n Z8_p41y = Float.sum(leftStart.y, y1);\n Z8_dotsection2 = -Float.sum(x1 * Z8_p21x, y1 * Z8_p21y);\n Z8_dotsection4 = -Float.sum(x1 * Z8_p41x, y1 * Z8_p41y);\n Z8_p21MagSquared = Float.sum(Z8_dotsection2, Float.sum(Z8_p21x * Z8_p21x, Z8_p21y * Z8_p21y));\n Z8_p41MagSquared = Float.sum(Z8_dotsection4, Float.sum(Z8_p41x * Z8_p41x, Z8_p41y * Z8_p41y));\n Z8_desire = desire;\n Z8_center = start.add(dir, speed * 0.5f);\n Z8_maxdist = Z8_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 8:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z9_p21x = Float.sum(rightEnd.x, x1);\n Z9_p21y = Float.sum(rightEnd.y, y1);\n Z9_p41x = Float.sum(leftStart.x, x1);\n Z9_p41y = Float.sum(leftStart.y, y1);\n Z9_dotsection2 = -Float.sum(x1 * Z9_p21x, y1 * Z9_p21y);\n Z9_dotsection4 = -Float.sum(x1 * Z9_p41x, y1 * Z9_p41y);\n Z9_p21MagSquared = Float.sum(Z9_dotsection2, Float.sum(Z9_p21x * Z9_p21x, Z9_p21y * Z9_p21y));\n Z9_p41MagSquared = Float.sum(Z9_dotsection4, Float.sum(Z9_p41x * Z9_p41x, Z9_p41y * Z9_p41y));\n Z9_desire = desire;\n Z9_center = start.add(dir, speed * 0.5f);\n Z9_maxdist = Z9_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 9:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z10_p21x = Float.sum(rightEnd.x, x1);\n Z10_p21y = Float.sum(rightEnd.y, y1);\n Z10_p41x = Float.sum(leftStart.x, x1);\n Z10_p41y = Float.sum(leftStart.y, y1);\n Z10_dotsection2 = -Float.sum(x1 * Z10_p21x, y1 * Z10_p21y);\n Z10_dotsection4 = -Float.sum(x1 * Z10_p41x, y1 * Z10_p41y);\n Z10_p21MagSquared = Float.sum(Z10_dotsection2, Float.sum(Z10_p21x * Z10_p21x, Z10_p21y * Z10_p21y));\n Z10_p41MagSquared = Float.sum(Z10_dotsection4, Float.sum(Z10_p41x * Z10_p41x, Z10_p41y * Z10_p41y));\n Z10_desire = desire;\n Z10_center = start.add(dir, speed * 0.5f);\n Z10_maxdist = Z10_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 10:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z11_p21x = Float.sum(rightEnd.x, x1);\n Z11_p21y = Float.sum(rightEnd.y, y1);\n Z11_p41x = Float.sum(leftStart.x, x1);\n Z11_p41y = Float.sum(leftStart.y, y1);\n Z11_dotsection2 = -Float.sum(x1 * Z11_p21x, y1 * Z11_p21y);\n Z11_dotsection4 = -Float.sum(x1 * Z11_p41x, y1 * Z11_p41y);\n Z11_p21MagSquared = Float.sum(Z11_dotsection2, Float.sum(Z11_p21x * Z11_p21x, Z11_p21y * Z11_p21y));\n Z11_p41MagSquared = Float.sum(Z11_dotsection4, Float.sum(Z11_p41x * Z11_p41x, Z11_p41y * Z11_p41y));\n Z11_desire = desire;\n Z11_center = start.add(dir, speed * 0.5f);\n Z11_maxdist = Z11_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 11:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z12_p21x = Float.sum(rightEnd.x, x1);\n Z12_p21y = Float.sum(rightEnd.y, y1);\n Z12_p41x = Float.sum(leftStart.x, x1);\n Z12_p41y = Float.sum(leftStart.y, y1);\n Z12_dotsection2 = -Float.sum(x1 * Z12_p21x, y1 * Z12_p21y);\n Z12_dotsection4 = -Float.sum(x1 * Z12_p41x, y1 * Z12_p41y);\n Z12_p21MagSquared = Float.sum(Z12_dotsection2, Float.sum(Z12_p21x * Z12_p21x, Z12_p21y * Z12_p21y));\n Z12_p41MagSquared = Float.sum(Z12_dotsection4, Float.sum(Z12_p41x * Z12_p41x, Z12_p41y * Z12_p41y));\n Z12_desire = desire;\n Z12_center = start.add(dir, speed * 0.5f);\n Z12_maxdist = Z12_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 12:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z13_p21x = Float.sum(rightEnd.x, x1);\n Z13_p21y = Float.sum(rightEnd.y, y1);\n Z13_p41x = Float.sum(leftStart.x, x1);\n Z13_p41y = Float.sum(leftStart.y, y1);\n Z13_dotsection2 = -Float.sum(x1 * Z13_p21x, y1 * Z13_p21y);\n Z13_dotsection4 = -Float.sum(x1 * Z13_p41x, y1 * Z13_p41y);\n Z13_p21MagSquared = Float.sum(Z13_dotsection2, Float.sum(Z13_p21x * Z13_p21x, Z13_p21y * Z13_p21y));\n Z13_p41MagSquared = Float.sum(Z13_dotsection4, Float.sum(Z13_p41x * Z13_p41x, Z13_p41y * Z13_p41y));\n Z13_desire = desire;\n Z13_center = start.add(dir, speed * 0.5f);\n Z13_maxdist = Z13_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 13:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z14_p21x = Float.sum(rightEnd.x, x1);\n Z14_p21y = Float.sum(rightEnd.y, y1);\n Z14_p41x = Float.sum(leftStart.x, x1);\n Z14_p41y = Float.sum(leftStart.y, y1);\n Z14_dotsection2 = -Float.sum(x1 * Z14_p21x, y1 * Z14_p21y);\n Z14_dotsection4 = -Float.sum(x1 * Z14_p41x, y1 * Z14_p41y);\n Z14_p21MagSquared = Float.sum(Z14_dotsection2, Float.sum(Z14_p21x * Z14_p21x, Z14_p21y * Z14_p21y));\n Z14_p41MagSquared = Float.sum(Z14_dotsection4, Float.sum(Z14_p41x * Z14_p41x, Z14_p41y * Z14_p41y));\n Z14_desire = desire;\n Z14_center = start.add(dir, speed * 0.5f);\n Z14_maxdist = Z14_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 14:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z15_p21x = Float.sum(rightEnd.x, x1);\n Z15_p21y = Float.sum(rightEnd.y, y1);\n Z15_p41x = Float.sum(leftStart.x, x1);\n Z15_p41y = Float.sum(leftStart.y, y1);\n Z15_dotsection2 = -Float.sum(x1 * Z15_p21x, y1 * Z15_p21y);\n Z15_dotsection4 = -Float.sum(x1 * Z15_p41x, y1 * Z15_p41y);\n Z15_p21MagSquared = Float.sum(Z15_dotsection2, Float.sum(Z15_p21x * Z15_p21x, Z15_p21y * Z15_p21y));\n Z15_p41MagSquared = Float.sum(Z15_dotsection4, Float.sum(Z15_p41x * Z15_p41x, Z15_p41y * Z15_p41y));\n Z15_desire = desire;\n Z15_center = start.add(dir, speed * 0.5f);\n Z15_maxdist = Z15_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 15:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z16_p21x = Float.sum(rightEnd.x, x1);\n Z16_p21y = Float.sum(rightEnd.y, y1);\n Z16_p41x = Float.sum(leftStart.x, x1);\n Z16_p41y = Float.sum(leftStart.y, y1);\n Z16_dotsection2 = -Float.sum(x1 * Z16_p21x, y1 * Z16_p21y);\n Z16_dotsection4 = -Float.sum(x1 * Z16_p41x, y1 * Z16_p41y);\n Z16_p21MagSquared = Float.sum(Z16_dotsection2, Float.sum(Z16_p21x * Z16_p21x, Z16_p21y * Z16_p21y));\n Z16_p41MagSquared = Float.sum(Z16_dotsection4, Float.sum(Z16_p41x * Z16_p41x, Z16_p41y * Z16_p41y));\n Z16_desire = desire;\n Z16_center = start.add(dir, speed * 0.5f);\n Z16_maxdist = Z16_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 16:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z17_p21x = Float.sum(rightEnd.x, x1);\n Z17_p21y = Float.sum(rightEnd.y, y1);\n Z17_p41x = Float.sum(leftStart.x, x1);\n Z17_p41y = Float.sum(leftStart.y, y1);\n Z17_dotsection2 = -Float.sum(x1 * Z17_p21x, y1 * Z17_p21y);\n Z17_dotsection4 = -Float.sum(x1 * Z17_p41x, y1 * Z17_p41y);\n Z17_p21MagSquared = Float.sum(Z17_dotsection2, Float.sum(Z17_p21x * Z17_p21x, Z17_p21y * Z17_p21y));\n Z17_p41MagSquared = Float.sum(Z17_dotsection4, Float.sum(Z17_p41x * Z17_p41x, Z17_p41y * Z17_p41y));\n Z17_desire = desire;\n Z17_center = start.add(dir, speed * 0.5f);\n Z17_maxdist = Z17_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 17:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z18_p21x = Float.sum(rightEnd.x, x1);\n Z18_p21y = Float.sum(rightEnd.y, y1);\n Z18_p41x = Float.sum(leftStart.x, x1);\n Z18_p41y = Float.sum(leftStart.y, y1);\n Z18_dotsection2 = -Float.sum(x1 * Z18_p21x, y1 * Z18_p21y);\n Z18_dotsection4 = -Float.sum(x1 * Z18_p41x, y1 * Z18_p41y);\n Z18_p21MagSquared = Float.sum(Z18_dotsection2, Float.sum(Z18_p21x * Z18_p21x, Z18_p21y * Z18_p21y));\n Z18_p41MagSquared = Float.sum(Z18_dotsection4, Float.sum(Z18_p41x * Z18_p41x, Z18_p41y * Z18_p41y));\n Z18_desire = desire;\n Z18_center = start.add(dir, speed * 0.5f);\n Z18_maxdist = Z18_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 18:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z19_p21x = Float.sum(rightEnd.x, x1);\n Z19_p21y = Float.sum(rightEnd.y, y1);\n Z19_p41x = Float.sum(leftStart.x, x1);\n Z19_p41y = Float.sum(leftStart.y, y1);\n Z19_dotsection2 = -Float.sum(x1 * Z19_p21x, y1 * Z19_p21y);\n Z19_dotsection4 = -Float.sum(x1 * Z19_p41x, y1 * Z19_p41y);\n Z19_p21MagSquared = Float.sum(Z19_dotsection2, Float.sum(Z19_p21x * Z19_p21x, Z19_p21y * Z19_p21y));\n Z19_p41MagSquared = Float.sum(Z19_dotsection4, Float.sum(Z19_p41x * Z19_p41x, Z19_p41y * Z19_p41y));\n Z19_desire = desire;\n Z19_center = start.add(dir, speed * 0.5f);\n Z19_maxdist = Z19_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n case 19:\n left = dir.rotateLeftDegrees(90);\n leftStart = start.subtract(dir, avoidwidth).add(left, avoidwidth);\n leftEnd = end.add(dir, avoidwidth).add(left, avoidwidth);\n rightEnd = leftEnd.subtract(left, Float.sum(avoidwidth, avoidwidth));\n x1 = -leftEnd.x;\n y1 = -leftEnd.y;\n Z20_p21x = Float.sum(rightEnd.x, x1);\n Z20_p21y = Float.sum(rightEnd.y, y1);\n Z20_p41x = Float.sum(leftStart.x, x1);\n Z20_p41y = Float.sum(leftStart.y, y1);\n Z20_dotsection2 = -Float.sum(x1 * Z20_p21x, y1 * Z20_p21y);\n Z20_dotsection4 = -Float.sum(x1 * Z20_p41x, y1 * Z20_p41y);\n Z20_p21MagSquared = Float.sum(Z20_dotsection2, Float.sum(Z20_p21x * Z20_p21x, Z20_p21y * Z20_p21y));\n Z20_p41MagSquared = Float.sum(Z20_dotsection4, Float.sum(Z20_p41x * Z20_p41x, Z20_p41y * Z20_p41y));\n Z20_desire = desire;\n Z20_center = start.add(dir, speed * 0.5f);\n Z20_maxdist = Z20_center.distanceTo(leftStart);\n angledRectangleCount++;\n break;\n }\n }",
"public static void main(String[] args){\n\tRectangle[] RecArray = new Rectangle[10];\n\n\t/* Here are the 10 rectangles\n\tRecArray[0] x[0]\n\tRecArray[1] x[1]\n\tRecArray[2]\n\t....\n\tRecArray[9] */\n\n\n\t//initialize each rectangle with random width and random height\n\t//for (int i=0; i<10; i++)\n\t//RecArray[i] = new\n\t//Rectangle(Math.random()*100, Math.random()*100);\n\n\t//initialize each rectangle with the specified width and height\n\tRecArray[0] = new Rectangle (2,3);\n\tRecArray[1] = new Rectangle (12,33);\n\tRecArray[2] = new Rectangle (20,33);\n\tRecArray[3] = new Rectangle (52,38);\n\tRecArray[4] = new Rectangle (22,37);\n\tRecArray[5] = new Rectangle (223,387);\n\tRecArray[6] = new Rectangle (112,23);\n\tRecArray[7] = new Rectangle (78,78);\n\tRecArray[8] = new Rectangle (23,67);\n\tRecArray[9] = new Rectangle (12,89);\n\n\t//print the ten rectangles and their areas\n\tfor(int i =0; i<10; i++)\n\tSystem.out.println(\"Rectangle \"\n\t+ i + \" is \" + RecArray[i] + \" and its area is \"\n\t+ RecArray[i] .getArea());\n\n\n }",
"public void add(Shape shapes) {\n\t\tshapesList.add(shapes);\n\t}",
"@Override\n\tpublic void redo() {\n\t\tthis.list.add(shape);\n\n\t}",
"@Override\n public void setRectangle() {\n switch (direction){\n case 0:\n rectangle.setLocation((int)x+5,(int)y+8);\n break;\n case 2:\n rectangle.setLocation((int)x+5,(int)y+8);\n break;\n case 1:\n rectangle.setLocation((int)x+13,(int)y+8);\n break;\n case 3:\n rectangle.setLocation((int)x+2,(int)y+8);\n break;\n }\n\n }",
"public void addAsteroid() \n\t{\n\t\tgameObj.add(new Asteroid(getHeight(), getWidth()));\n\t\tSystem.out.println(\"Asteroid added\");\n\t\tnotifyObservers();\n\t}",
"public void addShape(final Shape theShape) {\n if (myWidth > 0) {\n final Drawing newDrawing = new Drawing(theShape, myColor, myWidth);\n if (myDrawingArray.isEmpty()) {\n firePropertyChange(ARRAY_STRING, null, NOT_EMPTY_STRING);\n }\n myDrawingArray.add(newDrawing);\n repaint();\n } \n }",
"public void drawRect(float[] rect) {\n\t\tparent.rect(rect[0], rect[1], rect[2], rect[3]);\n\t}",
"public void add_Range(Range range_to_add){\n this.range_vector.add(range_to_add);\n }",
"@Override\n public void onAdd() {\n onRemove();\n \n // Generate a list of renderable images\n MapChunk[] chunks = generateChunks(generate());\n \n // Ensure the list is valid\n if(chunks == null) {\n return;\n }\n \n // Move the textures onto Rectangle shapes\n int chunkWidth = getChunkWidth();\n int chunkHeight = getChunkHeight();\n \n int rows = getHeightInChunks();\n int cols = getWidthInChunks();\n \n // Init our storage\n mTextures = new Texture[ rows * cols ];\n mShapes = new RectangleShape[ rows * cols ];\n \n // Iterate the whole map in chunks\n for(int x = 0; x < cols; x++) {\n for(int y = 0; y < rows; y++) {\n \n // Get the chunk for this position\n MapChunk thisChunk = chunks[ (y * cols) + x ];\n \n if(thisChunk == null) {\n // Something went wrong. Undo.\n onRemove();\n return;\n }\n \n // Convert our image into a texture\n Texture t = new Texture();\n if(t == null || !t.loadFromImage(thisChunk.image)) {\n onRemove();\n return;\n }\n \n // Store the texture for removal later on\n mTextures[ (y * cols) + x ] = t;\n \n // Create a rectangle shape\n RectangleShape r = new RectangleShape( chunkWidth, chunkHeight );\n \n // Apply some settings\n r.setTexture(t);\n r.setPosition( x * chunkWidth, y * chunkHeight );\n \n // Add this shape to the renderer\n if(mRenderer.add(r) < 0) {\n onRemove();\n return;\n }\n \n // Store the shape\n mShapes[ (y * cols) + x ] = r;\n \n }\n }\n \n }",
"void setBounds(Rectangle rectangle);",
"@Override\n public void redo() {\n shapeList.add((newShape));\n }",
"private void addRow() {\n\t\t\n\t\tArrayList<Invader> lastRow = enemyArray.get(enemyArray.size() - 1);\n\t\tArrayList<Invader> newRow = new ArrayList<Invader>();\n\t\t\t\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tnewRow.add(new Invader(\n\t\t\t\t\tlastRow.get(i).getX(),\n\t\t\t\t\tlastRow.get(i).getY() + 40,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\tPLAYER_WIDTH,\n\t\t\t\t\t2));\n\t\t}\n\t\t\n\t\tenemyArray.add(newRow);\n\t}",
"private void addGraphicObject(GraphicObject g_obj, int x, int y) {\n\t\tg_obj.setFillColor(this.currentFillColor);\n g_obj.setStroke(this.currentStrokeColor, this.currentStrokeSize.getValue());\n\n\t\tthis.canvas.add(g_obj, x, y);\n\t}",
"void add(Shape aShape);",
"public void addAsteroid() \n\t{\n\t\tgameObj[0].add(new Asteroid());\n\t\tSystem.out.println(\"Asteroid added\");\n\t}",
"void add(Polygon3 polygon)\n\t\t{\n\t\t\tPolygon3[] shapes2 = new Polygon3[shapes.length+1];\n\t\t\tfor(int i=0; i<shapes.length; i++)\n\t\t\t{\n\t\t\t\tshapes2[i] = shapes[i];\n\t\t\t}\n\t\t\tshapes2[shapes.length] = polygon;\n\t\t\tshapes = new Polygon3[shapes2.length];\n\t\t\tfor(int i=0; i<shapes2.length; i++)\n\t\t\t{\n\t\t\t shapes[i] = shapes2[i];\n\t\t\t}\n\t\t\t\n\t\t}",
"public void addRound(ArrayList<Move> round) {\r\n\t\tfor (Move move : round) {\r\n\t\t\tadd(move);\r\n\t\t}\r\n\r\n\t\tint lastIndex = offsets.size() - 1;\r\n\t\toffsets.add(round.size() + offsets.get(lastIndex)); // accumulate the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// index\r\n\t}",
"public void addElts(Bars bar){\r\n BarsList.add(bar);\r\n }",
"private void drawRectangle(GraphicsContext gc, double x, double y) {\r\n GraphicsContext gc2 = myCanvas.getGraphicsContext2D();\r\n gc2.setFill(randomColor());\r\n gc2.fillRect(x - 20, y - 20, 40, 40);\r\n }",
"public void drawRect(float[] rect) {\n\t\trect(rect[0], rect[1], rect[2], rect[3]);\n\t}",
"private void addAnotherElement() {\n\t\t SnakeSquare ss = sSquare.get(sSquare.size() - 1);\n\t\t double velX = ss.getDX();\n\t\t double velY = ss.getDY();\n\t\t \n\t\t double x = ss.getX();\n\t\t double y = ss.getY();\n\t\t double len = ss.getLength();\n\t\t Color c = ss.getColor();\n//\t\t double snakeSize = 10.0f;\n\t\t \n\t\t if(velX == 0 && velY == 0){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}\n\t\t if(velX == 0 && velY == 1){sSquare.add(new SnakeSquare(x, y - snakeSize, c, len));}//move down;\n\t\t if(velX == 0 && velY == -1){sSquare.add(new SnakeSquare(x, y + snakeSize, c, len));}//move up;\n\t\t if(velX == 1 && velY == 0){sSquare.add(new SnakeSquare(x+ snakeSize, y, c, len));}//move right;\n\t\t if(velX == -1 && velY == 0){sSquare.add(new SnakeSquare(x - snakeSize, y, c, len));}// move left;\n\t\t\n\t}",
"public static Rectangle toRectangle(int[] rect) {\r\n\t\tRectangle result = new Rectangle(rect[0], rect[1], rect[2], rect[3]);\r\n\t\treturn result;\r\n\t}",
"Rectangle(double newWidth, double newHeight){\n height = newHeight;\n width = newWidth;\n }",
"public void addSquare(Square square) {\n\t\t\n\t}",
"Rectangle getRect(){\n \treturn new Rectangle(x,y,70,25);\n }",
"public void addShape(TShape aShape){\r\n // fShapes.remove(aShape); // just in case it was already there\r\n\r\n /*unfortunately we need to have a front to back screen order, properties at the back\r\n (drawn first), then individuals, finally relations between individuals*/\r\n\r\n /* if (aShape instanceof TLine)\r\n fShapes.add(aShape); // add at the end\r\n else if (aShape instanceof TProperty)\r\n fShapes.add(0,aShape); // add at the beginning\r\n else {\r\n int insertIndex=0;\r\n if (fShapes.size() > 0) {\r\n Iterator iter = fShapes.iterator();\r\n\r\n while (iter.hasNext()) {\r\n if (! ((TShape) iter.next()instanceof TProperty))\r\n break; //put it after rectangles\r\n else\r\n insertIndex++;\r\n }\r\n }\r\n fShapes.add(insertIndex,aShape);\r\n }*/\r\n\r\n\r\n // aShape.setSemantics(fSemantics);\r\n\r\n aShape.addChangeListener(this); // and we'll listen for any of its changes, such as being selected\r\n\r\n addShapeToList(aShape,fShapes);\r\n\r\n if (aShape instanceof TInterpretationBoard)\r\n ((TInterpretationBoard)aShape).setSemantics(fSemantics);\r\n\r\n\r\n fPalette.check(); // some of the names may need updating\r\n\r\n repaint();\r\n }",
"@Override\n public void rect(double x, double y, double width, double height) {\n graphicsEnvironmentImpl.rect(canvas, x, y, width, height);\n }",
"public void fillRectangle(int x, int y, int width, int height);",
"public void addToBoard(Location location, State state)\n {\n for (Node node : gridPaneBoard.getChildren())\n if (GridPane.getColumnIndex(node) == location.getX() && GridPane.getRowIndex(node) == location.getY())\n {\n Rectangle rectangle = ((Rectangle) node);\n switch(state)\n {\n case HEAD:\n rectangle.setFill(Color.DARKGREEN);\n break;\n case TAIL:\n rectangle.setFill(Color.GREEN);\n score++;\n break;\n case FOOD:\n rectangle.setFill(Color.RED);\n break;\n }\n labelScore.setText(\"Wynik: \" + score);\n }\n }",
"public void addPoints(List<Point2D> points);",
"private void drawRect(double x0, double y0, double width, double height, int lWidth, Color color){\n \n lWidth = Math.min(lWidth, max_width);\n \n x0 += 0.5 * lWidth;\n y0 += 0.5 * lWidth;\n width -= lWidth;\n height -= lWidth;\n \n x0 /= this.width;\n y0 /= this.height;\n width /= this.width;\n height /= this.height;\n \n x0 -= 0.5;\n y0 -= 0.5;\n \n glLineWidth(lWidth);\n \n glBegin(GL_LINES);\n glEnable(GL_LINE_WIDTH);\n glColor3f(color.getRed(), color.getGreen(), color.getBlue());\n \n //left side\n glVertex3d(x0, y0 + height, 0);\n glVertex3d(x0, y0, 0);\n \n //Right side\n glVertex3d(x0 + width, y0, 0);\n glVertex3d(x0 + width, y0 + height, 0);\n \n x0 -= (double)lWidth / (double)this.width / 2d;\n width += (double)lWidth / (double)this.width;\n \n //bottom\n glVertex3d(x0, y0, 0);\n glVertex3d(x0 + width, y0, 0);\n \n //top\n glVertex3d(x0, y0 + height, 0);\n glVertex3d(x0 + width, y0 + height, 0);\n \n \n glEnd();\n }",
"public void addPoints(int i, List<Point2D> points);",
"public int[] addGraphics(Graphic[] graphics)\n\t{\n\t\treturn getObject().addGraphics(graphics);\n\t}",
"private static void addShaped()\n {}",
"public void add(List<IShape> component)\n\t{\n\t\tfilterShapes(component);\n\t\tfilterGroups(component);\n\t}",
"public void drawRectangle(Rectangle rectangle) {\n implementation.devDrawRectangle(\n (int) rectangle.getMinX(),\n (int) rectangle.getMinY(),\n (int) rectangle.getWidth(),\n (int) rectangle.getHeight(),\n rectangle.getColor()\n );\n }",
"public static void drawRectangle(double width, double height) {\n gl.glPushMatrix();\n gl.glScaled(width, height, 1);\n gl.glBegin(GL.GL_TRIANGLE_FAN);\n gl.glVertex3d(-0.5, -0.5, 0);\n gl.glVertex3d(0.5, -0.5, 0);\n gl.glVertex3d(0.5, 0.5, 0);\n gl.glVertex3d(-0.5, 0.5, 0);\n gl.glEnd();\n gl.glPopMatrix();\n }",
"private static void storeRectangle(Roi roi, MetadataStore store,\n int roiNum, int shape)\n {\n Rectangle bounds = roi.getBounds();\n store.setRectangleX(new Double(bounds.x), roiNum, shape);\n store.setRectangleY(new Double(bounds.y), roiNum, shape);\n store.setRectangleWidth(new Double(bounds.width), roiNum, shape);\n store.setRectangleHeight(new Double(bounds.height), roiNum, shape);\n }",
"public void add(SceneShape s)\n {\n shapes.add(s);\n repaint();\n }",
"public Rectangle() {\n\t\tthis.width = 1;\n\t\tthis.hight = 1;\n\t\tcounter++;\n\t}",
"public void drawRect(int x, int y, int width, int height, int color);",
"private void addWalls() {\n wallList.add(new RectF(0, 0, wallSize, screenHeight / 2 - doorSize));\n wallList.add(new RectF(0, screenHeight / 2 + doorSize, wallSize, screenHeight));\n wallList.add(new RectF(0, 0, screenWidth / 2 - doorSize, wallSize));\n wallList.add(new RectF(screenWidth / 2 + doorSize, 0, screenWidth, wallSize));\n wallList.add(new RectF(screenWidth - wallSize, 0, screenWidth, screenHeight / 2 - doorSize));\n wallList.add(new RectF(screenWidth - wallSize, screenHeight / 2 + doorSize, screenWidth, screenHeight));\n wallList.add(new RectF(0, screenHeight - wallSize, screenWidth / 2 - doorSize, screenHeight));\n wallList.add(new RectF(screenWidth / 2 + doorSize, screenHeight - wallSize, screenWidth, screenHeight));\n }",
"public void addGraphicObject(GraphicObject obj)\n {\n graphicObjects.addLast(obj);\n }",
"@Test\r\n\tpublic void testAddNewShapeToScreen() {\r\n\r\n\t\t// Create a shape square\r\n\t\tPoint origin = new Point(5,5); \t // Set origin for square\r\n\t\tList<Double> list = new ArrayList<Double>(); \t // Create a new list of parameters\r\n double side = 5.0; \t // Add side as parameter for shape square \r\n list.add(side); \t\t\t\t\t\t\t\t\t\t \t // Add to list\r\n\t\tShape shape = ShapeFactory.createShape(0, origin, list); \t // 0 for creation of square\r\n\t\t\r\n\t\tscreen.shapesOnScreen.add(shape);\t\t\t\t\t\t \t // Add shape to screen\r\n\t\tassertEquals( 1, screen.shapesOnScreen.size());\t\t\t \t // Check if size of list is 1 after addition of shape\r\n\t}",
"Rectangle(int l, int w)\n {\n\tlength = l;\n\twidth = w;\n }",
"@Override\n public COSBase getCOSObject()\n {\n return rectArray;\n }",
"public void drawRectangle(int RGB, int startX, int startY, int width,\n\t\t\tint height) {\n\n\t\tfor (int x = startX; x < (startX + width + 1); x++) {\n\t\t\tdrawPixel(RGB, x, startY);\n\t\t\tdrawPixel(RGB, x, startY + height);\n\t\t}\n\t\tfor (int y = startY; y < (startY + height + 1); y++) {\n\t\t\tdrawPixel(RGB, startX, y);\n\t\t\tdrawPixel(RGB, startX + width, y);\n\t\t}\n\t\t\n\t}",
"private static Rect createRect(String[] input) {\r\n int px = Integer.parseInt(input[1]);\r\n int py = Integer.parseInt(input[2]);\r\n int vx = Integer.parseInt(input[3]);\r\n int vy = Integer.parseInt(input[4]);\r\n boolean isFilled = Boolean.parseBoolean(input[5]);\r\n int width = Integer.parseInt(input[6]);\r\n int height = Integer.parseInt(input[7]);\r\n float r = (float) Integer.parseInt(input[8]) / 255.0f;\r\n float g = (float) Integer.parseInt(input[9]) / 255.0f;\r\n float b = (float) Integer.parseInt(input[10]) / 255.0f;\r\n int insertionTime = Integer.parseInt(input[11]);\r\n boolean isFlashing = Boolean.parseBoolean(input[12]);\r\n float r1 = (float) Integer.parseInt(input[13]) / 255.0f;\r\n float g1 = (float) Integer.parseInt(input[14]) / 255.0f;\r\n float b1 = (float) Integer.parseInt(input[15]) / 255.0f;\r\n return new Rect(insertionTime, px, py, vx, vy, width, height, new Color(r, g, b, 1), isFilled,\r\n isFlashing, new Color(r1, g1, b1, 1));\r\n }",
"public void drawRectangle(int x, int y, int width, int height, Color color) {\n implementation.devDrawRectangle(x, y, width, height, color);\n }",
"public MyRectangle[] getFeature() {\n return rectangles;\n }",
"private void createRectangle() {\n int x = 0;\n int y = 270;\n int x1 = 230;\n for(int index = 0; index < 10; index++){\n rec[index] = new JLabel();\n doublyrec[index] = new JLabel();\n circularrec[index] = new JLabel();\n arrowLabel[index] = new JLabel();\n doublyarrowLabel[index] = new JLabel();\n circulararrowLabel[index] = new JLabel();\n rec[index].setBackground(new java.awt.Color(0, 0, 255));\n rec[index].setLocation(x,y);\n rec[index].setVisible(false);\n rec[index].setSize(80,40);\n rec[index].setOpaque(true);\n rec[index].setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n singlyPracticalPanel.add(rec[index]);\n doublyrec[index].setBackground(new java.awt.Color(0, 0, 255));\n doublyrec[index].setLocation(x,y);\n doublyrec[index].setVisible(false);\n doublyrec[index].setSize(80,40);\n doublyrec[index].setOpaque(true);\n doublyrec[index].setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n doublyPracticalPanel.add(doublyrec[index]);\n circularrec[index].setBackground(new java.awt.Color(0, 0, 255));\n circularrec[index].setLocation(x,y);\n circularrec[index].setVisible(false);\n circularrec[index].setSize(80,40);\n circularrec[index].setOpaque(true);\n circularrec[index].setFont(new java.awt.Font(\"Tahoma\", 1, 14));\n circularPracticalPanel.add(circularrec[index]);\n y -= 20;\n arrowLabel[index].setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/DataStructure/22312.png\")));\n singlyPracticalPanel.add(arrowLabel[index]);\n arrowLabel[index].setBounds(x1, 210, 20, 20);\n arrowLabel[index].setVisible(false);\n \n doublyarrowLabel[index].setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/DataStructure/doubly.png\")));\n doublyPracticalPanel.add(doublyarrowLabel[index]);\n doublyarrowLabel[index].setBounds(x1, 210, 20, 20);\n doublyarrowLabel[index].setVisible(false);\n \n circulararrowLabel[index].setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/DataStructure/22312.png\")));\n circularPracticalPanel.add(circulararrowLabel[index]);\n circulararrowLabel[index].setBounds(x1, 210, 20, 20);\n circulararrowLabel[index].setVisible(false);\n \n x1 += 100;\n }\n }",
"public void strokeRectangle(RectangleShape rectangle);",
"public static int[] addRectangleBorder(final List<DoubleList> output, final double x, final double y, final double width, final double height, final Border border,\n final double thickness) {\n if (border == Border.ALL) {\n return VboUtil.addRectangleBorder(output, x, y, width, height, thickness);\n }\n final IntList modes = new ArrayIntList(8);\n // calculate the metrics\n final double xLeft = x - (width * 0.5);\n final double xRight = x + (width * 0.5);\n final double yBottom = y - (height * 0.5);\n final double yTop = y + (height * 0.5);\n // verts\n final double verts[][] = new double[4][];\n // top\n if (border.isTop()) {\n verts[0] = new double[]{xLeft, yTop};\n verts[1] = new double[]{xLeft, yTop + thickness};\n verts[2] = new double[]{xRight, yTop + thickness};\n verts[3] = new double[]{xRight, yTop};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // bottom\n if (border.isBottom()) {\n verts[0] = new double[]{xLeft, yBottom - thickness};\n verts[1] = new double[]{xLeft, yBottom};\n verts[2] = new double[]{xRight, yBottom};\n verts[3] = new double[]{xRight, yBottom - thickness};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // left\n if (border.isLeft()) {\n verts[0] = new double[]{xLeft - thickness, yBottom};\n verts[1] = new double[]{xLeft - thickness, yTop};\n verts[2] = new double[]{xLeft, yTop};\n verts[3] = new double[]{xLeft, yBottom};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // right\n if (border.isRight()) {\n verts[0] = new double[]{xRight, yBottom};\n verts[1] = new double[]{xRight, yTop};\n verts[2] = new double[]{xRight + thickness, yTop};\n verts[3] = new double[]{xRight + thickness, yBottom};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // upper left corner\n if (border.isLeft() && border.isTop()) {\n verts[0] = new double[]{xLeft - thickness, yTop};\n verts[1] = new double[]{xLeft - thickness, yTop + thickness};\n verts[2] = new double[]{xLeft, yTop + thickness};\n verts[3] = new double[]{xLeft, yTop};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // upper right corner\n if (border.isRight() && border.isTop()) {\n verts[0] = new double[]{xRight, yTop};\n verts[1] = new double[]{xRight, yTop + thickness};\n verts[2] = new double[]{xRight + thickness, yTop + thickness};\n verts[3] = new double[]{xRight + thickness, yTop};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // lower left corner\n if (border.isLeft() && border.isBottom()) {\n verts[0] = new double[]{xLeft - thickness, yBottom - thickness};\n verts[1] = new double[]{xLeft - thickness, yBottom};\n verts[2] = new double[]{xLeft, yBottom};\n verts[3] = new double[]{xLeft, yBottom - thickness};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n // lower right corner\n if (border.isRight() && border.isBottom()) {\n verts[0] = new double[]{xRight, yBottom - thickness};\n verts[1] = new double[]{xRight, yBottom};\n verts[2] = new double[]{xRight + thickness, yBottom};\n verts[3] = new double[]{xRight + thickness, yBottom - thickness};\n final ArrayDoubleList vertices = new ArrayDoubleList(12);\n output.add(vertices);\n modes.add(addPolygon(vertices, verts));\n }\n return modes.toArray();\n }",
"public void addLine(Line l) {\n\t\tlines.add(l);\n\t\t// vypocitaj bounding rect\n\t\tfloat x, y, w, h;\n\t\tif (l.getX1() < l.getX2()) {\n\t\t\tx = l.getX1();\n\t\t\tw = l.getX2() - l.getX1();\n\t\t} else {\n\t\t\tx = l.getX2();\n\t\t\tw = l.getX1() - l.getX2();\n\t\t}\n\t\tif (l.getY1() < l.getY2()) {\n\t\t\ty = l.getY1();\n\t\t\th = l.getY2() - l.getY1();\n\t\t} else {\n\t\t\ty = l.getY2();\n\t\t\th = l.getY1() - l.getY2();\n\t\t}\n\t\tif (boundingRect==null) {\n\t\t\tboundingRect = new Rectangle(x, y, w, h);\n\t\t} else {\n\t\t\tif (x < boundingRect.getX()) {\n\t\t\t\tboundingRect.setX(x);\n\t\t\t}\n\t\t\tif (y < boundingRect.getY()) {\n\t\t\t\tboundingRect.setY(y);\n\t\t\t}\n\t\t\tif (w > boundingRect.getW()) {\n\t\t\t\tboundingRect.setW(w);\n\t\t\t}\n\t\t\tif (h > boundingRect.getH()) {\n\t\t\t\tboundingRect.setH(h);\n\t\t\t}\n\t\t}\n\t}",
"public void drawRect(int x, int y, int width, int height, int color){\n hline(x, x + width - 1, y, color);\n hline(x, x + width - 1, y + height - 1, color);\n vline(y, y + height - 1, x, color);\n vline(y, y + height - 1, x + width - 1, color);\n }"
]
| [
"0.8027243",
"0.7163968",
"0.7138014",
"0.7082203",
"0.6753686",
"0.6696214",
"0.6534529",
"0.6496794",
"0.6480945",
"0.64032036",
"0.63732624",
"0.6350268",
"0.6328984",
"0.6098959",
"0.5984109",
"0.5944061",
"0.5943041",
"0.58983195",
"0.5882943",
"0.5813354",
"0.57919437",
"0.57782197",
"0.5749309",
"0.5698144",
"0.5696445",
"0.56851053",
"0.56825197",
"0.56364644",
"0.5626483",
"0.56161773",
"0.56010294",
"0.5596844",
"0.55937463",
"0.5591128",
"0.5570754",
"0.5549602",
"0.55452836",
"0.5539787",
"0.5529806",
"0.5505825",
"0.5487759",
"0.5481173",
"0.54771036",
"0.54751354",
"0.5467862",
"0.54513997",
"0.54459745",
"0.5439466",
"0.5433774",
"0.5431492",
"0.5409826",
"0.5408091",
"0.5373626",
"0.53656274",
"0.5362299",
"0.5361206",
"0.53570676",
"0.53551894",
"0.5349953",
"0.53472996",
"0.53446835",
"0.53322804",
"0.5329023",
"0.5326556",
"0.53228813",
"0.53097653",
"0.529362",
"0.5275242",
"0.5258257",
"0.52565926",
"0.5254893",
"0.5253609",
"0.52530193",
"0.5249067",
"0.5239798",
"0.5239515",
"0.52353823",
"0.5231489",
"0.5227695",
"0.5218111",
"0.520515",
"0.5204754",
"0.52014637",
"0.5198304",
"0.51799154",
"0.51750535",
"0.5174031",
"0.51682407",
"0.5166682",
"0.5160079",
"0.51582783",
"0.5157959",
"0.515221",
"0.5145588",
"0.5144746",
"0.51393706",
"0.51359415",
"0.5130663",
"0.51284003",
"0.5118163"
]
| 0.8142709 | 0 |
prints all shapes of the arrayLists | public void printAll(){
for (Triangle triangle : triangles) {
System.out.println(triangle.toString());
}
for (Circle circle : circles) {
System.out.println(circle.toString());
}
for (Rectangle rectangle : rectangles) {
System.out.println(rectangle.toString());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void printShapes(List<Shape> array, String label) {\n\n System.out.println(label + \"\\n\");\n // Iterate array of polygons using a foreach loop\n for (Shape shape : array) {\n // Use getClass to print the class of the Object and then print the Object (calls the toString)\n System.out.printf(\"%s: %s\\n\", shape.getClass(), shape);\n }\n System.out.println();\n }",
"public void printArrays() {\n for (ArraySymbol as: arrays) {\n System.out.println(as);\n }\n }",
"private void displayArrays(ArrayList list){}",
"void show(double[][][] arr,String name){\n \n System.out.println(name+\"Array\");\n Vector Size = new Vector(arr.length,arr[0].length,arr[0][0].length);\n \n for(int i=0;i<Size.x;i++){\n \n for(int j=0;j<Size.y;j++){\n \n for(int k=0;k<Size.z;k++){\n \n System.out.print(arr[i][j][k]+\" \");\n }\n System.out.println();\n }\n System.out.println();\n }\n\n}",
"public static void printArrays() {\r\n\t\tIterator it = arrayMap.entrySet().iterator();\r\n\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry<Integer, ArrayList<Integer>> pair = (Map.Entry<Integer, ArrayList<Integer>>) it\r\n\t\t\t\t\t.next();\r\n\t\t\tArrayList<Integer> list = pair.getValue();\r\n\t\t\tIterator liter = list.iterator();\r\n\t\t\twhile (liter.hasNext()) {\r\n\t\t\t\tSystem.out.print(liter.next() + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"public void print() {\n\t\tfor(int i = 0; i < size; i++) {\n\t\t\tfor(int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(m[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\n\t}",
"public void display(){\n \tfor(int i=0;i<size;i++){\n \tSystem.out.print(elements[i]+\" \");\n \t}\n\t}",
"public void printArray(){\n\n\t\tfor (int i=0;i<1;i++){\n\n\t\t\tfor (int j=0;j<population[i].getLength();j++){\n\n\t\t\t\tSystem.out.println(\"X\" + j + \": \" + population[i].getX(j) + \" \" + \"Y\"+ j + \": \" + population[i].getY(j));\n\t\t\t\tSystem.out.println();\n\n\t\t\t}//end j\n\n\t\t\tSystem.out.println(\"The duplicate count is: \" + population[i].duplicateCheck());\n\t\t\tSystem.out.println(\"The fitness is \" + population[i].computeFitness());\n\t\t\t//population[i].computeFitness();\n\n\t\t}//end i\n\n\t}",
"private void printMatrix(ArrayList<ArrayList<String>> x) {\n for (ArrayList<String> array : x) {\n String line = \"\";\n for (String word: array) {\n line += word + \" \";\n }\n System.out.println(line);\n }\n System.out.println(\"\\n\");\n }",
"public void display() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(a[i] + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"public void print() {\n for (int i = 0; i < size; i++)\n System.out.print(elements[i] + \" \");\n System.out.println();\n }",
"@Override\r\n\tpublic void visit(Square shapes) {\n\t\tSystem.out.println(shapes.getName() + \"네모네모 움직영!\");\r\n\t}",
"public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}",
"public void print () \r\n\t{\r\n\t\tfor (int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\tif (index % 5 == 0) // print 5 columns\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\tSystem.out.print(array[index] + \"\\t\");\t// print next element\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"public void describeEqualSides() {\n for (Shape shape : shapes) {\n if ((shape instanceof Triangle && ((Triangle) shape).isEquilateral())\n || shape instanceof Rectangle && ((Rectangle) shape).isSquare())\n System.out.println(shape.toString());\n }\n }",
"public void print() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }",
"public static void showD(ArrayList<ArrayList<String>> data){\n\t\tfor(int i = 0; i<data.get(0).size(); i++){\r\n\t\t\tfor(int j = 0; j<data.size(); j++){\r\n\t\t\t\tSystem.out.print(data.get(j).get(i));\r\n\t\t\t\tSystem.out.print(\"\\t\");\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"\\n\");\r\n\t\t}\r\n\t\treturn;\r\n\t}",
"public void print() {\n\t\tcounter++;\n\t\tSystem.out.print(counter + \" \");\n\t\tfor (int i = 0; i < size; i++) {\n\t\t for (int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(squares[j][i].getValue());\n\t\t }\n\t\t System.out.print(\"//\");\n\t\t}\n\t\tSystem.out.println();\n }",
"public void printLayout() {\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 4; j++) {\n System.out.print(matrix[i][j] + \" \");\n\n }\n System.out.println(\"\");\n }\n }",
"private void showArray(ArrayList<String[]> arr) {\n for(String[] row: arr){\n for(String x: row){\n System.out.print(x + \"\\t\\t\");\n }\n System.out.println();\n } \n System.out.println(\"------------------------------------\");\n }",
"public void printAllMonomials() {\n\t\t//TODO total is just printing number of dimns...\n\t\tSystem.out.println(\"Printing monomials in dual A\" + N + \" of dimension at most \" + getDimension() + \"; total: \" + allMonomials.size() + \"\\n\");\n\t\tprintMonomials(allMonomials);\n\t}",
"public void printAll(){\nfor(int i=0;i<size ;i++){\n System.out.println(\"a[%d]\"+data[i]); \n}\n System.out.println(\"size\"+size); \n}",
"public void print(){\n\t\tif(isEmpty()) System.out.println(\"[vazio]\");\n\t\telse{\n\t\t\tSystem.out.print(\"A = [\" + A[0]);\n\t\t\tfor(int i=1; i<size; i++)\n\t\t\t\tSystem.out.print(\", \"+ A[i]);\n\t\t\tSystem.out.println(\"]\");\n\t\t}\n\t}",
"public void printDimensions() {\n System.out.println(\"[rows = \" + numRows() + \" , cols = \" + numCols() + \" ]\");\n }",
"public static void printMatrix(ArrayList<ArrayList<Integer>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++){\r\n\t\t\tchar index = (char) ('A' + i);\r\n\t\t\tSystem.out.print(index);\r\n\t\t\tSystem.out.print(\":\\t \"); \r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++){\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j));\r\n\t\t\t\tif (j != matrix.get(i).size() - 1) System.out.print(\"\\t|\");\r\n\t\t\t\telse System.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"static void showGraph(ArrayList<ArrayList<Integer>> graph) {\n for(int i=0;i< graph.size(); i++ ){\n System.out.print(\"Vertex : \" + i + \" : \");\n for(int j = 0; j < graph.get(i).size(); j++) {\n System.out.print(\" -> \"+ graph.get(i).get(j));\n }\n }\n }",
"public void printObjectList(){\n\t\tfor (int i = 0; i < gameObjectsList.size(); i++){\n\t\t\tSystem.out.println(i + \", \" + gameObjectsList.get(i).getCategory() + \" : Type:\" + gameObjectsList.get(i).getObjecttype() + \" X:\" + gameObjectsList.get(i).getX() + \" Y:\" + gameObjectsList.get(i).getY());\n\t\t}\n\t}",
"private static void printArray(ArrayList<Integer> list) {\n for (int i : list) {\n System.out.println(i * 3);\n }\n\n }",
"public void print() {\n\t\tfor (int count = 0; count < adjacencyList.length; count++) {\n\t\t\tLinkedList<Integer> edges = adjacencyList[count];\n\t\t\tSystem.out.println(\"Adjacency list for \" + count);\n\n\t\t\tSystem.out.print(\"head\");\n\t\t\tfor (Integer edge : edges) {\n\t\t\t\tSystem.out.print(\" -> \" + edge);\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void print() {\n\t\tint l = 0;\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tSystem.out.print(vertexList[v].id);\n\t\t\tfor (Neighbor nbr = vertexList[v].adjList; nbr != null; nbr = nbr.next) {\n\t\t\t\tSystem.out.print(\" -> \" + vertexList[nbr.vertexNumber].id + \"(\"\n\t\t\t\t\t\t+ nbr.weight + \")\");\n\t\t\t\tl++;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\");\n\t\t}\n\t\tSystem.out.println(\"Number of edges = \" + l / 2);\n\t}",
"public void test(){\n\t\tfor(int i =0; i< this.position.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tfor(int p = 0 ; p<this.position.length;p++){\n\t\t\t\tSystem.out.print(this.position[i][p]);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" \");\n\t\tfor(int i =0; i< this.position.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tfor(int p = 0 ; p<this.position.length;p++){\n\t\t\t\tSystem.out.print(this.Ari[i][p]);\n\t\t\t}\n\t\t}\n\t}",
"public void print_stacks(ArrayList<ArrayList<Stack<Integer>>> stacks) {\n\t\tfor (int k=0; k<size*size; k++) {\n\t\t\tSystem.out.println(\"----------------------------------------\\n\\tRow \"+k+\"'s Possible Values\\n----------------------------------------\");\n\t\t\tfor (int l=0; l<size*size; l++) {\n\t\t\t\tSystem.out.print(\"col \"+l+\" |\");\n\t\t\t\tif (!stacks.get(k).get(l).empty()) System.out.println(stacks.get(k).get(l));\n\t\t\t\telse System.out.println();\t\n\t\t\t}\n\t\t}\n\t}",
"public void printLaptops(){\n\t\tSystem.out.println(\"Root is: \"+vertices.get(root));\n\t\tSystem.out.println(\"Edges: \");\n\t\tfor(int i=0;i<parent.length;i++){\n\t\t\tif(parent[i] != -1){\n\t\t\t\tSystem.out.print(\"(\"+vertices.get(parent[i])+\", \"+\n\t\t\tvertices.get(i)+\") \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t\t}",
"public void print()\n\t{\n\t\tStringBuffer print = new StringBuffer();\n\t\tif (arraySize != 0)\n\t\t{\n\t\t\tfor (int index = 0; index < arraySize - 1; index++) \n\t\t\t{ \n\t\t\t\tprint.append(array[index] + \", \");\n\t\t\t}\n\t\t\tprint.append(array[arraySize - 1]);\n\t\t\tSystem.out.println(print.toString());\n\t\t}\n\t}",
"public void displayAsList()\n\t{\n\t\tSystem.out.println(\"Printing all vertices\");\n\t\tvertices.show();\n\t}",
"private static <T extends Shape> void showShapeInfo(T shape){\r\n\t\t// Implement method and handle exception if there's not shape created\r\n\t\tif(shapes[0] != null){\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(shapes[0].toString());\r\n\t\t}\r\n\t\telse{\r\n\t\t\ttry {\r\n\t\t\t\tthrow new IndexOutOfBoundsException(\"No shape has been created yet.\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void printEdges(){\n System.out.print(\" |\");\n for(int i=0;i<size;i++)\n System.out.print(\" \"+i+\" \");\n System.out.print(\"\\n\");\n for(int i=0;i<size+1;i++)\n System.out.print(\"-------\");\n System.out.print(\"\\n\");\n for(int i=0;i<size;i++){\n System.out.print(\" \"+i+\" |\");\n for(int j=0;j<size;j++){\n System.out.print(\" \"+Matrix[i][j]+\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"public void print() {\r\n System.out.print(\"[id: <\" + this.id + \"> \");\r\n if (this.dimension > 0) {\r\n System.out.print(this.data[0]);\r\n }\r\n for (int i = 1; i < this.dimension * 2; i++) {\r\n System.out.print(\" \" + this.data[i]);\r\n }\r\n System.out.println(\"]\");\r\n }",
"private void printGrid(StateObservation stateObs) {\n\n ArrayList<Observation>[][] gameGrid = stateObs.getObservationGrid();\n System.out.println(\"rows \" + gameGrid.length + \" cols \" + gameGrid[0].length);\n\n System.out.println(\"------------------\");\n for (int i = 0; i < gameGrid[0].length; i++) { // cols\n for (int j = 0; j < gameGrid.length; j++) { // rows\n\n if (gameGrid[j][i].isEmpty()) {\n System.out.print(\". \");\n } else {\n for (Observation o : gameGrid[j][i]) {\n System.out.print(o.itype + \" \");\n }\n }\n }\n System.out.println();\n }\n System.out.println(\"------------------\");\n }",
"public String toString()\n {\n String contents = \"\";\n double totalArea = 0;\n \n contents = contents + \"\\nThere are \" + shapes.size() + \" shapes in the container.\\n\";\n \n for(int i = 0; i < shapes.size(); i++)\n {\n totalArea = totalArea + shapes.get(i).getArea();\n contents = contents + shapes.get(i).toString();\n }\n contents = contents + \"\\nand total area of shapes is \" + totalArea + \"\\n\";\n return contents;\n }",
"public static void printItems(ArrayList<Integer>[] items)\n\t{\n\t\tSystem.out.println(\"Starting Items:\");\n\t\tfor(int i = 0; i < items.length; i++)\n\t\t{\n\t\t\tSystem.out.print(i + \":\");\n\t\t\tfor(int j = 0; j < items[i].size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(items[i].get(j) + \", \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"static public void printTable(int list[][])\r\n\t{\r\n\t\tfor(int i = 0; i < h; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j < w; j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(list[i][j] + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t}",
"public void printInfoFoundPolygonsToConsole() {\n System.out.println(\"start sorting\");\n Collections.sort(foundPolygons, new Comparator<Polygon2D>() {\n public int compare(Polygon2D p1, Polygon2D p2) {\n return -Double.compare(p1.calculateArea(), p2.calculateArea());\n }\n });\n System.out.println(\"Number of found polygons: \" + foundPolygons.size());\n System.out.println(foundPolygons.get(0));\n System.out.println(\"Largest area: \" + foundPolygons.get(0).calculateArea());\n }",
"public void printCoordinates ()\n\t{\n\t\tfor (int a = 0; a < object.size(); a++)\n\t\t{\n\t\t\tSystem.out.println(\"Polygon \" + (a+1) + \":\");\n\t\t\tobject.get(a).detailedPrint();\n\t\t\tSystem.out.println(\"**********\");\n\t\t}\n\t}",
"public void printVertices() {\r\n\t\tfor (int i = 0; i < vertices.size(); i++)\r\n\t\t\tSystem.out.print(vertices.get(i).label);\r\n\t}",
"static void spiral_disp(int arr[][]) {\n\t\t\tint mincol, minrow, maxcol, maxrow, count = 0;\n\t\t\tmincol = 0;\n\t\t\tminrow = 0;\n\t\t\tmaxrow = arr.length - 1;\n\t\t\tmaxcol = arr[0].length - 1;\n\t\t\tint net = arr.length * arr[0].length;\n\t\t\twhile (count < net) {\n\n\t\t\t\tfor (int row = minrow; row <= maxrow && count < net; row++) {\n\t\t\t\t\tSystem.out.print(arr[row][mincol] + \", \");\n\t\t\t\t\tcount++;\n\t\t\t\t}\t\t\n\t\t\t\tmincol++;\n\t\t\t\tfor (int col = mincol; col <= maxcol && count < net; col++) {\n\t\t\t\t\tSystem.out.print(arr[maxrow][col] + \", \");\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tmaxrow--;\n\t\t\t\tfor (int row = maxrow; row >= minrow && count < net; row--) {\n\t\t\t\t\tSystem.out.print(arr[row][maxcol] + \", \");\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tmaxcol--;\n\t\t\t\tfor (int col = maxcol; col>= mincol && count < net; col--) {\n\t\t\t\t\tSystem.out.print(arr[minrow][col] + \", \");\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tminrow++;\n\n\t\t\t}\n\n\t\t}",
"public void display(){\n for(int i=0;i<N;i++){\n for(int j=0;j<N;j++)\n System.out.print(adj_matrix[i][j]+\" \");\n System.out.println();\n }\n }",
"public void mapToString() {\r\n for (Square[] x : map) {\r\n for (Square y : x) {\r\n System.out.print(y.getVisual() + \" \");\r\n }\r\n System.out.println();\r\n }\r\n }",
"private void printList(String type) {\n switch(type) {\n case \"unordered\":\n System.out.println(\"Printing unordered list\");\n\n Iterator<PlanarShape> unorderedListIterator = unorderedList.iterator();\n\n while(unorderedListIterator.hasNext()) {\n System.out.println(\"\\t\" + unorderedListIterator.next());\n }\n\n break;\n case \"ordered\":\n System.out.println(\"Printing ordered list\");\n\n Iterator<PlanarShape> orderedListIterator = orderedList.iterator();\n\n while(orderedListIterator.hasNext()) {\n System.out.println(\"\\t\" + orderedListIterator.next());\n }\n\n break;\n default: break;\n }\n }",
"public static void print1( int[][] a )\n {\n for(int x = 0; a.length > x; x++) { //for the amount of rows...\n\t for(int y = 0; a[x].length > y; y++){//...and for the length of the\n\t //nested array\n\t System.out.println(a[x][y]); //print out that specific array point\n\t }\n }\n }",
"public static void printMatrix(ArrayList<List<String>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++) {\r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++) {\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j)+\", \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"void debug() {\n\t\tfor( int i = 0; i < N; i++ ) {\t\n\t\t\tSystem.out.print(i+\" \");\n\t\t\tfor( int j = 0; j < N; j++ )\n\t\t\t\tSystem.out.print(j+\":\"+(defined[i][j]?\"T\":\"F\")+\" \"+\n\t\t\t\t\t\tc[i][j]+\" p=\"+path[i][j]+\" f=\"+f[i][j]+\"; \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"private static void printListOfList(ArrayList<ArrayList<Integer>> inputList) {\n\t\tIterator< ArrayList<Integer>> itor = inputList.iterator();\n\t\twhile(itor.hasNext()) {\n\t\t\tArrayList<Integer> current = itor.next();\n\t\t\tIterator<Integer> eleItor = current.iterator();\n\t\t\twhile(eleItor.hasNext()) {\n\t\t\t\tint currentElement = eleItor.next();\n\t\t\t\tSystem.out.print(currentElement + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t}",
"public void print (){\r\n for (int i = 0; i < graph.size(); ++i){\r\n graph.get(i).print();\r\n }\r\n }",
"public void print() {\n\t\t\tfor (int i = 0; i < nowLength; i++) {\n\t\t\t\tSystem.out.print(ray[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}",
"private static void printArray(Node[][] puzzle) {\r\n\t\tfor (int i = 0; i < puzzle.length; i++) {\r\n\t\t\tfor (int j = 0; j < puzzle[0].length; j++) {\r\n\t\t\t\tSystem.out.print(puzzle[i][j].getValue());\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\r\n\t}",
"void Print()\n {\n int quadLabel = 1;\n String separator;\n\n System.out.println(\"CODE\");\n\n Enumeration<Quadruple> e = this.Quadruple.elements();\n e.nextElement();\n\n while (e.hasMoreElements())\n {\n Quadruple nextQuad = e.nextElement();\n String[] quadOps = nextQuad.GetOps();\n System.out.print(quadLabel + \": \" + quadOps[0]);\n for (int i = 1; i < nextQuad.GetQuadSize(); i++)\n {\n System.out.print(\" \" + quadOps[i]);\n if (i != nextQuad.GetQuadSize() - 1)\n {\n System.out.print(\",\");\n } else System.out.print(\"\");\n }\n System.out.println(\"\");\n quadLabel++;\n }\n }",
"public void printScalars() {\n for (ScalarSymbol ss: scalars) {\n System.out.println(ss);\n }\n }",
"void matice(){\n\t\tfor(int i = 0;i<matice.length;i++){\n\t\t\tfor(int j =0; j< matice[i].length;j++){\n\t\t\t\tSystem.out.print(matice[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void main(String[] args) {\n int [][] flats; // A 2-D Array\n flats = new int[3][3];\n flats[0][0] = 101; flats[1][0] = 201; flats[2][0] = 301;\n flats[0][1] = 102; flats[1][1] = 202; flats[2][1] = 302;\n flats[0][2] = 103; flats[1][2] = 203; flats[2][2] = 303;\n\n\n //Displaying the Array (for loop)\n System.out.println(\"Printing a 2-D array using for loop\");\n for (int i=0; i<flats.length; i++){\n for (int j=0; j<flats[i].length; j++) {\n System.out.print(flats[i][j]);\n System.out.print(\" \");\n }\n System.out.print(\"\\n\");\n }\n }",
"private static void print(int[][] image) {\n for(int i = 0; i < image.length; i++) {\n for(int j = 0; j < image[0].length; j++) {\n System.out.print(image[i][j] + \" \");\n }\n System.out.println(\"\\n\");\n }\n }",
"public void display()\n {\n System.out.println(�\\n The elements are�);\n for(int i=0; i<n; i++)\n System.out.println(� �+a[i]);\n }",
"public void print() {\r\n\r\n\t\tfor (int row=0; row<10; row++) \r\n\t\t{\r\n\t\t\tfor (int col=0; col<10; col++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"\\t\"+nums[row][col]); //separated by tabs\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"void printSubgraphs() {\n StringBuilder sb = new StringBuilder();\n for(int sgKey: listOfSolutions.keySet()) {\n HashMap<Integer, Long> soln = listOfSolutions.get(sgKey);\n // inside a soln\n //sb.append(\"S:8:\");\n for(int key: soln.keySet()) {\n sb.append(key + \",\" + soln.get(key) + \";\");\n\n }\n sb.setLength(sb.length() - 1);\n sb.append(\"\\n\");\n }\n System.out.println(\"\\n\" + sb.toString());\n }",
"public void print() {\n\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < this.cols; j++) {\n System.out.format(\"%.4f\", data[i][j]);\n if (j != this.cols - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n }",
"public void print(){\n\t\t\n\t\tfor(int i=0;i<maxindex;i++)\n\t\t{\n\t\t\tif(data[i] != 0)\n\t\t\t{\n\t\t\t\tSystem.out.print(data[i]+\"x\"+i+\" \");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void showArray() {\n\t\tSystem.out.println(Arrays.toString(this.array));\n\n\t}",
"public void showPuzzle() {\n\n for (int r = 0; r < numbers.length; r++) {\n for (int c = 0; c < numbers[r].length; c++) {\n System.out.print(numbers[r][c] + \"\\t\");\n }\n System.out.println();\n }\n }",
"void printF(double[][]F) {\n\t\tfor (int i = 1; i < F.length; i++) {\n\t\t\tSystem.err.println(Arrays.toString(F[i]));\n\t\t}\n\t}",
"public static void show(int mat3d[][][]) {\n //for loop which runs 3 times again\n for(int s=0; s<3; s++) {\n //this for loop does the same as the first method\n for(int j=0; j<(3+2*s); j++) {\n //for follows pattern of array ^^\n for(int c=0; c<(s+j+1); c++) {\n //prints of the array slot for s,j,c\n System.out.print(mat3d[s][j][c]);\n //prints out a blank space to seperate\n System.out.print(\" \");\n }\n //prints out blank line to seperate \n System.out.println();\n }\n \n System.out.println();\n }\n }",
"public void printdia(int[][] array){\n\t\tint dim = array.length;\n\n\t for( int k = 0 ; k < dim * 2 ; k++ ) {\n\t for( int j = 0 ; j <= k ; j++ ) {\n\t int i = k - j;\n\t if( i < dim && j < dim ) {\n\t System.out.print( array[i][j] + \" \" );\n\t }\n\t }\n\t System.out.println();\n\t }\n\t}",
"public <T> void printMatrix(T matrix[][])\n {\n int longestString = 0;\n \n for (T[] m : matrix)\n {\n for (T j : m)\n {\n if (j.toString().length() > longestString)\n {\n longestString = j.toString().length();\n }\n }\n }\n String matrixLength = \"\";\n matrixLength += matrix.length;\n \n if (longestString < matrixLength.length())\n {\n longestString = matrix.length;\n }\n \n // limit the length of a string to 4 characters\n longestString = (longestString > 4) ? 4 : longestString;\n \n String format = \"%-\" + (longestString + 1) + \".\" + longestString + \"s\";\n \n System.out.printf(format, \" \");\n for (int i = 0; i < matrix.length; i++)\n {\n System.out.printf(format, i);\n }\n System.out.println(\"\");\n\n int k = 0;\n\n for (T j[] : matrix)\n {\n System.out.printf(format, k++);\n\n for (T i : j)\n {\n String s = \"\";\n s += (i == null) ? \"-\" : i;\n System.out.printf(format, s);\n }\n System.out.println(\"\");\n }\n System.out.println(\"\");\n }",
"public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}",
"public void printMatrix(){\n for (int row = 0; row < matrix.length; row++){\n for (int count = 0; count < matrix[row].length; count++){\n System.out.print(\"----\");\n }\n System.out.println();\n System.out.print('|');\n for (int column = 0; column < matrix[row].length; column++){\n if (matrix[row][column] == SHIP)\n System.out.print('X' + \" | \");\n else if (matrix[row][column] == HIT)\n System.out.print('+' + \" | \");\n else if (matrix[row][column] == MISS)\n System.out.print('*' + \" | \");\n else\n System.out.print(\" \" + \" | \");\n }\n System.out.println();\n }\n }",
"static void printAllInterpretations(int[] arr) {\n\n // Step 1: Create Tree\n Node root = createTree(0, \"\", arr);\n\n // Step 2: Print Leaf nodes\n printleaf(root);\n\n System.out.println(); // Print new line\n }",
"@Override\n\tpublic ArrayList<Shape3D> display() {\n\t\treturn list;\n\t}",
"public void print_board(){\n\t\tfor(int i = 0; i < size*size; i++){\n\t\t\tif(i%this.size == 0) System.out.println(); //just for divider\n\t\t\tfor(int j = 0; j < size*size; j++){\n\t\t\t\tif(j%this.size == 0) System.out.print(\" \"); //just for divider\n\t\t\t\tSystem.out.print(board[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"public void printA(){\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\n\t\t\t\tif(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\t}",
"public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}",
"public static <E> void showArrayList(ArrayList<E> arr)\n {\n System.out.println(\"...........................................\");\n\n for (int i = 0; i < arr.size(); i++)\n {\n System.out.format(\"\\nElement #%d = [%s]%n\", i, arr.get(i).toString());\n } //for\n\n System.out.println();\n\n\n }",
"public static void printList(List<List<Integer>> list) {\n for (int i = 0; i < list.size(); i++) {\n\n List<Integer> lst = list.get(i);\n\n for (int j = 0; j < lst.size(); j++) {\n System.out.print(lst.get(j) + \" \");\n }\n\n System.out.println();\n }\n }",
"public static void print(String[][][] god){\n for(int i = 0; i < god.length; i++){\n for(int j = 0; j < god[i].length; j++){\n for(int k = 0; k < god[i][j].length; k++){\n if(k == 0){\n System.out.print(\"[\" + god[i][j][k] + \",\");\n }\n if(k == (god[i][j].length - 1)){\n System.out.print(god[i][j][k] +\"]|\");\n }\n else{\n System.out.print(god[i][j][k] + \",\");\n }\n }\n }\n System.out.print(\"---\");\n }\n \n }",
"public void print()\n {\n for (int i=0; i<list.length; i++)\n System.out.println(i + \":\\t\" + list[i]);\n }",
"public String toString()\n\t{\n\t\tSystem.out.print(\"Array list contains: [ \");\n\t\tfor(int i=0; i<size; i++)\n\t\t\tSystem.out.print(myArray[i]+ \", \");\n\t\treturn\" ]\";\n\t}",
"public void print() {\r\n\t\tfor (int i = front; i <= rear; i++) {\r\n\t\t\tSystem.out.print(arr[i].getData() + \"\\t\");\r\n\t\t}\r\n\t}",
"public void print() {\n System.out.print(\"[ \" + value + \":\" + numSides + \" ]\");\n }",
"public void print() {\n for (int i = 0; i < headers.length; i++) {\n System.out.printf(headers[i] + \", \"); // Print column headers.\n }\n System.out.printf(\"\\n\");\n for (int i = 0; i < (data.length - 1); i++) {\n for (int j = 0; j < data[i].length; j++) {\n System.out.printf(data[i][j] + \" \"); // Print value at i,j.\n }\n System.out.printf(\"\\n\");\n }\n }",
"private void printArrayList(ArrayList<String> printThis) {\n for(int i = 0; i < printThis.size(); i++) {\n System.out.print(printThis.get(i) + \"\\t\");\n }\n\n }",
"public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}",
"void debugarcf() {\t\n\t\tfor( int i = 0; i < N; i++ )\n\t\t{\tSystem.out.print(\"f[\"+i+\"]= \");\n\t\tfor( int j = 0; j < N; j++ )\n\t\t\tSystem.out.print(f[i][j]+\" \");\n\t\tSystem.out.print(\" arcs[\"+i+\"]= \");\n\t\tfor( int j = 0; j < N; j++ )\n\t\t\tSystem.out.print(arcs[i][j]+\" \");\n\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void printMatrix()\n {\n for(int i = 0; i < n; i++)\n {\n System.out.println();\n for(int j = 0; j < n; j++)\n {\n System.out.print(connectMatrix[i][j] + \" \");\n }\n }\n }",
"@Override\r\n public String toString() {\r\n String result = \"\";\r\n\r\n // Convert each sprite in each ArrayList to its string representation, then print it out.\r\n for (ArrayList<T> list : new ArrayList<ArrayList<T>>()) {\r\n for (T sprite : list) {\r\n result += sprite.toString();\r\n }\r\n result += \"\\n\";\r\n }\r\n\r\n return result;\r\n }",
"public static void main(String[] args) {\n\t\tint s[] = {6,5,4,3,2,1}; \n\t\tList<List<Integer>> l = subsets(s);\n\t\tfor(int i=0;i<l.size();i++){\n\t\t\tSystem.out.print(\"{\");\n\t\t\tfor(int j=0;j<l.get(i).size();j++){\n\t\t\t\tSystem.out.print(l.get(i).get(j) + \", \");\n\t\t\t}\n\t\t\tSystem.out.println(\"}\");\n\t\t}\n\t}",
"static void printMat(Integer mat[][], int n)\n\t{\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public static void printWave(int[][] ar){\n\n for (int i = 0; i <ar.length ; i++) {\n\n if(i%2==0){\n for (int j = 0; j <ar.length ; j++) {\n System.out.println(ar[i][j]);\n }\n }\n else{\n\n for (int j = ar.length-1; j>=0 ; j--) {\n System.out.println(ar[i][j]);\n }\n }\n }\n }",
"public static void printList(ArrayList list) {\n String output = \"[ \";\n for (int i = 0; i < list.size(); i++) {\n if (i != 0) {\n output += \", \" + list.get(i);\n }\n else {\n output += list.get(i);\n }\n }\n output += \" ]\";\n System.out.println(output);\n }",
"public void printGraphStructure() {\n\t\tSystem.out.println(\"Vector size \" + nodes.size());\n\t\tSystem.out.println(\"Nodes: \"+ this.getSize());\n\t\tfor (int i=0; i<nodes.size(); i++) {\n\t\t\tSystem.out.print(\"pos \"+i+\": \");\n\t\t\tNode<T> node = nodes.get(i);\n\t\t\tSystem.out.print(node.data+\" -- \");\n\t\t\tIterator<EDEdge<W>> it = node.lEdges.listIterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tEDEdge<W> e = it.next();\n\t\t\t\tSystem.out.print(\"(\"+e.getSource()+\",\"+e.getTarget()+\", \"+e.getWeight()+\")->\" );\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}"
]
| [
"0.736534",
"0.6786791",
"0.6604611",
"0.64781",
"0.64605457",
"0.6426071",
"0.6408846",
"0.6393569",
"0.634245",
"0.6306304",
"0.62845993",
"0.62283677",
"0.6163153",
"0.6156965",
"0.61539763",
"0.6125278",
"0.61108476",
"0.6094038",
"0.60843813",
"0.60829794",
"0.60825014",
"0.60723436",
"0.6051607",
"0.60340136",
"0.6026773",
"0.60206795",
"0.59910077",
"0.59907806",
"0.59906447",
"0.59902036",
"0.5972446",
"0.5968773",
"0.59660995",
"0.59500176",
"0.5945773",
"0.59149015",
"0.5900461",
"0.5899055",
"0.5890952",
"0.5890638",
"0.5889392",
"0.5889375",
"0.58798766",
"0.58721256",
"0.584562",
"0.584199",
"0.58216184",
"0.5821229",
"0.5801586",
"0.58009124",
"0.5797928",
"0.5776656",
"0.57765585",
"0.5772236",
"0.5771826",
"0.5769924",
"0.5764811",
"0.5761847",
"0.5761806",
"0.57587606",
"0.57490367",
"0.57442665",
"0.57331014",
"0.5722526",
"0.57190436",
"0.5712015",
"0.57108897",
"0.5705113",
"0.56944376",
"0.5690485",
"0.56896824",
"0.5684496",
"0.5680034",
"0.5675139",
"0.5670961",
"0.566433",
"0.5663301",
"0.5657575",
"0.5657575",
"0.5657575",
"0.56543875",
"0.56508857",
"0.56493264",
"0.56485116",
"0.5646515",
"0.56440353",
"0.56435984",
"0.5641464",
"0.56403816",
"0.56394136",
"0.5637949",
"0.5629044",
"0.5625641",
"0.5621673",
"0.5616672",
"0.5612008",
"0.5610291",
"0.5610266",
"0.5606872",
"0.5605206"
]
| 0.69206524 | 1 |
draws all shapes of the arrayList | public void drawAll(){
for (Triangle triangle : triangles) {
triangle.draw();
}
for (Circle circle : circles) {
circle.draw();
}
for(Rectangle rectangle : rectangles){
rectangle.draw();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void drawAll(List<? extends Shape> shapes) {\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}",
"public void paintComponenet(){\r\n\t\tfor(DShape ds : shapes){\r\n\t\t\tds.draw();\r\n\t\t}\r\n\t}",
"public Shapes draw ( );",
"public void draw(PApplet applet) {\n\t\tapplet.pushStyle();\n\t\t\n\t\tfor(PhysicsShape shape : shapes) {\n\t\t\tshape.draw(applet);\n\t\t}\n\t\t\n\t\tapplet.popStyle();\n\t}",
"public void paintComponent(Graphics g){\n super.paintComponent(g);\n for(int i = 0; i < count; i++){\n drawObjects[i].draw(g);\n } \n }",
"public void draw() {\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setPenRadius(.01);\n for (Point2D p : s) {\n p.draw();\n }\n }",
"public void draw() {\n for (Point2D p: mPoints) {\n StdDraw.filledCircle(p.x(), p.y(), 0.002);\n }\n }",
"void draw() {\n canvas.drawColor(Color.BLACK);\n insertSort(vstar);\n for( int i=0; i<NUMSTARS; i++){\n vstar[i].draw();\n }\n }",
"public List<Shape> getDrawShapes();",
"public void paintComponent(Graphics g){\r\n super.paintComponent(g);\r\n\r\n for (int i = 0; i < list.size(); i++) {//draw the shapes of the original list\r\n list.get(i).draw(g);\r\n }\r\n for (int i = 0; i <clonedList.size() ; i++) {//draw the shapes of the cloned list\r\n clonedList.get(i).draw(g);\r\n }\r\n\r\n\r\n }",
"@Override\n public void handlePaint()\n {\n for(GraphicObject obj : this.graphicObjects)\n {\n obj.draw();\n }\n \n }",
"public void draw() {\n\t\t/* Clear Screen */\n\t\tGdx.graphics.getGL20().glClearColor(1,1,1,0);\n\t\tGdx.graphics.getGL20().glClear( GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT );\n\n\t\t/* Iterate through draw list */\n\t\tIterator<ArrayList<Drawable>> iter = this.drawlist.iterator();\n\t\twhile(iter.hasNext()) {\n\t\t\tArrayList<Drawable> layer = iter.next();\n\t\t\t/* Sort the layer. */\n\t\t\tCollections.sort(layer, new DrawableComparator());\n\t\t\t/* Iterate through the layer. */\n\t\t\tIterator<Drawable> jter = layer.iterator();\n\t\t\twhile(jter.hasNext()) {\n\t\t\t\tDrawable drawable = jter.next();\n\t\t\t\tif (drawable.isDead()) {\n\t\t\t\t\tjter.remove(); //Remove if dead.\n\t\t\t\t}//fi\n\t\t\t\telse {\n\t\t\t\t\tdrawable.draw(this, this.scalar); //Draw the drawable.\n\t\t\t\t}//else\n\t\t\t}//elihw\n\t\t}//elihw\n\t}",
"public void draw() {\n for (Point2D point : pointSet) {\n point.draw();\n }\n }",
"public void draw() {\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setPenRadius(0.01);\n for (Point2D point : points) {\n StdDraw.point(point.x(), point.y());\n }\n StdDraw.setPenRadius();\n }",
"public void draw() {\n for (Point2D i : pointsSet)\n i.draw();\n }",
"public void paint(Graphics g )\n {\n super.paint(g); // is no super.paint(), then lines stay on screen \n \n for ( int i=0; i<allTheShapesCount; i++ )\n {\n allTheShapes[ i ] . drawMe(g);\n }\n }",
"public void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Iterator<Circle> circleIterator = circleArrayList.iterator();\n Circle drawCircle;\n\n // iterate through the ArrayList\n while (circleIterator.hasNext()) {\n drawCircle = circleIterator.next();\n drawCircle.draw(g); // draw each circle\n }\n\n }",
"public void draw()\r\n\t\t{\r\n\t\tfor(PanelStationMeteo graph: graphList)\r\n\t\t\t{\r\n\t\t\tgraph.repaint();\r\n\t\t\t}\r\n\t\t}",
"private void drawPolygons(Renderer r) {\n for ( Polygon p : polygons ) {\n p.drawYourSelf(r);\n }\n }",
"public static void draw(ArrayList<Sighting> data){\n \n \t\tint backgroundColor = Utils.globalProcessing.color(120, 120, 120, 60);\n \n \t\tUtils.globalProcessing.fill(backgroundColor);\n \n \t\tUtils.globalProcessing.rect(200, 0, 1024, 768);\n \t\t//Utils.globalProcessing.rectMode(Utils.globalProcessing.CORNERS);\n \t\tArrayList<Shape> shapes = new ArrayList<Shape>();\n \t\tArrayList<Time> times = new ArrayList<Time>();\n \t\tArrayList<City> locations = new ArrayList<City>();\n \t\t//calculate min/max for each dimension\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tif(!shapes.contains(s.getShape()))\n \t\t\t\tshapes.add(s.getShape());\n \t\t\tif(!times.contains(s.getTime()))\n \t\t\t\ttimes.add(s.getTime());\n \t\t\tif(!locations.contains(s.getPosition()))\n \t\t\t\tlocations.add((City)s.getPosition());\n \t\t}\n \t\tfloat xPloti, xPlote, yPloti, yPlote;\n \t\txPloti = 200;\n \t\txPlote = 1024;\n \t\tyPloti = 100;\n \t\tyPlote = 700;\n \n \t\tfloat maxDistance = 0;\n\t\tfloat minPopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n\t\tfloat maxpopulationDensity = Utils.allCities.get(0).getPopulationDensity();\n \t\tfor(City c: locations){\n \t\t\tif(c.getDistanceAirport() > maxDistance)\n \t\t\t\tmaxDistance = c.getDistanceAirport();\n \t\t\tif(c.getPopulationDensity()< minPopulationDensity)\n \t\t\t\tminPopulationDensity = c.getPopulationDensity();\n \t\t\telse if(c.getPopulationDensity() > maxpopulationDensity)\n \t\t\t\tmaxpopulationDensity = c.getPopulationDensity();\n \n \t\t}\n \n \n \n \t\t\n \t\tfor(int i = 0; i < data.size(); i++){\n \t\t\tSighting s = data.get(i);\n \t\t\tUtils.globalProcessing.stroke(s.getShape().getColor());\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t//Utils.globalProcessing.stroke(120);\n \t\t\tfloat x = Utils.globalProcessing.map((float)1/7, 0, 1, xPloti, xPlote);\n \t\t\tfloat y = Utils.globalProcessing.map(((City)s.getPosition()).getDistanceAirport(), 0, maxDistance, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); // distance\n \n \t\t\tx = Utils.globalProcessing.map((float)2/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(((City)s.getPosition()).getPopulationDensity(), minPopulationDensity, maxpopulationDensity, yPloti, yPlote);\n \n \t\t\tUtils.globalProcessing.vertex(x,y); //populationDensity\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\t//It works only if I threat all the couple of points as separate, indipendent lines\n \t\t\tUtils.globalProcessing.beginShape();\n \n \t\t\tUtils.globalProcessing.vertex(x,y);\n \n \t\t\tx = Utils.globalProcessing.map((float)3/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)<19 &&s.getTime().getBeginTime().get(Calendar.HOUR_OF_DAY)>=7)\n \t\t\t\ty = Utils.globalProcessing.map(1, 0, 3, yPloti, yPlote); //day \n \t\t\telse\t\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 3, yPloti, yPlote); //night \n \t\t\t//System.out.println(x +\" \" +y);\n \t\t\tUtils.globalProcessing.vertex(x,y); // night/day\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x,y);\n \t\t\tx = Utils.globalProcessing.map((float)4/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.MONTH)+1, 0, 13, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //month of the year\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\tx = Utils.globalProcessing.map((float)5/7, 0, 1, xPloti, xPlote);\n \t\t\tif(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.MARCH || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.APRIL ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.MAY) //Spring\n \t\t\ty = Utils.globalProcessing.map(1, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.JUNE || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.JULY ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.AUGUST) //summer\n \t\t\t\ty = Utils.globalProcessing.map(2, 0, 5, yPloti, yPlote);\n \t\t\telse if(s.getTime().getBeginTime().get(Calendar.MONTH)==Calendar.SEPTEMBER || s.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.OCTOBER ||\n \t\t\t\t\ts.getTime().getBeginTime().get(Calendar.MONTH) == Calendar.NOVEMBER) //autumn\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\telse\n \t\t\t\ty = Utils.globalProcessing.map(3, 0, 5, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //seasons\n \t\t\t\n \t\t\tUtils.globalProcessing.endShape();\n \t\t\tUtils.globalProcessing.beginShape();\n \t\t\t\n \t\t\tUtils.globalProcessing.vertex(x, y);\n \t\t\t\n \t\t\tx = Utils.globalProcessing.map((float)6/7, 0, 1, xPloti, xPlote);\n \t\t\ty = Utils.globalProcessing.map(s.getTime().getBeginTime().get(Calendar.YEAR), 2000, 2011, yPloti, yPlote);\n \t\t\tUtils.globalProcessing.vertex(x, y); //years\n \t\t\tUtils.globalProcessing.endShape();\n \t\t}\n \t\t//draw vertical lines\n \n \t\tfor(int i = 1; i < 7 ; i++){\n \t\t\tfloat x = Utils.globalProcessing.map((float)i/7, 0, 1, xPloti, xPlote);\n \t\t\t//Utils.globalProcessing.\n \t\t}\n \n \t}",
"private String drawAllShapes() {\n\n /*\n Have list of list for each shape and the motions of each shape\n Need to iterate through the frames and for each motion in a frame\n add it to the corresponding shape in the list of lists\n */\n StringBuilder shapeSVG = new StringBuilder();\n Map<Integer, List<Shape>> animationFrames = this.model.getFrames();\n List<List<Shape>> shapeStates = new ArrayList<>();\n for (Integer key : new TreeSet<>(animationFrames.keySet())) {\n List<Shape> singleFrame = animationFrames.get(key);\n for (Shape shape : singleFrame) {\n if (!this.containsShapeList(shapeStates, shape.getName())) {\n List<Shape> shapeMotions = new ArrayList<>();\n shapeMotions.add(singleFrame.get(singleFrame.indexOf(shape)));\n shapeStates.add(shapeMotions);\n } else {\n shapeStates.get(this.findShape(shapeStates, shape.getName()))\n .add(singleFrame.get(singleFrame.indexOf(shape)));\n }\n }\n }\n\n for (List<Shape> shape : shapeStates) {\n shapeSVG.append(this.drawSingleShape(shape.get(0).getName(), shape.get(0).getType(), shape))\n .append(\"\\n\");\n }\n\n return shapeSVG.toString();\n }",
"static void printShapes(List<Shape> array, String label) {\n\n System.out.println(label + \"\\n\");\n // Iterate array of polygons using a foreach loop\n for (Shape shape : array) {\n // Use getClass to print the class of the Object and then print the Object (calls the toString)\n System.out.printf(\"%s: %s\\n\", shape.getClass(), shape);\n }\n System.out.println();\n }",
"public Paint(){\n triangles = new ArrayList<>();\n rectangles = new ArrayList<>();\n circles = new ArrayList<>();\n }",
"public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}",
"void draw(IViewShapes shape);",
"public abstract ArrayList<Shape> getShapes();",
"public static void drawAll(Vector<Shape> v, Graphics g)\r\n\t{\r\n\t\tint i; \r\n\r\n\t\tfor(i=0 ; i<v.size() ; i++)\r\n\t\t{\r\n\t\t\tdouble random = Math.random()*(v.size());\r\n\t\t\tint num = (int)random;\t\t\t\r\n\t\t\tif(i==0)\r\n\t\t\t\tg.setColor(Color.GREEN);\r\n\t\t\telse if(num%5==0)\r\n\t\t\t\tg.setColor(Color.ORANGE);\r\n\t\t\telse if(num%8==0)\r\n\t\t\t\tg.setColor(Color.BLUE);\r\n\t\t\telse if(num%7==0)\r\n\t\t\t\tg.setColor(Color.RED);\r\n\t\t\telse if(num%9==0)\r\n\t\t\t\tg.setColor(Color.GRAY);\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(i%3==0)\r\n\t\t\t\t\tg.setColor(Color.CYAN);\r\n\t\t\t\telse if(i%4 == 0)\r\n\t\t\t\t\tg.setColor(Color.magenta);\r\n\t\t\t\telse\r\n\t\t\t\t\tg.setColor(Color.LIGHT_GRAY);\r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t(v.get(i)).draw(g);\r\n\t\t}\r\n\r\n\t}",
"public void paintComponent(Graphics page)\r\n {\r\n super.paintComponent(page);\r\n \r\n //Goes through each object in the array list and\r\n //draws the dot.\r\n for(int i = 0; i < dotList.size(); i++)\r\n {\r\n \t ((Dot) dotList.get(i)).draw(page); //Draws the dot\r\n }\r\n }",
"@Override\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n\n Graphics2D g2d = (Graphics2D)g;\n\n if (shapeList != null) {\n shapeList.sort(Comparator.comparing(Shape::getLayer));\n for (Shape shape : shapeList) {\n if (shape.getType() == ShapeType.RECTANGLE) {\n g2d.setColor(new Color(shape.getR(), shape.getG(), shape.getB()));\n g2d.fillRect(shape.getX(), shape.getY(), shape.getWidth(), shape.getHeight());\n }\n else if (shape.getType() == ShapeType.ELLIPSE) {\n g2d.setColor(new Color(shape.getR(), shape.getG(), shape.getB()));\n g2d.fillOval(shape.getX(), shape.getY(), shape.getWidth(), shape.getHeight());\n }\n }\n }\n }",
"public void paint(Graphics g) {\n\t\tshapes[0] = dc1;\n\t\tdrawables[0] = dc1;\n\t\tdc1.setColor(new Color(176,134,245));\n\t\t\n\t\t\n\t\tshapes[1] = dr1;\n\t\tdrawables[1] = dr1;\n\t\tdrawables[1].setColor(new Color(12,12,12));\n\t\t\n\t\tshapes[2] = dr2;\n\t\tdrawables[2] = dr2;\n\t\tdrawables[2].setColor(new Color(222,12,12));\n\t\t\n/*\t shapes[3] = dr3;\n \tdrawables[3] = dr3; */\n \t\n\t\tshapes[4] = dc2;\n\t\tdrawables[4] = dc2;\n\t\t\n\t\tshapes[5] = dc3;\n\t\tdrawables[5] = dc3;\n\t\tdrawables[5].setColor(new Color(255,255,0));\n\t\t\n\t\t\n\t\t// Added\n\t\tshapes[6] = dl1;\n\t\tdrawables[6] = dl1;\n\t\tdrawables[6].setColor(new Color(255,255,0));\n\n\t\tdouble total_area = 0;\n\n\t\t// use the array\n\t\tfor (int i = 0; i < shapes.length; i++) {\n\t\t\ttotal_area = total_area + shapes[i].area();\n\t\t\tdrawables[i].draw(g);\n\t\t}\n\t\tSystem.out.println(\"total_area\");\n\t\tg.drawString(\"Total area: \" + total_area, 200, 400);\n\t}",
"public void drawAllGraphics(){\r\n\t\t \r\n\t}",
"public void draw()\n\t{\t\t\n\t\tArrayList<Segment> seg = new ArrayList<Segment>();\n\t\tfor(int i = 0; i < hullVertices.length - 1; i++)\n\t\t{\n\t\t\tSegment s = new Segment(hullVertices[i], hullVertices[i+1]);\n\t\t\tseg.add(s);\n\t\t}\n\t\tSegment s1 = new Segment(hullVertices[hullVertices.length-1], hullVertices[0]);\n\t\tseg.add(s1);\n\t\t// Based on Section 4.1, generate the line segments to draw for display of the convex hull.\n\t\t// Assign their number to numSegs, and store them in segments[] in the order.\n\t\tSegment[] segments = new Segment[seg.size()];\n\t\tfor(int i = 0; i < seg.size(); i++)\n\t\t{\n\t\t\tsegments[i] = seg.get(i);\n\t\t}\n\t\t// The following statement creates a window to display the convex hull.\n\t\tPlot.myFrame(pointsNoDuplicate, segments, getClass().getName());\n\t}",
"private void drawWalls(){\n for(int i = 0 ; i < wallsArrayList.size(); i++){\n wallsArrayList.get(i).drawImage(buffer);\n }\n\n }",
"@Override\r\n public void paintComponent(Graphics g)\r\n {\r\n super.paintComponent(g); // clears drawing area\r\n\r\n for(Point point : points)\r\n g.fillOval(point.x, point.y, 4, 4);\r\n }",
"private void drawShapes() {\n\n // get a polygon shape object\n SKPolygon polygon = new SKPolygon();\n // set the polygon's nodes\n List<SKCoordinate> nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7765));\n nodes.add(new SKCoordinate(-122.4141, 37.7765));\n nodes.add(new SKCoordinate(-122.4342, 37.7620));\n polygon.setNodes(nodes);\n // set the outline size\n polygon.setOutlineSize(3);\n // set colors used to render the polygon\n polygon.setOutlineColor(new float[]{1f, 0f, 0f, 1f});\n polygon.setColor(new float[]{1f, 0f, 0f, 0.2f});\n // render the polygon on the map\n mapView.addPolygon(polygon);\n\n // get a circle mask shape object\n SKCircle circleMask = new SKCircle();\n // set the shape's mask scale\n circleMask.setMaskedObjectScale(1.3f);\n // set the colors\n circleMask.setColor(new float[]{1f, 1f, 0.5f, 0.67f});\n circleMask.setOutlineColor(new float[]{0f, 0f, 0f, 1f});\n circleMask.setOutlineSize(3);\n // set circle center and radius\n circleMask.setCircleCenter(new SKCoordinate(-122.4200, 37.7665));\n circleMask.setRadius(300);\n // set outline properties\n circleMask.setOutlineDottedPixelsSkip(6);\n circleMask.setOutlineDottedPixelsSolid(10);\n // set the number of points for rendering the circle\n circleMask.setNumberOfPoints(150);\n // render the circle mask\n mapView.addCircle(circleMask);\n\n\n // get a polyline object\n SKPolyline polyline = new SKPolyline();\n // set the nodes on the polyline\n nodes = new ArrayList<SKCoordinate>();\n nodes.add(new SKCoordinate(-122.4342, 37.7898));\n nodes.add(new SKCoordinate(-122.4141, 37.7898));\n nodes.add(new SKCoordinate(-122.4342, 37.7753));\n polyline.setNodes(nodes);\n // set polyline color\n polyline.setColor(new float[]{0f, 0f, 1f, 1f});\n // set properties for the outline\n polyline.setOutlineColor(new float[]{0f, 0f, 1f, 1f});\n polyline.setOutlineSize(4);\n polyline.setOutlineDottedPixelsSolid(3);\n polyline.setOutlineDottedPixelsSkip(3);\n mapView.addPolyline(polyline);\n }",
"public void drawShape(Shape shape);",
"@Override\n public void paintComponent(final Graphics theGraphics) {\n super.paintComponent(theGraphics);\n final Graphics2D g2d = (Graphics2D) theGraphics;\n\n for (int i = 0; i < myDrawingArray.size(); i++) {\n final Drawing drawing = myDrawingArray.get(i);\n g2d.setPaint(drawing.getColor());\n g2d.setStroke(new BasicStroke(drawing.getWidth()));\n g2d.draw(drawing.getShape());\n }\n \n if (myCurrentShape != null) {\n g2d.setPaint(myCurrentShape.getColor());\n g2d.setStroke(new BasicStroke(myCurrentShape.getWidth()));\n g2d.draw(myCurrentShape.getShape());\n }\n \n if (myGrid) { //Paints the grid if myGrid is true.\n g2d.setStroke(new BasicStroke(1));\n g2d.setPaint(Color.GRAY);\n for (int row = 0; row < getHeight() / GRID_SPACING; row++) {\n final Line2D line = new Line2D.Float(0, GRID_SPACING + (row * GRID_SPACING),\n getWidth(), GRID_SPACING + (row * GRID_SPACING));\n g2d.draw(line);\n }\n for (int col = 0; col < getWidth() / GRID_SPACING; col++) {\n final Line2D line = new Line2D.Float(GRID_SPACING \n + (col * GRID_SPACING), 0,\n GRID_SPACING\n + (col * GRID_SPACING), getHeight());\n g2d.draw(line);\n }\n \n }\n }",
"public Paint() {\n shapes = new ArrayList<>();\n }",
"public void draw() {\n if (isEmpty()) return;\n draw1(root, 0, 1, 0, 1);\n }",
"public void draw() {\n \n // TODO\n }",
"@Override\n\tpublic ArrayList<Shape3D> display() {\n\t\treturn list;\n\t}",
"public void draw() {\r\n System.out.println(\"Shape: \" + this.getClass().getName() +\r\n \"\\t Perimeter: \" + calculatePerimeter() +\r\n \"\\t Area: \" + calculateArea());\r\n }",
"static List<Shape> createShapeArray(){\n return Arrays.asList(new Rectangle(new Point(0,0),new Point(0,4),new Point(2,4), new Point(2,0)),\n new Rectangle(new Point(0,0),new Point(0,2),new Point(2,2), new Point(2,0)),\n new Rectangle(new Point(0,0),new Point(0,3),new Point(2,3), new Point(2,0)),\n new Circle(new Point(0,0),new Point(0,1)),\n new Circle(new Point(1,0),new Point(1,4)),\n new Circle(new Point(1,0),new Point(0,2)),\n new Triangle(new Point(0,0),new Point(0,2),new Point(2,0)),\n new Triangle(new Point(0,0),new Point(0,4),new Point(4,0)),\n new Triangle(new Point(0,0),new Point(0,1),new Point(1,0)));\n\n }",
"public void draw() {\n\t\tfor (Link link : links)\n\t\t\tlink.draw();\n\t}",
"private void drawPolygonsUsingArrays(int drawMode, List<int[]> polygonsList) {\n for (int j = 0; j < polygonsList.size(); j++) {\n int[] polygon = polygonsList.get(j);\n int drawModePolygon = polygon[0];\n int vertexPos = polygon[1];\n int drawSizePolygon = polygon[2];\n if (drawMode == GLES20.GL_LINE_LOOP && polygon[2] > 3) {\n // is this wireframe?\n // Log.v(\"GLES20Renderer\",\"Drawing wireframe for '\" + obj.getId() + \"' (\" + drawSizePolygon + \")...\");\n for (int i = 0; i < polygon[2] - 2; i++) {\n // Log.v(\"GLES20Renderer\",\"Drawing wireframe triangle '\" + i + \"' for '\" + obj.getId() + \"'...\");\n GLES20.glDrawArrays(drawMode, polygon[1] + i, 3);\n GLUtil.checkGlError(\"glDrawArrays\");\n }\n } else {\n GLES20.glDrawArrays(drawMode, polygon[1], polygon[2]);\n GLUtil.checkGlError(\"glDrawArrays\");\n }\n }\n }",
"private void repaint() {\n\t\tclear();\n\t\tfor (PR1Model.Shape c : m.drawDataProperty()) {\n\t\t\tif(!c.getText().equals(defaultshape))\n\t\t\t\tdrawShape(c, false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tdrawShape(getSelection(), true);\n\t\t}\n\t}",
"private void drawArray(ArrayList<NormalFishCollect> images, GraphicsContext gc) {\n\t\tgc.save();\n\t\tfor (int i = 0; i < images.size(); i++) {\n\t\t\tgc.drawImage(images.get(i).img, images.get(i).x, images.get(i).y);\n\n\t\t}\n\t\tgc.restore();\n\n\t}",
"public void draw(Graphics g, World world) {\n for (Shapes current : this.listShapes) {\n current.draw(g,world);\n }\n }",
"public void paintComponent(Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tfor(Shape s : shapes){\n\t\t\ts.paint(g);\n\t\t}\n\t}",
"public void paintShapeAll(RMShapePainter aPntr)\n{\n // Get graphics\n RMShapePainter pntr = aPntr;\n \n // If clipping, clip to shape\n if(getClipShape()!=null) {\n pntr = pntr.clone();\n pntr.clip(getClipShape());\n }\n \n // Have shape paint only itself\n pntr.sendPaintShape(this);\n \n // Have shape paint children\n paintShapeChildren(pntr);\n \n // Have shape paint over\n paintShapeOver(aPntr);\n \n // If graphics copied, dispose\n if(pntr!=aPntr) pntr.dispose();\n}",
"public void draw()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\tfor(int i = lines.size()-1; i >= 0; i--)\r\n\t\t\t{\r\n\t\t\t\tlines.get(i).draw();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"void renderShape(ArrayList<PVector> vertices, int fillColor) {\n processing.fill(fillColor);\n processing.noStroke();\n\n // draw a polygon\n processing.beginShape();\n for (PVector v : vertices) {\n processing.vertex(v.x, v.y);\n }\n processing.endShape(processing.CLOSE);\n }",
"public ShapeGraphics() {\r\n //A random object to set random measures for the shapes\r\n Random rn = new Random();\r\n //Creating two instances of every shape using the random object and adding them to the list\r\n for (int i = 0; i <2 ; i++) {\r\n MyLine line = new MyLine(rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE), Color.RED);\r\n MyRectangle rec = new MyRectangle (rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),Color.RED,true);\r\n MyOval oval = new MyOval (rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),rn.nextInt(MAX_SIZE),Color.RED,true);\r\n list.add(line);\r\n list.add(oval);\r\n list.add(rec);\r\n\r\n }\r\n //Creating cloned shapes of this list and adding them to another array list\r\n ClonedShapes c = new ClonedShapes(list);\r\n clonedList = c.getClonedList();\r\n }",
"void drawShape() {\n System.out.println(\"Drawing Triangle\");\n this.color.addColor();\n }",
"public void drawControlPolygon() {\n\t\t//this.frame.stroke(255, 0, 0);\n\t\tfor(int i=0;i<points.length;i++) {\n\t\t\tfor(int j=0;j<points[i].length;j++)\n\t\t\t\tthis.frame.drawVertex(points[i][j]);\n\t\t}\n\t}",
"private void drawSquares() {\n for (Square square : gui.game) {\n new SquareRenderer(gui, g2, square);\n }\n }",
"public void draw(Canvas canvas) {\n // Draw the game\n for (int i = 0; i < width + 2; i++) {\n for (int j = 0; j < height + 2; j++) {\n canvas.setPoint(i, j, '.');\n }\n }\n\n for (int i = 0; i < width + 2; i++) {\n canvas.setPoint(i, 0, '-');\n canvas.setPoint(i, height + 1, '-');\n }\n\n for (int i = 0; i < height + 2; i++) {\n canvas.setPoint(0, i, '|');\n canvas.setPoint(width + 1, i, '|');\n }\n\n for (BaseObject object : getAllItems()) {\n object.draw(canvas);\n }\n }",
"public void makeGraphic() {\n\t\tStdDraw.clear();\n\n\t\tfor (int i = 0; i < p.showArray.size(); i++) {\n\t\t\tStdDraw.setPenColor(0, 255, 255);\n\n\t\t\tStdDraw.circle(p.showArray.get(i).acquirePosition().x, p.showArray.get(i).acquirePosition().y,\n\t\t\t\t\tp.showArray.get(i).acquireSizeOfBody());\n\t\t\tStdDraw.setPenColor(StdDraw.GRAY);\n\n\t\t\tStdDraw.filledCircle(p.showArray.get(i).acquirePosition().x, p.showArray.get(i).acquirePosition().y,\n\t\t\t\t\tp.showArray.get(i).acquireSizeOfBody());\n\n\t\t}\n\t\tStdDraw.show();\n\t}",
"void currentFrame(List<IShape> shapes);",
"@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tfor (int i = 0; i < wall.length; i++) {\n\t\t\t\t\tfor (int j = 0; j < wall[i].length; j++) {\n\t\t\t\t\t\tg.setColor(Color.blue);\n\t\t\t\t\t\tg.drawRect(i*30, j*30, 30, 30);\n\t\t\t\t\t\tif (wall[i][j] == 1) {\n\t\t\t\t\t\t\tg.fillRect(i*30, j*30, 30, 30);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"protected synchronized void paintComponent(Graphics g) {\n /*Call the paintComponent of the super class*/\n super.paintComponent(g);\n\n /*Cast the object to a Graphics2D object*/\n Graphics2D g2 = (Graphics2D) g;\n\n /*Enable rendering Antialiasing and other rendering optimizations*/\n g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,\n\t\t\t\t\tRenderingHints.VALUE_TEXT_ANTIALIAS_ON);\n\n\n /***\n * Loop through the List that holds all the shapes.\n * shapesBuffer list and Draw them on screen\n */\n for (int i=0; i<labelBuffer.size(); i++)\n {\n /*Get the Concept for each index i*/\n ShapesInterface currentConcept = (ShapesInterface) labelBuffer.get(i);\n\n \n /*Pass from the connected List*/\n if (currentConcept instanceof ShapeConcept || currentConcept instanceof ShapeLinking) {\n for (int k=0; k<currentConcept.getConnComponenetsList().size(); k++) {\n /*Get the center point of this Concept*/\n Point p1 = currentConcept.getCenter();\n Point p2 = ((ShapesInterface) currentConcept.getConnComponenetsList().get(k)).getCenter();\n \n //Point p2 = ((ShapeConcept) currentConcept.getConnComponenetsList().get(k)).getCenter();\n\n g2.draw(new Line2D.Double(p1.x, p1.y, p2.x, p2.y));\n }//end for\n }//end if check\n }//end for\n\n}",
"void drawShapes(List<ITile> tilesToDraw, IVertex optimalVertexToDraw,\n Point2D optimalVertexCoordinates);",
"public void draw() {\n \n }",
"public static void main(String[] args) {\n\t\tArrayList<Shape> list = new ArrayList<Shape>();\r\n\t\tRectangle rt1 = new Rectangle(4, 7, 5);\r\n\t\tRectangle rt2 = new Rectangle(5, 4, 6);\r\n\t\tCircle cir1 = new Circle(6, 6, 7);\r\n\t\tCircle cir2 = new Circle(7, 8, 3);\r\n\t\t\r\n\t\tlist.add(rt1);\r\n\t\tlist.add(rt2);\r\n\t\tlist.add(cir1);\r\n\t\tlist.add(cir2);\r\n\t\t\r\n\t\tSystem.out.println(\"구분 \\t\\t 길이 \\tx좌표\\t y좌료\\t Area\\t Circumference\");\r\n\t\tfor(Shape s : list){\r\n\t\t\tif(s instanceof Rectangle){\r\n\t\t\t\tRectangle rt = (Rectangle)s;\r\n\t\t\tSystem.out.println(rt.getClass().getSimpleName()+ \"\\t\"+\r\n\t\t\t\t\trt.wideth+\"\\t\"+rt.point.x+\"\\t\"+rt.point.y+\r\n\t\t\t\t\t\"\\t\"+rt.getArea()+\"\\t\"+rt.getCircumference());\r\n\t\t\t}else if(s instanceof Circle){\r\n\t\t\t\tCircle cir = (Circle) s;\r\n\t\t\t\tSystem.out.println(cir.getClass().getSimpleName()+ \"\\t\\t\"+\r\n\t\t\t\t\t\tcir.radius+\"\\t\"+cir.point.x+\"\\t\"+cir.point.y+\r\n\t\t\t\t\t\t\"\\t\"+cir.getArea()+\"\\t\"+cir.getCircumference());\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tfor(Shape s : list){\r\n\t\t\tif(s instanceof Rectangle){\r\n\t\t\t\tRectangle rt = (Rectangle)s;\r\n\t\t\t\trt.move(10, 10);\r\n\t\t\t}else if(s instanceof Circle){\r\n\t\t\t\tCircle cir = (Circle) s;\r\n\t\t\t\tcir.move(10, 10);\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tfor(Shape s : list){\r\n\t\t\tif(s instanceof Rectangle){\r\n\t\t\t\tRectangle rt = (Rectangle)s;\r\n\t\t\tSystem.out.println(rt.getClass().getSimpleName()+ \"\\t\"+\r\n\t\t\t\t\trt.wideth+\"\\t\"+rt.point.x+\"\\t\"+rt.point.y);\r\n\t\t\t}else if(s instanceof Circle){\r\n\t\t\t\tCircle cir = (Circle) s;\r\n\t\t\t\tSystem.out.println(cir.getClass().getSimpleName()+ \"\\t\\t\"+\r\n\t\t\t\t\t\tcir.radius+\"\\t\"+cir.point.x+\"\\t\"+cir.point.y);\r\n\t\t\t}\t\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void draw() {\n\t\tbg.draw();\n\t\tfor(Test2 t : test)\n\t\t\tt.draw();\n\t\tfor(Test2 t : test2)\n\t\t\tt.draw();\n\t\t\n\t\tfor(Test2 t : test3)\n\t\t\tt.draw();\n\t\tobj.draw();\n\t\tEffect().drawEffect(1);\n\t}",
"public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }",
"public void paintBalls(Graphics g);",
"private void drawImages() {\n\t\t\r\n\t}",
"public void draw() {\n\t\tfor (int i = 0; i < particleCount; i++) {\r\n\t\t\tif (particles[i] != null) {\r\n\t\t\t\tglBegin(GL_QUADS);\r\n\t\t\t\t{\r\n\t\t\t\t\tparticles[i].draw();\r\n\t\t\t\t}\r\n\t\t\t\tglEnd();\r\n\t\t\t}\r\n\t\t}\r\n\t\tglColor3f(1, 1, 1);\r\n\t}",
"public void clear() {\n \tthis.listShapes.clear();\n }",
"protected void drawImpl()\n {\n if (mode == 2) {\n // Invader\n background(0);\n noStroke();\n int triangleXDensity = 32;\n int triangleYDensity = 18;\n for (int i = 0; i < triangleXDensity + 100; i++) {\n for (int j = 0; j < triangleYDensity + 100; j++) {\n float value = scaledBandLevels[(i % scaledBandLevels.length)];\n float shapeSize = map(value, 0, 255, 0, 150);\n int currentX = (width/triangleXDensity) * i;\n int currentY = (int)(((height/triangleYDensity) * j));\n\n if (subMode == 1) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 3));\n }\n else if (subMode == 3) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 6));\n }\n\n if (subMode == 4) {\n shapeSize = map(value, 0, 255, 0, 500);\n }\n\n if ((i + j) % (int)random(1,5) == 0) {\n fill(0, 255, 255);\n }\n else {\n fill(234,100,255);\n }\n pushMatrix();\n if (subMode == 2) {\n translate(width/2, height/2);\n rotate(radians(frameCount % value * 2));\n translate(-width/2, -height/2);\n }\n triangle(currentX, currentY - shapeSize/2, currentX - shapeSize/2, currentY + shapeSize/2, currentX + shapeSize/2, currentY + shapeSize/2);\n popMatrix();\n }\n }\n\n }\n else if (mode == 5) {\n // Mirror Ball\n background(0);\n translate(width/2, height/2, 500);\n noStroke();\n if (subMode == 0) {\n rotateY(frameCount * PI/800);\n }\n else if (subMode == 1 || subMode == 2) {\n rotateY(frameCount * PI/800);\n rotateX(frameCount * PI/100);\n }\n else if (subMode == 3) {\n rotateY(frameCount * PI/400);\n }\n\n for (int i = 0; i < 100; i++) {\n for (int j = 0; j < 100; j++) {\n rotateY((2*PI/200) * j);\n pushMatrix();\n rotateX((2*PI/200) * i);\n translate(0,200);\n if (j > 50 && j < 150) {\n rotateX(PI/2);\n }\n else {\n rotateX(-PI/2);\n }\n if (subMode == 2 || subMode == 3) {\n fill(i * 2, 0, j, scaledBandLevels[i % scaledBandLevels.length] * 2);\n }\n else {\n fill(255, scaledBandLevels[i % scaledBandLevels.length]);\n }\n rect(0,200,20,20);\n popMatrix();\n }\n }\n }\n else if (mode == 8) {\n // End To Begin\n background(0);\n\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i] && modSizes[i] < 60) {\n modSizes[i]+=2;\n }\n else if (modSizes[i] > 5) {\n modSizes[i]--;\n }\n }\n \n theta += .2;\n\n if (subMode >=3) {\n theta += .6;\n }\n\n float tempAngle = theta;\n for (int i = 0; i < yvalues.length; i++) {\n yvalues[i] = sin(tempAngle)*amplitude;\n tempAngle+=dx;\n }\n\n noStroke();\n if (subMode >= 4) {\n translate(0, height/2);\n }\n int currentFrameCount = frameCount;\n for (int x = 0; x < yvalues.length; x++) {\n if (subMode >= 4) {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length] * 3);\n rotateX(currentFrameCount * (PI/200));\n }\n else {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length]);\n }\n ellipse(x*xspacing - period/2, height/2+yvalues[x], modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n if (subMode >= 1) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n if (subMode >= 2) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n }\n }\n else if (mode == 1) {\n // Life Support\n background(0);\n noStroke();\n if (trigger) { \n if (subMode == 0) {\n fill(255, 0, 0, triggerHold - (triggerCount * 4));\n }\n else if (subMode == 1) {\n fill(255, triggerHold - (triggerCount * 4));\n }\n rect(0,0,width,height);\n if (triggerCount > triggerHold) {\n trigger = false;\n triggerCount = 1;\n }\n else {\n triggerCount++;\n }\n }\n }\n else if (mode == 6) {\n // Stacking Cards\n background(255);\n if (subMode >= 1) {\n translate(width/2, 0);\n rotateY(frameCount * PI/200);\n }\n imageMode(CENTER);\n\n if (subMode <= 1) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=40;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n else if (subMode == 2) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 4; j++) {\n rotateY(j * (PI/4));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 3) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 4) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int k = 0; k < height; k+= 300) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), k, modSizes[i], modSizes[i]);\n }\n }\n }\n }\n } \n else if (mode == 4) {\n background(0);\n noStroke();\n for (int i = 0; i < letterStrings.length; i++) { \n if (subMode == 0) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), (height/2) + 75);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, (height/2) + 75);\n }\n }\n else if (subMode == 1) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100; j < height + 100; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 2) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100 - (frameCount % 400); j < height + 600; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 3) {\n for (int j = -100; j < height + 100; j+=200) {\n if (random(0,1) < .5) {\n fill(0,250,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n else {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n }\n }\n else if (mode == 9) {\n background(0);\n noStroke();\n fill(234,100,255);\n String bandName = \"ELAPHANT\";\n text(bandName, (width/2) - (textWidth(bandName)/2), (height/2) + 75);\n }\n else {\n background(0);\n }\n }",
"private void drawGrid(){\r\n\r\n\t\tdrawHorizontalLines();\r\n\t\tdrawVerticalLines();\r\n\t}",
"@Override\r\n public void actionPerformed(ActionEvent e) {\n progress_stack = progress_stack_bkup;\r\n\r\n rec_points = rec_points_bkup;\r\n rec_colors = rec_colors_bkup;\r\n\r\n squ_points = squ_points_bkup;\r\n squ_colors = squ_colors_bkup;\r\n\r\n ell_points = ell_points_bkup;\r\n ell_colors = ell_colors_bkup;\r\n\r\n cir_points = cir_points_bkup;\r\n cir_colors = cir_colors_bkup;\r\n\r\n str_points = str_points_bkup;\r\n str_colors = str_colors_bkup;\r\n\r\n poly_points = poly_points_bkup;\r\n poly_colors = poly_colors_bkup;\r\n\r\n handdraw_points = handdraw_points_bkup;\r\n handdraw_colors = handdraw_colors_bkup;\r\n\r\n\r\n if(rec_colors.size()>0){\r\n repaint_shapes(\"rec\", rec_colors, rec_points);\r\n }\r\n\r\n //repaint circle\r\n if(cir_colors.size()>0){\r\n repaint_shapes(\"cir\", cir_colors, cir_points);\r\n }\r\n\r\n //repaint square\r\n if(squ_colors.size()>0){\r\n repaint_shapes(\"squ\", squ_colors, squ_points);\r\n }\r\n\r\n //repaint ellipse\r\n if(ell_colors.size()>0){\r\n repaint_shapes(\"ell\", ell_colors, ell_points);\r\n }\r\n\r\n //repaint straight line\r\n if(str_colors.size()>0){\r\n repaint_shapes(\"str\", str_colors, str_points);\r\n }\r\n\r\n //repaint polygons\r\n if(poly_colors.size()>0){\r\n //polygon repaint\r\n ArrayList<Integer> separate_index = get_separate_index(poly_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n\r\n //other shapes\r\n for (int j = 0; j < separate_index.size()-1; j++) {\r\n Color polygon_color = poly_colors.get(j);\r\n //each shape repaint\r\n int begin_index = separate_index.get(j);\r\n int end_index = separate_index.get(j+1);\r\n\r\n //get polygon points arraylist\r\n for (int k = (begin_index+1); k < end_index; k++) {\r\n points.add(poly_points.get(k));\r\n\r\n }\r\n System.out.println(points);\r\n\r\n //repaint one polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int k = 0; k < line_num; k++) {\r\n int begin_point = k*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(polygon_color);\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n }\r\n points.clear();\r\n }\r\n\r\n //the last polygon\r\n //get last shape points arraylist\r\n int index = separate_index.get(separate_index.size()-1);\r\n for (int j = index+1; j < poly_points.size(); j++) {\r\n points.add(poly_points.get(j));\r\n }\r\n System.out.println(points);\r\n //using points to repaint polygon\r\n int line_num = points.size()/2 - 1 ;\r\n for (int j = 0; j < line_num; j++) {\r\n int begin_point = j*2;\r\n x1 = points.get(begin_point);\r\n y1 = points.get(begin_point + 1);\r\n x2 = points.get(begin_point + 2);\r\n y2 = points.get(begin_point + 3);\r\n\r\n g.setColor(poly_colors.get(poly_colors.size()-1));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n }\r\n\r\n //repaint freehand lines\r\n if(handdraw_colors.size()>0){\r\n //repaint all handdraw\r\n ArrayList<Integer> separate_index = get_separate_index(handdraw_points);\r\n ArrayList<Integer> points = new ArrayList<Integer>();\r\n for (int i = 0; i < handdraw_colors.size(); i++) {\r\n //each handdraw\r\n //take all points in one draw\r\n if(i == 0){\r\n //first draw\r\n int begin_index = 0;\r\n int end_index = separate_index.get(i);\r\n //get all points in first drawing\r\n for (int j = begin_index; j < end_index; j++) {\r\n points.add(handdraw_points.get(j));\r\n }\r\n //repaint first drawing\r\n System.out.println(points);\r\n\r\n int line_num = points.size()/2 - 1;\r\n for (int j = 0; j < line_num; j++) {\r\n //draw each short line\r\n begin_index = j*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n points.clear();\r\n\r\n }else{\r\n //draw other handdraws\r\n for (int j = 0; j < handdraw_colors.size()-1; j++) {\r\n //draw each drawing\r\n\r\n int begin_index = separate_index.get(j)+1;\r\n int end_index = separate_index.get(j+1);\r\n //get all points in one drawing\r\n for (int k = begin_index; k < end_index; k++) {\r\n points.add(handdraw_points.get(k));\r\n }\r\n System.out.println(points);\r\n\r\n //repaint drawing\r\n int line_num = points.size()/2 - 1;\r\n for (int k = 0; k < line_num; k++) {\r\n //each line\r\n begin_index = k*2;\r\n\r\n x1 = points.get(begin_index);\r\n y1 = points.get(begin_index + 1);\r\n x2 = points.get(begin_index + 2);\r\n y2 = points.get(begin_index + 3);\r\n\r\n g.setColor(handdraw_colors.get(i));\r\n g.drawLine(x1, y1, x2, y2);\r\n\r\n canvas.repaint();\r\n\r\n }\r\n\r\n points.clear();\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }",
"public static void showShapes(DrawingPanel panel, boolean integrity) {\n int i = 0;\n while (i < numShapes){\n if (integrity){\n graphicsSetColor(panel, i);//calls method to set shape[i] color\n }\n else if (!integrity){\n setNoColor(panel);//calls method to set shape[i] to white\n }\n if (shapes[i].equalsIgnoreCase(\"square\")){ //if the i-th shape is a \"Square\", it calls the method showSquare()\n showSquare(panel, i, integrity);\n }\n else if (shapes[i].equalsIgnoreCase(\"circle\")){// if the i-th shape is a \"Circle\", it calls the method showCircle()\n showCircle(panel, i, integrity);\n }\n ++i;\n }\n }",
"void displayShape(Shape shape);",
"public static void mainDraw(Graphics graphics) {\n Color[] colors = {Color.green, Color.blue, Color.red, Color.cyan};\n int rectangles[] = {50, 100, 150, 200};\n for (int k = 0; k < 4; k++) {\n toCenter(graphics, rectangles[k], colors[k]);\n }\n }",
"private void paintAllObjects()\n {\n for (int i = 0; i < allObjects.size(); i++)\n {\n JComponent c = (JComponent) allObjects.get(i);\n\n c.setBackground(backgroundColor);\n c.setForeground(foregroundColor);\n }\n }",
"@Override\n protected void onDraw(Canvas canvas) {\n // Draw the components\n Arrange();\n box.draw(canvas);\n for (Node node : nodes) {\n node.draw(canvas);\n }\n line.draw(canvas);\n invalidate(); // Force a re-draw\n }",
"void drawShape(Shape s) {\n }",
"public void draw() {\n }",
"public void draw() \r\n\t{\r\n\t\tdraw(root, new RectHV(0,0,1,1) );\r\n\t}",
"public void setShapes(ArrayList<DrawableGUIShape> shapes) {\n if (shapes == null) {\n throw new IllegalArgumentException(\"invalid shape list\");\n } else {\n for (DrawableGUIShape s : shapes) {\n if (s == null) {\n throw new IllegalArgumentException(\"invalid shape list\");\n }\n }\n }\n this.shapes.clear();\n this.shapes.addAll(shapes);\n }",
"public void draw() {\n draw(root, true);\n }",
"private void draw() {\n\n // Current generation (y-position on canvas)\n int generation = 0;\n\n // Looping while still on canvas\n while (generation < canvasHeight / CELL_SIZE) {\n\n // Next generation\n cells = generate(cells);\n\n // Drawing\n for (int i = 0; i < cells.length; i++) {\n gc.setFill(colors[cells[i]]);\n gc.fillRect(i * CELL_SIZE, generation * CELL_SIZE, CELL_SIZE, CELL_SIZE);\n }\n\n // Next line..\n generation++;\n }\n }",
"public void drawStars()\r\n\t{\r\n\t\tIterator<Star> iterator = stars.iterator();\r\n\t\twhile (iterator.hasNext())\r\n\t\t{\r\n\t\t\tStar s = iterator.next();\r\n\t\t\tstarCircles.add(drawStar(s.x, s.y));\r\n\t\t}\r\n\t}",
"public void update(List<Shape> currentShapes) {\n\t\tthis.listOfShapes = currentShapes;\n\t\trepaint();\n\n\t}",
"public void drawShape(RShape shape) {\n // Recurse through any children of this shape\n for (int i = 0; i < shape.countChildren(); i++) {\n RShape s = shape.children[i];\n drawShape(s);\n }\n\n // Iterate through each path of the shape, drawing them to the screen\n for (int i = 0; i < shape.countPaths(); i++) {\n // Get the points of the current path\n RPath p = shape.paths[i];\n RPoint[] points = p.getPoints();\n\n // Connect each of the points using lines\n for (int k = 0; k < points.length - 1; k++) {\n line(points[k].x, points[k].y, points[k + 1].x, points[k + 1].y);\n }\n }\n }",
"public void draw() {\n draw(root, false);\n }",
"public void paint() {\r\n\r\n\t\tsuper.paint();\r\n\t\r\n\t\tint len = _composites.size();\r\n\t\tfor (int i = 0; i < len; i++) {\r\n\t\t\tComposite c = _composites.get(i);\r\n\t\t\tc.paint();\r\n\t\t}\t\t\t\t\t\t\r\n\t}",
"@Override\n\tpublic void draw() {\n\t\tdecoratedShape.draw();\n\t}",
"public void draw()\n {\n Rectangle hatbox = new Rectangle(x, y, 20, 20);\n hatbox.fill();\n Rectangle brim = new Rectangle(x-10, y+20, 40, 0);\n brim.draw();\n Ellipse circle = new Ellipse (x, y+20, 20, 20);\n circle.draw();\n Ellipse circle2 = new Ellipse (x-10, y+40, 40, 40);\n circle2.draw();\n Ellipse circle3 = new Ellipse (x-20, y+80, 60, 60);\n circle3.draw();\n \n }",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g); // Wipes the screen\n\n\n if (array != null) {\n if (btnCircles.isSelected()) {\n // Circle\n\n float angle = (float) (2.0f * Math.PI / array.get_array_length());\n for (int i = 0; i < array.get_array_length(); i++) {\n // Change color via hue\n Color c = Color.getHSBColor(1.0f * array.get_value(i) / array.get_max_int(), 1.0f, 0.7f);\n g.setColor(c);\n\n // tRiGoNoMeTrY iS uSeFuL\n int[] x = {0, 0, 0};\n int[] y = {0, 0, 0};\n x[0] = canvas.getWidth() / 2;\n y[0] = canvas.getHeight() / 2;\n x[1] = (int) (x[0] * Math.cos((i) * angle + Math.PI / 2.0f) + x[0]);\n y[1] = (int) (y[0] * -Math.sin((i) * angle + Math.PI / 2.0f) + y[0]);\n x[2] = (int) (x[0] * Math.cos((i + 1) * angle + Math.PI / 2.0f) + x[0]);\n y[2] = (int) (y[0] * -Math.sin((i + 1) * angle + Math.PI / 2.0f) + y[0]);\n\n g.fillPolygon(x, y, 3);\n }\n } else {\n // Bars\n\n // Calculate box width and heights\n float column_width = 1.0f * canvas.getWidth() / array.get_array_length();\n float row_height = 1.0f * (canvas.getHeight()) / array.get_max_int();\n\n for (int i = 0; i < array.get_array_length(); i++) {\n // Change color\n Color c = Color.getHSBColor(1.0f * array.get_value(i) / array.get_max_int(), 1.0f, 0.7f);\n g.setColor(c);\n\n // Calculate x and y positions\n float x = i * column_width;\n x = Math.max(x, 1.0f);\n float y = canvas.getHeight() - (array.get_value(i) * row_height);\n\n // Draw box\n g.fillRect((int) x, (int) y, (int) column_width, canvas.getHeight() - (int) y);\n }\n }\n }\n }",
"void buildRectangles(){\n background(255);\n for(int i=0;i<arr.length;i++){\n noStroke();\n Rect r=new Rect(40+i*80,400,75,-arr[i]*20,color1);\n createRectangle(r,color1);\n }\n }",
"public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}",
"public void paint () {\n\t\tPaint.clear();\n\t\t\n\t\tPaint.setColor(Color.WHITE);\n\t\tPaint.fillRect(0,0,numcols_ * cellsize_,numrows_ * cellsize_);\n\t\tPaint.setColor(Color.GRAY);\n\t\tPaint.drawRect(0,0,numcols_ * cellsize_ - 1,numrows_ * cellsize_ - 1);\n\n\t\tfor ( int row = 0 ; row < numrows_ ; row++ ) {\n\t\t\tfor ( int col = 0 ; col < numcols_ ; col++ ) {\n\t\t\t\tint x = col * cellsize_;\n\t\t\t\tint y = row * cellsize_;\n\n\t\t\t\tThing thing = at(row,col);\n\t\t\t\tif ( thing != null ) {\n\t\t\t\t\tthing.paint(x,y,cellsize_,cellsize_);\n\t\t\t\t}\n\t\t\t\tPaint.setColor(Color.GRAY);\n\t\t\t\tPaint.drawRect(x,y,cellsize_,cellsize_);\n\t\t\t}\n\t\t}\n\n\t}",
"public void paint(Graphics g) {\n\t\t\tsuper.paint(g); // don't remove - required for GUI widgets to draw correctly\n\t\t\t/************************\n\t\t\t * Late Binding Demo\n\t\t\t ************************/\n\t\t\tfor (int i = 0; i < myShapes.length; i++) {\n\t\t\t\t// which draw method is invoked here?\n\t\t\t\t// There are many forms of the method (polymorphic),\n\t\t\t\t// so which is chosen?\n\t\t\t\t// Java has RTTI (run-time type info)\n\t\t\t\t// about every object,\n\t\t\t\t// and it uses this info to choose\n\t\t\t\t// the correct method to invoke!\n\t\t\t\tmyShapes[i].draw(g);\n\t\t\t}\n\t\t}",
"public void draw() \n\t {\n\t\t draw(root,0,0,1,1,true);\n\t }"
]
| [
"0.76907516",
"0.7499032",
"0.7499032",
"0.7499032",
"0.7255377",
"0.70922023",
"0.69829506",
"0.6937083",
"0.68589276",
"0.68421733",
"0.67149633",
"0.6664942",
"0.66621983",
"0.66124374",
"0.6590853",
"0.65762293",
"0.65554816",
"0.6528602",
"0.6528511",
"0.6490931",
"0.6474765",
"0.64580613",
"0.64274144",
"0.63821083",
"0.6380174",
"0.63607836",
"0.6343553",
"0.63323015",
"0.63316625",
"0.63173753",
"0.63159376",
"0.63129765",
"0.63044125",
"0.62985086",
"0.6291089",
"0.62589717",
"0.6253464",
"0.62498915",
"0.6228307",
"0.6218775",
"0.6216999",
"0.6193832",
"0.61855775",
"0.61441034",
"0.6138094",
"0.6133811",
"0.61276644",
"0.6125511",
"0.61203384",
"0.6105452",
"0.6097995",
"0.6094079",
"0.60802746",
"0.60709417",
"0.6065716",
"0.60267717",
"0.60134846",
"0.5997572",
"0.5984215",
"0.59834623",
"0.5981221",
"0.59782505",
"0.5964295",
"0.5957745",
"0.59539557",
"0.5947124",
"0.5945819",
"0.5933128",
"0.5927244",
"0.5919386",
"0.5904811",
"0.5900793",
"0.58855486",
"0.5880466",
"0.58714426",
"0.58628386",
"0.58574545",
"0.58530957",
"0.5851756",
"0.5844819",
"0.5843151",
"0.5839432",
"0.5836908",
"0.5823423",
"0.5823325",
"0.5822174",
"0.581431",
"0.5814272",
"0.5812514",
"0.58078897",
"0.5806942",
"0.5802554",
"0.5793193",
"0.5791285",
"0.57875645",
"0.57835364",
"0.5781865",
"0.57805085",
"0.5772545",
"0.5768578"
]
| 0.7532462 | 1 |
return cloned object to avoid changing it by the client application | public HashMap<String, String> getProperties() {
return (HashMap<String, String>) properties.clone();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object clone();",
"Object clone();",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"public Object clone() {\n return this.copy();\n }",
"public abstract Object clone();",
"public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }",
"@Override\n public Object clone() {\n return super.clone();\n }",
"public abstract Object clone() ;",
"public Function clone();",
"public Object clone(){\n \t\n \treturn this;\n \t\n }",
"public Object clone ()\n\t{\n\t\ttry \n\t\t{\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch (CloneNotSupportedException e) \n\t\t{\n throw new InternalError(e.toString());\n\t\t}\n\t}",
"public Object clone() {\n try {\n return super.clone();\n } catch (Exception exception) {\n throw new InternalError(\"Clone failed\");\n }\n }",
"public Object clone()\n/* */ {\n/* 835 */ return super.clone();\n/* */ }",
"public Object clone()\n {\n try {\n Object newObj = super.clone();\n ((LDAPUrl)newObj).url = (com.github.terefang.jldap.ldap.LDAPUrl)this.url.clone();\n return newObj;\n } catch( CloneNotSupportedException ce) {\n throw new RuntimeException(\"Internal error, cannot create clone\");\n }\n }",
"public Object clone()\n {\n Object o = null;\n try\n {\n o = super.clone();\n }\n catch (CloneNotSupportedException e)\n {\n e.printStackTrace();\n }\n return o;\n}",
"public Object clone() throws CloneNotSupportedException { return super.clone(); }",
"@Override\n\tpublic Object clone() {\n\t\treturn null;\n\t}",
"public Object clone () {\n\t\t\ttry {\n\t\t\t\treturn super.clone();\n\t\t\t} catch (CloneNotSupportedException e) {\n\t\t\t\tthrow new InternalError(e.toString());\n\t\t\t}\n\t\t}",
"public Object clone() {\r\n try {\r\n return super.clone();\r\n } catch (CloneNotSupportedException e) {\r\n return null;\r\n }\r\n }",
"public Object clone() {\n\t\ttry {\n\t\t\treturn super.clone();\n\t\t}\n\t\tcatch(CloneNotSupportedException exc) {\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }",
"@Override\n protected Object clone() throws CloneNotSupportedException {\n\n return super.clone();\n }",
"public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}",
"private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }",
"@Override\n protected Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n // return super.clone(); // OR we can return the already present :: return getInstance();\n }",
"@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}",
"public Object clone() {\n \n\tQuerynotyfyaddressbol obj = new Querynotyfyaddressbol(getObjectsDatastore());\n\n\tobj.iNotifyaddress = iNotifyaddress; \n\n\treturn obj;\n }",
"@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"@Override\n public Object clone() throws CloneNotSupportedException{\n return super.clone();\n }",
"public Object clone() {\n GlobalizedAnswer cloned;\n try {\n cloned = (GlobalizedAnswer)super.clone();\n }\n catch (CloneNotSupportedException e) {\n throw new Error(getClass() + \" must support cloning\", e);\n }\n assert cloned != null;\n \n // Copy mutable fields by value\n cloned.tuples = (Tuples) tuples.clone();\n \n return cloned;\n }",
"public Cliente clone(){\r\n return new Cliente(this.nome, this.email, this.endereco, this.id);\r\n }",
"@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }",
"@Override\n public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }",
"Component deepClone();",
"@Override\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError(e);\n }\n }",
"public Object clone() {\n try {\n // clones itself\n return super.clone();\n } catch (Exception exception) {\n ;\n }\n return null;\n }",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}",
"public Object clone() throws CloneNotSupportedException {\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}",
"public /*@ non_null @*/ Object clone() {\n return this;\n }",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\r\n\t}",
"Prototype makeCopy();",
"static <T> T clone(T in) throws IOException {\n\t\tByteArrayOutputStream bOut = new ByteArrayOutputStream();\n\t\tMap<Long, Object> smugglerCache = new HashMap<>();\n\t\ttry (ObjectOutputStream out = new LiveObjectOutputStream(bOut, smugglerCache)) {\n\t\t\tout.writeObject(in);\n\t\t}\n\t\ttry {\n\t\t\treturn (T) new LiveObjectInputStream(\n\t\t\t\t\tnew ByteArrayInputStream(bOut.toByteArray()),\n\t\t\t\t\tsmugglerCache)\n\t\t\t\t.readObject();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tthrow new AssertionError(\"We just serialized this object a minute ago. The class cannot be missing\", e);\n\t\t}\n\t}",
"@Override\n public SharedObject clone() {\n SharedObject c;\n try {\n c = (SharedObject)super.clone();\n } catch (CloneNotSupportedException e) {\n // Should never happen.\n throw new ICUCloneNotSupportedException(e);\n }\n c.refCount = new AtomicInteger();\n return c;\n }",
"public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }",
"public Object clone() throws CloneNotSupportedException {\n // return INSTANCE\n throw new CloneNotSupportedException();\n }",
"@Override\n public MetaContainer clone() {\n return clone(false);\n }",
"@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"public Client copy() {\n\t\tClient clone = new Client(ID, Email, PostalAddress);\n\t\treturn(clone);\n\t}",
"public CMObject copyOf();",
"public final Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }",
"public Object clone(){ \r\n\t\tBaseballCard cloned = new BaseballCard();\r\n\t\tcloned.name = this.getName();\r\n\t\tcloned.manufacturer=this.getManufacturer();\r\n\t\tcloned.year = this.getYear();\r\n\t\tcloned.price = this.getPrice();\r\n\t\tcloned.size[0]= this.getSizeX();\r\n\t\tcloned.size[1]= this.getSizeY();\r\n\t\treturn cloned;\r\n\t}",
"public Object clone()\n {\n Object o = null;\n try \n { o = super.clone(); } \n catch(CloneNotSupportedException e) \n { System.err.println(\"Erreur dans le clonage de la cellule...\"); }\n return o;\n }",
"Model copy();",
"@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\treturn super.clone();\n\t}",
"public T cloneDeep();",
"public abstract Pessoa clone();",
"public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n /* Cannot happen */\n throw new RuntimeException(e.getMessage(), e);\n }\n }",
"@Override\n public User clone(){\n return new User(this);\n }",
"@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }",
"@Override\n protected Currency clone() {\n final Currency currency = new Currency();\n if (data != null) {\n currency.data = data.clone();\n }\n return currency;\n\n }",
"@Override\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\n\t}",
"@Override\n public FieldEntity copy()\n {\n return state.copy();\n }",
"@Override \n public Object clone() {\n try {\n Resource2Builder result = (Resource2Builder)super.clone();\n result.self = result;\n return result;\n } catch (CloneNotSupportedException e) {\n throw new InternalError(e.getMessage());\n }\n }",
"@Override \n public Door clone()\n {\n try\n {\n Door copy = (Door)super.clone();\n \n //a copy of the location class\n copy.room = room.clone(); \n \n return copy;\n }\n catch(CloneNotSupportedException e)\n {\n throw new InternalError();\n }\n }",
"protected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"public Scm clone()\n {\n try\n {\n Scm copy = (Scm) super.clone();\n\n if ( copy.locations != null )\n {\n copy.locations = new java.util.LinkedHashMap( copy.locations );\n }\n\n return copy;\n }\n catch ( java.lang.Exception ex )\n {\n throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()\n + \" does not support clone()\" ).initCause( ex );\n }\n }",
"public Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\n\t}",
"public Object clone() throws CloneNotSupportedException\n\t{\n\t\tthrow new CloneNotSupportedException();\n\t}",
"@SuppressWarnings(\"unchecked\")\n \tprivate <T extends Entity<T>> T _clone(Entity<T> obj) throws RaplaException {\n \t\tEntity<T> deepClone = ((Mementable<T>) obj).deepClone();\n \t\tT clone = deepClone.cast();\n \n \t\tRaplaType raplaType = clone.getRaplaType();\n \t\tif (raplaType == Appointment.TYPE) {\n \t\t\t// Hack for 1.6 compiler compatibility\n \t\t\tObject temp = clone;\n \t\t\t((AppointmentImpl) temp).removeParent();\n \t\t}\n \t\tif (raplaType == Category.TYPE) {\n \t\t\t// Hack for 1.6 compiler compatibility\n \t\t\tObject temp = clone;\n \t\t\t((CategoryImpl) temp).removeParent();\n \t\t}\n \n \t\tsetNew((RefEntity<T>) clone, this.workingUser);\n \t\treturn clone;\n \t}",
"public Object clone()\n\t{\n\t\treturn new Tree();\n\t}",
"public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException(\"clone() is not supported in \"+this.getClass().getName());\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic <T> T clon(){\n\t\ttry {\n\t\t\treturn (T) this.clone();\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn (T) new Object();\n\t}",
"public Object clone() throws CloneNotSupportedException{\n\t\tthrow (new CloneNotSupportedException());\n\t}",
"public MobileEntity getclone(MobileEntity ws){\n return ws.MakeCopy();\n }",
"public Object clone(){\n\t\tVehicle car;\n\t\ttry{\n\t\t\tcar = (Vehicle) super.clone();\n\t\t} catch(CloneNotSupportedException e){\n\t\t\treturn null;\n\t\t}\n\t\t\treturn car;\n\t\t}",
"public Object clone() throws CloneNotSupportedException {\n\tthrow new CloneNotSupportedException(\"This is a Singleton Ojbect; Buzz off\");\n }",
"private static Object deepClone(Object object) {\n try {\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);\n objectOutputStream.writeObject(object);\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());\n ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);\n return objectInputStream.readObject();\n }\n catch (Exception e) {\n return null;\n }\n }",
"public Object clone() {\r\n\t\tUser cloned = new User();\r\n\t\tif (this.password != null)\r\n\t\t\tcloned.setPassword(new String(this.password));\r\n\t\tif (this.name != null)\r\n\t\t\tcloned.setName(new String(this.name));\r\n\t\tif (this.roles.get(0) != null)\r\n\t\t\tcloned.roles.add(new Role(this.roles.get(0).getRole()));\r\n\t\treturn cloned;\r\n\t}",
"public Object clone(){\n\t\tRouter prot = null;\n\t\ttry{\n\t\t\tprot = (Router) super.clone();\n\t\t}catch( CloneNotSupportedException e ) {} // never happens\n\t\treturn prot;\n\t}",
"public Entity clone() {\n try {\n return (Entity) super.clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n return null;\n }\n }",
"org.omg.CORBA.Object _duplicate();",
"public BufferTWeak cloneMe() {\r\n BufferTWeak ib = new BufferTWeak(uc);\r\n ib.increment = increment;\r\n ib.set(new Object[objects.length]);\r\n for (int i = 0; i < objects.length; i++) {\r\n ib.objects[i] = this.objects[i];\r\n }\r\n ib.offset = this.offset;\r\n ib.count = this.count;\r\n return ib;\r\n }",
"public Object clone() {\n return new RelevantObjectsCommand(name, \n relevantStateVariables, \n relevantObjects,\n relevancyRelationship);\n }",
"private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }"
]
| [
"0.83064145",
"0.83064145",
"0.80941105",
"0.80941105",
"0.80941105",
"0.80941105",
"0.7858263",
"0.7815407",
"0.7800865",
"0.77739054",
"0.7738905",
"0.768743",
"0.7504584",
"0.7458981",
"0.7447127",
"0.7389672",
"0.73856914",
"0.7328174",
"0.7327682",
"0.73129493",
"0.7311228",
"0.72714067",
"0.7242216",
"0.72412515",
"0.72412515",
"0.72412515",
"0.71926934",
"0.7178423",
"0.71707624",
"0.7158052",
"0.7154189",
"0.71511114",
"0.7143788",
"0.71415335",
"0.71284556",
"0.71239865",
"0.7116802",
"0.7113632",
"0.7110367",
"0.7106168",
"0.709751",
"0.7093669",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70803636",
"0.70640165",
"0.70559376",
"0.7054956",
"0.7052399",
"0.70417774",
"0.7033389",
"0.70325905",
"0.7026896",
"0.70230997",
"0.70228577",
"0.69869256",
"0.69869256",
"0.69869256",
"0.69764024",
"0.6975368",
"0.69744664",
"0.6971417",
"0.696879",
"0.69669014",
"0.6965077",
"0.6949348",
"0.6941449",
"0.69361174",
"0.6932656",
"0.6926048",
"0.6877563",
"0.68714046",
"0.68705547",
"0.68698895",
"0.6865429",
"0.6864393",
"0.68619275",
"0.68616456",
"0.68606436",
"0.68533653",
"0.6850924",
"0.68416506",
"0.6839438",
"0.6837955",
"0.6835701",
"0.68263835",
"0.68229246",
"0.68052936",
"0.67987025",
"0.6792741",
"0.67793435",
"0.6778426",
"0.67773217",
"0.6775311",
"0.6750602"
]
| 0.0 | -1 |
Insert a new element at the rear of the queue If queue is full, resizes | public void enqueueRear(int n); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void enqueue(E e) {\n\t\tint index = (pos + size) % queue.length;\n\t\tqueue[index] = e;\n\t\tsize++;\n\t}",
"public void queue(Object newItem){\n if(isFull()){\n System.out.println(\"queue is full\");\n return;\n }\n ArrayQueue[++rear] = newItem;\n if(front == -1)\n front = 0;\n \n }",
"@Override\r\n\tpublic void enqueueRear(E element) {\n\t\tif(sizeDeque == CAPACITY) return;\r\n\t\tif(sizeDeque == 0) {\r\n\t\t\tdata[backDeque] = element;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tbackDeque = (backDeque + 1)%CAPACITY;\r\n\t\t\tdata[backDeque] = element;\r\n\t\t}\r\n\t\t\r\n\t\tsizeDeque++;\r\n\t}",
"private void queueResize() {\n queue = Arrays.copyOf(queue, queue.length + 1);\n }",
"@Override\n\tpublic void enqueue(E e) {\n\t\tif(size==data.length-1){\n\t\t\tresize();\n\t\t}\n\t\tif(rear==data.length-1){\n\t\t\tdata[rear]=e;\n\t\t\tsize++;\n\t\t\trear=(rear+1)%data.length;\n\t\t}else{\n\t\t\tsize++;\n\t\t\tdata[rear++]=e;\n\t\t}\n\t\t\n\t\t\n\t}",
"private void growQueue() {\n Runnable[] oldQ = queue;\n int oldSize = oldQ.length;\n int newSize = oldSize << 1;\n if (newSize > MAXIMUM_QUEUE_CAPACITY)\n throw new RejectedExecutionException(\"Queue capacity exceeded\");\n Runnable[] newQ = queue = new Runnable[newSize];\n\n int b = base;\n int bf = b + oldSize;\n int oldMask = oldSize - 1;\n int newMask = newSize - 1;\n do {\n int oldIndex = b & oldMask;\n Runnable t = oldQ[oldIndex];\n if (t != null && !casSlotNull(oldQ, oldIndex, t))\n t = null;\n setSlot(newQ, b & newMask, t);\n } while (++b != bf);\n pool.signalWork();\n }",
"public void offer(E e) {\n if (e == null) throw new NullPointerException();\n queue[currentPos++] = e;\n size++;\n\n if (currentPos == queue.length) resize();\n }",
"public void enqueue(E e) {\n if (e == null){\n throw new NullPointerException();\n }\n\n int x = size;\n size++;\n\n if (x+1 >= queue.length-1){\n this.queue = resize((E[])queue, queue.length*2);\n }\n //size = size + 1;\n if (x == 0){\n queue[0] = e;\n }else{\n\n if (size == queue.length){\n resize((E[])queue, queue.length*2);\n }\n queue[findNull()] = e;\n shift();\n\n }\n }",
"void enqueue(E newEntry);",
"private void growQueue() {\n int newSize = (int)(QUEUE.length * 1.5f);\n \n Logger.log(\"INFO\", \"Queue is full, growing to new size: \" + Integer.toString(newSize));\n \n Object[] newQueue = new Object[newSize];\n lockQueue();\n copyQueue(newQueue);\n unlockQueue();\n }",
"public void enqueue(Integer elem) {\n\t\t // add to end of array\n\t\t // increase size\n\t\t // create a recursive helper, percolateUp,\n\t\t // that allows you puts the inserted val \n\t\t // in the right place\n\t\t if(size == capacity) {\n\t\t\t ensureCapacity(size);\n\t\t }\n\t\t data[size] = elem;\n\t\t size++;\n\t\t percolateUp(size-1); \n\t }",
"public void enqueue (E element);",
"private void enqueue(E x) {\n final Object[] items = this.items;\n items[putIndex] = x;\n if (++putIndex == items.length) putIndex = 0;\n count++;\n notEmpty.signal();\n }",
"@Override\r\n\tpublic void enqueue(Object element){\r\n\t\tif(head == null) {\r\n\t\t\thead = new Node(element);\r\n\t\t\ttail = head;\r\n\t\t}else {\r\n\t\t\ttail.next = new Node(element);\r\n\t\t\ttail = tail.next;\r\n\t\t}\r\n\t\tsize++;\r\n\t}",
"public void enqueue(T element);",
"@Override\n public void enqueue(E e) {\n array.addLast(e);\n }",
"public synchronized void enqueue(T thing) {\r\n\t\twhile (queue.size()==maxSize){\r\n\t\t\ttry{\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch(InterruptedException e){\r\n\t\t\t\tSystem.out.println(\"Interruption during enqueue\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tqueue.addLast(thing);\r\n\t\tthis.notifyAll();\r\n\t}",
"public void enqueue(E e) {\n\t\tlist.addLast(e);\n\t}",
"@Override\n public void enqueue(Object element) {\n LinkedNode<T> node = new LinkedNode<T>((T) element);\n if (isEmpty()) {\n front = node;\n } else {\n rear.setNext(node);\n }\n rear = node;\n count++;\n\n }",
"@Override\r\n\tpublic void enqueueFront(E element) {\n\t\tif(sizeDeque == CAPACITY) return;\r\n\t\tif(sizeDeque == 0) {\r\n\t\t\tdata[frontDeque] = element;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfrontDeque = (frontDeque - 1 + CAPACITY) % CAPACITY;\r\n\t\t\tdata[frontDeque] = element;\r\n\t\t}\r\n\t\t\r\n\t\tsizeDeque++;\r\n\t}",
"@Override\r\n\tpublic boolean enqueue(T element) {\r\n\t\t\r\n\t\t// checking if queue is already full or not\r\n\t\tif (isFull()) {\r\n\t\t\tthrow new AssertionError(\"Queue is full\");\r\n\t\t} else {\r\n\t\t\tif (this.front == -1) {\r\n\t\t\t\tthis.front = 0;\r\n\t\t\t}\r\n\t\t\tthis.rear = (this.rear + 1) % this.size;\r\n\t\t\tthis.array[this.rear] = (Integer)element;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public void push(E elem) {\n if (elem != null) {\r\n contents[++top] = elem;\r\n }\r\n\r\n // Usually better to resize after an addition rather than before for\r\n // multi-threading reasons. Although, that is not important for this class.\r\n if (top == contents.length-1) resize();\r\n }",
"public void enqueue(E element) {\n\t\tadd(element);\n\t}",
"public void enqueue(T item) {\n\t\tif(rear == capacity)\n\t\t\treSize();\n\t\tarr[rear] = item;\n\t\tSystem.out.println(\"Added: \" + item);\n\t\trear++;\n\t\tsize++;\n\t}",
"@Override\n public boolean offer(E e) {\n if(e== null || (limited && size >= length)) {\n return false;\n }\n queue[size++] = e;\n Arrays.sort(queue, comparator);\n if(size >= queue.length) {\n queueResize();\n }\n return true;\n }",
"public void enqueue(E item) throws IllegalStateException {\n if (size == arrayQueue.length) {\n throw new IllegalStateException(\"Queue is full\");\n }\n int available = (front + size) % arrayQueue.length;\n arrayQueue[available] = item;\n size++;\n }",
"private void resize() {\n Object[] newQueue = new Object[(int) (queue.length * 1.75)];\n System.arraycopy(queue, startPos, newQueue, 0, queue.length - startPos);\n\n currentPos = queue.length - startPos;\n startPos = 0;\n queue = newQueue;\n\n }",
"public void enqueue(E e) {\n\t\t\tsynchronized (this.pq) {\n\t\t\t\tthis.pq.add(e);\n//\t\t\t\tSystem.out.println(\"insert \" + e);\n\t\t\t}\n\t\t\tthis.sem.release();\n\t}",
"public boolean insert(E object){\r\n if(isFull())\r\n return false;\r\n \r\n //find index to insert object\r\n int loc = findInsertPoint(object, 0, currentSize-1);\r\n\r\n //right shift\r\n for(int i = currentSize-1; i >= loc; i--){\r\n queue[i+1] = queue[i];\r\n }\r\n\r\n queue[loc] = object; //insert object\r\n currentSize++; //accomodate for inserted object by adding to array size\r\n\r\n return true;\r\n }",
"public synchronized void insert(Integer e) {\r\n\t\ttry {\r\n\t\t\twhile (buffer.size() == maxSize) {\r\n\t\t\t\twait();\r\n\t\t\t}\r\n\t\t\tbuffer.add(e);\r\n\t\t\tnotify();\t\t\t\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\tThread.currentThread().interrupt();\r\n\t\t}\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void push(Object element) {\n\t\tif(size == capacity) {\n\t\t\tthrow new IllegalArgumentException(\"Capacity has been reached.\");\n\t\t}\n\t\tlist.add(0, (E) element);\n\t\tsize++;\n\t\t\n\t}",
"@Override\r\n\tpublic boolean enqueue(T e) throws QueueOverflowException {\r\n\t\tif (this.isFull()) {\r\n\t\t\tthrow new QueueOverflowException(\"The queue is full\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata.add(data.size(), e);\r\n\t\t}\r\n\t\t// Add element to the end of the Queue\t\t\r\n\t\treturn true;\r\n\t}",
"public void enqueue(Item item){\n if (item == null){ throw new NullPointerException(\"Cannot add a null item\"); }\n\n // fill the nulls\n if(itemCount < array.length) {\n for(int i=0;i<array.length;i++) {\n if(array[i] == null) {\n array[i] = item;\n break;\n }\n }\n }\n // resize when too big\n if(itemCount == array.length){\n resize(2*itemCount);\n array[itemCount] = item;\n }\n itemCount++; // Item added!!\n }",
"public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}",
"public void enqueue(E item) {\n addLast(item);\n }",
"public void insert(T element)\r\n\t{\n\t\tif (size >= data.length - 1)\r\n\t\t{\r\n\t\t\tresize();\r\n\t\t}\r\n\t\t\r\n\t\t//add the new element\r\n\t\tsize++;\r\n\t\tdata[size] = element;\r\n\t\tswim(size);\r\n\t}",
"public void insert(Object init)\n {\n\n if (isFull())\n // System.out.println(\"rear +1 = \"+(rear+1));\n if (front != 0)\n shift(front);\n else\n throw new QueueFullException((\"Full\"));\n queue[++rear] = init;\n nItems++;\n //System.out.println(\"object \" + init + \" rear is \" + rear + \" n items is \" + nItems + \" front is \" + front);\n }",
"void enqueue(E el);",
"public void offer(E e)\n {\n if(!mOverflow.get())\n {\n mQueue.offer(e);\n\n int size = mCounter.incrementAndGet();\n\n if(size > mMaximumSize)\n {\n setOverflow(true);\n }\n }\n }",
"public void enqueue (Item item){\n Node<Item> oldLast = last;\n last = new Node<Item>();\n last.item = item;\n last.next = null;\n if(isEmpty()) {first = last;}\n else oldLast.next = last;\n N++;\n }",
"private Queue<Integer> addToQueue(Queue<Integer> q, int item, int maxLength){\n q.add(item);\n while(q.size() > maxLength){\n q.remove(); //make sure the queue size isn't larger than its supposed to be\n }\n //System.out.println(\"queue_after_added \" + q);\n return q;\n }",
"@Override\r\n\tpublic void enqueue(T element)\r\n\t{\r\n\t\tLinkedNode<T> n = new LinkedNode<>(element);\r\n\r\n\t\t// if the only element in the queue, it becomes the first element\r\n\t\tif (head == null)\r\n\t\t{\r\n\t\t\thead = n;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// otherwise, the tail's next receives the new node\r\n\t\t\t// because later, tail will be the new node\r\n\t\t\ttail.next = n;\r\n\t\t}\r\n\r\n\t\t// always add at the end of the list\r\n\t\ttail = n;\r\n\t\tcount++;\r\n\t}",
"@Override\n public void enqueue(T value) {\n myQ[myLength] = value;\n myLength++;\n }",
"public void enqueue(E item) {\n Node<E> oldlast = last;\n last = new Node<E>();\n last.item = item;\n last.next = null;\n if (isEmpty()) first = last;\n else oldlast.next = last;\n n++;\n }",
"@Override\r\n\tpublic void enqueue(Item item) {\r\n\t\tif (item == null)\r\n\t\t\tthrow new NullPointerException(\"You cannot put a 'null' element inside the queue\");\r\n\t\tif (count == arr.length)\r\n\t\t\tresize(arr.length * 2);\r\n\t\tarr[count++] = item;\r\n\t}",
"public void enqueue(Item item) {\n if (item == null) {\n throw new IllegalArgumentException(\"Empty item\");\n }\n\n if (queue.length == qSize) {\n resize(qSize * 2);\n }\n\n queue[qSize] = item;\n qSize++;\n }",
"void enqueue(E item);",
"public static void enQueue(Queue q, String entry){ \n if (q.queuesize < q.names.length){ //If the queue isn't full - Size of queue is less than the set array size \n q.names[q.queuesize] = entry; //Set the value at the index of queue size to the input (Using the array in the Queue class to store this)\n q.queuesize +=1; //Increment the size of queue \n }\n }",
"@Override\n public void addElement(T element) {\n // TODO. \n // Pseudocode: \n // Check if array is at capacity, if so expand it. \n // add element to the array\n // increment count\n // if this is not the first element, then call heapifyAdd to check if the newly added\n // element needs to be swapped up the heap\n if (count == heap.length) {\n expandCapacity();\n\n }\n heap[count] = element;\n count++;\n\n if (count > 1) {\n heapifyAdd();\n }\n\n }",
"public void add(E element){\n\t\tArrayQueue<E> temp = new ArrayQueue<E>();\n\t\ttemp.enqueue(element);\n\t\tQ.enqueue(temp);\n\t}",
"public void push(Object element)\n\t{\n\t\tensureCapacity();\n\t\telements[size++] = element;\n\t}",
"public void enqueue(T pushed)\n\t{insert(pushed);}",
"public void enqueue(E e) {\n\t\tsynchronized(mutex){\n\t\t\ttry {\n\t\t\t\tqueue.add(e);\n\t\t\t} catch(NullPointerException ex) {\n\t\t\t\tthrow new NullPointerException(\"enqueued null element\");\n\t\t\t} catch (ClassCastException ex) {\n\t\t\t\tthrow new ClassCastException(\"enqueued element is incompetible type\");\n\t\t\t}\n\t\t\tsem.release();\n\t\t}\n\t}",
"public void enqueue(Item item) throws NoSuchElementException {\r\n // Usar el metodo upHeap para corregir la condicion de\r\n // Min Heap\r\n\r\n\r\n if (size == 0){\r\n heap[1] = item;\r\n size = 1;\r\n return;\r\n }\r\n int cur = size + 1;\r\n int par = cur/2;\r\n\r\n heap[cur] = item;\r\n size++;\r\n\r\n if (heap[cur].compareTo(heap[par]) > 0){\r\n upHeap(cur);\r\n }\r\n\r\n\r\n }",
"public void enqueue(T item) {\r\n\r\n\t\t++item_count;\r\n\t\tif(item_count==arr.length)\r\n\t\t\tdoubleArray();\r\n\t\tarr[++back%arr.length]=item;\r\n\t}",
"public void enqueue( MyTreeNode<T> treeNode ) {\n\t\tQueueNode newNode = new QueueNode(treeNode);\n\t\t// the queue is empty\n\t\tif ( tail == null ) {\n\t\t\t// the tail and the head point to the same only element in the collection\n\t\t\tthis.tail = newNode;\n\t\t\tthis.head = newNode;\n\t\t// the queue is not empty\n\t\t} else {\n\t\t\t// the second from the end item of the collection keeps track with the tail\n\t\t\tthis.tail.next = newNode;\n\t\t\t// the new element becomes the tail of the collection\n\t\t\tthis.tail = newNode;\n\t\t}\n\t}",
"public void enqueue(Item item) {\n if (item == null)\n throw new UnsupportedOperationException();\n \n// StdOut.println(\"count:\"+ count);\n// StdOut.println(\"N:\"+ N);\n// StdOut.println(\"randomizedQueue.length:\"+ randomizedQueue.length);\n if (count >= N) { \n resize(N*2); // double size of array if necessary\n N *= 2;\n } \n randomizedQueue[count++] = item; \n //assert\n }",
"public void enqueue(Object value)\n {\n queue.insertLast(value);\n }",
"public void put(E e) throws InterruptedException {\n checkNotNull(e);\n final ReentrantLock lock = this.lock;\n lock.lockInterruptibly();\n try {\n while (count == items.length)\n notFull.await();\n enqueue(e);\n } finally {\n lock.unlock();\n }\n }",
"@Override\n // worst-case complexity: O(n), since it might need to resize itself\n // amortised average-case complexity: O(1), since resizing happens too\n // too infrequent to affect the actual complexity\n public void add(T item) {\n if (size >= arr.length)\n arr = resize(arr, EXPAND_FACTOR);\n // we add the item to the end and then increment the size\n arr[size++] = item;\n }",
"public void enqueue (int elemento) {\n if(!isFull()){\n data[last] = elemento;\n count++;\n if(last == data.length-1) {\n last = 0;\n } else {\n last++;\n }\n }else{\n throw new RuntimeException(\"A fila está cheia\");\n }\n\n }",
"public void enqueue(int element) {\n\tr++;\n\tif(r-f==100){\n\t\tSystem.out.println(\"Queue Full\"); return;\n\t}\n\tmyarray[r%100]=element;\n\t\t// ..... fill the stub function ......\n\t}",
"@Override\n public void insert(int element) {\n if (isFull()) {\n throw new IllegalStateException(\"Heap is full.\");\n }\n\n // Percolate up\n usedSize++;\n heap[heapSize++] = element; // insert element\n heapifyUp(heapSize - 1);\n\n // Percolate down (doesn't work)\n //usedSize++;\n //heap[heapSize++] = element;\n //heapifyDown(heapSize - 1);\n }",
"public void put(T element) {\n\t\tcheckCapacity(size + 1);\n\t\tdata[size++] = element;\n\t}",
"@Override\n\tpublic void addToQueue() {\n\t}",
"void enqueue(T item) {\n contents.addAtTail(item);\n }",
"public void enqueue(Item item) {\n if (item == null) throw new IllegalArgumentException(\"Null argument\");\n\n if (n == a.length) resize(2*a.length);\n a[n++] = item;\n }",
"public void enqueue(T item) {\n\t\tNode<T> oldlast = last;\n\t\tlast = new Node<>();\n\t\tlast.item = item;\n\t\tlast.next = null;\n\t\tif (isEmpty()) first = last;\n\t\telse oldlast.next = last;\n\t\tN++;\n\t}",
"public void enqueue(Item item) {\n if (item == null) throw new NullPointerException();\n\n if (size == array.length) {\n Item[] temp = (Item[]) new Object[array.length * 2];\n System.arraycopy( array, 0, temp, 0, array.length);\n array = temp;\n temp = null;\n }\n array[size] = item;\n size++;\n if(size>1) { \n int x=StdRandom.uniform(size);\n Item temp=array[x];\n array[x]=array[size-1];\n array[size-1]=temp;\n }\n\n }",
"public void push(Object o){\n if (count<maxsize && maxsize!=-1)\n { insert(o);}\n else if (maxsize==-1){ insert(o);}\n else { System.out.println(\"Can't add element.\");}\n }",
"@Override\n public Object enqueue(Object x) {\n if (!isFull() && x != null){ // Pré-condição\n if (++tail >= MAX){\n tail = 0; // MAX-1 é a ultima posição do vetor\n }\n \n if (head == -1){\n head = tail;\n }\n \n memo[tail] = x;\n total++;\n return x;\n }\n else{ // Não pode inserir elemento nulo (x == null)\n return null; // Ou se a FILA estiver cheia\n }\n }",
"public void insert(E element)\n {\n this.size++;\n //Create new node with the given element \n Node toInsert = new Node(element);\n //Insert that element to the tail end of the filled elements\n heap.add(toInsert);\n int currentIndex = size-1;\n //Check to make sure the heap is still a valid max heap \n if (this.size > 1)\n {\n while (heap.get(currentIndex).element.compareTo(heap.get(getParent(currentIndex)).element) > 0)\n { switchPosition(currentIndex, getParent(currentIndex));\n currentIndex = getParent(currentIndex);\n }\n }\n \n \n }",
"public void append(Object obj) throws Exception {\n\t\tif(count>0&&front==rear)\n\t\t\t\tthrow new Exception(\" 队列已满\");\n\t\tdata[rear]= obj;\n\t\trear=(rear+1)%maxSize;\n\t\tcount++;\n\t}",
"public void enqueue(T x) {\n //Enqueue the item. Don't forget to increase fillCount and update last.\n if (isFull()) {\n throw new RuntimeException(\"Ring Buffer Overflow\");\n }\n rb[last] = x;\n fillCount += 1;\n last = (last + 1) % capacity;\n }",
"@Override\n public synchronized void add(E element) {\n if (this.pointer == this.capacity) {\n int newCapacity = this.capacity + (this.capacity >> 1);\n Object[] arr = Arrays.copyOf(this.container, newCapacity);\n this.capacity = newCapacity;\n this.container = arr;\n }\n this.container[this.pointer++] = element;\n }",
"@Override\n public void enqueue(T item) {\n if (item != null) {\n heap.add(item);\n } else {\n throw new IllegalArgumentException(\"Cant enqueue null\");\n }\n }",
"public void enqueue(T newEntry){\n Node newNode = new Node(newEntry, null);\n\n if (isEmpty()){\n firstNode = newNode;\n }\n else {\n lastNode.setNext(newNode);\n }\n lastNode = newNode;\n }",
"void enqueue(E e);",
"private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }",
"public void offer(E e) throws NullPointerException {\n\t\tif (e == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tapq.add(e);\n\t\tupheap(this.size()); // size changed\n\t\t// implement this method\n\t}",
"public synchronized void enqueue(Object o) {\r\n insertAtBack(o);\r\n }",
"public void enqueue ()\n {\n count++;\n questionList.add(newQuestion);\n //System.out.println(\"Question #\"+ totNumQ + \" is added to the queue.\");\n }",
"public void enqueue(Item item)\r\n {\r\n if (item == null) throw new NullPointerException(\"Null item\");\r\n if (n == a.length) resize(2 * a.length); // double the size of array if necessary\r\n a[n++] = item;\r\n }",
"public boolean add(ElementType element){\n if(this.contains(element)){\n return false;\n }\n else{\n if(size==capacity){\n reallocate();\n }\n elements[size]=element;\n size++;\n }\n return true;\n }",
"public synchronized void add(T object) throws InterruptedException {\n\t\twhile (store.size() == capacity) {\n\t\t\tLOG.info(\"No more space\");\n\t\t\twait();\n\t\t}\n\t\tstore.add(object);\n\t\tLOG.info(\"Added product\" + store.size());\n\t\tnotify();\n\t}",
"public void insert(int x)\n\t{\n//\t\treturns if queue is full\n\t\tif(isFull())\n\t\t{\n\t\t\tSystem.out.println(\"Queue Overflow\\n\");\n\t\t\treturn;\n\t\t}\n\t\tif(front==-1)\n\t\t\tfront=0;\n//\t\tif rear = last index of array\n\t\tif(rear==queueArray.length-1)\n\t\t\trear=0;\n\t\telse\n//\t\t\tincrements rear\n\t\t\trear=rear+1;\n//\t\tinserts new element in rear of array\n\t\tqueueArray[rear]=x;\n\t}",
"public void enqueue(Comparable item);",
"void enqueue(Object elem);",
"public void push(E item) {\n if (!isFull()) {\n this.stack[top] = item;\n top++;\n } else {\n Class<?> classType = this.queue.getClass().getComponentType();\n E[] newArray = (E[]) Array.newInstance(classType, this.stack.length*2);\n System.arraycopy(stack, 0, newArray, 0, this.stack.length);\n this.stack = newArray;\n\n this.stack[top] = item;\n top++;\n }\n }",
"void enqueue(Node n) {\n if (queueSet.contains(n)) {\n return;\n }\n queueSet.add(n);\n queue.addFirst(n);\n }",
"private void putOneQueue(BlockingQueue q, List buffer) throws InterruptedException {\n q.put(buffer);\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" done\");\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" first record \" + buffer.get(0));\n }",
"public void add( int item ) \n {\n\t//queue is empty\n\tif ( queue.isEmpty() ) {\n\t queue.add( item );\n\t return;\n\t}\n\t\n\t//queue is not empty\n\telse {\n\t //find spot of insetion\n\t for ( int i = 0; i < queue.size(); i++ ) {\t\t\t \n\t\tif ( (int) queue.get(i) < item ) {\n\t\t queue.add( i, item );\n\t\t return;\n\t\t}\t\t\n\t }\n\t}\n }",
"public void insert(E obj) {\n // insert it as last\n array[lastPosition] = obj;\n // go down on the depth path to the root as long proprieties are not balanced\n minHeapify(lastPosition);\n lastPosition++;\n // if the array is 50% full, double the size\n if (lastPosition == array.length / 2) {\n array = Arrays.copyOf(array, array.length * 2);\n }\n }",
"public void enqueue(T data) {\n if (data == null) {\n throw new IllegalArgumentException(\"The data you entered is null.\"\n + \" Please enter existing data.\");\n }\n if (size == backingArray.length) {\n T[] oldarray = backingArray;\n Object[] arr = new Object[2 * size];\n backingArray = (T[]) arr;\n int temp = front;\n for (int i = 0; i < oldarray.length - front; i++) {\n backingArray[i] = oldarray[temp];\n temp++;\n }\n temp = 0;\n for (int i = oldarray.length - front; i < oldarray.length; i++) {\n backingArray[i] = oldarray[temp];\n temp++;\n }\n front = 0;\n backingArray[size] = data;\n } else if (backingArray[backingArray.length - 1] != null) {\n int back = (front + size) % backingArray.length;\n backingArray[back] = data;\n\n } else {\n int back = front + size;\n backingArray[back] = data;\n }\n size++;\n\n }",
"public boolean offer(E element) {\n\t\tif (element == null)\n\t\t\tthrow new NullPointerException();\n\t\twhile (true) {\n\t\t\tlong r = rear.get();\n\t\t\tint i = (int)(r % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did rear change while we were reading x?\n\t\t\tif (r != rear.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue full?\n\t\t\tif (r == front.get() + elements.length())\n\t\t\t\treturn false; //Don't retry; fail the offer.\n\n\t\t\tif (x == null) {//Is the rear empty?\n\t\t\t\tif (elements.compareAndSet(i, x, element)) {//Try to store an element.\n\t\t\t\t\t//Try to increment rear. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further insertions, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\trear.compareAndSet(r, r+1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else //rear not empty. Try to help other threads.\n\t\t\t\trear.compareAndSet(r, r+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"public synchronized void add(Object object) {\n\n if (_queue.size() == 0) {\n // no elements then simply add it here\n _queue.addElement(object);\n } else {\n int start = 0;\n int end = _queue.size() - 1;\n\n if (_comparator.compare(object,\n _queue.firstElement()) < 0) {\n // it need to go before the first element\n _queue.insertElementAt(object, 0);\n } else if (_comparator.compare(object,\n _queue.lastElement()) > 0) {\n // add to the end of the queue\n _queue.addElement(object);\n } else {\n // somewhere in the middle\n while (true) {\n int midpoint = start + (end - start) / 2;\n if (((end - start) % 2) != 0) {\n midpoint++;\n }\n\n int result = _comparator.compare(\n object, _queue.elementAt(midpoint));\n\n if (result == 0) {\n _queue.insertElementAt(object, midpoint);\n break;\n } else if ((start + 1) == end) {\n // if the start and end are next to each other then\n // insert after at the end\n _queue.insertElementAt(object, end);\n break;\n } else {\n if (result > 0) {\n // musty be in the upper half\n start = midpoint;\n } else {\n // must be in the lower half\n end = midpoint;\n }\n }\n }\n }\n }\n }",
"public void add(E element){\n if(size==capacity){\n capacity *=2;\n E[] array2 = (E[]) new Object[capacity];\n if (size >= 0) System.arraycopy(array, 0, array2, 0, size);\n array2[size]=element;\n array=array2;\n }else{\n array[size]=element;\n }\n size++;\n }",
"public static void enqueue(Object object) {\n queue.addLast(object);\n }",
"public void enqueue(Item item) {\n if (item == null)\n throw new NullPointerException();\n\n // Check if whole array has been filled up, and act accordingly\n if (values.length == elements)\n resize((int) (elements * GROWTH_FACTOR));\n\n // Add element into values array\n values[elements++] = item;\n }",
"public void push(E e) throws InterruptedException {\n while (!isFree) {\n synchronized (this) {\n wait();\n }\n }\n\n synchronized (this) {\n if (queue != null) {\n queue.add(e);\n }\n isFree = true;\n notifyAll();\n }\n }",
"public ImmutableQueue<T> enQueue(T element) {\r\n\t\tif (element == null)\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\treturn new ImmutableQueue<T>(this.enqueueStack.push(element), this.dequeueStack);\r\n\t}"
]
| [
"0.75579727",
"0.75264823",
"0.75051135",
"0.7447747",
"0.7422202",
"0.74058324",
"0.7372422",
"0.73678267",
"0.7279371",
"0.7225737",
"0.7195849",
"0.71392685",
"0.711183",
"0.70877343",
"0.7050691",
"0.704628",
"0.6979478",
"0.697939",
"0.69710785",
"0.696805",
"0.69456095",
"0.6935146",
"0.6927278",
"0.69270664",
"0.68927234",
"0.6884823",
"0.68777394",
"0.6851166",
"0.68361837",
"0.6827879",
"0.68161786",
"0.6815947",
"0.6805151",
"0.6784807",
"0.6776494",
"0.6767106",
"0.6759497",
"0.6757931",
"0.6756632",
"0.6754786",
"0.67541957",
"0.67534304",
"0.6738242",
"0.6721259",
"0.6719859",
"0.6717174",
"0.6702681",
"0.6700332",
"0.6692319",
"0.6686639",
"0.66842806",
"0.6657894",
"0.665392",
"0.6642375",
"0.6599309",
"0.65912175",
"0.65845495",
"0.6579632",
"0.6578107",
"0.6575507",
"0.6573503",
"0.6541645",
"0.6536458",
"0.6532695",
"0.65316653",
"0.6530688",
"0.6523132",
"0.65225464",
"0.6516995",
"0.65165895",
"0.65163434",
"0.6514675",
"0.651081",
"0.6493513",
"0.64887875",
"0.6485899",
"0.64823806",
"0.6459719",
"0.6454438",
"0.64489895",
"0.6448805",
"0.6446138",
"0.64385116",
"0.6437353",
"0.6434317",
"0.6433887",
"0.6429215",
"0.64203167",
"0.6414715",
"0.64111984",
"0.64005595",
"0.63945633",
"0.63871235",
"0.63839287",
"0.63822603",
"0.63764304",
"0.63737875",
"0.63641244",
"0.63634384",
"0.63633996",
"0.63518596"
]
| 0.0 | -1 |
Insert a new element at the front of the queue If queue is full, resizes | public void enqueueFront(int n); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void enqueueFront(E element) {\n\t\tif(sizeDeque == CAPACITY) return;\r\n\t\tif(sizeDeque == 0) {\r\n\t\t\tdata[frontDeque] = element;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfrontDeque = (frontDeque - 1 + CAPACITY) % CAPACITY;\r\n\t\t\tdata[frontDeque] = element;\r\n\t\t}\r\n\t\t\r\n\t\tsizeDeque++;\r\n\t}",
"@Override\n\tpublic void enqueue(E e) {\n\t\tint index = (pos + size) % queue.length;\n\t\tqueue[index] = e;\n\t\tsize++;\n\t}",
"public void enqueue(E e) {\n if (e == null){\n throw new NullPointerException();\n }\n\n int x = size;\n size++;\n\n if (x+1 >= queue.length-1){\n this.queue = resize((E[])queue, queue.length*2);\n }\n //size = size + 1;\n if (x == 0){\n queue[0] = e;\n }else{\n\n if (size == queue.length){\n resize((E[])queue, queue.length*2);\n }\n queue[findNull()] = e;\n shift();\n\n }\n }",
"public void queue(Object newItem){\n if(isFull()){\n System.out.println(\"queue is full\");\n return;\n }\n ArrayQueue[++rear] = newItem;\n if(front == -1)\n front = 0;\n \n }",
"void enqueue(E newEntry);",
"@Override\n\tpublic void enqueue(E e) {\n\t\tif(size==data.length-1){\n\t\t\tresize();\n\t\t}\n\t\tif(rear==data.length-1){\n\t\t\tdata[rear]=e;\n\t\t\tsize++;\n\t\t\trear=(rear+1)%data.length;\n\t\t}else{\n\t\t\tsize++;\n\t\t\tdata[rear++]=e;\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic void enqueueRear(E element) {\n\t\tif(sizeDeque == CAPACITY) return;\r\n\t\tif(sizeDeque == 0) {\r\n\t\t\tdata[backDeque] = element;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tbackDeque = (backDeque + 1)%CAPACITY;\r\n\t\t\tdata[backDeque] = element;\r\n\t\t}\r\n\t\t\r\n\t\tsizeDeque++;\r\n\t}",
"@Override\r\n\tpublic void enqueue(Object element){\r\n\t\tif(head == null) {\r\n\t\t\thead = new Node(element);\r\n\t\t\ttail = head;\r\n\t\t}else {\r\n\t\t\ttail.next = new Node(element);\r\n\t\t\ttail = tail.next;\r\n\t\t}\r\n\t\tsize++;\r\n\t}",
"public void enqueue (E element);",
"@Override\n public void enqueue(Object element) {\n LinkedNode<T> node = new LinkedNode<T>((T) element);\n if (isEmpty()) {\n front = node;\n } else {\n rear.setNext(node);\n }\n rear = node;\n count++;\n\n }",
"public void enqueue(T element);",
"private void enqueue(E x) {\n final Object[] items = this.items;\n items[putIndex] = x;\n if (++putIndex == items.length) putIndex = 0;\n count++;\n notEmpty.signal();\n }",
"void insertToFront(int key)\n {\n // check whether Deque if full or not \n if (isFull())\n {\n return;\n }\n //Empty queue\n if (front == -1)\n {\n front = end = 0;\n } else if (front == 0) {\n front = size - 1; // First position\n } else {// decrement front end by '1'\n front--;\n }\n // insert current element into Deque \n arr[front] = key ;\n }",
"public void enqueue(E e) {\n\t\tlist.addLast(e);\n\t}",
"public void offer(E e) {\n if (e == null) throw new NullPointerException();\n queue[currentPos++] = e;\n size++;\n\n if (currentPos == queue.length) resize();\n }",
"@Override\r\n\tpublic void enqueue(T element)\r\n\t{\r\n\t\tLinkedNode<T> n = new LinkedNode<>(element);\r\n\r\n\t\t// if the only element in the queue, it becomes the first element\r\n\t\tif (head == null)\r\n\t\t{\r\n\t\t\thead = n;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// otherwise, the tail's next receives the new node\r\n\t\t\t// because later, tail will be the new node\r\n\t\t\ttail.next = n;\r\n\t\t}\r\n\r\n\t\t// always add at the end of the list\r\n\t\ttail = n;\r\n\t\tcount++;\r\n\t}",
"public void enqueue(Integer elem) {\n\t\t // add to end of array\n\t\t // increase size\n\t\t // create a recursive helper, percolateUp,\n\t\t // that allows you puts the inserted val \n\t\t // in the right place\n\t\t if(size == capacity) {\n\t\t\t ensureCapacity(size);\n\t\t }\n\t\t data[size] = elem;\n\t\t size++;\n\t\t percolateUp(size-1); \n\t }",
"private void queueResize() {\n queue = Arrays.copyOf(queue, queue.length + 1);\n }",
"public void enqueue(E element) {\n\t\tadd(element);\n\t}",
"public synchronized void enqueue(T thing) {\r\n\t\twhile (queue.size()==maxSize){\r\n\t\t\ttry{\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch(InterruptedException e){\r\n\t\t\t\tSystem.out.println(\"Interruption during enqueue\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tqueue.addLast(thing);\r\n\t\tthis.notifyAll();\r\n\t}",
"public void push_front(T element);",
"public void enqueue (Item item){\n Node<Item> oldLast = last;\n last = new Node<Item>();\n last.item = item;\n last.next = null;\n if(isEmpty()) {first = last;}\n else oldLast.next = last;\n N++;\n }",
"public void enqueue(E item) {\n Node<E> oldlast = last;\n last = new Node<E>();\n last.item = item;\n last.next = null;\n if (isEmpty()) first = last;\n else oldlast.next = last;\n n++;\n }",
"public void enqueue(Item item) throws NoSuchElementException {\r\n // Usar el metodo upHeap para corregir la condicion de\r\n // Min Heap\r\n\r\n\r\n if (size == 0){\r\n heap[1] = item;\r\n size = 1;\r\n return;\r\n }\r\n int cur = size + 1;\r\n int par = cur/2;\r\n\r\n heap[cur] = item;\r\n size++;\r\n\r\n if (heap[cur].compareTo(heap[par]) > 0){\r\n upHeap(cur);\r\n }\r\n\r\n\r\n }",
"public void enqueue(T pushed)\n\t{insert(pushed);}",
"public void enqueue(Object value)\n {\n queue.insertLast(value);\n }",
"void enqueue(E el);",
"public synchronized void enqueue(Object o) {\r\n insertAtBack(o);\r\n }",
"@Override\n public void enqueue(T value) {\n myQ[myLength] = value;\n myLength++;\n }",
"@Override\n public void enqueue(E e) {\n array.addLast(e);\n }",
"private void growQueue() {\n Runnable[] oldQ = queue;\n int oldSize = oldQ.length;\n int newSize = oldSize << 1;\n if (newSize > MAXIMUM_QUEUE_CAPACITY)\n throw new RejectedExecutionException(\"Queue capacity exceeded\");\n Runnable[] newQ = queue = new Runnable[newSize];\n\n int b = base;\n int bf = b + oldSize;\n int oldMask = oldSize - 1;\n int newMask = newSize - 1;\n do {\n int oldIndex = b & oldMask;\n Runnable t = oldQ[oldIndex];\n if (t != null && !casSlotNull(oldQ, oldIndex, t))\n t = null;\n setSlot(newQ, b & newMask, t);\n } while (++b != bf);\n pool.signalWork();\n }",
"public void enqueue(E item) {\n addLast(item);\n }",
"void enqueue(E item);",
"@Override\n public Object enqueue(Object x) {\n if (!isFull() && x != null){ // Pré-condição\n if (++tail >= MAX){\n tail = 0; // MAX-1 é a ultima posição do vetor\n }\n \n if (head == -1){\n head = tail;\n }\n \n memo[tail] = x;\n total++;\n return x;\n }\n else{ // Não pode inserir elemento nulo (x == null)\n return null; // Ou se a FILA estiver cheia\n }\n }",
"public void push(E elem) {\n if (elem != null) {\r\n contents[++top] = elem;\r\n }\r\n\r\n // Usually better to resize after an addition rather than before for\r\n // multi-threading reasons. Although, that is not important for this class.\r\n if (top == contents.length-1) resize();\r\n }",
"public void enqueue(E e) {\n\t\t\tsynchronized (this.pq) {\n\t\t\t\tthis.pq.add(e);\n//\t\t\t\tSystem.out.println(\"insert \" + e);\n\t\t\t}\n\t\t\tthis.sem.release();\n\t}",
"public void addFirst(T item) {\n if (size == 0) {\n array[front] = item;\n size++;\n return;\n }\n\n this.checkReSizeUp();\n front--;\n this.updatePointer();\n array[front] = item;\n size++;\n }",
"public void enqueue(X item) {\n QueueNode<X> new_last = new QueueNode<X>(item);\n if (last != null)\n last.next = new_last;\n last = new_last;\n if (first == null)\n first = last;\n }",
"public void enqueue(T item) {\n\t\tif(rear == capacity)\n\t\t\treSize();\n\t\tarr[rear] = item;\n\t\tSystem.out.println(\"Added: \" + item);\n\t\trear++;\n\t\tsize++;\n\t}",
"public void insert(Object init)\n {\n\n if (isFull())\n // System.out.println(\"rear +1 = \"+(rear+1));\n if (front != 0)\n shift(front);\n else\n throw new QueueFullException((\"Full\"));\n queue[++rear] = init;\n nItems++;\n //System.out.println(\"object \" + init + \" rear is \" + rear + \" n items is \" + nItems + \" front is \" + front);\n }",
"public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}",
"@Override\r\n\tpublic boolean enqueue(T element) {\r\n\t\t\r\n\t\t// checking if queue is already full or not\r\n\t\tif (isFull()) {\r\n\t\t\tthrow new AssertionError(\"Queue is full\");\r\n\t\t} else {\r\n\t\t\tif (this.front == -1) {\r\n\t\t\t\tthis.front = 0;\r\n\t\t\t}\r\n\t\t\tthis.rear = (this.rear + 1) % this.size;\r\n\t\t\tthis.array[this.rear] = (Integer)element;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public void enqueue( MyTreeNode<T> treeNode ) {\n\t\tQueueNode newNode = new QueueNode(treeNode);\n\t\t// the queue is empty\n\t\tif ( tail == null ) {\n\t\t\t// the tail and the head point to the same only element in the collection\n\t\t\tthis.tail = newNode;\n\t\t\tthis.head = newNode;\n\t\t// the queue is not empty\n\t\t} else {\n\t\t\t// the second from the end item of the collection keeps track with the tail\n\t\t\tthis.tail.next = newNode;\n\t\t\t// the new element becomes the tail of the collection\n\t\t\tthis.tail = newNode;\n\t\t}\n\t}",
"public void enqueue(T item) {\n\t\tNode<T> oldlast = last;\n\t\tlast = new Node<>();\n\t\tlast.item = item;\n\t\tlast.next = null;\n\t\tif (isEmpty()) first = last;\n\t\telse oldlast.next = last;\n\t\tN++;\n\t}",
"private void shift(){\n if (queue.length < 1){\n throw new Error(\"Table self destruction!\");\n }\n if (size <= 0){\n return;\n }\n\n if (queue[0] == null){\n E best = null;\n int bestAT = -1;\n for (int x = 0 ; x < queue.length; x++){\n E cur = (E)queue[x];\n if (cur == null){\n continue;\n }\n if (best == null || cur.compareTo(best) > 0){\n best = cur;\n bestAT = x;\n }\n }\n // Not put best at front;\n queue[bestAT] = null;\n queue[0] = best;\n }\n\n }",
"public void enqueue(student element) {\n Node3 node = new Node3(element);\n if (front == null) {\n rear = node;\n front = node;\n size++;\n } else {\n rear.setNext(node);\n rear = node;\n size++;\n }\n }",
"public void enqueue(T data) {\n if (data == null) {\n throw new IllegalArgumentException(\"The data you entered is null.\"\n + \" Please enter existing data.\");\n }\n if (size == backingArray.length) {\n T[] oldarray = backingArray;\n Object[] arr = new Object[2 * size];\n backingArray = (T[]) arr;\n int temp = front;\n for (int i = 0; i < oldarray.length - front; i++) {\n backingArray[i] = oldarray[temp];\n temp++;\n }\n temp = 0;\n for (int i = oldarray.length - front; i < oldarray.length; i++) {\n backingArray[i] = oldarray[temp];\n temp++;\n }\n front = 0;\n backingArray[size] = data;\n } else if (backingArray[backingArray.length - 1] != null) {\n int back = (front + size) % backingArray.length;\n backingArray[back] = data;\n\n } else {\n int back = front + size;\n backingArray[back] = data;\n }\n size++;\n\n }",
"public void enqueue(Item item) {\n if (item == null) {\n throw new IllegalArgumentException(\"Empty item\");\n }\n\n if (queue.length == qSize) {\n resize(qSize * 2);\n }\n\n queue[qSize] = item;\n qSize++;\n }",
"private void growQueue() {\n int newSize = (int)(QUEUE.length * 1.5f);\n \n Logger.log(\"INFO\", \"Queue is full, growing to new size: \" + Integer.toString(newSize));\n \n Object[] newQueue = new Object[newSize];\n lockQueue();\n copyQueue(newQueue);\n unlockQueue();\n }",
"public void enqueue(E item) throws IllegalStateException {\n if (size == arrayQueue.length) {\n throw new IllegalStateException(\"Queue is full\");\n }\n int available = (front + size) % arrayQueue.length;\n arrayQueue[available] = item;\n size++;\n }",
"public void enqueue(Object data){\r\n super.insert(data, 0);//inserts it to the first index everytime (for tostring)\r\n }",
"void enqueue(E e);",
"@Override\r\n\tpublic void enqueue(Item item) {\r\n\t\tif (item == null)\r\n\t\t\tthrow new NullPointerException(\"You cannot put a 'null' element inside the queue\");\r\n\t\tif (count == arr.length)\r\n\t\t\tresize(arr.length * 2);\r\n\t\tarr[count++] = item;\r\n\t}",
"void enqueue(T item) {\n contents.addAtTail(item);\n }",
"public void enqueue(T object) {\n Node<T> node = new Node<>(object);\n\n if (first == null) {\n last = node;\n first = last;\n }\n else {\n last.next = node;\n last = node;\n }\n\n size++;\n }",
"@Override\n\tpublic void enqueue(E e) {\n\t\tNode node = new Node();\n\t\tnode.element = e;\n\t\tnode.next = null;\n\t\t\n\t\tif (last != null)\n\t\t\tlast.next = node;\n\t\telse\n\t\t\tfirst = node;\n\t\tlast = node;\n\t\t\n\t}",
"public void enqueue(Comparable item);",
"public void enqueue(T item) {\r\n\r\n\t\t++item_count;\r\n\t\tif(item_count==arr.length)\r\n\t\t\tdoubleArray();\r\n\t\tarr[++back%arr.length]=item;\r\n\t}",
"@Override\r\n\tpublic boolean enqueue(T e) throws QueueOverflowException {\r\n\t\tif (this.isFull()) {\r\n\t\t\tthrow new QueueOverflowException(\"The queue is full\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata.add(data.size(), e);\r\n\t\t}\r\n\t\t// Add element to the end of the Queue\t\t\r\n\t\treturn true;\r\n\t}",
"void enqueue(T data) \n { \n \n // Create a new LL node \n LinkedListQueue temp = new LinkedListQueue(data); \n \n // If queue is empty, then new node is front and rear both \n if (this.rear == null) { \n this.front = this.rear = temp; \n return; \n } \n \n // Add the new node at the end of queue and change rear \n this.rear.next = temp; \n this.rear = temp; \n }",
"@Override\n public void enqueue(T item) {\n if (item != null) {\n heap.add(item);\n } else {\n throw new IllegalArgumentException(\"Cant enqueue null\");\n }\n }",
"public void enqueue(T newEntry){\n Node newNode = new Node(newEntry, null);\n\n if (isEmpty()){\n firstNode = newNode;\n }\n else {\n lastNode.setNext(newNode);\n }\n lastNode = newNode;\n }",
"public void enqueue(E e) {\n\t\tsynchronized(mutex){\n\t\t\ttry {\n\t\t\t\tqueue.add(e);\n\t\t\t} catch(NullPointerException ex) {\n\t\t\t\tthrow new NullPointerException(\"enqueued null element\");\n\t\t\t} catch (ClassCastException ex) {\n\t\t\t\tthrow new ClassCastException(\"enqueued element is incompetible type\");\n\t\t\t}\n\t\t\tsem.release();\n\t\t}\n\t}",
"void enqueue(T x);",
"public void enqueue (T item) {\n leftStack.push(item);\n }",
"void enqueue(Node n) {\n if (queueSet.contains(n)) {\n return;\n }\n queueSet.add(n);\n queue.addFirst(n);\n }",
"@Override\n public boolean offer(E e) {\n if(e== null || (limited && size >= length)) {\n return false;\n }\n queue[size++] = e;\n Arrays.sort(queue, comparator);\n if(size >= queue.length) {\n queueResize();\n }\n return true;\n }",
"void enqueue(Object elem);",
"public boolean insertFront(int value) {\n if (head == tail && size == capacity)\n return false;\n else {\n head = (head + capacity - 1) % capacity;//由于head初始时为0,在最左侧,所以需要先找到双端队列\n //最右侧头端点:head的位置\n elementData[head] = value;//将当前插入的值赋值在head位置处\n size++;//元素个数++;\n return true;\n }\n\n }",
"@Override\n\tpublic void queue(T element) {\n\t\tLinkElement<T> linkElement = new LinkElement<T>(element);\n\n\t\tif ( last != null )\n\t\t\tlast.setPrevLinkElement(linkElement);\t// ensure previous last element refers to new last element.\n\t\t\n\t\tlast = linkElement;\n\t\t\n\t\tif (head == null)\n\t\t\thead = linkElement;\t// the first element on the queue, so becomes the head.\n\t}",
"public void enqueue(Item item){\n if (item == null){ throw new NullPointerException(\"Cannot add a null item\"); }\n\n // fill the nulls\n if(itemCount < array.length) {\n for(int i=0;i<array.length;i++) {\n if(array[i] == null) {\n array[i] = item;\n break;\n }\n }\n }\n // resize when too big\n if(itemCount == array.length){\n resize(2*itemCount);\n array[itemCount] = item;\n }\n itemCount++; // Item added!!\n }",
"public static void enQueue(Queue q, String entry){ \n if (q.queuesize < q.names.length){ //If the queue isn't full - Size of queue is less than the set array size \n q.names[q.queuesize] = entry; //Set the value at the index of queue size to the input (Using the array in the Queue class to store this)\n q.queuesize +=1; //Increment the size of queue \n }\n }",
"void enqueue(T t);",
"public void enqueue(T x) {\n //Enqueue the item. Don't forget to increase fillCount and update last.\n if (isFull()) {\n throw new RuntimeException(\"Ring Buffer Overflow\");\n }\n rb[last] = x;\n fillCount += 1;\n last = (last + 1) % capacity;\n }",
"private void resize() {\n Object[] newQueue = new Object[(int) (queue.length * 1.75)];\n System.arraycopy(queue, startPos, newQueue, 0, queue.length - startPos);\n\n currentPos = queue.length - startPos;\n startPos = 0;\n queue = newQueue;\n\n }",
"public void add( int item ) \n {\n\t//queue is empty\n\tif ( queue.isEmpty() ) {\n\t queue.add( item );\n\t return;\n\t}\n\t\n\t//queue is not empty\n\telse {\n\t //find spot of insetion\n\t for ( int i = 0; i < queue.size(); i++ ) {\t\t\t \n\t\tif ( (int) queue.get(i) < item ) {\n\t\t queue.add( i, item );\n\t\t return;\n\t\t}\t\t\n\t }\n\t}\n }",
"void enqueue(int idNumber, int arrival_time) \r\n\t { \r\n\t \r\n\t // Create a new LL node \r\n\t QNode temp = new QNode(idNumber, arrival_time); \r\n\t \r\n\t // If queue is empty, then new node is front and rear both \r\n\t if (this.rear == null) \r\n\t { \r\n\t this.front = this.rear = temp; \r\n\t size++;\r\n\t maxSize++;\r\n\t return; \r\n\t } \r\n\t \r\n\t // Add the new node at the end of queue and change rear \r\n\t else {\r\n\t \tthis.rear.next = temp;\r\n\t \tthis.rear = temp; \r\n\t \tsize++;\r\n\t \tmaxSize++;\r\n\t }\r\n\t \r\n\t }",
"public void enqueue(Item item) {\n if (item == null) throw new IllegalArgumentException(\"Null argument\");\n\n if (n == a.length) resize(2*a.length);\n a[n++] = item;\n }",
"public boolean insert(E object){\r\n if(isFull())\r\n return false;\r\n \r\n //find index to insert object\r\n int loc = findInsertPoint(object, 0, currentSize-1);\r\n\r\n //right shift\r\n for(int i = currentSize-1; i >= loc; i--){\r\n queue[i+1] = queue[i];\r\n }\r\n\r\n queue[loc] = object; //insert object\r\n currentSize++; //accomodate for inserted object by adding to array size\r\n\r\n return true;\r\n }",
"public static void enqueue(Object object) {\n queue.addLast(object);\n }",
"public void enqueue (int elemento) {\n if(!isFull()){\n data[last] = elemento;\n count++;\n if(last == data.length-1) {\n last = 0;\n } else {\n last++;\n }\n }else{\n throw new RuntimeException(\"A fila está cheia\");\n }\n\n }",
"public void enqueue(E data) {\n Noder<E> temp = new Noder<>(data);\n if (first == null) {\n last = temp;\n first = last;\n } else {\n if (first.next == null) {\n first.next = temp;\n }\n last.next = temp;\n last = temp;\n }\n }",
"public synchronized void insert(Integer e) {\r\n\t\ttry {\r\n\t\t\twhile (buffer.size() == maxSize) {\r\n\t\t\t\twait();\r\n\t\t\t}\r\n\t\t\tbuffer.add(e);\r\n\t\t\tnotify();\t\t\t\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\tThread.currentThread().interrupt();\r\n\t\t}\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic void push(Object element) {\n\t\tif(size == capacity) {\n\t\t\tthrow new IllegalArgumentException(\"Capacity has been reached.\");\n\t\t}\n\t\tlist.add(0, (E) element);\n\t\tsize++;\n\t\t\n\t}",
"public void offer(E e)\n {\n if(!mOverflow.get())\n {\n mQueue.offer(e);\n\n int size = mCounter.incrementAndGet();\n\n if(size > mMaximumSize)\n {\n setOverflow(true);\n }\n }\n }",
"public void enqueue(Item item) {\n \t if (item == null) {\n \t \t throw new NullPointerException();\n \t } \n \t Node a = new Node(item);\n \t Node oldPrev = sentinel.prev.prev;\n \t oldPrev.next = a;\n \t a.next = sentinel.prev;\n \t sentinel.prev.prev = a;\n \t a.prev = oldPrev;\n \t size = size + 1;\n }",
"public boolean insertFront(int value) {\n if (isFull()) {\n return false;\n } else if (last == capacitySize) {\n int[] newElements = new int[capacitySize];\n System.arraycopy(elements, front, newElements, 0, last - front);\n elements = newElements;\n last = last - front;\n front = 0;\n }\n elements[last++] = value;\n return true;\n }",
"public void insert(T element)\r\n\t{\n\t\tif (size >= data.length - 1)\r\n\t\t{\r\n\t\t\tresize();\r\n\t\t}\r\n\t\t\r\n\t\t//add the new element\r\n\t\tsize++;\r\n\t\tdata[size] = element;\r\n\t\tswim(size);\r\n\t}",
"@Override\n public void addFirst(E value) {\n if (value == null) {\n throw new NullPointerException(\"Value can not be null\");\n }\n if (isEmpty()) {\n head = tail = 0;\n dequeue[head] = value;\n size++;\n return;\n }\n\n head--;\n if (head == -1) {\n head = dequeue.length - 1;\n }\n dequeue[head] = value;\n size++;\n\n if (size == dequeue.length) {\n widen();\n }\n\n }",
"void pushFront(T value) throws ListException;",
"public void insert(int x)\n\t{\n//\t\treturns if queue is full\n\t\tif(isFull())\n\t\t{\n\t\t\tSystem.out.println(\"Queue Overflow\\n\");\n\t\t\treturn;\n\t\t}\n\t\tif(front==-1)\n\t\t\tfront=0;\n//\t\tif rear = last index of array\n\t\tif(rear==queueArray.length-1)\n\t\t\trear=0;\n\t\telse\n//\t\t\tincrements rear\n\t\t\trear=rear+1;\n//\t\tinserts new element in rear of array\n\t\tqueueArray[rear]=x;\n\t}",
"private void putOneQueue(BlockingQueue q, List buffer) throws InterruptedException {\n q.put(buffer);\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" done\");\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" first record \" + buffer.get(0));\n }",
"public void enqueue(final E data) {\n if (head == null) {\n head = new Node(data);\n tail = head;\n size++;\n return;\n }\n Node node = new Node(data, null);\n tail.next = node;\n tail = node;\n size++;\n\n }",
"@Override\r\n\tpublic void Enqueue(int data) {\n\t\t\r\n\t\tif (rear == -1) \r\n {\r\n front = 0;\r\n rear = 0;\r\n queue[rear] = data;\r\n }\r\n else if (IsFull())\r\n throw new IndexOutOfBoundsException(\"Overflow Exception\");\r\n else if ( rear + 1 < size)\r\n queue[++rear] = data; \r\n\t\tSystem.out.println(\"Enqued element: \" +queue[rear]);\r\n\t \r\n\t len++ ;\r\n\t\t\r\n\t}",
"@Override\n\tpublic void addToQueue() {\n\t}",
"public void enqueue ()\n {\n count++;\n questionList.add(newQuestion);\n //System.out.println(\"Question #\"+ totNumQ + \" is added to the queue.\");\n }",
"public void uncheckedPushFront(IClause c) {\n tab[front--] = c;\n if (front < 0)\n front = tab.length - 1;\n\n assert back + 1 != front\n && (front != 0 || back != tab.length - 1) : \"Deque is full !\";\n }",
"public void enqueue(Item item) {\n if (item == null) throw new NullPointerException();\n\n if (size == array.length) {\n Item[] temp = (Item[]) new Object[array.length * 2];\n System.arraycopy( array, 0, temp, 0, array.length);\n array = temp;\n temp = null;\n }\n array[size] = item;\n size++;\n if(size>1) { \n int x=StdRandom.uniform(size);\n Item temp=array[x];\n array[x]=array[size-1];\n array[size-1]=temp;\n }\n\n }",
"public void enqueue(Item item)\r\n {\r\n if (item == null) throw new NullPointerException(\"Null item\");\r\n if (n == a.length) resize(2 * a.length); // double the size of array if necessary\r\n a[n++] = item;\r\n }",
"public synchronized void add(Object object) {\n\n if (_queue.size() == 0) {\n // no elements then simply add it here\n _queue.addElement(object);\n } else {\n int start = 0;\n int end = _queue.size() - 1;\n\n if (_comparator.compare(object,\n _queue.firstElement()) < 0) {\n // it need to go before the first element\n _queue.insertElementAt(object, 0);\n } else if (_comparator.compare(object,\n _queue.lastElement()) > 0) {\n // add to the end of the queue\n _queue.addElement(object);\n } else {\n // somewhere in the middle\n while (true) {\n int midpoint = start + (end - start) / 2;\n if (((end - start) % 2) != 0) {\n midpoint++;\n }\n\n int result = _comparator.compare(\n object, _queue.elementAt(midpoint));\n\n if (result == 0) {\n _queue.insertElementAt(object, midpoint);\n break;\n } else if ((start + 1) == end) {\n // if the start and end are next to each other then\n // insert after at the end\n _queue.insertElementAt(object, end);\n break;\n } else {\n if (result > 0) {\n // musty be in the upper half\n start = midpoint;\n } else {\n // must be in the lower half\n end = midpoint;\n }\n }\n }\n }\n }\n }"
]
| [
"0.7737335",
"0.76122254",
"0.7432296",
"0.7381711",
"0.7341963",
"0.73341566",
"0.726821",
"0.7248474",
"0.7215156",
"0.7162423",
"0.7132639",
"0.7129768",
"0.70712626",
"0.70531297",
"0.7021252",
"0.700406",
"0.6998703",
"0.6980603",
"0.6977456",
"0.69722223",
"0.69663376",
"0.69382715",
"0.6934144",
"0.6904383",
"0.69005907",
"0.6882938",
"0.68780446",
"0.68650997",
"0.68614244",
"0.6840173",
"0.68330896",
"0.6823577",
"0.6822506",
"0.68060833",
"0.6794636",
"0.6756906",
"0.67541504",
"0.6753516",
"0.67320347",
"0.6728614",
"0.6727026",
"0.67237973",
"0.66884494",
"0.6681022",
"0.66725576",
"0.66682154",
"0.6666628",
"0.6664809",
"0.6663755",
"0.66620606",
"0.6660187",
"0.6655402",
"0.6645727",
"0.6644208",
"0.66294307",
"0.66118926",
"0.6602206",
"0.65974396",
"0.6595663",
"0.65869784",
"0.6586497",
"0.65830576",
"0.6581558",
"0.65741014",
"0.65736765",
"0.65637136",
"0.6558843",
"0.65550894",
"0.655289",
"0.65404046",
"0.65365416",
"0.65327346",
"0.65300703",
"0.652059",
"0.65203696",
"0.65176296",
"0.6489596",
"0.6464377",
"0.6459782",
"0.64464",
"0.6434276",
"0.643307",
"0.64316905",
"0.64284736",
"0.64114964",
"0.64112693",
"0.6406696",
"0.64063907",
"0.64060867",
"0.64051443",
"0.639927",
"0.63879055",
"0.6387643",
"0.63859755",
"0.63839275",
"0.63774526",
"0.6367942",
"0.63663775",
"0.63490623",
"0.63394964"
]
| 0.6711776 | 42 |
Remove and return the front element of the queue; move everything over to the left one slot Note: Does not check for underflow | public int dequeueFront(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic E dequeueFront() {\n\t\tif(isEmpty()) return null;\r\n\t\tE value = data[frontDeque];\r\n\t\tfrontDeque = (frontDeque + 1)% CAPACITY;\r\n\t\tsizeDeque--;\r\n\t\treturn value;\r\n\t}",
"public long remove(){\n\t\t\r\n\t\t\tlong temp = queueArray[front]; //retrieves and stores the front element\r\n\t\t\tfront++;\r\n\t\t\tif(front == maxSize){ //To set front = 0 and use it again\r\n\t\t\t\tfront = 0;\r\n\t\t\t}\r\n\t\t\tnItems--;\r\n\t\t\treturn temp;\r\n\t\t}",
"private void shift(){\n if (queue.length < 1){\n throw new Error(\"Table self destruction!\");\n }\n if (size <= 0){\n return;\n }\n\n if (queue[0] == null){\n E best = null;\n int bestAT = -1;\n for (int x = 0 ; x < queue.length; x++){\n E cur = (E)queue[x];\n if (cur == null){\n continue;\n }\n if (best == null || cur.compareTo(best) > 0){\n best = cur;\n bestAT = x;\n }\n }\n // Not put best at front;\n queue[bestAT] = null;\n queue[0] = best;\n }\n\n }",
"public E poll() {\n\t\twhile (true) {\n\t\t\tlong f = front.get();\n\t\t\tint i = (int)(f % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did front change while we were reading x?\n\t\t\tif (f != front.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue empty?\n\t\t\tif (f == rear.get())\n\t\t\t\treturn null; //Don't retry; fail the poll.\n\n\t\t\tif (x != null) {//Is the front nonempty?\n\t\t\t\tif (elements.compareAndSet(i, x, null)) {//Try to remove an element.\n\t\t\t\t\t//Try to increment front. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further removals, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\tfront.compareAndSet(f, f+1);\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t} else //front empty. Try to help other threads.\n\t\t\t\tfront.compareAndSet(f, f+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"public E dequeue(){\n if (isEmpty()) return null;\n E answer = arrayQueue[front];\n arrayQueue[front] = null;\n front = (front +1) % arrayQueue.length;\n size--;\n return answer;\n }",
"public E dequeue() {\n if (size == 0){\n return null;\n }\n\n\n E result = (E) queue[0];\n queue[0] = null;\n --size;\n\n if (size != 0){\n shift();\n }\n return result;\n }",
"private E dequeue() {\n final Object[] items = this.items;\n @SuppressWarnings(\"unchecked\")\n E x = (E) items[takeIndex];\n items[takeIndex] = null;\n if (++takeIndex == items.length) takeIndex = 0;\n count--;\n notFull.signal();\n return x;\n }",
"@Override\n\tpublic E dequeue() {\n\t\tE temp=null;\n\t\tif(front==data.length-1){\n\t\t\ttemp=data[front];\n\t\t\tsize--;\n\t\t\tfront=(front+1)%data.length;\n\t\t}else{\n\t\t\tsize--;\n\t\t\ttemp=data[front++];\n\t\t}\n\t\treturn temp;\n\t}",
"public int dequeue() {\n\t\tif (isEmpty()) throw new IllegalStateException(\"\\nQueue is empty!\\n\");\n\t\tint removedItem = bq[head];\n\t\tif (head == bq.length - 1) head = 0; // wraparound\n\t\telse head++;\n\t\tsize--;\n\t\treturn removedItem;\t\n\t}",
"T getFront() throws EmptyQueueException;",
"private E remove() {\n if (startPos >= queue.length || queue[startPos] == null) throw new NoSuchElementException();\n size--;\n return (E) queue[startPos++];\n }",
"public T front() throws EmptyQueueException;",
"public E dequeue() {\n if (isEmpty()) return null; //nothing to remove.\n E item = first.item;\n first = first.next; //will become null if the queue had only one item.\n n--;\n if (isEmpty()) last = null; // special case as the queue is now empty. \n return item;\n }",
"void dequeue() \n { \n // If queue is empty, return NULL. \n if (this.front == null) \n return; \n \n // Store previous front and move front one node ahead \n LinkedListQueue temp = this.front; \n this.front = this.front.next; \n \n // If front becomes NULL, then change rear also as NULL \n if (this.front == null) \n this.rear = null; \n }",
"public T removeFirst(){\n\tT ret = _front.getCargo();\n\t_front = _front.getPrev();\n\t_front.setNext(null);\n\t_size--;\n\treturn ret;\n }",
"void deleteFromFront()\n {\n // check whether Deque is empty or not \n if (isEmpty())\n {\n return;\n }\n // Only one element left\n if (front == end)\n {\n front = end = -1;\n }\n else {\n // back to initial\n front = (front == size -1) ? 0 : front+1;\n }\n }",
"public IClause uncheckedPopFront() {\n assert back!=front : \"Deque is empty\";\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"@Override\n public E poll() {\n E tmp = (E)queue[0];\n System.arraycopy(queue, 1, queue, 0, size - 1);\n size--;\n return tmp;\n }",
"public Object todequeue() {\n\t\tif(rear == 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tObject to_return = arr[front];\n\t\t\tfront++;\n\t\t\tsize--;\n\t\t\treturn to_return;\n\t\t}\n\t}",
"@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public E removeFront() {\r\n if (elem[front] == null) {\r\n throw new NoSuchElementException();\r\n } else {\r\n E temp = elem[front];\r\n elem[front] = null;\r\n front++;\r\n return temp;\r\n }\r\n }",
"public Item removeFirst(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[first];\r\n\t\tlist[first++] = null;\r\n\t\tn--;\r\n\t\tprior=first-1;\r\n\t\tif(first==list.length){first=0;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}",
"private int dequeue(){\n size--;\n int ret = array[front];\n front = (front+1)%capacity;\n return ret;\n }",
"public T poll() {\n if (size == 0) {\n return null;\n }\n\n // set returned value to queue[0]\n T value = (T) array[0];\n\n // decrease size - we are removing element\n size--;\n\n // move queue 1 place left\n System.arraycopy(array, 1, array, 0, size);\n\n // clear last element\n array[size] = null;\n\n return value;\n }",
"public T dequeue(){\n T front = getFront(); // might throw exception, assumes firstNode != null\n firstNode = firstNode.getNext();\n\n if (firstNode == null){\n lastNode = null;\n } // end if\n return front;\n }",
"public E remove(){\r\n if(isEmpty())\r\n return null;\r\n \r\n //since the array is ordered, the highest priority will always be at the end of the queue\r\n //--currentSize will find the last index (highest priority) and remove it\r\n return queue[--currentSize];\r\n }",
"public Object deQueue()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n Node temp = this.front;\n front = front.getNext();\n if(this.isEmpty()){this.rear = null;}\n return temp.getData();\n }",
"public Country removeFront() {\n\t\tCountry temp = null;\n\t\ttry {\n\t\t\tif (isEmpty()) {\n\t\t\t\tSystem.out.println(\"The queue is empty.\");\n\t\t\t} else if (front != end) {\n\t\t\t\tfront.previous = null;\n\t\t\t\ttemp = front.data;\n\t\t\t\tfront = front.next;\n\t\t\t} else {\n\t\t\t\tfront = end = null;\n\t\t\t\ttemp = front.data;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t;\n\t\t}\n\t\treturn temp;\n\t}",
"public Integer dequeue() {\n\t\t // get last val in heap, copy value to index 0\n\t\t // decrease size \n\t\t // create a recursive helper, percolateDown,\n\t\t // that allows you move the removed val \n\t\t // in the right place\n\t\t \n\t\t if (size == 0) \n\t\t\t throw new EmptyStackException();\n\t int item = data[0]; \n\t data[0] = data[size - 1]; \n\t size--;\n\t percolateDown(0); \n\t return item;\n\t }",
"@Override\n\tpublic E dequeue() {\n\t\tif(isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tE data = queue[pos];\n\t\tqueue[pos] = null;\n\t\tpos = (pos+1) % queue.length;\n\t\tsize--;\n\t\treturn data;\n\t}",
"public E peek(){\r\n if(isEmpty())\r\n return null;\r\n\r\n return queue[currentSize-1]; //return the object without removing it\r\n }",
"public Object peek()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n return front.getData();\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic T dequeue() {\r\n\t\tT data;\r\n\t\t\r\n\t\t// checking if queue is empty or not\r\n\t\tif (isEmtpy()) {\r\n\t\t\tthrow new AssertionError(\"Queue is empty\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// remove element\r\n\t\t\tdata = (T)(Integer)this.array[this.front];\r\n\t\t\t\r\n\t\t\t// adjust both front and rear of queue\r\n\t\t\tif (this.front == this.rear) {\r\n\t\t\t\tthis.front = this.rear = -1;\r\n\t\t\t} else {\r\n\t\t\t\tthis.front = (this.front + 1) % this.size;\r\n\t\t\t}\r\n\t\t\treturn (T)data;\r\n\t\t}\r\n\t}",
"public T removeFromFront() {\n DoublyLinkedListNode<T> temp = head;\n if (size == 0) {\n throw new NoSuchElementException(\"The list is empty, so there\"\n + \" is nothing to get.\");\n } else {\n if (head == tail) {\n head = tail;\n tail = null;\n return temp.getData();\n } else {\n head = head.getNext();\n head.setPrevious(null);\n size -= 1;\n return temp.getData();\n }\n }\n\n\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"queue is empty\");\n }\n Item a;\n a = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else first.prev = null;\n size--;\n return a;\n }",
"public T dequeue() {\n if (size == 0) {\n throw new NoSuchElementException(\"The queue is empty\"\n + \". Please add data before attempting to remove.\");\n } else if (front == backingArray.length - 1) {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = 0;\n size--;\n return data;\n } else {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = temp + 1;\n size--;\n return data;\n }\n }",
"public E removeFront() {\n\t\tif (count == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tE temp = head.value;\n\t\t\thead = head.next;\n\t\t\tcount--;\n\t\t\treturn temp;\n\t\t}\n\t}",
"@Override\n\tpublic E deQueue() {\n\t\treturn list.removeFirst();\n\t}",
"public void dequeue()\n\t{\n\t\tq.removeFirst();\n\t}",
"T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }",
"public O popFront()\r\n {\r\n if (!isEmpty())\r\n {\r\n VectorItem<O> l = first;\r\n first = first.getNext();\r\n \r\n count--;\r\n if (isEmpty()) last = null;\r\n else first.setPrevious(null);\r\n \r\n return l.getObject();\r\n } else\r\n return null;\r\n }",
"public static String deQueue(Queue q){ \n String front = q.names[0]; //Store the front element to be returned and printed if wanted \n if (q.queuesize != 0){ //IF the queue is not empty \n for (int i = 0; i < q.queuesize; i++){ //For the all of the non zero elements in the queue\n q.names[i] = q.names[i+1]; // Overwrite the first element to get rid of it and shove all of the others up 1\n }\n q.queuesize -=1; //Decrease the size by 1 as someone left \n }\n else{\n System.out.print(\"Empty Queue\"); //State the queue is empty and nothing can be removed\n }\n return front; //Return the element that was once in front - This can be printed \n }",
"public T dequeue() {\n if (isEmpty()) {\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T itemToReturn = rb[first];\n rb[first] = null;\n fillCount -= 1;\n if (isEmpty()) {\n first = 0;\n last = 0;\n return itemToReturn;\n }\n first = (first + 1) % capacity;\n return itemToReturn;\n\n // Dequeue the first item. Don't forget to decrease fillCount and update\n }",
"Node dequeue() {\n Node n = queue.removeFirst();\n queueSet.remove(n);\n return n;\n }",
"public Item dequeue() throws NoSuchElementException {\r\n // Usar el metodo downHeap para corregir la condicion\r\n // de Min Heap\r\n\r\n\r\n Item ret = heap[1];\r\n\r\n heap[1] = heap[size];\r\n downHeap(1);\r\n\r\n heap[size] = null;\r\n size--;\r\n\r\n return ret;\r\n }",
"public T removeFront() {\n\t\tT found = start.value;\n\t\tstart = start.next;\n\t\treturn found;\n\t}",
"@Override\r\n public CustomProcess removeBest() {\r\n if (isEmpty()) {\r\n throw new NoSuchElementException(\"queue is empty, cannot remove from empty queue\");\r\n }\r\n CustomProcess best = data[0]; // process to be removed\r\n data[0] = data[size - 1];\r\n data[size - 1] = null;\r\n minHeapPercolateDown(0); // Percolate down on first index\r\n size--;\r\n return best;\r\n }",
"public E dequeue() {\n return pop();\n }",
"public Object dequeue()\n {\n return queue.removeFirst();\n }",
"@Override\n public AmortizedDeque<T> popFront() throws NoSuchElementException {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n return new AmortizedDeque<>(head.popFront(), tail);\n }",
"public int pop() {\n int size=queue.size();\n for (int i = 0; i <size-1 ; i++) {\n int temp=queue.poll();\n queue.add(temp);\n }\n return queue.poll();\n }",
"@Override\r\n\tpublic T dequeue() {\r\n\t\tT element;\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new AssertionError(\"Queue is empty.\");\r\n\t\telement = arr[front].getData();\r\n\t\tif (front == rear) {\r\n\t\t\tfront = rear = -1;\r\n\t\t} else {\r\n\t\t\tfront++;\r\n\t\t}\r\n\t\treturn element;\r\n\t}",
"public static Object dequeue() {\t \n if(queue.isEmpty()) {\n System.out.println(\"The queue is already empty. No element can be removed from the queue.\"); \n return -1;\n }\n return queue.removeFirst();\n }",
"public int getFront() {\n if(isEmpty()){\n return -1;\n }\n return queue[head];\n }",
"public static Object peek() {\t \n if(queue.isEmpty()) { \n System.out.println(\"The queue is empty so we can't see the front item of the queue.\"); \n return -1;\n }\t \n else {\n System.out.println(\"The following element is the top element of the queue:\" + queue.getFirst()); \t \n }\n return queue.getFirst();\n }",
"public T removeFirst() {\n if (size == 0) {\n return null;\n }\n if (size == 1) {\n size--;\n return array[front];\n }\n this.checkReSizeDown();\n size--;\n front++;\n this.updatePointer();\n return array[Math.floorMod(front - 1, array.length)];\n }",
"@Override\r\n\tpublic T dequeue() throws QueueUnderflowException {\r\n\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tthrow new QueueUnderflowException(\"The queue is empty\");\r\n\t\t}\r\n\t\t// Remove the first element\t\t\r\n\t\treturn data.remove(0);\r\n\t}",
"public Item peek(){\n if(isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\n return first.item;\n }",
"public synchronized Object dequeue() throws EmptyListException {\r\n return removeFromFront();\r\n }",
"public Object dequeue() {\n\t\tif(isEmpty()) throw new RuntimeException(); \n\t\tObject value = data[0];\n\t\tfor(int i = 0; i < data.length-1; i++) {\n\t\t\tdata[i] = data[i+1];\n\t\t}\n\t\tdata[size()] = null;\n\t\tindx--;\n\t\treturn value;\n\t}",
"public void pop() {\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\twhile (!queue.isEmpty())\n\t\t\tlist.add(queue.poll());\n\t\tfor (int i = 0; i < list.size() - 1; i++)\n\t\t\tqueue.add(list.get(i));\n\t}",
"public T dequeue()\n\t{\n\t\tNode<T> eliminado = head;\n\t\thead = head.getNext();\n\t\tif(head == null)\n\t\t{\n\t\t\ttail = null;\n\t\t}\n\t\tsize--;\n\t\treturn eliminado.getElement();\n\t}",
"public E dequeue() {\n\t\treturn list.removeFirst();\n\t}",
"public int pop() {\r\n if (queue1.size() == 0) {\r\n return -1;\r\n }\r\n int removed = top;\r\n while (queue1.peek() != removed) {\r\n top = queue1.remove();\r\n queue1.add(top);\r\n }\r\n return queue1.remove();\r\n }",
"public int removeMin() \n {\n\t//error\n\tif ( queue.isEmpty() ) {//nothing to remove\n\t System.out.println( \"Error! Nothing to remove!\" );\n\t throw new NoSuchElementException();\n\t}\n\n\tint ret = (int) queue.get(0);\n\tqueue.remove(0);\n\treturn ret; \n }",
"public Object dequeue(){\r\n return super.remove(size()-1);\r\n }",
"public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}",
"public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }",
"public IClause popFront() {\n if (back==front)\n \tthrow new BufferUnderflowException();\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"public NodeBase<V> dequeue() {\r\n \tif(!isEmpty()){\r\n \tNodeBase<V> min=queue[0];\r\n \tint j=0;\r\n for(int i=0;i<currentSize;i++){\r\n \t if(min.getPriority()>queue[i].getPriority()){\r\n \t\t min=queue[i];\r\n \t\t j=i;\r\n \t }\r\n }\r\n for(int x=j;x<currentSize-1;x++){\r\n \t queue[x]=queue[x+1];\r\n }\r\n \r\n currentSize--;\r\n \r\n return min;\r\n \t}\r\n \telse{\r\n \t\treturn null;\r\n \t}\r\n }",
"E dequeue();",
"E dequeue();",
"E dequeue();",
"T dequeue();",
"T dequeue();",
"public E dequeue() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t}\r\n\t\t\r\n\t\tif (size() != 1) {\r\n\t\t\t//Node p = first; \r\n\t\t\tE item = first.item;\r\n\t\t\tremove(0);\r\n\t\t\t//first = p.next;\r\n\t\t\t//first.prev = null;\r\n\t\t\treturn item;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tE e = last.item;\r\n\t\t\tremove(last.item);\r\n\n\t\t\treturn e;\r\n\t\t}\n\t}",
"public T dequeue() {\n if (first != null) {\n size--;\n T data = first.data;\n first = first.next;\n\n if (first == null) {\n last = null; // avoid memory leak by removing reference\n }\n\n return data;\n }\n return null;\n }",
"@Override\r\n\tpublic void Dequeue() {\n\t\tif (IsEmpty())\r\n\t throw new NoSuchElementException(\"Underflow Exception\");\r\n\t else \r\n\t {\r\n\t \tlen--;\r\n\t int data = queue[front];\r\n\t System.out.println(\"The Dequed Element is \"+data);\r\n\t if ( front == rear) \r\n\t {\r\n\t front = -1;\r\n\t rear = -1;\r\n\t }\r\n\t else\r\n\t front++;\r\n\t }\r\n\t\t\r\n\t}",
"@Override\n public T dequeue() {\n if (!isEmpty()) {\n return heap.remove();\n } else {\n throw new NoSuchElementException(\"Priority Queue is null\");\n }\n }",
"public Item dequeue()\n {\n checkNotEmpty();\n\n if (items.length / 4 > size)\n {\n resize(items.length / 2);\n }\n\n int last = size - 1;\n swap(items, nextIndex(), last);\n Item toReturn = items[last];\n items[last] = null;\n size--;\n\n return toReturn;\n }",
"public void pop() {\n int size = q.size();\n for(int i = 1; i<size;i++){\n q.offer(q.poll());\n }\n q.poll();\n }",
"public E dequeue() {\n\t\tresetIterator();\n\t\tsize--;\n\t\tE temp = head.data;\n\t\thead = head.next;\n\t\treturn temp;\n\t}",
"public T removeFirst() {\r\n \r\n if (size == 0) {\r\n return null;\r\n }\r\n \r\n T deleted = front.element;\r\n front = front.next;\r\n size--;\r\n \r\n return deleted;\r\n }",
"public Item removeFirst(){\n\t\tif(isEmpty()){\n\t\t\tthrow new NoSuchElementException(\"Queue underflow\");\n\t\t}else{\n\t\t\t//save item to return\n\t\t\tItem returnItem = first.item;\n\t\t\t//delete first node\n\t\t\tfirst = first.next;\n\t\t\tn--;\n\t\t\tif(isEmpty()){\n\t\t\t\tlast = null; // to avoid loitering\n\t\t\t}else{\n\t\t\t\tfirst.prev = null;\n\t\t\t}\n\t\t\treturn returnItem;\n\t\t}\n\t}",
"T dequeue() {\n return contents.removeFromTail();\n }",
"public int pop() {\n int size = queue.size();\n while (size > 2) {\n queue.offer(queue.poll());\n size--;\n }\n topElem = queue.peek();\n queue.offer(queue.poll());\n return queue.poll();\n }",
"@Override\n\tpublic E dequeue() {\n\t\tif (! isEmpty()) {\n\t\t\tNode temp = first;\n\t\t\tE e = temp.element;\n\t\t\tfirst = temp.next;\n\t\t\t\n\t\t\tif (temp == last)\n\t\t\t\tlast = null;\n\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"public void dequeue() {\n\t\tObject ret_val = todequeue();\n\t\tif(ret_val == null)\n\t\t\tSystem.out.println(\"The queue is empty\");\n\t\telse\n\t\t\tSystem.out.println(\"Removed: \" + ret_val);\n\t}",
"@Override\n public E removeLast() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[tail];\n dequeue[tail] = null;\n tail--;\n if (tail == -1) {\n tail = dequeue.length - 1;\n }\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }",
"public E dequeue();",
"public Object popFront(){\n\t\tObject data = head.data;\n\t\thead = head.nextNode; \n\t\t--size; \n\t\t\n\t\treturn data; \n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic ImmutableQueue<T> deQueue() {\r\n\t\tif (this.isEmpty())\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t\r\n\t\tif (!this.dequeueStack.isEmpty()) \r\n\t\t\treturn new ImmutableQueue<T>(this.enqueueStack, this.dequeueStack.getTail());\r\n\t\telse \t\t\t\r\n\t\t\treturn new ImmutableQueue<T>(ImmutableStack.empty(), this.enqueueStack.reverse().getTail());\r\n\t\t\r\n\t}",
"public int pop() {\n int res= q1.remove();\n if (!q1.isEmpty())\n top = q1.peek();\n return res;\n }",
"public IClause uncheckedFront() {\n assert back!=front : \"Deque is empty\";\n\n int i = front - 1;\n if (i < 0)\n i = tab.length - 1;\n return tab[i];\n }",
"public int pop() {\r\n if (queue1.size() == 0) {\r\n return -1;\r\n }\r\n Queue<Integer> queue2 = new LinkedList();\r\n int removed = top;\r\n while (queue1.peek() != removed) {\r\n top = queue1.remove();\r\n queue2.add(top);\r\n }\r\n queue1 = queue2;\r\n return removed;\r\n }",
"public T dequeue();",
"public void pop() {\n queue.remove(0);\n }",
"public Object dequeue() {\n\t\tObject itemToDeq = null;\n\t\tif(this.l.start==null){\n\t\t\tnew QueueUnderflowException(\"No elements in the queue\");\n\t\t}\n\t\telse{\n\t\t\tListNode p = this.l.start;\n\t\t\tif(p.next==null){\n\t\t\t\titemToDeq = p.item;\n\t\t\t\tthis.l.start = null;\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(p.next.next!=null){\n\t\t\t\t\tp = p.next;\n\t\t\t\t}\n\t\t\t\titemToDeq = p.next.item;\n\t\t\t\tp.next=null;\n\t\t\t}\n\t\t\treturn itemToDeq;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n public T dequeue() {\n T frontChar = myQ[0];\n\n for(int i = 1; i < myLength; i++) {\n myQ[i - 1] = myQ[i];\n }\n myLength--;\n return frontChar;\n }"
]
| [
"0.7772967",
"0.77117085",
"0.7550495",
"0.7457074",
"0.7400244",
"0.7384271",
"0.7369698",
"0.73610646",
"0.73550296",
"0.7345545",
"0.7342202",
"0.7272804",
"0.72678214",
"0.7249244",
"0.7223971",
"0.7214708",
"0.72118217",
"0.7210561",
"0.7207122",
"0.7195922",
"0.7181171",
"0.7179072",
"0.7175878",
"0.71515304",
"0.71370775",
"0.7133717",
"0.71189016",
"0.71185607",
"0.7114719",
"0.7100317",
"0.7080396",
"0.706211",
"0.705429",
"0.7053954",
"0.70338374",
"0.70172995",
"0.7008564",
"0.69839936",
"0.698106",
"0.6964553",
"0.6962496",
"0.69617265",
"0.6950448",
"0.69407713",
"0.69403815",
"0.6911815",
"0.6906966",
"0.6887176",
"0.68869686",
"0.6880552",
"0.6879959",
"0.6879392",
"0.6867161",
"0.6863206",
"0.6857067",
"0.68540365",
"0.68434167",
"0.683506",
"0.6822353",
"0.68218565",
"0.6820987",
"0.6819824",
"0.6812017",
"0.68007976",
"0.6789037",
"0.6788246",
"0.6775297",
"0.67751575",
"0.67724717",
"0.6768881",
"0.6766213",
"0.6766213",
"0.6766213",
"0.6755194",
"0.6755194",
"0.6754236",
"0.6749981",
"0.6743798",
"0.67427856",
"0.6734987",
"0.67343116",
"0.6732281",
"0.6728102",
"0.67237145",
"0.67119443",
"0.6703324",
"0.6700606",
"0.66814095",
"0.66787827",
"0.6675224",
"0.667447",
"0.6669484",
"0.6664269",
"0.66530454",
"0.66481626",
"0.66314447",
"0.66282713",
"0.6610543",
"0.6606262",
"0.6595195"
]
| 0.7603967 | 2 |
Remove and return the front element of the queue; move everything over to the left one slot Note: Does not check for underflow | public int dequeueRear(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic E dequeueFront() {\n\t\tif(isEmpty()) return null;\r\n\t\tE value = data[frontDeque];\r\n\t\tfrontDeque = (frontDeque + 1)% CAPACITY;\r\n\t\tsizeDeque--;\r\n\t\treturn value;\r\n\t}",
"public long remove(){\n\t\t\r\n\t\t\tlong temp = queueArray[front]; //retrieves and stores the front element\r\n\t\t\tfront++;\r\n\t\t\tif(front == maxSize){ //To set front = 0 and use it again\r\n\t\t\t\tfront = 0;\r\n\t\t\t}\r\n\t\t\tnItems--;\r\n\t\t\treturn temp;\r\n\t\t}",
"public int dequeueFront();",
"private void shift(){\n if (queue.length < 1){\n throw new Error(\"Table self destruction!\");\n }\n if (size <= 0){\n return;\n }\n\n if (queue[0] == null){\n E best = null;\n int bestAT = -1;\n for (int x = 0 ; x < queue.length; x++){\n E cur = (E)queue[x];\n if (cur == null){\n continue;\n }\n if (best == null || cur.compareTo(best) > 0){\n best = cur;\n bestAT = x;\n }\n }\n // Not put best at front;\n queue[bestAT] = null;\n queue[0] = best;\n }\n\n }",
"public E poll() {\n\t\twhile (true) {\n\t\t\tlong f = front.get();\n\t\t\tint i = (int)(f % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did front change while we were reading x?\n\t\t\tif (f != front.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue empty?\n\t\t\tif (f == rear.get())\n\t\t\t\treturn null; //Don't retry; fail the poll.\n\n\t\t\tif (x != null) {//Is the front nonempty?\n\t\t\t\tif (elements.compareAndSet(i, x, null)) {//Try to remove an element.\n\t\t\t\t\t//Try to increment front. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further removals, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\tfront.compareAndSet(f, f+1);\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t} else //front empty. Try to help other threads.\n\t\t\t\tfront.compareAndSet(f, f+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"public E dequeue(){\n if (isEmpty()) return null;\n E answer = arrayQueue[front];\n arrayQueue[front] = null;\n front = (front +1) % arrayQueue.length;\n size--;\n return answer;\n }",
"public E dequeue() {\n if (size == 0){\n return null;\n }\n\n\n E result = (E) queue[0];\n queue[0] = null;\n --size;\n\n if (size != 0){\n shift();\n }\n return result;\n }",
"private E dequeue() {\n final Object[] items = this.items;\n @SuppressWarnings(\"unchecked\")\n E x = (E) items[takeIndex];\n items[takeIndex] = null;\n if (++takeIndex == items.length) takeIndex = 0;\n count--;\n notFull.signal();\n return x;\n }",
"@Override\n\tpublic E dequeue() {\n\t\tE temp=null;\n\t\tif(front==data.length-1){\n\t\t\ttemp=data[front];\n\t\t\tsize--;\n\t\t\tfront=(front+1)%data.length;\n\t\t}else{\n\t\t\tsize--;\n\t\t\ttemp=data[front++];\n\t\t}\n\t\treturn temp;\n\t}",
"public int dequeue() {\n\t\tif (isEmpty()) throw new IllegalStateException(\"\\nQueue is empty!\\n\");\n\t\tint removedItem = bq[head];\n\t\tif (head == bq.length - 1) head = 0; // wraparound\n\t\telse head++;\n\t\tsize--;\n\t\treturn removedItem;\t\n\t}",
"T getFront() throws EmptyQueueException;",
"private E remove() {\n if (startPos >= queue.length || queue[startPos] == null) throw new NoSuchElementException();\n size--;\n return (E) queue[startPos++];\n }",
"public T front() throws EmptyQueueException;",
"public E dequeue() {\n if (isEmpty()) return null; //nothing to remove.\n E item = first.item;\n first = first.next; //will become null if the queue had only one item.\n n--;\n if (isEmpty()) last = null; // special case as the queue is now empty. \n return item;\n }",
"void dequeue() \n { \n // If queue is empty, return NULL. \n if (this.front == null) \n return; \n \n // Store previous front and move front one node ahead \n LinkedListQueue temp = this.front; \n this.front = this.front.next; \n \n // If front becomes NULL, then change rear also as NULL \n if (this.front == null) \n this.rear = null; \n }",
"public T removeFirst(){\n\tT ret = _front.getCargo();\n\t_front = _front.getPrev();\n\t_front.setNext(null);\n\t_size--;\n\treturn ret;\n }",
"void deleteFromFront()\n {\n // check whether Deque is empty or not \n if (isEmpty())\n {\n return;\n }\n // Only one element left\n if (front == end)\n {\n front = end = -1;\n }\n else {\n // back to initial\n front = (front == size -1) ? 0 : front+1;\n }\n }",
"public IClause uncheckedPopFront() {\n assert back!=front : \"Deque is empty\";\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"@Override\n public E poll() {\n E tmp = (E)queue[0];\n System.arraycopy(queue, 1, queue, 0, size - 1);\n size--;\n return tmp;\n }",
"public Object todequeue() {\n\t\tif(rear == 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tObject to_return = arr[front];\n\t\t\tfront++;\n\t\t\tsize--;\n\t\t\treturn to_return;\n\t\t}\n\t}",
"@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public E removeFront() {\r\n if (elem[front] == null) {\r\n throw new NoSuchElementException();\r\n } else {\r\n E temp = elem[front];\r\n elem[front] = null;\r\n front++;\r\n return temp;\r\n }\r\n }",
"public Item removeFirst(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[first];\r\n\t\tlist[first++] = null;\r\n\t\tn--;\r\n\t\tprior=first-1;\r\n\t\tif(first==list.length){first=0;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}",
"private int dequeue(){\n size--;\n int ret = array[front];\n front = (front+1)%capacity;\n return ret;\n }",
"public T poll() {\n if (size == 0) {\n return null;\n }\n\n // set returned value to queue[0]\n T value = (T) array[0];\n\n // decrease size - we are removing element\n size--;\n\n // move queue 1 place left\n System.arraycopy(array, 1, array, 0, size);\n\n // clear last element\n array[size] = null;\n\n return value;\n }",
"public T dequeue(){\n T front = getFront(); // might throw exception, assumes firstNode != null\n firstNode = firstNode.getNext();\n\n if (firstNode == null){\n lastNode = null;\n } // end if\n return front;\n }",
"public E remove(){\r\n if(isEmpty())\r\n return null;\r\n \r\n //since the array is ordered, the highest priority will always be at the end of the queue\r\n //--currentSize will find the last index (highest priority) and remove it\r\n return queue[--currentSize];\r\n }",
"public Country removeFront() {\n\t\tCountry temp = null;\n\t\ttry {\n\t\t\tif (isEmpty()) {\n\t\t\t\tSystem.out.println(\"The queue is empty.\");\n\t\t\t} else if (front != end) {\n\t\t\t\tfront.previous = null;\n\t\t\t\ttemp = front.data;\n\t\t\t\tfront = front.next;\n\t\t\t} else {\n\t\t\t\tfront = end = null;\n\t\t\t\ttemp = front.data;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t;\n\t\t}\n\t\treturn temp;\n\t}",
"public Object deQueue()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n Node temp = this.front;\n front = front.getNext();\n if(this.isEmpty()){this.rear = null;}\n return temp.getData();\n }",
"public Integer dequeue() {\n\t\t // get last val in heap, copy value to index 0\n\t\t // decrease size \n\t\t // create a recursive helper, percolateDown,\n\t\t // that allows you move the removed val \n\t\t // in the right place\n\t\t \n\t\t if (size == 0) \n\t\t\t throw new EmptyStackException();\n\t int item = data[0]; \n\t data[0] = data[size - 1]; \n\t size--;\n\t percolateDown(0); \n\t return item;\n\t }",
"@Override\n\tpublic E dequeue() {\n\t\tif(isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tE data = queue[pos];\n\t\tqueue[pos] = null;\n\t\tpos = (pos+1) % queue.length;\n\t\tsize--;\n\t\treturn data;\n\t}",
"public E peek(){\r\n if(isEmpty())\r\n return null;\r\n\r\n return queue[currentSize-1]; //return the object without removing it\r\n }",
"public Object peek()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n return front.getData();\n }",
"public T removeFromFront() {\n DoublyLinkedListNode<T> temp = head;\n if (size == 0) {\n throw new NoSuchElementException(\"The list is empty, so there\"\n + \" is nothing to get.\");\n } else {\n if (head == tail) {\n head = tail;\n tail = null;\n return temp.getData();\n } else {\n head = head.getNext();\n head.setPrevious(null);\n size -= 1;\n return temp.getData();\n }\n }\n\n\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic T dequeue() {\r\n\t\tT data;\r\n\t\t\r\n\t\t// checking if queue is empty or not\r\n\t\tif (isEmtpy()) {\r\n\t\t\tthrow new AssertionError(\"Queue is empty\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// remove element\r\n\t\t\tdata = (T)(Integer)this.array[this.front];\r\n\t\t\t\r\n\t\t\t// adjust both front and rear of queue\r\n\t\t\tif (this.front == this.rear) {\r\n\t\t\t\tthis.front = this.rear = -1;\r\n\t\t\t} else {\r\n\t\t\t\tthis.front = (this.front + 1) % this.size;\r\n\t\t\t}\r\n\t\t\treturn (T)data;\r\n\t\t}\r\n\t}",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"queue is empty\");\n }\n Item a;\n a = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else first.prev = null;\n size--;\n return a;\n }",
"public T dequeue() {\n if (size == 0) {\n throw new NoSuchElementException(\"The queue is empty\"\n + \". Please add data before attempting to remove.\");\n } else if (front == backingArray.length - 1) {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = 0;\n size--;\n return data;\n } else {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = temp + 1;\n size--;\n return data;\n }\n }",
"public E removeFront() {\n\t\tif (count == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tE temp = head.value;\n\t\t\thead = head.next;\n\t\t\tcount--;\n\t\t\treturn temp;\n\t\t}\n\t}",
"@Override\n\tpublic E deQueue() {\n\t\treturn list.removeFirst();\n\t}",
"public void dequeue()\n\t{\n\t\tq.removeFirst();\n\t}",
"T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }",
"public O popFront()\r\n {\r\n if (!isEmpty())\r\n {\r\n VectorItem<O> l = first;\r\n first = first.getNext();\r\n \r\n count--;\r\n if (isEmpty()) last = null;\r\n else first.setPrevious(null);\r\n \r\n return l.getObject();\r\n } else\r\n return null;\r\n }",
"public static String deQueue(Queue q){ \n String front = q.names[0]; //Store the front element to be returned and printed if wanted \n if (q.queuesize != 0){ //IF the queue is not empty \n for (int i = 0; i < q.queuesize; i++){ //For the all of the non zero elements in the queue\n q.names[i] = q.names[i+1]; // Overwrite the first element to get rid of it and shove all of the others up 1\n }\n q.queuesize -=1; //Decrease the size by 1 as someone left \n }\n else{\n System.out.print(\"Empty Queue\"); //State the queue is empty and nothing can be removed\n }\n return front; //Return the element that was once in front - This can be printed \n }",
"public T dequeue() {\n if (isEmpty()) {\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T itemToReturn = rb[first];\n rb[first] = null;\n fillCount -= 1;\n if (isEmpty()) {\n first = 0;\n last = 0;\n return itemToReturn;\n }\n first = (first + 1) % capacity;\n return itemToReturn;\n\n // Dequeue the first item. Don't forget to decrease fillCount and update\n }",
"public Item dequeue() throws NoSuchElementException {\r\n // Usar el metodo downHeap para corregir la condicion\r\n // de Min Heap\r\n\r\n\r\n Item ret = heap[1];\r\n\r\n heap[1] = heap[size];\r\n downHeap(1);\r\n\r\n heap[size] = null;\r\n size--;\r\n\r\n return ret;\r\n }",
"Node dequeue() {\n Node n = queue.removeFirst();\n queueSet.remove(n);\n return n;\n }",
"public T removeFront() {\n\t\tT found = start.value;\n\t\tstart = start.next;\n\t\treturn found;\n\t}",
"@Override\r\n public CustomProcess removeBest() {\r\n if (isEmpty()) {\r\n throw new NoSuchElementException(\"queue is empty, cannot remove from empty queue\");\r\n }\r\n CustomProcess best = data[0]; // process to be removed\r\n data[0] = data[size - 1];\r\n data[size - 1] = null;\r\n minHeapPercolateDown(0); // Percolate down on first index\r\n size--;\r\n return best;\r\n }",
"public E dequeue() {\n return pop();\n }",
"public Object dequeue()\n {\n return queue.removeFirst();\n }",
"@Override\n public AmortizedDeque<T> popFront() throws NoSuchElementException {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n return new AmortizedDeque<>(head.popFront(), tail);\n }",
"@Override\r\n\tpublic T dequeue() {\r\n\t\tT element;\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new AssertionError(\"Queue is empty.\");\r\n\t\telement = arr[front].getData();\r\n\t\tif (front == rear) {\r\n\t\t\tfront = rear = -1;\r\n\t\t} else {\r\n\t\t\tfront++;\r\n\t\t}\r\n\t\treturn element;\r\n\t}",
"public int pop() {\n int size=queue.size();\n for (int i = 0; i <size-1 ; i++) {\n int temp=queue.poll();\n queue.add(temp);\n }\n return queue.poll();\n }",
"public static Object dequeue() {\t \n if(queue.isEmpty()) {\n System.out.println(\"The queue is already empty. No element can be removed from the queue.\"); \n return -1;\n }\n return queue.removeFirst();\n }",
"public int getFront() {\n if(isEmpty()){\n return -1;\n }\n return queue[head];\n }",
"public static Object peek() {\t \n if(queue.isEmpty()) { \n System.out.println(\"The queue is empty so we can't see the front item of the queue.\"); \n return -1;\n }\t \n else {\n System.out.println(\"The following element is the top element of the queue:\" + queue.getFirst()); \t \n }\n return queue.getFirst();\n }",
"public T removeFirst() {\n if (size == 0) {\n return null;\n }\n if (size == 1) {\n size--;\n return array[front];\n }\n this.checkReSizeDown();\n size--;\n front++;\n this.updatePointer();\n return array[Math.floorMod(front - 1, array.length)];\n }",
"@Override\r\n\tpublic T dequeue() throws QueueUnderflowException {\r\n\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tthrow new QueueUnderflowException(\"The queue is empty\");\r\n\t\t}\r\n\t\t// Remove the first element\t\t\r\n\t\treturn data.remove(0);\r\n\t}",
"public Item peek(){\n if(isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\n return first.item;\n }",
"public synchronized Object dequeue() throws EmptyListException {\r\n return removeFromFront();\r\n }",
"public Object dequeue() {\n\t\tif(isEmpty()) throw new RuntimeException(); \n\t\tObject value = data[0];\n\t\tfor(int i = 0; i < data.length-1; i++) {\n\t\t\tdata[i] = data[i+1];\n\t\t}\n\t\tdata[size()] = null;\n\t\tindx--;\n\t\treturn value;\n\t}",
"public T dequeue()\n\t{\n\t\tNode<T> eliminado = head;\n\t\thead = head.getNext();\n\t\tif(head == null)\n\t\t{\n\t\t\ttail = null;\n\t\t}\n\t\tsize--;\n\t\treturn eliminado.getElement();\n\t}",
"public void pop() {\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\twhile (!queue.isEmpty())\n\t\t\tlist.add(queue.poll());\n\t\tfor (int i = 0; i < list.size() - 1; i++)\n\t\t\tqueue.add(list.get(i));\n\t}",
"public E dequeue() {\n\t\treturn list.removeFirst();\n\t}",
"public int pop() {\r\n if (queue1.size() == 0) {\r\n return -1;\r\n }\r\n int removed = top;\r\n while (queue1.peek() != removed) {\r\n top = queue1.remove();\r\n queue1.add(top);\r\n }\r\n return queue1.remove();\r\n }",
"public int removeMin() \n {\n\t//error\n\tif ( queue.isEmpty() ) {//nothing to remove\n\t System.out.println( \"Error! Nothing to remove!\" );\n\t throw new NoSuchElementException();\n\t}\n\n\tint ret = (int) queue.get(0);\n\tqueue.remove(0);\n\treturn ret; \n }",
"public Object dequeue(){\r\n return super.remove(size()-1);\r\n }",
"public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }",
"public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}",
"public IClause popFront() {\n if (back==front)\n \tthrow new BufferUnderflowException();\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"public NodeBase<V> dequeue() {\r\n \tif(!isEmpty()){\r\n \tNodeBase<V> min=queue[0];\r\n \tint j=0;\r\n for(int i=0;i<currentSize;i++){\r\n \t if(min.getPriority()>queue[i].getPriority()){\r\n \t\t min=queue[i];\r\n \t\t j=i;\r\n \t }\r\n }\r\n for(int x=j;x<currentSize-1;x++){\r\n \t queue[x]=queue[x+1];\r\n }\r\n \r\n currentSize--;\r\n \r\n return min;\r\n \t}\r\n \telse{\r\n \t\treturn null;\r\n \t}\r\n }",
"E dequeue();",
"E dequeue();",
"E dequeue();",
"T dequeue();",
"T dequeue();",
"public E dequeue() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t}\r\n\t\t\r\n\t\tif (size() != 1) {\r\n\t\t\t//Node p = first; \r\n\t\t\tE item = first.item;\r\n\t\t\tremove(0);\r\n\t\t\t//first = p.next;\r\n\t\t\t//first.prev = null;\r\n\t\t\treturn item;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tE e = last.item;\r\n\t\t\tremove(last.item);\r\n\n\t\t\treturn e;\r\n\t\t}\n\t}",
"public T dequeue() {\n if (first != null) {\n size--;\n T data = first.data;\n first = first.next;\n\n if (first == null) {\n last = null; // avoid memory leak by removing reference\n }\n\n return data;\n }\n return null;\n }",
"@Override\r\n\tpublic void Dequeue() {\n\t\tif (IsEmpty())\r\n\t throw new NoSuchElementException(\"Underflow Exception\");\r\n\t else \r\n\t {\r\n\t \tlen--;\r\n\t int data = queue[front];\r\n\t System.out.println(\"The Dequed Element is \"+data);\r\n\t if ( front == rear) \r\n\t {\r\n\t front = -1;\r\n\t rear = -1;\r\n\t }\r\n\t else\r\n\t front++;\r\n\t }\r\n\t\t\r\n\t}",
"@Override\n public T dequeue() {\n if (!isEmpty()) {\n return heap.remove();\n } else {\n throw new NoSuchElementException(\"Priority Queue is null\");\n }\n }",
"public Item dequeue()\n {\n checkNotEmpty();\n\n if (items.length / 4 > size)\n {\n resize(items.length / 2);\n }\n\n int last = size - 1;\n swap(items, nextIndex(), last);\n Item toReturn = items[last];\n items[last] = null;\n size--;\n\n return toReturn;\n }",
"public void pop() {\n int size = q.size();\n for(int i = 1; i<size;i++){\n q.offer(q.poll());\n }\n q.poll();\n }",
"public E dequeue() {\n\t\tresetIterator();\n\t\tsize--;\n\t\tE temp = head.data;\n\t\thead = head.next;\n\t\treturn temp;\n\t}",
"public T removeFirst() {\r\n \r\n if (size == 0) {\r\n return null;\r\n }\r\n \r\n T deleted = front.element;\r\n front = front.next;\r\n size--;\r\n \r\n return deleted;\r\n }",
"public Item removeFirst(){\n\t\tif(isEmpty()){\n\t\t\tthrow new NoSuchElementException(\"Queue underflow\");\n\t\t}else{\n\t\t\t//save item to return\n\t\t\tItem returnItem = first.item;\n\t\t\t//delete first node\n\t\t\tfirst = first.next;\n\t\t\tn--;\n\t\t\tif(isEmpty()){\n\t\t\t\tlast = null; // to avoid loitering\n\t\t\t}else{\n\t\t\t\tfirst.prev = null;\n\t\t\t}\n\t\t\treturn returnItem;\n\t\t}\n\t}",
"T dequeue() {\n return contents.removeFromTail();\n }",
"public int pop() {\n int size = queue.size();\n while (size > 2) {\n queue.offer(queue.poll());\n size--;\n }\n topElem = queue.peek();\n queue.offer(queue.poll());\n return queue.poll();\n }",
"@Override\n\tpublic E dequeue() {\n\t\tif (! isEmpty()) {\n\t\t\tNode temp = first;\n\t\t\tE e = temp.element;\n\t\t\tfirst = temp.next;\n\t\t\t\n\t\t\tif (temp == last)\n\t\t\t\tlast = null;\n\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"public void dequeue() {\n\t\tObject ret_val = todequeue();\n\t\tif(ret_val == null)\n\t\t\tSystem.out.println(\"The queue is empty\");\n\t\telse\n\t\t\tSystem.out.println(\"Removed: \" + ret_val);\n\t}",
"@Override\n public E removeLast() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[tail];\n dequeue[tail] = null;\n tail--;\n if (tail == -1) {\n tail = dequeue.length - 1;\n }\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public E dequeue();",
"void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }",
"public Object popFront(){\n\t\tObject data = head.data;\n\t\thead = head.nextNode; \n\t\t--size; \n\t\t\n\t\treturn data; \n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic ImmutableQueue<T> deQueue() {\r\n\t\tif (this.isEmpty())\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t\r\n\t\tif (!this.dequeueStack.isEmpty()) \r\n\t\t\treturn new ImmutableQueue<T>(this.enqueueStack, this.dequeueStack.getTail());\r\n\t\telse \t\t\t\r\n\t\t\treturn new ImmutableQueue<T>(ImmutableStack.empty(), this.enqueueStack.reverse().getTail());\r\n\t\t\r\n\t}",
"public int pop() {\n int res= q1.remove();\n if (!q1.isEmpty())\n top = q1.peek();\n return res;\n }",
"public IClause uncheckedFront() {\n assert back!=front : \"Deque is empty\";\n\n int i = front - 1;\n if (i < 0)\n i = tab.length - 1;\n return tab[i];\n }",
"public int pop() {\r\n if (queue1.size() == 0) {\r\n return -1;\r\n }\r\n Queue<Integer> queue2 = new LinkedList();\r\n int removed = top;\r\n while (queue1.peek() != removed) {\r\n top = queue1.remove();\r\n queue2.add(top);\r\n }\r\n queue1 = queue2;\r\n return removed;\r\n }",
"public T dequeue();",
"public void pop() {\n queue.remove(0);\n }",
"public Object dequeue() {\n\t\tObject itemToDeq = null;\n\t\tif(this.l.start==null){\n\t\t\tnew QueueUnderflowException(\"No elements in the queue\");\n\t\t}\n\t\telse{\n\t\t\tListNode p = this.l.start;\n\t\t\tif(p.next==null){\n\t\t\t\titemToDeq = p.item;\n\t\t\t\tthis.l.start = null;\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(p.next.next!=null){\n\t\t\t\t\tp = p.next;\n\t\t\t\t}\n\t\t\t\titemToDeq = p.next.item;\n\t\t\t\tp.next=null;\n\t\t\t}\n\t\t\treturn itemToDeq;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n public T dequeue() {\n T frontChar = myQ[0];\n\n for(int i = 1; i < myLength; i++) {\n myQ[i - 1] = myQ[i];\n }\n myLength--;\n return frontChar;\n }"
]
| [
"0.7774538",
"0.7711547",
"0.7604803",
"0.7550729",
"0.7457264",
"0.7400458",
"0.73847485",
"0.7369938",
"0.7361799",
"0.7355097",
"0.7347222",
"0.7341771",
"0.72746176",
"0.72680545",
"0.7248873",
"0.722417",
"0.72152",
"0.721211",
"0.7211473",
"0.7207754",
"0.7196709",
"0.7182085",
"0.71786606",
"0.71756923",
"0.71523803",
"0.71380925",
"0.713372",
"0.71195954",
"0.71183956",
"0.7115252",
"0.710059",
"0.70815486",
"0.7063158",
"0.70552033",
"0.70547456",
"0.70340496",
"0.70178396",
"0.701037",
"0.6984249",
"0.6980906",
"0.69652975",
"0.6964223",
"0.69613814",
"0.6950901",
"0.6940764",
"0.69407445",
"0.6913135",
"0.6906276",
"0.6888219",
"0.6887531",
"0.68818337",
"0.6880584",
"0.68802136",
"0.686775",
"0.68657094",
"0.68588567",
"0.6854548",
"0.68436134",
"0.68363035",
"0.68231595",
"0.682274",
"0.68204147",
"0.6820322",
"0.68131083",
"0.6801215",
"0.67891675",
"0.67886484",
"0.67759126",
"0.67751175",
"0.6772722",
"0.6769364",
"0.6766475",
"0.6766475",
"0.6766475",
"0.6755276",
"0.6755276",
"0.6755104",
"0.67507637",
"0.67430395",
"0.67429847",
"0.6735026",
"0.67336196",
"0.67332184",
"0.6728585",
"0.67237693",
"0.67121696",
"0.67035276",
"0.6701427",
"0.66815805",
"0.66788787",
"0.66751015",
"0.66749954",
"0.66710037",
"0.6663551",
"0.6653512",
"0.6649106",
"0.6631648",
"0.6628642",
"0.6610046",
"0.6606455",
"0.65965307"
]
| 0.0 | -1 |
Return front element of the queue without removing it Note: Does not check for underflow | public int peekFront(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic E dequeueFront() {\n\t\tif(isEmpty()) return null;\r\n\t\tE value = data[frontDeque];\r\n\t\tfrontDeque = (frontDeque + 1)% CAPACITY;\r\n\t\tsizeDeque--;\r\n\t\treturn value;\r\n\t}",
"T getFront() throws EmptyQueueException;",
"public T front() throws EmptyQueueException;",
"public static Object peek() {\t \n if(queue.isEmpty()) { \n System.out.println(\"The queue is empty so we can't see the front item of the queue.\"); \n return -1;\n }\t \n else {\n System.out.println(\"The following element is the top element of the queue:\" + queue.getFirst()); \t \n }\n return queue.getFirst();\n }",
"public int getFront() {\n if(isEmpty()){\n return -1;\n }\n return queue[head];\n }",
"public E peek(){\r\n if(isEmpty())\r\n return null;\r\n\r\n return queue[currentSize-1]; //return the object without removing it\r\n }",
"public Object peek()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n return front.getData();\n }",
"public E first(){\n if (isEmpty()) return null;\n return arrayQueue[front];\n }",
"public IClause uncheckedPopFront() {\n assert back!=front : \"Deque is empty\";\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"public int dequeueFront();",
"@Override\n public T peekFront() {\n if (isEmpty()) {\n return null;\n }\n return head.peekFront();\n }",
"T peek(){\n if(isEmpty()){\n return null;\n }\n return (T)queueArray[0];\n }",
"public int Front() {\n if (this.count == 0)\n return -1;\n return this.queue[this.headIndex];\n }",
"public Item peek(){\n if(isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\n return first.item;\n }",
"public int Front() {\n if(queue[head] == null){\n return -1;\n }else{\n return queue[head];\n }\n }",
"public Object getFront() throws Exception {\n if (!isEmpty()) {\n return queue[front];\n } else {\n // 对为空返回null\n return null;\n }\n }",
"public T getFront(){\n if (isEmpty()){\n throw new EmptyQueueException();\n }\n else {\n return firstNode.getData();\n }\n }",
"public T peek() {\n if (size == 0) {\n throw new NoSuchElementException(\"The queue is empty\"\n + \". Please add data before attempting to peek.\");\n } else {\n return backingArray[front];\n }\n\n }",
"public E dequeue(){\n if (isEmpty()) return null;\n E answer = arrayQueue[front];\n arrayQueue[front] = null;\n front = (front +1) % arrayQueue.length;\n size--;\n return answer;\n }",
"@Override\n\tpublic E dequeue() {\n\t\tE temp=null;\n\t\tif(front==data.length-1){\n\t\t\ttemp=data[front];\n\t\t\tsize--;\n\t\t\tfront=(front+1)%data.length;\n\t\t}else{\n\t\t\tsize--;\n\t\t\ttemp=data[front++];\n\t\t}\n\t\treturn temp;\n\t}",
"public E dequeue() {\n if (size == 0){\n return null;\n }\n\n\n E result = (E) queue[0];\n queue[0] = null;\n --size;\n\n if (size != 0){\n shift();\n }\n return result;\n }",
"@Override\n\tpublic E first() {\n\t\treturn queue[pos];\n\t}",
"public IClause uncheckedFront() {\n assert back!=front : \"Deque is empty\";\n\n int i = front - 1;\n if (i < 0)\n i = tab.length - 1;\n return tab[i];\n }",
"@Override\n public E peek() {\n return (E)queue[0];\n }",
"public Country removeFront() {\n\t\tCountry temp = null;\n\t\ttry {\n\t\t\tif (isEmpty()) {\n\t\t\t\tSystem.out.println(\"The queue is empty.\");\n\t\t\t} else if (front != end) {\n\t\t\t\tfront.previous = null;\n\t\t\t\ttemp = front.data;\n\t\t\t\tfront = front.next;\n\t\t\t} else {\n\t\t\t\tfront = end = null;\n\t\t\t\ttemp = front.data;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t;\n\t\t}\n\t\treturn temp;\n\t}",
"public E poll() {\n\t\twhile (true) {\n\t\t\tlong f = front.get();\n\t\t\tint i = (int)(f % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did front change while we were reading x?\n\t\t\tif (f != front.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue empty?\n\t\t\tif (f == rear.get())\n\t\t\t\treturn null; //Don't retry; fail the poll.\n\n\t\t\tif (x != null) {//Is the front nonempty?\n\t\t\t\tif (elements.compareAndSet(i, x, null)) {//Try to remove an element.\n\t\t\t\t\t//Try to increment front. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further removals, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\tfront.compareAndSet(f, f+1);\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t} else //front empty. Try to help other threads.\n\t\t\t\tfront.compareAndSet(f, f+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"public T poll() {\n if (size == 0) {\n return null;\n }\n\n // set returned value to queue[0]\n T value = (T) array[0];\n\n // decrease size - we are removing element\n size--;\n\n // move queue 1 place left\n System.arraycopy(array, 1, array, 0, size);\n\n // clear last element\n array[size] = null;\n\n return value;\n }",
"@Override\n public AmortizedDeque<T> popFront() throws NoSuchElementException {\n if (isEmpty()) {\n throw new NoSuchElementException();\n }\n return new AmortizedDeque<>(head.popFront(), tail);\n }",
"public int Front() {\n if (isEmpty()) {\n return -1;\n }\n return queue[head];\n }",
"public E removeFront() {\n\t\tif (count == 0) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tE temp = head.value;\n\t\t\thead = head.next;\n\t\t\tcount--;\n\t\t\treturn temp;\n\t\t}\n\t}",
"@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"private E dequeue() {\n final Object[] items = this.items;\n @SuppressWarnings(\"unchecked\")\n E x = (E) items[takeIndex];\n items[takeIndex] = null;\n if (++takeIndex == items.length) takeIndex = 0;\n count--;\n notFull.signal();\n return x;\n }",
"public Object dequeue()\n {\n return queue.removeFirst();\n }",
"public E removeFront() {\r\n if (elem[front] == null) {\r\n throw new NoSuchElementException();\r\n } else {\r\n E temp = elem[front];\r\n elem[front] = null;\r\n front++;\r\n return temp;\r\n }\r\n }",
"@Override\r\n\tpublic T dequeue() {\r\n\t\tT element;\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new AssertionError(\"Queue is empty.\");\r\n\t\telement = arr[front].getData();\r\n\t\tif (front == rear) {\r\n\t\t\tfront = rear = -1;\r\n\t\t} else {\r\n\t\t\tfront++;\r\n\t\t}\r\n\t\treturn element;\r\n\t}",
"public E dequeue() {\n if (isEmpty()) return null; //nothing to remove.\n E item = first.item;\n first = first.next; //will become null if the queue had only one item.\n n--;\n if (isEmpty()) last = null; // special case as the queue is now empty. \n return item;\n }",
"public T dequeue(){\n T front = getFront(); // might throw exception, assumes firstNode != null\n firstNode = firstNode.getNext();\n\n if (firstNode == null){\n lastNode = null;\n } // end if\n return front;\n }",
"@Override\n public E poll() {\n E tmp = (E)queue[0];\n System.arraycopy(queue, 1, queue, 0, size - 1);\n size--;\n return tmp;\n }",
"public E peekFront() {\r\n if (front == rear) {\r\n throw new NoSuchElementException();\r\n } else {\r\n return elem[front];\r\n }\r\n }",
"public T removeFront() {\n\t\tT found = start.value;\n\t\tstart = start.next;\n\t\treturn found;\n\t}",
"public E peek(){\n return front!=rear?(E) data[(int)((front) & (max_size - 1))]:null;\n }",
"T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }",
"public O popFront()\r\n {\r\n if (!isEmpty())\r\n {\r\n VectorItem<O> l = first;\r\n first = first.getNext();\r\n \r\n count--;\r\n if (isEmpty()) last = null;\r\n else first.setPrevious(null);\r\n \r\n return l.getObject();\r\n } else\r\n return null;\r\n }",
"public static Object dequeue() {\t \n if(queue.isEmpty()) {\n System.out.println(\"The queue is already empty. No element can be removed from the queue.\"); \n return -1;\n }\n return queue.removeFirst();\n }",
"public T dequeue() {\n if (size == 0) {\n throw new NoSuchElementException(\"The queue is empty\"\n + \". Please add data before attempting to remove.\");\n } else if (front == backingArray.length - 1) {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = 0;\n size--;\n return data;\n } else {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = temp + 1;\n size--;\n return data;\n }\n }",
"public int peek()\n\t{\n\t\tif(isEmpty())\t\n\t\t{\n\t\t\tSystem.out.println(\"Queue Underflow\");\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\t\treturn queueArray[front];\n\t}",
"@Override\n\tpublic E dequeue() {\n\t\tif(isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tE data = queue[pos];\n\t\tqueue[pos] = null;\n\t\tpos = (pos+1) % queue.length;\n\t\tsize--;\n\t\treturn data;\n\t}",
"public int queue_top() {\n\t\tif (isEmpty()) error(\"Queue is Empty!\");\n\t\treturn data[(front + 1) % MAX_QUEUE_SIZE];\n\t}",
"public T removeFromFront() {\n DoublyLinkedListNode<T> temp = head;\n if (size == 0) {\n throw new NoSuchElementException(\"The list is empty, so there\"\n + \" is nothing to get.\");\n } else {\n if (head == tail) {\n head = tail;\n tail = null;\n return temp.getData();\n } else {\n head = head.getNext();\n head.setPrevious(null);\n size -= 1;\n return temp.getData();\n }\n }\n\n\n }",
"public Object todequeue() {\n\t\tif(rear == 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tObject to_return = arr[front];\n\t\t\tfront++;\n\t\t\tsize--;\n\t\t\treturn to_return;\n\t\t}\n\t}",
"@Override\n public T dequeue() {\n if (!isEmpty()) {\n return heap.remove();\n } else {\n throw new NoSuchElementException(\"Priority Queue is null\");\n }\n }",
"public int peekFront() {\n int x = 0;\n if(head == null) {\n return Integer.MIN_VALUE;\n }\n\n return head.val;\n }",
"public NodeBase<V> dequeue() {\r\n \tif(!isEmpty()){\r\n \tNodeBase<V> min=queue[0];\r\n \tint j=0;\r\n for(int i=0;i<currentSize;i++){\r\n \t if(min.getPriority()>queue[i].getPriority()){\r\n \t\t min=queue[i];\r\n \t\t j=i;\r\n \t }\r\n }\r\n for(int x=j;x<currentSize-1;x++){\r\n \t queue[x]=queue[x+1];\r\n }\r\n \r\n currentSize--;\r\n \r\n return min;\r\n \t}\r\n \telse{\r\n \t\treturn null;\r\n \t}\r\n }",
"public E dequeue() {\n\t\treturn list.removeFirst();\n\t}",
"@Override\n\tpublic E dequeue() {\n\t\tif (! isEmpty()) {\n\t\t\tNode temp = first;\n\t\t\tE e = temp.element;\n\t\t\tfirst = temp.next;\n\t\t\t\n\t\t\tif (temp == last)\n\t\t\t\tlast = null;\n\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"int getFront()\n {\n // check whether Deque is empty or not \n if (isEmpty())\n {\n return -1 ;\n }\n return arr[front];\n }",
"public int top() {\n int size=queue.size();\n for (int i = 0; i < size-1; i++) {\n int temp=queue.poll();\n queue.add(temp);\n }\n int top=queue.poll();\n queue.add(top);\n return top;\n }",
"Node dequeue() {\n Node n = queue.removeFirst();\n queueSet.remove(n);\n return n;\n }",
"public E remove(){\r\n if(isEmpty())\r\n return null;\r\n \r\n //since the array is ordered, the highest priority will always be at the end of the queue\r\n //--currentSize will find the last index (highest priority) and remove it\r\n return queue[--currentSize];\r\n }",
"public long remove(){\n\t\t\r\n\t\t\tlong temp = queueArray[front]; //retrieves and stores the front element\r\n\t\t\tfront++;\r\n\t\t\tif(front == maxSize){ //To set front = 0 and use it again\r\n\t\t\t\tfront = 0;\r\n\t\t\t}\r\n\t\t\tnItems--;\r\n\t\t\treturn temp;\r\n\t\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic T dequeue() {\r\n\t\tT data;\r\n\t\t\r\n\t\t// checking if queue is empty or not\r\n\t\tif (isEmtpy()) {\r\n\t\t\tthrow new AssertionError(\"Queue is empty\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// remove element\r\n\t\t\tdata = (T)(Integer)this.array[this.front];\r\n\t\t\t\r\n\t\t\t// adjust both front and rear of queue\r\n\t\t\tif (this.front == this.rear) {\r\n\t\t\t\tthis.front = this.rear = -1;\r\n\t\t\t} else {\r\n\t\t\t\tthis.front = (this.front + 1) % this.size;\r\n\t\t\t}\r\n\t\t\treturn (T)data;\r\n\t\t}\r\n\t}",
"public T removeFirst(){\n\tT ret = _front.getCargo();\n\t_front = _front.getPrev();\n\t_front.setNext(null);\n\t_size--;\n\treturn ret;\n }",
"public T dequeue() {\n if (isEmpty()) {\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T itemToReturn = rb[first];\n rb[first] = null;\n fillCount -= 1;\n if (isEmpty()) {\n first = 0;\n last = 0;\n return itemToReturn;\n }\n first = (first + 1) % capacity;\n return itemToReturn;\n\n // Dequeue the first item. Don't forget to decrease fillCount and update\n }",
"private E remove() {\n if (startPos >= queue.length || queue[startPos] == null) throw new NoSuchElementException();\n size--;\n return (E) queue[startPos++];\n }",
"public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }",
"public Item removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"queue is empty\");\n }\n Item a;\n a = first.item;\n first = first.next;\n if (first == null) {\n last = null;\n }\n else first.prev = null;\n size--;\n return a;\n }",
"int front()\n {\n if (isEmpty())\n return Integer.MIN_VALUE;\n return this.array[this.front];\n }",
"public T peek()\n\t{\n\t\tT ret = list.removeFirst();\n\t\tlist.addFirst(ret);\n\t\treturn ret;\n\t}",
"public Item removeFirst(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[first];\r\n\t\tlist[first++] = null;\r\n\t\tn--;\r\n\t\tprior=first-1;\r\n\t\tif(first==list.length){first=0;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}",
"public int dequeue() {\n\t\tif (isEmpty()) throw new IllegalStateException(\"\\nQueue is empty!\\n\");\n\t\tint removedItem = bq[head];\n\t\tif (head == bq.length - 1) head = 0; // wraparound\n\t\telse head++;\n\t\tsize--;\n\t\treturn removedItem;\t\n\t}",
"public DVDPackage front() {\n\t\treturn queue.peek();\n\t}",
"@Override\n public E dequeue() {\n if(array.isEmpty()) {\n throw new NoSuchElementException(\"Cannot dequeue from an empty queue.\");\n }\n return array.removeFirst();\n }",
"public T removeFirst() {\n if (size == 0) {\n return null;\n }\n if (size == 1) {\n size--;\n return array[front];\n }\n this.checkReSizeDown();\n size--;\n front++;\n this.updatePointer();\n return array[Math.floorMod(front - 1, array.length)];\n }",
"private int dequeue(){\n size--;\n int ret = array[front];\n front = (front+1)%capacity;\n return ret;\n }",
"public int peekMin() \n {\n\tfor ( int i = 0; i < queue.size(); i++ ) {\n\t if ( queue.get( i + 1 ) == null ) {\n\t\treturn (int) queue.get(i);\n\t }\n\t}\n\t\n\t//nothing to peek at!\n\tif ( queue.isEmpty() ) {\n\t throw new NoSuchElementException();\n\t}\n\n\treturn 0;\n }",
"public Integer dequeue() {\n\t\t // get last val in heap, copy value to index 0\n\t\t // decrease size \n\t\t // create a recursive helper, percolateDown,\n\t\t // that allows you move the removed val \n\t\t // in the right place\n\t\t \n\t\t if (size == 0) \n\t\t\t throw new EmptyStackException();\n\t int item = data[0]; \n\t data[0] = data[size - 1]; \n\t size--;\n\t percolateDown(0); \n\t return item;\n\t }",
"@Override\r\n public CustomProcess peekBest() {\r\n if (data[0] == null || isEmpty()) {\r\n throw new NoSuchElementException(\"queue is empty\");\r\n }\r\n return data[0];\r\n }",
"public int getFront() {\n if (isEmpty()) {\n return -1;\n }\n return arr[front];\n }",
"public E dequeue() {\n return pop();\n }",
"public int getFront() {\n if(size == 0) return -1;\n \n return head.next.val;\n \n}",
"@Override\r\n\tpublic T dequeue() throws QueueUnderflowException {\r\n\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tthrow new QueueUnderflowException(\"The queue is empty\");\r\n\t\t}\r\n\t\t// Remove the first element\t\t\r\n\t\treturn data.remove(0);\r\n\t}",
"public int popFront() {\n if(head == null) {\n return Integer.MIN_VALUE;\n }\n\n Node node = head;\n head = node.next;\n\n size--;\n\n return node.val;\n }",
"public int peek() {\n return queue.firstElement();\n }",
"@Override\n\tpublic E deQueue() {\n\t\treturn list.removeFirst();\n\t}",
"public Object dequeue() {\n\t\t\n\t\t// Check: Queue is empty\n\t\tif (isEmpty()) {\n\t\t\tthrow new NoSuchElementException(\"Queue is empty. Cannot dequeue.\");\n\t\t}\n\t\t\n\t\t// Check: one element (tail = head)\n\t\t// If so, set tail to null\n\t\tif (tail == head) tail = null;\n\t\t\n\t\t// Save head's data to return\n\t\tObject first = head.data;\n\t\t\n\t\t// Remove head from queue and re-assign head to head.next\n\t\thead = head.next;\n\t\t\n\t\treturn first;\n\t}",
"public IClause popFront() {\n if (back==front)\n \tthrow new BufferUnderflowException();\n\n front++;\n if (front >= tab.length)\n front = 0;\n return tab[front];\n }",
"public T dequeue()\n\t{\n\t\tNode<T> eliminado = head;\n\t\thead = head.getNext();\n\t\tif(head == null)\n\t\t{\n\t\t\ttail = null;\n\t\t}\n\t\tsize--;\n\t\treturn eliminado.getElement();\n\t}",
"public Object peek()\n {\n return queue.peekLast();\n }",
"public int getFront() {\n if (cnt == 0)\n return -1;\n return head.val;\n }",
"public T dequeue() {\n if (first != null) {\n size--;\n T data = first.data;\n first = first.next;\n\n if (first == null) {\n last = null; // avoid memory leak by removing reference\n }\n\n return data;\n }\n return null;\n }",
"public Object dequeue() {\n\t\tif(isEmpty()) throw new RuntimeException(); \n\t\tObject value = data[0];\n\t\tfor(int i = 0; i < data.length-1; i++) {\n\t\t\tdata[i] = data[i+1];\n\t\t}\n\t\tdata[size()] = null;\n\t\tindx--;\n\t\treturn value;\n\t}",
"public E peekFront();",
"public int getFront() {\n return !isEmpty() ? elements[last - 1] : -1;\n }",
"public E dequeue() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t}\r\n\t\t\r\n\t\tif (size() != 1) {\r\n\t\t\t//Node p = first; \r\n\t\t\tE item = first.item;\r\n\t\t\tremove(0);\r\n\t\t\t//first = p.next;\r\n\t\t\t//first.prev = null;\r\n\t\t\treturn item;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tE e = last.item;\r\n\t\t\tremove(last.item);\r\n\n\t\t\treturn e;\r\n\t\t}\n\t}",
"public T peek() {\n\t if (size==0)\n\t return null;\n\t else return (T) pq[0];\n }",
"public T popFront() {\n\t\tif(tamanio==0)\n\t\t\treturn null;\n\t\tNodo<T> aux= inicio.getSiguiente();\n\t\tT dato = inicio.getDato();\n\t\tinicio=null;\n\t\tinicio=aux;\n\t\ttamanio--;\n\t\treturn dato;\n\t}",
"public Item dequeue() throws NoSuchElementException {\r\n // Usar el metodo downHeap para corregir la condicion\r\n // de Min Heap\r\n\r\n\r\n Item ret = heap[1];\r\n\r\n heap[1] = heap[size];\r\n downHeap(1);\r\n\r\n heap[size] = null;\r\n size--;\r\n\r\n return ret;\r\n }",
"public int peek()\n\t{\n\t\tif (isEmpty() == true)\n\t\t{\n\t\t\tthrow new NullPointerException(\"Queue is empty!\");\n\t\t}\n\t\treturn head.value;\n\t}",
"public synchronized Object dequeue() throws EmptyListException {\r\n return removeFromFront();\r\n }",
"public T removeFirst() {\r\n \r\n if (size == 0) {\r\n return null;\r\n }\r\n \r\n T deleted = front.element;\r\n front = front.next;\r\n size--;\r\n \r\n return deleted;\r\n }"
]
| [
"0.81022567",
"0.8071247",
"0.78835213",
"0.7770994",
"0.77258545",
"0.7614049",
"0.756892",
"0.75672424",
"0.75075215",
"0.7459961",
"0.74336755",
"0.7411806",
"0.73996437",
"0.73875827",
"0.73647344",
"0.7363643",
"0.7353924",
"0.73501784",
"0.7350145",
"0.7335822",
"0.7329517",
"0.73221064",
"0.7321904",
"0.7312319",
"0.73072726",
"0.72720945",
"0.72669965",
"0.72574353",
"0.7240118",
"0.72321457",
"0.7229338",
"0.72247636",
"0.7223377",
"0.72143847",
"0.7212564",
"0.72010964",
"0.71804005",
"0.71769613",
"0.7175263",
"0.7161594",
"0.7158613",
"0.71525156",
"0.71422744",
"0.7115501",
"0.7112401",
"0.71009606",
"0.7099365",
"0.7094225",
"0.70926684",
"0.7083039",
"0.70774996",
"0.7077401",
"0.7075433",
"0.70685095",
"0.7064577",
"0.70408547",
"0.70400524",
"0.70375204",
"0.7028671",
"0.7025412",
"0.7025296",
"0.70211095",
"0.7014638",
"0.6969595",
"0.6966891",
"0.6964951",
"0.69637233",
"0.695118",
"0.69356006",
"0.69308555",
"0.6927723",
"0.69200677",
"0.6907562",
"0.690714",
"0.6903268",
"0.6891615",
"0.68866396",
"0.68865794",
"0.6877662",
"0.68681204",
"0.68664837",
"0.68655133",
"0.6860454",
"0.685437",
"0.6843265",
"0.68422854",
"0.68408066",
"0.683391",
"0.68327934",
"0.68316853",
"0.6828826",
"0.68281496",
"0.68234736",
"0.68223625",
"0.6819231",
"0.68177646",
"0.68137795",
"0.6811935",
"0.6800967",
"0.6797005"
]
| 0.68746084 | 79 |
Return rear element of the queue without removing it Note: Does not check for underflow | public int peekRear(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private E dequeue() {\n final Object[] items = this.items;\n @SuppressWarnings(\"unchecked\")\n E x = (E) items[takeIndex];\n items[takeIndex] = null;\n if (++takeIndex == items.length) takeIndex = 0;\n count--;\n notFull.signal();\n return x;\n }",
"public E dequeue() {\n if (size == 0){\n return null;\n }\n\n\n E result = (E) queue[0];\n queue[0] = null;\n --size;\n\n if (size != 0){\n shift();\n }\n return result;\n }",
"@Override\n public E poll() {\n E tmp = (E)queue[0];\n System.arraycopy(queue, 1, queue, 0, size - 1);\n size--;\n return tmp;\n }",
"public E dequeue(){\n if (isEmpty()) return null;\n E answer = arrayQueue[front];\n arrayQueue[front] = null;\n front = (front +1) % arrayQueue.length;\n size--;\n return answer;\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic T dequeue() {\r\n\t\tT data;\r\n\t\t\r\n\t\t// checking if queue is empty or not\r\n\t\tif (isEmtpy()) {\r\n\t\t\tthrow new AssertionError(\"Queue is empty\");\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t// remove element\r\n\t\t\tdata = (T)(Integer)this.array[this.front];\r\n\t\t\t\r\n\t\t\t// adjust both front and rear of queue\r\n\t\t\tif (this.front == this.rear) {\r\n\t\t\t\tthis.front = this.rear = -1;\r\n\t\t\t} else {\r\n\t\t\t\tthis.front = (this.front + 1) % this.size;\r\n\t\t\t}\r\n\t\t\treturn (T)data;\r\n\t\t}\r\n\t}",
"public E remove(){\r\n if(isEmpty())\r\n return null;\r\n \r\n //since the array is ordered, the highest priority will always be at the end of the queue\r\n //--currentSize will find the last index (highest priority) and remove it\r\n return queue[--currentSize];\r\n }",
"public T poll() {\n if (size == 0) {\n return null;\n }\n\n // set returned value to queue[0]\n T value = (T) array[0];\n\n // decrease size - we are removing element\n size--;\n\n // move queue 1 place left\n System.arraycopy(array, 1, array, 0, size);\n\n // clear last element\n array[size] = null;\n\n return value;\n }",
"@Override\n\tpublic E dequeue() {\n\t\tE temp=null;\n\t\tif(front==data.length-1){\n\t\t\ttemp=data[front];\n\t\t\tsize--;\n\t\t\tfront=(front+1)%data.length;\n\t\t}else{\n\t\t\tsize--;\n\t\t\ttemp=data[front++];\n\t\t}\n\t\treturn temp;\n\t}",
"@Override\n\tpublic E dequeue() {\n\t\tif(isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tE data = queue[pos];\n\t\tqueue[pos] = null;\n\t\tpos = (pos+1) % queue.length;\n\t\tsize--;\n\t\treturn data;\n\t}",
"public int dequeue() {\n\t\tif (isEmpty()) throw new IllegalStateException(\"\\nQueue is empty!\\n\");\n\t\tint removedItem = bq[head];\n\t\tif (head == bq.length - 1) head = 0; // wraparound\n\t\telse head++;\n\t\tsize--;\n\t\treturn removedItem;\t\n\t}",
"@Override\r\n\tpublic T dequeue() {\r\n\t\tT element;\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new AssertionError(\"Queue is empty.\");\r\n\t\telement = arr[front].getData();\r\n\t\tif (front == rear) {\r\n\t\t\tfront = rear = -1;\r\n\t\t} else {\r\n\t\t\tfront++;\r\n\t\t}\r\n\t\treturn element;\r\n\t}",
"public E dequeue() {\n if (isEmpty()) return null; //nothing to remove.\n E item = first.item;\n first = first.next; //will become null if the queue had only one item.\n n--;\n if (isEmpty()) last = null; // special case as the queue is now empty. \n return item;\n }",
"public Object todequeue() {\n\t\tif(rear == 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tObject to_return = arr[front];\n\t\t\tfront++;\n\t\t\tsize--;\n\t\t\treturn to_return;\n\t\t}\n\t}",
"@Override\n public E removeLast() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[tail];\n dequeue[tail] = null;\n tail--;\n if (tail == -1) {\n tail = dequeue.length - 1;\n }\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public E poll() {\n\t\twhile (true) {\n\t\t\tlong f = front.get();\n\t\t\tint i = (int)(f % elements.length());\n\t\t\tE x = elements.get(i);\n\t\t\t//Did front change while we were reading x?\n\t\t\tif (f != front.get())\n\t\t\t\tcontinue;\n\t\t\t//Is the queue empty?\n\t\t\tif (f == rear.get())\n\t\t\t\treturn null; //Don't retry; fail the poll.\n\n\t\t\tif (x != null) {//Is the front nonempty?\n\t\t\t\tif (elements.compareAndSet(i, x, null)) {//Try to remove an element.\n\t\t\t\t\t//Try to increment front. If we fail, other threads will\n\t\t\t\t\t//also try to increment before any further removals, so we\n\t\t\t\t\t//don't need to loop.\n\t\t\t\t\tfront.compareAndSet(f, f+1);\n\t\t\t\t\treturn x;\n\t\t\t\t}\n\t\t\t} else //front empty. Try to help other threads.\n\t\t\t\tfront.compareAndSet(f, f+1);\n\n\t\t\t//If we get here, we failed at some point. Try again.\n\t\t}\n\t}",
"T poll(){\n if(isEmpty()){\n return null;\n }\n T temp = (T) queueArray[0];\n for(int i=0; i<tail-1;i++){\n queueArray[i] = queueArray[i+1];\n }\n tail--;\n return temp;\n }",
"private int dequeue(){\n size--;\n int ret = array[front];\n front = (front+1)%capacity;\n return ret;\n }",
"public T dequeue() {\n if (isEmpty()) {\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T itemToReturn = rb[first];\n rb[first] = null;\n fillCount -= 1;\n if (isEmpty()) {\n first = 0;\n last = 0;\n return itemToReturn;\n }\n first = (first + 1) % capacity;\n return itemToReturn;\n\n // Dequeue the first item. Don't forget to decrease fillCount and update\n }",
"public Object dequeue() {\n\t\tif(isEmpty()) throw new RuntimeException(); \n\t\tObject value = data[0];\n\t\tfor(int i = 0; i < data.length-1; i++) {\n\t\t\tdata[i] = data[i+1];\n\t\t}\n\t\tdata[size()] = null;\n\t\tindx--;\n\t\treturn value;\n\t}",
"public Object dequeue()\n {\n return queue.removeFirst();\n }",
"public long remove(){\n\t\t\r\n\t\t\tlong temp = queueArray[front]; //retrieves and stores the front element\r\n\t\t\tfront++;\r\n\t\t\tif(front == maxSize){ //To set front = 0 and use it again\r\n\t\t\t\tfront = 0;\r\n\t\t\t}\r\n\t\t\tnItems--;\r\n\t\t\treturn temp;\r\n\t\t}",
"public T dequeue()\n\t{\n\t\tNode<T> eliminado = head;\n\t\thead = head.getNext();\n\t\tif(head == null)\n\t\t{\n\t\t\ttail = null;\n\t\t}\n\t\tsize--;\n\t\treturn eliminado.getElement();\n\t}",
"public Object dequeue(){\r\n return super.remove(size()-1);\r\n }",
"public static Object dequeue() {\t \n if(queue.isEmpty()) {\n System.out.println(\"The queue is already empty. No element can be removed from the queue.\"); \n return -1;\n }\n return queue.removeFirst();\n }",
"private E remove() {\n if (startPos >= queue.length || queue[startPos] == null) throw new NoSuchElementException();\n size--;\n return (E) queue[startPos++];\n }",
"E dequeue();",
"E dequeue();",
"E dequeue();",
"public E dequeue() {\n return pop();\n }",
"public Integer dequeue() {\n\t\t // get last val in heap, copy value to index 0\n\t\t // decrease size \n\t\t // create a recursive helper, percolateDown,\n\t\t // that allows you move the removed val \n\t\t // in the right place\n\t\t \n\t\t if (size == 0) \n\t\t\t throw new EmptyStackException();\n\t int item = data[0]; \n\t data[0] = data[size - 1]; \n\t size--;\n\t percolateDown(0); \n\t return item;\n\t }",
"@Override\r\n\tpublic T dequeue() throws QueueUnderflowException {\r\n\r\n\t\tif (this.isEmpty()) {\r\n\t\t\tthrow new QueueUnderflowException(\"The queue is empty\");\r\n\t\t}\r\n\t\t// Remove the first element\t\t\r\n\t\treturn data.remove(0);\r\n\t}",
"T dequeue();",
"T dequeue();",
"@Override\n public Object dequeue() throws EmptyCollectionException {\n if (isEmpty()) {\n throw new EmptyCollectionException(\"queue\");\n }\n\n T result = front.getN();\n front = front.getNext();\n count--;\n if (isEmpty()) {\n rear = null;\n }\n\n return result;\n }",
"public T dequeue() {\n if (size == 0) {\n throw new NoSuchElementException(\"The queue is empty\"\n + \". Please add data before attempting to remove.\");\n } else if (front == backingArray.length - 1) {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = 0;\n size--;\n return data;\n } else {\n int temp = front;\n T data = backingArray[temp];\n backingArray[front] = null;\n front = temp + 1;\n size--;\n return data;\n }\n }",
"public E peek(){\r\n if(isEmpty())\r\n return null;\r\n\r\n return queue[currentSize-1]; //return the object without removing it\r\n }",
"@Override\n public T dequeue() {\n if(fillCount==0){\n throw new RuntimeException(\"Ring buffer underflow\");\n }\n T return_val = rb[first];\n rb[first] = null;\n first = adjust_F_ring_position(first);\n fillCount = fillCount-1;\n return return_val;\n }",
"@Override\n public T dequeue() {\n if (!isEmpty()) {\n return heap.remove();\n } else {\n throw new NoSuchElementException(\"Priority Queue is null\");\n }\n }",
"public T dequeue();",
"public E dequeue();",
"@Override\n public E dequeue() {\n if(array.isEmpty()) {\n throw new NoSuchElementException(\"Cannot dequeue from an empty queue.\");\n }\n return array.removeFirst();\n }",
"@Override\n\tpublic E deQueue() {\n\t\treturn list.removeFirst();\n\t}",
"public E dequeue() {\n\t\treturn list.removeFirst();\n\t}",
"public int pop() {\n int size=queue.size();\n for (int i = 0; i <size-1 ; i++) {\n int temp=queue.poll();\n queue.add(temp);\n }\n return queue.poll();\n }",
"T dequeue() {\n return contents.removeFromTail();\n }",
"@Override\r\n\tpublic E dequeueFront() {\n\t\tif(isEmpty()) return null;\r\n\t\tE value = data[frontDeque];\r\n\t\tfrontDeque = (frontDeque + 1)% CAPACITY;\r\n\t\tsizeDeque--;\r\n\t\treturn value;\r\n\t}",
"public int dequeue() {\r\n\t\tint v = elements[0];\r\n\t\tint[] temp = new int[elements.length];\r\n\t\tSystem.arraycopy(elements, 1, temp, 0, size);\r\n\t\telements = temp;\r\n\t\tsize--;\r\n\t\treturn v;\r\n\t}",
"Node dequeue() {\n Node n = queue.removeFirst();\n queueSet.remove(n);\n return n;\n }",
"@Override\n public E removeFirst() {\n if (isEmpty()) {\n throw new NoSuchElementException(\"No elements in dequeue\");\n }\n E value = dequeue[head];\n dequeue[head] = null;\n head = ++head % dequeue.length;\n size--;\n if (size < dequeue.length / 2) {\n reduce();\n }\n return value;\n }",
"public Object deQueue()\n {\n if(this.isEmpty()){throw new QueueUnderflowException();}\n Node temp = this.front;\n front = front.getNext();\n if(this.isEmpty()){this.rear = null;}\n return temp.getData();\n }",
"@Override\n\tpublic E dequeue() {\n\t\tif (! isEmpty()) {\n\t\t\tNode temp = first;\n\t\t\tE e = temp.element;\n\t\t\tfirst = temp.next;\n\t\t\t\n\t\t\tif (temp == last)\n\t\t\t\tlast = null;\n\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"public E dequeue() {\n\t\tresetIterator();\n\t\tsize--;\n\t\tE temp = head.data;\n\t\thead = head.next;\n\t\treturn temp;\n\t}",
"public int Rear() {\n if (this.count == 0)\n return -1;\n int tailIndex = (this.headIndex + this.count - 1) % this.capacity;\n return this.queue[tailIndex];\n }",
"public int dequeueFront();",
"public Item dequeue()\n {\n checkNotEmpty();\n\n if (items.length / 4 > size)\n {\n resize(items.length / 2);\n }\n\n int last = size - 1;\n swap(items, nextIndex(), last);\n Item toReturn = items[last];\n items[last] = null;\n size--;\n\n return toReturn;\n }",
"public T poll() {\n if(size==0)\n return null;\n else {\n T temp= (T) pq[0];\n pq[0]=pq[size-1];\n size--;\n percolateDown(0);\n return temp;\n\n\n }\n }",
"public Item dequeue() {\n if (isEmpty())\n throw new NoSuchElementException(\"Queue underflow\");\n Item item = first.item;\n first = first.next;\n N--;\n if (isEmpty())\n last = null; // to avoid loitering\n return item;\n }",
"public int pop() {\n int size = queue.size();\n for (int i = 0; i < size - 1; i++) {\n Integer poll = queue.poll();\n queue.offer(poll);\n }\n return queue.poll();\n }",
"@Override\r\n\tpublic Object dequeue(){\r\n\t\tcheck();\r\n\t\tNode temp = head;\r\n\t\thead = head.next;\r\n\t\tsize--;\r\n\t\treturn temp.value;\r\n\t}",
"public void dequeue()\n\t{\n\t\tq.removeFirst();\n\t}",
"int dequeue()\n\t{\n\t\tint x=-999999;\n\t\tif(isEmpty())\n\t\t\t//throw new Exception\n\t\t\tSystem.out.println(\"Queue is Empty!\");\n\t\telse\n\t\t{\n\t\t\tx = queue[front];\n\t\t\tif(front==rear)\n\t\t\t{\n\t\t\t\tfront = -1;\n\t\t\t\trear = front;\n\t\t\t}\n\t\t\telse\n\t\t\t\tfront++;\n\t\t}\n\t\treturn x;\n\t\t\n\t}",
"public int Rear() {\n if(queue[tail] == null){\n return -1;\n }else{\n return queue[tail];\n }\n }",
"public Item removeLast(){\r\n\t\tif (isEmpty()) throw new NoSuchElementException(\"Queue underflow\");\r\n\t\tItem tmp = list[last--];\r\n\t\tn--;\r\n\t\tlatter=last+1;\r\n\t\tif(last==-1){last=list.length-1;}\r\n\t\tif (n > 0 && n == list.length/4) resize(list.length/2); \r\n\t\treturn tmp;}",
"T dequeue() throws RuntimeException;",
"T dequeue() throws RuntimeException;",
"public NodeBase<V> dequeue() {\r\n \tif(!isEmpty()){\r\n \tNodeBase<V> min=queue[0];\r\n \tint j=0;\r\n for(int i=0;i<currentSize;i++){\r\n \t if(min.getPriority()>queue[i].getPriority()){\r\n \t\t min=queue[i];\r\n \t\t j=i;\r\n \t }\r\n }\r\n for(int x=j;x<currentSize-1;x++){\r\n \t queue[x]=queue[x+1];\r\n }\r\n \r\n currentSize--;\r\n \r\n return min;\r\n \t}\r\n \telse{\r\n \t\treturn null;\r\n \t}\r\n }",
"public Item dequeue() {\n if (isEmpty()) throw new NoSuchElementException(\"\");\n int i = randomNotEmptyIndex();\n Item item = queue[i];\n queue[i] = null;\n size--;\n if (size <= capacity / 4) {\n resize(capacity / 2);\n }\n return item;\n }",
"public int pop() {\n return queue.poll();\n }",
"Object dequeue();",
"Object dequeue();",
"public Item dequeue() {\n if (isEmpty()) throw new NoSuchElementException(\"deque underflow\");\n Item item;\n int randomIndex = StdRandom.uniform(N);\n while(randomizedQueue[randomIndex] == null){\n randomIndex = StdRandom.uniform(N);\n }\n item = randomizedQueue[randomIndex];\n randomizedQueue[randomIndex] = null;\n// StdOut.println(\"dequeue randomIndex:\"+ randomIndex);\n// StdOut.println(\"dequeue randomizedQueue[\"+randomIndex+\"]:\"+ randomizedQueue[randomIndex]);\n count--; \n if (count < N/2){ \n resize(N/2); // half size of array if necessary \n N /= 2;\n }\n// assert\n \n return item;\n }",
"public int dequeueRear();",
"public T poll() {\n if (size == 0)\n return null;\n int s = --size;\n T result = (T) heap[0];\n T backup = (T) heap[s];\n heap[s] = null; // delete\n if (s != 0)\n siftDown(0, backup);\n return result;\n }",
"public synchronized T dequeue() {\r\n\t\twhile(queue.size()==0){\r\n\t\t\ttry {\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\tSystem.out.println(\"Problem during dequeue\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tT ans = queue.removeFirst();\r\n\t\tthis.notifyAll();\r\n\t\treturn ans;\r\n\r\n\t}",
"public T dequeue() {\n if (first != null) {\n size--;\n T data = first.data;\n first = first.next;\n\n if (first == null) {\n last = null; // avoid memory leak by removing reference\n }\n\n return data;\n }\n return null;\n }",
"public E poll()\n {\n if(size > 0)\n {\n E retElement = arrayList.get(0);\n arrayList.set(0, arrayList.get(size() - 1));\n arrayList.remove(size() - 1);\n size--;\n trickleDown(0);\n return retElement;\n }\n return null;\n }",
"public Item dequeue() {\n if (size == 0) throw new NoSuchElementException();\n if (size > 0 && size == queue.length / 4) resizeArray(queue.length / 2);\n int randomInt = StdRandom.uniform(size);\n Item item = queue[randomInt];\n queue[randomInt] = queue[--size];\n queue[size] = null;\n return item;\n }",
"public Item dequeue() {\n if (this.isEmpty()) {\n throw new NoSuchElementException();\n }\n int random = StdRandom.uniform(this.currentIndex);\n Item saved = this.storage[random];\n this.storage[random] = null;\n this.size--;\n this.storage[random] = this.storage[currentIndex - 1];\n this.storage[currentIndex - 1] = null;\n this.currentIndex--;\n if (this.size <= (1.0 / 4.0) * this.storage.length) {\n int ceiling = (int) ((1.0 / 2.0) * this.storage.length);\n Item[] newArray = (Item[]) new Object[ceiling];\n for (int i = 0; i < this.size; i++) {\n newArray[i] = this.storage[i];\n }\n this.storage = newArray;\n\n }\n return saved;\n\n }",
"public Object dequeue() {\n\t\tObject itemToDeq = null;\n\t\tif(this.l.start==null){\n\t\t\tnew QueueUnderflowException(\"No elements in the queue\");\n\t\t}\n\t\telse{\n\t\t\tListNode p = this.l.start;\n\t\t\tif(p.next==null){\n\t\t\t\titemToDeq = p.item;\n\t\t\t\tthis.l.start = null;\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(p.next.next!=null){\n\t\t\t\t\tp = p.next;\n\t\t\t\t}\n\t\t\t\titemToDeq = p.next.item;\n\t\t\t\tp.next=null;\n\t\t\t}\n\t\t\treturn itemToDeq;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n public Object dequeue() {\n Object objeto;\n if (!isEmpty()){ // Pré-condição\n objeto = memo[head];\n if (++head >= MAX){\n head = 0; // MAX-1 é a ultima posição do vetor\n }\n \n total--;\n if (total == 0){\n head = -1;\n tail = -1;\n }\n \n return objeto; // Retor o objeto que estava na head\n }\n else{\n return null; // Não se retira elemento de FILA vazia\n }\n }",
"public Item dequeue() throws NoSuchElementException {\r\n // Usar el metodo downHeap para corregir la condicion\r\n // de Min Heap\r\n\r\n\r\n Item ret = heap[1];\r\n\r\n heap[1] = heap[size];\r\n downHeap(1);\r\n\r\n heap[size] = null;\r\n size--;\r\n\r\n return ret;\r\n }",
"@Override\r\n\tpublic void Dequeue() {\n\t\tif (IsEmpty())\r\n\t throw new NoSuchElementException(\"Underflow Exception\");\r\n\t else \r\n\t {\r\n\t \tlen--;\r\n\t int data = queue[front];\r\n\t System.out.println(\"The Dequed Element is \"+data);\r\n\t if ( front == rear) \r\n\t {\r\n\t front = -1;\r\n\t rear = -1;\r\n\t }\r\n\t else\r\n\t front++;\r\n\t }\r\n\t\t\r\n\t}",
"public MyTreeNode<T> dequeue() {\n\t\tif ( this.head == null) {\n\t\t\tthrow new IllegalStateException(\"Can't perform a retrieve operation on an empty queue\");\n\t\t}\n\t\tMyTreeNode<T> treeNode = this.head.item;\n\t\t// The previous second item is now first item in the collection.\n\t\tthis.head = this.head.next;\n\t\t// no more elements left in the collection\n\t\tif ( this.head == null ) {\n\t\t\tthis.tail = null;\n\t\t}\n\t\treturn treeNode;\n\t}",
"public E removeRear() {\r\n if (elem[rear] == null) {\r\n throw new NoSuchElementException();\r\n } else {\r\n E temp = elem[rear];\r\n elem[rear] = null;\r\n rear--;\r\n return temp;\r\n }\r\n }",
"public int getRear() {\n if(isEmpty()){\n return -1;\n }\n return queue[moveLeft(tail)];\n }",
"public synchronized Object removeFirstElement() {\n return _queue.remove(0);\n }",
"public int pop() {\n int size = queue.size();\n while (size > 2) {\n queue.offer(queue.poll());\n size--;\n }\n topElem = queue.peek();\n queue.offer(queue.poll());\n return queue.poll();\n }",
"public process dequeue() {\n\t\treturn queue.removeFirst();\n\t}",
"public void dequeue() {\n\t\tObject ret_val = todequeue();\n\t\tif(ret_val == null)\n\t\t\tSystem.out.println(\"The queue is empty\");\n\t\telse\n\t\t\tSystem.out.println(\"Removed: \" + ret_val);\n\t}",
"public int dequeue() {\n if (!isEmpty()){\n int e = data[first];\n count --;\n if(first == data.length-1) {\n first = 0;\n } else {\n first++;\n }\n return e;\n }\n else{\n throw new RuntimeException(\"A fila está vazia\");\n }\n }",
"public int getRear() {\n if(size == 0) return -1;\n return tail.prev.val;\n}",
"int poll() {\n\n\t\t// check if element can be polled from the queue\n\t\tif (!canPoll)\n\t\t\tthrow new IllegalStateException(\"Queue is Empty!\");\n\n\t\t// poll element into variable and shift pointer\n\t\tint result = queue[qPoll++];\n\t\t\n\t\t// set canPush flag, cuz there's now at least one empty space in the queue\n\t\tcanPush = true;\n\t\t\n\t\t/*\n\t\t * If poll pointer went beyond array bounds - return it to the first position\n\t\t */\n\t\t\n\t\tif (qPoll == queue.length)\n\t\t\tqPoll = 0;\n\t\t\n\t\t/*\n\t\t * If poll pointer now points to the push pointer - then queue is empty\n\t\t * Set flag\n\t\t */\n\t\t\n\t\tif (qPoll == qPush)\n\t\t\tcanPoll = false;\n\t\t\n\t\t// return previously saved element\n\t\t\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic Item dequeue() {\r\n\t\tif (isEmpty())\r\n\t\t\tthrow new NoSuchElementException(\"You cannot delete anything from the empty queue\");\r\n\t\tint index = StdRandom.uniform(count);\r\n\t\tItem item = arr[index];\r\n\t\tarr[index] = null;\r\n\t\tarr[index] = arr[--count];\r\n\t\tarr[count] = null;\r\n\t\tif (count > 0 && count == arr.length / 4)\r\n\t\t\tresize(arr.length / 2);\r\n\t\treturn item;\r\n\t}",
"public Item dequeue() {\n if (isEmpty()) throw new NoSuchElementException(\"Empty queue\");\n\n int rdm = StdRandom.uniform(n);\n Item item = a[rdm];\n a[rdm] = a[n-1];\n a[n-1] = null;\n n--;\n\n if (n > 0 && n == a.length/4) resize(a.length/2);\n return item;\n }",
"public T dequeue () {\n if (rightStack.empty()) {\n while (!leftStack.empty()) {\n rightStack.push(leftStack.pop());\n }\n }\n return rightStack.pop();\n }",
"void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }",
"public E dequeue() {\n\t\tif(isEmpty()){\n\t\t\tSystem.out.println(\"Queue is already empty\");\n\t\t\treturn null;\n\t\t}else{\n\t\t\tif(head.next==tail){\n\t\t\t\ttail=head;\n\t\t\t}\n\t\t\tE e=head.next.e;\n\t\t\thead.next=head.next.next;\n\t\t\treturn e;\n\t\t}\n\t\t\n\t}",
"public synchronized Object dequeue() throws EmptyListException {\r\n return removeFromFront();\r\n }",
"public Item dequeue() {\n if (qSize == 0) {\n throw new java.util.NoSuchElementException(\"Empty queue\");\n }\n\n int index = StdRandom.uniform(qSize);\n Item item = queue[index];\n\n if (index == qSize - 1) {\n queue[index] = null;\n } else {\n queue[index] = queue[qSize - 1];\n queue[qSize - 1] = null;\n }\n\n qSize--;\n if (qSize > 0 && qSize == queue.length / 4) {\n resize(queue.length / 2);\n }\n\n return item;\n }",
"public E blockingPop() throws InterruptedException\n {\n _lock.lock();\n try\n {\n //Wait for an item to be offered to the queue\n try\n {\n //This loop is necessary because it is possible to be awoken erroneously; however, empty will still\n //be false and so the thread will go back to sleep\n while(_empty)\n {\n _notEmptyCondition.await();\n }\n }\n //Propogate to a non-interrupted thread\n //The situation of multiple consumer threads is not currently used in cakehat\n catch(InterruptedException e)\n {\n _notEmptyCondition.signal();\n throw e;\n }\n \n //Retrieve and remove next element\n Iterator<TaggedElement<T, E>> iterator = _elements.iterator();\n TaggedElement<T, E> taggedElement = iterator.next();\n iterator.remove();\n _empty = !iterator.hasNext();\n \n //If the element was tagged, remove it from the set of elements with that tag\n if(taggedElement.getTag() != null)\n {\n _tagMap.get(taggedElement.getTag()).remove(taggedElement);\n }\n \n return taggedElement.getElement();\n }\n finally\n {\n _lock.unlock();\n }\n }",
"public Item dequeue() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tint index = StdRandom.uniform(0,n);\r\n\t\t\tItem toBeRemoved = queue[index];\r\n\t\t\tqueue[index] = queue[n-1];\r\n\t\t\tqueue[n-1] = null;\r\n\t\t\tn--;\r\n\t\t\tif (n > 0 && n == queue.length/4) {\r\n\t\t\t\tItem[] temp = (Item[]) new Object[queue.length/2];\r\n\t\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\t\ttemp[i] = queue[i];\r\n\t\t\t\t}\r\n\t\t\t\tqueue = temp;\r\n\t\t\t}\r\n\t\t\treturn toBeRemoved;\r\n\t\t}\r\n\t}"
]
| [
"0.8083502",
"0.8046659",
"0.8012749",
"0.7969197",
"0.7926453",
"0.7893271",
"0.7878406",
"0.7860969",
"0.78126395",
"0.7791895",
"0.77684003",
"0.774739",
"0.7745101",
"0.7730321",
"0.7725172",
"0.76661927",
"0.7659318",
"0.7653272",
"0.7629506",
"0.76243454",
"0.75988257",
"0.75982416",
"0.7595622",
"0.75814426",
"0.75795424",
"0.756986",
"0.756986",
"0.756986",
"0.7546137",
"0.75428146",
"0.75228184",
"0.7521228",
"0.7521228",
"0.749048",
"0.748603",
"0.7482596",
"0.7472329",
"0.7455516",
"0.74430424",
"0.74382687",
"0.7435342",
"0.74265367",
"0.74232996",
"0.74168485",
"0.7411232",
"0.7393908",
"0.7393604",
"0.738422",
"0.73634046",
"0.73622453",
"0.7341026",
"0.7340837",
"0.7340031",
"0.73055476",
"0.72984666",
"0.7298124",
"0.7274264",
"0.7259796",
"0.72443426",
"0.723868",
"0.7236834",
"0.72334415",
"0.7232789",
"0.72264457",
"0.72264457",
"0.7222032",
"0.7210992",
"0.7205982",
"0.71971613",
"0.71971613",
"0.71824825",
"0.71791935",
"0.7173616",
"0.7168226",
"0.7168116",
"0.7162491",
"0.7161813",
"0.7155018",
"0.7154595",
"0.71414936",
"0.71310294",
"0.71252453",
"0.71211034",
"0.7118666",
"0.7107928",
"0.7106161",
"0.71027935",
"0.7084258",
"0.7078692",
"0.7077103",
"0.70746106",
"0.7067379",
"0.7065409",
"0.7063017",
"0.70623016",
"0.7057067",
"0.70504665",
"0.70486814",
"0.7047249",
"0.7041471",
"0.7037588"
]
| 0.0 | -1 |
Return the number of integers in the queue | public int size(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getCount() {\n return queue.size();\n }",
"public int size(){\r\n\t\treturn queue.size();\r\n\t}",
"int getNumEvents() {\n int cnt = eventCount;\n for (Entry entry : queue) {\n cnt += entry.eventCount;\n }\n return cnt;\n }",
"int getQueueSize();",
"public int size() {\n return queue.size();\n }",
"public static int size() {\n System.out.println();\n System.out.println(\"The size of the queue is: \" + queue.size());\t \n return queue.size();\n }",
"public int size() {\n return _queue.size();\n }",
"public int size() {\n return this.queue.size();\n }",
"public int size() {\n\t\treturn queue.size();\n\t}",
"public int size()\n\t{\n\t\tif(isEmpty())\n\t\t\treturn 0;\n\t\tif(isFull())\n\t\t\treturn queueArray.length;\n\t\t\n\t\tint i=front;\n\t\tint sz=0;\n\t\tif(front<=rear)\n\t\t\twhile(i<=rear)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\telse\n\t\t{\n\t\t\twhile(i<=queueArray.length-1)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\ti=0;\n\t\t\twhile(i<=rear)\n\t\t\t{\n\t\t\t\tsz++;\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn sz;\n\t}",
"public int queueSize() {\n\t\treturn queue.size();\t\n\t}",
"public abstract int getQueueLength();",
"public int getRunnableCount() {\n return queue.size();\n }",
"public int inputQueueSize() {\n\t\tsynchronized (inputQueue) {\n\t\t\treturn inputQueue.size();\n\t\t}\n\t}",
"public int numVehiclesInQueue() {\r\n\t\treturn vehiclesInQueue.size();\r\n\t}",
"public int size() {\n\t\t//Because we're the only consumer, we know nothing will be removed while\n\t\t//we're computing the size, so we know there are at least (rear - front)\n\t\t//elements already added.\n\t\treturn (int)(rear.get() - front.get());\n\t}",
"public void incTotalOfQueueEntries() {\n totalOfQueueEntries++;\n }",
"public int size(){\n\t\tListUtilities start = this.returnToStart();\n\t\tint count = 1;\n\t\twhile(start.nextNum != null){\n\t\t\tcount++;\n\t\t\tstart = start.nextNum;\n\t\t}\n\t\treturn count;\n\t}",
"long getExcutorTasksInWorkQueueCount();",
"public int size() {\n processQueue();\n return weakCache.size();\n }",
"public int size() \r\n {\r\n if(measurementQueue==null) return 0;\r\n \r\n return measurementQueue.size();\r\n }",
"final int getQueueSize() {\n // suppress momentarily negative values\n return Math.max(0, sp - base);\n }",
"public int size() {\n \t\n \tint i = 0;\n \t\n \twhile(this.front != null) {\n \t\ti = i+1;\n \t\tthis.front = this.front.next; \n \t}\n \t\n \treturn i;\n \t\n }",
"public final int size()\r\n/* 41: */ {\r\n/* 42:215 */ long after = lvConsumerIndex();\r\n/* 43: */ for (;;)\r\n/* 44: */ {\r\n/* 45:219 */ long before = after;\r\n/* 46:220 */ long currentProducerIndex = lvProducerIndex();\r\n/* 47:221 */ after = lvConsumerIndex();\r\n/* 48:222 */ if (before == after)\r\n/* 49: */ {\r\n/* 50:224 */ long size = currentProducerIndex - after >> 1;\r\n/* 51:225 */ break;\r\n/* 52: */ }\r\n/* 53: */ }\r\n/* 54: */ long size;\r\n/* 55:230 */ if (size > 2147483647L) {\r\n/* 56:232 */ return 2147483647;\r\n/* 57: */ }\r\n/* 58:236 */ return (int)size;\r\n/* 59: */ }",
"public int UnassignedCount() {\n \t\treturn jobqueue.size();\n \t}",
"int getNumBufferedBytes() {\n ChannelBuffer buf;\n int IOQueued;\n for (IOQueued = 0, buf = inQueueHead;\n buf != null; buf = buf.next) {\n IOQueued += buf.nextAdded - buf.nextRemoved;\n }\n return IOQueued;\n }",
"static int findFrequency(Queue<Integer> q, int k){\n \n // return Collections.frequency(q, k);\n return (int) q.stream().filter(e-> e== k).count();\n }",
"public int getNumQueues() {\n return queues.size();\n }",
"int getInCount();",
"public long getQueueSize(){\n return queue.size();\n }",
"Integer size();",
"Integer size();",
"public int size() {\r\n if (NumItems > Integer.MAX_VALUE) {\r\n return Integer.MAX_VALUE;\r\n }\r\n return NumItems;\r\n }",
"public int numIncoming() {\r\n int result = incoming.size();\r\n return result;\r\n }",
"public int getQueueSize() {\r\n\t\treturn this.queue.size();\r\n\t}",
"@Override\n\tpublic int size() {\n\t\tint nr = 0;\n\t\tfor (int i = 0; i < nrb; i++) {\n\t\t\t// pentru fiecare bucket numar in lista asociata acestuia numarul de\n\t\t\t// elemente pe care le detine si le insumez\n\t\t\tfor (int j = 0; j < b.get(i).getEntries().size(); j++) {\n\t\t\t\tnr++;\n\t\t\t}\n\t\t}\n\t\treturn nr;// numaru total de elemente\n\t}",
"public int size() {\n int found = 0;\n Node<T> it = head.get();\n // Do a raw count.\n for (int i = 0; i < capacity; i++) {\n if (!it.free.get()) {\n found += 1;\n }\n it = it.next;\n }\n return found;\n }",
"Long getNumberOfElement();",
"public int size()\n {\n return N;\n }",
"public int size()\n { \t\n \t//initialize a counter to measure the size of the list\n int sizeVar = 0;\n //create local node variable to update in while loop\n LinkedListNode<T> localNode = getFirstNode();\n \n //update counter while there are still nodes\n while(localNode != null)\n {\n sizeVar += 1;\n localNode = localNode.getNext();\n }\n \n return sizeVar;\n }",
"public int size() {\n\t\tint count = 0;\n\t\tListNode current = front;\n\t\twhile (current != null) {\n\t\t\tcurrent = current.next;\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}",
"public int count() throws TrippiException {\n try {\n int n = 0;\n while (hasNext()) {\n next();\n n++;\n }\n return n;\n } finally {\n close();\n }\n }",
"public int size() {\r\n\t\treturn q.size();\r\n\t}",
"public synchronized int size() {\n return count;\n }",
"public int size() {\n ListNode current = front;\n int size = 0;\n while (current != null) {\n size += 1;\n current = current.next;\n }\n return size;\n }",
"public int size() {\r\n return N;\r\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n return N;\n }",
"public int size() {\n\t\treturn N;\n\t}",
"public int size() {\n\t\treturn N;\n\t}",
"public int size() {\n\t\treturn N;\n\t}",
"public int size() {\n\t\treturn N;\n\t}",
"public int size() {\n\t\treturn N;\n\t}",
"BigInteger getCount();",
"public int size() \r\n\t{\r\n\t\treturn getCounter();\r\n\t}",
"public int size()\n {\n Node n = head.getNext();\n int count = 0;\n while(n != null)\n {\n count++; \n n = n.getNext();\n }\n return count;\n }",
"public int queueArrayLength(){\n\t\treturn queueArray.length;\n\t}",
"public int getOutgoingQueueSize();",
"public int size (){\n return N;\n }",
"public int size(){\n\t\t\r\n\t\treturn N;\r\n\t}",
"public int size()\r\n { return N; }",
"public int size(){\r\n\t\treturn N;\r\n\t}",
"public int size(){\n int size = 0;\n for(LinkedList<E> item : this.data){\n size += item.size();\n }\n return size;\n }",
"int getJobsCount();",
"int getJobsCount();",
"int getJobsCount();",
"public int size()\r\n\t{\r\n\t\treturn heap.size();\r\n\t}",
"Integer count();",
"Integer count();",
"public int size()\n\t\t{\n\t\treturn N;\n\t\t}",
"public final int size() {\n int size = 0;\n final Iterator iterator = this.iterator();\n while (iterator.hasNext()) {\n size++;\n iterator.next();\n }\n return size;\n }",
"@Transactional(readOnly = true)\n public int getQueueNumber(Long id) {\n log.debug(\"Request to get getQueueNumber : {}\", id);\n return findByFoodJoint_Id(id).size();\n }",
"public int count() {\n\t\tint q = 0;\n\t\tfor(int i = 0; i < list.length; i++) if (list[i] != null) q++;\n\t\treturn q;\n\t\t\n\t}",
"public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }",
"public static int size(ArrayQueueADT arrayQueue) {\n return arrayQueue.size;\n }",
"public int size() {\n return N;\n\n }",
"public int size() {\n return _N;\n\n }",
"public int size() {\n\t return N;\n\t }",
"public int size()\n\t{\n\t\treturn requestQueue != null ? requestQueue.size() : 0;\n\t}",
"public int totalNum(){\n return wp.size();\n }",
"public static int registeredSize() {\n\t\tInteger count = new Integer(0);\n\t\tObject object = cache.get(FQN_COUNT, LOGGED_COUNT);\n\t\tif (object != null) {\n\t\t\tcount = (Integer) object;\n\t\t}\n\n\t\treturn (count == null ? 0 : count.intValue());\n\t}",
"Integer getNumQuestions();",
"public int size() {\n int counter = 1;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n counter += 1;\n }\n return counter;\n }",
"public int size()\r\n {\r\n return n;\r\n }",
"public int size()\r\n {\r\n return count;\r\n }",
"public int getQueueSize() {\n return queue.getQueueSize();\n }",
"public int size() {\n\t\treturn real-front+1; //x\r\n\t}",
"public int size() {\n\t\treturn heap.size();\n\t}",
"int getNumItems();",
"int getBlockNumbersCount();",
"private int size() {\n return n;\n }",
"public int getAvailableCount();",
"@Override\n public int size() {\n // Returns the number of elements stored in the heap\n return nelems;\n }",
"public static int size() \r\n\t{\r\n\t\treturn m_count;\r\n }",
"@Override\n public int size() {\n int i = 0;\n boolean cont = true;\n Node holder = new Node();\n holder = head;\n do {\n if (isEmpty()) {\n cont = false;\n } else if (holder.getNext() == null) {\n i++;\n cont = false;\n } else {\n holder = holder.getNext();\n i++;\n }\n } while (cont == true);\n return i;\n }",
"int getEntryCount();"
]
| [
"0.7672397",
"0.75295514",
"0.74924195",
"0.7436263",
"0.740751",
"0.7406072",
"0.73868775",
"0.7342145",
"0.73416626",
"0.7322079",
"0.71660167",
"0.7118695",
"0.71070254",
"0.7015161",
"0.7009227",
"0.7001164",
"0.6979156",
"0.6974966",
"0.6973743",
"0.6950656",
"0.694793",
"0.69341713",
"0.6844533",
"0.6819915",
"0.68079084",
"0.67899597",
"0.6765249",
"0.67406124",
"0.6735748",
"0.67235464",
"0.66834545",
"0.66834545",
"0.66326386",
"0.66289854",
"0.6587011",
"0.65762424",
"0.65662336",
"0.6555956",
"0.6545947",
"0.6534533",
"0.6534262",
"0.65262544",
"0.6524946",
"0.65120435",
"0.6506917",
"0.6505885",
"0.65027004",
"0.65027004",
"0.65027004",
"0.65027004",
"0.65027004",
"0.65027004",
"0.65027004",
"0.64858174",
"0.64858174",
"0.64858174",
"0.64858174",
"0.64858174",
"0.64644945",
"0.6461192",
"0.6461182",
"0.64608306",
"0.6456177",
"0.6441232",
"0.6440177",
"0.6434968",
"0.6432614",
"0.64277726",
"0.6415037",
"0.6415037",
"0.6415037",
"0.640886",
"0.6408831",
"0.6408831",
"0.6392371",
"0.6382522",
"0.63807756",
"0.6378207",
"0.6375962",
"0.6369877",
"0.6367361",
"0.6349993",
"0.6343646",
"0.63329333",
"0.63172626",
"0.63153696",
"0.6314498",
"0.6292753",
"0.6292179",
"0.62919205",
"0.6285842",
"0.6284913",
"0.62832105",
"0.6278039",
"0.6277378",
"0.6273119",
"0.627199",
"0.6271442",
"0.6267663",
"0.62671286",
"0.626065"
]
| 0.0 | -1 |
Return true iff there are no elements in the queue | public boolean isEmpty(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isEmpty(){\n\t\tif(queue.isEmpty()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isEmpty() {\n return this.queue.size() == 0;\n }",
"boolean isEmpty() {\n return queue.isEmpty();\n }",
"public boolean isEmpty() \n {\n\treturn queue.size() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return queue.isEmpty();\n }",
"public boolean isEmpty() {\n return queue.isEmpty();\n }",
"public boolean isEmpty() {\n\t\treturn queue.isEmpty();\n\t}",
"public boolean isEmpty() {\n\t\treturn queue.isEmpty();\n\t}",
"public boolean isEmpty()\n {\n return queue.isEmpty();\n }",
"public boolean isEmpty() {\n return queue.isEmpty();\n }",
"public boolean is_empty() {\n\t\tif (queue.size() <= 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean queueEmpty() {\r\n\t\tif (vehiclesInQueue.size() == 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean isEmpty() {\n return holdingQueue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty() && forReverse.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n\t\treturn queue.isEmpty();\n\t}",
"public boolean empty() {\n return normalQueue.isEmpty() && reverseQueue.isEmpty();\n }",
"public boolean isEmpty() {\n return (head == tail) && (queue[head] == null);\n }",
"public boolean isEmpty()\r\n {\r\n if(measurementQueue==null) return true;\r\n \r\n return measurementQueue.isEmpty();\r\n }",
"public static boolean isEmpty() {\n\t\treturn resultQueue.isEmpty();\n\t}",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"public boolean empty() {\n return queue.isEmpty();\n }",
"boolean isEmpty() {\n\t\t\n\t\t// array is empty if no elements can be polled from it\n\t\t// \"canPoll\" flag shows if any elements can be polled from queue\n\t\t// NOT \"canPoll\" means - empty\n\t\t\n\t\treturn !canPoll;\n\t}",
"public boolean isEmpty()\r\n\t{\n\t\tif(backIndex<0)\r\n\t\t{\r\n\t\t\tbackIndex=-1;\r\n\t\t\tSystem.out.println(\"Queue is Empty\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static boolean isEmpty() {\n System.out.println();\t \n if(queue.isEmpty()) {\t \n System.out.println(\"The queue is currently empty and has no elements.\");\t \t \t \n }\n else {\n System.out.println(\"The queue is currently not empty.\");\t \t\t \n }\n return queue.isEmpty();\n }",
"public boolean isEmpty(){\n\t\treturn ( startQueue.isEmpty() && finishQueue.isEmpty() && completedRuns.isEmpty() );\n\t}",
"public boolean empty() {\r\n return queue1.size() == 0;\r\n }",
"public boolean empty() {\r\n return queue1.size() == 0;\r\n }",
"public boolean isQueueEmpty(Queue objQueue){\r\n\t\treturn objQueue.getRare()==-1;\r\n\t}",
"public boolean isEmpty() { return (dequeSize == 0); }",
"public boolean empty() {\n\t if(q.size()==0) return true;\n\t return false;\n\t }",
"public boolean empty() {\r\n return this.queueMain.isEmpty();\r\n }",
"public boolean empty() {\n return q.isEmpty();\n }",
"public boolean isEmpty() {\n\t\treturn heap.size() == 0;\n\t}",
"public boolean isEmpty() {\n\t\treturn heap.size() == 0;\n\t}",
"@Override\n\tpublic boolean notEmpty() {\n\t\treturn count==0&&front==rear?true:false;\n\t}",
"public boolean isEmpty() {\n return qSize == 0;\n }",
"public boolean empty() {\n return queueA.isEmpty() && queueB.isEmpty();\n }",
"public boolean isEmpty() {\n\t\tboolean empty = true;\n\n\t\tfor(LinkedList<Passenger> queue : queues) { // loop through each queue to see if its empty.\n\t\t\tif(!queue.isEmpty()){\n\t\t\t\tempty = false;\n\t\t\t}\n \t}\n\t\treturn empty;\n }",
"public boolean empty() {\n return q.isEmpty();\n }",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn (front == -1 && rear == -1);\r\n\t}",
"public boolean empty() {\n /**\n * 当两个栈中都没有元素时,说明队列中也没有元素\n */\n return stack.isEmpty() && otherStack.isEmpty();\n }",
"public boolean isEmpty() {\n\t\treturn heap.isEmpty();\n\t}",
"public boolean isEmpty()\n\t{ \n\t\treturn (front==-1);\n\t}",
"public boolean isFull() {\n int nexttail = (tail + 1 == queue.length) ? 0 : tail + 1;\n return (nexttail == head) && (queue[tail] != null);\n }",
"public boolean isEmpty() {\r\n boolean z = false;\r\n if (!isUnconfinedQueueEmpty()) {\r\n return false;\r\n }\r\n DelayedTaskQueue delayedTaskQueue = (DelayedTaskQueue) this._delayed;\r\n if (delayedTaskQueue != null && !delayedTaskQueue.isEmpty()) {\r\n return false;\r\n }\r\n Object obj = this._queue;\r\n if (obj != null) {\r\n if (obj instanceof LockFreeTaskQueueCore) {\r\n z = ((LockFreeTaskQueueCore) obj).isEmpty();\r\n }\r\n return z;\r\n }\r\n z = true;\r\n return z;\r\n }",
"@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}",
"public boolean isMessageQueueEmpty() {\r\n\t\treturn this.messages.size() == 0;\r\n\t}",
"@Override\r\n\tpublic boolean isFull() {\r\n\r\n\t\treturn data.size() >= maxQueue;\r\n\t}",
"public boolean isFull(){\n return size == arrayQueue.length;\n }",
"@Override\r\n\tpublic boolean isempty() {\n\t\treturn count<=0;\r\n\t\t\r\n\t}",
"public boolean empty() {\n return queue1.isEmpty();\n }",
"@Override\n public boolean hasNext() {\n return !queue.isEmpty();\n }",
"public boolean isFull()\n\t{\n\t return (front==0 && rear==queueArray.length-1 || (front==rear+1));\n\t}",
"public boolean containsNoItems() {\n\t\treturn (this.items.size() == 0);\n\t}",
"private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}",
"public boolean isEmpty() {\n\t\treturn elements == 0;\n\t}",
"public boolean isEmpty() {\n\t\treturn front == null;\n\t}",
"public boolean isEmpty() {\n\t\treturn front == -1 && rear==-1;\r\n\t}",
"public static boolean isEmpty(ArrayQueueADT arrayQueue) {\n return arrayQueue.size == 0;\n }",
"public boolean isEmpty()\n {\n return heapSize == 0;\n }",
"@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn count == 0;\r\n\t}",
"public boolean queueFull() {\r\n\t\tif (vehiclesInQueue.size() > maxQueueSize) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean isEmpty() {\n // Write your code here\n return queue1.isEmpty() && queue2.isEmpty();\n }",
"public synchronized boolean isEmpty() {\r\n return size == 0;\r\n }",
"public synchronized boolean isEmpty() {\n\t\treturn size == 0;\n\t}",
"public boolean empty() {\n return push.isEmpty();\n }",
"public boolean empty() {\n\t\treturn (size() <= 0);\n\t}",
"@Override\r\n\tpublic boolean isEmtpy() {\r\n\t\tif (this.front == -1) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean isEmpty(){\n return myHeap.getLength() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return this.count() == 0;\n }",
"@Override\n public boolean isEmpty() {\n return this.size == 0;\n }",
"public boolean isEmpty() {\n return elements == 0;\n }",
"public boolean isEmpty() {\n\t\treturn elements.isEmpty();\n\t}",
"public boolean isEmpty()\r\n\t{\r\n\t\treturn count == 0;\r\n\t}",
"public boolean isEmpty()\n {\n return this.size == 0;\n }",
"public boolean isEmpty() {\n \treturn stack.size() == 0;\n }",
"public boolean isEmpty() { return count == 0; }",
"public boolean isEmpty()\n {\n return elements.isEmpty();\n }",
"public boolean empty() {\n return size <= 0;\n }",
"public boolean isEmpty() { return size == 0; }",
"public boolean isEmpty() { return size == 0; }",
"public boolean isEmpty() { return size == 0; }",
"public boolean isEmpty()\n {\n return stack.size() == 0;\n }",
"public boolean isEmpty() {\n return downStack.isEmpty();\n }",
"public boolean isEmpty() {\n return (this.count == 0);\n }",
"public boolean isEmpty() {\n return size <= 0;\n }",
"private boolean isEmpty() {\n\t\treturn (size == 0);\n\t}",
"public boolean isEmpty() {\n\t\treturn this.size == 0;\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}",
"@Override\n\tpublic boolean isEmpty() {\n\t\tboolean respuesta = true;\n\t\tif(N > 0)\n\t\t{\n\t\t\trespuesta = false;\n\t\t}\n\t\treturn respuesta;\n\t}"
]
| [
"0.8411878",
"0.83895415",
"0.83722556",
"0.83680415",
"0.8349618",
"0.8332298",
"0.8308994",
"0.8308994",
"0.8307721",
"0.82791424",
"0.8188129",
"0.8101091",
"0.80391467",
"0.79478663",
"0.7930493",
"0.7930493",
"0.7930493",
"0.7930493",
"0.7930493",
"0.7930493",
"0.7930493",
"0.79281193",
"0.7920505",
"0.79097223",
"0.79034877",
"0.7894416",
"0.7863223",
"0.7863223",
"0.7863223",
"0.7863223",
"0.7863223",
"0.7854127",
"0.78527975",
"0.784835",
"0.78230166",
"0.77665937",
"0.77665937",
"0.77537996",
"0.77177685",
"0.7659163",
"0.7654013",
"0.7614566",
"0.76138145",
"0.76138145",
"0.76118803",
"0.7595534",
"0.7593222",
"0.75852203",
"0.75716376",
"0.75686926",
"0.7537174",
"0.75371283",
"0.75118357",
"0.74815255",
"0.7480544",
"0.74198884",
"0.7416738",
"0.74149215",
"0.74138415",
"0.74055666",
"0.7397905",
"0.7388939",
"0.7380087",
"0.73695624",
"0.7368589",
"0.73670936",
"0.73663056",
"0.73614985",
"0.73608816",
"0.73566973",
"0.7344638",
"0.7343843",
"0.73408943",
"0.7335018",
"0.73307604",
"0.73257935",
"0.73244715",
"0.7319427",
"0.7318964",
"0.7311471",
"0.73097914",
"0.73088247",
"0.7296612",
"0.7296487",
"0.7296115",
"0.7291832",
"0.7291487",
"0.72894347",
"0.72869354",
"0.7282669",
"0.7282669",
"0.7282669",
"0.72821623",
"0.72818524",
"0.7280656",
"0.72777534",
"0.72756124",
"0.7274076",
"0.7268493",
"0.7268493",
"0.72662306"
]
| 0.0 | -1 |
Created by richellin on 2017/01/08. | public interface RevienService {
@Headers({
"Accept: application/json"
})
@GET("Prod/resource/{date}") Observable<JsonObject> getSentence(@Path("date") int date);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"private void poetries() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n public void init() {\n }",
"@Override\n void init() {\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public void mo38117a() {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"private void init() {\n\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"private void kk12() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n public void init() {}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void mo4359a() {\n }",
"@Override\n public void memoria() {\n \n }",
"@Override\r\n\tpublic void init() {}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"private void m50366E() {\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void init() {\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"private void strin() {\n\n\t}",
"@Override\n public void initialize() { \n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"public void mo6081a() {\n }",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"Petunia() {\r\n\t\t}",
"private void init() {\n\n\n\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}"
]
| [
"0.60704154",
"0.58455634",
"0.58193594",
"0.58186376",
"0.58186376",
"0.5796041",
"0.5707703",
"0.56947047",
"0.5673031",
"0.56604785",
"0.56381625",
"0.56345147",
"0.56339115",
"0.56264806",
"0.56264794",
"0.5616477",
"0.5611732",
"0.56039816",
"0.55847967",
"0.55498344",
"0.55483145",
"0.5527079",
"0.55187595",
"0.55101895",
"0.54889846",
"0.54889846",
"0.54889846",
"0.54889846",
"0.54889846",
"0.5483092",
"0.5474455",
"0.54606867",
"0.54590815",
"0.5457384",
"0.54524153",
"0.5447111",
"0.5439498",
"0.54383117",
"0.54358166",
"0.54358166",
"0.54358166",
"0.54358166",
"0.54358166",
"0.54358166",
"0.543098",
"0.5420026",
"0.5420026",
"0.5417884",
"0.5416551",
"0.539558",
"0.539558",
"0.53814214",
"0.5379508",
"0.5372924",
"0.5372924",
"0.5372924",
"0.53708047",
"0.53687334",
"0.5367965",
"0.5366122",
"0.53571695",
"0.53570867",
"0.53570867",
"0.53505695",
"0.53505695",
"0.53505695",
"0.53496695",
"0.53493947",
"0.5349364",
"0.5349364",
"0.5349364",
"0.5337489",
"0.53366584",
"0.53210545",
"0.53011465",
"0.5295793",
"0.5293965",
"0.5292202",
"0.529018",
"0.5285755",
"0.52724046",
"0.5270823",
"0.5268357",
"0.5268259",
"0.5255536",
"0.5255536",
"0.5255536",
"0.5255536",
"0.5255536",
"0.5255536",
"0.5255536",
"0.5254589",
"0.5250036",
"0.52372056",
"0.5220658",
"0.5218256",
"0.521211",
"0.5201682",
"0.5201682",
"0.51943994",
"0.51943994"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) throws IOException {
Start st = new Start();
WebDriver drv = st.driverInit();
String url = st.prop.getProperty("url") ;
drv.get(url);
System.out.println(dr.getTitle());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
LocalDate date = LocalDate.now().minusYears(4); | public double getCyclePrice(Cycle cycle, LocalDate date) {
int dateCurrent = date.getYear();
double cyclePrice = 500;
double totalCyclePrice = cyclePrice + getPrice();
switch (dateCurrent) {
case 2016:
totalCyclePrice = totalCyclePrice - totalCyclePrice* 50 / 100;
break;
case 2018:
totalCyclePrice = totalCyclePrice - totalCyclePrice* 25 / 100;
break;
default:
break;
}
return totalCyclePrice;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static ZonedDateTime fixYearIfInFuture(ZonedDateTime dateAndTime) {\n if (dateAndTime.isAfter(ZonedDateTime.now())) {\n return dateAndTime.minusYears(100);\n }\n return dateAndTime;\n }",
"LocalDate getDate();",
"public static LocalDate generateExpiration() {\n LocalDate today = LocalDate.now(); //gives us the information at the moment the program is running\n int expYear = today.getYear() + 5;\n LocalDate exp = LocalDate.of(expYear, today.getMonth(), today.getDayOfMonth());\n return exp;\n }",
"int getYear();",
"public static long howManyYearsFromNow(LocalDateTime date){\n LocalDateTime now = LocalDateTime.now();\n return now.until(date, ChronoUnit.YEARS);\n }",
"int getYears();",
"private DateTime goodLocalDateUse4() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return new DateTime().toDateTime(DateTimeZone.forID(\"America/New_York\"))\n .withDate(ld)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }",
"Date date(LocalDate date);",
"public static String getPastYearDate() {\n String dateStr = null;\n if (getLeapYear()) {\n dateStr = decDays(-366);\n } else {\n dateStr = decDays(-365);\n }\n return dateStr;\n }",
"Years createYears();",
"LocalDate getDateOfBirth();",
"private static Date getYearDate(int year) {\n Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.set(Calendar.YEAR, year);\n return calendar.getTime();\n }",
"@Override\n public int getYear() {\n return this.deadline.getYear();\n }",
"Year createYear();",
"public static final int getReleaseYear() { return 2019; }",
"Integer getTenYear();",
"private static int getDaysSinceNewYear() {\n\t\tGregorianCalendar now = new GregorianCalendar();\n\n\t\treturn now.get(GregorianCalendar.DAY_OF_YEAR);\n\t}",
"public BigDecimal getCurrentYear() {\n return currentYear;\n }",
"public int getYearsUntilTenure(){\n return m_yearsUntilTenure;\n }",
"public String asYear() {\n \treturn new SimpleDateFormat(\"yyyy\").format(expiredAfter);\n }",
"@Override\n\tpublic void oneYearAgo(int year) {\n\n\t}",
"public int getEndingYear()\n {\n return -1;\n }",
"private static LocalDate localQuarterDate( int year, int quarter, int dayOfQuarter )\n {\n if ( quarter == 2 && dayOfQuarter == 92 )\n {\n throw new InvalidValuesArgumentException( \"Quarter 2 only has 91 days.\" );\n }\n // instantiate the yearDate now, because we use it to know if it is a leap year\n LocalDate yearDate = LocalDate.ofYearDay( year, dayOfQuarter ); // guess on the day\n if ( quarter == 1 && dayOfQuarter > 90 && (!yearDate.isLeapYear() || dayOfQuarter == 92) )\n {\n throw new InvalidValuesArgumentException( String.format(\n \"Quarter 1 of %d only has %d days.\", year, yearDate.isLeapYear() ? 91 : 90 ) );\n }\n return yearDate\n .with( IsoFields.QUARTER_OF_YEAR, quarter )\n .with( IsoFields.DAY_OF_QUARTER, dayOfQuarter );\n }",
"public static int getAge(int yearBorn)\r\n {\r\n return LocalDate.now().getYear()-yearBorn;\r\n }",
"public int getYear() { return year; }",
"public int getYear() { return year; }",
"private static String getNewYearAsString() {\n\t\t// calculate the number of days since new years\n\t\tGregorianCalendar now = new GregorianCalendar();\n\t\t\n\t\t// create a date and string representing the new year\n\t\tGregorianCalendar newYearsDay = new GregorianCalendar( now.get(GregorianCalendar.YEAR), 0, 1);\n\t\tDateFormat fmt = new SimpleDateFormat(\"MMM dd, yyyy \");\n\t\n\t\treturn fmt.format( newYearsDay.getTime() );\n\t}",
"public int getStartingYear()\n {\n return 2013;\n }",
"public int getYear() {\n return endDate.getYear();\n }",
"public HISDate addYears(int numberOfYears) {\r\n GregorianCalendar gc = new GregorianCalendar(this.getYear(), this.getMonth() - 1, this.getDay());\r\n gc.add(Calendar.YEAR, numberOfYears);\r\n return new HISDate(gc.getTime());\r\n }",
"public static void main(String[] args) {\n\n\t\tLocalDate current =LocalDate.now();\n\tLocalDate ld =\tLocalDate.of(1989, 11, 30);\n\t\t\n\tPeriod pd =\tPeriod.between(current, ld);\n\tSystem.out.println(pd.getYears());\n\t}",
"public static String addYearsToDate(String date, int numberOfYears) {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.UK);\r\n\t\t\tDateTime dt = new DateTime((Date) sdf.parse(date));\r\n\t\t\tDateTime dt2 = dt.plusYears(numberOfYears);\r\n\t\t\treturn dt2.toString(\"yyyy-MM-dd\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn date;\r\n\t\t}\r\n\t}",
"private static String getYearMonth() {\n LocalDate oneMonthAgo = LocalDate.now().minusMonths(1);\n return oneMonthAgo.getYear() + String.format(\"%02d\", oneMonthAgo.getMonth().getValue());\n }",
"private DateTime goodLocalDateUse() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }",
"public BigDecimal getPriorYear() {\n return priorYear;\n }",
"public int getYear() {\n return year;\n }",
"public int getYear()\n {\n return yr;\n }",
"public static LocalDate getDayAfterTomorrow() {\n\t\treturn LocalDate.now().plus(Period.ofDays(2));\n\t}",
"public int getYear()\n {\n return year;\n }",
"public int getYearFounded() {\n\t\treturn yearFounded;\n\t}",
"public double getYear() {\n return year;\n }",
"private LocalDate nowLocalDate() {\n\t\tInstant instantNow = Instant.ofEpochMilli( System.currentTimeMillis() );\n\t\tLocalDate nowLocalDate = instantNow.atOffset(ZoneOffset.UTC).toLocalDate();\n\t\treturn nowLocalDate;\n\t}",
"public static int getTodaysYear() {\t\r\n\t\t\r\n\t\tTime time = new Time();\r\n\t\ttime.setToNow();\r\n\t\treturn time.year;\t\r\n\t\t\r\n\t}",
"public int getYear() {\n return year;\n }",
"public int getYear () {\n return year;\n }",
"public int yearsSinceDebut(int debutYear)\n {\n int year = Calendar.getInstance().get(Calendar.YEAR);\n return year - debutYear;\n }",
"public static void main(String[] args) {\n\t\tLocalDate ld = LocalDate.now();\n\t\tSystem.out.println(ld);\n\t\tSystem.out.println(ld.minusDays(1));\n\t}",
"public int getYear() {\r\n return year;\r\n }",
"private String getYear(Date date) {\n\t\tLocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();\n\n\t\tInteger yearAsInt = localDate.getYear();\n\n\t\treturn String.valueOf(yearAsInt);\n\t}",
"@Test\n public void leapYearIsDivisibleBy4(){\n int year = 2020;\n assertTrue(LeapYear.isLeapYear(year));\n }",
"public LocalDate getDate() {\r\n\t\treturn loanDate;\r\n\t}",
"public int getYear() {\n\treturn year;\n}",
"public static void testDate() {\n\t\tDate oldDate = new Date();\r\n\t\tSystem.out.println(oldDate);\r\n\r\n\t\tCalendar c = Calendar.getInstance();\r\n\t\tc.set(2000, 0, 17);\r\n\t\tDate oldDate2 = c.getTime();\r\n\t\tSystem.out.println(oldDate2);\r\n\r\n\t\t// Dates created with Java 8\r\n\t\tLocalDateTime newDateTime = LocalDateTime.now();\r\n\t\tLocalDate newDate = LocalDate.now();\r\n\t\tLocalTime newTime = LocalTime.now();\r\n\t\tSystem.out.println(newTime);\r\n\r\n\t\tnewDateTime = LocalDateTime.of(newDate, newTime);\r\n\t\tSystem.out.println(newDateTime);\r\n\r\n\t\tLocalDateTime newDateTime1 = LocalDateTime.of(2015, 12, 1, 10, 2, 3, 4);\r\n\t\tSystem.out.println(newDateTime1);\r\n\r\n\t\tnewDateTime1 = newDateTime1.plusYears(1);\r\n\t\tSystem.out.println(newDateTime1);\r\n\r\n\t\tDateTimeFormatter dtf = DateTimeFormatter\r\n\t\t\t\t.ofLocalizedDateTime(FormatStyle.SHORT);\r\n\t\tSystem.out.println(dtf.format(newDateTime1));\r\n\t\tdtf = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM);\r\n\t\tSystem.out.println(dtf.format(newDateTime1));\r\n\r\n\t\tdtf = DateTimeFormatter.ofPattern(\"MMMM dd yyyy, hh:mm:ss\");\r\n\t\tSystem.out.println(dtf.format(newDateTime1));\r\n\t}",
"public Date getYearToDate() {\r\n return (Date) getAttributeInternal(YEARTODATE);\r\n }",
"private DateTime goodLocalDateUse2() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n LocalTime now = LocalTime.now();\n return new DateTime(ld.getYear(), ld.getMonthOfYear(), ld.getDayOfYear(), now.getHourOfDay(),\n now.getMinuteOfHour(), now.getSecondOfMinute(), now.getMillisOfSecond(),\n DateTimeZone.getDefault())\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }",
"public static int getCurrentYear()\n\t{\n\t\treturn Calendar.getInstance().get(Calendar.YEAR);\n\t}",
"public int getYear() {\r\n return year;\r\n }",
"@Override\n public LocalDate getDate() {\n return null;\n }",
"@Test\n public void isLeapYearOk(){\n assertTrue(Date.isLeapYear(2008));\n }",
"public LocalDate getDateOfPurchase() {\n return dateOfPurchase;\n }",
"public LocalDate getDate() {\n return date;\n }",
"private DateTime goodLocalDateUse5() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return new DateTime().toDateTime(DateTimeZone.getDefault())\n .withDate(ld)\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }",
"public int getYear() {\n\treturn year;\n }",
"void setDateOfBirth(LocalDate dateOfBirth);",
"public static void main(String[] args) {\n\n LocalDate today = LocalDate.now();\n System.out.println(\"today = \" + today);\n\n LocalDate tomorrow = today.plus(1, ChronoUnit.DAYS);\n System.out.println(\"tomorrow = \" + tomorrow );\n\n LocalDate yesterday = tomorrow.minusDays(2);\n System.out.println(\"yesterday = \" + yesterday);\n\n LocalDate independenceDay = LocalDate.of(2019, Month.DECEMBER, 11);\n DayOfWeek dayOfWeek = independenceDay.getDayOfWeek();\n System.out.println(\"dayOfWeek = \" + dayOfWeek);\n\n\n\n\n }",
"public java.math.BigInteger getExpirationYear() {\r\n return expirationYear;\r\n }",
"private static int returnsCurrentYear() {\n\t\treturn Calendar.getInstance().get(Calendar.YEAR);\n\t}",
"private int calculateAge() {\n\t\treturn LocalDate.now().getYear() - this.birthYear;\n\t}",
"com.google.type.Date getExpireDate();",
"public Integer getYear() {\n return year;\n }",
"public Integer getYear() {\n return year;\n }",
"public Integer getYear() {\n return year;\n }",
"public int getYear() {\n return year;\n }",
"public int getDocumentYear();",
"public int getNumberOfYears() {\n return numberOfYears;\n }",
"Date getDueDate();",
"Date getDueDate();",
"public Integer getYear() {\r\n return year;\r\n }",
"public Integer getYear() {\r\n return year;\r\n }",
"public static int getAge(int yearBorn)\n {\n return 2016-yearBorn;\n }",
"public int getAgeInYears (Date today) {\n int maxAgeInYears = today.year - this.year;\n\n if (today.month > this.month || (today.month == this.month && today.day >= this.day)){\n return maxAgeInYears;\n }\n\n return maxAgeInYears - 1;\n }",
"@Override\r\n\tpublic int yearsTillRetirement() //calculate years until retirement\r\n\t{\n\t\tint retire = (int)Math.round((35 - (super.getYears() + (double)(usedUnpaidVacation + usedVacation* 2 + usedSickDays)/260)));\r\n\t\t\r\n\t\treturn retire;\r\n\t\t\r\n\t\t\r\n\t}",
"Date getDate();",
"Date getDate();",
"Date getDate();",
"private AbsentYear createAbsentYear(Employee emp, LocalDate startDate) {\n\t\tAbsentYear absentYear = new AbsentYear();\n\t\tabsentYear.setEmployee(emp);\n\t\tabsentYear.setYear((short)startDate.getYear());\n\t\tabsYearRepo.save(absentYear);\n\t\treturn absentYear;\n\t}",
"private DateTime goodLocalDateUse3() {\n LocalDate ld = new LocalDate(2020, 6, 2);\n return ld.toDateTimeAtStartOfDay(DateTimeZone.forID(\"America/New_York\"))\n .toDateTime(DateTimeZone.forID(\"America/Los_Angeles\"));\n }",
"@Override\n\tpublic int getYear() {\n\t\treturn year;\n\t}",
"@RequiresApi(api = Build.VERSION_CODES.O)\n public static LocalDate getLocalDate() {\n return LocalDate.now();\n }",
"public static Date addYears(final Date date, final int amount) {\n final Calendar calendar = Calendar.getInstance();\n calendar.setTime(date);\n calendar.add(Calendar.YEAR, amount);\n return calendar.getTime();\n }",
"public static Date addYears(final Date date, final int years) {\n return Dates.add(date, years, Calendar.YEAR);\n }",
"public static long differenceInYears(LocalDateTime from, LocalDateTime to){\n return to.until(from, ChronoUnit.YEARS);\n }",
"public int getYear(){\r\n\t\treturn year;\r\n\t}",
"public int getYear() {\n\t\treturn year;\n\t}",
"Date getPriorDate();",
"public String getYear()\n {\n return year;\n }",
"public String getYear()\r\n {\r\n return year;\r\n }",
"public int getYear(){\n\t\treturn year; \n\t}",
"public LocalDate getDate() {\n return date;\n }",
"public LocalDate getDate() {\n return date;\n }",
"public void setPrevYear()\n\t{\n\t\tm_calendar.set(Calendar.YEAR,getYear()-1);\n\n\t}"
]
| [
"0.6672431",
"0.6480564",
"0.64320284",
"0.6215641",
"0.6202467",
"0.61915994",
"0.61797315",
"0.61570615",
"0.6142301",
"0.6130909",
"0.61047614",
"0.60852695",
"0.60779613",
"0.60184723",
"0.5994929",
"0.59789056",
"0.5972",
"0.5937625",
"0.5894671",
"0.588424",
"0.5856853",
"0.579814",
"0.5715916",
"0.5670389",
"0.5669549",
"0.5669549",
"0.56672245",
"0.5651712",
"0.56505334",
"0.5627296",
"0.5608419",
"0.55904263",
"0.5588485",
"0.55743265",
"0.5559789",
"0.55476063",
"0.5541303",
"0.55239975",
"0.55148226",
"0.5492711",
"0.54886997",
"0.54709387",
"0.54564464",
"0.5446419",
"0.5439841",
"0.54384863",
"0.5435743",
"0.5435367",
"0.5431894",
"0.54289675",
"0.54225844",
"0.5407914",
"0.5402637",
"0.53964",
"0.539204",
"0.53907573",
"0.5389741",
"0.53639656",
"0.5363735",
"0.5361901",
"0.5358948",
"0.53538424",
"0.53389496",
"0.5334696",
"0.53320324",
"0.5330077",
"0.53281975",
"0.5328169",
"0.53216946",
"0.53193843",
"0.53193843",
"0.53193843",
"0.53183275",
"0.5314997",
"0.530053",
"0.52967304",
"0.52967304",
"0.52932835",
"0.52932835",
"0.5289985",
"0.52890974",
"0.5288825",
"0.5284945",
"0.5284945",
"0.5284945",
"0.52780455",
"0.5276175",
"0.5269364",
"0.5261264",
"0.5246243",
"0.52456665",
"0.52406716",
"0.52381194",
"0.5237658",
"0.52375907",
"0.52315867",
"0.5229075",
"0.5226434",
"0.522514",
"0.522514",
"0.5224769"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void run() {
String str;
while(true){
try {
str = charBufferIn.readLine();
gm.textArea1.append(str + "\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
Toolkit.getDefaultToolkit().getScreenSize(); literally why is this scalable while the game screen isnt? | public Screen() {
frame = new JFrame("Transmission");
frame.setSize(screen);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
panel = new Canvas();
panel.setPreferredSize(screen);
panel.setMaximumSize(screen);
panel.setMinimumSize(screen);
panel.setFocusable(false);
frame.add(panel);
frame.pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getScreenSize() {\r\n\t\treturn SCREEN_SIZE;\r\n\t}",
"protected byte desiredWinScale() { return 9; }",
"private void getScreenSize() {\n WindowManager wm = getWindowManager();\n Display disp = wm.getDefaultDisplay();\n Point size = new Point();\n disp.getSize(size);\n screenWidth = size.x;\n screenHeight = size.y;\n }",
"public int getScreenWidth();",
"public int getScreenWidth();",
"public void resize_screen(){\r\n \tstop_scn_updates();\r\n \tscn_font_size = min_font_size+1;\r\n \twhile (scn_font_size < max_font_size){\r\n \t\tscn_font = new Font(tz390.z390_font,Font.BOLD,scn_font_size);\r\n \t\tcalc_screen_size();\r\n \t\tif (scn_image.getWidth() < main_panel_width\r\n \t\t\t&& scn_image.getHeight() < main_panel_height){\r\n \t\t\tscn_font_size++;\r\n \t\t} else {\r\n \t\t scn_font_size--;\r\n \t\t break;\r\n \t\t}\r\n \t} \t\r\n \tscn_font = new Font(tz390.z390_font,Font.BOLD,scn_font_size);\r\n \tcalc_screen_size();\r\n start_scn_updates();\r\n }",
"public int winSize() { return winSize; }",
"public int getScreenSize() {\n screensize = getResources().getConfiguration().screenLayout &\n Configuration.SCREENLAYOUT_SIZE_MASK;\n return screensize;\n }",
"default int getSquareSize() {\n return java.awt.Toolkit.getDefaultToolkit().getScreenSize().width / 20;\n }",
"private Point getScreenDim() {\n \t\tDisplay display = this.getWindowManager().getDefaultDisplay();\n \n \t\t@SuppressWarnings( \"deprecation\" )\n \t\tPoint size = new Point( display.getWidth(), display.getHeight() );\n \t\treturn size;\n \t}",
"public int[] getSuggestedScreenSize();",
"private void calc_screen_size(){\r\n \tscn_grid.setFont(scn_font);\r\n \tscn_context = scn_grid.getFontRenderContext();\r\n \t scn_layout = new TextLayout(\"X\",scn_font,scn_context);\r\n scn_char_rect = scn_layout.getBlackBoxBounds(0,1).getBounds();\r\n scn_char_height = (int) (scn_char_rect.getHeight()); // RPI 630 was Width in err, 6 to *1.5\r\n \tscn_char_base = scn_char_height/2+1;\r\n \tscn_char_height = scn_char_height + scn_char_base+2;\r\n scn_char_width = (int) (scn_char_rect.getWidth()); // RPI 630 was Height in err\r\n \tscn_height = scn_rows * scn_char_height; // RPI 408 + 5 \r\n \tscn_width = scn_cols * scn_char_width + 3; // RPI 408 + 5 \r\n \tscn_size = new Dimension(scn_width,scn_height);\r\n \tscn_image = new BufferedImage(scn_width,scn_height,BufferedImage.TYPE_INT_ARGB);\r\n \tscn_grid = scn_image.createGraphics();\r\n \tscn_grid.setFont(scn_font); \r\n scn_grid.setColor(scn_text_color);\r\n \t scn_context = scn_grid.getFontRenderContext();\r\n scn_grid.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n RenderingHints.VALUE_ANTIALIAS_ON);\r\n }",
"public int getScreenHeight();",
"public int getScreenHeight();",
"public int getScreenSize(){\n\t \n\t //get screen soe promatticaly so we can set the layout gallery view at runtome\n\t int screenSize = this.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;\n\t \n\t switch(screenSize){\n\t \n\t case Configuration.SCREENLAYOUT_SIZE_XLARGE:\n\t\t return 1;\n\tcase Configuration.SCREENLAYOUT_SIZE_NORMAL:\n\t \t\treturn 2;\n\tcase Configuration.SCREENLAYOUT_SIZE_LARGE:\n\t\t//at east 480dp\n \t\treturn 3;\n\t\t \n\t \n\t \n\t }\n\t return 0;//if neither 1 or 2\n }",
"private void getScreenDimensions() {\n DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();\n mScreenWidth = metrics.widthPixels;\n mScreenHeight = metrics.heightPixels;\n mScreenDensity = metrics.densityDpi;\n }",
"public int getWidthScreen(){\n return widthScreen ;\n }",
"int[] getScreenSize() {\n qq scSize = new qq(game.z, game.d, game.e);\n return new int[] { scSize.a(), scSize.b() };\n }",
"public Point getSize() {\n\t\treturn p_screenSize;\n\t}",
"public static Point getAppUsableScreenSize(Context context) {\n WindowManager windowManager =\n (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n return size;\n }",
"public static void getScreenSize(Context context)\n\t{\n\t\tDisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\n\t\tfloat screenWidthDp = displayMetrics.widthPixels / displayMetrics.density; \n\t\tfloat screenHeightDp = displayMetrics.heightPixels / displayMetrics.density;\n\t\tLog.w(Utils.class.getName(), \"getScreenSize() gets the screen size in DP width=\" + screenWidthDp\n\t\t\t\t\t+ \" height=\" + screenHeightDp);\n\t\t\n\t\t// use width and height as in vertical mode, so width < height\n\t\tif(screenWidthDp > screenHeightDp)\n\t\t{\n\t\t\tfloat mid = screenWidthDp;\n\t\t\tscreenWidthDp = screenHeightDp;\n\t\t\tscreenHeightDp = mid; \n\t\t}\n\t\t\n\t\tint screenWidthInt = (int) screenWidthDp;\n\t\tint screenHeightInt = (int) screenHeightDp;\n\t\t\n\t\tif((screenWidthInt%2) != 0)\n\t\t{\n\t\t\tscreenWidthInt--;\n\t\t}\n\t\tif((screenHeightInt%2) != 0)\n\t\t{\n\t\t\tscreenHeightInt--;\n\t\t}\n\t\t\n\t\tUtils.ConstantVars.screenWidth = screenWidthInt;\n\t\tUtils.ConstantVars.screenHeight = screenHeightInt;\n\t\t\n\t\tLog.w(Utils.class.getName(), \"getScreenSize() optimized the screen size in integer width=\" \n\t\t\t\t+ Utils.ConstantVars.screenWidth + \" height=\" + Utils.ConstantVars.screenHeight);\n\t\t\t\t\n\t}",
"private static Point getScreenSize(Context context) {\n WindowManager wm = (WindowManager) context\n .getSystemService(Context.WINDOW_SERVICE);\n Display display = wm.getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n\n // Make width <= height, regardless of the current screen orientation.\n if (size.x > size.y) {\n size.set(size.y, size.x);\n }\n\n return size;\n }",
"public int getScreenWidth()\r\n\t{\r\n\t\treturn mScreen.getWidth();\r\n\t}",
"private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }",
"public int getDisplayWidth() {\n return isHiRes() ? 640 : 320;\n }",
"@Override\n public void resize(int width, int height) {game.screenPort.update(width, height, true);}",
"public float getEqualizationScale() {\n return Gdx.graphics.getWidth() / WE.getCurrentConfig().getRenderResolutionWidth();\n }",
"private static void initUsableDisplaySizes() {\n\t\t// Optimized display dimensions for display resolutions\n\t\tdisplaySizes.add(new Dimension(640, 480)); // Smaller 4:3 (1024x768 and smaller)\n\t\tdisplaySizes.add(new Dimension(800, 600)); // Larger 4:3 (1280x1024)\n\t\tdisplaySizes.add(new Dimension(864, 486)); // Larger 16:9 (1366x768 and larger)\n\t}",
"protected void calculateBounds()\r\n {\r\n Toolkit DefaultToolkit = Toolkit.getDefaultToolkit();\r\n Dimension ScreenSize = DefaultToolkit.getScreenSize();\r\n int FrameWidth = ScreenSize.width - 100;\r\n int FrameHeight = ScreenSize.height - 100;\r\n setBounds(50, 50, FrameWidth, FrameHeight);\r\n }",
"public int getHeightScreen(){\n return heightScreen ;\n }",
"private Dimension tailleEcranAdapté(){\n GraphicsEnvironment graphicsEnvironment =GraphicsEnvironment.getLocalGraphicsEnvironment();\n //get maximum window bounds\n Rectangle rectangle =graphicsEnvironment.getMaximumWindowBounds();\n //Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();\n Dimension dim = new Dimension((int)rectangle.getWidth(),(int)rectangle.getHeight());\n return dim;\n }",
"public int[] determineScreenSize()\n {\n int heightInPixels, widthInPixels;\n int horizontal, vertical;\n\n // Determine initial values from CRTC registers (ensure dimensions are positive by casting byte to int)\n horizontal = ((((int) videocard.crtControllerRegister.regArray[1]) & 0xFF) + 1) * 8;\n vertical = ((((int) videocard.crtControllerRegister.regArray[18]) & 0xFF) | \n (((((int) videocard.crtControllerRegister.regArray[7]) & 0xFF) & 0x02) << 7) | (((((int) videocard.crtControllerRegister.regArray[7]) & 0xFF) & 0x40) << 3)) + 1;\n\n if (videocard.graphicsController.shift256Reg == 0)\n {\n widthInPixels = 640;\n heightInPixels = 480;\n\n if (videocard.crtControllerRegister.regArray[0x06] == (byte) 0xBF)\n {\n if (videocard.crtControllerRegister.regArray[0x17] == (byte) 0xA3 && videocard.crtControllerRegister.regArray[0x14] == (byte) 0x40 && videocard.crtControllerRegister.regArray[0x09] == (byte) 0x41)\n {\n widthInPixels = 320;\n heightInPixels = 240;\n }\n else\n {\n if (videocard.sequencer.dotClockRate != 0)\n {\n horizontal <<= 1;\n }\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else if ((horizontal >= 640) && (vertical >= 480))\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else if (videocard.graphicsController.shift256Reg == 2)\n {\n\n if (videocard.sequencer.chainFourEnable != 0)\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n else\n {\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n }\n else\n {\n if (videocard.sequencer.dotClockRate != 0)\n horizontal <<= 1;\n widthInPixels = horizontal;\n heightInPixels = vertical;\n }\n return new int[] {heightInPixels, widthInPixels};\n }",
"static int[] getResolution ()\n\t{\n\t\t//get the Toolkit of this instance\n\t\tToolkit tk = Toolkit.getDefaultToolkit ();\n\t\t\n\t\t//get the screen size as Dimension object\n\t\tDimension resolution = tk.getScreenSize ();\n\n\t\tint[] rez = new int[2];\n\n\t\t//extract integers from that Dimension object\n\t\trez[0] = new Double (resolution.getWidth ()).intValue ();\n\t\trez[1] = new Double (resolution.getHeight ()).intValue ();\n\n\t\treturn rez;\n\t}",
"public boolean isSmallScreen() {\n \t\treturn m_smallScreenMode;\n \t}",
"public GraphicsDevice getScreen();",
"public static double getDisplayWidth() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getWidth();\n\t}",
"public int getScreenWidth() {\n return this.screenWidth;\n }",
"public static void setBounds() {\n\t\tDimension dim = Toolkit.getDefaultToolkit().getScreenSize();\r\n\t\t\r\n\t\t// Determine the new location of the window\r\n\t\tint w = gameFrame.getSize().width;\r\n\t\tint h = gameFrame.getSize().height;\r\n\t\tint x = (dim.width/2)-(w/2);\r\n\t\tint y = (dim.height/2)-(h/2);\r\n\t\t// Move the window\r\n\t\tgameFrame.setLocation(x, y);\r\n\t\tgameFrame.setVisible(true);\r\n\t}",
"public void settings() { size(1200, 800); }",
"public int getScreenHeight()\r\n\t{\r\n\t\treturn mScreen.getHeight();\r\n\t}",
"public Dimension2D getCanvasSize(\n )\n {\n return renderSize == null\n ? Dimension.get(getContentContext().getBox()) // Device-independent (user-space) area.\n : renderSize; // Device-dependent (device-space) area.\n }",
"@Implementation(minSdk = O_MR1)\n public Point getStableDisplaySize() throws RemoteException {\n DisplayInfo defaultDisplayInfo = mDm.getDisplayInfo(Display.DEFAULT_DISPLAY);\n return new Point(defaultDisplayInfo.getNaturalWidth(), defaultDisplayInfo.getNaturalHeight());\n }",
"public void settings() {\r\n size(WIDTH, HEIGHT); // Set size of screen\r\n }",
"public static double[] getDisplayResolution() {\n\t\tjava.awt.Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\tdouble width = screenSize.getWidth();\n\t\tdouble height = screenSize.getHeight();\n\t\tdouble[] displayRes = {width, height};\n\t\treturn displayRes;\n\t}",
"public abstract int getDisplayWidth();",
"public void showOnScreen(int screen, JFrame frame) {\n\t\tGraphicsConfiguration[] screenConfig = screenDevices[screen].getConfigurations();\n\t\tSystem.out.println(\"width:\" + screenConfig[0].getBounds().getWidth());\n\t\tSystem.out.println(\"height:\" + screenConfig[0].getBounds().getHeight());\n\t\tint width = (int) screenConfig[0].getBounds().getWidth();\n\t\tint height = (int) screenConfig[0].getBounds().getHeight();\n\t\tsetPreferredSize(new Dimension(width, height));\n\t\tWIDTH = width / SCALE;\n\t\tHEIGHT = height / SCALE;\n\t\tGame.WIDTH = WIDTH;\n\t\tGame.HEIGHT = HEIGHT;\n\t\t// frame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\tframe.setUndecorated(true);\n\t\tframe.setResizable(false);\n\t\tframe.pack();\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tif (screen > -1 && screen < screenDevices.length) {\n\t\t\tscreenDevices[screen].setFullScreenWindow(frame);\n\t\t} else if (screenDevices.length > 0) {\n\t\t\tscreenDevices[0].setFullScreenWindow(frame);\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"No Screens Found\");\n\t\t}\n\t}",
"@Override\r\n\tpublic int getGameInitialWidth() {\n\t\treturn 320;\r\n\t}",
"public int[] getScreenDimensions() {\n if (Minecraft.getInstance().currentScreen != null) {\n return new int[]{Minecraft.getInstance().currentScreen.width, Minecraft.getInstance().currentScreen.height};\n } else {\n return new int[]{Minecraft.getInstance().getMainWindow().getWidth(), Minecraft.getInstance().getMainWindow().getHeight()};\n }\n }",
"public static double getRawDisplayWidth() {\n\t\treturn javafx.stage.Screen.getPrimary().getBounds().getWidth();\n\t}",
"public static Dimension getLastScreenSize()\r\n\t{\r\n\t\treturn _lastPlotSize;\r\n\t}",
"@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) \r\n\t{\n\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n\t\tSystem.out.println(\"Screen Mesure: \"+getMeasuredWidth()+\" \"+getMeasuredHeight());\r\n\t\twindowW = getMeasuredWidth();\r\n\t\twindowH = getMeasuredHeight();\r\n\t \r\n\t \r\n\t}",
"public void SetResolution() {\r\n DisplayMetrics displayMetrics = new DisplayMetrics();\r\n WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);\r\n wm.getDefaultDisplay().getMetrics(displayMetrics);\r\n this.ScreenWidth = displayMetrics.widthPixels;\r\n this.ScreenHeight = displayMetrics.heightPixels;\r\n }",
"public static Point getRealScreenSize(Context context) {\n WindowManager windowManager =\n (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\n Point size = new Point();\n\n if (Build.VERSION.SDK_INT >= 17) {\n display.getRealSize(size);\n } else if (Build.VERSION.SDK_INT >= 15) {\n try {\n size.x = (Integer) Display.class.getMethod(\"getRawWidth\").invoke(display);\n size.y = (Integer) Display.class.getMethod(\"getRawHeight\").invoke(display);\n } catch (IllegalAccessException e) {\n } catch (InvocationTargetException e) {\n } catch (NoSuchMethodException e) {\n }\n }\n\n return size;\n }",
"public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }",
"Point getScreenDimensions() {\n\t\tDisplay display = getWindowManager().getDefaultDisplay();\n\t\tPoint screenDimensions = new Point();\n\t\tdisplay.getSize(screenDimensions);\n\t\treturn screenDimensions;\n\t}",
"private void getWidthAndHeight() {\n DisplayMetrics displaymetrics = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);\n screenHeight = displaymetrics.heightPixels;\n screenWidth = displaymetrics.widthPixels;\n }",
"int getWindowSize();",
"public static Rect getScreenSize(View view){\r\n WindowManager windowManager = (WindowManager)view.getContext().getSystemService(Context.WINDOW_SERVICE);\r\n Display display = windowManager.getDefaultDisplay();\r\n\r\n return new Rect(0, 0, display.getWidth(), display.getHeight());\r\n }",
"@Override\n protected GRect getScreenBounds_rawInOs() {\n /*\n * As the spec say, for safety we prefer\n * to just stick to first monitor.\n */\n final boolean mustUseWholeDisplayElseFirstMonitor = false;\n \n final ScreenBoundsType screenBoundsType =\n this.getBindingConfig().getScreenBoundsType();\n \n final GRect ret;\n if (screenBoundsType == ScreenBoundsType.CONFIGURED) {\n final GRect screenBoundsInOs =\n this.getBindingConfig().getScreenBoundsInOs();\n ret = LangUtils.requireNonNull(screenBoundsInOs);\n \n } else if (screenBoundsType == ScreenBoundsType.PRIMARY_SCREEN_FULL) {\n final Rectangle rectangle;\n if (mustUseWholeDisplayElseFirstMonitor) {\n rectangle = this.display.getBounds();\n } else {\n final Monitor monitor = this.display.getMonitors()[0];\n rectangle = monitor.getBounds();\n }\n ret = SwtUtils.toGRect(rectangle);\n \n } else if (screenBoundsType == ScreenBoundsType.PRIMARY_SCREEN_AVAILABLE) {\n final Rectangle rectangle;\n if (mustUseWholeDisplayElseFirstMonitor) {\n rectangle = this.display.getClientArea();\n } else {\n final Monitor monitor = this.display.getMonitors()[0];\n rectangle = monitor.getClientArea();\n }\n ret = SwtUtils.toGRect(rectangle);\n } else {\n throw new IllegalArgumentException(\"\" + screenBoundsType);\n }\n return ret;\n }",
"public static int getWidth() {\r\n\t\treturn 1280;\r\n\t}",
"protected final Dimension windowSizeControl () {\n\t\tif (!this.isMaximum && !this.isIcon && !this.isClosed) {\n\t\t\tint height = size.height;\n\t\t\tint width = size.height;\n\t\t\t\n\t\t\t// Gets the current size\n\t\t\tint currentHeight = this.getHeight();\n\t\t\tint currentWidth = this.getWidth();\n\t\t\t\n\t\t\t// Makes a pack() to get the minimum required size\n\t\t\tthis.pack();\n\t\t\t\n\t\t\t// Gets the pack size\n\t\t\tint packHeight = this.getHeight();\n\t\t\tint packWidth = this.getWidth();\n\t\t\t\n\t\t\t// Calculates the ideal height\n\t\t\tif (packHeight > currentHeight) {\n\t\t\t\theight = packHeight;\n\t\t\t} else {\n\t\t\t\theight = currentHeight;\n\t\t\t}\n\t\t\t// Calculates the ideal width\n\t\t\tif (packWidth > currentWidth) {\n\t\t\t\twidth = packWidth;\n\t\t\t} else {\n\t\t\t\twidth = currentWidth;\n\t\t\t}\n\t\t\t\n\t\t\t// It must not be greater than the desktop size\n\t\t\tint desktopHeight = parent.getDesktopPane().getHeight();\n\t\t\tint desktopWidth = parent.getDesktopPane().getWidth();\n\t\t\t\n\t\t\tif (width > desktopWidth){\n\t\t\t\twidth = desktopWidth;\n\t\t\t}\n\t\t\tif (packWidth > desktopWidth){\n\t\t\t\tpackWidth = desktopWidth;\n\t\t\t}\n\t\t\tif (height > desktopHeight){\n\t\t\t\theight = desktopHeight;\n\t\t\t}\n\t\t\tif (packHeight > desktopHeight){\n\t\t\t\tpackHeight = desktopHeight;\n\t\t\t}\n\t\t\t\n\t\t\t// Resizes the window and sets the minimum allowed size\n\t\t\tsize = new Dimension(width, height);\n\t\t\tsetSize(size);\n\t\t\tsetMinimumSize(new Dimension(packWidth, packHeight));\n\t\t}\n\t\treturn size;\n\t}",
"private void initialGame() {\n Display display = this.getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n GameUtils.mWidth = size.x;\n GameUtils.mHeight = size.y;\n GameUtils.frameWidth = (int)(GameUtils.mWidth / 2.5);\n GameUtils.frameHeight = GameUtils.frameWidth;\n GameUtils.dx = GameUtils.mWidth / 120;\n GameUtils.maxVelX = GameUtils.mHeight / 15;\n GameUtils.maxVelY = GameUtils.mHeight / 8;\n\n // Bitmap\n GameUtils.bitmapPika = BitmapFactory.decodeResource(getResources(),\n R.drawable.pika_sprite_8_384);\n GameUtils.bitmapPika = Bitmap.createScaledBitmap(GameUtils.bitmapPika,\n GameUtils.frameWidth * GameUtils.frameCount, GameUtils.frameHeight, false);\n GameUtils.apple = BitmapFactory.decodeResource(getResources(), R.drawable.apple);\n GameUtils.banana = BitmapFactory.decodeResource(getResources(), R.drawable.banana);\n GameUtils.coke = BitmapFactory.decodeResource(getResources(), R.drawable.coke);\n\n GameUtils.bitmapRestart = BitmapFactory.decodeResource(getResources(), R.drawable.restart);\n GameUtils.bitmapRestart = Bitmap.createScaledBitmap(GameUtils.bitmapRestart,\n GameUtils.mWidth / 12, GameUtils.mWidth / 12, false);\n GameUtils.bitmapPause = BitmapFactory.decodeResource(getResources(), R.drawable.pause);\n GameUtils.bitmapPause = Bitmap.createScaledBitmap(GameUtils.bitmapPause,\n GameUtils.mWidth / 15, GameUtils.mWidth / 15, false);\n\n // Game Data\n GameUtils.WIN = true;\n GameUtils.score = 0;\n GameUtils.apples = 0;\n GameUtils.bananas = 0;\n GameUtils.cokes = 0;\n GameUtils.jumps = 0;\n GameUtils.totalSec = GameUtils.totalTime;\n GameUtils.visibleFruit = 0;\n }",
"public int getDisplayHeight()\n {\n if ( amiga.isPAL() ) {\n return isInterlaced() ? 512 : 256;\n }\n return isInterlaced() ? 400 : 200;\n }",
"public void settings() {\r\n\t\tthis.size(PlayGame.WIDTH,PlayGame.HEIGHT);\r\n\t}",
"public void setScale() {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n scaleAffine();\n Scalebar.putZoomLevelDistances();\n\n //Set up the JFrame using the monitors resolution.\n setSize(screenSize); //screenSize\n setPreferredSize(new Dimension(800, 600)); //screenSize\n setExtendedState(Frame.NORMAL); //Frame.MAXIMIZED_BOTH\n }",
"public static double getRawDisplayHeight() {\n\t\treturn javafx.stage.Screen.getPrimary().getBounds().getHeight();\n\t}",
"public static double getDisplayHeight() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getHeight();\n\t}",
"public int getGameSize() {\r\n\t\treturn this.gameSize;\r\n\t}",
"public static int[] setup()\r\n\t{\r\n\t\tint[] size = new int[2];\r\n\t\tGraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();\r\n\t\tint width = gd.getDisplayMode().getWidth();\r\n\t\tint length = gd.getDisplayMode().getHeight();\r\n\t\tsize[0] = width;\r\n\t\tsize[1] = length;\r\n\t\treturn size;\r\n\t}",
"@Override\n public void start(Stage primaryStage) {\n// if (screenWidth >= 414) {\n// screenWidth = 414;\n// }\n// if (screenHeight >= 736) {\n// screenHeight = 736;\n// }//preset stage/scene size\n\n //System.out.println(Integer.toString(screenWidth) + Integer.toString(screenHeight));\n System.out.print(\"Default:\");\n gameController = new GameController(1, 4);//default player and map size\n// gameController.newMapPane();//preload a Map Pane\n\n ScreenController mainContainer = new ScreenController();\n mainContainer.loadScreen(GroupGame.homeScreenID, GroupGame.homeScreenFile);\n mainContainer.loadScreen(GroupGame.newOptionID, GroupGame.newOptionFile);\n mainContainer.loadScreen(GroupGame.createPlayerID, GroupGame.createPlayerFile);\n mainContainer.loadScreen(GroupGame.MapScreenID, GroupGame.MapScreenFile);\n mainContainer.setScreen(GroupGame.homeScreenID);\n\n Group root = new Group();\n root.getChildren().addAll(mainContainer);\n Scene scene = new Scene(root);\n primaryStage.setScene(scene);\n primaryStage.show();\n }",
"public abstract int getDisplayHeight();",
"public static double getDisplayDpi() {\n\t\treturn javafx.stage.Screen.getPrimary().getDpi();\n\t}",
"public int[] getScreenSize() {\n Object[] size = screenSizeImpl();\n return new int[] {\n ((Number)size[0]).intValue(),\n ((Number)size[1]).intValue(),\n };\n }",
"public Point getScreenSize(Activity activity) {\n Display display = activity.getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n\n return size;\n }",
"@Override\n\tpublic void resize(int arg0, int arg1) {\n\t\t\n\t\t\n\t\t\n\t\tif (getScreen() == null)\n\t\t{\n\t\t\tSCREEN_WIDTH = arg0;\n\t \tSCREEN_HEIGHT = arg1;\n\t \t\n\t \tfloat w = 800, h = 550;\n\t \tif (SCREEN_WIDTH * h < SCREEN_HEIGHT * w)\n\t \t\tRATIO = (float)SCREEN_WIDTH / (float)w;\n\t \telse\n\t \t\tRATIO = (float)SCREEN_HEIGHT / (float)h;\n\t \t\n\t \tGdx.app.log(\"RATIO\", \"\"+RATIO);\n\t\t\tsetScreen(getLoadingScreen(DESTINATION.START,DESTINATION.NO));\n\t \t//setScreen(getStartScreen());\n\t\t}\n\t\telse\n\t\t\tthis.getScreen().resize(arg0, arg1);\n\t}",
"public void display_game_screen() {\n\n myScreen.screenMode = myScreen.DISPLAY_GAME_SCREEN;\n\n pushMatrix();\n\n calc_screen_translation();\n\n imageMode(CORNER);\n image(backgroundImage, 0, 0);\n\n // draw_grid();\n\n draw_game_assets();\n\n pacman.update(isPacmanUp, isPacmanDown, isPacmanLeft, isPacmanRight);\n ghost.update(isGhostUp, isGhostDown, isGhostLeft, isGhostRight);\n\n pacman.display();\n ghost.display();\n\n score.run(pacman.xTile, pacman.yTile, ghost.xTile, ghost.yTile);\n\n popMatrix();\n }",
"public int getScreenHeight() {\n return this.screenHeight;\n }",
"public boolean isOnscreen( )\r\n {\r\n if ( this.transform.tx( ) + this.width( ) < 0.0f ) return false;\r\n if ( this.transform.tx( ) > SkyDiver.WindowWidth ) return false;\r\n if ( this.transform.ty( ) + this.height( ) < 0.0f ) return false;\r\n if ( this.transform.ty( ) > SkyDiver.WindowHeight ) return false;\r\n\r\n return true;\r\n }",
"@Override\r\n\tpublic int getGameInitialHeight() {\n\t\treturn 240;\r\n\t}",
"double transformXScreenLengthToWorld(final double screen);",
"public Game(){\n\t\tDimension size = new Dimension(width * scale, height * scale);\n\t\tsetPreferredSize(size);\n\t\t\n\t\tscreen = new Screen(width, height);//instantiated the new screen\n\t\t\n\t\tframe = new JFrame();\n\t\t\n\t}",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tGdx.app.log(\"GameScreen\", \"resizing\");\n\t}",
"@Override\n\tpublic float getPrefWidth() {\n\t\treturn windowSize * 1.2f;\n\t}",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tGdx.app.log(\"GameScreen\", \"Resizing\");\n\t}",
"public int getWidth() {\r\n return Display.getWidth();\r\n }",
"public abstract float doLandscapeLayout(float screenWidth, float screenHeight);",
"@Override\n\tpublic Dimension getPreferredSize(){\n\t\treturn new Dimension(640, 480);\n\t}",
"@Override\n\tpublic void render() {\n\t\tthis.w=this.width;\n\t\tthis.h=this.height;\n\t\tif(Gdx.graphics.getWidth()<400){\n\t\t\tthis.w=this.width*1.5f;\n\t\t\tthis.h=this.height*1.5f;\n\t\t}\n\t\telse if(Gdx.graphics.getWidth()>=400 && Gdx.graphics.getWidth()<480){\n\t\t\tthis.w=this.width*1.35f;\n\t\t\tthis.h=this.height*1.35f;\n\t\t}\n\t\telse if(Gdx.graphics.getWidth()>600 && Gdx.graphics.getWidth()<=800){\n\t\t\tthis.w=this.width/1.75f;\n\t\t\tthis.h=this.height/1.75f;\n\t\t}\n\t\telse if(Gdx.graphics.getWidth()>800 && Gdx.graphics.getWidth()<1100){\n\t\t\tthis.w=this.width/2f;\n\t\t\tthis.h=this.height/2f;\n\t\t}\n\t\t\n\t\telse if(Gdx.graphics.getWidth()>1100){\n\t\t\tthis.w=this.width/2.5f;\n\t\t\tthis.h=this.height/2.5f;\n\t\t}\n\t\tif(!isShow)\n\t\t\treturn;\n\t\tif(font != null){\n\t\t\tfont.setScale(w, h);\n//\t\t\tfont.draw(GlobalVars.ge.getScreen().getBatch(), text, x, y);\n//\t\t\tfont.drawMultiLine(GlobalVars.ge.getScreen().getBatch(),text, x, y, this.areaWidth, this.hAlignment);\n\t\t\tfont.drawWrapped(GlobalVars.ge.getScreen().getBatch(),text, x, y, this.areaWidth, this.hAlignment);\n\t\t}\n\t}",
"public WinScreen()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(1500, 500, 1); \r\n\r\n prepare();\r\n }",
"private Rectangle getControllerScreenPosition(){\n \t \t\n\t \tProperties props = getAppSettings();\n\t \t\n\t\tDimension2D oDim = Toolkit.getDefaultToolkit().getScreenSize();\t\n\t\n\t\tString x1 = props.getProperty(PREFIX+DSC_WIN_X);\n\t\tString y1 = props.getProperty(PREFIX+DSC_WIN_Y);\n\t\tString w1 = props.getProperty(PREFIX+DSC_WIN_W);\n\t\tString h1 = props.getProperty(PREFIX+DSC_WIN_H);\n\t\t\n\t\tint x2 = x1 != null && x1.length()>0 ? Integer.valueOf(x1).intValue() : 0;\t\t\n\t\tint y2 = y1 != null && y1.length()>0 ? Integer.valueOf(y1).intValue() : 0;\n\t\tint w2 = w1 != null && w1.length()>0 ? Integer.valueOf(w1).intValue() : (int)oDim.getWidth()*43/64;\n\t\tint h2 = h1 != null && h1.length()>0 ? Integer.valueOf(h1).intValue() : (int)oDim.getHeight()*45/64;\n\t\t\n\t \tRectangle rec = new Rectangle(x2, y2, w2, h2);\n\t \t \t\n\t \tAppLogger.debug2(\"net.sourceforge.dscsim.gui.AppFrame \" + rec.toString());\n\t \treturn rec;\n\n }",
"@Override\n protected void appSize(int width, int height, Bitmap.Config config) {\n // Do nothing if already set.\n if (width == screenWidth && height == screenHeight && config == screenConfig)\n return;\n \n screenWidth = width;\n screenHeight = height;\n screenConfig = config;\n \n if (eyeCandy != null)\n eyeCandy.setConfiguration(screenWidth, screenHeight, screenConfig);\n }",
"public int getHeight() {\r\n return Display.getHeight();\r\n }",
"public Dimension getPreferredSize() {\n Dimension size = super.getPreferredSize();\n size.width += extraWindowWidth;\n return size;\n }",
"public int getWindowsSize() {\n return this.SVBEngine.getWindowsSize();\n }",
"private boolean isScreenFull(){\n for(int i = 0; i < mPixelX.length; i++){\n if(i % 10 == 0 && mPixelX[i] == 0){\n return false;\n }\n }\n for(int i = 0; i < mPixelY.length; i++){\n if(i % 10 == 0 && mPixelY[i] == 0){\n return false;\n }\n }\n return true;\n }",
"Point onScreen();",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(640, 600);\n\t}",
"public void updateRenderRect() {\n int i = 0;\n if (this.mTargetRatio == 2) {\n this.mTx = this.mRenderWidth == 0 ? 0 : (this.mRenderOffsetX * this.mSurfaceWidth) / this.mRenderWidth;\n int i2 = (this.mSurfaceHeight - this.mSurfaceWidth) / 2;\n if (this.mRenderHeight != 0) {\n i = (this.mRenderOffsetY * this.mSurfaceHeight) / this.mRenderHeight;\n }\n this.mTy = i2 + i;\n this.mTwidth = this.mSurfaceWidth;\n this.mTheight = this.mSurfaceWidth;\n this.mRenderLayoutRect.set(this.mRenderOffsetX, ((this.mRenderHeight - this.mRenderWidth) / 2) + this.mRenderOffsetY, this.mRenderWidth + this.mRenderOffsetX, ((this.mRenderHeight - this.mRenderWidth) / 2) + this.mRenderOffsetY + this.mRenderWidth);\n return;\n }\n this.mTx = this.mRenderWidth == 0 ? 0 : (this.mRenderOffsetX * this.mSurfaceWidth) / this.mRenderWidth;\n this.mTy = this.mRenderHeight == 0 ? 0 : (this.mRenderOffsetY * this.mSurfaceHeight) / this.mRenderHeight;\n this.mTwidth = this.mSurfaceWidth;\n this.mTheight = this.mSurfaceHeight;\n this.mRenderLayoutRect.set(0, 0, this.mRenderWidth, this.mRenderHeight);\n }",
"public Rect getScreenRect() {\n return this.mScreenRect;\n }",
"short getPaperSize();"
]
| [
"0.7126162",
"0.7043223",
"0.69917434",
"0.6886005",
"0.6886005",
"0.6769122",
"0.6718933",
"0.6608191",
"0.66016966",
"0.6593125",
"0.65487653",
"0.65180427",
"0.6508244",
"0.6508244",
"0.6508055",
"0.6504594",
"0.6465093",
"0.6450315",
"0.64375854",
"0.6350111",
"0.63162893",
"0.63153565",
"0.6310438",
"0.630974",
"0.62813985",
"0.62709135",
"0.62499094",
"0.62464005",
"0.6222156",
"0.61973464",
"0.6177967",
"0.61773753",
"0.61498654",
"0.61278033",
"0.61048687",
"0.609887",
"0.60871804",
"0.60696",
"0.605922",
"0.6039012",
"0.6025053",
"0.60248923",
"0.6020766",
"0.60144585",
"0.6008133",
"0.6006644",
"0.5999982",
"0.5989862",
"0.59889406",
"0.5985781",
"0.5974017",
"0.5966601",
"0.59635454",
"0.59579533",
"0.59561914",
"0.5955648",
"0.59462035",
"0.5924324",
"0.5918446",
"0.5917647",
"0.59090084",
"0.5883959",
"0.5860167",
"0.5849296",
"0.5843308",
"0.5836743",
"0.5833555",
"0.5832692",
"0.5811744",
"0.5805881",
"0.58053875",
"0.579936",
"0.5793342",
"0.57825994",
"0.57800347",
"0.5757616",
"0.57567716",
"0.5755815",
"0.5725252",
"0.57196856",
"0.57158095",
"0.5714805",
"0.5711857",
"0.5710373",
"0.5702884",
"0.5694709",
"0.5688678",
"0.5675103",
"0.56551194",
"0.5644173",
"0.56366855",
"0.56354326",
"0.5632169",
"0.56205946",
"0.56144077",
"0.56140906",
"0.5607944",
"0.5606592",
"0.55961955",
"0.5594445"
]
| 0.575608 | 77 |
TODO Autogenerated method stub | public S3Object createS3Object(Bucket bucket, String key,
CanonicalUser owner) throws IOException {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public S3Object load(String bucket, String key) throws S3Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void store(S3Object s3Object) throws S3Exception {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void remove(S3Object s3Object) throws S3Exception {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void setS3ObjectDao(S3ObjectDao s3ObjectDao) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public Bucket createBucket(String name, CanonicalUser owner)
throws IOException {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public Bucket loadBucket(String name) throws S3Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void storeBucket(Bucket bucket) throws S3Exception {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void deleteBucket(Bucket bucket) throws IOException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public List<Bucket> findBuckets(String username) throws IOException {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public String listKeys(Bucket bucket, String prefix, String marker,
String delimiter, int maxKeys) throws S3Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public void setBucketDao(BucketDao bucketDao) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
Get the value of nom | public String getNom() {
return nom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getNume();",
"java.lang.String getNume();",
"public String getNom() {\r\n\t\treturn nom;\r\n\t}",
"public String getNom() {\r\n\t\treturn nom;\r\n\t}",
"public String getNom() {\r\n return nom;\r\n }",
"public String getNom() {\n\t\treturn nom;\n\t}",
"public String getNom() {\n\t\treturn nom;\n\t}",
"public String getNom() {\r\n return nom;\r\n }",
"public String getnom ()\n {\n return nom_et;\n }",
"public String getNom() {\n\t\treturn this.nom;\r\n\t\t}",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom () {\n return nom;\n }",
"public String getNom() {\n\treturn this.nom;\n }",
"public String getNom() {\n\treturn this.nom;\n }",
"public String getNom() {\n\t\treturn this.nom;\n\t}",
"public String getNom() {\n\t\treturn this.nom;\n\t}",
"public String getNom() {\n\t\treturn this.nom;\n\t}",
"public String getNom(){\n\t\treturn this.nom;\n\t}",
"java.lang.String getNum2();",
"java.lang.String getNum1();",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn nom;\r\n\t}",
"@Override\n public String getNom() {\n return nom;\n }",
"java.lang.String getN();",
"public String getNem() {\n return nem;\n }",
"public String annaNimi()\n\t{\n\t\treturn this.nimi;\n\t}",
"public String getNom() {\n\t\treturn null;\r\n\t}",
"public int getNmi(){\n return nmi;\n }",
"public int getNickel () {\n return NNickel;\n }",
"public String getNom();",
"public String getMiNo() {\r\n return miNo;\r\n }",
"public String getNomor() {\n return this.nomor;\n }",
"public String getNum() {\r\n return num;\r\n }",
"public static String getfNam() {\r\n return fNam;\r\n }",
"public String getNum() {\n return num;\n }",
"public String getNum() {\n return num;\n }",
"public String getNit() {\n return nit;\n }",
"Integer getNLNDreu();",
"public String nomAttribut(final Element refAttribut) {\n return(refAttribut.getAttribute(\"nom\"));\n }",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"public String getNomcheflieu() {\n return (String) getAttributeInternal(NOMCHEFLIEU);\n }",
"java.lang.String getNumb();",
"public String getNtnNo() {\n return (String)getAttributeInternal(NTNNO);\n }",
"@Override\n\tpublic String getNom() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic int getNam() {\n\t\treturn _keHoachKiemDemNuoc.getNam();\n\t}",
"String getVal();",
"public java.lang.String getNume() {\n java.lang.Object ref = nume_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nume_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getNume() {\n java.lang.Object ref = nume_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nume_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String getPraNom() {\n\t\treturn praNom;\n\t}",
"public String getSupMobil() {\n return supMobil;\n }",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"public static String getNum() {\n\tString num;\n\tnum = gameNum.getText();\n\treturn num;\n\n }",
"public String getOutputNominalValues(int pos){\r\n\t\treturn nominalValues[1][pos];\r\n\t}",
"public String getNaam() {\n return naam;\n }",
"public java.lang.String getNume() {\n java.lang.Object ref = nume_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nume_ = s;\n return s;\n }\n }",
"public java.lang.String getNume() {\n java.lang.Object ref = nume_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nume_ = s;\n return s;\n }\n }",
"public int getNum();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"java.lang.String getValue();",
"Num\t\tgetNumValue();",
"public String getNaam() {\n\t\treturn naam;\n\t}",
"String getUltimoNome();",
"public String getInputNominalValues(int pos){\r\n\t\treturn nominalValues[0][pos];\r\n\t}",
"public String getHuman() { \n\t\treturn getHumanElement().getValue();\n\t}",
"String value();",
"String value();",
"public String getValueNm() {\n return this.valueNm;\n }",
"private String formulerMonNom() {\n\t return \"Je m'appelle \" + this.nom; // appel de la propriété nom\n\t }",
"public String obtenirNomItem() {\n\t\treturn this.nomItem;\n\t}",
"public int getNiveau() {\r\n return niveau;\r\n }",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();",
"public String getValue();"
]
| [
"0.72802526",
"0.72802526",
"0.7135556",
"0.7135556",
"0.7090904",
"0.70903575",
"0.70903575",
"0.70809186",
"0.7029342",
"0.6999358",
"0.699174",
"0.699174",
"0.699174",
"0.699174",
"0.699174",
"0.699174",
"0.699174",
"0.69704884",
"0.689079",
"0.689079",
"0.68760127",
"0.68760127",
"0.68760127",
"0.6870461",
"0.6800247",
"0.67982507",
"0.67541474",
"0.67152166",
"0.67080265",
"0.66772777",
"0.6611204",
"0.6524442",
"0.65144414",
"0.6439406",
"0.64080566",
"0.6377612",
"0.63701886",
"0.63697207",
"0.63372314",
"0.632674",
"0.632674",
"0.63216496",
"0.6311999",
"0.626509",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.62425935",
"0.6218922",
"0.619764",
"0.6184847",
"0.61207414",
"0.6117019",
"0.61064196",
"0.6106151",
"0.6106151",
"0.6098894",
"0.6091315",
"0.60882103",
"0.60882103",
"0.60882103",
"0.6074182",
"0.6045644",
"0.603097",
"0.60273993",
"0.60273993",
"0.599582",
"0.59884673",
"0.59884673",
"0.59884673",
"0.59884673",
"0.59884673",
"0.59884673",
"0.59797883",
"0.5974255",
"0.59660983",
"0.5963568",
"0.595652",
"0.5954367",
"0.5954367",
"0.5938821",
"0.593715",
"0.5936635",
"0.5927862",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086",
"0.59267086"
]
| 0.7095469 | 5 |
Set the value of nom | public void setNom(String nom) {
this.nom = nom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNom(String p_onom);",
"public void setNom(String nom){\n this.nom = nom;\n }",
"public void setNom(String nom) {\r\n this.nom = nom;\r\n }",
"@Override\n public void setNom(String nom) {\n this.nom = nom;\n }",
"public void setNom(String nom) {\n this.nom = nom;\n }",
"public void setNom(final String nom) {\n\t\tthis.nom = nom;\n\t}",
"public void setNom(String nom) {\n\t\tthis.nom=nom;\n\t}",
"public void setNom(String nom) {\r\n\t\tthis.nom = nom;\r\n\t}",
"public void setNom(String nom) {\n\t\tthis.nom = nom;\n\t}",
"public void setNom(String nom) {\n\t\tthis.nom = nom;\n\t}",
"public void setNom(String nouveauNom) {\r\n if (nouveauNom == null) {\r\n nom = NOM_BIDON;\r\n \r\n } else {\r\n nom = nouveauNom;\r\n }\r\n }",
"public void setNom ( String nouveauNom ) {\n if ( nouveauNom == null ) {\n nom = NOM_BIDON;\n } else {\n nom = nouveauNom;\n }\n }",
"public void setNomor(String nomor) {\n this.nomor = nomor;\n }",
"@Override\n\tpublic void setNom(String nom) throws NomVideException {\n\t\tif (NomVideException.estVide(nom)) {\n\t\t\tthrow new NomVideException();\n\t\t}\n\t\tthis.nom = nom;\n\t}",
"public void setNmi(int nmi){\n this.nmi=nmi;\n }",
"public void setNombres(String nombres);",
"public void setNombre(String nom) {\n this.nombre = nom;\n }",
"public void setNama() {\n nama.postValue(\"Hello, Riyanto!\");\n }",
"public void setNombres(String nombres) { this.nombres = nombres; }",
"public void setNombres(String p) { this.nombres = p; }",
"public void setNomDistrito(String nomDistrito);",
"public void setName (String n){\n\t\tname = n;\n\t}",
"public void setName(String n){ name=n; }",
"public static void setName(String n){\n\t\tname = n;\n\t}",
"public void setNtnNo(String value) {\n setAttributeInternal(NTNNO, value);\n }",
"public void setNomcheflieu(String value) {\n setAttributeInternal(NOMCHEFLIEU, value);\n }",
"void setNome(String nome);",
"public void setKoernerImMaul(int n)\n {\n koernerImMaul=n;\n }",
"private void setNN(int NN) {\n\t\tCMN.NN = NN;\n\t}",
"public String getNom() {\r\n\t\treturn nom;\r\n\t}",
"public String getNom() {\r\n\t\treturn nom;\r\n\t}",
"public Builder setNume(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n nume_ = value;\n onChanged();\n return this;\n }",
"public Builder setNume(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n nume_ = value;\n onChanged();\n return this;\n }",
"public String getNom() {\r\n return nom;\r\n }",
"public String getNom() {\r\n return nom;\r\n }",
"public void setValue(int n) {\n\t\t\tthis.value = n;\n\t}",
"public String getNom() {\r\n return nom;\r\n }",
"public String getNom() {\r\n return nom;\r\n }",
"public Builder setN(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n n_ = value;\n onChanged();\n return this;\n }",
"public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }",
"public String getNom() {\n\t\treturn nom;\n\t}",
"public String getNom() {\n\t\treturn nom;\n\t}",
"@Override\n\tpublic void setNam(int nam) {\n\t\t_keHoachKiemDemNuoc.setNam(nam);\n\t}",
"public void setName (String n) {\n name = n;\n }",
"public void setNumero(int numero) { this.numero = numero; }",
"public void setNum(int num) {\r\n this.num = num;\r\n }",
"private void affTourJoueur(String nomJoueur) {\r\n\t\tlbl_tour.setText(nomJoueur);\r\n\t}",
"public void setName(String n) {\r\n name = n;\r\n }",
"public void setPlantillaAssociada(String nom) {\n\t\tp = CtrlPlantilla.consultarPlantilla(nom);\n\t\tpl = nom;\n\t}",
"public void setDni(String dni);",
"public void setGegenkontoNummer(String kontonummer) throws RemoteException;",
"public Builder setN(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n n_ = value;\n onChanged();\n return this;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public String getNom() {\n return nom;\n }",
"public void setName(String nm){\n\t\tname = nm;\n\t}",
"public void setNomcommune(String value) {\n setAttributeInternal(NOMCOMMUNE, value);\n }",
"public void setNomProvincia(String nomProvincia);",
"public abstract void setMontant(Double unMontant);",
"public void setValueNm(String valueNm) {\n this.valueNm = valueNm;\n }",
"public void setArticleNo(String value) {\n setAttributeInternal(ARTICLENO, value);\n }",
"public void setArticleNo(String value) {\n setAttributeInternal(ARTICLENO, value);\n }",
"public void setName(String n);",
"void setNama(String nama) {\r\n\tthis.nama = nama;\r\n }",
"public void setNomregion(String value) {\n setAttributeInternal(NOMREGION, value);\n }",
"public void setNoms(){\r\n\t\tDSElement<Verbum> w = tempWords.first;\r\n\t\tint count = tempWords.size(); // failsafe counter\r\n\t\twhile(count > 0){\r\n\t\t\tGetNom(w.getItem());\r\n\t\t\t//System.out.println(w.getItem().nom);\r\n\t\t\tw = w.getNext();\r\n\t\t\tif(w == null)\r\n\t\t\t\tw = tempWords.first;\r\n\t\t\tcount--;\r\n\t\t}\r\n\t}",
"private String formulerMonNom() {\n\t return \"Je m'appelle \" + this.nom; // appel de la propriété nom\n\t }",
"public void setNomorRekamMedis(String nomorRekamMedis) {\r\n //pengecekan panjang karakter variabel nomorRekamMedis harus sama dengan 16\r\n //if (nomorRekamMedis.length() == 16) {\r\n //nilai variabel nomorRekamMedis sama dengan NIK\r\n this.nomorRekamMedis = nomorRekamMedis;\r\n // } else {\r\n //pesan jika bernilai false\r\n // throw new Exception(\"Nomor Rekam Medis terdiri dari 16 karakter \");\r\n // }\r\n }",
"public void setName(String n) {\r\n\t\tthis.name = n;\r\n\t}",
"public void setNummer(int n) {\n\t\tint alteNummer = this.nummer; //this-Ref nicht unbedingt nötig!\n\t\tthis.nummer = n;\n\t\tif (!validateNummer()) { // wenn neue Nummer ist nicht gueltig\n\t\t\tthis.nummer = alteNummer;\n\t\t}\n\t}",
"public String getNom () {\n return nom;\n }",
"public void registriereNummer (int nr) {\n this.nr = nr;\n }",
"@Override\n\tpublic void setMontant(double s) {\n\t\t\n\t}",
"public void setNombre(String nombre)\r\n/* 118: */ {\r\n/* 119:214 */ this.nombre = nombre;\r\n/* 120: */ }",
"public void setNumero(int numero) {\n this.dado1 = numero;\n }",
"public void setNombre(String nombre)\r\n/* 65: */ {\r\n/* 66: 76 */ this.nombre = nombre;\r\n/* 67: */ }",
"public void setNumeroInicial(int numeroInicial)\r\n/* 185: */ {\r\n/* 186:198 */ this.numeroInicial = numeroInicial;\r\n/* 187: */ }",
"public void setNumer(int numer)\n\t{\n\t\tthis.numer = numer;\n\t}",
"public void setNumber(String newValue);",
"@Override\n public String getNom() {\n return nom;\n }",
"public void setName(String name)\r\n\t{\r\n\t\tthis.nome = nome;\r\n\t}",
"public void setNX(int nx){\n newX=nx;\n }",
"public void setAnio(int p) { this.anio = p; }",
"void setNama(String nama){\n this.nama = nama;\n }",
"void setAnzahlVerkauft(String anzahlVerkauft);",
"public void setNombre(String nombre) {// ---> SE DEBE PONER EN EL PARAMETRO EL MISMO NOMBRE DEL ATRIBUTO DECLARADO.\r\n\t\tthis.nombre = nombre;\r\n\t}",
"public void setNode_1(String node_1);",
"public final void setNum_emp(String val) {\n setString(getNum_empAttribute(getMtDatabase()), val);\n }",
"public void setName(String n) {\n this.name = n;\n }",
"public void setNode_5(String node_5);",
"public boolean setInputNominalValue(InstanceAttributes instAttributes, int pos, String value){\r\n\t\tAttribute at = (Attribute)instAttributes.getInputAttribute(pos);\r\n\t\tif (at.getType() != Attribute.NOMINAL) return false;\r\n\t\telse{\r\n\t\t\tif (at.convertNominalValue(value) != -1){\r\n\t\t\t\tnominalValues[0][pos] = value;\r\n\t\t\t\tintNominalValues[0][pos] = at.convertNominalValue(value);\r\n\t\t\t\trealValues[0][pos] = intNominalValues[0][pos];\r\n\t\t\t\tmissingValues[0][pos] = false;\r\n\t\t\t\tanyMissingValue[0] = false;\r\n\t\t\t\tfor (int i=0; i<missingValues[0].length; i++) \r\n\t\t\t\t\tanyMissingValue[0] |= missingValues[0][i];\r\n\t\t\t}\r\n\t\t\telse return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public void setVnom(short value) {\n this.vnom = value;\n }",
"public void setRegno(String regno)\n {\n if(checker.acceptRegno(regno))\n this.regno = regno;\n else\n this.regno = \"\";\n }",
"public void setAnio(int anio){\r\n \r\n \r\n this.anio = anio;\r\n \r\n }",
"public void updateNenNom(Integer id, String nom) {\n\t\t\tEntityManager em = emf.createEntityManager();\n\t\t\tem.getTransaction().begin();\n\t\t\tNen ac = (Nen) em.find(Nen.class, id);\n\t\t\tac.setNom(nom);\n\t\t\tem.merge(ac);\n\t\t\tem.getTransaction().commit();\n\t\t\tem.close();\n\t\t}"
]
| [
"0.7651823",
"0.7467188",
"0.7457903",
"0.7391767",
"0.7290532",
"0.7280689",
"0.7273888",
"0.72537374",
"0.71561533",
"0.71561533",
"0.71042866",
"0.69940984",
"0.69649637",
"0.6909408",
"0.6793833",
"0.6678422",
"0.66086006",
"0.6567521",
"0.6495571",
"0.6467458",
"0.643248",
"0.63916016",
"0.6362677",
"0.6321113",
"0.62597513",
"0.62517464",
"0.6203485",
"0.61964846",
"0.6148088",
"0.61414146",
"0.61414146",
"0.613453",
"0.613453",
"0.61293614",
"0.61293614",
"0.6129324",
"0.61234653",
"0.6121823",
"0.61162484",
"0.610678",
"0.60819894",
"0.60819894",
"0.6081777",
"0.60784876",
"0.607057",
"0.6052269",
"0.60490006",
"0.6042386",
"0.60423625",
"0.6029868",
"0.6007979",
"0.60077316",
"0.6007368",
"0.6007368",
"0.6007368",
"0.6007368",
"0.6007368",
"0.6007368",
"0.6007368",
"0.60062385",
"0.59999025",
"0.5980218",
"0.5974245",
"0.5973158",
"0.59707564",
"0.59707564",
"0.5960998",
"0.59609056",
"0.5955633",
"0.5953866",
"0.5952368",
"0.5945322",
"0.5937014",
"0.5924394",
"0.59238195",
"0.59232605",
"0.5918231",
"0.5913005",
"0.59120035",
"0.5907252",
"0.5901886",
"0.58863133",
"0.58836263",
"0.58834976",
"0.5882001",
"0.5873128",
"0.58670616",
"0.58621776",
"0.5860205",
"0.58348364",
"0.5823935",
"0.58173525",
"0.58078235",
"0.57955235",
"0.5793021",
"0.5786707",
"0.5783201",
"0.5781428",
"0.57810056"
]
| 0.7401597 | 4 |
Get the value of path | public String getPath() {
return path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getPath() {\n\t\treturn getString(\"path\");\n\t}",
"public String getPath() { \n\t\treturn getPathElement().getValue();\n\t}",
"String getPath() {\r\n\t\treturn path;\r\n\t}",
"Path getPath();",
"public String getPath(){\r\n\t\treturn path;\r\n\t}",
"public int path(){\n\t\treturn this.path;\n\t}",
"public String path() {\n return this.path;\n }",
"public String path() {\n return this.path;\n }",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath(){\n\t\t\treturn this.path;\n\t\t}",
"public String getPath() {\n\t\treturn this.path;\n\t}",
"public String path() {\n\treturn path;\n }",
"public final String getPath() {\n\t\treturn this.path.toString();\n\t}",
"public String getPath()\n {\n return path;\n }",
"public String getPath()\n {\n return path;\n }",
"public String getPath() {\n\t\treturn path;\n\t}",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\r\n\t\t\treturn path;\r\n\t\t}",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public final String getPath() {\n\t return m_path;\n\t}",
"String getPath() {\n return path;\n }",
"String getPath();",
"String getPath();",
"String getPath();",
"String getPath();",
"String getPath();",
"public java.lang.String getPath() {\n\t\t return path;\n\t }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n return path;\n }",
"public String getPath() {\n\n\t\treturn this.path;\n\n\t}",
"public String path() {\n return filesystem().pathString(path);\n }",
"String getPath() {\n return this.path;\n }",
"public String getPath()\r\n/* 26: */ {\r\n/* 27:57 */ return this.path;\r\n/* 28: */ }",
"public final String getPath()\n {\n return path;\n }",
"public String getPath()\n {\n\n return _path;\n }",
"public String getPathName()\n {\n return getString(\"PathName\");\n }",
"public Path getPath();",
"public final String path() {\n return string(preparePath(concat(path, SLASH, name)));\n }",
"public String getPath() {\n return m_path;\n }",
"public String getPath();",
"public String getPath();",
"public String getPath();",
"protected String getPath ()\n\t{\n\t\treturn path;\n\t}",
"public Path getPath(){\n return this.path;\n }",
"public String getPathName();",
"public String getPath() {\n return (path == null || path.equals(\"\")) ? \"/\" : path;\n }",
"@Nullable public String getPath() {\n return path;\n }",
"public Path getPath() {\n return this.path;\n }",
"IPath getPath();",
"String getPathName();",
"String getPathName();",
"public Path getPath() {\n return path;\n }",
"public CustomPath getPath() {\n\t\treturn path;\n\t}",
"public java.lang.String getPath(int index) {\n return path_.get(index);\n }",
"String getRealPath(String path);",
"@Override\n\t\tpublic String getRealPath(String path) {\n\t\t\treturn null;\n\t\t}",
"public SoPath getPath() {\n\t\t return path; \n\t}",
"public String getpathInput() {\r\n\t\treturn pathInput;\r\n\t}",
"protected String path() {\n return path(getName());\n }",
"String getPath() {\n return mPath;\n }",
"public File getPath() {\n return this.path;\n }",
"public String getPathname() {return this.pathname;}",
"public java.lang.String getPath(int index) {\n return path_.get(index);\n }",
"public Path getPath() {\n return path;\n }",
"@Nullable String getPath();",
"java.lang.String getFilePath();",
"public String getPropertyPath();",
"public String getPropertyPath();",
"public String toPathString() {\n return path();\n }",
"java.lang.String getXpath();",
"public IPathItem getPath(String path){\r\n return pathsMap.get(path);\r\n }",
"String getValueOfNode(String path)\n throws ProcessingException;"
]
| [
"0.7522736",
"0.7168341",
"0.7117474",
"0.7086261",
"0.7076608",
"0.70653117",
"0.7050919",
"0.7050919",
"0.7041381",
"0.7041381",
"0.7041381",
"0.70411265",
"0.70380306",
"0.703547",
"0.7025151",
"0.7013001",
"0.7013001",
"0.7005383",
"0.70020413",
"0.69947225",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6994353",
"0.6975929",
"0.69752645",
"0.6971403",
"0.6971403",
"0.6971403",
"0.6971403",
"0.6971403",
"0.69449717",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.69365764",
"0.6918784",
"0.6902752",
"0.68974584",
"0.6889278",
"0.6878976",
"0.68609",
"0.6850259",
"0.6847573",
"0.683962",
"0.6811519",
"0.6806978",
"0.6806978",
"0.6806978",
"0.6777757",
"0.67283446",
"0.6726691",
"0.672504",
"0.67014116",
"0.6671907",
"0.6647648",
"0.6633101",
"0.6633101",
"0.65962875",
"0.6591488",
"0.6588084",
"0.6584622",
"0.65744686",
"0.65709454",
"0.65696573",
"0.6566317",
"0.65376157",
"0.6530532",
"0.6523559",
"0.6506124",
"0.65031445",
"0.6496883",
"0.6480763",
"0.647008",
"0.647008",
"0.64636445",
"0.6443583",
"0.64395386",
"0.64379907"
]
| 0.70419407 | 9 |
Set the value of path | public void setPath(String path) {
this.path = path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setPath(String path);",
"public void setPath(String path);",
"public void setPath(String path)\n {\n try\n {\n // Tokenize the path\n pathArray = getPathResolved(path);\n \n // Set path property\n this.path = path;\n }\n catch (NumberFormatException nfe)\n {\n // Reset path property\n this.path = \"\";\n }\n }",
"public void setPath(String path)\r\n/* 21: */ {\r\n/* 22:53 */ this.path = path;\r\n/* 23: */ }",
"public void setPath(String path){\n mPath = path;\n }",
"public void setPath(Path path) {\n this.path = path;\n }",
"public void setPath(String path) {\n if (!path.startsWith(\"/\")) {\n this.path = \"/\" + path;\n } else {\n this.path = path;\n }\n }",
"public free_args setPath(String path) {\n this.path = path;\n return this;\n }",
"void setPath(DrivePath path);",
"public void setPath(String path)\n {\n this.path = path;\n }",
"public void setPath (\r\n String strPath) throws java.io.IOException, com.linar.jintegra.AutomationException;",
"public void setPath(String path) {\n this.path = path;\n }",
"public void changePath(String newPath){\n this.path=newPath;\n }",
"public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}",
"public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}",
"public void setPath(String path) {\r\n\t\tthis.path = path;\r\n\t}",
"public void setPath(java.lang.String path) {\n\t\t this.path = path;\n\t }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(String path) {\n this.path = path;\n }",
"public void setPath(int path){\n\t\tthis.path = path;\n\t}",
"public void setPath(String path) {\n\n this.path = path;\n }",
"public void setPath(File path) {\n this.path = path;\n }",
"public Builder setCurrentPath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n currentPath_ = value;\n onChanged();\n return this;\n }",
"void setFilePath(Path filePath);",
"public void setPath(String path) {\r\n this.path = path == null ? null : path.trim();\r\n }",
"public void setPath(Path path)\n\t{\n\t\tpathList.clear();\n\t\tpathList.add(path);\n\t}",
"public static void setPath(String path) {\n\t\tfilePath = path;\n\t}",
"public void setPath(String path) {\n this.path = path == null ? null : path.trim();\n }",
"public void setPath(String path) {\n this.path = path == null ? null : path.trim();\n }",
"public void setPath(String path) {\n this.path = path == null ? null : path.trim();\n }",
"public void\nsetPath(SoPath path)\n{\n // ref the input path\n if (path != null)\n path.ref();\n\n // nuke the old path\n if (pathOfInterest != null) {\n pathOfInterest.unref();\n pathOfInterest = null;\n }\n // and copy the new path\n if (path != null) {\n pathOfInterest = path.copy();\n pathOfInterest.ref();\n }\n\n // unref the input path\n if (path != null)\n path.unref();\n\n}",
"void setValueOfNode(String path, String value)\n throws ProcessingException;",
"@Override\n public void setPath( final Path path ) {\n throw new RuntimeException( \"Not yet implemented.\" );\n }",
"public void setPath(String newPath) {\n String id = PREF_DEFAULTDIR + getId();\n idv.getStateManager().writePreference(id, newPath);\n }",
"public void set(String path, Object value) {\n yml.set(path, value);\n save();\n }",
"public Builder setPath(final String value) {\n _path = value;\n return self();\n }",
"public void setPath(Tile path) {\n\t\tthis.path = path;\n\t}",
"public HttpBuilder<E,T> setPath (String path)\n\t{\n\t\tthis.path = String.format(path);\n\t\treturn this;\n\t}",
"@Override\n\tpublic void setValue(String path, Object value) {\n\t\tif (path.indexOf('.') >= 0 || path.indexOf('(') >= 0 ) {\n\t\t\tFlexDataAccess access = new FlexDataAccess(this, path, true);\n\t\t\taccess.setToPath(value);\n\t\t} else {\n\t\t\tsetValueMap(path, value);\n\t\t}\n\t}",
"public void setSystemPath(String path) {\r\n\t\ttry {\r\n\t\t\tPaths.get(path);\r\n\t\t} catch (InvalidPathException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tthis.settings.setProperty(\"systemPath\", path);\r\n\t\tthis.saveChanges();\r\n\t}",
"Config set(String path, Object value);",
"public void setPath(Position[] path) {\n\t\tif(path != null)\n\t\t\tthis.path = path;\n\t}",
"public void setPath(Path inputPath) {\n path = inputPath;\n node = path.getNodes().getFirst();\n }",
"public void setFullPath( String path )\n {\n if( file != null )\n {\n throw new RuntimeException( \"The path has already been set for this object.\" );\n }\n\n // Parse out multiple directories as needed.\n StringTokenizer st = new StringTokenizer( path, \"/\\\\\" );\n\n String current = st.nextToken();\n while( st.hasMoreTokens() )\n {\n this.parent = new FileIndex( this.parent, current );\n current = st.nextToken();\n }\n\n this.file = current;\n\n // Cache our full path\n if( parent == null )\n fullPath = this.file;\n else\n fullPath = parent.getFullPath() + \"/\" + this.file;\n }",
"@Override\n void setPath(String sessionId, String path) {\n if (sessionsInfoManager.getPath(sessionId).isEmpty())\n {\n sessionsInfoManager.setPath(sessionId, path);\n }\n }",
"public void setPathname(String s) {this.pathname = s;}",
"public completeFile_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public setAttribute_args setPath(String path) {\n this.path = path;\n return this;\n }",
"private void setFileNamePath(String value) {\n\t\tthis.fileNamePath = value;\n\t}",
"public final native void setPath(JsArray<LatLng> value) /*-{\n\t\tthis.setPath(value);\n\t}-*/;",
"private void setAssetPath(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n assetPath_ = value;\n }",
"public getStatus_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public void initPath() {\r\n\t\tpath = new Path();\r\n\t}",
"void path(String path);",
"void path(String path);",
"public void setRing(String path);",
"@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }",
"@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }",
"@JsonProperty(\"path\")\n public void setPath(String path) {\n this.path = path;\n }",
"public void updatePathAndFile(String path, String file){\r\n\t\tthis.path = path;\r\n\t\tthis.file = file;\r\n\t}",
"public static void setPathCache(String pathCache)\r\n/* 50: */ throws IOException\r\n/* 51: */ {\r\n/* 52: 49 */ log.finest(\"OSHandler.setPathCache\");\r\n/* 53: 50 */ setProperty(\"path\", pathCache);\r\n/* 54: */ }",
"public rename_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public Builder setPath(\n int index, java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensurePathIsMutable();\n path_.set(index, value);\n onChanged();\n return this;\n }",
"void setFilePath(String filePath);",
"public synchronized void setValueOfNode(String path, String value)\n throws ProcessingException {\n path = this.createPath(path); // correct path\n\n Node node = DOMUtil.selectSingleNode(data, path, this.xpathProcessor);\n if (node.getNodeType() == Node.ATTRIBUTE_NODE) {\n Attr attr = (Attr)node;\n attr.setNodeValue(value);\n\n } else {\n\n // remove old childs\n while (node.hasChildNodes() == true) {\n node.removeChild(node.getFirstChild());\n }\n\n node.appendChild(node.getOwnerDocument().createTextNode(value));\n }\n }",
"public void setTextPath(String path) {\n this.txf_FilePath.setText(path);\n }",
"public checkConsistency_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public void setFilesPath(File path) {\r\n\t\tfilesPathProperty.set(path);\r\n\t}",
"@Override\n\tpublic void setValue(String path, boolean value) {\n\t\tsetValue(path, new Boolean(value));\n\t}",
"@Override\n\tpublic void setValue(String path, int value) {\n\t\tsetValue(path, new Integer(value));\n\t}",
"public void setPath(String path) {\n // We know that URL arguments should always be encoded in UTF-8 according to spec\n setPath(path, EncoderCache.URL_ARGUMENT_ENCODING);\n }",
"public void setPath(String path) {\n // We know that URL arguments should always be encoded in UTF-8 according to spec\n setPath(path, EncoderCache.URL_ARGUMENT_ENCODING);\n }",
"public void updatePath() {\n\t\tString oldPath = this.path;\n\t\tif (materializePath()) {\n\t\t\tPageAlias.create(this, oldPath);\n\t\t\tupdateChildPaths();\n\t\t}\n\t}",
"public static void setDefaultPath(String path) {\n\t\tPATH = path;\n\t}",
"@Override\n\tpublic void setValue(String path, double value) {\n\t\tsetValue(path, new Double(value));\n\t}",
"public void setsFilePath(String value) {\n sFilePath = value;\n // // initialize these two\n CurrentFile = null;\n CurrentUri = null;\n // // If we have something real, setup the file and the Uri.\n if (!sFilePath.equalsIgnoreCase(\"\")) {\n CurrentFile = new File(sFilePath);\n CurrentUri = Uri.fromFile(CurrentFile);\n }\n }",
"public void setPath(ArrayList<String> newPath) {\n list = newPath;\n }",
"public void setLoadPath(final String p_path) {\n m_path = p_path;\n\n // trim / at the end\n if (m_path.charAt(m_path.length() - 1) == '/') {\n m_path = m_path.substring(0, m_path.length() - 1);\n }\n }",
"public createFile_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public ElementDefinitionDt setPath(StringDt theValue) {\n\t\tmyPath = theValue;\n\t\treturn this;\n\t}",
"public void put(String path, T value) {\n checkNotEmpty(path);\n requireNonNull(value);\n\n List<String> components = pathToComponents(Paths.get(removeAsterisk(path)));\n\n if (path.endsWith(\"/\") || path.endsWith(\"/*\")) {\n // it is a directory\n components.add(\"/\");\n }\n\n T existing = tree.getExactMatch(components);\n if (existing != null) {\n String message = format(\"Path '%s' has already been configured with a ID of [%s]\",\n path, existing.toString());\n throw new DuplicatePathException(message);\n }\n\n tree.addValueWithParents(components, value);\n }",
"public scheduleAsyncPersistence_args setPath(String path) {\n this.path = path;\n return this;\n }",
"void setNode(String path, Node node)\n throws ProcessingException;",
"public setAcl_args setPath(String path) {\n this.path = path;\n return this;\n }",
"public void setImage(String path) {\n\t\tthis.path = path;\n\t\tgetImage().set(new Image(path));\n\t}",
"public URIBuilder setPath(final String path) {\n this.path = path;\n this.encodedSchemeSpecificPart = null;\n this.encodedPath = null;\n return this;\n }",
"void setImagePath(String path);",
"public void set(String path) throws FileNotFoundException {\n counterSeveralLines = linesAfter;\n arrayPreviousLines = new String[prevSize];\n currentPath = path;\n fileReader = new FileReader(currentPath);\n bufferReader = new BufferedReader(fileReader);\n resetDateBefore();\n }",
"public Builder setCurrentPathBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n currentPath_ = value;\n onChanged();\n return this;\n }",
"public void setPath(String fileName) {\n path = fileName;\n }",
"private void setFilePath(\n java.lang.String value) {\n value.getClass();\n bitField0_ |= 0x00000008;\n filePath_ = value;\n }",
"public void setRingback(String path);",
"public Builder setPath(String path) {\n\t\t\turl.path = path == null || path.isEmpty() ? null : path;\n\t\t\treturn this;\n\t\t}"
]
| [
"0.86890864",
"0.8401985",
"0.8377009",
"0.82911885",
"0.7952583",
"0.7931014",
"0.7794656",
"0.7773068",
"0.7668308",
"0.7666933",
"0.76524925",
"0.76487374",
"0.75290155",
"0.7521888",
"0.7521888",
"0.7521888",
"0.7464746",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.74632096",
"0.7433129",
"0.7408505",
"0.737861",
"0.732815",
"0.7305346",
"0.7292242",
"0.72920495",
"0.72521776",
"0.72374606",
"0.72374606",
"0.72374606",
"0.7225451",
"0.72198105",
"0.7194979",
"0.7179947",
"0.71728736",
"0.7161267",
"0.71276265",
"0.71134764",
"0.7104023",
"0.7075955",
"0.70310557",
"0.7006645",
"0.69942427",
"0.6965688",
"0.6961723",
"0.6903951",
"0.68570614",
"0.6856775",
"0.684626",
"0.68153614",
"0.6773735",
"0.6771731",
"0.676823",
"0.67548656",
"0.67548656",
"0.6753509",
"0.67498964",
"0.67498964",
"0.6708302",
"0.66942346",
"0.66932833",
"0.6689751",
"0.66888267",
"0.6679922",
"0.6673944",
"0.6663633",
"0.66561913",
"0.6654201",
"0.6646058",
"0.6616519",
"0.6611114",
"0.6611114",
"0.661077",
"0.66095835",
"0.6607899",
"0.6598671",
"0.659759",
"0.6585871",
"0.65469676",
"0.6527782",
"0.651615",
"0.650387",
"0.6489901",
"0.648981",
"0.64897954",
"0.6485079",
"0.6481491",
"0.64739645",
"0.6470311",
"0.646878",
"0.6466104",
"0.64475226",
"0.64471674"
]
| 0.7608118 | 12 |
open the site (row, col) if it is not open already | public void open(int row, int col) {
if (row < 0 || row > n - 1 || col < 0 || col > n - 1) throw new java.lang.IndexOutOfBoundsException("open():row or col out of bounds");
if (!isOpen(row, col)) {
grid[row][col] = true;
openSites++;
int comp1 = n*row + col;
if (row == 0) myUF.union(comp1, n*n);
if (row == n - 1 ) myUF.union(comp1, n*n + 1);
if (row + 1 < n && grid[row+1][col]) myUF.union(comp1, comp1 + n);
if (row - 1 >= 0 && grid[row-1][col]) myUF.union(comp1, comp1 - n);
if (col + 1 < n && grid[row][col+1]) myUF.union(comp1, comp1 + 1);
if (col - 1 >= 0 && grid[row][col-1]) myUF.union(comp1, comp1 - 1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void open(int row, int col) {\n if (grid[row][col] == 0) {\n grid[row][col] = 1;\n openSites++;\n if (row == 0) {\n grid[row][col] = 2;\n fill(row,col);\n }\n if (row > 0 && grid[row - 1][col] > 0) {\n // wqu.union(ID[row - 1][col], ID[row][col]);\n if (isFull(row - 1, col))\n fill(row-1,col);\n }\n if (row < grid.length - 1 && grid[row + 1][col] > 0) {\n // wqu.union(ID[row + 1][col], ID[row][col]);\n if (isFull(row + 1, col))\n fill(row+1,col);\n }\n if (col > 0 && grid[row][col - 1] > 0) {\n // wqu.union(ID[row][col - 1], ID[row][col]);\n if (isFull(row, col - 1))\n fill(row,col-1);\n }\n if (col < grid.length - 1 && grid[row][col + 1] > 0) {\n // wqu.union(ID[row][col + 1], ID[row][col]);\n if (isFull(row, col + 1))\n fill(row,col+1);\n }\n }\n // open the site (row, col) if it is not open already\n }",
"public void open(int row, int col)\n {\n validate(row, col);\n int oneDimensional = xyTo1D(row, col);\n if (grid[oneDimensional]) {\n return;\n }\n grid[oneDimensional] = true;\n connectToOpenNeighbors(oneDimensional);\n connectToVirtualSites(oneDimensional);\n openSites++;\n }",
"public void open (int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n if (isOpen(row, col)) return;\n\n siteStatus[row - 1][col - 1] = true;\n if (row == 1 || row == getSize()) connectWithVirtualSites(row, col);\n connectWithOpenSites(row, col);\n openSites++;\n }",
"public void open(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n if (this.isOpen(row, col))\n return;\n\n // set the site to opened status\n this.status[getElement(row, col)] |= OPENBIT;\n\n // see whether the site is connected to top/bottom row\n byte top = (byte) (this.status[getElement(row, col)] & TOPBIT);\n byte bottom = (byte) (this.status[getElement(row, col)] & BOTTOMBIT);\n int parent = -1;\n\n // see whether the surrounding sites' root is connected to top/bottom row\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n parent = this.uf.find(getElement(row - 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n parent = this.uf.find(getElement(row + 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n parent = this.uf.find(getElement(row, col - 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n parent = this.uf.find(getElement(row, col + 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n\n // connect to each surrounding site\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n this.uf.union(getElement(row, col), getElement(row - 1, col));\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n this.uf.union(getElement(row, col), getElement(row + 1, col));\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n this.uf.union(getElement(row, col), getElement(row, col - 1));\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n this.uf.union(getElement(row, col), getElement(row, col + 1));\n }\n\n // judge whether the root of the site is connected to top/bottom row\n parent = this.uf.find(getElement(row, col));\n this.status[parent] |= (top | bottom);\n\n // if the root is connected to top & bottom, then the whole system is percolated\n if (TOPBIT == (this.status[parent] & TOPBIT) && BOTTOMBIT == (this.status[parent] & BOTTOMBIT))\n this.isPercolated = true;\n }",
"public void open(int row, int col) {\n\n }",
"public void open(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n if(!isOpen(row, col)) {\n numOpen++;\n grid[row][col] = true;\n if(row==1) {\n // Opening a site on top connects it to the virtual top\n UF.union(((row-1)*size + col), top);\n UF2.union(((row-1)*size + col), top);\n }\n if(row==size) {\n // Opening a site on bottom connects it to the virtual bottom\n UF.union(((row-1)*size + col), bottom);\n }\n // Connect the site being opened to all its open neighbours\n if(row-1>=1 && grid[row-1][col]) {\n UF.union(((row-1)*size + col), (((row-1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row-1)-1)*size + col));\n }\n if(row+1<=size && grid[row+1][col]) {\n UF.union(((row-1)*size + col), (((row+1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row+1)-1)*size + col));\n }\n if(col-1>=1 && grid[row][col-1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n }\n if(col+1<=size && grid[row][col+1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n }\n }\n }",
"public void open(int row, int col) {\n if (isOpen(row, col))\n return;\n int index = rowColToIndex(row, col);\n sitesIsOpen[index] = true;\n if (row == 1) {\n sitesUF.union(index, upSiteIndex);\n sidesFullUF.union(index, upSiteIndex);\n }\n\n\n //!this.percolates() this situation is prevent after percolates, every\n //sites open down will be full, but not fix 在下面按了几个后, 另一块区域联通是的,原来的区域 full 了\n if (row == side && !this.percolates())\n sitesUF.union(index, downSiteIndex);\n\n for (int aroundIndex : indexsAround(row, col)) {\n if (sitesIsOpen[aroundIndex]) {\n sitesUF.union(aroundIndex, index);\n sidesFullUF.union(aroundIndex, index);\n }\n }\n\n }",
"public void open(int row, int col){\n\t\tint index= transformInput(row, col);\n\t\tif(openSites[index]){ //returns if already open\n\t\t\treturn;\n\t\t}\n\t\t//set site as opened\n\t\topenSites[index]=true;\n\t\tnumOpen++;\n\t\t\n\t\t//Note if statement will truncate if out of index of array\n\t\tif( index+1 <= row*n && openSites[index+1]){ //right boundary\n\t\t\tgrid.union(index, index+1);\n\t\t}\n\t\tif( index-1 >= (row-1)*n +1 && openSites[index-1]){ //left boundary\n\t\t\tgrid.union(index, index-1);\n\t\t}\n\t\tif( index+n <= n*n && openSites[index+n]){ //bottom boundary\n\t\t\tgrid.union(index, index+n);\n\t\t}\n\t\tif( index-n >= 1 && openSites[index-n]){ //top boundary\n\t\t\tgrid.union(index, index-n);\n\t\t}\n\t}",
"public void open(int row, int col) {\n validate(row, col);\n int thisSite = getThisSite(row, col);\n if (isOpen(row, col)) {\n return;\n }\n openSites += 1;\n openState[thisSite] = true;\n\n// if only one, open is percolate\n if (n == 1) {\n percolates = true;\n return;\n }\n if (row == 1) {\n// first row\n uf.union(vTop, thisSite);\n if (col == 1) {\n// the left top corner\n checkRight(row, col);\n } else if (col == n) {\n// the right top corner\n checkLeft(row, col);\n } else {\n// other in top\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkBottom(row, col);\n } else if (row == n) {\n// last row\n// uf.union(vBottom, );\n bottom[col - 1] = getThisSite(row, col);\n if (col == 1) {\n// the left bottom corner\n checkRight(row, col);\n } else if (col == n) {\n// the right bottom corner\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n } else {\n if (col == 1) {\n// the left col\n checkRight(row, col);\n } else if (col == n) {\n// the right col\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n checkBottom(row, col);\n }\n// how to improve\n if (!percolates) {\n for (int i = 0; i < n; i++) {\n int site = bottom[i];\n int rowx = n;\n int colx = i + 1;\n if (site > 0 && isFull(rowx, colx)) {\n percolates = true;\n }\n }\n }\n }",
"public void open(int row, int col) {\n if (isInBounds(row-1, col-1)) {\n if (isOpen(row, col)) return;\n if (row == 1) {\n mainObject.union(vsite1, coordinateConvertFrom(row, col));\n }\n if (row == size) {\n mainObject.union(vsite2, coordinateConvertFrom(row, col));\n }\n if (isInBounds(row - 1, col) && isOpen(row, col + 1)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row, col + 1));\n }\n if (isInBounds(row - 1, col - 2) && isOpen(row, col - 1)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row, col - 1));\n }\n if (isInBounds(row, col - 1) && isOpen(row + 1, col)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row + 1, col));\n }\n if (isInBounds(row - 2, col - 1) && isOpen(row - 1, col)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row - 1, col));\n }\n grid[row - 1][col - 1] = true;\n numberOfOpenSites++;\n }\n else {\n throw new java.lang.IllegalArgumentException(\"Bad Coordinates\");\n }\n\n }",
"public void open(int row, int col) {\n if (!validateCoordinates(row - 1, col - 1)) {\n throw new IllegalArgumentException(\"invalid (row, col) value provided\");\n }\n\n if (isOpen(row, col)) return;\n\n // 1 --> open site\n grid[row - 1][col - 1] = 1;\n openSitesCount++;\n\n // top neighbour\n if (row > 1 && isOpen(row - 1, col)) {\n performUnion(row, col, row - 1, col);\n }\n\n // right neighbour\n if (col <= gridSize - 1 && isOpen(row, col + 1)) {\n performUnion(row, col, row, col + 1);\n }\n\n // down neighbour\n if (row <= gridSize - 1 && isOpen(row + 1, col)) {\n performUnion(row, col, row + 1, col);\n }\n\n // left neighbour\n if (col > 1 && isOpen(row, col - 1)) {\n performUnion(row, col, row, col - 1);\n }\n\n // connect to virtual top site if newly opened\n // site is in row 1 (top row)\n if (row == 1) {\n int indexP = xyToOneD(row, col);\n wquf.union(indexP, virtualTopSiteIndex);\n wquf2.union(indexP, virtualTopSiteIndex);\n } else if (row == gridSize) {\n int indexP = xyToOneD(row, col);\n wquf2.union(indexP, virtualBottomSiteIndex);\n }\n }",
"public void open(int row, int col){\n validateRowCol(row, col);\n if(grid[row][col]){\n grid[row][col] = false;\n numOpenSites++;\n if(row != 0 && isOpen(row - 1, col)) {\n uf.union(siteNum(row, col), siteNum(row - 1, col));\n tempUF.union(siteNum(row, col), siteNum(row - 1, col));\n }\n if(row != (gridSize-1) && isOpen(row+1, col)) {\n uf.union(siteNum(row, col), siteNum(row + 1, col));\n tempUF.union(siteNum(row, col), siteNum(row + 1, col));\n }\n if(col != 0 && isOpen(row, col-1)) {\n uf.union(siteNum(row, col), siteNum(row, col - 1));\n tempUF.union(siteNum(row, col), siteNum(row, col - 1));\n }\n if(col != (gridSize-1) && isOpen(row, col+1)) {\n uf.union(siteNum(row, col), siteNum(row, col + 1));\n tempUF.union(siteNum(row, col), siteNum(row, col + 1));\n }\n if(row == 0) {\n uf.union(siteNum(row, col), ufSize - 2);\n tempUF.union(siteNum(row, col), ufSize - 2);\n }\n if(row == (gridSize-1))\n uf.union(siteNum(row, col), ufSize - 1);\n\n }\n }",
"public void open(int row, int col) {\n validate(row, col);\n if (!isOpen(row, col)) {\n this.numOfOpenSites += 1;\n }\n grid[row - 1][col - 1] = true;\n int indexOfThisSite = site2index(row, col);\n\n // union adjacent open nodes\n if (row > 1 && isOpen(row - 1, col)) {\n this.uf.union(site2index(row - 1, col), indexOfThisSite);\n this.ufNoBottom.union(site2index(row - 1, col), indexOfThisSite);\n }\n\n if (row < this.n && isOpen(row + 1, col)) {\n this.uf.union(site2index(row + 1, col), indexOfThisSite);\n this.ufNoBottom.union(site2index(row + 1, col), indexOfThisSite);\n }\n\n if (col > 1 && isOpen(row, col - 1)) {\n this.uf.union(site2index(row, col - 1), indexOfThisSite);\n this.ufNoBottom.union(site2index(row, col - 1), indexOfThisSite);\n }\n\n if (col < this.n && isOpen(row, col + 1)) {\n this.uf.union(site2index(row, col + 1), indexOfThisSite);\n this.ufNoBottom.union(site2index(row, col + 1), indexOfThisSite);\n }\n }",
"public void open(int row, int col) {\n if (isOpen(row, col)) {\n return;\n }\n grid[row][col] = true;\n openSites++;\n int p1 = fromXYTo1D(row, col);\n for (int i = 0; i < rowOrder.length; ++i) {\n int newRow = row + rowOrder[i];\n int newCol = col + colOrder[i];\n if (inGrid(newRow, newCol) && isOpen(newRow, newCol)) {\n int p2 = fromXYTo1D(newRow, newCol);\n uf.union(p1, p2);\n }\n }\n }",
"public boolean isOpen(int row, int col){\n\t\tint index= transformInput(row,col);\n\t\treturn openSites[index];\n\t}",
"public void open(int row, int col)\r\n {\r\n if (row < 1 || row > dimension || col < 1 || col > dimension)\r\n throw new IllegalArgumentException(\"error range\");\r\n\r\n if (isOpen(row, col)) return;\r\n else\r\n {\r\n grids[(row - 1) * dimension + col] = true;\r\n openSites++;\r\n }\r\n // up\r\n if (row - 1 > 0)\r\n {\r\n if(isOpen(row - 1, col)) uf.union((row - 1)*dimension + col, (row -2 )*dimension + col);\r\n }\r\n else uf.union((row -1)*dimension + col, 0);\r\n // down\r\n if (row + 1 <= dimension)\r\n {\r\n if (isOpen(row + 1, col)) uf.union((row - 1) * dimension + col, row * dimension + col);\r\n }\r\n else uf.union((row -1)*dimension + col, dimension * dimension + 1);\r\n // left\r\n if (col - 1 > 0)\r\n {\r\n if (isOpen(row, col - 1)) uf.union((row - 1)*dimension + col, (row - 1)*dimension + col - 1);\r\n }\r\n // right\r\n if (col + 1 <= dimension)\r\n {\r\n if (isOpen(row, col + 1)) uf.union((row - 1)*dimension + col, (row - 1)*dimension + col + 1);\r\n }\r\n }",
"public void open(int row, int col) {\n // validate the indices of the site\n validate(row, col);\n int k = mapping(row, col);\n if (idOpen[k] == 0) {\n idOpen[k] = 1;\n openCount++;\n if (row == count) //&& uf.find(k) == uf.find(count * count))\n uf.union(count * count + 1, k);\n if (row == 1)\n uf.union(count * count, k);\n }\n\n // perform sequence of union-find operations that links the site in question to its open neighbors (multiple UF can happen in one call)\n if (idOpen[moveDown(row, col)] == 1)\n uf.union(k, moveDown(row, col));\n if (idOpen[moveUp(row, col)] == 1)\n uf.union(k, moveUp(row, col));\n if (idOpen[moveRi(row, col)] == 1)\n uf.union(k, moveRi(row, col));\n if (idOpen[moveLe(row, col)] == 1)\n uf.union(k, moveLe(row, col));\n }",
"public void open(int i, int j) {\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n\n if (isOpen(i, j)) return;\n\n mGrid[i - 1][j - 1] = true;\n ++mOpenSites;\n\n // Neither Topmost or bottom most rows\n\n int idxFrom = xyTo1D(i, j);\n\n if (checkIndex(i - 1, j)) {\n if (isOpen(i - 1, j)) mUnionFind.union(idxFrom, xyTo1D(i - 1, j));\n }\n if (checkIndex(i + 1, j) && (i != mGridSize)) {\n if (isOpen(i + 1, j)) mUnionFind.union(idxFrom, xyTo1D(i + 1, j));\n }\n if (checkIndex(i, j + 1)) {\n if (isOpen(i, j + 1)) mUnionFind.union(idxFrom, xyTo1D(i, j + 1));\n }\n if (checkIndex(i, j - 1)) {\n if (isOpen(i, j - 1)) mUnionFind.union(idxFrom, xyTo1D(i, j - 1));\n }\n // 1: top row\n if (i == 1) {\n int idx = xyTo1D(i, j);\n mUnionFind.union(0, idx);\n\n }\n // 2: bottom row\n if (i == mGridSize && (!percolates())) {\n int idx = xyTo1D(i, j);\n mUnionFind.union(idx, mGridSize * mGridSize + 1);\n }\n\n\n }",
"public void open(int row, int col) {\n check(row, col);\n if (!isOpen(row, col)) {\n sites[row - 1][col - 1] = true;\n openSites++;\n\n int index = index(row, col);\n if (row == gridDimension) {\n unionFind.union(index, bottomRoot);\n\n if (gridDimension == 1){\n unionFind.union(index, topRoot);\n fullSites.union(index, topRoot);\n }\n else if (isOpen(row - 1, col)) {\n unionFind.union(index(row - 1, col), index);\n fullSites.union(index(row - 1, col), index);\n }\n }\n else if (row == 1) {\n unionFind.union(index, topRoot);\n fullSites.union(index, topRoot);\n\n if (isOpen(row + 1, col)) {\n unionFind.union(index(row + 1, col), index);\n fullSites.union(index(row + 1, col), index);\n }\n }\n\n else {\n if (isOpen(row + 1, col)) {\n unionFind.union(index(row + 1, col), index);\n fullSites.union(index(row + 1, col), index);\n }\n\n if (isOpen(row - 1, col)) {\n unionFind.union(index(row - 1, col), index);\n fullSites.union(index(row - 1, col), index);\n }\n }\n\n\n\n if (col > 1) {\n if (isOpen(row, col - 1)) {\n unionFind.union(index(row, col - 1), index);\n fullSites.union(index(row, col - 1), index);\n }\n }\n\n if (col < gridDimension) {\n if (isOpen(row, col + 1)) {\n unionFind.union(index(row, col + 1), index);\n fullSites.union(index(row, col + 1), index);\n }\n }\n }\n }",
"private void connectWithOpenSites(int row, int col) {\n if (isLegalCoordinate(row - 1, col))// upper\n UF.union(getIndex(row - 1, col), getIndex(row, col));\n if (isLegalCoordinate(row, col - 1))// left\n UF.union(getIndex(row, col - 1), getIndex(row, col));\n if (isLegalCoordinate(row, col + 1))// right\n UF.union(getIndex(row, col + 1), getIndex(row, col));\n if (isLegalCoordinate(row + 1, col))// bottom\n UF.union(getIndex(row + 1, col), getIndex(row, col));\n }",
"public void open(final int row, final int col) {\n checkBounds(row, col);\n if (!isOpen(row, col)) {\n numOpen++;\n grid[row - 1][col - 1] = true;\n int oneDsite = xyTo1D(row, col);\n // above\n if (row + 1 <= size && isOpen(row + 1, col)) {\n // StdOut.println(\"connecting [\"+row+\", \"+col+\"] with\n // [\"+(row + 1)+\", \"+col+\"]\");\n wqf.union(oneDsite, xyTo1D(row + 1, col));\n }\n // right\n if (col + 1 <= size && isOpen(row, col + 1)) {\n wqf.union(oneDsite, xyTo1D(row, col + 1));\n }\n // below\n if (row - 1 >= 1 && isOpen(row - 1, col)) {\n wqf.union(oneDsite, xyTo1D(row - 1, col));\n }\n // left\n if (col - 1 >= 1 && isOpen(row, col - 1)) {\n wqf.union(oneDsite, xyTo1D(row, col - 1));\n }\n }\n }",
"public void open(int row, int col){\n\t\tif (row <= 0 || col <= 0 || row > storeVar || col > storeVar) \n\t\t\tthrow new IllegalArgumentException(\"row index i out of bounds\");\n\n\t\t// System.out.println(\"\\n We're opening again! \");\n\t\tint currIndex = ((row-1)*storeVar) + col;\n\n\t\tif (isOpen(row, col)) return;\n\t\topenSites++;\n\t\tgrid[currIndex] = true;\n\n\n\t\tif (currIndex < storeVar+1 ){\n\t\t\tunionFind.union(currIndex, virtualTop);\n\t\t\tbackwash.union(currIndex, virtualTop);\n\t\t\tfullgrid[currIndex] = true;\n\t\t}\n\t\tif ((currIndex < grid.length - 1) && (currIndex >= (grid.length - 1 - storeVar))){\n\t\t\t// System.out.println(\"Confirmed that bottom is connected\");\n\t\t\tunionFind.union(currIndex, virtualBottom);\n\t\t}\n\n\t\t\n\t\tif(row + 1 <= storeVar && isOpen(row + 1, col)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex+storeVar)) {\n\t\t\t\tunionFind.union(currIndex, currIndex+storeVar);\n\t\t\t\tbackwash.union(currIndex, currIndex+storeVar);\n\t\t\t}\n\t\t}\n\t\tif(col + 1 <= storeVar && isOpen(row , col+1)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex+1)) {\n\t\t\t\tunionFind.union(currIndex, currIndex+1);\n\t\t\t\tbackwash.union(currIndex, currIndex+1);\n\t\t\t}\n\t\t}\n\t\tif(row - 1 > 0 && isOpen(row - 1, col)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex-storeVar)){ \n\t\t\t\tunionFind.union(currIndex, currIndex-storeVar);\n\t\t\t\tbackwash.union(currIndex, currIndex-storeVar);\n\t\t\t}\n\t\t}\n\t\tif(col - 1 > 0 && isOpen(row , col-1)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex-1)){\n\t\t\t unionFind.union(currIndex, currIndex-1);\n\t\t\t backwash.union(currIndex, currIndex-1);\n\t\t\t}\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return openState[getThisSite(row, col)];\n }",
"public void open(int i, int j) {\n\t\tvalidate(i, j);\n\t\tif (!isOpen(i, j)) {\n\t\t\tgrid[i - 1][j - 1] = true;\n\n\t\t\tunite(i, j, i - 1, j);\n\t\t\tunite(i, j, i + 1, j);\n\t\t\tunite(i, j, i, j - 1);\n\t\t\tunite(i, j, i, j + 1);\n\n\t\t\tif (i == 1) { // connect to virtual top site\n\t\t\t\tlinearGrid.union(0, xyTo1D(i, j));\n\t\t\t\tlinearGridNoBackwash.union(0, xyTo1D(i, j));\n\t\t\t} \n\t\t\tif (i == gridSize) { // connect to virtual bottom site\n\t\t\t\tlinearGrid.union(1, xyTo1D(i, j));\n\t\t\t}\n\t\t}\n\t}",
"public void open(int i, int j) {\n if (isOpen(i, j))\n return;\n\n int element = ((i-1)*siteDepth) + (j-1) + 1;\n\n if (i == 1) {\n // connect the top row to its virtual node\n wuf.union(virtTop, element);\n wufFull.union(virtTop, element);\n }\n\n if (i == siteDepth) {\n // connect the bottom row to its virtual node\n wuf.union(element, virtBottom);\n }\n\n // connect neighbors if they are open\n if ((i != 1) && isOpen(i - 1, j)) {\n wuf.union(element, element - siteDepth);\n wufFull.union(element, element - siteDepth);\n }\n\n if ((i != siteDepth) && isOpen(i + 1, j)) {\n wuf.union(element, element + siteDepth);\n wufFull.union(element, element + siteDepth);\n }\n \n if ((j != 1) && isOpen(i, j - 1)) {\n wuf.union(element, element - 1);\n wufFull.union(element, element - 1);\n }\n\n if ((j != siteDepth) && isOpen(i, j + 1)) {\n wuf.union(element, element + 1);\n wufFull.union(element, element + 1);\n }\n\n // Open the current site\n sites[i][j] = true;\n\n if (!hasPercolated && wuf.find(element) == wuf.find(virtTop))\n wufFull.union(virtTop, element);\n\n }",
"public boolean isOpen(int row, int col) {\n check(row, col);\n return sites[row - 1][col - 1];\n }",
"public boolean isOpen(int row, int col) {\n int index = rowColToIndex(row, col);\n return sitesIsOpen[index];\n }",
"public void open(int i, int j){ // open site (row i, column j) if it is not already\n\t\tif (i <= 0 || i > N) throw new java.lang.IndexOutOfBoundsException(\"row index i out of bounds\");\n\t\tif (j <= 0 || j > N) throw new java.lang.IndexOutOfBoundsException(\"row index j out of bounds\");\n\t\t\n\t\tif(idGrid[i-1][j-1] && !isPathological){\n\t\t\t\n\t\t\tidGrid[i-1][j-1] = false;\n\t\t\t\n\t\t//\tStringBuilder builder = new StringBuilder();\n\t\t\t\n\t\t\tif(!idGrid[i-1][max(0, j-2)]){ // Checking to the left\n\t\t\t\tquickUnion.union(j + (i-1)*N, max(1,j-1) + (i-1)*N);\n\t\t\t\tquickUnionBackwash.union(j + (i-1)*N, max(1,j-1) + (i-1)*N);\n\t\t\t//\tbuilder.append(\"Left \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[i-1][min(N-1, j)]){ // Checking to the right\n\t\t\t\tquickUnion.union(j + (i-1)*N, min(N,j+1) + (i-1)*N);\n\t\t\t\tquickUnionBackwash.union(j + (i-1)*N, min(N,j+1) + (i-1)*N);\n\t\t\t//\tbuilder.append(\"Right \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[max(0, i-2)][j-1]){ // Checking upwards\n\t\t\t\tquickUnion.union(max(0,i-2)*N + j, (i-1)*N + j);\n\t\t\t\tquickUnionBackwash.union(max(0,i-2)*N + j, (i-1)*N + j);\n\t\t\t//\tbuilder.append(\"Up \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[min(N-1, i)][j-1]){ // Checking downwards\n\t\t\t\tquickUnion.union(min(N-1,i)*N + j, (i-1)*N + j);\n\t\t\t\tquickUnionBackwash.union(min(N-1,i)*N + j, (i-1)*N + j);\n\t\t\t//\tbuilder.append(\"Down \");\n\t\t\t}\n\t\t\n\t\t\tif(i == 1){\n\t\t\t\tquickUnion.union((i-1)*N+j, 0);\n\t\t\t\tquickUnionBackwash.union((i-1)*N+j, 0);\n\t\t\t//\tbuilder.append(\"Top \");\n\t\t\t}\n\t\t\tif(i == N){\n\t\t\t\tquickUnion.union((i-1)*N+j, N*N+1);\n\t\t\t//\tbuilder.append(\"Bottom\");\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(builder.toString());\n\t\t}else if(isPathological && idGrid[0][0]){\n\t\t\tidGrid[0][0] = false;\n\t\t\t\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n if (row < 1 || row > gridSize || col < 1 || col > gridSize) {\n throw new IllegalArgumentException(\"array index out of bounds\");\n }\n\n // 1 --> open site\n return grid[row - 1][col - 1] == 1;\n }",
"public void open(int row, int col) {\n validate(row, col);\n if (isOpen(row, col)) {\n return;\n }\n \n int inputIndex = convertRowColToIndex(row, col);\n\n // Top connection required\n if (row == 1) {\n gridGraphVirtualTop.union(inputIndex, virtualTopGridIndex);\n gridGraphVirtualTopBottom.union(inputIndex, virtualTopGridIndex);\n \n }\n \n // Bottom connection required\n if (row == size) {\n gridGraphVirtualTopBottom.union(inputIndex, virtualBottomGridIndex);\n }\n\n gridState[row - 1][col - 1] = true;\n openGridCount++;\n \n checkAndConnect(inputIndex, row - 1, col); // top\n checkAndConnect(inputIndex, row, col - 1); // left\n checkAndConnect(inputIndex, row + 1, col); // bottom\n checkAndConnect(inputIndex, row, col + 1); // right\n }",
"public boolean isOpen(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n\n // check the site's open status\n return OPENBIT == (this.status[this.getElement(row, col)] & OPENBIT);\n }",
"public void open(int i, int j) throws Exception { \n validation(i, j);\n if (!isOpen(i, j)) { // mark the site as open\n int xyTo1DTemp = xyTo1D(i, j);\n lattice[xyTo1DTemp] = true;\n \n // links the site in question to its open neighbors\n if (xyTo1DTemp % number != 0) // leftneighbor\n if (isOpen(i, j - 1)) { \n ufVirtual.union(xyTo1DTemp, xyTo1DTemp - 1);\n ufTrue.union(xyTo1DTemp, xyTo1DTemp - 1);\n }\n if ((xyTo1DTemp + 1) % number != 0) // right neighbor\n if (isOpen(i, j + 1)) { \n ufVirtual.union(xyTo1DTemp, xyTo1DTemp + 1);\n ufTrue.union(xyTo1DTemp, xyTo1DTemp + 1);\n }\n if (xyTo1DTemp - number >= 0) // up neighbor\n if (isOpen(i - 1, j)) { \n ufVirtual.union(xyTo1DTemp, xyTo1DTemp - number);\n ufTrue.union(xyTo1DTemp, xyTo1DTemp - number);\n }\n if (xyTo1DTemp + number <= SIZE - 1) // beneath neighbor\n if (isOpen(i + 1, j)) { \n ufVirtual.union(xyTo1DTemp, xyTo1DTemp + number);\n ufTrue.union(xyTo1DTemp, xyTo1DTemp + number);\n }\n }\n }",
"public void open(int row, int col) {\n if (row - 1 >= grid.length || col - 1 >= grid.length || row - 1 < 0 || col - 1 < 0) {\n throw new IllegalArgumentException(\"index is out of boundary.\");\n }\n row = row - 1;\n col = col - 1;\n if (grid.length == 1 && !grid[row][col]) {\n grid[row][col] = true;\n openNum += 1;\n return;\n }\n if (!grid[row][col]) {\n grid[row][col] = true;\n openNum += 1;\n if (row - 1 >= 0 && isOpen(row, col + 1)) {\n uf.union(ufindex(row, col + 1), ufindex(row + 1, col + 1));\n }\n if (row + 1 < grid.length && isOpen(row + 2, col + 1)) {\n uf.union(ufindex(row + 2, col + 1), ufindex(row + 1, col + 1));\n }\n if (col - 1 >= 0 && isOpen(row + 1, col)) {\n uf.union(ufindex(row + 1, col), ufindex(row + 1, col + 1));\n }\n if (col + 1 < grid.length && isOpen(row + 1, col + 2)) {\n uf.union(ufindex(row + 1, col + 2), ufindex(row + 1, col + 1));\n }\n }\n }",
"public void open(int row, int col) {\n if (isOpen(row, col)) return;\n grid[row - 1][col - 1] = true;\n ++openSites;\n\n // Transform the row and the column into an appropriate index\n // because the quick union class uses a one-dimensional array.\n final int currentSiteIndex = toIndex(row, col);\n\n // The topmost row must be connected to the virtual top.\n if (row == 1) {\n mainUnion.union(virtualTopId, currentSiteIndex);\n backwashAwareUnion.union(virtualTopId, currentSiteIndex);\n }\n // The bottommost row must be connected to virtual the bottom.\n if (row == size) mainUnion.union(virtualBottomId, currentSiteIndex);\n\n // Connect all neighbors of the current site if and only if the neighbors are open.\n if (row > 1 && isOpen(row - 1, col)) {\n final int topNeighborIndex = toIndex(row - 1, col);\n mainUnion.union(topNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(topNeighborIndex, currentSiteIndex);\n }\n\n if (row < size && isOpen(row + 1, col)) {\n final int bottomNeighborIndex = toIndex(row + 1, col);\n mainUnion.union(bottomNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(bottomNeighborIndex, currentSiteIndex);\n }\n\n if (col > 1 && isOpen(row, col - 1)) {\n final int leftNeighborIndex = toIndex(row, col - 1);\n mainUnion.union(leftNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(leftNeighborIndex, currentSiteIndex);\n }\n\n if (col < size && isOpen(row, col + 1)) {\n final int rightNeighborIndex = toIndex(row, col + 1);\n mainUnion.union(rightNeighborIndex, currentSiteIndex);\n backwashAwareUnion.union(rightNeighborIndex, currentSiteIndex);\n }\n }",
"public void open(int row, int col) {\n rowAndColWithinBounds(row, col);\n if(isOpen(row, col)) return;\n int index = getIndex(row, col);\n openings[index] = true;\n openSites++;\n\n //connect up the virtual nodes if we are on the top or bottom rows\n if (row - 1 == 0) weightedUnion.union(0, index);\n\n int above = index - n;\n int below = index + n;\n int left = index - 1;\n int right = index + 1;\n if (above > 0 && openings[above]) weightedUnion.union(above, index);\n if (row < n && openings[below]) weightedUnion.union(below, index);\n if (col > 1 && openings[left]) weightedUnion.union(left, index);\n if (col < n && openings[right]) weightedUnion.union(right, index);\n }",
"public void Open() {\r\n\t click();\r\n\t }",
"public boolean isOpen(int row, int col) {\n return false;\n }",
"public void open(int row, int col) {\n checkRowAndCol(row, col);\n\n if (isOpen(row, col)) {\n return;\n }\n\n int idx = getIndex(row, col);\n int[] neighbours = new int[]{\n getIndex(row - 1, col),\n getIndex(row, col + 1),\n getIndex(row + 1, col),\n getIndex(row, col - 1)\n };\n\n for (int neighbour : neighbours) {\n if (neighbour < 0) {\n continue;\n }\n if (opened[neighbour])\n weightedQuickUnionUF.union(neighbour, idx);\n }\n\n if (row == 1) {\n weightedQuickUnionUF.union(0, idx);\n }\n opened[idx] = true;\n openSitesCount++;\n }",
"public void open(int row, int col) {\n HandleError(row, col);\n if(isOpen(row, col)) return;\n state[row][col] = 0;\n openHelper(row, col);\n open_blocks += 1;\n }",
"public boolean isOpen(int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n return siteStatus[row - 1][col - 1];\n }",
"public void open(int row, int col) {\n if ((row > (size-1)) || (col > (size-1)) || (col < 0) || (row < 0)) {\r\n throw new java.lang.IndexOutOfBoundsException();\r\n }\r\n else if (grid[row][col] == 0) { // if blocked\r\n int number;\r\n int min = row * size + col; // minimum index\r\n flowGrid[row * size + col] = min; // points at itself in the beginning\r\n boolean fullOrOpen;\r\n\r\n //Checking all sites around, to find the lowest number\r\n fullOrOpen = withinBounds(row - 1, col);\r\n if (fullOrOpen) {\r\n number = flowGrid[(row - 1) * size + col]; // takes the pointer at the location\r\n if (min > number) { // if pointer is lower than at it self\r\n min = number;\r\n }\r\n }\r\n fullOrOpen = withinBounds(row, col + 1);\r\n if (fullOrOpen) {\r\n number = flowGrid[row * size + (col + 1)];\r\n if (min > number) {\r\n min = number;\r\n }\r\n }\r\n fullOrOpen = withinBounds(row, col - 1);\r\n if (fullOrOpen) {\r\n number = flowGrid[row * size + col - 1];\r\n if (min > number) {\r\n min = number;\r\n }\r\n }\r\n fullOrOpen = withinBounds(row + 1, col);\r\n if (fullOrOpen) {\r\n number = flowGrid[(row + 1) * size + col];\r\n if (min > number) {\r\n min = number;\r\n }\r\n }\r\n\r\n\r\n //Checking all sites around and saving the new min\r\n fullOrOpen = withinBounds(row - 1, col);\r\n if (fullOrOpen) {\r\n number = flowGrid[(row - 1) * size + col]; // takes the pointer at the location\r\n flowGrid[number] = min; // the lowest index at current union takes points at the min\r\n }\r\n fullOrOpen = withinBounds(row, col + 1);\r\n if (fullOrOpen) {\r\n number = flowGrid[row * size + (col + 1)];\r\n\r\n flowGrid[number] = min;\r\n }\r\n fullOrOpen = withinBounds(row, col - 1);\r\n if (fullOrOpen) {\r\n number = flowGrid[row * size + col - 1];\r\n flowGrid[number] = min;\r\n }\r\n fullOrOpen = withinBounds(row + 1, col);\r\n if (fullOrOpen) {\r\n number = flowGrid[(row + 1) * size + col];\r\n flowGrid[number] = min;\r\n }\r\n\r\n NOpen += 1; // update number of open sites\r\n\r\n\r\n flowGrid[row * size + col] = min; // update new open site to its union lowest index\r\n checkAll();\r\n if (min<size) {\r\n grid[row][col]=2;\r\n }\r\n else {\r\n grid[row][col]=1;\r\n }\r\n }\r\n }",
"public void open(int i, int j){\n\t\tif(i<=0 || i>this.gridLength || j<=0 || j>this.gridLength){\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\tint N = this.gridLength;\n\t\t\n\t\t/*opens argument site is previously unopened and also connects to neighboring open sites\n\t\twhile also updating its connectedness to the bottom row indices*/\n\t\tif(this.idGrid[(i-1)*N + j] == false){\n\t\t\tthis.idGrid[(i-1)*N + j] = true;\n\t\t\tboolean connectBottom = this.bottom[(i-1)*N + j];\n\t\t\tif(i-1>0){\n\t\t\t\tif(idGrid[(i-2)*N + j] == true){\n\t\t\t\t\tif(this.bottom[this.unionTest.find((i - 2)*N + j)] == true){\n\t\t\t\t\t\tconnectBottom = true;\n\t\t\t\t\t}\n\t\t\t\t\tunionTest.union((i-1)*N + j, (i-2)*N + j);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(i+1<=this.gridLength){\n\t\t\t\tif(idGrid[(i)*N + j] == true){\n\t\t\t\t\tif(this.bottom[this.unionTest.find((i)*N + j)] == true){\n\t\t\t\t\t\tconnectBottom = true;\n\t\t\t\t\t}\n\t\t\t\t\tunionTest.union((i-1)*N + j, (i)*N + j);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(j-1>0){\n\t\t\t\tif(idGrid[(i-1)*N + j - 1] == true){\n\t\t\t\t\tif(this.bottom[(this.unionTest.find((i-1)*N + j - 1))] == true){\n\t\t\t\t\t\tconnectBottom = true;\n\t\t\t\t\t}\n\t\t\t\t\tunionTest.union((i-1)*N + j, (i-1)*N + j-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(j+1<=this.gridLength){\n\t\t\t\tif(idGrid[(i-1)*N + j + 1] == true){\n\t\t\t\t\tif(this.bottom[this.unionTest.find((i-1)*N + j + 1)] == true){\n\t\t\t\t\t\tconnectBottom = true;\n\t\t\t\t\t}\n\t\t\t\t\tunionTest.union((i-1)*N + j, (i-1)*N + j+1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update root status\n\t\t\tif(this.bottom[this.unionTest.find((i-1)*N + j)] != true){\n\t\t\t\tthis.bottom[this.unionTest.find((i-1)*N + j)] = connectBottom;\n\t\t\t}\n\t\t}\n\t}",
"public void open() {\n\n\t\tresize();\n\t\tgenerateLinks();\n\t\tshowing = true;\n\n\t}",
"public boolean isOpen(int i, int j) {\n boolean status = false;\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n if (mGrid[i - 1][j - 1]) {\n status = true;\n }\n return status;\n }",
"public boolean isOpen(int i, int j) {\n if (i <= 0 || i > siteDepth || j <= 0 || j > siteDepth)\n throw new IndexOutOfBoundsException();\n\n if (sites[i][j])\n return true;\n \n return false;\n }",
"public boolean isOpen(int row, int col) {\n if (row < 0 || row > n - 1 || col < 0 || col > n - 1) throw new java.lang.IndexOutOfBoundsException(\"isOpen():row or col out of bounds\");\n return grid[row][col];\n }",
"private void winOpen() {\n try {\n content = Files.readAllLines(Paths.get(FILE_PATH_INDEX_TXT), Charset.forName(\"cp1251\"));\n String[] Str = content.get(0).split(\";\");\n mapIndexes = new HashMap();\n int i = 0;\n for (String string : Str) {\n mapIndexes.put(string, ++i);\n }\n setLocation(main.getLocation().x + main.getWidth(), main.getLocation().y + this.getHeight() - 10);\n } catch (IOException ex) {\n JOptionPane.showOptionDialog(this, \"Ошибка\", \"Не найден индексный файл!\", JOptionPane.DEFAULT_OPTION,\n JOptionPane.ERROR_MESSAGE, null, null, null);\n }\n\n }",
"public void openCell(Integer xOpen, Integer yOpen){\n \r\n if(isValidCell(xOpen,yOpen)){\r\n // System.out.println(\" openCell(). es celda Valida\");\r\n if(grid[xOpen][yOpen].isMine()){\r\n // System.out.println(\" openCell().Perdiste, habia una mina en g[\"+xOpen+\"][\"+yOpen+\"]\");\r\n //grid[xOpen][yOpen].setStatus(Status.REVEALED);\r\n grid[xOpen][yOpen].setNumber(9);\r\n this.gs = gameStatus.LOSE;\r\n }else{\r\n // System.out.println(\" openCell().No es mina, puede continuar\");\r\n if( grid[xOpen][yOpen].getStatus() == Status.CLOSE ){//si esta cerrado, contar las minas\r\n // System.out.println(\" openCell().Esta cerrada, puede abrirse\");\r\n \r\n int minas = getMines(xOpen,yOpen); //error\r\n this.grid[xOpen][yOpen].setNumber(minas);\r\n \r\n if(minas == 0){ //abre las celdas de alrededor\r\n // System.out.println(\" openCell().Tiene 0 minas alrededor, hay que explotar\");\r\n for(int i=xOpen-1; i<=xOpen+1; i++){\r\n for(int j=yOpen-1; j<=yOpen+1 ;j++){\r\n if( i== xOpen && j==yOpen){\r\n grid[xOpen][yOpen].setStatus(Status.REVEALED);\r\n revealedCells++;\r\n }else\r\n openCell(i,j);\r\n }\r\n }\r\n }else{\r\n // System.out.println(\" openCell().La celda tiene un numero >0, puede abrise\");\r\n \r\n grid[xOpen][yOpen].setStatus(Status.REVEALED);\r\n revealedCells++;\r\n \r\n }\r\n } \r\n }\r\n }else{\r\n // System.out.println(\" openCell().Es una celda no valida\");\r\n }\r\n }",
"protected void openWebPage() {\n\t\tEseoTest.driver.get(Configuration.getString(\"website_address\"));\n\t\t//Assert.assertEquals(\"Web page title does not appear correct.\", Configuration.getString(\"login_title\"),\n\t\t\t//\tEseoTest.driver.getTitle());\t\t\n\t\tAssert.assertEquals(\"Browser title bar does not appear correct.\",Configuration.getString(\"homepage_title\"),EseoTest.driver.getTitle());\n\t\tAssert.assertEquals(\"Site title does not appear correct.\",Configuration.getString(\"blog_title\"),EseoTest.driver.findElement(By.tagName(\"h1\")).getText());\n\t\tAssert.assertEquals(\"Site description does not appear correct.\",Configuration.getString(\"blog_description\"),EseoTest.driver.findElement(By.tagName(\"p\")).getText());\n\t\tAssert.assertTrue(\"Log in item does not appear correct.\",EseoTest.driver.findElement(By.linkText(Configuration.getString(\"mainmenu_login_item\"))).isDisplayed());\n\t}",
"private boolean openBrowser(IProgressMonitor monitor) {\n\n monitor.subTask(\"Open index page\");\n // FIXME: port should come from the config files\n Display.getDefault().syncExec(new Runnable() {\n public void run() {\n URL url;\n try {\n url = new URL(\"http://localhost:8888\");\n IWorkbenchBrowserSupport browserSupport = WebBrowserUIPlugin\n .getInstance().getWorkbench().getBrowserSupport();\n IWebBrowser browser = browserSupport.createBrowser(\n IWorkbenchBrowserSupport.LOCATION_BAR\n | IWorkbenchBrowserSupport.NAVIGATION_BAR,\n null, null, null);\n browser.openURL(url);\n } catch (Exception e) {\n Trace.trace(Trace.SEVERE, \"Error opening browser\", e);\n }\n }\n });\n\n monitor.worked(3);\n return true;\n }",
"public void open() {\r\n\t\tthis.setVisible(true);\r\n\t}",
"public boolean isOpen(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return grid[oneDimensional];\n }",
"public boolean isOpen(int row, int col) {\n\t valid_rc(row, col);\r\n\t return open[index(row, col)];\r\n\t}",
"public void open(int row, int col) {\n\t\tif (!isOpen(row, col)) {\n\t\t\tgrid[row - 1][col - 1] = true;\n\t\t\topenCount++;\n\t\t}\n\t\tint indexInUF = getUnionIndex(row, col);\n\n\t\t// left neighbor\n\t\tunionIfOpen(indexInUF, row, col - 1);\n\n\t\t// right neighbor\n\t\tunionIfOpen(indexInUF, row, col + 1);\n\n\t\t// top neighbor\n\t\tunionIfOpen(indexInUF, row + 1, col);\n\n\t\t// bottom neighbor\n\t\tunionIfOpen(indexInUF, row - 1, col);\n\n\t\tif (row == 1) {\n\t\t\t// union to virtual top index\n\t\t\tuf.union(0, indexInUF);\n\t\t}\n\n\t\tif (row == size) {\n\t\t\t// union to virtual bottom index\n\t\t\tuf.union(size * size + 1, indexInUF);\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n if (row - 1 >= grid.length || col - 1 >= grid.length || row - 1 < 0 || col - 1 < 0) {\n throw new IllegalArgumentException(\"index is out of boundary.\");\n }\n return grid[row - 1][col - 1];\n }",
"private void connectToOpenNeighbors(int currentSite)\n {\n int aboveSite = currentSite - gridSize;\n int leftOfSite = currentSite - 1;\n int rightOfSite = currentSite + 1;\n int belowSite = currentSite + gridSize;\n\n if (aboveSite > 0) {\n if (grid[aboveSite]) {\n uf.union(currentSite, aboveSite);\n }\n }\n\n if (rightOfSite % gridSize != 0 && rightOfSite < totalSites) {\n if (grid[rightOfSite]) {\n uf.union(currentSite, rightOfSite);\n }\n }\n\n if (leftOfSite % gridSize != gridSize-1 && leftOfSite > 0) {\n if (grid[leftOfSite]) {\n uf.union(currentSite, leftOfSite);\n }\n }\n\n if (belowSite < totalSites) {\n if (grid[belowSite]) {\n uf.union(currentSite, belowSite);\n }\n }\n }",
"private native static boolean is_open_in_window(int clientSite);",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n int k = mapping(row, col);\n return idOpen[k] == 1;\n }",
"public boolean isOpen(int row, int col) {\n if ((row > (size-1)) || (col > (size-1)) || (col < 0) || (row < 0)) {\r\n throw new java.lang.IndexOutOfBoundsException();\r\n }\r\n else if (grid[row][col] > 0) {\r\n return true;\r\n } else return false;\r\n }",
"public boolean isOpen(int row, int col) {\n\t\tif(row < 0 || row >= N || col < 0 || col >= N) \n\t\t\tthrow new IllegalArgumentException();\n\n\t\tint index = xyTo1D(row, col);\n\t\treturn grid[index];\n\t}",
"private void openUpdate() {\n\t\tString url = MySoup.getUpdateLink(SITE);\n\t\tIntent i = new Intent(Intent.ACTION_VIEW);\n\t\ti.setData(Uri.parse(url));\n\t\tstartActivity(i);\n\t\tfinish();\n\t}",
"public boolean isOpen(int row, int col) {\n\t\tif (row < 1 || row > size || col < 1 || col > size) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn grid[row - 1][col - 1];\n\t}",
"private void openPage(String address)\n {\n String os = System.getProperty(\"os.name\").toLowerCase();\n \n if(os.contains(\"win\"))\n {\n if(Desktop.isDesktopSupported())\n {\n Desktop desktop = Desktop.getDesktop();\n if(desktop.isSupported(Desktop.Action.BROWSE))\n {\n try { desktop.browse(new URI(address)); }\n\n catch(IOException | URISyntaxException e)\n {\n JOptionPane.showMessageDialog(null, \"Could not open page\");\n }\n }\n }\n }\n \n else \n JOptionPane.showMessageDialog(null, \"Cannot open page, system is not supported\");\n }",
"public boolean open(){\n\t\tboolean allopen = true;\n\t\tfor (boolean element: open){\n\t\t\tif (element ==false)\n\t\t\t\tallopen = false;\n\t\t}\n\t\treturn allopen;\t\t\n\t}",
"public void open(int row, int col) {\n\t\tif(row < 0 || row >= N || col < 0 || col >= N) \n\t\t\tthrow new IllegalArgumentException();\n\t\tif(isOpen(row, col)) return;\n\t\tint index = xyTo1D(row, col);\n\t\tgrid[index] = true;\n\t\tsize++;\n\t\t// left\n\t\tif(col - 1 >= 0 && isOpen(row, col - 1)) {\n\t\t\tweigtedJoin.union(index - 1, index);\n\t\t\tnonPercolate.union(index - 1, index);\n\t\t}\n\t\t// right\n\t\tif(col + 1 < N && isOpen(row, col + 1)) {\n\t\t\tweigtedJoin.union(index + 1, index); \n\t\t\tnonPercolate.union(index + 1, index);\n\t\t}\n\t\t// up\n\t\tif(row - 1 >= 0 && isOpen(row - 1, col)) {\n\t\t\tweigtedJoin.union(index - N, index);\n\t\t\tnonPercolate.union(index - N, index);\n\t\t}\n\t\t// down\n\t\tif(row + 1 < N && isOpen(row + 1, col)) {\n\t\t\tweigtedJoin.union(index + N, index);\n\t\t\tnonPercolate.union(index + N, index);\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return grid[row - 1][col - 1];\n }",
"public void open(int row, int col) {\n validateWithinBounds(row, col);\n\n int currentPos = pos(row, col);\n if (open[currentPos]) {\n return;\n }\n open[currentPos] = true;\n count++;\n\n if (row == 1) {\n quickUnion.union(virtualTop, currentPos);\n backwashQuickUnion.union(virtualTop, currentPos);\n }\n\n if (row == n) {\n backwashQuickUnion.union(virtualBottom, currentPos);\n }\n\n unionAdjacent(currentPos, row - 1, col);\n unionAdjacent(currentPos, row + 1, col);\n unionAdjacent(currentPos, row, col - 1);\n unionAdjacent(currentPos, row, col + 1);\n }",
"public boolean isOpen(int row, int col)\r\n {\r\n if (row < 1 || row > dimension || col < 1 || col > dimension)\r\n throw new IllegalArgumentException(\"error range\");\r\n\r\n return grids[(row - 1) * dimension + col];\r\n }",
"public boolean isOpen(int row, int col) {\n checkRowAndCol(row, col);\n\n int index = getIndex(row, col);\n return opened[index];\n }",
"public void open() {\n setWebDriver();\n }",
"public boolean isOpen(int row, int col){\n\t\tif (row <= 0 || col <= 0 || row > storeVar || col > storeVar)\n\t\t\tthrow new IllegalArgumentException(\"row index i out of bounds\");\n\n\t\treturn grid[(row-1)*storeVar + (col)];\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return gridState[row-1][col-1];\n }",
"public void openSite(View view) {\n Intent toView = new Intent(Intent.ACTION_VIEW, Uri.parse(\"https://www.google.com\"));\n startActivity(toView);\n }",
"public static void Goto()\n\t{\n\t\tUserLogin.Login();\n\t\t\t\t\n\t\t//Choose community\n\t\tWebElement Community= Driver.Instance.findElement(PageObjRef.CommunityTab);\n\t\tCommunity.click();\n\t\tWebElement CommunityToJoin= Driver.Instance.findElement(PageObjRef.CommunityToJoin);\n\t CommunityToJoin.click();\n\t\t\n\t}",
"private void open() {\n\t\tdelegate.questionTabOpened(assesmentProxy.getId(),question.getId(),this);\n\t\t\n\t\tif(answersLoaded==false){\n\t\t\tdelegate.twistieOpenQuestionClicked(this);\n\t\t\tanswersLoaded=true;\n\t\t}\n\t\ttwistieOpen.setVisible(false);\n\t\tanswers.setVisible(true);\n\t\ttwistieClose.setVisible(true);\n\t\tanswersVisible=true;\n\t\tdetailsTablePanel.setVisible(true);\n\t\tquestionTable.setClassName(\"questionTable-open\");\n\t}",
"@Given(\"the user opens the index page\")\r\n\tpublic final void givenTheUserOpensTheIndexPage() {\r\n\t\tgetHomePage(chromeDriver);\r\n\t\tgetHomePage(firefoxDriver);\r\n\t\tgetHomePage(internetExplorerDriver);\r\n\t}",
"public boolean isOpen(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n return grid[row][col];\n }",
"public boolean isOpen(int row, int col){\n validateRowCol(row, col);\n return (grid[row][col] == false);\n }",
"public void openGame(View view) {\n setViewBackgroundWithoutResettingPadding(view, R.drawable.bkg_button_on);\n\n // Calculates the first level least completed on file\n String levelCodes = loadLevelStatus(this);\n int firstUnsolvedLevel = levelCodes.indexOf(\"0\");\n if (firstUnsolvedLevel == -1) {\n firstUnsolvedLevel = levelCodes.indexOf(\"1\");\n }\n if (firstUnsolvedLevel == -1) {\n firstUnsolvedLevel = levelCodes.indexOf(\"2\");\n }\n if (firstUnsolvedLevel == -1) {\n firstUnsolvedLevel = 0;\n }\n\n // Saves the default level scroll position and the first unsolved level\n SharedPreferences.Editor settingsEditor = sharedPreferences.edit();\n settingsEditor.putInt(GRID_POSITION, firstUnsolvedLevel);\n settingsEditor.putInt(CURRENT_LEVEL, firstUnsolvedLevel);\n settingsEditor.apply();\n\n // Starts the intent at the first level not completed\n Intent intent = new Intent(this, BoardActivity.class);\n startActivity(intent);\n }",
"public boolean isOpen(int row, int col) {\n validateWithinBounds(row, col);\n return open[pos(row, col)];\n }",
"public boolean isFull(int row, int col){\n\t\tint index= transformInput(row,col);\n\t\treturn (grid.connected(0, index) && openSites[index]);\n\t}",
"public boolean isOpen(int row, int col) {\n return this.grid[row][col];\n }",
"public boolean isOpen(int row, int col) {\n if (isInBounds(row-1, col-1)) {\n return grid[row-1][col-1];\n }\n else {\n throw new java.lang.IllegalArgumentException(\"Bad Coordinates\");\n }\n }",
"public boolean positionsOpen(int[][] spacesBetween, int[][] board) {\r\n\t\tboolean open=true;\r\n\t\tfor (int space=0; space<spacesBetween[0].length; space++) {\r\n\t\t\tif (board[spacesBetween[space][0]][spacesBetween[space][1]]>1) {\r\n\t\t\t\topen=false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn open;\r\n\t}",
"@Override\n\tprotected void openPage(PageLocator arg0, Object... arg1) {\n\t\t\n\t}",
"public boolean isOpen(int i, int j) throws Exception { \n validation(i, j);\n if (lattice[xyTo1D(i, j)])\n return true;\n return false;\n }",
"private void switchToFrame() {\n\t\tdriver.switchTo().frame(\"mainpanel\");\n\t}",
"public boolean isOpen(int row, int col) {\n HandleError(row, col);\n percolation.find(0); //不想加的但为了autograde\n return state[row][col] == 0 || state[row][col] == 2;\n }",
"public void openMenu() {\r\n\t\tJFrame current_frame = this;\r\n\t\tContainer content_pane = getContentPane();\r\n\t\ttop_panel = new PicPanel(\"trials.png\");\r\n\t\tmiddle_panel = new PicPanel(\"trials2.png\");\r\n\t\tlower_panel = new PicPanel(\"trials3.png\");\r\n\t\t//add panels to the content pane\r\n\t\tcontent_pane.add(top_panel);\r\n\t\tcontent_pane.add(middle_panel);\r\n\t\tcontent_pane.add(lower_panel);\r\n\t\t//*******\r\n\t\tJLabel control_keys_label = createLabel(\"controlkeys.png\");\r\n\t\tmiddle_panel.add(control_keys_label);\r\n\t\t//****\r\n\t\tJButton return_button = createButton(\"returntomenu.png\");\r\n\t\treturn_button.addActionListener(new ActionListener(){\r\n\t\t public void actionPerformed(ActionEvent e){\r\n\t\t \tcurrent_frame.dispose();\r\n\t\t \tStartMenuScreen start_menu = new StartMenuScreen();\r\n\t\t }\r\n\t\t});\r\n\t\tlower_panel.add(return_button);\r\n\t}",
"public static void openBrowser()\n\t{\n\t\tdriver = DriverSetup.getWebDriver(ReadPropertiesFile.getBrowser());\n\t\tdriver.get(ReadPropertiesFile.getURL());\n\t\tlog.info(\"Opening Browser\");\n\t\tlog.info(\"Practo website is launched \");\n\t}",
"public boolean isOpen(final int row, final int col) {\n return grid[row - 1][col - 1];\n }",
"public void openRandom() {\n\t\tint total = N * N;\n\t\tint index, row, col;\n\t\tdo {\n\t\t\tindex = randomGenerator.nextInt(total);\n\t\t\trow = index / N;\n\t\t\tcol = index % N;\n\t\t}while(isOpen(row, col) && size < total);\n\t\tif(size < total)\n\t\t\topen(row, col);\n\t}",
"private void openView(String viewToOpen)\n throws IOException, InterruptedException, URISyntaxException {\n Parent root = null;\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(getClass().getResource(viewToOpen + \"/\" + viewToOpen + \".fxml\"));\n root = loader.load();\n\n if (\"view0\".equals(viewToOpen)) {\n view0Controller = loader.getController();\n view0Controller.init(getVmFactory());\n }\n\n Scene s;\n s = new Scene(root);\n primaryStage.setScene(s);\n primaryStage.initStyle(StageStyle.UNDECORATED);\n primaryStage.initStyle(StageStyle.TRANSPARENT);\n primaryStage.show();\n\n // getcounter/iteratorvalue\n\n }",
"@FXML\n\tpublic void OpenHelpContentPage() {\n\n\t\tif (!Desktop.isDesktopSupported()) {\n\t\t\tSystem.out.println(\"Desktop not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (!Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {\n\t\t\tSystem.out.println(\"File opening not supported\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Task<Void> task = new Task<Void>() {\n\t\t\t@Override\n\t\t\tpublic Void call() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tFile sx3InstallLocation = SX3Manager.getInstance().getInstallLocation().getParentFile()\n\t\t\t\t\t\t\t.getAbsoluteFile();\n\t\t\t\t\tDesktop.getDesktop().open(new File(\n\t\t\t\t\t\t\tsx3InstallLocation + File.separator + \"Cypress_EZ-USB_SX3_ConfigurationUtility.pdf\"));\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.err.println(e.toString());\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\tfinal Thread thread = new Thread(task);\n\t\tthread.setDaemon(true);\n\t\tthread.start();\n\t}",
"public void openHomePage() {\n\t\tlogger.info(\"Opening Home Page\");\n\t\tdriver.get(ReadPropertyFile.getConfigPropertyVal(\"homePageURL\"));\n\t\t\n\t}",
"private void jMenuItem142ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem142ActionPerformed\n URI uri = null;\n try {\n uri = new URI(\"http://manual.audacityteam.org\");\n }\n catch (URISyntaxException ex) {\n Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;\n if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {\n try {\n desktop.browse(uri);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public void openRec(int x, int y) {\n\t\ttileArr[x][y].setOpened(true);\n\n\t\tif (tileArr[x][y].getNeighbors() == 0) {\n\t\t\tint left = x - 1;\n\t\t\tint right = x + 1;\n\t\t\tint up = y - 1;\n\t\t\tint down = y + 1;\n\t\t\t// same row\n\t\t\tif (left >= 0 && tileArr[left][y].canOpen())\n\t\t\t\topenRec(left, y);\n\t\t\tif (right < worldWidth && tileArr[right][y].canOpen())\n\t\t\t\topenRec(right, y);\n\n\t\t\t// row above\n\t\t\tif (left >= 0 && up >= 0 && tileArr[left][up].canOpen())\n\t\t\t\topenRec(left, up);\n\t\t\tif (up >= 0 && tileArr[x][up].canOpen())\n\t\t\t\topenRec(x, up);\n\t\t\tif (right < worldWidth && up >= 0 && tileArr[right][up].canOpen())\n\t\t\t\topenRec(right, up);\n\n\t\t\t// row below\n\t\t\tif (left >= 0 && down < worldHeight\n\t\t\t\t\t&& tileArr[left][down].canOpen())\n\t\t\t\topenRec(left, down);\n\t\t\tif (down < worldHeight && tileArr[x][down].canOpen())\n\t\t\t\topenRec(x, down);\n\t\t\tif (right < worldWidth && down < worldHeight\n\t\t\t\t\t&& tileArr[right][down].canOpen())\n\t\t\t\topenRec(right, down);\n\t\t}\n\t}",
"public boolean isFull(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n\n // the site that is opened and connected to top row is treated as the full site\n return isOpen(row, col) && TOPBIT == (this.status[this.uf.find(getElement(row, col))] & TOPBIT);\n }",
"public void verifyMyActivityPageSuccessfullyDisplayedInNewWindow()\n\t{\n\t\tgetDriver().navigate().refresh();\n\t\tAssert.assertTrue(MyActivitiesHeader.isDisplayed());\n\t\t\n\t}",
"public boolean isOpen(int i, int j){\n\t\t\n\t\tif (i <= 0 || i > N) throw new java.lang.IndexOutOfBoundsException(\"row index i out of bounds\");\n\t\tif (j <= 0 || j > N) throw new java.lang.IndexOutOfBoundsException(\"row index j out of bounds\");\n\t\t\t\t\n\t\treturn !idGrid[i-1][j-1];\n\t}"
]
| [
"0.7073",
"0.696519",
"0.69468445",
"0.6855801",
"0.68164325",
"0.6799386",
"0.67646205",
"0.67407364",
"0.6670827",
"0.6657598",
"0.6631129",
"0.6598512",
"0.65028334",
"0.64882505",
"0.6376393",
"0.6228447",
"0.6174125",
"0.60998356",
"0.6098711",
"0.60602415",
"0.60184216",
"0.60077864",
"0.6001813",
"0.5972691",
"0.59708005",
"0.5957491",
"0.5948284",
"0.5926673",
"0.59128135",
"0.5899185",
"0.58565193",
"0.58347374",
"0.5768854",
"0.5746459",
"0.5723308",
"0.5695471",
"0.5688257",
"0.5665773",
"0.5663589",
"0.56389105",
"0.5627987",
"0.5617757",
"0.5614441",
"0.55175996",
"0.55041087",
"0.5488643",
"0.5460355",
"0.54113716",
"0.54015255",
"0.5366269",
"0.5343012",
"0.5342201",
"0.5320836",
"0.53154206",
"0.53114563",
"0.5300931",
"0.52975625",
"0.5294514",
"0.526184",
"0.52472496",
"0.52195716",
"0.5216636",
"0.5185155",
"0.517954",
"0.51565397",
"0.51459646",
"0.51401514",
"0.51394224",
"0.51327497",
"0.51316136",
"0.51278716",
"0.51164794",
"0.51112705",
"0.5106742",
"0.51057076",
"0.51014626",
"0.50958693",
"0.5092471",
"0.5090971",
"0.5086592",
"0.5061083",
"0.5059597",
"0.5058459",
"0.5048996",
"0.50384885",
"0.5014972",
"0.5014469",
"0.5004982",
"0.5003363",
"0.49945736",
"0.4994374",
"0.4965984",
"0.4961504",
"0.49434757",
"0.49394366",
"0.49316788",
"0.49309635",
"0.49303195",
"0.49289244",
"0.49172148"
]
| 0.6367184 | 15 |
is the site (row, col) open? | public boolean isOpen(int row, int col) {
if (row < 0 || row > n - 1 || col < 0 || col > n - 1) throw new java.lang.IndexOutOfBoundsException("isOpen():row or col out of bounds");
return grid[row][col];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isOpen(int row, int col){\n\t\tint index= transformInput(row,col);\n\t\treturn openSites[index];\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return openState[getThisSite(row, col)];\n }",
"public boolean isOpen(int row, int col) {\n int index = rowColToIndex(row, col);\n return sitesIsOpen[index];\n }",
"public boolean isOpen(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n\n // check the site's open status\n return OPENBIT == (this.status[this.getElement(row, col)] & OPENBIT);\n }",
"public boolean isOpen(int row, int col) {\n check(row, col);\n return sites[row - 1][col - 1];\n }",
"public boolean isOpen(int row, int col) {\n if (row < 1 || row > gridSize || col < 1 || col > gridSize) {\n throw new IllegalArgumentException(\"array index out of bounds\");\n }\n\n // 1 --> open site\n return grid[row - 1][col - 1] == 1;\n }",
"public boolean isOpen(int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n return siteStatus[row - 1][col - 1];\n }",
"public boolean isOpen(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return grid[oneDimensional];\n }",
"public boolean isOpen(int row, int col) {\n return false;\n }",
"public void open(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n if (this.isOpen(row, col))\n return;\n\n // set the site to opened status\n this.status[getElement(row, col)] |= OPENBIT;\n\n // see whether the site is connected to top/bottom row\n byte top = (byte) (this.status[getElement(row, col)] & TOPBIT);\n byte bottom = (byte) (this.status[getElement(row, col)] & BOTTOMBIT);\n int parent = -1;\n\n // see whether the surrounding sites' root is connected to top/bottom row\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n parent = this.uf.find(getElement(row - 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n parent = this.uf.find(getElement(row + 1, col));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n parent = this.uf.find(getElement(row, col - 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n parent = this.uf.find(getElement(row, col + 1));\n top |= (this.status[parent] & TOPBIT);\n bottom |= (this.status[parent] & BOTTOMBIT);\n }\n\n // connect to each surrounding site\n if (isValid(row - 1, col) && isOpen(row - 1, col)) {\n this.uf.union(getElement(row, col), getElement(row - 1, col));\n }\n if (isValid(row + 1, col) && isOpen(row + 1, col)) {\n this.uf.union(getElement(row, col), getElement(row + 1, col));\n }\n if (isValid(row, col - 1) && isOpen(row, col - 1)) {\n this.uf.union(getElement(row, col), getElement(row, col - 1));\n }\n if (isValid(row, col + 1) && isOpen(row, col + 1)) {\n this.uf.union(getElement(row, col), getElement(row, col + 1));\n }\n\n // judge whether the root of the site is connected to top/bottom row\n parent = this.uf.find(getElement(row, col));\n this.status[parent] |= (top | bottom);\n\n // if the root is connected to top & bottom, then the whole system is percolated\n if (TOPBIT == (this.status[parent] & TOPBIT) && BOTTOMBIT == (this.status[parent] & BOTTOMBIT))\n this.isPercolated = true;\n }",
"public void open(int row, int col) {\n validate(row, col);\n int thisSite = getThisSite(row, col);\n if (isOpen(row, col)) {\n return;\n }\n openSites += 1;\n openState[thisSite] = true;\n\n// if only one, open is percolate\n if (n == 1) {\n percolates = true;\n return;\n }\n if (row == 1) {\n// first row\n uf.union(vTop, thisSite);\n if (col == 1) {\n// the left top corner\n checkRight(row, col);\n } else if (col == n) {\n// the right top corner\n checkLeft(row, col);\n } else {\n// other in top\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkBottom(row, col);\n } else if (row == n) {\n// last row\n// uf.union(vBottom, );\n bottom[col - 1] = getThisSite(row, col);\n if (col == 1) {\n// the left bottom corner\n checkRight(row, col);\n } else if (col == n) {\n// the right bottom corner\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n } else {\n if (col == 1) {\n// the left col\n checkRight(row, col);\n } else if (col == n) {\n// the right col\n checkLeft(row, col);\n } else {\n// other in bottom\n checkRight(row, col);\n checkLeft(row, col);\n }\n checkTop(row, col);\n checkBottom(row, col);\n }\n// how to improve\n if (!percolates) {\n for (int i = 0; i < n; i++) {\n int site = bottom[i];\n int rowx = n;\n int colx = i + 1;\n if (site > 0 && isFull(rowx, colx)) {\n percolates = true;\n }\n }\n }\n }",
"public boolean isOpen(int row, int col) {\n if (row - 1 >= grid.length || col - 1 >= grid.length || row - 1 < 0 || col - 1 < 0) {\n throw new IllegalArgumentException(\"index is out of boundary.\");\n }\n return grid[row - 1][col - 1];\n }",
"public boolean isOpen(int row, int col) {\n\t valid_rc(row, col);\r\n\t return open[index(row, col)];\r\n\t}",
"public void open(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n if(!isOpen(row, col)) {\n numOpen++;\n grid[row][col] = true;\n if(row==1) {\n // Opening a site on top connects it to the virtual top\n UF.union(((row-1)*size + col), top);\n UF2.union(((row-1)*size + col), top);\n }\n if(row==size) {\n // Opening a site on bottom connects it to the virtual bottom\n UF.union(((row-1)*size + col), bottom);\n }\n // Connect the site being opened to all its open neighbours\n if(row-1>=1 && grid[row-1][col]) {\n UF.union(((row-1)*size + col), (((row-1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row-1)-1)*size + col));\n }\n if(row+1<=size && grid[row+1][col]) {\n UF.union(((row-1)*size + col), (((row+1)-1)*size + col));\n UF2.union(((row-1)*size + col), (((row+1)-1)*size + col));\n }\n if(col-1>=1 && grid[row][col-1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col-1)));\n }\n if(col+1<=size && grid[row][col+1]) {\n UF.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n UF2.union(((row-1)*size + col), ((row-1)*size + (col+1)));\n }\n }\n }",
"public boolean isOpen(int i, int j) {\n boolean status = false;\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n if (mGrid[i - 1][j - 1]) {\n status = true;\n }\n return status;\n }",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n int k = mapping(row, col);\n return idOpen[k] == 1;\n }",
"public boolean isOpen(int row, int col) {\n validateWithinBounds(row, col);\n return open[pos(row, col)];\n }",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return gridState[row-1][col-1];\n }",
"public boolean isOpen(int row, int col) {\n\t\tif(row < 0 || row >= N || col < 0 || col >= N) \n\t\t\tthrow new IllegalArgumentException();\n\n\t\tint index = xyTo1D(row, col);\n\t\treturn grid[index];\n\t}",
"public boolean isOpen(int row, int col) {\n return this.grid[row][col];\n }",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return grid[row - 1][col - 1];\n }",
"public boolean isOpen(int i, int j) {\n if (i <= 0 || i > siteDepth || j <= 0 || j > siteDepth)\n throw new IndexOutOfBoundsException();\n\n if (sites[i][j])\n return true;\n \n return false;\n }",
"public boolean isFull(int row, int col){\n\t\tint index= transformInput(row,col);\n\t\treturn (grid.connected(0, index) && openSites[index]);\n\t}",
"public boolean isOpen(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n return grid[row][col];\n }",
"public boolean isFull(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n\n // the site that is opened and connected to top row is treated as the full site\n return isOpen(row, col) && TOPBIT == (this.status[this.uf.find(getElement(row, col))] & TOPBIT);\n }",
"public boolean isOpen(int row, int col)\r\n {\r\n if (row < 1 || row > dimension || col < 1 || col > dimension)\r\n throw new IllegalArgumentException(\"error range\");\r\n\r\n return grids[(row - 1) * dimension + col];\r\n }",
"public boolean isOpen(int row, int col) {\n if (isInBounds(row-1, col-1)) {\n return grid[row-1][col-1];\n }\n else {\n throw new java.lang.IllegalArgumentException(\"Bad Coordinates\");\n }\n }",
"public boolean isFull(int row, int col) {\n if (!isOpen(row, col)) {\n return false;\n }\n\n int indexP = xyToOneD(row, col);\n return wquf.connected(indexP, virtualTopSiteIndex);\n }",
"public void open(int row, int col){\n\t\tint index= transformInput(row, col);\n\t\tif(openSites[index]){ //returns if already open\n\t\t\treturn;\n\t\t}\n\t\t//set site as opened\n\t\topenSites[index]=true;\n\t\tnumOpen++;\n\t\t\n\t\t//Note if statement will truncate if out of index of array\n\t\tif( index+1 <= row*n && openSites[index+1]){ //right boundary\n\t\t\tgrid.union(index, index+1);\n\t\t}\n\t\tif( index-1 >= (row-1)*n +1 && openSites[index-1]){ //left boundary\n\t\t\tgrid.union(index, index-1);\n\t\t}\n\t\tif( index+n <= n*n && openSites[index+n]){ //bottom boundary\n\t\t\tgrid.union(index, index+n);\n\t\t}\n\t\tif( index-n >= 1 && openSites[index-n]){ //top boundary\n\t\t\tgrid.union(index, index-n);\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n\t\tif (row < 1 || row > size || col < 1 || col > size) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn grid[row - 1][col - 1];\n\t}",
"public void open(int row, int col)\n {\n validate(row, col);\n int oneDimensional = xyTo1D(row, col);\n if (grid[oneDimensional]) {\n return;\n }\n grid[oneDimensional] = true;\n connectToOpenNeighbors(oneDimensional);\n connectToVirtualSites(oneDimensional);\n openSites++;\n }",
"public void open(int row, int col) {\n if (grid[row][col] == 0) {\n grid[row][col] = 1;\n openSites++;\n if (row == 0) {\n grid[row][col] = 2;\n fill(row,col);\n }\n if (row > 0 && grid[row - 1][col] > 0) {\n // wqu.union(ID[row - 1][col], ID[row][col]);\n if (isFull(row - 1, col))\n fill(row-1,col);\n }\n if (row < grid.length - 1 && grid[row + 1][col] > 0) {\n // wqu.union(ID[row + 1][col], ID[row][col]);\n if (isFull(row + 1, col))\n fill(row+1,col);\n }\n if (col > 0 && grid[row][col - 1] > 0) {\n // wqu.union(ID[row][col - 1], ID[row][col]);\n if (isFull(row, col - 1))\n fill(row,col-1);\n }\n if (col < grid.length - 1 && grid[row][col + 1] > 0) {\n // wqu.union(ID[row][col + 1], ID[row][col]);\n if (isFull(row, col + 1))\n fill(row,col+1);\n }\n }\n // open the site (row, col) if it is not open already\n }",
"public boolean isOpen(int row, int col) {\n checkRowAndCol(row, col);\n\n int index = getIndex(row, col);\n return opened[index];\n }",
"public boolean isOpen(final int row, final int col) {\n return grid[row - 1][col - 1];\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n if (!isOpen(row, col)) {\n return false;\n }\n if (row == 1) {\n return true;\n }\n int s = getThisSite(row, col);\n// uf.find()\n return uf.connected(s, vTop);\n }",
"public void open(int row, int col) {\n if (isOpen(row, col))\n return;\n int index = rowColToIndex(row, col);\n sitesIsOpen[index] = true;\n if (row == 1) {\n sitesUF.union(index, upSiteIndex);\n sidesFullUF.union(index, upSiteIndex);\n }\n\n\n //!this.percolates() this situation is prevent after percolates, every\n //sites open down will be full, but not fix 在下面按了几个后, 另一块区域联通是的,原来的区域 full 了\n if (row == side && !this.percolates())\n sitesUF.union(index, downSiteIndex);\n\n for (int aroundIndex : indexsAround(row, col)) {\n if (sitesIsOpen[aroundIndex]) {\n sitesUF.union(aroundIndex, index);\n sidesFullUF.union(aroundIndex, index);\n }\n }\n\n }",
"public void open (int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n if (isOpen(row, col)) return;\n\n siteStatus[row - 1][col - 1] = true;\n if (row == 1 || row == getSize()) connectWithVirtualSites(row, col);\n connectWithOpenSites(row, col);\n openSites++;\n }",
"public boolean isOpen(int row, int col){\n\t\tif (row <= 0 || col <= 0 || row > storeVar || col > storeVar)\n\t\t\tthrow new IllegalArgumentException(\"row index i out of bounds\");\n\n\t\treturn grid[(row-1)*storeVar + (col)];\n\t}",
"public boolean isOpen(int row, int col) {\n HandleError(row, col);\n percolation.find(0); //不想加的但为了autograde\n return state[row][col] == 0 || state[row][col] == 2;\n }",
"public boolean isOpen(int row, int col){\n validateRowCol(row, col);\n return (grid[row][col] == false);\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n int indexOfThisSite = site2index(row, col);\n return isOpen(row, col) && this.ufNoBottom.connected(0, indexOfThisSite);\n }",
"private native static boolean is_open_in_window(int clientSite);",
"public boolean percolates() {\n if (openSitesCount < gridSize) {\n return false;\n }\n\n if (gridSize == 1 && openSitesCount == 1) {\n return true;\n }\n\n return wquf2.connected(virtualTopSiteIndex, virtualBottomSiteIndex);\n }",
"public void open(int row, int col) {\n if (isInBounds(row-1, col-1)) {\n if (isOpen(row, col)) return;\n if (row == 1) {\n mainObject.union(vsite1, coordinateConvertFrom(row, col));\n }\n if (row == size) {\n mainObject.union(vsite2, coordinateConvertFrom(row, col));\n }\n if (isInBounds(row - 1, col) && isOpen(row, col + 1)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row, col + 1));\n }\n if (isInBounds(row - 1, col - 2) && isOpen(row, col - 1)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row, col - 1));\n }\n if (isInBounds(row, col - 1) && isOpen(row + 1, col)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row + 1, col));\n }\n if (isInBounds(row - 2, col - 1) && isOpen(row - 1, col)) {\n mainObject.union(coordinateConvertFrom(row, col), coordinateConvertFrom(row - 1, col));\n }\n grid[row - 1][col - 1] = true;\n numberOfOpenSites++;\n }\n else {\n throw new java.lang.IllegalArgumentException(\"Bad Coordinates\");\n }\n\n }",
"public boolean positionsOpen(int[][] spacesBetween, int[][] board) {\r\n\t\tboolean open=true;\r\n\t\tfor (int space=0; space<spacesBetween[0].length; space++) {\r\n\t\t\tif (board[spacesBetween[space][0]][spacesBetween[space][1]]>1) {\r\n\t\t\t\topen=false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn open;\r\n\t}",
"public void open(int row, int col) {\n if (!validateCoordinates(row - 1, col - 1)) {\n throw new IllegalArgumentException(\"invalid (row, col) value provided\");\n }\n\n if (isOpen(row, col)) return;\n\n // 1 --> open site\n grid[row - 1][col - 1] = 1;\n openSitesCount++;\n\n // top neighbour\n if (row > 1 && isOpen(row - 1, col)) {\n performUnion(row, col, row - 1, col);\n }\n\n // right neighbour\n if (col <= gridSize - 1 && isOpen(row, col + 1)) {\n performUnion(row, col, row, col + 1);\n }\n\n // down neighbour\n if (row <= gridSize - 1 && isOpen(row + 1, col)) {\n performUnion(row, col, row + 1, col);\n }\n\n // left neighbour\n if (col > 1 && isOpen(row, col - 1)) {\n performUnion(row, col, row, col - 1);\n }\n\n // connect to virtual top site if newly opened\n // site is in row 1 (top row)\n if (row == 1) {\n int indexP = xyToOneD(row, col);\n wquf.union(indexP, virtualTopSiteIndex);\n wquf2.union(indexP, virtualTopSiteIndex);\n } else if (row == gridSize) {\n int indexP = xyToOneD(row, col);\n wquf2.union(indexP, virtualBottomSiteIndex);\n }\n }",
"public boolean isOpen(int row, int col) {\n if ((row > (size-1)) || (col > (size-1)) || (col < 0) || (row < 0)) {\r\n throw new java.lang.IndexOutOfBoundsException();\r\n }\r\n else if (grid[row][col] > 0) {\r\n return true;\r\n } else return false;\r\n }",
"private boolean isInGameWindow(){\n if (currPos.x > Window.getWidth() || currPos.y > Window.getHeight()){\n return false;\n }\n return true;\n }",
"public boolean isOpen(int i, int j) {\n\t\tvalidate(i, j);\n\t\treturn grid[i - 1][j - 1];\n\t}",
"public void open(int row, int col) {\n validate(row, col);\n if (!isOpen(row, col)) {\n this.numOfOpenSites += 1;\n }\n grid[row - 1][col - 1] = true;\n int indexOfThisSite = site2index(row, col);\n\n // union adjacent open nodes\n if (row > 1 && isOpen(row - 1, col)) {\n this.uf.union(site2index(row - 1, col), indexOfThisSite);\n this.ufNoBottom.union(site2index(row - 1, col), indexOfThisSite);\n }\n\n if (row < this.n && isOpen(row + 1, col)) {\n this.uf.union(site2index(row + 1, col), indexOfThisSite);\n this.ufNoBottom.union(site2index(row + 1, col), indexOfThisSite);\n }\n\n if (col > 1 && isOpen(row, col - 1)) {\n this.uf.union(site2index(row, col - 1), indexOfThisSite);\n this.ufNoBottom.union(site2index(row, col - 1), indexOfThisSite);\n }\n\n if (col < this.n && isOpen(row, col + 1)) {\n this.uf.union(site2index(row, col + 1), indexOfThisSite);\n this.ufNoBottom.union(site2index(row, col + 1), indexOfThisSite);\n }\n }",
"public boolean isOpen(int i, int j) {\n\t\tif (!isInside(i, j))\n\t\t\treturn false;\n\t\treturn grid[getPosition(i, j)];\n\n\t}",
"public boolean isOpen(int i, int j) throws Exception { \n validation(i, j);\n if (lattice[xyTo1D(i, j)])\n return true;\n return false;\n }",
"public void open(int row, int col) {\n\n }",
"public boolean isFull(int row, int col) {\n if (isOpen(row, col)) {\n return mainObject.connected(vsite1, coordinateConvertFrom(row, col));\n }\n return false;\n }",
"public boolean isOpen(int i, int j){\n \tif(i<=0 || i>this.gridLength || j<=0 || j>this.gridLength){\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n \treturn this.idGrid[(i-1)*this.gridLength + j] == true;\n }",
"private boolean isInTwoPaneMode() {\n\t\t\n Log.i(TAG, \"DailySelfieMainActivity.isInTwoPaneMode entered\");\n\n\t\treturn findViewById(R.id.selfie_list) != null;\n\t}",
"public void open(int row, int col){\n validateRowCol(row, col);\n if(grid[row][col]){\n grid[row][col] = false;\n numOpenSites++;\n if(row != 0 && isOpen(row - 1, col)) {\n uf.union(siteNum(row, col), siteNum(row - 1, col));\n tempUF.union(siteNum(row, col), siteNum(row - 1, col));\n }\n if(row != (gridSize-1) && isOpen(row+1, col)) {\n uf.union(siteNum(row, col), siteNum(row + 1, col));\n tempUF.union(siteNum(row, col), siteNum(row + 1, col));\n }\n if(col != 0 && isOpen(row, col-1)) {\n uf.union(siteNum(row, col), siteNum(row, col - 1));\n tempUF.union(siteNum(row, col), siteNum(row, col - 1));\n }\n if(col != (gridSize-1) && isOpen(row, col+1)) {\n uf.union(siteNum(row, col), siteNum(row, col + 1));\n tempUF.union(siteNum(row, col), siteNum(row, col + 1));\n }\n if(row == 0) {\n uf.union(siteNum(row, col), ufSize - 2);\n tempUF.union(siteNum(row, col), ufSize - 2);\n }\n if(row == (gridSize-1))\n uf.union(siteNum(row, col), ufSize - 1);\n\n }\n }",
"boolean hasGrid();",
"public boolean isOpen(int i, int j){\n\t\t\n\t\tif (i <= 0 || i > N) throw new java.lang.IndexOutOfBoundsException(\"row index i out of bounds\");\n\t\tif (j <= 0 || j > N) throw new java.lang.IndexOutOfBoundsException(\"row index j out of bounds\");\n\t\t\t\t\n\t\treturn !idGrid[i-1][j-1];\n\t}",
"public void open(final int row, final int col) {\n checkBounds(row, col);\n if (!isOpen(row, col)) {\n numOpen++;\n grid[row - 1][col - 1] = true;\n int oneDsite = xyTo1D(row, col);\n // above\n if (row + 1 <= size && isOpen(row + 1, col)) {\n // StdOut.println(\"connecting [\"+row+\", \"+col+\"] with\n // [\"+(row + 1)+\", \"+col+\"]\");\n wqf.union(oneDsite, xyTo1D(row + 1, col));\n }\n // right\n if (col + 1 <= size && isOpen(row, col + 1)) {\n wqf.union(oneDsite, xyTo1D(row, col + 1));\n }\n // below\n if (row - 1 >= 1 && isOpen(row - 1, col)) {\n wqf.union(oneDsite, xyTo1D(row - 1, col));\n }\n // left\n if (col - 1 >= 1 && isOpen(row, col - 1)) {\n wqf.union(oneDsite, xyTo1D(row, col - 1));\n }\n }\n }",
"public boolean open(){\n\t\tboolean allopen = true;\n\t\tfor (boolean element: open){\n\t\t\tif (element ==false)\n\t\t\t\tallopen = false;\n\t\t}\n\t\treturn allopen;\t\t\n\t}",
"public boolean isCellOpen(int row, int column) {\n return getCell(row, column).isFree();\n }",
"public boolean isOpen(int i, int j) throws IndexOutOfBoundsException {\r\n\t\tif (i > N || i < 1)\r\n\t\t\tthrow new IndexOutOfBoundsException(\"row index i out of bounds\");\r\n\t\tif (j > N || j < 1)\r\n\t\t\tthrow new IndexOutOfBoundsException(\"column index j out of bounds\");\r\n\t\treturn grid[i - 1][j - 1];\r\n\t}",
"public boolean isFull(int row, int col) {\n check(row, col);\n int index = index(row, col);\n return fullSites.connected(index, topRoot);\n }",
"public boolean checkOpen(float x, float y)\r\n/* 483: */ {\r\n/* 484:580 */ if (!tileWalkable(x, y)) {\r\n/* 485:582 */ return false;\r\n/* 486: */ }\r\n/* 487:585 */ AgentModel a = getAgentOnTile(x, y);\r\n/* 488:586 */ if ((a != null) || (((a instanceof DoorModel)) && (!((DoorModel)a).isOpen()))) {\r\n/* 489:588 */ return false;\r\n/* 490: */ }\r\n/* 491:591 */ return true;\r\n/* 492: */ }",
"public void open(int row, int col) {\n if (isOpen(row, col)) {\n return;\n }\n grid[row][col] = true;\n openSites++;\n int p1 = fromXYTo1D(row, col);\n for (int i = 0; i < rowOrder.length; ++i) {\n int newRow = row + rowOrder[i];\n int newCol = col + colOrder[i];\n if (inGrid(newRow, newCol) && isOpen(newRow, newCol)) {\n int p2 = fromXYTo1D(newRow, newCol);\n uf.union(p1, p2);\n }\n }\n }",
"public void open(int row, int col)\r\n {\r\n if (row < 1 || row > dimension || col < 1 || col > dimension)\r\n throw new IllegalArgumentException(\"error range\");\r\n\r\n if (isOpen(row, col)) return;\r\n else\r\n {\r\n grids[(row - 1) * dimension + col] = true;\r\n openSites++;\r\n }\r\n // up\r\n if (row - 1 > 0)\r\n {\r\n if(isOpen(row - 1, col)) uf.union((row - 1)*dimension + col, (row -2 )*dimension + col);\r\n }\r\n else uf.union((row -1)*dimension + col, 0);\r\n // down\r\n if (row + 1 <= dimension)\r\n {\r\n if (isOpen(row + 1, col)) uf.union((row - 1) * dimension + col, row * dimension + col);\r\n }\r\n else uf.union((row -1)*dimension + col, dimension * dimension + 1);\r\n // left\r\n if (col - 1 > 0)\r\n {\r\n if (isOpen(row, col - 1)) uf.union((row - 1)*dimension + col, (row - 1)*dimension + col - 1);\r\n }\r\n // right\r\n if (col + 1 <= dimension)\r\n {\r\n if (isOpen(row, col + 1)) uf.union((row - 1)*dimension + col, (row - 1)*dimension + col + 1);\r\n }\r\n }",
"public boolean isFull(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n // A site i full if it is connected to the top\n return UF2.connected(((row-1)*size + col), top);\n }",
"public void open(int row, int col) {\n \t if (row < 0 || row > n - 1 || col < 0 || col > n - 1) throw new java.lang.IndexOutOfBoundsException(\"open():row or col out of bounds\");\n if (!isOpen(row, col)) {\n grid[row][col] = true;\n openSites++;\n int comp1 = n*row + col;\n if (row == 0) myUF.union(comp1, n*n);\n if (row == n - 1 ) myUF.union(comp1, n*n + 1);\n if (row + 1 < n && grid[row+1][col]) myUF.union(comp1, comp1 + n);\n if (row - 1 >= 0 && grid[row-1][col]) myUF.union(comp1, comp1 - n);\n if (col + 1 < n && grid[row][col+1]) myUF.union(comp1, comp1 + 1);\n if (col - 1 >= 0 && grid[row][col-1]) myUF.union(comp1, comp1 - 1);\n } \n }",
"private void connectWithOpenSites(int row, int col) {\n if (isLegalCoordinate(row - 1, col))// upper\n UF.union(getIndex(row - 1, col), getIndex(row, col));\n if (isLegalCoordinate(row, col - 1))// left\n UF.union(getIndex(row, col - 1), getIndex(row, col));\n if (isLegalCoordinate(row, col + 1))// right\n UF.union(getIndex(row, col + 1), getIndex(row, col));\n if (isLegalCoordinate(row + 1, col))// bottom\n UF.union(getIndex(row + 1, col), getIndex(row, col));\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n return isOpen(row, col) &&\n (gridGraphVirtualTop.find(virtualTopGridIndex) == gridGraphVirtualTop.find(convertRowColToIndex(row, col)));\n }",
"boolean isContentDisplayed();",
"public void open(int row, int col){\n\t\tif (row <= 0 || col <= 0 || row > storeVar || col > storeVar) \n\t\t\tthrow new IllegalArgumentException(\"row index i out of bounds\");\n\n\t\t// System.out.println(\"\\n We're opening again! \");\n\t\tint currIndex = ((row-1)*storeVar) + col;\n\n\t\tif (isOpen(row, col)) return;\n\t\topenSites++;\n\t\tgrid[currIndex] = true;\n\n\n\t\tif (currIndex < storeVar+1 ){\n\t\t\tunionFind.union(currIndex, virtualTop);\n\t\t\tbackwash.union(currIndex, virtualTop);\n\t\t\tfullgrid[currIndex] = true;\n\t\t}\n\t\tif ((currIndex < grid.length - 1) && (currIndex >= (grid.length - 1 - storeVar))){\n\t\t\t// System.out.println(\"Confirmed that bottom is connected\");\n\t\t\tunionFind.union(currIndex, virtualBottom);\n\t\t}\n\n\t\t\n\t\tif(row + 1 <= storeVar && isOpen(row + 1, col)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex+storeVar)) {\n\t\t\t\tunionFind.union(currIndex, currIndex+storeVar);\n\t\t\t\tbackwash.union(currIndex, currIndex+storeVar);\n\t\t\t}\n\t\t}\n\t\tif(col + 1 <= storeVar && isOpen(row , col+1)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex+1)) {\n\t\t\t\tunionFind.union(currIndex, currIndex+1);\n\t\t\t\tbackwash.union(currIndex, currIndex+1);\n\t\t\t}\n\t\t}\n\t\tif(row - 1 > 0 && isOpen(row - 1, col)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex-storeVar)){ \n\t\t\t\tunionFind.union(currIndex, currIndex-storeVar);\n\t\t\t\tbackwash.union(currIndex, currIndex-storeVar);\n\t\t\t}\n\t\t}\n\t\tif(col - 1 > 0 && isOpen(row , col-1)){\n\t\t\tif (!unionFind.connected(currIndex, currIndex-1)){\n\t\t\t unionFind.union(currIndex, currIndex-1);\n\t\t\t backwash.union(currIndex, currIndex-1);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public boolean detect() {\n QQRobot.findWindowLocation(RGB_SCREEN);\n if (QQTetris.QQCoord.x != -1) {\n return true;\n } else {\n return false;\n }\n }",
"public boolean isFull(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return uf.connected(oneDimensional, topVirtualSite);\n }",
"boolean isOpen();",
"boolean isOpen();",
"public void open(int i, int j) {\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n\n if (isOpen(i, j)) return;\n\n mGrid[i - 1][j - 1] = true;\n ++mOpenSites;\n\n // Neither Topmost or bottom most rows\n\n int idxFrom = xyTo1D(i, j);\n\n if (checkIndex(i - 1, j)) {\n if (isOpen(i - 1, j)) mUnionFind.union(idxFrom, xyTo1D(i - 1, j));\n }\n if (checkIndex(i + 1, j) && (i != mGridSize)) {\n if (isOpen(i + 1, j)) mUnionFind.union(idxFrom, xyTo1D(i + 1, j));\n }\n if (checkIndex(i, j + 1)) {\n if (isOpen(i, j + 1)) mUnionFind.union(idxFrom, xyTo1D(i, j + 1));\n }\n if (checkIndex(i, j - 1)) {\n if (isOpen(i, j - 1)) mUnionFind.union(idxFrom, xyTo1D(i, j - 1));\n }\n // 1: top row\n if (i == 1) {\n int idx = xyTo1D(i, j);\n mUnionFind.union(0, idx);\n\n }\n // 2: bottom row\n if (i == mGridSize && (!percolates())) {\n int idx = xyTo1D(i, j);\n mUnionFind.union(idx, mGridSize * mGridSize + 1);\n }\n\n\n }",
"public void open(int row, int col) {\n check(row, col);\n if (!isOpen(row, col)) {\n sites[row - 1][col - 1] = true;\n openSites++;\n\n int index = index(row, col);\n if (row == gridDimension) {\n unionFind.union(index, bottomRoot);\n\n if (gridDimension == 1){\n unionFind.union(index, topRoot);\n fullSites.union(index, topRoot);\n }\n else if (isOpen(row - 1, col)) {\n unionFind.union(index(row - 1, col), index);\n fullSites.union(index(row - 1, col), index);\n }\n }\n else if (row == 1) {\n unionFind.union(index, topRoot);\n fullSites.union(index, topRoot);\n\n if (isOpen(row + 1, col)) {\n unionFind.union(index(row + 1, col), index);\n fullSites.union(index(row + 1, col), index);\n }\n }\n\n else {\n if (isOpen(row + 1, col)) {\n unionFind.union(index(row + 1, col), index);\n fullSites.union(index(row + 1, col), index);\n }\n\n if (isOpen(row - 1, col)) {\n unionFind.union(index(row - 1, col), index);\n fullSites.union(index(row - 1, col), index);\n }\n }\n\n\n\n if (col > 1) {\n if (isOpen(row, col - 1)) {\n unionFind.union(index(row, col - 1), index);\n fullSites.union(index(row, col - 1), index);\n }\n }\n\n if (col < gridDimension) {\n if (isOpen(row, col + 1)) {\n unionFind.union(index(row, col + 1), index);\n fullSites.union(index(row, col + 1), index);\n }\n }\n }\n }",
"public boolean isSquareVisited(int row, int col) {\n return playingBoard[row][col].isVisited();\n }",
"public boolean isAt() {\n\t\treturn Browser.title().equals(title);\n\t}",
"boolean hasPosition();",
"boolean hasPosition();",
"boolean hasPosition();",
"boolean hasPosition();",
"boolean isLocator();",
"boolean isCellAlive(int x, int y);",
"private boolean positionExists(int row, int column) {\n\t\treturn row >= 0 && row < rows && column >= 0 && column < columns;\n\t}",
"private boolean isOpen () {\n boolean result = false;\n if (interOne == null || interTwo == null) result = true;\n return (result);\n }",
"public void open(int i, int j){ // open site (row i, column j) if it is not already\n\t\tif (i <= 0 || i > N) throw new java.lang.IndexOutOfBoundsException(\"row index i out of bounds\");\n\t\tif (j <= 0 || j > N) throw new java.lang.IndexOutOfBoundsException(\"row index j out of bounds\");\n\t\t\n\t\tif(idGrid[i-1][j-1] && !isPathological){\n\t\t\t\n\t\t\tidGrid[i-1][j-1] = false;\n\t\t\t\n\t\t//\tStringBuilder builder = new StringBuilder();\n\t\t\t\n\t\t\tif(!idGrid[i-1][max(0, j-2)]){ // Checking to the left\n\t\t\t\tquickUnion.union(j + (i-1)*N, max(1,j-1) + (i-1)*N);\n\t\t\t\tquickUnionBackwash.union(j + (i-1)*N, max(1,j-1) + (i-1)*N);\n\t\t\t//\tbuilder.append(\"Left \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[i-1][min(N-1, j)]){ // Checking to the right\n\t\t\t\tquickUnion.union(j + (i-1)*N, min(N,j+1) + (i-1)*N);\n\t\t\t\tquickUnionBackwash.union(j + (i-1)*N, min(N,j+1) + (i-1)*N);\n\t\t\t//\tbuilder.append(\"Right \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[max(0, i-2)][j-1]){ // Checking upwards\n\t\t\t\tquickUnion.union(max(0,i-2)*N + j, (i-1)*N + j);\n\t\t\t\tquickUnionBackwash.union(max(0,i-2)*N + j, (i-1)*N + j);\n\t\t\t//\tbuilder.append(\"Up \");\n\t\t\t}\n\t\t\t\n\t\t\tif(!idGrid[min(N-1, i)][j-1]){ // Checking downwards\n\t\t\t\tquickUnion.union(min(N-1,i)*N + j, (i-1)*N + j);\n\t\t\t\tquickUnionBackwash.union(min(N-1,i)*N + j, (i-1)*N + j);\n\t\t\t//\tbuilder.append(\"Down \");\n\t\t\t}\n\t\t\n\t\t\tif(i == 1){\n\t\t\t\tquickUnion.union((i-1)*N+j, 0);\n\t\t\t\tquickUnionBackwash.union((i-1)*N+j, 0);\n\t\t\t//\tbuilder.append(\"Top \");\n\t\t\t}\n\t\t\tif(i == N){\n\t\t\t\tquickUnion.union((i-1)*N+j, N*N+1);\n\t\t\t//\tbuilder.append(\"Bottom\");\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(builder.toString());\n\t\t}else if(isPathological && idGrid[0][0]){\n\t\t\tidGrid[0][0] = false;\n\t\t\t\n\t\t}\n\t}",
"public int isIsland(int row, int col){\n if(grid[row][col] == '0'){\n return 0;\n }\n //Otherwise there is an island here and we need to recursively\n //flood fill 0s to prevent future double-counts.\n floodFill(row, col);\n return 1;\n \n }",
"public boolean isFull(int row, int col) {\n if (!isValidSite(row, col)) {\n throw new IllegalArgumentException(\"Illegal indices [\" + row + \"][\" + col + \"]\");\n }\n return this.quf.find((this.n * this.n) + 1) == this.quf.find(this.getSite(row, col));\n }",
"boolean hasGridLayout();",
"public void open(int row, int col) {\n // validate the indices of the site\n validate(row, col);\n int k = mapping(row, col);\n if (idOpen[k] == 0) {\n idOpen[k] = 1;\n openCount++;\n if (row == count) //&& uf.find(k) == uf.find(count * count))\n uf.union(count * count + 1, k);\n if (row == 1)\n uf.union(count * count, k);\n }\n\n // perform sequence of union-find operations that links the site in question to its open neighbors (multiple UF can happen in one call)\n if (idOpen[moveDown(row, col)] == 1)\n uf.union(k, moveDown(row, col));\n if (idOpen[moveUp(row, col)] == 1)\n uf.union(k, moveUp(row, col));\n if (idOpen[moveRi(row, col)] == 1)\n uf.union(k, moveRi(row, col));\n if (idOpen[moveLe(row, col)] == 1)\n uf.union(k, moveLe(row, col));\n }",
"public void open(int row, int col) {\n validate(row, col);\n if (isOpen(row, col)) {\n return;\n }\n \n int inputIndex = convertRowColToIndex(row, col);\n\n // Top connection required\n if (row == 1) {\n gridGraphVirtualTop.union(inputIndex, virtualTopGridIndex);\n gridGraphVirtualTopBottom.union(inputIndex, virtualTopGridIndex);\n \n }\n \n // Bottom connection required\n if (row == size) {\n gridGraphVirtualTopBottom.union(inputIndex, virtualBottomGridIndex);\n }\n\n gridState[row - 1][col - 1] = true;\n openGridCount++;\n \n checkAndConnect(inputIndex, row - 1, col); // top\n checkAndConnect(inputIndex, row, col - 1); // left\n checkAndConnect(inputIndex, row + 1, col); // bottom\n checkAndConnect(inputIndex, row, col + 1); // right\n }",
"public boolean isWin() {\n\t\t\n\t\tboolean win = true;\n\t\t\n\t\tfor(int i = 0; i < numTiles - 2; i++) {\n\t\t\twin = win && (boardConfig[i] < boardConfig[i+1]);\n\t\t}\n\t\t\n\t\twin = win && (boardConfig[numTiles - 1] == 0);\n\t\t\n\t\treturn win;\n\t}",
"private void connectToOpenNeighbors(int currentSite)\n {\n int aboveSite = currentSite - gridSize;\n int leftOfSite = currentSite - 1;\n int rightOfSite = currentSite + 1;\n int belowSite = currentSite + gridSize;\n\n if (aboveSite > 0) {\n if (grid[aboveSite]) {\n uf.union(currentSite, aboveSite);\n }\n }\n\n if (rightOfSite % gridSize != 0 && rightOfSite < totalSites) {\n if (grid[rightOfSite]) {\n uf.union(currentSite, rightOfSite);\n }\n }\n\n if (leftOfSite % gridSize != gridSize-1 && leftOfSite > 0) {\n if (grid[leftOfSite]) {\n uf.union(currentSite, leftOfSite);\n }\n }\n\n if (belowSite < totalSites) {\n if (grid[belowSite]) {\n uf.union(currentSite, belowSite);\n }\n }\n }",
"public boolean isSite() {\n return site;\n }",
"boolean reachedEdge() {\n\t\treturn this.x > parent.width - 30;// screen width including the size of\n\t\t\t\t\t\t\t\t\t\t\t// the image\n\t}",
"private boolean isInGrid(int row, int col) {\n return (row >= 1 && row <= size) && (col >= 1 && col <= size);\n }"
]
| [
"0.7603261",
"0.7473287",
"0.74506974",
"0.7371943",
"0.7363469",
"0.72330785",
"0.71025217",
"0.70060664",
"0.6947601",
"0.68914115",
"0.6761325",
"0.67522",
"0.67481446",
"0.6743529",
"0.67347944",
"0.6675136",
"0.66550744",
"0.6615941",
"0.6605118",
"0.6604098",
"0.65964437",
"0.6588577",
"0.6583941",
"0.65339065",
"0.6533066",
"0.65231395",
"0.6514069",
"0.6496407",
"0.64889985",
"0.6486527",
"0.6473343",
"0.6467198",
"0.64562666",
"0.64493966",
"0.6444954",
"0.64403987",
"0.64399207",
"0.6424418",
"0.6423035",
"0.6400157",
"0.63992065",
"0.638311",
"0.63770604",
"0.6344106",
"0.63359684",
"0.63092405",
"0.63077676",
"0.6299124",
"0.619223",
"0.61871016",
"0.618678",
"0.6115935",
"0.60739845",
"0.60517657",
"0.6050086",
"0.60271233",
"0.6008925",
"0.5992294",
"0.5982823",
"0.5976379",
"0.5939425",
"0.5938877",
"0.5938371",
"0.5929181",
"0.5924795",
"0.59149945",
"0.590332",
"0.59024507",
"0.58909005",
"0.5869801",
"0.5858899",
"0.5858635",
"0.58346635",
"0.5834311",
"0.5829822",
"0.5819411",
"0.5819411",
"0.5789615",
"0.57626414",
"0.5760651",
"0.57490855",
"0.5731136",
"0.5731136",
"0.5731136",
"0.5731136",
"0.5720862",
"0.5710257",
"0.5693831",
"0.56858325",
"0.56780964",
"0.5666352",
"0.566414",
"0.563876",
"0.5633016",
"0.5629169",
"0.562443",
"0.5614753",
"0.5589905",
"0.5586444",
"0.55773807"
]
| 0.668814 | 15 |
is the site (row, col) full? | public boolean isFull(int row, int col) {
if (row < 0 || row > n - 1 || col < 0 || col > n - 1) throw new java.lang.IndexOutOfBoundsException("isFull():row or col out of bounds");
if (isOpen(row, col) && myUF.connected(n*n, row*n + col))
return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isFull(int row, int col) {\n validate(row, col);\n int indexOfThisSite = site2index(row, col);\n return isOpen(row, col) && this.ufNoBottom.connected(0, indexOfThisSite);\n }",
"public boolean isFull(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return uf.connected(oneDimensional, topVirtualSite);\n }",
"public boolean isFull(int row, int col){\n\t\tint index= transformInput(row,col);\n\t\treturn (grid.connected(0, index) && openSites[index]);\n\t}",
"public boolean isFull(int row, int col) {\n if (!isOpen(row, col)) {\n return false;\n }\n\n int indexP = xyToOneD(row, col);\n return wquf.connected(indexP, virtualTopSiteIndex);\n }",
"public boolean isFull(int row, int col) {\n if(!inRange(row, col)) {\n throw new IllegalArgumentException();\n }\n // A site i full if it is connected to the top\n return UF2.connected(((row-1)*size + col), top);\n }",
"public boolean isFull(int row, int col) {\n if (!this.isValid(row, col))\n throw new IndexOutOfBoundsException(\"row or col is out of side length!\");\n\n // the site that is opened and connected to top row is treated as the full site\n return isOpen(row, col) && TOPBIT == (this.status[this.uf.find(getElement(row, col))] & TOPBIT);\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n if (!isOpen(row, col)) {\n return false;\n }\n if (row == 1) {\n return true;\n }\n int s = getThisSite(row, col);\n// uf.find()\n return uf.connected(s, vTop);\n }",
"public boolean isFull(int row, int col) {\n check(row, col);\n int index = index(row, col);\n return fullSites.connected(index, topRoot);\n }",
"public boolean isFull(int row, int col) {\n int index = rowColToIndex(row, col);\n return sidesFullUF.connected(index, upSiteIndex);\n// return sitesUF.connected(index, upSiteIndex);\n }",
"public boolean isFull(int row, int col) {\n if (!isValidSite(row, col)) {\n throw new IllegalArgumentException(\"Illegal indices [\" + row + \"][\" + col + \"]\");\n }\n return this.quf.find((this.n * this.n) + 1) == this.quf.find(this.getSite(row, col));\n }",
"public boolean isFull(int row, int col){\n validateRowCol(row, col);\n return tempUF.connected(siteNum(row, col), ufSize - 2);\n }",
"public boolean isFull(int row, int col) {\n return false;\n }",
"public boolean isFull(int row, int col) {\n if (isOpen(row, col)) {\n return mainObject.connected(vsite1, coordinateConvertFrom(row, col));\n }\n return false;\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n return isOpen(row, col) &&\n (gridGraphVirtualTop.find(virtualTopGridIndex) == gridGraphVirtualTop.find(convertRowColToIndex(row, col)));\n }",
"public static boolean isBoardFull() {\n\t\treturn spacesLeft == 0;\n\t}",
"private boolean isFullWest()\r\n\t{\r\n\t\treturn (westElem == maxSize);\r\n\t}",
"public boolean isFull(int row, int col) {\n if (row - 1 >= grid.length || col - 1 >= grid.length || row - 1 < 0 || col - 1 < 0) {\n throw new IllegalArgumentException(\"index is out of boundary.\");\n }\n if (grid.length == 1) {\n return isOpen(row, col);\n }\n return uf.find(ufindex(row, col)) == uf.find(grid.length * grid.length) && isOpen(row, col);\n }",
"public boolean isFull() {\r\n return placeCounter == dimension * dimension;\r\n }",
"@Override\n\tpublic boolean boardIsfull() {\n\t\treturn _columnFull.size() == _columnCount;\n\t}",
"public boolean isFull(int row, int col){\n\t\tif (row <= 0 || col <= 0 || row > storeVar || col > storeVar) \n\t\t\tthrow new IllegalArgumentException(\"row index i out of bounds\");\n\n\t\tint currIndex = ((row-1)*storeVar) + (col);\n\n\t\tif(backwash.connected(virtualTop, currIndex)){\n\t\t\tSystem.out.println(\"Filled in new \" + row + \"\\t\" + col);\n\t\t\tfullgrid[currIndex] = true;\n\t\t}\n\n\t\treturn fullgrid[currIndex];\n\t}",
"public boolean isBoardFull() {\n\t\t// REPLACE NEXT LINE WITH YOUR IMPLEMENTATION\n\t\tint boardSize = getBoardSize();\n\t\t\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t\n\t\t\t\tif (isSpotBlank(i,j)) {\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t\t\n\t}",
"private boolean isFullSouth()\r\n\t{\r\n\t\treturn (southElem == maxSize);\r\n\t}",
"public boolean isFull(int row, int col) {\n validateWithinBounds(row, col);\n return quickUnion.connected(virtualTop, pos(row, col));\n }",
"private boolean isScreenFull(){\n for(int i = 0; i < mPixelX.length; i++){\n if(i % 10 == 0 && mPixelX[i] == 0){\n return false;\n }\n }\n for(int i = 0; i < mPixelY.length; i++){\n if(i % 10 == 0 && mPixelY[i] == 0){\n return false;\n }\n }\n return true;\n }",
"public boolean isFull(int row, int col) {\n\t\tint id = (row - 1) * N + col;\n\t\tif(uf.isConnected(id, 0)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isFull(int row, int col) {\n\t valid_rc(row, col);\r\n\t return uftest.connected(index(row, col), n*n);\r\n\t}",
"boolean hasGrid();",
"private boolean full()\n {\n // Check whether every column is full one by one\n for (int col = 0; col < COLUMNS; col++ )\n {\n // If a column is not full, the check failed\n if (chessBoard[0][col] == 0)\n {\n return false;\n }\n }\n // If all columns are full, the check passes\n return true;\n }",
"public boolean isFull ()\n {\n for (int row = 0; row < 3; row++)\n for (int column = 0; column < 3; column++)\n if (getGridElement(row, column).getPlayer() == Player.NONE)\n return false;\n\n return true;\n }",
"public boolean isFullBoard() {\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n return false;\n }\n }\n }\n return true;\n }",
"public boolean isFull(final int row, final int col) {\n if (isOpen(row, col)) {\n // loop through first row to see\n for (int k = 0; k < size; k++) {\n if (wqf.connected(xyTo1D(row, col), k)) {\n return true;\n }\n }\n }\n return false;\n }",
"private boolean isFull(){\n return cellSize == Max;\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n int k = mapping(row, col);\n return uf.find(count * count) == uf.find(k);\n }",
"public boolean isFull() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (getBoard()[i][j] == null)\n return false;\n }\n }\n return true;\n }",
"public boolean isFull(int row, int col) {\n if (0 > row && row > size && 0 > col && col > size) {\n throw new IndexOutOfBoundsException();\n }\n int index = returnIndex(row, col);\n return weightedQuickUnionUF.connected(top, index);\n }",
"public boolean isFull(int row, int col) {\n\t\tif(row < 0 || row >= N || col < 0 || col >= N) \n\t\t\tthrow new IllegalArgumentException();\n\t\tint index = xyTo1D(row, col);\n\t\treturn isOpen(row, col) && nonPercolate.connected(index, N * N);\n\t}",
"public static boolean isFull() {\n return (board[0][0] > 0 && board[0][1] > 0 && board[0][2] > 0\n && board[1][0] > 0 && board[1][1] > 0 && board[1][2] > 0\n && board[2][0] > 0 && board[2][1] > 0 && board[2][2] > 0\n && board[0][0] > 0 && board[1][0] > 0 && board[2][0] > 0\n && board[0][1] > 0 && board[1][1] > 0 && board[2][1] > 0\n && board[0][2] > 0 && board[1][2] > 0 && board[2][2] > 0\n && board[0][0] > 0 && board[1][1] > 0 && board[2][2] > 0\n && board[0][2] > 0 && board[1][1] > 0 && board[2][0] > 0);\n }",
"public boolean isFull(int row, int col) {\n HandleError(row, col);\n if( isOpen(row, col) == false ) return false;\n if( state[row][col] == 2 ) return true;\n for(int i = 0; i < length; i++) {\n if(isOpen(0,i) && percolation.connected(translate(0, i),translate(row ,col))) {\n state[row][col] = 2;\n return true;\n }\n }\n return false;\n }",
"public boolean isBoardFull() {\r\n\r\n\t\t\r\n for (int i = 0; i < boardsize; i++) \r\n {\r\n for (int j = 0; j < boardsize; j++) \r\n {\r\n if (board[i][j] == -1) \r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n\t\t\r\n return true;\r\n }",
"@Override\r\n\t\t\tpublic boolean isFull() {\r\n\t\t\t\tfor(int row = 0; row +1< 6; row++) {\r\n\t\t\t\t\tfor(int col = 0; col < 7; col++) {\r\n\t\t\t\t\t\tString brick = board[row][col].getText().trim();\r\n\t\t\t\t\t\tif(brick.isEmpty()){\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}",
"private boolean boardIsFull() {\n int numberOfFieldsOnBoard = boardSize * boardSize;\n return (numberOfFieldsOnBoard == this.numberOfOccupiedFields);\n }",
"public boolean isFull() {\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (!isRowFull(r)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tover = true;\n\t\treturn true;\n\t}",
"public boolean isFull(int[][] grid) {\n for (int row = 0; row < 9; row++){\n for (int col = 0; col < 9; col++) {\n if (grid[row][col] == 0) return false;\n }\n }\n return true;\n }",
"public boolean isFull(int i, int j) {\n if (!checkIndex(i, j))\n throw new IndexOutOfBoundsException(\"invalid index i or j for grid site\");\n int idx = xyTo1D(i, j);\n // is virtual top site connected to this site\n //return mUnionFind.connected(0, idx);\n return mUnionFind.find(0) == mUnionFind.find(idx);\n\n }",
"private boolean tileIsInbounds(int row, int col){\n\t\treturn row >= 0 && col >= 0\n\t\t\t\t&& row < board.length && col < board[0].length;\n\t}",
"@Override\n public boolean isBoardFull() {\n //assume board is full\n boolean isFull = true;\n\n int i = 0;\n try {\n //if a column is not full => the board is not full and the loop ends\n while (isFull && i < NUM_COLS) {\n isFull = isColumnFull(i);\n i++;\n }\n } catch (IllegalColumnException e) {\n System.out.println(e + \" in MyGameState.java Method isBoardFull\");\n }\n\n return isFull;\n }",
"public boolean isFull(int row, int col) {\n if ((row > (size-1)) || (col > (size-1)) || (col < 0) || (row < 0)) {\r\n throw new java.lang.IndexOutOfBoundsException();\r\n }\r\n else if (grid[row][col] == 2) {\r\n return true;\r\n } else return false;\r\n }",
"public boolean isFull() {\n\t\tboolean full = true;\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tif (board[i][j] == '-') {\n\t\t\t\t\tfull = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn full;\n\t}",
"private boolean isFull() {\n for (int i = 0; i < 6; i++)\n for (int j = 0; j < 7; j++)\n if (cell[i][j] == ' ')\n return false; // At least one cell is not filled\n\n // All cells are filled\n return true;\n }",
"private boolean isRowFull(int row) {\n int numBlocks = 0;\n\n for (int col = 0; col < 10; col++) {\n if (isCellOccupied(row, col)) {\n numBlocks++;\n }\n }\n\n return numBlocks == 10;\n }",
"public boolean isFull(int row, int col)\r\n {\r\n if (row < 1 || row > dimension || col < 1 || col > dimension)\r\n throw new IllegalArgumentException(\"error range\");\r\n\r\n if (uf.find((row-1)*dimension + col) == uf.find(0)) return true;\r\n else return false;\r\n }",
"private boolean isInGrid(int row, int col) {\n return (row >= 1 && row <= size) && (col >= 1 && col <= size);\n }",
"public boolean isFull(int row, int col) {\n if (isOpen(row, col)) {\n int point = fromXYTo1D(row, col);\n return uf.connected(point, source) ||\n uf.connected(point, sink);\n }\n\n return false;\n }",
"public boolean isFull(int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n return UF.isConnected(0, getIndex(row, col));\n }",
"public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }",
"public boolean is_full(){\n return this.habitant.size() >= Constantes.HOUSE_FULL;\n }",
"public boolean isFull(int row, int col) {\n checkRowAndCol(row, col);\n\n int idx = getIndex(row, col);\n return weightedQuickUnionUF.connected(0, idx);\n }",
"private boolean cell_in_bounds(int row, int col) {\n return row >= 0\n && row < rowsCount\n && col >= 0\n && col < colsCount;\n }",
"@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }",
"public boolean percolates() {\n if (openSitesCount < gridSize) {\n return false;\n }\n\n if (gridSize == 1 && openSitesCount == 1) {\n return true;\n }\n\n return wquf2.connected(virtualTopSiteIndex, virtualBottomSiteIndex);\n }",
"public boolean isFull(int x, int y){\r\n\t\tif (_squares[x][y] == null){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public boolean isFull(){\r\n\t\tfor(int i = 0; i < boardSize; i++){\r\n\t\t\tif(board[i] == Box.EMPTY){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public abstract boolean currentSizeVSCageSize(int row, int col);",
"protected static boolean isFull(final Board board)\r\n {\r\n for (int col = 0; col < board.getBoardKey()[0].length; col++)\r\n {\r\n for (int row = 0; row < board.getBoardKey().length; row++)\r\n {\r\n //if there is an empty space return false\r\n if (board.getKey(col, row) == Board.KEY_EMPTY)\r\n return false;\r\n }\r\n }\r\n \r\n //this board is full\r\n return true;\r\n }",
"public boolean isFull() {\n if(this.top==(size - 1)) {\n return true;\n }\n return false;\n }",
"public boolean percolates() {\n // bottom row (grid[n - 1][0] ... grid[n - 1][n - 1])\n for (int j = 1; j <= size; j++) {\n // StdOut.println(\"j: \"+j+\" isOpen: \"+ isOpen(size, j) +\n // \" isFull: \" + isFull(size, j));\n if (isFull(size, j)) {\n return true;\n }\n }\n return false;\n }",
"public boolean isFull() {\n for (int r = 0; r < 6; r++) {\n for (int c = 0; c < 7; c++) {\n if (!hasPiece(r, c)) {\n return false;\n }\n }\n }\n return true;\n }",
"private boolean isBoardFull() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (boardState[i][j] != 'X' && boardState[i][j] != 'O') {\n return false; \n }\n }\n }\n return true; \n }",
"public void checkBlankSpace() {\n\t\tif (xOffset < 0) {\n\t\t\txOffset = 0;\n\t\t} else if (xOffset > handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth()) {\n\t\t\txOffset = handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth();\n\t\t}\n\t\t\n\t\tif (yOffset < 0) {\n\t\t\tyOffset = 0;\n\t\t} else if (yOffset > handler.getWorld().getHeight() * Tile.TILEHEIGHT - handler.getHeight()) {\n\t\t\tyOffset = handler.getWorld().getHeight() * Tile.TILEWIDTH - handler.getHeight();\n\t\t}\n\t}",
"public boolean isFull(int row, int col) {\n\t\tif (isOpen(row, col)) {\n\t\t\tint top = uf.find(0);\n\t\t\tint target = uf.find(getUnionIndex(row, col));\n\t\t\treturn top == target;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isColFull(int c) {\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (board[r][c] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public boolean isColumnFull(int col) throws IllegalColumnException {\n //handle exceptions\n if (col < 0 || col >= NUM_COLS) {\n throw new IllegalColumnException(col);\n }\n\n //assume the column is full\n boolean isFull = true;\n try {\n //if the top is empty => the column is empty\n isFull = getCounterAt(col, NUM_ROWS - 1) != EMPTY;\n } catch (IllegalRowException e) {\n System.out.println(e + \" in MyGameState.java Method isColumnFull\");\n } catch (IllegalColumnException e) {\n System.out.println(e + \" in MyGameState.java Method isColumnFull\");\n }\n\n return isFull;\n }",
"private boolean inBounds(int row, int col)\n {\n return ((row >= 0) && (row < NUM_ROWS) &&\n (col >= 0) && (col < NUM_COLS)); \n }",
"boolean hasColumnLayout();",
"private boolean inBounds(int row, int col){\n if (row > -1 && row < 120 && col > -1 && col < 160)\n return true;\n return false;\n }",
"public boolean isTotallyOnGrid() {\n\t\t\tfor(int i=0; i<4; i++) {\n\t\t\t\tif(position.y + i >= 0)\n\t\t\t\t\treturn true; //everything from here down is on grid\n\t\t\t\t// this row is above grid so look for non-empty squares\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tif(squares[i][j])\n\t\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tSystem.err.println(\"TetrisPiece.isTotallyOnGrid internal error\");\n\t\t\treturn false;\n\t\t}",
"public boolean isFull(int i, int j) {\n if (i <= 0 || i > siteDepth || j <= 0 || j > siteDepth)\n throw new IndexOutOfBoundsException();\n\n int element = ((i-1)*siteDepth) + (j-1) + 1;\n\n if (wufFull.connected(element, virtTop))\n return true;\n\n return false;\n }",
"public boolean checkBoardFull() {\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (grid[i][j].getSymbol() == '-')\n return false;\n }\n }\n return true;\n }",
"public int isIsland(int row, int col){\n if(grid[row][col] == '0'){\n return 0;\n }\n //Otherwise there is an island here and we need to recursively\n //flood fill 0s to prevent future double-counts.\n floodFill(row, col);\n return 1;\n \n }",
"public boolean isOpen(int row, int col) {\n check(row, col);\n return sites[row - 1][col - 1];\n }",
"public boolean isFull(int i, int j) {\n\t\tvalidate(i, j);\n\t\treturn linearGridNoBackwash.connected(0, xyTo1D(i, j));\n\t}",
"private boolean full(Board board)\n {\n for (int i = 0; i < size; i++)\n for (int j = 0; j < size; j++)\n if (board.array[i][j] == EMPTY)\n return false;\n return true;\n }",
"public boolean percolates() {\n for (int i = 0; i < size; i++) {\r\n if (flowGrid[size * (size - 1) + i] < size) { // if any of the bottom row points at any of the index in the top row\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public boolean isFull(char[][] grid){\r\n\t\tboolean full = true;\r\n\t\tfor (int i=0;i<grid.length;i++){\r\n\t\t\tfor (int j=0;j<grid[i].length;j++){\r\n\t\t\t\tif (grid[i][j] == ' '){\r\n\t\t\t\t\tfull = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn full;\r\n\t}",
"public boolean isRowFull(int r) {\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (board[r][c] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private boolean isEmptyWest()\r\n\t{\r\n\t\treturn (westElem == 0);\r\n\t}",
"private boolean isEmptySouth()\r\n\t{\r\n\t\treturn (southElem == 0);\r\n\t}",
"public boolean isOpen(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return grid[oneDimensional];\n }",
"public boolean isOnscreen( )\r\n {\r\n if ( this.transform.tx( ) + this.width( ) < 0.0f ) return false;\r\n if ( this.transform.tx( ) > SkyDiver.WindowWidth ) return false;\r\n if ( this.transform.ty( ) + this.height( ) < 0.0f ) return false;\r\n if ( this.transform.ty( ) > SkyDiver.WindowHeight ) return false;\r\n\r\n return true;\r\n }",
"private boolean isOccupied(Location loc)\n\t{\n\t\treturn grid[loc.getRow()][loc.getCol()] != null;\n\t}",
"private boolean isEmpty(Point pos){\r\n Cells aux = model.getValueAt(pos);\r\n return (aux == Cells.BLACK_FLOOR);\r\n }",
"public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}",
"public boolean isOpen(int row, int col) {\n if (row < 1 || row > gridSize || col < 1 || col > gridSize) {\n throw new IllegalArgumentException(\"array index out of bounds\");\n }\n\n // 1 --> open site\n return grid[row - 1][col - 1] == 1;\n }",
"private boolean isInGameWindow(){\n if (currPos.x > Window.getWidth() || currPos.y > Window.getHeight()){\n return false;\n }\n return true;\n }",
"public boolean isFull() {\n return (this.top == this.stack.length);\n }",
"public boolean inGrid(int row, int col) {\n return (row >= 0 && col >= 0) &&\n (row < cellNum && col < cellNum);\n }",
"boolean hasWidth();",
"boolean hasWidth();",
"boolean hasWidth();",
"public boolean coordOnBoard(int row, int col, ArrayList<ArrayList<GamePiece>> board) {\n return (0 <= row && row < board.size()) && (0 <= col && col < board.get(0).size());\n }"
]
| [
"0.7434127",
"0.742922",
"0.74152446",
"0.7338581",
"0.7331804",
"0.73164284",
"0.72741836",
"0.7212042",
"0.71626025",
"0.71345526",
"0.7092722",
"0.7019148",
"0.6994887",
"0.69650024",
"0.6882816",
"0.6877432",
"0.6858501",
"0.6855847",
"0.67562354",
"0.67379427",
"0.6727629",
"0.67210805",
"0.67140406",
"0.6655195",
"0.66418546",
"0.6622545",
"0.66154987",
"0.65917915",
"0.65659696",
"0.6559684",
"0.6548004",
"0.6516243",
"0.6499024",
"0.6492045",
"0.64658666",
"0.6452767",
"0.64514506",
"0.64313173",
"0.6416746",
"0.6408962",
"0.6407443",
"0.64037555",
"0.6358376",
"0.6342148",
"0.63237435",
"0.63086945",
"0.62931776",
"0.62895656",
"0.62877566",
"0.62811697",
"0.6278927",
"0.62718976",
"0.6261295",
"0.62535083",
"0.6250693",
"0.62328213",
"0.62300074",
"0.62225217",
"0.6219036",
"0.61864495",
"0.6173123",
"0.6154488",
"0.61438847",
"0.61349976",
"0.61343557",
"0.61343384",
"0.61259824",
"0.61180264",
"0.610708",
"0.6099902",
"0.6091363",
"0.60832834",
"0.6070748",
"0.60689676",
"0.60621035",
"0.60444075",
"0.60281384",
"0.602516",
"0.60164446",
"0.600948",
"0.5993115",
"0.59923834",
"0.59591657",
"0.59526414",
"0.59524584",
"0.5939624",
"0.5928521",
"0.5926772",
"0.5921097",
"0.5916818",
"0.5905066",
"0.5872847",
"0.58693683",
"0.5867239",
"0.5852152",
"0.585063",
"0.58465",
"0.58465",
"0.58465",
"0.583561"
]
| 0.64564 | 35 |
number of open sites | public int numberOfOpenSites() {
return openSites;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int numberOfOpenSites() {\n \treturn num;\r\n }",
"public int numberOfOpenSites(){\n\t\treturn numOpen;\n\t}",
"public int numberOfOpenSites() {\n return NOpen;\r\n }",
"public int numberOfOpenSites() {\n return 0;\n }",
"public int numberOfOpenSites() {\n return count;\n }",
"public int numberOfOpenSites() {\n return numOpen;\n }",
"public int numberOfOpenSites() {\n return (openCount);\n }",
"public int numberOfOpenSites() {\n return numOpen;\n }",
"public int numberOfOpenSites(){\n return numOpenSites;\n }",
"public int numberOfOpenSites() {\n return openNum;\n }",
"public int numberOfOpenSites() {\n \treturn size;\n }",
"public int numberOfOpenSites() {\n return numberOfOpenSites;\n }",
"public int numberOfOpenSites() {\n return mOpenSites;\n }",
"public int numberOfOpenSites()\r\n { return openSites; }",
"public int numberOfOpenSites() {\n\t\treturn openCount;\n\t}",
"public int numberOfOpenSites() {\n return this.numOfOpenSites;\n }",
"public int numberOfOpenSites(){ return openSites; }",
"public int numberOfOpenSites() {\n return openSitesCount;\n }",
"public int numberOfOpenSites() {\n return openSitesCount;\n }",
"public int numberOfOpenSites() {\n return open_blocks;\n }",
"public int getSourceURLCount() {\n int count = 0;\n for (String site : getSourceSites()) {\n count += this.getSourceURLs(site).size();\n }\n return count;\n }",
"private void updateNumVisits(String url)\r\n\t{\r\n\t\tfor(int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif (webVisited[0][i].equals(url))\t\t\t\t\t\t\t\t\t//if the url is found in the array\r\n\t\t\t{\r\n\t\t\t\twebVisited[1][i] = (int)webVisited[1][i] + 1;\t\t\t\t\t//increment the number of times user visited the site\r\n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//break out of the loop\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"int getLinksCount();",
"public static long getNumberOfOpenConnections() {\n return openConnections.size();\n }",
"private int visitedNetworksCount() {\n final HashSet<String> visitedNetworksSet = new HashSet<>(mVisitedNetworks);\n return visitedNetworksSet.size();\n }",
"public int getURLCount(int list) {\n/* 93 */ int result = 0;\n/* 94 */ List urls = (List)this.urlSeries.get(list);\n/* 95 */ if (urls != null) {\n/* 96 */ result = urls.size();\n/* */ }\n/* 98 */ return result;\n/* */ }",
"int getHotelImageURLsCount();",
"public int getWebCount() {\n\t\treturn channelCountMapper.getWebCount();\n\t}",
"int getPeerURLsCount();",
"public static void updateCount(String url) {\n if(sites.isEmpty()) {\n sites.add(new SiteStats(url, 1));\n } else {\n //access via new for-loop\n for(Object object : sites) {\n SiteStats element = (SiteStats) object;\n if ((element.getUrl().equalsIgnoreCase(url))) {\n element.setNumVisits(element.getNumVisits() + 1);\n return;\n }\n }\n sites.add(new SiteStats(url, 1));\n }\n }",
"public int getOpenWhiteListCount() {\n return openWhiteList_.size();\n }",
"public int getOpenWhiteListCount() {\n return openWhiteList_.size();\n }",
"public int getNumVisits() {\n return this.numVisits;\n }",
"int getCityImageURLsCount();",
"@Override\n public int countByUrl(String websiteUrl) {\n return appDao.countByUrl(websiteUrl);\n }",
"int getRequestsCount();",
"int getRequestsCount();",
"@Exported\n public int getNumberOfOnlineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOnline()) {\n count++;\n }\n }\n return count;\n }",
"public int countLink() {\n\t\tint count = 0;\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tPreparedStatement stmt = connection.prepareStatement(\n\t\t\t\t\t\"SELECT count(*) from links\");\n\t\t stmt.execute();\n\t\t ResultSet rs = stmt.executeQuery();\n\t\t\twhile(rs.next()) {\n\t\t\t\tcount = rs.getInt(1);\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tconnection.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn count;\n\t}",
"private void printNumVisited()\r\n\t{\r\n\t\tSystem.out.println(\"\");\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t\tSystem.out.println(webVisited[0][i] + \" visited \" + webVisited[1][i] + \" time(s)\");\r\n\t}",
"public int getHotelImageURLsCount() {\n return hotelImageURLs_.size();\n }",
"public int numofConnections() {\n\t\tint numberofconnection = 0;\n\t\tString node;\n\t\tfor (String key : Nodeswithconnect.keySet()) {\n\t\t\tfor (int i = 0; i < Nodeswithconnect.get(key).length; i++) {\n\t\t\t\tnode = Nodeswithconnect.get(key)[i];\n\t\t\t\tif (!node.equals(\"null\")) {\n\t\t\t\t\tnumberofconnection++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn numberofconnection;\n\t}",
"long getRequestsCount();",
"public int getHotelImageURLsCount() {\n return hotelImageURLs_.size();\n }",
"private synchronized static void incrementNumberOfOpenSockets() {\r\n\r\n\t\tnumberOfOpenSockets++;\r\n\t}",
"@Override\n\tpublic int getOpenPRCount(String pullURL) {\n\t\t\n\t\treturn 0;\n\t}",
"public final int getOpenCount() {\n\t\treturn m_openCount;\n\t}",
"@Override\n\tpublic int getOpenCount(int agentid) {\n\t\treturn 0;\n\t}",
"int getConnectionsCount();",
"public Integer getWebLinkSize() {\r\n\t\treturn webLinks.size();\t\t\r\n\t}",
"public int getTotalVisited(){\n return this.getSea().countVisited();\n }",
"public int getDestURLCount() {\n int count = 0;\n for (String site : getDestSites()) {\n count += this.getDestURLs(site).size();\n }\n return count;\n }",
"Integer getConnectorCount();",
"public static int getLinksCount()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn getService().getLinksCount();\n\t}",
"public long loadAllURLCount()\n\t{\n\t\treturn this.env.getEntityStore().getPrimaryIndex(String.class, URLEntity.class).entities().count();\n\t}",
"public int size() {\n return this.exploreList.size();\n }",
"public void setNumOpens(int n) {\r\n itersOpen = n;\r\n }",
"public int count() {\n return this.visitors.size();\n }",
"public int getSimultanDownloadNumPerHost() {\r\n int ret = 0;\r\n if (!org.jdownloader.settings.staticreferences.CFG_GENERAL.MAX_DOWNLOADS_PER_HOST_ENABLED.isEnabled() || (ret = config.getMaxSimultaneDownloadsPerHost()) <= 0) { return Integer.MAX_VALUE; }\r\n return ret;\r\n }",
"public int getActiveRunwaysCount();",
"public int countByURLTitle(String urlTitle);",
"int getNumSources();",
"int getWifisCount();",
"int getSeenInfoCount();",
"public int manyConnections() {\n\t\tint ammound = 0;\n\t\tfor (int i = 0; i < this.size(); i++) {\n\t\t\tif(this.get(i).clientAlive) {\n\t\t\t\tammound++;\n\t\t\t}\n\t\t\tSystem.out.println(\"Ist Client Nr. \" + i + \" frei? \" + !this.get(i).isAlive());\n\t\t}\n\t\treturn ammound;\n\t\t\n\t}",
"@Exported\n public int getNumberOfOfflineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOffline()) {\n count++;\n }\n }\n return count;\n }",
"public int getNumRobots() {\n return ((Integer)numRobotsSpinner.getValue()).intValue();\n }",
"public int getNumConnects() {\n\t\treturn numConnects;\n\t}",
"public Integer getVisitCount() {\n return visitCount;\n }",
"public Integer getVisitCount() {\n return visitCount;\n }",
"public int getCityImageURLsCount() {\n return cityImageURLs_.size();\n }",
"public int size() {\r\n\t\tint size = 0;\r\n\t\tfor (Integer key : connectionLists.keySet()) {\r\n\t\t\tsize += connectionLists.get(key).size();\r\n\t\t}\r\n\t\treturn size;\r\n\t}",
"int getVersionsCount();",
"private int getLatestWickets() {\n // return 2 for simplicity\n return 2;\n }",
"public int getListCount() { return this.urlSeries.size(); }",
"int getAoisCount();",
"@Test\n public void testNumLinks()\n {\n String[] navLinks = {\"CS1632 D3 Home\", \"Factorial\", \"Fibonacci\", \"Hello\", \"Cathedral Pics\"};\n int numLinks = 0;\n\n for (int i = 0; i < navLinks.length; i++) {\n driver.findElement(By.linkText(navLinks[0])).click();\n List<WebElement> links = driver.findElements(By.tagName(\"a\"));\n assertEquals(5, links.size());\n }\n }",
"public int getCityImageURLsCount() {\n return cityImageURLs_.size();\n }",
"protected double Hops() {\r\n\t\tint hops = 0;\r\n\t\tIterator<Flow> f = this.flows.iterator();\r\n\t\twhile (f.hasNext()) {\r\n\t\t\thops += f.next().getLinks().size();\r\n\t\t}\r\n\t\treturn hops;\r\n\t}",
"public Map<String, Integer> getNoOfHyperMediaLinks(Document doc) {\n logger.log(Level.INFO, \"Getting internal and external links count\");\n Map<String, Integer> hyperMediaLinksMap = new HashMap<>();\n List<String> hyperLinks = getHyperLinks(doc);\n\n int internalLinksCount = 0;\n int externalLinksCount = 0;\n\n try {\n URL url = new URL(doc.baseUri());\n String domain = url.getHost();\n for (String hyperLink : hyperLinks) {\n if (hyperLink.contains(domain))\n internalLinksCount++;\n else\n externalLinksCount++;\n }\n\n hyperMediaLinksMap.put(Constants.INTERNAL_LINKS, internalLinksCount);\n hyperMediaLinksMap.put(Constants.EXTERNAL_LINKS, externalLinksCount);\n } catch (MalformedURLException e) {\n logger.log(Level.SEVERE, \"Malformed URL\", e);\n throw new ApiException(HttpStatus.INTERNAL_SERVER_ERROR, ErrorCodes.MALFORMED_URL);\n }\n return hyperMediaLinksMap;\n }",
"public long lookups() {\r\n\t\treturn _lookups;\r\n\t\t\r\n//\t\tlong size = 0;\r\n//\t\tfor (Integer status : _status.keySet()) {\r\n//\t\t\tif (status != CrawlerConstants.SKIP_SUFFIX && status != CrawlerConstants.SKIP_ROBOTS) {\r\n//\t\t\t\tsize += _status.get(status);\r\n//\t\t\t}\r\n//\t\t}\r\n//\r\n//\t\treturn size;\r\n\t}",
"int getCazuriCount();",
"public int numberOfHotels() {\r\n \tint anzahlHotel=hotelDAO.getHotelList().size();\r\n \treturn anzahlHotel;\r\n }",
"int getFHPackagesCount();",
"int getConnectionCount();",
"int getIndexEndpointsCount();",
"public int getNonResourceUrlsCount() {\n return nonResourceUrls_.size();\n }",
"public abstract void countLaunchingActivities(int num);",
"public long size() {\n return links.length * links.length;\n }",
"public int getCantidadRobots();",
"public int getNonResourceUrlsCount() {\n return nonResourceUrls_.size();\n }",
"public int numberOfOccorrence();",
"int getApplicationsCount();",
"int getSessionCount();",
"public int numConnections(){\n return connections.size();\n }",
"int getInfoCount();"
]
| [
"0.9108626",
"0.8968774",
"0.8968428",
"0.89385223",
"0.8929599",
"0.8927411",
"0.88782996",
"0.8877802",
"0.88760066",
"0.8793068",
"0.8763073",
"0.8754773",
"0.8741213",
"0.8738111",
"0.8713938",
"0.86926174",
"0.86654603",
"0.8657694",
"0.8657694",
"0.8127798",
"0.7115143",
"0.7094629",
"0.70535254",
"0.6934628",
"0.68488437",
"0.68396026",
"0.6775105",
"0.67518306",
"0.67367256",
"0.6708248",
"0.6636662",
"0.66184247",
"0.66079706",
"0.6584316",
"0.65592104",
"0.65486175",
"0.65486175",
"0.6522966",
"0.6506377",
"0.6496959",
"0.64622235",
"0.6426762",
"0.6418205",
"0.6380047",
"0.6309031",
"0.62895745",
"0.62581235",
"0.6251835",
"0.62421596",
"0.6241464",
"0.6234921",
"0.6210679",
"0.61924857",
"0.6191552",
"0.61788404",
"0.6176129",
"0.61725724",
"0.6160215",
"0.6144412",
"0.6127167",
"0.6120869",
"0.61118764",
"0.61098117",
"0.6103427",
"0.61032176",
"0.6097189",
"0.60829747",
"0.60736626",
"0.60652715",
"0.60652715",
"0.60566723",
"0.6041561",
"0.60383743",
"0.6000489",
"0.59996897",
"0.5993439",
"0.5987981",
"0.59771115",
"0.5975917",
"0.597494",
"0.59735703",
"0.59711474",
"0.59651566",
"0.5958471",
"0.59547335",
"0.59543836",
"0.5952241",
"0.5947599",
"0.5947094",
"0.5944168",
"0.5934793",
"0.5931826",
"0.5924443",
"0.5924154",
"0.5922287",
"0.59195864"
]
| 0.87469375 | 16 |
does the system percolate? | public boolean percolates() {
return myUF.connected(n*n, n*n + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void COPower(){\r\n COP = true;\r\n }",
"@Override\n\tpublic void cook() {\n\t\tSystem.out.println(\"Cooking....\\n\");\n\t}",
"public void notificate() {\nSystem.out.println(\"Comman for all\");\r\n\t}",
"public void plum() {\n plum = true;\n }",
"public void act() \n {\n verificaClique();\n }",
"public void crunch(){\n cpuBurstTime--;\n rem--;\n }",
"public boolean cp() {\n return false;\n }",
"void z_piracy()\n {\n //branch (!f_setup.piracy);\n\n }",
"public boolean percolates() {\n return false;\n }",
"private void brewCoffeeGrinds() {\r\n LOG.debug( \"Brewing coffee grinds\" );\r\n }",
"private void promote() {\r\n //promote gives more money\r\n increment();\r\n }",
"@Override\n\tpublic void compete() {\n\t\tSystem.out.println(\"Pawan is competing as a swimming Athlete \");\n\t\t\n\t}",
"@Override\r\n\tvoid poop() {\n\t\tSystem.out.println(\"stinky\");\r\n\t}",
"protected void drink() {\n\t\tSystem.out.println(\"Ape drinking\");\n\t}",
"public void preempt()\n\t{\n\t}",
"public void affichage() {\n if (blanc){\n System.out.print(\"Cb\");\n }\n else{\n System.out.print(\"Cn\");\n }\t\t\n }",
"public void cheat() {\r\n announce( \"cheat\" );\r\n }",
"public void perder() {\n // TODO implement here\n }",
"@Override\n public void perish() {\n \n }",
"public void act1()\r\n {\r\n super.act1();\r\n isPhasing = !isPhasing;\r\n }",
"public boolean activate() { //if true continue to execute\n\n if (Inventory.getCount(PowerFletch.LOG) >= 1) {\n System.out.println(\"cutting activated\");\n\n return true;\n }\n\n return false;\n }",
"@Override\n\tpublic void DoGoToCashier() {\n\t\t\n\t}",
"public void superCOPower(){\r\n SCOP = true;\r\n }",
"boolean isCrouching();",
"public void purr() {\n\t\tSystem.out.println(\"Brrrrrrrrrrrrr\");\n\t}",
"private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}",
"boolean hasToForeman();",
"final void checkForComodification() {\n\t}",
"public void turnOnCooler() {\n oilPompController.turnPompsOn();\n breakController.turnOff();\n mainPowerController.turnOn();\n supportPowerController.turnOn();\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n System.out.println(\"Waiting to stand up was interrupted.\");\n }\n supportPowerController.turnOff();\n System.out.println(\"System is running.\");\n }",
"public void interactWhenSteppingOn() {\r\n\t\t\r\n\t}",
"@Override\n\tpublic long procount() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void cry() \n\t{\n\t\tSystem.out.println(\"喵喵喵\");\n\t\t\n\t}",
"public boolean doPowerUpStuff() {\n System.out.println(\"* Performing robot stuff that we would do on power up.\");\n // Home motors, move stuff to starting position, etc.\n // System.out.println(\"Robot wheelbase in inches: \" + m_robotGeometry.wheelbaseInches);\n return true;\n }",
"private void pump_water() {\n\t\t\r\n\t}",
"public boolean isClimbing ( ) {\n\t\treturn extract ( handle -> handle.isClimbing ( ) );\n\t}",
"public int thunderclap();",
"public void credit(){\n\t\tSystem.out.println(\"hsbc --- credit\");\n\t}",
"public void baocun() {\n\t\t\n\t}",
"public boolean percolates() {\n // The system percolates if top and bottom are connected\n return UF.connected(top, bottom);\n }",
"public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"private boolean Verific() {\n\r\n\treturn true;\r\n\t}",
"public boolean percolates() {\n return this.isPercolated;\n }",
"static void perform_cpo(String passed){\n\t\tint type = type_of_cpo(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_when_parity_not(passed);\n\t\t\tbreak;\n\t\t}\n\t}",
"public boolean percolates() {\n return percolates;\n }",
"@Override\n\tpublic void cookAtHome() {\n\t\t\n\t}",
"protected boolean processSeeksCleared(){return false;}",
"void comer() {\n\t\tSystem.out.println(\"comiendo\");\n\t}",
"public void power()\r\n {\r\n powerOn = true;\r\n }",
"public static void main(String[] args) {\n\t\t\tSystem.out.println(\"Hola Mundo o/\");\n\t\t\t\n\t\t\tint i = 0;\n\t\t\tint nota = 0;\n\t\t\tboolean copia = true;\n\t\t\t\n\t\t\tdo{\n\t\t\tSystem.out.println(\"Tu nota es a\" + nota);\t\n\t\t\t\tif(i>20)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}while(copia);\n\t\t\tSystem.out.println(\"Wiiiiii\");\n\t}",
"public void pourCoffeeImp() {\n\t\tSystem.out.println(\"加奶咖啡\");\n\t}",
"public static void main(String[] args){\n Percolation p = new Percolation(4);\n p.open(0, 1);\n System.out.println(p.percolates());\n p.open(1, 1);\n System.out.println(p.percolates());\n p.open(2, 1);\n System.out.println(p.percolates());\n p.open(3, 1);\n System.out.println(p.percolates());\n }",
"boolean isConsomme();",
"public void thrash();",
"private void canRepair(boolean b) {\n\t\t\n\t}",
"private boolean startScouting(){\n\t\t// calculate motivation to forage based on amount of food in hive\n\t\tdouble motivation = 1 - (hive.food/hive.foodCapacity);\n\t\t\n\t\t// calculate motivation to follow dance based on amount of dances\n\t\tdouble danceFactor = (1-Math.exp((-1/colonySize)*hive.dancingBees.size()));\n\t\t\n\t\t// calculate whether or not bee should scout\n\t\tif(RandomHelper.nextDoubleFromTo(0,1) < scoutProb*motivation + \n\t\t\t\t(1-scoutProb)*motivation*(1-danceFactor)*scoutProb){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// otherwise follow a dance\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic void offMachine() {\n\t\t System.out.println(\"Off the machine when the cook is done \");\r\n\t}",
"void cook(Food food) {\n //cook in pressure cooker\n }",
"@Override\n\tpublic void cry() {\n\t\tSystem.out.println(\"黄种人-哭\");\n\t}",
"public void swim() {\n\t\tSystem.out.println(\"All the ducks can swim. This is an unchanged behavior for all ducks\");\n\t}",
"public void charge() {\n\t\t\tSystem.out.println(\"Battery is charging\");\n\t\t}",
"static void perform_cp(String passed){\n\t\tint type = type_of_cp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_when_sign_not(passed);\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\n\tpublic void operate() {\n\t\tSystem.out.println(\"이동중 연산을 해요!\");\n\t}",
"public void evolve() {\n\t\tfurniturePriority++;\r\n\t}",
"public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}",
"public void credit() {\n\t\tSystem.out.println(\"HSBC---credit\");\n\t}",
"@Test\n void cupTesting() {\n Assertions.assertFalse(machine.isCupPositioned());\n Assertions.assertFalse(machine.removeCup());\n\n Assertions.assertDoesNotThrow(() -> machine.positionCup());\n\n Assertions.assertTrue(machine.removeCup());\n Assertions.assertFalse(machine.isCupPositioned());\n machine.setCupPositioned(true);\n Assertions.assertTrue(machine.isCupPositioned());\n\n }",
"public boolean commutes(){\n\t\treturn false;\n }",
"@Override\r\n\tpublic void cookChicken(int noOfChicken) {\n System.out.println(\"please place the chicken in the grill machine\");\r\n grillmachine.setState(grillmachine.getCookingState());\r\n\t}",
"public synchronized int pencil() throws InterruptedException {\n\t\tThread.currentThread().destroy();\n\t\treturn 2;\n\t}",
"public int invokeCutMode()\n{\n \n return(0);\n\n}",
"@Override public boolean active() {\n General.sleep(200, 300); // Reduces CPU usage.\n return isAtFish();\n }",
"private void oops(){\n\t\tSystem.out.println(\"Oops! \" +getCandyName() +\" is delicious! I ate that one.\");\n\t}",
"@Override\n\tpublic boolean paie() {\n\n\t\treturn true;\n\t}",
"@Override\n\tpublic void msgAtCooking() {\n\t\t\n\t}",
"public void act() \r\n {\r\n super.mueve();\r\n super.tocaBala();\r\n super.creaItem();\r\n \r\n if(getMoveE()==0)\r\n {\r\n \r\n if(shut%3==0)\r\n {\r\n dispara();\r\n shut=shut%3;\r\n shut+=1;\r\n \r\n }\r\n else \r\n shut+=1;\r\n }\r\n super.vidaCero();\r\n }",
"public boolean isCursing() {\n\t\treturn methods.settings.getSetting(1584) % 2 != 0;\n\t}",
"public void run() {\n Set<Philosopher> disabledPhils = new HashSet<Philosopher>();\r\n // True if last philosopher who tried to eat succeed\r\n boolean wasAttemptSuccessful = false;\r\n final long startTime = System.currentTimeMillis();\r\n while (System.currentTimeMillis() - startTime < runningTime) {\r\n if (wasAttemptSuccessful || hungryPhils.isEmpty()) {\r\n hungryPhils.addAll(disabledPhils);\r\n disabledPhils.clear();\r\n }\r\n Philosopher philBeingServed = null;\r\n try {\r\n philBeingServed = hungryPhils.take(); // get phil with the highest priority\r\n disabledPhils.add(philBeingServed);\r\n if (forks.get(philBeingServed.id).attempt(1)) { // Could use tryLock instead\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] took left fork\");\r\n }\r\n if (forks.get(philBeingServed.id + 1).attempt(Math.round(Math.random() *\r\n (MAX_ATTEMPT_TIME + 1)))) {\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] took right fork\");\r\n }\r\n philBeingServed.giveMeal();\r\n disabledPhils.remove(philBeingServed);\r\n wasAttemptSuccessful = true;\r\n } else {\r\n wasAttemptSuccessful = false;\r\n forks.get(philBeingServed.id).release();\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] put left fork\");\r\n }\r\n }\r\n } else {\r\n wasAttemptSuccessful = false;\r\n }\r\n } catch (InterruptedException e) {\r\n if (philBeingServed != null) {\r\n forks.get(philBeingServed.id).release();\r\n forks.get(philBeingServed.id + 1).release();\r\n }\r\n e.printStackTrace();\r\n }\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.printf(\"\\n\\n\"); // Kinda delimiter\r\n FireStarter.isDebugEnabled = false; // Stop producing messages from philosophers\r\n }\r\n }\r\n }",
"@Override\n public void bake() {\n System.out.println(\"Bake Pepporonie Pizza !!\");\n }",
"@Override\n\tpublic void fly() {\n\t\tSystem.out.println(\"Parrot can fly\");\t \n\t}",
"private void relax()\n {\n System.out.println(\"You take a few deep breaths and really notice the beauty of the environment around you.\");\n }",
"@Override\n\tpublic void ccc() {\n\t\t\n\t}",
"public void credit(){\n\t\tSystem.out.println(\"hdfcbank credited\");\n\t\t\n\t}",
"public DefaultStabilizeClimb() {\n\t\trequires(Robot.climb);\n\t}",
"private void doUnchokes() { \n\n\t\t// logic below is either 1 second or 10 secondly, bail out early id neither\n\n\t\tif( !UploadSlotManager.AUTO_SLOT_ENABLE ) {\t\t //manual per-torrent unchoke slot mode\n\n\t\t\tif( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ) { \n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfinal int max_to_unchoke = adapter.getMaxUploads(); //how many simultaneous uploads we should consider\n\t\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\t\t//determine proper unchoker\n\t\t\tif( seeding_mode ) {\n\t\t\t\tif( unchoker == null || !(unchoker.isSeedingUnchoker()) ) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( true );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( unchoker == null || unchoker.isSeedingUnchoker()) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( false );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t//do main choke/unchoke update every 10 secs\n\t\t\t\n\t\t\tif ( mainloop_loop_count % MAINLOOP_TEN_SECOND_INTERVAL == 0 ){\n\n\t\t\t\tfinal boolean refresh = mainloop_loop_count % MAINLOOP_THIRTY_SECOND_INTERVAL == 0;\n\n\t\t\t\tunchoker.calculateUnchokes( max_to_unchoke, peer_transports, refresh, adapter.hasPriorityConnection());\n\n\t\t\t\tArrayList\tchokes \t\t= unchoker.getChokes();\n\t\t\t\tArrayList\tunchokes\t= unchoker.getUnchokes();\n\t\t\t\t\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( chokes, unchokes );\n\t\t\t\t\n\t\t\t}else if ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL == 0 ) { //do quick unchoke check every 1 sec\n\n\t\t\t\tArrayList unchokes = unchoker.getImmediateUnchokes( max_to_unchoke, peer_transports );\n\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( null, unchokes );\n\t\t\t}\n\t\t}\n\t}",
"public void canclePraise(int po_id) {\n\t\tpm.canclePraise(po_id);\r\n\t}",
"public boolean togglePower() {\r\n if(power) {\r\n pioneerclient.sendCommand(\"PF\");\r\n return false;\r\n } else {\r\n pioneerclient.sendCommand(\"PO\");\r\n return true;\r\n }\r\n\t}",
"public boolean isCarry() {\n\t\treturn ((get() >> 4) & 1) == 1;\n\t}",
"@Override\n\tpublic void attack() {\n\t\tSystem.out.println(\"Woof! Woof! *Crunch!*\");\n\t}",
"protected BigDecimal reword(){\n\t\tif(getNowAct() == 0){\n\t\t\treturn(rewordBuy());\n\t\t}\n\t\t//keep\n\t\telse if(getNowAct() == 1){\n\t\t\treturn(rewordWait());\n\t\t}\n\t\t//sell\n\t\telse if(getNowAct() == 2){\n\t\t\treturn(rewordSell());\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"getNowAct : \" + getNowAct() + \"\\nerror occur.\");\n\t\t\tSystem.exit(2);\n\t\t\treturn(null);\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean isConcave() {\n\t\treturn false;\r\n\t}",
"public static void main (String[] args) {\n testchackAp();\n\n // Движение ctrl + shift вниз\n }",
"@Override\r\n\tpublic void credit() {\n\t\tSystem.out.println(\"Core Method of Child\");\r\n\t}",
"public void act() \n {\n setLocation(getX(),getY()+1);\n givePower();\n delete();\n }",
"public boolean isExecuting(){\n return !pausing;\n }",
"public void buyFarm(){\n bought = !bought;\n }",
"private void checkForCPUChance()\n\t\t\t{\n\t\t\t\tf12 = false;\n\t\t\t\tfor (m = 0; m < 8; ++m)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lose[m] == 2 && win[m] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tf12 = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (f12 == false)\n\t\t\t\t\tm = 10;\n\n\t\t\t}",
"@Override\n public int continuar() {\n // TODO Auto-generated method stub\n return 0;\n }",
"@Override\r\n\tpublic void chocarOvos() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void chocarOvos() {\n\t\t\r\n\t}",
"public void comer(){\r\n\t\tSystem.out.println(\"He comido\");\r\n\t}",
"public boolean poison() {\r\n\t\tstrength = 0;\r\n\t\treturn true;\r\n\t}"
]
| [
"0.6087865",
"0.5873111",
"0.5701228",
"0.5610626",
"0.5603718",
"0.55497676",
"0.553736",
"0.5534243",
"0.5494445",
"0.5492496",
"0.548774",
"0.5427967",
"0.54149324",
"0.54041725",
"0.5397156",
"0.5385371",
"0.53761727",
"0.53700554",
"0.5365661",
"0.53653276",
"0.5354736",
"0.5353407",
"0.53310114",
"0.53265184",
"0.53196615",
"0.5317566",
"0.5307498",
"0.5306797",
"0.5297271",
"0.5288184",
"0.52866244",
"0.5253358",
"0.5238576",
"0.5233112",
"0.5232994",
"0.5231002",
"0.52201575",
"0.52117",
"0.52096677",
"0.51796484",
"0.51653415",
"0.5164077",
"0.51635695",
"0.51632947",
"0.5154984",
"0.51459813",
"0.51175594",
"0.5114144",
"0.51079315",
"0.5106025",
"0.5096882",
"0.509583",
"0.5089225",
"0.5088427",
"0.5065203",
"0.5065163",
"0.50624233",
"0.50569636",
"0.5047668",
"0.5045204",
"0.50415456",
"0.5036418",
"0.5032196",
"0.50305325",
"0.50305325",
"0.5028148",
"0.5018374",
"0.5016951",
"0.50166965",
"0.5015995",
"0.50138795",
"0.5012006",
"0.50034505",
"0.5000199",
"0.49995872",
"0.49949846",
"0.49933782",
"0.49839246",
"0.49838272",
"0.49814418",
"0.49795043",
"0.49765325",
"0.49746257",
"0.49666956",
"0.49611977",
"0.49567518",
"0.49518013",
"0.49503222",
"0.49496025",
"0.4944899",
"0.49447945",
"0.49435595",
"0.4939655",
"0.49389276",
"0.49385303",
"0.49352154",
"0.4934322",
"0.49327382",
"0.49327382",
"0.4932606",
"0.49318138"
]
| 0.0 | -1 |
Determines whether a candidate Matching represents a solution to the Stable Marriage problem. Study the description of a Matching in the project documentation to help you with this. | @Override
public boolean isStableMatching(Matching marriage) {
int residentsNumber = marriage.getResidentCount();
ArrayList<Integer> resident_matching = marriage.getResidentMatching();
ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();
ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();
/*To check later if all slots are filled */
int matchedResidents=0;
/*loop through all residents*/
for (int resident = 0; resident < residentsNumber; resident++) {
if(resident_matching.get(resident)!=-1)
matchedResidents++;
int matchedHospital = resident_matching.get(resident);
if (matchedHospital == -1)
continue;
/*loop through all residents before the selected resident in the matched hospital's preference list*/
for (int residentToCompareIndex = 0; residentToCompareIndex < hospital_preference.get(matchedHospital).indexOf(resident); residentToCompareIndex++) {
int residentToCompare = hospital_preference.get(matchedHospital).get(residentToCompareIndex);
int matchedHospitalToCompare = resident_matching.get(residentToCompare);
/*check for 1st instability*/
if (matchedHospitalToCompare == -1)
return false;
/*check for 2nd instability*/
else if (resident_preference.get(residentToCompare).indexOf(matchedHospital) < resident_preference.get(residentToCompare).indexOf(matchedHospitalToCompare))
return false;
}
}
if(matchedResidents!=marriage.totalHospitalSlots())
return false;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isMatch();",
"@Override\n\tpublic boolean isIsSingleMatch() {\n\t\treturn _esfTournament.isIsSingleMatch();\n\t}",
"@Override\n\tpublic boolean isIsTeamMatch() {\n\t\treturn _esfTournament.isIsTeamMatch();\n\t}",
"@Override\n\tpublic boolean isIsNationalMatch() {\n\t\treturn _esfTournament.isIsNationalMatch();\n\t}",
"public boolean isExactMatch() {\n return exactMatch;\n }",
"public boolean isMatched() {\r\n return this.matched;\r\n }",
"public boolean isGameSolved() {\n Block[] blocks = board.getBlocks();\n\n for (Block block: blocks) {\n if (!isBlockSolved(block))\n return false;\n }\n\n for (int r = 0; r < 9; r++) {\n if (!isRowSolved(this.board, r)) {\n return false;\n }\n }\n\n for (int c = 0; c < 9; c++) {\n if (!isColumnSolved(this.board, c)) {\n return false;\n }\n }\n\n return true;\n }",
"public int doesCardMatchCurrentPlayerTerritory() {\r\n\t\tint countMatchingCards = 0;\r\n\r\n\t\tfor (RiskCardModel card : risk.curPlayer.getCard()) {\r\n\t\t\tfor (RiskTerritoryModel territory : risk.curPlayer.getOccupiedTerritories()) {\r\n\t\t\t\tif (territory.getId() == card.territory)\r\n\t\t\t\t\tcountMatchingCards++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn countMatchingCards;\r\n\t}",
"private Matching getBruteForceCorrectMatching(ArrayList<Matching> stableMatchings, ArrayList<ArrayList<Integer>> validPartners) {\n for (int matching = 0; matching < stableMatchings.size(); matching++) {\n if (stableMatchings.get(matching).getResidentMatching().equals(validPartners.get(0)))\n return stableMatchings.get(matching);\n }\n return null;\n }",
"@Override\n\tpublic boolean isIsIndividualMatch() {\n\t\treturn _esfTournament.isIsIndividualMatch();\n\t}",
"private boolean isFullyMatched() {\n\t\treturn subBeatMatches > 0 && beatMatches > 0;\n\t}",
"public boolean isMatched() {\n return ruleCount == matches;\n }",
"public boolean strictMatches() { return strict_matches_cbmi.isSelected(); }",
"@Override\n\tpublic boolean getIsSingleMatch() {\n\t\treturn _esfTournament.getIsSingleMatch();\n\t}",
"public boolean match(BoardSpace that);",
"public boolean getMatch() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isIsJuniorMatch() {\n\t\treturn _esfTournament.isIsJuniorMatch();\n\t}",
"@Override\n public boolean matches(AllocationCandidate candidate) {\n return true;\n }",
"public boolean isSolved()\r\n\t{\r\n\t\t\r\n\t}",
"public boolean isSolved() {\n\t\tboolean solved = true;\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++ ) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tVariable var = Sudoku.grid[row][col];\n\t\t\t\tif (!var.isFound()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\treturn solved;\n\t}",
"public boolean isSolved(){\n\t\t// if any of row, col, and block contains 1,2,...,size*size,\n\t\t// then the sudoku is solved\n\t\tList<Integer> correctArray = new ArrayList<Integer>(size*size);\n\t\tfor (int i = 0; i < size*size; i++){\n\t\t\tcorrectArray.add(i+1);\n\t\t}\n\t\tfor (int n = 0; n < size*size; n++){\n\t\t\tif (!(this.getRowAsList(n).containsAll(correctArray)))\n\t\t\t\treturn false;\n\t\t\tif (!(this.getColAsList(n).containsAll(correctArray)))\n\t\t\t\treturn false;\n\t\t\tif (!(this.getBlockAsList(n).containsAll(correctArray)))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isSolvable() {\n Board twin = initial.twin();\n MinPQ<Node> mainQueue = new MinPQ<>(getComparator());\n MinPQ<Node> twinQueue = new MinPQ<>(getComparator());\n mainQueue.insert(new Node(initial, 0, null));\n twinQueue.insert(new Node(twin, 0, null));\n while (this.solution == null) {\n Node temp = mainQueue.delMin();\n if (temp.board.isGoal()) {\n this.solution = temp;\n return true;\n }\n Iterable<Board> nebrs = temp.board.neighbors();\n for (Board x : nebrs) {\n if (!x.equals(temp.previousNode.board)) {\n mainQueue.insert(new Node(x, temp.movesToBoard + 1, temp));\n }\n }\n Node temp2 = twinQueue.delMin();\n if (temp2.board.isGoal()) {\n this.solution = null;\n return false;\n }\n Iterable<Board> nebrs2 = temp2.board.neighbors();\n for (Board x : nebrs2) {\n if (!x.equals(temp2.previousNode.board)) {\n twinQueue.insert(new Node(x, temp2.movesToBoard + 1, temp2));\n }\n }\n }\n return false;\n }",
"public boolean checkR1(String candidateSolution){\n\t\tint number = Integer.parseInt(candidateSolution);\n\t\tif(number > 0){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean hasCandidate();",
"@Override\n\tpublic boolean isSolved () {\n\t\tCube222 solved = new Cube222();\n\t\tfor ( int ctr = 0 ; ctr < state_.length ; ctr++ ) {\n\t\t\tif ( state_[ctr].id() != ctr\n\t\t\t || state_[ctr].frontback() != solved.state_[ctr].frontback()\n\t\t\t || state_[ctr].updown() != solved.state_[ctr].updown()\n\t\t\t || state_[ctr].leftright() != solved.state_[ctr].leftright() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Override\n public Matching stableMarriageBruteForce_residentoptimal(Matching marriage) {\n int residentsNumber = marriage.getResidentCount();\n int hospitalSlots = marriage.totalHospitalSlots();\n\n ArrayList<ArrayList<Integer>> validPartners = new ArrayList<ArrayList<Integer>>(0);\n ArrayList<Matching> stableMatchings = new ArrayList<Matching>();\n int count = 0;\n\n Permutation p = new Permutation(residentsNumber, hospitalSlots);\n Matching matching;\n int i=0;\n while ((matching = p.getNextMatching(marriage)) != null) {\n i++;\n\n if (isStableMatching(matching)) {\n stableMatchings.add(matching);\n validPartners.add(matching.getResidentMatching());\n count++;\n }\n }\n\n if (count == 1)\n return stableMatchings.get(0);\n\n validPartners = sortValidPartners(marriage, stableMatchings.size(), validPartners);\n\n return getBruteForceCorrectMatching(stableMatchings, validPartners);\n }",
"public boolean isSolved() {\n\t\tfor (int i=0; i<size*size; i++) {\n\t\t\tif (inRow(0, i) || inCol(0,i) || inBox(0,i)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public boolean stitchWillWork()\n {\n // get features\n ImageFeatures features = new ImageFeatures(this.vlImages.size());\n MatVector feature_find_masks = new MatVector(this.vlImages.size());\n computeImageFeatures(stitcher.featuresFinder(), this.vlImages, features, feature_find_masks);\n\n // get matches\n MatchesInfo matchesInfo = new MatchesInfo(this.vlImages.size());\n stitcher.featuresMatcher().apply2(features, matchesInfo, new UMat());\n stitcher.featuresMatcher().collectGarbage();\n\n // figure out if all the images should be in pano\n IntPointer indices = leaveBiggestComponent(features, matchesInfo, (float) stitcher.panoConfidenceThresh());\n// int[] ints = indices.getStringCodePoints();\n// System.out.println(indices.capacity());\n// System.out.println(\"len: \" + ints.length);\n// System.out.println(Arrays.toString(ints));\n\n // composePanorama relies on the fact that you will provide the same number of images as it determined the panorama should contain\n return indices.capacity() == this.vlImages.size();\n }",
"@Override\n\tpublic boolean getIsNationalMatch() {\n\t\treturn _esfTournament.getIsNationalMatch();\n\t}",
"private boolean isSolvable() {\n\t\tshort permutations = 0; // the number of incorrect orderings of tiles\n\t\tshort currentTileViewLocationScore;\n\t\tshort subsequentTileViewLocationScore;\n\n\t\t// Start at the first tile\n\t\tfor (int i = 0; i < tiles.size() - 2; i++) {\n\t\t\tTile tile = tiles.get(i);\n\n\t\t\t// Determine the tile's location value\n\t\t\tcurrentTileViewLocationScore = computeLocationValue(tile\n\t\t\t\t\t.getCorrectLocation());\n\n\t\t\t// Compare the tile's location score to all of the tiles that\n\t\t\t// follow it\n\t\t\tfor (int j = i + 1; j < tiles.size() - 1; j++) {\n\t\t\t\tTile tSub = tiles.get(j);\n\n\t\t\t\tsubsequentTileViewLocationScore = computeLocationValue(tSub\n\t\t\t\t\t\t.getCorrectLocation());\n\n\t\t\t\t// If a tile is found to be out of order, increment the number\n\t\t\t\t// of permutations.\n\t\t\t\tif (currentTileViewLocationScore > subsequentTileViewLocationScore) {\n\t\t\t\t\tpermutations++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return whether number of permutations is even\n\t\treturn permutations % 2 == 0;\n\t}",
"public boolean isSolutionExist() {\n // Mengecek apakah sebuah matriks SPL memiliki solusi\n boolean ada_solusi = true;\n\n int i = this.NBrsEff - 1;\n\n while(ada_solusi && i >= 0){\n int j = 0;\n boolean found = false;\n\n while(!found && j <= this.NKolEff) {\n if(this.M[i][j] != 0 && j != this.NKolEff - 1) {\n found = true;\n }\n j += 1;\n }\n\n if(!found) {\n boolean all_zero_brs = false;\n\n for(int k = 0; k < this.NBrsEff; k++){\n if(this.isAllZeroBrs(k)) {\n all_zero_brs = true;\n }\n }\n\n if(!all_zero_brs) {\n ada_solusi = false;\n }\n }\n\n i -= 1;\n }\n\n return ada_solusi;\n }",
"public boolean matches(InventoryCrafting inventoryCrafting,IInventory schematic, World par2World) {\r\n\t\tfor (int i = 0; i <= 5 - this.recipeWidth; ++i) {\r\n\t\t\tfor (int j = 0; j <= 5 - this.recipeHeight; ++j) {\r\n\t\t\t\tif (this.checkMatch(inventoryCrafting, schematic, i, j, true)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.checkMatch(inventoryCrafting, schematic, i, j, false)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"public boolean isSolution() {\n\t\t\n\t\tboolean foundSolution = false;\n\t\t\n\t\tif (inconsistencyCount == 0) {\n\t\t\tfoundSolution = true;\n\t\t\tSet<PlanGraphLiteral> lastLevelFacts = facts.get(maxLevel);\n\t\t\tPlanGraphStep endStep = steps.get(maxLevel + 1).iterator().next();\n\t\t\tfor (PlanGraphLiteral goalCondition : endStep.getParentNodes()) {\n\t\t\t\tif (!lastLevelFacts.contains(goalCondition)) {\n\t\t\t\t\tinconsistencies.get(maxLevel).add(new UnsupportedPrecondition(goalCondition, maxLevel));\n\t\t\t\t\tinconsistencyCount++;\n\t\t\t\t\tfoundSolution = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn foundSolution;\n\t}",
"public int verify(String candidateSolution) {\n\t\treturn 0;\n\t\t\n\t\t//check\n\t}",
"public int verify(String candidateSolution) {\n\t\treturn 0;\n\t\t\n\t\t//check\n\t}",
"@Override\n\tpublic boolean getIsTeamMatch() {\n\t\treturn _esfTournament.getIsTeamMatch();\n\t}",
"private boolean matches(MetricalLpcfgMatch matchType) {\n\t\tswitch (matchType) {\n\t\t\tcase SUB_BEAT:\n\t\t\t\treturn subBeatMatches > 0;\n\t\t\t\t\n\t\t\tcase BEAT:\n\t\t\t\treturn beatMatches > 0;\n\t\t\t\t\n\t\t\tcase WRONG:\n\t\t\t\treturn isWrong();\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public boolean isSolved() {\n return (this.getCellNumber() != 0);\n }",
"public boolean isBoardSolved() {\n for (int goal : goalCells) {\n if (!((board[goal] & 15) == BOX_ON_GOAL)) {\n return false;\n }\n }\n return true;\n }",
"public boolean hasSolved()\r\n {\r\n for (Food food : getFoods())\r\n {\r\n //if food is moving the board is not solved yet\r\n if (food.hasVelocity())\r\n return false;\r\n \r\n //if the food is still in the playing area the board is not solved yet\r\n if (food.getRow() <= VALID_ROWS)\r\n return false;\r\n }\r\n \r\n return true;\r\n }",
"private boolean isFound(int remaingingMarbles) {\n\n return (Math.log(remaingingMarbles) / Math.log(2)) % 1 == 0 ;\n\n }",
"public void calcMatch() {\n if (leftResult == null || rightResult == null) {\n match_score = 0.0f;\n } else {\n match_score = FaceLockHelper.Similarity(leftResult.getFeature(), rightResult.getFeature(), rightResult.getFeature().length);\n match_score *= 100.0f;\n tvFaceMatchScore1.setText(Float.toString(match_score));\n llFaceMatchScore.setVisibility(View.VISIBLE);\n\n }\n }",
"public boolean hasFinished() {\n\n if(!matching) {\n boolean first = true;\n for(S left : slp.getAxioms()) {\n if(slp.length(left, first) == 1) {\n return true;\n }\n first = false;\n }\n }\n\n if(matching) {\n long patternLen = slp.length(patter, true);\n if(patternLen == 1) {\n return true;\n }\n }\n\n return false;\n }",
"@Test\r\n\tpublic void testStartMatchToMatchLeaguePlayMatch1() {\n\t\tassertTrue(\"Portfolio value does not equal initial balance\", false);\r\n\t\t//Check that players cannot change their portfolios\t\t\r\n\t\tassertTrue(\"Stock holdings may not be modified\", false);\r\n\t}",
"private boolean isMatch(AxiomTreeNode t1, AxiomTreeNode t2, AxiomTreeMapping mapping) {\n\n boolean match;\n //System.out.println(\"MATCHING: \" + t1 + \" \" + t2);\n //System.out.println(\"t1: \" + t1);\n //System.out.println(\"t2: \" + t2);\n // nodes must have the same number of children\n if (t1.getChildCount() != t2.getChildCount()) {\n match = false;\n //System.out.println(\"DIFFERENT CHILD COUNT\");\n //System.out.println(\"\");\n return match;\n }\n\n // string matching for operators\n if (isOperator(t1) && isOperator(t2)) {\n match = t1.sameLabel(t2);\n // System.out.println(\"OPERATORS. Label matching is: \"+ match);\n // System.out.println(\"\");\n return match;\n } else {\n // else check whether the nodes violate an existing mapping\n if (compatibleNodeTypes(t1, t2) && !mapping.violatesStrictMapping(t1, t2)) {\n \t//System.out.println(\"AT LEAST ONE NON OPERATOR. Compatible.\");\n \t//System.out.println(\"\");\n return true;\n }\n }\n //System.out.println(\"Fails all tests.\");\n //System.out.println(\"\");\n return false;\n\n }",
"public boolean matchResult() {\n return !pathMatchDependencies.isEmpty();\n }",
"protected int matches(Alignment alignment) {\n\t\treturn 1;\n\t}",
"public boolean canAddMatch(Tournament tournament, Round round) {\r\n\t\tList<Player> availablePlayers = FXCollections.observableArrayList(round.getPlayers());\r\n\t\tfor (Match match : round.getMatches()) {\r\n\t\t\tListUtil.removeAll(availablePlayers, match.getHomeTeam());\r\n\t\t\tListUtil.removeAll(availablePlayers, match.getAwayTeam());\r\n\t\t}\r\n\t\treturn availablePlayers.size() >= tournament.getTeamSize() * 2;\r\n\t}",
"@Test\r\n\tpublic void testStartMatchToMatchLeaguePlayMatch2() {\n\t\tassertTrue(\"Portfolio value does not equal initial balance\", false);\r\n\t\t//Check that players cannot change their portfolios\t\t\r\n\t\tassertTrue(\"Stock holdings may not be modified\", false);\r\n\t}",
"public boolean isMatch(String s, String p) {\n\n return match_dymaic_plan_bottom_up(s, p);\n \n }",
"private boolean matchesPrediction(int row) {\n \tfor (int j = 0; j < width; j++) {\n \t\tif (predictions[row][j] != UNKNOWN && matrix[row][j] != predictions[row][j]) {\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\n }",
"public boolean isWinnable() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n if(Solution.size() == 0) {\n //No Solution\n return false;\n }\n return true;\n }",
"public int verify(String candidateSolution) {\n\t\tif(checkR1(candidateSolution)) {\n\t\t\treturn 0;\n\t\t} else if (checkR2(candidateSolution)) {\n\t\t\treturn 1;\n\t\t}\n\t\telse if (checkR3(candidateSolution)) {\n\t\t\treturn 2;\n\t\t}\n\t\telse if (checkR4(candidateSolution)) {\n\t\t\treturn 3;\n\t\t}\n\t\telse if (checkR2(candidateSolution)) {\n\t\t\treturn 4;\n\t\t}\n\t\treturn -1;\n\t\t\t\n\t\t\n\t\t//check\n\t}",
"public boolean checkstability()\r\n\t\t{\r\n\t\t\tArrayList<String> previouselement = null;\r\n\t\t\t\r\n\t\t\tSystem.out.println(womenmatchinlist);\r\n\t\t\t\r\n\t\t\tfor(int l=0;l<womenmatchinlist.size();l++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tString matchedman = menmatchinglist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tString matchedwoman = womenmatchinlist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tint matchedwomanindex = women.indexOf(matchedwoman);\r\n\t\t\t\t\r\n\t\t\t\tfor(int z=0;z<women.size();z++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\tif(womenpreflist[matchedwomanindex][z].equals(matchedman))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(z>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor(int s=0;s<=z;s++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tpreviouselement = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tpreviouselement.add(womenpreflist[matchedwomanindex][s]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(previouselement.isEmpty()==false)\r\n\t\t\t\t{\r\n\r\n\t\t\t\tfor(int t=0;t<previouselement.size();t++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tString higherpreferman = previouselement.get(t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// find current partner of higherpreferman\r\n\t\t\t\t\t\r\n\t\t\t\t\tint higherprefmenindex = menmatchinglist.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\tString currentpartnerofhigher = womenmatchinlist.get(higherprefmenindex);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tint tempindex = men.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<numberofwomen;i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// if new partner comes before current partner then return true\r\n\t\t\t\t\t\tif(menpreflist[tempindex][i].equals(currentpartnerofhigher))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// otherwise return false\r\n\t\t\t\t\t\tif(womenpreflist[tempindex][i].equals(matchedwoman))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\t}",
"private boolean checkMatch(InventoryCrafting inventoryCrafting,IInventory schematic, int par2, int par3, boolean par4) {\r\n\t\tfor (int k = 0; k < 5; ++k) {\r\n\t\t\tfor (int l = 0; l < 5; ++l) {\r\n\t\t\t\tint i1 = k - par2;\r\n\t\t\t\tint j1 = l - par3;\r\n\t\t\t\tItemStack itemstack = null;\r\n\r\n\t\t\t\tif (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) {\r\n\t\t\t\t\tif (par4) {\r\n\t\t\t\t\t\titemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\titemstack = this.recipeItems[i1 + j1 * this.recipeWidth];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tItemStack itemstack1 = inventoryCrafting.getStackInRowAndColumn(k, l);\r\n\r\n\t\t\t\tif (itemstack1 != null || itemstack != null) {\r\n\t\t\t\t\tif (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItem() != itemstack1.getItem()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// for debugging\r\n\t\t/* if(schematicTypeNeeded != null)\r\n\t\t * System.out.println(schematicTypeNeeded.getUnlocalizedName());\r\n\t\t * else System.out.println(\"null type needed\"); */\r\n\r\n\t\t// if there is no specilness needed, just return true\r\n\t\tif (schematicTypeNeeded == null) return true;\r\n\r\n\t\tItemStack schematicStack = schematic.getStackInSlot(0);\r\n\t\t\r\n\t\tif (schematicStack == null) return false;\r\n\r\n\t\tSystem.out.println(schematicStack.getUnlocalizedName());\r\n\r\n\t\tSystem.out.println(\"[NausicaaMod] block that needs schematic\");\r\n\r\n\t\tif (!schematicStack.hasTagCompound()) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled: no tags\");\r\n\t\t\treturn false;\r\n\r\n\t\t} else if (!SchematicHolder.getCanCraft(schematicStack, schematicTypeNeeded)) {\r\n\t\t\tSystem.out.println(\"[NausicaaMod] crafting canceled\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}",
"public Player isMatchWon(final String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> isMatchWon: matchId=\" + matchId);\r\n Match match = getMatchById(matchId);\r\n Player player1 = match.getPlayer1();\r\n Player player2 = match.getPlayer2();\r\n int sunkBoatsP1 = countOfStatus(player1, FIELD_SUNK);\r\n int sunkBoatsP2 = countOfStatus(player2, FIELD_SUNK);\r\n if(sunkBoatsP1 == 30){\r\n return player2;\r\n }else if(sunkBoatsP2 == 30){\r\n return player1;\r\n } else {\r\n return null;\r\n }\r\n}",
"@Override\n\t\tpublic boolean isValidSolution() {\n\t\t\treturn super.isValidSolution();\n\t\t}",
"public boolean isSolution(int sol[], Square adjacents[], int s) {\n\t\tint accumulated=0,total=0; \n\t\tfor (int k = 0; k < sol.length; k++) {\n\t\t\taccumulated += sol[k];\n\t\t\ttotal += posibleAmount(getSquare(adjacents[k]));\n\t\t} \n\t\treturn (accumulated==Integer.min(total, s));\n\t}",
"Match getResultMatch();",
"public boolean solutionTest(MyList<Integer> candidates) {\n\n\t\t// -----------------------------\n\t\t// Output Variable --> InitialValue\n\t\t// -----------------------------\n\t\tif (candidates.length() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\t// -----------------------------\n\t\t// Output Variable --> Return FinalValue\n\t\t// -----------------------------\n\t\treturn false;\n\t}",
"float getMatch();",
"public boolean matchesFilled() throws SQLException {\n\t\ttry {\n\t\t\tif (getMatches().last() == true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isMatch(){\r\n boolean[][] match=new boolean[lens+1][lenp+1];\r\n match[lens][lenp]=true;\r\n \r\n for(int i=lenp-1;i>=0;i--){\r\n if(pattern.charAt(i)!='*')\r\n break;\r\n else\r\n match[lens][i]=true;\r\n }\r\n for(int i=lens-1;i>=0;i--){\r\n for(int j=lenp-1;j>=0;j--){\r\n if(str.charAt(i)==pattern.charAt(j)||pattern.charAt(j)=='.')\r\n match[i][j]=match[i+1][j+1];\r\n else if(pattern.charAt(j)=='*')\r\n match[i][j]=match[i+1][j]||match[i][j+1];\r\n else\r\n match[i][j]=false;\r\n }\r\n }\r\n return match[0][0];\r\n }",
"public boolean isSatisfiedBySolution(Solution possibleSolution){\n\t\treturn !Collections.disjoint(possibleSolution.getColors(), preferences);\n\t}",
"@Override\n\tpublic boolean getIsIndividualMatch() {\n\t\treturn _esfTournament.getIsIndividualMatch();\n\t}",
"static boolean isSolved() {\n\t\tfor (int i=0; i<Play.NUM[TOTAL]; i++) {\t\n\t\t\tif (!isPieceCorrect(Play.jigsawPieces.get(i))) { //check if the piece is in the correct position and orientation\n\t\t\t\treturn false; //return if even once piece is not\n\t\t\t}\n\t\t}\n\t\treturn true; //if the method reached here, then it means that all the pieces are correctly placed\n\t}",
"public boolean isSolvable() {\r\n return solution() != null;\r\n }",
"public boolean isApplicable(int xCells, int yCells, int tileSize)\n{\n //int actualXCells = m.getOutputImageManager().getMosaic().getFlipH().length;\n //int actualYCells = m.getOutputImageManager().getMosaic().getFlipH()[0].length;\n \n int actualTileSize = (int)cp5.getController(\"sizeOfTiles\").getValue();\n boolean isThereMatch = false;\n \n int actualXCells;\n int actualYCells;\n \n for(int i = 1; i < cp5.getController(\"sizeOfTiles\").getMax()+1; i++)\n {\n actualXCells = (m.getOutputImageManager().getMosaic().getXCanvasSize())/(m.getOutputImageManager().getMosaic().getTiles()[0].getW()*i)+3;\n actualYCells = (m.getOutputImageManager().getMosaic().getYCanvasSize())/(m.getOutputImageManager().getMosaic().getTiles()[0].getH()*i);\n if(xCells == actualXCells && yCells == actualYCells)\n isThereMatch = true;\n //println(xCells, yCells, i);\n //println(actualXCells,actualYCells, actualTileSize);\n //println(\"\");\n }\n return isThereMatch;\n}",
"@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }",
"public boolean checkR3(String candidateSolution){\n\t\t//Split the string to a number of 9 digits\n\t\tString []candSol = candidateSolution.split(\"(?<=\\\\G.........)\");\n\t\tint candSolIndex = 0;\n\t\t\n\t\twhile(candSolIndex < 9){\n\n\t\t\tString testPart = candSol[candSolIndex];\n\t\t\t//R2 part\n\t\t\tboolean ok = checkIfDublicate(testPart);\n\t\t\tcandSolIndex++;\n\t\t\tif(ok){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn true;\t\t\t\t\n\t\t}\n\t\treturn false;\n\t}",
"private static void checkForMatches() {\n int matchesThisTurn = 0;\n switch (pattern) {\n case RED:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Red\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case BLACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardColor(playerDeck.get(i)).equals(\"Black\")) {\n //system.out.println(\"Matched Card Color:\" + GameDeck.getCardColor(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n matchesThisTurn++;\n playerDeck.get(i).setCardPurchased(true);\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case HEART:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Heart\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case DIAMOND:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Diamond\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case CLUB:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Club\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SPADE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardSuit(playerDeck.get(i)).equals(\"Spade\")) {\n //system.out.println(\"Matched Card Suit:\" + GameDeck.getCardSuit(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TWO:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case THREE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"3\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FOUR:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"4\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case FIVE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"5\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SIX:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"6\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SEVEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case EIGHT:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"8\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case NINE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"9\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case TEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"10\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case JACK:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"J\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case QUEEN:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"Q\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case KING:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"K\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case ACE:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case SINGLEDIGITPRIMES:\n for(int i = 0; i< playerDeck.size(); i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"2\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"3\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"5\") ||\n GameDeck.getCardName(playerDeck.get(i)).equals(\"7\")) {\n //system.out.println(\"Matched Card Name:\" + GameDeck.getCardName(playerDeck.get(i)));\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n// guessPattern();\n }\n break;\n case PAIRS:\n int[] isAPair = new int[]{0,0,0,0};\n if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(1)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n isAPair[1] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(GameDeck.getCardName(playerDeck.get(0)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(0)));\n matchedDeck.add(playerDeck.get(0));\n playerDeck.get(0).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(0).setCardPurchased(false);\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n if(isAPair[1] != 1) {\n if(isAPair[2] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(2)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n isAPair[2] = 1;\n matchesThisTurn += 2;\n } else if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(1)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(1)));\n matchedDeck.add(playerDeck.get(1));\n playerDeck.get(1).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n isAPair[3] = 1;\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(1).setCardPurchased(false);\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n \n }\n \n if(isAPair[2] != 1) {\n if(isAPair[3] != 1 && GameDeck.getCardName(playerDeck.get(2)).equals(GameDeck.getCardName(playerDeck.get(3)))) {\n //system.out.println(\"Matched Pair Name:\" + GameDeck.getCardName(playerDeck.get(2)));\n matchedDeck.add(playerDeck.get(2));\n playerDeck.get(2).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(3));\n playerDeck.get(3).setCardPurchased(true);\n matchesThisTurn += 2;\n }\n else\n {\n \tplayerDeck.get(2).setCardPurchased(false);\n \tplayerDeck.get(3).setCardPurchased(false);\n }\n }\n if(matchesThisTurn == 4)\n {\n guessPattern();\n }\n break;\n case SUMOFPAIRS: //Ace is high for this sum calculation(Ace=14)\n int tempSum;\n int sumPairCount = 0;\n for(int i=0;i<playerDeck.size();i+=2) {\n tempSum = 0;\n tempSum += GameDeck.getCardValue(playerDeck.get(i));\n tempSum += GameDeck.getCardValue(playerDeck.get(i+1));\n if(tempSum == sumValue) {\n //system.out.println(\"Sum Value:\" + tempSum);\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchedDeck.add(playerDeck.get(i+1));\n playerDeck.get(i+1).setCardPurchased(true);\n sumPairCount++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n \tplayerDeck.get(i+1).setCardPurchased(false);\n }\n }\n if(sumPairCount == 2)\n {\n// guessPattern();\n }\n break;\n case INCREMENTING:\n int[] isIncrementing = new int[]{0,0,0,0};\n int[] isConsecutive = new int[]{0,0,0};\n int consecutiveCount = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardName(playerDeck.get(i)).equals(\"A\")) {\n if(1 == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))-1) {\n //system.out.println(\"Matched incrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isIncrementing[i] = 1;\n isIncrementing[i+1] = 1;\n isConsecutive[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isIncrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive[i] == 1) {\n consecutiveCount++;\n }\n }\n if(consecutiveCount == 3)\n {\n// guessPattern();\n }\n break;\n case DECREMENTING:\n int[] isDecrementing = new int[]{0,0,0,0};\n int[] isConsecutive2 = new int[]{0,0,0};\n int consecutiveCount2 = 0;\n for(int i = 0; i< playerDeck.size()-1; i++) {\n if(GameDeck.getCardValue(playerDeck.get(i)) == 2) {\n if(GameDeck.getCardName(playerDeck.get(i+1)).equals(\"A\")) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n } else {\n if(GameDeck.getCardValue(playerDeck.get(i)) == GameDeck.getCardValue(playerDeck.get(i+1))+1) {\n //system.out.println(\"Matched decrementing:\" + GameDeck.getCardName(playerDeck.get(i)) +\n // \" & \" + GameDeck.getCardName(playerDeck.get(i+1)));\n isDecrementing[i] = 1;\n isDecrementing[i+1] = 1;\n isConsecutive2[i] = 1;\n }\n }\n }\n for(int i=0;i<playerDeck.size();i++) {\n if(isDecrementing[i] == 1) {\n matchedDeck.add(playerDeck.get(i));\n playerDeck.get(i).setCardPurchased(true);\n matchesThisTurn ++;\n }\n else\n {\n \tplayerDeck.get(i).setCardPurchased(false);\n }\n }\n for(int i=0;i<3;i++) {\n if(isConsecutive2[i] == 1) {\n consecutiveCount2++;\n }\n }\n if(consecutiveCount2 == 3)\n {\n// guessPattern();\n }\n break;\n default:\n //system.out.println(\"\");\n break;\n }\n }",
"boolean exactMatch(FlowRule rule);",
"public boolean isSolved(){ return getRemainingValues() == 0; }",
"public static boolean isSolved(int[][] board) {\n\t\tfor(int i = 0; i < 9; i++) {\n\t\t\tfor(int j = 0; j < 9; j++) {\n\t\t\t\tif(board[i][j] < 1) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//rows\n\t\tfor(int i = 0; i < 9; i++) {\n\t\t\tif(!checkRow(board, i)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//columns\n\t\tfor(int i = 0; i < 9; i++) {\n\t\t\tif(!checkCol(board, i)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//cells\n\t\tfor(int r = 0; r < 3; r++) {\n\t\t\tfor(int c = 0; c < 3; c++) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn true;\n\t}",
"public boolean isSolved() {\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(1, 1) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(2, 1) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(3, 1) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(1, 2) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(3, 2) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(1, 3) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(2, 3) != RubiksColor.BLUE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.RIGHT).getSquare(3, 3) != RubiksColor.BLUE) return false;\n\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(1, 1) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(2, 1) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(3, 1) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(1, 2) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(3, 2) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(1, 3) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(2, 3) != RubiksColor.YELLOW) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.BACK).getSquare(3, 3) != RubiksColor.YELLOW) return false;\n\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(1, 1) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(2, 1) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(3, 1) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(1, 2) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(3, 2) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(1, 3) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(2, 3) != RubiksColor.GREEN) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.LEFT).getSquare(3, 3) != RubiksColor.GREEN) return false;\n\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(1, 1) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(2, 1) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(3, 1) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(1, 2) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(3, 2) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(1, 3) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(2, 3) != RubiksColor.WHITE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.FRONT).getSquare(3, 3) != RubiksColor.WHITE) return false;\n\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(1, 1) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(2, 1) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(3, 1) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(1, 2) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(3, 2) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(1, 3) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(2, 3) != RubiksColor.ORANGE) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.UP).getSquare(3, 3) != RubiksColor.ORANGE) return false;\n\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(1, 1) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(2, 1) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(3, 1) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(1, 2) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(3, 2) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(1, 3) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(2, 3) != RubiksColor.RED) return false;\n if (getRubiksFace(RubiksFace.RubiksFacePosition.DOWN).getSquare(3, 3) != RubiksColor.RED) return false;\n\n return true;\n }",
"private boolean matchesDesiredResult(Object result)\n {\n return ((result == null) && (m_desiredResult == null)) || m_desiredResult.equals(result);\n }",
"public abstract Match match();",
"public boolean findBestMatch() {\n\t\t\tif(nodes.size() >= nodeLimit) return false;\n\n\t\t\tdouble bestScore = 0.0;\n\t\t\tint bestLight = -1;\n\t\t\tfor(int p = 0; p < lights.size(); p++) {\n\t\t\t\tif(nodeIndex.contains(p)) continue;\n\t\t\t\tdouble score = scoreByDistance(lights.get(p));\n\t\t\t\tif(score != Double.NaN && score > bestScore) {\n\t\t\t\t\tbestScore = score;\n\t\t\t\t\tbestLight = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bestLight >= 0) {\n\t\t\t\taddNode(bestLight);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public boolean isSolvable() {\n return solution != null || initialNode.board.isGoal();\n }",
"public boolean isSolvable() {\n int inversions = 0;\n int zrow = 0;\n int beg;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (tiles[i][j] == 0)\n zrow = i;\n else {\n for (int k = i; k < n; k++) {\n beg = (k == i)? j+1 : 0;\n for (int l = beg; l < n; l++) {\n if (tiles[i][j] != 0 && tiles[k][l] != 0 && tiles[i][j] > tiles[k][l])\n inversions++;\n }\n }\n }\n }\n }\n if (n%2 == 1)\n return (inversions%2 == 0);\n return ((inversions+zrow)%2 == 1);\n }",
"private void isMatchInfoValid(String firstPlayerId, String secondPlayerId, String tennisMatchDate\r\n , String locationOfMatch, String score) throws TennisDatabaseException {\r\n if(firstPlayerId == null) {\r\n throw new TennisDatabaseException(\"firstPlayer Id is not a valid Id\");\r\n } else if (secondPlayerId == null) {\r\n throw new TennisDatabaseException(\"Second player Id is not a valid Id\");\r\n } else if (tennisMatchDate == null) {\r\n throw new TennisDatabaseException(\"tennisMatchDate is not a valid date\");\r\n } else if (locationOfMatch == null) {\r\n throw new TennisDatabaseException(\"locationOfMatch is not valid\");\r\n } else if (score == null) {\r\n throw new TennisDatabaseException(\"scores is not valid\");\r\n }\r\n }",
"private boolean firstMilestoneAccomplished()\n {\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4)\n )\n return true;\n else\n return false;\n }",
"public boolean solved()\n\t{\n\t\tfor(int row = 0; row < board.length; row++)\n\t\t{\n\t\t\tfor(int col = 0; col < board.length; col++)\n\t\t\t{\n\t\t\t\tif(board[row][col] == 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public boolean matches(Card otherCard) {\r\n if (suit==otherCard.suit() && pointValue == otherCard.pointValue() && rank == otherCard.rank())\r\n return true;\r\n else\r\n return false;\r\n }",
"private void runIsMatchTest(AnswerType answerTypeForNameIsMatch,\n AnswerType answerTypeForAddressIsMatch,\n AnswerType answerTypeForPhoneIsMatch,\n AnswerType answerTypeForEmailIsMatch,\n ContactMatchType expectedMatchResult) {\n runIsMatchTest(answerTypeForNameIsMatch,\n answerTypeForAddressIsMatch,\n answerTypeForPhoneIsMatch,\n answerTypeForEmailIsMatch,\n expectedMatchResult,\n answerTypeForAddressIsMatch != null,\n answerTypeForPhoneIsMatch != null,\n answerTypeForEmailIsMatch != null);\n }",
"boolean hasSameAs();",
"@Override\n\tpublic boolean goalTest(String currentState) {\n\t\tString[] imfAll = currentState.split(\";\")[3].split(\"-\");\n\t\tString max_cap = currentState.split(\";\")[0].split(\",\")[2];\n\t\tString curr_cap = currentState.split(\";\")[4];\n\n\t\t// System.out.println(Arrays.toString(imfAll));\n\t\tint numImf = imfAll.length;\n\t\tfor (int i = 0; i < numImf; i++) {\n\t\t\tString[] splitted = imfAll[i].split(\",\");\n\t\t\t// System.out.println(Arrays.toString(splitted));\n\t\t\t// System.out.println(Integer.parseInt(splitted[2]));\n\t\t\tif (splitted[3].equals(\"F\")) {\n\t\t\t\t// System.out.println(\"ALO\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n//\t\tSystem.out.println(\"Final\");\n//\t\tSystem.out.println(currentState);\n\t\tif (max_cap.equals(curr_cap)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}",
"boolean isFinalAnswer(List<List<Integer>> puzzle) {\n List<Integer> expectedList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);\n\n // check row\n int rowMatchedCount = 9;\n for (int rowIndex = 0; rowIndex < 9; rowIndex++) {\n List<Integer> rowNums = new ArrayList<>(puzzle.get(rowIndex));\n Collections.sort(rowNums);\n if (rowNums.equals(expectedList)) {\n rowMatchedCount -= 1;\n }\n }\n\n // check col\n int colMatchedCount = 9;\n for (int colIndex = 0; colIndex < 9; colIndex++) {\n List<Integer> colNums = new ArrayList<>(getColValues(colIndex, puzzle));\n Collections.sort(colNums);\n if (colNums.equals(expectedList)) {\n colMatchedCount -= 1;\n }\n }\n\n // check block\n int blockMatchedCount = 9;\n for (List<Integer> rowAndCol : getAllBlockTopLeftPos()) {\n List<Integer> blockNums =\n new ArrayList<>(getBlockValues(rowAndCol.get(0), rowAndCol.get(1), puzzle));\n Collections.sort(blockNums);\n if (blockNums.equals(expectedList)) {\n blockMatchedCount -= 1;\n }\n }\n\n return (rowMatchedCount + colMatchedCount + blockMatchedCount) == 0;\n }",
"boolean isNearMatch(double score);",
"public boolean isSolved() {\n return mSolved;\n }",
"public boolean isGoodMatch(Session x, Set<Session> s) {\n for(Session y:s) {\n Set<String> hours=sessionHours(y);\n for(String id: sessionHours(x))\n if(hours.contains(id)) return false;\n }\n return true;\n }",
"private boolean checkMatch(String first, String second, String third)\n {\n // First makes sure the given inputs aren't empty\n if (!first.isEmpty())\n {\n // Set the winner to be the current player\n return first.equals(second) && first.equals(third);\n }\n /*\n * If one or more of them are empty, set he current winner to -1 and\n * return false\n */\n return false;\n }",
"public boolean isPuzzleSolved() {\n\t\t// check rows/col/block )\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tif ((this.constraints[i][0].nextClearBit(1) < N + 1) || (this.constraints[0][i].nextClearBit(1) < N + 1)\n\t\t\t\t\t|| (this.constraints[N + 1][i].nextClearBit(1) < N + 1))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private boolean finalMilestoneAccomplished()\n {\n if( (firstMilestoneAccomplished()) &&\n (secondMilestoneAccomplished()) &&\n (thirdMilestoneAccomplished()) &&\n (beliefs.puzzle[2][1] == 10) &&\n (beliefs.puzzle[2][2] == 11) &&\n (beliefs.puzzle[2][3] == 12) &&\n (beliefs.puzzle[3][1] == 14) &&\n (beliefs.puzzle[3][2] == 15)\n\n )\n return true;\n else\n return false;\n }",
"public void setMatched(boolean matched) {\r\n this.matched = matched;\r\n }",
"public boolean isSequenceMatch(String sequence) {\n\t\tif (uniqueSequenceList.size() == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tUniqueSequenceList u = uniqueSequenceList.get(0);\n\t\tString referenceSequence = u.getSeqResSequence();\n\t\tProteinSequence s1 = new ProteinSequence(referenceSequence);\n\t\tif (s1.getLength() == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tProteinSequence s2 = new ProteinSequence(sequence);\n\t\tif (s2.getLength() == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (referenceSequence.equals(sequence)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tSmithWaterman3DParameters params = new SmithWaterman3DParameters();\n\t\tGapPenalty penalty = new SimpleGapPenalty();\n\t\tpenalty.setOpenPenalty(params.getGapOpen());\n\t\tpenalty.setExtensionPenalty(params.getGapExtend());\n\t\tSubstitutionMatrix<AminoAcidCompound> matrix = SubstitutionMatrixHelper.getBlosum65();\n\t\tPairwiseSequenceAligner<ProteinSequence, AminoAcidCompound> smithWaterman =\n\t\t\tAlignments.getPairwiseAligner(s1, s2, PairwiseSequenceAlignerType.LOCAL, penalty, matrix);\n\n\t\tSequencePair<ProteinSequence, AminoAcidCompound> pair = smithWaterman.getPair();\n//\t\tSystem.out.println(\"Len1: \" + referenceSequence.length() + \" - \" + s1.getLength());\n//\t\tSystem.out.println(\"Len2: \" + sequence.length() + \" - \" + s2.getLength());\n//\t\tSystem.out.println(\"Length: \" + pair.getLength() + \"idenities: \" + pair.getNumIdenticals());\n\t\tif (pair.getLength() == 0)\n\t\t\treturn false;\n\t\tdouble sequenceIdentity = (double)pair.getNumIdenticals()/pair.getLength();\n\t\tdouble alignmentLengthFraction = (double)pair.getLength()/Math.max(s1.getLength(), s2.getLength());\n//\t\tSystem.out.println(\"Ref seq. identity: \" + sequenceIdentity + \" fraction: \" + alignmentLengthFraction);\n\t\treturn sequenceIdentity >= parameters.getSequenceIdentityThreshold() && alignmentLengthFraction >= parameters.getAlignmentFractionThreshold();\n\t}",
"public boolean isPartialMatch() {\n return partialMatch;\n }",
"public void setMatched(boolean matched)\n\t{\n\t\t_isMatched = matched;\n\t}",
"public synchronized boolean completeMission() {\n //determine mission success / fail\n int numFails = 0;\n for (boolean choice : teamMemberChoices.values()) {\n if (!choice) {\n numFails++;\n }\n }\n if (numFails == 1) {\n sendPublicMessage(\"*The mission was a failure! There was 1 fail.*\");\n } else if (numFails > 1) {\n sendPublicMessage(\"*The mission was a failure! There were \" + numFails + \" fails.*\");\n } else {\n sendPublicMessage(\"*The mission was a success!*\");\n }\n\n CompleteMissionState completeMissionState = doMissionState.completeMission(numFails == 0);\n if (completeMissionState.isGameOver()) {\n //report the winner\n if (completeMissionState.didSpiesWin()) {\n sendPublicMessage(\"*3 missions have failed! Spies win!*\");\n announceSpies();\n sendPublicMessage(\"Thank you for playing!\");\n } else {\n sendPublicMessage(\"*3 missions have succeeded! The Resistance wins!*\");\n announceSpies();\n sendPublicMessage(\"Thank you for playing!\");\n }\n reset();\n return true;\n } else {\n pickTeamState = completeMissionState.getPickTeamState();\n state = State.PICK_TEAM;\n teamSelection = new HashSet<>();\n return false;\n }\n }",
"@Override\r\n\tpublic void isMatched(Point p) {\n\t\t\r\n\t}"
]
| [
"0.64329547",
"0.6253455",
"0.6085128",
"0.5982814",
"0.58510524",
"0.583798",
"0.57798547",
"0.574744",
"0.5728044",
"0.5693899",
"0.56915516",
"0.5680646",
"0.5665224",
"0.5643159",
"0.5634073",
"0.5609406",
"0.56043315",
"0.5576363",
"0.55664307",
"0.556594",
"0.5555978",
"0.5536114",
"0.55357945",
"0.5505561",
"0.54740316",
"0.5472711",
"0.5445821",
"0.5433347",
"0.5425468",
"0.5421923",
"0.5419837",
"0.54101974",
"0.54074013",
"0.540467",
"0.540467",
"0.5395464",
"0.5368962",
"0.53676075",
"0.5361334",
"0.5355862",
"0.53464437",
"0.53251743",
"0.5319814",
"0.5317991",
"0.5282228",
"0.52811724",
"0.5275751",
"0.5270064",
"0.5262307",
"0.52539563",
"0.5243122",
"0.5218875",
"0.52165115",
"0.5215341",
"0.5214528",
"0.5196297",
"0.5166623",
"0.5164404",
"0.51621205",
"0.5157307",
"0.5148904",
"0.5137676",
"0.51259583",
"0.51174355",
"0.51169103",
"0.5104644",
"0.5103835",
"0.5098605",
"0.5091814",
"0.5091208",
"0.50788766",
"0.5077262",
"0.507225",
"0.5058298",
"0.5046571",
"0.5042823",
"0.5040756",
"0.5027254",
"0.50259584",
"0.5013508",
"0.5007052",
"0.50052977",
"0.5005117",
"0.5004189",
"0.5001304",
"0.49993497",
"0.49975738",
"0.49955115",
"0.49916673",
"0.49892265",
"0.49813232",
"0.49777022",
"0.49749824",
"0.4974693",
"0.497001",
"0.4967071",
"0.49597692",
"0.4952306",
"0.49434394",
"0.4940189"
]
| 0.6921842 | 0 |
Determines a resident optimal solution to the Stable Marriage problem from the given input set. Study the project description to understand the variables which represent the input to your solution. | @Override
public Matching stableMarriageBruteForce_residentoptimal(Matching marriage) {
int residentsNumber = marriage.getResidentCount();
int hospitalSlots = marriage.totalHospitalSlots();
ArrayList<ArrayList<Integer>> validPartners = new ArrayList<ArrayList<Integer>>(0);
ArrayList<Matching> stableMatchings = new ArrayList<Matching>();
int count = 0;
Permutation p = new Permutation(residentsNumber, hospitalSlots);
Matching matching;
int i=0;
while ((matching = p.getNextMatching(marriage)) != null) {
i++;
if (isStableMatching(matching)) {
stableMatchings.add(matching);
validPartners.add(matching.getResidentMatching());
count++;
}
}
if (count == 1)
return stableMatchings.get(0);
validPartners = sortValidPartners(marriage, stableMatchings.size(), validPartners);
return getBruteForceCorrectMatching(stableMatchings, validPartners);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n//\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N= Integer.parseInt(st.nextToken());\n\t\tint T= Integer.parseInt(st.nextToken());\n\t\t\n\t\t//for each N, three possible problem sets (P, A, G)\n\t\t//and P (prep time: min), V (value)\n\t\t//P <= A <= G\n\t\t\n\t\t//given limit T\n\t\t//find max profit\n\t\tint[][] v = new int[N+1][3+1];\n\t\tint[][] w = new int[N+1][3+1];\n\t\t\n\t\t//one \n\t\t\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\t\t\t\tw[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\tv[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t}\n\t\t}\n//\t\tfor (int i = 1; i <= N; i++) {\n//\t\t\tfor (int j = 1; j <= 3; j++) {\n//\t\t\t\tSystem.out.println(w[i][j] + \" \"+ v[i][j]);\n//\t\t\t}\n//\t\t}\n\t\tint[][] dp = new int[2][T+1];\n\t\t//where k looks at the kth row of the values/weight array\n\t\tfor (int k = 1; k <= N; k++) {\n\t\t\tfor (int x = 0; x <= T; x++) {\n\t\t\t\t//going through each weight and value\n\t\t\t\tboolean ran = false;\n\t\t\t\tfor (int a = 1; a <= 3; a++) {\t\t\t\t\t\n\t\t\t\t\tif (w[k][a] > x) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tran = true;\n\t\t\t\t\t\tdp[1][x] = Math.max(Math.max(dp[0][x],dp[0][x-w[k][a]] + v[k][a]),dp[1][x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!ran) {\n\t\t\t\t\tdp[1][x] = dp[0][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp[0] = dp[1].clone();\n//\t\t\tfor (int[] row: dp) {\n//\t\t\t\tfor (int m: row) {\n//\t\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println();\n//\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int[] row: dp) {\n//\t\t\tfor (int m: row) {\n//\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t}\n//\t\t\tSystem.out.println();\n//\t\t}\n\t\tSystem.out.println(dp[1][T]);\n\t}",
"private static void solve(long[][][] ranks, String problem_name) {\n Solver solver = new Solver(\"StableMarriage\");\n\n //\n // data\n //\n System.out.println(\"\\n#####################\");\n System.out.println(\"Problem: \" + problem_name);\n\n long[][] rankWomen = ranks[0];\n long[][] rankMen = ranks[1];\n\n int n = rankWomen.length;\n\n //\n // variables\n //\n IntVar[] wife = solver.makeIntVarArray(n, 0, n - 1, \"wife\");\n IntVar[] husband = solver.makeIntVarArray(n, 0, n - 1, \"husband\");\n\n //\n // constraints\n // (the comments are the Comet code)\n // forall(m in Men)\n // cp.post(husband[wife[m]] == m);\n for (int m = 0; m < n; m++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(husband, wife[m]), m));\n }\n\n // forall(w in Women)\n // cp.post(wife[husband[w]] == w);\n for (int w = 0; w < n; w++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(wife, husband[w]), w));\n }\n\n // forall(m in Men, o in Women)\n // cp.post(rankMen[m,o] < rankMen[m, wife[m]] =>\n // rankWomen[o,husband[o]] < rankWomen[o,m]);\n for (int m = 0; m < n; m++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankMen[m], wife[m]).var(), rankMen[m][o]);\n\n IntVar b2 = solver.makeIsLessCstVar(\n solver.makeElement(rankWomen[o], husband[o]).var(), rankWomen[o][m]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n // forall(w in Women, o in Men)\n // cp.post(rankWomen[w,o] < rankWomen[w,husband[w]] =>\n // rankMen[o,wife[o]] < rankMen[o,w]);\n for (int w = 0; w < n; w++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankWomen[w], husband[w]).var(), rankWomen[w][o]);\n IntVar b2 =\n solver.makeIsLessCstVar(solver.makeElement(rankMen[o], wife[o]).var(), rankMen[o][w]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n //\n // search\n //\n DecisionBuilder db = solver.makePhase(wife, solver.INT_VAR_DEFAULT, solver.INT_VALUE_DEFAULT);\n\n solver.newSearch(db);\n\n //\n // output\n //\n while (solver.nextSolution()) {\n System.out.print(\"wife : \");\n for (int i = 0; i < n; i++) {\n System.out.print(wife[i].value() + \" \");\n }\n System.out.print(\"\\nhusband: \");\n for (int i = 0; i < n; i++) {\n System.out.print(husband[i].value() + \" \");\n }\n System.out.println(\"\\n\");\n }\n\n solver.endSearch();\n\n // Statistics\n // System.out.println();\n System.out.println(\"Solutions: \" + solver.solutions());\n System.out.println(\"Failures: \" + solver.failures());\n System.out.println(\"Branches: \" + solver.branches());\n System.out.println(\"Wall time: \" + solver.wallTime() + \"ms\");\n }",
"public abstract double solve(int[][] matrix, double[] profitTable, int[] teamTable);",
"public abstract double[] solveDual(int[][] matrix, double[] profitTable, int[] teamTable);",
"@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }",
"public List<Configuration> solve(){\n int group = 0;\n for(List<Configuration> set : input){\n minimize(set);\n\n for(Configuration root : set) {\n root.setGroup(group);\n }\n group++;\n\n }\n\n // Step 2: Preprocess\n sortBySize(input);\n\n // Step 5: Initialize set of partial solutions\n List<Configuration> partialSolutions;\n if(input.size()==0){\n return null;\n }\n else {\n partialSolutions = input.get(0);\n input.remove(partialSolutions);\n }\n\n // Step 6: The compositional computations\n for(List<Configuration> set : input) {\n filter(partialSolutions, setCutoff);\n filter(set, setCutoff);\n partialSolutions = combine(partialSolutions, set, constraints);\n }\n\n // Step 7: Postprocessing\n //greedyPostProcessing(partialSolutions);\n\n return partialSolutions;\n }",
"public static int solution(int[] budgets, int M) {\n\t\tint lV = 0;\n\t\tint rV = 0;\n\t\tfor(int i = 0; i < budgets.length; i++) {\n//\t\t\tlV = Math.min(lV, budgets[i]); // 이게 있으면 위에 네번째 테케를 못품. \n\t\t\trV = Math.max(rV, budgets[i]);\n\t\t}\n\t\tint mid = rV/2;\n\t\tint ans = 0;\n\t\t\n\t\twhile(lV <= rV) {\n\t\t\tint tmp = 0;\n\t\t\tfor(int i = 0; i < budgets.length; i++) {\n\t\t\t\tif(budgets[i] > mid) tmp += mid;\n\t\t\t\telse tmp += budgets[i];\n\t\t\t}\n\t\t\n\t\t\tif(tmp > M) {\n\t\t\t\trV = mid - 1;\n\t\t\t} else {\n\t\t\t\tlV = mid + 1;\n\t\t\t\tans = Math.max(mid, ans);\n\t\t\t}\n\t\t\tmid = (lV+rV)/2;\n\t\t}\n\t\t\n\t\t\n\t\treturn ans;\n\t}",
"@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }",
"public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }",
"public void solveSingleSolution() {\n SPL M1 = this;\n\n int counter = 1;\n\n for(int i=0; i < this.NBrsEff; i++) {\n System.out.println(\"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1]);\n this.Solusi += \"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1];\n counter += 1;\n this.Solusi += \"\\n\";\n } \n }",
"public HardSoftScore calculateScore(MPSReadinessCheckSolution solution) {\n\t\tint hardScore = 0, softScore = 0;\n\t\tMap<ProductionPlant, Map<Date, List<FixedPlanEntry>>> fulfilled = solution.getFulfilledMPS();\n\t\tMap<PlanEntryIndex, MRPEntry> mrp = solution.getAccumulatedMRP();\n\t\tMap<ProductionPlant, Map<Date, Map<UUID, Integer>>> aggregatecDemands = aggregateDemands(fulfilled);\n\t\tfor (Map.Entry<ProductionPlant, Map<Date, Map<UUID, Integer>>> fulfilledByLocEntry: aggregatecDemands.entrySet()) {\n\t\t\tProductionPlant fulfilledLoc = fulfilledByLocEntry.getKey();\n\t\t\tMap<Date, Map<UUID, Integer>> fulfilledByLoc = fulfilledByLocEntry.getValue();\n\t\t\tfor (Map.Entry<Date, Map<UUID, Integer>> fulfilledByDateEntry: fulfilledByLoc.entrySet()) {\n\t\t\t\tDate fulfilledDate = fulfilledByDateEntry.getKey();\n\t\t\t\tMap<UUID, MRPEntry> mrpPlan = findMRPSupportByFulfilledDate(mrp, fulfilledLoc, fulfilledDate);\n\t\t\t\tif (mrpPlan == null) {\n\t\t\t\t\thardScore = -10;\n\t\t\t\t\t//System.out.println(\"no mrp plan, date=\" + fulfilledDate);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tMap<UUID, Integer> skuDemands = fulfilledByDateEntry.getValue();\n\t\t\t\tfor (Map.Entry<UUID, Integer> skuDemand: skuDemands.entrySet()) {\n\t\t\t\t\tSystem.out.println(\"skuDemand:\" + skuDemand);\n\t\t\t\t\tUUID skuNo = skuDemand.getKey();\n\t\t\t\t\tint mpsQty = skuDemand.getValue();\n\t\t\t\t\t//System.out.println(\"calculateScore Called, skuNo=\" + skuNo + \",mpsQty =\" + mpsQty);\n\t\t\t\t\tif (mpsQty == 0) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no demand, hardscore:\" + hardScore);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tMRPEntry mrpEntry = mrpPlan.get(skuNo);\n\t\t\t\t\tif (mrpEntry == null) {\n\t\t\t\t\t\thardScore=-10;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no mrp, hardscore:\" + hardScore + \",sku=\" + skuDemand.getKey());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (mrpEntry.getPlanQty() >= mpsQty) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp meet demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t} else { \n\t\t\t\t\t\thardScore = -1;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp less than demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hardScore < 0) break;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"end calculateScore Called, hardScore=\" + hardScore + \",solution=\" + solution);\n\t\t//System.out.println(\"\");\n\t\treturn HardSoftScore.valueOf(hardScore, softScore);\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint T = s.nextInt(); //number of tests\n\t\t\n\t\tfor(int i = 0; i < T; i++) {\n\t\t\tint N = s.nextInt(); //number of students\n\t\t\tint P = s.nextInt(); //number of students to pick\n\t\t\t\n\t\t\t//Get all skill scores\n\t\t\tint[] skillOfAllStudents = new int[N];\n\t\t\tfor(int j = 0; j < N; j++) {\n\t\t\t\tskillOfAllStudents[j] = s.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//Sort\n\t\t\tArrays.sort(skillOfAllStudents);\n\t\t\t\n\t\t\t//Find min number of hours to get a fair team\n\t\t\t//Go from largest down to smallest. take however many needed from the right and calculate amount needed for fair team\n\t\t\tint numHours = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int l = N-1; l > P-2; l--) {\n\t\t\t\tint tempSkill = 0;\n\t\t\t\t\n\t\t\t\tint highest = skillOfAllStudents[l];\n\t\t\t\tfor(int k = l-1; k > l - P; k--) {\n\t\t\t\t\ttempSkill += (highest - skillOfAllStudents[k]);\n\t\t\t\t\t//System.out.println(\"intermediate #1: \" + tempSkill );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempSkill < numHours) {\n\t\t\t\t\tnumHours = tempSkill;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Print solution\n\t\t\tSystem.out.println(\"Case #\" + (i+1) + \": \" + numHours);\n\t\t}\n\t}",
"public abstract int[] solve(double[][] costs);",
"public void testSudoku() {\n \t\tfinal Sudoku model = new Sudoku(3);\n \t\tfinal Solution sol = solve(model.rules(), model.puzzle1());\n //\t\tSATISFIABLE\n //\t\tp cnf 1544 6974\n //\t\tprimary variables: 702\n \t\tassertEquals(Solution.Outcome.SATISFIABLE, sol.outcome());\n \t\tassertEquals(702, sol.stats().primaryVariables());\n \t\tassertEquals(1544, sol.stats().variables());\n \t\tassertEquals(6974, sol.stats().clauses());\n \t}",
"public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }",
"@Override\n\tpublic void solve() {\n\t\tlong startTime = System.nanoTime();\n\n\t\twhile(!unvisitedPM.isEmpty()){\n\t\t\tProblemModel current = findCheapestNode();\n\t\n\t\t\tfor(ProblemModel pm : current.getSubNodes()){\n\t\t\n\t\t\t\tif(!visited.contains(pm) && !unvisitedPM.contains(pm)){\n\t\t\t\t\t\n\t\t\t\t\tunvisitedPM.add(pm);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(current.getSideStart().isEmpty()){\n\t\t\t\tSystem.out.print( \"\\n\"+ \"StartSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideStart()){\n\t\t\t\t\tSystem.out.print( \" \" +r) ;\n\t\t\t\t}\n\t\t\t\tSystem.out.print( \"\\n\" + \"EndSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideEnd()){\n\t\t\t\t\tSystem.out.print( \" \" + r);\n\t\t\t\t}\n\n\t\t\t\tprintPathTaken(current);\n\t\t\t\tSystem.out.print( \"\\n\" + \"------------done--------------\");\n\t\t\t\tlong endTime = System.nanoTime();\n\t\t\t\tlong duration = ((endTime - startTime)/1000000);\n\t\t\t\tSystem.out.print( \"\\n\" + \"-AS1 Time taken: \" + duration + \"ms\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvisited.add(current);\n\t\t\n\t\t}\n\t\t\n\n\t}",
"public void findSolution() {\n\n\t\t// TODO\n\t}",
"public Solution solve(ISearchable s) {\n return null;\n }",
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) {\n int input = 0;\n int armLength;\n int solution = 0;\n\n // get the puzzle input\n System.out.print(\"Please provide the puzzle input: \");\n input = new Scanner(System.in).nextInt();\n\n /// PART 1\n // figure out which spiral input is on to calculate distance on one axis\n armLength = SpiralUtils.lengthOfSprialArm(input);\n solution = (armLength - 1) / 2;\n\n // find the midpoints of the spiral the input is on\n List<Integer> midpoints = SpiralUtils.midpointsOfSprialArm(armLength);\n\n // calculate the smallest distance from any midpoint to our input for other access\n solution += SpiralUtils.smallestDistanceFromMidpoints(input, midpoints);\n\n System.out.println(\"The solution to part 1 is: \" + solution);\n\n /// PART 2\n // this part is less elegant, as I'm just going to create the spiral instead of run calculations\n System.out.println(\"The solution to part 2 is: \" + SpiralUtils.spiralUntilAtLeast(input));\n }",
"public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }",
"boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }",
"private static double findOneSetCost(int r, int [] set,\r\n Vector oneSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n ArrayList setNeighbors = new ArrayList();\r\n for ( int i = 0; i < set.length; i++)\r\n {\r\n int index = set[i] - 1;\r\n Host neighbor = (Host) neighbors.get(index);\r\n setNeighbors.add(neighbor);\r\n }\r\n double [][] setDistanceArray = findDistanceArray(currentNode, destList, setNeighbors);\r\n //the setDistanceArray[r][m]\r\n\r\n //check if any neighbor in set is not common neighbor for all dests\r\n //if a neighbor is so, return a MaxDistance, hopArray = NULL\r\n int m = destList.size();\r\n for ( int i = 0; i < m; i++)\r\n {\r\n int num = 0;\r\n for ( int j = 0; j < r; j++)\r\n {\r\n if (setDistanceArray[j][i] < 0)\r\n {\r\n num++;\r\n setDistanceArray[j][i] = MaxDistance;\r\n }\r\n }\r\n if ( num >= r )\r\n {\r\n // All the neighbors in set cannot forward to destination[i]\r\n oneSetVector.clear(); // ???\r\n return MaxDistance;\r\n }\r\n }\r\n\r\n //find forward nodes provides min remain distance\r\n double totalCost = 0.0;\r\n\r\n //go thourgh destList, find a best forward neighbor for each dest\r\n //add the distance to totalRemainDistance\r\n for (int i = 0; i < m; ++i) {//loop through destList\r\n double minCost = setDistanceArray[0][i];//get first neighbor for each dest\r\n oneSetVector.add(i, setNeighbors.get(0));\r\n for (int j = 0; j < r; ++j) {// Loop through the neighbor\r\n if (minCost > setDistanceArray[j][i]) {\r\n // Swap\r\n minCost = setDistanceArray[j][i];\r\n oneSetVector.set(i, setNeighbors.get(j));\r\n }\r\n }\r\n totalCost += minCost;\r\n }\r\n\r\n return totalCost;\r\n }",
"public Solution solve(KnapsackData data);",
"private Hashtable solve() {\n Hashtable<Integer, Double> solution = new Hashtable<>(); //maps variable (column) to its value\n double det = system.determinant();\n if (det == 0) {\n System.err.println(\"LinearSystem Solve Failed: determinant of matrix is 0\");\n return null;\n } else {\n for (int c = 0; c < system.N; c++) {\n double detC = colVectorIntoMatrix(c).determinant();\n solution.put(c, detC/det);\n }\n return solution;\n }\n }",
"private static double getMinSetCost_given_r( int r, Vector rSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n long cnr = getCnr(n, r);\r\n double minCostFor_r = MaxDistance;\r\n\r\n int[] set = new int[r]; /// ?????????????????????????\r\n set = initSet(r);\r\n\r\n //loop cnr set, find one set with minimum remaining distance\r\n for (long i = 0; i < cnr; ++i)\r\n {\r\n Vector oneSetVector = new Vector();\r\n double oneSetCost;\r\n oneSetCost = findOneSetCost(r, set,\r\n oneSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n if ( oneSetCost < minCostFor_r ) {\r\n minCostFor_r = oneSetCost;\r\n rSetVector.clear();\r\n for (int k = 0; k < oneSetVector.size(); ++k) {\r\n rSetVector.add(k, oneSetVector.get(k));\r\n }\r\n }\r\n if (i < (cnr - 1)) {\r\n calculateNextSet(n,r,set);\r\n }\r\n }\r\n\r\n return minCostFor_r;\r\n\r\n }",
"public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public TTPSolution SH2() {\n \n // get TTP data\n long[][] D = ttp.getDist();\n int[] A = ttp.getAvailability();\n double maxSpeed = ttp.getMaxSpeed();\n double minSpeed = ttp.getMinSpeed();\n long capacity = ttp.getCapacity();\n double C = (maxSpeed - minSpeed) / capacity;\n double R = ttp.getRent();\n int m = ttp.getNbCities(),\n n = ttp.getNbItems();\n TTPSolution s = new TTPSolution(m, n);\n int[] x = s.getTour(),\n z = s.getPickingPlan();\n \n /*\n * the tour\n * generated using greedy algorithm\n */\n x = linkernTour();\n z = zerosPickingPlan();\n Deb.echo(x);\n Deb.echo(z);\n \n /*\n * the picking plan\n * generated so that the TTP objective value is maximized\n */\n ttp.objective(s);\n \n // partial distance from city x_i\n long di;\n \n // partial time with item k collected from city x_i\n double tik;\n \n // item scores\n Double[] score = new Double[n];\n \n // total time with no items collected\n double t_ = s.ft;\n \n // total time with only item k collected\n double tik_;\n \n // fitness value\n double u[] = new double[n];\n \n for (int k=0; k<n; k++) {\n \n int i;\n for (i=0; i<m; i++) {\n if (A[k]==x[i]) break;\n }\n //P.echo2(\"[\"+k+\"]\"+(i+1)+\"~\");\n \n // time to start with\n tik = i==0 ? .0 : s.timeAcc[i-1];\n int iw = ttp.weightOf(k),\n ip = ttp.profitOf(k);\n \n // recalculate velocities from start\n di = 0;\n for (int r=i; r<m; r++) {\n \n int c1 = x[r]-1;\n int c2 = x[(r+1)%m]-1;\n \n di += D[c1][c2];\n tik += D[c1][c2] / (maxSpeed-iw*C);\n }\n \n score[k] = ip - R*tik;\n tik_ = t_ - di + tik;\n u[k] = R*t_ + ttp.profitOf(k) - R*tik_;\n //P.echo(k+\" : \"+u[k]);\n }\n \n Quicksort<Double> qs = new Quicksort<Double>(score);\n qs.sort();\n int[] si = qs.getIndices();\n int wc = 0;\n for (int k=0; k<n; k++) {\n int i = si[k];\n int wi = ttp.weightOf(i);\n // eliminate useless\n if (wi+wc <= capacity && u[i] > 0) {\n z[i] = A[i];\n wc += wi;\n }\n }\n \n ttp.objective(s);\n \n return s;\n }",
"public abstract OptimisationSolution getBestSolution();",
"public void solve() {\n /** To solve the traveling salesman problem:\n * Set up the graph, choose a starting node, then call the recursive backtracking method and pass it the starting node.\n */\n\n // We need to pass a starting node to recursive backtracking method\n Node startNode = null;\n\n // Grab a node, any node...\n for( Node n : graph.nodes() ) {\n startNode = n;\n break;\n }\n\n // Visit the first node\n startNode.visit();\n\n // Add first node to the route\n this.route[0] = startNode;\n\n // Pass the number of choices made\n int nchoices = 1;\n\n // Recursive backtracking\n explore(startNode, nchoices );\n\n\n }",
"private void run() throws Exception {\n int t = sc.nextInt();\n sc.nextLine();\n\n for (int i = 1; i <= t; i++) {\n out.print(\"Case #\" + i + \": \");\n String line = sc.nextLine();\n\n StringTokenizer st = new StringTokenizer(line, \" \");\n String Sstr = st.nextToken();\n\n int K = Integer.parseInt(st.nextToken());\n\n BitSet S = new BitSet(Sstr.length());\n for(int j=0; j<Sstr.length(); ++j){\n if(Sstr.charAt(j) == '+')\n S.set(j);\n else\n S.clear(j);\n }\n\n solveBig(S, K, Sstr.length());\n }\n sc.close();\n out.close();\n }",
"public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static void solve(){\n try {\r\n Rete env = new Rete();\r\n env.clear();\r\n env.batch(\"sudoku.clp\");\r\n\t\t\tenv.batch(\"solve.clp\");\r\n env.batch(\"output-frills.clp\");\r\n env.batch(\"guess.clp\");\r\n env.batch(\"grid3x3-p1.clp\");\r\n\t env.eval(\"(open \\\"test.txt\\\" output \\\"w\\\")\");\r\n env.reset();\r\n env.eval(\"(assert (try guess))\");\r\n env.run();\r\n env.eval(\"(close output)\");\r\n } catch (JessException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n System.out.println(\"ok\");\r\n FileReader fr;\r\n try {\r\n int r = 0,c = 0;\r\n fr = new FileReader(\"test.txt\");\r\n Scanner sc = new Scanner(fr);\r\n \r\n while (sc.hasNextInt()){\r\n int next = sc.nextInt();\r\n int i = id[r][c];\r\n gui.setSudokuValue(i-1, next);\r\n c++;\r\n if (c >= 6){\r\n c = 0; r++;\r\n }\r\n }\r\n } catch (Exception e){\r\n }\r\n \r\n }",
"protected abstract void solve(Items items,Knapsack knapsack);",
"public void getSolution(TaskState state){\n\n if(state.isNew) {\n state.isNew = false;\n state.hasSolution = true;\n }\n else {\n if(!(state.hasSolution = rollBack(state)))\n return;\n }\n\n while (state.moveStack.size() < 64 ||\n !state.moveStack.peek().getStandElement().hasNeighbour(state.graph.getFirst())){\n\n if(state.moveStack.size() == 64 && !rollBack(state)) {\n state.hasSolution = false;\n return;\n }\n\n if(state.moveStack.peek().hasNextMove())\n state.moveStack.push(\n new HorseMove(state.moveStack.peek().getNextMove())\n );\n\n else if(!rollBack(state)){\n state.hasSolution = false;\n return;\n }\n\n }\n\n }",
"public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public static int dynamicProgrammingMin(List<List<Integer>> R) {\r\n\t\tif(R.isEmpty()) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t// declare\r\n\t\tList<Integer> result = new ArrayList<Integer>();\r\n\t\tList<Integer> sequence = new ArrayList<Integer>();\r\n\t\tint n = R.size();\r\n\t\t\r\n\t\t// initialize (BC)\r\n\t\tif(n >= 1) {\r\n\t\t\tresult.add(0);\r\n\t\t\tsequence.add(0);\r\n\t\t}\r\n\t\tif(n >= 2) {\r\n\t\t\tresult.add(R.get(0).get(1));\r\n\t\t\tsequence.add(1);\r\n\t\t}\r\n\t\t\r\n\t\t// iterate (RC)\r\n\t\tfor(int row = 3; row <= n; row++) {\r\n\t\t\tint curr = R.get(row - 2).get(row - 1);\r\n\t\t\tint prevSolutionPlusCurr = result.get(row - 2) + curr;\r\n\t\t\t\r\n\t\t\tint lastColMin = INFINITY;\r\n\t\t\tint selected = INFINITY;\r\n\t\t\tfor(int k = 0; k < row - 2; k++) {\r\n\t\t\t\tint thisColValue = result.get(k) + R.get(k).get(row - 1);\r\n\t\t\t\tlastColMin = min(thisColValue, lastColMin);\r\n\t\t\t\t\r\n\t\t\t\tif(lastColMin == thisColValue) {\r\n\t\t\t\t\tselected = k;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint min = min(prevSolutionPlusCurr, lastColMin);\r\n\t\t\tresult.add(min);\r\n\t\t\t\r\n\t\t\tif(result.get(row - 1) == prevSolutionPlusCurr) {\r\n\t\t\t\tsequence.add(row - 2);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsequence.add(selected);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(dynamicProgrammingRecover(sequence));\r\n\t\treturn result.get(n - 1);\r\n\t}",
"public static void isSAT(Predicate pred, int[] vList){\n\t\t\n\t\tStack<Integer> assignedVariables = new Stack<Integer>();\n\t\tboolean satisfiability = false;\n\t\twhile(assignedCount<vList.length/2){\n\t\t\tif(pred.isContainsVariable(assignedCount+1, vList.length/2) == 0){\n\t\t\t\tvList[assignedCount] = 0;\n\t\t\t\tvList[assignedCount+vList.length/2] = 1;\n\t\t\t\tassignedCount++;\n\t\t\t} else {\n\t\t\t\tfailedPoint = assignedCount+1;\n\t\t\t\tsatisfiability = assignVariableAndEvaluatePred(pred, vList, assignedVariables);\n\t\t\t\t\n\t\t\t\tif(!satisfiability){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(satisfiability){\n\t\t\t\n\t\t\tsats.add(vList);\n\t\t\t\n\t\t\tgetAllSat(pred, vList);\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Assigned Values for Variables:\");\n\t\t\tfor(int[] arr: sats){\n\t\t\t\tfor(int i=0; i<vList.length/2; i++){\n\t\t\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" )\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" ) ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"No Possible Variable Values for Satisfiability\");\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Variable: \" + failedPoint);\n\t\t\t\n\t\t\tSystem.out.println(\"Backtracked Node Count: \" + backTrackedCount);\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \") ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private String solve(String inputData) {\n\t\tScanner in = new Scanner(inputData);\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tint testCases = in.nextInt();\n\t\tfor (int i = 1; i <= testCases; ++i) {\n\t\t\tsb.append(\"Case #\" + i + \": \");\n\t\t\t\n\t\t\tint googlers = in.nextInt();\n\t\t\tint surprisingCase = in.nextInt();\n\t\t\tint target = in.nextInt();\n\t\t\tArrayList<Integer> scores = new ArrayList<Integer>();\n\t\t\tfor (int j = 0; j < googlers; ++j) {\n\t\t\t\tscores.add(in.nextInt());\n\t\t\t}\n\t\t\t\n\t\t\tint accepted = 0;\n\t\t\tint acceptLine = Math.max(target, target * 3 - 2);\n\t\t\tint limited = 0;\n\t\t\tint limitLine = Math.max(target, target * 3 - 4);\n\t\t\tfor (Integer score : scores) {\n\t\t\t\tif (score >= acceptLine) {\n\t\t\t\t\t++accepted;\n\t\t\t\t}\n\t\t\t\telse if (score >= limitLine) {\n\t\t\t\t\t++limited;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint result = accepted + Math.min(surprisingCase, limited);\n\t\t\tsb.append(result);\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}",
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"public void solveUsingLeastCostMethod() {\n\n this.solution = new Solution();\n\n Source[] proxySources = Arrays.copyOf(sources, sources.length);\n Destination[] proxyDestinations = Arrays.copyOf(destinations, destinations.length);\n int[][] matrix = new int[costs.length][costs[0].length];\n\n List<Integer> rows = new ArrayList<Integer>();\n List<Integer> columns = new ArrayList<Integer>();\n while ( rows.size() != proxySources.length && columns.size() != proxyDestinations.length ) {\n //getting minimum cell (if there is a tie, we choose where is the maximum quantity)\n int indexI,indexJ, value;\n indexI = 0;\n indexJ = 0;\n value = 0;\n boolean firstElement = true;\n for(int i=0;i<proxySources.length;i++) {\n if( !rows.contains(i) ) {\n for(int j=0;j<proxyDestinations.length;j++) {\n if( !columns.contains(j) ) {\n if ( firstElement ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n firstElement = false;\n }\n if( costs[i][j] < value ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n else if( costs[i][j] == value ) {\n if( Math.min(proxySources[i].getSupply(),proxyDestinations[j].getDemand()) > Math.min(proxySources[indexI].getSupply(),proxyDestinations[indexJ].getDemand()) ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n }\n }\n }\n }\n }\n int supply = proxySources[indexI].getSupply();\n int demand = proxyDestinations[indexJ].getDemand();\n\n\n this.solution.add(sources[indexI], destinations[indexJ], Math.min(supply,demand), costs[indexI][indexJ]);\n\n if ( supply < demand ) {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(demand - supply);\n rows.add(indexI);\n }\n else if( supply > demand ) {\n proxySources[indexI].setSupply(supply-demand);\n proxyDestinations[indexJ].setDemand(0);\n columns.add(indexJ);\n }\n else {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(0);\n rows.add(indexI);\n columns.add(indexJ);\n }\n }\n this.solution.showSolution();\n\n\n }",
"@Test\n public void testTrain_RegressionDataSet() {\n System.out.println(\"train\");\n RegressionDataSet trainSet = FixedProblems.getSimpleRegression1(150, new Random(2));\n RegressionDataSet testSet = FixedProblems.getSimpleRegression1(50, new Random(3));\n\n for (boolean modification1 : new boolean[] { true, false })\n for (SupportVectorLearner.CacheMode cacheMode : SupportVectorLearner.CacheMode.values()) {\n PlattSMO smo = new PlattSMO(new RBFKernel(0.5));\n smo.setCacheMode(cacheMode);\n smo.setC(1);\n smo.setEpsilon(0.1);\n smo.setModificationOne(modification1);\n smo.train(trainSet);\n\n double errors = 0;\n for (int i = 0; i < testSet.size(); i++)\n errors += Math.pow(testSet.getTargetValue(i) - smo.regress(testSet.getDataPoint(i)), 2);\n assertTrue(errors / testSet.size() < 1);\n }\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"public static int dynamic_p(int objects,int capacity){\r\n // Array to accommodate dynamic programming solutions\r\n int dp_array[][] = new int[objects+1][capacity+1];\r\n // filling the 2D array\r\n for(int i=0; i<= objects;i++){\r\n for(int j=0; j<= capacity;j++){\r\n if(i == 0)\r\n dp_array[i][j]=0; // base case(number of objects are zero)\r\n else if(j == 0)\r\n dp_array[i][j]=0; // base case(capacity is zero)\r\n else if(randvariables[i-1] <= j){ // checking if the wight of object is less than the current knapsack capacity\r\n int included = randvalues[i-1]+dp_array[i-1][j-randvariables[i-1]]; // object is included\r\n int not_included = dp_array[i-1][j]; // object is not included\r\n\r\n //taking the max of these two\r\n if(included > not_included)\r\n dp_array[i][j] = included;\r\n else\r\n dp_array[i][j]= not_included;\r\n }\r\n else // weight is more than capacity .. not including the object\r\n dp_array[i][j] = dp_array[i-1][j];\r\n }\r\n }\r\n\r\n //System.out.println(Arrays.deepToString(dp_array));\r\n int solution = dp_array[objects][capacity];\r\n boolean[] optimalset = solution_used(dp_array,objects,capacity);\r\n System.out.println(Arrays.toString(optimalset));\r\n dp_array = null;\r\n return solution; // return the final solution\r\n\r\n }",
"@Test\n public void testSolution() throws Exception {\n assertEquals(4, new Task5().solution(4, new int[]{1, 2, 3}));\n // 1. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 2. 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n // 3. 2, 2, 1, 1, 1, 1, 1, 1, 1, 1\n // 4. 2, 2, 2, 1, 1, 1, 1, 1, 1\n // 5. 2, 2, 2, 2, 1, 1, 1, 1\n // 6. 2, 2, 2, 2, 2, 1, 1\n // 7. 2, 2, 2, 2, 2, 2\n // 8. 5, 1, 1, 1, 1, 1, 1, 1\n // 9. 5, 2, 1, 1, 1, 1, 1\n // 10. 5, 2, 2, 1, 1, 1\n // 11. 5, 2, 2, 2, 1\n // 12. 5, 5, 1, 1\n // 13. 5, 5, 2\n assertEquals(13, new Task5().solution(12, new int[]{1, 2, 5}));\n // 1. 2, 2, 2, 2, 2, 2\n // 2. 5, 5, 2\n assertEquals(2, new Task5().solution(12, new int[]{2, 5}));\n }",
"public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }",
"int countSusbset(int n, int w){\n int dp[][] = new int[n+1][w+1];\n for(int i=0;i<=n;i++){\n for(int j=0;j<=w;j++){\n //when no items are there and target sum is 0, only one empty subset is possible\n if(i == 0 && j == 0){\n dp[i][j] = 1;\n }\n //no items left and target sum is greater than 0, no set is possible\n else if(i == 0 && j > 0){\n dp[i][j] = 0; \n }\n //if target sum is 0, no matter how many items we have , only one empty subset is possible\n else if(j == 0){\n dp[i][j] = 1;\n }\n //since item > target sum, so exclude\n else if(arr[i-1] > j){\n dp[i][j] = dp[i-1][j];\n }else{\n //two cases include and exclude\n dp[i][j] = dp[i-1][j] + dp[i-1][j - arr[i-1]];\n }\n }\n }\n return dp[n][w];\n}",
"public void readSet() throws IOException {\n temps = new HashSet<String>();\n readDescription();\n // adds the words in the temporary set to the temp array\n for (String w : temps) {\n if (w.equals(\"dana\")) {\n System.out.println(w + \" was called +1\");\n }\n int v = d.getValue(w);\n arr[v]++;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called +1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n temps = new HashSet<String>();\n readDescription();\n // does the same thing above, except since this is the second\n // description, subtract 1 from array\n for (String w : temps) {\n int v = d.getValue(w);\n arr[v]--;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called -1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n // get the prices\n int p1 = getPrice();\n int p2 = getPrice();\n // get the answer value\n // a should be the correct answer\n // b should be the answer they choose\n int a = getAnswer();\n int b = getAnswer();\n // System.out.println(\"The correct answer is: \" + a +\n // \" The chosen answer is: \" + b);\n int y_real;\n DecimalFormat numberFormat = new DecimalFormat(\"#.####\");\n double real_ratio;\n double mturk_ratio;\n if (p1 > p2) {\n y_real = p1 - p2;\n real_ratio = (double) p1 / p2;\n } else {\n y_real = p2 - p1;\n real_ratio = (double) p2 / p1;\n }\n int pdiff;\n if (a == b) {\n pdiff = y_real;\n mturk_ratio = real_ratio;\n } else {\n pdiff = -y_real;\n mturk_ratio = 1 / real_ratio;\n }\n if (p2 > p1) {\n for (int i = 0; i < arr.length; i++) {\n arr[i] = -arr[i];\n }\n }\n w.write(pdiff + \" \");\n w.write(numberFormat.format(real_ratio) + \" \");\n w.write(numberFormat.format(mturk_ratio) + \" \");\n for (int i = 0; i < size; i++) {\n if (i != arr.length - 1) {\n w.write(arr[i] + \" \");\n } else {\n w.write(arr[i]);\n }\n }\n w.write(\"\\n\");\n arr = new int[size];\n }",
"protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public void solveIt() {\n\t\tfirstFreeSquare.setNumberMeAndTheRest();\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n n = in.nextInt();\n m = in.nextLong();\n initFactorSets();\n long total = 0;\n\n boolean add = true;\n for (ArrayList<Integer> factorSet : factorSets) {\n for (int factor : factorSet) {\n if (add) {\n total += m / factor;\n } else {\n total -= m / factor;\n }\n }\n add = !add;\n }\n System.out.println(total);\n }",
"static int nonDivisibleSubset(int k, int[] S) {\n\t\tint result = 0;\n\n\t\tArrayList < ArrayList < Integer >> solutions = new ArrayList < ArrayList < Integer >>();\n\t\tArrayList < HashSet < Integer >> minSets = new ArrayList < HashSet < Integer >>();\n\n\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( S [ 0 ])));\n\t\tminSets.add (new HashSet <Integer > ( ));\n\t\tminSets.get(0).add ( S [ 0 ] % k);\n\n\n\t\t// Go over all the numbers\n\t\tfor ( int i = 1; i < S.length; i++ ){\n\t\t\tint n = S [ i ]; \n\t\t\tint m = S [ i ] % k; // Number we will add to all the elements of all the minSets.\n\n\t\t\t// Go over all the minSets.\n\t\t\t// For each one, check that each element plus m is not divisible by k.\n\n\t\t\tboolean workedForASet = false;\n\t\t\tfor ( int j = 0; j < minSets.size(); j++){\n\t\t\t\t// For each set, check all the elements of the set.\n\n\t\t\t\tHashSet < Integer > minSet = minSets.get(j);\n\t\t\t\tIterator < Integer > iter = minSet.iterator();\n\n\t\t\t\tboolean works = true;\n\t\t\t\twhile ( iter.hasNext() && works ){\n\t\t\t\t\tint num = iter.next();\n\t\t\t\t\tif ( (num + m) % k == 0 ){\n\t\t\t\t\t\tworks = false;\n\t\t\t\t\t\tworkedForASet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( works ){\n\t\t\t\t\tsolutions.get(j).add(n);\n\t\t\t\t\tminSet.add(m);\n\t\t\t\t}\n\t\t\t} \n\n\t\t\tif ( !workedForASet ){\n\t\t\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( n )));\n\t\t\t\tminSets.add (new HashSet <Integer > ( ));\n\t\t\t\tminSets.get (minSets.size() - 1).add ( m ); \n\t\t\t} \n\t\t}\n\n\t\t// Find the solution with the most elements.\n\n\t\tfor ( ArrayList <Integer > solution : solutions ){\n\t\t\tresult = Math.max ( result, solution.size() );\n\t\t\tSystem.out.println ( solution );\n\t\t}\n\n\t\tif ( result == 1 ) result = 0;\n\t\treturn result;\n\t}",
"public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for (int Q = 0; Q < T; Q++) {\n \tint N = sc.nextInt();\n \tint M = sc.nextInt();\n \tint[][] m = new int[M][3];\n \tfor (int i = 0; i < M; i++) {\n \t\tm[i][0] = sc.nextInt();\n \t\tif (m[i][0] == 1) {\n \t\t\t//合并x和y所在的集合\n \t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tm[i][2] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 2){\n\t\t\t\t\t//将x提出来成立新的集合\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 3){\n\t\t\t\t\t//输出x所在集合的正整数个数\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tSystem.out.println(i);\n\t\t\t\t}\n \t}\n }\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.print(\"Unesite velicinu n x n matrice: \");\r\n\t\tint n = input.nextInt(); // unos n x n matrice n = broj redova i kolona matrice\r\n\r\n\t\tint[][] matrix = new int[n][n];\r\n\t\tArrayList<Integer> maxR = new ArrayList<>();\r\n\t\tArrayList<Integer> maxK = new ArrayList<>();\r\n\r\n\t\tSystem.out.println(\"Matrica: \");\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\t\tmatrix[i][j] = (int)(Math.random()*2); // punjenje matrice integerima 0 i 1\r\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \"); // ispis matrice u konzolu\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\tint sumaR = 0, sumaK = 0, totalSumaR, totalSumaK, nula = 0;\r\n\t\t\r\n\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\tsumaR += matrix[0][j]; // suma reda matrice\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tsumaK += matrix[i][0]; // suma kolona matrice\r\n\t\t}\r\n\t\tfor(int i=0; i<matrix.length; i++) { // za sve elemente matrice\r\n\t\t\ttotalSumaR = 0;\r\n\t\t\ttotalSumaK = 0;\r\n\t\t\tfor(int j=0; j<matrix[i].length; j++) {\r\n\t\t\t\ttotalSumaR += matrix[i][j]; // suma svih redova matrice\r\n\t\t\t\ttotalSumaK += matrix[j][i]; // suma svih kolona matrice\r\n\t\t\t\tif(totalSumaR > sumaR) { // ako bilo koji red matrice ima vecu sumu od sume prvog reda matrice\r\n\t\t\t\t\tsumaR = totalSumaR; // taj red postaje red sa najvecom sumom\r\n\t\t\t\t\tmaxR.clear(); // brisu se stare pozicije redova sa najvecom sumom\r\n\t\t\t\t\tmaxR.add(i); // ubacivanje broja indexa reda sa najvecom sumom u listu\t\r\n\t\t\t\t} else if(totalSumaR == sumaR) { // ako je ukupna suma zadnjeg reda jednak najvecoj sumi reda\r\n\t\t\t\t\t//maxR.clear(); brisu se ostale pozicije redova sa najvecom sumom u listi (ako trazimo samo zadnji red sa najvise 1)\r\n\t\t\t\t\tmaxR.add(i); // dodaje se krajnja pozicija najvece sume reda u listi\r\n\t\t\t\t}\r\n\t\t\t\tif(totalSumaK > sumaK) { // ako bilo koja kolona matrice ima vecu sumu od sume prve kolone matrice\r\n\t\t\t\t\tsumaK = totalSumaK; // ta kolona postaje kolona sa najvecom sumom\r\n\t\t\t\t\tmaxK.clear(); // brisu se stare pozicije kolone sa najvecom sumom\r\n\t\t\t\t\tmaxK.add(i); // ubacivanje broja indexa kolone sa najvecom sumom u listu\r\n\t\t\t\t} else if(totalSumaK == sumaK) { // ako je ukupna suma zadnje kolone jednaka najvecoj sumi kolone\r\n\t\t\t\t\t//maxK.clear(); brisu se ostale pozicije kolona sa najvecom sumom u listi (ako trazimo samo zadnju kolonu sa najvise 1)\r\n\t\t\t\t\tmaxK.add(i); // dodaje se krajnja pozicija najvece sume kolone u listi\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(maxR.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxR.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"Redovi sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxR.size(); i++) {\r\n\t\t\tSystem.out.print(maxR.get(i) + \" \"); // ispis pozicija najvece sume redova iz liste\r\n\t\t}\r\n\t\tif(maxK.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxK.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"\\nKolone sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxK.size(); i++) {\r\n\t\t\tSystem.out.print(maxK.get(i) + \" \"); // ispis pozicija najvece sume kolona iz liste\r\n\t\t}\r\n\t\t\r\n\t\tinput.close();\r\n\t}",
"public static void bestApproach(int matrix[][]){\n\t\t\n\t\tint m = matrix.length;\n\t\tint n = matrix[0].length;\n\t\t\n\t\t//Taking two variables for storing status of first row and column\n\t\tboolean firstRow = false;\n\t\tboolean firstColumn = false;\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\tif(matrix[i][j] == 0){\n\t\t\t\t\tif(i == 0) firstRow == true;\n\t\t\t\t\tif(j == 0) firstColumn == true;\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][0] = 0;\n\t\t\t\t\tmatrix[0][j] = 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 1;i<m;i++){\n\t\t\t\n\t\t\tfor(int j = 1;j<n;j++){\n\t\t\t\t//based on first row and first column making the entire column and row as zero\n\t\t\t\tif(matrix[0][j] == 0 || matrix[i][0] == 0){\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Making every column value to 0 in first row\n\t\tif(firstRow){\n\t\t\t\n\t\t\tfor(int j = 0;j <n;j++){\n\t\t\t\tmatrix[0][j] = 0;\n\t\t\t}\n\t\t}\n\t\t//Making every row value to 0 in first column\n\t\tif(firstColumn){\n\t\t\t\n\t\t\tfor(int i = 0;i <m;i++){\n\t\t\t\tmatrix[i][0] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public static void printTargetSumSubsetsRF(int[] arr, int idx, String set, int sos, int tar) {\n\n /*\n * if (sos > tar) { return; }\n * \n * if (sos == tar) { if(idx < arr.length){ if(arr[idx] == 0){\n * System.out.println(set + 0 + \", .\"); System.out.println(set + \".\"); return; }\n * printTargetSumSubsetsRF(arr, idx + 1, set, sos, tar); return;\n * \n * } else { System.out.println(set + \".\"); return; }\n * \n * }\n * \n * \n * for (int i = idx; idx < arr.length; idx++) { printTargetSumSubsetsRF(arr, idx\n * + 1, set + arr[idx] + \", \", sos + arr[idx], tar); }\n */\n if (sos > tar) {\n return;\n }\n if (idx == arr.length) {\n if (sos == tar) {\n System.out.println(set + \".\");\n }\n return;\n }\n\n printTargetSumSubsetsRF(arr, idx + 1, set + arr[idx] + \", \", sos + arr[idx], tar);\n printTargetSumSubsetsRF(arr, idx + 1, set, sos, tar);\n }",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public static void main(final String[] args) {\n // instantiate this set\n Set s = new Set();\n // code to read the test cases input file\n Scanner stdin = new Scanner(new BufferedInputStream(System.in));\n // check if there is one more line to process\n while (stdin.hasNext()) {\n // read the line\n String line = stdin.nextLine();\n // split the line using space\n String[] tokens = line.split(\" \");\n // based on the list operation invoke the corresponding method\n switch (tokens[0]) {\n case \"size\":\n System.out.println(s.size());\n break;\n case \"contains\":\n System.out.println(s.contains(Integer.parseInt(tokens[1])));\n break;\n case \"print\":\n System.out.println(s);\n break;\n case \"add\":\n int[] intArray = intArray(tokens[1]);\n if (intArray.length == 1) {\n s.add(intArray[0]);\n } else {\n s.add(intArray);\n }\n break;\n case \"intersection\":\n s = new Set();\n Set t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(s.intersection(t));\n break;\n case \"retainAll\":\n s = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n System.out.println(s.retainAll(intArray));\n break;\n case \"cartesianProduct\":\n s = new Set();\n t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(Arrays.deepToString(s.cartesianProduct(t)));\n break;\n default:\n break;\n }\n }\n }",
"public SATSolver get5Solver() {\n final int A = 1, B = 2, C = 3, D = 4, E = 5, F = 6;\n SATSolver solver = new SAT4JSolver();\n// int[][] clauses = {\n// \t{-1,2},{-1,3},{-1,4},{-1,5},{-1,6},{-2,-3},{-2,-4},{-2,-5},{-2,-6},\n// \t{-3,1},{-3,2},{-4,1,2,3},{-5,-1},{-5,-2},{-5,-3},{-5,-4},{-6,-1},{-6,-2},\n// \t{-6,-3},{-6,-4},{-6,-5},\n// \t{-2,-3,-4,-5,-6,1},{3,4,5,6,2},{-1,-2,3},{-1,4},{-2,4},{-3,4},{1,2,3,4,5},{1,2,3,4,5,6}};\n \n int[][] clauses = {\n \t\t// From statement (1)\n \t\t{A, -B, -C, -D, -E, -F},\n \t\t{-A, B},\n \t\t{-A, C},\n \t\t{-A, D},\n \t\t{-A, E},\n \t\t{-A, F},\n \t\t\n \t\t// From statement (2)\n \t\t{B, C, D, E, F},\n \t\t{-B, -C},\n \t\t{-B, -D},\n \t\t{-B, -E},\n \t\t{-B, -F},\n \t\t\n \t\t// From statement (3)\n \t\t{C, -A, -B},\n \t\t{-C, A},\n \t\t{-C, B},\n \t\t\n \t\t// From statement (4)\n \t\t{D, -A},\n \t\t{D, -B},\n \t\t{D, -C},\n \t\t{A, B, C, -D},\n \t\t\n \t\t// From statement (5)\n \t\t{A, B, C, D, E},\n \t\t{-E, -A},\n \t\t{-E, -B},\n \t\t{-E, -C},\n \t\t{-E, -D},\n \t\t\n \t\t// From statement (6)\n \t\t{A, B, C, D, E, F},\n \t\t{-F, -A},\n \t\t{-F, -B},\n \t\t{-F, -C},\n \t\t{-F, -D},\n \t\t{-F, -E},\n \t\t\n }; // TODO - Insert your clauses here.\n for (int[] clause : clauses)\n solver.addClause(clause);\n return solver;\n\t}",
"public void setFinalSolution() {\r\n for(int i=0; i<Config.numberOfSeeds;i++) {\r\n// this.seeds[i].setDurationMilliSec(GLowestState.getDwelltimes()[i]);\r\n// Cur_state[i] = GLowestState.getDwelltimes()[i];\r\n Cur_state[i] = this.seeds[i].getDurationMilliSec();\r\n }\r\n if (Config.SACostFunctionType==3) {\r\n setCur_cost(costCUR());\r\n }\r\n if (Config.SACostFunctionType==2) {\r\n setCur_cost(costCURfinal());\r\n }\r\n if (Config.SACostFunctionType==1) {\r\n setCur_cost(costCURsuper());\r\n }\r\n if (Config.SACostFunctionType==0) {\r\n setCur_cost(costCURsuperfinal());\r\n }\r\n }",
"private String getSolution(String dayColum, String MxTColum, String MnTColum, ArrayList<String[]> dataset) {\n\t\tint line = -1; // the number of the row, which has Small Temperature Spread\n\t\tint mxt = -1; // the number of the column, which is mxt\n\t\tint mnt = -1; // the number of the column, which is mnt\n\t\tint day = -1; // the number of the column, which is mnt\n\t\tif (dataset.size() == 0)\n\t\t\treturn String.valueOf(-1);\n\t\tfor (int i = 0; i < dataset.get(0).length; i++) {\n\t\t\tif (dataset.get(0)[i].equals(MxTColum))\n\t\t\t\tmxt = i;\n\t\t\tif (dataset.get(0)[i].equals(MnTColum))\n\t\t\t\tmnt = i;\n\t\t\tif (dataset.get(0)[i].equals(dayColum))\n\t\t\t\tday = i;\n\t\t}\n\t\tif ((mxt == -1) || (mnt == -1) || (day == -1)) \n\t\t\treturn String.valueOf(-1);\n\t\tfloat min = Float.MAX_VALUE;\n\t\tfor (int i = 1; i < dataset.size(); i++) {\n\t\t\ttry {\n\t\t\t\tfloat mnt_value = Float.parseFloat(dataset.get(i)[mnt]);\n\t\t\t\tfloat mxt_value = Float.parseFloat(dataset.get(i)[mxt]);\n\t\t\t\tif (min > Math.abs(mnt_value - mxt_value)) {\n\t\t\t\t\tmin = Math.abs(mnt_value - mxt_value);\n\t\t\t\t\tline = i;\n\t\t\t\t}\n\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// System.out.println(mnt+\" \"+mxt+\" \"+line);\n\t\treturn String.valueOf(dataset.get(line)[day]);\n\t}",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}",
"@SuppressWarnings(\"Main Logic\")\n void solve() {\n n = ii();\n m = ii();\n a = iia(n);\n int from[] = new int[n - 1];\n int to[] = new int[n - 1];\n for (int i = 0; i < n - 1; i++) {\n from[i] = ii() - 1;\n to[i] = ii() - 1;\n }\n g = packU(n, from, to, n - 1);\n int[][] pars = parents3(g, 0);\n par = pars[0];\n int[] ord = pars[1];\n dep = pars[2];\n spar = logstepParents(par);\n subTree = new int[n];\n dfs(0, -1);\n pointer = 1;\n baseArray = new int[n + 1];\n chainNo = 0;\n chainInHead = new int[n];\n Arrays.fill(chainInHead, -1);\n posInBase = new int[n];\n chainInInd = new int[n];\n HLD(0, -1);\n makeTree();\n out.println(Arrays.toString(baseArray));\n out.println(Arrays.toString(a));\n for (int q = 0; q < m; q++) {\n int type = ii();\n if (type == 1) {\n int u = ii() - 1, v = ii() - 1;\n query(u, v);\n out.println(\"DONE\");\n } else {\n int u = ii(), v = ii();\n // update\n }\n }\n }",
"@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}",
"public static void main(String args[]) throws Exception {\n\n\t\tString file = \"B-small-attempt0\";\n\n\t\tObject[] pairIO = IO.openIO(file);\n\t\tBufferedReader red = (BufferedReader) pairIO[0];\n\t\tPrintWriter wr = (PrintWriter) pairIO[1];\n\n\n\t\tint problemas = Integer.parseInt(red.readLine());\n\t\touter: for (int w = 0 ; w < problemas ; w++) {\n\t\t\tString par [] = red.readLine().split(\" \");\n\t\t\tdouble C = Double.parseDouble(par[0]);\n\t\t\tdouble F = Double.parseDouble(par[1]);\n\t\t\tdouble X = Double.parseDouble(par[2]);\n\t\t\tdouble V0 = 2;\n\t\t\t\n\t\t\tdouble mint = X/V0;\n\t\t\tdouble parSum = 0;\n\t\t\tint i = 1;\n\t\t\twhile (true) {\n\t\t\t\tdouble series = parSum + C/(V0 + (i-1)*F);\n\t\t\t\tdouble t = series + X/(V0 + i*F);\n\t\t\t\tif (t < mint) {\n\t\t\t\t\tmint = t;\n\t\t\t\t\tparSum = series;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twr.println(\"Case #\" + (w+1) + \": \" + mint);\n\t\t}\n\t}",
"public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}",
"void solve() throws IOException {\n\t\tint n = ni();\n\t\tint[] v = new int[n];\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tv[i] = ni();\n\t\tsolve(v);\n\t\tout.println(result.size());\n\t\tfor (int a : result)\n\t\t\tout.print(a + \" \");\n\t}",
"public int minCostClimbingStairs(int[] cost) {\n // We initialize an array of size = cost, and it means the minimun cost of reaching n^th stair\n int[] dp = new int[cost.length];\n // We assign values to the first 2 numbers in the array because it can´t be smaller than 3\n dp[0] = cost[0];\n dp[1] = cost[1];\n // We iterate from n=2 to n-1, and in each position we save the min\n // value to reach the stair, the MIN is (dp[i-1] + cost[i] , dp[i-2] + cost[i]\n // that is so that the min way of reaching that stair is either using the n-1 or n-2\n for (int i = 2; i < cost.length; i++) {\n dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);\n }\n\n // We return the min value of the last 2 stairs because both can reach the end\n return Math.min(dp[cost.length - 1], dp[cost.length - 2]);\n\n\t\t /*\n\t\t\t cost[1,100,1,1,1,100,1,1,100,1]\n\t\t 1.- Imagine this is the array\n\t\t\t dp[]\n\t\t 2.- We add the first two values\n\t\t\t dp[1,100]\n\t\t 3.- Iterate form 2 to n\n\t\t\t This is a representation of the first one\n\t\t dp[2] = Math.min(1+1, 100+1)\n\t\t dp[2] = Math.min(2,101)\n\t\t dp[2] = 2\n\t\t dp[1,100,2]\n\t\t\t After the for, this is how it should look\n\t\t dp[1,100,2,3,3,103,4,5,105,6]\n\t\t 4.- Select the min between last 2 because both can reach last step\n\t\t\treturn min (105,6)\n\t\t\treturn 6\n\n\t\t\tIt should have a space complexity of O(n) becuase we´re using an array of n size\n\t\t\tThe time complexity should also be O(n) because we have to iterate through all the array once\n\n\t\t */\n }",
"private ASSPSolution floydWarshall(Double[][] aMatrix, Integer[][] pMatrix)\n {\n Double best[][][] = new Double[2][this.numIntxns][this.numIntxns];\n Integer pred[][][] = new Integer[2][this.numIntxns][this.numIntxns];\n\n best[0] = aMatrix;\n best[1] = aMatrix;\n\n pred[0] = pMatrix;\n pred[1] = pMatrix;\n\n int solnIndex = 0;\n\n for (int k = 0; k < this.numIntxns; k++)\n {\n for (int u = 0; u < this.numIntxns; u++)\n {\n for (int v = 0; v < this.numIntxns; v++)\n {\n // we only need to keep two matrices in memory and swap\n // between them. i and j alternate.\n int i = k % 2;\n int j = (i == 0) ? 1 : 0;\n\n best[i][u][v] = best[j][u][v];\n\n // note that null represents infinity\n if (best[i][u][k] != null && best[i][k][v] != null)\n {\n // if this spot is infinite, anything is better\n if (best[i][u][v] == null)\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n else if \n ((best[j][u][k] + best[j][k][v]) < best[i][u][v])\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n\n // Stores the last i value so that the correct answers \n // can be sent back to the user.\n if (v == this.numIntxns - 1)\n {\n solnIndex = i;\n }\n }\n }\n }\n }\n\n return new ASSPSolution(best[solnIndex], pred[solnIndex]);\n }",
"public void doRegressionAnalysis()\r\n {\n n = Y.getRowDimension();\r\n p = X.getColumnDimension(); \r\n k = p - 1; // k is number of explanatory variables\r\n Resids = new Matrix(n, 1);\r\n StandResids = new Matrix(n, 1);\r\n StudResids = new Matrix(n, 1);\r\n Cooks_D = new Matrix(n, 1);\r\n R_Student = new Matrix(n, 1);\r\n\r\n // MVP, p73\r\n X_Prime = X.transpose();\r\n X_Prime_X = X_Prime.times(X);\r\n X_Prime_X_Inv = X_Prime_X.inverse(); \r\n HatMatrix = X.times(X_Prime_X_Inv.times(X_Prime)); \r\n BetaHats = X_Prime_X_Inv.times(X_Prime.times(Y)); \r\n YHats = HatMatrix.times(Y);\r\n BXY = (BetaHats.transpose()).times(X_Prime.times(Y));\r\n Y_Prime_Y = (Y.transpose()).times(Y); \r\n ssRegression = BXY.get(0,0) - sumY_Squared_Over_n;\r\n SSRes = Y_Prime_Y.minus(BXY);\r\n ssResiduals = SSRes.get(0,0);\r\n ssTotal = Y_Prime_Y.get(0,0) - sumY_Squared_Over_n;\r\n \r\n r2 = ssRegression / ssTotal;\r\n s = Math.sqrt(ssResiduals / (n - k - 1));\r\n adj_r2 = 1.0 - (ssResiduals / (n - k - 1)) / (ssTotal / (n - 1));\r\n \r\n dfReg = k;\r\n dfResid = n - k - 1;\r\n dfTotal = n - 1;\r\n msReg = ssRegression / (double)k;\r\n msResid = ssResiduals / (double)(n - k - 1);\r\n fStatistic = msReg / msResid;\r\n fDist = new FDistribution(k, n - k - 1);\r\n pValue_F = fDist.getRightTailArea(fStatistic);\r\n Resids = Y.minus(YHats);\r\n\r\n tempDouble_01 = 1.0 / Math.sqrt(msResid);\r\n\r\n StandResids = Resids.times(tempDouble_01); \r\n for (int jj = 0; jj < n; jj++)\r\n { \r\n tempDouble_02 = HatMatrix.get(jj, jj);\r\n StudResids.set(jj, 0, Resids.get(jj, 0) * tempDouble_01 / Math.sqrt(1.0 - tempDouble_02));\r\n tempDouble_03 = StudResids.get(jj, 0) * StudResids.get(jj, 0) / (double)p;\r\n tempDouble_04 = tempDouble_02 / (1.0 - tempDouble_02);\r\n Cooks_D.set(jj, 0, tempDouble_03 * tempDouble_04);\r\n \r\n // Student-R calculations from 4.12, 4.13, p135\r\n jjResid = Resids.get(jj, 0);\r\n double e_i_sq = jjResid * jjResid; \r\n double oneMinus_hii = 1.0 - HatMatrix.get(jj, jj);\r\n double s_i_sq = ((n - p)*msResid - e_i_sq/oneMinus_hii) / (n - p - 1);\r\n R_Student.set(jj, 0, jjResid / Math.sqrt(s_i_sq * oneMinus_hii)); \r\n }\r\n\r\n StErrCoef = new Matrix(k + 1, 1); // Explanatory variables + intercept \r\n TStat = new Matrix(k + 1, 1); \r\n PValue_T = new Matrix(k + 1, 1); \r\n tDist = new TDistribution (n - k - 1);\r\n\r\n for (int preds = 0; preds <= k; preds++)\r\n {\r\n StErrCoef.set(preds, 0, Math.sqrt(msResid * X_Prime_X_Inv.get(preds, preds)));\r\n TStat.set(preds, 0, BetaHats.get(preds, 0) / StErrCoef.get(preds, 0));\r\n PValue_T.set(preds, 0, 2.0 * tDist.getRightTailArea(Math.abs(TStat.get(preds, 0))));\r\n }\r\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint query = input.nextInt();\n\t\t\n\t\tfor(int i=0;i<query;i++)\n\t\t{\n\t\t\tint n=input.nextInt();\n\t\t\tint m=input.nextInt();\n\t\t\tint[] array=new int[n];\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tarray[j]=input.nextInt();\n\t\t\t}\n\t\t\tSystem.out.println(maxSubArraySum(subsets(array),m));\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\r\n\tpublic <E> CSPResult<E> solve(CSP<E> csp, int i) {\r\n\t\titerationCount = 0;\r\n\t\tif(i==0) {\r\n\t\t\tAssignment<E> finalAssignment = backtrackFC(csp, new Assignment<E>());\r\n\t\t\treturn new CSPResult<E>(finalAssignment, iterationCount);\t\r\n\t\t}\r\n\t\tif(i==1) {\r\n\t\t\tAssignment<E> finalAssignment = backtrackFCMRVLRVDH(csp, new Assignment<E>());\r\n\t\t\treturn new CSPResult<E>(finalAssignment, iterationCount);\t\r\n\t\t}\r\n\t\tif(i==2) {\r\n\t\t\t\r\n\t\t\tAssignment<E> AC3Assignment = backtrackAC3(csp, new Assignment<E>());\r\n\t\t\treturn new CSPResult<E>(AC3Assignment,iterationCount);\r\n\t\t}\r\n\t\tif(i==3) {\r\n\t\t\t\r\n\t\t\tAssignment<E> AC3Assignment = backtrackAC3MRVLRVDH(csp, new Assignment<E>());\r\n\t\t\treturn new CSPResult<E>(AC3Assignment,iterationCount);\r\n\t\t}\r\n\t\tif(i==4) {\r\n\t\t\t\r\n\t\t\tAssignment<E> Backtracking = backtracking(csp, new Assignment<E>(), new HashMap<String,Set<E>>());\r\n\t\t\treturn new CSPResult<E>(Backtracking,iterationCount);\r\n\t\t}\r\n\t\tif(i==5) {\r\n\t\t\t\r\n\t\t\tAssignment<E> Backtracking = backtrackingMRVLCVDH(csp, new Assignment<E>(), new HashMap<String,Set<E>>());\r\n\t\t\treturn new CSPResult<E>(Backtracking,iterationCount);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void maximize()\n\t{\n\t\tint i,j,max=cost[0][0];\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]>max)\n\t\t\t\t{\n\t\t\t\t\tmax=cost[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\t\t\n\t\t\t\tcost[i][j]=max-cost[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}",
"private void testSolution(String input, String output) {\n runs++;\n\n // Load the problem & solution\n ProblemSpec problemSpec = Solution.loadProblem(input);\n Solution solution = new Solution(problemSpec);\n\n // Solve and time the solution\n long startTime = System.currentTimeMillis();\n List<State> states = solution.solve();\n long endTime = System.currentTimeMillis();\n durations.put(input, endTime - startTime);\n\n // Output the solution\n Solution.writeSolution(Formatter.format(states), output);\n\n problemSpec = Solution.loadProblem(input, output);\n if (solutionPasses(problemSpec)) {\n passes++;\n }\n\n successes++;\n }",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int t = Integer.parseInt(s.nextLine());\n for(int i=1;i<=t;i++){\n int n = Integer.parseInt(s.nextLine());\n Set<String> a = new HashSet<>();\n\n for(int j=0;j<n;j++) {\n String str = s.nextLine();\n if(str.equals(\"easy-medium\"))\n str=\"medium\";\n else if(str.equals(\"medium-hard\"))\n str=\"hard\";\n a.add(str);\n }\n System.out.println(a.size()<5?\"No\":\"Yes\");\n /*int a1=0,a2=0,a3=0,a4=0,a5=0;\n for(int k=0;k<n;k++){\n if(a.contains(\"cakewalk\"))\n a1++;\n if(a.contains(\"simple\"))\n a2++;\n if(a[k].equals(\"easy\"))\n a3++;\n if(a[k].equals(\"easy-medium\") || a[k].equals(\"medium\"))\n a4++;\n if(a[k].equals(\"medium-hard\") || a[k].equals(\"hard\"))\n a5++;\n }\n if(a1==1&&a2==1&&a3==1&&a4==1&&a5==1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n*/\n }\n }",
"public void SOM() {\n // Pick an input vector randomly.\n // A input vector can't be picked twice in a row.\n ArrayList<Double> oldVector = new ArrayList<>();\n ArrayList<Double> vector;\n\n for (int t = 0; t < this.nbIterations; t++) {\n\n // Choose another entry vector than the previous one.\n do {\n int randomInput = (int) (Math.random() * this.input.size());\n vector = this.input.get(randomInput);\n } while (oldVector.equals(vector));\n\n // The old vector is replaced by the new one.\n oldVector = new ArrayList<>(vector);\n\n // Calculation of BMU (Best Matching Unit).\n Neuron BMU = this.getBMU(vector);\n\n // Update the BMU's neighbors.\n this.updateNeighbors(BMU, vector, t);\n\n // Update the screen.\n this.screen.repaint();\n // Sleep for the animation.\n try {\n Thread.sleep(10);\n }\n catch (InterruptedException e) {\n System.out.println(\"Erreur sleep : \" + e);\n }\n }\n }",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n\t\tint T = Integer.parseInt(br.readLine());\n\t\tfor(int tc = 1; tc <= T; tc++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\tint N = Integer.parseInt(st.nextToken());\n\t\t\tint M = Integer.parseInt(st.nextToken());\n\n\t\t\tint[][] arr = new int[N][M];\n\t\t\tint[] sum = new int[M];\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tarr[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tif(arr[i][j] == 1)\n\t\t\t\t\t\tsum[i]++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint cnt = 0;\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tmax = Math.max(max, sum[i]);\n\t\t\t}\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tif(max == sum[i]) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbw.write(\"#\"+tc+ \" \" + cnt + \" \" + max + \"\\n\");\n\t\t\tbw.flush();\n\t\t}\n\t}",
"public<P extends Problem, S extends Solution> S solve(P problem, Class<P> problemClass, Class<S> solutionClass);",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint [][][] dp = new int[n+1][m+1][m+1];\n\t\tint [][] arr = new int[n+1][m+1];\n\t\tint max = 1;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (arr[i][j] == 1) {\n\t\t\t\t\tfor (int z = j; z <= m && arr[i][z] == 1; z++) {\n\t\t\t\t\t\tdp[i][j][z] = dp[i-1][j][z] + 1;\n\t\t\t\t\t\tmax = Math.max(max, Math.min(dp[i][j][z], z-j+1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"public static void main(String[] args) throws IOException {\n\n\t\t\n\t\tdouble[] columnwise = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.};\n\t\tdouble[] condmat = {1.,3.,7.,9.};\n\t\tint[] matrixDimension = new int[10]; // dont except to ever use more than 4 cells. would by 99x99\n\n\tString[] inputARGNull = null ;\n\t\tArrayList<Integer> inputTestData = new ArrayList<>(Arrays.asList(11,2,3,6,11,18,45,88));\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(inputTestData.toString());\n//\t\tSystem.out.println(\"Test Running Class: \" +this.getClass() ) ;\t\n//\t\tMatrix testRunMatrix = new Matrix(2, 3, inputTestData );\n\n\t\tMatrix testRunMatrix = new Matrix();\n\t\ttestRunMatrix.setName(\"testRunMatrix\");\n\t\ttestRunMatrix.displayCompact();\n//\t\tclearScreen();\n\n\t\tMatrix firstRunMatrixParams = new Matrix(3,3, inputTestData);\n\t\tfirstRunMatrixParams.setName(\"firstRunMatrixParams\");\n\t\tfirstRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t\tMatrix secondRunMatrixParams = new Matrix(3,3, columnwise); // or condmat\n\t\tsecondRunMatrixParams.setName(\"secondRunMatrixParams\");\n\t\tsecondRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t//\tfirstRunMatrixParams.displayDeepString();\n\t//\tsecondRunMatrixParams.displayDeepString();\n\t\tmatrixDimension[0]=2;\n\t\tmatrixDimension[1]=3;\n\t\n\t\tMatrix outOfSeqTestMatrix = new Matrix(matrixDimension, columnwise);\n\t\tsecondRunMatrixParams.setName(\"outOfSeqTestMatrix\");\n\t\tsecondRunMatrixParams.displayCompact();\n\t\t\n\t\tMatrix addResult = firstRunMatrixParams.Add(secondRunMatrixParams);\n\t\taddResult.setName(\"addResult\");\n\t\t\n\t\taddResult.displayCompact();\n//\t\tclearScreen();\n\t\t\n//\t\taddResult = addResult.Multiply((22/7));\n\t\taddResult = addResult.Multiply(3.623);\n\t\taddResult.displayMore();\n\t\t\n\t\t\n\t\tString[] testInput1 = new String[]{\"-c\",\"5x4\",\"12\", \"32\", \"43\", \"44\", \"5\",\"5\",\"5\",\"4\",\"4\",\".999999999\",\"0\",\"0\",\"0\",\"9\",\"4\",\"2.71826\",\"3.14159\",\"33\",\"11\",\"0.1136\",\"888\",\"7\",\"6\",\"5\"};\n\t\tInputStringObj myTestCase = new InputStringObj(\"-c\", testInput1);\n\t\tInputNumericObj myNumTest = new InputNumericObj(myTestCase);\n\t\t\n\t\tSystem.out.println(\"And Now a Matrix from a Numeric Object\");\n\n\t\tMatrix numObjBasedMatrix = new Matrix(myNumTest,\"TestMatrix.java_string\");\n\t\tnumObjBasedMatrix.setName(\"numObjBasedMatrix\");\n\t\tnumObjBasedMatrix.displayCompact();\n\tSystem.out.println(\"\");\n\tSystem.out.println(\"\");\n\t\tnumObjBasedMatrix.displayMore();\n\t\t\n\t\t\n//\t\tclearScreen();\n\t\t\n\t}",
"public abstract List<OptimisationSolution> getSolutions();",
"public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"public static void main(String[] args) throws IOException {\n br = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n nextInt();\r\n int X = nextInt();\r\n String lString = nextToken();\r\n\r\n StringBuilder s = new StringBuilder();\r\n for (; X > 0; X--) s.append(lString);\r\n char[] arr = s.toString().toCharArray();\r\n String soln = solve(arr) ? \"YES\" : \"NO\";\r\n\r\n System.out.printf(\"Case #%d: %s%n\", t, soln);\r\n }\r\n }",
"public SolutionSet execute() throws JMetalException, ClassNotFoundException, IOException {\n initialization();\n createInitialSwarm() ;\n evaluateSwarm();\n initializeLeaders() ;\n initializeParticlesMemory() ;\n updateLeadersDensityEstimator() ;\n\n while (!stoppingCondition()) {\n computeSpeed(iterations_, maxIterations_);\n computeNewPositions();\n perturbation();\n evaluateSwarm();\n updateLeaders() ;\n updateParticleMemory() ;\n updateLeadersDensityEstimator() ;\n iterations_++ ;\n }\n\n tearDown() ;\n return paretoFrontApproximation() ;\n }",
"public String[][] solve(String[][] sudoku, int[] matrizVetados, String[][] pass) \n {\n String[][] sudokuRespuesta = null;\n\n //-- Busqueda de matriz 3x3 con más números o menos espacios vacíos \n \n int[] XY = this.busqueda(sudoku, matrizVetados);\n\n if (XY[0] != 0) \n { \n sudokuRespuesta = this.poner(sudoku, this.matriz3x3(sudoku, XY[1], XY[2]), XY);\n\n if (Arrays.deepEquals(sudokuRespuesta, pass)) \n {\n matrizVetados[this.posicionM3x3(XY[1], XY[2])] = this.posicionM3x3(XY[1], XY[2]);\n } else \n {\n pass = this.poner(pass, this.matriz3x3(pass, XY[1], XY[2]), XY);\n \n //--Limpiar vector vetados\n \n matrizVetados = this.cleanVetados(matrizVetados);\n\n }\n \n \n /*\n Validar si el sudoku está resuelto, de lo contrario se llamará recursivamente. \n */\n \n if (this.isComplete(sudokuRespuesta)) \n {\n return sudokuRespuesta;\n } else \n {\n this.solve(sudokuRespuesta, matrizVetados, pass);\n }\n \n \n } else \n { \n //--Limpiar vector vetados\n \n matrizVetados = this.cleanVetados(matrizVetados);\n int[] XY2 = this.busqueda2(sudoku, matrizVetados);\n \n sudokuRespuesta = this.poner2(sudoku, this.matriz3x3(sudoku, XY2[1], XY2[2]), XY2);\n if (!Arrays.deepEquals(sudokuRespuesta, pass)) \n {\n pass = this.poner2(pass, this.matriz3x3(pass, XY2[1], XY2[2]), XY2);\n }\n \n if (this.isComplete(sudokuRespuesta)) \n {\n return sudokuRespuesta;\n } else {\n this.solve(sudokuRespuesta, matrizVetados, pass);\n }\n }\n \n return sudokuRespuesta;\n }",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tN = Integer.parseInt(st.nextToken());\n\t\tM = Integer.parseInt(st.nextToken());\n\t\t\n\t\tcon = new ArrayList[N+1]; conW = new ArrayList[N+1];\n\t\tD = new long[N+1];\n\t\tfor(int i =1;i<=N;i++ ){\n\t\t\tcon[i] = new ArrayList<>();\n\t\t\tconW[i] = new ArrayList<>();\n\t\t\tD [i] = Long.MAX_VALUE;\n\t\t}\n\t\t\n\t\tfor(int i=1;i<=M;i++){\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tint c = Integer.parseInt(st.nextToken());\n\t\t\tcon[a].add(b); \n\t\t\tconW[a].add(c); \n\t\t}\n\n\t\tD[1] = 0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif(D[i] < Long.MAX_VALUE){\n\t\t\t\tfor (int j=0;j<con[i].size();j++){\n\t\t\t\t\tint k = con[i].get(j);//i->k\n\t\t\t\t\tint w = conW[i].get(j);//i->k까지 가는데 cost\n\t\t\t\t\tD[k] = Math.min(D[k], D[i]+w);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(D[N] < Long.MAX_VALUE ? D[N] : -1);\n\n\t}",
"private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}",
"@Override\r\n\tpublic void solve() {\n\t\t\r\n\t}",
"public SolutionType getBestSolution();",
"public static void main(String[] args) throws IOException{\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\r\n\r\n \tint n = Integer.parseInt(f.readLine());\r\n \t\r\n \tint[] a = new int[n];\r\n \tStringTokenizer st = new StringTokenizer(f.readLine());\r\n \tfor(int i = 0; i < n; i++) a[i] = Integer.parseInt(st.nextToken());\r\n \t\r\n \tSystem.out.println(solution(a));\r\n \r\n //out.close();\r\n }",
"private static void solve() throws IOException {\n\n OptimizationGame.solve();\n SumOfSumOfDigits.solve();\n CrossTheStreet.solve();\n }",
"public static void main(String[] args){\n\n // Create file\n File file = new File(inputfileName);\n\n try {\n BufferedReader in = new BufferedReader(new FileReader(file.getAbsoluteFile()));\n try {\n\n //Read the first 3 lines\n String string1 = in.readLine();\n String string2 = in.readLine();\n String string3 = in.readLine();\n //Ignore an empty string\n in.readLine();\n\n String[] mn = string1.split(\" \");\n String[] sc = string2.split(\" \");\n\n //Initialize m, n, lineNumber, colmn, condition\n m = Integer.parseInt(mn[0]);\n n = Integer.parseInt(mn[1]);\n lineNumber = Integer.parseInt(sc[0]);\n colmn = Integer.parseInt(sc[1]);\n condition = Integer.parseInt(string3);\n\n //Validation of basic parameters\n validation(m, n, condition, lineNumber, colmn);\n\n //----------------------We alternately read all the matrices------------------------\n for (int i = 0; i < m; i++){\n String matrixStr = \"\";\n for (int j = 0; j < n; j++){\n matrixStr += in.readLine() + \" \";\n }\n in.readLine();\n\n int[] tmpIntArray = strToIntArr(matrixStr.trim().split(\" \"));\n\n if(i == 0){\n rezult = getFirstResultString(tmpIntArray);\n continue;\n }else {\n multiplication(matrixStr);\n }\n }\n\n //The desired number\n int rezultValue = rezult[colmn - 1];\n\n //Check the result of the last multiplication\n if(rezultValue >= condition){\n write((rezultValue % condition) + \"\");\n }else {\n write(rezultValue + \"\");\n }\n //---------------------------------------------------------------------------------\n } finally {\n in.close();\n }\n } catch(IOException e) {\n throw new RuntimeException(e);\n }\n }",
"public synchronized Map<String, Result<? extends Record>> solve(final Set<String> tables)\n throws ModelException {\n // run the solver and get a result set per table\n LOG.info(\"Running the solver\");\n final long start = System.nanoTime();\n final Map<IRTable, Result<? extends Record>> recordsPerTable = backend.runSolver(dbCtx, irTables);\n LOG.info(\"Solver has run successfully in {}ns. Processing records.\", System.nanoTime() - start);\n final Map<String, Result<? extends Record>> recordsToReturn = new HashMap<>();\n for (final Map.Entry<IRTable, Result<? extends Record>> entry: recordsPerTable.entrySet()) {\n if (tables.contains(entry.getKey().getName())) {\n recordsToReturn.put(entry.getKey().getName(), entry.getValue());\n }\n }\n return recordsToReturn;\n }"
]
| [
"0.5894574",
"0.58576417",
"0.5773891",
"0.5771225",
"0.5503211",
"0.54555136",
"0.5451275",
"0.5373665",
"0.5321916",
"0.528764",
"0.52598464",
"0.52403843",
"0.5218045",
"0.51843816",
"0.51445025",
"0.51183337",
"0.50966877",
"0.50713485",
"0.506664",
"0.5064372",
"0.5063967",
"0.505649",
"0.50496393",
"0.5038161",
"0.50139815",
"0.4998477",
"0.49980846",
"0.4965459",
"0.49623737",
"0.49553475",
"0.49287286",
"0.49230686",
"0.49168772",
"0.48853037",
"0.48849297",
"0.48440176",
"0.48421398",
"0.48295045",
"0.48260087",
"0.48194313",
"0.48161358",
"0.48155254",
"0.48144785",
"0.4809895",
"0.48026535",
"0.47961915",
"0.4786217",
"0.47769824",
"0.47735947",
"0.47632226",
"0.47602823",
"0.47574368",
"0.47532836",
"0.47449672",
"0.47449607",
"0.47409812",
"0.47393999",
"0.47330612",
"0.47263414",
"0.4725567",
"0.4725204",
"0.47243676",
"0.47192824",
"0.47159636",
"0.47151914",
"0.47043407",
"0.47003692",
"0.46946457",
"0.46940944",
"0.46926185",
"0.46824864",
"0.46812445",
"0.4679415",
"0.46744087",
"0.46718407",
"0.46621433",
"0.46617043",
"0.4659056",
"0.46566552",
"0.4637588",
"0.46371424",
"0.46267238",
"0.46187812",
"0.4618265",
"0.4610728",
"0.46073848",
"0.46037823",
"0.45988864",
"0.45940027",
"0.45937243",
"0.4588229",
"0.45879087",
"0.45825684",
"0.4573913",
"0.4569058",
"0.45667514",
"0.45667356",
"0.4566156",
"0.4565288",
"0.455478"
]
| 0.57304466 | 4 |
Determines a resident optimal solution to the Stable Marriage problem from the given input set. Study the description to understand the variables which represent the input to your solution. | @Override
public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {
int m = marriage.getHospitalCount();
int n = marriage.getResidentCount();
ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();
ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();
ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();
ArrayList<Integer> residentMatching = new ArrayList<Integer>();
arrlistInit(residentMatching, n, -1, false); //O(n)
/*At first the resident can propose to all his list.
Each time a proposal is made the hospital is removed from the list*/
/*Trying to create a copy of the arraylist elements not copy of references*/
ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();
for (int i = 0; i < n; i++) //O(n)
hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));
/*list of residents that still can propose(free and hasn't proposed to every hospital)*/
ArrayList<Integer> proposing = new ArrayList<Integer>();
arrlistInit(proposing, n, 0, true); //O(n)
/*Keep track of each hospital matched residents*/
ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);
for (int i = 0; i < m; i++)
hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)
/*Array list that holds the value of the lowest matched resident rank in each hospital
* so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */
ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();
arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)
/*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/
while (!proposing.isEmpty()) {
/*Get the head of the proposing list*/
for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {
int resident = proposing.get(0);
int hospital = 0;
int hospitalIndex;
/*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/
for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {
hospital = hospitalsToProposeTo.get(resident).get(0);
int residentRank = hospital_preference.get(hospital).indexOf(resident);
/*hospital is full, loop through the matched residents and see if anyone can be kicked out*/
if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {
if (residentRank < lowestMatchedResidentRank.get(hospital)) {
/*1.Replace in hospitalResidents
* 2.Add/remove in resident-matching
* 3.Remove resident from the proposing list
* 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)
*/
int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));
hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);
residentMatching.set(lowestMatchedResident, -1);
residentMatching.set(resident, hospital);
proposing.remove(proposing.indexOf(resident));
if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {
proposing.add(lowestMatchedResident);
}
/*set the lowest rank
* TODO make it O(1)*/
int min = 0;
for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {
int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));
if (tempRank > min)
min = tempRank;
}
lowestMatchedResidentRank.set(hospital, min);
}
}
/*If there is available spot*/
else {
/*1.Add in hospitalResidents
* 2.Add in resident-matching
* 3.Set the lowest ranked resident
* 4.Remove resident from proposing list
*/
/*Update the lowest rank*/
if (residentRank > lowestMatchedResidentRank.get(hospital))
lowestMatchedResidentRank.set(hospital, residentRank);
hospitalResidents.get(hospital).add(resident);
residentMatching.set(resident, hospital);
proposing.remove(proposing.indexOf(resident));
}
/*1. Remove hospital from resident's hospitalsToProposeTo
*2. If resident is matched or proposed to every possible hospital, remove resident from proposing list
*/
hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));
if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))
proposing.remove(proposing.indexOf(resident));
}
}
}
marriage.setResidentMatching(residentMatching);
return marriage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }",
"@Override\n public Matching stableMarriageBruteForce_residentoptimal(Matching marriage) {\n int residentsNumber = marriage.getResidentCount();\n int hospitalSlots = marriage.totalHospitalSlots();\n\n ArrayList<ArrayList<Integer>> validPartners = new ArrayList<ArrayList<Integer>>(0);\n ArrayList<Matching> stableMatchings = new ArrayList<Matching>();\n int count = 0;\n\n Permutation p = new Permutation(residentsNumber, hospitalSlots);\n Matching matching;\n int i=0;\n while ((matching = p.getNextMatching(marriage)) != null) {\n i++;\n\n if (isStableMatching(matching)) {\n stableMatchings.add(matching);\n validPartners.add(matching.getResidentMatching());\n count++;\n }\n }\n\n if (count == 1)\n return stableMatchings.get(0);\n\n validPartners = sortValidPartners(marriage, stableMatchings.size(), validPartners);\n\n return getBruteForceCorrectMatching(stableMatchings, validPartners);\n }",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n//\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N= Integer.parseInt(st.nextToken());\n\t\tint T= Integer.parseInt(st.nextToken());\n\t\t\n\t\t//for each N, three possible problem sets (P, A, G)\n\t\t//and P (prep time: min), V (value)\n\t\t//P <= A <= G\n\t\t\n\t\t//given limit T\n\t\t//find max profit\n\t\tint[][] v = new int[N+1][3+1];\n\t\tint[][] w = new int[N+1][3+1];\n\t\t\n\t\t//one \n\t\t\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\t\t\t\tw[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\tv[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t}\n\t\t}\n//\t\tfor (int i = 1; i <= N; i++) {\n//\t\t\tfor (int j = 1; j <= 3; j++) {\n//\t\t\t\tSystem.out.println(w[i][j] + \" \"+ v[i][j]);\n//\t\t\t}\n//\t\t}\n\t\tint[][] dp = new int[2][T+1];\n\t\t//where k looks at the kth row of the values/weight array\n\t\tfor (int k = 1; k <= N; k++) {\n\t\t\tfor (int x = 0; x <= T; x++) {\n\t\t\t\t//going through each weight and value\n\t\t\t\tboolean ran = false;\n\t\t\t\tfor (int a = 1; a <= 3; a++) {\t\t\t\t\t\n\t\t\t\t\tif (w[k][a] > x) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tran = true;\n\t\t\t\t\t\tdp[1][x] = Math.max(Math.max(dp[0][x],dp[0][x-w[k][a]] + v[k][a]),dp[1][x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!ran) {\n\t\t\t\t\tdp[1][x] = dp[0][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp[0] = dp[1].clone();\n//\t\t\tfor (int[] row: dp) {\n//\t\t\t\tfor (int m: row) {\n//\t\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println();\n//\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int[] row: dp) {\n//\t\t\tfor (int m: row) {\n//\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t}\n//\t\t\tSystem.out.println();\n//\t\t}\n\t\tSystem.out.println(dp[1][T]);\n\t}",
"private static void solve(long[][][] ranks, String problem_name) {\n Solver solver = new Solver(\"StableMarriage\");\n\n //\n // data\n //\n System.out.println(\"\\n#####################\");\n System.out.println(\"Problem: \" + problem_name);\n\n long[][] rankWomen = ranks[0];\n long[][] rankMen = ranks[1];\n\n int n = rankWomen.length;\n\n //\n // variables\n //\n IntVar[] wife = solver.makeIntVarArray(n, 0, n - 1, \"wife\");\n IntVar[] husband = solver.makeIntVarArray(n, 0, n - 1, \"husband\");\n\n //\n // constraints\n // (the comments are the Comet code)\n // forall(m in Men)\n // cp.post(husband[wife[m]] == m);\n for (int m = 0; m < n; m++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(husband, wife[m]), m));\n }\n\n // forall(w in Women)\n // cp.post(wife[husband[w]] == w);\n for (int w = 0; w < n; w++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(wife, husband[w]), w));\n }\n\n // forall(m in Men, o in Women)\n // cp.post(rankMen[m,o] < rankMen[m, wife[m]] =>\n // rankWomen[o,husband[o]] < rankWomen[o,m]);\n for (int m = 0; m < n; m++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankMen[m], wife[m]).var(), rankMen[m][o]);\n\n IntVar b2 = solver.makeIsLessCstVar(\n solver.makeElement(rankWomen[o], husband[o]).var(), rankWomen[o][m]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n // forall(w in Women, o in Men)\n // cp.post(rankWomen[w,o] < rankWomen[w,husband[w]] =>\n // rankMen[o,wife[o]] < rankMen[o,w]);\n for (int w = 0; w < n; w++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankWomen[w], husband[w]).var(), rankWomen[w][o]);\n IntVar b2 =\n solver.makeIsLessCstVar(solver.makeElement(rankMen[o], wife[o]).var(), rankMen[o][w]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n //\n // search\n //\n DecisionBuilder db = solver.makePhase(wife, solver.INT_VAR_DEFAULT, solver.INT_VALUE_DEFAULT);\n\n solver.newSearch(db);\n\n //\n // output\n //\n while (solver.nextSolution()) {\n System.out.print(\"wife : \");\n for (int i = 0; i < n; i++) {\n System.out.print(wife[i].value() + \" \");\n }\n System.out.print(\"\\nhusband: \");\n for (int i = 0; i < n; i++) {\n System.out.print(husband[i].value() + \" \");\n }\n System.out.println(\"\\n\");\n }\n\n solver.endSearch();\n\n // Statistics\n // System.out.println();\n System.out.println(\"Solutions: \" + solver.solutions());\n System.out.println(\"Failures: \" + solver.failures());\n System.out.println(\"Branches: \" + solver.branches());\n System.out.println(\"Wall time: \" + solver.wallTime() + \"ms\");\n }",
"public abstract double solve(int[][] matrix, double[] profitTable, int[] teamTable);",
"public abstract double[] solveDual(int[][] matrix, double[] profitTable, int[] teamTable);",
"public List<Configuration> solve(){\n int group = 0;\n for(List<Configuration> set : input){\n minimize(set);\n\n for(Configuration root : set) {\n root.setGroup(group);\n }\n group++;\n\n }\n\n // Step 2: Preprocess\n sortBySize(input);\n\n // Step 5: Initialize set of partial solutions\n List<Configuration> partialSolutions;\n if(input.size()==0){\n return null;\n }\n else {\n partialSolutions = input.get(0);\n input.remove(partialSolutions);\n }\n\n // Step 6: The compositional computations\n for(List<Configuration> set : input) {\n filter(partialSolutions, setCutoff);\n filter(set, setCutoff);\n partialSolutions = combine(partialSolutions, set, constraints);\n }\n\n // Step 7: Postprocessing\n //greedyPostProcessing(partialSolutions);\n\n return partialSolutions;\n }",
"public static int solution(int[] budgets, int M) {\n\t\tint lV = 0;\n\t\tint rV = 0;\n\t\tfor(int i = 0; i < budgets.length; i++) {\n//\t\t\tlV = Math.min(lV, budgets[i]); // 이게 있으면 위에 네번째 테케를 못품. \n\t\t\trV = Math.max(rV, budgets[i]);\n\t\t}\n\t\tint mid = rV/2;\n\t\tint ans = 0;\n\t\t\n\t\twhile(lV <= rV) {\n\t\t\tint tmp = 0;\n\t\t\tfor(int i = 0; i < budgets.length; i++) {\n\t\t\t\tif(budgets[i] > mid) tmp += mid;\n\t\t\t\telse tmp += budgets[i];\n\t\t\t}\n\t\t\n\t\t\tif(tmp > M) {\n\t\t\t\trV = mid - 1;\n\t\t\t} else {\n\t\t\t\tlV = mid + 1;\n\t\t\t\tans = Math.max(mid, ans);\n\t\t\t}\n\t\t\tmid = (lV+rV)/2;\n\t\t}\n\t\t\n\t\t\n\t\treturn ans;\n\t}",
"private static double findOneSetCost(int r, int [] set,\r\n Vector oneSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n ArrayList setNeighbors = new ArrayList();\r\n for ( int i = 0; i < set.length; i++)\r\n {\r\n int index = set[i] - 1;\r\n Host neighbor = (Host) neighbors.get(index);\r\n setNeighbors.add(neighbor);\r\n }\r\n double [][] setDistanceArray = findDistanceArray(currentNode, destList, setNeighbors);\r\n //the setDistanceArray[r][m]\r\n\r\n //check if any neighbor in set is not common neighbor for all dests\r\n //if a neighbor is so, return a MaxDistance, hopArray = NULL\r\n int m = destList.size();\r\n for ( int i = 0; i < m; i++)\r\n {\r\n int num = 0;\r\n for ( int j = 0; j < r; j++)\r\n {\r\n if (setDistanceArray[j][i] < 0)\r\n {\r\n num++;\r\n setDistanceArray[j][i] = MaxDistance;\r\n }\r\n }\r\n if ( num >= r )\r\n {\r\n // All the neighbors in set cannot forward to destination[i]\r\n oneSetVector.clear(); // ???\r\n return MaxDistance;\r\n }\r\n }\r\n\r\n //find forward nodes provides min remain distance\r\n double totalCost = 0.0;\r\n\r\n //go thourgh destList, find a best forward neighbor for each dest\r\n //add the distance to totalRemainDistance\r\n for (int i = 0; i < m; ++i) {//loop through destList\r\n double minCost = setDistanceArray[0][i];//get first neighbor for each dest\r\n oneSetVector.add(i, setNeighbors.get(0));\r\n for (int j = 0; j < r; ++j) {// Loop through the neighbor\r\n if (minCost > setDistanceArray[j][i]) {\r\n // Swap\r\n minCost = setDistanceArray[j][i];\r\n oneSetVector.set(i, setNeighbors.get(j));\r\n }\r\n }\r\n totalCost += minCost;\r\n }\r\n\r\n return totalCost;\r\n }",
"public void solveSingleSolution() {\n SPL M1 = this;\n\n int counter = 1;\n\n for(int i=0; i < this.NBrsEff; i++) {\n System.out.println(\"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1]);\n this.Solusi += \"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1];\n counter += 1;\n this.Solusi += \"\\n\";\n } \n }",
"@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }",
"private static double getMinSetCost_given_r( int r, Vector rSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n int n = neighbors.size();\r\n long cnr = getCnr(n, r);\r\n double minCostFor_r = MaxDistance;\r\n\r\n int[] set = new int[r]; /// ?????????????????????????\r\n set = initSet(r);\r\n\r\n //loop cnr set, find one set with minimum remaining distance\r\n for (long i = 0; i < cnr; ++i)\r\n {\r\n Vector oneSetVector = new Vector();\r\n double oneSetCost;\r\n oneSetCost = findOneSetCost(r, set,\r\n oneSetVector,\r\n currentNode,\r\n neighbors,\r\n destList);\r\n if ( oneSetCost < minCostFor_r ) {\r\n minCostFor_r = oneSetCost;\r\n rSetVector.clear();\r\n for (int k = 0; k < oneSetVector.size(); ++k) {\r\n rSetVector.add(k, oneSetVector.get(k));\r\n }\r\n }\r\n if (i < (cnr - 1)) {\r\n calculateNextSet(n,r,set);\r\n }\r\n }\r\n\r\n return minCostFor_r;\r\n\r\n }",
"public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }",
"public HardSoftScore calculateScore(MPSReadinessCheckSolution solution) {\n\t\tint hardScore = 0, softScore = 0;\n\t\tMap<ProductionPlant, Map<Date, List<FixedPlanEntry>>> fulfilled = solution.getFulfilledMPS();\n\t\tMap<PlanEntryIndex, MRPEntry> mrp = solution.getAccumulatedMRP();\n\t\tMap<ProductionPlant, Map<Date, Map<UUID, Integer>>> aggregatecDemands = aggregateDemands(fulfilled);\n\t\tfor (Map.Entry<ProductionPlant, Map<Date, Map<UUID, Integer>>> fulfilledByLocEntry: aggregatecDemands.entrySet()) {\n\t\t\tProductionPlant fulfilledLoc = fulfilledByLocEntry.getKey();\n\t\t\tMap<Date, Map<UUID, Integer>> fulfilledByLoc = fulfilledByLocEntry.getValue();\n\t\t\tfor (Map.Entry<Date, Map<UUID, Integer>> fulfilledByDateEntry: fulfilledByLoc.entrySet()) {\n\t\t\t\tDate fulfilledDate = fulfilledByDateEntry.getKey();\n\t\t\t\tMap<UUID, MRPEntry> mrpPlan = findMRPSupportByFulfilledDate(mrp, fulfilledLoc, fulfilledDate);\n\t\t\t\tif (mrpPlan == null) {\n\t\t\t\t\thardScore = -10;\n\t\t\t\t\t//System.out.println(\"no mrp plan, date=\" + fulfilledDate);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tMap<UUID, Integer> skuDemands = fulfilledByDateEntry.getValue();\n\t\t\t\tfor (Map.Entry<UUID, Integer> skuDemand: skuDemands.entrySet()) {\n\t\t\t\t\tSystem.out.println(\"skuDemand:\" + skuDemand);\n\t\t\t\t\tUUID skuNo = skuDemand.getKey();\n\t\t\t\t\tint mpsQty = skuDemand.getValue();\n\t\t\t\t\t//System.out.println(\"calculateScore Called, skuNo=\" + skuNo + \",mpsQty =\" + mpsQty);\n\t\t\t\t\tif (mpsQty == 0) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no demand, hardscore:\" + hardScore);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tMRPEntry mrpEntry = mrpPlan.get(skuNo);\n\t\t\t\t\tif (mrpEntry == null) {\n\t\t\t\t\t\thardScore=-10;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no mrp, hardscore:\" + hardScore + \",sku=\" + skuDemand.getKey());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (mrpEntry.getPlanQty() >= mpsQty) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp meet demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t} else { \n\t\t\t\t\t\thardScore = -1;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp less than demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hardScore < 0) break;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"end calculateScore Called, hardScore=\" + hardScore + \",solution=\" + solution);\n\t\t//System.out.println(\"\");\n\t\treturn HardSoftScore.valueOf(hardScore, softScore);\n\t}",
"public abstract int[] solve(double[][] costs);",
"public Solution solve(KnapsackData data);",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint T = s.nextInt(); //number of tests\n\t\t\n\t\tfor(int i = 0; i < T; i++) {\n\t\t\tint N = s.nextInt(); //number of students\n\t\t\tint P = s.nextInt(); //number of students to pick\n\t\t\t\n\t\t\t//Get all skill scores\n\t\t\tint[] skillOfAllStudents = new int[N];\n\t\t\tfor(int j = 0; j < N; j++) {\n\t\t\t\tskillOfAllStudents[j] = s.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//Sort\n\t\t\tArrays.sort(skillOfAllStudents);\n\t\t\t\n\t\t\t//Find min number of hours to get a fair team\n\t\t\t//Go from largest down to smallest. take however many needed from the right and calculate amount needed for fair team\n\t\t\tint numHours = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int l = N-1; l > P-2; l--) {\n\t\t\t\tint tempSkill = 0;\n\t\t\t\t\n\t\t\t\tint highest = skillOfAllStudents[l];\n\t\t\t\tfor(int k = l-1; k > l - P; k--) {\n\t\t\t\t\ttempSkill += (highest - skillOfAllStudents[k]);\n\t\t\t\t\t//System.out.println(\"intermediate #1: \" + tempSkill );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempSkill < numHours) {\n\t\t\t\t\tnumHours = tempSkill;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Print solution\n\t\t\tSystem.out.println(\"Case #\" + (i+1) + \": \" + numHours);\n\t\t}\n\t}",
"private Hashtable solve() {\n Hashtable<Integer, Double> solution = new Hashtable<>(); //maps variable (column) to its value\n double det = system.determinant();\n if (det == 0) {\n System.err.println(\"LinearSystem Solve Failed: determinant of matrix is 0\");\n return null;\n } else {\n for (int c = 0; c < system.N; c++) {\n double detC = colVectorIntoMatrix(c).determinant();\n solution.put(c, detC/det);\n }\n return solution;\n }\n }",
"public void solve() {\n /** To solve the traveling salesman problem:\n * Set up the graph, choose a starting node, then call the recursive backtracking method and pass it the starting node.\n */\n\n // We need to pass a starting node to recursive backtracking method\n Node startNode = null;\n\n // Grab a node, any node...\n for( Node n : graph.nodes() ) {\n startNode = n;\n break;\n }\n\n // Visit the first node\n startNode.visit();\n\n // Add first node to the route\n this.route[0] = startNode;\n\n // Pass the number of choices made\n int nchoices = 1;\n\n // Recursive backtracking\n explore(startNode, nchoices );\n\n\n }",
"int countSusbset(int n, int w){\n int dp[][] = new int[n+1][w+1];\n for(int i=0;i<=n;i++){\n for(int j=0;j<=w;j++){\n //when no items are there and target sum is 0, only one empty subset is possible\n if(i == 0 && j == 0){\n dp[i][j] = 1;\n }\n //no items left and target sum is greater than 0, no set is possible\n else if(i == 0 && j > 0){\n dp[i][j] = 0; \n }\n //if target sum is 0, no matter how many items we have , only one empty subset is possible\n else if(j == 0){\n dp[i][j] = 1;\n }\n //since item > target sum, so exclude\n else if(arr[i-1] > j){\n dp[i][j] = dp[i-1][j];\n }else{\n //two cases include and exclude\n dp[i][j] = dp[i-1][j] + dp[i-1][j - arr[i-1]];\n }\n }\n }\n return dp[n][w];\n}",
"public void readSet() throws IOException {\n temps = new HashSet<String>();\n readDescription();\n // adds the words in the temporary set to the temp array\n for (String w : temps) {\n if (w.equals(\"dana\")) {\n System.out.println(w + \" was called +1\");\n }\n int v = d.getValue(w);\n arr[v]++;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called +1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n temps = new HashSet<String>();\n readDescription();\n // does the same thing above, except since this is the second\n // description, subtract 1 from array\n for (String w : temps) {\n int v = d.getValue(w);\n arr[v]--;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called -1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n // get the prices\n int p1 = getPrice();\n int p2 = getPrice();\n // get the answer value\n // a should be the correct answer\n // b should be the answer they choose\n int a = getAnswer();\n int b = getAnswer();\n // System.out.println(\"The correct answer is: \" + a +\n // \" The chosen answer is: \" + b);\n int y_real;\n DecimalFormat numberFormat = new DecimalFormat(\"#.####\");\n double real_ratio;\n double mturk_ratio;\n if (p1 > p2) {\n y_real = p1 - p2;\n real_ratio = (double) p1 / p2;\n } else {\n y_real = p2 - p1;\n real_ratio = (double) p2 / p1;\n }\n int pdiff;\n if (a == b) {\n pdiff = y_real;\n mturk_ratio = real_ratio;\n } else {\n pdiff = -y_real;\n mturk_ratio = 1 / real_ratio;\n }\n if (p2 > p1) {\n for (int i = 0; i < arr.length; i++) {\n arr[i] = -arr[i];\n }\n }\n w.write(pdiff + \" \");\n w.write(numberFormat.format(real_ratio) + \" \");\n w.write(numberFormat.format(mturk_ratio) + \" \");\n for (int i = 0; i < size; i++) {\n if (i != arr.length - 1) {\n w.write(arr[i] + \" \");\n } else {\n w.write(arr[i]);\n }\n }\n w.write(\"\\n\");\n arr = new int[size];\n }",
"public Solution solve(ISearchable s) {\n return null;\n }",
"public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }",
"public static int dynamic_p(int objects,int capacity){\r\n // Array to accommodate dynamic programming solutions\r\n int dp_array[][] = new int[objects+1][capacity+1];\r\n // filling the 2D array\r\n for(int i=0; i<= objects;i++){\r\n for(int j=0; j<= capacity;j++){\r\n if(i == 0)\r\n dp_array[i][j]=0; // base case(number of objects are zero)\r\n else if(j == 0)\r\n dp_array[i][j]=0; // base case(capacity is zero)\r\n else if(randvariables[i-1] <= j){ // checking if the wight of object is less than the current knapsack capacity\r\n int included = randvalues[i-1]+dp_array[i-1][j-randvariables[i-1]]; // object is included\r\n int not_included = dp_array[i-1][j]; // object is not included\r\n\r\n //taking the max of these two\r\n if(included > not_included)\r\n dp_array[i][j] = included;\r\n else\r\n dp_array[i][j]= not_included;\r\n }\r\n else // weight is more than capacity .. not including the object\r\n dp_array[i][j] = dp_array[i-1][j];\r\n }\r\n }\r\n\r\n //System.out.println(Arrays.deepToString(dp_array));\r\n int solution = dp_array[objects][capacity];\r\n boolean[] optimalset = solution_used(dp_array,objects,capacity);\r\n System.out.println(Arrays.toString(optimalset));\r\n dp_array = null;\r\n return solution; // return the final solution\r\n\r\n }",
"protected abstract void solve(Items items,Knapsack knapsack);",
"public static void isSAT(Predicate pred, int[] vList){\n\t\t\n\t\tStack<Integer> assignedVariables = new Stack<Integer>();\n\t\tboolean satisfiability = false;\n\t\twhile(assignedCount<vList.length/2){\n\t\t\tif(pred.isContainsVariable(assignedCount+1, vList.length/2) == 0){\n\t\t\t\tvList[assignedCount] = 0;\n\t\t\t\tvList[assignedCount+vList.length/2] = 1;\n\t\t\t\tassignedCount++;\n\t\t\t} else {\n\t\t\t\tfailedPoint = assignedCount+1;\n\t\t\t\tsatisfiability = assignVariableAndEvaluatePred(pred, vList, assignedVariables);\n\t\t\t\t\n\t\t\t\tif(!satisfiability){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(satisfiability){\n\t\t\t\n\t\t\tsats.add(vList);\n\t\t\t\n\t\t\tgetAllSat(pred, vList);\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Assigned Values for Variables:\");\n\t\t\tfor(int[] arr: sats){\n\t\t\t\tfor(int i=0; i<vList.length/2; i++){\n\t\t\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" )\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" ) ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"No Possible Variable Values for Satisfiability\");\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Variable: \" + failedPoint);\n\t\t\t\n\t\t\tSystem.out.println(\"Backtracked Node Count: \" + backTrackedCount);\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \") ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void testSudoku() {\n \t\tfinal Sudoku model = new Sudoku(3);\n \t\tfinal Solution sol = solve(model.rules(), model.puzzle1());\n //\t\tSATISFIABLE\n //\t\tp cnf 1544 6974\n //\t\tprimary variables: 702\n \t\tassertEquals(Solution.Outcome.SATISFIABLE, sol.outcome());\n \t\tassertEquals(702, sol.stats().primaryVariables());\n \t\tassertEquals(1544, sol.stats().variables());\n \t\tassertEquals(6974, sol.stats().clauses());\n \t}",
"static int nonDivisibleSubset(int k, int[] S) {\n\t\tint result = 0;\n\n\t\tArrayList < ArrayList < Integer >> solutions = new ArrayList < ArrayList < Integer >>();\n\t\tArrayList < HashSet < Integer >> minSets = new ArrayList < HashSet < Integer >>();\n\n\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( S [ 0 ])));\n\t\tminSets.add (new HashSet <Integer > ( ));\n\t\tminSets.get(0).add ( S [ 0 ] % k);\n\n\n\t\t// Go over all the numbers\n\t\tfor ( int i = 1; i < S.length; i++ ){\n\t\t\tint n = S [ i ]; \n\t\t\tint m = S [ i ] % k; // Number we will add to all the elements of all the minSets.\n\n\t\t\t// Go over all the minSets.\n\t\t\t// For each one, check that each element plus m is not divisible by k.\n\n\t\t\tboolean workedForASet = false;\n\t\t\tfor ( int j = 0; j < minSets.size(); j++){\n\t\t\t\t// For each set, check all the elements of the set.\n\n\t\t\t\tHashSet < Integer > minSet = minSets.get(j);\n\t\t\t\tIterator < Integer > iter = minSet.iterator();\n\n\t\t\t\tboolean works = true;\n\t\t\t\twhile ( iter.hasNext() && works ){\n\t\t\t\t\tint num = iter.next();\n\t\t\t\t\tif ( (num + m) % k == 0 ){\n\t\t\t\t\t\tworks = false;\n\t\t\t\t\t\tworkedForASet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( works ){\n\t\t\t\t\tsolutions.get(j).add(n);\n\t\t\t\t\tminSet.add(m);\n\t\t\t\t}\n\t\t\t} \n\n\t\t\tif ( !workedForASet ){\n\t\t\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( n )));\n\t\t\t\tminSets.add (new HashSet <Integer > ( ));\n\t\t\t\tminSets.get (minSets.size() - 1).add ( m ); \n\t\t\t} \n\t\t}\n\n\t\t// Find the solution with the most elements.\n\n\t\tfor ( ArrayList <Integer > solution : solutions ){\n\t\t\tresult = Math.max ( result, solution.size() );\n\t\t\tSystem.out.println ( solution );\n\t\t}\n\n\t\tif ( result == 1 ) result = 0;\n\t\treturn result;\n\t}",
"public static void printTargetSumSubsetsRF(int[] arr, int idx, String set, int sos, int tar) {\n\n /*\n * if (sos > tar) { return; }\n * \n * if (sos == tar) { if(idx < arr.length){ if(arr[idx] == 0){\n * System.out.println(set + 0 + \", .\"); System.out.println(set + \".\"); return; }\n * printTargetSumSubsetsRF(arr, idx + 1, set, sos, tar); return;\n * \n * } else { System.out.println(set + \".\"); return; }\n * \n * }\n * \n * \n * for (int i = idx; idx < arr.length; idx++) { printTargetSumSubsetsRF(arr, idx\n * + 1, set + arr[idx] + \", \", sos + arr[idx], tar); }\n */\n if (sos > tar) {\n return;\n }\n if (idx == arr.length) {\n if (sos == tar) {\n System.out.println(set + \".\");\n }\n return;\n }\n\n printTargetSumSubsetsRF(arr, idx + 1, set + arr[idx] + \", \", sos + arr[idx], tar);\n printTargetSumSubsetsRF(arr, idx + 1, set, sos, tar);\n }",
"public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }",
"public TTPSolution SH2() {\n \n // get TTP data\n long[][] D = ttp.getDist();\n int[] A = ttp.getAvailability();\n double maxSpeed = ttp.getMaxSpeed();\n double minSpeed = ttp.getMinSpeed();\n long capacity = ttp.getCapacity();\n double C = (maxSpeed - minSpeed) / capacity;\n double R = ttp.getRent();\n int m = ttp.getNbCities(),\n n = ttp.getNbItems();\n TTPSolution s = new TTPSolution(m, n);\n int[] x = s.getTour(),\n z = s.getPickingPlan();\n \n /*\n * the tour\n * generated using greedy algorithm\n */\n x = linkernTour();\n z = zerosPickingPlan();\n Deb.echo(x);\n Deb.echo(z);\n \n /*\n * the picking plan\n * generated so that the TTP objective value is maximized\n */\n ttp.objective(s);\n \n // partial distance from city x_i\n long di;\n \n // partial time with item k collected from city x_i\n double tik;\n \n // item scores\n Double[] score = new Double[n];\n \n // total time with no items collected\n double t_ = s.ft;\n \n // total time with only item k collected\n double tik_;\n \n // fitness value\n double u[] = new double[n];\n \n for (int k=0; k<n; k++) {\n \n int i;\n for (i=0; i<m; i++) {\n if (A[k]==x[i]) break;\n }\n //P.echo2(\"[\"+k+\"]\"+(i+1)+\"~\");\n \n // time to start with\n tik = i==0 ? .0 : s.timeAcc[i-1];\n int iw = ttp.weightOf(k),\n ip = ttp.profitOf(k);\n \n // recalculate velocities from start\n di = 0;\n for (int r=i; r<m; r++) {\n \n int c1 = x[r]-1;\n int c2 = x[(r+1)%m]-1;\n \n di += D[c1][c2];\n tik += D[c1][c2] / (maxSpeed-iw*C);\n }\n \n score[k] = ip - R*tik;\n tik_ = t_ - di + tik;\n u[k] = R*t_ + ttp.profitOf(k) - R*tik_;\n //P.echo(k+\" : \"+u[k]);\n }\n \n Quicksort<Double> qs = new Quicksort<Double>(score);\n qs.sort();\n int[] si = qs.getIndices();\n int wc = 0;\n for (int k=0; k<n; k++) {\n int i = si[k];\n int wi = ttp.weightOf(i);\n // eliminate useless\n if (wi+wc <= capacity && u[i] > 0) {\n z[i] = A[i];\n wc += wi;\n }\n }\n \n ttp.objective(s);\n \n return s;\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }",
"public static void bestApproach(int matrix[][]){\n\t\t\n\t\tint m = matrix.length;\n\t\tint n = matrix[0].length;\n\t\t\n\t\t//Taking two variables for storing status of first row and column\n\t\tboolean firstRow = false;\n\t\tboolean firstColumn = false;\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\tif(matrix[i][j] == 0){\n\t\t\t\t\tif(i == 0) firstRow == true;\n\t\t\t\t\tif(j == 0) firstColumn == true;\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][0] = 0;\n\t\t\t\t\tmatrix[0][j] = 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 1;i<m;i++){\n\t\t\t\n\t\t\tfor(int j = 1;j<n;j++){\n\t\t\t\t//based on first row and first column making the entire column and row as zero\n\t\t\t\tif(matrix[0][j] == 0 || matrix[i][0] == 0){\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Making every column value to 0 in first row\n\t\tif(firstRow){\n\t\t\t\n\t\t\tfor(int j = 0;j <n;j++){\n\t\t\t\tmatrix[0][j] = 0;\n\t\t\t}\n\t\t}\n\t\t//Making every row value to 0 in first column\n\t\tif(firstColumn){\n\t\t\t\n\t\t\tfor(int i = 0;i <m;i++){\n\t\t\t\tmatrix[i][0] = 0;\n\t\t\t}\n\t\t}\n\t}",
"private void run() throws Exception {\n int t = sc.nextInt();\n sc.nextLine();\n\n for (int i = 1; i <= t; i++) {\n out.print(\"Case #\" + i + \": \");\n String line = sc.nextLine();\n\n StringTokenizer st = new StringTokenizer(line, \" \");\n String Sstr = st.nextToken();\n\n int K = Integer.parseInt(st.nextToken());\n\n BitSet S = new BitSet(Sstr.length());\n for(int j=0; j<Sstr.length(); ++j){\n if(Sstr.charAt(j) == '+')\n S.set(j);\n else\n S.clear(j);\n }\n\n solveBig(S, K, Sstr.length());\n }\n sc.close();\n out.close();\n }",
"public void solveUsingLeastCostMethod() {\n\n this.solution = new Solution();\n\n Source[] proxySources = Arrays.copyOf(sources, sources.length);\n Destination[] proxyDestinations = Arrays.copyOf(destinations, destinations.length);\n int[][] matrix = new int[costs.length][costs[0].length];\n\n List<Integer> rows = new ArrayList<Integer>();\n List<Integer> columns = new ArrayList<Integer>();\n while ( rows.size() != proxySources.length && columns.size() != proxyDestinations.length ) {\n //getting minimum cell (if there is a tie, we choose where is the maximum quantity)\n int indexI,indexJ, value;\n indexI = 0;\n indexJ = 0;\n value = 0;\n boolean firstElement = true;\n for(int i=0;i<proxySources.length;i++) {\n if( !rows.contains(i) ) {\n for(int j=0;j<proxyDestinations.length;j++) {\n if( !columns.contains(j) ) {\n if ( firstElement ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n firstElement = false;\n }\n if( costs[i][j] < value ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n else if( costs[i][j] == value ) {\n if( Math.min(proxySources[i].getSupply(),proxyDestinations[j].getDemand()) > Math.min(proxySources[indexI].getSupply(),proxyDestinations[indexJ].getDemand()) ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n }\n }\n }\n }\n }\n int supply = proxySources[indexI].getSupply();\n int demand = proxyDestinations[indexJ].getDemand();\n\n\n this.solution.add(sources[indexI], destinations[indexJ], Math.min(supply,demand), costs[indexI][indexJ]);\n\n if ( supply < demand ) {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(demand - supply);\n rows.add(indexI);\n }\n else if( supply > demand ) {\n proxySources[indexI].setSupply(supply-demand);\n proxyDestinations[indexJ].setDemand(0);\n columns.add(indexJ);\n }\n else {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(0);\n rows.add(indexI);\n columns.add(indexJ);\n }\n }\n this.solution.showSolution();\n\n\n }",
"public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static void main(String[] args) {\n int input = 0;\n int armLength;\n int solution = 0;\n\n // get the puzzle input\n System.out.print(\"Please provide the puzzle input: \");\n input = new Scanner(System.in).nextInt();\n\n /// PART 1\n // figure out which spiral input is on to calculate distance on one axis\n armLength = SpiralUtils.lengthOfSprialArm(input);\n solution = (armLength - 1) / 2;\n\n // find the midpoints of the spiral the input is on\n List<Integer> midpoints = SpiralUtils.midpointsOfSprialArm(armLength);\n\n // calculate the smallest distance from any midpoint to our input for other access\n solution += SpiralUtils.smallestDistanceFromMidpoints(input, midpoints);\n\n System.out.println(\"The solution to part 1 is: \" + solution);\n\n /// PART 2\n // this part is less elegant, as I'm just going to create the spiral instead of run calculations\n System.out.println(\"The solution to part 2 is: \" + SpiralUtils.spiralUntilAtLeast(input));\n }",
"@Override\n\tpublic void solve() {\n\t\tlong startTime = System.nanoTime();\n\n\t\twhile(!unvisitedPM.isEmpty()){\n\t\t\tProblemModel current = findCheapestNode();\n\t\n\t\t\tfor(ProblemModel pm : current.getSubNodes()){\n\t\t\n\t\t\t\tif(!visited.contains(pm) && !unvisitedPM.contains(pm)){\n\t\t\t\t\t\n\t\t\t\t\tunvisitedPM.add(pm);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(current.getSideStart().isEmpty()){\n\t\t\t\tSystem.out.print( \"\\n\"+ \"StartSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideStart()){\n\t\t\t\t\tSystem.out.print( \" \" +r) ;\n\t\t\t\t}\n\t\t\t\tSystem.out.print( \"\\n\" + \"EndSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideEnd()){\n\t\t\t\t\tSystem.out.print( \" \" + r);\n\t\t\t\t}\n\n\t\t\t\tprintPathTaken(current);\n\t\t\t\tSystem.out.print( \"\\n\" + \"------------done--------------\");\n\t\t\t\tlong endTime = System.nanoTime();\n\t\t\t\tlong duration = ((endTime - startTime)/1000000);\n\t\t\t\tSystem.out.print( \"\\n\" + \"-AS1 Time taken: \" + duration + \"ms\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvisited.add(current);\n\t\t\n\t\t}\n\t\t\n\n\t}",
"public abstract OptimisationSolution getBestSolution();",
"@Test\n public void testTrain_RegressionDataSet() {\n System.out.println(\"train\");\n RegressionDataSet trainSet = FixedProblems.getSimpleRegression1(150, new Random(2));\n RegressionDataSet testSet = FixedProblems.getSimpleRegression1(50, new Random(3));\n\n for (boolean modification1 : new boolean[] { true, false })\n for (SupportVectorLearner.CacheMode cacheMode : SupportVectorLearner.CacheMode.values()) {\n PlattSMO smo = new PlattSMO(new RBFKernel(0.5));\n smo.setCacheMode(cacheMode);\n smo.setC(1);\n smo.setEpsilon(0.1);\n smo.setModificationOne(modification1);\n smo.train(trainSet);\n\n double errors = 0;\n for (int i = 0; i < testSet.size(); i++)\n errors += Math.pow(testSet.getTargetValue(i) - smo.regress(testSet.getDataPoint(i)), 2);\n assertTrue(errors / testSet.size() < 1);\n }\n }",
"public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }",
"public Set<Set<Integer>> calculate(Set<Integer> originalSet)\n\t{\n\t\tvalidateInputSet(originalSet);\n\n\t\tSet<Set<Integer>> sets = new HashSet<Set<Integer>>();\n\t\t//Base class returns the empty set.\n\t\tif (originalSet.isEmpty())\n\t\t{\n\t\t\tsets.add(new HashSet<Integer>());\n\t\t\treturn sets;\n\t\t}\n\t\t//Take the first element in head.\n\t\tList<Integer> list = new ArrayList<Integer>(originalSet);\n\t\tInteger head = list.get(0);\n\t\t//Generate a hash set without the first element\n\t\tSet<Integer> rest = new HashSet<Integer>(list.subList(1, list.size()));\n\t\t//Recursive call to iterate over every combination generated with the rest list.\n\t\tfor (Set<Integer> set : calculate(rest))\n\t\t{\n\t\t\t//Add every element and the head, the old set and the new set.\n\t\t\tSet<Integer> newSet = new HashSet<Integer>();\n\t\t\tnewSet.add(head);\n\t\t\tnewSet.addAll(set);\n\t\t\tsets.add(newSet);\n\t\t\tsets.add(set);\n\t\t}\n\t\treturn sets;\n\t}",
"public static int dynamicProgrammingMin(List<List<Integer>> R) {\r\n\t\tif(R.isEmpty()) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t// declare\r\n\t\tList<Integer> result = new ArrayList<Integer>();\r\n\t\tList<Integer> sequence = new ArrayList<Integer>();\r\n\t\tint n = R.size();\r\n\t\t\r\n\t\t// initialize (BC)\r\n\t\tif(n >= 1) {\r\n\t\t\tresult.add(0);\r\n\t\t\tsequence.add(0);\r\n\t\t}\r\n\t\tif(n >= 2) {\r\n\t\t\tresult.add(R.get(0).get(1));\r\n\t\t\tsequence.add(1);\r\n\t\t}\r\n\t\t\r\n\t\t// iterate (RC)\r\n\t\tfor(int row = 3; row <= n; row++) {\r\n\t\t\tint curr = R.get(row - 2).get(row - 1);\r\n\t\t\tint prevSolutionPlusCurr = result.get(row - 2) + curr;\r\n\t\t\t\r\n\t\t\tint lastColMin = INFINITY;\r\n\t\t\tint selected = INFINITY;\r\n\t\t\tfor(int k = 0; k < row - 2; k++) {\r\n\t\t\t\tint thisColValue = result.get(k) + R.get(k).get(row - 1);\r\n\t\t\t\tlastColMin = min(thisColValue, lastColMin);\r\n\t\t\t\t\r\n\t\t\t\tif(lastColMin == thisColValue) {\r\n\t\t\t\t\tselected = k;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint min = min(prevSolutionPlusCurr, lastColMin);\r\n\t\t\tresult.add(min);\r\n\t\t\t\r\n\t\t\tif(result.get(row - 1) == prevSolutionPlusCurr) {\r\n\t\t\t\tsequence.add(row - 2);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsequence.add(selected);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(dynamicProgrammingRecover(sequence));\r\n\t\treturn result.get(n - 1);\r\n\t}",
"private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.print(\"Unesite velicinu n x n matrice: \");\r\n\t\tint n = input.nextInt(); // unos n x n matrice n = broj redova i kolona matrice\r\n\r\n\t\tint[][] matrix = new int[n][n];\r\n\t\tArrayList<Integer> maxR = new ArrayList<>();\r\n\t\tArrayList<Integer> maxK = new ArrayList<>();\r\n\r\n\t\tSystem.out.println(\"Matrica: \");\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\t\tmatrix[i][j] = (int)(Math.random()*2); // punjenje matrice integerima 0 i 1\r\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \"); // ispis matrice u konzolu\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\tint sumaR = 0, sumaK = 0, totalSumaR, totalSumaK, nula = 0;\r\n\t\t\r\n\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\tsumaR += matrix[0][j]; // suma reda matrice\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tsumaK += matrix[i][0]; // suma kolona matrice\r\n\t\t}\r\n\t\tfor(int i=0; i<matrix.length; i++) { // za sve elemente matrice\r\n\t\t\ttotalSumaR = 0;\r\n\t\t\ttotalSumaK = 0;\r\n\t\t\tfor(int j=0; j<matrix[i].length; j++) {\r\n\t\t\t\ttotalSumaR += matrix[i][j]; // suma svih redova matrice\r\n\t\t\t\ttotalSumaK += matrix[j][i]; // suma svih kolona matrice\r\n\t\t\t\tif(totalSumaR > sumaR) { // ako bilo koji red matrice ima vecu sumu od sume prvog reda matrice\r\n\t\t\t\t\tsumaR = totalSumaR; // taj red postaje red sa najvecom sumom\r\n\t\t\t\t\tmaxR.clear(); // brisu se stare pozicije redova sa najvecom sumom\r\n\t\t\t\t\tmaxR.add(i); // ubacivanje broja indexa reda sa najvecom sumom u listu\t\r\n\t\t\t\t} else if(totalSumaR == sumaR) { // ako je ukupna suma zadnjeg reda jednak najvecoj sumi reda\r\n\t\t\t\t\t//maxR.clear(); brisu se ostale pozicije redova sa najvecom sumom u listi (ako trazimo samo zadnji red sa najvise 1)\r\n\t\t\t\t\tmaxR.add(i); // dodaje se krajnja pozicija najvece sume reda u listi\r\n\t\t\t\t}\r\n\t\t\t\tif(totalSumaK > sumaK) { // ako bilo koja kolona matrice ima vecu sumu od sume prve kolone matrice\r\n\t\t\t\t\tsumaK = totalSumaK; // ta kolona postaje kolona sa najvecom sumom\r\n\t\t\t\t\tmaxK.clear(); // brisu se stare pozicije kolone sa najvecom sumom\r\n\t\t\t\t\tmaxK.add(i); // ubacivanje broja indexa kolone sa najvecom sumom u listu\r\n\t\t\t\t} else if(totalSumaK == sumaK) { // ako je ukupna suma zadnje kolone jednaka najvecoj sumi kolone\r\n\t\t\t\t\t//maxK.clear(); brisu se ostale pozicije kolona sa najvecom sumom u listi (ako trazimo samo zadnju kolonu sa najvise 1)\r\n\t\t\t\t\tmaxK.add(i); // dodaje se krajnja pozicija najvece sume kolone u listi\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(maxR.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxR.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"Redovi sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxR.size(); i++) {\r\n\t\t\tSystem.out.print(maxR.get(i) + \" \"); // ispis pozicija najvece sume redova iz liste\r\n\t\t}\r\n\t\tif(maxK.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxK.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"\\nKolone sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxK.size(); i++) {\r\n\t\t\tSystem.out.print(maxK.get(i) + \" \"); // ispis pozicija najvece sume kolona iz liste\r\n\t\t}\r\n\t\t\r\n\t\tinput.close();\r\n\t}",
"public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n n = in.nextInt();\n m = in.nextLong();\n initFactorSets();\n long total = 0;\n\n boolean add = true;\n for (ArrayList<Integer> factorSet : factorSets) {\n for (int factor : factorSet) {\n if (add) {\n total += m / factor;\n } else {\n total -= m / factor;\n }\n }\n add = !add;\n }\n System.out.println(total);\n }",
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int t = Integer.parseInt(s.nextLine());\n for(int i=1;i<=t;i++){\n int n = Integer.parseInt(s.nextLine());\n Set<String> a = new HashSet<>();\n\n for(int j=0;j<n;j++) {\n String str = s.nextLine();\n if(str.equals(\"easy-medium\"))\n str=\"medium\";\n else if(str.equals(\"medium-hard\"))\n str=\"hard\";\n a.add(str);\n }\n System.out.println(a.size()<5?\"No\":\"Yes\");\n /*int a1=0,a2=0,a3=0,a4=0,a5=0;\n for(int k=0;k<n;k++){\n if(a.contains(\"cakewalk\"))\n a1++;\n if(a.contains(\"simple\"))\n a2++;\n if(a[k].equals(\"easy\"))\n a3++;\n if(a[k].equals(\"easy-medium\") || a[k].equals(\"medium\"))\n a4++;\n if(a[k].equals(\"medium-hard\") || a[k].equals(\"hard\"))\n a5++;\n }\n if(a1==1&&a2==1&&a3==1&&a4==1&&a5==1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n*/\n }\n }",
"private ASSPSolution floydWarshall(Double[][] aMatrix, Integer[][] pMatrix)\n {\n Double best[][][] = new Double[2][this.numIntxns][this.numIntxns];\n Integer pred[][][] = new Integer[2][this.numIntxns][this.numIntxns];\n\n best[0] = aMatrix;\n best[1] = aMatrix;\n\n pred[0] = pMatrix;\n pred[1] = pMatrix;\n\n int solnIndex = 0;\n\n for (int k = 0; k < this.numIntxns; k++)\n {\n for (int u = 0; u < this.numIntxns; u++)\n {\n for (int v = 0; v < this.numIntxns; v++)\n {\n // we only need to keep two matrices in memory and swap\n // between them. i and j alternate.\n int i = k % 2;\n int j = (i == 0) ? 1 : 0;\n\n best[i][u][v] = best[j][u][v];\n\n // note that null represents infinity\n if (best[i][u][k] != null && best[i][k][v] != null)\n {\n // if this spot is infinite, anything is better\n if (best[i][u][v] == null)\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n else if \n ((best[j][u][k] + best[j][k][v]) < best[i][u][v])\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n\n // Stores the last i value so that the correct answers \n // can be sent back to the user.\n if (v == this.numIntxns - 1)\n {\n solnIndex = i;\n }\n }\n }\n }\n }\n\n return new ASSPSolution(best[solnIndex], pred[solnIndex]);\n }",
"public void doRegressionAnalysis()\r\n {\n n = Y.getRowDimension();\r\n p = X.getColumnDimension(); \r\n k = p - 1; // k is number of explanatory variables\r\n Resids = new Matrix(n, 1);\r\n StandResids = new Matrix(n, 1);\r\n StudResids = new Matrix(n, 1);\r\n Cooks_D = new Matrix(n, 1);\r\n R_Student = new Matrix(n, 1);\r\n\r\n // MVP, p73\r\n X_Prime = X.transpose();\r\n X_Prime_X = X_Prime.times(X);\r\n X_Prime_X_Inv = X_Prime_X.inverse(); \r\n HatMatrix = X.times(X_Prime_X_Inv.times(X_Prime)); \r\n BetaHats = X_Prime_X_Inv.times(X_Prime.times(Y)); \r\n YHats = HatMatrix.times(Y);\r\n BXY = (BetaHats.transpose()).times(X_Prime.times(Y));\r\n Y_Prime_Y = (Y.transpose()).times(Y); \r\n ssRegression = BXY.get(0,0) - sumY_Squared_Over_n;\r\n SSRes = Y_Prime_Y.minus(BXY);\r\n ssResiduals = SSRes.get(0,0);\r\n ssTotal = Y_Prime_Y.get(0,0) - sumY_Squared_Over_n;\r\n \r\n r2 = ssRegression / ssTotal;\r\n s = Math.sqrt(ssResiduals / (n - k - 1));\r\n adj_r2 = 1.0 - (ssResiduals / (n - k - 1)) / (ssTotal / (n - 1));\r\n \r\n dfReg = k;\r\n dfResid = n - k - 1;\r\n dfTotal = n - 1;\r\n msReg = ssRegression / (double)k;\r\n msResid = ssResiduals / (double)(n - k - 1);\r\n fStatistic = msReg / msResid;\r\n fDist = new FDistribution(k, n - k - 1);\r\n pValue_F = fDist.getRightTailArea(fStatistic);\r\n Resids = Y.minus(YHats);\r\n\r\n tempDouble_01 = 1.0 / Math.sqrt(msResid);\r\n\r\n StandResids = Resids.times(tempDouble_01); \r\n for (int jj = 0; jj < n; jj++)\r\n { \r\n tempDouble_02 = HatMatrix.get(jj, jj);\r\n StudResids.set(jj, 0, Resids.get(jj, 0) * tempDouble_01 / Math.sqrt(1.0 - tempDouble_02));\r\n tempDouble_03 = StudResids.get(jj, 0) * StudResids.get(jj, 0) / (double)p;\r\n tempDouble_04 = tempDouble_02 / (1.0 - tempDouble_02);\r\n Cooks_D.set(jj, 0, tempDouble_03 * tempDouble_04);\r\n \r\n // Student-R calculations from 4.12, 4.13, p135\r\n jjResid = Resids.get(jj, 0);\r\n double e_i_sq = jjResid * jjResid; \r\n double oneMinus_hii = 1.0 - HatMatrix.get(jj, jj);\r\n double s_i_sq = ((n - p)*msResid - e_i_sq/oneMinus_hii) / (n - p - 1);\r\n R_Student.set(jj, 0, jjResid / Math.sqrt(s_i_sq * oneMinus_hii)); \r\n }\r\n\r\n StErrCoef = new Matrix(k + 1, 1); // Explanatory variables + intercept \r\n TStat = new Matrix(k + 1, 1); \r\n PValue_T = new Matrix(k + 1, 1); \r\n tDist = new TDistribution (n - k - 1);\r\n\r\n for (int preds = 0; preds <= k; preds++)\r\n {\r\n StErrCoef.set(preds, 0, Math.sqrt(msResid * X_Prime_X_Inv.get(preds, preds)));\r\n TStat.set(preds, 0, BetaHats.get(preds, 0) / StErrCoef.get(preds, 0));\r\n PValue_T.set(preds, 0, 2.0 * tDist.getRightTailArea(Math.abs(TStat.get(preds, 0))));\r\n }\r\n }",
"public int minCostClimbingStairs(int[] cost) {\n // We initialize an array of size = cost, and it means the minimun cost of reaching n^th stair\n int[] dp = new int[cost.length];\n // We assign values to the first 2 numbers in the array because it can´t be smaller than 3\n dp[0] = cost[0];\n dp[1] = cost[1];\n // We iterate from n=2 to n-1, and in each position we save the min\n // value to reach the stair, the MIN is (dp[i-1] + cost[i] , dp[i-2] + cost[i]\n // that is so that the min way of reaching that stair is either using the n-1 or n-2\n for (int i = 2; i < cost.length; i++) {\n dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);\n }\n\n // We return the min value of the last 2 stairs because both can reach the end\n return Math.min(dp[cost.length - 1], dp[cost.length - 2]);\n\n\t\t /*\n\t\t\t cost[1,100,1,1,1,100,1,1,100,1]\n\t\t 1.- Imagine this is the array\n\t\t\t dp[]\n\t\t 2.- We add the first two values\n\t\t\t dp[1,100]\n\t\t 3.- Iterate form 2 to n\n\t\t\t This is a representation of the first one\n\t\t dp[2] = Math.min(1+1, 100+1)\n\t\t dp[2] = Math.min(2,101)\n\t\t dp[2] = 2\n\t\t dp[1,100,2]\n\t\t\t After the for, this is how it should look\n\t\t dp[1,100,2,3,3,103,4,5,105,6]\n\t\t 4.- Select the min between last 2 because both can reach last step\n\t\t\treturn min (105,6)\n\t\t\treturn 6\n\n\t\t\tIt should have a space complexity of O(n) becuase we´re using an array of n size\n\t\t\tThe time complexity should also be O(n) because we have to iterate through all the array once\n\n\t\t */\n }",
"public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public void maximize()\n\t{\n\t\tint i,j,max=cost[0][0];\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tif(cost[i][j]>max)\n\t\t\t\t{\n\t\t\t\t\tmax=cost[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(i=0;i<n;i++)\n\t\t{\n\t\t\tfor(j=0;j<n;j++)\n\t\t\t{\t\t\n\t\t\t\tcost[i][j]=max-cost[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public void SOM() {\n // Pick an input vector randomly.\n // A input vector can't be picked twice in a row.\n ArrayList<Double> oldVector = new ArrayList<>();\n ArrayList<Double> vector;\n\n for (int t = 0; t < this.nbIterations; t++) {\n\n // Choose another entry vector than the previous one.\n do {\n int randomInput = (int) (Math.random() * this.input.size());\n vector = this.input.get(randomInput);\n } while (oldVector.equals(vector));\n\n // The old vector is replaced by the new one.\n oldVector = new ArrayList<>(vector);\n\n // Calculation of BMU (Best Matching Unit).\n Neuron BMU = this.getBMU(vector);\n\n // Update the BMU's neighbors.\n this.updateNeighbors(BMU, vector, t);\n\n // Update the screen.\n this.screen.repaint();\n // Sleep for the animation.\n try {\n Thread.sleep(10);\n }\n catch (InterruptedException e) {\n System.out.println(\"Erreur sleep : \" + e);\n }\n }\n }",
"public void getSolution(TaskState state){\n\n if(state.isNew) {\n state.isNew = false;\n state.hasSolution = true;\n }\n else {\n if(!(state.hasSolution = rollBack(state)))\n return;\n }\n\n while (state.moveStack.size() < 64 ||\n !state.moveStack.peek().getStandElement().hasNeighbour(state.graph.getFirst())){\n\n if(state.moveStack.size() == 64 && !rollBack(state)) {\n state.hasSolution = false;\n return;\n }\n\n if(state.moveStack.peek().hasNextMove())\n state.moveStack.push(\n new HorseMove(state.moveStack.peek().getNextMove())\n );\n\n else if(!rollBack(state)){\n state.hasSolution = false;\n return;\n }\n\n }\n\n }",
"public static void main(final String[] args) {\n // instantiate this set\n Set s = new Set();\n // code to read the test cases input file\n Scanner stdin = new Scanner(new BufferedInputStream(System.in));\n // check if there is one more line to process\n while (stdin.hasNext()) {\n // read the line\n String line = stdin.nextLine();\n // split the line using space\n String[] tokens = line.split(\" \");\n // based on the list operation invoke the corresponding method\n switch (tokens[0]) {\n case \"size\":\n System.out.println(s.size());\n break;\n case \"contains\":\n System.out.println(s.contains(Integer.parseInt(tokens[1])));\n break;\n case \"print\":\n System.out.println(s);\n break;\n case \"add\":\n int[] intArray = intArray(tokens[1]);\n if (intArray.length == 1) {\n s.add(intArray[0]);\n } else {\n s.add(intArray);\n }\n break;\n case \"intersection\":\n s = new Set();\n Set t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(s.intersection(t));\n break;\n case \"retainAll\":\n s = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n System.out.println(s.retainAll(intArray));\n break;\n case \"cartesianProduct\":\n s = new Set();\n t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(Arrays.deepToString(s.cartesianProduct(t)));\n break;\n default:\n break;\n }\n }\n }",
"public static void knapsackDynamicProgramming(objects[] items, int capacity, int n) \r\n { \r\n\t\t//use bubble sort to sort item by their weight\t\t\t\t\r\n\t\tfor (int i = 0; i < n-1; i++) \t\t\t\t\r\n\t\t{ \t\t \r\n\t\t\tfor (int j = 0; j < (n-i-1); j++) \t\t \r\n\t\t\t{\t\t \r\n\t\t\t\tif (items[j].weight < items[j+1].weight) \t\t \r\n\t\t\t\t{ \t\t \t\r\n\t\t\t\t\tobjects temp = items[j]; \t\t \r\n\t\t\t\t\titems[j] = items[j+1]; \t\t \r\n\t\t\t\t\titems[j+1] = temp; \t\t \t\t\t\t\t\r\n\t\t\t\t}\t\t \r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\t\r\n \tif(n <= 0 || capacity <= 0)\r\n \t{\r\n \t\tSystem.out.print(\"Error capacity and object numbers can't be 0\");\r\n \t}\r\n \r\n \tint matrixTable[][] = new int[n+1][capacity+1]; \r\n \r\n \tfor (int i = 0; i <= n; i++) \r\n \t{ \r\n \t\tfor (int j = 0; j <= capacity; j++) \r\n \t\t{ \r\n \t\t\t//Preset row 0 value and column value to 0\r\n \t\t\tif (i==0 || j==0) \r\n \t {\r\n \t\t\t\tmatrixTable[i][j] = 0; \r\n \t }\r\n \r\n \t\t\t//If current row number is greater than current weight number\r\n \t\t\telse if (items[i-1].weight <= j) \r\n \t\t\t{\r\n \t\t\t\t//Compare the top value with top value plus value(use weight as the value to go left)result\r\n \t\t\t\t//and use the greatest value for the current one.\r\n \t\t\t\tmatrixTable[i][j] = Math.max(items[i-1].profit + matrixTable[i-1][j-items[i-1].weight], matrixTable[i-1][j]); \r\n \t\t\t}\r\n \t\t\t//If row number is less than current weight number just use the top value\r\n \t\t\telse \r\n \t\t\t{ \t \r\n \t\t\t\tmatrixTable[i][j] = matrixTable[i-1][j];\r\n \t\t\t}\r\n \t\t} \t\r\n \t} \r\n \t\r\n\t\tint totalProfit = matrixTable[n][capacity]; \t\t\r\n\t\tint temp = matrixTable[n][capacity];\r\n\t\tint [] itemInKnapsack = new int [n];\r\n\t\t\r\n\t\t//solving which item is in the knapsack\r\n for (int i = n; i > 0 && temp > 0; i--) { \r\n \r\n \r\n \tif (temp == matrixTable[i - 1][capacity]) \r\n \t{\r\n continue;\r\n \t}\r\n \t//if the top value is different than it is include in the knapsack\r\n else \r\n { \r\n itemInKnapsack[i-1] = items[i-1].index; //Save item number\r\n temp = temp - items[i - 1].profit; \r\n capacity = capacity - items[i - 1].weight; \r\n } \r\n } \r\n \r\n printResult(itemInKnapsack, totalProfit, 2); //Call print result\r\n }",
"public Rule selectRule(Vector ruleSet) {\r\n Enumeration enum2 = ruleSet.elements() ;\r\n long numClauses ;\r\n Rule nextRule ;\r\n\r\n Rule bestRule = (Rule)enum2.nextElement() ;\r\n long max = bestRule.numAntecedents() ;\r\n while (enum2.hasMoreElements()) {\r\n nextRule = (Rule)enum2.nextElement() ;\r\n if ((numClauses = nextRule.numAntecedents()) > max) {\r\n max = numClauses ;\r\n bestRule = nextRule ;\r\n }\r\n }\r\n return bestRule ;\r\n }",
"protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"private String getSolution(String dayColum, String MxTColum, String MnTColum, ArrayList<String[]> dataset) {\n\t\tint line = -1; // the number of the row, which has Small Temperature Spread\n\t\tint mxt = -1; // the number of the column, which is mxt\n\t\tint mnt = -1; // the number of the column, which is mnt\n\t\tint day = -1; // the number of the column, which is mnt\n\t\tif (dataset.size() == 0)\n\t\t\treturn String.valueOf(-1);\n\t\tfor (int i = 0; i < dataset.get(0).length; i++) {\n\t\t\tif (dataset.get(0)[i].equals(MxTColum))\n\t\t\t\tmxt = i;\n\t\t\tif (dataset.get(0)[i].equals(MnTColum))\n\t\t\t\tmnt = i;\n\t\t\tif (dataset.get(0)[i].equals(dayColum))\n\t\t\t\tday = i;\n\t\t}\n\t\tif ((mxt == -1) || (mnt == -1) || (day == -1)) \n\t\t\treturn String.valueOf(-1);\n\t\tfloat min = Float.MAX_VALUE;\n\t\tfor (int i = 1; i < dataset.size(); i++) {\n\t\t\ttry {\n\t\t\t\tfloat mnt_value = Float.parseFloat(dataset.get(i)[mnt]);\n\t\t\t\tfloat mxt_value = Float.parseFloat(dataset.get(i)[mxt]);\n\t\t\t\tif (min > Math.abs(mnt_value - mxt_value)) {\n\t\t\t\t\tmin = Math.abs(mnt_value - mxt_value);\n\t\t\t\t\tline = i;\n\t\t\t\t}\n\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// System.out.println(mnt+\" \"+mxt+\" \"+line);\n\t\treturn String.valueOf(dataset.get(line)[day]);\n\t}",
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"private String solve(String inputData) {\n\t\tScanner in = new Scanner(inputData);\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tint testCases = in.nextInt();\n\t\tfor (int i = 1; i <= testCases; ++i) {\n\t\t\tsb.append(\"Case #\" + i + \": \");\n\t\t\t\n\t\t\tint googlers = in.nextInt();\n\t\t\tint surprisingCase = in.nextInt();\n\t\t\tint target = in.nextInt();\n\t\t\tArrayList<Integer> scores = new ArrayList<Integer>();\n\t\t\tfor (int j = 0; j < googlers; ++j) {\n\t\t\t\tscores.add(in.nextInt());\n\t\t\t}\n\t\t\t\n\t\t\tint accepted = 0;\n\t\t\tint acceptLine = Math.max(target, target * 3 - 2);\n\t\t\tint limited = 0;\n\t\t\tint limitLine = Math.max(target, target * 3 - 4);\n\t\t\tfor (Integer score : scores) {\n\t\t\t\tif (score >= acceptLine) {\n\t\t\t\t\t++accepted;\n\t\t\t\t}\n\t\t\t\telse if (score >= limitLine) {\n\t\t\t\t\t++limited;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint result = accepted + Math.min(surprisingCase, limited);\n\t\t\tsb.append(result);\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public void solveIt() {\n\t\tfirstFreeSquare.setNumberMeAndTheRest();\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tN = Integer.parseInt(st.nextToken());\n\t\tM = Integer.parseInt(st.nextToken());\n\t\t\n\t\tcon = new ArrayList[N+1]; conW = new ArrayList[N+1];\n\t\tD = new long[N+1];\n\t\tfor(int i =1;i<=N;i++ ){\n\t\t\tcon[i] = new ArrayList<>();\n\t\t\tconW[i] = new ArrayList<>();\n\t\t\tD [i] = Long.MAX_VALUE;\n\t\t}\n\t\t\n\t\tfor(int i=1;i<=M;i++){\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tint c = Integer.parseInt(st.nextToken());\n\t\t\tcon[a].add(b); \n\t\t\tconW[a].add(c); \n\t\t}\n\n\t\tD[1] = 0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif(D[i] < Long.MAX_VALUE){\n\t\t\t\tfor (int j=0;j<con[i].size();j++){\n\t\t\t\t\tint k = con[i].get(j);//i->k\n\t\t\t\t\tint w = conW[i].get(j);//i->k까지 가는데 cost\n\t\t\t\t\tD[k] = Math.min(D[k], D[i]+w);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(D[N] < Long.MAX_VALUE ? D[N] : -1);\n\n\t}",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}",
"private int helper(int s, int M, int[] piles){\n if(s >= piles.length){\n return 0;\n }\n if(2*M + s > piles.length){\n return sums[s];\n }\n if(memo[s][M] != 0){\n return memo[s][M];\n }\n int min = Integer.MAX_VALUE;\n for(int x=1; x<=2*M; x++){\n // get the min score the player two can get\n min = Math.min(min, helper(s+x, Math.max(x, M), piles));\n }\n memo[s][M] = sums[s] - min;\n return memo[s][M];\n \n }",
"public static void main(String args[]) throws Exception {\n BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb=new StringBuilder();\n int t=Integer.parseInt(bu.readLine());\n int m[]=new int[10],i;\n m[0]=9;\n for(i=1;i<10;i++)\n m[i]=m[i-1]*10;\n\n while(t-->0)\n {\n int n=Integer.parseInt(bu.readLine());\n long ans=0; int sum=0,x=0;\n while(true)\n {\n if(sum+m[x]<=n)\n {\n ans+=1l*(x+1)*m[x];\n sum+=m[x];\n x++;\n }\n else break;\n }\n ans+=1l*(x+1)*(n-sum);\n sb.append(ans+\"\\n\");\n }\n System.out.print(sb);\n }",
"private double snrm( int n, double sx[], int itol ) {\n int isamax;\n double ans;\n\n if (itol <= 3) {\n ans = 0.0;\n for( int i = 0; i < n; i++ )\n ans += sx[i] * sx[i];\n return Math.sqrt(ans);\n } else {\n isamax = 0;\n for( int i = 0; i < n; i++ ) {\n if (Math.abs(sx[i]) > Math.abs(sx[isamax]))\n isamax = i;\n }\n return Math.abs(sx[isamax]);\n }\n }",
"public double[] solveLinearSet(double[] bvec){\r\n \tMatrix ludmat =\tthis.luDecomp();\r\n\r\n \treturn ludmat.luBackSub(bvec);\r\n \t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n\t\tint T = Integer.parseInt(br.readLine());\n\t\tfor(int tc = 1; tc <= T; tc++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\tint N = Integer.parseInt(st.nextToken());\n\t\t\tint M = Integer.parseInt(st.nextToken());\n\n\t\t\tint[][] arr = new int[N][M];\n\t\t\tint[] sum = new int[M];\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tarr[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tif(arr[i][j] == 1)\n\t\t\t\t\t\tsum[i]++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint cnt = 0;\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tmax = Math.max(max, sum[i]);\n\t\t\t}\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tif(max == sum[i]) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbw.write(\"#\"+tc+ \" \" + cnt + \" \" + max + \"\\n\");\n\t\t\tbw.flush();\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n sc = new Reader();\n //out = new Printer(\"./src/answer.txt\");\n out = new Printer();\n int testCases, n, m, k;\n long c;\n long[][] matrix, rsum, csum, oddLastCalc, evenLastCalc;\n// boolean flag;\n testCases = sc.nextInt();\n while (testCases-- > 0) {\n n = sc.nextInt();\n m = sc.nextInt();\n k = sc.nextInt();\n matrix = new long[n][m];\n rsum = new long[n+1][m+1];\n csum = new long[n+1][m+1];\n oddLastCalc = new long[n][m];\n evenLastCalc = new long[n][m];\n c = 0l;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n matrix[i][j] = sc.nextLong();\n oddLastCalc[i][j] = matrix[i][j];\n if(matrix[i][j]>=k)\n c++;\n }\n }\n\n for (int i = 0; i < n; i++) {\n rsum[i][m-1] = matrix[i][m-1];\n }\n for (int i = 0; i < m; i++) {\n csum[n-1][i] = matrix[n-1][i];\n }\n for (int i = 0; i < n; i++) {\n for (int j = m-2; j >=0; j--) {\n rsum[i][j] = rsum[i][j+1] + matrix[i][j];\n }\n }\n for (int i = 0; i < m; i++) {\n for (int j = n-2; j >=0; j--) {\n csum[j][i] = csum[j+1][i] + matrix[j][i];\n }\n }\n PRINT.ArrayMatrix(rsum);\n PRINT.ArrayMatrix(csum);\n System.out.println(\"-------------------------------------------------------\");\n\n for (int size = 2; size <= n; size++) {\n// flag = false;\n for (int i = n-size; i >= 0; i--) {\n for (int j = m - size; j >= 0; j--) {\n if(size%2==0){\n evenLastCalc[i][j] = matrix[i][j]\n + oddLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*evenLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n } else {\n oddLastCalc[i][j] = matrix[i][j]\n + evenLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*oddLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n }\n System.out.println(size + \"\\t\" + i + \"\\t\" + j);\n PRINT.ArrayMatrix(oddLastCalc);\n PRINT.ArrayMatrix(evenLastCalc);\n System.out.println(\"-------------------------------------------------------\");\n c++;\n }\n// if(flag)\n// break;\n }\n }\n System.out.println(c);\n }\n\n out.close();\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for (int Q = 0; Q < T; Q++) {\n \tint N = sc.nextInt();\n \tint M = sc.nextInt();\n \tint[][] m = new int[M][3];\n \tfor (int i = 0; i < M; i++) {\n \t\tm[i][0] = sc.nextInt();\n \t\tif (m[i][0] == 1) {\n \t\t\t//合并x和y所在的集合\n \t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tm[i][2] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 2){\n\t\t\t\t\t//将x提出来成立新的集合\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 3){\n\t\t\t\t\t//输出x所在集合的正整数个数\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tSystem.out.println(i);\n\t\t\t\t}\n \t}\n }\n\t}",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint query = input.nextInt();\n\t\t\n\t\tfor(int i=0;i<query;i++)\n\t\t{\n\t\t\tint n=input.nextInt();\n\t\t\tint m=input.nextInt();\n\t\t\tint[] array=new int[n];\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tarray[j]=input.nextInt();\n\t\t\t}\n\t\t\tSystem.out.println(maxSubArraySum(subsets(array),m));\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void findSolution() {\n\n\t\t// TODO\n\t}",
"public boolean isSubSetSumProblem(int [] set, int n , int sum){\n\t\tif (sum == 0)\n\t\t\treturn true;\n\t\t\n\t\tif(n == 0 && sum != 0)\n\t\t\treturn false;\n\t\tif(set[n-1] > sum)\n\t\t\treturn isSubSetSumProblem(set, n-1, sum);\n\t\t\n\t\treturn isSubSetSumProblem(set, n-1, sum) || isSubSetSumProblem(set, n-1, sum-set[n-1]);\n\t}",
"private void PuzzleSolve(int k, ArrayList<Integer> S, ArrayList<Integer> U) {\n // for every integer value in the array passed in U we will add it to the empty array and remove it from the\n // new array made called list.\n for (Integer s : U) {\n ArrayList<Integer> list = new ArrayList<>(U);\n S.add(s);\n list.remove(s);\n // If we have removed all numbers in the list and S is now full, check the evaluation.\n if (k == 1) {\n Equals(S);\n }\n // else we keep calling this method until U is empty.\n else {\n PuzzleSolve(k - 1, S, list);\n }\n // remove the value from s and then add it back to the list to test a new variation at the end.\n S.remove(s);\n list.add(s);\n }\n }",
"public static double[] solve(double[][] matrix, double[] vector) {\r\n // Merken der Spalte, welche eine Zahl ungleich null besitzt\r\n int tmpColumn = -1;\r\n\r\n // Alle Zeilen durchgehen: Ziel der for-Schleife -> Matrix in\r\n // Zeilenstufenform bringen!\r\n // -> Alle Zahlen unterhalb der Diagonale sind null\r\n for (int line = 0; line < matrix.length; line++) {\r\n\r\n tmpColumn = -1;\r\n\r\n // Umformungsschritt 1: Finden einer Spalte mit einem Wert ungleich null\r\n for (int column = 0; column < matrix[line].length; column++) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n if (matrix[row][column] != 0) {\r\n tmpColumn = column;\r\n break;\r\n }\r\n }\r\n\r\n // Abbruch, zahl ungleich null wurde gefunden\r\n if (tmpColumn != -1) {\r\n break;\r\n }\r\n }\r\n\r\n // NullZeile(n) entdeckt!\r\n if (tmpColumn == -1) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n // Gleichungssystem hat keine Loesung!\r\n if (vector[line] != 0) {\r\n System.out.println(\"Gleichungssystem besitzt keine Loesung!\");\r\n return null;\r\n }\r\n }\r\n // Nullzeile(n) vorhanden -> Ist das System noch eindeutig loesbar?\r\n if (matrix[0].length - 1 >= line) {\r\n // System nicht eindeutig loesbar.\r\n System.out.println(\"Gleichungssystem nicht eindeutig loesbar!\");\r\n return null;\r\n }\r\n break;\r\n }\r\n\r\n // Umformungsschritt 2: Die Zahl matrix[line][tmpColumn] soll UNgleich\r\n // null sein\r\n if (matrix[line][tmpColumn] == 0) {\r\n\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n\r\n if (matrix[row][tmpColumn] != 0) {\r\n // Vertauschen von Zeilen -> matrix[line][tmpColumn] wird dann\r\n // ungleich null\r\n swapTwoLines(line, row, matrix, vector);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Umformungsschritt 3: matrix[line][tmpColumn] soll gleich 1 sein.\r\n if (matrix[line][tmpColumn] != 0) {\r\n\r\n // Division der Zeile mit matrix[line][tmpColumn]\r\n divideLine(line, matrix[line][tmpColumn], matrix, vector);\r\n }\r\n\r\n // Umformungsschritt 4: Alle Zahlen unter matrix[line][tmpColumn] sollen\r\n // null sein.\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n // Subtraktion damit unter der Zahl im Umformungsschritt 3 nur nullen\r\n // stehen\r\n removeRowLeadingNumber(matrix[row][tmpColumn], line, row, matrix,\r\n vector);\r\n }\r\n }\r\n\r\n // Umformungsschritt 6: Matrix in Normalform bringen (Zahlen oberhalb der\r\n // Diagonale werden ebenfalls zu null)\r\n for (int column = matrix[0].length - 1; column > 0; column--) {\r\n\r\n // Alle Werte oberhalb von \"column\" werden zu null\r\n for (int row = column; row > 0; row--) {\r\n\r\n // Dazu wird Subtraktion angewandt\r\n removeRowLeadingNumber(matrix[row - 1][column], column, row - 1,\r\n matrix, vector);\r\n }\r\n }\r\n\r\n // Unser ehemaliger Loesungsvektor ist jetzt zu unserem Zielvektor geworden\r\n // :)\r\n return vector;\r\n }",
"public SATSolver get5Solver() {\n final int A = 1, B = 2, C = 3, D = 4, E = 5, F = 6;\n SATSolver solver = new SAT4JSolver();\n// int[][] clauses = {\n// \t{-1,2},{-1,3},{-1,4},{-1,5},{-1,6},{-2,-3},{-2,-4},{-2,-5},{-2,-6},\n// \t{-3,1},{-3,2},{-4,1,2,3},{-5,-1},{-5,-2},{-5,-3},{-5,-4},{-6,-1},{-6,-2},\n// \t{-6,-3},{-6,-4},{-6,-5},\n// \t{-2,-3,-4,-5,-6,1},{3,4,5,6,2},{-1,-2,3},{-1,4},{-2,4},{-3,4},{1,2,3,4,5},{1,2,3,4,5,6}};\n \n int[][] clauses = {\n \t\t// From statement (1)\n \t\t{A, -B, -C, -D, -E, -F},\n \t\t{-A, B},\n \t\t{-A, C},\n \t\t{-A, D},\n \t\t{-A, E},\n \t\t{-A, F},\n \t\t\n \t\t// From statement (2)\n \t\t{B, C, D, E, F},\n \t\t{-B, -C},\n \t\t{-B, -D},\n \t\t{-B, -E},\n \t\t{-B, -F},\n \t\t\n \t\t// From statement (3)\n \t\t{C, -A, -B},\n \t\t{-C, A},\n \t\t{-C, B},\n \t\t\n \t\t// From statement (4)\n \t\t{D, -A},\n \t\t{D, -B},\n \t\t{D, -C},\n \t\t{A, B, C, -D},\n \t\t\n \t\t// From statement (5)\n \t\t{A, B, C, D, E},\n \t\t{-E, -A},\n \t\t{-E, -B},\n \t\t{-E, -C},\n \t\t{-E, -D},\n \t\t\n \t\t// From statement (6)\n \t\t{A, B, C, D, E, F},\n \t\t{-F, -A},\n \t\t{-F, -B},\n \t\t{-F, -C},\n \t\t{-F, -D},\n \t\t{-F, -E},\n \t\t\n }; // TODO - Insert your clauses here.\n for (int[] clause : clauses)\n solver.addClause(clause);\n return solver;\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint [][][] dp = new int[n+1][m+1][m+1];\n\t\tint [][] arr = new int[n+1][m+1];\n\t\tint max = 1;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (arr[i][j] == 1) {\n\t\t\t\t\tfor (int z = j; z <= m && arr[i][z] == 1; z++) {\n\t\t\t\t\t\tdp[i][j][z] = dp[i-1][j][z] + 1;\n\t\t\t\t\t\tmax = Math.max(max, Math.min(dp[i][j][z], z-j+1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"public TemporalState getSetTemporalState(TemporalState ts, TemporalState last_state, FSA lts, Statement statement, ArrayList<Statement> s,HashSet<TemporalState> initial_states, HashSet<TemporalState> final_states){\n\t\t\tTemporalStateNode node=getSetTemporalStateNode(s);\n\t\t\tTemporalState state=null;\n\t\t\t \n\t\t\t \n\t\t\tboolean fusion=false;\n\t\t\tboolean blem=false;\n\t\t\tfor(TemporalState temp:node.states){\n\t\t\t\tboolean ok=false;\n\t\t\t\tif (mode>=0){\n\t\t\t\t\tif (temp.checkConstraintsCompatibility(ts)){\n\t\t\t\t\t\tok=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif (mode==-2){\n\t\t\t\t\t\tok=temp.exactLoChecking(ts,last_state,lts,statement,initial_states,final_states);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tok=temp.approxLoChecking(ts,last_state,lts,statement);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(statement);\n\t\t\t\t//temp.display(false);\n\t\t\t\t//ts.display(false);\n\t\t\t\t\n\t\t\t\tif (ok){\n\t\t\t\t\tstate=temp;\n\t\t\t\t\tfusion=true;\n\t\t\t\t\t//System.out.println(\"fusion \"+ts+\" avec \"+temp);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"pas de fusion de \"+ts+\" avec \"+temp);\n\t\t\t\t\t//System.out.println(\"pas fusion\");\n\t\t\t\t\tblem=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fusion){\n\t\t\t\tstate=new TemporalState(ts.requiredPast,ts.requiredFuture,ts.ensuredPast,ts.ensuredFuture,ts.past,ts.future);\n\t\t\t\t/*state.beganFutureSequences=ts.beganFutureSequences;\n\t\t\t\tstate.beganPastSequences=ts.beganPastSequences;\n\t\t\t\tstate.forbidenFuture=ts.forbidenFuture;\n\t\t\t\tstate.forbidenPast=ts.forbidenPast;*/\n\t\t\t\tnode.states.add(state);\n\t\t\t\tlts.addState(state);\n\t\t\t}\n\t\t\t\n\t\t\tif (last_state!=null){\n\t\t\t\tTransition tr=new Transition(last_state,statement,state);\n\t\t\t\tlts.addTransition(tr);\n\t\t\t}\n\t\t\t\n\t\t\tif (mode>=0){\n\t\t\t\tif(updateMode==0){\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> requiredFuture=TemporalState.union(state.requiredFuture,ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> past=TemporalState.intersect(state.past,ts.past);\n\t\t\t\t\tHashSet<Sequence> future=TemporalState.intersect(state.future,ts.future);\n\t\t\t\t\tHashSet<Sequence> lrequiredPast=TemporalState.copy(requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\tlrequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(lrequiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tstate.updateRequiredPast(requiredPast);\n\t\t\t\t\tstate.updateRequiredFuture(requiredFuture);\n\t\t\t\t\tstate.updateFuture(future);\n\t\t\t\t\tstate.updatePast(past);\n\t\t\t\t\n\t\t\t\t\tts.updatePast(past);\n\t\t\t\t\tts.updateRequiredFuture(requiredFuture);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tHashSet<Sequence> requiredPast=TemporalState.union(state.requiredPast,ts.requiredPast);\n\t\t\t\t\tif(statement!=null){\n\t\t\t\t\t\tString ch=statement.getText();\n\t\t\t\t\t\tSequence st=TemporalState.root.getForwardChild(ch);\n\t\t\t\t\t\trequiredPast.remove(st);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (last_state!=null){\n\t\t\t\t\t\tlast_state.updateRequiredPast(requiredPast);\n\t\t\t\t\t}\n\t\t\t\t\tHashSet<Sequence> srp=TemporalState.copy(state.requiredPast);\n\t\t\t\t\tHashSet<Sequence> srf=TemporalState.copy(state.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> sp=TemporalState.copy(state.past);\n\t\t\t\t\tHashSet<Sequence> sf=TemporalState.copy(state.future);\n\t\t\t\t\tHashSet<Sequence> trp=TemporalState.copy(ts.requiredPast);\n\t\t\t\t\tHashSet<Sequence> trf=TemporalState.copy(ts.requiredFuture);\n\t\t\t\t\tHashSet<Sequence> tp=TemporalState.copy(ts.past);\n\t\t\t\t\tHashSet<Sequence> tf=TemporalState.copy(ts.future);\n\t\t\t\t\t\n\t\t\t\t\tstate.updateRequiredPast(TemporalState.firstMinusSecond(trp,srp),1);\n\t\t\t\t\tstate.updateRequiredFuture(TemporalState.firstMinusSecond(trf,srf),1);\n\t\t\t\t\tstate.updatePast(TemporalState.firstMinusSecond(sp,tp),1);\n\t\t\t\t\tstate.updateFuture(TemporalState.firstMinusSecond(sf,tf),1);\n\t\t\t\t\t\n\t\t\t\t\tts.updateRequiredFuture(TemporalState.firstMinusSecond(srf,trf),1);\n\t\t\t\t\tts.updatePast(TemporalState.firstMinusSecond(tp,sp),1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/*if (NewTemporalState.mode>=0){\n\t\t\t\t\n\t\t\t}*/\n\t\t\t/*else{\n\t\t\t\tSystem.out.println(\"Ensure ok\");\n\t\t\t}*/\n\t\t\t//\n\t\t\t//System.out.println(\"fin\"+lts.getStates().size());\n\t\t\t/*if (blem){\n\t\t\t\tGenerateDOT.printDot(lts, \"a.dot\");\n\t\t\t\tReader reader = new InputStreamReader(System.in);\n\t\t\t\tBufferedReader input = new BufferedReader(reader);\n\t\t\t\tSystem.out.print(\"tapez touche pour continuer\");\n\t\t\t\ttry{\n\t\t\t\t\tString ok = input.readLine();\n\t\t\t\t}\n\t\t\t\tcatch(IOException e){System.out.println(e);}\n\t\t\t}*/\n\t\t\t\n\t\t\treturn(state);\n\t\t}",
"public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tout = new PrintWriter(System.out);\r\n\t\tsc = new StringTokenizer(\"\");\r\n\t\tn = nxtInt();\r\n\t\tm = nxtInt();\r\n\t\tc0 = nxtInt();\r\n\t\td0 = nxtInt();\r\n\t\ta = new int[m];\r\n\t\tb = new int[m];\r\n\t\tc = new int[m];\r\n\t\td = new int[m];\r\n\t\tdp = new long[m+2][101][n+1];\r\n\t\tfor(long[][]ar:dp)\r\n\t\t\tfor(long[]arr:ar)\r\n\t\t\t\tArrays.fill(arr, -1);\r\n\t\tint i = 0;\r\n\t\twhile(i < m){\r\n\t\t\ta[i]= nxtInt();\r\n\t\t\tb[i]= nxtInt();\r\n\t\t\tc[i]= nxtInt();\r\n\t\t\td[i]= nxtInt();\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tSystem.out.println(maxVal(0, n, a[0]));\r\n\r\n\t}",
"@Override\n \tpublic Solution solve() {\n \t\tfor (int i = 0; i < n; i++) {\n \t\t\tnest[i] = generator.getSolution();\n \t\t}\n \n \t\tfor (int t = 0; t < maxGeneration; t++) { // While (t<MaxGeneration) or\n \t\t\t\t\t\t\t\t\t\t\t\t\t// (stop criterion)\n \t\t\t// Get a cuckoo randomly (say, i) and replace its solution by\n \t\t\t// performing random operations;\n \t\t\tint i = r.nextInt(n);\n \t\t\tSolution randomNest = nest[i];\n \t\t\t//FIXME: randomNest = solutionModifier.modify(nest[i]);\n \n \t\t\t// Evaluate its quality/fitness\n \t\t\tint fi = randomNest.f();\n \n \t\t\t// Choose a nest among n (say, j) randomly;\n \t\t\tint j = r.nextInt(n);\n \t\t\tint fj = f[j];\n \n \t\t\tif (fi > fj) {\n \t\t\t\tnest[i] = randomNest;\n \t\t\t\tf[i] = fi;\n \t\t\t}\n \n \t\t\tsort();\n \t\t\t// A fraction (pa) of the worse nests are abandoned and new ones are built;\n\t\t\tfor(i = n-toAbandon; i<n; i++) {\n \t\t\t\tnest[i] = generator.getSolution();\n \t\t\t}\n \t\t\t\n \t\t\t// Rank the solutions/nests and find the current best;\n \t\t\tsort();\n \t\t}\n \n \t\treturn nest[0];\n \t}",
"private static boolean solveWithMRV(Node[][] puzzle, int x, int y) {\r\n\t\t// Use constraint lists to pick a node by MRV heuristic\r\n\t\tNode currentNode = mrvFindNode();\r\n\r\n\t\t// When there are no constrainedNodes left, mrvFindNode returns\r\n\t\t// a null -- this marks us reaching the end of the constraints\r\n\t\tif (currentNode == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// for each value in the domain of 1-4 or 1-9\r\n\t\tfor (int v = 1; v <= dimensions; v++) {\r\n\t\t\t// Does this node have this domain value in its constraints list?\r\n\t\t\t// If it does not, proceed.\r\n\t\t\tif (!currentNode.getConstraints().contains(v)) {\r\n\r\n\t\t\t\t// Needed to add row and col variables for this reason:\r\n\t\t\t\t// No longer just looping over the whole maze and using\r\n\t\t\t\t// its indices as my row and col\r\n\t\t\t\tif (viable(puzzle, currentNode.getRow(), currentNode.getColumn(), v)) {\r\n\r\n\t\t\t\t\t// temporarily change curNode's value to v\r\n\t\t\t\t\tint prevVal = currentNode.getValue();\r\n\t\t\t\t\tconstrainedNodes.remove(currentNode);\r\n\t\t\t\t\tcurrentNode.setValue(v);\r\n\t\t\t\t\t// this helper method will review and amend constraints\r\n\t\t\t\t\t// while also manipulating the puzzle variable\r\n\t\t\t\t\tList<Node> changedNodes = addViableConstraints(currentNode, v);\r\n\t\t\t\t\t// Now that all the constraint work is done, recurse\r\n\t\t\t\t\tif (solveWithMRV(puzzle, x, y)) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// replace curNode's value with its original value\r\n\t\t\t\t\t// and reset all values so we can backtrack\r\n\t\t\t\t\tcurrentNode.setValue(prevVal);\r\n\t\t\t\t\tconstrainedNodes.add(currentNode);\r\n\t\t\t\t\t// Reset the constraints of manipulated Nodes too\r\n\t\t\t\t\tfor (Node node : changedNodes) {\r\n\t\t\t\t\t\tnode.getConstraints().remove(v);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(new FileReader(\"talent.in\"));// new InputStreamReader(System.in)); //\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"talent.out\")));\n int N = sc.nextInt();\n int minWeight = sc.nextInt();\n int[] weight = new int[N];\n int[] value = new int[N];\n int totalTalent = 0;\n for (int i = 0; i < N; i++) {\n int wt = sc.nextInt();\n int val = sc.nextInt();\n weight[i] = wt;\n value[i] = val;\n totalTalent += val;\n }\n\n // Store, for a given talent, what is the smallest weight used to achieve it?\n int[] dp = new int[totalTalent + 1];\n Arrays.fill(dp, (int) 1e9);\n dp[0] = 0;\n // the min weight to produce 0 talent is 0. However,\n // it is necessary to make everything else big because we can only BUILD\n // from 0\n double bestRatio = 0;\n for (int cow = 0; cow < N; cow++) {\n // look at each cow, and go DOWN THROUGH THE dp array, updating the\n // best weight achievable BEHIND US. This countercurrent motion ensures no repeated\n // counting of a single cow's talents\n int contribution = value[cow];\n int wt = weight[cow];\n for (int talent = totalTalent; talent >= 0; talent--) {\n int boostedTalent = contribution + talent;\n int boostedWeight = dp[talent] + wt;\n // with the min weight of a certain talent,\n // is it possible to get a smaller boostedWeight for a boostedTalent\n if (boostedTalent <= totalTalent) {\n // If we are in bounds,\n if (boostedWeight < dp[boostedTalent]) {\n // and the attempted team has a better weight value\n // then update it!\n // Initially, when everything is 1 billion, this cannot\n // happen except for from the base cases, building outward\n dp[boostedTalent] = boostedWeight;\n\n // At the same time, we can be more efficient by constantly\n // checking if we had enough weight first of all, and\n // second of all had a better talent/weight ratio!\n double ratio = (double) boostedTalent / boostedWeight;\n if (ratio > bestRatio && boostedWeight >= minWeight) {\n bestRatio = ratio;\n }\n }\n }\n }\n }\n\n out.println((int) (1000 * bestRatio));\n out.close();\n }",
"private static <V extends Variable<A>, A extends Value> Map<V, DomainReduction<A>> FORWARD_CHECK2(SharedDomainVariableSet<V, A> variableSet, V var) throws Exception {\n\t\tMap<V, DomainReduction<A>> domainReduction = new HashMap<>(256);\n\t\t\n\t\t// map of constraints to unset variables\n\t\tMap<Constraint<V>, Queue<V>> unsetConstraints = new HashMap<>();\n\t\tfor (Constraint<V> constraint : variableSet.getConstraintsByVariable(var)) {\n\t\t\t\n\t\t\t// get free variables in the constraint\n\t\t\tQueue<V> freeVariables = new LinkedList<>();\n\t\t\tfor (V v : constraint.getVariables()) {\n\t\t\t\tif (!v.isSet()) {\n\t\t\t\t\tfreeVariables.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// add only if number of free variables is not empty\n\t\t\tif (!freeVariables.isEmpty()) {\n\t\t\t\tunsetConstraints.put(constraint, freeVariables);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\t// made at least one reduction for all constraints\n\t\t\tboolean madeReductionAll = false;\n\t\t\t\n\t\t\t// for each constraint on the variable\n\t\t\tfor (Constraint<V> constraint : unsetConstraints.keySet()) {\n\t\t\t\t\n\t\t\t\tQueue<V> freeVariables = unsetConstraints.get(constraint);\n\t\t\t\t\n\t\t\t\twhile (true) {\n\t\t\t\t\tMap<V, DomainReduction<A>> reductions = new HashMap<>(256);\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < freeVariables.size(); i ++) {\n\t\t\t\t\t\tV freeVariable = freeVariables.remove();\n\t\t\t\t\t\t\n\t\t\t\t\t\treductions.put(freeVariable, new DomainReduction<>(256)); // TODO\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<A> domain = variableSet.getDomain(freeVariable);\n\t\t\t\t\t\tif (domain.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (A val : domain) {\n\t\t\t\t\t\t\tfreeVariable.assign(val);\n\t\t\t\t\t\t\tif (!FIND_COMBINATION(variableSet, freeVariables, constraint)) {\n\t\t\t\t\t\t\t\treductions.get(freeVariable).add(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfreeVariable.unassign();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfreeVariables.add(freeVariable);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tboolean noReduction = true;\n\t\t\t\t\t\n\t\t\t\t\tfor (V freeVariable : freeVariables) {\n\t\t\t\t\t\tDomainReduction<A> reduc = reductions.get(freeVariable);\n\t\t\t\t\t\tif (!reduc.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.addDomainReduction(freeVariable, reduc);\n\t\t\t\t\t\t\tif (!domainReduction.containsKey(freeVariable)) {\n\t\t\t\t\t\t\t\tdomainReduction.put(freeVariable, reduc);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdomainReduction.get(freeVariable).addAll(reduc);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnoReduction = false;\n\t\t\t\t\t\t\tmadeReductionAll = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (noReduction) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!madeReductionAll) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn domainReduction;\n\t\t\n\t}",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public void updateCombination(Set<Integer> s, int n, int r) \n { \n combinations = new ArrayList();\n int arr[]= new int[n];\n // Copying contents of s to arr[] \n Iterator<Integer> it = s.iterator(); \n for (int i=0; i<s.size(); i++) \n arr[i] = it.next(); \n // A temporary array to store all combination one by one \n int[] data= new int[r];\n \n // Print all combination using temprary array 'data[]' \n combinationUtil(arr, data, 0, n-1, 0, r); \n }",
"public static void main(String args[]) throws Exception {\n\n\t\tString file = \"B-small-attempt0\";\n\n\t\tObject[] pairIO = IO.openIO(file);\n\t\tBufferedReader red = (BufferedReader) pairIO[0];\n\t\tPrintWriter wr = (PrintWriter) pairIO[1];\n\n\n\t\tint problemas = Integer.parseInt(red.readLine());\n\t\touter: for (int w = 0 ; w < problemas ; w++) {\n\t\t\tString par [] = red.readLine().split(\" \");\n\t\t\tdouble C = Double.parseDouble(par[0]);\n\t\t\tdouble F = Double.parseDouble(par[1]);\n\t\t\tdouble X = Double.parseDouble(par[2]);\n\t\t\tdouble V0 = 2;\n\t\t\t\n\t\t\tdouble mint = X/V0;\n\t\t\tdouble parSum = 0;\n\t\t\tint i = 1;\n\t\t\twhile (true) {\n\t\t\t\tdouble series = parSum + C/(V0 + (i-1)*F);\n\t\t\t\tdouble t = series + X/(V0 + i*F);\n\t\t\t\tif (t < mint) {\n\t\t\t\t\tmint = t;\n\t\t\t\t\tparSum = series;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twr.println(\"Case #\" + (w+1) + \": \" + mint);\n\t\t}\n\t}",
"@Override\n\tpublic int[][] computeAssignments( final double[][] matrix )\n\t{\n\t\tfinal int nlines = matrix.length;\n\t\tif ( nlines == 0 )\n\t\t{\n\t\t\t// no spot\n\t\t\treturn new int[][] { {} };\n\t\t}\n\t\tfinal int ncols = matrix[ 0 ].length;\n\t\tif ( nlines <= 1 && ncols <= 1 )\n\t\t\treturn new int[][] { {} };\n\n\t\t// subtract minimum value from rows and columns to create lots of zeroes\n\t\treduceMatrix( matrix );\n\n\t\t// non negative values are the index of the starred or primed zero in\n\t\t// the row or column\n\t\tfinal int[] starsByRow = new int[ matrix.length ];\n\t\tArrays.fill( starsByRow, -1 );\n\t\tfinal int[] starsByCol = new int[ matrix[ 0 ].length ];\n\t\tArrays.fill( starsByCol, -1 );\n\t\tfinal int[] primesByRow = new int[ matrix.length ];\n\t\tArrays.fill( primesByRow, -1 );\n\n\t\t// 1s mean covered, 0s mean not covered\n\t\tfinal int[] coveredRows = new int[ matrix.length ];\n\t\tfinal int[] coveredCols = new int[ matrix[ 0 ].length ];\n\n\t\t// star any zero that has no other starred zero in the same row or\n\t\t// column\n\t\tinitStars( matrix, starsByRow, starsByCol );\n\t\tcoverColumnsOfStarredZeroes( starsByCol, coveredCols );\n\n\t\twhile ( !allAreCovered( coveredCols ) )\n\t\t{\n\n\t\t\tint[] primedZero = primeSomeUncoveredZero( matrix, primesByRow, coveredRows, coveredCols );\n\n\t\t\twhile ( primedZero == null )\n\t\t\t{\n\t\t\t\t// keep making more zeroes until we find something that we can\n\t\t\t\t// prime (i.e. a zero that is uncovered)\n\t\t\t\tmakeMoreZeroes( matrix, coveredRows, coveredCols );\n\t\t\t\tprimedZero = primeSomeUncoveredZero( matrix, primesByRow, coveredRows, coveredCols );\n\t\t\t}\n\n\t\t\t// check if there is a starred zero in the primed zero's row\n\t\t\tfinal int columnIndex = starsByRow[ primedZero[ 0 ] ];\n\t\t\tif ( -1 == columnIndex )\n\t\t\t{\n\n\t\t\t\t// if not, then we need to increment the zeroes and start over\n\t\t\t\tincrementSetOfStarredZeroes( primedZero, starsByRow, starsByCol, primesByRow );\n\t\t\t\tArrays.fill( primesByRow, -1 );\n\t\t\t\tArrays.fill( coveredRows, 0 );\n\t\t\t\tArrays.fill( coveredCols, 0 );\n\t\t\t\tcoverColumnsOfStarredZeroes( starsByCol, coveredCols );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t// cover the row of the primed zero and uncover the column of\n\t\t\t\t// the starred zero in the same row\n\t\t\t\tcoveredRows[ primedZero[ 0 ] ] = 1;\n\t\t\t\tcoveredCols[ columnIndex ] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// ok now we should have assigned everything\n\t\t// take the starred zeroes in each column as the correct assignments\n\n\t\tfinal int[][] retval = new int[ matrix.length ][];\n\t\tfor ( int i = 0; i < starsByCol.length; i++ )\n\t\t{\n\t\t\tretval[ i ] = new int[] { starsByCol[ i ], i };\n\t\t}\n\t\treturn retval;\n\n\t}",
"public void setFinalSolution() {\r\n for(int i=0; i<Config.numberOfSeeds;i++) {\r\n// this.seeds[i].setDurationMilliSec(GLowestState.getDwelltimes()[i]);\r\n// Cur_state[i] = GLowestState.getDwelltimes()[i];\r\n Cur_state[i] = this.seeds[i].getDurationMilliSec();\r\n }\r\n if (Config.SACostFunctionType==3) {\r\n setCur_cost(costCUR());\r\n }\r\n if (Config.SACostFunctionType==2) {\r\n setCur_cost(costCURfinal());\r\n }\r\n if (Config.SACostFunctionType==1) {\r\n setCur_cost(costCURsuper());\r\n }\r\n if (Config.SACostFunctionType==0) {\r\n setCur_cost(costCURsuperfinal());\r\n }\r\n }",
"public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}",
"private void planDynamicStairs() throws GameActionException, HungryException {\r\n\t\tInteger fluxHeight = gameMap.get(fluxInfo.location).totalHeight;\r\n\t\tif (fluxHeight == fluxHeightWhenStairsPlanned){\r\n\t\t\tif (DEBUG) System.out.println(\"No need to plan stairs now\");\r\n\t\t\t//return; /* No return for now. Always plan stairs, so no stupid block lockups will occur */\r\n\t\t}\r\n\t\t\r\n\t\tif (DEBUG) System.out.println(\"-----TOWER-----\");\r\n\t\tDirection randDir = navigation.getRandomDirection();\r\n\t\tMapLocation start1 = fluxInfo.location.add(randDir).add(randDir);\r\n\t\tMapLocation start2 = fluxInfo.location.subtract(randDir).subtract(randDir);\r\n\t\tif ((gameMap.get(start1) == null) || (gameMap.get(start2) == null))\r\n\t\t\t/* unlucky - start position wasn't scanned yet */\r\n\t\t\treturn;\r\n\t\t\r\n\t\tfluxHeightWhenStairsPlanned = fluxHeight;\r\n\t\t\r\n\t\tList<MapLocation> fluxPath1 = navigation.findPathUsingAStar(gameMap, start1, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath1);\r\n\t\tList<MapLocation> fluxPath2 = navigation.findPathUsingAStar(gameMap, start2, fluxInfo.location, false);\r\n\t\t//if (DEBUG) System.out.println(fluxPath2);\r\n\t\tCollections.reverse(fluxPath1);\r\n\t\tCollections.reverse(fluxPath2);\r\n\t\tList<MapLocation> result = new ArrayList<MapLocation>();\r\n\t\twhile ((fluxPath1.size() > 0) && (fluxPath2.size() > 0) && (fluxPath1.get(0).equals(fluxPath2.get(0)))){\r\n\t\t\tresult.add(fluxPath1.remove(0));\r\n\t\t\tfluxPath2.remove(0);\r\n\t\t}\r\n\t\tCollections.reverse(result);\r\n\t\tif (result.size() >= stairs.size())\r\n\t\t\t/* prefer fresh data, but not too short */\r\n\t\t\tstairs = result;\r\n\t\tif (DEBUG) System.out.println(result);\r\n\t\tif (DEBUG) System.out.println(navigation.changePathToDirections(result));\r\n\t\tif (DEBUG) System.out.println(\"----/TOWER-----\");\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint T;\r\n\t\tT = sc.nextInt();\r\n\t\tfor (int test_case = 1; test_case <= T; test_case++) {\r\n\t\t\tlong min = Long.MAX_VALUE;\r\n\t\t\tN = sc.nextInt();\r\n\t\t\tmap = new long[N][2];\r\n\t\t\tcombination = new ArrayList<>();\r\n\t\t\tcombination(new boolean[N], 0, N / 2);\r\n\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tmap[i][0] = sc.nextInt();\r\n\t\t\t\tmap[i][1] = sc.nextInt();\r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < combination.size(); i++) {\r\n\t\t\t\tlong x = 0;\r\n\t\t\t\tlong y = 0;\r\n\t\t\t\tboolean[] com = combination.get(i);\r\n\t\t\t\tfor (int j = 0; j < com.length; j++) {\r\n\t\t\t\t\tif (com[j]) {\r\n\t\t\t\t\t\tx += map[j][0];\r\n\t\t\t\t\t\ty += map[j][1];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tx -= map[j][0];\r\n\t\t\t\t\t\ty -= map[j][1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tmin = Math.min(x * x + y * y, min);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + min);\r\n\t\t}\r\n\r\n\t\tsc.close();\r\n\t}"
]
| [
"0.59278554",
"0.58907455",
"0.57984066",
"0.57041454",
"0.5655098",
"0.55077356",
"0.5265416",
"0.5255286",
"0.51597667",
"0.5150644",
"0.51179695",
"0.5116956",
"0.50946414",
"0.5058573",
"0.50510985",
"0.500044",
"0.49987668",
"0.4933664",
"0.49138787",
"0.4882461",
"0.48796678",
"0.48773414",
"0.48735097",
"0.48723045",
"0.48530173",
"0.48512042",
"0.48488674",
"0.48438364",
"0.48400322",
"0.483868",
"0.48099214",
"0.48076445",
"0.48043478",
"0.48017257",
"0.47948763",
"0.47946692",
"0.47930482",
"0.47914028",
"0.47843102",
"0.47789007",
"0.47724575",
"0.47698557",
"0.47692862",
"0.47672018",
"0.47603184",
"0.47594908",
"0.47548702",
"0.47481734",
"0.47415859",
"0.47378334",
"0.47227266",
"0.4711197",
"0.4708493",
"0.47077125",
"0.4704717",
"0.46858755",
"0.4680055",
"0.4673175",
"0.46522886",
"0.46361232",
"0.4632605",
"0.46313098",
"0.46251467",
"0.46199375",
"0.46190724",
"0.4617591",
"0.4617284",
"0.46106833",
"0.4596704",
"0.45922685",
"0.45823857",
"0.45767662",
"0.4573563",
"0.4558995",
"0.45555517",
"0.45475504",
"0.45475036",
"0.45449597",
"0.45436206",
"0.45426485",
"0.45382574",
"0.45374814",
"0.4536181",
"0.45327473",
"0.45269492",
"0.45258197",
"0.45236745",
"0.45184553",
"0.45051283",
"0.45042706",
"0.450289",
"0.44999653",
"0.44989637",
"0.44965336",
"0.44952074",
"0.4483711",
"0.44812486",
"0.4479837",
"0.44706506",
"0.446871"
]
| 0.5509822 | 5 |
Determines a hospital optimal solution to the Stable Marriage problem from the given input set. Study the description to understand the variables which represent the input to your solution. | @Override
public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {
int m = marriage.getHospitalCount();
int n = marriage.getResidentCount();
ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();
ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();
ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();
ArrayList<Integer> residentMatching = new ArrayList<Integer>();
arrlistInit(residentMatching, n, -1, false);
/*list of residents that each hospital can propose to
* Initially equals the hospital_preference list*/
ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();
for (int i = 0; i < m; i++) //O(m)
residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));
/*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/
ArrayList<Integer> proposing = new ArrayList<Integer>();
arrlistInit(proposing, m, 0, true); //O(n)
/*Keep track of each hospital matched residents*/
ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);
for (int i = 0; i < m; i++) //O(m)
hospitalResidents.add(new ArrayList<Integer>(0));
/*Looping through each hospital in the proposing list
* Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident
* So total running time of the loop will be O(m*n)*/
while (!proposing.isEmpty()) {
for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {
/*Get the head of the proposing Arraylist*/
int hospital = proposing.get(0);
int residentIndex;
int resident = 0;
for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {
/*Get the next resident the hospital hasn't proposed to yed*/
resident = residentsToProposeTo.get(hospital).get(0);
int hospitalRank = resident_preference.get(resident).indexOf(hospital);
/*resident is matched, compare the hospitals rank*/
if (residentMatching.get(resident) != -1) {
int matchedHospital = residentMatching.get(resident);
int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);
if (hospitalRank < matchedHospitalRank) {
/*1.Add/remove to hospitalResidents
* 2.Add in resident-matching
* 3.Add matchedHospital to the proposing list if it's not in it
*/
hospitalResidents.get(hospital).add(resident);
hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));
residentMatching.set(resident, hospital);
if (!proposing.contains(matchedHospital))
proposing.add(matchedHospital);
}
}
/*resident is free, match with the hospital*/
else {
/*1.Add in hospitalResidents
* 2.Add in resident-matching
*/
hospitalResidents.get(hospital).add(resident);
residentMatching.set(resident, hospital);
}
/*1.Remove resident from the hospital's list of residentsToProposeTo
* 2.If hospital's slots are full, remove hospital from the proposing list
*/
residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));
if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))
proposing.remove(proposing.indexOf(hospital));
}
}
}
marriage.setResidentMatching(residentMatching);
return marriage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n//\t\tPrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tint N= Integer.parseInt(st.nextToken());\n\t\tint T= Integer.parseInt(st.nextToken());\n\t\t\n\t\t//for each N, three possible problem sets (P, A, G)\n\t\t//and P (prep time: min), V (value)\n\t\t//P <= A <= G\n\t\t\n\t\t//given limit T\n\t\t//find max profit\n\t\tint[][] v = new int[N+1][3+1];\n\t\tint[][] w = new int[N+1][3+1];\n\t\t\n\t\t//one \n\t\t\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tfor (int j = 1; j <= 3; j++) {\n\t\t\t\tw[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\tv[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t}\n\t\t}\n//\t\tfor (int i = 1; i <= N; i++) {\n//\t\t\tfor (int j = 1; j <= 3; j++) {\n//\t\t\t\tSystem.out.println(w[i][j] + \" \"+ v[i][j]);\n//\t\t\t}\n//\t\t}\n\t\tint[][] dp = new int[2][T+1];\n\t\t//where k looks at the kth row of the values/weight array\n\t\tfor (int k = 1; k <= N; k++) {\n\t\t\tfor (int x = 0; x <= T; x++) {\n\t\t\t\t//going through each weight and value\n\t\t\t\tboolean ran = false;\n\t\t\t\tfor (int a = 1; a <= 3; a++) {\t\t\t\t\t\n\t\t\t\t\tif (w[k][a] > x) {\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tran = true;\n\t\t\t\t\t\tdp[1][x] = Math.max(Math.max(dp[0][x],dp[0][x-w[k][a]] + v[k][a]),dp[1][x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!ran) {\n\t\t\t\t\tdp[1][x] = dp[0][x];\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp[0] = dp[1].clone();\n//\t\t\tfor (int[] row: dp) {\n//\t\t\t\tfor (int m: row) {\n//\t\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t\t}\n//\t\t\t\tSystem.out.println();\n//\t\t\t}\n\t\t}\n\t\t\n//\t\tfor (int[] row: dp) {\n//\t\t\tfor (int m: row) {\n//\t\t\t\tSystem.out.print(m + \" \");\n//\t\t\t}\n//\t\t\tSystem.out.println();\n//\t\t}\n\t\tSystem.out.println(dp[1][T]);\n\t}",
"public abstract double solve(int[][] matrix, double[] profitTable, int[] teamTable);",
"private static void solve(long[][][] ranks, String problem_name) {\n Solver solver = new Solver(\"StableMarriage\");\n\n //\n // data\n //\n System.out.println(\"\\n#####################\");\n System.out.println(\"Problem: \" + problem_name);\n\n long[][] rankWomen = ranks[0];\n long[][] rankMen = ranks[1];\n\n int n = rankWomen.length;\n\n //\n // variables\n //\n IntVar[] wife = solver.makeIntVarArray(n, 0, n - 1, \"wife\");\n IntVar[] husband = solver.makeIntVarArray(n, 0, n - 1, \"husband\");\n\n //\n // constraints\n // (the comments are the Comet code)\n // forall(m in Men)\n // cp.post(husband[wife[m]] == m);\n for (int m = 0; m < n; m++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(husband, wife[m]), m));\n }\n\n // forall(w in Women)\n // cp.post(wife[husband[w]] == w);\n for (int w = 0; w < n; w++) {\n solver.addConstraint(solver.makeEquality(solver.makeElement(wife, husband[w]), w));\n }\n\n // forall(m in Men, o in Women)\n // cp.post(rankMen[m,o] < rankMen[m, wife[m]] =>\n // rankWomen[o,husband[o]] < rankWomen[o,m]);\n for (int m = 0; m < n; m++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankMen[m], wife[m]).var(), rankMen[m][o]);\n\n IntVar b2 = solver.makeIsLessCstVar(\n solver.makeElement(rankWomen[o], husband[o]).var(), rankWomen[o][m]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n // forall(w in Women, o in Men)\n // cp.post(rankWomen[w,o] < rankWomen[w,husband[w]] =>\n // rankMen[o,wife[o]] < rankMen[o,w]);\n for (int w = 0; w < n; w++) {\n for (int o = 0; o < n; o++) {\n IntVar b1 = solver.makeIsGreaterCstVar(\n solver.makeElement(rankWomen[w], husband[w]).var(), rankWomen[w][o]);\n IntVar b2 =\n solver.makeIsLessCstVar(solver.makeElement(rankMen[o], wife[o]).var(), rankMen[o][w]);\n solver.addConstraint(solver.makeLessOrEqual(solver.makeDifference(b1, b2), 0));\n }\n }\n\n //\n // search\n //\n DecisionBuilder db = solver.makePhase(wife, solver.INT_VAR_DEFAULT, solver.INT_VALUE_DEFAULT);\n\n solver.newSearch(db);\n\n //\n // output\n //\n while (solver.nextSolution()) {\n System.out.print(\"wife : \");\n for (int i = 0; i < n; i++) {\n System.out.print(wife[i].value() + \" \");\n }\n System.out.print(\"\\nhusband: \");\n for (int i = 0; i < n; i++) {\n System.out.print(husband[i].value() + \" \");\n }\n System.out.println(\"\\n\");\n }\n\n solver.endSearch();\n\n // Statistics\n // System.out.println();\n System.out.println(\"Solutions: \" + solver.solutions());\n System.out.println(\"Failures: \" + solver.failures());\n System.out.println(\"Branches: \" + solver.branches());\n System.out.println(\"Wall time: \" + solver.wallTime() + \"ms\");\n }",
"@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }",
"public abstract double[] solveDual(int[][] matrix, double[] profitTable, int[] teamTable);",
"@Override\n public Matching stableMarriageBruteForce_residentoptimal(Matching marriage) {\n int residentsNumber = marriage.getResidentCount();\n int hospitalSlots = marriage.totalHospitalSlots();\n\n ArrayList<ArrayList<Integer>> validPartners = new ArrayList<ArrayList<Integer>>(0);\n ArrayList<Matching> stableMatchings = new ArrayList<Matching>();\n int count = 0;\n\n Permutation p = new Permutation(residentsNumber, hospitalSlots);\n Matching matching;\n int i=0;\n while ((matching = p.getNextMatching(marriage)) != null) {\n i++;\n\n if (isStableMatching(matching)) {\n stableMatchings.add(matching);\n validPartners.add(matching.getResidentMatching());\n count++;\n }\n }\n\n if (count == 1)\n return stableMatchings.get(0);\n\n validPartners = sortValidPartners(marriage, stableMatchings.size(), validPartners);\n\n return getBruteForceCorrectMatching(stableMatchings, validPartners);\n }",
"private Hashtable solve() {\n Hashtable<Integer, Double> solution = new Hashtable<>(); //maps variable (column) to its value\n double det = system.determinant();\n if (det == 0) {\n System.err.println(\"LinearSystem Solve Failed: determinant of matrix is 0\");\n return null;\n } else {\n for (int c = 0; c < system.N; c++) {\n double detC = colVectorIntoMatrix(c).determinant();\n solution.put(c, detC/det);\n }\n return solution;\n }\n }",
"public List<Configuration> solve(){\n int group = 0;\n for(List<Configuration> set : input){\n minimize(set);\n\n for(Configuration root : set) {\n root.setGroup(group);\n }\n group++;\n\n }\n\n // Step 2: Preprocess\n sortBySize(input);\n\n // Step 5: Initialize set of partial solutions\n List<Configuration> partialSolutions;\n if(input.size()==0){\n return null;\n }\n else {\n partialSolutions = input.get(0);\n input.remove(partialSolutions);\n }\n\n // Step 6: The compositional computations\n for(List<Configuration> set : input) {\n filter(partialSolutions, setCutoff);\n filter(set, setCutoff);\n partialSolutions = combine(partialSolutions, set, constraints);\n }\n\n // Step 7: Postprocessing\n //greedyPostProcessing(partialSolutions);\n\n return partialSolutions;\n }",
"public static int solution(int[] budgets, int M) {\n\t\tint lV = 0;\n\t\tint rV = 0;\n\t\tfor(int i = 0; i < budgets.length; i++) {\n//\t\t\tlV = Math.min(lV, budgets[i]); // 이게 있으면 위에 네번째 테케를 못품. \n\t\t\trV = Math.max(rV, budgets[i]);\n\t\t}\n\t\tint mid = rV/2;\n\t\tint ans = 0;\n\t\t\n\t\twhile(lV <= rV) {\n\t\t\tint tmp = 0;\n\t\t\tfor(int i = 0; i < budgets.length; i++) {\n\t\t\t\tif(budgets[i] > mid) tmp += mid;\n\t\t\t\telse tmp += budgets[i];\n\t\t\t}\n\t\t\n\t\t\tif(tmp > M) {\n\t\t\t\trV = mid - 1;\n\t\t\t} else {\n\t\t\t\tlV = mid + 1;\n\t\t\t\tans = Math.max(mid, ans);\n\t\t\t}\n\t\t\tmid = (lV+rV)/2;\n\t\t}\n\t\t\n\t\t\n\t\treturn ans;\n\t}",
"public void solveSingleSolution() {\n SPL M1 = this;\n\n int counter = 1;\n\n for(int i=0; i < this.NBrsEff; i++) {\n System.out.println(\"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1]);\n this.Solusi += \"x\" + counter + \" = \" + M1.M[i][this.NKolEff-1];\n counter += 1;\n this.Solusi += \"\\n\";\n } \n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint T = s.nextInt(); //number of tests\n\t\t\n\t\tfor(int i = 0; i < T; i++) {\n\t\t\tint N = s.nextInt(); //number of students\n\t\t\tint P = s.nextInt(); //number of students to pick\n\t\t\t\n\t\t\t//Get all skill scores\n\t\t\tint[] skillOfAllStudents = new int[N];\n\t\t\tfor(int j = 0; j < N; j++) {\n\t\t\t\tskillOfAllStudents[j] = s.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//Sort\n\t\t\tArrays.sort(skillOfAllStudents);\n\t\t\t\n\t\t\t//Find min number of hours to get a fair team\n\t\t\t//Go from largest down to smallest. take however many needed from the right and calculate amount needed for fair team\n\t\t\tint numHours = Integer.MAX_VALUE;\n\t\t\t\n\t\t\tfor(int l = N-1; l > P-2; l--) {\n\t\t\t\tint tempSkill = 0;\n\t\t\t\t\n\t\t\t\tint highest = skillOfAllStudents[l];\n\t\t\t\tfor(int k = l-1; k > l - P; k--) {\n\t\t\t\t\ttempSkill += (highest - skillOfAllStudents[k]);\n\t\t\t\t\t//System.out.println(\"intermediate #1: \" + tempSkill );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempSkill < numHours) {\n\t\t\t\t\tnumHours = tempSkill;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Print solution\n\t\t\tSystem.out.println(\"Case #\" + (i+1) + \": \" + numHours);\n\t\t}\n\t}",
"@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }",
"public SolutionSet execute() throws JMException, ClassNotFoundException {\n int maxEvaluations ;\n int evaluations ;\n\n SolutionSet population ;\n SolutionSet offspringPopulation ;\n\n Solution betterIndividual ;\n\n Operator mutationOperator ;\n Comparator comparator ;\n Operator localSearchOperator ;\n\n\n comparator = new ObjectiveComparator(0) ; // Single objective comparator\n\n // Read the params\n maxEvaluations = ((Integer)this.getInputParameter(\"maxEvaluations\")).intValue();\n\n // Initialize the variables\n population = new SolutionSet(mu_) ;\n offspringPopulation = new SolutionSet(lambda_) ;\n\n evaluations = 0;\n\n // Read the operators\n mutationOperator = this.operators_.get(\"mutation\");\n localSearchOperator = (LocalSearch) operators_.get(\"improvement\");\n\n System.out.println(\"(\" + mu_ + \" + \" + lambda_+\")ES\") ;\n\n // Create 1-parent population of mu solutions\n Solution newIndividual;\n newIndividual = new Solution(problem_);\n problem_.evaluate(newIndividual);\n evaluations++;\n betterIndividual = new Solution(newIndividual);\n population.add(betterIndividual);\n\n // Main loop\n while (evaluations < maxEvaluations) {\n // STEP 1. Generate the offspring\n Solution offspring = new Solution(population.get(0)) ;\n mutationOperator.execute(offspring);\n /*Solution mutated_solution = (Solution) mutationOperator.execute(offspring);\n if(offspring.getObjective(0) < mutated_solution.getObjective(0))\n offspring = mutated_solution;*/\n problem_.evaluate(offspring);\n Solution local_offspring = (Solution) localSearchOperator.execute(offspring);\n offspring.setObjective(0, local_offspring.getObjective(0));\n offspringPopulation.add(offspring);\n evaluations++;\n\n if(comparator.compare(betterIndividual, offspringPopulation.get(0)) > 0) {\n betterIndividual = new Solution(offspringPopulation.get(0));\n population.clear();\n // STEP 4. Create the new mu population\n population.add(betterIndividual);\n }\n\n System.out.println(population.get(0).getObjective(0)) ;\n\n // STEP 6. Delete the offspring population\n offspringPopulation.clear() ;\n } // while\n\n // Return a population with the best individual\n SolutionSet resultPopulation = new SolutionSet(1) ;\n resultPopulation.add(population.get(0)) ;\n\n return resultPopulation ;\n }",
"public HardSoftScore calculateScore(MPSReadinessCheckSolution solution) {\n\t\tint hardScore = 0, softScore = 0;\n\t\tMap<ProductionPlant, Map<Date, List<FixedPlanEntry>>> fulfilled = solution.getFulfilledMPS();\n\t\tMap<PlanEntryIndex, MRPEntry> mrp = solution.getAccumulatedMRP();\n\t\tMap<ProductionPlant, Map<Date, Map<UUID, Integer>>> aggregatecDemands = aggregateDemands(fulfilled);\n\t\tfor (Map.Entry<ProductionPlant, Map<Date, Map<UUID, Integer>>> fulfilledByLocEntry: aggregatecDemands.entrySet()) {\n\t\t\tProductionPlant fulfilledLoc = fulfilledByLocEntry.getKey();\n\t\t\tMap<Date, Map<UUID, Integer>> fulfilledByLoc = fulfilledByLocEntry.getValue();\n\t\t\tfor (Map.Entry<Date, Map<UUID, Integer>> fulfilledByDateEntry: fulfilledByLoc.entrySet()) {\n\t\t\t\tDate fulfilledDate = fulfilledByDateEntry.getKey();\n\t\t\t\tMap<UUID, MRPEntry> mrpPlan = findMRPSupportByFulfilledDate(mrp, fulfilledLoc, fulfilledDate);\n\t\t\t\tif (mrpPlan == null) {\n\t\t\t\t\thardScore = -10;\n\t\t\t\t\t//System.out.println(\"no mrp plan, date=\" + fulfilledDate);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tMap<UUID, Integer> skuDemands = fulfilledByDateEntry.getValue();\n\t\t\t\tfor (Map.Entry<UUID, Integer> skuDemand: skuDemands.entrySet()) {\n\t\t\t\t\tSystem.out.println(\"skuDemand:\" + skuDemand);\n\t\t\t\t\tUUID skuNo = skuDemand.getKey();\n\t\t\t\t\tint mpsQty = skuDemand.getValue();\n\t\t\t\t\t//System.out.println(\"calculateScore Called, skuNo=\" + skuNo + \",mpsQty =\" + mpsQty);\n\t\t\t\t\tif (mpsQty == 0) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no demand, hardscore:\" + hardScore);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tMRPEntry mrpEntry = mrpPlan.get(skuNo);\n\t\t\t\t\tif (mrpEntry == null) {\n\t\t\t\t\t\thardScore=-10;\n\t\t\t\t\t\t//System.out.println(\"calculateScore no mrp, hardscore:\" + hardScore + \",sku=\" + skuDemand.getKey());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (mrpEntry.getPlanQty() >= mpsQty) {\n\t\t\t\t\t\thardScore++;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp meet demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t} else { \n\t\t\t\t\t\thardScore = -1;\n\t\t\t\t\t\t//System.out.println(\"calculateScore mrp less than demand, hardscore:\" + hardScore + \",mrpEntry=\" + mrpEntry);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (hardScore < 0) break;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"end calculateScore Called, hardScore=\" + hardScore + \",solution=\" + solution);\n\t\t//System.out.println(\"\");\n\t\treturn HardSoftScore.valueOf(hardScore, softScore);\n\t}",
"public Solution solve(KnapsackData data);",
"public static void isSAT(Predicate pred, int[] vList){\n\t\t\n\t\tStack<Integer> assignedVariables = new Stack<Integer>();\n\t\tboolean satisfiability = false;\n\t\twhile(assignedCount<vList.length/2){\n\t\t\tif(pred.isContainsVariable(assignedCount+1, vList.length/2) == 0){\n\t\t\t\tvList[assignedCount] = 0;\n\t\t\t\tvList[assignedCount+vList.length/2] = 1;\n\t\t\t\tassignedCount++;\n\t\t\t} else {\n\t\t\t\tfailedPoint = assignedCount+1;\n\t\t\t\tsatisfiability = assignVariableAndEvaluatePred(pred, vList, assignedVariables);\n\t\t\t\t\n\t\t\t\tif(!satisfiability){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(satisfiability){\n\t\t\t\n\t\t\tsats.add(vList);\n\t\t\t\n\t\t\tgetAllSat(pred, vList);\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Assigned Values for Variables:\");\n\t\t\tfor(int[] arr: sats){\n\t\t\t\tfor(int i=0; i<vList.length/2; i++){\n\t\t\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Satisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" )\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \" ) ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"No Possible Variable Values for Satisfiability\");\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Variable: \" + failedPoint);\n\t\t\t\n\t\t\tSystem.out.println(\"Backtracked Node Count: \" + backTrackedCount);\n\t\t\t\n\t\t\tSystem.out.println(\"UnSatisfied Clauses:\");\n\t\t\tfor(int i : pred.clauses.keySet()){\n\t\t\t\tClause c = pred.clauses.get(i);\n\t\t\t\tif(i==pred.clauses.size()){\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"(\" + c.getL1().value + \" V \" + c.getL2().value + \" V \" + c.getL3().value + \") ^ \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public abstract int[] solve(double[][] costs);",
"public Solution solve(ISearchable s) {\n return null;\n }",
"int countSusbset(int n, int w){\n int dp[][] = new int[n+1][w+1];\n for(int i=0;i<=n;i++){\n for(int j=0;j<=w;j++){\n //when no items are there and target sum is 0, only one empty subset is possible\n if(i == 0 && j == 0){\n dp[i][j] = 1;\n }\n //no items left and target sum is greater than 0, no set is possible\n else if(i == 0 && j > 0){\n dp[i][j] = 0; \n }\n //if target sum is 0, no matter how many items we have , only one empty subset is possible\n else if(j == 0){\n dp[i][j] = 1;\n }\n //since item > target sum, so exclude\n else if(arr[i-1] > j){\n dp[i][j] = dp[i-1][j];\n }else{\n //two cases include and exclude\n dp[i][j] = dp[i-1][j] + dp[i-1][j - arr[i-1]];\n }\n }\n }\n return dp[n][w];\n}",
"public void readSet() throws IOException {\n temps = new HashSet<String>();\n readDescription();\n // adds the words in the temporary set to the temp array\n for (String w : temps) {\n if (w.equals(\"dana\")) {\n System.out.println(w + \" was called +1\");\n }\n int v = d.getValue(w);\n arr[v]++;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called +1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n temps = new HashSet<String>();\n readDescription();\n // does the same thing above, except since this is the second\n // description, subtract 1 from array\n for (String w : temps) {\n int v = d.getValue(w);\n arr[v]--;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called -1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n // get the prices\n int p1 = getPrice();\n int p2 = getPrice();\n // get the answer value\n // a should be the correct answer\n // b should be the answer they choose\n int a = getAnswer();\n int b = getAnswer();\n // System.out.println(\"The correct answer is: \" + a +\n // \" The chosen answer is: \" + b);\n int y_real;\n DecimalFormat numberFormat = new DecimalFormat(\"#.####\");\n double real_ratio;\n double mturk_ratio;\n if (p1 > p2) {\n y_real = p1 - p2;\n real_ratio = (double) p1 / p2;\n } else {\n y_real = p2 - p1;\n real_ratio = (double) p2 / p1;\n }\n int pdiff;\n if (a == b) {\n pdiff = y_real;\n mturk_ratio = real_ratio;\n } else {\n pdiff = -y_real;\n mturk_ratio = 1 / real_ratio;\n }\n if (p2 > p1) {\n for (int i = 0; i < arr.length; i++) {\n arr[i] = -arr[i];\n }\n }\n w.write(pdiff + \" \");\n w.write(numberFormat.format(real_ratio) + \" \");\n w.write(numberFormat.format(mturk_ratio) + \" \");\n for (int i = 0; i < size; i++) {\n if (i != arr.length - 1) {\n w.write(arr[i] + \" \");\n } else {\n w.write(arr[i]);\n }\n }\n w.write(\"\\n\");\n arr = new int[size];\n }",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int t = Integer.parseInt(s.nextLine());\n for(int i=1;i<=t;i++){\n int n = Integer.parseInt(s.nextLine());\n Set<String> a = new HashSet<>();\n\n for(int j=0;j<n;j++) {\n String str = s.nextLine();\n if(str.equals(\"easy-medium\"))\n str=\"medium\";\n else if(str.equals(\"medium-hard\"))\n str=\"hard\";\n a.add(str);\n }\n System.out.println(a.size()<5?\"No\":\"Yes\");\n /*int a1=0,a2=0,a3=0,a4=0,a5=0;\n for(int k=0;k<n;k++){\n if(a.contains(\"cakewalk\"))\n a1++;\n if(a.contains(\"simple\"))\n a2++;\n if(a[k].equals(\"easy\"))\n a3++;\n if(a[k].equals(\"easy-medium\") || a[k].equals(\"medium\"))\n a4++;\n if(a[k].equals(\"medium-hard\") || a[k].equals(\"hard\"))\n a5++;\n }\n if(a1==1&&a2==1&&a3==1&&a4==1&&a5==1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n*/\n }\n }",
"public static int dynamic_p(int objects,int capacity){\r\n // Array to accommodate dynamic programming solutions\r\n int dp_array[][] = new int[objects+1][capacity+1];\r\n // filling the 2D array\r\n for(int i=0; i<= objects;i++){\r\n for(int j=0; j<= capacity;j++){\r\n if(i == 0)\r\n dp_array[i][j]=0; // base case(number of objects are zero)\r\n else if(j == 0)\r\n dp_array[i][j]=0; // base case(capacity is zero)\r\n else if(randvariables[i-1] <= j){ // checking if the wight of object is less than the current knapsack capacity\r\n int included = randvalues[i-1]+dp_array[i-1][j-randvariables[i-1]]; // object is included\r\n int not_included = dp_array[i-1][j]; // object is not included\r\n\r\n //taking the max of these two\r\n if(included > not_included)\r\n dp_array[i][j] = included;\r\n else\r\n dp_array[i][j]= not_included;\r\n }\r\n else // weight is more than capacity .. not including the object\r\n dp_array[i][j] = dp_array[i-1][j];\r\n }\r\n }\r\n\r\n //System.out.println(Arrays.deepToString(dp_array));\r\n int solution = dp_array[objects][capacity];\r\n boolean[] optimalset = solution_used(dp_array,objects,capacity);\r\n System.out.println(Arrays.toString(optimalset));\r\n dp_array = null;\r\n return solution; // return the final solution\r\n\r\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"public TTPSolution SH2() {\n \n // get TTP data\n long[][] D = ttp.getDist();\n int[] A = ttp.getAvailability();\n double maxSpeed = ttp.getMaxSpeed();\n double minSpeed = ttp.getMinSpeed();\n long capacity = ttp.getCapacity();\n double C = (maxSpeed - minSpeed) / capacity;\n double R = ttp.getRent();\n int m = ttp.getNbCities(),\n n = ttp.getNbItems();\n TTPSolution s = new TTPSolution(m, n);\n int[] x = s.getTour(),\n z = s.getPickingPlan();\n \n /*\n * the tour\n * generated using greedy algorithm\n */\n x = linkernTour();\n z = zerosPickingPlan();\n Deb.echo(x);\n Deb.echo(z);\n \n /*\n * the picking plan\n * generated so that the TTP objective value is maximized\n */\n ttp.objective(s);\n \n // partial distance from city x_i\n long di;\n \n // partial time with item k collected from city x_i\n double tik;\n \n // item scores\n Double[] score = new Double[n];\n \n // total time with no items collected\n double t_ = s.ft;\n \n // total time with only item k collected\n double tik_;\n \n // fitness value\n double u[] = new double[n];\n \n for (int k=0; k<n; k++) {\n \n int i;\n for (i=0; i<m; i++) {\n if (A[k]==x[i]) break;\n }\n //P.echo2(\"[\"+k+\"]\"+(i+1)+\"~\");\n \n // time to start with\n tik = i==0 ? .0 : s.timeAcc[i-1];\n int iw = ttp.weightOf(k),\n ip = ttp.profitOf(k);\n \n // recalculate velocities from start\n di = 0;\n for (int r=i; r<m; r++) {\n \n int c1 = x[r]-1;\n int c2 = x[(r+1)%m]-1;\n \n di += D[c1][c2];\n tik += D[c1][c2] / (maxSpeed-iw*C);\n }\n \n score[k] = ip - R*tik;\n tik_ = t_ - di + tik;\n u[k] = R*t_ + ttp.profitOf(k) - R*tik_;\n //P.echo(k+\" : \"+u[k]);\n }\n \n Quicksort<Double> qs = new Quicksort<Double>(score);\n qs.sort();\n int[] si = qs.getIndices();\n int wc = 0;\n for (int k=0; k<n; k++) {\n int i = si[k];\n int wi = ttp.weightOf(i);\n // eliminate useless\n if (wi+wc <= capacity && u[i] > 0) {\n z[i] = A[i];\n wc += wi;\n }\n }\n \n ttp.objective(s);\n \n return s;\n }",
"private static double findOneSetCost(int r, int [] set,\r\n Vector oneSetVector,\r\n Host currentNode,\r\n ArrayList neighbors,\r\n ArrayList destList)\r\n {\n ArrayList setNeighbors = new ArrayList();\r\n for ( int i = 0; i < set.length; i++)\r\n {\r\n int index = set[i] - 1;\r\n Host neighbor = (Host) neighbors.get(index);\r\n setNeighbors.add(neighbor);\r\n }\r\n double [][] setDistanceArray = findDistanceArray(currentNode, destList, setNeighbors);\r\n //the setDistanceArray[r][m]\r\n\r\n //check if any neighbor in set is not common neighbor for all dests\r\n //if a neighbor is so, return a MaxDistance, hopArray = NULL\r\n int m = destList.size();\r\n for ( int i = 0; i < m; i++)\r\n {\r\n int num = 0;\r\n for ( int j = 0; j < r; j++)\r\n {\r\n if (setDistanceArray[j][i] < 0)\r\n {\r\n num++;\r\n setDistanceArray[j][i] = MaxDistance;\r\n }\r\n }\r\n if ( num >= r )\r\n {\r\n // All the neighbors in set cannot forward to destination[i]\r\n oneSetVector.clear(); // ???\r\n return MaxDistance;\r\n }\r\n }\r\n\r\n //find forward nodes provides min remain distance\r\n double totalCost = 0.0;\r\n\r\n //go thourgh destList, find a best forward neighbor for each dest\r\n //add the distance to totalRemainDistance\r\n for (int i = 0; i < m; ++i) {//loop through destList\r\n double minCost = setDistanceArray[0][i];//get first neighbor for each dest\r\n oneSetVector.add(i, setNeighbors.get(0));\r\n for (int j = 0; j < r; ++j) {// Loop through the neighbor\r\n if (minCost > setDistanceArray[j][i]) {\r\n // Swap\r\n minCost = setDistanceArray[j][i];\r\n oneSetVector.set(i, setNeighbors.get(j));\r\n }\r\n }\r\n totalCost += minCost;\r\n }\r\n\r\n return totalCost;\r\n }",
"protected abstract void solve(Items items,Knapsack knapsack);",
"public void solution() {\n\t\t\n\t}",
"public void doRegressionAnalysis()\r\n {\n n = Y.getRowDimension();\r\n p = X.getColumnDimension(); \r\n k = p - 1; // k is number of explanatory variables\r\n Resids = new Matrix(n, 1);\r\n StandResids = new Matrix(n, 1);\r\n StudResids = new Matrix(n, 1);\r\n Cooks_D = new Matrix(n, 1);\r\n R_Student = new Matrix(n, 1);\r\n\r\n // MVP, p73\r\n X_Prime = X.transpose();\r\n X_Prime_X = X_Prime.times(X);\r\n X_Prime_X_Inv = X_Prime_X.inverse(); \r\n HatMatrix = X.times(X_Prime_X_Inv.times(X_Prime)); \r\n BetaHats = X_Prime_X_Inv.times(X_Prime.times(Y)); \r\n YHats = HatMatrix.times(Y);\r\n BXY = (BetaHats.transpose()).times(X_Prime.times(Y));\r\n Y_Prime_Y = (Y.transpose()).times(Y); \r\n ssRegression = BXY.get(0,0) - sumY_Squared_Over_n;\r\n SSRes = Y_Prime_Y.minus(BXY);\r\n ssResiduals = SSRes.get(0,0);\r\n ssTotal = Y_Prime_Y.get(0,0) - sumY_Squared_Over_n;\r\n \r\n r2 = ssRegression / ssTotal;\r\n s = Math.sqrt(ssResiduals / (n - k - 1));\r\n adj_r2 = 1.0 - (ssResiduals / (n - k - 1)) / (ssTotal / (n - 1));\r\n \r\n dfReg = k;\r\n dfResid = n - k - 1;\r\n dfTotal = n - 1;\r\n msReg = ssRegression / (double)k;\r\n msResid = ssResiduals / (double)(n - k - 1);\r\n fStatistic = msReg / msResid;\r\n fDist = new FDistribution(k, n - k - 1);\r\n pValue_F = fDist.getRightTailArea(fStatistic);\r\n Resids = Y.minus(YHats);\r\n\r\n tempDouble_01 = 1.0 / Math.sqrt(msResid);\r\n\r\n StandResids = Resids.times(tempDouble_01); \r\n for (int jj = 0; jj < n; jj++)\r\n { \r\n tempDouble_02 = HatMatrix.get(jj, jj);\r\n StudResids.set(jj, 0, Resids.get(jj, 0) * tempDouble_01 / Math.sqrt(1.0 - tempDouble_02));\r\n tempDouble_03 = StudResids.get(jj, 0) * StudResids.get(jj, 0) / (double)p;\r\n tempDouble_04 = tempDouble_02 / (1.0 - tempDouble_02);\r\n Cooks_D.set(jj, 0, tempDouble_03 * tempDouble_04);\r\n \r\n // Student-R calculations from 4.12, 4.13, p135\r\n jjResid = Resids.get(jj, 0);\r\n double e_i_sq = jjResid * jjResid; \r\n double oneMinus_hii = 1.0 - HatMatrix.get(jj, jj);\r\n double s_i_sq = ((n - p)*msResid - e_i_sq/oneMinus_hii) / (n - p - 1);\r\n R_Student.set(jj, 0, jjResid / Math.sqrt(s_i_sq * oneMinus_hii)); \r\n }\r\n\r\n StErrCoef = new Matrix(k + 1, 1); // Explanatory variables + intercept \r\n TStat = new Matrix(k + 1, 1); \r\n PValue_T = new Matrix(k + 1, 1); \r\n tDist = new TDistribution (n - k - 1);\r\n\r\n for (int preds = 0; preds <= k; preds++)\r\n {\r\n StErrCoef.set(preds, 0, Math.sqrt(msResid * X_Prime_X_Inv.get(preds, preds)));\r\n TStat.set(preds, 0, BetaHats.get(preds, 0) / StErrCoef.get(preds, 0));\r\n PValue_T.set(preds, 0, 2.0 * tDist.getRightTailArea(Math.abs(TStat.get(preds, 0))));\r\n }\r\n }",
"boolean solveBranchingModel(BranchingConstraintSet targetSet) {\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n Map<String, Double> terms = new HashMap<>();\n terms.put(branching.branchingVarName, 1.0);\n\n if (branching.branchingType == ConstraintType.LEQL)\n origin.addConstraint(branching.name, terms, branching.branchingType, -Double.MAX_VALUE, branching.bound);\n else\n origin.addConstraint(branching.name, terms, branching.branchingType, branching.bound, Double.MAX_VALUE);\n\n }\n\n origin.solveLP();\n\n for (BranchingConstraint branching : targetSet.branchingConstraints) {\n origin.removeConstraint(branching.name);\n }\n\n if (origin.getStatus() == Model.Status.OPTIMAL) {\n// System.out.println(\"Objective: \" + origin.getOptimum()); /* Get objective value */\n if (integerSolution()) {\n if (origin.getOptimum() < ub)\n ub = origin.getOptimum();\n return false;\n } else {\n if (origin.getOptimum() > lb)\n lb = origin.getOptimum();\n return true;\n }\n } else {\n System.out.println(\"Current branch is infeasible!\");\n return false;\n }\n }",
"public void minimize() {\n D = new boolean[states.length][states.length];\r\n S = new ArrayList<ArrayList<HashSet<Point>>>(); // lol\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int i = 0; i < states.length; i++) {\r\n ArrayList<HashSet<Point>> innerList = new ArrayList<HashSet<Point>>();\r\n\r\n //noinspection ForLoopReplaceableByForEach\r\n for (int j = 0; j < states.length; j++) {\r\n Arrays.fill(D[i], false);\r\n innerList.add(new HashSet<Point>());\r\n }\r\n S.add(innerList);\r\n }\r\n\r\n // 2. states with different acceptances are distinguishable\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n if (acceptStates.contains(i) != acceptStates.contains(j)) {\r\n D[i][j] = true;\r\n }\r\n }\r\n }\r\n\r\n // 3. mark as possibly indistinguishable, enforce distinguishability\r\n for (int i = 0; i < states.length; i++) {\r\n for (int j = i + 1; j < states.length; j++) {\r\n // only pairs that are as of yet indistinguishable\r\n if (D[i][j]) {\r\n continue;\r\n }\r\n\r\n DFAState qi = states[i];\r\n DFAState qj = states[j];\r\n\r\n // one of the things being compared is unreachable\r\n if (qi == null || qj == null) {\r\n continue;\r\n }\r\n\r\n // helps emulate \"for any\"\r\n boolean distinguished = false;\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n // if on the same letter, qm and qn move to distinguishable states\r\n if (D[m][n] || D[n][m]) {\r\n dist(i, j);\r\n distinguished = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!distinguished) {\r\n // qm and qn are indistinguishable\r\n for (int k = 0; k < qi.transitions.size(); k++) {\r\n int m = qi.transitions.get(k);\r\n int n = qj.transitions.get(k);\r\n\r\n if (m < n && !(i == m && j == n)) {\r\n S.get(m).get(n).add(new Point(i, j));\r\n } else if (m > n && !(i == n && j == m)) {\r\n S.get(n).get(m).add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n mergeStates();\r\n }",
"public abstract OptimisationSolution getBestSolution();",
"static int nonDivisibleSubset(int k, int[] S) {\n\t\tint result = 0;\n\n\t\tArrayList < ArrayList < Integer >> solutions = new ArrayList < ArrayList < Integer >>();\n\t\tArrayList < HashSet < Integer >> minSets = new ArrayList < HashSet < Integer >>();\n\n\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( S [ 0 ])));\n\t\tminSets.add (new HashSet <Integer > ( ));\n\t\tminSets.get(0).add ( S [ 0 ] % k);\n\n\n\t\t// Go over all the numbers\n\t\tfor ( int i = 1; i < S.length; i++ ){\n\t\t\tint n = S [ i ]; \n\t\t\tint m = S [ i ] % k; // Number we will add to all the elements of all the minSets.\n\n\t\t\t// Go over all the minSets.\n\t\t\t// For each one, check that each element plus m is not divisible by k.\n\n\t\t\tboolean workedForASet = false;\n\t\t\tfor ( int j = 0; j < minSets.size(); j++){\n\t\t\t\t// For each set, check all the elements of the set.\n\n\t\t\t\tHashSet < Integer > minSet = minSets.get(j);\n\t\t\t\tIterator < Integer > iter = minSet.iterator();\n\n\t\t\t\tboolean works = true;\n\t\t\t\twhile ( iter.hasNext() && works ){\n\t\t\t\t\tint num = iter.next();\n\t\t\t\t\tif ( (num + m) % k == 0 ){\n\t\t\t\t\t\tworks = false;\n\t\t\t\t\t\tworkedForASet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( works ){\n\t\t\t\t\tsolutions.get(j).add(n);\n\t\t\t\t\tminSet.add(m);\n\t\t\t\t}\n\t\t\t} \n\n\t\t\tif ( !workedForASet ){\n\t\t\t\tsolutions.add(new ArrayList <Integer > ( Arrays.asList ( n )));\n\t\t\t\tminSets.add (new HashSet <Integer > ( ));\n\t\t\t\tminSets.get (minSets.size() - 1).add ( m ); \n\t\t\t} \n\t\t}\n\n\t\t// Find the solution with the most elements.\n\n\t\tfor ( ArrayList <Integer > solution : solutions ){\n\t\t\tresult = Math.max ( result, solution.size() );\n\t\t\tSystem.out.println ( solution );\n\t\t}\n\n\t\tif ( result == 1 ) result = 0;\n\t\treturn result;\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"private ASSPSolution floydWarshall(Double[][] aMatrix, Integer[][] pMatrix)\n {\n Double best[][][] = new Double[2][this.numIntxns][this.numIntxns];\n Integer pred[][][] = new Integer[2][this.numIntxns][this.numIntxns];\n\n best[0] = aMatrix;\n best[1] = aMatrix;\n\n pred[0] = pMatrix;\n pred[1] = pMatrix;\n\n int solnIndex = 0;\n\n for (int k = 0; k < this.numIntxns; k++)\n {\n for (int u = 0; u < this.numIntxns; u++)\n {\n for (int v = 0; v < this.numIntxns; v++)\n {\n // we only need to keep two matrices in memory and swap\n // between them. i and j alternate.\n int i = k % 2;\n int j = (i == 0) ? 1 : 0;\n\n best[i][u][v] = best[j][u][v];\n\n // note that null represents infinity\n if (best[i][u][k] != null && best[i][k][v] != null)\n {\n // if this spot is infinite, anything is better\n if (best[i][u][v] == null)\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n else if \n ((best[j][u][k] + best[j][k][v]) < best[i][u][v])\n {\n best[i][u][v] = best[j][u][k] + best[j][k][v];\n pred[i][u][v] = k;\n }\n\n // Stores the last i value so that the correct answers \n // can be sent back to the user.\n if (v == this.numIntxns - 1)\n {\n solnIndex = i;\n }\n }\n }\n }\n }\n\n return new ASSPSolution(best[solnIndex], pred[solnIndex]);\n }",
"public void testSudoku() {\n \t\tfinal Sudoku model = new Sudoku(3);\n \t\tfinal Solution sol = solve(model.rules(), model.puzzle1());\n //\t\tSATISFIABLE\n //\t\tp cnf 1544 6974\n //\t\tprimary variables: 702\n \t\tassertEquals(Solution.Outcome.SATISFIABLE, sol.outcome());\n \t\tassertEquals(702, sol.stats().primaryVariables());\n \t\tassertEquals(1544, sol.stats().variables());\n \t\tassertEquals(6974, sol.stats().clauses());\n \t}",
"public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public void getSolution(TaskState state){\n\n if(state.isNew) {\n state.isNew = false;\n state.hasSolution = true;\n }\n else {\n if(!(state.hasSolution = rollBack(state)))\n return;\n }\n\n while (state.moveStack.size() < 64 ||\n !state.moveStack.peek().getStandElement().hasNeighbour(state.graph.getFirst())){\n\n if(state.moveStack.size() == 64 && !rollBack(state)) {\n state.hasSolution = false;\n return;\n }\n\n if(state.moveStack.peek().hasNextMove())\n state.moveStack.push(\n new HorseMove(state.moveStack.peek().getNextMove())\n );\n\n else if(!rollBack(state)){\n state.hasSolution = false;\n return;\n }\n\n }\n\n }",
"public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static void bestApproach(int matrix[][]){\n\t\t\n\t\tint m = matrix.length;\n\t\tint n = matrix[0].length;\n\t\t\n\t\t//Taking two variables for storing status of first row and column\n\t\tboolean firstRow = false;\n\t\tboolean firstColumn = false;\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 0;i<m;i++){\n\t\t\tfor(int j = 0;j<n;j++){\n\t\t\t\tif(matrix[i][j] == 0){\n\t\t\t\t\tif(i == 0) firstRow == true;\n\t\t\t\t\tif(j == 0) firstColumn == true;\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][0] = 0;\n\t\t\t\t\tmatrix[0][j] = 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//any element except for first row and first column is zero\n\t\tfor(int i = 1;i<m;i++){\n\t\t\t\n\t\t\tfor(int j = 1;j<n;j++){\n\t\t\t\t//based on first row and first column making the entire column and row as zero\n\t\t\t\tif(matrix[0][j] == 0 || matrix[i][0] == 0){\n\t\t\t\t\t//Making first row and first column as zero\n\t\t\t\t\tmatrix[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Making every column value to 0 in first row\n\t\tif(firstRow){\n\t\t\t\n\t\t\tfor(int j = 0;j <n;j++){\n\t\t\t\tmatrix[0][j] = 0;\n\t\t\t}\n\t\t}\n\t\t//Making every row value to 0 in first column\n\t\tif(firstColumn){\n\t\t\t\n\t\t\tfor(int i = 0;i <m;i++){\n\t\t\t\tmatrix[i][0] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n int input = 0;\n int armLength;\n int solution = 0;\n\n // get the puzzle input\n System.out.print(\"Please provide the puzzle input: \");\n input = new Scanner(System.in).nextInt();\n\n /// PART 1\n // figure out which spiral input is on to calculate distance on one axis\n armLength = SpiralUtils.lengthOfSprialArm(input);\n solution = (armLength - 1) / 2;\n\n // find the midpoints of the spiral the input is on\n List<Integer> midpoints = SpiralUtils.midpointsOfSprialArm(armLength);\n\n // calculate the smallest distance from any midpoint to our input for other access\n solution += SpiralUtils.smallestDistanceFromMidpoints(input, midpoints);\n\n System.out.println(\"The solution to part 1 is: \" + solution);\n\n /// PART 2\n // this part is less elegant, as I'm just going to create the spiral instead of run calculations\n System.out.println(\"The solution to part 2 is: \" + SpiralUtils.spiralUntilAtLeast(input));\n }",
"public static void main(String[] args) {\n Scanner ob = new Scanner(System.in);\n Solution solution = null;\n int testcases = ob.nextInt();\n ob.nextLine();\n for (int i = 0; i < testcases; i++) {\n String numsLine = ob.nextLine();\n String[] numsLineParts = numsLine.trim().split(\" \");\n int dimensions = Integer.valueOf(numsLineParts[0]);\n int numOperations = Integer.valueOf(numsLineParts[1]);\n solution = new Solution(dimensions);\n for (int j = 0; j < numOperations; j++) {\n String line = ob.nextLine();\n String[] lineParts = line.split(\" \");\n if (lineParts[0].equals(\"UPDATE\")) {\n solution.update(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4]));\n }\n if (lineParts[0].equals(\"QUERY\")) {\n solution.query(Integer.valueOf(lineParts[1])-1, Integer.valueOf(lineParts[2])-1, Integer.valueOf(lineParts[3])-1, Integer.valueOf(lineParts[4])-1, Integer.valueOf(lineParts[5])-1, Integer.valueOf(lineParts[6])-1);\n }\n }\n }\n }",
"public static void main(final String[] args) {\n // instantiate this set\n Set s = new Set();\n // code to read the test cases input file\n Scanner stdin = new Scanner(new BufferedInputStream(System.in));\n // check if there is one more line to process\n while (stdin.hasNext()) {\n // read the line\n String line = stdin.nextLine();\n // split the line using space\n String[] tokens = line.split(\" \");\n // based on the list operation invoke the corresponding method\n switch (tokens[0]) {\n case \"size\":\n System.out.println(s.size());\n break;\n case \"contains\":\n System.out.println(s.contains(Integer.parseInt(tokens[1])));\n break;\n case \"print\":\n System.out.println(s);\n break;\n case \"add\":\n int[] intArray = intArray(tokens[1]);\n if (intArray.length == 1) {\n s.add(intArray[0]);\n } else {\n s.add(intArray);\n }\n break;\n case \"intersection\":\n s = new Set();\n Set t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(s.intersection(t));\n break;\n case \"retainAll\":\n s = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n System.out.println(s.retainAll(intArray));\n break;\n case \"cartesianProduct\":\n s = new Set();\n t = new Set();\n intArray = intArray(tokens[1]);\n s.add(intArray);\n intArray = intArray(tokens[2]);\n t.add(intArray);\n System.out.println(Arrays.deepToString(s.cartesianProduct(t)));\n break;\n default:\n break;\n }\n }\n }",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\t\t\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\tN = Integer.parseInt(st.nextToken());\n\t\tM = Integer.parseInt(st.nextToken());\n\t\t\n\t\tcon = new ArrayList[N+1]; conW = new ArrayList[N+1];\n\t\tD = new long[N+1];\n\t\tfor(int i =1;i<=N;i++ ){\n\t\t\tcon[i] = new ArrayList<>();\n\t\t\tconW[i] = new ArrayList<>();\n\t\t\tD [i] = Long.MAX_VALUE;\n\t\t}\n\t\t\n\t\tfor(int i=1;i<=M;i++){\n\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\tint c = Integer.parseInt(st.nextToken());\n\t\t\tcon[a].add(b); \n\t\t\tconW[a].add(c); \n\t\t}\n\n\t\tD[1] = 0;\n\t\tfor(int i=1;i<=N;i++){\n\t\t\tif(D[i] < Long.MAX_VALUE){\n\t\t\t\tfor (int j=0;j<con[i].size();j++){\n\t\t\t\t\tint k = con[i].get(j);//i->k\n\t\t\t\t\tint w = conW[i].get(j);//i->k까지 가는데 cost\n\t\t\t\t\tD[k] = Math.min(D[k], D[i]+w);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(D[N] < Long.MAX_VALUE ? D[N] : -1);\n\n\t}",
"@Override\n\tpublic void solve() {\n\t\tlong startTime = System.nanoTime();\n\n\t\twhile(!unvisitedPM.isEmpty()){\n\t\t\tProblemModel current = findCheapestNode();\n\t\n\t\t\tfor(ProblemModel pm : current.getSubNodes()){\n\t\t\n\t\t\t\tif(!visited.contains(pm) && !unvisitedPM.contains(pm)){\n\t\t\t\t\t\n\t\t\t\t\tunvisitedPM.add(pm);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(current.getSideStart().isEmpty()){\n\t\t\t\tSystem.out.print( \"\\n\"+ \"StartSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideStart()){\n\t\t\t\t\tSystem.out.print( \" \" +r) ;\n\t\t\t\t}\n\t\t\t\tSystem.out.print( \"\\n\" + \"EndSide Runners: \");\n\t\t\t\tfor(Integer r: current.getSideEnd()){\n\t\t\t\t\tSystem.out.print( \" \" + r);\n\t\t\t\t}\n\n\t\t\t\tprintPathTaken(current);\n\t\t\t\tSystem.out.print( \"\\n\" + \"------------done--------------\");\n\t\t\t\tlong endTime = System.nanoTime();\n\t\t\t\tlong duration = ((endTime - startTime)/1000000);\n\t\t\t\tSystem.out.print( \"\\n\" + \"-AS1 Time taken: \" + duration + \"ms\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tvisited.add(current);\n\t\t\n\t\t}\n\t\t\n\n\t}",
"private void run() throws Exception {\n int t = sc.nextInt();\n sc.nextLine();\n\n for (int i = 1; i <= t; i++) {\n out.print(\"Case #\" + i + \": \");\n String line = sc.nextLine();\n\n StringTokenizer st = new StringTokenizer(line, \" \");\n String Sstr = st.nextToken();\n\n int K = Integer.parseInt(st.nextToken());\n\n BitSet S = new BitSet(Sstr.length());\n for(int j=0; j<Sstr.length(); ++j){\n if(Sstr.charAt(j) == '+')\n S.set(j);\n else\n S.clear(j);\n }\n\n solveBig(S, K, Sstr.length());\n }\n sc.close();\n out.close();\n }",
"public Set<Set<Integer>> calculate(Set<Integer> originalSet)\n\t{\n\t\tvalidateInputSet(originalSet);\n\n\t\tSet<Set<Integer>> sets = new HashSet<Set<Integer>>();\n\t\t//Base class returns the empty set.\n\t\tif (originalSet.isEmpty())\n\t\t{\n\t\t\tsets.add(new HashSet<Integer>());\n\t\t\treturn sets;\n\t\t}\n\t\t//Take the first element in head.\n\t\tList<Integer> list = new ArrayList<Integer>(originalSet);\n\t\tInteger head = list.get(0);\n\t\t//Generate a hash set without the first element\n\t\tSet<Integer> rest = new HashSet<Integer>(list.subList(1, list.size()));\n\t\t//Recursive call to iterate over every combination generated with the rest list.\n\t\tfor (Set<Integer> set : calculate(rest))\n\t\t{\n\t\t\t//Add every element and the head, the old set and the new set.\n\t\t\tSet<Integer> newSet = new HashSet<Integer>();\n\t\t\tnewSet.add(head);\n\t\t\tnewSet.addAll(set);\n\t\t\tsets.add(newSet);\n\t\t\tsets.add(set);\n\t\t}\n\t\treturn sets;\n\t}",
"private String getSolution(String dayColum, String MxTColum, String MnTColum, ArrayList<String[]> dataset) {\n\t\tint line = -1; // the number of the row, which has Small Temperature Spread\n\t\tint mxt = -1; // the number of the column, which is mxt\n\t\tint mnt = -1; // the number of the column, which is mnt\n\t\tint day = -1; // the number of the column, which is mnt\n\t\tif (dataset.size() == 0)\n\t\t\treturn String.valueOf(-1);\n\t\tfor (int i = 0; i < dataset.get(0).length; i++) {\n\t\t\tif (dataset.get(0)[i].equals(MxTColum))\n\t\t\t\tmxt = i;\n\t\t\tif (dataset.get(0)[i].equals(MnTColum))\n\t\t\t\tmnt = i;\n\t\t\tif (dataset.get(0)[i].equals(dayColum))\n\t\t\t\tday = i;\n\t\t}\n\t\tif ((mxt == -1) || (mnt == -1) || (day == -1)) \n\t\t\treturn String.valueOf(-1);\n\t\tfloat min = Float.MAX_VALUE;\n\t\tfor (int i = 1; i < dataset.size(); i++) {\n\t\t\ttry {\n\t\t\t\tfloat mnt_value = Float.parseFloat(dataset.get(i)[mnt]);\n\t\t\t\tfloat mxt_value = Float.parseFloat(dataset.get(i)[mxt]);\n\t\t\t\tif (min > Math.abs(mnt_value - mxt_value)) {\n\t\t\t\t\tmin = Math.abs(mnt_value - mxt_value);\n\t\t\t\t\tline = i;\n\t\t\t\t}\n\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// System.out.println(mnt+\" \"+mxt+\" \"+line);\n\t\treturn String.valueOf(dataset.get(line)[day]);\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString input = in.readLine();\r\n\t\tString[] temp = new String[3];\r\n\t\tInteger[] stats = new Integer[3];\r\n\t\ttemp = input.split(\" \");\r\n\t\tstats[0] = Integer.parseInt(temp[0]);\r\n\t\tstats[1] = Integer.parseInt(temp[1]);\r\n\t\tstats[2] = Integer.parseInt(temp[2]);\r\n\t\tint numberofholds = stats[0];\r\n\t\tint[] H = new int[stats[0] + 1];\r\n\t\tH[0] = 0;\r\n\t\tboolean possible = true;\r\n\t\tint M = stats[1];\r\n\t\tint E = stats[2];\r\n\t\tint distance;\r\n\t\tfor (int i = 1; i < numberofholds + 1; i++) {\r\n\t\t\tH[i] = Integer.parseInt(in.readLine());\r\n\t\t}\r\n\t\tfor (int i = 0; i < numberofholds; i++) {\r\n\t\t\tdistance = H[i + 1] - H[i];\r\n\t\t\tif (distance > M) {\r\n\t\t\t\tif (E > 0) {\r\n\t\t\t\t\tif (distance > M * 2) {\r\n\t\t\t\t\t\tpossible = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tE--;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpossible = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (possible) {\r\n\t\t\tSystem.out.println(\"Too easy!\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Unfair!\");\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n n = in.nextInt();\n m = in.nextLong();\n initFactorSets();\n long total = 0;\n\n boolean add = true;\n for (ArrayList<Integer> factorSet : factorSets) {\n for (int factor : factorSet) {\n if (add) {\n total += m / factor;\n } else {\n total -= m / factor;\n }\n }\n add = !add;\n }\n System.out.println(total);\n }",
"public static void parametrik(Matriks M) {\r\n\t\t// KAMUS LOKAL\r\n\t\tchar[] varAlp = new char[10];\r\n\t\tint unusedAlpIdx = 0;\r\n\t\tchar[] valOfVar = new char[M.KolEff];\r\n\t\tdouble[] numOfVar = new double[M.KolEff];\r\n\r\n\r\n\t\t// ALGORITMA\r\n\t\tvarAlp[0] = 'q';\r\n\t\tvalOfVar[0] = 'A';\r\n\t\tnumOfVar[0] = -12345;\r\n\r\n\t\tfor (int i=1; i<varAlp.length; i++) {\r\n\t\t\tvarAlp[i] = (char) (varAlp[0]+1);\r\n\r\n\t\t\tif (i < M.KolEff-1) {\r\n\t\t\t\tvalOfVar[i] = 'A';\r\n\t\t\t\tnumOfVar[i] = -12345;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvalOfVar[M.KolEff-1] = 'B';\r\n\r\n\r\n\t\tfor (int i=0; i<M.BrsEff - 1; i++) {\r\n\t\t\tint firstIdx = 0;\r\n\r\n\t\t\tboolean foundFirst1 = false;\r\n\t\t\tboolean foundSecond = false;\r\n\r\n\t\t\tfor (int j=0; j<M.KolEff - 1; j++) {\r\n\t\t\t\tif(M.Elmt[i][j] != 0) {\r\n\t\t\t\t\tif (!foundFirst1) {\r\n\t\t\t\t\t\tfoundFirst1 = true;\r\n\t\t\t\t\t\tfirstIdx = j;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\tvalOfVar[j] = varAlp[unusedAlpIdx];\r\n\t\t\t\t\t\t\tunusedAlpIdx++;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfoundSecond = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!foundSecond && foundFirst1) {\r\n\t\t\t\tnumOfVar[firstIdx] = M.Elmt[i][M.KolEff-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i=0; i<M.BrsEff; i=i+1) {\r\n\t\t\tint firstIdx = 0;\r\n\r\n\t\t\tboolean foundFirst1 = false;\r\n\t\t\tboolean foundSecond = false;\r\n\r\n\t\t\tfor (int j=0; j<M.KolEff; j=j+1) {\r\n\r\n\t\t\t\tif (M.Elmt[i][j] != 0) {\r\n\r\n\t\t\t\t\tif ((!foundFirst1) && (j != M.KolEff-1)) {\r\n\t\t\t\t\t\tfoundFirst1 = true;\r\n\t\t\t\t\t\tSystem.out.printf(\"x%d = \", j);\r\n\t\t\t\t\t\tfirstIdx = j;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\tif (!foundSecond) {\r\n\r\n\t\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\"%.2f \", -(M.Elmt[i][j] * numOfVar[j]));\r\n\t\t\t\t\t\t\t\tfoundSecond = true;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (valOfVar[j] == 'B') {\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tSystem.out.printf(\"%.2f%c \", -M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\tfoundSecond = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\tif (valOfVar[j] == 'A') {\r\n\t\t\t\t\t\t\t\tdouble value = M.Elmt[i][j] * numOfVar[j];\r\n\r\n\t\t\t\t\t\t\t\tif (value < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f \", -value);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f \", value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (valOfVar[j] == 'B') {\r\n\r\n\t\t\t\t\t\t\t\tif (M.Elmt[i][j] < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f \", -M.Elmt[i][j]);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f \", M.Elmt[i][j]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\tif (M.Elmt[i][j] < 0) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"+ %.2f%c \", -M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tSystem.out.printf(\"- %.2f%c \", M.Elmt[i][j], valOfVar[j]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!foundSecond && foundFirst1) {\r\n\t\t\t\tSystem.out.printf(\"%.2f \", numOfVar[firstIdx]);\r\n\t\t\t}\r\n\r\n\t\t\tif (foundFirst1) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int j=0; j<valOfVar.length; j++) {\r\n\r\n\t\t\tif ((valOfVar[j] != 'A') && (valOfVar[j] != 'B')) {\r\n\t\t\t\tSystem.out.printf(\"x%d = %c\", j, valOfVar[j]);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}",
"private int optimize() {\n\t\t// items: Items sorted by value-to-weight ratio for linear relaxation\n\t\t// t: the decision vector being tested at each node\n\t\t// ws, vs, is, bs: stacks of weight, value, item id, whether bring item\n\t\t// p: stack pointer; i, b, weight, value: loop caches; best: max search\n\t\t// ss: stack size: Always <=2 children on stack for <=n-1 parents\n\t\tItem[] items = new Item[n];\n\t\tint ss = 2 * n;\n\t\tint[] itemsSorted = new int[n], t = new int[n], ws = new int[ss],\n\t\t\tvs = new int[ss], is = new int[ss], bs = new int[ss];\n\t\tint i, b, weight, value, best = 0, p = 0;\n\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titems[j] = new Item(j);\n\t\tArrays.sort(items);\n\t\tfor (int j = 0; j < n; j++)\n\t\t\titemsSorted[j] = items[j].i();\n\t\titems = null; // For garbage collection.\n\n\t\t// Push item 0 onto the stack with and without bringing it.\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 1; p++;\n\t\tws[p] = 0; vs[p] = 0; is[p] = 0; bs[p] = 0; p++;\n\n\t\twhile (p > 0) {\n\t\t\tp--; // Pop the latest item off the stack\n\t\t\ti = is[p]; b = bs[p];\n\t\t\tweight = ws[p] + w[i] * b;\n\t\t\tif (weight > k)\n\t\t\t\tcontinue;\n\t\t\tvalue = vs[p] + v[i] * b;\n\t\t\tif (bound(i, weight, value, itemsSorted) < best)\n\t\t\t\tcontinue;\n\t\t\tbest = Math.max(value, best);\n\t\t\tt[i] = b;\n\t\t\tif (i < n - 1) { // Push children onto stack w/ & w/o bringing item\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 1; p++;\n\t\t\t\tws[p] = weight; vs[p] = value; is[p] = i + 1; bs[p] = 0; p++;\n\t\t\t}\n\t\t\telse if (value >= best)\n\t\t\t\tSystem.arraycopy(t, 0, x, 0, n);\n\t\t}\n\t\treturn best;\n\t}",
"public void solveSA() {\r\n initState();\r\n for (int ab = 0; ab < Config.NumberOfMetropolisResets; ab++) {\r\n LogTool.print(\"==================== INACTIVE: START CALC FOR OUTER ROUND \" + ab + \"=========================\",\"notification\");\r\n\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\");\r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n setCur_cost(costCURsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"CUR COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n /* [Newstate] with random dwelltimes */\r\n New_state = newstater(); \r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW STATE \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n// newstater();\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New State before Metropolis: A)\" + New_state[0] + \" B) \" + New_state[1] + \" C) \" + New_state[2],\"notification\");\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal()); //One of four possible costNEX variants\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n //</editor-fold>\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"SolveSA: New Cost : \" + New_cost,\"notification\");\r\n }\r\n\r\n /**\r\n * MetropolisLoop\r\n * @param Config.NumberOfMetropolisRounds\r\n */\r\n\r\n for(int x=0;x<Config.NumberOfMetropolisRounds;x++) { \r\n LogTool.print(\"SolveSA Iteration \" + x + \" Curcost \" + Cur_cost + \" Newcost \" + New_cost,\"notification\");\r\n if ((Cur_cost - New_cost)>0) { // ? die Kosten\r\n \r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 START\",\"notification\");\r\n }\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA Cost delta \" + (Cur_cost - New_cost) + \" \",\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n if (Config.SAverboselvl>1) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set) Metropolis CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: (Fall 1 nach set): CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C1 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C1 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 1 STOP \",\"notification\");\r\n }\r\n } else if (Math.exp(-(New_cost - Cur_cost)/temperature)> RandGenerator.randDouble(0.01, 0.99)) {\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 START: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 before set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 before set: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n Cur_state = New_state;\r\n Cur_cost = New_cost;\r\n \r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after set: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after set: CurCost : \" + this.getCur_cost(),\"notification\");\r\n //</editor-fold>\r\n }\r\n New_state = newstater();\r\n if (Config.SAdebug) {\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA C2 after generate: NewCost : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurCost : \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: NewState : \" + this.getNew_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA C2 after generate: CurState : \" + this.getCur_state_string(),\"notification\");\r\n //</editor-fold>\r\n }\r\n if (Config.SAverboselvl>1) {\r\n LogTool.print(\"Fall 2 STOP: Zufallsgenerierter Zustand traegt hoehere Kosten als vorhergehender Zustand. Iteration: \" + x,\"notification\");\r\n }\r\n } else {\r\n New_state = newstater();\r\n }\r\n temperature = temperature-1;\r\n if (temperature==0) {\r\n break;\r\n }\r\n \r\n setNew_cost(costNEXsuperfinal());\r\n LogTool.print(\"NEW COST SUPER FINAL \",\"notification\");\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"My custom code folding\">\r\n LogTool.print(\"SolveSA: Cur_State Read before Metropolis : A)\" + Cur_state[0] + \" B) \" + Cur_state[1] + \" C) \" + Cur_state[2],\"notification\");\r\n LogTool.print(\"Debug: GLS get before loop only once each reset: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"Debug: GLC_field get before loop only once each reset: \" + Cur_cost,\"notification\"); \r\n LogTool.print(\"Debug: GLC_getter get before loop only once each reset: \" + this.getCur_cost(),\"notification\");\r\n LogTool.print(\"Debug: NXC_field get before loop only once each reset: \" + New_cost,\"notification\");\r\n LogTool.print(\"Debug: NXC_getter get before loop only once each reset: \" + this.getNew_cost(),\"notification\");\r\n//</editor-fold>\r\n if ((x==58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n if ((Cur_cost - New_cost)>0) {\r\n Cur_state = New_state;\r\n Cur_cost = New_cost; \r\n }\r\n }\r\n if ((x>58)&(ab==0)) {\r\n LogTool.print(\"Last internal Iteration Checkpoint\",\"notification\");\r\n }\r\n }\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Auskommentierter GLowestState Object Class\">\r\n// if (ab==9) {\r\n// double diff=0;\r\n// }\r\n \r\n // Hier wird kontrolliert, ob das minimalergebnis des aktuellen\r\n // Metropolisloops kleiner ist als das bsiher kleinste\r\n \r\n// if (Cur_cost<Global_lowest_cost) {\r\n// this.setGlobal_lowest_cost(Cur_cost);\r\n// GlobalState GLowestState = new GlobalState(this.Cur_state);\r\n// String rGLSOvalue = GLowestState.getGlobal_Lowest_state_string();\r\n// LogTool.print(\"GLS DEDICATED OBJECT STATE OUTPUT -- \" + GLowestState.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(GLowestState.getDwelltimes());\r\n // LogTool.print(\"READ FROM OBJECT OUTPUT -- \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// LogTool.print(\"DEBUG: CurCost direct : \" + this.getCur_cost(),\"notification\"); \r\n// LogTool.print(\"Debug: Cur<global CurState get : \" + this.getCur_state_string(),\"notification\");\r\n// LogTool.print(\"Debug: Cur<global GLS get : \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n// this.setGlobal_Lowest_state(this.getCur_state(Cur_state));\r\n// LogTool.print(\"Debug: Cur<global GLS get after set : \" + this.getGlobal_Lowest_state_string(),\"notification\"); \r\n// }\r\n //</editor-fold>\r\n LogTool.print(\"SolveSA: Outer Iteration : \" + ab,\"notification\");\r\n LogTool.print(\"SolveSA: Last Calculated New State/Possible state inner loop (i.e. 99) : \" + this.getNew_state_string(),\"notification\");\r\n// LogTool.print(\"SolveSA: Best Solution : \" + this.getCur_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: GLS after all loops: \" + this.getGlobal_Lowest_state_string(),\"notification\");\r\n LogTool.print(\"SolveSA: LastNewCost, unchecked : \" + this.getNew_cost(),\"notification\");\r\n LogTool.print(\"SolveSA: CurCost : \" + this.getCur_cost() + \"i.e. lowest State of this round\",\"notification\"); \r\n }\r\n // return GLowestState;\r\n }",
"public void solve() {\n /** To solve the traveling salesman problem:\n * Set up the graph, choose a starting node, then call the recursive backtracking method and pass it the starting node.\n */\n\n // We need to pass a starting node to recursive backtracking method\n Node startNode = null;\n\n // Grab a node, any node...\n for( Node n : graph.nodes() ) {\n startNode = n;\n break;\n }\n\n // Visit the first node\n startNode.visit();\n\n // Add first node to the route\n this.route[0] = startNode;\n\n // Pass the number of choices made\n int nchoices = 1;\n\n // Recursive backtracking\n explore(startNode, nchoices );\n\n\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }",
"public static double[] solve(double[][] matrix, double[] vector) {\r\n // Merken der Spalte, welche eine Zahl ungleich null besitzt\r\n int tmpColumn = -1;\r\n\r\n // Alle Zeilen durchgehen: Ziel der for-Schleife -> Matrix in\r\n // Zeilenstufenform bringen!\r\n // -> Alle Zahlen unterhalb der Diagonale sind null\r\n for (int line = 0; line < matrix.length; line++) {\r\n\r\n tmpColumn = -1;\r\n\r\n // Umformungsschritt 1: Finden einer Spalte mit einem Wert ungleich null\r\n for (int column = 0; column < matrix[line].length; column++) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n if (matrix[row][column] != 0) {\r\n tmpColumn = column;\r\n break;\r\n }\r\n }\r\n\r\n // Abbruch, zahl ungleich null wurde gefunden\r\n if (tmpColumn != -1) {\r\n break;\r\n }\r\n }\r\n\r\n // NullZeile(n) entdeckt!\r\n if (tmpColumn == -1) {\r\n\r\n for (int row = line; row < matrix.length; row++) {\r\n\r\n // Gleichungssystem hat keine Loesung!\r\n if (vector[line] != 0) {\r\n System.out.println(\"Gleichungssystem besitzt keine Loesung!\");\r\n return null;\r\n }\r\n }\r\n // Nullzeile(n) vorhanden -> Ist das System noch eindeutig loesbar?\r\n if (matrix[0].length - 1 >= line) {\r\n // System nicht eindeutig loesbar.\r\n System.out.println(\"Gleichungssystem nicht eindeutig loesbar!\");\r\n return null;\r\n }\r\n break;\r\n }\r\n\r\n // Umformungsschritt 2: Die Zahl matrix[line][tmpColumn] soll UNgleich\r\n // null sein\r\n if (matrix[line][tmpColumn] == 0) {\r\n\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n\r\n if (matrix[row][tmpColumn] != 0) {\r\n // Vertauschen von Zeilen -> matrix[line][tmpColumn] wird dann\r\n // ungleich null\r\n swapTwoLines(line, row, matrix, vector);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Umformungsschritt 3: matrix[line][tmpColumn] soll gleich 1 sein.\r\n if (matrix[line][tmpColumn] != 0) {\r\n\r\n // Division der Zeile mit matrix[line][tmpColumn]\r\n divideLine(line, matrix[line][tmpColumn], matrix, vector);\r\n }\r\n\r\n // Umformungsschritt 4: Alle Zahlen unter matrix[line][tmpColumn] sollen\r\n // null sein.\r\n for (int row = line + 1; row < matrix.length; row++) {\r\n // Subtraktion damit unter der Zahl im Umformungsschritt 3 nur nullen\r\n // stehen\r\n removeRowLeadingNumber(matrix[row][tmpColumn], line, row, matrix,\r\n vector);\r\n }\r\n }\r\n\r\n // Umformungsschritt 6: Matrix in Normalform bringen (Zahlen oberhalb der\r\n // Diagonale werden ebenfalls zu null)\r\n for (int column = matrix[0].length - 1; column > 0; column--) {\r\n\r\n // Alle Werte oberhalb von \"column\" werden zu null\r\n for (int row = column; row > 0; row--) {\r\n\r\n // Dazu wird Subtraktion angewandt\r\n removeRowLeadingNumber(matrix[row - 1][column], column, row - 1,\r\n matrix, vector);\r\n }\r\n }\r\n\r\n // Unser ehemaliger Loesungsvektor ist jetzt zu unserem Zielvektor geworden\r\n // :)\r\n return vector;\r\n }",
"public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tout = new PrintWriter(System.out);\r\n\t\tsc = new StringTokenizer(\"\");\r\n\t\tn = nxtInt();\r\n\t\tm = nxtInt();\r\n\t\tc0 = nxtInt();\r\n\t\td0 = nxtInt();\r\n\t\ta = new int[m];\r\n\t\tb = new int[m];\r\n\t\tc = new int[m];\r\n\t\td = new int[m];\r\n\t\tdp = new long[m+2][101][n+1];\r\n\t\tfor(long[][]ar:dp)\r\n\t\t\tfor(long[]arr:ar)\r\n\t\t\t\tArrays.fill(arr, -1);\r\n\t\tint i = 0;\r\n\t\twhile(i < m){\r\n\t\t\ta[i]= nxtInt();\r\n\t\t\tb[i]= nxtInt();\r\n\t\t\tc[i]= nxtInt();\r\n\t\t\td[i]= nxtInt();\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tSystem.out.println(maxVal(0, n, a[0]));\r\n\r\n\t}",
"public void splMatriksBalikan() {\n Matriks MKoef = this.Koefisien();\n Matriks MKons = this.Konstanta();\n\n if(!MKoef.IsPersegi()) {\n System.out.println(\"Matriks koefisien bukan matriks persegi, sehingga tidak dapat diselesaikan dengan metode matriks balikan.\");\n this.Solusi = \"Matriks koefisien bukan matriks persegi, sehingga tidak dapat diselesaikan dengan metode matriks balikan.\";\n } else {\n float det = MKoef.DeterminanKofaktor();\n if (det == 0) {\n System.out.println(\"Determinan matriks koefisien bernilai 0, sehingga tidak dapat diselesaikan dengan metode matriks balikan.\");\n this.Solusi = \"Determinan matriks koefisien bernilai 0, sehingga tidak dapat diselesaikan dengan metode matriks balikan.\";\n } else {\n Matriks MBalikan = MKoef.BuatMatriksBalikan();\n Matriks MHsl = MBalikan.KaliMatriks(MKons);\n\n for (int i = 0; i < MHsl.NBrsEff; i++) {\n System.out.println(\"x\" + (i+1) + \" = \" + MHsl.M[i][0]);\n this.Solusi += \"x\" + (i+1) + \" = \" + MHsl.M[i][0] + \"\\n\";\n }\n }\n }\n }",
"private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}",
"public static int dynamicProgrammingMin(List<List<Integer>> R) {\r\n\t\tif(R.isEmpty()) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t// declare\r\n\t\tList<Integer> result = new ArrayList<Integer>();\r\n\t\tList<Integer> sequence = new ArrayList<Integer>();\r\n\t\tint n = R.size();\r\n\t\t\r\n\t\t// initialize (BC)\r\n\t\tif(n >= 1) {\r\n\t\t\tresult.add(0);\r\n\t\t\tsequence.add(0);\r\n\t\t}\r\n\t\tif(n >= 2) {\r\n\t\t\tresult.add(R.get(0).get(1));\r\n\t\t\tsequence.add(1);\r\n\t\t}\r\n\t\t\r\n\t\t// iterate (RC)\r\n\t\tfor(int row = 3; row <= n; row++) {\r\n\t\t\tint curr = R.get(row - 2).get(row - 1);\r\n\t\t\tint prevSolutionPlusCurr = result.get(row - 2) + curr;\r\n\t\t\t\r\n\t\t\tint lastColMin = INFINITY;\r\n\t\t\tint selected = INFINITY;\r\n\t\t\tfor(int k = 0; k < row - 2; k++) {\r\n\t\t\t\tint thisColValue = result.get(k) + R.get(k).get(row - 1);\r\n\t\t\t\tlastColMin = min(thisColValue, lastColMin);\r\n\t\t\t\t\r\n\t\t\t\tif(lastColMin == thisColValue) {\r\n\t\t\t\t\tselected = k;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint min = min(prevSolutionPlusCurr, lastColMin);\r\n\t\t\tresult.add(min);\r\n\t\t\t\r\n\t\t\tif(result.get(row - 1) == prevSolutionPlusCurr) {\r\n\t\t\t\tsequence.add(row - 2);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsequence.add(selected);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(dynamicProgrammingRecover(sequence));\r\n\t\treturn result.get(n - 1);\r\n\t}",
"private String solve(String inputData) {\n\t\tScanner in = new Scanner(inputData);\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tint testCases = in.nextInt();\n\t\tfor (int i = 1; i <= testCases; ++i) {\n\t\t\tsb.append(\"Case #\" + i + \": \");\n\t\t\t\n\t\t\tint googlers = in.nextInt();\n\t\t\tint surprisingCase = in.nextInt();\n\t\t\tint target = in.nextInt();\n\t\t\tArrayList<Integer> scores = new ArrayList<Integer>();\n\t\t\tfor (int j = 0; j < googlers; ++j) {\n\t\t\t\tscores.add(in.nextInt());\n\t\t\t}\n\t\t\t\n\t\t\tint accepted = 0;\n\t\t\tint acceptLine = Math.max(target, target * 3 - 2);\n\t\t\tint limited = 0;\n\t\t\tint limitLine = Math.max(target, target * 3 - 4);\n\t\t\tfor (Integer score : scores) {\n\t\t\t\tif (score >= acceptLine) {\n\t\t\t\t\t++accepted;\n\t\t\t\t}\n\t\t\t\telse if (score >= limitLine) {\n\t\t\t\t\t++limited;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint result = accepted + Math.min(surprisingCase, limited);\n\t\t\tsb.append(result);\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static void main(String[] args) {\n\r\n\t\tScanner cin = new Scanner(System.in);\r\n\t\twhile (cin.hasNext()) {\r\n\t\t\tHashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\r\n\t\t\tVector<Integer> vec = new Vector<Integer>();\r\n\t\t\tint n = cin.nextInt();\r\n\t\t\tint m = cin.nextInt();\r\n\r\n\t\t\tfor (int i = 1; i <= n; i++)\r\n\t\t\t\thm.put(i, i);\r\n\r\n\t\t\tfor (int i = 0; i < m; i++) {\r\n\t\t\t\tint a = cin.nextInt();\r\n\t\t\t\tint b = cin.nextInt();\r\n\t\t\t\tif (hm.get(a) == a && hm.get(b) == b) {\r\n\t\t\t\t\thm.put(a, Math.min(a, b));// TODO\r\n\t\t\t\t\thm.put(b, Math.min(a, b));// TODO\r\n\t\t\t\t}\r\n\t\t\t\tif (hm.get(a) != a && hm.get(b) == b)\r\n\t\t\t\t\thm.put(b, hm.get(a));\r\n\t\t\t\tif (hm.get(a) == a && hm.get(b) != b)\r\n\t\t\t\t\thm.put(a, hm.get(b));\r\n\t\t\t}\r\n\t\t\t// System.out.println(hm.keySet());\r\n\t\t\t// System.out.println(hm.values());\r\n\r\n\t\t\tfor (int i = 1; i <= n; i++)\r\n\t\t\t\tif (!vec.contains(hm.get(i)))\r\n\t\t\t\t\tvec.add(hm.get(i));\r\n\t\t\tSystem.out.println(vec.size());\r\n\r\n\t\t}\r\n\r\n\t}",
"public static void main(String args[]) throws Exception {\n BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));\n StringBuilder sb=new StringBuilder();\n int t=Integer.parseInt(bu.readLine());\n int m[]=new int[10],i;\n m[0]=9;\n for(i=1;i<10;i++)\n m[i]=m[i-1]*10;\n\n while(t-->0)\n {\n int n=Integer.parseInt(bu.readLine());\n long ans=0; int sum=0,x=0;\n while(true)\n {\n if(sum+m[x]<=n)\n {\n ans+=1l*(x+1)*m[x];\n sum+=m[x];\n x++;\n }\n else break;\n }\n ans+=1l*(x+1)*(n-sum);\n sb.append(ans+\"\\n\");\n }\n System.out.print(sb);\n }",
"@SuppressWarnings(\"Main Logic\")\n void solve() {\n n = ii();\n m = ii();\n a = iia(n);\n int from[] = new int[n - 1];\n int to[] = new int[n - 1];\n for (int i = 0; i < n - 1; i++) {\n from[i] = ii() - 1;\n to[i] = ii() - 1;\n }\n g = packU(n, from, to, n - 1);\n int[][] pars = parents3(g, 0);\n par = pars[0];\n int[] ord = pars[1];\n dep = pars[2];\n spar = logstepParents(par);\n subTree = new int[n];\n dfs(0, -1);\n pointer = 1;\n baseArray = new int[n + 1];\n chainNo = 0;\n chainInHead = new int[n];\n Arrays.fill(chainInHead, -1);\n posInBase = new int[n];\n chainInInd = new int[n];\n HLD(0, -1);\n makeTree();\n out.println(Arrays.toString(baseArray));\n out.println(Arrays.toString(a));\n for (int q = 0; q < m; q++) {\n int type = ii();\n if (type == 1) {\n int u = ii() - 1, v = ii() - 1;\n query(u, v);\n out.println(\"DONE\");\n } else {\n int u = ii(), v = ii();\n // update\n }\n }\n }",
"public static void knapsackDynamicProgramming(objects[] items, int capacity, int n) \r\n { \r\n\t\t//use bubble sort to sort item by their weight\t\t\t\t\r\n\t\tfor (int i = 0; i < n-1; i++) \t\t\t\t\r\n\t\t{ \t\t \r\n\t\t\tfor (int j = 0; j < (n-i-1); j++) \t\t \r\n\t\t\t{\t\t \r\n\t\t\t\tif (items[j].weight < items[j+1].weight) \t\t \r\n\t\t\t\t{ \t\t \t\r\n\t\t\t\t\tobjects temp = items[j]; \t\t \r\n\t\t\t\t\titems[j] = items[j+1]; \t\t \r\n\t\t\t\t\titems[j+1] = temp; \t\t \t\t\t\t\t\r\n\t\t\t\t}\t\t \r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\t\r\n \tif(n <= 0 || capacity <= 0)\r\n \t{\r\n \t\tSystem.out.print(\"Error capacity and object numbers can't be 0\");\r\n \t}\r\n \r\n \tint matrixTable[][] = new int[n+1][capacity+1]; \r\n \r\n \tfor (int i = 0; i <= n; i++) \r\n \t{ \r\n \t\tfor (int j = 0; j <= capacity; j++) \r\n \t\t{ \r\n \t\t\t//Preset row 0 value and column value to 0\r\n \t\t\tif (i==0 || j==0) \r\n \t {\r\n \t\t\t\tmatrixTable[i][j] = 0; \r\n \t }\r\n \r\n \t\t\t//If current row number is greater than current weight number\r\n \t\t\telse if (items[i-1].weight <= j) \r\n \t\t\t{\r\n \t\t\t\t//Compare the top value with top value plus value(use weight as the value to go left)result\r\n \t\t\t\t//and use the greatest value for the current one.\r\n \t\t\t\tmatrixTable[i][j] = Math.max(items[i-1].profit + matrixTable[i-1][j-items[i-1].weight], matrixTable[i-1][j]); \r\n \t\t\t}\r\n \t\t\t//If row number is less than current weight number just use the top value\r\n \t\t\telse \r\n \t\t\t{ \t \r\n \t\t\t\tmatrixTable[i][j] = matrixTable[i-1][j];\r\n \t\t\t}\r\n \t\t} \t\r\n \t} \r\n \t\r\n\t\tint totalProfit = matrixTable[n][capacity]; \t\t\r\n\t\tint temp = matrixTable[n][capacity];\r\n\t\tint [] itemInKnapsack = new int [n];\r\n\t\t\r\n\t\t//solving which item is in the knapsack\r\n for (int i = n; i > 0 && temp > 0; i--) { \r\n \r\n \r\n \tif (temp == matrixTable[i - 1][capacity]) \r\n \t{\r\n continue;\r\n \t}\r\n \t//if the top value is different than it is include in the knapsack\r\n else \r\n { \r\n itemInKnapsack[i-1] = items[i-1].index; //Save item number\r\n temp = temp - items[i - 1].profit; \r\n capacity = capacity - items[i - 1].weight; \r\n } \r\n } \r\n \r\n printResult(itemInKnapsack, totalProfit, 2); //Call print result\r\n }",
"public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tint query = input.nextInt();\n\t\t\n\t\tfor(int i=0;i<query;i++)\n\t\t{\n\t\t\tint n=input.nextInt();\n\t\t\tint m=input.nextInt();\n\t\t\tint[] array=new int[n];\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tarray[j]=input.nextInt();\n\t\t\t}\n\t\t\tSystem.out.println(maxSubArraySum(subsets(array),m));\n\t\t\t\n\t\t}\n\t\t\n\t}",
"int solve() {\n dp[0][0] = 1;\n IntStream.rangeClosed(1, m).forEach(i ->\n IntStream.rangeClosed(0, n).forEach(j ->\n dp[i][j] = j - i >= 0 ?\n (dp[i - 1][j] + dp[i][j - i]) % M :\n dp[i - 1][j]));\n return dp[m][n];\n }",
"public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.print(\"Unesite velicinu n x n matrice: \");\r\n\t\tint n = input.nextInt(); // unos n x n matrice n = broj redova i kolona matrice\r\n\r\n\t\tint[][] matrix = new int[n][n];\r\n\t\tArrayList<Integer> maxR = new ArrayList<>();\r\n\t\tArrayList<Integer> maxK = new ArrayList<>();\r\n\r\n\t\tSystem.out.println(\"Matrica: \");\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\t\tmatrix[i][j] = (int)(Math.random()*2); // punjenje matrice integerima 0 i 1\r\n\t\t\t\tSystem.out.print(matrix[i][j] + \" \"); // ispis matrice u konzolu\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t\tint sumaR = 0, sumaK = 0, totalSumaR, totalSumaK, nula = 0;\r\n\t\t\r\n\t\tfor(int j=0; j<matrix[0].length; j++) {\r\n\t\t\tsumaR += matrix[0][j]; // suma reda matrice\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i=0; i<matrix.length; i++) {\r\n\t\t\tsumaK += matrix[i][0]; // suma kolona matrice\r\n\t\t}\r\n\t\tfor(int i=0; i<matrix.length; i++) { // za sve elemente matrice\r\n\t\t\ttotalSumaR = 0;\r\n\t\t\ttotalSumaK = 0;\r\n\t\t\tfor(int j=0; j<matrix[i].length; j++) {\r\n\t\t\t\ttotalSumaR += matrix[i][j]; // suma svih redova matrice\r\n\t\t\t\ttotalSumaK += matrix[j][i]; // suma svih kolona matrice\r\n\t\t\t\tif(totalSumaR > sumaR) { // ako bilo koji red matrice ima vecu sumu od sume prvog reda matrice\r\n\t\t\t\t\tsumaR = totalSumaR; // taj red postaje red sa najvecom sumom\r\n\t\t\t\t\tmaxR.clear(); // brisu se stare pozicije redova sa najvecom sumom\r\n\t\t\t\t\tmaxR.add(i); // ubacivanje broja indexa reda sa najvecom sumom u listu\t\r\n\t\t\t\t} else if(totalSumaR == sumaR) { // ako je ukupna suma zadnjeg reda jednak najvecoj sumi reda\r\n\t\t\t\t\t//maxR.clear(); brisu se ostale pozicije redova sa najvecom sumom u listi (ako trazimo samo zadnji red sa najvise 1)\r\n\t\t\t\t\tmaxR.add(i); // dodaje se krajnja pozicija najvece sume reda u listi\r\n\t\t\t\t}\r\n\t\t\t\tif(totalSumaK > sumaK) { // ako bilo koja kolona matrice ima vecu sumu od sume prve kolone matrice\r\n\t\t\t\t\tsumaK = totalSumaK; // ta kolona postaje kolona sa najvecom sumom\r\n\t\t\t\t\tmaxK.clear(); // brisu se stare pozicije kolone sa najvecom sumom\r\n\t\t\t\t\tmaxK.add(i); // ubacivanje broja indexa kolone sa najvecom sumom u listu\r\n\t\t\t\t} else if(totalSumaK == sumaK) { // ako je ukupna suma zadnje kolone jednaka najvecoj sumi kolone\r\n\t\t\t\t\t//maxK.clear(); brisu se ostale pozicije kolona sa najvecom sumom u listi (ako trazimo samo zadnju kolonu sa najvise 1)\r\n\t\t\t\t\tmaxK.add(i); // dodaje se krajnja pozicija najvece sume kolone u listi\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(maxR.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxR.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"Redovi sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxR.size(); i++) {\r\n\t\t\tSystem.out.print(maxR.get(i) + \" \"); // ispis pozicija najvece sume redova iz liste\r\n\t\t}\r\n\t\tif(maxK.isEmpty()) { // ako je lista prazna\r\n\t\t\tmaxK.add(nula); // ubaci u listu 0\r\n\t\t}\r\n\t\tSystem.out.print(\"\\nKolone sa najvise jedinica su: \");\r\n\t\tfor(int i=0; i<maxK.size(); i++) {\r\n\t\t\tSystem.out.print(maxK.get(i) + \" \"); // ispis pozicija najvece sume kolona iz liste\r\n\t\t}\r\n\t\t\r\n\t\tinput.close();\r\n\t}",
"public int[] solution(String S, int[] P, int[] Q) {\n int[] menorInt = new int[P.length];\n\n for (int i = 0; i < P.length; i++) {\n\n char menorAtual = 'T';\n\n for (int j = P[i]; j <= Q[i]; j++) {\n char atual = S.charAt(j);\n if (atual < menorAtual) {\n menorAtual = atual;\n if (menorAtual == 'A') {\n break;\n }\n }\n }\n\n switch (menorAtual) {\n case 'A':\n menorInt[i] = 1;\n break;\n case 'C':\n menorInt[i] = 2;\n break;\n case 'G':\n menorInt[i] = 3;\n break;\n case 'T':\n menorInt[i] = 4;\n break;\n }\n\n }\n\n return menorInt;\n\n }",
"public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for (int Q = 0; Q < T; Q++) {\n \tint N = sc.nextInt();\n \tint M = sc.nextInt();\n \tint[][] m = new int[M][3];\n \tfor (int i = 0; i < M; i++) {\n \t\tm[i][0] = sc.nextInt();\n \t\tif (m[i][0] == 1) {\n \t\t\t//合并x和y所在的集合\n \t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tm[i][2] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 2){\n\t\t\t\t\t//将x提出来成立新的集合\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\t\n\t\t\t\t}else if(m[i][0] == 3){\n\t\t\t\t\t//输出x所在集合的正整数个数\n\t\t\t\t\tm[i][1] = sc.nextInt();\n\t\t\t\t\tSystem.out.println(i);\n\t\t\t\t}\n \t}\n }\n\t}",
"public static void main(String[] args) {\n\t\tString OptionChosen = \"\";\n\n\t\tboolean didRankingHappen = false;\n\n\t\tArrayList<School> schoolArrayList = new ArrayList<School>(); // objects\n\n\t\tArrayList<Student> studentArrayList = new ArrayList<Student>();\n\t\tboolean Quit = false;\n\n\t\tint loadedStudents = 0;\n\t\tint loadedSchools = 0;\n\n\t\tSMPSolver GSS = new SMPSolver(studentArrayList, schoolArrayList, true);\n\t\tSMPSolver GSH = new SMPSolver(schoolArrayList, studentArrayList, false);\n\n\t\tdo {\n\t\t\tdisplayMenu();\n\n\t\t\tOptionChosen = getUserInput(\"Enter choice: \");\n\n\t\t\tif (checkUserInput(OptionChosen)) {\n\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"Q\")) {\n\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tSystem.out.println(\"Hasta luego!\");\n\t\t\t\t\tSystem.exit(0);\n\n\t\t\t\t}\n\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"L\")) {\n\n\t\t\t\t\tdidRankingHappen = false;\n\n\t\t\t\t\tstudentArrayList.clear();\n\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tloadedSchools = loadSchools(schoolArrayList);\n\n\t\t\t\t\tloadedStudents = 0;\n\n\t\t\t\t\tloadedStudents = loadStudents(studentArrayList,\n\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t// Loop through and update the school's number of\n\t\t\t\t\t// participants data field real quick\n\t\t\t\t\tfor (int i = 0; i < schoolArrayList.size(); i++) {\n\t\t\t\t\t\tschoolArrayList.get(i).setNParticipants(loadedStudents);\n\t\t\t\t\t}\n\n\t\t\t\t\tdidRankingHappen = assignRankings(studentArrayList,\n\t\t\t\t\t\t\tschoolArrayList, loadedStudents, loadedSchools);\n\t\t\t\t\t// Update participants messes up my matches :(\n\t\t\t\t\tif (loadedSchools != 0 || loadedStudents != 0) {\n\t\t\t\t\t\tGSS.setMatchesExist(false);\n\t\t\t\t\t\tGSH.setMatchesExist(false);\n\t\t\t\t\t\t// updateParticipants( GSS, GSH, studentArrayList,\n\t\t\t\t\t\t// schoolArrayList);\n\t\t\t\t\t\tGSS.clearMatches();\n\t\t\t\t\t\tGSH.clearMatches();\n\t\t\t\t\t\tupdateParticipants(GSS, GSH, studentArrayList,\n\t\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t}\n\t\t\t\t\tfor (int i = 0; i < studentArrayList.size(); i++) {\n\t\t\t\t\t\ttotalNumMatches += studentArrayList.get(i)\n\t\t\t\t\t\t\t\t.getMaxMatches();\n\n\t\t\t\t\t}\n\t\t\t\t\tfor (int j = 0; j < schoolArrayList.size(); j++) {\n\t\t\t\t\t\ttotalNumMatches += schoolArrayList.get(j)\n\t\t\t\t\t\t\t\t.getMaxMatches();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"E\")) {\n\n\t\t\t\t\teditData(studentArrayList, schoolArrayList,\n\t\t\t\t\t\t\tnumStudentsAdded, loadedSchoolsNum,\n\t\t\t\t\t\t\tdidRankingHappen);\n\t\t\t\t\tif (studentArrayList.size() != 0\n\t\t\t\t\t\t\t|| schoolArrayList.size() != 0) {\n\t\t\t\t\t\tupdateParticipants(GSS, GSH, studentArrayList,\n\t\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"M\")) {\n\t\t\t\t\t// didMatchingHappen = false;\n\t\t\t\t\t// clearMatches(studentArray, schoolArray, numStudentsAdded,\n\t\t\t\t\t// loadedSchoolsNum);\n\t\t\t\t\t// didMatchingHappen = match(studentArray, schoolArray,\n\t\t\t\t\t// numStudentsAdded, loadedSchoolsNum, didRankingHappen);\n\n\t\t\t\t\t// Create new SMP solver object\n\n\t\t\t\t\t// boolean canMatchingProceed = GSS.matchingCanProceed();\n\n\t\t\t\t\tlong start = System.currentTimeMillis();\n\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tSystem.out.println(\"STUDENT-OPTIMAL MATCHING\");\n\t\t\t\t\tboolean matchingCanProceed = GSS.matchingCanProceed();\n\t\t\t\t\tif (matchingCanProceed) {\n\t\t\t\t\t\tboolean didMatchingHappen1 = GSS.match();\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\tGSS.print();\n\t\t\t\t\t}\n\t\t\t\t\tlong elapsedTime = System.currentTimeMillis() - start;\n\t\t\t\t\tif (matchingCanProceed) {\n\n\t\t\t\t\t\tSystem.out.println(totalNumMatches\n\t\t\t\t\t\t\t\t+ \" matches made in \" + elapsedTime + \"ms!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t}\n\n\t\t\t\t\tlong start1 = System.currentTimeMillis();\n\n\t\t\t\t\tSystem.out.println(\"SCHOOL-OPTIMAL MATCHING\");\n\n\t\t\t\t\tboolean matchingCanProceed2 = GSH.matchingCanProceed();\n\t\t\t\t\tif (matchingCanProceed2) {\n\t\t\t\t\t\tboolean didMatchingHappen1 = GSH.match();\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\tGSH.print();\n\t\t\t\t\t}\n\t\t\t\t\tlong elapsedTime2 = System.currentTimeMillis() - start;\n\t\t\t\t\tif (matchingCanProceed) {\n\n\t\t\t\t\t\tSystem.out.println(totalNumMatches\n\t\t\t\t\t\t\t\t+ \" matches made in \" + elapsedTime + \"ms!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\tif (studentArrayList.size() != 0\n\t\t\t\t\t\t\t&& schoolArrayList.size() != 0) {\n\t\t\t\t\t\tupdateParticipants(GSS, GSH, studentArrayList,\n\t\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t}\n\n\t\t\t\t\t// didMatchingHappen = GSH.match();\n\t\t\t\t\t// boolean didMatchingHappen2 =\n\n\t\t\t\t}\n\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"P\")) {\n\t\t\t\t\tif (schoolArrayList.size() != 0\n\t\t\t\t\t\t\t&& studentArrayList.size() != 0) {\n\t\t\t\t\t\tif (GSS.matchesExist()) {\n\t\t\t\t\t\t\tcopyAllMatches(GSS, studentArrayList,\n\t\t\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// copyAllMatches(GSH, schoolArrayList,\n\t\t\t\t\t\t// studentArrayList);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (studentArrayList.size() == 0) {\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\tSystem.out.println(\"ERROR: No students are loaded!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprintStudents(studentArrayList, schoolArrayList,\n\t\t\t\t\t\t\t\tloadedStudents, didRankingHappen);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (schoolArrayList.size() == 0) {\n\n\t\t\t\t\t\tSystem.out.println(\"ERROR: No schools are loaded!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprintSchools(studentArrayList, schoolArrayList,\n\t\t\t\t\t\t\t\tloadedSchools, didRankingHappen);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"D\")) {\n\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t// solve.printMatches();\n\t\t\t\t\t// solve.printStats();\n\t\t\t\t\t// System.out.println(\"\");\n\n\t\t\t\t\tSystem.out.println(\"STUDENT-OPTIMAL SOLUTION\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tif (!GSS.matchesExist() || schoolArrayList.size() == 0\n\t\t\t\t\t\t\t|| studentArrayList.size() == 0) {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: No matches exist!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (studentArrayList.size() != 0\n\t\t\t\t\t\t\t\t&& schoolArrayList.size() != 0) {\n\t\t\t\t\t\t\tGSS.printMatches();\n\t\t\t\t\t\t\tGSS.print();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(\"SCHOOL-OPTIMAL SOLUTION\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tif (!GSH.matchesExist() || schoolArrayList.size() == 0\n\t\t\t\t\t\t\t|| studentArrayList.size() == 0) {\n\t\t\t\t\t\tSystem.out.println(\"ERROR: No matches exist!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (studentArrayList.size() != 0\n\t\t\t\t\t\t\t\t&& schoolArrayList.size() != 0) {\n\t\t\t\t\t\t\tGSH.printMatches();\n\t\t\t\t\t\t\tGSH.print();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"x\")) {\n\t\t\t\t\t// do this if matches happened other wise say\n\t\t\t\t\t// \"no! and return\"\n\n\t\t\t\t\tif (GSS.matchesExist() && studentArrayList.size() != 0\n\t\t\t\t\t\t\t&& schoolArrayList.size() != 0) {\n\t\t\t\t\t\tcopyAllMatches(GSS, studentArrayList, schoolArrayList);\n\t\t\t\t\t\tcopyAllMatches(GSH, schoolArrayList, studentArrayList);\n\t\t\t\t\t\tupdateParticipants(GSS, GSH, studentArrayList,\n\t\t\t\t\t\t\t\tschoolArrayList);\n\t\t\t\t\t\tString stabilityWinner = \"\";\n\t\t\t\t\t\tString avgSchoolWinner = \"\";\n\t\t\t\t\t\tString avgStudentWinner = \"\";\n\t\t\t\t\t\tString avgTotalWinner = \"\";\n\t\t\t\t\t\tString timeWinner = \"School-opt\";\n\t\t\t\t\t\tString winner = \"WINNER\";\n\t\t\t\t\t\tif (GSS.getAvgReceiverRegret() < GSH\n\t\t\t\t\t\t\t\t.getAvgSuitorRegret()) {\n\t\t\t\t\t\t\tavgSchoolWinner = \"Student-opt\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tavgSchoolWinner = \"School-opt\";\n\t\t\t\t\t\tif (GSS.getAvgSuitorRegret() < GSH\n\t\t\t\t\t\t\t\t.getAvgReceiverRegret()) {\n\t\t\t\t\t\t\tavgStudentWinner = \"School-opt\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tavgStudentWinner = \"Student-opt\";\n\t\t\t\t\t\tif (GSS.getAvgTotalRegret() < GSH.getAvgTotalRegret()) {\n\t\t\t\t\t\t\tavgTotalWinner = \"Student-opt\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tavgTotalWinner = \"School-opt\";\n\t\t\t\t\t\tif (GSS.isStable() && GSH.isStable()) {\n\t\t\t\t\t\t\tstabilityWinner = \"TIE\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (GSS.isStable() && !GSH.isEveryoneMatched()) {\n\t\t\t\t\t\t\tstabilityWinner = \"School-opt\";\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tstabilityWinner = \"Student-opt\";\n\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"Solution Stable Avg school regret Avg student regret Avg total regret Comp time (ms)\");\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"----------------------------------------------------------------------------------------------------------------\");\n\t\t\t\t\t\tGSS.printStatsRow(\"Student optimal\");\n\t\t\t\t\t\tGSH.printStatsRow(\"School-optimal\");\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"----------------------------------------------------------------------------------------------------------------\");\n\t\t\t\t\t\tSystem.out.format(\"%-15s\", winner);\n\t\t\t\t\t\tSystem.out.format(\"%13s%21s%21s%21s%21s\\n\",\n\t\t\t\t\t\t\t\tstabilityWinner, avgSchoolWinner,\n\t\t\t\t\t\t\t\tavgStudentWinner, avgTotalWinner, timeWinner);\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"----------------------------------------------------------------------------------------------------------------\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t} else if (!GSH.matchesExist()\n\t\t\t\t\t\t\t|| schoolArrayList.size() == 0\n\t\t\t\t\t\t\t|| studentArrayList.size() == 0) {\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\tSystem.out.println(\"ERROR: No matches exist!\");\n\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (OptionChosen.equalsIgnoreCase(\"R\")) {\n\n\t\t\t\t\tGSS.reset();\n\t\t\t\t\tGSH.reset();\n\t\t\t\t\tschoolArrayList.clear();\n\t\t\t\t\tstudentArrayList.clear();\n\t\t\t\t\tloadedSchoolsNum = 0;\n\t\t\t\t\tloadedStudents = 0;\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\tSystem.out.println(\"Database cleared!\");\n\t\t\t\t\tSystem.out.println(\"\");\n\n\t\t\t\t\t// Remove everything from both array lists\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} while (!Quit);\n\n\t}",
"public static void main(String[] args) {\n // variables iniciales\n int semilla ; \n int tpoblacion ;\n double pcruza ;\n double pmutaccion ;\n int iteraciones ;\n int ttablero ;\n ArrayList<Integer> fitvalores = new ArrayList<>();\n ArrayList<int []> poblacion = new ArrayList<>();//ponemos tableros a la poblacion inicial\n ArrayList<int []> nuevagen = new ArrayList<>();\n /*Scanner sc=new Scanner(System.in);\n System.out.println(\"Ingrese semilla: \");\n semilla=sc.nextInt();\n System.out.println(\"Ingrese numero de reinas \");\n ttablero=(sc.nextInt()-1);\n System.out.println(\"Ingrese tamaño de la poblacion: \");\n tpoblacion=sc.nextInt();\n System.out.println(\"Ingrese numero de generaciones: \");\n iteraciones=sc.nextInt();\n System.out.println(\"Ingrese probabilidad de cruza (con coma en un rango de 0,0 a 1,0): \");\n pcruza=sc.nextDouble();\n System.out.println(\"Ingrese probabilidad de mutacion (con coma en un rango de 0,0 a 1,0): \");\n pmutaccion=sc.nextDouble();\n System.out.println();*/\n \n if (args.length <6) { //si hay más de 1 parámetro\n\t\t\tSystem.out.println(\"Debe ingresar 6 variables (semilla reinas poblacion generaciones probcruza probmutacion)\");\n\t\t\t\n\t\t} \n \n \n else {\n //recibe las variables como strings\n\tString ssemilla =args[0]; \n String sttablero =args[1];\n String stpoblacion =args[2];\n String siteraciones =args[3];\n String spcruza =args[4];\n String spmutaccion =args[5];\n //cambiar de string a enteros y decimales\n \n int isemilla = Integer.parseInt(ssemilla);\n int itpoblacion = Integer.parseInt(stpoblacion);\n double ipcruza = Double.parseDouble(spcruza);\n double ipmutaccion = Double.parseDouble(spmutaccion);\n int iiteraciones = Integer.parseInt(siteraciones);\n int itablero = Integer.parseInt(sttablero);\n // le pasamos el valor a las variables\n \n semilla =isemilla; \n tpoblacion =itpoblacion;\n pcruza =ipcruza;\n pmutaccion =ipmutaccion;\n iteraciones =iiteraciones;\n ttablero =itablero;\n/**/\n int gen=1;\n boolean find=false;\n //inicializamos la poblacion de tableros randomicamente 1ra generacion\n for(int i=0;i<tpoblacion;i++){\n int[] tablero= RandomizeArray(0, ttablero);\n poblacion.add(tablero);\n int fit=fittnes(tablero);\n if (fit==0) {\n //dibujo(tablero);\n System.out.println(Arrays.toString(tablero));\n System.out.println(\"En generacion 0\");\n dibujo(tablero);\n find=true;\n \n break;\n }\n fitvalores.add(fit);\n }//fin llenado de la poblacion inicial\n \n \n \n //acá construiriamos 1 generacion\n int m = 0;\n if (find==false){\n for (int i = 0; i < iteraciones; i++) {\n m++;\n for (int kk = 0; kk < tpoblacion; kk++) {\n //selecionamos dos padres por medio de la ruleta . solo obtenemos el iindice del tablero\n int padre1=ruolette(fitvalores,poblacion, semilla); \n int padre2=ruolette(fitvalores,poblacion, semilla);\n // System.out.println(\"padre 1 \"+padre1);\n //volvemos a elegir el padre 2 si es igual al padre 1\n\n if (padre2==padre1) {\n if (padre1==poblacion.size()) {\n padre2=padre1-1;\n // System.out.println(\"padres iguales pero se cambió\");\n }\n else{\n padre2=padre1+1;\n }\n }\n \n // System.out.println(\"padre 2 \"+padre2);\n //random decimal para ver si se cruzan los padres\n double randomdeccc=randomadec(0,1,semilla);\n \n //obtenemos la mitad para hacer a los hijos\n int mitad=randomanint(0,ttablero, semilla);\n //recuperar padre y madre seleccionados\n int [] padrek=obtenerpadre(poblacion, ttablero, padre1);\n int [] padres=obtenerpadre(poblacion, ttablero, padre2);\n int [] hijo1= new int[ttablero];\n int [] hijo2= new int[ttablero];\n //realizamos la cruza\n boolean cruza;\n //obtenemos la probabilidad de cruza\n cruza=probabilidadcruza(pcruza, randomdeccc);\n if(cruza==true){\n hijo1 =cruza( padrek, padres, ttablero, mitad, 1);\n hijo2 =cruza( padrek, padres, ttablero, mitad, 2);\n }\n // for (int i = 0; i <ttablero+1; i++) {\n // System.out.print( hijo1[i]);\n // }\n // System.out.println(\" \");\n // for (int i = 0; i <ttablero+1; i++) {\n // System.out.print( hijo2[i]);\n // }\n // System.out.println(\" \");\n //reparamosa a los hijos si se repiten los numeros\n int[] hijoreparauno=reparacion2(hijo1,ttablero);\n int[] hijoreparados=reparacion2(hijo2,ttablero);\n //seleccionamos numeros enteros para hacer la mutacion. si esta dentro de la probabilidad\n int num1=randomanint(0, ttablero, semilla);\n int num2=randomanint(0, ttablero, semilla);\n //nos aseguramon que no salga el mismo numero\n if (num1==num2) {\n if (num1==ttablero) {\n num2=num1-1;\n \n }\n else{\n num2=num1+1;\n }\n }\n \n // System.out.println(\"numero 1 \"+num1);\n // System.out.println(\"numero 2 \"+num2);\n //seleccionamos la probabilidad para la mutacion\n double probmut=randomadec(0,1,semilla);\n //hacemos la mutacion de los hijos\n int[] hijolistouno=mutacion(hijo1,ttablero,num1,num2,probmut,pmutaccion);\n int[] hijolistodos=mutacion(hijo2,ttablero,num1,num2,probmut,pmutaccion);\n //agregamos lo hijos a la nueva generacion\n //nuevagen.add(hijolistouno);\n // nuevagen.add(hijolistodos);\n poblacion.add(padre1, hijolistouno);\n poblacion.add(padre2, hijolistodos);\n int fit=fittnes(hijolistouno);\n if (fit==0) {\n //dibujo(hijolistouno);\n System.out.println(Arrays.toString(hijolistouno));\n System.out.println(\"En generacion \"+(m));\n dibujo(hijolistouno);\n // System.out.println(0);\n find=true;\n break;\n }\n int fiti=fittnes(hijolistodos);\n if (fiti==0) {\n //dibujo(hijolistouno);\n System.out.println(Arrays.toString(hijolistodos));\n System.out.println(\"En generacion \"+(m));\n // System.out.println(0);\n find=true;\n break;\n }\n \n \n fitvalores.add(padre1,fit);\n fitvalores.add(padre2,fiti);\n //se crea una nueva generacion\n }//fin llenado de una nueva poblacion\n }//fin de la creacion de generaciones (while) \n int mejor=100;\n \n for(int i = 0; i < fitvalores.size(); i++){\n\t if(fitvalores.get(i)<mejor){\n mejor=fitvalores.get(i);\n \t}\n\t\t\t\n\t}\n int [] mejorcito=obtenerpadre(poblacion, ttablero, mejor);\n if (find==false) {\n \n \n System.out.println(\"la mejor solucion es \");\n dibujo(mejorcito);\n System.out.println(Arrays.toString(mejorcito));\n System.out.print(\"generaciones escaneadas \"+m);\n }\n }\n }\n }",
"private void setProblem() throws IOException, InvalidInputException{\r\n String finalInputFileName;\r\n if(scale){\r\n finalInputFileName = inputFileName + \".scaled\";\r\n }\r\n else{\r\n finalInputFileName = inputFileName;\r\n }\r\n \r\n // Read data from the input file\r\n BufferedReader reader = new BufferedReader(new FileReader(finalInputFileName));\r\n if(reader.toString().length() == 0){\r\n throw new InvalidInputException(\"Invalid input file! File is empty!\");\r\n }\r\n\r\n // Prepare holders for dataset D=(X,y)\r\n Vector<svm_node[]> X = new Vector<svm_node[]>();\r\n Vector<Double> y = new Vector<Double>();\r\n int maxIndex = 0;\r\n\r\n // Load data from file to holders\r\n while(true){\r\n String line = reader.readLine();\r\n\r\n if(line == null){\r\n break;\r\n }\r\n\r\n StringTokenizer st = new StringTokenizer(line,\" \\t\\n\\r\\f:\");\r\n\r\n y.addElement(Utils.toDouble(st.nextToken()));\r\n int m = st.countTokens()/2;\r\n svm_node[] x = new svm_node[m];\r\n for(int i = 0; i < m; i++) {\r\n x[i] = new svm_node();\r\n x[i].index = Utils.toInt(st.nextToken());\r\n x[i].value = Utils.toDouble(st.nextToken());\r\n }\r\n if(m > 0){\r\n maxIndex = Math.max(maxIndex, x[m-1].index);\r\n }\r\n X.addElement(x);\r\n }\r\n\r\n this.problem = new svm_problem();\r\n this.problem.l = y.size();\r\n this.inputDime = maxIndex + 1;\r\n\r\n // Wrap up multi-dimensional input vector X\r\n this.problem.x = new svm_node[this.problem.l][];\r\n for(int i=0;i<this.problem.l;i++)\r\n this.problem.x[i] = X.elementAt(i);\r\n\r\n // Wrap up 1-dimensional input vector y\r\n this.problem.y = new double[this.problem.l];\r\n for(int i=0;i<this.problem.l;i++)\r\n this.problem.y[i] = y.elementAt(i);\r\n \r\n////////////////////???\r\n // Verify the gamma setting according to the maxIndex\r\n if(param.gamma == 0 && maxIndex > 0)\r\n param.gamma = 1.0/maxIndex;\r\n\r\n // Dealing with pre-computed kernel\r\n if(param.kernel_type == svm_parameter.PRECOMPUTED){\r\n for(int i = 0; i < this.problem.l; i++) {\r\n if (this.problem.x[i][0].index != 0) {\r\n String msg = \"Invalid kernel matrix! First column must be 0:sample_serial_number.\";\r\n throw new InvalidInputException(msg);\r\n }\r\n if ((int)this.problem.x[i][0].value <= 0 || (int)this.problem.x[i][0].value > maxIndex){\r\n String msg = \"Invalid kernel matrix! Sample_serial_number out of range.\";\r\n throw new InvalidInputException(msg);\r\n }\r\n }\r\n }\r\n\r\n reader.close();\r\n }",
"public abstract double evaluateSolution(Solution solution) throws JMException, SimulationException;",
"public static void main(String args[]) throws Exception {\n Scanner sc = new Scanner(System.in);\n //Scanner sc = new Scanner(new FileInputStream(\"input.txt\"));\n String st = \"abc\";\n\n System.out.print(st.substring(0,1));\n int T = sc.nextInt();\n\n for (int test_case = 0; test_case < T; test_case++) {\n\n // Answer = 0;\n /////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t/*\n\t\t\t Implement your algorithm here.\n\t\t\t The answer to the case will be stored in variable Answer.\n\t\t\t */\n /////////////////////////////////////////////////////////////////////////////////////////////\n int N = sc.nextInt();\n int points[][] = new int[N][2];\n double dist[][] = new double[N][N];\n\n for(int i=0;i<N;i++)\n {\n points[i][0] = sc.nextInt();\n points[i][1] = sc.nextInt();\n }\n\n double max = -1;\n for(int i=0;i<N;i++)\n {\n\n double [] result = getIntersection(points[i],points[0],points[N-1]);\n double tdist= (points[i][0]-result[0])*(points[i][0]-result[0]) +\n (points[i][1]-result[1])*(points[i][1]-result[1]);\n tdist=Math.sqrt(tdist);\n max=Math.max(tdist,max);\n\n for(int j=0;j<N-1;j++)\n {\n\n result = getIntersection(points[i],points[j],points[j+1]);\n tdist= (points[i][0]-result[0])*(points[i][0]-result[0]) +\n (points[i][1]-result[1])*(points[i][1]-result[1]);\n tdist=Math.sqrt(tdist);\n max=Math.max(tdist,max);\n }\n\n }\n Answer = max;\n\n // Print the answer to standard output(screen).\n System.out.println(\"Case #\" + (test_case + 1));\n System.out.format(\"%.2f\",Answer);\n }\n }",
"private static <V extends Variable<A>, A extends Value> Map<V, DomainReduction<A>> FORWARD_CHECK2(SharedDomainVariableSet<V, A> variableSet, V var) throws Exception {\n\t\tMap<V, DomainReduction<A>> domainReduction = new HashMap<>(256);\n\t\t\n\t\t// map of constraints to unset variables\n\t\tMap<Constraint<V>, Queue<V>> unsetConstraints = new HashMap<>();\n\t\tfor (Constraint<V> constraint : variableSet.getConstraintsByVariable(var)) {\n\t\t\t\n\t\t\t// get free variables in the constraint\n\t\t\tQueue<V> freeVariables = new LinkedList<>();\n\t\t\tfor (V v : constraint.getVariables()) {\n\t\t\t\tif (!v.isSet()) {\n\t\t\t\t\tfreeVariables.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// add only if number of free variables is not empty\n\t\t\tif (!freeVariables.isEmpty()) {\n\t\t\t\tunsetConstraints.put(constraint, freeVariables);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\t// made at least one reduction for all constraints\n\t\t\tboolean madeReductionAll = false;\n\t\t\t\n\t\t\t// for each constraint on the variable\n\t\t\tfor (Constraint<V> constraint : unsetConstraints.keySet()) {\n\t\t\t\t\n\t\t\t\tQueue<V> freeVariables = unsetConstraints.get(constraint);\n\t\t\t\t\n\t\t\t\twhile (true) {\n\t\t\t\t\tMap<V, DomainReduction<A>> reductions = new HashMap<>(256);\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < freeVariables.size(); i ++) {\n\t\t\t\t\t\tV freeVariable = freeVariables.remove();\n\t\t\t\t\t\t\n\t\t\t\t\t\treductions.put(freeVariable, new DomainReduction<>(256)); // TODO\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<A> domain = variableSet.getDomain(freeVariable);\n\t\t\t\t\t\tif (domain.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.clearDomainReduction(domainReduction);\n\t\t\t\t\t\t\tthrow new Exception();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (A val : domain) {\n\t\t\t\t\t\t\tfreeVariable.assign(val);\n\t\t\t\t\t\t\tif (!FIND_COMBINATION(variableSet, freeVariables, constraint)) {\n\t\t\t\t\t\t\t\treductions.get(freeVariable).add(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfreeVariable.unassign();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfreeVariables.add(freeVariable);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tboolean noReduction = true;\n\t\t\t\t\t\n\t\t\t\t\tfor (V freeVariable : freeVariables) {\n\t\t\t\t\t\tDomainReduction<A> reduc = reductions.get(freeVariable);\n\t\t\t\t\t\tif (!reduc.isEmpty()) {\n\t\t\t\t\t\t\tvariableSet.addDomainReduction(freeVariable, reduc);\n\t\t\t\t\t\t\tif (!domainReduction.containsKey(freeVariable)) {\n\t\t\t\t\t\t\t\tdomainReduction.put(freeVariable, reduc);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdomainReduction.get(freeVariable).addAll(reduc);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnoReduction = false;\n\t\t\t\t\t\t\tmadeReductionAll = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (noReduction) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!madeReductionAll) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn domainReduction;\n\t\t\n\t}",
"public double[] solveLinearSet(double[] bvec){\r\n \tMatrix ludmat =\tthis.luDecomp();\r\n\r\n \treturn ludmat.luBackSub(bvec);\r\n \t}",
"public static void main(String[] args) {\n Double rateOfSvi;\n Double rateOfEvi;\n Double rateOfIvi;\n Double rateOfShi;\n Double rateOfEhi;\n Double rateOfIhi;\n Double weeklyRateOfIhi;\n Double Ihi;\n int nextSvi;\n int nextEvi;\n int nextIvi;\n int nextShi;\n int nextEhi;\n int nextIhi;\n int week = 0;\n final int id = 69;\n String[] line;\n final int[] infectedPredictions = new int[53];\n double vectorPopulation; // 3times the Host population in the area\n// initializeMobility();\n int val = 0;\n double error = 1000;\n\n// for(int e = 3500; e < 4500; e++) {\n// mohSampleMob = e;\n\n// System.out.println(\"Mobility Initialized\");\n initializePopulation();\n// System.out.println(\"Population Initialized\");\n initializeInfected();\n// System.out.println(\"Infected Initialized\");\n setInitialConditions(id, 0);\n// System.out.println(\"Initial conditions created\");\n// System.out.println(\"betaVi,betaHi,scalingFactor = \" + betaVi + \",\" + betaHi + \",\" + scalingFactor);\n infectedPredictions[0] = currentIhi;\n// try {\n// writer = new CSVWriter(new FileWriter(\"/Users/Anushka/Documents/workspace/CSV/Colombo_MSE.csv\"));\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// for (int bvi = 0; bvi<100 ; bvi++) {\n// betaVi = (bvi * 0.01);\n// for (int bhi = 0; bhi < 100; bhi++) {\n// betaHi = (bhi * 0.01);\n for (int i = 1; i <= 52; i++) {\n week = i;\n weeklyRateOfIhi = 0.0;\n\n setInitialConditions(69, week - 1);\n\n for (int j = 0; j < 7; j++) { // Do this for a week as we calculate daily figures.\n //Equations for the vectors\n rateOfSvi = muVi * scalingFactor * getMOHPopulation(id) - betaVi * getConnectivity(id, week) * currentSvi - muVi * currentSvi; // scalingFactor*HostPopulation = vectorPopulation\n rateOfEvi = betaVi * getConnectivity(id, week) * currentSvi - muVi * currentEvi - kappa * currentEvi;\n rateOfIvi = kappa * currentEvi - muVi * currentIvi;\n\n // Equations for the hosts\n rateOfShi = getMOHPopulation(id) - betaHi * getConnectivityWithinRegion(id) * currentShi - muHi * currentShi;\n rateOfEhi = betaHi * getConnectivityWithinRegion(id) * currentShi - lambda * currentEhi - muHi * currentEhi;\n rateOfIhi = lambda * currentEhi - delta * currentIhi - muHi * currentIhi;\n weeklyRateOfIhi += rateOfIhi;\n // Obtain next states\n\n// if (i == 0) {\n// currentSvi = rateOfSvi.intValue();\n// currentEvi = rateOfEvi.intValue();\n// currentIvi = rateOfIvi.intValue();\n// currentShi = rateOfShi.intValue();\n// currentEhi = rateOfEhi.intValue();\n// currentIhi = rateOfIhi.intValue();\n// }else{\n currentSvi += rateOfSvi.intValue();\n currentEvi += rateOfEvi.intValue();\n currentIvi += rateOfIvi.intValue();\n currentShi += rateOfShi.intValue();\n currentEhi += rateOfEhi.intValue();\n\n// if (rateOfIhi.intValue() > 0) {\n// currentIhi += rateOfIhi.intValue();\n// }\n// }\n\n\n }\n infectedPredictions[week] = weeklyRateOfIhi.intValue();\n //System.out.println(\"Week \" + week + \" Prediction \" + infectedPredictions[week] + \" Actual \" + infected[id][week]);\n //System.out.print(infectedPredictions[week] + \",\");\n //System.out.print(infected[id][week] + \",\");\n // Set current infected to actual value for next prediction\n currentIhi = infected[id][week];\n }\n System.out.println(Arrays.toString(infectedPredictions));\n System.out.println(Arrays.toString(infected[id]));\n\n// double er = calculateMSE(infectedPredictions, infected[id]);\n System.out.println(betaVi + \" \" + betaHi + \" \" + calculateMSE(infectedPredictions, infected[id]));\n\n// if(er < error){\n// error = er;\n// val = e;\n// }\n\n// DrawGraph provider = new DrawGraph();\n// DrawGraph.createAndShowGui();\n int[] actual = Arrays.copyOfRange(infected[id], 0, 52);\n int[] predict = Arrays.copyOfRange(infectedPredictions, 0, 52);\n\n// System.out.println();\n// }\n\n// System.out.println(val);\n// System.out.println(Arrays.toString(predict));\n// System.out.println(Arrays.toString(actual));\n\n XYLineChartExample temp = new XYLineChartExample(actual, predict);\n\n\n// BufferedWriter br = null;\n// try {\n// br = new BufferedWriter(new FileWriter(\"myfile.csv\"));\n//\n// StringBuilder sb = new StringBuilder();\n// for (int element : infectedPredictions) {\n// sb.append(element);\n// sb.append(\",\");\n// }\n// sb.append(\",\");\n//\n// for (int element : infected[id]) {\n// sb.append(element);\n// sb.append(\",\");\n// }\n//\n// br.write(String.valueOf(sb));\n// br.close();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n\n\n //line = new String[]{Double.toString(betaVi), Double.toString(betaHi), Double.toString(calculateMSE(infectedPredictions, infected[id]))};\n //writer.writeNext(line);\n// }\n//\n// }\n// try {\n// writer.close();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n }",
"public void solveUsingLeastCostMethod() {\n\n this.solution = new Solution();\n\n Source[] proxySources = Arrays.copyOf(sources, sources.length);\n Destination[] proxyDestinations = Arrays.copyOf(destinations, destinations.length);\n int[][] matrix = new int[costs.length][costs[0].length];\n\n List<Integer> rows = new ArrayList<Integer>();\n List<Integer> columns = new ArrayList<Integer>();\n while ( rows.size() != proxySources.length && columns.size() != proxyDestinations.length ) {\n //getting minimum cell (if there is a tie, we choose where is the maximum quantity)\n int indexI,indexJ, value;\n indexI = 0;\n indexJ = 0;\n value = 0;\n boolean firstElement = true;\n for(int i=0;i<proxySources.length;i++) {\n if( !rows.contains(i) ) {\n for(int j=0;j<proxyDestinations.length;j++) {\n if( !columns.contains(j) ) {\n if ( firstElement ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n firstElement = false;\n }\n if( costs[i][j] < value ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n else if( costs[i][j] == value ) {\n if( Math.min(proxySources[i].getSupply(),proxyDestinations[j].getDemand()) > Math.min(proxySources[indexI].getSupply(),proxyDestinations[indexJ].getDemand()) ) {\n indexI = i;\n indexJ = j;\n value = costs[i][j];\n }\n }\n }\n }\n }\n }\n int supply = proxySources[indexI].getSupply();\n int demand = proxyDestinations[indexJ].getDemand();\n\n\n this.solution.add(sources[indexI], destinations[indexJ], Math.min(supply,demand), costs[indexI][indexJ]);\n\n if ( supply < demand ) {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(demand - supply);\n rows.add(indexI);\n }\n else if( supply > demand ) {\n proxySources[indexI].setSupply(supply-demand);\n proxyDestinations[indexJ].setDemand(0);\n columns.add(indexJ);\n }\n else {\n proxySources[indexI].setSupply(0);\n proxyDestinations[indexJ].setDemand(0);\n rows.add(indexI);\n columns.add(indexJ);\n }\n }\n this.solution.showSolution();\n\n\n }",
"public static void process(Scanner s) {\n\t\tString[] first_name, last_name;\n\t\tString[] letter_grade;\n\t\tString[] output, first_initial;\n\t\tdouble[] assignments,aGrades;\n\t\tint[] letterGradeCount = new int[11];\n\t\tdouble aTotal,aGTotal;\n\t\tint studentCount=0;\n\t\tint aCount = 0;\n\t\tdouble[] assignment_grade, participation_grade, midterm, final_exam, weighted_average,normalizedMid, normalizedFin, curved_score_mid, curved_score_fin;\n\t\tdouble maxPPoint, rawPPoint;\n\t\tdouble totalMid, aveMid, totalFin, aveFin, stdMid, stdFin, sumstdm, sumstdf;\n\t\t\n\t\t\n\t\taTotal = aGTotal = totalMid = totalFin = sumstdm = sumstdf = 0;\n\t\t\n\t\ts = new Scanner(System.in);\n\t\t\n\t\taCount = s.nextInt();\n\n\t\tassignments = new double[aCount];\n\t\taGrades = new double[aCount];\n\t\t\n\t\tfor(int i = 0;i < aCount;i++)\n\t\t{\n\t\t\tassignments[i] = s.nextDouble();\n\t\t\taTotal= aTotal + assignments[i];\n\t\t}\n\t\t\n\t\tmaxPPoint = s.nextDouble();\n\t\tstudentCount=s.nextInt();\n\t\toutput = new String[studentCount];\n\t\tfirst_name = new String[studentCount];\n\t\tlast_name = new String[studentCount];\n\t\tfirst_initial = new String[studentCount];\n\t\tnormalizedMid = new double[studentCount];\n\t\tnormalizedFin = new double[studentCount];\n\t\tcurved_score_mid = new double[studentCount];\n\t\tcurved_score_fin = new double[studentCount];\n\t\tletter_grade = new String[studentCount];\n\t\tassignment_grade = new double[studentCount];\n\t\tparticipation_grade= new double[studentCount];\n\t\tmidterm = new double[studentCount];\n\t\tfinal_exam = new double[studentCount];\n\t\tweighted_average = new double[studentCount];\n\t\t//input all the information\n\t\tfor(int i = 0;i < studentCount;i++)\n\t\t{\n\t\t\tfirst_name[i]=s.next();\n\t\t\tfirst_initial[i]=Character.toString(first_name[i].charAt(0)) + \".\";\n\t\t\tlast_name[i]=s.next();\n\t\t\t\n\t\t\trawPPoint=s.nextDouble();\n\t\t\tparticipation_grade[i] = 100 * (rawPPoint / (maxPPoint * 0.8));\n\t\t\t\n\t\t\tparticipation_grade[i] = (participation_grade[i] > 100) ? 100 : participation_grade[i];\n\t\t\taGTotal=0;\n\t\t\tfor(int i1 = 0;i1 < aCount;i1++)\n\t\t\t{\n\t\t\t\taGrades[i1] = s.nextDouble();\n\t\t\t\taGTotal= aGTotal + aGrades[i1];\n\t\t\t}\n\t\t\t\n\t\t\tassignment_grade[i] =100*(aGTotal)/(aTotal);\n\t\n\t\t\tmidterm[i]=s.nextDouble();\n\t\t\tfinal_exam[i]=s.nextDouble();\n\t\t\t\n\t\t\ttotalMid = totalMid + midterm[i];\n\t\t\ttotalFin = totalFin + final_exam[i];\n\t\t}\n\t\t\n\t\taveMid = totalMid / studentCount;\n\t\taveFin = totalFin / studentCount;\n\t\tfor(int i = 0 ; i < studentCount ; i++)\n\t\t{\n\t\t\tsumstdm=sumstdm+Math.pow(midterm[i]-aveMid, 2);\n\t\t\tsumstdf=sumstdf+Math.pow(final_exam[i]-aveFin, 2);\n\t\t}\n\t\t\n\t\tstdMid = Math.sqrt( sumstdm / studentCount);\n\t\tstdFin = Math.sqrt( sumstdf / studentCount);\n\t\t\n\t\tfor(int i = 0 ; i < studentCount ; i++)\n\t\t{\n\t\t\tdouble nm, nf;\n\t\t\tnm = (midterm[i]-aveMid)/stdMid;\n\t\t\tnf = (final_exam[i]-aveFin)/stdFin;\n\t\t\tif(nm>1.0 && nm <2.0 && nm > -4.0)\n\t\t\t\tcurved_score_mid[i] = (nm - 1.0)/(2.0 - 1.0)*(100.0 - 94.0) + 94.0;\n\t\t\telse if(nm>0.0)\n\t\t\t\tcurved_score_mid[i] = (nm - 0.0)/(1.0 - 0.0)*(94.0 - 85.0) + 85.0;\n\t\t\telse if(nm>-1.0)\n\t\t\t\tcurved_score_mid[i] = (nm - (-1.0))/(0.0 - (-1.0))*(85.0 - 75.0) + 75.0;\n\t\t\telse if(nm>-1.5)\n\t\t\t\tcurved_score_mid[i] = (nm - (-1.5))/((-1.0) - (-1.5))*(75.0 - 65.0) + 65.0;\n\t\t\telse if(nm>-2.0)\n\t\t\t\tcurved_score_mid[i] = (nm - (-2.0))/((-1.5) - (-2.0))*(65.0 - 55.0) + 55.0;\n\t\t\telse if(nm>-3.0)\n\t\t\t\tcurved_score_mid[i] = (nm - (-3.0))/((-2.0) - (-3.0))*(55.0 - 30.0) + 30.0;\n\t\t\telse\n\t\t\t\tcurved_score_mid[i] = (nm - (-4.0))/((-3.0) - (-4.0))*(30.0 - 0) + 30.0;\n\n\t\t\tif(nf>1.0 && nf <2.0 && nf > -4.0)\n\t\t\t\tcurved_score_fin[i] = (nf - 1.0)/(2.0 - 1.0)*(100.0 - 94.0) + 94.0;\n\t\t\telse if(nf>0.0)\n\t\t\t\tcurved_score_fin[i] = (nf - 0.0)/(1.0 - 0.0)*(94.0 - 85.0) + 85.0;\n\t\t\telse if(nf>-1.0)\n\t\t\t\tcurved_score_fin[i] = (nf - (-1.0))/(0.0 - (-1.0))*(85.0 - 75.0) + 75.0;\n\t\t\telse if(nf>-1.5)\n\t\t\t\tcurved_score_fin[i] = (nf - (-1.5))/((-1.0) - (-1.5))*(75.0 - 65.0) + 65.0;\n\t\t\telse if(nf>-2.0)\n\t\t\t\tcurved_score_fin[i] = (nf - (-2.0))/((-1.5) - (-2.0))*(65.0 - 55.0) + 55.0;\n\t\t\telse if(nf>3.0)\n\t\t\t\tcurved_score_fin[i] = (nf - (-3.0))/((-2.0) - (-3.0))*(55.0 - 30.0) + 30.0;\n\t\t\telse\n\t\t\t\tcurved_score_fin[i] = (nf - (-4.0))/((-3.0) - (-4.0))*(30.0 - 0) + 0.0;\n\t\t\n\t\t} \n\t\tfor(int i = 0;i < studentCount;i++)\n\t\t{\n\t\t\tweighted_average[i] = assignment_grade[i]*0.4 + participation_grade[i]*0.15 +\n\t\t\t\t\tcurved_score_mid[i]*0.2 +curved_score_fin[i]*0.25;\n\t\t\tswitch((int)weighted_average[i])\n\t\t\t{\n\t\t\t\tcase 94:case 95:case 96:case 97:case 98:case 99:case 100:\n\t\t\t\t\tletter_grade[i] = \"A\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 90:case 91:case 92:case 93:\n\t\t\t\t\tletter_grade[i] = \"A-\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 86:case 87:case 88:case 89:\n\t\t\t\t\tletter_grade[i] = \"B+\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 83:case 84:case 85:\n\t\t\t\t\tletter_grade[i] = \"B\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 80:case 81:case 82:\n\t\t\t\t\tletter_grade[i] = \"B-\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 76:case 77:case 78:case 79:\n\t\t\t\t\tletter_grade[i] = \"C+\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 73:case 74:case 75:\n\t\t\t\t\tletter_grade[i] = \"C\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 70:case 71:case 72:\n\t\t\t\t\tletter_grade[i] = \"C-\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 65:case 66:case 67:case 68:case 69:\n\t\t\t\t\tletter_grade[i] = \"D+\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 60:case 61:case 62:case 63:case 64:\n\t\t\t\t\tletter_grade[i] = \"D\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(weighted_average[i] < 60)\n\t\t\t{\n\t\t\t\tletter_grade[i] = \"F\";\n\t\t\t}\n\n\t\t}\n\t\t \n\t\tfor(int i = 0;i < studentCount;i++)\n\t\t{\n\t\t\tswitch(letter_grade[i])\n\t\t\t{\n\t\t\tcase \"A\":\n\t\t\t\tletterGradeCount[0]++;\n\t\t\t\tbreak;\n\t\t\tcase \"A-\":\n\t\t\t\tletterGradeCount[1]++;\n\t\t\t\tbreak;\n\t\t\tcase \"B+\":\n\t\t\t\tletterGradeCount[2]++;\n\t\t\t\tbreak;\n\t\t\tcase \"B\":\n\t\t\t\tletterGradeCount[3]++;\n\t\t\t\tbreak;\n\t\t\tcase \"B-\":\n\t\t\t\tletterGradeCount[4]++;\n\t\t\t\tbreak;\n\t\t\tcase \"C+\":\n\t\t\t\tletterGradeCount[5]++;\n\t\t\t\tbreak;\n\t\t\tcase \"C\":\n\t\t\t\tletterGradeCount[6]++;\n\t\t\t\tbreak;\n\t\t\tcase \"C-\":\n\t\t\t\tletterGradeCount[7]++;\n\t\t\t\tbreak;\n\t\t\tcase \"D+\":\n\t\t\t\tletterGradeCount[8]++;\n\t\t\t\tbreak;\n\t\t\tcase \"D\":\n\t\t\t\tletterGradeCount[9]++;\n\t\t\t\tbreak;\n\t\t\tcase \"F\":\n\t\t\t\tletterGradeCount[10]++;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"A : \" + letterGradeCount[0]);\n\t\tSystem.out.println(\"A-: \" + letterGradeCount[1]);\n\t\tSystem.out.println(\"B+: \" + letterGradeCount[2]);\n\t\tSystem.out.println(\"B : \" + letterGradeCount[3]);\n\t\tSystem.out.println(\"B-: \" + letterGradeCount[4]);\n\t\tSystem.out.println(\"C+: \" + letterGradeCount[5]);\n\t\tSystem.out.println(\"C : \" + letterGradeCount[6]);\n\t\tSystem.out.println(\"C-: \" + letterGradeCount[7]);\n\t\tSystem.out.println(\"D+: \" + letterGradeCount[8]);\n\t\tSystem.out.println(\"D : \" + letterGradeCount[9]);\n\t\tSystem.out.println(\"F : \" + letterGradeCount[10]);\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\r\n Scanner scanner = new Scanner(System.in);\r\n \r\n long n = scanner.nextLong();\r\n int d = scanner.nextInt();\r\n List<Integer> expenditureList = new ArrayList<>();\r\n for(long i = 0; i < n; i++){\r\n int Ei = scanner.nextInt();\r\n expenditureList.add(Ei);\r\n }\r\n System.out.println(getSolution(expenditureList, d));\r\n }",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\n\n\t\tint T = Integer.parseInt(br.readLine());\n\t\tfor(int tc = 1; tc <= T; tc++) {\n\t\t\tStringTokenizer st = new StringTokenizer(br.readLine());\n\t\t\tint N = Integer.parseInt(st.nextToken());\n\t\t\tint M = Integer.parseInt(st.nextToken());\n\n\t\t\tint[][] arr = new int[N][M];\n\t\t\tint[] sum = new int[M];\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tst = new StringTokenizer(br.readLine());\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tarr[i][j] = Integer.parseInt(st.nextToken());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tfor(int j = 0; j < M; j++) {\n\t\t\t\t\tif(arr[i][j] == 1)\n\t\t\t\t\t\tsum[i]++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint cnt = 0;\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tmax = Math.max(max, sum[i]);\n\t\t\t}\n\t\t\tfor(int i = 0; i < N; i++) {\n\t\t\t\tif(max == sum[i]) {\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbw.write(\"#\"+tc+ \" \" + cnt + \" \" + max + \"\\n\");\n\t\t\tbw.flush();\n\t\t}\n\t}",
"protected static List<Conflict> solve() {\n\t\tcleaned = false;\n\t\tif (curMIDI != null)\n\t\t\ttry {\n\t\t\t\tSolver greedy = new OOGreedySolver(setOfStrings);\n\t\t\t\tcurMIDI = TrackSplitter.split(curMIDI, setOfStrings.length, bassTrack);\n\t\t\t\tcurMIDI = greedy.solve(curMIDI);\n\t\t\t\tsetOfConflicts = Cleaner.getConflicts(curMIDI, setOfStrings);\n\n\t\t\t\t//serve users valid choices\n\t\t\t\t//receive users choice\n\t\t\t\t//call appropriate method\n\n\t\t\t\t// give the simulation the new midi\n\t\t\t\tcurMIDI = Cleaner.prePos(curMIDI, prepositionDelay, setOfStrings, prepositionLength);\n\t\t\t\tif (sim!=null) sim.setSequence(curMIDI);\n\t\t\t\treturn setOfConflicts;\n\t\t\t} catch (InvalidMidiDataException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"public static void main(String[] args) throws UnsatisfiableConstraintSetException{\n\t\tint order = 1;\n\t\tBidirectionalVariableOrderPrefixIDMap<CharacterToken> statesByIndex = new BidirectionalVariableOrderPrefixIDMap<CharacterToken>(order);\n\t\t\n\t\tfinal CharacterToken cToken = new CharacterToken('C');\n\t\tint cID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(cToken)));\n\t\tfinal CharacterToken dToken = new CharacterToken('D');\n\t\tint dID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(dToken)));\n\t\tfinal CharacterToken eToken = new CharacterToken('E');\n\t\tint eID = statesByIndex.addPrefix(new LinkedList<CharacterToken>(Arrays.asList(eToken)));\n\t\t\n\t\tMap<Integer, Map<Integer, Double>> transitions = new HashMap<Integer, Map<Integer, Double>>();\n\t\t\n\t\tMap<Integer, Double> priors = new HashMap<Integer, Double>();\n\t\tpriors.put(cID, .5);\n\t\tpriors.put(dID, 1.0/6);\n\t\tpriors.put(eID, 1.0/3);\n\n\t\tfinal HashMap<Integer, Double> transFromC = new HashMap<Integer, Double>();\n\t\ttransFromC.put(cID, .5);\n\t\ttransFromC.put(dID, .25);\n\t\ttransFromC.put(eID, .25);\n\t\ttransitions.put(cID, transFromC);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromD = new HashMap<Integer, Double>();\n\t\ttransFromD.put(cID, .5);\n//\t\ttransFromD.put(dID, 0.);\n\t\ttransFromD.put(eID, .5);\n\t\ttransitions.put(dID, transFromD);\n\t\t\n\t\tfinal HashMap<Integer, Double> transFromE = new HashMap<Integer, Double>();\n\t\ttransFromE.put(cID, .5);\n\t\ttransFromE.put(dID, .25);\n\t\ttransFromE.put(eID, .25);\n\t\ttransitions.put(eID, transFromE);\n\t\t\n\t\tSparseVariableOrderMarkovModel<CharacterToken> model = new SparseVariableOrderMarkovModel<CharacterToken>(statesByIndex, priors, transitions);\n\t\t\n\t\tCharacterToken[][] seqs = new CharacterToken[][] {\n\t\t\tnew CharacterToken[]{cToken, cToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, cToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, eToken, eToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, cToken, dToken},\n\t\t\tnew CharacterToken[]{cToken, dToken, eToken, dToken}\n\t\t};\n\n\t\tSystem.out.println(\"UNCONSTRAINED:\");\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + model.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + model.generate(4));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"CONSTRAINED:\");\n\t\t\n\t\tint length = 4;\n\t\tList<List<ConditionedConstraint<CharacterToken>>> constraints = new ArrayList<List<ConditionedConstraint<CharacterToken>>>(); \n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tconstraints.add(new ArrayList<ConditionedConstraint<CharacterToken>>());\n\t\t}\n\t\tconstraints.get(3).add(new ConditionedConstraint<>(new CharacterTokenConstraint<CharacterToken>(new CharacterToken('D')),true));\n\t\t\n\t\tSparseVariableOrderNHMMMultiThreaded<CharacterToken> constrainedModel = null;\n\t\ttry {\n\t\t\tconstrainedModel = new SparseVariableOrderNHMMMultiThreaded<CharacterToken>(model, length, constraints);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tfor (CharacterToken[] seq : seqs) {\n\t\t\tSystem.out.println(\"Seq:\" + Arrays.toString(seq) + \" Prob:\" + constrainedModel.probabilityOfSequence(seq));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"\" + (i+1) + \": \" + constrainedModel.generate(4));\n\t\t}\n\t}",
"public void solver(){\n\n tohSolver(noDisks,1,3,2);\n\n }",
"public int minCostClimbingStairs(int[] cost) {\n // We initialize an array of size = cost, and it means the minimun cost of reaching n^th stair\n int[] dp = new int[cost.length];\n // We assign values to the first 2 numbers in the array because it can´t be smaller than 3\n dp[0] = cost[0];\n dp[1] = cost[1];\n // We iterate from n=2 to n-1, and in each position we save the min\n // value to reach the stair, the MIN is (dp[i-1] + cost[i] , dp[i-2] + cost[i]\n // that is so that the min way of reaching that stair is either using the n-1 or n-2\n for (int i = 2; i < cost.length; i++) {\n dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);\n }\n\n // We return the min value of the last 2 stairs because both can reach the end\n return Math.min(dp[cost.length - 1], dp[cost.length - 2]);\n\n\t\t /*\n\t\t\t cost[1,100,1,1,1,100,1,1,100,1]\n\t\t 1.- Imagine this is the array\n\t\t\t dp[]\n\t\t 2.- We add the first two values\n\t\t\t dp[1,100]\n\t\t 3.- Iterate form 2 to n\n\t\t\t This is a representation of the first one\n\t\t dp[2] = Math.min(1+1, 100+1)\n\t\t dp[2] = Math.min(2,101)\n\t\t dp[2] = 2\n\t\t dp[1,100,2]\n\t\t\t After the for, this is how it should look\n\t\t dp[1,100,2,3,3,103,4,5,105,6]\n\t\t 4.- Select the min between last 2 because both can reach last step\n\t\t\treturn min (105,6)\n\t\t\treturn 6\n\n\t\t\tIt should have a space complexity of O(n) becuase we´re using an array of n size\n\t\t\tThe time complexity should also be O(n) because we have to iterate through all the array once\n\n\t\t */\n }",
"public static void main(String[] args) throws IOException {\n sc = new Reader();\n //out = new Printer(\"./src/answer.txt\");\n out = new Printer();\n int testCases, n, m, k;\n long c;\n long[][] matrix, rsum, csum, oddLastCalc, evenLastCalc;\n// boolean flag;\n testCases = sc.nextInt();\n while (testCases-- > 0) {\n n = sc.nextInt();\n m = sc.nextInt();\n k = sc.nextInt();\n matrix = new long[n][m];\n rsum = new long[n+1][m+1];\n csum = new long[n+1][m+1];\n oddLastCalc = new long[n][m];\n evenLastCalc = new long[n][m];\n c = 0l;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < m; j++) {\n matrix[i][j] = sc.nextLong();\n oddLastCalc[i][j] = matrix[i][j];\n if(matrix[i][j]>=k)\n c++;\n }\n }\n\n for (int i = 0; i < n; i++) {\n rsum[i][m-1] = matrix[i][m-1];\n }\n for (int i = 0; i < m; i++) {\n csum[n-1][i] = matrix[n-1][i];\n }\n for (int i = 0; i < n; i++) {\n for (int j = m-2; j >=0; j--) {\n rsum[i][j] = rsum[i][j+1] + matrix[i][j];\n }\n }\n for (int i = 0; i < m; i++) {\n for (int j = n-2; j >=0; j--) {\n csum[j][i] = csum[j+1][i] + matrix[j][i];\n }\n }\n PRINT.ArrayMatrix(rsum);\n PRINT.ArrayMatrix(csum);\n System.out.println(\"-------------------------------------------------------\");\n\n for (int size = 2; size <= n; size++) {\n// flag = false;\n for (int i = n-size; i >= 0; i--) {\n for (int j = m - size; j >= 0; j--) {\n if(size%2==0){\n evenLastCalc[i][j] = matrix[i][j]\n + oddLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*evenLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n } else {\n oddLastCalc[i][j] = matrix[i][j]\n + evenLastCalc[i+1][j+1]\n + csum[i+1][j] - csum[i+size][j]\n + rsum[i][j+1] - rsum[i][j+size];\n if(1.0*oddLastCalc[i][j]/(size*size)<k){\n// flag = true;\n break;\n }\n }\n System.out.println(size + \"\\t\" + i + \"\\t\" + j);\n PRINT.ArrayMatrix(oddLastCalc);\n PRINT.ArrayMatrix(evenLastCalc);\n System.out.println(\"-------------------------------------------------------\");\n c++;\n }\n// if(flag)\n// break;\n }\n }\n System.out.println(c);\n }\n\n out.close();\n }",
"@Override\n public void evaluate(Solution solution) throws JMException {\n\n int[] tour = new int[numberOfNodes + 1];\n int firstCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[0];\n int lastCity = ((Permutation) solution.getDecisionVariables()[0]).vector_[numberOfNodes - 1];\n\n double fitness1_td = 0.0;\n\n // Calculate fitness 1 - total distance\n for (int i = 0; i < numberOfNodes - 1; i++) {\n int x = ((Permutation) solution.getDecisionVariables()[0]).vector_[i];\n int y = ((Permutation) solution.getDecisionVariables()[0]).vector_[i+1];\n\n tour[i] = x;\n tour[i+1] = y;\n\n fitness1_td += calDistances(x, y);\n }\n // generate tour with same start city and end city\n tour[numberOfNodes] = tour[0];\n\n fitness1_td += calDistances(firstCity, lastCity);\n\n\n // Correctness check: does the tour start and end in the same city\n if(tour[0] != tour[tour.length - 1]) {\n System.err.println(\"ERROR: The last city must be the same as the first city\");\n System.exit(1);\n }\n\n /*for (int i = 0; i < tour.length; i++) {\n System.out.print(tour[i] + \" \");\n }*/\n //System.out.println(\"\\n\" + tour.length);\n\n // Calculate fitness 2 - objective value of a given tour\n ArrayInt z = (ArrayInt) solution.getDecisionVariables()[1];\n //System.out.println(z.getLength());\n\n double fitness2_ob;\n double wc = 0.0;\n double ft = 0.0;\n double fp = 0.0;\n\n //the following is used for a different interpretation of \"packingPlan\"\n int itemsPerCity = z.getLength() / (tour.length - 2);\n //System.out.println(itemsPerCity);\n\n for (int i = 0; i < tour.length - 1; i++) {\n\n int currentCityTEMP = tour[i];\n // what's the current city? --> but the items start at city 2 in the TTP file, so I have to take another 1 off!\n int currentCity = currentCityTEMP - 1;\n\n if (i > 0) {\n\n if (currentCity == -1) {\n // No items in city 1\n wc += 0.0;\n fp += 0.0;\n\n } else {\n\n for (int itemNumber = 0; itemNumber < itemsPerCity; itemNumber++) {\n\n int indexOfPackingPlan = (i-1) * itemsPerCity + itemNumber;\n // what is the next item's index in items-array?\n int itemIndex = currentCity + itemNumber * (numberOfNodes - 1);\n //System.out.println(\"i: \" + i);\n\n if (z.getValue(indexOfPackingPlan) == 1) {\n // pack item\n //System.out.println(itemIndex);\n int currentWC = items[itemIndex][2];\n wc += currentWC;\n\n int currentFP = items[itemIndex][1];\n fp += currentFP;\n }\n }\n\n }\n\n int h = (i+1) % (tour.length-1); //h: next tour city index\n //System.out.println(\"h: \" + h);\n long distance = calDistances(i, h);\n // compute the adjusted (effective) distance\n ft += (distance / (1 - wc * (maxSpeed - minSpeed) / capacityOfKnapsack));\n }\n }\n\n wendUsed = wc;\n wend = capacityOfKnapsack - wc;\n fitness2_ob = fp - ft * rentingRatio;\n\n solution.setObjective(0, fitness1_td);\n solution.setObjective(1, -fitness2_ob); // Convert from maximum objective value to minimum objective value\n }",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public static void main(String[] args) throws IOException {\n int max = 100000;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n N = Integer.parseInt(br.readLine());\n\n int arr[] = new int[max+1];\n\n for (int p=2; p<=99999; p++)\n {\n if (arr[p] == 0)\n { arr[p] = 1;\n for (int i=p*2; i<=max; i += p) {\n arr[i]++;\n }\n }\n }\n\n int mat[][] = new int[6][max+1];\n// for (int i = 2; i < arr.length; i++) {\n// mat[arr[i]][i] = 1;\n// }\n\n for (int i = 1; i < 6; i++) {\n for (int j = 2; j < mat[0].length; j++) {\n if(arr[j] == i) {\n mat[i][j] = mat[i][j - 1]+1;\n } else {\n mat[i][j] = mat[i][j - 1];\n }\n }\n }\n\n\n for (int i = 0; i < N; i++) {\n String str[] = br.readLine().split(\" \");\n int a = Integer.parseInt(str[0]);\n int b = Integer.parseInt(str[1]);\n int k = Integer.parseInt(str[2]);\n int ans = mat[k][b]-mat[k][a-1];\n System.out.println(ans);\n }\n }",
"public void findSolution() {\n\n\t\t// TODO\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint [][][] dp = new int[n+1][m+1][m+1];\n\t\tint [][] arr = new int[n+1][m+1];\n\t\tint max = 1;\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <= n; i++) {\n\t\t\tfor (int j = 1; j <= m; j++) {\n\t\t\t\tif (arr[i][j] == 1) {\n\t\t\t\t\tfor (int z = j; z <= m && arr[i][z] == 1; z++) {\n\t\t\t\t\t\tdp[i][j][z] = dp[i-1][j][z] + 1;\n\t\t\t\t\t\tmax = Math.max(max, Math.min(dp[i][j][z], z-j+1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(max);\n\t}",
"void solve() throws IOException {\n\t\tint n = ni();\n\t\tint[] v = new int[n];\n\t\tfor (int i = 0; i < n; ++i)\n\t\t\tv[i] = ni();\n\t\tsolve(v);\n\t\tout.println(result.size());\n\t\tfor (int a : result)\n\t\t\tout.print(a + \" \");\n\t}",
"public static void main(String[] args) throws Exception {\n Scanner sc = new Scanner(new FileReader(\"talent.in\"));// new InputStreamReader(System.in)); //\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"talent.out\")));\n int N = sc.nextInt();\n int minWeight = sc.nextInt();\n int[] weight = new int[N];\n int[] value = new int[N];\n int totalTalent = 0;\n for (int i = 0; i < N; i++) {\n int wt = sc.nextInt();\n int val = sc.nextInt();\n weight[i] = wt;\n value[i] = val;\n totalTalent += val;\n }\n\n // Store, for a given talent, what is the smallest weight used to achieve it?\n int[] dp = new int[totalTalent + 1];\n Arrays.fill(dp, (int) 1e9);\n dp[0] = 0;\n // the min weight to produce 0 talent is 0. However,\n // it is necessary to make everything else big because we can only BUILD\n // from 0\n double bestRatio = 0;\n for (int cow = 0; cow < N; cow++) {\n // look at each cow, and go DOWN THROUGH THE dp array, updating the\n // best weight achievable BEHIND US. This countercurrent motion ensures no repeated\n // counting of a single cow's talents\n int contribution = value[cow];\n int wt = weight[cow];\n for (int talent = totalTalent; talent >= 0; talent--) {\n int boostedTalent = contribution + talent;\n int boostedWeight = dp[talent] + wt;\n // with the min weight of a certain talent,\n // is it possible to get a smaller boostedWeight for a boostedTalent\n if (boostedTalent <= totalTalent) {\n // If we are in bounds,\n if (boostedWeight < dp[boostedTalent]) {\n // and the attempted team has a better weight value\n // then update it!\n // Initially, when everything is 1 billion, this cannot\n // happen except for from the base cases, building outward\n dp[boostedTalent] = boostedWeight;\n\n // At the same time, we can be more efficient by constantly\n // checking if we had enough weight first of all, and\n // second of all had a better talent/weight ratio!\n double ratio = (double) boostedTalent / boostedWeight;\n if (ratio > bestRatio && boostedWeight >= minWeight) {\n bestRatio = ratio;\n }\n }\n }\n }\n }\n\n out.println((int) (1000 * bestRatio));\n out.close();\n }",
"private void PuzzleSolve(int k, ArrayList<Integer> S, ArrayList<Integer> U) {\n // for every integer value in the array passed in U we will add it to the empty array and remove it from the\n // new array made called list.\n for (Integer s : U) {\n ArrayList<Integer> list = new ArrayList<>(U);\n S.add(s);\n list.remove(s);\n // If we have removed all numbers in the list and S is now full, check the evaluation.\n if (k == 1) {\n Equals(S);\n }\n // else we keep calling this method until U is empty.\n else {\n PuzzleSolve(k - 1, S, list);\n }\n // remove the value from s and then add it back to the list to test a new variation at the end.\n S.remove(s);\n list.add(s);\n }\n }",
"public static void main(String[] args){\n\t\tScanner input = new Scanner(System.in); \n\t\t\t\t\n\t\tSystem.out.print(\"Please input the string X: \" );\n\t\tString strX = input.nextLine(); \n\t\t\t\t\n\t\tSystem.out.println(\"Please input the component of transition matrix: \"); \n\t\tString transStr = input.nextLine();\n\t\t\n\t\tSystem.out.println(\"Please input the transition matrix: (AB * AB)\"); \n\t\t// copy: 0.641 0.359 0.729 0.271 0.117 0.691 0.192 0.097 0.42 0.483\n\t\t \n\t\t\n\t\tint dim = transStr.length(); \n\t\t\n\t\tdouble transition[][] = new double[dim][dim];\n\t\tfor(int i=0; i<dim; i++){\n\t\t\t\n\t\t\tfor(int j=0; j<dim; j++){\n\t\t\t\t\n\t\t\t\ttransition[i][j] = input.nextDouble();\n\t\t\t}\n\t\t\t\n\t\t}//end i<hmm.length(); \n\t\t\n\t\tprintMatrix(transition); \n\t\t\n\t\t//emission matrix\n\t\tSystem.out.println(\"Now input the emission matrix:\"); \n\t\t//copy: 0.117 0.691 0.192 0.097 0.42 0.483\n\t\t\n\t\tString Row = transStr;\t\t\t//\"AB\" in this case; \n\t\tString Col = \"xyz\"; \t\t//\"xyz\" in this case; \n\t\t\n\t\t//create a matrix for probability column given row\n\t\tdouble emission[][] = new double [Row.length()][Col.length()]; \n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tfor(int j=0; j<Col.length(); j++){\n\t\t\t\t\n\t\t\t\temission[i][j] = input.nextDouble(); \t\t\t\t\n\n\t\t\t}\n\t\t\t\n\t\t}//end for i<Row.length(); \n\t\t\n\t\tprintMatrix(emission); \n\t\t\n\t\t//close the input scanner\n\t\tinput.close(); \n\t\t\n\t\t\n\t\t\n\t\t/**************************************************************************************************/\n\t\t//step 2, build a state-matrix \n\t\tdouble state[][] = new double[Row.length()][strX.length()]; \n\t\t\n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tfor(int j=0; j<strX.length(); j++){\n\t\t\t\t\n\t\t\t\t//the state matrix will share the same Row name with the transition matrix; \n\t\t\t\tint row = i; \n\t\t\t\tint col = Col.indexOf( strX.charAt(j) );\n\t\t\t\t\n\t\t\t\tstate[i][j] = emission[row][col]; \n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t/**************************************************************************************************/\n\t\t//Step 3, traverse through the string-X, check each character,\n\t\t\n\t\t//step 3.1, update the first column of the state[][] matrix; \n\t\t//for the first column of the state[][] matrix; \n\t\t// it could be the max of [AAx or BAx ]\n\t\t// or could be the max of [ABx or BBx ]\n\t\tint row = state.length; \n\t\tint col = state[0].length; \n\t\t\n\t\t\n\t\tfor( int i=0; i<row; i++){\n\t\t\t\n\t\t\t//when i = 0; the state[0][0] would be AAx or BAx, we take the greater value from AB*AB transition matrix first column, \n\t\t\t// \n\t\t\t//call maxOfcolumn() method to get the max value of a column.\n\t\t\tstate[i][0] = state[i][0] * maxOfColumn(transition, i); \n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t\n\t\t\n\t\t//step 4, update all other elements in the state[][] matrix; \n\t\t\n\t\tfor(int i=1; i<col; i++){\n\t\t\t\n\t\t\tfor( int j=0; j<row; j++){\n\t\t\t\t\n\t\t\t\tstate[j][i] = state[j][i] * maxOfColumn(state, i-1); \n\t\t\t\t\n\t\t\t}//end for j<row loop; \n\t\t\t\n\t\t}//end for i<col loop; \n\t\t\n\t\tprintMatrix(state); \n\t\t\n\t\t\n\t\t//step 4, back trace the state[][] matrix, get the HMM hidden path; \n\t\tString hiddenPath = \"\"; \n\t\t\n\t\tfor(int i=0; i<col; i++){\n\t\t\t\n\t\t\tdouble currMax = 0.0; \n\t\t\tchar currChar = 'X';\n\t\t\t\n\t\t\tfor(int j=0; j<row; j++){\n\t\t\t\t\n\t\t\t\tif(state[j][i] > currMax){\n\t\t\t\t\t\n\t\t\t\t\tcurrMax = state[j][i]; \n\t\t\t\t\tcurrChar = Row.charAt(j); \n\t\t\t\t\t\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t} //end for j<row loop \n\t\t\t\n\t\t\t\n\t\t\thiddenPath += currChar; \n\t\t} //end for i<col loop; \n\t\t\n\t\tSystem.out.println(\"The finial hidden path: \" + hiddenPath); \n\t\t\n\t\t/*****************************************************\n\t\t * \n\t\t * \n\t\tdouble prob = 1.0; \n\t\t\n\t\t//the probability of the very first char\n\t\t\n\t\tint col_first = Col.indexOf(strX.charAt(0)); \n\t\t\n\t\tdouble prob_max = 0;\n\t\tString hmm = \"\"; \n\t\t\n\t\tfor(int i=0; i<Row.length(); i++){\n\t\t\t\n\t\t\tif(emission[i][col_first] > prob_max) {\n\t\t\t\n\t\t\t\thmm = Row.charAt(i) + \"\"; \n\t\t\t\tprob_max = emission[i][col_first]; \n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t//initial the first char of hmm;\t\t\t\n\t\t}\n\t\t\n\t\tprob *= prob_max; \n\t\t\n\t\t\n\t\t//1st, get HMM probability of AB/AA/BA/BB, whichever possbile at current character; \n\t\t//2nd, get emission probability\n\t\t//3rd, use emission probability*HMM, check the maximum probability; \n\t\tfor(int i=1; i<strX.length(); i++){\n\t\t\t\n\t\t\tSystem.out.println(\"hmm: \" + hmm); \n\t\t\t\n\t\t\tprob_max = 0.0; \n\t\t\tchar nextHMM = 'X'; \n\t\t\t\n\t\t\t// Here we know the prior Letter in the HMM hidden path is 'A'; \n\t\t\t// the current letter in the String-X is y;\n\t\t\t// so the current pattern could be AAy or ABy; \n\t\t\t\n\t\t\t//construct the pattern: String pattern = hmm.charAt(i-1) + \"A/B\" + strX.charAt(i); \n\t\t\t\n\t\t\tfor(int index = 0; index < Row.length(); index++){\n\t\t\t\t\n\t\t\t//\tString pattern = \"\" + hmm.charAt(i-1) + Row.charAt( index ) + strX.charAt(i); \n\t\t\t\t\n\t\t\t\tint transition_row = Row.indexOf( hmm.charAt(i-1) );\n\t\t\t\tint transition_col = Row.indexOf( Row.charAt( index) );\n\t\t\t\t\n\t\t\t\tint emission_row = transition_col; \n\t\t\t\tint emission_col = Col.indexOf( strX.charAt(i) ); \n\t\t\t\t\n\t\t\t\tdouble currProb = transition[transition_row][transition_col] * emission[emission_row][emission_col];\n\t\t\t\t\n\t\t\t\tif( currProb > prob_max){\n\t\t\t\t\t\n\t\t\t\t\tprob_max = currProb;\n\t\t\t\t\tnextHMM = Row.charAt(index); \n\t\t\t\t\t\n\t\t\t\t}//end if( currProb > prob_max)\n\t\t\t\t\n\t\t\t}//end index < Row.length(); \n\t\t\t\n\t\t\thmm += nextHMM; \n\t\t\t\n\t\t\tprob *= prob_max; \n\t\t\t\n\t\t} //end for i<strX.length() loop; \n\t\t\n\t\t\n\t\tSystem.out.println(\"The hmm: \" + hmm); \n\t\tSystem.out.println(\"The final probability is: \" + prob);\n\t\t\n\t\t*/\n\t\t\n\t}",
"public static void main(String[] args) {\n\n Map<String, Integer> nyt;\n nyt = new HashMap<String, Integer>();\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt(), m = scan.nextInt();\n scan.nextLine();\n int cont = 0;\n seen = new boolean[193];\n g = new ArrayList[193];\n\n for (int i = 0; i < 193; i++) {\n g[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n String[] value = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(value[0])) {\n nyt.put(value[0], cont);\n cont++;\n }\n if (!nyt.containsKey(value[1])) {\n nyt.put(value[1], cont);\n cont++;\n }\n\n int u = nyt.get(value[0]);\n int v = nyt.get(value[1]);\n g[u].add(v);\n }\n boolean ok;\n for (int i = 0; i < m; i++) {\n ok = true;\n String[] trump = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(trump[0]) || !nyt.containsKey(trump[1])) {\n System.out.println(\"Pants on Fire\");\n } else {\n\n dfs(nyt.get(trump[0]));\n if (seen[nyt.get(trump[1])]) {\n System.out.println(\"Fact\");\n ok = false;\n }\n\n if (ok) {\n seen = new boolean[193];\n dfs(nyt.get(trump[1]));\n if (seen[nyt.get(trump[0])]) {\n System.out.println(\"Alternative Fact\");\n } else {\n System.out.println(\"Pants on Fire\");\n }\n\n }\n\n }\n seen = new boolean[193];\n\n }\n\n }"
]
| [
"0.5985055",
"0.58406335",
"0.56095886",
"0.56034505",
"0.5584431",
"0.5546848",
"0.5409848",
"0.53860307",
"0.5251521",
"0.52113587",
"0.52001005",
"0.51888037",
"0.5170165",
"0.5120262",
"0.50763",
"0.50726867",
"0.5054083",
"0.50270396",
"0.5025388",
"0.49907708",
"0.49611026",
"0.49455398",
"0.492466",
"0.49215856",
"0.48824552",
"0.48800862",
"0.48699823",
"0.48678237",
"0.48650676",
"0.48491785",
"0.48483095",
"0.483597",
"0.48278582",
"0.4796708",
"0.47959226",
"0.4792256",
"0.47908133",
"0.4788458",
"0.47810507",
"0.477769",
"0.47709528",
"0.47693264",
"0.4767838",
"0.47664773",
"0.4755884",
"0.47444525",
"0.473401",
"0.47284254",
"0.47246885",
"0.4719341",
"0.47180414",
"0.4717733",
"0.47125366",
"0.47041652",
"0.4698026",
"0.4690228",
"0.46854997",
"0.46812874",
"0.46799973",
"0.46795604",
"0.46757945",
"0.46738225",
"0.46726692",
"0.46673355",
"0.46663266",
"0.46632305",
"0.46501586",
"0.46423694",
"0.46385127",
"0.46365538",
"0.46224698",
"0.4620374",
"0.4619158",
"0.4618908",
"0.4615743",
"0.4613552",
"0.46040505",
"0.46015695",
"0.4601486",
"0.4599704",
"0.45947027",
"0.4593952",
"0.45913118",
"0.45905477",
"0.4588145",
"0.4587104",
"0.45835376",
"0.45834762",
"0.4578666",
"0.4578444",
"0.4577033",
"0.45722473",
"0.4571368",
"0.4571111",
"0.4571064",
"0.4564116",
"0.45616663",
"0.45613918",
"0.4561291",
"0.45599756"
]
| 0.626817 | 0 |
/sorting each resident's valid partners using insertion sort | private ArrayList<ArrayList<Integer>> sortValidPartners(Matching data, int validPartnersNo, ArrayList<ArrayList<Integer>> validPartners) {
for (int resident = 0; resident < validPartners.get(0).size(); resident++) {
for (int partner = 1; partner < validPartnersNo; partner++) {
int partnerRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partner).get(resident));
int partnerValue = validPartners.get(partner).get(resident);
if (partnerRank == -1)
partnerRank = 999999;
int partnerToCompare = partner - 1;
int partnerToCompareRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partnerToCompare).get(resident));
if (partnerToCompareRank == -1)
partnerToCompareRank = 999999;
while (partnerToCompareRank > partnerRank) {
validPartners.get(partnerToCompare + 1).set(resident, validPartners.get(partnerToCompare).get(resident));
partnerToCompare--;
if (partnerToCompare < 0)
break;
partnerToCompareRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partnerToCompare).get(resident));
if (partnerToCompareRank == -1)
partnerToCompareRank = 999999;
}
validPartners.get(partnerToCompare + 1).set(resident, partnerValue);
}
}
return validPartners;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }",
"private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }",
"private ArrayList<Teacher> sortTeacherByPriorty(ArrayList<Teacher> teachers, ArrayList<Integer> preferedTeachers, int numSections) {\n ArrayList<Teacher> aux = new ArrayList<>();\r\n if (preferedTeachers.isEmpty()) {\r\n return aux;\r\n }\r\n\r\n for (int i = 0; i < numSections; i++) {\r\n Teacher teacher = findTeacher(teachers, preferedTeachers.get(i % preferedTeachers.size()));\r\n aux.add(teacher);\r\n }\r\n return aux;\r\n }",
"public void sortCompetitors(){\n\t\t}",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"public void sortFinalsList() {\n \n Course course = null;\n int j = 0;\n for (int i = 1; i < finalsList.size(); i++) {\n\n j = i;\n // checks to see if the start time of the element j is less than the\n // previous element, and if j > 0\n while (j > 0) {\n\n // if the current element, is less than the previous, then....\n if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) < 0) {\n\n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n else if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) == 0) {\n \n if (compareTimes(finalsList.get(j).getBeginTime(), finalsList.get(j - 1).getBeginTime()) < 0) {\n \n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n }\n\n // decrement j\n j--;\n }\n }\n }",
"Vector<NewsArticle> insertionSort(Vector<NewsArticle> articles) {\n int i, j;\n int size = articles.size();\n NewsArticle sortedList[] = new NewsArticle[articles.size()];\n\n articles.copyInto(sortedList);\n NewsArticle temp;\n\n for (i = 1; i < size; i++) {\n temp = sortedList[i];\n\n j = i;\n while ((j > 0) && (sortedList[j - 1].getScore(filterType) < temp.getScore(filterType))) {\n sortedList[j] = sortedList[j - 1];\n j = j - 1;\n }\n sortedList[j] = temp;\n }\n Vector<NewsArticle> outList = new Vector<NewsArticle>();\n\n for (i = 0; i < size; i++) {\n temp = sortedList[i];\n outList.addElement(temp);\n }\n return outList;\n }",
"protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}",
"private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}",
"public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}",
"public void sortMatches();",
"public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }",
"public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }",
"private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }",
"@Test\n\tpublic void testLLSort() {\n\t\tLinkedList playerList = new LinkedList();\n\t\tPlayer tempInsert5 = new Player();\n\t\ttempInsert5.setName(\"test5\");\n\t\ttempInsert5.setPoints(5);\n\t\ttempInsert5.setWins(4);\n\t\ttempInsert5.setLosses(3);\n\t\tplayerList.LLInsert(tempInsert5);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tPlayer tempInsert2 = new Player();\n\t\ttempInsert2.setName(\"test2\");\n\t\ttempInsert2.setPoints(2);\n\t\ttempInsert2.setWins(1);\n\t\ttempInsert2.setLosses(0);\n\t\tplayerList.LLInsert(tempInsert2);\n\t\t\n\t\tPlayer tempInsert3 = new Player();\n\t\ttempInsert3.setName(\"test3\");\n\t\ttempInsert3.setPoints(3);\n\t\ttempInsert3.setWins(2);\n\t\ttempInsert3.setLosses(1);\n\t\tplayerList.LLInsert(tempInsert3);\n\t\t\n\t\tPlayer tempInsert1 = new Player();\n\t\ttempInsert1.setName(\"test1\");\n\t\ttempInsert1.setPoints(1);\n\t\ttempInsert1.setWins(0);\n\t\ttempInsert1.setLosses(0);\n\t\tplayerList.LLInsert(tempInsert1);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tPlayer tempInsert4 = new Player();\n\t\ttempInsert4.setName(\"test4\");\n\t\ttempInsert4.setPoints(4);\n\t\ttempInsert4.setWins(3);\n\t\ttempInsert4.setLosses(2);\n\t\tplayerList.LLInsert(tempInsert4);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tplayerList.LLSort();\n\t\tassertEquals(playerList.LLPrint(), \n\t\t\t\t\"test5: Points: 5, Wins/Losses: 4/3\\n\"\n\t\t\t\t\t\t+ \"test4: Points: 4, Wins/Losses: 3/2\\n\"\n\t\t\t\t\t\t+ \"test3: Points: 3, Wins/Losses: 2/1\\n\"\n\t\t\t\t\t\t+ \"test2: Points: 2, Wins/Losses: 1/0\\n\"\n\t\t\t\t\t\t+ \"test1: Points: 1, Wins/Losses: 0/0\\n\");\n\t}",
"public void employeeSorter(){\n Collections.sort(employees, new Comparator<Employee>() {\n @Override\n public int compare(Employee o1, Employee o2) {\n if(o1.getSalary() < o2.getSalary())\n return 1;\n else if(o1.getSalary() > o2.getSalary())\n return -1;\n else\n return 0;\n }\n });\n }",
"public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }",
"public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}",
"public void move_elevator() {\n\n // Sort in descending order\n\n int temp;\n int n = passengers.size();\n\n\n\n\n\n\n }",
"private void sortRequiredVertices(Integer v) {\n\t\tIterator<Integer> it = instance.getRequiredVerticesIterator();\n\n\t\t// We represent the list as a TreeSet, with a specific comparator to compare to distance from v\n\t\t// of each terminal\n\t\tTreeSet<Integer> ts = new TreeSet<Integer>(\n\t\t\t\tgetRequiredVerticesComparator(v));\n\t\twhile (it.hasNext()) {\n\t\t\tInteger t = it.next();\n\t\t\tts.add(t);\n\t\t}\n\n\t\t// Register the list\n\t\tsortedRequiredVertices.put(v, ts);\n\t}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"private void sortTravelContactsByCitizenship() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }",
"private static void multipleSortOfFinalPlayerList() {\n\n sortedFinalPlayerList = new ArrayList<>();\n\n Comparator<Player> byLastName = (e1, e2) -> e1\n .getLastName().compareTo(e2.getLastName());\n\n Comparator<Player> byFirstName = (e1, e2) -> e1\n .getFirstName().compareTo(e2.getFirstName());\n\n Comparator<Player> byCountry = (e1, e2) -> e1\n .getCountry().compareTo(e2.getCountry());\n\n streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry))\n .forEach(e -> System.out.print(e));\n Stream<Player> f = streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry));\n f.forEach(r -> sortedFinalPlayerList.add(r));\n }",
"private void showCourtBookings()\n {\n ArrayList<Court> courtList = new ArrayList<Court>();\n ArrayList<Booking> bookingList = new ArrayList<Booking>();\n for(Sport sObj : sportsClub.sportList)\n {\n System.out.println(\"Displaying Courts for : \" + sObj.getSportName());\n courtList = sObj.getCourtList();\n for(Court cObj : courtList)\n { \n if(cObj.getCourtBookings().size()==0)\n System.out.println(\"Booking are not yet started for sport :\" + sObj.getSportName() + \" on Court : \" + cObj.getCourtId());\n else\n { \n\n Collections.sort(cObj.getCourtBookings());\n System.out.println(cObj.getCourtBookings().toString());\n\n } \n }\n } \n }",
"public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }",
"public void sortEmployeeById() {\r\n\t\tfor (int indexI = 0; indexI < emp.size() - 1; indexI++) {\r\n\t\t\t\r\n\t\t\tfor (int indexJ = 0; indexJ < emp.size() - indexI - 1; indexJ++) {\r\n\t\t\t\t\r\n\t\t\t\tif (emp.get(indexJ).empId > emp.get(indexJ + 1).empId) {\r\n\t\t\t\t\tEmployee temp1 = emp.get(indexJ);\r\n\t\t\t\t\tEmployee temp2 = emp.get(indexJ + 1);\r\n\t\t\t\t\temp.set(indexJ, temp2);\r\n\t\t\t\t\temp.set(indexJ + 1, temp1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static List<WorkerSlot> sortSlots(List<WorkerSlot> availableSlots) {\n\n if (availableSlots != null && availableSlots.size() > 0) {\n // group by node\n Map<String, List<WorkerSlot>> slotGroups = new TreeMap<String, List<WorkerSlot>>();\n for (WorkerSlot slot : availableSlots) {\n String node = slot.getNodeId();\n List<WorkerSlot> slots = null;\n if (slotGroups.containsKey(node)) {\n slots = slotGroups.get(node);\n } else {\n slots = new ArrayList<WorkerSlot>();\n slotGroups.put(node, slots);\n }\n slots.add(slot);\n }\n\n // sort by port: from small to large\n for (List<WorkerSlot> slots : slotGroups.values()) {\n Collections.sort(slots, new Comparator<WorkerSlot>() {\n @Override\n public int compare(WorkerSlot o1, WorkerSlot o2) {\n return o1.getPort() - o2.getPort();\n }\n });\n }\n\n // sort by available slots size: from large to small\n List<List<WorkerSlot>> list = new ArrayList<List<WorkerSlot>>(slotGroups.values());\n Collections.sort(list, new Comparator<List<WorkerSlot>>() {\n @Override\n public int compare(List<WorkerSlot> o1, List<WorkerSlot> o2) {\n return o2.size() - o1.size();\n }\n });\n\n return interleaveAll(list);\n }\n\n return null;\n }",
"public void sortEmployeeArray()\n\t {\n\t\t\tEmployee employeeTmp = new Employee();\n\t for(int i = 0; i < numOfEmployees - 1; i++)\n\t {\n\t for(int j = 0; j < numOfEmployees - 1; j++)\n\t {\n\t if (employeeData[j].getEmployeeNumber() > employeeData[j+1].getEmployeeNumber())\n\t {\n\t \temployeeTmp = employeeData[j+1];\n\t \temployeeData[j+1] = employeeData[j];\n\t \temployeeData[j] = employeeTmp;\n\t }\n\t }\n\t }\n\n\t }",
"public static void SortPlayers () {\r\n boolean sorted = false;\r\n Player temp;\r\n\r\n while (!sorted) {\r\n sorted = true;\r\n for (int i = 0; i < player.length - 1; i++) {\r\n if (player[i].score > player[i + 1].score) {\r\n\r\n // SWAP THE OBJECTS' POSITION IN THE ARRAY\r\n temp = player[i];\r\n player[i] = player[i + 1];\r\n player[i + 1] = temp;\r\n\r\n sorted = false;\r\n }\r\n\r\n }\r\n }\r\n\r\n }",
"public void sort_crystals() {\n\t\tArrays.sort(identifiedArray, new SortByRating()); \n\t}",
"public static List<Person> checkSortLists(List<Person> people){\r\n TreeMap tm = new TreeMap();\r\n for (Person person: people) {\r\n if(person.getAge()>18){\r\n System.out.println(\"checking beyond\");\r\n return null;\r\n }\r\n tm.put(person.getNo(),person);\r\n }\r\n if(people.size()!=tm.size()){\r\n System.out.println(\"checking redundant\");\r\n return null;\r\n }\r\n List<Person> sortPeople = new ArrayList(tm.values());\r\n return sortPeople;\r\n }",
"public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }",
"public ArrayList<ArrayList<Furniture>> comparePrice(ArrayList<ArrayList<Furniture>> valid ){\n ArrayList<ArrayList<Furniture>> ordered = new ArrayList<ArrayList<Furniture>>();\n\n int i = valid.size();\n while(i != 0){\n int price = getComboPrice(valid.get(0));\n ArrayList<Furniture> cheapest = valid.get(0);\n\n for(ArrayList<Furniture> combo : valid){\n if(getComboPrice(combo) < price){\n price = getComboPrice(combo);\n cheapest = combo;\n }\n }\n // adds the cheapest element to the list and then removes it from the param list\n ordered.add(cheapest);\n valid.remove(cheapest);\n i--;\n }\n return ordered;\n }",
"protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }",
"public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }",
"public void SortDepartmentsAscending() {\n\t\tcurr = head;\n\t\twhile (curr.next != null) {\n\t\t\tif (curr.data.students.getStudentCount() > curr.next.data.students.getStudentCount()) {\n\t\t\t\tDepartment tempData = curr.data;\n\t\t\t\tcurr.data = curr.next.data;\n\t\t\t\tcurr.next.data = tempData;\n\t\t\t} curr = curr.next;\n\t\t}\n\t}",
"private void sortOutlines() {\r\n Collections.sort(outlines, reversSizeComparator);\r\n }",
"public void sortareDesc(List<Autor> autoriList){\n\t\tboolean ok;\t\t\t\t \n\t\tdo { \n\t\t ok = true;\n\t\t for (int i = 0; i < autoriList.size() - 1; i++)\n\t\t if (autoriList.get(i).getNrPublicatii() < autoriList.get(i+1).getNrPublicatii()){ \n\t\t \t Autor aux = autoriList.get(i);\t\t//schimbarea intre autori\n\t\t \t Autor aux1 = autoriList.get(i+1);\t\n\t\t \t try {\n\t\t \t\t \trepo.schimbareAutori(aux,aux1);\n\t\t\t } catch (Exception e) {\n\t\t\t System.out.println(e.getMessage());\n\t\t\t }\n\t\t\t\t ok = false;\n\t\t\t}\n\t\t}\n\t while (!ok);\n\t }",
"void sortV();",
"public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}",
"public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}",
"private void sortRequiredVertices() {\n\t\tIterator<Integer> it = instance.getGraph().getVerticesIterator();\n\t\twhile (it.hasNext())\n\t\t\tsortRequiredVertices(it.next());\n\t}",
"private ArrayList<IPlayer> sortPlayerAfterPoints() {\n ArrayList<IPlayer> arrlist = new ArrayList<>();\n\n iPlayerList.entrySet().stream().map((pair) -> (IPlayer) pair.getValue()).forEachOrdered((ip) -> {\n arrlist.add(ip);\n });\n\n Collections.sort(arrlist, (IPlayer p1, IPlayer p2) -> {\n try {\n if (p1.getPoints() == p2.getPoints()) {\n return 0;\n } else if (p1.getPoints() > p2.getPoints()) {\n return -1;\n } else {\n return 1;\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n return 0;\n });\n\n return arrlist;\n }",
"public void sortBasedPendingJobs();",
"private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }",
"public void ordenarListaDePasajerosPorDNI() {\r\n\t\tPasajero aux = null;\r\n\t\tfor (int i = 0; i < (cantidadPasajeros-1); i ++) {\r\n\t\t\tfor (int j = 0; i < (cantidadPasajeros-1); j++) {\r\n\t\t\t\tif (pasajeros[j].getDni() > pasajeros[j+1].getDni()) {\r\n\t\t\t\t\taux = pasajeros[j];\r\n\t\t\t\t\tpasajeros[j] = pasajeros [j+1];\r\n\t\t\t\t\tpasajeros[j+1] = aux;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t}",
"private void sortByLastName() { \r\n\t\tfor ( int i = 0; i < size-1; i++) {\r\n\t\t\tint minIndex = i; \r\n\t\t\tfor(int j = i + 1; j < size; j++) {\r\n\t\t\t\tif ( accounts[j].getHolder().getLname().compareTo(accounts[minIndex].getHolder().getLname()) < 0 ) { \r\n\t\t\t\t\tSystem.out.println(accounts[j].getHolder().getLname());\r\n\t\t\t\t\tminIndex = j;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tAccount temp = accounts[minIndex];\r\n\t\t\taccounts[minIndex] = accounts[i];\r\n\t\t\taccounts[i] = temp;\r\n\t\t}\r\n\t\treturn;\r\n\t}",
"public void sortVehicles() {\n\t\tCollections.sort(vehicles);\n\t\t\n\t}",
"@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }",
"public void sortChart() {\n\t\tPassengerTrain temp;\n\t\tGoodsTrain temp1;\n\n\t\tfor (int index = 0; index < TrainDetails.passengerList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.passengerList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.passengerList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.passengerList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp = TrainDetails.passengerList.get(index);\n\t\t\t\t\tTrainDetails.passengerList.set(index,\n\t\t\t\t\t\t\tTrainDetails.passengerList.get(i));\n\t\t\t\t\tTrainDetails.passengerList.set(i, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int index = 0; index < TrainDetails.goodsList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.goodsList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.goodsList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.goodsList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp1 = TrainDetails.goodsList.get(index);\n\t\t\t\t\tTrainDetails.goodsList.set(index,\n\t\t\t\t\t\t\tTrainDetails.goodsList.get(i));\n\t\t\t\t\tTrainDetails.goodsList.set(i, temp1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"protected Individual[] sortIndsArr(Individual[] ar)\n\t\t{\tint num_ar = ar.length;\n\t\t\tIndividual temp;\n\t\t\tfor(int j=0;j<num_ar-1;j++)\n\t\t\t\tfor(int i=0;i<num_ar-1-j;i++)\n\t\t\t\t\tif(ar[i].getFitness()<ar[i+1].getFitness()) {\n\t\t\t\t\t\ttemp\t= ar[i+1];\n\t\t\t\t\t\tar[i+1]\t= ar[i];\n\t\t\t\t\t\tar[i]\t= temp;\n\t\t\t\t\t}\n\t\t\treturn ar;\n\t\t}",
"public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }",
"public ArrayList<ArrayList<String>> inputTestListAndSort (ArrayList<ArrayList<String>> testList){\n ArrayList<ArrayList<String>> testList1=new ArrayList<>(testList);\n Collections.sort(testList1, new SubClass_CompareItemsInTheRowsOfTheTimetable_in_TeachingOverlapAndHours());\n return testList1;\n }",
"private void sort() {\n final Comparator<Slave> c = Comparator.comparing(Slave::getNodeName);\n this.slaves.sort(c);\n }",
"public void sortByAndser() {\r\n\t\tQuestion[][] question2DArray = new Question[displayingList.size()][];\r\n\t\tfor (int i = 0; i < displayingList.size(); i++) {\r\n\t\t\tquestion2DArray[i] = new Question[1];\r\n\t\t\tquestion2DArray[i][0] = displayingList.get(i);\r\n\t\t}\r\n\r\n\t\twhile (question2DArray.length != 1) {\r\n\t\t\tquestion2DArray = (Question[][]) merge2DArray(question2DArray);\r\n\t\t}\r\n\t\tdisplayingList.removeAll(displayingList);\r\n\t\tfor (int i = 0; i < question2DArray[0].length; i++) {\r\n\t\t\tdisplayingList.add(question2DArray[0][i]);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void sortir() {\n\t\tif (!estVide()) {\n\t\t\tTC next = getProchain();\t\t\t\t//On recupere le prochain\n\t\t\tsalle.get(next.getPrio()).remove(next);\t//Antinomie de entrer\n\t\t}\n\t}",
"public List<ContactPartAllocation> optimizeAllocation(List<ContactPartAllocation> contactPartAllocations) {\n // filter for not allocated and tile parts and sort them\n List<ContactPartAllocation> notAllocatedAndTitleParts = contactPartAllocations.stream().filter(part ->\n ContactParts.NOT_ALLOCATED.equals(part.getContactStringPart()) ||\n ContactParts.TITLE.equals(part.getContactStringPart())\n ).sorted(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()))\n .collect(Collectors.toList());\n\n // if there are none or only one not allocated of title part sort allocated parts and return them unchanged\n if (notAllocatedAndTitleParts.size() < 2) {\n contactPartAllocations.sort(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()));\n return contactPartAllocations;\n }\n\n // create possible concat titles\n String possibleTitleSpace = getCompletePossibleTitle(notAllocatedAndTitleParts, \" \");\n String possibleTitleDash = getCompletePossibleTitle(notAllocatedAndTitleParts, \"-\");\n\n for (int i = notAllocatedAndTitleParts.size() - 1; i > 0; i--) {\n // check if concat string is a valid title\n if (this.stringInFileCheckerService.stringIsInFile(possibleTitleSpace, TITLES_PATH) ||\n this.stringInFileCheckerService.stringIsInFile(possibleTitleDash, TITLES_PATH)) {\n contactPartAllocations.add(new ContactPartAllocation(new Tuple<>(notAllocatedAndTitleParts.get(0).getContactPart().getFirstObject(), possibleTitleSpace), ContactParts.TITLE));\n contactPartAllocations.removeAll(notAllocatedAndTitleParts.subList(0, i + 1));\n break;\n }\n\n // cut title string for new approach\n possibleTitleSpace = possibleTitleSpace.substring(0, possibleTitleSpace.length() - (notAllocatedAndTitleParts.get(i).getContactPart().getSecondObject().length() + 1));\n possibleTitleDash = possibleTitleDash.substring(0, possibleTitleDash.length() - (notAllocatedAndTitleParts.get(i).getContactPart().getSecondObject().length() + 1));\n }\n contactPartAllocations.sort(Comparator.comparingInt(a -> a.getContactPart().getFirstObject()));\n return contactPartAllocations;\n }",
"public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}",
"public void insertionNumberSort()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && Integer.parseInt(AL.get(possibleIndex - 1).toString()) < Integer.parseInt(temp.toString()))\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }",
"private static void selectSortingOption(ArrayList<Person> p) {\n\t\tArrayList<Person> personList = p;\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tboolean again = true;\n\t\twhile (again) {\n\t\t\tagain = false;\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Pick your sorting option\\n\" + \"1: First Name\\n\" + \"2: Last Name\\n\" + \"3: Starting Date\");\n\n\t\t\tint input = scan.nextInt();\n\n\t\t\tswitch (input) {\n\t\t\tcase 1:\n\t\t\t\tCollections.sort(personList, new Comparator<Person>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(final Person object1, final Person object2) {\n\t\t\t\t\t\treturn object1.getFirstName().toUpperCase().compareTo(object2.getFirstName().toUpperCase());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tsortingOptions(personList);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tCollections.sort(personList, new Comparator<Person>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(final Person object1, final Person object2) {\n\t\t\t\t\t\treturn object1.getLastName().toUpperCase().compareTo(object2.getLastName().toUpperCase());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tsortingOptions(personList);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tCollections.sort(personList, new Comparator<Person>() {\n\t\t\t\t\tDateFormat f = new SimpleDateFormat(\"yyyyMMdd\");\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(Person o1, Person o2) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn f.parse(o1.getStartDate()).compareTo(f.parse(o2.getStartDate()));\n\t\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\t\tthrow new IllegalArgumentException(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tsortingOptions(personList);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tagain = true;\n\t\t\t\tSystem.out.println(\"Enter a number between 1 and 3\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}",
"public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"@Test\n public void testItem_Ordering_With_Holes() {\n OasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 6, 8, 19);\n instance.addAll(Arrays.asList(1, 2, 6, 8));\n\n instance.remove(1);\n instance.add(19);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }",
"@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }",
"public void putListInPointOrder() {\n for (int i = 0; i < players.size(); i++) {\n Player s = players.get(i);\n if (i < players.size() - 1) {\n for (int j = i; j < players.size(); j++) {\n while (s.getPoint() < players.get(j).getPoint()) {\n Collections.swap(players, i, j);\n }\n\n }\n }\n }\n }",
"public static void testSort() {\n\t\tint[] test = {-1,-2,-3,4,1,3,0,3,-2,1,-2,2,-1,1,-5,4,-3};\n\t\tArrays.sort(test);\n\t\tfor (int e : test) {\n\t\t\tSystem.out.print(e + \", \");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tArrayList <Person> employee_list = new ArrayList <>();\r\n\r\n//taking input for the file name\r\n\t\tSystem.out.println(\"Please enter the name of the file (with the extension) that you want to process: \");\r\n\t\tScanner sc= new Scanner(System.in);\r\n\t\tString file_name=sc.nextLine();\r\n\t\t\r\n//opening and reading the file\r\n\t\t\r\n\t\ttry {\r\n List<String> empl_Lines = Files.readAllLines(java.nio.file.Paths.get(file_name), StandardCharsets.UTF_8);\r\n for (String line: empl_Lines) {\r\n \t String[] tokens = line.split(\",\");\r\n \temployee_list.add((Person)Employee.parse(line));\r\n }\r\n }\r\n\t\tcatch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\t\t\r\n System.out.println(\"Showing the data in the unsorted format\");\r\n System.out.println();\r\n for(Person emp: employee_list) {\r\n \tSystem.out.println(emp);\r\n }\r\n System.out.println();\r\n\r\n//sorting the employee list based on their IDs in ascending order\r\n \r\n Object[] person_array = employee_list.toArray();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getID()).compareTo(((Person) b).getID()));\r\n System.out.println(\"Sorting the array by the people's ID:\");\r\n System.out.println();\r\n Stream<Object> stream1 = Arrays.stream(person_array);\r\n stream1.forEach(System.out::println);\r\n System.out.println();\r\n \r\n\t\t\r\n//sorting the employee list alphabetically based on their first name\r\n System.out.println(\"Sorting based on First names: \");\r\n System.out.println();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getFirstName()).compareTo(\"\"+((Person) b).getFirstName())); \r\n Stream<Object> stream2 = Arrays.stream(person_array);\r\n stream2.forEach(System.out::println);\r\n System.out.println();\r\n \r\n//sorting the employee list alphabetically based on their last name, if same last name, then sorting based on first name\r\n System.out.println(\"Sorting based on Last names: \");\r\n System.out.println();\r\n Arrays.sort(person_array, (a,b) -> (\"\"+((Person) a).getLastName()).compareTo(\"\"+((Person) b).getLastName())); \r\n Arrays.sort(person_array, (a, b) -> {\r\n \tint ck = (\"\" + ((Person) a).getLastName()).compareTo(\"\" + ((Person) b).getLastName()); // lastName\r\n \treturn ck != 0? ck:\r\n \t(\"\" + ((Person) a).getFirstName()).compareTo(\"\" + ((Person) b).getFirstName()); // then firstFame\r\n \t});\r\n\r\n Stream<Object> stream3 = Arrays.stream(person_array);\r\n stream3.forEach(System.out::println);\r\n System.out.println(); \r\n\t\t\r\n//showing the total average and the number of the total employees using a stream\r\n\t\t\t\tObject[] empl_array= employee_list.toArray();\r\n\t\t\t\tStream<Object> stream = Arrays.stream(empl_array);\r\n\t\t\t\tdouble avg= stream.mapToDouble(e->((Employee) e).getSalary().doubleValue()).average().getAsDouble();\r\n\t\t\t\tBigDecimal avg_sal= new BigDecimal(avg);\r\n\t\t\t\tSystem.out.print(\"The average salary is: \");\r\n\t\t\t\tSystem.out.printf(\"%.2f\", avg_sal);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(\"The total number of employees is: \"+ empl_array.length);\r\n\t\t\t\tSystem.out.println();\r\n \t\t \r\n//grouping the employees based on their salary range\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tMap<Object, DoubleSummaryStatistics> result = employee_list.stream()\r\n\t\t\t\t\t\t\t.collect(Collectors.groupingBy(emp -> \r\n\t\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 25000 ? \"<25000\" :\r\n\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 40000 ? \"25000-40000\" :\r\n\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() < 70000 ? \"40000-70000\" :\r\n\t\t\t\t\t\t\t\t\t ((Employee) emp).getSalary().doubleValue() > 70000 ? \">70000\" : \">70000\",\r\n\t\t\t\t\t\t\t\t Collectors.summarizingDouble(emp -> ((Employee) emp).getSalary().doubleValue())));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_25 = result.get(\"<25000\");\r\n\t\t\t\tdouble avg_25 = sal_25 == null ? 0.0 : sal_25.getAverage();\r\n\t\t\t\tSystem.out.println(\"<25000 --> employee count: \" + sal_25.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_25));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_25_40 = result.get(\"25000-40000\");\r\n\t\t\t\tdouble avg_25_40 = sal_25_40 == null ? 0.0 : sal_25_40.getAverage();\r\n\t\t\t\tSystem.out.println(\"25000-40000 --> employee count: \" + sal_25_40.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_25_40));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_40_70 = result.get(\"40000-70000\");\r\n\t\t\t\tdouble avg_40_70 = sal_40_70 == null ? 0.0 : sal_40_70.getAverage();\r\n\t\t\t\tSystem.out.println(\"40000-70000 --> employee count: \" + sal_40_70.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_40_70));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\tDoubleSummaryStatistics sal_70 = result.get(\">70000\");\r\n\t\t\t\tdouble avg_70 = sal_70 == null ? 0.0 : sal_70.getAverage();\r\n\t\t\t\tSystem.out.println(\">70000 --> employee count: \" + sal_70.getCount() + \" --> avg salary: \" + String.format(\"%.2f\",avg_70));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t}",
"public void sortByName()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //for each RideLines's index\n for(int i = 0; i<currentRide; i++)\n {\n //assume thet the smallest name is the one we start with \n int minIndex= i;\n \n //finding the index of the(alphabetically) lowest RideLines name, \n //k: the index to start searching for the lowest name\n for(int k= minIndex+1; k<currentRide; k++)\n {\n //if the other RideLines has a lower name, they are the low name\n if(rides[k].getName().compareTo(rides[minIndex].getName())<0)\n { \n // standard swap, using a temporary. swap the smallest name\n RideLines temp = rides[k];\n rides[k]=rides[i];\n rides[i]=temp;\n \n swapMade=true; //remember this pass made at least one swap\n } \n\n }\n\n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }",
"private void orderSegments() {\n //insert numOrder for the db\n int i = 0;\n for(TransportSegmentLogic transportSegment: transportSegments){\n transportSegment.setOrder(i);\n i++;\n }\n\n\n\n /*int i = 0;\n int j = 1;\n\n\n TransportSegmentLogic swapSegment;\n\n while(j < transportSegments.size()){\n if(transportSegments.get(j).getOrigin().equals(transportSegments.get(i).getDestination())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(i +1, swapSegment);\n i = i + 1;\n j = i + 1;\n }\n j++;\n }\n\n j = transportSegments.size() -1;\n\n while(j > i){\n if(transportSegments.get(j).getDestination().equals(transportSegments.get(0).getOrigin())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(0, swapSegment);\n i = i + 1;\n j = transportSegments.size();\n }\n j--;\n } */\n }",
"private void addPartList ()\r\n {\r\n // Map (page) ScorePart -> (score) ScorePart data\r\n List<ScorePart> partList = new ArrayList<>();\r\n\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n partList.add(scorePart);\r\n }\r\n\r\n // Need map: pagePart instance -> set of related systemPart instances\r\n // (Since we only have the reverse link)\r\n Map<ScorePart, List<SystemPart>> page2syst = new LinkedHashMap<>();\r\n\r\n for (TreeNode pn : score.getPages()) {\r\n Page page = (Page) pn;\r\n\r\n for (TreeNode sn : page.getSystems()) {\r\n ScoreSystem system = (ScoreSystem) sn;\r\n\r\n for (TreeNode n : system.getParts()) {\r\n SystemPart systPart = (SystemPart) n;\r\n\r\n ScorePart pagePart = systPart.getScorePart();\r\n List<SystemPart> cousins = page2syst.get(pagePart);\r\n\r\n if (cousins == null) {\r\n cousins = new ArrayList<>();\r\n page2syst.put(pagePart, cousins);\r\n }\r\n\r\n cousins.add(systPart);\r\n }\r\n }\r\n }\r\n\r\n // Align each candidate to its related result (System -> Page -> Score)\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n int newId = scorePart.getId();\r\n\r\n for (Candidate candidate : connection.getResultMap().get(result)) {\r\n ScorePart pagePart = (ScorePart) candidate.getUnderlyingObject();\r\n // Update (page) part id\r\n pagePart.setId(newId);\r\n\r\n // Update all related (system) part id\r\n for (SystemPart systPart : page2syst.get(pagePart)) {\r\n systPart.setId(newId);\r\n }\r\n }\r\n }\r\n\r\n score.setPartList(partList);\r\n }",
"public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }",
"private void sortByLastName() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int alphaSmallerIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getHolder().getLastNameFirstName().compareTo(accounts[alphaSmallerIndex].getHolder().getLastNameFirstName()) < 0) {\n alphaSmallerIndex = j;\n }\n Account acc = accounts[alphaSmallerIndex];\n accounts[alphaSmallerIndex] = accounts[i];\n accounts[i] = acc;\n }\n }",
"public static void main(String[] args) {\nScanner ttt=new Scanner(System.in);\r\nint pp;\r\nout.println(\"Enter the no. of Employees \");\r\npp=ttt.nextInt();\r\n\t\tEmployeeArr[] emp=new EmployeeArr[pp];\r\n\t\t\r\n\t\tint i;\r\n\t\tfor(i=0;i<emp.length;i++) {\r\n\t\t\temp[i]=new EmployeeArr();\r\n\t\t\tout.print(\"Enter \");\r\n\t\t\tout.print(i+1+\" \");\r\n\t\t\temp[i].get();\r\n\t\t}\r\n\t\tfor(int j=0;j<emp.length;j++) {\r\n\t\t\tout.print(j+1+\" \");\r\n\t\t\temp[j].show();\r\n\t\t}\r\n\t\t EmployeeArr temp=new EmployeeArr();\r\n\t\tfor(int k=0;k<emp.length;k++) {\r\n\t\t\tfor(int m=1;m<emp.length;m++) {\r\n\t\t\t\tif(emp[k].id >emp[m].id){\r\n\t\t\t\t\ttemp=emp[k];\r\n\t\t\t\t\temp[k]=emp[m];\r\n\t\t\t\t\temp[m]=temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tout.println(\"Sorted array are \");\r\n\t\tfor(int l=0;l<emp.length;l++) {\r\n\t\t\tout.print(l+1+\" \");\r\n\t\t\temp[l].show();\r\n\t\t}\r\n\t}",
"public void sort() {\n\t\tArrays.sort(contactList, 0, contactCounter);\n\t}",
"public static void quickSortTest(){\n\t\tTransformer soundwave = new Transformer(\"Soundwave\", 'D', new int[] {8,9,2,6,7,5,6,10});\n\t\tTransformer bluestreak = new Transformer(\"Bluestreak\", 'A', new int[] {6,6,7,9,5,2,9,7});\n\t\tTransformer hubcap = new Transformer(\"Hubcap\", 'A', new int[] {4,4,4,4,4,4,4,4});\n\t\tTransformer abominus = new Transformer(\"Abominus\", 'D', new int[] {10,1,3,10,5,10,8,4});\n\t\t\n\t\tgame.addTransformer(soundwave);\n\t\tgame.addTransformer(bluestreak);\n\t\tgame.addTransformer(hubcap);\n\t\tgame.addTransformer(abominus);\n\t\t\n\t\tgame.sortCompetitorsByRank();\n\t\tgame.printSortedRoster();\n\t}",
"public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"public void sortNames() {\n\t\t\n\t\t\n\t\tSystem.out.println( \"\\nTASK [4]> Match names with e-mails, check for duplicate e-mails: \\n\");\n\t\t\n\t\t// Adding all names / e-mails to ArrayLists, avoiding blank lines\n\t\tArrayList<String> allNames = new ArrayList<String>();\n\t\tArrayList<String> allEmails = new ArrayList<String>();\n\t\t\n\t\tfor(int col = 1; col < 3; ++col) {\n\t\t\t\n\t\t\tString[] namesCol = columns.get(col);\n\t\t\tString[] emailsCol = columns.get(col + 2);\n\t\t\t\n\t\t\t// omit the first row with col. names\n\t\t\tfor(int row = 1; row < namesCol.length; ++row) {\n\t\t\t\t\n\t\t\t\tif(!namesCol[ row ].isBlank()) {\n\t\t\t\t\tallNames.add( namesCol[ row ] );\t\t\t\t\t\n\t\t\t\t\tallEmails.add( emailsCol[ row ]);\n\t\t\t\t } \t\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"Names, e-mails (both columns): \\n\");\n\t\t\n\t\t\n\t\tfor(int row = 0; row < allNames.size(); ++row) {\n\t\t\tSystem.out.print( allNames.get(row) + \" \" + allEmails.get(row) + \"\\n\");\n\t\t}\n\t\t\n\t\t\n\t\t// checking for duplicates\n\t\tString[] emails = allEmails.toArray( new String[ allEmails.size() ] );\n\t\tArrayList<String> duplEmails = this.findDuplicates( emails ); \n\t\t\n\n\t\t\n\t\tSystem.out.println(\"\\nStudents with same emails: \\n\");\n\t\t\t\t\n\t\tfor(int dupl = 0; dupl < duplEmails.size(); ++ dupl) {\n\t\t\t\n\t\t\tString duplicate_i = duplEmails.get(dupl);\n\t\t\tfor(int row = 0; row < allEmails.size(); ++ row) {\n\t\t\t\t\n\t\t\t\tif(Objects.equals(allEmails.get(row), duplicate_i ) ) {\n\t\t\t\t\tSystem.out.println(allNames.get(row) + \" : \" + duplicate_i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println( \"----------------------------------------------------\");\n\t}",
"List<Sppprm> exportPrimesJourToPaie(List<Pointage> pointagesOrderedByDateAsc);",
"private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}",
"void topologicalSort() {\n\n\t\tfor (SimpleVertex vertice : allvertices) {\n\n\t\t\tif (vertice.isVisited == false) {\n\t\t\t\tlistset.add(vertice.Vertexname);\n\t\t\t\ttopologicalSortUtil(vertice);\n\n\t\t\t}\n\t\t}\n\n\t}",
"private void sortCorners(ArrayList<Point> corners) {\n Collections.sort(corners, new Comparator<Point>() {\n public int compare (Point a, Point b) {\n double val = a.y - b.y;\n if (val < 0) return -1;\n else if (val > 0) return 1;\n else return 0;\n }\n }\n );\n if (corners.size() > 1) {\n if (corners.get(0).x > corners.get(1).x) {\n Point temp = corners.get(0);\n corners.set(0, corners.get(1));\n corners.set(1, temp);\n }\n }\n if (corners.size() > 3) {\n if (corners.get(2).x > corners.get(3).x) {\n Point temp = corners.get(2);\n corners.set(2, corners.get(3));\n corners.set(3, temp);\n }\n }\n }",
"private void setVoteOrder() {\n\t\tfor (int i = 1; i < temp.size(); i++) {\n\t\t\t// deleting the comma from the name\n\t\t\tString s = temp.elementAt(i).replaceAll(\",\", \"\");\n\t\t\t// creating a vector \"tempVoteOrder\" to store the preferences of\n\t\t\t// each voter\n=======\n\t\t\tCandidats.add(candidat);\n\t\t\ttempCandidats = tempCandidats.replaceFirst(\n\t\t\t\t\ttempCandidats.substring(0, tempCandidats.indexOf(\",\") + 1),\n\t\t\t\t\t\"\");// delete the first candidat in the String\n\t\t}\n\t\tfor (int j = 0; j < Candidats.size(); j++)\n\t\t\tCandidats.elementAt(j).setVowsPerRound(Candidats.size());// fill the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// vector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// size\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"candidats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0's\n\t}",
"public static <T extends Comparable<? super T>> void sortTest2(T[] a) {\n int N = a.length;\n for (int i = 1; i < N; i++) { \n // Insert a[i] among a[i-1], a[i-2], a[i-3]... ..\n for (int j = i; j > 0 && lessTest(a[j], a[j-1]); j--) {\n exch(a, j, j-1);\n }\n }\n }",
"private SeqIter addSortedServer(final SeqIter it1, final SeqIter it2) {\r\n if(it1 == null && it2 != null) return it2;\r\n if(it2 == null && it1 != null) return it1;\r\n \r\n final SeqIter tmp = new SeqIter();\r\n Item i1 = it1.next(), i2 = it2.next();\r\n while(i1 != null && i2 != null) {\r\n if(i1.score < i2.score) {\r\n tmp.add(i2);\r\n i2 = it2.next();\r\n } else if(i1.score > i2.score) {\r\n tmp.add(i1);\r\n i1 = it1.next();\r\n } else {\r\n tmp.add(i2);\r\n i1 = it1.next();\r\n i2 = it2.next();\r\n }\r\n \r\n }\r\n while((i1 = it1.next()) != null) tmp.add(i1);\r\n while((i2 = it2.next()) != null) tmp.add(i2);\r\n return tmp;\r\n }",
"public void insertionSort() {\n\t\tfor (int i = 1; i < numberOfElements; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\twhile (j > 0) {\n\t\t\t\tif (arr[j - 1] <= temp) {\n\t\t\t\t\tnumberOfComparisons++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnumberOfComparisons++;\n\t\t\t\tarr[j] = arr[j - 1];\n\t\t\t\tnumberOfCopies++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j] = temp;\n\t\t}\n\t}",
"@Override\n\tpublic int compare(Person p1, Person p2) { //because this class implements Comparator \n\t\treturn p1.id-p2.id;\n\t}",
"public static List<String> sortOrders(List<String> orderList) {\n // Write your code here\n List<String> primeOrders = new ArrayList<>();\n LinkedHashSet<String> nonPrimeOrders = new LinkedHashSet<>();\n for (String order : orderList) {\n String orderType = order.split(\" \")[1];\n try {\n int orderNum = Integer.parseInt(orderType);\n nonPrimeOrders.add(order);\n } catch (Exception e) {\n primeOrders.add(order);\n }\n }\n Collections.sort(primeOrders, new Comparator<String>() {\n \n @Override\n public int compare(String s1, String s2) {\n String[] s1Elements = s1.split(\" \");\n String[] s2Elements = s2.split(\" \");\n int i = 1;\n while (i < s1Elements.length && i < s2Elements.length) {\n if (!s1Elements[i].equals(s2Elements[i])) {\n return s1Elements[i].compareTo(s2Elements[i]);\n }\n i++;\n }\n if (i < s1Elements.length) {\n return 1;\n }\n if (i < s2Elements.length) {\n return -1;\n }\n return s1Elements[0].compareTo(s2Elements[0]);\n }\n \n });\n for (String nonPrimeOrder : nonPrimeOrders) {\n primeOrders.add(nonPrimeOrder);\n }\n return primeOrders;\n }",
"private void insertionSort(ArrayList<ArrayList<Piece>> combinations2) {\n for (int index = 1; index < combinations2.size(); index++) {\n ArrayList<Piece> compareWord = combinations2.get(index);\n\n int lowerIndex = index-1;\n\n while (lowerIndex >=0 && compareWord.size()<combinations2.get(lowerIndex).size()){\n combinations2.set(lowerIndex+1, combinations2.get(lowerIndex));\n lowerIndex--;\n }\n\n combinations2.set(lowerIndex+1,compareWord);\n }\n }",
"private List<PmTableGenericRow<T_ROW_ELEMENT_PM>> ensureSortedRows(List<PmTableGenericRow<T_ROW_ELEMENT_PM>> rows) {\n if (sortOrderSelection == null) {\n // generates the sort order container.\n getColumns();\n }\n\n List<PmTableGenericRow<T_ROW_ELEMENT_PM>> existingList = sortOrderSelection.sortedRows;\n if (existingList == null) {\n if (sortOrderSelection.sortCol != null) {\n // Assign a new list after sorting to prevent concurrent modification problems.\n ArrayList<PmTableGenericRow<T_ROW_ELEMENT_PM>> tempList = new ArrayList<PmTableGenericRow<T_ROW_ELEMENT_PM>>(rows);\n Collections.sort(tempList, new RowComparator(sortOrderSelection));\n sortOrderSelection.assignSortedRows(tempList);\n\n return sortOrderSelection.sortedRows;\n }\n else {\n sortOrderSelection.assignSortedRows(new ArrayList<PmTableGenericRow<T_ROW_ELEMENT_PM>>(rows));\n return sortOrderSelection.sortedRows;\n }\n }\n else {\n return existingList;\n }\n }",
"public static <T extends Comparable<T>> \n\t\t\t\t\t\t void sorteringVedInsetting(T[] data) {\n\t\tfor (int index=1; index<data.length; index++) {\n\t\t\tT nokkel = data[index];\n\t\t\tint p = index;\n\t\t\twhile (p > 0 && nokkel.compareTo(data[p-1])<0) {\n\t\t\t\tdata[p]=data[p-1];\n\t\t\t\tp--;\n\t\t\t}\n\t\t\tdata[p]=nokkel;\n\t\t}\n\t}",
"@Override\r\n\tpublic int compareTo(Venue o) {\r\n\t\treturn o.getAvailableTickets() - this.getAvailableTickets();\r\n\t}",
"private static void sortingOptions(ArrayList<Person> p) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tArrayList<Person> personList = p;\n\t\tboolean again = true;\n\t\twhile (again) {\n\t\t\tagain = false;\n\t\t\tSystem.out.println(\"Ascending or descending?\\n\" + \"1: Ascending\\n\" + \"2: Descending\");\n\t\t\tint input = scan.nextInt();\n\n\t\t\tswitch (input) {\n\t\t\tcase 1:\n\t\t\t\tprintDataFormat(personList);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tCollections.reverse(personList);\n\t\t\t\tprintDataFormat(personList);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tagain = true;\n\t\t\t\tSystem.out.println(\"Enter either 1 or 2\");\n\t\t\t}\n\t\t}\n\t\tscan.close();\n\t}",
"private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }",
"@Override\r\n /**\r\n * *\r\n *Primero revisa si los apellidos con iguales, en el caso de que sean iguales\r\n *entra al if y compara por nombres, de lo contrario nunca entra al if y \r\n * compara normalmente por apellido\r\n * \r\n */ \r\n public void ordenarPersonas (){\r\n Comparator<Persona> comparacionPersona= (Persona persona1,Persona persona2)->{\r\n \r\n if(persona1.getApellidos().compareToIgnoreCase(persona2.getApellidos())==0){\r\n return persona1.getNombres().compareToIgnoreCase(persona2.getNombres());}\r\n return persona1.getApellidos().compareToIgnoreCase(persona2.getApellidos());\r\n }; \r\n\r\n listaPersona.sort(comparacionPersona);\r\n }",
"@Override\n\t\t\t\tpublic int compare(PartnerDemand lhs, PartnerDemand rhs) {\n\t\t\t\t\treturn rhs.getCreatedAt().compareTo(lhs.getCreatedAt());\n\t\t\t\t}",
"private void sortByLastName() { \n\t\t\n\t\tint numAccounts = size;\n\t\tString firstHolder_lname;\n\t\tString secondHolder_lname;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstHolder_lname = (accounts[j].getHolder()).get_lname();\n\t\t\t\tsecondHolder_lname = (accounts[min_idx].getHolder()).get_lname();\n\t\t\t\t\n\t\t\t\tif (firstHolder_lname.compareTo(secondHolder_lname) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\n\t\t\t\n\t\t}\n\t}",
"@Test\n\tvoid SelectionSortTest() \n\t{\t\n\t\tint[] twoNumbers = new int[] {2, 1};\n\t\tint[] expTwoNumbers = new int[] {1, 2};\n\t\tint[] everyOther = new int[] {1, 3, 5, 6, 4, 2};\n\t\tint[] expEveryOther = new int[] {1, 2, 3, 4, 5, 6};\n\t\tint[] smallestFirst = new int[] {1, 2, 5, 6, 3, 4};\n\t\tint[] expSmallestFirst = new int[] {1, 2, 3, 4, 5, 6};\n\t\tint[] smallestMiddle = new int[] {3, 4, 1, 2, 5, 6};\n\t\tint[] expSmallestMiddle = new int[] {1, 2, 3, 4, 5, 6};\n\t\t\n\t\tassertArrayEquals(expTwoNumbers, utilities.SelectionSort(twoNumbers));\n\t\tassertArrayEquals(expEveryOther, utilities.SelectionSort(everyOther));\n\t\tassertArrayEquals(expSmallestFirst, utilities.SelectionSort(smallestFirst));\n\t\tassertArrayEquals(expSmallestMiddle, utilities.SelectionSort(smallestMiddle));\n\t}",
"public void sortProposals() {\n\n\t}",
"public DynamicPart[] sortParts(DynamicPart[] parts) {\n Arrays.sort(parts, (DynamicPart a, DynamicPart b) -> {\n return a.dynamic.ordinal() - b.dynamic.ordinal();\n });\n return parts;\n }"
]
| [
"0.6138682",
"0.60294974",
"0.5756289",
"0.56024927",
"0.55455923",
"0.54713887",
"0.5444038",
"0.53816015",
"0.53688145",
"0.5351534",
"0.53267056",
"0.5303028",
"0.52577066",
"0.5256751",
"0.5236519",
"0.52300197",
"0.5226727",
"0.52249134",
"0.5198696",
"0.51929384",
"0.51863474",
"0.51841766",
"0.5175587",
"0.5172788",
"0.51666826",
"0.51488084",
"0.5144694",
"0.5140348",
"0.513485",
"0.51295114",
"0.5122456",
"0.51202935",
"0.5108819",
"0.5101041",
"0.5098415",
"0.5086714",
"0.50849664",
"0.50737447",
"0.50702107",
"0.5063048",
"0.5047048",
"0.5047048",
"0.50363266",
"0.50293696",
"0.5023412",
"0.5021322",
"0.50121087",
"0.5003357",
"0.50022113",
"0.49987537",
"0.49935082",
"0.49771369",
"0.49653766",
"0.49636155",
"0.4961371",
"0.4956822",
"0.49559477",
"0.49551806",
"0.49488437",
"0.49392816",
"0.49383864",
"0.49340636",
"0.491863",
"0.4917865",
"0.4910349",
"0.490488",
"0.4900341",
"0.4899234",
"0.489617",
"0.4894923",
"0.48946673",
"0.48931256",
"0.48897266",
"0.4876191",
"0.4871172",
"0.4867695",
"0.48666298",
"0.4864696",
"0.4862989",
"0.48616108",
"0.48567736",
"0.4852711",
"0.4848216",
"0.48425573",
"0.48409578",
"0.48387048",
"0.48364735",
"0.48360607",
"0.48332062",
"0.48270157",
"0.48259315",
"0.48219138",
"0.48213094",
"0.4819886",
"0.48171085",
"0.48170012",
"0.48155314",
"0.4812879",
"0.4812046",
"0.48119226"
]
| 0.73542446 | 0 |
/perfect matching will simply be the one with the first Arraylist | private Matching getBruteForceCorrectMatching(ArrayList<Matching> stableMatchings, ArrayList<ArrayList<Integer>> validPartners) {
for (int matching = 0; matching < stableMatchings.size(); matching++) {
if (stableMatchings.get(matching).getResidentMatching().equals(validPartners.get(0)))
return stableMatchings.get(matching);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int match(ArrayList<ImageCell> images);",
"public static List<Integer> lcs(List<Integer> arr1, List<Integer> arr2) {\r\n ArrayList empty = new ArrayList();\r\n /* BEFORE WE ALLOCATE ANY DATA STORAGE, VALIDATE ARGS */\r\n if (null == arr1 || 0 == arr1.size())\r\n return empty;\r\n if (null == arr2 || 0 == arr2.size())\r\n return empty;\r\n\r\n if (equalLists(arr1, arr2)) {\r\n return arr1;\r\n }\r\n\r\n /* ALLOCATE VARIABLES WE'LL NEED FOR THE ROUTINE */\r\n ArrayList<Integer> bestMatch = new ArrayList<Integer>();\r\n ArrayList<Integer> currentMatch = new ArrayList<Integer>();\r\n ArrayList<List<Integer>> dataSuffixList = new ArrayList<List<Integer>>();\r\n ArrayList<List<Integer>> lineSuffixList = new ArrayList<List<Integer>>();\r\n\r\n /* FIRST, COMPUTE SUFFIX ARRAYS */\r\n for (int i = 0; i < arr1.size(); i++) {\r\n dataSuffixList.add(arr1.subList(i, arr1.size()));\r\n }\r\n for (int i = 0; i < arr2.size(); i++) {\r\n lineSuffixList.add(arr2.subList(i, arr2.size()));\r\n }\r\n\r\n /* STANDARD SORT SUFFIX ARRAYS */\r\n IntegerListComparator comp = new IntegerListComparator();\r\n Collections.sort(dataSuffixList, comp);\r\n Collections.sort(lineSuffixList, comp);\r\n\r\n /* NOW COMPARE ARRAYS MEMBER BY MEMBER */\r\n List<?> d = null;\r\n List<?> l = null;\r\n List<?> shorterTemp = null;\r\n int stopLength = 0;\r\n int k = 0;\r\n boolean match = false;\r\n\r\n bestMatch.retainAll(empty);\r\n bestMatch.addAll(currentMatch);\r\n for (int i = 0; i < dataSuffixList.size(); i++) {\r\n d = (List) dataSuffixList.get(i);\r\n for (int j = 0; j < lineSuffixList.size(); j++) {\r\n l = (List) lineSuffixList.get(j);\r\n if (d.size() < l.size()) {\r\n shorterTemp = d;\r\n } else {\r\n shorterTemp = l;\r\n }\r\n\r\n currentMatch.retainAll(empty);\r\n k = 0;\r\n stopLength = shorterTemp.size();\r\n match = (l.get(k).equals(d.get(k)));\r\n while (k < stopLength && match) {\r\n if (l.get(k).equals(d.get(k))) {\r\n currentMatch.add((Integer) shorterTemp.get(k));\r\n k++;\r\n } else {\r\n match = false;\r\n }\r\n }\r\n if (currentMatch.size() > bestMatch.size()) {\r\n bestMatch.retainAll(empty);\r\n bestMatch.addAll(currentMatch);\r\n }\r\n }\r\n }\r\n return bestMatch;\r\n }",
"static void UseArrayList(ArrayList<Integer> myList2){\r\n\t\tLong start = System.currentTimeMillis();\r\n\t\tfor (int n=0; n<myList2.size();n++)\r\n\t\t{\r\n\t\t\tfor (int m=n+1; m<myList2.size();m++){\r\n\t\t\t\tif( myList2.get(n)== myList2.get(m) ) {System.out.println(\"Duplicate found \"+myList2.get(n));}\r\n\t\t\t}\r\n\t\t}\r\n\t\tLong End = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"Total time taken for executing this code is: \" + (End-start));\r\n\t}",
"private <T> T findActual(T matchingObject, List<? extends T> list) {\n T actual = null;\n for (T check : list) {\n if (check.equals(matchingObject)) {\n actual = check;\n }\n }\n return actual;\n }",
"public static ArrayList<Match> getMatchesForSeason(ArrayList<FootballClub> seasonBasedClub){\n\n // these both arrayList will be of the same size\n ArrayList<Match> matchesDisplayed = new ArrayList<>();\n ArrayList<Match> allMatches = new ArrayList<>();\n\n // populating the allMatches list will all the matches from the seasonBasedClub\n // adding all the matches played for that season inside the allMatches list\n for (FootballClub footballClub: seasonBasedClub) {\n allMatches.addAll(footballClub.getMatchesPlayed());\n\n }\n\n // sort the matches in ascending order of the date\n Comparator<Match> sortByDate = (match1, match2) -> {\n\n if(match1.getDate().getYear() == match2.getDate().getYear()){\n if (match1.getDate().getMonth() == match2.getDate().getMonth()) {\n if (match1.getDate().getDay() > match2.getDate().getDay()) {\n return 1;\n }\n } else if (match1.getDate().getMonth() > match2.getDate().getMonth()) {\n return 1;\n }\n }else if (match1.getDate().getYear() > match2.getDate().getYear()) {\n return 1;\n }\n\n return -1;\n };\n allMatches.sort(sortByDate); // sorting the matches according to the date\n\n // MAIN CODE FOR EXTRACTING THE NECESSARY SET OF MATCHES (NO DUPLICATES)\n for (Match match : allMatches) {\n\n boolean matchNotAvailable = true;\n\n // NOTE THAT THIS IS TO PREVENT THE REPEATING OF MATCHES IN ALL CLUBS WHICH IS DUPLICATING\n for (Match value : matchesDisplayed) {\n if (match.getOpponentClubName().equalsIgnoreCase(value.getParticipatedCLubName())) {\n // NOTE: goal scored from the club is equal to goal received from the opponent club\n if (\n (value.getGoalReceived() == match.getGoalScored()) &&\n (value.getGoalScored() == match.getGoalReceived()) &&\n (value.getMatchType().equalsIgnoreCase(match.getMatchType())) &&\n (value.getDate().equals(match.getDate()))\n ) {\n matchNotAvailable = false;\n }\n }\n }\n // WE ADD THE NON DUPLICATED MATCHES INTO THIS LIST AND SEND IT TO THE VIEWS\n if (matchNotAvailable) {\n matchesDisplayed.add(match);\n }\n }\n return matchesDisplayed;\n }",
"private static String bestMatch(String s,ArrayList<Token>list) {\n\t\tfor(int i = 0; i<list.size();i++){\n\t\t\tif(list.get(i).value.equals(s)){\n\t\t\t\treturn s;\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"private boolean compareList(ArrayList<Point> solutions2, ArrayList<Point> current) {\r\n\t\treturn solutions2.toString().contentEquals(current.toString());\r\n\t}",
"@Test\n public void getMatchListTest2()\n {\n RiotApiHandler userTest=RiotApiHandler.getInstance();\n String[] array= {\"EUN1_2775220260\", \"EUN1_2774180103\", \"EUN1_2773714308\", \"EUN1_2773662778\", \"EUN1_2772530238\", \"EUN1_2772505023\",\n \"EUN1_2772491193\", \"EUN1_2772005021\", \"EUN1_2771803452\", \"EUN1_2769206534\", \"EUN1_2767311256\", \"EUN1_2767113653\", \"EUN1_2767101111\",\n \"EUN1_2767036478\", \"EUN1_2766884534\", \"EUN1_2766808664\", \"EUN1_2766432042\", \"EUN1_2766071093\", \"EUN1_2766077729\", \"EUN1_2765668508\"\n };\n ArrayList<String> correct = new ArrayList<>(Arrays.asList(array));\n Assert.assertNotEquals(correct , userTest.getMatchlist(\"Stains of Time\",\"eun1\"));\n }",
"private void compareSecondPass() {\n final int arraySize = this.oldFileNoMatch.size()\r\n + this.newFileNoMatch.size();\r\n this.compareArray = new SubsetElement[arraySize][2];\r\n final Iterator<String> oldIter = this.oldFileNoMatch.keySet()\r\n .iterator();\r\n int i = 0;\r\n while (oldIter.hasNext()) {\r\n final String key = oldIter.next();\r\n final SubsetElement oldElement = this.oldFileNoMatch.get(key);\r\n SubsetElement newElement = null;\r\n if (this.newFileNoMatch.containsKey(key)) {\r\n newElement = this.newFileNoMatch.get(key);\r\n }\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n // now go through the new elements and check for any that have no match.\r\n // these will be new elements with no corresponding old element\r\n final SubsetElement oldElement = null;\r\n final Iterator<String> newIter = this.newFileNoMatch.keySet()\r\n .iterator();\r\n while (newIter.hasNext()) {\r\n final String key = newIter.next();\r\n if (!this.oldFileNoMatch.containsKey(key)) {\r\n final SubsetElement newElement = this.newFileNoMatch.get(key);\r\n this.compareArray[i][0] = oldElement;\r\n this.compareArray[i][1] = newElement;\r\n i++;\r\n }\r\n\r\n }\r\n\r\n }",
"private Vector<Integer> matchCheckPoint(List<Point> a) {\t\t\t\n\t\tVector<Integer> iDS= new Vector<>();\n\t\tfor(Point p :a) {\n\t\t\tif(!getAsphalt(p.x, p.y,this.trk).isIdDefalt()) {\n\t\t\t\tiDS.add(getAsphalt(p.x, p.y,this.trk).getId());\n\t\t\t}\n\t\t}\n\t\treturn iDS;\n\t}",
"@Test\n public void getMatchListTest()\n {\n RiotApiHandler userTest=RiotApiHandler.getInstance();\n String[] array= {\"EUN1_2813356879\", \"EUN1_2797819662\", \"EUN1_2797712721\", \"EUN1_2797709856\", \"EUN1_2797693226\", \"EUN1_2797682448\", \"EUN1_2797526002\",\n \"EUN1_2797504038\", \"EUN1_2797540836\", \"EUN1_2794696829\", \"EUN1_2791827193\", \"EUN1_2791781454\", \"EUN1_2791655029\",\n \"EUN1_2791596648\", \"EUN1_2786187593\", \"EUN1_2785993952\", \"EUN1_2727858238\", \"EUN1_2727671015\", \"EUN1_2727312718\", \"EUN1_2727226847\"\n };\n ArrayList<String> correct = new ArrayList<>(Arrays.asList(array));\n //test fails, I play this game everyday so the matchlist changes constantly, it all works real good (source ---> trust me :ok:)\n Assert.assertEquals(correct ,userTest.getMatchlist(\"8f9zu86yj87xgh76\",\"eun1\"));\n }",
"private static boolean fun3(List<String> res, List<String> ac1) {\n\t\tHashSet<String> hs=new HashSet<String>();\r\n\t\tfor(int i=0;i<res.size();i++){\r\n\t\t\ths.add(res.get(i));\r\n\t\t}\r\n\t\tfor(int i=0;i<ac1.size();i++){\r\n\t\t\tif(hs.contains(ac1.get(i)))\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test\n public void test1() {\n final List<String> listA = Arrays.asList(\"Fremont\", \"Dublin\", \"anamole\", \"San Jose\" , \"SFO\", \"Dublin\", \"San Jose\", \"paramount\", \"y\");\n final List<String> listB = Arrays.asList(\"Dublin\", \"san mateo\", \"los angeles\", \"san mateo\", \"fremont\", \"anamole\", \"x\", \"x\", \"Y\");\n final List<String> common = FindIntersection.findCommonLists(listA, listB);\n System.out.println(Arrays.toString(FindIntersection.findCommonLists(listA, listB).toArray()));\n\n }",
"static List compareList(List<Integer> test, List<Integer> results) {\r\n\r\n if (test.size() > results.size()) {\r\n results = test;\r\n }\r\n\r\n return results;\r\n }",
"public static void main(String[] args) {\n\t\tList l=new ArrayList();\r\n\t\tl.add(12);\r\n\t\tl.add(45);\r\n\t\tl.add(15);\r\n\t\tl.add(78);\r\n\t\t\r\n\t\tList l2=new ArrayList();\r\n\t\tl2.add(12);\r\n\t\tl2.add(45);\r\n\t\tl2.add(10);\r\n\t\tl2.add(78);\r\n\t\t\r\n\t\tBoolean m=l.containsAll(l2);\r\n\t\t\r\n\t\tif(m)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Elements are same\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Not equal\");\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"private static boolean compareList(List<Object> l1, List<Object> l2)\n {\n int count=0;\n for (Object o : l1)\n {\n Object temp = o;\n for (Object otemp : l2)\n {\n if (EqualsBuilder.reflectionEquals(temp, otemp))\n {\n count++;\n }\n }\n\n }\n\n if(count == l1.size()) return true;\n return false;\n\n }",
"int getMatchedElements();",
"public Collection<MatchingPair> matchingPairs(Collection<Integer> values, Integer targetSum)\n {\n HashMap<Integer, Integer> tableCompteur = new HashMap<>();\n LinkedHashMap<Integer, Integer> tablePaire = new LinkedHashMap<Integer, Integer>();\n Collection<MatchingPair> paireSansDuplication = new LinkedList();\n Collection<MatchingPair> solution = new LinkedList();\n\n // On itere sur les valeurs donnee pour savoir le compte de chaque valeur\n for (Integer valeur : values)\n {\n if (tableCompteur.containsKey(valeur))\n {\n // Partie Compteur\n Integer compteur = tableCompteur.get(valeur);\n compteur++;\n tableCompteur.put(valeur, compteur);\n }\n else {\n tableCompteur.put(valeur, 0);\n }\n\n }\n\n // On itere sur les valeurs donnee pour savoir les paires\n for (Integer element : values)\n {\n int temp = targetSum - element;\n if (tablePaire.containsKey(element))\n {\n if (tablePaire.get(element) != null)\n {\n paireSansDuplication.add(new MatchingPair(element, temp));\n }\n // si la table contient l'element on met nul pour ne pas avoir de repetition\n tablePaire.put(temp, null);\n }\n else if (!tablePaire.containsKey(element))\n {\n tablePaire.put(temp, element);\n }\n }\n\n // On trouve le minimum count entre les paire et leur compte pour tenir en compte de toutes les possibilites. Ici le meilleur cas reste O(n) ( pas de paire)\n for (MatchingPair paire : paireSansDuplication)\n {\n if (paire != null) { // verification au debug pr erreur nullpointer\n int a = tableCompteur.get(paire.first);\n int b = tableCompteur.get(paire.second);\n int minCount = Math.min(a+1, b+1);\n for (int i = 0; i < pow(minCount, 2); i++)\n {\n solution.add(new MatchingPair(paire.first, paire.second));\n }\n }\n }\n return solution;\n }",
"@Test\n public void testIntersectionOfLists() {\n System.out.println(\"IntersectionOfLists\");\n ArrayList<Integer> arr1 = new ArrayList<>();\n arr1.add(12);\n arr1.add(10);\n arr1.add(23);\n ArrayList<Integer> arr2 = new ArrayList<>();\n arr2.add(23);\n arr2.add(10);\n Collections.sort(arr2);\n ArrayListRecursive instance = new ArrayListRecursive(arr1, arr2);\n List result = instance.IntersectionOfLists();\n Collections.sort(result);\n assertEquals(arr2, result);\n }",
"private static void fun2(List<String> ac1, List<List<String>> result, int index) {\n\t\tString key = ac1.get(0);\r\n\t\tfor(int i=index;i<result.size();i++){\r\n\t\t\tList<String> res=result.get(i);\r\n\t\t\tif(res.get(0).equals(key)){\r\n\t\t\t\t//check if any one of the value is repeated\r\n\t\t\t\tboolean check=fun3(res,ac1);\r\n\t\t\t\tif(check){\r\n\t\t\t\t\tfor(int j=1;j<ac1.size();j++){\r\n\t\t\t\t\t\tres.add(ac1.get(i));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public ArrayList<ArrayList> intersection (ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(Document d: docs)\n {\n if(docs2.contains(d))\n {\n docs3.add(d);\n int docIndex = docs.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance.get(docIndex);\n int oldOcc = (int) occurrence.get(docIndex);\n relevance3.add(oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.add(occurrence2.get(docIndex2));\n }\n else\n {\n occurrence3.add(oldOcc);\n }\n popularity3.add(d.popularity);\n }\n \n }\n data = new ArrayList<ArrayList> ();\n data.add(docs3);\n data.add(relevance3);\n data.add(occurrence3);\n data.add(popularity3);\n \n return data;\n }",
"@Override\n public Matching stableMarriageGaleShapley_residentoptimal(Matching marriage) {\n\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false); //O(n)\n\n /*At first the resident can propose to all his list.\n Each time a proposal is made the hospital is removed from the list*/\n\n /*Trying to create a copy of the arraylist elements not copy of references*/\n ArrayList<ArrayList<Integer>> hospitalsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < n; i++) //O(n)\n hospitalsToProposeTo.add(new ArrayList<Integer>(resident_preference.get(i)));\n\n\n /*list of residents that still can propose(free and hasn't proposed to every hospital)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, n, 0, true); //O(n)\n\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++)\n hospitalResidents.add(new ArrayList<Integer>(0)); //O(m)\n\n /*Array list that holds the value of the lowest matched resident rank in each hospital\n * so each time a resident propose to a full hospital, the resident is swapped with the least ranked rmatched resident */\n ArrayList<Integer> lowestMatchedResidentRank = new ArrayList<Integer>();\n arrlistInit(lowestMatchedResidentRank, m, -1, false); //O(m)\n\n /*we enter the loop as long as some residents aren't done proposing to all hospitals yet O(mn*maximum no of spots)*/\n while (!proposing.isEmpty()) {\n\n /*Get the head of the proposing list*/\n for (int residentIndex = 0; residentIndex < proposing.size(); residentIndex++) {\n int resident = proposing.get(0);\n int hospital = 0;\n int hospitalIndex;\n /*Get the first hospital in the resident list which he hasn't proposed to yet, breaks if he can't no longer propose if matched*/\n for (hospitalIndex = 0; hospitalIndex < hospitalsToProposeTo.get(resident).size() && proposing.contains(resident); hospitalIndex++) {\n hospital = hospitalsToProposeTo.get(resident).get(0);\n int residentRank = hospital_preference.get(hospital).indexOf(resident);\n\n /*hospital is full, loop through the matched residents and see if anyone can be kicked out*/\n if (hospitalResidents.get(hospital).size() == hospitalSlots.get(hospital)) {\n\n if (residentRank < lowestMatchedResidentRank.get(hospital)) {\n /*1.Replace in hospitalResidents\n * 2.Add/remove in resident-matching\n * 3.Remove resident from the proposing list\n * 4.Check if matched resident still has hospitals to propose to (if yes, add to proposing)\n */\n int lowestMatchedResident = hospital_preference.get(hospital).get(lowestMatchedResidentRank.get(hospital));\n\n hospitalResidents.get(hospital).set(hospitalResidents.get(hospital).indexOf(lowestMatchedResident), resident);\n residentMatching.set(lowestMatchedResident, -1);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n if (!hospitalsToProposeTo.get(lowestMatchedResident).isEmpty()) {\n proposing.add(lowestMatchedResident);\n }\n\n /*set the lowest rank\n * TODO make it O(1)*/\n int min = 0;\n for (int i = 0; i < hospitalResidents.get(hospital).size(); i++) {\n int tempRank = hospital_preference.get(hospital).indexOf(hospitalResidents.get(hospital).get(i));\n if (tempRank > min)\n min = tempRank;\n }\n lowestMatchedResidentRank.set(hospital, min);\n\n }\n }\n\n /*If there is available spot*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n * 3.Set the lowest ranked resident\n * 4.Remove resident from proposing list\n */\n\n /*Update the lowest rank*/\n if (residentRank > lowestMatchedResidentRank.get(hospital))\n lowestMatchedResidentRank.set(hospital, residentRank);\n\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n proposing.remove(proposing.indexOf(resident));\n }\n\n /*1. Remove hospital from resident's hospitalsToProposeTo\n *2. If resident is matched or proposed to every possible hospital, remove resident from proposing list\n */\n\n hospitalsToProposeTo.get(resident).remove(hospitalsToProposeTo.get(resident).indexOf(hospital));\n if (hospitalsToProposeTo.get(resident).size() == 0 && proposing.contains(resident))\n proposing.remove(proposing.indexOf(resident));\n }\n }\n }\n\n marriage.setResidentMatching(residentMatching);\n return marriage;\n\n }",
"public int getExactMatches(PegArray master) \n\t{\n\t\tint sum = 0;\n\t\t// a match whenever the same index of both have the same value\n\t\tfor (int i = 0; i < pegs.length; i++) \n\t\t\tif (master.getPeg(i).getLetter() == pegs[i].getLetter())\n\t\t\t\tsum++;\n\t\t// set private instance variable to local variable to hold value\n\t\texactMatches = sum;\n\t\treturn sum;\n\t}",
"private static ArrayList<Result> getDirectMatches(DataManager myVocab, String querystr, \n\t\t\tString originalQuerystr, String type) {\n\t\t// perfectMatch is an ArrayList for a Result where the match\n\t\t// is to be considered an exact match.\n\t\tArrayList<Result> perfectMatch = new ArrayList<Result>();\n\t\t\n\t\t// imperfectResults are for all non-100% matches\n\t\tArrayList<Result> imperfectResults = new ArrayList<Result>();\n\t\t// Loop through the whole vocabulary list, quit if there's a perfect match\n\t\tfor (int i = 0; i<myVocab.vocab.size() && perfectMatch.size()<1; i++){\n\t\t\tString vocabTerm = myVocab.vocab.get(i).trim();\n\t\t\t// Clean up the vocabulary term string if it isn't case/punctuation sensitive\n\t\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\t\tvocabTerm = vocabTerm.toLowerCase();\n\t\t\t}\n\t\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\t\tvocabTerm = vocabTerm.replaceAll(\"[\\\\W_]\", \"\");\n\t\t\t}\n\t\t\t// The VocabID returned is always type/exact term\n\t\t\tString vocabID = type+\"/\"+myVocab.vocab.get(i);\n\t\t\t\n\t\t\t// Don't check for matching conditions if there's already a\n\t\t\t// perfect match, just get out of the loop ASAP, as there's nothing\n\t\t\t// to be gained after that point.\n\t\t\tif ((perfectMatch.size()<1 )&&(vocabTerm.equals(querystr))\n\t\t\t\t\t|| (myVocab.vocab.get(i).equals(originalQuerystr))){\t\t\t\t\n\t\t\t\tResult match = new Result(vocabID,myVocab.vocab.get(i),type, 100.0,true);\n\t\t\t\tperfectMatch.add(match);\n\t\t\t}else if(myVocab.capsSensitive()||myVocab.punctSensitive()){\n\t\t\t\t// if there's a matching value that just differs in \n\t\t\t\t// punctuation/capitalization or both, put it on the top\n\t\t\t\t// of the list\n\t\t\t\tif(myVocab.capsSensitive() && myVocab.vocab.get(i).toLowerCase().equals(querystr.toLowerCase())){\n\t\t\t\t\tResult possibleMatch = new Result(vocabID,myVocab.vocab.get(i),type, 99.0,false);\n\t\t\t\t\timperfectResults.add(possibleMatch);\n\t\t\t\t}\n\t\t\t\tif(myVocab.punctSensitive() && myVocab.vocab.get(i).replaceAll(\"[\\\\W_]\", \"\").equals(querystr.replaceAll(\"[\\\\W_]\", \"\"))){\n\t\t\t\t\tResult possibleMatch = new Result(vocabID,myVocab.vocab.get(i),type, 99.0,false);\n\t\t\t\t\timperfectResults.add(possibleMatch);\n\t\t\t\t}\n\t\t\t\tif(myVocab.punctSensitive() && myVocab.capsSensitive() && myVocab.vocab.get(i).replaceAll(\"[\\\\W_]\", \"\").toLowerCase().equals(querystr.replaceAll(\"[\\\\W_]\", \"\").toLowerCase())){\n\t\t\t\t\tResult possibleMatch = new Result(vocabID,myVocab.vocab.get(i),type, 99.0,false);\n\t\t\t\t\timperfectResults.add(possibleMatch);\n\t\t\t\t}\n\t\t\t\t//to do finish this!\n\t\t\t}else if ((perfectMatch.size()<1 )&&(vocabTerm.contains(querystr) || querystr.contains(vocabTerm))\n\t\t\t\t\t|| (myVocab.vocab.get(i).contains(originalQuerystr)) || (originalQuerystr.contains(myVocab.vocab.get(i)))){\n\t\t\t\tdouble score=0;\n\t\t\t\tif (querystr.length()>vocabTerm.length()){\n\t\t\t\t\tscore = ((double)vocabTerm.length()/(double)querystr.length())*100;\n\t\t\t\t}else{\n\t\t\t\t\tscore = ((double)querystr.length()/(double)vocabTerm.length())*100;\n\t\t\t\t}\n\t\t\t\tif (!myVocab.capsSensitive() && !myVocab.punctSensitive() && score >= (double)100){\n\t\t\t\t\tResult match = new Result(vocabID,myVocab.vocab.get(i),type, 100.0,true);\n\t\t\t\t\tperfectMatch.add(match);\n\t\t\t\t}\n\t\t\t\tResult possibleMatch = new Result(vocabID,myVocab.vocab.get(i),type, score,false);\n\t\t\t\timperfectResults.add(possibleMatch);\n\t\t\t}\n\t\t}\n\t\tif (perfectMatch.size()>0)\n\t\t\treturn perfectMatch;\n\t\telse\n\t\t\treturn imperfectResults;\n\t}",
"public void isAllRecommended() {\n //Get ScoredId\n for(int i = 0; i < originalList.size(); i++) {\n Boolean isPresent = true;\n\n ScoredId sc = originalList.get(i);\n\n long m = sc.getId();\n\n //Check if it is present in all other lists\n for(Map.Entry<Long, List<ScoredId>> entry : recMap.entrySet()) {\n List<ScoredId> sco = entry.getValue();\n\n HashSet moovies = new HashSet<>();\n\n for(int j=0; j < sco.size(); j++) {\n ScoredId mov = sco.get(j);\n\n long moo = mov.getId();\n\n moovies.add(moo);\n }\n\n if(!moovies.contains(m)){\n isPresent = false;\n }\n }\n\n //Movie should be added to list here, after all lists examined\n if(isPresent) {\n commonRec.add(sc);\n }\n }\n\n //Commenting out as was used for testing purposes.\n //System.out.println(commonRec);\n\n obtainFinalRecs();\n }",
"public void matchingcouple()\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Output :\");\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Following are the matching pairs \");\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0;i<womenmatchinlist.size();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t// print the matching pair from same index of men and women matching list\r\n\t\t\t\tSystem.out.println(menmatchinglist.get(i)+\" is engaged with \"+womenmatchinlist.get(i));\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}",
"public static void main(String[] args) {\n String[] data ={\"cars\",\"clothes\",\"jewelry\",\"women\"};\r\n List<String> list1 = Arrays.asList(data);\r\n \r\n ArrayList<String> list2 = new ArrayList<String>();\r\n list2.add(\"youtube\");\r\n list2.add(\"snapchat\");\r\n list2.add(\"instagram\");\r\n \r\n for(String x : list2)\r\n System.out.printf(\"%s \", x);\r\n \r\n Collections.addAll(list2, data);\r\n \r\n System.out.println();\r\n for(String x : list2)\r\n System.out.printf(\"%s \", x);\r\n System.out.println();\r\n \r\n System.out.println(Collections.frequency(list2, \"cars\"));\r\n \r\n boolean tof = Collections.disjoint(list1, list2);\r\n System.out.println(tof);\r\n \r\n if(tof)\r\n System.out.println(\"these list do not have anything in common\");\r\n else \r\n System.out.println(\"these list do have something in common!\");\r\n \r\n }",
"public List<String> match(List<String> someList)\n {\n char[] objectWord = this.aWord.toCharArray();\n Arrays.sort(objectWord);\n\n List<String> answer = new ArrayList<>();\n HashMap<String, Integer> mapForEachWord = new HashMap<>();\n\n for (int i = 0; i < someList.size(); i++)\n {\n String wordFromList = someList.get(i).toLowerCase();\n //mapForEachWord = processWord(wordFromList);\n\n char[] listWordArray = wordFromList.toCharArray();\n Arrays.sort(listWordArray);\n\n if (Arrays.equals(listWordArray, objectWord) && !this.aWord.equals(wordFromList))\n {\n answer.add(someList.get(i));\n }\n\n }\n\n return answer;\n }",
"public boolean happyList(ArrayList<String> original) {\n for(int i = 1; i < original.size(); i++){\n ArrayList<Character> lastChars = characterArrayListMaker(original.get(i-1));\n ArrayList<Character> currentChars = characterArrayListMaker(original.get(i));\n boolean compareFlag = false;\n for(Character last : lastChars){\n for(Character current : currentChars){\n if (last.equals(current)){\n compareFlag = true;\n }\n }\n }\n if(!compareFlag){\n return false;\n }\n }\n return true;\n }",
"private ArrayList<Point> findS(ArrayList<Point> s, Point p1, Point p2) {\n ArrayList<Point> s1 = new ArrayList<>();\n for(int i = 1; i < s.size(); i++){\n if(p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y > 0) {\n s1.add(s.get(i));\n }\n }\n return s1;\n }",
"public abstract Collection<T> getMatches(T first);",
"public ArrayList<String> getKeywordExactMatch(String word, ArrayList<String> allkeywords){\n ArrayList<String> arrayListResult = new ArrayList<String> ();\n ArrayList<String> ngramList;\n ArrayList<String> keywordList;\n int equalKeys = 0, ngramListSize;\n\n ngramList = processWord(word, \"_\");\n ngramListSize = ngramList.size();\n\n for (int iterator = 0; iterator<ngramListSize; iterator++)\n System.out.print(\"ngram\"+iterator+\":\"+ngramList.get(iterator)+\";\");\n System.out.print(\"\\n\");\n\n if (!allkeywords.isEmpty()) \n for (int i=0, i2 = allkeywords.size();i<i2;i++){\n keywordList = processWord(allkeywords.get(i), \" \");\n\n if (ngramListSize == keywordList.size())\n for (int h=0; h<ngramListSize;h++){\n if ( keywordList.get(h).startsWith(ngramList.get(h)) ){\n equalKeys++;\n System.out.println(\"keywordList»\"+keywordList+\"«ngramsList»\"+ngramList.get(h)+\"«equalKeys:\"+equalKeys);\n }\n else\n h = ngramListSize+999;\n }\n if (equalKeys == ngramListSize){\n arrayListResult.add(allkeywords.get(i));\n System.out.println(\"Added: \"+allkeywords.get(i));\n }\n equalKeys = 0;\n }\n return arrayListResult;\n }",
"void match(int groupSize, ArrayList<Buddy> unmatched){\n\t\tif (unmatched.size() <= groupSize) { //base case, put all the unmatched into one group\n\t\t\tArrayList<Buddy> group = new ArrayList<Buddy>();\n\t\t\tfor (Buddy b: unmatched) {\n\t\t\t\tSystem.out.printf(\"Matched %s in the last group.\\n\", b.name);\n\t\t\t\tgroup.add(b);\n\t\t\t}\n\t\t\tmatches.add(group);\n\t\t\treturn;\n\t\t}\n\n\t\tArrayList<Buddy> group = new ArrayList<Buddy>();\n\t\trecursiveIteration:\n\t\twhile (group.size() < groupSize) {\n\t\t\tCollections.shuffle(unmatched); //randomize order\n\t\t\tfor (int i = 0; i < unmatched.size(); i++) {\n\t\t\t\tBuddy b = unmatched.get(i);\n\t\t\t\tgroup.add(b);\n\t\t\t\tSystem.out.printf(\"Put %s in empty group.\\n\",b.name);\n\t\t\t\tunmatched.remove(b);\n\t\t\t\tfor (int j = 0; j < b.iterableInterests.size(); j++) { //finding an interest in order of preference\n\t\t\t\t\tString interest = b.iterableInterests.get(j);\n\t\t\t\t\tfor (int k = i; k < unmatched.size(); k++) { //finding a match\n\t\t\t\t\t\tif (k == i)\n\t\t\t\t\t\t\tcontinue; //skip over the same buddy we're already choosing a match for\n\t\t\t\t\t\tBuddy c = unmatched.get(k);\n\t\t\t\t\t\t\tfor (int l = 0; l < c.iterableInterests.size(); l++) {\n\t\t\t\t\t\t\t\tif (c.iterableInterests.get(l).equals(interest)) { //yay! we've got an interests match!\n\t\t\t\t\t\t\t\t\t\tif (group.size() < groupSize) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.printf(\"Matched %s and %s based on '%s'\\n\",b.name, c.name, interest);\n\t\t\t\t\t\t\t\t\t\t\tgroup.add(c);\n\t\t\t\t\t\t\t\t\t\t\tunmatched.remove(c);\n\t\t\t\t\t\t\t\t\t\t\tk--; //to account for the removal of a student in unmatched\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\tbreak recursiveIteration;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}//end for l\n\t\t\t\t\t}//end for k\n\t\t\t\t}// end for j\n\t\t\t\ti--; //account for removal of a student in unmatched\n\t\t\t}//end for i\n\t\t}//end while\n\t\tmatches.add(group);\n\t\tmatch(groupSize, unmatched);\n\t}",
"private static int planeSearch(String item, AOSLArrayBased listOfPlanes)\r\n\t{\r\n\t\tint returnedValue = 0;\r\n\r\n\t\t// Uses the listOfPlanes' search method to search for duplicates in\r\n\t\t// the ordered listOfPlanes\r\n\t\treturnedValue = listOfPlanes.search(item);\r\n\r\n\t\tif(returnedValue >= 0) // There are duplicates\r\n\t\t{\r\n\t\t\treturn 1; // Duplicate\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 0; // No duplicate \r\n\t\t} // END IF/ELSE\r\n\t}",
"private boolean isIntersectWithSource(List<Pair<Tuple,String>> list1, List<Pair<Tuple,String>> list2) {\n\t\tboolean intersect = false;\n\t\t\n\t\tfor (Pair<Tuple,String> tuple : list1) {\n\t\t\tif (list2.contains(tuple)) {\n\t\t\t\tintersect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn intersect;\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString myList[] = {\"Bozo\", \"Foobar\", \"Delta\", \"Foozball\", \"Demo\", \"Money\", \"Zoo\"};\n\t\tint foundIndexes[];\n\t\tboolean found = false;\n\t\t\n\t\t\n\t\tSystem.out.println(\"This is the of the arrayHasExactMatch and indexOfOccurenceInArray methods\");\n\t\tSystem.out.println(\"The array to test contains the following items:\");\n\t\tfor(int i = 0; i < myList.length; i++) {\n\t\t\tSystem.out.print(myList[i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Scenario 1\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"zo\", false);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 2\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"zoo\", false);\n\t\tSystem.out.println(\"Scenario 3\");\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 4\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"zoo\", true);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 5\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"foo\", true);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 6\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"foo\", false);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 7\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"delta\", true);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\tSystem.out.println(\"Scenario 8\");\n\t\tfound = ArrUtil.arrayHasExactMatch (myList, \"Delta\", true);\n\t\tSystem.out.println(\"arrayHasExactMatch \" + found);\n\t\t\n\t\tSystem.out.println(\"Scenario 9\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"zo\", false);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 10\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"zoo\", false);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 11\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"zoo\", true);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 12\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"foo\", true);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 13\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"foo\", false);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 14\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"delta\", true);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"Scenario 15\");\n\t\tfoundIndexes = ArrUtil.indexOfOccuranceInArray (myList, \"Delta\", true);\n\t\tSystem.out.println(\"indexOfOccuranceInArray \" + foundIndexes[0]);\n\t\tSystem.out.println(\"This works\");\n\t}",
"public static String checkList(String[] l1, String[] l2, String[] l3, String[] l4){\n Arrays.sort(l1);\n Arrays.sort(l2);\n Arrays.sort(l3);\n Arrays.sort(l4);\n //current runtime O(4log(N)) ~ O(log(N))\n\n String lexo = \"\";\n\n int count;\n\n //running through all elements of the first list O(N)\n for (int i = 0; i < l1.length; i++) {\n count = 1;\n if (Arrays.binarySearch(l2, l1[i]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l3, l1[i]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l4, l1[i]) >= 0)\n count += 1;\n if (count == 3){\n lexo = l1[i];\n break;\n }\n }\n //running through elements of the last list O(N)\n for (int j = 0; j < l2.length; j++) {\n count = 1;\n if (Arrays.binarySearch(l1, l2[j]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l3, l2[j]) >= 0)\n count += 1;\n if (Arrays.binarySearch(l4, l2[j]) >= 0)\n count += 1;\n if (count == 3 && (l2[j].compareTo(lexo)<0 || lexo == \"\")){\n lexo = l2[j];\n break;\n }\n }\n //Total running time in a worst case scenario of no triplets is now 2N(4*log(N)) ~ O(N*log(N))\n return lexo;\n\n\n }",
"public boolean checkstability()\r\n\t\t{\r\n\t\t\tArrayList<String> previouselement = null;\r\n\t\t\t\r\n\t\t\tSystem.out.println(womenmatchinlist);\r\n\t\t\t\r\n\t\t\tfor(int l=0;l<womenmatchinlist.size();l++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tString matchedman = menmatchinglist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tString matchedwoman = womenmatchinlist.get(l);\r\n\t\t\t\t\r\n\t\t\t\tint matchedwomanindex = women.indexOf(matchedwoman);\r\n\t\t\t\t\r\n\t\t\t\tfor(int z=0;z<women.size();z++)\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\tif(womenpreflist[matchedwomanindex][z].equals(matchedman))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(z>0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tfor(int s=0;s<=z;s++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tpreviouselement = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tpreviouselement.add(womenpreflist[matchedwomanindex][s]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(previouselement.isEmpty()==false)\r\n\t\t\t\t{\r\n\r\n\t\t\t\tfor(int t=0;t<previouselement.size();t++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tString higherpreferman = previouselement.get(t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// find current partner of higherpreferman\r\n\t\t\t\t\t\r\n\t\t\t\t\tint higherprefmenindex = menmatchinglist.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\tString currentpartnerofhigher = womenmatchinlist.get(higherprefmenindex);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tint tempindex = men.indexOf(higherpreferman);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<numberofwomen;i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// if new partner comes before current partner then return true\r\n\t\t\t\t\t\tif(menpreflist[tempindex][i].equals(currentpartnerofhigher))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// otherwise return false\r\n\t\t\t\t\t\tif(womenpreflist[tempindex][i].equals(matchedwoman))\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\t}",
"public double matchData() {\n\t\tArrayList<OWLDataProperty> labels1 = getDataProperties(ontology1);\n\t\tArrayList<OWLDataProperty> labels2 = getDataProperties(ontology2);\n\t\tfor (OWLDataProperty lit1 : labels1) {\n\t\t\tfor (OWLDataProperty lit2 : labels2) {\n\t\t\t\tif (LevenshteinDistance.computeLevenshteinDistance(TestAlign.mofidyURI(lit1.toString())\n\t\t\t\t\t\t, TestAlign.mofidyURI(lit2.toString()))>0.8){\n\t\t\t\t\treturn 1.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0.;\n\n\n\t}",
"public ArrayList<ArrayList> union(ArrayList<ArrayList> data, ArrayList<ArrayList> data2)\n {\n if(data == null || data2 == null)\n {\n return null;\n }\n ArrayList<Document> docs = data.get(0);\n ArrayList<Double> relevance = data.get(1);\n ArrayList<Integer> occurrence = data.get(2);\n ArrayList<Integer> popularity = data.get(3);\n \n ArrayList<Document> docs2 = data2.get(0);\n ArrayList<Double> relevance2 = data2.get(1);\n ArrayList<Integer> occurrence2 = data2.get(2);\n ArrayList<Integer> popularity2 = data2.get(3);\n \n ArrayList<Document> docs3 = new ArrayList<>();\n ArrayList<Double> relevance3 = new ArrayList<>();\n ArrayList<Integer> occurrence3 = new ArrayList<>();\n ArrayList<Integer> popularity3 = new ArrayList<>();\n \n for(int i = 0; i < docs.size(); i++)\n {\n docs3.add(docs.get(i));\n relevance3.add(relevance.get(i));\n occurrence3.add(occurrence.get(i));\n popularity3.add(popularity.get(i));\n }\n \n for(Document d: docs2)\n {\n if(!docs3.contains(d))\n {\n docs3.add(d);\n int docIndex = docs2.indexOf(d);\n relevance3.add(relevance2.get(docIndex));\n occurrence3.add(occurrence2.get(docIndex));\n popularity3.add(d.popularity);\n }\n else\n {\n int docIndex = docs3.indexOf(d);\n int docIndex2 = docs2.indexOf(d);\n double oldRel = (double) relevance3.get(docIndex);\n int oldOcc = (int) occurrence3.get(docIndex);\n relevance3.set(docIndex, oldRel+relevance2.get(docIndex2));\n if(oldOcc > occurrence2.get(docIndex2))\n {\n occurrence3.set(docIndex, occurrence2.get(docIndex2));\n }\n } \n }\n ArrayList<ArrayList> data3 = new ArrayList();\n data3.add(docs3);\n data3.add(relevance3);\n data3.add(occurrence3);\n data3.add(popularity3);\n return data3; \n }",
"@Test\n public void aminoCompareTest1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(d);\n int expected = 1;\n assertEquals(expected, first.aminoAcidCompare(second));\n }",
"public static boolean compareListElements(ArrayList<Double> a,ArrayList<Double> b){\n\t\t\n\t\tif(a==null && b==null)\n\t\t\treturn true;\n\t\t\n\t\tif(a.size()!=b.size())\n\t\t\treturn false;\n\t\t\n\t\tint i=0,j,k;\n\t\t\n\t\twhile(i<a.size())\n\t\t{\n\t\t\tj=(int) (100*a.get(i));\n\t\t\tk=(int) (100*b.get(i));\n\t\t\t\n\t\t\tif(j!=k)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 2;\r\n\t\t\t}",
"void compareSearch();",
"public static void main(String[] args) {\n\t\tInteger [] a= {1,4,7, 9, 2};\n\t\tInteger [] b={1,7,3,4,5};\n\t\tArrayList <Integer> c=new ArrayList<Integer>();\n\t\tfor(int i=0;i<a.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<b.length;j++)\n\t\t\t{\n\t\t\t\tif(a[i]==b[j])\n\t\t\t\t{\n\t\t\t\t\tif(!c.contains(a[i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tc.add(a[i]);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"First Method : \"+c);\n\t\t//second method\n\t\tList<Integer> arr1=Arrays.asList(a);\n\t\tList<Integer> arr2=Arrays.asList(b);\n\t\tHashSet<Integer> aset=new HashSet<>(arr1);\n\t\taset.retainAll(arr2);\n\t\tSystem.out.println(\"Second Method: \"+aset);\n\t\t\n\t}",
"public boolean match( ListExp p ) { return false; }",
"private static List<Integer> getCommonElementsAlgo1(int [] arr1, int [] arr2) {\n\t\t\n\t\tList<Integer> list1 = new ArrayList<Integer>();\n\t\tfor (int i : arr1) {\n\t\t\tlist1.add(i);\n\t\t}\n\t\tList<Integer> list2 = new ArrayList<Integer>();\n\t\tfor (int i : arr2) {\n\t\t\tlist2.add(i);\n\t\t}\n\t\tif (list1.size() > list2.size()) {\n\t\t\tlist1.retainAll(list2);\n\t\t\treturn list1;\n\t\t}\n\t\telse {\n\t\t\tlist2.retainAll(list1);\n\t\t\treturn list2;\n\t\t}\n\t\t\n\t}",
"private static void checkOne(ArrayList<Team> teamArray){\n int teamNum=1;\r\n int check = 0;\r\n boolean used = false;\r\n\r\n //sets Tokimon that have a JSON or is the first tokimon on the JSON\r\n //sorts Tokimon on team alphabetically and sorts teams by team number\r\n for(Team team: teamArray){\r\n team.getMembers().get(0).setHasJson(true);\r\n team.getMembers().get(0).setIsFirst(true);\r\n team.setOwner(team.getMembers().get(0));\r\n Collections.sort(team.getMembers(), new TokimonComparator());\r\n }\r\n Collections.sort(teamArray, new TeamComparator());\r\n\r\n for(int a=0; a<teamArray.size()-1; a++){\r\n for(int b=0; b<teamArray.get(a).getMembers().size(); b++){\r\n for(int c=a+1; c<teamArray.size(); c++){\r\n //finds if the Tokimon submitted a JSON file\r\n if(teamArray.get(a).getMembers().get(b).getId().trim().equalsIgnoreCase(teamArray.get(c).getMembers().get(0).getId().trim())){\r\n teamArray.get(c).getMembers().get(0).setHasJson(true);\r\n }\r\n for(int d=0; d<teamArray.get(c).getMembers().size(); d++){\r\n //If two Tokimon have the same ID, but different names on JSON files then exit\r\n if(teamArray.get(a).getMembers().get(b).getId().trim().equalsIgnoreCase(teamArray.get(c).getMembers().get(d).getId().trim())){\r\n if(teamArray.get(a).getMembers().get(b).getName().equals(teamArray.get(c).getMembers().get(d).getName())==false){\r\n System.out.println(\"Tokimon property match error between:\\n\");\r\n System.out.println(\"Name: \" + teamArray.get(a).getMembers().get(b).getName() + \" ID: \" + teamArray.get(a).getMembers().get(b).getId());\r\n System.out.println(\"Path and Filename: \" + teamArray.get(c).getFilename());\r\n System.out.println(\"and\");\r\n System.out.println(\"Name: \" + teamArray.get(c).getMembers().get(d).getName() + \" ID: \" + teamArray.get(c).getMembers().get(d).getId());\r\n System.out.println(\"Path and Filename: \" + teamArray.get(a).getFilename());\r\n System.exit(-1);\r\n }\r\n if(teamArray.get(a).getMembers().get(b).getHasJson()==true || teamArray.get(c).getMembers().get(d).getHasJson()==true){\r\n teamArray.get(a).getMembers().get(b).setHasJson(true);\r\n teamArray.get(c).getMembers().get(d).setHasJson(true);\r\n }\r\n }\r\n //used to check if team is equal\r\n if(teamArray.get(a).getMembers().size() == teamArray.get(c).getMembers().size()){\r\n used = true;\r\n if(teamArray.get(a).getMembers().get(d).getId().trim().equalsIgnoreCase(teamArray.get(c).getMembers().get(d).getId().trim())){\r\n check++;\r\n }\r\n }\r\n }\r\n //sets what team they are on\r\n if(check== teamArray.get(a).getMembers().size() && used == true ){\r\n if(teamArray.get(a).getTeamNum() == -1){\r\n teamArray.get(a).setTeamNum(teamNum);\r\n }\r\n teamArray.get(c).setTeamNum(teamArray.get(a).getTeamNum());\r\n }else if(check != teamArray.get(a).getMembers().size() && check!=0){\r\n System.out.println(\"Tokimon contained on different teams\");\r\n System.out.println(\"Path and Filename: \" + teamArray.get(a).getFilename());\r\n System.exit(-1);\r\n }\r\n if(teamArray.get(a).getMembers().size()==1){\r\n if(check == 1){\r\n System.out.println(\"Duplicate of single Tokimon team found\");\r\n System.out.println(\"Path and Filename: \" + teamArray.get(a).getFilename());\r\n System.exit(-1);\r\n }\r\n teamArray.get(a).setTeamNum(teamNum);\r\n }\r\n check = 0;\r\n used = false;\r\n }\r\n teamNum++;\r\n }\r\n }\r\n //base case if a single Tokimon team is last\r\n if(teamArray.get(teamArray.size()-1).getMembers().size()==1 && teamArray.get(teamArray.size()-1).getTeamNum()==-1){\r\n teamArray.get(teamArray.size()-1).setTeamNum(99999);\r\n }\r\n for(Team team: teamArray){\r\n for(Tokimon tokimon: team.getMembers()){\r\n //makes sure all tokimon have JSON\r\n if(tokimon.getHasJson()==false){\r\n System.out.println(\"Tokimon missing JSON submission\");\r\n System.out.println(\"Path and Filename: \" + team.getFilename());\r\n System.out.println(\"Name: \" + tokimon.getName() + \" ID: \" + tokimon.getId());\r\n System.exit(-1);\r\n }\r\n// System.out.println(tokimon.getId());\r\n }\r\n //makes sure tokimon only appear on one team\r\n if(team.getTeamNum()==-1){\r\n System.out.println(\"One or more teams are incorrect\");\r\n System.out.println(\"Path and Filename: \" + team.getFilename());\r\n System.exit(-1);\r\n }\r\n\r\n }\r\n }",
"public String[] findRestaurant(String[] list1, String[] list2) {\n Map<String, Integer> map = new HashMap<String, Integer>();\n for (int i = 0; i < list1.length; i++) {\n map.put(list1[i], i);\n }\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < list2.length; i++) {\n Integer j = map.get(list2[i]);\n if (j != null) {\n min = Math.min(min, i + j);\n }\n }\n List<String> list = new LinkedList<String>();\n for (int i = 0; i < list2.length; i++) {\n Integer j = map.get(list2[i]);\n if (j != null && (i + j) == min) {\n list.add(list2[i]);\n }\n } \n String[] re = new String[]{};\n return list.toArray(re);\n }",
"private TemplateInfo m19294a(long j, List<TemplateInfo>... listArr) {\n if (listArr != null) {\n for (List<TemplateInfo> it : listArr) {\n for (TemplateInfo templateInfo : it) {\n if (C2575a.m7391rq(templateInfo.ttid) == j) {\n return templateInfo;\n }\n }\n }\n }\n return null;\n }",
"private boolean Equals(ArrayList<Integer> list) {\n f = list.get(0);\n o = list.get(1);\n r = list.get(2);\n t = list.get(3);\n y = list.get(4);\n s = list.get(5);\n i = list.get(6);\n x = list.get(7);\n e = list.get(8);\n n = list.get(9);\n // Y is in 1's place, T in 10's, R in 100's, O in 1000's place and finally F in 10000's place. assign these\n // values approprately for each number.\n FORTY = (f * 10000 + o * 1000 + r * 100 + t * 10 + y * 1);\n SIXTY = (s * 10000 + i * 1000 + x * 100 + t * 10 + y * 1);\n TEN = (t * 100 + e * 10 + n * 1);\n int sum = FORTY + TEN + TEN;\n\n // if our values match up correctly, then we will show the values of each.\n if (sum == SIXTY) {\n System.out.printf(\"Forty: %d,\\nTen: %d,\\nSixty: %d\\n\", FORTY, TEN, SIXTY);\n System.out.printf(\"The values of each letters are as follows:\\nF = %d,\\nO = %d,\\nR = %d,\\nT = %d,\\nY = %d,\\n\" +\n \"S = %d,\\nI = %d,\\nX = %d,\\nE = %d,\\nand N = %d.\", f, o, r, t, y, s, i, x, e, n);\n return true;\n }\n return false;\n }",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t/*\r\n\t\tInteger[] l1 = {1,3};\r\n\t\tInteger[] l2 = {2,4};\r\n\t\tInteger[] l3 = {4,6};\r\n\t\tList<Integer[]> testlist = new ArrayList<Integer[]>();\r\n\t\t\r\n\t\ttestlist.add(l1);\r\n\t\ttestlist.add(l2);\r\n\t\ttestlist.add(l3);\r\n\t\tInteger[][] test1 = new Integer[3][2];\r\n\t\ttest1[0] = l3;\r\n\t\ttest1[1] = l1;\r\n\t\ttest1[2] = l2;\r\n\t\tComparator<Integer[]> c = new MyComparator();\r\n\t\tArrays.sort(test1,c );\t\r\n\t\tint a = 3;\r\n\t\ta = 4;\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tList<Integer> testl = new ArrayList<Integer>();\r\n\t\ttestl.add(1);\r\n\t\ttestl.add(3);\r\n\t\ttestl.add(9);\r\n\t\ttestl.add(6);\r\n\t\t\r\n\t\tint maxtest = Collections.max(testl);\r\n\t\tSystem.out.println(testl.indexOf(maxtest));\r\n\t\tfloat a = (float)40/16;\r\n\t\tSystem.out.println(a);\r\n\t\t\t\t\r\n\t\t*/\r\n\t\t/*\r\n\t\tList<Integer> testlist = new ArrayList<Integer>();\r\n\t\ttestlist.add(2);\r\n\t\ttestlist.add(4);\r\n\t\ttestlist.add(6);\r\n\t\t\r\n\t\tList<Integer> testlist1 = new ArrayList<Integer>(testlist);\r\n\t\t\r\n\t\t//int[] testarray = new int[3]{3,4,5};\r\n\t\t\r\n\t\ttestlist.set(0, 10);\r\n\t\ttestlist1.set(0, 55);\r\n\t\t\r\n\t\t//System.out.println(testlist.get(0));\r\n\t\t//System.out.println(testlist1.get(0));\r\n\t\t\r\n\t\tList<ArrayList> mytestlist = new ArrayList<ArrayList>();\r\n\t\t\r\n\t\tmytestlist.add(new ArrayList<Integer>());\r\n\t\t\r\n\t\t//mytestlist.get(0).a\r\n\t\tArrayList[] mylist = new ArrayList[5];\r\n\t\tmylist[0] = new ArrayList<Integer>();\r\n\t\tmylist[0].add(2);\r\n\t\t\r\n\t\tmylist[0].add(4);\r\n\t\t\r\n\t\tmylist[0].add(6);\r\n\t\t\r\n\t\tif(mylist[0].contains(2)){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"hahaha\");\r\n\t\t}\r\n\t\tif(mylist[0].contains(\"a\")){\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"ddddd\");\r\n\t\t}\r\n\t\t*/\r\n\t\t/*\r\n\t\tList<Integer> testm = new ArrayList<Integer>();\r\n\t\tfor(int i=0;i<10;i++){\r\n\t\t\ttestm.add(5);\r\n\t\t}\r\n\t\t\r\n\t\tList<Integer> mylist1 = testm.subList(0, 5);\r\n\t\t\r\n\t\tSystem.out.println(mylist1.size());\r\n\t\t\r\n\t\t\r\n\t\tList<Integer> testm1 = new ArrayList<Integer>();\r\n\t\tSystem.out.println(Collections.max(testm1));\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tList<FMData> testlist = new ArrayList<FMData>();\r\n\t\tfor(int i=0;i<10;i++){\r\n\t\t\tFMData fm = new FMData(i,i,i,(float)i,i);\r\n\t\t\ttestlist.add(fm);\r\n\t\t}\r\n\t\t\r\n\t\tList<FMData> testlist1 = new ArrayList<FMData>(testlist);\r\n\t\t\r\n\t\tfor(int i=0;i<10;i++){\r\n\t\t\t\r\n\t\t\tif(testlist.get(i).fmstart==5){\r\n\t\t\t\ttestlist1.set(i, 55);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(testlist.size());*/\r\n\t\t\r\n\t\tList<Integer> l1 = new ArrayList<Integer>();\r\n\t\tfor(int i=0;i<10;i++){\r\n\t\t\t\r\n\t\t\tl1.add(i);\r\n\t\t}\r\n\t\t\r\n\t\tList<Integer> l2 = l1.subList(0, 6);//new ArrayList<Integer>(l1);\r\n\r\n\t\tl2.set(2, 55);\r\n\t\t\r\n\t\tSystem.out.println(l1.get(2));\r\n\t\tSystem.out.println(l2.get(2));\r\n\t\t\r\n\t}",
"public ArrayList<Flight> SearchPreferFlight1(double maxprice,Date date, String depar,String arriv){\n ArrayList<Flight> result= new ArrayList<>();\n //System.out.println(\"in_search1\\n\");\n System.out.print(maxprice + \" \");\n System.out.print(date + \" \");\n System.out.print(depar + \" \");\n System.out.print(arriv + \"\\n\");\n for(Airliners airliner:airlDir.getAirlinersList()){\n //System.out.printf(\"result of if airls eaquals is:\"+airliner.equals(airls)+\"\\n\");\n for(Flight flyt:airliner.getFleetlist()){\n System.out.print(flyt.getPrice() + \" \");\n System.out.print(flyt.getDate() + \" \");\n System.out.print(flyt.getFromlocaltion() + \" \");\n System.out.print(flyt.getTolocation() + \"\\n\");\n if( (flyt.getPrice()<=maxprice || maxprice==-1) \n &&(depar.equals(\"\")||depar.equals(flyt.getFromlocaltion()))\n &&(arriv.equals(\"\")||arriv.equals(flyt.getTolocation()))\n &&(date==null || date.equals(flyt.getDate())) ) \n {\n result.add(flyt);\n }\n } \n \n }\n System.out.printf(\"resultlist size:%d\",result.size());\n return result;\n \n }",
"public static ArrayList<String> joinArrayLists(ArrayList<String> EqList, ArrayList<String> sshList){\n\n\t\t\t\n\t\t\tArrayList<Integer> counteq = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> countssh = new ArrayList<Integer>();\n\t\t\t\n\t\t\tList<String> split1 = new ArrayList<String>();\n\t\t\tList<String> split2 = new ArrayList<String>();\n\t\t\t\n\t\t\tArrayList<String> combine = new ArrayList<String>();\n\t\t\t\n\t\t\t//Checks how many object exist in arrayList and addes their index to a new list\n\t\t\tfor(int i = 0;i<EqList.size();i++){\n\t\t\t\tif(EqList.get(i) == \"Object\"){\n\t\t\t\t\tcounteq.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j = 0;j<sshList.size();j++){\n\t\t\t\tif(sshList.get(j) == \"Object\"){\n\t\t\t\t\tcountssh.add(j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//The size of the matrices must be equal. If it is 1, removes the ID and object index from the second matrix and addes it to the first arrayList\n\t\t\tif(counteq.size() == countssh.size()){\n\t\t\t\tif(counteq.size() == 1){\n\t\t\t\t\tif(EqList.get(1).equals(sshList.get(1))){\n\t\t\t\t\t\tEqList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tsshList.remove(0);\n\t\t\t\t\t\tcombine.addAll(EqList);\n\t\t\t\t\t\tcombine.addAll(sshList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Based on the IDs of both lists, it splits both lists on the specified index and addes the two parts to the new combined matrix\n\t\t\t\t\t//The indexes are taken from the specified matrices counteq and countssh\n\t\t\t\t\tcounteq.add(EqList.size());\n\t\t\t\t\tcountssh.add(sshList.size());\n\t\t\t\t\tfor(int i = 0;i<counteq.size()-1;i++){\n\t\t\t\t\t\tfor(int j = 0;j<countssh.size()-1;j++){\n\t\t\t\t\t\t\tif(EqList.get(counteq.get(i)+1).equals(sshList.get(countssh.get(j)+1))){\n\n\t\t\t\t\t\t\t\t\tsplit1 = EqList.subList(counteq.get(i),counteq.get(i+1));\n\t\t\t\t\t\t\t\t\tsplit2 = sshList.subList(countssh.get(j)+2,countssh.get(j+1));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tcombine.addAll(split1);\n\t\t\t\t\t\t\t\t\tcombine.addAll(split2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Error! Arraylists size not the same. Please check the data\");\n\t\t\t\n\t\t\t//If any remaining object indexes are left, remove them\n\t\t\tfor(int i = 0;i<combine.size();i++){\n\t\t\t\tif(combine.get(i) == \"Object\"){\n\t\t\t\t\tcombine.remove(i);\n\t\t\t\t\ti=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn combine;\n\t\t}",
"@Test\n public void test_2() {\n long expected = 12;\n List<List<Integer>> possibleRoads = List.of(\n List.of(1, 3),\n List.of(3, 4),\n List.of(2, 4),\n List.of(1, 2),\n List.of(2, 3),\n List.of(5, 6)\n );\n long result = roadsAndLibraries(6, 2, 5, possibleRoads);\n Assertions.assertEquals(expected, result);\n }",
"public static <T extends Comparable<? super T>>\n void intersection(SLL<T> list1, SLL<T> list2, SLL<T> result) {\n\n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n\n T itemlist1=null, itemlist2=null;\n\n // get first item in each list\n if ( iterlist1 != null && iterlist2 != null ) {\n itemlist1 = iterlist1.info;\n itemlist2 = iterlist2.info;\n }\n\n while ( itemlist1 != null && itemlist2 != null ) {\n int compareResult = itemlist1.compareTo(itemlist2);\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //append to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n }\n }",
"private void crossMatch(int[] clientSliders, ArrayList<String[]> matchList){\r\n\t\tString[] currArr;//current match String[]\r\n\t\tint[] currentMatch = new int[]{-1,-1,-1,-1,-1,-1,-1};//holds currArr converted into int's\r\n\r\n\t\tfor(int i = 0; i < matchList.size(); i++){//go through all the matches\r\n\t\t\tcurrArr = matchList.get(i);//get current match\r\n\t\t\t\r\n\t\t\tfor(int j = 1; j < 7; j++){//convert strings to int, 1-6\r\n\t\t\t\tcurrentMatch[j] = Integer.valueOf(currArr[j]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//check whether the client values are between current match's value\r\n\t\t\tif(clientSliders[0] < currentMatch[1] || clientSliders[0] > currentMatch[2]//check pGender\r\n\t\t\t\t\t|| clientSliders[1] < currentMatch[3] || clientSliders[1] > currentMatch[4]//check pExpression\r\n\t\t\t\t\t|| clientSliders[2] < currentMatch[5] || clientSliders[2] > currentMatch[6]){//check pOrientation\r\n\t\t\t\tmatchList.remove(i);//remove match from matchList if values don't fit within\r\n\t\t\t\ti--;//compensate for removed match\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n boolean found = false;\r\n \r\n\t\t\r\n\t\tLinkedList<Integer> ll = new LinkedList<>(new ArrayList<Integer>(Arrays.asList(34,90,56,12)));\r\n\t\tLinkedList<Integer> ll2 = new LinkedList<>(new ArrayList<Integer>(Arrays.asList(34,91)));\r\n\t\tfor(int i=0;i<=ll2.size()-1;i++)\r\n\t\t{\r\n\t\t\tfor(int j=0;j<=ll.size()-1;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(ll2.get(i));\r\n\t\t\t\tSystem.out.println(ll.get(j));\r\n\t\t\t\tif(ll2.get(i)==ll.get(j))\r\n\t\t\t\t{\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tfound = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(found)\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"here\");\r\n\t\t\t\tfound = false;\r\n\t\t\t\tSystem.out.println(\"Not sublist\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\tif(found)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"sublist\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"boolean hasMatchedElements();",
"@Override\n public Matching stableMarriageGaleShapley_hospitaloptimal(Matching marriage) {\n int m = marriage.getHospitalCount();\n int n = marriage.getResidentCount();\n\n ArrayList<ArrayList<Integer>> hospital_preference = marriage.getHospitalPreference();\n ArrayList<ArrayList<Integer>> resident_preference = marriage.getResidentPreference();\n\n ArrayList<Integer> hospitalSlots = marriage.getHospitalSlots();\n\n ArrayList<Integer> residentMatching = new ArrayList<Integer>();\n arrlistInit(residentMatching, n, -1, false);\n\n /*list of residents that each hospital can propose to\n * Initially equals the hospital_preference list*/\n ArrayList<ArrayList<Integer>> residentsToProposeTo = new ArrayList<ArrayList<Integer>>();\n for (int i = 0; i < m; i++) //O(m)\n residentsToProposeTo.add(new ArrayList<Integer>(hospital_preference.get(i)));\n\n /*list of hospitals that still can propose(has free spots and hasn't proposed to every resident)*/\n ArrayList<Integer> proposing = new ArrayList<Integer>();\n arrlistInit(proposing, m, 0, true); //O(n)\n\n /*Keep track of each hospital matched residents*/\n ArrayList<ArrayList<Integer>> hospitalResidents = new ArrayList<ArrayList<Integer>>(0);\n for (int i = 0; i < m; i++) //O(m)\n hospitalResidents.add(new ArrayList<Integer>(0));\n\n /*Looping through each hospital in the proposing list\n * Even though some hospital may be added again in the proposing list, each hospital can propose at most once to each resident\n * So total running time of the loop will be O(m*n)*/\n while (!proposing.isEmpty()) {\n for (int hospitalIndex = 0; hospitalIndex < proposing.size(); hospitalIndex++) {\n /*Get the head of the proposing Arraylist*/\n int hospital = proposing.get(0);\n int residentIndex;\n int resident = 0;\n for (residentIndex = 0; residentIndex < residentsToProposeTo.get(hospital).size() && proposing.contains(hospital); hospitalIndex++) {\n /*Get the next resident the hospital hasn't proposed to yed*/\n resident = residentsToProposeTo.get(hospital).get(0);\n int hospitalRank = resident_preference.get(resident).indexOf(hospital);\n\n /*resident is matched, compare the hospitals rank*/\n if (residentMatching.get(resident) != -1) {\n int matchedHospital = residentMatching.get(resident);\n int matchedHospitalRank = resident_preference.get(resident).indexOf(matchedHospital);\n if (hospitalRank < matchedHospitalRank) {\n /*1.Add/remove to hospitalResidents\n * 2.Add in resident-matching\n * 3.Add matchedHospital to the proposing list if it's not in it\n */\n hospitalResidents.get(hospital).add(resident);\n hospitalResidents.get(matchedHospital).remove(hospitalResidents.get(matchedHospital).indexOf(resident));\n residentMatching.set(resident, hospital);\n if (!proposing.contains(matchedHospital))\n proposing.add(matchedHospital);\n\n }\n }\n /*resident is free, match with the hospital*/\n else {\n /*1.Add in hospitalResidents\n * 2.Add in resident-matching\n */\n hospitalResidents.get(hospital).add(resident);\n residentMatching.set(resident, hospital);\n }\n\n /*1.Remove resident from the hospital's list of residentsToProposeTo\n * 2.If hospital's slots are full, remove hospital from the proposing list\n */\n residentsToProposeTo.get(hospital).remove(residentsToProposeTo.get(hospital).indexOf(resident));\n if (hospitalResidents.get(hospital).size() >= hospitalSlots.get(hospital))\n proposing.remove(proposing.indexOf(hospital));\n }\n }\n }\n marriage.setResidentMatching(residentMatching);\n return marriage;\n }",
"public void compareArray() {\n\t\tmatches = 0;\n\t\tfor(int g = 0; g<guessNum.length; g++) {\n\t\t\tfor(int r=0; r<randNum.length; r++) {\n\t\t\t\tif(guessNum[g]==randNum[r]) {\n\t\t\t\t\tmatches++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n ArrayList<String> obj = new ArrayList<String>();\r\n obj.add(\"bersih bagus aakm\");\r\n obj.add(\"bersih rapi aakm\");\r\n obj.add(\"rapi bagus aakm\");\r\n obj.add(\"bagus rapi aakm\");\r\n obj.add(\"bagus rapi aakm\");\r\n obj.add(\"bagus sejuk aakm\");\r\n obj.add(\"bersih sejuk bagus aakm\");\r\n obj.add(\"bagus aakm\");\r\n obj.add(\"mudah aakm\");\r\n obj.add(\"bagus aakm\");\r\n\r\n String[] arr;\r\n ArrayList<ArrayList<String>> listOfLists = new ArrayList<ArrayList<String>>();\r\n\r\n for (int i = 0; i < obj.size(); i++) {\r\n arr = obj.get(i).split(\" \");\r\n ArrayList<String> tmp = new ArrayList<String>();\r\n\r\n for (int j = 0; j < arr.length; j++) {\r\n tmp.add(arr[j]);\r\n }\r\n\r\n listOfLists.add(tmp);\r\n\r\n }\r\n System.out.println(listOfLists);\r\n\r\n//------------------------------------------------------------------------------------------------\r\n ArrayList<String> frq = new ArrayList<String>();\r\n ArrayList<Integer> cnt = new ArrayList<Integer>();\r\n// System.out.println(\"size: \"+listOfLists.get(0).size());\r\n for (int i = 0; i < listOfLists.size(); i++) {\r\n for (int j = 0; j < listOfLists.get(i).size(); j++) {\r\n if (frq.size() == 0) {\r\n frq.add(listOfLists.get(i).get(j));\r\n cnt.add(1);\r\n } else {\r\n boolean podo = false;\r\n for (int k = 0; k < frq.size(); k++) {\r\n if (frq.get(k).equals(listOfLists.get(i).get(j))) {\r\n //count+1\r\n// cnt.set(k, 9);\r\n cnt.set(k, cnt.get(k) + 1);\r\n podo = true;\r\n break;\r\n }\r\n }\r\n if (podo == false) {\r\n frq.add(listOfLists.get(i).get(j));\r\n cnt.add(1);\r\n }\r\n }\r\n }\r\n }\r\n System.out.println(frq);\r\n System.out.println(cnt);\r\n//------------------------------------------------------------------------------------------------\r\n\r\n for (int i = 0; i < cnt.size() - 1; i++) {\r\n int t = 0;\r\n int index = 0;\r\n for (int j = i; j < cnt.size(); j++) {\r\n if (cnt.get(j) >= t) {\r\n t = cnt.get(j);\r\n index = j;\r\n }\r\n }\r\n //swap\r\n int x = cnt.get(i);\r\n cnt.set(i, t);\r\n cnt.set(index, x);\r\n //swap string\r\n String y = frq.get(i);\r\n frq.set(i, frq.get(index));\r\n frq.set(index, y);\r\n\r\n }\r\n\r\n System.out.println(cnt);\r\n System.out.println(frq);\r\n\r\n//------------------------------------------------------------------------------------------------\r\n int minsupp = 2;\r\n for (int i = 0; i < cnt.size(); i++) {\r\n if (cnt.get(i) < minsupp) {\r\n String a = frq.get(i);\r\n cnt.remove(i);\r\n frq.remove(i);\r\n for (int j = 0; j < listOfLists.size(); j++) {\r\n for (int k = 0; k < listOfLists.get(j).size(); k++) {\r\n if (listOfLists.get(j).get(k).equalsIgnoreCase(a)) {\r\n listOfLists.get(j).remove(k);\r\n\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n System.out.println(cnt);\r\n System.out.println(frq);\r\n\r\n//------------------------------------------------------------------------------------------------\r\n System.out.println(listOfLists);\r\n System.out.println(\"\");\r\n// System.out.println(listOfLists.get(6));\r\n\r\n for (int h = 0; h < listOfLists.size(); h++) {\r\n for (int i = 0; i < listOfLists.get(h).size() - 1; i++) {\r\n int indexcount = 0;\r\n int count = 0;\r\n int index = 0;\r\n String a = null;\r\n for (int j = i; j < listOfLists.get(h).size(); j++) {\r\n// System.out.println(listOfLists.get(0).get(j));\r\n for (int k = 0; k < frq.size(); k++) {\r\n// System.out.println(k);\r\n if (listOfLists.get(h).get(j).equalsIgnoreCase(frq.get(k))) {\r\n// System.out.println(listOfLists.get(0).get(j));\r\n indexcount = k;\r\n break;\r\n }\r\n }\r\n if (cnt.get(indexcount) >= count) {\r\n count = cnt.get(indexcount);\r\n index = j;\r\n a = frq.get(indexcount);\r\n\r\n// System.out.println(frq.get(indexcount));\r\n }\r\n }\r\n// System.out.println(\"\");\r\n String x = listOfLists.get(h).get(i);\r\n// System.out.println(\"string x= \" + x);\r\n// System.out.println(\"index count= \" + index);\r\n// System.out.println(frq.get(indexcount));\r\n listOfLists.get(h).set(i, a);\r\n// System.out.println(listOfLists.get(6));\r\n\r\n listOfLists.get(h).set(index, x);\r\n// System.out.println(listOfLists.get(6));\r\n\r\n }\r\n }\r\n// System.out.println(listOfLists.get(6));\r\n\r\n System.out.println(listOfLists);\r\n\r\n //------------------------------------------------------------------------------------------------\r\n ArrayList<ArrayList<Integer>> tree = new ArrayList<ArrayList<Integer>>();\r\n\r\n//aakm=1\r\n//baggis=2\r\n//rapi=3\r\n//bersih=4\r\n//sejuk=5\r\n//mudah=6\r\n for (int i = 0; i < listOfLists.size(); i++) {\r\n ArrayList<Integer> trans = new ArrayList<Integer>();\r\n\r\n for (int j = 0; j < listOfLists.get(i).size(); j++) {\r\n switch (listOfLists.get(i).get(j)) {\r\n case \"aakm\":\r\n trans.add(1);\r\n break;\r\n case \"bagus\":\r\n trans.add(2);\r\n break;\r\n case \"rapi\":\r\n trans.add(3);\r\n break;\r\n case \"bersih\":\r\n trans.add(4);\r\n break;\r\n case \"sejuk\":\r\n trans.add(5);\r\n break;\r\n case \"mudah\":\r\n trans.add(6);\r\n break;\r\n }\r\n }\r\n tree.add(i, trans);\r\n\r\n }\r\n System.out.println(tree);\r\n\r\n //\r\n \r\n// ----------------------------------------------------------------------------------------------\r\nGraph coba =new Graph(5);\r\n//coba.addAdj(0, 1);\r\n//coba.cetak();\r\nfor (int i = 0; i < tree.size(); i++) {\r\n coba.addAdj(tree.get(i));\r\n }\r\n\r\n//coba.addAdj(tree.get(0));\r\n//coba.cetak();\r\n//coba.addAdj(tree.get(1));\r\n//coba.cetak();\r\n//coba.addAdj(tree.get(2));\r\ncoba.cetak();\r\n\r\n\r\n//--------------------------------------------------------------------------------------------------------------\r\n\r\n\r\n//coba.tes();\r\n }",
"void searchMax(ArrayList<SanPham> list);",
"@Test\n public void aminoCompareTest2() {\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(c);\n int expected = 0;\n assertEquals(expected, first.aminoAcidCompare(second));\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tArrayList <String> objArray = new ArrayList<String>();\r\n\t\tArrayList <String> objArray2 = new ArrayList<String>();\r\n\t\t\r\n\t\tobjArray2.add(0, \"common1\");\r\n\t\tobjArray2.add(1, \"common2\");\r\n\t\tobjArray2.add(2, \"notcommon0\");\r\n\t\tobjArray2.add(3, \"notcommon1\");\r\n\r\n\t\tobjArray.add(0, \"common1\");\r\n\t\tobjArray.add(1, \"common2\");\r\n\t\tobjArray.add(2, \"notcommon2\");\r\n\t\t\r\n\t\tSystem.out.println(\"Array elements of Array1\"+objArray);\r\n\t\tSystem.out.println(\"Array elements of Array2\"+objArray2);\r\n\t\t\r\n\t\tobjArray.retainAll(objArray2);\r\n\t\t// retainAll : objArray의 객체를 남겨라. 그러나 objArray2 중에서 공통된것만 남기고 나머지는 없애라.\r\n\t\t// 양쪽 배열에 공통적으로 포함되있는 것만을 뽑고 싶을 때, retainAll이라는 메소드펑션을 사용하는 것이다.\r\n\t\t\r\n\t\tSystem.out.println(\"Array1 after retaining common elements of Array1 & Array2\"+objArray);\r\n\r\n//\t\t결과\r\n//\t\tArray elements of Array1[common1, common2, notcommon2]\r\n//\t\tArray elements of Array2[common1, common2, notcommon0, notcommon1]\r\n//\t\tArray1 after retaining common elements of Array1 & Array2[common1, common2]\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic boolean matches(Object list) {\n\t\t\t\treturn ((List<String>) list).size() == 1;\r\n\t\t\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tint arr1[] = {3,2,11,4,6,7};\r\n\t\tint arr2[] = {1,2,8,4,9,7};\r\n\t\t\r\n\t\tList<Integer> list1 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tList<Integer> list2 = new ArrayList<Integer>();\r\n\t\t\r\n\t\tfor (int a : arr1) {\r\n\t\t\tlist1.add(a);\r\n\t\t}\r\n\t\tfor (int b : arr2) {\r\n\t\t\tlist2.add(b);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(list1);\r\n System.out.println(list2);\r\n \r\n list1.retainAll(list2);\r\n System.out.println(\"The Intersection values : \" + list1);\r\n \r\n\t}",
"@Test\n public void test_1() {\n // 3 3 2 1\n long expected = 4;\n List<List<Integer>> possibleRoads = List.of(\n List.of(1, 2),\n List.of(3, 1),\n List.of(2, 3)\n );\n long result = roadsAndLibraries(3, 2, 1, possibleRoads);\n Assertions.assertEquals(expected, result);\n }",
"public void sensibleMatches1() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n Map<String, Set<String>> mapWithoutHal = new HashMap<>(clientMap);\n mapWithoutHal.remove(\"Hal\");\n for (String eachClient : mapWithoutHal.keySet()) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }",
"Match getResultMatch();",
"public String[] findRestaurant(String[] list1, String[] list2) {\n\n List<String> result = new ArrayList<>(list1.length);\n Map<String, Integer> map = new HashMap<>(list1.length);\n\n for (int i = 0; i < list1.length; ++i) {\n map.put(list1[i], i);\n }\n\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < list2.length; ++i) {\n if (map.containsKey(list2[i])) {\n int index = i + map.get(list2[i]);\n if (index > min) continue;\n if (index < min) {\n result.clear();\n min = index;\n }\n result.add(list2[i]);\n }\n }\n\n String [] arr = new String[result.size()];\n\n for (int i = 0; i < result.size(); ++i) {\n arr[i] = result.get(i);\n }\n\n return arr;\n }",
"List<Long> getBestSolIntersection();",
"private boolean contains(ArrayList<int[]> list, int[] element) {\n for (int[] temp : list) {\n if (temp[0] == element[0] && temp[1] == element[1]) {\n return true;\n }\n }\n return false;\n }",
"private boolean isEqual(Iterator<?> instance, OasisList<?> baseList) {\n\n boolean equal = true;\n int i = 0;\n while (instance.hasNext()) {\n if (!baseList.get(i++).equals(instance.next())) {\n equal = false;\n break;\n }\n }\n\n return equal;\n }",
"int findCandidate(int a[], int size) {\n int maj_index = 0, count = 1;\n int i;\n for (i = 1; i < size; i++) {\n if (a[maj_index] == a[i])\n count++;\n else\n count--;\n\n if (count == 0) {\n maj_index = i;\n count = 1;\n }\n }\n return a[maj_index];\n }",
"public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}",
"public List<String> comparingRoom(List<String> all, List<String> data2) throws SQLException\n {\n \tif(data2.size()==0)\n \t\treturn all;\n \tList<String> different = new ArrayList<String>();\n \tfor(int x = 0; x < all.size();x++)\n \t{\n \t\tif(data2.contains(all.get(x))==false)\n \t\t{\n \t\t\tdifferent.add(all.get(x));\n \t\t}\n \t}\n \treturn different;\n }",
"@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tTreeSet<Integer> treeset = new TreeSet<Integer>();\n\t\ttreeset.add(1);\n\t\tint a=0,b=0;\n\t\tint number = sc.nextInt();\n\t\tint pairnumber = sc.nextInt();\n\t\tArrayList<matching> arraylist = new ArrayList<matching>();\n\t\t//연결 정보를 arraylist에 저장\n\t\tfor(int i =0;i<pairnumber;i++) {\n\t\t\ta=sc.nextInt();\n\t\t\tb=sc.nextInt();\n\t\t\tarraylist.add(new matching(a,b));\n\t\t}\n\n\t\tIterator<matching> itr = arraylist.iterator();\n\t\t//연결된 컴퓨터를 set에 넣는다.\n\t\tfor(int i =0;i<pairnumber;i++)\n\t\t{\n\t\t\titr = arraylist.iterator();\n\t\t\twhile(itr.hasNext()) {\n\t\t\t\tmatching temp2 = itr.next();\n\t\t\t\t//System.out.println(temp2.getnum1());\n\t\t\t\tif(treeset.contains(temp2.getnum1())|| treeset.contains(temp2.getnum2())) {\n\t\t\t\t\ttreeset.add(temp2.getnum2());\n\t\t\t\t\ttreeset.add(temp2.getnum1());\n\t\t\t\t\titr.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(treeset.size()-1);\n\t}",
"public boolean RepVec(String []a){\n boolean rep=false;\n String aux1=\"\",aux2=\"\";\n for (int i = 0; i < a.length; i++) {\n aux1=a[i];\n for (int j = 0; j < a.length; j++) {\n aux2=a[j];\n if( i!=j ){ \n if(aux1==aux2){\n rep=true;\n return rep;\n } \n } \n }\n }\n return rep;\n \n }",
"private boolean isSameList(CardList l1, CardList l2){\r\n\t\tif (l1.size()!=l2.size())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tIterator<Card> i1 = l1.iterator();\r\n\t\tIterator<Card> i2 = l2.iterator();\r\n\t\twhile(i1.hasNext()){\r\n\t\t\tif (!i1.next().equals(i2.next()))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public static void main(String[] args) {\nArrayList<String> al1= new ArrayList<String>();\nal1.add(\"a\");\nal1.add(\"b\");\nal1.add(\"a\");\nal1.add(\"d\");\nal1.add(\"e\");\nal1.add(\"e\");\n\nArrayList<String> al2=new ArrayList<String>();\nal2.add(\"a\");\nal2.add(\"e\");\n\n// al1.removeAll(al2); --> b/d\nal1.retainAll(al2);\n\nfor(String a:al1)\nSystem.out.println(a);\n}",
"public static boolean isStable(ArrayList<int[]> assignment1, double[][] matrix) {\n\t\tboolean error = false;\n\t\tboolean result = true;\n\t\tfor (int i = 0, len = assignment1.size(); i < len; i++) {\n\t\t\tdouble value = matrix[assignment1.get(i)[0]][assignment1.get(i)[1]];\n\t\t\terror = false;\n\t\t\t// loop over entries\n\t\t\tfor (int x = 0; x < matrix.length; x++) {\n\t\t\t\t// check all solutions that are better\n\t\t\t\tif (matrix[x][assignment1.get(i)[1]] < value) {\n\t\t\t\t\t// find the result in this row\n\t\t\t\t\tdouble hook = -1;\n\t\t\t\t\tfor (int j = 0; j < assignment1.size(); j++) {\n\t\t\t\t\t\t// check if there is a result with this\n\t\t\t\t\t\tif (assignment1.get(j)[0] == x) {\n\t\t\t\t\t\t\thook = matrix[assignment1.get(j)[0]][assignment1.get(j)[1]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// check if the result is better\n\t\t\t\t\tif (hook != -1) {\n\t\t\t\t\t\tif (matrix[x][assignment1.get(i)[1]] < hook) {\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// loop over entries\n\t\t\tfor (int y = 0; y < matrix[0].length; y++) {\n\t\t\t\t// check all solutions that are better\n\t\t\t\tif (matrix[assignment1.get(i)[0]][y] < value) {\n\t\t\t\t\t// find the result in this col\n\t\t\t\t\tdouble hook = -1;\n\t\t\t\t\tfor (int j = 0; j < assignment1.size(); j++) {\n\t\t\t\t\t\t// check if there is a result with this\n\t\t\t\t\t\tif (assignment1.get(j)[1] == y) {\n\t\t\t\t\t\t\thook = matrix[assignment1.get(j)[0]][assignment1.get(j)[1]];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// check if the result is better\n\t\t\t\t\tif (hook != -1) {\n\t\t\t\t\t\tif (matrix[assignment1.get(i)[0]][y] < hook) {\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (error) {\n\t\t\t\tSystem.out.println(\"Unstable at \" + assignment1.get(i)[0] + \", \" + assignment1.get(i)[1]);\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"@Test\n public void findOverlap() {\n\n int[] A = new int[] {1,3,5,7,10};\n int[] B = new int[] {-2,2,5,6,7,11};\n\n List<Integer> overlap = new ArrayList<Integer>();\n overlap.add(5);\n overlap.add(7);\n\n Assert.assertEquals(overlap,Computation.findOverlap(A,B));\n\n }",
"public String getRelatedSubjectByPknows (double [] vector,String[] knowns){\n VectorSpaceModel vectorSpaceModel = new VectorSpaceModel();\n MongoCursor<Document> cr = subject.find().iterator();\n class similarities implements Comparable<similarities>{\n double sim = 0.0;\n ArrayList<String> docs;\n String skills;\n String name;\n\n public similarities(double s,ArrayList<String> d,String sk,String name){\n this.sim =s;\n this.docs = d;\n this.skills = sk;\n this.name = name;\n }\n @Override\n public int compareTo(similarities s1) {\n if (this.sim < s1.sim) return 1;\n else return -1;\n }\n }\n ArrayList<similarities> sims = new ArrayList<similarities>();\n ArrayList<Double> knowns_vector =new ArrayList<Double>() ;\n\n try {\n while (cr.hasNext()){\n Document sbj = cr.next();\n String tnp = (String)sbj.get(\"spaceVector\");\n String skills = (String)sbj.get(\"skills\");\n String [] doc_skills = skills.split(\",\");\n System.out.println(\"doc_skills\"+doc_skills[0]+(String)sbj.get(\"id\"));\n /* check length of docs knows and user skills in other having same vector length*/\n if (knowns.length>=doc_skills.length){\n /* Init ouput vector to need dimension */\n for (int i=0;i<knowns.length;i++){\n knowns_vector.add(i,new Double(0.0));\n }\n /* get skills of doc related to pknows */\n System.out.println(\"knows larger\");\n for (int i = 0; i<knowns.length;i++){\n if (knowns[i]!=null){\n\n int ind = Arrays.asList(doc_skills).indexOf(knowns[i]);\n if (ind!=-1){\n System.out.println(\"knows checking \"+knowns[i]+\" \"+skills);\n System.out.println(\"barruan \"+ind+\" \"+vector[i]);\n knowns_vector.add(ind,new Double(vector[i]));\n }\n else knowns_vector.add(new Double(0.0));\n }\n }\n }\n else {\n /* Init ouput vector to need dimension */\n for (int j=0;j<doc_skills.length;j++){\n knowns_vector.add(j,new Double(0.0));\n }\n for (int i = 0; i<knowns.length;i++){\n\t for (int x = 0 ; x<doc_skills.length;x++){\n\t\tif (doc_skills[x].equals(knowns[i])) knowns_vector.add(x,new Double(vector[i]));\n\t\telse knowns_vector.add(x,new Double(0.0));\n \n\t\t\t\n }\n }\n }\n ArrayList<String> docs = (ArrayList<String>) sbj.get(\"docs\");\n String [] vct = tnp.split(\",\");\n double[] vec1 = Arrays.stream(vct)\n .mapToDouble(Double::parseDouble)\n .toArray();\n double[] knowns_vector1 = knowns_vector.stream().mapToDouble(Double::doubleValue).toArray();\n\n double sim = vectorSpaceModel.getSimilarity(vec1,knowns_vector1);\n System.out.println(sim);\n if (sim>0.09){\n sims.add(new similarities(sim,docs,skills,(String)sbj.get(\"id\")));\n\n }\n }\n\n}\n finally {\n // cr.close();\n }\n Collections.sort(sims);\n String result = \"{\\\"docs\\\":[\";\n for(similarities sim:sims){\n System.out.println(sim.docs);\n System.out.println(sim.sim);\n result+=\"{\\\"name\\\":\\\"\"+sim.name+\"\\\",\\\"sim\\\":\"+sim.sim+\",\\\"skills\\\":\\\"\"+sim.skills+\"\\\",\\\"docs\\\":[\";\n for(String doc:sim.docs){\n result+=\"\\\"\"+doc+\"\\\",\";\n }\n result = result.substring(0,result.length()-1);\n result+=\"]},\";\n }\n result = result.substring(0,result.length()-1);\n result+=\"]}\";\n if (sims.size() ==0) return \"{\\\"docs\\\":[]}\";\n return result;\n}",
"public void sensibleMatches2() \n { \n Map<String, Set<String>> clientMap = new HashMap<>();\n Set<String> interests = new HashSet<>();\n\n interests.add(\"Food\");\n interests.add(\"Wine\");\n interests.add(\"Tandems\");\n clientMap.put(\"Hal\", interests);\n\t \n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Walking\");\n interests.add(\"Welding\");\n clientMap.put(\"Gemma\", interests);\n\n interests = new HashSet<>();\n interests.add(\"Food\");\n interests.add(\"Cinema\");\n interests.add(\"Wine\");\n clientMap.put(\"Caroline\", interests);\n\n Set<String> halsInterests = clientMap.get(\"Hal\");\n String outputString;\n Set<String> eachClientInterests;\n Set<String> intersection ;\n\n for (String eachClient : clientMap.keySet()) \n {\n if (!eachClient.equals(\"Hal\")) \n {\n eachClientInterests = clientMap.get(eachClient);\n intersection = new HashSet<>(halsInterests);\n intersection.retainAll(eachClientInterests);\n outputString = \"Hal and \" + eachClient \n + \" have common interests: \"\n + intersection;\n System.out.println(outputString);\n }\n }\n }",
"public ArrayList<Tuple2<Input, Input>> call(ArrayList<Tuple2<Data<Type0, Type1>, Input>> lst1a,\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> lst1b) {\n\n if (sameRDD) {\n\n int[] permutationArray = new int[lst1a.size()];\n for (int i = 0; i < permutationArray.length; i++) {\n permutationArray[i] = i;\n }\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list2 = new ArrayList<Tuple2<Data<Type0, Type1>, Input>>();//new Tuple2<Data<Type0,Type1>,Input>[lst1a.length];\n //Collections.copy(lst1a,list2);\n list2.addAll(lst1a);\n\n new myMergeSort<Type0, Type1, Input>().sort(list2, permutationArray, new revDataComparator<Type0, Type1, Input>(\n list2ASC, list2ASCSec, equalReverse));\n\n ArrayList<Tuple2<Input, Input>> wilResult = getViolationsSelf(lst1a,\n permutationArray);\n return wilResult;\n } else {\n\n // reset pivot flag\n for (int i = 0; i < lst1b.size(); i++) {\n lst1b.get(i)._1().resetPivot();\n }\n\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list1 = merge(lst1a, lst1b, list1ASC, list1ASCSec);\n\n int[] permutationArray = new int[list1.size()];\n for (int i = 0; i < permutationArray.length; i++) {\n permutationArray[i] = i;\n }\n ArrayList<Tuple2<Data<Type0, Type1>, Input>> list2 = new ArrayList<Tuple2<Data<Type0, Type1>, Input>>();//Tuple2<Data<Type0,Type1>,Record>[list1.length];\n //System.arraycopy(list1, 0, list2, 0, list1.size());\n //Collections.copy(list1,list2);\n list2.addAll(list1);\n new myMergeSort<Type0, Type1, Input>().sort(list2, permutationArray, new revDataComparator<Type0, Type1, Input>(\n list2ASC, list2ASCSec, equalReverse));\n\n ArrayList<Tuple2<Input, Input>> wilResult = getViolationsNonSelf(\n list1, permutationArray);\n\n return wilResult;\n }\n // return output;\n\n }",
"private void compareFirstPass() {\n this.oldFileNoMatch = new HashMap<String, SubsetElement>();\r\n Iterator<String> iter = this.oldFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.newFile.containsKey(key)) {\r\n final String newKey = this.oldFile.get(key).getSubsetCode()\r\n + this.oldFile.get(key).getConceptCode();\r\n this.oldFileNoMatch.put(newKey, this.oldFile.get(key));\r\n }\r\n }\r\n\r\n // Now repeat going the other way, pulling all new file no matches into\r\n // newFileNoMatch\r\n this.newFileNoMatch = new HashMap<String, SubsetElement>();\r\n iter = this.newFile.keySet().iterator();\r\n while (iter.hasNext()) {\r\n final String key = iter.next();\r\n if (!this.oldFile.containsKey(key)) {\r\n final String newKey = this.newFile.get(key).getSubsetCode()\r\n + this.newFile.get(key).getConceptCode();\r\n this.newFileNoMatch.put(newKey, this.newFile.get(key));\r\n }\r\n }\r\n\r\n // dump the initial large HashMaps to reclaim some memory\r\n this.oldFile = null;\r\n this.newFile = null;\r\n }",
"public static int method1(int temp[]) {\r\n\r\n\t\tfor (int i = 0; i < temp.length; i++) {\r\n\r\n\t\t\tint count = 0;\r\n\t\t\tint founded = temp[i];\r\n\t\t\tfor (int j = 0; j < temp.length; j++) {\r\n\r\n\t\t\t\tif (temp[j] == founded) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ((count % 2) != 0) {\r\n\t\t\t\treturn founded;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"public static ArrayList<StudentGrade> getGradesbyRubric(ArrayList<Rubric> rubric , String rubricName)\n{\n ArrayList<StudentGrade> grades = null;\n for(Rubric search: rubric)\n {\n if(search.getRubricName().equalsIgnoreCase(rubricName))\n {\n \n grades= search.getGrades();\n }\n\n }\n return grades; \n}",
"private void arraySearch(MyArrayList myArrayList, Results results, int value) {\r\n if(myArrayList.search(value)) { \r\n results.storeNewResult(\"ArraySearch test case: PASSED\");\r\n }\r\n else { \r\n results.storeNewResult(\"ArraySearch test case: FAILED\");\r\n }\r\n }",
"private static int matchingFriends(int seq) {\n\t\tint firstFree = -1;\n\t\tfor (int i = 0; i < students; ++i) {\n\t\t\tif (!taken[i]) {\n\t\t\t\tfirstFree = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// all students find their own pairs and finish recursion\n\t\tif (firstFree == -1) {\n\t\t\treturn 1;\n\t\t}\n\t\t\n\t\tint result = 0;\n\t\tfor (int pairWith = firstFree + 1; pairWith < students; ++pairWith) {\n\t\t\tif (!taken[pairWith] && areFriends[firstFree][pairWith] && areFriends[pairWith][firstFree]) {\n\t\t\t\ttaken[firstFree] = true;\n\t\t\t\ttaken[pairWith] = true;\n\t\t\t\tresult += matchingFriends(firstFree + 1);\n\t\t\t\ttaken[firstFree] = false;\n\t\t\t\ttaken[pairWith] = false;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"private List<AxiomTreeMapping> matchNodeLists(List<AxiomTreeNode> t1s, List<AxiomTreeNode> t2s, AxiomTreeMapping mapping) {\n\n // no more child nodes left\n if (t1s.isEmpty()) {\n return Collections.singletonList(mapping);\n }\n\n List<AxiomTreeMapping> matches = new ArrayList<AxiomTreeMapping>();\n\n // get the first child node in the list\n AxiomTreeNode t1 = t1s.get(0);\n List<AxiomTreeNode> t1sReduced = reduceNodeList(t1s, 0);\n //System.out.println(\"FIRST CHILD NODES: \" + t1sReduced);\n // loop over child nodes in t2s\n for (int i = 0; i < t2s.size(); i++) {\n AxiomTreeNode t2 = t2s.get(i);\n List<AxiomTreeNode> t2sReduced = reduceNodeList(t2s, i);\n //System.out.println(\"SECOND CHILD NODES: \" + t2sReduced);\n // try and match the first element in t1s and some element in t2\n for (AxiomTreeMapping match : match(t1, t2, mapping)) {\n matches.addAll(matchNodeLists(t1sReduced, t2sReduced, match));\n }\n }\n \n return matches;\n }"
]
| [
"0.6324397",
"0.6273612",
"0.6045899",
"0.602479",
"0.6003994",
"0.5990258",
"0.59692556",
"0.59566844",
"0.59516",
"0.5945943",
"0.5939203",
"0.5908899",
"0.5851697",
"0.5823648",
"0.5792951",
"0.5789306",
"0.5782592",
"0.57743096",
"0.5761652",
"0.5753038",
"0.57307565",
"0.5727458",
"0.5708823",
"0.5646169",
"0.56443036",
"0.5640546",
"0.56077987",
"0.5576804",
"0.555236",
"0.55503833",
"0.5541229",
"0.5536688",
"0.5535196",
"0.5531928",
"0.5505966",
"0.5500359",
"0.5500292",
"0.5491931",
"0.5476595",
"0.5476301",
"0.54750705",
"0.54673517",
"0.5429127",
"0.5429127",
"0.5429127",
"0.5429127",
"0.5429127",
"0.5429127",
"0.54283637",
"0.5425153",
"0.5424868",
"0.54121566",
"0.54031265",
"0.54024917",
"0.5398545",
"0.538679",
"0.5382141",
"0.5380281",
"0.5372066",
"0.5369748",
"0.5346401",
"0.53437144",
"0.5331866",
"0.5327145",
"0.53154445",
"0.53014517",
"0.5299645",
"0.5297266",
"0.52964115",
"0.5293448",
"0.52896965",
"0.52896965",
"0.52896965",
"0.5287698",
"0.5281526",
"0.5272369",
"0.5271002",
"0.5270694",
"0.52635264",
"0.52623945",
"0.52592695",
"0.525744",
"0.5238861",
"0.52372634",
"0.5214767",
"0.52133185",
"0.5209904",
"0.5208345",
"0.52060276",
"0.5205044",
"0.5201432",
"0.51980245",
"0.5197098",
"0.5184946",
"0.51803946",
"0.5176394",
"0.51746666",
"0.5173242",
"0.51707685",
"0.5167189"
]
| 0.5956543 | 8 |
The toggle was changed | protected void toggleStateChanged()
{
getSoccerMaster().setShowBallCoord( isToggledOn() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void Toggle() {\n\t \n }",
"public void toggle(){\n isOn = !isOn;\n }",
"void updateCommonToggleStatus(boolean shown);",
"public void isChanged()\n\t{\n\t\tchange = true;\n\t}",
"public void toggleConsumptionHasChanged() {\n\t\tthis.consumptionHasChanged = (this.consumptionHasChanged) ? false : true;\n\t}",
"public void toggle(){\r\n isDown = !isDown;\r\n }",
"public abstract void toggle();",
"@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) {\n\t\t\t\tSystem.out.println(\"distancia selecionada e \" + tg.getSelectedToggle().getUserData().toString());\n\t\t\t\t\n\t\t\t\tangle = Integer.parseInt(tg.getSelectedToggle().getUserData().toString()); \n\t\t\t}",
"void toggle();",
"@Override\n public void onCheckedChanged(CompoundButton toggleButton, boolean isChecked) {\n if (!isChecked) {\n viewHolder.state_endpoint_in_scene_text_view.setText(context.getResources().getString(R.string.label_off));\n state[0] = 0;\n } else {\n viewHolder.state_endpoint_in_scene_text_view.setText(context.getResources().getString(R.string.label_on));\n state[0] = 255;\n }\n // If the values are modified while the user does not check/unckeck the checkbox, then we update the value from the controller.\n int exist = mode.getPayload().indexOf(c);\n if (exist != -1) {\n mode.getPayload().get(exist).setV(state[0]);\n }\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 2;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 1;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}",
"void toggled(ToggledEvent event);",
"public void toggle()\n\t{\n\t\tbitHolder.setValue(Math.abs(bitHolder.getValue() - 1 ));\n\t\t\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 3;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}",
"protected synchronized void setChanged() {\n changed = true;\n }",
"Boolean getIsChanged();",
"void notifySpyModeToggle();",
"public void toggleEnable();",
"protected void change() {\r\n\r\n // consume?\r\n if(isLoop()) return;\r\n \r\n // prevent re-entry\r\n setLoop(true);\r\n\r\n // initialize\r\n int dx = 0;\r\n int dy = 0;\r\n\r\n // set flag\r\n boolean isSelected = getToggleButton().isSelected();\r\n\r\n // any change?\r\n if(isExpanded!=isSelected) {\r\n\r\n // set flag\r\n isExpanded = isSelected;\r\n\r\n // translate selection to view\r\n if(isExpanded) {\r\n\r\n \t// get preferred size\r\n \tint max = (preferredExpandedHeight==0 ? (isPreferredSizeSet() ? super.getPreferredSize().height : 0) : preferredExpandedHeight);\r\n\r\n // get height\r\n int h = (isTmpSet(0) ? tmpSize[0].height : max);\r\n\r\n // calculate change\r\n dy = h - minimumCollapsedHeight;\r\n\r\n // apply temporary stored sizes?\r\n if(isTmpSet(1)) super.setMinimumSize(getTmpSize(1));\r\n if(isTmpSet(2)) super.setPreferredSize(getTmpSize(2));\r\n if(isTmpSet(3)) super.setMaximumSize(getTmpSize(3));\r\n\r\n // reset temporary sets\r\n resetTmpSizes();\r\n\r\n }\r\n else {\r\n\r\n // get collapsed height\r\n int h = minimumCollapsedHeight;\r\n\r\n // update temporary sizes\r\n setTmpSize(0,isDisplayable() ? super.getSize() : getPreferredSize(),true);\r\n\r\n // update temporary insets\r\n tmpInsets = super.getInsets();\r\n\r\n // calculate change\r\n dy = h - getTmpSize(0).height;\r\n\r\n // set collapsed size\r\n minimumCollapsedHeight = h;\r\n\r\n // set new insets\r\n if(headerPlacement==SwingUtilities.BOTTOM) {\r\n \tcollapsedInsets = new Insets(0, tmpInsets.left, tmpInsets.bottom, tmpInsets.right);\r\n } else {\r\n \tcollapsedInsets = new Insets(tmpInsets.top, tmpInsets.left, 0, tmpInsets.right);\r\n }\r\n \r\n\r\n }\r\n\r\n // apply change\r\n super.setBorder(createBorder());\r\n\r\n // update tool tip text\r\n getToggleButton().setToolTipText(isExpanded() ? \"Lukk\" : \"┼pne\");\r\n\r\n // notify\r\n fireToggleEvent(dx,dy);\r\n\r\n // notify manager hierarchy\r\n super.requestResize(dx, dy, true);\r\n\r\n }\r\n\r\n // resume\r\n setLoop(false);\r\n\r\n }",
"public void change() {\r\n this.mode = !this.mode;\r\n }",
"@Override\n public void changed(ObservableValue<? extends Boolean> ov, Boolean onHidden, Boolean onShown) {\n }",
"public void toggle() {\n toggle(false);\n }",
"@Override\n\t\t\tpublic void changed(ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) {\n\t\t\t\tif (group.getSelectedToggle() != null) {\n\t\t\t\t\tRadioButton button = (RadioButton) group.getSelectedToggle();\n\t\t\t\t\tSystem.out.println(\"Button: \" + button.getText());\n switch (button.getText()) {\n case \"False\":\n ReportResult.updateLastResult(Boolean.FALSE);\n break;\n case \"True\":\n default:\n ReportResult.updateLastResult(Boolean.TRUE);\n break;\n }\n\t\t\t\t\tinfoArea.appendText(\"You choosed the result of the report text : \" + button.getText() + \"\\n\");\n\t\t\t\t}\n\t\t\t}",
"void onSwitched(ToggleableView toggleableView, boolean isOn);",
"@Override\n\tpublic void toggle() {\n\t\tsetChecked(!checked);\n\t}",
"@Override\n\tpublic void setChanged() {\n\t\tthis.changed = true;\n\t}",
"public void toggle() {\n setChecked(!checked);\n }",
"@Override\r\n\tpublic int ToggleDown() {\n\t\treturn 0;\r\n\t}",
"@JsProperty boolean getToggles();",
"public boolean isToggle() {\n return getElement().isToggle();\n }",
"@Override\n public void toggle() {\n checkBox.toggle();\n }",
"@Override // androidx.lifecycle.Observer\n public void onChanged(Boolean bool) {\n Boolean bool2 = bool;\n if (bool2 != null) {\n bool2.booleanValue();\n Views.setVisible(AdvertStatsActivity.access$getToolbarTitle$p(this.a), bool2.booleanValue());\n }\n }",
"void currentStateChanged();",
"public void setToggle(int toggle) {\n\t\tToggle[SortType - 1] = toggle;\n\t}",
"@Override\n public void toggle(boolean active) {\n }",
"public void markChanged()\n \t{\n \t\tbChanged=true;\n \t}",
"private void changed() {\n // Ok to have a race here, see the field javadoc.\n if (!changed)\n changed = true;\n }",
"public void toggleSignal() {\n if (green) {\n green = false;\n } else {\n green = true;\n }\n }",
"@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagHehuo = !bFlagHehuo;\r\n\t\t\t\t hehuo_btn.setChecked(bFlagHehuo);\r\n\t\t\t }",
"public void toggle() { this.isOpen = !this.isOpen; }",
"@Override\n\t\tpublic void onChange(boolean selfChange) {\n\t\t\tsuper.onChange(selfChange);\n\t\t}",
"public boolean isChanged() {\r\n return isChanged;\r\n }",
"public void setChanged(boolean isChanged)\r\n\t{\r\n\t\tchanged = isChanged;\r\n\t}",
"public void changeIsFlagged() {\r\n\t\tif (this.isFlagged) {\r\n\t\t\tthis.isFlagged = false;\r\n\t\t} else {\r\n\t\t\tthis.isFlagged = true;\r\n\t\t}\r\n\t}",
"public boolean isSwitchedOn(){\r\n return _switchedOn;\r\n }",
"@Override\n public boolean onClick(View view) {\n updateToggle(view, !mChecked);\n// updateText(view); // automatically\n return true;\n }",
"@Override\n public void onMenuToggle(boolean b) {\n }",
"@Override\n\t\t\t\t\tpublic void onToggleChange(View v, boolean isOpen) {\n\t\t\t\t\t\tSPUtils.putBoolean(getApplicationContext(),\n\t\t\t\t\t\t\t\tMyContains.SHOWSYSTEMTASK, isOpen);\n\t\t\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t\t\t}",
"public int getToggle() {\n\t\treturn Toggle [SortType - 1];\n\t}",
"public void toggle() {\n if (isOn()) {\n turnOff();\n } else {\n turnOn();\n }\n }",
"void toggleButton_actionPerformed(ActionEvent e) {\n this.togglePlot();\n }",
"public void setToggle(boolean value) {\n getElement().setToggle(value);\n }",
"@Override\n public void onChange(boolean selfChange) {\n onChange(selfChange, null);\n }",
"public void onToggleAnimate(View view) {\n updateEnabledState();\n }",
"@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagZhaopin = !bFlagZhaopin;\r\n\t\t\t\t zhaopin_btn.setChecked(bFlagZhaopin);\r\n\t\t\t }",
"@JsProperty void setToggles(boolean value);",
"public boolean changeMade()\n {\n return isChanged;\n }",
"@Override\r\n\tpublic void handle(ActionEvent event) {\r\n\t\tString command = ((ToggleButton) event.getSource()).getText();\r\n\t\tthis.view.getPaintPanel().setMode(command);\r\n\t\t\r\n\t}",
"public void changeStatus(){\n Status = !Status;\n\n }",
"@Test\n public void testToggle() {\n // Toggle on test.\n boolean before = plug.getCondition();\n clickOn(\"ON\");\n assertNotEquals(before, plug.getCondition());\n\n // Toggle off test which also implies that the ON/OFF status is displayed.\n before = plug.getCondition();\n clickOn(\"OFF\");\n assertNotEquals(before, plug.getCondition());\n }",
"@Override\r\n public boolean isSwitchOn() {\r\n return isOn;\r\n }",
"public void toggleMode() {\n if (edit_rbmi.isSelected()) filter_rbmi.setSelected(true);\n // else if (filter_rbmi.isSelected()) edgelens_rbmi.setSelected(true);\n // else if (edgelens_rbmi.isSelected()) timeline_rbmi.setSelected(true);\n else edit_rbmi.setSelected(true);\n }",
"@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagLianxiren = !bFlagLianxiren;\r\n\t\t\t\t lianxiren_btn.setChecked(bFlagLianxiren);\r\n\t\t\t }",
"@FXML\n public void toggle(ActionEvent actionEvent) {\n if (isToggled) {\n cardText.setText(current.getQuestion());\n isToggled = false;\n } else {\n cardText.setText(current.getAnswer());\n isToggled = true;\n }\n }",
"public void toggle()\n\t{\n\t\tsetVisible(!this.isShowing());\n\t}",
"@Override\n public void changed(ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) {\n\n prices.add(0);\n if (newValue == spareRibs) {\n prices.add(169);\n\n } if (newValue == origSparePlus20) {\n prices.add(189);\n\n } if (newValue == plus40) {\n prices.add(209);\n\n } if (newValue == amiRibsAndChickenBreast) {\n prices.add(185);\n\n } if (newValue == route66) {\n prices.add(205);\n\n } if (newValue == chilliDip) {\n prices.add(6);\n\n } if (newValue == smokeyBBQ) {\n prices.add(6);\n\n } if (newValue == aioli) {\n prices.add(6);\n } if (newValue == chipotleMayo) {\n prices.add(6);\n } if (newValue == bakedPotatoWSourButter) {\n prices.add(10);\n } if (newValue == bakedPotatoWSourCream) {\n prices.add(10);\n } if (newValue == bakedPotatoWSourGarlicButter) {\n prices.add(10);\n } if (newValue == CrispyPotatoButtonPlus10 ) {\n prices.add(10);\n }\n if (newValue == ChooseSoftIce){\n prices.add(49);\n }\n if(newValue == showTotal){\n prices.add(0);\n }\n\n\n int price = 0;\n for (int i = 0; i < prices.size() - 1; i++) {\n price = prices.get(i) + price;\n }\n totalPrice.setText(\"\" + price);\n System.out.println(price);\n\n }",
"public void onChanged(Boolean bool) {\n if (bool != null) {\n C41389o oVar = this.f107704a;\n C7573i.m23582a((Object) bool, \"it\");\n oVar.mo102021a(bool.booleanValue());\n }\n }",
"public void switchLight(){\r\n _switchedOn = !_switchedOn;\r\n }",
"public Toggle (Boolean setting, String name, String trueName, String falseName){\r\n \t\t\tthis.setting = setting;\r\n \t\t\tthis.name = name;\r\n \t\t\tthis.trueName = trueName;\r\n \t\t\tthis.falseName = falseName;\r\n \t\t}",
"@Override\n\tpublic void stateChanged() {\n\t\t\n\t}",
"@Override\r\n\tpublic int ToggleUp() {\n\t\treturn 0;\r\n\t}",
"public boolean isChanged()\r\n\t{\r\n\t\treturn changed;\r\n\t}",
"public void setOn(){\n state = true;\n //System.out.println(\"Se detecto un requerimiento!\");\n\n }",
"synchronized void toggle() {\n myShouldPause = !myShouldPause;\n this.notify();\n }",
"public boolean switchOn(){\n if(this.is_Switched_On){\n return false;\n }\n this.is_Switched_On = true;\n return true;\n }",
"public void onChanged(Boolean bool) {\n int i;\n if (bool != null) {\n LocationActivitySettingItem a = this.f107703a.mo102020a();\n C7573i.m23582a((Object) bool, \"it\");\n if (bool.booleanValue()) {\n i = 0;\n } else {\n i = 8;\n }\n a.setVisibility(i);\n }\n }",
"private void toggle(int a) {\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < et.size(); i++) {\r\n\t\t\t\ttoogleOne(et.get(i), el.get(i), false);\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < toggle; i++) {\r\n\t\t\t\ttoogleOne(et.get(i), el.get(i), true);\r\n\t\t\t}\r\n\t\t\tlogp(INFO, getClassName(GraphicalUserInterface.class), \"toggle\", String.join(getSpace(), \"T\".concat(Library.toString(a)), \"Activated\"));\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tlogp(INFO, getClassName(GraphicalUserInterface.class), \"toggle\", String.join(getSpace(), \"Error\", \"Activated\"));\r\n\t\t}\r\n\t}",
"public void changeStatus()\n {\n if(this.isActivate == false)\n {\n this.isActivate = true;\n switchSound.play();\n //this.dungeon.updateSwitches(true); \n }\n else{\n this.isActivate = false;\n switchSound.play(1.75, 0, 1.5, 0, 1);\n //this.dungeon.updateSwitches(false); \n }\n notifyObservers();\n\n }",
"@Override\r\n\t\t\t\t public void onClick(View v) {\n\t\t\t\t\t bFlagGongsi = !bFlagGongsi;\r\n\t\t\t\t\t gongsi_btn.setChecked(bFlagGongsi);\r\n\t\t\t\t }",
"public void changed(boolean changed) {\r\n\t\tthis.changed = changed;\r\n\t}",
"private void change() {\n\t\tsetChanged();\n\t\t//NotifyObservers calls on the update-method in the GUI\n\t\tnotifyObservers();\n\t}",
"public boolean hasChanged();",
"public boolean hasChanged();",
"public void toggle() {\n if (volume == 1f) {\n volume = 0f;\n }\n else if (volume == 0f) {\n volume = 1f;\n }\n\n }",
"public boolean changed() {\r\n\t\treturn changed;\r\n\t}",
"public void statusChanged() {\n\t\tif(!net.getArray().isEmpty()) {\n\t\t\tigraj.setEnabled(true);\n\t\t}else\n\t\t\tigraj.setEnabled(false);\n\t\t\n\t\tupdateKvota();\n\t\tupdateDobitak();\n\t}",
"@Override\r\n public void onChange(SwitchButton sb, boolean state) {\n Log.d(\"switchButton\", state ? \"锟斤拷\":\"锟斤拷\");\r\n mImgView.setImageBitmap(null);\r\n //defreckle\r\n if(qubanSBtn.isSwitchOn())\r\n mImgView.setImageBitmap(mFaceEditor.BFDefreckleAuto());//));\r\n else\r\n mImgView.setImageBitmap(mFaceEditor.getBaseImage());\r\n }",
"public boolean isChanged() {\n return this.changed;\n }",
"@FXML\n public void isSelectedOn() {\n reset();\n off.setSelected(false);\n // off.\n lab4.setVisible(true);\n txt4.setVisible(true);\n lab5.setVisible(true);\n txt5.setVisible(true);\n lab6.setVisible(true);\n txt6.setVisible(true);\n }",
"private void updateToggles() {\n ContentResolver res = getContentResolver();\n\n final boolean backupEnabled = Settings.Secure.getInt(res,\n Settings.Secure.BACKUP_ENABLED, 0) == 1;\n mBackup.setChecked(backupEnabled);\n\n mAutoRestore.setChecked(Settings.Secure.getInt(res,\n Settings.Secure.BACKUP_AUTO_RESTORE, 1) == 1);\n mAutoRestore.setEnabled(backupEnabled);\n }",
"public void toggleSwitch() {\r\n if (this.radioToggleGroup.getSelectedToggle().equals(this.inHouseRadio)) {\r\n machineOrCompanyLabel.setText(\"Machine ID\");\r\n inHouseSelected = true;\r\n } else {\r\n machineOrCompanyLabel.setText(\"Company Name\");\r\n inHouseSelected = false;\r\n }\r\n }",
"public void stateChanged(ChangeEvent e)\r\n\t\t\t\t\t{\n\t\t\t\t\t\ttheGridView.showWalkTiles(showWalkTilesButton.isSelected());\r\n\t\t\t\t\t}",
"public boolean toggle() {\r\n // forward\r\n getToggleButton().doClick();\r\n // return toggle state\r\n return isExpanded();\r\n }",
"public boolean hasStatusChanged() {\n return typeCase_ == 5;\n }",
"public void click() {\n\t\tif(toggles) {\n\t\t\tvalue = (value == 0) ? 1 : 0;\t// flip toggle value\n\t\t}\n\t\tupdateStore();\n\t\tif(delegate != null) delegate.uiButtonClicked(this);\t// deprecated\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n \tapp.toggleLightMode();\n \tisDark = !isDark;\n }",
"@Override\n\t\tpublic void buttonStatusChange() {\n\t\t\t\n\t\t}",
"public final void onChanged(Boolean bool) {\n if (bool != null && bool.booleanValue()) {\n ((ImageView) this.f53754a.mo78146a(R.id.btnSliceOrder)).setImageResource(R.drawable.bfy);\n }\n }",
"public Toggle (Boolean setting, String name){\r\n \t\t\tthis.setting = setting;\r\n \t\t\tthis.name = name;\r\n \t\t\ttrueName = \"enabled\"; //Default names.\r\n \t\t\tfalseName = \"disabled\";\r\n \t\t}"
]
| [
"0.7413197",
"0.7047961",
"0.7043459",
"0.7026336",
"0.6864783",
"0.68542314",
"0.684332",
"0.68372816",
"0.68130547",
"0.68034214",
"0.6786445",
"0.67816216",
"0.6734508",
"0.6709748",
"0.666255",
"0.66450936",
"0.66356134",
"0.6633887",
"0.6580026",
"0.6543534",
"0.6540818",
"0.6536975",
"0.6526612",
"0.6509343",
"0.6488023",
"0.6479394",
"0.64283395",
"0.64250845",
"0.6416221",
"0.64027876",
"0.6395087",
"0.6350791",
"0.6303377",
"0.630173",
"0.6301133",
"0.62935424",
"0.6280692",
"0.6279979",
"0.62303346",
"0.6204357",
"0.6202969",
"0.6201161",
"0.61998814",
"0.61867166",
"0.6170684",
"0.61628133",
"0.61555994",
"0.61545104",
"0.61232615",
"0.6118584",
"0.6113147",
"0.6109406",
"0.61072314",
"0.6100759",
"0.6099697",
"0.6095256",
"0.6093754",
"0.6089553",
"0.60821575",
"0.6081227",
"0.6071368",
"0.6066306",
"0.6065375",
"0.606281",
"0.60592955",
"0.6056759",
"0.6045556",
"0.6026252",
"0.6020534",
"0.6004027",
"0.600045",
"0.5996396",
"0.5991441",
"0.59763515",
"0.5968388",
"0.5959573",
"0.59541243",
"0.5947525",
"0.59282595",
"0.5926397",
"0.5926249",
"0.59224564",
"0.5920146",
"0.5920146",
"0.59178907",
"0.5913025",
"0.5904681",
"0.5897575",
"0.5895648",
"0.5891111",
"0.58890885",
"0.588324",
"0.5881023",
"0.5878588",
"0.58712703",
"0.5858967",
"0.5858939",
"0.5846268",
"0.58408636",
"0.5838238"
]
| 0.69645333 | 4 |
start of drag, if drag in progress | @Override
public void mousePressed(MouseEvent e) {
lastClick = e.getPoint();
// Process the hotspots in REVERSE order, so that he who is plotted last (frontmost) is detected first
for(int i=hotspot.length-1; i>=0; i--) {
int dx = lastClick.x - hotspot[i].x, dy = lastClick.y - hotspot[i].y;
if(dx*dx + dy*dy <= hotspot[i].r*hotspot[i].r) {
activeHotspot = i;
displacement.x = displacement.y = 0;
addMouseMotionListener(mouseFollower);
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean onDragStarted();",
"@Override\n public void onDragStarted(int position) {\n }",
"private void startDragging() {\n Point mousePosition = calculateMouseLocation();\n mouseX = mousePosition.getX();\n mouseY = mousePosition.getY();\n prevX = getArea().getX();\n prevY = getArea().getY();\n setDragging(true);\n }",
"public boolean canStartDrag()\n\t{\n\t\treturn !isDragging();\n\t}",
"@DISPID(-2147412077)\n @PropGet\n java.lang.Object ondragstart();",
"protected abstract boolean dragged();",
"private synchronized void startDrag(Point p) {\n this.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));\n beingDragged = true;\n moveSource = p;\n }",
"void onDragStart(View view);",
"@DISPID(204)\r\n public boolean beginDrag() {\r\n throw new UnsupportedOperationException();\r\n }",
"private boolean startDrag(MotionEvent event) {\n if(dragging != null)\n {\n return false;\n }\n\n int x = ((int) event.getX() - targetOffsetX) / targetColumnWidth;\n int y = ((int) event.getY() - targetOffsetY) / targetRowHeight;\n\n if(x < 0 || x >= puzzleWidth || y < 0 || y >= puzzleHeight)\n {\n return false;\n }\n\n int direction = slidePuzzle.getDirection(x + puzzleWidth * y);\n\n if(direction >= 0)\n {\n dragging = new HashSet<Integer>();\n\n while(x + puzzleWidth * y != slidePuzzle.getHandleLocation())\n {\n dragging.add(x + puzzleWidth * y);\n dragStartX = (int) event.getX();\n dragStartY = (int) event.getY();\n dragOffsetX = 0;\n dragOffsetY = 0;\n dragDirection = direction;\n\n x -= PuzzleSlide.DIRECTION_X[direction];\n y -= PuzzleSlide.DIRECTION_Y[direction];\n }\n }\n\n dragInTarget = false;\n vibrate(VIBRATE_DRAG);\n\n return true;\n }",
"public void onDragEnded();",
"@DISPID(-2147412077)\n @PropPut\n void ondragstart(\n java.lang.Object rhs);",
"protected abstract Vector4d startSourceDrag(Node source,\n Vector3d pos, Vector4d copy);",
"void onStartTrackingTouch() {\n mIsDragging = true;\n }",
"void onStartTrackingTouch() {\n mIsDragging = true;\n }",
"public void startDrag(IDragStone iDragStone)\n\t{\n\t\tdragged = iDragStone;\n\t\tpaintMode = false;\n\t\tpaintOneOnly = false;\n\t}",
"static void setNotDraging(){isDraging=false;}",
"@Override\r\n public void mousePressed(MouseEvent e) {\n startDrag = new Point(e.getX(), e.getY());\r\n endDrag = startDrag;\r\n repaint();\r\n\r\n }",
"@Override\n\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\tif(state.getStatus()==Status.SELECTING_RECT){\n\t\t\t\tif(startDragginPoint == null)\n\t\t\t\t\tdraggingFrom(arg0.getPoint());\n\t\t\t\tcurrentDragPoint = arg0.getPoint();\t\n\t\t\t\trepaint();\n\t\t\t}\n\t\t\tif(state.getStatus()==Status.SELECTING_RECT_LS){\n\t\t\t\tif(startDragginPoint == null)\n\t\t\t\t\tdraggingFrom(arg0.getPoint());\n\t\t\t\tcurrentDragPoint = arg0.getPoint();\t\n\t\t\t\trepaint();\n\t\t\t}\n\t\t}",
"public void mouseMoved(MouseEvent e) {\n ptDragStart = e.getPoint();\r\n\r\n }",
"public static void setDragStart() {\n\t\tblockContext.dragStart = new Date();\n\n\t\tblockContext.dragStartTimeStamp = (int) (blockContext.dragStart.getTime()\n\t\t\t\t- blockContext.instructionEnd.getTime());\n\t}",
"public boolean isDragging()\n\t{\n\t\treturn dragged != null;\n\t}",
"@Override\n\tpublic void onDragEnd(boolean success) {\n\t\t\n\t}",
"@Override\n\tpublic void onDragStart(DragSource source, Object info, int dragAction) {\n\n\t}",
"public void mouseDragged (MouseEvent e) { if(task!=null) task.mouseDragged(e); }",
"public void draggingStarted(RowDragEvent ev) {\r\n\t\tsetMessage(\"...Moving row...\");\r\n\t\t// System.out.println(\"Started dragging row \"+draggedRow);\r\n\t}",
"void onStartDrag(RecyclerView.ViewHolder viewHolder);",
"void onStartDrag(RecyclerView.ViewHolder viewHolder);",
"void onDragged();",
"public void setDrag(boolean drag){\n mDrag = drag;\n if(drag && !mEventHandler.getScroller().isFinished()){\n mEventHandler.getScroller().forceFinished(true);\n }\n }",
"public void mousePressed(MouseEvent e) {\n ptDragStart = e.getPoint();\r\n mouseDragged = true;\r\n }",
"private void enableDrag() {\n final Delta dragDelta = new Delta();\n setOnMousePressed((MouseEvent mouseEvent) -> {\n // record a delta distance for the drag and drop operation.\n if(isDragEnabled) {\n dragDelta.x = getCenterX() - mouseEvent.getX();\n dragDelta.y = getCenterY() - mouseEvent.getY();\n }\n });\n setOnMouseDragged((MouseEvent mouseEvent) -> {\n if(isDragEnabled) {\n double newX = mouseEvent.getX() + dragDelta.x;\n if (newX > 0 && newX < getScene().getWidth()) {\n setCenterX(newX);\n if(this == base)\n startX = getCenterX();\n }\n double newY = mouseEvent.getY() + dragDelta.y;\n if (newY > 0 && newY < getScene().getHeight()) {\n setCenterY(newY);\n if(this == base)\n startY = getCenterY();\n }\n }\n });\n }",
"public void startDrag(String skillname, int tile) {\n dragging = true;\n draggedImage.isVisible = true;\n draggedImage.setTile(tile);\n dragTile = tile;\n draggedSkill = skillname;\n }",
"public boolean isDragging( ) {\n\t\tif ( draggable ) {\n\t\t\tif ( dragging ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n public void onItemDragStarted(int position) {\n }",
"abstract boolean getIsDragging();",
"@Override\n public void drag(int x, int y)\n {\n }",
"@Override\r\n\t\tpublic void dragEnter(DropTargetDragEvent dtde) {\n\t\t\t\r\n\t\t}",
"@Override\r\n public void dragEnter(DropTargetDragEvent dtde) {}",
"public boolean dragFromSubComponents();",
"public void dragEnter(DropTargetDragEvent dtde) {\n\t\t\n\t}",
"public void drag(Point p);",
"public void dragEnter(DropTargetDragEvent dtde) {\r\n \r\n }",
"@Override\n\tpublic void onMarkerDragStart(Marker arg0) {\n\t}",
"public void startDragging(Rectangle selectionBox) {\n\t\tVector position = getPosition(selectionBox);\n\t\t\n\t\ttransform.setFromPoint(position);\n\t\ttransform.setToPoint(position);\n\t\ttransform.setAnchorPoint(getAnchorPoint(selectionBox));\n\t}",
"void dragPoint() {\n\t\toffsetP = PVector.sub(P, beginOffsetP); // calculate the offset made by\n\t\t\t\t\t\t\t\t\t\t\t\t// mouseDrag -- subtract\n\t\t\t\t\t\t\t\t\t\t\t\t// beginOffsetP from P\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].drag();\n\t}",
"void dragDetected(DragDetectEvent e);",
"private native long startDrag(Component component,\n Transferable transferable,\n\t\t\t\t InputEvent nativeTrigger, \n\t\t\t\t Cursor c, int ctype, int actions, \n\t\t\t\t long[] formats, Map formatMap);",
"@Override\n\tpublic boolean onDrag(View v, DragEvent event) {\n\n\t\tif (event.getAction() == DragEvent.ACTION_DRAG_STARTED) {\n\t\t\t// ジェスチャー開始時\n\t\t\tstartX = event.getX();\n\t\t\tviewPositionX = v.getX();\n\n\t\t} else if (event.getAction() == DragEvent.ACTION_DRAG_LOCATION) {\n\n\t\t\tv.setX(viewPositionX + (event.getX() - startX));\n\t\t\tv.setAlpha(1.0f - Math.abs(event.getX() - startX) / 200);\n\n\t\t} else if (event.getAction() == DragEvent.ACTION_DROP) {\n\t\t\t// ジェスチャー終了時\n\n\t\t\tv.setX(viewPositionX);\n\t\t\tv.setAlpha(1.0f);\n\n\t\t\tfloat distance = event.getX() - startX;\n\t\t\tSystem.out.println(\"移動距離: \" + distance);\n\n\t\t\tif (distance > 200) {\n\t\t\t\tonGestureListener.onPrev(v);\n\t\t\t} else if (distance < -200) {\n\t\t\t\tonGestureListener.onNext(v);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Override\r\n public void onDownMotionEvent() {\n mFirstScroll = mDragging = true;\r\n }",
"@Override\n public void mousePressed(MouseEvent e) {\n startDrag = new Point(e.getX(), e.getY());\n points.add(startDrag);\n repaint();\n }",
"private void dragPaint() {\n\n\t\t//buffer die image ooit\n\t\tinvalidate();\n\t\trepaint();\n\t}",
"public void onMoveGestureStarted()\n\t{\n\t\tfireEvent(TiC.EVENT_MOVE_START, null);\n\t}",
"@Override\r\n @TargetApi(Build.VERSION_CODES.HONEYCOMB)\r\n protected void onStartDrag() {\n ArrayList<BaseToken> tokens =\r\n new ArrayList<BaseToken>(this.mMultiSelect.getSelectedTokens());\r\n if (!this.mSelected) {\r\n tokens.add(0, this.getPrototype());\r\n }\r\n this.startDrag(null,\r\n new TokenStackDragShadow(tokens, (int) this.getTokenRadius()),\r\n tokens, 0);\r\n }",
"public PuzzleState drag(int startRow, int startColumn, int endRow, int endColumn);",
"@Override\r\n\tpublic void mouseDragged(MouseEvent me) {\r\n\t\tdrag(me.getX(), me.getY());\r\n\t}",
"@Override\n public void mouseDragged(MouseEvent e) {\n Point tabPt = e.getPoint(); // e.getDragOrigin();\n if (startPt != null\n && Math.sqrt(Math.pow(tabPt.x - startPt.x, 2)\n + Math.pow(tabPt.y - startPt.y, 2)) > gestureMotionThreshold) {\n DnDTabbedPane src = (DnDTabbedPane) e.getSource();\n TransferHandler th = src.getTransferHandler();\n dragTabIndex = src.indexAtLocation(tabPt.x, tabPt.y);\n th.exportAsDrag(src, e, TransferHandler.MOVE);\n lineRect.setRect(0, 0, 0, 0);\n src.getRootPane().getGlassPane().setVisible(true);\n src.setDropLocation(new DropLocation(tabPt, -1));\n startPt = null;\n }\n }",
"protected abstract Vector4d doSourceDrag(Node source,\n Vector3d pos, Vector4d copy);",
"@Override\n\t\t\tpublic void dragEnter(DropTargetDragEvent e) {\n\t\t\t}",
"public void mouseDragged(MouseEvent e) {\n if (mouseDraggedCmd != null) {\n mouseDraggedCmd.execute();\n }\n }",
"@Override\n\tpublic void onMarkerDragStart(Marker marker) {\n\t\t\n\t}",
"public void setDragging( boolean state ) {\n\t\tthis.dragging = state;\n\t}",
"private void dragDone(DragEvent event) {\n TransferMode modeUsed = event.getTransferMode();\n if (modeUsed == TransferMode.MOVE) {\n this.setDisable(true);\n }\n event.consume();\n }",
"@FXML\n private void mouseDown(MouseEvent event) {\n preDragX = event.getX();\n preDragY = event.getY();\n }",
"private void moveStart(MouseEvent e) {\n\t\tif (e.getButton()!=PRIMARY || resizing.get()!=NONE) return;\n\n\t\tmouseMonitor = APP.getMouse().observeMouseVelocity(consumer(m -> mouseSpeed = m.getSpeed()));\n\t\tisMoving.set(true);\n\t\tappX = e.getSceneX();\n\t\tappY = e.getSceneY();\n\t}",
"private boolean finishDrag(MotionEvent event) {\n if(dragging == null)\n {\n return false;\n }\n\n updateDrag(event);\n\n if(dragInTarget)\n {\n doMove(dragDirection, dragging.size());\n }\n else\n {\n vibrate(VIBRATE_DRAG);\n }\n\n dragInTarget = false;\n dragging = null;\n invalidate();\n\n return true;\n }",
"@Override\n\tpublic void dragAborted () {\n\t}",
"@Override\r\n\t\t\tpublic void dragEnter(DropTargetEvent event) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void dragEnter(DropTargetEvent event) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n\tpublic boolean touchDragged(int arg0, int arg1, int arg2) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean touchDragged(int arg0, int arg1, int arg2) {\n\t\treturn false;\n\t}",
"public void startMovingToTarget() \r\n {\n movingToTarget = true;\r\n }",
"@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}",
"public void mousePressed(MouseEvent me) {\n startDrag(me.getPoint());\n }",
"@Override\n public void onDragEnd() {\n // Do nothing.\n }",
"public void setDragEnabled(boolean enabled) { \n \tthis.dragEnabled = enabled; \n \t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\tpublic void dragDropped() {\n\n\t}",
"@Override\r\n\t\t\tpublic void mouseDragged(MouseEvent arg0) {\n\r\n\t\t\t}",
"@Override\n public void onDragStarted(RecyclerView.ViewHolder viewHolder) {\n if(viewHolder instanceof EditRecipeIngredientViewHolder)\n mIngredientItemTouchHelper.startDrag(viewHolder);\n\n if(viewHolder instanceof EditImageViewHolder)\n mImageItemTouchHelper.startDrag(viewHolder);\n }",
"public void dragEnter(DragSourceDragEvent evt) {\n }",
"@Override\r\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\n \tpublic void mouseDragged(MouseEvent e) {\n \t}",
"@Override\n protected boolean performDrag(float x) {\n if (!mCaptured) {\n int dx = 0;\n int dy = 0;\n boolean horizontal = mAxes == SCROLL_AXIS_HORIZONTAL;\n if (horizontal) {\n dx = Math.round(mLastMotionX - x);\n } else {\n dy = Math.round(mLastMotionY - x);\n }\n if (dx == 0 && dy == 0) {\n return false;\n }\n if (dispatchNestedPreScroll(dx, dy, null, mScrollOffsetPair)) {\n if (horizontal) {\n mNestedScrollOffset += mScrollOffsetPair[0];\n mLastMotionX = x;\n } else {\n mNestedScrollOffset += mScrollOffsetPair[1];\n mLastMotionY = x;\n }\n return false;\n }\n mCaptured = horizontal ? horizontalCanScroll(dx) : verticalCanScroll(dy);\n if (!mCaptured) {\n if (dispatchNestedScroll(0, 0, dx, dy, mScrollOffsetPair)) {\n if (horizontal) {\n mNestedScrollOffset += mScrollOffsetPair[0];\n mLastMotionX = x;\n } else {\n mNestedScrollOffset += mScrollOffsetPair[1];\n mLastMotionY = x;\n }\n }\n return false;\n }\n }\n return super.performDrag(x);\n }",
"void captureDrag(float[] startingPoint, float[] endingPoint, int sequenceNumber);",
"@Override\r\n\t\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\t}",
"@Override\n\tpublic void mousePressed(MouseEvent event) {\n\t\tif( event.getButton() == MouseEvent.BUTTON1 ){\n\t\t\tleftClickDrag = true;\n\t\t}else if (event.getButton() == MouseEvent.BUTTON3){\n\t\t\tleftClickDrag = false;\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t// Set the drag start point.\n\t\tcurrentPositionBeforeDrag = getCurrentPosition();\n\t\tdragStartPosition = event.getPoint();\n\t}",
"@Override\n\t\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t}",
"public void mouseDragged(MouseEvent e) {\n if(jtf[mmlp1][mmlp2].getBackground()==Color.yellow || isRightClick)\n setNotDraging();// agar khane zard rang bashad wa ya rast klik shawad-\n else //-nemitan bar ruye an draging kard.\n setDraging();\n }",
"public void dragDropEnd(boolean success);",
"public void mouseDragged(MouseEvent e){}",
"@FXML\n private void mouseDrag(MouseEvent event) {\n dragging = true;\n double tempX = event.getX();\n double tempY = event.getY();\n dragOffsetX = (preDragX - tempX) / 2;\n dragOffsetY = (preDragY - tempY) / 2;\n drawUniverse();\n }",
"@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\t\n\t}"
]
| [
"0.82719445",
"0.75420547",
"0.74230576",
"0.7356134",
"0.7277677",
"0.7130392",
"0.70655525",
"0.7052147",
"0.7030703",
"0.70189464",
"0.6909287",
"0.6798291",
"0.67809576",
"0.67789704",
"0.67789704",
"0.6768147",
"0.67574596",
"0.6744048",
"0.6662771",
"0.6658432",
"0.66232854",
"0.6617383",
"0.6546624",
"0.6529684",
"0.6527033",
"0.6521617",
"0.6468161",
"0.6468161",
"0.6459831",
"0.6448921",
"0.63854873",
"0.6383819",
"0.63438725",
"0.6328419",
"0.63171935",
"0.629479",
"0.6275774",
"0.6267476",
"0.62617856",
"0.6198852",
"0.61901855",
"0.617936",
"0.6170679",
"0.61612123",
"0.61569786",
"0.6154536",
"0.6149879",
"0.614365",
"0.6133265",
"0.612957",
"0.61155444",
"0.6114619",
"0.61136234",
"0.611226",
"0.6107832",
"0.61067104",
"0.60979223",
"0.6088617",
"0.60820496",
"0.6066621",
"0.6055652",
"0.6048396",
"0.60300463",
"0.6014338",
"0.6004583",
"0.6003254",
"0.5994877",
"0.59906006",
"0.5986614",
"0.5959075",
"0.5959075",
"0.5954317",
"0.5945552",
"0.5945552",
"0.59431297",
"0.5942084",
"0.5925188",
"0.5921857",
"0.5921857",
"0.5921857",
"0.5914491",
"0.5913013",
"0.5906666",
"0.59066415",
"0.59060335",
"0.59060335",
"0.59022385",
"0.59017044",
"0.5894661",
"0.58927083",
"0.5888117",
"0.5885901",
"0.58740395",
"0.58709115",
"0.58691275",
"0.5866398",
"0.5865804",
"0.5860565",
"0.5860565",
"0.5860565",
"0.5860565"
]
| 0.0 | -1 |
CONSTRUCTOR Create a JanusEllipsoid viewer on top of the double pendulum state object passed as the argument to the constructor | public InteractiveJanusEllipsoidViewer(InteractiveJanusEllipsoid attachedTo) {
controller = attachedTo;
setOpaque(true);
setBackground(Color.WHITE);
setPreferredSize(new Dimension(600,600));
// Set up hotspots
for(int i=0; i<hotspot.length; i++) {
hotspot[i] = new Hotspot();
}
// Listen for mouse events
addMouseListener(mouseFollower);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Viewer() {\r\n\t\tzoom = DEFAULT_ZOOM;\r\n\t\tisWireframe = false;\r\n\t\tisAxes = true;\r\n\t\tnextRotationAngle = 0;\r\n\t\tnextRotationAxis = null;\r\n\t\trotationMatrix = null;\r\n\t\tscreenWidth = 0;\r\n\t\tscreenHeight = 0;\r\n\t}",
"public void init() {\n try {\n java.net.URL codeBase = getCodeBase();\n codeBaseString = codeBase.toString();\n } catch (Exception e) {\n // probably running as an application, try the application\n // code base\n codeBaseString = \"file:./\";\n }\n\n if (colorMode == USE_COLOR) {\n objColor = red;\n } else {\n objColor = white;\n }\n\n Container contentPane = getContentPane();\n\n contentPane.setLayout(new BorderLayout());\n\n GraphicsConfiguration config = SimpleUniverse\n .getPreferredConfiguration();\n\n canvas = new Canvas3D(config);\n\n u = new SimpleUniverse(canvas);\n\n if (isApplication) {\n offScreenCanvas = new OffScreenCanvas3D(config, true);\n // set the size of the off-screen canvas based on a scale\n // of the on-screen size\n Screen3D sOn = canvas.getScreen3D();\n Screen3D sOff = offScreenCanvas.getScreen3D();\n Dimension dim = sOn.getSize();\n dim.width *= OFF_SCREEN_SCALE;\n dim.height *= OFF_SCREEN_SCALE;\n sOff.setSize(dim);\n sOff.setPhysicalScreenWidth(sOn.getPhysicalScreenWidth()\n * OFF_SCREEN_SCALE);\n sOff.setPhysicalScreenHeight(sOn.getPhysicalScreenHeight()\n * OFF_SCREEN_SCALE);\n\n // attach the offscreen canvas to the view\n u.getViewer().getView().addCanvas3D(offScreenCanvas);\n\n }\n contentPane.add(\"Center\", canvas);\n\n // setup the env nodes and their GUI elements\n setupLights();\n setupBackgrounds();\n setupFogs();\n setupSounds();\n\n // Create a simple scene and attach it to the virtual universe\n BranchGroup scene = createSceneGraph();\n\n // set up sound\n u.getViewer().createAudioDevice();\n\n // get the view\n view = u.getViewer().getView();\n\n // Get the viewing platform\n ViewingPlatform viewingPlatform = u.getViewingPlatform();\n\n // Move the viewing platform back to enclose the -4 -> 4 range\n double viewRadius = 4.0; // want to be able to see circle\n // of viewRadius size around origin\n // get the field of view\n double fov = u.getViewer().getView().getFieldOfView();\n\n // calc view distance to make circle view in fov\n float viewDistance = (float) (viewRadius / Math.tan(fov / 2.0));\n tmpVector.set(0.0f, 0.0f, viewDistance);// setup offset\n tmpTrans.set(tmpVector); // set trans to translate\n // move the view platform\n viewingPlatform.getViewPlatformTransform().setTransform(tmpTrans);\n\n // add an orbit behavior to move the viewing platform\n OrbitBehavior orbit = new OrbitBehavior(canvas, OrbitBehavior.STOP_ZOOM);\n orbit.setSchedulingBounds(infiniteBounds);\n viewingPlatform.setViewPlatformBehavior(orbit);\n\n u.addBranchGraph(scene);\n\n contentPane.add(\"East\", guiPanel());\n }",
"public VisualView(ReadOnlyAnimatorModel aModel) {\n\n super();\n\n // attrs\n\n int leftMostX = (int) aModel.getBoundingBoxLoc().getX();\n int topMostY = (int) aModel.getBoundingBoxLoc().getY();\n int height = aModel.getBoundingBoxHeight();\n int width = aModel.getBoundingBoxWidth();\n\n List<AnimatedShapeImpl> shapesAtTick = aModel.getShapesAtTick(aModel.getModelStartTime());\n\n this.setTitle(\"Animator Visual View - Bou Lahdou and McNeill\");\n this.setSize(width, height);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setLayout(new BorderLayout());\n\n this.animationPanel = new AnimationPanel(shapesAtTick);\n animationPanel.setPreferredSize(new Dimension(width, (7 * height) / 8));\n this.add(animationPanel, BorderLayout.NORTH);\n\n JScrollPane scroller = new JScrollPane(animationPanel);\n scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);\n scroller.setBounds(20, 25, 200, 50);\n\n this.add(scroller, BorderLayout.CENTER);\n }",
"public CoordinateSystem() {\r\n\t\torigin = new GuiPoint(0, 0);\r\n\t\tzoomFactor = 1f;\r\n\t}",
"@JsConstructor\n public EllipsoidRhumbLine() {\n }",
"public CalendarFrame()\n\t{\n\t\tmodel = new Model();\n\t\tcontroller = new ControllerPanel(model);\n\t\tview = new MonthlyView(model);\n\t\tmodel.attach(view);\n\n\t\tthis.setSize(1500, 700);\n\t\tadd(controller, BorderLayout.NORTH);\n\t\tadd(view, BorderLayout.CENTER);\n\t\tsetBackground(Color.WHITE);\n\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t// pack();\n\t\tsetVisible(true);\n\t}",
"public EnhancedVisualView(IReadOnlyModel model, int speed) {\n super();\n this.mm = (AnimationModel) model;\n VisualView vView = new VisualView(mm, speed);\n this.setTitle(vView.getTitle());\n this.setSize(vView.getSize());\n this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);\n this.setDefaultCloseOperation(vView.getDefaultCloseOperation());\n\n //use a borderlayout with drawing panel in center and button panel in south\n this.setLayout(vView.getLayout());\n this.vPanel = new VisualPanel(mm, speed);\n vPanel.setPreferredSize(new Dimension(500, 500));\n this.add(vPanel, BorderLayout.CENTER);\n\n //set play button\n buttonPanel = new ButtonPanel();\n this.add(buttonPanel, BorderLayout.SOUTH);\n\n //sets the menu bar\n menuBar = new MenuPanel(mm.getShapes());\n this.add(menuBar, BorderLayout.WEST);\n\n vPanel.setSlider(menuBar.getJSlider());\n this.menuBar.getJSlider().setMinimum(0);\n this.menuBar.getJSlider().setMaximum(this.vPanel.getMaxTick());\n menuBar.getJSlider().setValue(0);\n menuBar.getJSlider().addChangeListener((ChangeEvent e) -> {\n JSlider source = (JSlider) e.getSource();\n int fps = (int) source.getValue();\n if (source.getValueIsAdjusting()) {\n vPanel.stopTimer();\n vPanel.setTick(fps);\n vPanel.repaint();\n } else {\n vPanel.startTimer();\n }\n });\n\n }",
"public static void main( String args[] )\n {\n JFrame f = new JFrame(\"Test for AltAzController\");\n f.setBounds(0,0,200,200);\n AltAzController controller = new AltAzController();\n// controller.setVirtualScreenSize( 2, 2 );\n f.getContentPane().add( controller );\n f.setVisible( true );\n\n\n JFrame window = new JFrame(\"Test for AltAzController\");\n window.setBounds(20,20,500,500);\n ThreeD_JPanel test = new ThreeD_JPanel();\n window.getContentPane().add( test );\n window.setVisible( true );\n\n controller.addControlledPanel( test );\n IThreeD_Object objs[] = new IThreeD_Object[6];\n Vector3D pts[] = new Vector3D[6];\n pts[0] = new Vector3D( -1, 1, 0 );\n pts[1] = new Vector3D( 1, 1, 0 );\n pts[2] = new Vector3D( 1, 1, 1 );\n pts[3] = new Vector3D( 1, 1, 0 );\n pts[4] = new Vector3D( 1, -1, 0 );\n pts[5] = new Vector3D( -1, -1, 0 );\n objs[0] = new Polyline( pts, Color.CYAN );\n\n pts = new Vector3D[2];\n pts[0] = new Vector3D( 0, 0, 0 );\n pts[1] = new Vector3D( 1, 0, 0 );\n objs[1] = new Polyline( pts, Color.RED );\n\n pts = new Vector3D[2];\n pts[0] = new Vector3D( 0, 0, 0 );\n pts[1] = new Vector3D( 0, 1, 0 );\n objs[2] = new Polyline( pts, Color.GREEN );\n\n pts = new Vector3D[2];\n pts[0] = new Vector3D( 0, 0, 0 );\n pts[1] = new Vector3D( 0, 0, 1 );\n objs[3] = new Polyline( pts, Color.BLUE );\n\n Vector3D center = new Vector3D( -1, -1, 1 );\n Vector3D x_vec = new Vector3D( -1, 1, 0 );\n Vector3D y_vec = new Vector3D( 0, 0, 1 );\n float width = 3;\n float height = 2;\n Color[][] colors = { { Color.RED, Color.GREEN, Color.BLUE },\n { Color.YELLOW, Color.CYAN, Color.MAGENTA },\n { Color.ORANGE, Color.GRAY, Color.WHITE } };\n\n ImageRectangle1 im_rect = new ImageRectangle1( center,\n x_vec,\n y_vec,\n width,\n height,\n colors );\n objs[4] = im_rect;\n\n\n center = new Vector3D( 1, 1, 1 );\n y_vec = new Vector3D( 1, 1, 0 );\n x_vec = new Vector3D( 1, -1, 0 );\n width = 2;\n height = 4;\n Color[][] colors_2 = { { Color.RED, Color.GREEN, Color.BLUE },\n { Color.YELLOW, Color.CYAN, Color.MAGENTA } };\n\n ImageRectangle1 im_rect_2 = new ImageRectangle1( center,\n x_vec,\n y_vec,\n width,\n height,\n colors_2 );\n objs[5] = im_rect_2;\n\n\n test.setObjects( \"SAMPLE_OBJECTS\", objs );\n\n controller.apply( true );\n }",
"@JsConstructor\n public EllipsoidRhumbLine(Cartographic start) {\n }",
"public ViewVolumeViewer(WorldWindow observedWindow, Dimension size)\n {\n this.observered = observedWindow;\n this.getContentPane().setLayout(new BorderLayout(5, 5));\n\n this.wwp = new WWPanel((WorldWindowGLCanvas) this.observered, size, this.makeModel());\n this.getContentPane().add(wwp, BorderLayout.CENTER);\n\n this.wwd = wwp.wwd;\n\n final SectorGeometryLayer sgLayer = new SectorGeometryLayer();\n this.wwd.getModel().getLayers().add(sgLayer);\n\n final ViewVolumeLayer vvLayer = new ViewVolumeLayer();\n this.wwd.getModel().getLayers().add(0, vvLayer);\n\n // This view volume viewer updates its display within a rendering listener registered for the observed window\n this.observered.addRenderingListener(new RenderingListener()\n {\n public void stageChanged(RenderingEvent event)\n {\n if (event.getStage().equals(RenderingEvent.AFTER_BUFFER_SWAP))\n {\n // Get the observed window's sector geometry and update this window's terrain display layer\n SectorGeometryList sgCopy = new SectorGeometryList(observered.getSceneController().getTerrain());\n sgLayer.setGeometry(sgCopy);\n\n // Get the observed window's view and update this window's view volume display layer\n vvLayer.setView(observered.getView());\n\n // Redraw this (the view volume viewer's) window\n wwd.redraw();\n }\n }\n });\n\n this.setTitle(\"View Volume Viewer\");\n this.setResizable(true);\n this.pack();\n }",
"public AStationPane() {\n }",
"public VisualView(IModel model1, int tickPerSecond) {\n super();\n this.tickPerSecond = tickPerSecond;\n panel = new MyPanel(model1, tickPerSecond);\n model = model1;\n }",
"public View(Model m) {\n super(\"Group G: Danmarkskort\");\n model = m;\n iconPanel.addObserverToIcons(this);\n routePanel = new RouteView(this, model);\n optionsPanel = new OptionsPanel(this,model);\n /*Three helper functions to set up the AffineTransform object and\n make the buttons and layout for the frame*/\n setScale();\n makeGUI();\n adjustZoomFactor();\n\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\n //This sets up a listener for when the frame is re-sized.\n createComponentListener();\n\n pack();\n canvas.requestFocusInWindow();\n model.addObserver(this);\n }",
"public Life3D() {\n // Set up the user interface.\n myDisplay = Display.getDisplay(this);\n myCanvas = new CallbackCanvas(this);\n myCanvas.setCommandListener(this);\n myCanvas.addCommand(exitCommand);\n }",
"@Override\n public void componentOpened() {\n\n java.awt.EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n\n /*\n Create and start JMEVisualization instance\n */\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }\n });\n }",
"public static void setScene() {\n\n Shape ground = new Plane(vec3(0.0, -1.0, 0.0), vec3(0, 1, -0.2), new Diffuse(new Vec3(1,1,1), white));\n \n /* Shape globe1 = new Sphere(vec3(0.0, 2, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe2 = new Sphere(vec3(2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n Shape globe3 = new Sphere(vec3(-2, 0, -6.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.5, 0.5, 0.5)));\n*/\n Shape globe1T = new Sphere(vec3(0.0, 2, -2.0), 0.3, new Diffuse(new Vec3(1,1,1), white));\n // Shape globe2T = new Sphere(vec3(-0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1),yellow));\n // Shape globe3T = new Sphere(vec3(0.5, -2, -3.0), 0.5, new Diffuse(new Vec3(1,1,1), yellow));\n\n \n \n Shape globe4 = new Sphere(vec3(0.0, 2, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe5 = new Sphere(vec3(2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n Shape globe6 = new Sphere(vec3(-2, 0, -4.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.3, 0.3, 0.3)));\n \n Shape globe7 = new Sphere(vec3(0.0, 2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe8 = new Sphere(vec3(2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe9 = new Sphere(vec3(-2, 0, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n Shape globe7D = new Sphere(vec3(0.0, -2, -8.0), 0.5, new Diffuse(new Vec3(1,1,1), new Vec3(0.7, 0.7, 0.7)));\n\n Shape globeC = new Sphere(vec3(0.0, 0.0, -6.0), 1.0, new Diffuse(new Vec3(1,1,1), red));\n \n ArrayList<Shape> shapes = new ArrayList<>();\n shapes.add(bg);\n shapes.add(ground);\n shapes.add(globe1T);\n // shapes.add(globe2T);\n // shapes.add(globe3T);\n //shapes.add(globe4);\n //shapes.add(globe5);\n shapes.add(globe7);\n shapes.add(globe8);\n shapes.add(globe9);\n shapes.add(globe7D);\n shapes.add(globeC);\n gr = new Group(shapes);\n /////////////////////////////--------------------------------------\n \n \n }",
"public ViewerPosition3D()\n {\n }",
"public View() {\n this.view = new ViewPanel();\n //this.view.setGraph(this.graph);\n initComponents();\n this.m_algoritmos.setEnabled(false);\n this.mi_maze.setEnabled(false);\n this.mi_salvarImagem.setEnabled(false);\n }",
"public WaveView() {\n initComponents();\n }",
"public EAEditorView(ReadOnlyEAOperations model) {\n\n super();\n setTitle(\"The Easy Animator\");\n\n // check for null\n if (model == null) {\n throw new IllegalArgumentException(\"Model can't be null\");\n }\n this.model = model;\n\n // initialize the main panel\n constructMainPanel();\n constructAnimationPanel();\n generateLabelPanel();\n generateButtonPanel();\n constructPopup();\n createOKButtons();\n\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.pack();\n }",
"public Ocean()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n BF bf = new BF();\n addObject(bf,500,300);\n SF sf = new SF();\n addObject(sf,100,300);\n }",
"public Evolver(int width, int height)\n {\n\tsuper(width,height);\n\tsetBackground(Color.white);\n\n\ttimer = null;\n\tmodelSpeed(50);\n\taddMouseListener(new smallMouseListener());\n\taddMouseMotionListener(new smallMouseMotionListener());\n\tup_color = true;\n\t\n }",
"@Override\r\n protected void initModel() {\n model = new Sphere(\"projectil Model\", 5, 5, 0.2f);\r\n model.setModelBound(new BoundingBox());\r\n model.updateModelBound();\r\n }",
"public VirtualWorld(Node rootNode, AssetManager assetManager, ViewPort viewPort){\n sky = new Sky(rootNode, assetManager);\n water = new Water(rootNode, viewPort, assetManager);\n }",
"@SuppressWarnings({\"nullness\",\"initialization\"})\n public SimServerJInternalFrame() {\n simServerJPanel1 = new crcl.ui.server.SimServerJPanel();\n\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n setTitle(\"CRCL Simulation Server\");\n\n setJMenuBar(simServerJPanel1.jMenuBarSimServer);\n add(simServerJPanel1);\n pack();\n this.simServerJPanel1.setMenuOuter(this);\n }",
"public VolcanoWorld() {\n this(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n }",
"public lv3()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n //super(950, 600, 1); \n //prepare();\n prepare();\n stopped();\n started();\n }",
"public static void main(String[] args) {\n// Vector v1 = new Vector(new double[]{0, 0, 1});\n// Vector v2 = new Vector(new double[]{1, 0, 0});\n// System.out.println(v1.dot(v2));\n System.setProperty(\"sun.java2d.opengl\", \"true\");\n \n // Make World\n //WorldSpace world = new StreetWorldSpace();\n WorldSpace world = new TestWorldSpace();\n //WorldSpace world = new BigAssPolygonSpace();\n \n // Make Frame\n JFrame frame = new JFrame();\n \n // Get effective screen size\n Dimension screenSize = getScreenDimension(frame);\n\n // Set Camera View dimensions\n int width = 730;\n int height = width;\n \n // Make Camera\n Polygon[] polygons = world.getPolygons();\n Camera camera = new Camera(polygons, width, height, frame.getGraphicsConfiguration());\n image = camera.observe();\n \n // Make Camera Control Panel\n// int controlPanelHeight = 100;\n// CameraControlPanel cameraControlPanel = new CameraControlPanel(camera);\n// cameraControlPanel.setPreferredSize(new Dimension(width, controlPanelHeight));\n// cameraControlPanel.setBorder(BorderFactory.createCompoundBorder(new LineBorder(Color.BLACK, 2, false), new EmptyBorder(10, 10, 10, 10)));\n \n // Make Camera View Component\n CameraViewComponent cameraViewComponent = new CameraViewComponent(camera);\n cameraViewComponent.updateImage(image);\n cameraViewComponent.updateData(camera.getData());\n cameraViewComponent.setPreferredSize(new Dimension(width, height));\n\n // Make Camera Panel\n JPanel cameraPanel = new JPanel();\n cameraPanel.setLayout(new BoxLayout(cameraPanel, BoxLayout.Y_AXIS));\n cameraPanel.setPreferredSize(new Dimension(width, height));// + controlPanelHeight));\n cameraPanel.add(cameraViewComponent);\n //cameraPanel.add(cameraControlPanel);\n\n // Make Camera Data Panel\n //CameraDataPanel cameraDataPanel = new CameraDataPanel(camera);\n \n // Make Master Panel\n JPanel masterPanel = new JPanel();\n masterPanel.add(cameraPanel);\n //masterPanel.add(cameraDataPanel);\n \n frame.add(masterPanel);\n frame.pack();\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setVisible(true);\n\n // Make keyboard listener\n KeyListener kl = new KeyListener();\n \n // Time\n int lastTenthOfASecond = 0;\n double lastMilliSecond = 0;\n double currentMilliSecond = System.currentTimeMillis();\n double averageFrameRate = 0;\n double currentFrameRate = 0;\n long totalTime = 0;\n long totalFrames = 0;\n \n // Redraw camera view upon keyboard input\n while(true) { \n int currentTenthOfASecond = (int)((currentMilliSecond%1000)/100);\n if (currentMilliSecond/100 > lastMilliSecond/100) {\n boolean cameraMoved = false;\n if (kl.isWPressed()) {\n camera.move(FORWARD); \n cameraMoved = true;\n }\n if (kl.isSPressed()) {\n camera.move(BACKWARD); \n cameraMoved = true;\n }\n if (kl.isAPressed()) {\n camera.move(LEFT); \n cameraMoved = true;\n }\n if (kl.isDPressed()) {\n camera.move(RIGHT); \n cameraMoved = true;\n }\n if (kl.isSpacePressed()) {\n camera.move(UP); \n cameraMoved = true;\n }\n if (kl.isShiftPressed()) {\n camera.move(DOWN); \n cameraMoved = true;\n }\n if (cameraViewComponent.wasUpdated()) {\n cameraMoved = true;\n }\n// if (cameraControlPanel.getWasCameraChanged() || cameraViewComponent.wasUpdated()) {\n// cameraMoved = true;\n// }\n if (cameraMoved) {\n image = camera.observe();\n cameraViewComponent.updateImage(image);\n //cameraDataPanel.update();\n //cameraControlPanel.update(); \n totalFrames++;\n totalTime += currentMilliSecond-lastMilliSecond + 1;\n averageFrameRate = (totalFrames)/(totalTime/1000.0); \n currentFrameRate = (1000.0/(currentMilliSecond-lastMilliSecond));\n \n }\n }\n if (currentTenthOfASecond > lastTenthOfASecond) {\n \n String[] cameraData = camera.getData();\n String[] frameData = {\n \"Average Framerate: \" + String.format(\"%.2f\", averageFrameRate), \n \"Current Framerate: \" + String.format(\"%.2f\",currentFrameRate)\n };\n String[] data = new String[cameraData.length + frameData.length ];\n System.arraycopy(cameraData, 0, data, 0, cameraData.length);\n System.arraycopy(frameData, 0, data, cameraData.length, frameData.length);\n cameraViewComponent.updateData(data);\n } \n lastTenthOfASecond = currentTenthOfASecond;\n lastMilliSecond = currentMilliSecond;\n currentMilliSecond = System.currentTimeMillis(); \n }\n }",
"public SMRPlugin() {\n initComponents();\n irGraph = new LineGraph();\n lineGraph = new LineGraph();\n jPanelIRGraph.add(irGraph, BorderLayout.CENTER);\n jPanelLineGraph.add(lineGraph, BorderLayout.CENTER);\n leftWheel = new WheelControl(this, WheelControl.Wheel.LEFT);\n rightWheel = new WheelControl(this, WheelControl.Wheel.RIGHT);\n jPanelLeftWheel.add(leftWheel, BorderLayout.CENTER);\n jPanelRightWheel.add(rightWheel, BorderLayout.CENTER);\n }",
"public Simulation() {\n\t\taddMouseListener(this);\n\t\taddKeyListener(this);\n\n\t\tthis.setSize(MAX_X * DOT_SIZE, MAX_Y * DOT_SIZE);\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setResizable(false);\n\t\tthis.setTitle(\"Braaiinnnnnsss\");\n\n\t\t/* Create and set the size of the panel */\n\t\tdp = new DotPanel(MAX_X, MAX_Y, DOT_SIZE);\n\n\t\t/* Add the panel to the frame */\n\t\tContainer cPane = this.getContentPane();\n\t\tcPane.add(dp);\n\t\t\n\n\t\t/* Initialize the DotPanel canvas:\n\t\t * You CANNOT draw to the panel BEFORE this code is called.\n\t\t * You CANNOT add new widgets to the frame AFTER this is called.\n\t\t */\n\t\tthis.pack();\n\t\tdp.init();\n\t\tdp.clear();\n\t\tdp.setPenColor(Color.red);\n\t\tthis.setVisible(true);\n\n\t\t/* Create our city */\n\t\tworld = new City(MAX_X, MAX_Y, NUM_BUILDINGS, NUM_HUMANS, NUM_PRIESTS, NUM_VAMPIRES);\n\n\t\t/* This is the Run Loop (aka \"simulation loop\" or \"game loop\")\n\t\t * It will loop forever, first updating the state of the world\n\t\t * (e.g., having humans take a single step) and then it will\n\t\t * draw the newly updated simulation. Since we don't want\n\t\t * the simulation to run too fast for us to see, it will sleep\n\t\t * after repainting the screen. Currently it sleeps for\n\t\t * 33 milliseconds, so the program will update at about 30 frames\n\t\t * per second.\n\t\t */\n\t\twhile(true)\n\t\t{\n\t\t\t// Run update rules for world and everything in it\n\t\t\tworld.update();\n\t\t\t// Draw to screen and then refresh\n\t\t\tworld.draw();\n\t\t\tdp.repaintAndSleep(30);\n\n\t\t}\n\t}",
"private void constructAnimationPanel() {\n animationPanel = new EAPanel(model);\n animationPanel.setLayout(new FlowLayout());\n animationPanel.setPreferredSize(new Dimension(model.getWidth(), model.getHeight()));\n mainPanel.add(animationPanel);\n }",
"public StateVisualizer() {\r\n }",
"public GL4JRenderer()\r\n\t{\r\n\t\t//gl = this;\r\n\t\tsuper(256,256);\r\n\t\tActorSet = new Vector();\r\n\t\tLightSet = new Vector();\r\n\t\tCameraSet = new Vector();\r\n\t\tActions = new Vector();\r\n\t\tinitLess = true;\r\n\t\tMouseDown = 0;\r\n\t\tLastMouse = new int[2];\r\n\t\tInternalTexture = new int[1];\r\n\t\tInternalTexture[0] = 0;\r\n\t\tKeyHandler = null;\r\n\t\tClockThread = null;\r\n\t\tglut = new GLUTFuncLightImpl(gl, glu);\r\n\t\taddMouseMotionListener(this);\r\n\t\taddKeyListener(this);\r\n\t\tcurrTime = 0;\r\n\t}",
"public EdObservation()\n\t{\n\t\t_title = \"Observation\" ;\n\t\t_presSource = _w = new ObsGUI() ;\n\t\t_description = \"The observation is the smallest entity that can be scheduled.\" ;\n\n\t\t_obsTitle = _w.nameBox;\n\t\t_obsTitle.addWatcher( this ) ;\n\n\t\t_obsState = _w.obsState ;\n\n\t\t_w.jComboBox1.addActionListener( this ) ;\n\n\t\t_w.optional.addWatcher( this ) ;\n\t\t_w.standard.addWatcher( this ) ;\n\n\t\t// Added by MFO (22 February 2002)\n\t\tif( !OtCfg.telescopeUtil.supports( TelescopeUtil.FEATURE_FLAG_AS_STANDARD ) )\n\t\t{\n\t\t\t_w.standard.setText( \"Flag as Calibration\" ) ;\n\t\t\t_w.optional.setVisible( false ) ;\n\t\t\t_w.optional.deleteWatcher( this ) ;\n\t\t}\n\n\t\t_w.addRemainingCountListener(this);\n\n\t\t_w.obsStateLabel.setVisible( false ) ;\n\t\t_w.obsState.setVisible( false ) ;\n\t}",
"public DRInitialPlotPanel() {\n initComponents();\n }",
"public pr3s1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1280, 720, 1); \n prepare();\n }",
"private void init() {\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetBounds(10, 10, 1024, 720 );\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tcontentPane.setLayout(new BorderLayout(0, 0));\n\t\t\n\t\t/*\n\t\t * The north part of the layout contains the text fields describing the bounds of the displayed complex plane,\n\t\t *Which can be modified by th user\n\t\t */\n\t\tJPanel axisBoxPanel = new JPanel();\n\t\taxisBoxPanel.setLayout(new GridLayout(2,4));\n\t\trMinField = new JTextField(\"-2\");\n\t\trMaxField = new JTextField(\"2\");\n\t\tiMinField = new JTextField(\"-1.6\");\n\t\tiMaxField = new JTextField(\"1.6\");\n\t\taxisBoxPanel.add(rMaxField);\n\t\taxisBoxPanel.add(new JLabel(\" Max real\"));\n\t\taxisBoxPanel.add(iMaxField);\n\t\taxisBoxPanel.add(new JLabel(\" Max imaginary\"));\n\t\taxisBoxPanel.add(rMinField);\n\t\taxisBoxPanel.add(new JLabel(\" Min real\"));\n\t\taxisBoxPanel.add(iMinField);\n\t\taxisBoxPanel.add(new JLabel(\" Min imaginary\"));\n\t\t\n\t\t/*\n\t\t * The south panel contains the text field for changing the iteration number, and to display the point\n\t\t * currently selected by the user and the button to display the related julia set\n\t\t */\n\t\tJPanel southPanel = new JPanel();\n\t\tGridLayout gl = new GridLayout(1,6);\n\t\tgl.setHgap(10);\n\t\tsouthPanel.setLayout(gl);\n\t\t\n\t\titField = new JTextField(\"100\");\n\t\tJButton genButton = new JButton(\"Generate Fractal\");\n\t\tgenButton.addActionListener(new genButtonListener());\n\t\tsouthPanel.add(new JLabel(\"no. of Iterations\"));\n\t\tsouthPanel.add(itField);\n\t\t\n\t\tJLabel uPointLabel = new JLabel(\"User Selected Point\");\n\t\tuPointField = new JTextField(\"test\");\n\t\tJButton juliaButton = new JButton(\"generate julia set\");\n\t\tjuliaButton.addActionListener(new JuliaButtonListener());\n\t\t\n\t\tJButton loadJuliaButton = new JButton(\"Load Favourite Julia Fractal\");\n\t\tloadJuliaButton.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew LoadJuliaFrame(jSaves);\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tsouthPanel.add(genButton);\n\t\tsouthPanel.add(uPointLabel);\n\t\tsouthPanel.add(uPointField);\n\t\tsouthPanel.add(juliaButton);\n\t\tsouthPanel.add(loadJuliaButton);\n\n\t\t\n\t\t//This is the central element where the fractal image will appear\n\t\timgPanel = new MandPanel();\n\t\t\n\t\tcontentPane.add(imgPanel, BorderLayout.CENTER);\n\t\tcontentPane.add(axisBoxPanel, BorderLayout.NORTH);\n\t\tcontentPane.add(southPanel, BorderLayout.SOUTH);\n\t\t\n\t\tsetContentPane(contentPane);\n\t\tthis.setVisible(true);\n\t}",
"public SimulationFrame(String name, double scale) {\n\t\tframe = new JFrame(name);\n\t\t\n\t\t// set the scale\n\t\tthis.scale = scale;\n\t\t\n\t\t// create the world\n\t\tthis.world = new World();\n\t\t\n\t\t// setup the JFrame\n\t\tframe.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n\t\t\n\t\t// add a window listener\n\t\tframe.addWindowListener(new WindowAdapter() {\n\t\t\t/* (non-Javadoc)\n\t\t\t * @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\t// before we stop the JVM stop the simulation\n\t\t\t\t//stop();\n\t\t\t\tsuper.windowClosing(e);\n\t\t\t}\n\t\t});\n\t\t\n\t\t// setup OpenGL capabilities\n\t\tif (!GLProfile.isAvailable(GLProfile.GL2)) {\n\t\t\tthrow new GLException(\"Version!\");\n\t\t}\n\n\t\tGLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));\n\t\tcaps.setDoubleBuffered(true);\n\t\t// setup the stencil buffer to outline shapes\n\t\tcaps.setStencilBits(1);\n\t\t// setting multisampling allows for better looking body outlines\n\t\tcaps.setSampleBuffers(true);\n\t\tcaps.setNumSamples(2);\n\t\tcaps.setHardwareAccelerated(true);\n\t\t\n\t\t// create a NEWT window\n\t\twindow = GLWindow.create(caps);\n\t\twindow.setUndecorated(true);\n\t\twindow.addGLEventListener(this);\n\t\t\n\t\t// create the size of the window\n\t\tsize = new Dimension(800, 600);\n\t\t\n\t\t// create a canvas to paint to \n\t\tthis.canvas = new NewtCanvasAWT(window);\n\t\tthis.canvas.setPreferredSize(size);\n\t\tthis.canvas.setMinimumSize(size);\n\t\tthis.canvas.setIgnoreRepaint(true);\n\t\t\n\t\t// add the canvas to the JFrame\n\t\tJPanel pnlTest = new JPanel();\n\t\tpnlTest.setLayout(new BorderLayout());\n\t\tpnlTest.add(this.canvas);\n\n\t\tframe.add(pnlTest);\n\t\t\n\t\t// make the JFrame not resizable\n\t\t// (this way I dont have to worry about resize events)\n\t\tframe.setResizable(false);\n\t\t\n\t\t// size everything\n\t\tframe.pack();\n\n\t\tMouse ml = new Mouse();\n\t\tframe.addMouseWheelListener(ml);\n\n\t\twindow.addMouseListener(ml);\n\t\twindow.addKeyListener(new com.jogamp.newt.event.KeyListener() {\n\n\t\t\t@Override\n\t\t\tpublic void keyPressed(com.jogamp.newt.event.KeyEvent e) {\n\n\t\t\t\tif (e.getKeyCode() == KeyEvent.VK_SPACE){\n\n\t\t\t\t\toffset = new Vector2(0f, 0f);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void keyReleased(com.jogamp.newt.event.KeyEvent e) {}\n\n\t\t});\n\n\t\tframe.setLocationRelativeTo(null);\n\n\t\tthis.last = System.nanoTime();\n\t\t\n\t\tthis.animator = new Animator(window);\n\t\tthis.animator.setRunAsFastAsPossible(false);\n\t\tthis.animator.start();\n\t\t\n\t\t// setup the world\n\t\tthis.initializeWorld();\n\t}",
"public Sun getSunLocalPositions(double mjd, Geodetic obs){\n Sun sp = new Sun();\n \n Vector sunVector = new Vector(3); //equatorial coordinates of the Sun\n Vector horizontal = new Vector(3); //horizontal coordinates of object\n Vector equatorial = new Vector(3); //equatorial coordinates of object from observer view\n Vector observatory = new Vector(3); //equatorial coordinates of observer\n \n sunVector = (new Sun()).getSunPosition(mjd);\n \n horizontal=(new Transformation()).getHorizontalCoordinates3(sunVector,obs, mjd);\n //horizontal coordinates\n sp.az = horizontal.v[0];\n sp.h = horizontal.v[1];\n \n //equatorial (observer) coordinates\n //observer eq. coordinates\n observatory = (new Transformation()).fromGeodToGeoc(obs.lon, obs.lat,\n obs.altitude, (new Constants()).R_Earth, (new Constants()).f_Earth);\n observatory = (new Transformation()).fromGeocToEquat(observatory,mjd);\n //equatorial coordinates of object\n equatorial = equatorial.subtractVectors(sunVector, observatory);\n equatorial = equatorial.fromCartesianToPolar(equatorial);\n //FILLING contructor\n sp.ra = equatorial.v[0];\n sp.dec = equatorial.v[1];\n \n return sp;\n }",
"public IsingPlotController(){\n\t\tfullPanel = new JPanel();\n\t\tfullPanel.setLayout(new BorderLayout());\n\t\t\n\t\tJPanel headerPanel = new JPanel();\n\t\theaderPanel.setLayout(new BorderLayout());\n\t\theaderPanel.setBackground(Color.white);\n\t\tbackButton = new JButton(\"Back\");\n\t\theaderPanel.add(backButton,BorderLayout.WEST);\n\t\t\n\t\tthis.view = new ImagePanel();\n\t\t\n\t\tfullPanel.add(headerPanel,BorderLayout.NORTH);\n\t\tfullPanel.add(view);\n\t}",
"public LayerViewPanel()\r\n {\r\n \r\n }",
"public PlayerWL() {\n super();\n rotateYAxis = 0;\n positionZ = 0;\n positionX = 0;\n camera = new PerspectiveCamera(true);\n camera.getTransforms().addAll(\n new Rotate(0, Rotate.Y_AXIS),\n new Rotate(-10, Rotate.X_AXIS),\n new Translate(0, 0, 0));\n cameraGroup = new Group(camera);\n camera.setRotationAxis(new Point3D(0, 1, 0));\n }",
"public lat4() {\n initComponents();\n }",
"public VRMLState(Viewer viewer){\r\n this.viewer = viewer;\r\n view = viewer.getView();\r\n }",
"public Kalkulator() {\n initComponents();\n this.setLocation(300, 200);\n }",
"public MondrianPanel()\n {\n setPreferredSize(new Dimension(size, size));\n }",
"public SimulationView() {\n initComponents();\n }",
"@Override\n public void start(Stage primaryStage) throws Exception {\n PerspectiveCamera camera = new PerspectiveCamera(true);\n camera.setTranslateZ(-10000);\n camera.setNearClip(0.1);\n camera.setFarClip(100000.0);\n\n //Creates group that holds sphere\n Group group = new Group();\n //Create subscene that holds group\n SubScene world = new SubScene(group, 3.0 * WIDTH / 4.0, HEIGHT, true, SceneAntialiasing.DISABLED);\n\n //Container for controls\n VBox controls = new VBox(10);\n controls.setAlignment(Pos.TOP_CENTER);\n controls.setPadding(new Insets(10, 0, 0, 0));\n\n //Slider that changes G value\n Label gLabel = new Label(\"Gravitational Constant\");\n Slider gConstant = new Slider(.001, 100000, 6.67408 * Math.pow(10, 2));\n gConstant.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n VectorUpdater.G = newValue.doubleValue();\n }\n });\n\n //Slider that changes simulation speed\n Label timeLabel = new Label(\"Simulation Speed\");\n Slider timeConstant = new Slider(0, 10, 0);\n timeConstant.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n delay = newValue.longValue();\n }\n });\n\n //Slider the controls zoom\n Label zoomLabel = new Label(\"Zoom\");\n Slider zoom = new Slider(-50000, 10000, -10000);\n zoom.valueProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n camera.setTranslateZ(newValue.doubleValue());\n }\n });\n\n //All control text fields\n TextField massField = new TextField(\"Mass\");\n TextField radiusField = new TextField(\"Radius\");\n TextField x = new TextField(\"X Coordinate\");\n TextField y = new TextField(\"Y Coordinate\");\n TextField z = new TextField(\"Z Coordinate\");\n TextField vx = new TextField(\"X Velocity\");\n TextField vy = new TextField(\"Y Velocity\");\n TextField vz = new TextField(\"Z Velocity\");\n Label pad = new Label();\n pad.setPrefHeight(40);\n\n //Control buttons\n Button addSphere = new Button(\"Add Sphere\");\n HBox buttons = new HBox(5);\n Button toggle = new Button(\"Start\");\n Button clear = new Button(\"Clear\");\n buttons.setAlignment(Pos.CENTER);\n buttons.getChildren().addAll(toggle, clear);\n\n //Adds items to control menu\n controls.getChildren().addAll(massField, radiusField, x, y, z, vx, vy, vz, addSphere, pad, gLabel, gConstant, timeLabel,\n timeConstant, zoomLabel, zoom, buttons);\n\n //Animates program\n AnimationTimer timer = new AnimationTimer() {\n long time = System.nanoTime();\n\n @Override\n public void handle(long now) {\n if ((now - time) * Math.pow(10, -7) > delay) {\n VectorUpdater.updateVectors(spheres, 0.017);\n for (PhysicalSphere sphere : spheres) {\n double dx = sphere.getVelocityVector().getX() * 0.017;\n double dy = sphere.getVelocityVector().getY() * 0.017;\n double dz = sphere.getVelocityVector().getZ() * 0.017;\n sphere.setTranslateX(sphere.getTranslateX() + dx);\n sphere.setTranslateY(sphere.getTranslateY() + dy);\n sphere.setTranslateZ(sphere.getTranslateZ() + dz);\n }\n time = now;\n }\n }\n };\n\n\n addSphere.setOnAction(event -> {\n //Checks all text fields and formats ones that are not numbers\n for (Node field : controls.getChildren()) {\n if (field instanceof TextField) {\n try {\n Double.parseDouble(((TextField) field).getText());\n } catch (Exception e) {\n ((TextField) field).setText(\"0\");\n }\n }\n }\n //Velocity vector\n Point3D velocity = new Point3D(Double.parseDouble(vx.getText()), Double.parseDouble(vy.getText()),\n Double.parseDouble(vz.getText()));\n double mass = Double.parseDouble(massField.getText());\n double radius = Double.parseDouble(radiusField.getText());\n if(mass == 0)\n mass = 500;\n if(radius == 0)\n radius = 500;\n PhysicalSphere sphere = new PhysicalSphere(radius, mass, velocity);\n group.getChildren().add(sphere);\n sphere.setTranslateX(Double.parseDouble(x.getText()));\n sphere.setTranslateY(Double.parseDouble(y.getText()));\n sphere.setTranslateZ(Double.parseDouble(z.getText()));\n spheres.add(sphere);\n massField.setText(\"Mass\");\n radiusField.setText(\"Radius\");\n vx.setText(\"X Velocity\");\n vy.setText(\"Y Velocity\");\n vz.setText(\"Z Velocity\");\n x.setText(\"X Coordinate\");\n y.setText(\"Y Coordinate\");\n z.setText(\"Z Coordinate\");\n });\n\n //Clears spheres\n clear.setOnAction(event -> {\n group.getChildren().clear();\n spheres.clear();\n });\n\n //Toggles timer\n toggle.setOnAction(event -> {\n if (toggle.getText().equals(\"Start\")) {\n timer.start();\n toggle.setText(\"Stop\");\n } else {\n timer.stop();\n toggle.setText(\"Start\");\n }\n });\n\n //Gets anchor\n world.setOnMousePressed(event -> {\n anchorX = event.getSceneX();\n anchorY = event.getSceneY();\n });\n\n //Adds drag amount to anchor\n world.setOnMouseDragged(event -> {\n camera.setTranslateX(cameraX + (anchorX - event.getSceneX()) * 10);\n camera.setTranslateY(cameraY + (anchorY - event.getSceneY()) * 10);\n });\n\n //Logs new camera location\n world.setOnMouseReleased(event -> {\n cameraX = camera.getTranslateX();\n cameraY = camera.getTranslateY();\n });\n\n //Create border layout\n BorderPane layout = new BorderPane();\n layout.setPadding(new Insets(0, 10, 0, 10));\n layout.setCenter(world);\n layout.setRight(controls);\n\n //Create main scene and add layout\n Scene scene = new Scene(layout, WIDTH, HEIGHT, true);\n world.setFill(Color.LIGHTSTEELBLUE);\n world.setCamera(camera);\n\n //Make the main stage\n primaryStage.setTitle(\"3D Physics Simulation\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }",
"public AntelopePanel() {\n this( null, null, true );\n }",
"public DisplayImplJ2D(String name)\n throws VisADException, RemoteException {\n this(name, null, JPANEL);\n }",
"public AnimationSVGView() {\n this.model = new BasicAnimationModel();\n this.out = new StringBuilder();\n this.speed = 1;\n }",
"@Override\n public void run() {\n\n GLMouseListener mouse = viewer.getMouseHandler();\n if (mouse instanceof GLMouseAdapter) {\n ((GLMouseAdapter)mouse).setLaptopConfig();\n }\n \n viewer.addSelectionListener(new SimpleSelectionHandler(renderables));\n\n // Create a animator that drives canvas' display() at the specified FPS.\n final FPSAnimator animator;\n final FPSMonitor fpsMonitor;\n \n if (MultiViewer.doFPS) {\n animator = new FPSAnimator(viewer.getCanvas().getDrawable(), FPS, true);\n animator.setUpdateFPSFrames(3, null);\n animator.start();\n fpsMonitor = new FPSMonitor(title + \" FPS: \", animator);\n new Thread(fpsMonitor).start();\n } else {\n animator = null;\n fpsMonitor = null;\n }\n \n // Create the top-level container\n frame = new JFrame(); // Swing's JFrame or AWT's Frame\n frame.add(viewer.getCanvas().getComponent());\n\n frame.addWindowListener(new WindowAdapter() {\n @Override\n public void windowClosing(WindowEvent e) {\n // Use a dedicate thread to run the stop() to ensure that the\n // animator stops before program exits.\n new Thread() {\n @Override\n public void run() {\n \n if (animator != null && animator.isStarted()) {\n animator.stop();\n }\n if (fpsMonitor != null) { \n fpsMonitor.stop();\n }\n \n try {\n SwingUtilities.invokeAndWait (new Runnable() {\n @Override\n public void run () {\n viewer.dispose ();\n }\n });\n }\n catch (InvocationTargetException e) {\n }\n catch (InterruptedException e) {\n }\n \n closed = true;\n }\n }.start();\n }\n });\n frame.setTitle(title);\n // frame.pack();\n frame.setVisible(true);\n // animator.start(); // start the animation loop\n }",
"public JMain() {\r\n this.initComponets();\r\n this.initializeObliqueLaunch();\r\n \r\n animationPanel.setBorder(BorderFactory.createTitledBorder(\"Gráfico do Lançamento\"));\r\n animationPanel.add(this.graphPanel, BorderLayout.CENTER);\r\n \r\n topPanel.setLayout(new BorderLayout());\r\n topPanel.add(animationPanel,BorderLayout.CENTER);\r\n \r\n speedField.addActionListener(this);\r\n speedPanel.setBorder(BorderFactory.createTitledBorder(\"Velocidade Inicial - m/s\"));\r\n speedPanel.add(speedField);\r\n\r\n angleSlider.text.addActionListener(this);\r\n anglePanel.setBorder(BorderFactory.createTitledBorder(\"Ângulo - º\"));\r\n anglePanel.add(angleSlider);\r\n \r\n gravityField.addActionListener(this);\r\n gravityPanel.setBorder(BorderFactory.createTitledBorder(\"Gravidade - m/s^2\"));\r\n gravityPanel.add(gravityField);\r\n \r\n spaceComboBox.addActionListener(this);\r\n spaceComboBox.setSelectedIndex(0);\r\n spaceBoxPanel.setBorder(BorderFactory.createTitledBorder(\"Aceleração Gravitacional\"));\r\n spaceBoxPanel.add(spaceComboBox);\r\n\r\n\t reachField.addActionListener(this);\r\n \treachPanel.setBorder(BorderFactory.createTitledBorder(\"Alcance - m\"));\r\n \treachPanel.add(reachField);\r\n\t \r\n \tmHeightField.addActionListener(this);\r\n \tmHeightPanel.setBorder(BorderFactory.createTitledBorder(\"Altura Máxima - m\"));\r\n \tmHeightPanel.add(mHeightField);\r\n\r\n\t informationPanel.setLayout(new BoxLayout(informationPanel,BoxLayout.X_AXIS));\r\n informationPanel.setBorder(BorderFactory.createTitledBorder(\"Informações de Entrada\"));\r\n informationPanel.add(speedPanel);\r\n informationPanel.add(Box.createRigidArea(new Dimension(5,0)));\r\n informationPanel.add(anglePanel);\r\n informationPanel.add(Box.createRigidArea(new Dimension(5,0)));\r\n informationPanel.add(gravityPanel);\r\n informationPanel.add(Box.createRigidArea(new Dimension(5,0)));\r\n informationPanel.add(spaceBoxPanel);\r\n informationPanel.add(Box.createRigidArea(new Dimension(5,0)));\r\n informationPanel.add(reachPanel);\r\n informationPanel.add(Box.createRigidArea(new Dimension(5,0)));\r\n informationPanel.add(mHeightPanel);\r\n\t \r\n resultArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n resultArea.setLineWrap(true);\r\n resultArea.setWrapStyleWord(true);\r\n resultArea.setEditable(false);\r\n\t \r\n situationDescriptionArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));\r\n situationDescriptionArea.setLineWrap(true);\r\n situationDescriptionArea.setWrapStyleWord(true);\r\n situationDescriptionArea.setEditable(false);\r\n\t \r\n\t situationPanel.setBorder(BorderFactory.createTitledBorder(\"Situações Possíveis\"));\r\n\t situationPanel.setLayout(new BoxLayout(situationPanel,BoxLayout.Y_AXIS));\r\n\t situationsComboBox.addActionListener(this);\r\n situationsComboBox.setSelectedIndex(0);\r\n\t situationPanel.add(situationsComboBox);\r\n\t situationPanel.add(situationDescriptionScroll);\r\n \r\n resultPanel.setBorder(BorderFactory.createTitledBorder(\"Resultados\"));\r\n resultPanel.add(resultScroll);\r\n \r\n confResPanel.setLayout(new BoxLayout(confResPanel,BoxLayout.X_AXIS));\r\n confResPanel.add(situationPanel);\r\n confResPanel.add(resultPanel);\r\n \r\n bottomPanel.setLayout(new BoxLayout(bottomPanel,BoxLayout.Y_AXIS));\r\n bottomPanel.add(informationPanel);\r\n bottomPanel.add(confResPanel);\r\n \r\n basePanel.setLayout(new BorderLayout());\r\n basePanel.setBorder(BorderFactory.createEtchedBorder());\r\n basePanel.add(topPanel,BorderLayout.CENTER);\r\n basePanel.add(bottomPanel,BorderLayout.SOUTH);\r\n \r\n container = mainFrame.getContentPane();\r\n container.add(basePanel,BorderLayout.CENTER);\r\n \r\n mainFrame.pack();\r\n mainFrame.show();\r\n }",
"public MainClass()\r\n\t{\r\n\t\tthis.setPreferredSize(new Dimension(width - 300, height));// This sets the dimensions of the graphic space where cam is drawn\r\n\t\tpanel = new ControlPanel(); // Initialization of various objects incorporated into the main class\r\n\t\twindow = new Window(this, panel);\t\t\t\t//\r\n\t\tdisp = new DispAngleDiagram(stroke);\t\t\t//\r\n\t\trcp = new RenderCamProfile(disp, panel);\t\t//\r\n\t\tinput = new InputHandler(disp);\t\t\t\t\t//\r\n\t\t\r\n\t\tthis.addMouseListener(input);\t\t\t\t\t\r\n\t\tthis.addMouseMotionListener(input);\r\n\t}",
"public CircleViewer()\n {\n drawing = new CirclePanel();\n\n JFrame frame = new JFrame();\n frame.setTitle(\"Circle\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setSize(WIDTH, HEIGHT);\n frame.add(drawing);\n frame.setVisible(true);\n }",
"public Lat2() {\n initComponents();\n }",
"public MatkulKurikulum() {\n }",
"public Front() {\n\t\twheels.getrWheel().getBoundingSphereTree().getBoundingSphere().translateCenter(0.8 * Specification.TIRE_RADIUS, 0.5 * Specification.TIRE_RADIUS, 0.5 * Specification.B_DEPTH - 1.1 * Specification.TIRE_DEPTH);\n\t\twheels.getlWheel().getBoundingSphereTree().getBoundingSphere().translateCenter(0.8 * Specification.TIRE_RADIUS, 0.5 * Specification.TIRE_RADIUS, -0.5 * Specification.B_DEPTH + 1.1 * Specification.TIRE_DEPTH);\n\t}",
"public ValmarFrame(){\n\t\tsetTitle(\"Valmar\");\n\t setSize(500, 450);\n\t addWindowListener (new Closer());\n\t setVisible(true);\n\t setResizable(false);\n\t //add the game panel\n\t Dimension dim = getSize();\n\t Insets in=getInsets();\n\t setSize(dim.width+in.right+in.left, dim.height+in.top+in.bottom);\n\t Panel pan=new ValmarPanel(createImage(dim.width, dim.height),null);\n\t pan.setBounds(in.left, in.top, dim.width, dim.height);\n\t add(pan);\n\t}",
"private void initPanel() {\n final JPanel mainPanel = new JPanel(new BorderLayout());\n mainPanel.setBorder(new TitledBorder(\"Edit Indegree Condition\"));\n\n final JPanel operatorPanel = new JPanel(new BorderLayout());\n operatorPanel.setBorder(new EmptyBorder(5, 5, 5, 5));\n operatorPanel.add(m_operatorBox, BorderLayout.CENTER);\n\n final JPanel inputPanel = new JPanel(new BorderLayout());\n inputPanel.setBorder(new EmptyBorder(5, 0, 5, 5));\n inputPanel.add(m_inputField, BorderLayout.CENTER);\n\n final JPanel containerPanel = new JPanel(new BorderLayout());\n containerPanel.add(operatorPanel, BorderLayout.WEST);\n containerPanel.add(inputPanel, BorderLayout.CENTER);\n\n mainPanel.add(containerPanel, BorderLayout.NORTH);\n\n add(mainPanel, BorderLayout.CENTER);\n }",
"public ElementPanel(final Elements allElements) {\r\n\t\tsuper();\r\n\t\telements = allElements;\r\n\t\tmodificationListeners = new ArrayList<ElementModificationListener>(2);\r\n\t\tvectorListeners = new ArrayList<VectorDisplayListener>(2);\t\t\r\n\t\tsetLayout(new BoxLayout(this, BoxLayout.Y_AXIS));\r\n\t\tsetAlignmentX(CENTER_ALIGNMENT);\r\n\t\tsetAlignmentY(TOP_ALIGNMENT);\r\n\t\tJPanel views = new JPanel();\r\n\t\tviews.setLayout(new BoxLayout(views, BoxLayout.X_AXIS));\r\n\t\tzoomView = new ZoomView();\r\n\t\tviews.add(zoomView);\r\n\t\telementView = new ElementView(this);\r\n\t\tviews.add(elementView);\r\n\t\tvectorListeners.add(elementView);\r\n\t\tadd(views);\r\n\r\n\t\tviews = new JPanel();\r\n\t\tviews.setLayout(new BoxLayout(views, BoxLayout.X_AXIS));\r\n\t\tviews.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));\r\n\r\n\t\tactionsView = new ActionsView(this);\r\n\t\tviews.add(actionsView);\r\n\t\toptionsView = new OptionsView(this);\r\n\t\tviews.add(optionsView);\r\n\t\tviews.add(Box.createHorizontalStrut(32));\r\n\t\t\r\n\t\tadd(views);\r\n\t}",
"public BranchGroup InitPj3d(int mWinWidth, int mWinHeight)\r\n\t{\t\r\n\t\t//toolbox = new PJ3DToolbox();\r\n\t\tsetLayout( new BorderLayout( ) );\r\n\t\t//parent.width = 640;\r\n\t\t//parent.resize(640, 480);\r\n\r\n\t\t//Frame frame = new Frame(\"pj3d\");\r\n\t frame.pack();\r\n\t frame.show();\r\n\t frame.setSize(mWinWidth, mWinHeight);\r\n\r\n\t GraphicsConfiguration gc = parent.getGraphicsConfiguration();\r\n\t \r\n\t // default colors\r\n\t backgroundColor = new Color3f(0f, 0f, 0f);\r\n\t ambientColor = new Color3f(0.2f, 0.2f, 0.2f);\r\n\t diffuseColor = new Color3f(0.8f, 0.8f, 0.8f);\r\n\t emissiveColor = new Color3f(0.5f, 0.5f, 0.5f);\r\n\t specularColor = new Color3f(1.0f, 1.0f, 1.0f);\r\n\t textColor = new Color3f(0.5f, 0.5f, 0.5f);\r\n\t shininess = DEFAULTCOLOR;\r\n\t alpha = 0.0f;\r\n\t \r\n\t // default background um spaeter drauf zugreifen zu koennen\r\n\t //bg = new Background();\r\n\t bg = InitBackground();\r\n\t \r\n\t mb = new Pj3dScene(frame, gc, bg);\r\n\t branch = mb.InitBranch();\r\n\t \r\n\t // get the canvas3d to add the mouse and keylisteners\r\n\t canvas = mb.getMBCanvas3D();\r\n\t canvas.addKeyListener(this);\r\n\t canvas.addMouseListener(this);\r\n\t canvas.addMouseMotionListener(this);\r\n\t frame.add( \"Center\", canvas );\r\n\t \r\n\t frame.show( );\r\n\t frame.addWindowListener(new Pj3dWindowClosingAdapter(true));\r\n\t \r\n\t return branch;\r\n\t}",
"public GraphicsFrame() { //constructor\n\t super();\n\t //final Color VERY_LIGHT_GARY = new Color(204,204,204);\n\t \n\t JPanel panelOne = new JPanel();\n JPanel panelTwo = new JPanel();\n \n panelOne.setLayout(new BorderLayout());\n panelTwo.setLayout(new BorderLayout());\n \n panelOne.setPreferredSize(new Dimension(638, 300));\n panelTwo.setPreferredSize(new Dimension(638, 300));\n \n this.add(panelOne,BorderLayout.WEST);\n this.add(panelTwo,BorderLayout.EAST);\n \n\t MainPanel mainPanelPtr = new MainPanel(); //create mainpanel that will overwrites the frame\n\t BallAnimation ballAnimationPtr = new BallAnimation();\n\t \n\t panelOne.add(mainPanelPtr);\n\t panelTwo.add(ballAnimationPtr);\n\t \n }",
"public void init()\r\n {\r\n\t\t/* initialize the widget */\r\n\t\tint width = gl.getWidth();\r\n\t\tint height = gl.getHeight();\r\n\r\n\t\t// Initialize the rendering viewport size to OpenGL\r\n\t\tgl.viewport( 0, 0, width, height );\r\n\t\tgl.matrixMode( GL.PROJECTION );\t// Set up the camera mode\r\n\t\tgl.loadIdentity();\t\t\t\t\t// Reset the transformation matrix\r\n\t\tif (width <= height)\r\n\t\t\tgl.ortho (-50.0, 50.0, -50.0*(double)height/(double)width,\r\n\t\t\t\t 50.0*(double)height/(double)width, -1.0, 1.0);\r\n\t\telse\r\n\t\t\tgl.ortho (-50.0*(double)width/(double)height,\r\n\t\t\t 50.0*(double)width/(double)height, -50.0, 50.0, -1.0, 1.0);\r\n\t\tgl.matrixMode( GL.MODELVIEW );\t\t// Reset to model transforms\r\n }",
"private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }",
"@Override\n public void run() {\n jmeVisualization = new JMEVisualization();\n jmeVisualization.setRotated(false);\n jmeVisualization.setWidth(getVisualizationPanel().getWidth() - 15);\n jmeVisualization.setHeight(getVisualizationPanel().getHeight() - 30);\n jmeVisualization.startApplication();\n\n /*\n Fetch Canvas from JMEVisualization instance\n */\n jmeCanvas = jmeVisualization.getJmeCanvasContext().getCanvas();\n\n getVisualizationPanel().setLayout(new FlowLayout());\n getVisualizationPanel().add(jmeCanvas);\n getVisualizationPanel().revalidate();\n\n }",
"public VivariumPanel()\n {\n // Call super constructor\n super();\n\n // Initialize properties\n this.turtles = new HashSet<>();\n this.isDebug = false;\n }",
"public Sun getAntihelionLocalPositions(double mjd, Geodetic obs){\n Sun sp = new Sun();\n\n Vector sunVector = new Vector(3); //equatorial coordinates of the Sun\n Vector horizontal = new Vector(3); //horizontal coordinates of object\n Vector equatorial = new Vector(3); //equatorial coordinates of object from observer view\n Vector observatory = new Vector(3); //equatorial coordinates of observer\n\n sunVector = sunVector.multiplyVector(new Sun().getSunPosition(mjd),-1);\n\n horizontal=(new Transformation()).getHorizontalCoordinates3(sunVector,obs, mjd);\n //horizontal coordinates\n sp.az = horizontal.v[0];\n sp.h = horizontal.v[1];\n\n //equatorial (observer) coordinates\n //observer eq. coordinates\n observatory = (new Transformation()).fromGeodToGeoc(obs.lon, obs.lat,\n obs.altitude, (new Constants()).R_Earth, (new Constants()).f_Earth);\n observatory = (new Transformation()).fromGeocToEquat(observatory,mjd);\n //equatorial coordinates of object\n equatorial = equatorial.subtractVectors(sunVector, observatory);\n equatorial = equatorial.fromCartesianToPolar(equatorial);\n //FILLING contructor\n sp.ra = equatorial.v[0];\n sp.dec = equatorial.v[1];\n\n return sp;\n }",
"public JXGraph() {\r\n this(0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.2, 4, 0.2, 4);\r\n }",
"public OverlayEditorPanelJAI() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\t\t\r\n\t\t//colormap (grayscale)\r\n\t\tint[] cmap = new int[256];\r\n\t\tfor(int i=0;i<cmap.length;i+= 1){\r\n\t\t\tint iv = (int)(0x000000FF&i);\r\n\t\t\tcmap[i] = 0xFF000000 | iv<<16 | iv<<8 | i;\r\n\t\t}\r\n\r\n\t\tgreyIndexColorModel =\r\n\t\t\tnew java.awt.image.IndexColorModel(\r\n\t\t\t\t8, cmap.length,cmap,0,\r\n\t\t\t\tfalse /*false means NOT USE alpha*/ ,\r\n\t\t\t\t-1/*NO transparent single pixel*/,\r\n\t\t\t\tjava.awt.image.DataBuffer.TYPE_BYTE);\r\n\t\t\r\n\t\tinitCtrlz();\r\n\t}",
"public MapView(GameModel model){\n this.model = model;\n this.images = new Images(model);\n this.visualizer = new VisualizerVisitor(this, zoomFactor);\n this.debug = new DebugVisitor(this, zoomFactor);\n this.modelMid = new DoubleVec(model.getFieldSizeX()*0.5,model.getFieldSizeY()*0.5);\n this.refPoint = modelMid;\n this.smallVisualizer = new SmallVisitor(this, 3);\n updateBoxes();\n }",
"public MapPanel() {\r\n\t\tthis(EarthFlat.class);\r\n\t}",
"public State(GameStateManager gameStateManager){ //constructor\n this.gameStateManager = gameStateManager;\n camera = new OrthographicCamera();\n mouse = new Vector3();\n }",
"public Sphere(){\n\t\tradius = 128;\n\t\tlightScale = 1;\n\t\tambientLight = 0.3;\t\t\t// Amount of ambient light\n\t\tdiffuseLight = 0.7;\t\t\t// Amount of diffuse light\n\t\tlightSource = new double[]{0, 0, 128};\t// Place light 128 units away from origin\n\t}",
"final void initViewer()\n {\n if (viewer.getViewContext().getStartInStandaloneWindow() == true)\n {\n \n JFrame frame=null; \n // JFrame\n {\n frame = new JFrame();\n frame.setSize(new Dimension(800, 600));\n GuiSettings.placeToCenter(frame);\n }\n\n if (viewer.haveOwnScrollPane() == false)\n {\n // embed viewer in scrollPane \n JScrollPane scrollPane = new JScrollPane();\n scrollPane.setViewportView(viewer.getViewComponent());\n frame.add(scrollPane);\n }\n else\n {\n frame.add(viewer.getViewComponent());\n }\n \n // Viewer\n // viewer.setFrame(frame); \n viewer.initViewer();\n \n ViewerFrameListener listener = new ViewerFrameListener(frame,this);\n frame.addWindowListener(listener);\n frame.addComponentListener(listener); \n \n frame.pack();\n\n frame.setVisible(true);\n // viewer.setFrame(frame); \n }\n else\n {\n viewer.initViewer();\n }\n }",
"@Override\n public void init() {\n javax.swing.SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n setContentPane(new BallWorld(640, 480)); // BouncingBalls.BallWorld is a JPanel\n }\n });\n }",
"@Override\n public void init() throws Exception {\n Mapper mapper = new Mapper() {\n public double f(double x, double y) {\n try {\n return i3d.evaluate(x, y);\n } catch (InterpolationException e) {\n e.printStackTrace();\n return 0;\n }\n }\n };\n \n // Define range and precision for the function to plot\n Range rangeX = new Range((float)i3d.lowerA(), (float)i3d.upperA());\n int stepsX = 100;\n Range rangeY = new Range((float)i3d.lowerB(), (float)i3d.upperB());\n int stepsY = 100;\n \n AbstractDrawable drawable;\n // Create the object to represent the surface\n final Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(rangeX, stepsX, rangeY, stepsY), mapper);\n surface.setColorMapper(new ColorMapper(new ColorMapRainbow(),\n surface.getBounds().getZmin(), surface.getBounds().getZmax(), COLOR_BASE));\n surface.setWireframeDisplayed(true);\n surface.setWireframeWidth(1);\n surface.setWireframeColor(COLOR_WIRE);\n surface.setFaceDisplayed(true);\n drawable = surface;\n \n // Create a chart\n chart = AWTChartComponentFactory.chart(Quality.Advanced);\n chart.getAxeLayout().setXTickRenderer(new FixedDecimalTickRenderer(1));\n chart.getAxeLayout().setYTickRenderer(new FixedDecimalTickRenderer(1));\n chart.getAxeLayout().setZTickRenderer(new FixedDecimalTickRenderer(1));\n chart.getAxeLayout().setFaceDisplayed(false);\n chart.getAxeLayout().setMainColor(COLOR_MAIN);\n chart.getView().setBackgroundColor(COLOR_BG);\n chart.getScene().getGraph().add(drawable);\n \n chart.getAxeLayout().setXAxeLabel(\"Length\");\n chart.getAxeLayout().setYAxeLabel(\"Time\");\n chart.getAxeLayout().setZAxeLabel(\"Temperature\");\n }",
"public Scientific() {\n initComponents();\n }",
"public RenderEngine() {\n\t\twindow = Window.getInstance();\n\t\t\n\t\ttestEntity = new Entity(\"skull/skull.obj\", \"./res/models/skull/skull.png\", new Vector3f(0,0,0), new Vector3f(0,0,0));\n\t\ttestEntity.getWorldTransform().setScaling(new Vector3f(0.01f,0.01f,0.01f));\n\t\t\n\t\ttestEntity2 = new Entity(\"dummy/dummy.obj\", \"./res/models/dummy/dummy.jpg\", new Vector3f(0,8,0), new Vector3f(0,0,0));\n\t\ttestEntity2.getWorldTransform().setScaling(new Vector3f(0.05f,0.05f,0.05f));\n\t\t\n\t\ttestLight = new Light(new Vector3f(-5,5,-5), new Vector3f(1,1,1));\n\t\ttestLight.getWorldTransform().setScaling(new Vector3f(0.1f,0.1f,0.1f));\n\t\t\n\t\tsky = new SkyDome();\n\t\t\n\t}",
"@JsConstructor\n public EllipsoidRhumbLine(Cartographic start, Cartographic end) {\n }",
"public PMQuadtree() {\n\t\tvalidator = null;\n\t\troot = whiteSingleton;\n\t\t\n\t\tspatialOrigin = new Point2D.Float(0, 0);\n\t}",
"public MotionNetEditorPanel()\n {\n initComponents();\n this.keyFrameControlMap = new HashMap<KeyFrame, KeyFrameControl>();\n this.transitionControlList = new ArrayList<TransitionControl>();\n this.motionNet = null;\n firstKeyFrameRemoved = false;\n setPasteEnable(false);\n this.setBounds(0, 0, this.getWidth(), this.getHeight());\n this.jointChangeListener = new PropertyChangeListener()\n {\n public void propertyChange(PropertyChangeEvent evt)\n {\n if(evt.getPropertyName().compareTo(\"jointStateChanged\") == 0)\n {\n setPasteEnable(false);\n }\n }\n };\n\n }",
"private Camera() {\n viewport = new Rectangle();\n dirtyAreas = new ArrayList<Rectangle>();\n renderedAreas = new ArrayList<Rectangle>();\n fullUpdate = false;\n dirtyAreaCounter = 0;\n }",
"public Vector3D() {\n zero();\n }",
"public Vector3D() {\r\n\t\tthis(0.0);\r\n\t}",
"public KeyFramePropertyViewer()\n {\n initComponents();\n \n this.jScrollPane.getVerticalScrollBar().setBlockIncrement(20);\n this.jScrollPane.getVerticalScrollBar().setUnitIncrement(20);\n //keyFrameEditor = new KeyFrameEditor(new KeyFrame());\n\n this.jointChangeListener = new PropertyChangeListener()\n {\n public void propertyChange(PropertyChangeEvent evt)\n {\n if(evt.getPropertyName().compareTo(\"jointStateChanged\") == 0)\n {\n firePropertyChange(\"jointStateChanged\", null, null);\n }\n }\n };\n\n\n }",
"public Cylinder() {\n\t\tthis(1.0);\n\t}",
"@Override\n\tpublic void init() {\n\t\tGraph<Number,Number> ig = Graphs.<Number,Number>synchronizedDirectedGraph(new DirectedSparseMultigraph<Number,Number>());\n\t\tObservableGraph<Number,Number> og = new ObservableGraph<Number,Number>(ig);\n\t\tog.addGraphEventListener(new GraphEventListener<Number,Number>() {\n\n\t\t\tpublic void handleGraphEvent(GraphEvent<Number, Number> evt) {\n\t\t\t\tSystem.err.println(\"got \"+evt);\n\n\t\t\t}});\n\t\tthis.g = og;\n\n\t\tthis.timer = new Timer();\n\t\tthis.layout = new FRLayout2<Number,Number>(g);\n\t\t// ((FRLayout)layout).setMaxIterations(200);\n\t\t// create a simple pickable layout\n\t\tthis.vv = new VisualizationViewer<Number,Number>(layout, new Dimension(600,600));\n\n\n\n\t}",
"public IKQuadrupedModel() {\n\t\t/*\n\t\ttextureWidth = 16;\n\t\ttextureHeight = 16;\n\n\t\tbase = new ModelRenderer(this);\n\t\tbase.setRotationPoint(0.0F, 4.6F, 0.0F);\n\t\tbase.setTextureOffset(0, 0).addBox(-4.5F, -4.6F, -4.5F, 9.0F, 24.0F, 9.0F, 0.0F, false);\n\n\t\tnorth = new IKModelRenderer(this);\n\t\tnorth.setRotationPoint(0.0F, 0.4F, -4.5F);\n\t\tbase.addChild(north);\n\t\tnorth.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tnorth2 = new IKModelRenderer(this);\n\t\tnorth2.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\tnorth.addChild(north2);\n\t\tnorth2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tnorth3 = new IKModelRenderer(this,0,0,-13);\n\t\tnorth3.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\tnorth2.addChild(north3);\n\t\tnorth3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth = new IKModelRenderer(this);\n\t\tsouth.setRotationPoint(0.0F, 0.4F, 4.5F);\n\t\tbase.addChild(south);\n\t\tsouth.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth2 = new IKModelRenderer(this);\n\t\tsouth2.setRotationPoint(0.0F, 0.0F, 12.5F);\n\t\tsouth.addChild(south2);\n\t\tsouth2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.5F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\tsouth3 = new IKModelRenderer(this,0,0,13);\n\t\tsouth3.setRotationPoint(0.0F, 0.0F, 13.5F);\n\t\tsouth2.addChild(south3);\n\t\tsouth3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest = new IKModelRenderer(this);\n\t\twest.setRotationPoint(4.5F, 0.4F, 0.0F);\n\t\tbase.addChild(west);\n\t\t//setRotationAngle(west, 0.0F, -1.5708F, 0.0F);\n\t\twest.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest2 = new IKModelRenderer(this);\n\t\twest2.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\twest.addChild(west2);\n\t\twest2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\twest3 = new IKModelRenderer(this,0,0,-13);\n\t\twest3.setRotationPoint(0.0F, 0.0F, -13.0F);\n\t\twest2.addChild(west3);\n\t\twest3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, -13.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast = new IKModelRenderer(this);\n\t\teast.setRotationPoint(-4.5F, 0.4F, 0.0F);\n\t\tbase.addChild(east);\n\t\t//setRotationAngle(east, 0.0F, -1.5708F, 0.0F);\n\t\teast.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast2 = new IKModelRenderer(this);\n\t\teast2.setRotationPoint(0.0F, 0.0F, 13.0F);\n\t\teast.addChild(east2);\n\t\teast2.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\n\t\teast3 = new IKModelRenderer(this,0,0,13);\n\t\teast3.setRotationPoint(0.0F, 0.0F, 13.0F);\n\t\teast2.addChild(east3);\n\t\teast3.setTextureOffset(0, 0).addBox(-1.5F, -2.0F, 0.0F, 3.0F, 4.0F, 13.0F, 0.0F, false);\n\t\t*/\n\n\t\ttextureWidth = 128;\n\t\ttextureHeight = 128;\n\n\t\tTorso = new ModelRenderer(this);\n\t\tTorso.setRotationPoint(0.0F, 24.0F, 0.0F);\n\t\tTorso.setTextureOffset(0, 0).addBox(-6.0F, -28.0F, -10.0F, 12.0F, 9.0F, 23.0F, 0.0F, false);\n\n\t\tHead = new ModelRenderer(this);\n\t\tHead.setRotationPoint(0.0F, -23.0F, -10.0F);\n\t\tTorso.addChild(Head);\n\t\tHead.setTextureOffset(25, 32).addBox(-4.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(12, 18).addBox(-1.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(10, 14).addBox(2.0F, -3.0F, -7.0F, 2.0F, 2.0F, 2.0F, 0.0F, false);\n\t\tHead.setTextureOffset(0, 32).addBox(-5.0F, -4.0F, -5.0F, 10.0F, 5.0F, 5.0F, 0.0F, false);\n\n\t\tJaw = new ModelRenderer(this);\n\t\tJaw.setRotationPoint(0.0F, 2.4F, 0.0F);\n\t\tHead.addChild(Jaw);\n\t\tJaw.setTextureOffset(30, 32).addBox(-5.0F, -0.4F, -5.0F, 10.0F, 1.0F, 5.0F, 0.0F, false);\n\n\t\tFRLeg = new IKModelRenderer(this);\n\t\tFRLeg.setRotationPoint(-6.0F, -20.0F, -7.5F);\n\t\tTorso.addChild(FRLeg);\n\t\tsetRotationAngle(FRLeg, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg.setTextureOffset(18, 55).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin = new IKModelRenderer(this);\n\t\tFRShin.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg.addChild(FRShin);\n\t\tsetRotationAngle(FRShin, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin.setTextureOffset(10, 42).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin.addChild(FRFoot);\n\t\tFRFoot.setTextureOffset(57, 0).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg3 = new IKModelRenderer(this);\n\t\tFRLeg3.setRotationPoint(-6.0F, -20.0F, 1.5F);\n\t\tTorso.addChild(FRLeg3);\n\t\tsetRotationAngle(FRLeg3, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg3.setTextureOffset(30, 52).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin3 = new IKModelRenderer(this);\n\t\tFRShin3.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg3.addChild(FRShin3);\n\t\tsetRotationAngle(FRShin3, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin3.setTextureOffset(40, 40).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot3 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot3.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin3.addChild(FRFoot3);\n\t\tFRFoot3.setTextureOffset(50, 44).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg6 = new IKModelRenderer(this);\n\t\tFRLeg6.setRotationPoint(6.0F, -20.0F, 1.5F);\n\t\tTorso.addChild(FRLeg6);\n\t\tsetRotationAngle(FRLeg6, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg6.setTextureOffset(20, 42).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin6 = new IKModelRenderer(this);\n\t\tFRShin6.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg6.addChild(FRShin6);\n\t\tsetRotationAngle(FRShin6, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin6.setTextureOffset(0, 0).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot6 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot6.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin6.addChild(FRFoot6);\n\t\tFRFoot6.setTextureOffset(0, 14).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg4 = new IKModelRenderer(this);\n\t\tFRLeg4.setRotationPoint(-6.0F, -20.0F, 10.5F);\n\t\tTorso.addChild(FRLeg4);\n\t\tsetRotationAngle(FRLeg4, 0.0F, 0.0F, 0.7418F);\n\t\tFRLeg4.setTextureOffset(50, 50).addBox(-1.75F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin4 = new IKModelRenderer(this);\n\t\tFRShin4.setRotationPoint(-0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg4.addChild(FRShin4);\n\t\tsetRotationAngle(FRShin4, 0.0F, 0.0F, -0.4363F);\n\t\tFRShin4.setTextureOffset(30, 38).addBox(-1.3816F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot4 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot4.setRotationPoint(0.2F, 12.4F, -0.5F);\n\t\tFRShin4.addChild(FRFoot4);\n\t\tFRFoot4.setTextureOffset(50, 38).addBox(-1.6F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg5 = new IKModelRenderer(this);\n\t\tFRLeg5.setRotationPoint(6.0F, -20.0F, 10.5F);\n\t\tTorso.addChild(FRLeg5);\n\t\tsetRotationAngle(FRLeg5, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg5.setTextureOffset(47, 0).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin5 = new IKModelRenderer(this);\n\t\tFRShin5.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg5.addChild(FRShin5);\n\t\tsetRotationAngle(FRShin5, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin5.setTextureOffset(10, 0).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot5 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot5.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin5.addChild(FRFoot5);\n\t\tFRFoot5.setTextureOffset(47, 13).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\tFRLeg2 = new IKModelRenderer(this);\n\t\tFRLeg2.setRotationPoint(6.0F, -20.0F, -7.5F);\n\t\tTorso.addChild(FRLeg2);\n\t\tsetRotationAngle(FRLeg2, 0.0F, 0.0F, -0.7418F);\n\t\tFRLeg2.setTextureOffset(40, 54).addBox(-1.25F, -2.0F, -1.0F, 3.0F, 11.0F, 2.0F, 0.1F, false);\n\n\t\tFRShin2 = new IKModelRenderer(this);\n\t\tFRShin2.setRotationPoint(0.3604F, 9.0265F, 0.0F);\n\t\tFRLeg2.addChild(FRShin2);\n\t\tsetRotationAngle(FRShin2, 0.0F, 0.0F, 0.4363F);\n\t\tFRShin2.setTextureOffset(0, 42).addBox(-1.6184F, -0.5961F, -1.0F, 3.0F, 12.0F, 2.0F, 0.0F, false);\n\n\t\tFRFoot2 = new IKModelRenderer(this,0,2,0);\n\t\tFRFoot2.setRotationPoint(-0.2F, 12.4F, -0.5F);\n\t\tFRShin2.addChild(FRFoot2);\n\t\tFRFoot2.setTextureOffset(0, 56).addBox(-1.4F, -1.0F, -1.5F, 3.0F, 2.0F, 4.0F, 0.0F, false);\n\n\t\t/*\n textureWidth = 16;\n\t\ttextureHeight = 16;\n\t\tbase = new IKModelRenderer(this);\n\t\tbase.setRotationPoint(0.0F, 24.0F, 0.0F);\n\t\tbase.setTextureOffset(0, 0).addBox(-8.0F, -2.0F, -8.0F, 16.0F, 2.0F, 16.0F, 0.0F, false);\n\t\t\n\t\tarm = new IKModelRenderer(this);\n\t\tarm.setRotationPoint(0.0F, -2.0F, 0.0F);\n\t\tbase.addChild(arm);\n\t\tarm.setTextureOffset(0, 0).addBox(-1.5F, -16.0F, -1.5F, 3.0F, 16.0F, 3.0F, 0.0F, false);\n\t\t\n\t\telbow = new IKModelRenderer(this);\n\t\telbow.setRotationPoint(0.0F, -16.0F, 0.0F);\n\t\tarm.addChild(elbow);\n\t\telbow.setTextureOffset(0, 0).addBox(-1.5F, -16.0F, -1.5F, 3.0F, 16.0F, 3.0F, 0.0F, false);\n\n\t\tforearm = new IKModelRenderer(this,0,27,0);\n\t\tforearm.setRotationPoint(0.0F, -16.0F, 0.0F);\n\t\telbow.addChild(forearm);\n\t\tforearm.setTextureOffset(0, 0).addBox(-1.5F, -23.0F, -1.5F, 3.0F, 23.0F, 3.0F, 0.0F, false);\n\t\tforearm.setTextureOffset(0, 0).addBox(-2.5F, -27.0F, -2.5F, 5.0F, 4.0F, 5.0F, 0.0F, false);\n\t\t*/\n\t}",
"public CylinderPanel() {\n\t\t\n\t\trInput = new JLabel(\"R = \");\n\t\trInput.setAlignmentX(JLabel.RIGHT_ALIGNMENT);\n\t rInput.setHorizontalAlignment(JLabel.RIGHT);\n\t\thInput = new JLabel(\"H = \");\n\t\thInput.setAlignmentX(JLabel.RIGHT_ALIGNMENT);\n\t hInput.setHorizontalAlignment(JLabel.RIGHT);\n\t\tvOutput = new JLabel(\"Volume: \");\n\t\tvOutput.setAlignmentX(JLabel.RIGHT_ALIGNMENT);\n\t vOutput.setHorizontalAlignment(JLabel.RIGHT);\n\t\tsaOutput = new JLabel(\"Surface Area: \");\n\t\tsaOutput.setAlignmentX(JLabel.RIGHT_ALIGNMENT);\n\t saOutput.setHorizontalAlignment(JLabel.RIGHT);\n\t\tvResult = new JLabel(\" --\");\n\t\tsaResult = new JLabel(\" --\");\n\t\t\n\t\trText = new JTextField(10);\n\t\thText = new JTextField(10);\n\t\t\n\t\tclear = new JButton(\"Clear\");\n\t\tcalculate = new JButton(\"Calculate\");\n\t\t\n\t\ts = new Cylinder();\n\t\t\n\t\tsetBorder(BorderFactory.createTitledBorder(\"Cylinder\"));\n\t\t\n\t\tadd(rInput);\n\t\tadd(rText);\n\t\tadd(hInput);\n\t\tadd(hText);\n\t\tadd(vOutput);\n\t\tadd(vResult);\n\t\tadd(saOutput);\n\t\tadd(saResult);\n\t\tadd(clear);\n\t\tadd(calculate);\n\t\t\n\t\tButtonListener listener = new ButtonListener();\n\t\t\n\t\tclear.addActionListener(listener);\n\t\tcalculate.addActionListener(listener);\n\t\t\n\t\t\n\t}",
"private void initialize()\n {\n // Initialize any variables which are time-independent when\n // calculating the ECI coordinates of the satellite.\n m_satInc = orbit.Inclination();\n m_satEcc = orbit.Eccentricity();\n\n m_cosio = Math.cos(m_satInc);\n m_theta2 = m_cosio * m_cosio;\n m_x3thm1 = 3.0 * m_theta2 - 1.0;\n m_eosq = m_satEcc * m_satEcc;\n m_betao2 = 1.0 - m_eosq;\n m_betao = Math.sqrt(m_betao2);\n\n // The \"recovered\" semimajor axis and mean motion.\n m_aodp = orbit.SemiMajor();\n m_xnodp = orbit.MeanMotion();\n\n // For perigee below 156 km, the values of Globals.S and Globals.QOMS2T are altered.\n m_perigee = Globals.Xkmper * (m_aodp * (1.0 - m_satEcc) - Globals.Ae);\n\n m_s4 = Globals.S;\n m_qoms24 = Globals.Qoms2t;\n\n if (m_perigee < 156.0)\n {\n m_s4 = m_perigee - 78.0;\n\n if (m_perigee <= 98.0)\n {\n m_s4 = 20.0;\n }\n\n m_qoms24 = Math.pow((120.0 - m_s4) * Globals.Ae / Globals.Xkmper, 4.0);\n m_s4 = m_s4 / Globals.Xkmper + Globals.Ae;\n }\n\n double pinvsq = 1.0 / (m_aodp * m_aodp * m_betao2 * m_betao2);\n\n m_tsi = 1.0 / (m_aodp - m_s4);\n m_eta = m_aodp * m_satEcc * m_tsi;\n m_etasq = m_eta * m_eta;\n m_eeta = m_satEcc * m_eta;\n\n double psisq = Math.abs(1.0 - m_etasq);\n\n m_coef = m_qoms24 * Math.pow(m_tsi,4.0);\n m_coef1 = m_coef / Math.pow(psisq,3.5);\n\n double c2 = m_coef1 * m_xnodp *\n (m_aodp * (1.0 + 1.5 * m_etasq + m_eeta * (4.0 + m_etasq)) +\n 0.75 * Globals.Ck2 * m_tsi / psisq * m_x3thm1 *\n (8.0 + 3.0 * m_etasq * (8.0 + m_etasq)));\n\n m_c1 = orbit.BStar() * c2;\n m_sinio = Math.sin(m_satInc);\n\n double a3ovk2 = -Globals.Xj3 / Globals.Ck2 * Math.pow(Globals.Ae,3.0);\n\n m_c3 = m_coef * m_tsi * a3ovk2 * m_xnodp * Globals.Ae * m_sinio / m_satEcc;\n m_x1mth2 = 1.0 - m_theta2;\n m_c4 = 2.0 * m_xnodp * m_coef1 * m_aodp * m_betao2 *\n (m_eta * (2.0 + 0.5 * m_etasq) +\n m_satEcc * (0.5 + 2.0 * m_etasq) -\n 2.0 * Globals.Ck2 * m_tsi / (m_aodp * psisq) *\n (-3.0 * m_x3thm1 * (1.0 - 2.0 * m_eeta + m_etasq * (1.5 - 0.5 * m_eeta)) +\n 0.75 * m_x1mth2 *\n (2.0 * m_etasq - m_eeta * (1.0 + m_etasq)) *\n Math.cos(2.0 * orbit.ArgPerigee())));\n\n double theta4 = m_theta2 * m_theta2;\n double temp1 = 3.0 * Globals.Ck2 * pinvsq * m_xnodp;\n double temp2 = temp1 * Globals.Ck2 * pinvsq;\n double temp3 = 1.25 * Globals.Ck4 * pinvsq * pinvsq * m_xnodp;\n\n m_xmdot = m_xnodp + 0.5 * temp1 * m_betao * m_x3thm1 +\n 0.0625 * temp2 * m_betao *\n (13.0 - 78.0 * m_theta2 + 137.0 * theta4);\n\n double x1m5th = 1.0 - 5.0 * m_theta2;\n\n m_omgdot = -0.5 * temp1 * x1m5th + 0.0625 * temp2 *\n (7.0 - 114.0 * m_theta2 + 395.0 * theta4) +\n temp3 * (3.0 - 36.0 * m_theta2 + 49.0 * theta4);\n\n double xhdot1 = -temp1 * m_cosio;\n\n m_xnodot = xhdot1 + (0.5 * temp2 * (4.0 - 19.0 * m_theta2) +\n 2.0 * temp3 * (3.0 - 7.0 * m_theta2)) * m_cosio;\n m_xnodcf = 3.5 * m_betao2 * xhdot1 * m_c1;\n m_t2cof = 1.5 * m_c1;\n m_xlcof = 0.125 * a3ovk2 * m_sinio *\n (3.0 + 5.0 * m_cosio) / (1.0 + m_cosio);\n m_aycof = 0.25 * a3ovk2 * m_sinio;\n m_x7thm1 = 7.0 * m_theta2 - 1.0;\n }",
"public void setupPlainVariables_xjal()\n/* 422: */ {\n/* 423:492 */ this.mapPanel = \n/* 424:493 */ new TileMapPanel(new TileImageProvider());\n/* 425: */ }",
"public DiscMesh() {\n this(1f, 25);\n }",
"private void init(){\n\t\tadd(new DrawSurface());\n\t\tsetTitle(\"Animation Exercise\");\n\t\tsetSize(640, 480);\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}",
"protected WorldController() {\n\t\tthis(new Rectangle(0,0,DEFAULT_WIDTH,DEFAULT_HEIGHT), \n\t\t\t\tnew Vector2(0,DEFAULT_GRAVITY));\n\t}",
"public Ju(){\n\t\tsuper(STARTING_X, STARTING_Y);\n\t\tsetIsJumping(true);\n\t\tdy = STARTING_DY;\n\t\tjumpHeight = INITIAL_JUMP_HEIGHT;\n\t\thealth = STARTING_LIFE;\n\t\tisStageComplete = false;\n\t\tpoint = 0;\n\t\t//A Sound obj\n\t\t\n\t\t//LOAD THE IMAGES AND CREATE ANIMATION. #check\n\t\tBufferedImage[] rightImages = {ImageManipulator.loadImage(\"Data/Ju/stillRight.png\"), ImageManipulator.loadImage(\"Data/Ju/runRight1.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/runRight2.png\"), ImageManipulator.loadImage(\"Data/Ju/runRight3.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/runRight4.png\"), ImageManipulator.loadImage(\"Data/Ju/stillJumpRight1.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/stillJumpRight2.png\"), ImageManipulator.loadImage(\"Data/Ju/runningJumpRight1.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/runningJumpRight2.png\"), ImageManipulator.loadImage(\"Data/Ju/runningJumpRight3.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/stillSitRight.png\"), ImageManipulator.loadImage(\"Data/Ju/stillUpRight.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/deadRight1.png\"), ImageManipulator.loadImage(\"Data/Ju/deadRight2.png\"), \n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/deadRight3.png\"), ImageManipulator.loadImage(\"Data/Ju/runRight5.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/runRight6.png\"), ImageManipulator.loadImage(\"Data/Ju/runRight7.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/runRight8.png\"), ImageManipulator.loadImage(\"Data/Ju/runRightNew.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/stageWin1.png\"), ImageManipulator.loadImage(\"Data/Ju/stageWin2.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/stageWin3.png\"), ImageManipulator.loadImage(\"Data/Ju/stageWin4.png\"),\n\t\t\t\t\tImageManipulator.loadImage(\"Data/Ju/stageWin5.png\")};\n\t\t//0 == still right\n\t\t//1-4 == walk & run right\n\t\t//5-6 == still jump right\n\t\t//7-9 == running jump right\n\t\t//10 == sit right\n\t\t//11 == still up right\n\t\t//12-14 == dead right\n\t\t//15-16 17 18 == walk & run right new\n\t\t// 19-20 == walk right new\n\t\t//21-24 == win\n\t\tBufferedImage[] leftImages = {null, null, null, null, null, null, null, null, null,\n\t\t\t\tnull, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null};\n\t\tfor(int i=0; i<rightImages.length; i++){\n\t\t\tleftImages[i] = ImageManipulator.horizontalFlip(rightImages[i]);\n\t\t}\n\t\t\n\t\tstillLeft = new Animation(ANIM_TIME).addFrame(leftImages[0]);\n\t\twalkLeft = new Animation(ANIM_TIME+30).addFrame(leftImages[1]).addFrame(leftImages[4]).addFrame(leftImages[15]).addFrame(leftImages[19]).addFrame(leftImages[18]);\n\t\trunLeft = new Animation(ANIM_TIME).addFrame(leftImages[1]).addFrame(leftImages[2]).addFrame(leftImages[3]).addFrame(leftImages[4]).addFrame(leftImages[15]).addFrame(leftImages[16]).addFrame(leftImages[17]).addFrame(leftImages[18]);\n\t\tsitLeft = new Animation(ANIM_TIME).addFrame(leftImages[10]);\n\t\tstillJumpLeft = new Animation(ANIM_TIME).addFrame(leftImages[5], 300).addFrame(leftImages[6], 4000);\n\t\trunningJumpLeft = new Animation(ANIM_TIME).addFrame(leftImages[7]).addFrame(leftImages[8], 400).addFrame(leftImages[9], 4000);\n\t\tchangeLeft = new Animation(ANIM_TIME).addFrame(leftImages[1]);\n\t\tstillUpLeft = new Animation(ANIM_TIME).addFrame(leftImages[11]);\n\t\tdeadLeft = new Animation(ANIM_TIME-30).addFrame(leftImages[12], 500).addFrame(leftImages[13]).addFrame(leftImages[14], 3000);\n\t\t\n\t\tstillRight = new Animation(ANIM_TIME).addFrame(rightImages[0]);\n\t\twalkRight = new Animation(ANIM_TIME+30).addFrame(rightImages[1]).addFrame(rightImages[4]).addFrame(rightImages[15]).addFrame(rightImages[19]).addFrame(rightImages[18]);\n\t\trunRight = new Animation(ANIM_TIME).addFrame(rightImages[1]).addFrame(rightImages[2]).addFrame(rightImages[3]).addFrame(rightImages[4]).addFrame(rightImages[15]).addFrame(rightImages[16]).addFrame(rightImages[17]).addFrame(rightImages[18]);\n\t\tsitRight = new Animation(ANIM_TIME).addFrame(rightImages[10]);\n\t\tstillJumpRight = new Animation(ANIM_TIME).addFrame(rightImages[5], 300).addFrame(rightImages[6], 4000);\n\t\trunningJumpRight = new Animation(ANIM_TIME).addFrame(rightImages[7]).addFrame(rightImages[8], 400).addFrame(rightImages[9], 4000);\n\t\tchangeRight = new Animation(ANIM_TIME).addFrame(rightImages[1]);\n\t\tstillUpRight = new Animation(ANIM_TIME).addFrame(rightImages[11]);\n\t\tdeadRight = new Animation(ANIM_TIME-60).addFrame(rightImages[12], 500).addFrame(rightImages[13]).addFrame(rightImages[14], 3000);\n\t\t\n\t\tstageWin = new Animation(ANIM_TIME+60).addFrame(rightImages[0]).addFrame(rightImages[20]).addFrame(rightImages[21]).addFrame(rightImages[22]).addFrame(rightImages[23]).addFrame(rightImages[24]);\n\t\t\n\t\tsetAnimation(stillRight);\n\t\tcurrLeftAnim = walkLeft;\n\t\tcurrRightAnim = walkRight;\n\t}",
"public NavigatorPane() {\n _initNewLayer(_symbolLayer);\n _rebuildLayerArray();\n }",
"public ECCPanel() {\n initComponents();\n \n }",
"public Camera(){\n // servoPan = new Servo(PAN);\n servoTilt = new Servo(TILT);\n }",
"public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }"
]
| [
"0.5981607",
"0.59683686",
"0.58004534",
"0.57486904",
"0.5714899",
"0.5505402",
"0.5469751",
"0.5437378",
"0.54349196",
"0.53857327",
"0.5377253",
"0.53077996",
"0.5307616",
"0.52826774",
"0.5269019",
"0.52552974",
"0.5251111",
"0.52505195",
"0.5214487",
"0.5206022",
"0.5196683",
"0.51757425",
"0.51735944",
"0.5156085",
"0.5150052",
"0.5137078",
"0.5136007",
"0.51340455",
"0.5130388",
"0.5127202",
"0.51243955",
"0.5120888",
"0.51159877",
"0.5107782",
"0.5107098",
"0.5105919",
"0.5104229",
"0.5089051",
"0.5084996",
"0.5082929",
"0.50816786",
"0.50795424",
"0.50679314",
"0.5067288",
"0.5067117",
"0.50537986",
"0.50527394",
"0.5047782",
"0.50466484",
"0.50444186",
"0.504015",
"0.50395846",
"0.50239223",
"0.5022571",
"0.5017665",
"0.501658",
"0.50163674",
"0.50112283",
"0.5008188",
"0.5003846",
"0.50020564",
"0.49944127",
"0.49829087",
"0.49766302",
"0.49566466",
"0.4955824",
"0.4953955",
"0.49529645",
"0.49507356",
"0.4949229",
"0.49426466",
"0.49359626",
"0.49332958",
"0.49322116",
"0.493085",
"0.49294055",
"0.4928131",
"0.49190867",
"0.49114537",
"0.4908242",
"0.49081856",
"0.49074996",
"0.49012125",
"0.49001437",
"0.49000815",
"0.48996115",
"0.48935252",
"0.48933482",
"0.48917252",
"0.48798922",
"0.48759222",
"0.48724073",
"0.4870129",
"0.48691514",
"0.48662788",
"0.4856169",
"0.48533303",
"0.4852137",
"0.48487848",
"0.48449445"
]
| 0.69461566 | 0 |
Use the displacement of the hotspot and current coordinate system to work out the new state to pass to the controller | private void hotspotDragEnded() {
RigidBodyState state = controller.getRigidBodyState();
if(activeHotspot==0) { // change the z component of center of the ellipsoid
state.center.a[2] = state.center.a[2] + (double)(displacement.y/sy);
controller.setCenter(state.center);
}
else if(activeHotspot==1) { // change the orientation of the ellipsoid
double rx = sx*controller.state.getAxis().a[0];
double ry = sx*controller.state.getAxis().a[2];
Vector3d zrotated = state.rot.rotate(ZAXIS);
double theta = Math.acos(Vector3d.dot(zrotated, ZAXIS));
double tmpx = Math.sin(theta)*ry+displacement.x;
double tmpy = Math.cos(theta)*ry-displacement.y;
theta = Math.acos( tmpy/Math.sqrt(tmpx*tmpx+tmpy*tmpy) );
state.rot = new Quaternion( Math.cos(theta/2.), Vector3d.mult(XAXIS, Math.sin(theta/2.)));
controller.setRot(state.rot);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void move(TrackerState state) {\n\t\t\n\t\tcurrentPosition[0] = state.devicePos[0];\n\t\tcurrentPosition[1] = state.devicePos[1];\n\t\tcurrentPosition[2] = state.devicePos[2];\n\t\t\n\t\tboolean processMove = false;\n\t\t\n\t\tboolean isWheel = (state.actionType == TrackerState.TYPE_WHEEL);\n\t\tboolean isZoom = (isWheel || state.ctrlModifier);\n\t\t\n\t\tif (isZoom) {\n\t\t\t\n\t\t\tdirection[0] = 0;\n\t\t\tdirection[1] = 0;\n\t\t\t\n\t\t\tif (isWheel) {\n\t\t\t\tdirection[2] = state.wheelClicks * 0.1f;\n\t\t\t\t\n\t\t\t} else if (state.ctrlModifier) {\n\t\t\t\tdirection[2] = (currentPosition[1] - startPosition[1]);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdirection[2] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (direction[2] != 0) {\n\t\t\t\t\n\t\t\t\tdirection[2] *= 16;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tinVector.x = startViewMatrix.m02;\n\t\t\t\tinVector.y = startViewMatrix.m12;\n\t\t\t\tinVector.z = startViewMatrix.m22;\n\t\t\t\tinVector.normalize();\n\t\t\t\tinVector.scale(direction[2]);\n\t\t\t\t\n\t\t\t\tpositionVector.add(inVector);\n\t\t\t\t\n\t\t\t\t// stay above the floor\n\t\t\t\tif (positionVector.y > 0) {\n\t\t\t\t\tdestViewMatrix.set(startViewMatrix);\n\t\t\t\t\tdestViewMatrix.setTranslation(positionVector);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tdirection[0] = -(startPosition[0] - currentPosition[0]);\n\t\t\tdirection[1] = -(currentPosition[1] - startPosition[1]);\n\t\t\tdirection[2] = 0;\n\t\t\t\n\t\t\tfloat Y_Rotation = direction[0];\n\t\t\tfloat X_Rotation = direction[1];\n\t\t\t\n\t\t\tif( ( Y_Rotation != 0 ) || ( X_Rotation != 0 ) ) {\n\t\t\t\t\n\t\t\t\tdouble theta_Y = -Y_Rotation * Math.PI;\n\t\t\t\tdouble theta_X = -X_Rotation * Math.PI;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tpositionVector.x -= centerOfRotation.x;\n\t\t\t\tpositionVector.y -= centerOfRotation.y;\n\t\t\t\tpositionVector.z -= centerOfRotation.z;\n\t\t\t\t\n\t\t\t\tif (theta_Y != 0) {\n\n\t\t\t\t\trot.set(0, 1, 0, (float)theta_Y);\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (theta_X != 0) {\n\t\t\t\t\t\n\t\t\t\t\tvec.set(positionVector);\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tfloat angle = vec.angle(Y_AXIS);\n\t\t\t\t\t\n\t\t\t\t\tif (angle == 0) {\n\t\t\t\t\t\tif (theta_X > 0) {\n\t\t\t\t\t\t\trightVector.x = startViewMatrix.m00;\n\t\t\t\t\t\t\trightVector.y = startViewMatrix.m10;\n\t\t\t\t\t\t\trightVector.z = startViewMatrix.m20;\n\t\t\t\t\t\t\trightVector.normalize();\n\t\t\t\t\t\t\trot.set(rightVector.x, 0, rightVector.z, (float)theta_X);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trot.set(0, 0, 1, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((theta_X + angle) < 0) {\n\t\t\t\t\t\t\ttheta_X = -(angle - 0.0001f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvec.y = 0;\n\t\t\t\t\t\tvec.normalize();\n\t\t\t\t\t\trot.set(vec.z, 0, -vec.x, (float)theta_X);\n\t\t\t\t\t}\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpositionPoint.x = positionVector.x + centerOfRotation.x;\n\t\t\t\tpositionPoint.y = positionVector.y + centerOfRotation.y;\n\t\t\t\tpositionPoint.z = positionVector.z + centerOfRotation.z;\n\t\t\t\t\n\t\t\t\t// don't go below the floor\n\t\t\t\tif (positionPoint.y > 0) {\n\t\t\t\t\t\n\t\t\t\t\tmatrixUtils.lookAt(positionPoint, centerOfRotation, Y_AXIS, destViewMatrix);\n\t\t\t\t\tmatrixUtils.inverse(destViewMatrix, destViewMatrix);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (processMove) {\n\t\t\t\n\t\t\tboolean collisionDetected = \n\t\t\t\tcollisionManager.checkCollision(startViewMatrix, destViewMatrix);\n\t\t\t\n\t\t\tif (!collisionDetected) {\n\t\t\t\tAV3DUtils.toArray(destViewMatrix, array);\n\t\t\t\tChangePropertyTransientCommand cptc = new ChangePropertyTransientCommand(\n\t\t\t\t\tve, \n\t\t\t\t\tEntity.DEFAULT_ENTITY_PROPERTIES, \n\t\t\t\t\tViewpointEntity.VIEW_MATRIX_PROP,\n\t\t\t\t\tarray,\n\t\t\t\t\tnull);\n\t\t\t\tcmdCntl.execute(cptc);\n\t\t\t\tif (statusManager != null) {\n\t\t\t\t\tstatusManager.fireViewMatrixChanged(destViewMatrix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstartPosition[0] = currentPosition[0];\n\t\tstartPosition[1] = currentPosition[1];\n\t\tstartPosition[2] = currentPosition[2];\n\t}",
"protected void update(){\n\t\t_offx = _x.valueToPosition(0);\n\t\t_offy = _y.valueToPosition(0);\n\t}",
"void renderHotspots() {\n boolean afterCurrent = false;\n boolean hasLastPos = false;\n float lastX = 0.0f;\n float lastY = 0.0f;\n float lastZ = 0.0f;\n \n final float halfWidth = 0.1f / 2;\n final float halfLength = 0.1f / 2;\n final float halfHeight = 0.1f / 2;\n final float eyeHeight = 0.91712f;//1.1f;\n \n // Find pan position offset vector\n if (selectedTimeInterval.getLocationMetadataEntry() == null) {\n return;\n }\n \n if (!dstLocationVectorExists)\n return;\n \n GL11.glLoadIdentity();\n // set up for tracking hotspot screen x,y\n\t\tfloat projectedXYZ[] = new float[3]; \t\t\n\t\tprojectionMatrix.clear();\n\t\tGL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projectionMatrix);\n\t\tgetMatrixAsArray(projectionMatrix, projectionArray);\n\t\tviewportMatrix.clear();\n\t\tGL11.glGetInteger(GL11.GL_VIEWPORT, viewportMatrix);\n\t\tviewportArray[0] = viewportMatrix.get(0);\n\t\tviewportArray[1] = viewportMatrix.get(1);\n\t\tviewportArray[2] = viewportMatrix.get(2);\n\t\tviewportArray[3] = viewportMatrix.get(3);\n //System.out.println(\"\"+viewportArray[0] + \" \"+ viewportArray[1]+\" \"+viewportArray[2]+\" \"+viewportArray[3] ); \n\t\tmodelMatrix.clear();\n\t\tGL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelMatrix);\n\t\tgetMatrixAsArray(modelMatrix, modelArray);\n \n GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); // no texture\n \n for (int i=0; i<roverTrackingList.size()-1; i++) {\n \tRoverTrackingListEntry listEntry = (RoverTrackingListEntry) roverTrackingList.get(i);\n\t\t\tlistEntry.screenX = 0.0f;\n\t\t\tlistEntry.screenY = 0.0f;\n \t\n double da = listEntry.locationMetadataEntry.rover_origin_offset_vector_a + listEntry.siteMetadataEntry.offset_vector_a - currentLocationVectorA;\n double db = listEntry.locationMetadataEntry.rover_origin_offset_vector_b + listEntry.siteMetadataEntry.offset_vector_b - currentLocationVectorB;\n double dc = listEntry.locationMetadataEntry.rover_origin_offset_vector_c + listEntry.siteMetadataEntry.offset_vector_c - currentLocationVectorC;\n \n float x = (float) db;\n float y = (-(float)dc) - eyeHeight;\n float z = - (float) da;\n\n // calculate brightness of point based on number of images visible for location\n float brightness = 0.0f;\n \n if (listEntry.locationListEntry != null && listEntry.locationListEntry.getNumEnabledImages() > 2) {\n \t// track screen x, y of hotspot\n \t\t\tGLU.gluProject(x, y, z, modelArray, projectionArray, viewportArray, projectedXYZ);\n \t\t\tif (projectedXYZ[2] < 1.0f) {\n\t \t\t\tlistEntry.screenX = projectedXYZ[0];\n\t \t\t\t// transform y from opengl screen coords to regular screen coords\n\t \t\t\tlistEntry.screenY = viewportArray[3] - projectedXYZ[1];\n \t\t\t}\n \t\n \t// render hotspot\n GL11.glLoadIdentity();\n GL11.glTranslatef(x, y, z);\n //System.out.println(\"\"+listEntry.screenX+\" \"+listEntry.screenY);\n \n brightness = 0.5f + 0.1f * listEntry.locationListEntry.getNumEnabledImages();\n if (brightness > 1.0f) {\n brightness = 1.0f;\n }\n \n GL11.glBegin(GL11.GL_QUADS); // D draw A Quad\n \n if (listEntry.locationListEntry.getStartLocation().equals(selectedTimeInterval.getStartLocation())) {\n GL11.glColor3f(brightness, 0.0f, brightness); \n }\n else if (afterCurrent) {\n GL11.glColor3f(0.0f, 0.0f, brightness);\n }\n else {\n GL11.glColor3f(brightness, 0.0f, 0.0f);\n }\n \n GL11.glVertex3f(halfWidth, halfHeight, -halfLength); // Top Right Of The Quad (Top)\n GL11.glVertex3f(-halfWidth, halfHeight, -halfLength); // Top Left Of The Quad (Top)\n GL11.glVertex3f(-halfWidth, halfHeight, halfLength); // Bottom Left Of The Quad (Top)\n GL11.glVertex3f(halfWidth, halfHeight, halfLength); // Bottom Right Of The Quad (Top)\n\n GL11.glVertex3f(halfWidth, -halfHeight, halfLength); // Top Right Of The Quad (Bottom)\n GL11.glVertex3f(-halfWidth, -halfHeight, halfLength); // Top Left Of The Quad (Bottom)\n GL11.glVertex3f(-halfWidth, -halfHeight, -halfLength); // Bottom Left Of The Quad (Bottom)\n GL11.glVertex3f(halfWidth, -halfHeight, -halfLength); // Bottom Right Of The Quad (Bottom)\n\n GL11.glVertex3f(halfWidth, halfHeight, halfLength); // Top Right Of The Quad (Front)\n GL11.glVertex3f(-halfWidth, halfHeight, halfLength); // Top Left Of The Quad (Front)\n GL11.glVertex3f(-halfWidth, -halfHeight, halfLength); // Bottom Left Of The Quad (Front)\n GL11.glVertex3f(halfWidth, -halfHeight, halfLength); // Bottom Right Of The Quad (Front)\n\n GL11.glVertex3f(halfWidth, -halfHeight, -halfLength); // Bottom Left Of The Quad (Back)\n GL11.glVertex3f(-halfWidth, -halfHeight, -halfLength); // Bottom Right Of The Quad (Back)\n GL11.glVertex3f(-halfWidth, halfHeight, -halfLength); // Top Right Of The Quad (Back)\n GL11.glVertex3f(halfWidth, halfHeight, -halfLength); // Top Left Of The Quad (Back)\n\n GL11.glVertex3f(-halfWidth, halfHeight, halfLength); // Top Right Of The Quad (Left)\n GL11.glVertex3f(-halfWidth, halfHeight, -halfLength); // Top Left Of The Quad (Left)\n GL11.glVertex3f(-halfWidth, -halfHeight, -halfLength); // Bottom Left Of The Quad (Left)\n GL11.glVertex3f(-halfWidth, -halfHeight, halfLength); // Bottom Right Of The Quad (Left)\n\n GL11.glVertex3f(halfWidth, halfHeight, -halfLength); // Top Right Of The Quad (Right)\n GL11.glVertex3f(halfWidth, halfHeight, halfLength); // Top Left Of The Quad (Right)\n GL11.glVertex3f(halfWidth, -halfHeight, halfLength); // Bottom Left Of The Quad (Right)\n GL11.glVertex3f(halfWidth, -halfHeight, -halfLength); // Bottom Right Of The Quad (Right)\n \n GL11.glEnd(); // Done Drawing The Quads\n\t }\n \n if (hasLastPos && !listEntry.segmentStart) {\n brightness = 0.5f;\n if (afterCurrent) {\n GL11.glColor3f(0.0f, 0.0f, brightness);\n }\n else {\n GL11.glColor3f(brightness, 0.0f, 0.0f);\n } \n GL11.glLoadIdentity();\n GL11.glBegin(GL11.GL_LINES); \n// GL11.glColor3f(1.0f, 0.0f, 0.0f); \n GL11.glVertex3f(lastX, lastY, lastZ);\n GL11.glVertex3f(x, y, z);\n GL11.glEnd();\n }\n \n lastX = x;\n lastY = y;\n lastZ = z;\n hasLastPos = true;\n if (listEntry.locationListEntry != null && listEntry.locationListEntry.getStartLocation().equals(this.selectedTimeInterval.getStartLocation())) {\n afterCurrent = true;\n }\n }\n }",
"void updateStepCoordiantes(){\n if(xIncreasing) {\n lat = lat + STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat + STEP_LENGTH*yCompMotion*degToMRatio;\n }\n else{\n lat = lat - STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat - STEP_LENGTH*yCompMotion*degToMRatio;\n }\n if(yIncreasing) {\n lon = lon + STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon + STEP_LENGTH*xCompMotion*degToMRatio;\n }\n else{\n lon = lon - STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon - STEP_LENGTH*xCompMotion*degToMRatio;\n }\n }",
"private void updateCurrentTarget(){\n switch (state){\n case States.DEAD:\n currentTarget = currentLocation;\n break;\n case States.FIGHT:\n if (targetEnemy != null)\n currentTarget = targetEnemy.getCurrentLocation();\n else\n currentTarget = targetBuilding.getLocation();\n break;\n case States.RETREAT:\n currentTarget = new Point(20,20);\n break;\n case States.LOSS:\n currentTarget = new Point(20,20);\n break;\n case States.WIN:\n currentTarget = village.getCenter();\n break;\n case States.IDLE:\n currentTarget = targetBuilding.getLocation();\n }\n }",
"@Override\n\tpublic void update(float delta) {\n\t\tHashMap<Coordinate, MapTile> currentView = getView();\n\t\tcheckStateChange();\n\t\tfor(Coordinate i : currentView.keySet()) {\n\t\t\t\n\t\t\t//Building up wholeMap with data from currentView\n\t\t\tif(i.x >= 0 && i.y >= 0 && i.x < World.MAP_WIDTH && i.y < World.MAP_HEIGHT ) {\n\t\t\t\twholeMap.put(i, currentView.get(i));\n\t\t\t}\n\t\n\t\t}\n//\t\tif(getSpeed() > CAR_SPEED/2f){\n//\t\t\tapplyBrake();\n//\t\t}\n\n//\t\tif(checkWallAhead(getOrientation(), currentView)){\n//\t\t\tisReversing = true;\n//\t\t}\n//\t\tif(checkRightWall(getOrientation(), currentView)){\n//\t\t\tisTurningLeft = true;\n//\t\t}\n//\t\tif(checkLeftWall(getOrientation(), currentView)){\n//\t\t\tisTurningRight = true;\n//\t\t}\n\n\n\n\t\tdebugPrint(\"STATES: A: \" + isAccelerating +\" Rv: \"+ isReversing +\n\t\t\" L: \"+ isTurningLeft + \" R: \"+isTurningRight);\n\n\n\t\t//Handles Steering\n\t\tif(isTurningLeft){\n\t\t\tdebugPrint(\"TRYING TO TURN LEFT\");\n\t\t\tapplySafeLeftTurn(delta);\n\t\t} else if(isTurningRight){\n\t\t\tdebugPrint(\"TRYING TO TURN RIGHT\");\n\t\t\tapplySafeRightTurn(delta);\n\t\t}\n\t\tif(isAccelerating){\n\t\t\tdebugPrint(\"No\");\n\t\t\tapplySafeForwardAcceleration();\n\t\t}\n\n\t\tif(isReversing){\n\t\t\tapplySafeReverseAcceleration();\n//\t\t\tisReversing = false;\n\n\t\t}\n\n\n\n\n\n\t\t//\n\t\tif(hasReachedNextDest) {\n\t\t\tdebugPrint(\"Recalculating Route.\");\n\t\t\tList<Node> result =exploreDijkstras(new Coordinate(carrrr.getPosition()));\n\t\t\tresult.add(new Node(\"1,2\"));\n\t\t\tpathList.add(result);\n\t\t\thasReachedNextDest = false;\n\t\t}\n\n\n\n\n\t\t//Car movement code-----------------------------------------------------------------------------------\n\t\t//If there's a path in the path array to follow\n\t\tif(pathList.size() > 0 || processing) {\n\t\t\tif(processing) {\n\t\t\t\tcheckStateChange();\n\n\t\t\t\t//Identify if target tile is N,S,E or W.\n\t\t\t\ttry {\n\t\t\t\t\tpath.get(counter+1);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tdebugPrint(\"Starting new path\");\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\thasReachedNextDest = true;\n\t\t\t\t}\n\n\n\n\t\t\t\tCoordinate currPos = new Coordinate (getPosition());\n\t\t\t\tCoordinate targetPos = new Coordinate(path.get(counter).getName());\n\n\t\t\t\tif(!coordList.contains(currPos)){\n\t\t\t\t\tdebugPrint(\"Recalculating Route (Not on route).\");\n\t\t\t\t\tList<Node> result =exploreDijkstras(new Coordinate(getPosition()));\n\t\t\t\t\tresult.add(new Node(\"99,99\")); //This is just to make sure something is there.\n\t\t\t\t\tpathList.add(result);\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\tdebugPrint(result);\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\n\t\t\t\tWorldSpatial.Direction dir = getDirection(currPos, targetPos);\n\n\t\t\t\tboolean isFacingTarget = false;\n\n\t\t\t\tSystem.out.println(\"-----------------\");\n\t\t\t\tdebugPrint(\"currPos: \"+ currPos);\n\t\t\t\tdebugPrint(\"targetPos: \"+ targetPos);\n\t\t\t\tSystem.out.println(\"-----------------\");\n\n\t\t\t\t// If we are on the target, move on to next.\n\t\t\t\tif(currPos.equals(targetPos)) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\tcurrPos = targetPos;\n\t\t\t\t\ttargetPos = new Coordinate(path.get(counter).getName());\n\n\n\n\t\t\t\t\tif(!isFacingTarget){\n//\t\t\t\t\t\tisTurningSoon = true;\n\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\t\t\t\t\t}\n\t\t\t\t\tdir = getDirection(currPos, targetPos);\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir + \"|| carFront: \" + getOrientation());\n\t\t\t\t\tisFacingTarget = dir.equals(getOrientation());\n\n\t\t\t\t\tif(dir.equals(oppositeOfOrientation(getOrientation()))){\n\t\t\t\t\t\tisReversing = true;\n\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not on target yet.\n\t\t\t\t\tif(!isFacingTarget && isReversing) {\n\t\t\t\t\t\t//If not moving in Direction of target Coord:\n\t\t\t\t\t\tif(leftOrRight(dir) == null){\n\t\t\t\t\t\t\t//this is bad.\n\t\t\t\t\t\t\tdebugPrint(\"Not left or right?\");\n\t\t\t\t\t\t\tdebugPrint(\"UTURN REQUIRED\");\n\t\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisReversing = false;\n\t\t\t\t\t\t\tdebugPrint(\"leftOrRight: \" + leftOrRight(dir));\n\t\t\t\t\t\t\tlastTurnDirection = leftOrRight(dir);\n\t\t\t\t\t\t\tint targetDegree = directionToDegree(dir);\n\n\t\t\t\t\t\t\tdebugPrint(\"PEEK: \"+peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().toString());\n\n\t\t\t\t\t\t\tif(peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(currPos)){\n\t\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(lastTurnDirection.equals(WorldSpatial.RelativeDirection.RIGHT)){\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(targetPos)){\n\t\t\t\t\t\t\t\t\tdebugPrint(\"RIGHT TURN SAFE\");\n\t\t\t\t\t\t\t\t\tisTurningRight = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningRight = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.LEFT, delta).getCoordinate().equals(targetPos)) {\n\t\t\t\t\t\t\t\t\tdebugPrint(\"LEFT TURN SAFE\");\n\n\t\t\t\t\t\t\t\t\tisTurningLeft = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treadjust(lastTurnDirection, delta);\n\t\t\t\t\t\t//If moving in right direction,\n\t\t\t\t\t\t//Accelerate if not traveling at max speed\n\t\t\t\t\t\tfloat x = CAR_SPEED;\n\t\t\t\t\t\tif(isTurningSoon) {\n\t\t\t\t\t\t\tx = CAR_SPEED/4f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(getSpeed() < x){\n\t\t\t\t\t\t\tisTurningSoon = false;\n\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif(useTestPath){\n\t\t\t\t\tmakeTestPath();\n\t\t\t\t\tpath = testpath;\n\t\t\t\t} else {\n\t\t\t\t\tpath = pathList.poll();\n\t\t\t\t\t//Populate coordList\n\t\t\t\t\tfor(Node n: path){\n\t\t\t\t\t\tcoordList.add(new Coordinate(n.getName()));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tdebugPrint(path);\n\t\t\t\tprocessing = true; \n\t\t\t\t\n\t\t\t}\n\t\n\t\t\t\n\t\t} else {\n\t\t\tdebugPrint(\"End of path list\");\n\t\t}\n\n\n\n\n\n\n\n/*\t\t// If you are not following a wall initially, find a wall to stick to!\n\t\tif(!isFollowingWall){\n\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\tapplyForwardAcceleration();\n\t\t\t}\n\t\t\t// Turn towards the north\n\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.NORTH)){\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\tif(checkNorth(currentView)){\n\t\t\t\t// Turn right until we go back to east!\n\t\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.EAST)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Once the car is already stuck to a wall, apply the following logic\n\t\telse{\n\n\t\t\t// Readjust the car if it is misaligned.\n\t\t\treadjust(lastTurnDirection,delta);\n\n\t\t\tif(isTurningRight){\n\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\telse if(isTurningLeft){\n\t\t\t\t// Apply the left turn if you are not currently near a wall.\n\t\t\t\tif(!checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to determine whether or not the car is next to a wall.\n\t\t\telse if(checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t// Maintain some velocity\n\t\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t}\n\t\t\t\t// If there is wall ahead, turn right!\n\t\t\t\tif(checkWallAhead(getOrientation(),currentView)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tisTurningRight = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// This indicates that I can do a left turn if I am not turning right\n\t\t\telse{\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tisTurningLeft = true;\n\t\t\t}\n\t\t}\n\n\t\t*/\n\n\t}",
"public void updatePosition() {\n\n this.x = this.temp_x;\n this.y = this.temp_y;\n this.ax = 0;\n this.ay = 0;\n\t\tthis.axplusone = 0;\n this.ayplusone = 0;\n \n }",
"public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}",
"private void updateSensors()\r\n\t{\t\t\r\n\t\tthis.lineSensorRight\t\t= perception.getRightLineSensor();\r\n\t\tthis.lineSensorLeft \t\t= perception.getLeftLineSensor();\r\n\t\t\r\n\t\tthis.angleMeasurementLeft \t= this.encoderLeft.getEncoderMeasurement();\r\n\t\tthis.angleMeasurementRight \t= this.encoderRight.getEncoderMeasurement();\r\n\r\n\t\tthis.mouseOdoMeasurement\t= this.mouseodo.getOdoMeasurement();\r\n\r\n\t\tthis.frontSensorDistance\t= perception.getFrontSensorDistance();\r\n\t\tthis.frontSideSensorDistance = perception.getFrontSideSensorDistance();\r\n\t\tthis.backSensorDistance\t\t= perception.getBackSensorDistance();\r\n\t\tthis.backSideSensorDistance\t= perception.getBackSideSensorDistance();\r\n\t}",
"@Override\n\t\tpublic void updateVariables(){\n\t\t\tthis.currentX = odometer.getCurrentX();\n\t\t\tthis.currentY = odometer.getCurrentY();\n\t\t\tthis.currentAngle = odometer.getHeadingAngle();\n\t\t\tthis.currentAverageVelocity = odometer.getCurrentAverageVelocity();\n\t\t}",
"public CurrentRobotState() {\r\n currentPos = new RobotCoordinates();\r\n motorState = new Motor();\r\n reInitialize();\r\n }",
"private void getInput() { \n\t\txMove = 0;\n\t\tyMove = 0;\n\t\tif(handler.getKeyManager().pause) {\n\t\t\tMenuState menu = new MenuState(handler);\n\t\t\tState.setState(menu);\n\t\t}\n\t\t\n\t\tif(handler.getKeyManager().pKey) {\n\t\t\tif(gear != 0)\n\t\t\t\tchangeGear(0);\n\t\t}\n\t\tif(handler.getKeyManager().oKey) {\n\t\t\tif(gear != 1 && vector[0] == 0)\n\t\t\t\tchangeGear(1);\n\t\t}\n\t\tif(handler.getKeyManager().iKey) {\n\t\t\tif(gear != 2)\n\t\t\t\tchangeGear(2);\n\t\t}\n\t\tif(handler.getKeyManager().uKey) {\n\t\t\tif(gear != 3 && vector[0] == 0)\n\t\t\t\tchangeGear(3);\n\t\t}\n\t\t\n\t\t\t\n\t\tif(handler.getKeyManager().gas) {\n\t\t\tif(GameState.getGameActive() == 0 || GameState.getGameActive() == 4) {\n\t\t\t\tif(vector[0] < topSpeed && gear != 2 && gear != 0)\n\t\t\t\t\tvector[0] += accel;\n\t\t\t} else if (GameState.getGameActive() == 1 || GameState.getGameActive() == 2) {\n\t\t\t\tif(overSelector == 0) {\n\t\t\t\t\tConfigState config = new ConfigState(handler);\n\t\t\t\t\tState.setState(config);\n\t\t\t\t}else if(overSelector == 1) {\n\t\t\t\t\tMenuState menustate = new MenuState(handler);\n\t\t\t\t\tState.setState(menustate);\n\t\t\t\t}else if(overSelector == 2) {\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(!handler.getKeyManager().gas || gear == 2) {\n\t\t\t\tif(vector[0] > accel)\n\t\t\t\t\tvector[0] -= accel;\n\t\t\t\telse if(vector[0] > 0 && vector [0] <= 5 * accel)\n\t\t\t\t\tvector[0] = 0;\n\t\t}\n\t\t\n\t\tif(handler.getKeyManager().brake || (gear == 0 && vector[0] > 0)) {\n\t\t\tif(vector[0] > 0 && vector[0] - 5 * accel > 0)\n\t\t\t\tvector[0] -= 5 * accel;\n\t\t\telse if(vector[0] > 0)\n\t\t\t\tvector[0] = 0;\n\t\t}\n\t\t\n\t\tif(handler.getKeyManager().left) {\n\t\t\tif((GameState.getGameActive() == 0 || GameState.getGameActive() == 4) && vector[0] > 0) {\n\t\t\t\tif(dTurn < 0.1)\n\t\t\t\t\tdTurn += 0.02;\n\t\t\t\tif(vector[1] - dTurn <= 0)\n\t\t\t\t\tvector[1] = (double)(2 * Math.PI);\n\t\t\t\tvector[1] -= dTurn;\n\t\t\t\tif(dTurn < 0.05)\n\t\t\t\t\tdTurn += 0.01;\n\t\t\t\t//System.out.println(\"R\");\n\t\t\t} else if(GameState.getGameActive() == 1 || GameState.getGameActive() == 2) {\n\t\t\t\tif(overSelector > 0) {\n\t\t\t\t\toverSelector--;\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(!handler.getKeyManager().left && dTurn > 0) {\n\t\t\tdTurn = 0;\n\t\t}\n\t\t\n\t\tif(handler.getKeyManager().right) {\n\t\t\tif((GameState.getGameActive() == 0 || GameState.getGameActive() == 4) && vector[0] > 0) {\n\t\t\t\tif(dTurn < 0.1)\n\t\t\t\t\tdTurn += 0.02;\n\t\t\t\tvector[1] += dTurn;\n\t\t\t\t//System.out.println(dTurn);\n\t\t\t\tif(vector[1] >= (double)(2 * Math.PI))\n\t\t\t\t\tvector[1] = 0;\n\t\t\t}else if(GameState.getGameActive() == 1 || GameState.getGameActive() == 2) {\n\t\t\t\tif(overSelector < buttons.length - 1) {\n\t\t\t\t\toverSelector++;\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(!handler.getKeyManager().right && dTurn > 0) {\n\t\t\tdTurn = 0;\n\t\t}\n\t\t\n\t\tif((gear == 3) || ((gear == 2 || gear== 0) && prevGear == 3)) {\n\t\t\txMove = (double)(vector[0] * Math.cos(vector[1]));\n\t\t\tyMove = (double)(vector[0] * Math.sin(vector[1]));\n\t\t}else if(gear == 1 || ((gear == 2 || gear == 0) && prevGear == 1)) {\n\t\t\txMove = (double)(-vector[0] * Math.cos(vector[1]));\n\t\t\tyMove = (double)(-vector[0] * Math.sin(vector[1]));\n\t\t}\n\t}",
"public void update(){\n\t\tdouble timeStep = (double) 1 / METERS_PER_X_TICKS;\n\t\t\n\t\tdouble newXVel = xVel + xAccel * timeStep;\n\t\tdouble newYVel = yVel + yAccel * timeStep;\n\t\t\n//\t\tdouble deltaX = timeStep * (xVel + newXVel) / 2;\n//\t\tdouble deltaY = timeStep * (yVel + newYVel) / 2;\n\t\t\n\t\tdouble deltaX = timeStep * xVel;\n\t\tdouble deltaY = timeStep * yVel;\n\t\t\n\t\txCoord += deltaX;\n\t\tyCoord += deltaY;\n\t\t\n\t\txVel = newXVel;\n\t\tyVel = newYVel;\n\t\t\n\t\t//record new location\n\t\tif(recordPath)\n\t\t\tmyEnviron.getEntityHistories().get(ID).add(new double[]{xCoord, yCoord, xVel, yVel});\n\t\t\n\t\tcontactBlock = null; // reset to the appropriate block during block collision process, if needed\n\t\tcontactBlockSideNum = -1;\n\t\tcontactBlockVertexNum = -1;\n\t\tlifetime++;\n\t}",
"public void update()\n {\n if(RobotMap.manipController.getRawButton(XboxMap.X)==true)\n {\n activateDumpSolenoid(forward);\n }\n\n //when b is pressed, put gate back up\n if(RobotMap.manipController.getRawButton(XboxMap.B)==true)\n {\n activateDumpSolenoid(reverse);\n }\n\n //If A is pressed (auto)\n if(RobotMap.driveController.getRawButton(XboxMap.A)==true)\n {\n if(distanceSensor.checkDistance() < 270 && distanceSensor.checkDistance() != 0)\n {\n activateDumpSolenoid(forward);\n myRobot.setAutoDoneTrue();\n }\n }\n }",
"@Override\n\tpublic void update(MyAIController controller) {\n\t\t// Update Map\n\t\tmap.update(controller.getView());\n\t\tWorldSpatial.Direction orientation = controller.getOrientation();\n\t\tCoordinate pos = new Coordinate(controller.getPosition());\n\n\t\tSystem.out.println(state);\n\n\t\tswitch (state) {\n\t\tcase NORMAL:\n\t\t\tupdateNormal(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase WALL_FOLLOWING:\n\t\t\tupdateWallFollowing(controller, pos, orientation);\n\t\t\tbreak;\n\t\t// Checks car has moved tiles before going back to WALL_FOLLOWING state\n\t\tcase JUST_TURNED_LEFT:\n\t\t\tupdateJustTurnedLeft(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase PASSING_TRAP:\n\t\t\tupdatePassingTrap(controller, pos, orientation);\n\t\t\tbreak;\n\t\t}\n\t}",
"public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }",
"public void updateXLoc();",
"private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }",
"public void update() {\n vel.add(acc);\n vel.limit(max_vel);\n loc.add(vel);\n acc.mult(0);\n }",
"public void setStateOfMovement(int movementState){stateOfMovement = movementState; }",
"public void update() {\n\t\tgetLocation().offsetX(getDirection().getXOffset());\n\t\tgetLocation().offsetY(getDirection().getYOffset());\n\t\t\n\t\tChunk center = World.getMap().getCenterChunk();\n\t\t\n\t\tint localX = (int) (getLocation().getX() - center.getData().getRealX());\n\t\tint localY = (int) (getLocation().getY() - center.getData().getRealY());\n\t\t\n\t\tif(localX < 0 ||localY< 0\n\t\t\t|| localX > 256 || localY > 256) {\n\t\t\t\tWorld.getMap().load(getLocation());\n\t\t}\n\t}",
"@Override\n\tpublic void update() {\n\t\tcanBuild = true;\n\t\tfor (Ship s : SceneManager.sm.currSector.ships) {\n\t\t\tif (!s.isPlayer) {\n\t\t\t\tif (s.cm.distanceTo(p.cm) < 2500) {\n\t\t\t\t\tcanBuild = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (SceneManager.sm.endSector.clear && SceneManager.sm.currSector.pos.isSame(SceneManager.sm.endSector.pos)) {\n\t\t\tSystem.out.println(\"Game WON\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ws.setActive(true);\n\t\t}\n\t\tif (p.destroyed) {\n\t\t\tSystem.out.println(\"Game LOST\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ls.setActive(true);\n\t\t}\n\n\t\tshipYard.update();\n\t\tstarMap.update();\n\n\t\t// TODO remove before flight: to draw where mouse is - temp\n\t\t// if (InputManager.mouse[2]) {\n\t\t// System.out.println(InputManager.mPos.toString());\n\t\t// }\n\n\t\tif (InputManager.keys[81])\n\t\t\tp.cmdRotate(false);\n\t\tif (InputManager.keys[69])\n\t\t\tp.cmdRotate(true);\n\t\tif (InputManager.keys[87])\n\t\t\tp.cmdMove(0, 1);\n\t\tif (InputManager.keys[83])\n\t\t\tp.cmdMove(2, 1);\n\t\tif (InputManager.keys[65])\n\t\t\tp.cmdMove(3, 1);\n\t\tif (InputManager.keys[68])\n\t\t\tp.cmdMove(1, 1);\n\t\tif (InputManager.keys[38]) {\n\t\t\tCamera.yOff += 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[40]) {\n\t\t\tCamera.yOff -= 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[39]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff -= 10 * (1 / Camera.scale);\n\t\t}\n\t\tif (InputManager.keys[37]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff += 10 * (1 / Camera.scale);\n\t\t}\n\n\t\t// key to go to build area - b\n\t\tif (canBuild && InputManager.keysReleased[66] || shipYard.clicked) {\n\t\t\tswtichToBuild();\n\t\t}\n\t\tif (InputManager.keysReleased[77] || starMap.clicked) {\n\t\t\tswtichToStarMap();\n\t\t}\n\t\t\n\t\t// key to select a ship - no use atm\n\t\tif (InputManager.mouse[1]) {\n\t\t\t//selected = SceneManager.sm.currSector.getClickShip();\n\t\t\t// now have a ship selected\n\t\t}\n\t\t\n\t\tif(InputManager.keysReleased[32]) {\n\t\t\tcamFocus = p.cm;\n\t\t}\n\n\t\t// key to move the camera to a ship or area\n\t\tif (InputManager.mouseReleased[2]) {\n\t\t\teyeFocused = false;\n\t\t\tif(SceneManager.sm.currSector.getClickShip() != null)\n\t\t\t{\n\t\t\t\tcamFocus = SceneManager.sm.currSector.getClickShip().cm;\n\t\t\t}else if(Camera.toScreen(eyeLoc).distanceTo(InputManager.mPos) < 40){\n\t\t\t\tcamFocus = eyeLoc;\n\t\t\t\teyeFocused = true;\n\t\t\t}else {\n\t\t\t\tcamFocus = Camera.toMap(InputManager.mPos.x, InputManager.mPos.y);\n\t\t\t}\n\t\t}\n\t\tif (partTarget != null && partTarget.health <= 0)\n\t\t\tpartTarget = null;\n\n\t\tif (partTarget == null && target != null)\n\t\t\tp.shoot(target);\n\n\t\tif (partTarget == null && target == null)\n\t\t\tp.ceaseFire();\n\n\t\tif (target != null && InputManager.mouseReleased[3] && !target.destroyed) {\n\t\t\tpartTarget = SceneManager.sm.currSector.getClickShipPart(target);\n\t\t\tp.shoot(partTarget);\n\t\t}\n\n\t\tif (InputManager.mouseReleased[3]) {\n\t\t\ttarget = SceneManager.sm.currSector.getClickShip();\n\t\t\tif (target != null && partTarget == null) {\n\t\t\t\tp.shoot(target);\n\t\t\t}\n\t\t}\n\t\tif (target != null && (target.destroyed || target.isPlayer)) {\n\t\t\ttarget = null;\n\t\t\tpartTarget = null;\n\t\t\tp.ceaseFire();\n\t\t}\n\n\t\tif (camFocus != null)\n\t\t\tCamera.focus(camFocus);\n\t\t// if(selected != null) selected.vel.print();\n\n\t\tSceneManager.sm.currSector.update();\n\t}",
"@Override\n\tpublic void update() {\n\t\t\n\t\tif(!this.explShowing)\n\t\t{\n\t\t\tx+= dx;\n\t\t\ty+= dy;\n\t\n\t\t\tif(x < 0)\n\t\t\t{\n\t\t\t\tx = 0;\n\t\t\t\tdx = dx *-1;\n\t\t\t}\n\t\t\telse\n\t\t\tif(x + w > MainGame.getInstance().X_WORLD_END)\n\t\t\t{\n\t\t\t\tx = MainGame.getInstance().X_WORLD_END - w ;\n\t\t\t\tdx = dx *-1;\t\n\t\t\t}\n\t\n\t\t\tif(y < 0)\n\t\t\t{\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t\telse\n\t\t\tif(y + h > MainGame.getInstance().Y_WORLD_END)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t}\n\t\t\n\t\ts.update();\n\t\n\t\tif(this.explShowing)\n\t\t{\n\t\t\tif(expl.isHasFinished())\n\t\t\t{\n\t\t\t\texplShowing = false;\n\t\t\t\ts = this.normalImage;\n\t\t\t\tthis.x = this.xStart;\n\t\t\t\tthis.y = this.yStart;\n\t\t\t\ts.setX(this.xStart);\n\t\t\t\ts.setY(this.yStart);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//s.setX(x);\n\t\t//s.setY(y);\n\t\t\n\t\tthis.rect.setFrame(getX(),getY(),getW(),getH());\t\n\t}",
"public void updateLocation();",
"void updateSensors() {\n\t\tint visionDim = ninterface.affectors.getVisionDim();\n\t\tdouble distance;\n\n\t\t/* Update food vision variables. */\n\t\tfor (int i = 0; i < visionDim; i++) {\n\t\t\t/* Food sensory neurons. */\n\t\t\tdistance = viewingObjectOfTypeInSegment(i,\n\t\t\t\t\tCollision.TYPE_FOOD);\n\t\t\tninterface.affectors.vFood[i]\n\t\t\t\t\t= distance < 0.0 ? 1.0 : 1.0 - distance;\n\n\t\t\t/* Ally sensory neurons. */\n\t\t\tdistance = viewingObjectOfTypeInSegment(i,\n\t\t\t\t\tCollision.TYPE_AGENT);\n\t\t\tninterface.affectors.vAlly[i]\n\t\t\t\t\t= distance < 0.0 ? 1.0 : 1.0 - distance;\n\n\t\t\t/* Enemy sensory neurons. */\n\t\t\tdistance = viewingObjectOfTypeInSegment(i,\n\t\t\t\t\tCollision.TYPE_ENEMY);\n\t\t\tninterface.affectors.vEnemy[i]\n\t\t\t\t\t= distance < 0.0 ? 1.0 : 1.0 - distance;\n\n\t\t\t/* Wall sensory neurons. */\n\t\t\tdistance = viewingObjectOfTypeInSegment(i,\n\t\t\t\t\tCollision.TYPE_WALL);\n\t\t\tninterface.affectors.vWall[i]\n\t\t\t\t\t= distance < 0.0 ? 1.0 : 1.0 - distance;\n\t\t}\n\t}",
"public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\n\t}",
"@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}",
"public void updateStationPositions() {\r\n \t\tObject key;\r\n \t\tObject[] cells = graph.getDescendants(graph.getRoots());\r\n \t\tfor (Object cell : cells) {\r\n \t\t\tif (cell instanceof JmtCell) {\r\n \t\t\t\tJmtCell jcell = (JmtCell) cell;\r\n \t\t\t\tkey = ((CellComponent) jcell.getUserObject()).getKey();\r\n \t\t\t\t// Sets cell coordinate into data structure\r\n \t\t\t\tmodel.setStationPosition(key, new JMTPoint(getCellCoordinates(jcell), !jcell.isLeftInputCell()));\r\n \t\t\t}\r\n \t\t}\r\n \t}",
"private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }",
"private void calculateLocation()\r\n\t{\r\n\t\tdouble leftAngleSpeed \t= this.angleMeasurementLeft.getAngleSum() / ((double)this.angleMeasurementLeft.getDeltaT()/1000); //degree/seconds\r\n\t\tdouble rightAngleSpeed \t= this.angleMeasurementRight.getAngleSum() / ((double)this.angleMeasurementRight.getDeltaT()/1000); //degree/seconds\r\n\r\n\t\tdouble vLeft\t= (leftAngleSpeed * Math.PI * LEFT_WHEEL_RADIUS ) / 180 ; //velocity of left wheel in m/s\r\n\t\tdouble vRight\t= (rightAngleSpeed * Math.PI * RIGHT_WHEEL_RADIUS) / 180 ; //velocity of right wheel in m/s\t\t\r\n\t\tdouble w \t\t= (vRight - vLeft) / WHEEL_DISTANCE; //angular velocity of robot in rad/s\r\n\t\t\r\n\t\tDouble R \t= new Double(( WHEEL_DISTANCE / 2 ) * ( (vLeft + vRight) / (vRight - vLeft) ));\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\tdouble ICCx = 0;\r\n\t\tdouble ICCy = 0;\r\n\r\n\t\tdouble W_xResult \t\t= 0;\r\n\t\tdouble W_yResult \t\t= 0;\r\n\t\tdouble W_angleResult \t= 0;\r\n\t\t\r\n\t\tdouble E_xResult \t\t= 0;\r\n\t\tdouble E_yResult \t\t= 0;\r\n\t\tdouble E_angleResult \t= 0;\r\n\t\t\r\n\t\t//short axe = 0;\r\n\t\t\r\n\t\tdouble deltaT = ((double)this.angleMeasurementLeft.getDeltaT())/1000;\r\n\t\t\r\n\t\t// Odometry calculations\r\n\t\tif (R.isNaN()) \t\t\t\t//robot don't move\r\n\t\t{\r\n\t\t\tW_xResult\t\t= this.pose.getX();\r\n\t\t\tW_yResult\t\t= this.pose.getY();\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse if (R.isInfinite()) \t//robot moves straight forward/backward, vLeft==vRight\r\n\t\t{ \r\n\t\t\tW_xResult\t\t= this.pose.getX() + vLeft * Math.cos(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_yResult\t\t= this.pose.getY() + vLeft * Math.sin(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse \r\n\t\t{\t\t\t\r\n\t\t\tICCx = this.pose.getX() - R.doubleValue() * Math.sin(this.pose.getHeading());\r\n\t\t\tICCy = this.pose.getY() + R.doubleValue() * Math.cos(this.pose.getHeading());\r\n\t\t\r\n\t\t\tW_xResult \t\t= Math.cos(w * deltaT) * (this.pose.getX()-ICCx) - Math.sin(w * deltaT) * (this.pose.getY() - ICCy) + ICCx;\r\n\t\t\tW_yResult \t\t= Math.sin(w * deltaT) * (this.pose.getX()-ICCx) + Math.cos(w * deltaT) * (this.pose.getY() - ICCy) + ICCy;\r\n\t\t\tW_angleResult \t= this.pose.getHeading() + w * deltaT;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)W_xResult, (float)W_yResult);\r\n\t\tthis.pose.setHeading((float)W_angleResult);\r\n\t\t\r\n\t\t// Conversion to grads\r\n\t\tW_angleResult = W_angleResult/Math.PI*180;\r\n\t\t\r\n\t\t// Get the heading axe\r\n\t\t//axe = getHeadingAxe();\r\n\t\tgetHeadingAxe();\r\n\t\t\r\n\t\t// Verify the coordinates and the heading angle\r\n\t\tif (Po_Corn == 1)\r\n\t\t{\r\n\t\t\tswitch (Po_CORNER_ID)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\tPo_ExpAng = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\tE_yResult = 0.11;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tE_xResult = 1.6;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.45;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tE_angleResult = W_angleResult;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint block = 0;\r\n\t\t\t// white = 0, black = 2, grey = 1\r\n\t\t\tif ((lineSensorLeft == 0) && (lineSensorRight == 0) && (block == 0)) \t// Robot moves on the black line\r\n\t\t\t{\r\n\t\t\t\tswitch (Po_CORNER_ID)\t\t\t\t\t\t\t\t// Even numbers - x, Odd numbers - y\r\n\t\t\t\t{\r\n\t\t\t\tcase 0: \r\n\t\t\t\t\tif (this.pose.getX() < 1.6)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 1: \r\n\t\t\t\t\tif (this.pose.getY() < 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tif (this.pose.getX() > 1.65)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tif (this.pose.getY() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.5; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 4: \r\n\t\t\t\t\tif (this.pose.getX() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tif (this.pose.getY() < 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 6: \r\n\t\t\t\t\tif (this.pose.getX() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tif (this.pose.getY() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 2)) || ((lineSensorLeft == 2) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_W)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_W;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_W))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_W;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 1)) || ((lineSensorLeft == 1) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_G)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_G;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_G))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_G;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tLCD.drawString(\"AngRs: \" + (E_angleResult), 0, 7);\r\n\t\t\r\n\t\t// Conversion to rads\r\n\t\tW_angleResult = W_angleResult*Math.PI/180;\r\n\t\tE_angleResult = E_angleResult*Math.PI/180;\r\n\t\t\r\n\t\tif ((Po_CORNER_ID == 3) && (100*this.pose.getY() < 45))\r\n\t\t{\r\n\t\t\tE_angleResult = 3*Math.PI/180;;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)E_xResult, (float)E_yResult);\r\n\t\tthis.pose.setHeading((float)E_angleResult);\r\n\t\t\r\n\t\t/*\r\n\t\t// Integration deviation correction\r\n\t\tthis.pose.setLocation((float)(W_xResult), (float)(W_yResult + (0.01*22.4)/175));\r\n\t\tthis.pose.setHeading((float)((W_angleResult + 14/175)*Math.PI/180));\r\n\t\t*/\r\n\t}",
"void updatePosition() {\n\t\t\n\t\tcoords.x = body.getPosition().x*Simulation.meterToPixel;\n\t\tcoords.y = body.getPosition().y*Simulation.meterToPixel;\n\t\tspeed.x = body.m_linearVelocity.x;\n\t\tspeed.y = body.m_linearVelocity.y;\n\t}",
"public void updateYLoc();",
"public void update() {\n\n difT();\n difXY();\n solveFlow();\n //drawColorFlow();\n }",
"void updatePercepts() {\n clearPercepts();\n \n Location r1Loc = model.getAgPos(0);\n //Location r2Loc = model.getAgPos(1);\n \n Literal pos1 = Literal.parseLiteral(\"pos(r1,\" + r1Loc.x + \",\" + r1Loc.y + \")\");\n // Literal pos2 = Literal.parseLiteral(\"pos(r2,\" + r2Loc.x + \",\" + r2Loc.y + \")\");\n\n addPercept(pos1);\n //addPercept(pos2);\n \n if (model.hasObject(Const.ObstacleCode, r1Loc)) {\n addPercept(Const.v1);\n }\n// if (model.hasObject(Const.ObstacleCode, r2Loc)) {\n// addPercept(Const.v2);\n// }\n }",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }",
"private void updateStationPositions() {\n //stations going east\n if(layout == Layout.square) {\n for (int i = 0; i < numStations; i++) {\n northbound.get(i).setPosition(i+1,2*numStations+1);\n eastbound.get(i).setPosition(0,numStations+(i+1));\n southbound.get(i).setPosition(numStations+1+i,0);\n westbound.get(i).setPosition(numStations*2+1,1+i);\n }\n }else{\n for (int i = 0; i < numStations; i++) {\n eastbound.get(i).setPosition(i,2*numStations+i);\n northbound.get(i).setPosition(numStations+i,3*numStations+i);\n southbound.get(i).setPosition(2*numStations+i,i);\n westbound.get(i).setPosition(3*numStations+i,numStations+i);\n }\n }\n\n }",
"@Override\n\tpublic void update()\n\t{\n\t\tsuper.update();\n\n\t\tcalcAcceleration();\n\t\tsetVelocity(Vector2D.add(getVelocity(), getAcceleration()));\n\n\t\tcalcVelocity();\n\t\tsetPosition(Vector2D.add(getPosition(), getVelocity()));\n\n\t\tbm.update(getPosition(), getWidth(), getHeight());\n\t}",
"public void updateTrifecta() {\n\n\t\taccelX = (xl.getX() - 0) * 9.8 * Math.cos(angleToForward * (Math.PI / 180.0)); //convert from g's\n\t\taccelY = (xl.getY() - 0) * 9.8 * Math.sin(angleToForward * (Math.PI / 180.0));\n\t\taccelZ = (xl.getZ() - 0) * 9.8;\n\t\t\n\t\t//velocity updated by acceleration integral\n\t\tvelX += accelX * dT;\n\t\tvelY += accelY * dT;\n\t\tvelZ += accelZ * dT;\n\t\t\n\t\t//position updated by velocity integral and adjusted for robot rotation\n\t\tposX += velX * dT;\n\t\tposY += velY * dT;\n\t\tposZ += velZ * dT;\n\t}",
"public void update(){\n\t\tx+=xspeed; \n\t\ty+=yspeed;\t\n\t}",
"public void updatePositionValue(){\n m_X.setSelectedSensorPosition(this.getFusedPosition());\n }",
"private void move() {\n acceleration.accelerate(velocity, position);\r\n }",
"synchronized void updateActivatedLandmarks () {\n calculateViewportOffset (tmpXY, visitorX, visitorY);\n\n int offsetX = tmpXY[X];\n int offsetY = tmpXY[Y];\n\n for (int i = 0; i < mapLandmarks.length; ++i) {\n if (mapLandmarks[i].isActive ()) {\n int x0 = mapLandmarks[i].getX () - 16 - offsetX;\n int y0 = mapLandmarks[i].getY () - 16 - offsetY;\n repaint (x0, y0, 32, 32);\n }\n }\n }",
"public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}",
"@Override\n public void move() {\n this.point.x += vector.x * getCurrentSpeed();\n this.point.y += vector.y * getCurrentSpeed();\n }",
"@Override\n\tpublic void updatePosition()\n\t{\n\t\tif(!fired && !pathfinding)\n\t\t{\n\t\t\tif(x == destX && y == destY)\n\t\t\t{\n\t\t\t\tfired = true;\n\t\t\t\tvehicle.msgAnimationDestinationReached();\n\t\t\t\tcurrentDirection = MovementDirection.None;\n\t\t\t\t\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\tif(cIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t{\n\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(allowedToMove || drunk)\n\t\t\t{\n\t\t\t\tswitch(currentDirection)\n\t\t\t\t{\n\t\t\t\t\tcase Right:\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Down:\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x % CityPanel.GRID_SIZE == 0 && y % CityPanel.GRID_SIZE == 0 && !moves.isEmpty())\n\t\t\t{\t\n\t\t\t\tif(allowedToMove || drunk)\n\t\t\t\t{\n\t\t\t\t\tcurrentDirection = moves.pop();\n\t\t\t\t\n\t\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\t\n\t\t\t\t\tif(current != next)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\n\t\t\t\t\tswitch(currentDirection)\n\t\t\t\t\t{\n\t\t\t\t\tcase Down:next = new Point(current.x,current.y + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:next = new Point(current.x - 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Right:next = new Point(current.x + 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:next = new Point(current.x,current.y - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:next = current;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[next.y][next.x].tryAcquire())\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(next.y).get(next.x);\n\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Pathfinder.isCrossWalk(next, city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(Gui g : guiList)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(g instanceof PassengerGui)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(nextIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextIntersection.acquireAll();\n\t\t\t\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tguiList.add(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!allowedToMove && drunk)\n\t\t{\n\t\t\tcity.addGui(new ExplosionGui(x,y));\n\t\t\tSystem.out.println(\"DESTROYING\");\n\t\t\tcity.removeGui(this);\n\t\t\tvehicle.stopThread();\n\t\t\tsetPresent(false);\n\t\t\t\n\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\n\t\t\tif(cIntersection == null)\n\t\t\t{\n\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t{\n\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t{\n\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t}\n\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void new_position( Body body, double t ){\r\n body.lastState.copyStateVectors( body.currentState );\r\n body.currentState.x = body.currentState.x + body.currentState.vx * t; // new x\r\n body.currentState.y = body.currentState.y + body.currentState.vy * t; // new y\r\n body.currentState.z = body.currentState.z + body.currentState.vz * t; // new z\r\n }",
"public void update(){\n velX *= damp;\n velY *= damp;\n posX += velX;\n posY += velY;\n }",
"public void updateController() {\n\t\tjoystickLXAxis = controller.getRawAxis(portJoystickLXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLYAxis = controller.getRawAxis(portJoystickLYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLPress = controller.getRawButton(portJoystickLPress);\t//returns a value {0,1}\n\t\t\n\t\t//right joystick update\n\t\tjoystickRXAxis = controller.getRawAxis(portJoystickRXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRYAxis = controller.getRawAxis(portJoystickRYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRPress = controller.getRawButton(portJoystickRPress);\t//returns a value {0,1}\n\t\t\n\t\t//trigger updates\n\t\ttriggerL = controller.getRawAxis(portTriggerL);\t\t//returns a value [0,1]\n\t\ttriggerR = controller.getRawAxis(portTriggerR);\t\t//returns a value [0,1]\n\t\t\n\t\t//bumper updates\n\t\tbumperL = controller.getRawButton(portBumperL);\t\t//returns a value {0,1}\n\t\tbumperR = controller.getRawButton(portBumperR);\t\t//returns a value {0,1}\n\t\t\n\t\t//button updates\n\t\tbuttonX = controller.getRawButton(portButtonX);\t\t//returns a value {0,1}\n\t\tbuttonY = controller.getRawButton(portButtonY);\t\t//returns a value {0,1}\n\t\tbuttonA = controller.getRawButton(portButtonA);\t\t//returns a value {0,1}\n\t\tbuttonB = controller.getRawButton(portButtonB);\t\t//returns a value {0,1}\n\t\t\n\t\tbuttonBack = controller.getRawButton(portButtonBack);\t//returns a value {0,1}\n\t\tbuttonStart = controller.getRawButton(portButtonStart);\t//returns a value {0,1}\n\t\t\n\t\t//toggle checks\n\t\ttankDriveBool = checkButton(buttonX, tankDriveBool, portButtonX);\t\t//toggles boolean if button is pressed\n\t\tfastBool = checkButton(buttonB, fastBool, portButtonB);\t\t\t\t\t//toggles boolean if button is pressed\n\t\t\n\t\t\n\t\t//d-pad/POV updates\n\t\tdPad = controller.getPOV(portDPad);\t\t//returns a value {-1,0,45,90,135,180,225,270,315}\n\n\t\t//d-pad/POV turns\n\t\tif (dPad != -1) {\n\t\t\tdPad = 360 - dPad; //Converts the clockwise dPad rotation into a Gyro-readable counterclockwise rotation.\n\t\t\trotateTo(dPad);\n\t\t}\n\t\t\n\t\tjoystickDeadZone();\n\t}",
"public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}",
"public void act() \n {\n setLocation(getX() + Hur_Speed, getY());\n }",
"@Override\n\tpublic void update() {\n\t\tthis.setBounds(obstacle.getCoords().getX() * 64, obstacle.getCoords().getY() * 64, 64, 64);\n\t}",
"public abstract void updateLocations();",
"@Override\r\n\t\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\tmGX = event.values[SensorManager.DATA_X];\r\n\t\t\tmGY= event.values[SensorManager.DATA_Y];\r\n\t\t\tmGZ = event.values[SensorManager.DATA_Z];\r\n\t\t\tif(mGX<-2 && me.getexploded()==false)\r\n\t\t\t{\r\n\t\t\t\tme.setdirectionY(parameter.UP);\r\n\t\t\t\tme.setv(parameter.maxspeed);\r\n\t\t\t}\r\n\t\t\telse if (mGX>2 && me.getexploded()==false) \r\n\t\t\t{\r\n\t\t\t\tme.setdirectionY(parameter.DOWN);\r\n\t\t\t\tme.setv(parameter.maxspeed);\r\n\t\t\t}\r\n\t\t\tif(mGY<-2 && me.getexploded()==false)\r\n\t\t\t{\r\n\t\t\t\tme.setdirectionX(parameter.LEFT);\r\n\t\t\t\tme.setv(parameter.maxspeed);\r\n\t\t\t}\r\n\t\t\telse if (mGY>2 && me.getexploded()==false) \r\n\t\t\t{\r\n\t\t\t\tme.setdirectionX(parameter.RIGHT);\r\n\t\t\t\tme.setv(parameter.maxspeed);\r\n\t\t\t}\t\r\n\t\t}",
"protected void execute() {\t\n \ttarget = Robot.trackingCamera.getTargetPosition();\n \t\n \tSmartDashboard.putNumber(\"targetX\", target[0]);\n \tSmartDashboard.putNumber(\"targetY\", target[1]);\n \t\n \tif(target[0] == TrackingCamera.NOTFOUND || lastDistance < 28){\n \t\tsuper.execute();\n \t\treturn;\n \t}\n \t\n \ttargetX = target[0];\n \ttargetY = target[1];\n \t\n \tsuper.execute();\n \t//System.out.println(distance);\n }",
"@Override\n public void onSensorChanged(SensorEvent event) {\n if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)\n {\n mGravity = event.values;\n\n float[] g = new float[3];\n g = event.values.clone();\n\n float norm_Of_g = (float) Math.sqrt(g[0] * g[0] + g[1] * g[1] + g[2] * g[2]);\n\n // Normalize the accelerometer vector\n g[0] = g[0] / norm_Of_g;\n g[1] = g[1] / norm_Of_g;\n g[2] = g[2] / norm_Of_g;\n\n int inclination = (int) Math.round(Math.toDegrees(Math.acos(g[2])));\n //Log.d(\"test\", Integer.toString(inclination));\n\n // lower than 70 degree display google map view\n if(inclination<65)\n {\n if(showGoogleMap==false)\n {\n\n showGoogleMap=true;\n ft = getSupportFragmentManager().beginTransaction();\n ft.hide(mBeyondarFragment);\n ft.show(mapFragment);\n ft.commit();\n myLocationButton.setVisibility(View.VISIBLE);\n }\n\n }\n else\n {\n\n if(showGoogleMap==true)\n {\n showGoogleMap=false;\n ft = getSupportFragmentManager().beginTransaction();\n ft.hide(mapFragment);\n ft.show(mBeyondarFragment);\n ft.commit();\n myLocationButton.setVisibility(View.GONE);\n }\n // display AR view\n }\n /*if (inclination<25||inclination>155)\n {\n Log.d(\"test\", \"downwards\");\n }\n else\n {\n Log.d(\"test\", \"upwards\");\n }*/\n }\n\n }",
"public void update() {\n\tif(myGlass != null && continueGlassMoving == true) \n\t\tmyGlass.moveLaterally(FactoryPart.WEST, 1);\n\tif(myGlass != null && isBreaking == true)\n\t{\n\t\tmyGlass.breakGlass();\n\t}\n if(myGlass != null && myGlass.getXCoord() /*+ myGlass.getWidth()*/ <= baseXCoord && continueGlassMoving == true)\n {\n \tisOn = false;\n \tcontinueGlassMoving = false;\n \t//getPart(FactoryPart.WEST).receiveGlass(myGlass,FactoryPart.EAST);\n \tcontroller.doneJob();\n \t\n \t\n }\n}",
"@Override\r\n\tpublic void newLocationHasBeenCalculated(final String LocationCalculated) {\n\t\tfinal TextView ts = (TextView) findViewById(R.id.virtualSpot);\r\n\t\td(\"newLocation = \" + LocationCalculated);\r\n\t\t//currVS.setText(\"LocationCalculated\");\r\n\t\trunOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n \tts.setText(LocationCalculated);\r\n \t\r\n \tcurrentVirtualSpot = mapOfVirtualSpots.get(LocationCalculated);\r\n \t\tif (location != -1 && currentVirtualSpot != null){\r\n \t\t\troute = ninethFloor.getRoute(currentVirtualSpot.getFirstPOI(), \"\"+location);\t\r\n \t\t\tdirectionDescription = route.getDirections();\r\n \t\t\tts.setText(directionDescription);\r\n \t\t}\r\n }\r\n });\r\n\t\t\r\n\t}",
"public void update() {\n\t\tfirstMove = false;\n\t\tif (color == 1) xrange = -1;\n\t\tif (color == 0) xrange = 1;\n\t}",
"public void updatePlayerLocation() {requires new property on gamestate object\n //\n }",
"@Override\n\tvoid update(){\n\n\t\t\tif(Frogger.flag==1){\n\t\t\t\tif(orientation == Orientation.UP) y -= step;\n\t\t\t\telse if (orientation == Orientation.DOWN) y += step;\n\t\t\t\telse if (orientation == Orientation.RIGHT) x += step;\n\t\t\t\telse if (orientation == Orientation.LEFT) x -= step;\n\t\t}\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t}",
"public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\r\n public void act() \r\n {\n int posx = this.getX();\r\n int posy = this.getY();\r\n //calculamos las nuevas coordenadas\r\n int nuevox = posx + incx;\r\n int nuevoy = posy + incy;\r\n \r\n //accedemos al mundo para conocer su tamaño\r\n World mundo = this.getWorld();\r\n if(nuevox > mundo.getWidth())//rebota lado derecho\r\n {\r\n incx = -incx;\r\n }\r\n if(nuevoy > mundo.getHeight())//rebota en la parte de abajo\r\n {\r\n incy = -incy;\r\n }\r\n \r\n if(nuevoy < 0)//rebota arriba\r\n {\r\n incy = -incy;\r\n }\r\n if(nuevox < 0)//rebota izquierda\r\n {\r\n incx = -incx;\r\n }\r\n //cambiamos de posicion a la pelota\r\n this.setLocation(nuevox,nuevoy);\r\n }",
"public IPlacementState getState();",
"private void changeCharacterLocations() {\n if (locationAnimationDirectionSwitch) {\n locationAnimationTicker++;\n } else {\n locationAnimationTicker--;\n }\n\n // While the user's FaceCharacter bobs up, their opponent should bob down.\n heroLocation[1] += locationAnimationTicker;\n antagonistLocation[1] -= locationAnimationTicker;\n\n if (locationAnimationTicker == 5 || locationAnimationTicker == -5) {\n locationAnimationDirectionSwitch = !locationAnimationDirectionSwitch;\n }\n }",
"@Override\n\tpublic void updatePosition() {\n\t\t\n\t}",
"void update() {\n vel.add(acc);\n vel.limit(max_vel);\n loc.add(vel);\n // Multiplying by 0 sets the all the components to 0\n acc.mult(0);\n}",
"public void updateDrive () {\n leftCurrSpeed = scale (leftCurrSpeed, leftTargetSpeed, Constants.Drivetrain.ACCELERATION_SCALING, Constants.Drivetrain.ACCELERATION_THRESHOLD);\n rightCurrSpeed = scale (rightCurrSpeed, rightTargetSpeed, Constants.Drivetrain.ACCELERATION_SCALING, Constants.Drivetrain.ACCELERATION_THRESHOLD);\n driveRaw (leftCurrSpeed, rightCurrSpeed);\n }",
"private void updateBit() {\r\n float frameTime = 10f;\r\n xVel += (xAccel * frameTime);\r\n yVel += (yAccel * frameTime);\r\n\r\n float xS = (xVel / 20) * frameTime; //PROVIDE THE ANGULE OF THE POSITION\r\n float yS = (yVel / 20) * frameTime; // WITH LESS DENOMINADOR THE BALL MOVE IS MORE DIFFICULT\r\n\r\n xPos -= xS;\r\n yPos -= yS;\r\n\r\n if (xPos > xMax) {\r\n xPos = xMax;\r\n } else if (xPos < 0) {\r\n xPos = 0;\r\n }\r\n\r\n if (yPos > yMax) {\r\n yPos = yMax;\r\n } else if (yPos < 0) {\r\n yPos = 0;\r\n }\r\n\r\n\r\n }",
"@Override\n public void onDrawFrame(GL10 gl10) {\n glClear(GL_COLOR_BUFFER_BIT);\n\n Location drawCameraLocation;\n\n //Don't draw until camera location is known\n if (mCurrentCameraLocation == null && mNewCameraLocation == null) {\n //Log.d(LOG_TAG, \"onDraw 1\");\n return;\n } else if (mCurrentCameraLocation == null && mNewCameraLocation != null) {\n //Log.d(LOG_TAG, \"onDraw 2\");\n mCurrentCameraLocation = mNewCameraLocation;\n drawCameraLocation = mCurrentCameraLocation;\n } else if (mCurrentCameraLocation != null && mNewCameraLocation != null && mTargetCameraLocation == null) {\n //Log.d(LOG_TAG, \"onDraw 3\");\n\n float distance = mNewCameraLocation.distanceTo(mCurrentCameraLocation);\n\n ///Increment step to target location when new camera location\n // is greater than 1.5 meters from current location\n if (distance > 1.5f) {\n mTargetCameraLocation = mNewCameraLocation;\n }\n\n drawCameraLocation = mCurrentCameraLocation;\n }\n\n //Provide increment location (if necessary) for smooth changes in camera positions\n else if (mCurrentCameraLocation != null && mTargetCameraLocation != null) {\n //Log.d(LOG_TAG, \"onDraw 4\");\n float cameraDistance = mCurrentCameraLocation.distanceTo(mTargetCameraLocation);\n\n\n float x = (float) mCameraStep / TOTALCAMERASTEPS;\n //float y = (float)Math.pow(x,3)*(x*(6*x-15)+10);\n //float y = (float)Math.pow(x,2)*(3-2*x); //smoothstep\n float y = x;\n\n float incDistance = y * cameraDistance;\n float bearing = mCurrentCameraLocation.bearingTo(mTargetCameraLocation);\n\n bearing = (bearing + 360) % 360;\n\n drawCameraLocation = calculateDestinationLocation(mCurrentCameraLocation, bearing, incDistance);\n drawCameraLocation.setAccuracy(mTargetCameraLocation.getAccuracy());\n\n mCameraStep++;\n\n if (mCameraStep == TOTALCAMERASTEPS) {\n //mCurrentCameraLocation = mTargetCameraLocation;\n mCurrentCameraLocation = drawCameraLocation;\n mTargetCameraLocation = null;\n mCameraStep = 0;\n }\n } else {//Never should come to this\n Log.d(LOG_TAG, \"onDraw 5\");\n\n drawCameraLocation = mCurrentCameraLocation;\n }\n\n /*\n setLookAtM(viewMatrix, 0, viewValues[0], viewValues[1], viewValues[2]\n , viewValues[3], viewValues[4], viewValues[5]\n , viewValues[6], viewValues[7], viewValues[8]);\n */\n\n multiplyMM(viewMatrix, 0, rotationMatrix, 0, modelSensorMatrix, 0);\n // Multiply the view and projection matrices together.\n multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0);\n\n\n //Process each image texture with drawCameraLocation\n for (ImageTexture it : mImageTextures) {\n\n\n if (it == null) {\n return;\n }\n\n double ItAngle;\n double distance = drawCameraLocation.distanceTo(it.mLocation);\n\n\n\n /*\n if (distance > (drawCameraLocation.getAccuracy() /0.68f))\n {\n ItAngle = (drawCameraLocation.bearingTo(it.mLocation) + 360) % 360;\n it.rotateAroundCamera((float) ItAngle );\n\n Log.d(LOG_TAG, \"onDrawFrame: distance = \" + distance + \" > \" + (drawCameraLocation.getAccuracy() /0.68f) + \", ItAngle = \" +ItAngle );\n }\n //Within accuracy radius\n else {\n distance = 4;\n }\n\n */\n\n ItAngle = (drawCameraLocation.bearingTo(it.mLocation) + 360) % 360;\n\n\n if (distance != 0 || ItAngle != 0.0f) {\n it.rotateAroundCamera((float) ItAngle);\n it.moveFromToCamera((float) -distance * 0.79f);\n }\n\n\n Log.d(LOG_TAG, \"onDrawFrame: distance = \" + distance + \" > \" + (drawCameraLocation.getAccuracy() / 0.68f) + \", ItAngle = \" + ItAngle);\n Log.d(LOG_TAG, \"onDrawFrame: drawCameraLocation = \" + drawCameraLocation.getLatitude() + \", \" + drawCameraLocation.getLongitude()\n + \" \" + it.mLocation.getLatitude() + \", \" + it.mLocation.getLongitude());\n\n\n String debugStr = \"Camera: \" + String.format(\"%5.6f\", drawCameraLocation.getLatitude()) + \", \" + String.format(\"%5.6f\", drawCameraLocation.getLongitude())\n + \"\\nAccuracy: \" + String.format(\"%5.7f\", drawCameraLocation.getAccuracy()) + \", Z: \" + String.format(\"%3.1f\", mAzimuth)\n //+ \"\\nImage: \" + String.format(\"%5.7f\",it.mLocation.getLatitude()) + \", \" + String.format(\"%5.7f\",it.mLocation.getLongitude())\n + \"\\nDistance: \" + String.format(\"%5.5f\", distance) + \", ItAngle: \" + String.format(\"%3.7f\", it.mCameraRotationAngle);\n\n\n float[] modelMatrix = it.calculateModelMatrix();\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix, 0, modelMatrix, 0);\n mTextureShaderProgram.useProgram();\n mTextureShaderProgram.setUniforms(modelViewProjectionMatrix, it.mTextureId, it.opacity);//every object sets its own mvpMatrix, texture, and alpha values\n it.bindData(mTextureShaderProgram);\n it.draw();\n }\n }",
"void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }",
"public void updateGameWorld() {\r\n\t\t//divide the user entered height by the height of the canvas to get a ratio\r\n\t\tfloat canvas_height = Window.getCanvas().getHeight();\r\n\t\tfloat new_height = EnvironmentVariables.getHeight();\r\n\t\tfloat ratio = new_height / canvas_height;\r\n\t\t\r\n\t\t//use this ration th=o set the new meter value\r\n\t\tEnvironmentVariables.setMeter(EnvironmentVariables.getMeter() * ratio);\r\n\t\t\r\n\t\t//use the ratio to set all objects new location\r\n\t\tfor(GameObject obj: EnvironmentVariables.getWorldObjects()) {\r\n\t\t\tobj.setX(obj.getX() * ratio);\r\n\t\t\tobj.setY(obj.getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t\tfor(GameObject obj: EnvironmentVariables.getTerrain()) {\r\n\t\t\tobj.setX(obj.getX() * ratio);\r\n\t\t\tobj.setY(obj.getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t\tif(EnvironmentVariables.getMainPlayer() != null) {\r\n\t\t\tEnvironmentVariables.getMainPlayer().setX(EnvironmentVariables.getMainPlayer().getX() * ratio);\r\n\t\t\tEnvironmentVariables.getMainPlayer().setY(EnvironmentVariables.getMainPlayer().getY() * ratio);\r\n\t\t}\r\n\t\t\r\n\t}",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"public void update()\n\t{\n\t\tif(currentState == moving)\n\t\t{\n\t\t\tx += xSpeed;\n\t\t\ty += ySpeed;\n\t\t\t\n\t\t\tif(x < 0 || x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\tif(y < 0 || y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\t\n\t\t\tif(x < 0)\n\t\t\t\tx = 0;\n\t\t\tif(x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\tx = world.getSIMULATION_WIDTH() - individualSize;\n\t\t\t\n\t\t\tif(y < 0)\n\t\t\t\ty = 0;\n\t\t\tif(y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\ty = world.getSIMULATION_HEIGHT() - individualSize;\n\t\t}\n\t\tfor(PlayPauseTimer timer: timerList)\n\t\t\ttimer.update();\n\t\tworld.locationUpdate(this);\n\t}",
"public void update()\n {\n // always roatating time by 7 for fixed point calculation\n x = (velocity*cos(theta) *time) >> 21;\n int yFirstPart = (int)(velocity*sin(theta)*time) >> 21;\n int ySecondPart = (int)((g*time*time) >> 15);\n y = yFirstPart - ySecondPart;\n y =initialY - y;\n x= x + initialX;\n time+= updateSpeed;\n if(lastY == -1)\n {\n lastY = y;\n }else{\n int direction = lastY - y;\n if(lastDirection == -1)\n {\n lastDirection = direction;\n }else{\n if(lastDirection != 0 && direction != 0)\n {\n \n int signOfDirection = lastDirection / Math.abs(lastDirection);\n int signOfLastDirection = direction / Math.abs(direction);\n if(signOfDirection != signOfLastDirection)\n {\n if(!reachedTop)\n {\n onTop();\n reachedTop = true;\n }\n \n setIsOnHalf(true);\n }\n }\n lastY = y;\n }\n \n }\n }",
"void gettingBackToInitial(){\n robot.setDrivetrainPosition(-hittingMineralDistance, \"translation\", 1.0);\n }",
"private void updateMovement() {\n if (_movementTask == null) {\n return;\n }\n\n if (getOwner().isDead() || _followTarget != null && _followTarget.isDead()) {\n cancelMoveTask2(true);\n return;\n }\n\n // Movement is invalid! Queue a new movement and wait again!\n if (_destinationLocation == null)\n {\n if (_waypoints.peek() != null) {\n _destinationLocation = _waypoints.poll();\n\n if (getOwner().getLocation().getGameSector() != null && getOwner().getLocation().getGameSector().hasActiveNeighbours()) {\n double validatedZ = GeoService.getInstance().validateZ(_destinationLocation.getX(), _destinationLocation.getY(), _destinationLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n if (_destinationLocation != null) {\n _destinationLocation.setZ(validatedZ);\n }\n else {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n _isSectorActive = true;\n }\n else {\n _isSectorActive = false;\n }\n notifySector(true);\n }\n else\n {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n }\n\n if (_destinationLocation != null) {\n // Update current character movement, the location.\n float deltaTime = (System.currentTimeMillis() - _movementTick) / 1000.0f;\n float movementSpeed = getOwner().getActionStorage().getMoveSpeed();\n if (getOwner().getActionStorage().getAction().getActionChartActionT().getApplySpeedBuffType().isMove()) {\n movementSpeed *= (getOwner().getGameStats().getMoveSpeedRate().getMoveSpeedRate() + 1_000_000.0f) / 1_000_000.0f;\n }\n\n Location ownerLocation = getOwner().getLocation();\n\n double movementDirectionX = _destinationLocation.getX() - ownerLocation.getX();\n double movementDirectionY = _destinationLocation.getY() - ownerLocation.getY();\n double movementDirectionZ = _destinationLocation.getZ() - ownerLocation.getZ();\n\n double directionLength = Math.sqrt(Math.pow(movementDirectionX, 2) + Math.pow(movementDirectionY, 2) + Math.pow(movementDirectionZ, 2));\n movementDirectionX /= directionLength;\n movementDirectionY /= directionLength;\n movementDirectionZ /= directionLength;\n\n ownerLocation.setXYZ(\n ownerLocation.getX() + movementDirectionX * movementSpeed * deltaTime,\n ownerLocation.getY() + movementDirectionY * movementSpeed * deltaTime,\n ownerLocation.getZ() + movementDirectionZ * movementSpeed * deltaTime\n );\n\n if (_isSectorActive && !_navigationType.isAir()) {\n double validatedZ = GeoService.getInstance().validateZ(ownerLocation.getX(), ownerLocation.getY(), ownerLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n ownerLocation.setZ(validatedZ);\n }\n\n if (ownerLocation.isValid() && World.getInstance().getWorldMap().updateLocation(getOwner(), ownerLocation.getX(), ownerLocation.getY())) {\n double distanceToPoint = MathUtils.getDistance(ownerLocation, _destinationLocation) - getOwner().getTemplate().getBodySize();\n notifyVehicleMovement();\n\n if (_followTarget != null) {\n distanceToPoint -= _followTarget.getTemplate().getBodySize();\n\n if (!MathUtils.isInRange(_destinationLocation, _followTarget.getLocation(), 150)) {\n _destinationLocation.setLocation(_followTarget.getLocation());\n notifySector(true);\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n } else {\n // Check if we are near another destination, then we will\n // switch to another waypoint instead to continue our journey.\n Location nextWaypoint = _waypoints.peek();\n if (nextWaypoint != null) {\n if (distanceToPoint < 100) {\n _destinationLocation = null;\n }\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n }\n } else {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n }\n }\n _movementTick = System.currentTimeMillis();\n }",
"@Override\r\n\t\t\tpublic void onSensorChanged(SensorEvent event)\r\n\t\t\t{\n\t\t\t\tx=event.values[0];\r\n\t\t\t\ty=event.values[1];\r\n\t\t\t\tz=event.values[2];\r\n\t\t\t\t//balle\r\n\t\t\t\tmx-=(int)x;\r\n\t\t\t\tmy+=(int)y;\r\n\t\t\t\tif (mx<40)\r\n\t\t\t\t{\r\n\t\t\t\t\tmx=40;\r\n\t\t\t\t}\r\n\t\t\t\tif (mx>1190)\r\n\t\t\t\t{\r\n\t\t\t\t\tmx=1190;\r\n\t\t\t\t}\r\n\t\t\t\tif (my<50)\r\n\t\t\t\t{\r\n\t\t\t\t\tmy=50;\r\n\t\t\t\t}\r\n\t\t\t\tif (my>700)\r\n\t\t\t\t{\r\n\t\t\t\t\tmy=700;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t\t//departBalle\r\n\t\r\n\t\t\t\tdepartBalle.setPos_x(mx);\r\n\t\t\t\tdepartBalle.setPos_y(my);\r\n\t\t\tSystem.out.println(\"\"+mx+\":\"+my);\r\n\t\t\t\t\r\n\r\n\r\n\t\t\t}",
"@Override public void onLocationChanged(Location location) {\n if (mCurrentLocation == null) {\n map.getController().animateTo(new GeoPoint(location));\n }\n\n mCurrentLocation = location;\n\n long currentTime = System.currentTimeMillis();\n\n if (networkLocationIgnorer.shouldIgnore(location.getProvider(), currentTime))\n return;\n\n double dT = currentTime - mLastTime;\n if (dT < 200.0){\n return;\n };\n\n mLastTime = currentTime;\n\n if (!currentLocationOverlay.isEnabled()){\n currentLocationOverlay.setEnabled(true);\n }\n\n currentLocationOverlay.setLocation(new GeoPoint(location));\n currentLocationOverlay.setBearing(location.getBearing());\n currentLocationOverlay.setAccuracy((int) location.getAccuracy());\n\n // Navigation mode\n if (mNavigationMode) {\n if(!mNavigationRunning) {\n // Location for the first time -> get road\n mNavigationRunning = true;\n\n ArrayList<GeoPoint> wayPoints = new ArrayList<GeoPoint>();\n // Start location\n wayPoints.add(new GeoPoint(location));\n // Destination location\n wayPoints.add(getLocationFromAddress(destinationAddress));\n\n new RoadTask().execute(wayPoints);\n }\n else if (mNextNode != null) {\n GeoPoint currentGeoPoint = new GeoPoint(mCurrentLocation);\n int distance = currentGeoPoint.distanceTo(mNextNode.mLocation);\n boolean readInstructions = false;\n\n // TODO: Test which distance is good for marking node as reached\n // TODO: Preveri kako zaznati ali je šel čez node\n // TODO: Povej navodila tik preden zavije\n if ( distance < 4 ) {\n map.getController().animateTo(new GeoPoint(location));\n\n // Node reached, increase node index\n mNodeIndex++;\n\n if (mNodeIndex >= mRoad.mNodes.size()) {\n // Last node reached - turn navigation off\n mNavigationMode = false;\n mNavigationRunning = false;\n mNextNode = null;\n mCurrentNode = null;\n mNodeIndex = 0;\n\n Button button = (Button)findViewById(R.id.current_instruction_button);\n button.setVisibility(View.GONE);\n\n Button buttonFavPaths = (Button)findViewById(R.id.favourite_paths_button);\n buttonFavPaths.setVisibility(View.VISIBLE);\n }\n else {\n // Get next node\n mCurrentNode = mNextNode;\n mNextNode = mRoad.mNodes.get(mNodeIndex);\n\n readInstructions = true;\n }\n }\n else if (distance < 6) {\n readInstructions = true;\n }\n\n // Set new instruction\n setInstruction(readInstructions);\n }\n }\n\n map.invalidate();\n }",
"public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }",
"@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }",
"public void update()\n {\n if (frames_since_update++ < UPDATE_AFTER_FRAMES)\n return;\n frames_since_update = 0;\n\n //For each vehicle in the world, determine which station is the closest.\n Actor[] actors = world.getActors();\n for (Actor actor: actors)\n {\n if (!(actor instanceof Vehicle))\n continue;\n Vehicle vehicle = (Vehicle) actor;\n\n //Iterate over each station until the closest one is found.\n Station closest_station = null;\n float closest_station_distance = Float.MAX_VALUE;\n for (Station station : stations)\n {\n if (station == null)\n continue;\n\n float new_distance = vehicle.distance(station);\n if (new_distance < closest_station_distance)\n {\n closest_station = station;\n closest_station_distance = new_distance;\n }\n }\n\n vehicle.setClosestStation(closest_station);\n }\n }",
"@Override\n protected void execute() {\n \n //get velocity from SmartDashboard\n double m_sideVelocity = SmartDashboard.getNumber(\"Side Velocity\", 0);\n double m_beltVelocity = SmartDashboard.getNumber(\"Belt velocity\", 0);\n // if velocity coefficients on SmartDashboard have changed, write new values to controller\n \n Robot.CD7.setSideMotor(m_sideVelocity);\n Robot.CD7.setBeltMotor(m_beltVelocity);\n }",
"protected void updatePointerVariables() {\n mPositionHandle = GLES20.glGetAttribLocation(mProgram, \"vPosition\");\n colorUniformHandle = GLES20.glGetUniformLocation(mProgram, \"vColor\");\n textureUniformHandle = GLES20.glGetUniformLocation(mProgram, \"s_texture\");\n textureCoordinateHandle = GLES20.glGetAttribLocation(mProgram, \"a_texCoord\");\n mMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, \"uMVPMatrix\");\n\n MyGLRenderer.checkGlError(\"updatePointerVariables\");\n }",
"public void update(){\n posX += velX;\n posY += velY;\n }",
"Rover(){\n\t\tthis.id = 0;\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.orientation = Directions.NORTH;\n\t\tthis.mapW=this.defaultMapW;\n\t\tthis.mapH=this.defaultMapH;\n\t}",
"public void updateHitbox() {\n\t\tresistorPosEnd = new Rectangle(x - 10, y - 10, 40, 40);\n\t\tresistorNegEnd = new Rectangle(x + 30, y, 40, 40);\n\t}",
"public void moveToLastAcceptableLocation(){\n\t\tthis.x=this.xTemp;\n\t\tthis.y=this.yTemp;\n\t}",
"public void update() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < columns; j++) {\n Point point = getPointAtLocation(i, j);\n WorldItem item = point.getContainedItem();\n calculatePointTemp(point);\n point.update();\n if (item instanceof FlammableItem) {\n updateIgnition(point);\n } else if (item instanceof SimulatedSensor) {\n updateAlarm(point);\n }\n }\n }\n }",
"private void calculateMovement() {\r\n \tmovementY = (int)(movementSpeed * Math.sin(Math.toRadians(movementDirection - 90)));\r\n \tmovementX = (int)(movementSpeed * Math.cos(Math.toRadians(movementDirection - 90)));\r\n }",
"public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }",
"@Override\n public void runOpMode() {\n hw = new RobotHardware(robotName, hardwareMap);\n rd = new RobotDrive(hw);\n rs=new RobotSense(hw, telemetry);\n /*rd.moveDist(RobotDrive.Direction.FORWARD, .5, .3);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, .3);\n rd.moveDist(RobotDrive.Direction.FORWARD, .5, 1);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, 1);*/\n telemetry.addData(\"Ready! \", \"Go Flamangos!\"); \n telemetry.update();\n\n //Starting the servos in the correct starting position\n /*hw.armRight.setPosition(1-.3);\n hw.armLeft.setPosition(.3);\n hw.level.setPosition(.3+.05);*/\n hw.f_servoLeft.setPosition(1);\n hw.f_servoRight.setPosition(0.5);\n \n rd.moveArm(hw.startPos());\n waitForStart();\n while (opModeIsActive()) {\n \n /*Starting close to the bridge on the building side\n Move under the bridge and push into the wall*/\n rd.moveDist(RobotDrive.Direction.LEFT,2,.5);\n rd.moveDist(RobotDrive.Direction.FORWARD, 10, .5);\n break;\n }\n }",
"public void onUpdate()\n {\n super.onUpdate();\n this.jumpMovementFactor = 0.0F;\n this.renderYawOffset = this.rotationPitch = this.rotationYaw = 0.0F;\n\n if (this.target != null && this.target instanceof EntityLiving)\n {\n EntityLiving var1 = (EntityLiving) this.target;\n\n if (var1.getHealth() <= 0 || !this.canEntityBeSeen(var1))\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n return;\n }\n } else\n {\n if (this.target != null && this.target.isDead)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n return;\n }\n\n if (this.target == null)\n {\n this.target = this.worldObj.getClosestPlayerToEntity(this, -1.0D);\n\n if (this.target == null)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n\n return;\n }\n }\n }\n\n if (this.posX == (double) this.getOrgX() && this.posY == (double) this.getOrgY() && this.posZ == (double) this.getOrgZ())\n {\n if (!this.isReformed())\n {\n this.setReformed(true);\n }\n\n this.stop();\n this.moveTimer = 0;\n }\n\n if (this.slider == null)\n {\n Vec3 var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);\n Vec3 var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n MovingObjectPosition var18 = this.worldObj.rayTraceBlocks(var16, var2);\n var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);\n var2 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);\n\n if (var18 != null)\n {\n var2 = Vec3.createVectorHelper(var18.hitVec.xCoord, var18.hitVec.yCoord, var18.hitVec.zCoord);\n }\n\n if (!this.worldObj.isRemote)\n {\n Object var4 = null;\n List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(4.0D, 4.0D, 4.0D));\n double var6 = 0.0D;\n\n for (int var8 = 0; var8 < var15.size(); ++var8)\n {\n Entity var9 = (Entity) var15.get(var8);\n\n if (var9.canBeCollidedWith() && var9 != this)\n {\n float var10 = 0.3F;\n\n if (var9 instanceof EntitySlider)\n {\n this.slider = (EntitySlider) var9;\n var18 = null;\n }\n\n AxisAlignedBB var11 = var9.boundingBox.expand((double) var10, (double) var10, (double) var10);\n MovingObjectPosition var12 = var11.calculateIntercept(var16, var2);\n\n if (var12 != null)\n {\n double var13 = var16.distanceTo(var12.hitVec);\n\n if (var13 < var6 || var6 == 0.0D)\n {\n var6 = var13;\n }\n }\n }\n }\n }\n\n if (this.slider == null || this.slider.isDead)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n }\n } else if (this.slider.target != this.target)\n {\n this.target = null;\n this.stop();\n this.moveTimer = 0;\n\n if (!this.worldObj.isRemote)\n {\n this.setDead();\n }\n } else\n {\n this.fallDistance = 0.0F;\n double var17;\n double var5;\n double var3;\n\n if (this.gotMovement)\n {\n if (this.isCollided)\n {\n var17 = this.posX - 0.5D;\n var3 = this.boundingBox.minY + 0.75D;\n var5 = this.posZ - 0.5D;\n\n if (this.crushed)\n {\n this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, \"random.explode\", 3.0F, (0.625F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);\n this.worldObj.playSoundAtEntity(this, \"aeboss.slider.collide\", 2.5F, 1.0F / (this.rand.nextFloat() * 0.2F + 0.9F));\n }\n\n this.stop();\n } else\n {\n if (this.speedy < 2.0F)\n {\n this.speedy += 0.035F;\n }\n\n this.motionX = 0.0D;\n this.motionY = 0.0D;\n this.motionZ = 0.0D;\n\n if (this.direction == 0)\n {\n this.motionY = (double) this.speedy;\n\n if (this.boundingBox.minY > (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY + 0.35D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 1)\n {\n this.motionY = (double) (-this.speedy);\n\n if (this.boundingBox.minY < (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY - 0.25D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 2)\n {\n this.motionX = (double) this.speedy;\n\n if (this.posX > (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX + 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 3)\n {\n this.motionX = (double) (-this.speedy);\n\n if (this.posX < (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX - 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 4)\n {\n this.motionZ = (double) this.speedy;\n\n if (this.posZ > (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ + 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n } else if (this.direction == 5)\n {\n this.motionZ = (double) (-this.speedy);\n\n if (this.posZ < (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ - 0.125D))\n {\n this.stop();\n this.moveTimer = 8;\n }\n }\n }\n } else\n {\n this.motionY = 0.0D;\n\n if (this.moveTimer > 0)\n {\n --this.moveTimer;\n this.motionX = 0.0D;\n this.motionY = 0.0D;\n this.motionZ = 0.0D;\n } else\n {\n var17 = Math.abs(this.posX - (this.reform ? (double) this.getOrgX() : this.target.posX));\n var3 = Math.abs(this.boundingBox.minY - (this.reform ? (double) this.getOrgY() : this.target.boundingBox.minY));\n var5 = Math.abs(this.posZ - (this.reform ? (double) this.getOrgZ() : this.target.posZ));\n\n if (var17 > var5)\n {\n this.direction = 2;\n\n if (this.posX > (this.reform ? (double) this.getOrgX() - 1.0D : this.target.posX))\n {\n this.direction = 3;\n }\n } else\n {\n this.direction = 4;\n\n if (this.posZ > (this.reform ? (double) this.getOrgZ() - 1.0D : this.target.posZ))\n {\n this.direction = 5;\n }\n }\n\n if (var3 > var17 && var3 > var5 || var3 > 0.25D && this.rand.nextInt(5) == 0)\n {\n this.direction = 0;\n\n if (this.posY > (this.reform ? (double) this.getOrgY() : this.target.posY))\n {\n this.direction = 1;\n }\n }\n\n this.gotMovement = true;\n }\n }\n\n if (this.harvey > 0.01F)\n {\n this.harvey *= 0.8F;\n }\n }\n }",
"public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }",
"@Override\n public void runOpMode() {\n frontLeftWheel = hardwareMap.dcMotor.get(\"frontLeft\");\n backRightWheel = hardwareMap.dcMotor.get(\"backRight\");\n frontRightWheel = hardwareMap.dcMotor.get(\"frontRight\");\n backLeftWheel = hardwareMap.dcMotor.get(\"backLeft\");\n\n //telemetry sends data to robot controller\n telemetry.addData(\"Output\", \"hardwareMapped\");\n\n // The TFObjectDetector uses the camera frames from the VuforiaLocalizer, so we create that\n // first.\n initVuforia();\n\n if (ClassFactory.getInstance().canCreateTFObjectDetector()) {\n initTfod();\n } else {\n telemetry.addData(\"Sorry!\", \"This device is not compatible with TFOD\");\n }\n\n /**\n * Activate TensorFlow Object Detection before we wait for the start command.\n * Do it here so that the Camera Stream window will have the TensorFlow annotations visible.\n **/\n if (tfod != null) {\n tfod.activate();\n }\n\n /** Wait for the game to begin */\n telemetry.addData(\">\", \"Press Play to start op mode\");\n telemetry.update();\n waitForStart();\n\n if (opModeIsActive()) {\n while (opModeIsActive()) {\n if (tfod != null) {\n // getUpdatedRecognitions() will return null if no new information is available since\n // the last time that call was made\n List<Recognition> updatedRecognitions = tfod.getUpdatedRecognitions();\n if(updatedRecognitions == null) {\n frontLeftWheel.setPower(0);\n frontRightWheel.setPower(0);\n backLeftWheel.setPower(0);\n backRightWheel.setPower(0);\n } else if (updatedRecognitions != null) {\n telemetry.addData(\"# Object Detected\", updatedRecognitions.size());\n // step through the list of recognitions and display boundary info.\n int i = 0;\n\n\n for (Recognition recognition : updatedRecognitions) {\n float imageHeight = recognition.getImageHeight();\n float blockHeight = recognition.getHeight();\n\n //-----------------------\n// stoneCX = (recognition.getRight() + recognition.getLeft())/2;//get center X of stone\n// screenCX = recognition.getImageWidth()/2; // get center X of the Image\n// telemetry.addData(\"screenCX\", screenCX);\n// telemetry.addData(\"stoneCX\", stoneCX);\n// telemetry.addData(\"width\", recognition.getImageWidth());\n //------------------------\n\n telemetry.addData(\"blockHeight\", blockHeight);\n telemetry.addData(\"imageHeight\", imageHeight);\n telemetry.addData(String.format(\"label (%d)\", i), recognition.getLabel());\n telemetry.addData(String.format(\" left,top (%d)\", i), \"%.03f , %.03f\", recognition.getLeft(), recognition.getTop());\n telemetry.addData(String.format(\" right,bottom (%d)\", i), \"%.03f , %.03f\", recognition.getRight(), recognition.getBottom());\n\n\n if(hasStrafed == false) {\n float midpoint = (recognition.getLeft() + recognition.getRight()) /2;\n float multiplier ;\n if(midpoint > 500) {\n multiplier = -(((int)midpoint - 500) / 100) - 1;\n log = \"Adjusting Right\";\n sleep(200);\n } else if(midpoint < 300) {\n multiplier = 1 + ((500 - midpoint) / 100);\n log = \"Adjusting Left\";\n sleep(200);\n } else {\n multiplier = 0;\n log = \"In acceptable range\";\n hasStrafed = true;\n }\n frontLeftWheel.setPower(-0.1 * multiplier);\n backLeftWheel.setPower(0.1 * multiplier);\n frontRightWheel.setPower(-0.1 * multiplier);\n backRightWheel.setPower(0.1 * multiplier);\n } else {\n if( blockHeight/ imageHeight < .5) {\n frontLeftWheel.setPower(-.3);\n backLeftWheel.setPower(.3);\n frontRightWheel.setPower(.3);\n backRightWheel.setPower(-.3);\n telemetry.addData(\"detecting stuff\", true);\n } else {\n frontLeftWheel.setPower(0);\n backLeftWheel.setPower(0);\n frontRightWheel.setPower(0);\n backRightWheel.setPower(0);\n telemetry.addData(\"detecting stuff\", false);\n }\n }\n\n telemetry.addData(\"Angle to unit\", recognition.estimateAngleToObject(AngleUnit.DEGREES));\n telemetry.addData(\"Log\", log);\n\n }\n telemetry.update();\n }\n\n }\n }\n }\n if (tfod != null) {\n tfod.shutdown();\n }\n }",
"public void move()\n {\n universe.erase(this);\n \n // compute new position\n \n yPosition += ySpeed;\n xPosition += xSpeed;\n\n // check if it has hit the ground\n if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {\n yPosition = groundPosition - diameter;\n ySpeed = -ySpeed; \n }\n // check if top\n if(yPosition <= 0 && ySpeed < 0){\n ySpeed = -ySpeed; \n }\n //check right\n if(xPosition >= (universe.getLength() - diameter) && xSpeed >0){\n xSpeed = -xSpeed;\n }\n //check left\n if(xPosition <= 0 && xSpeed < 0){\n xSpeed = -xSpeed;\n }\n \n // draw again at new position\n universe.draw(this);\n }",
"void update(){\n if(!data.up.isEmpty() && data.isMoving==false){\r\n if(data.floor<data.up.get(0))\r\n data.state = 1;\r\n else if(data.floor>data.up.get(0))\r\n data.state = -1;\r\n }\r\n else if(!data.down.isEmpty() && data.isMoving==false){\r\n if(data.floor<data.down.get(0))\r\n data.state = 1;\r\n else if(data.floor>data.down.get(0))\r\n data.state = -1;\r\n\r\n } \r\n else if(data.isMoving == false)\r\n data.state = 0;\r\n }",
"public static void updatePosition() {\n\t\tfor (int i = 0; i < TitanV4.planets.length; i++) { //compute forces between all celestial corpses\n\t\t\tfor(int j=i; j<TitanV4.planets.length; j++){\n\t\t\t\tif (i != j) {\n\t\t\t\t\tdouble upper = TitanV4.G*TitanV4.planets[i].getMass() * TitanV4.planets[j].getMass();\n\t\t\t\t\tdouble lower = TitanV4.planets[i].getPosition().distanceFrom(TitanV4.planets[j].getPosition());\n\t\t\t\t\tdouble gravitation = upper/lower;\n\t\t\t\t\tVector a = new Vector();\n\t\t\t\t\ta = TitanV4.planets[i].getPosition().substract(TitanV4.planets[j].getPosition()).normalize().multiply(-1);\n\n\t\t\t\t\tTitanV4.planets[i].force.add(a.multiply(gravitation));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//compute acceleration vector for each celestial corpse but the sun\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tTitanV4.planets[i].acceleration = (TitanV4.planets[i].force.divide(TitanV4.planets[i].getMass()));\n\t\t}\n\n\t\t//calculate change in speed over deltaT\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tVector oldVelocity = new Vector(TitanV4.planets[i].velocity);\n\t\t\tTitanV4.planets[i].velocity.add((TitanV4.planets[i].acceleration.multiply(TitanV4.deltaT)));\n\n\t\t\tVector posChange = new Vector();\n\t\t\tposChange = (oldVelocity.add(velocity).divide(2)).multiply(TitanV4.deltaT);\n\t\t\tTitanV4.planets[i].pos.add(posChange);\n\t\t}\n\t}",
"@Override\n public void move() {\n _location.x++;\n }",
"public int getStateOfMovement(){ return stateOfMovement; }"
]
| [
"0.6479857",
"0.64787966",
"0.6423041",
"0.63848376",
"0.6317476",
"0.63173026",
"0.6312558",
"0.6231593",
"0.6180656",
"0.61330396",
"0.60823953",
"0.6041329",
"0.5966331",
"0.59557253",
"0.59314054",
"0.59287316",
"0.5925427",
"0.59143794",
"0.59133625",
"0.590001",
"0.5890751",
"0.58745056",
"0.5874371",
"0.586842",
"0.58658934",
"0.585271",
"0.58284193",
"0.57988393",
"0.5793456",
"0.57919157",
"0.5773132",
"0.57622933",
"0.5759637",
"0.57426333",
"0.5723081",
"0.5715518",
"0.5694452",
"0.5693674",
"0.5690144",
"0.5686472",
"0.56841123",
"0.5637806",
"0.5633544",
"0.5632496",
"0.5621785",
"0.56215405",
"0.56213754",
"0.562124",
"0.5617367",
"0.5617293",
"0.5614967",
"0.56114787",
"0.5589837",
"0.5581022",
"0.55777425",
"0.5569513",
"0.5557045",
"0.5551527",
"0.5550473",
"0.5542886",
"0.55386317",
"0.55348176",
"0.55333203",
"0.55309117",
"0.55061877",
"0.5496701",
"0.54928267",
"0.5491379",
"0.54828495",
"0.5479526",
"0.5470027",
"0.54661167",
"0.5449931",
"0.5449691",
"0.5445298",
"0.5441821",
"0.54414386",
"0.54381406",
"0.5437844",
"0.54350156",
"0.5432686",
"0.54291385",
"0.54290235",
"0.542713",
"0.5415886",
"0.5415433",
"0.5409355",
"0.5407019",
"0.5401631",
"0.5400492",
"0.5395493",
"0.53951925",
"0.5385879",
"0.5380205",
"0.5373051",
"0.536954",
"0.5368295",
"0.53677243",
"0.5366948",
"0.5362982"
]
| 0.6566144 | 0 |
MESSAGES This is received whenever the simulation displayed by this view has started running | public void simulationStarted() {
// Stop following the mouse while the simulation is running
removeMouseListener(mouseFollower);
// Ensure display is up-to-date
repaint();
// Send repaint messages at regular intervals using the autoUpdater Timer object
autoUpdater.restart();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void run() {\n System.out.println(\"PC Visual application run\");\n data = new Data(this);\n window = new Window(this);\n window.setup();\n mote = new MoteIF(PrintStreamMessenger.err);\n mote.registerListener(new OscilloscopeMsg(), this);\n }",
"@Override\n\tpublic void onSimulationComplete()\n\t{\n\t}",
"public void action() {\n MessageTemplate template = MessageTemplate.MatchPerformative(CommunicationHelper.GUI_MESSAGE);\n ACLMessage msg = myAgent.receive(template);\n\n if (msg != null) {\n\n /*-------- DISPLAYING MESSAGE -------*/\n try {\n\n String message = (String) msg.getContentObject();\n\n // TODO temporary\n if (message.equals(\"DistributorAgent - NEXT_SIMSTEP\")) {\n \tguiAgent.nextAutoSimStep();\n // wykorzystywane do sim GOD\n // startuje timer, zeby ten zrobil nextSimstep i statystyki\n // zaraz potem timer trzeba zatrzymac\n }\n\n guiAgent.displayMessage(message);\n\n } catch (UnreadableException e) {\n logger.error(this.guiAgent.getLocalName() + \" - UnreadableException \" + e.getMessage());\n }\n } else {\n\n block();\n }\n }",
"protected void messageList() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tmessageStore.print();\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}",
"public void start(){\n this.speakerMessageScreen.printScreenName();\n mainPart();\n }",
"private void initView() {\n TIMManager.getInstance().addMessageListener(this);\n initAdapter();\n initRefresh();\n }",
"void onStarted();",
"void msgViewableChanged() {\n resetViewport(start);\n }",
"protected abstract void displayStartMsg();",
"public void run() {\n String lg_ti = \"Test.\";\n String des_ti = \"The license valid until \";\n String ban_ti = \"Warning!\";\n getNotificationData();\n //notificationShow(des_ti,lg_ti,ban_ti);\n }",
"@Override protected void startup() {\n show(new MIDLetParamsView(this));\n }",
"@Override\n\tpublic void run() {\n\t\tregisterTab(\"chat\");\n\t\tregisterListener(\"COMMAND\");\n\t}",
"@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tSystem.out.println(\"onStart\");\n\t\t\t\tif(listener!=null) listener.onMessage(\"onStart\");\n\t\t\t\tisRun = true;\n\t\t\t}",
"public View runStartUp() {\r\n Controller contr = new Controller();\r\n contr.addObserver(InspectionStatsView.getObserver());\r\n Logger firstLogger = new FileLogger();\r\n return new View(contr, firstLogger);\r\n }",
"public void run() {\n //Moved Observers NOV 15\n if (messagingSystem.speakerMessengerController != null) {\n this.addObserver(messagingSystem.speakerMessengerController); //would be created\n }\n if (messagingSystem.speakerMessengerController != null) {\n this.addObserver(messagingSystem.speakerMessengerController.userInfo);\n }\n CSVReader fileReader = new CSVReader(\"phase1/src/Resources/Talks.csv\");\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n for(ArrayList<String> talkData: fileReader.getData()){\n this.talkManager.createTalk(talkData.get(0), talkData.get(1), talkData.get(2),\n talkData.get(3), LocalDateTime.parse(talkData.get(4), formatter));\n }\n setTalkManager();\n messagingSystem.run();\n scheduleSystem.run();\n createSignUpAttendees();\n if (this.user instanceof Attendee) {\n userScheduleController.setSignUpMap(signUpMap);\n }\n if (this.user instanceof Organizer) {\n orgScheduleController.setSignUpMap(signUpMap);\n }\n }",
"void sendStartMessage();",
"void sendStartMessage();",
"public void run() {\n SimpleChatUI firstWin = new SimpleChatUI();\n windows.add(firstWin);\n firstWin.setVisible(true);\n hub = new HubSession(new LoginCredentials(new ChatKeyManager(CHAT_USER)));\n\n firstWin.setStatus(\"No active chat\");\n }",
"public void start()\n\t{\n\t\tview.showWindow();\n\t\taddListeners();\n\t}",
"public void handleSimStatusCompleted() {\n }",
"public void startSimulation() {\r\n \t\tif(animationHolder != null ) {\r\n \t\t\tanimationHolder.stop();\r\n \t\t}\r\n \t\t// if simulation is not in pause state\r\n \t\tif (!stopSimulation.isEnabled()) {\r\n \t\t\t// Asks for confirmation before overwriting previous simulation data\r\n \t\t\tif (model.containsSimulationResults()) {\r\n \t\t\t\t// Find frame to show confirm dialog\r\n \t\t\t\tComponent parent = mainWindow;\r\n \t\t\t\tif (resultsWindow != null && resultsWindow.isFocused()) {\r\n \t\t\t\t\tparent = resultsWindow;\r\n \t\t\t\t}\r\n \r\n\t\t\t\tint resultValue = JOptionPane.showConfirmDialog(parent, \"This operation will overwrite old simulation results. Continue anyway?\",\r\n \t\t\t\t\t\t\"JMT - Warning\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n \t\t\t\tif (resultValue == JOptionPane.NO_OPTION) {\r\n \t\t\t\t\treturn;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t// Asks for confirmation if a logger-file exists (and has existing data) [MF08 0.7.4 (Marco Bertoli)]\r\n \t\t\tString[] ln = model.getLoggerNameList();\r\n \t\t\tString ln2 = \"\";\r\n \t\t\tif (ln != null) {\r\n \t\t\t\tif (model.getLoggingGlbParameter(\"autoAppend\")\r\n \t\t\t\t\t\t.equalsIgnoreCase(new Integer(jmt.engine.log.LoggerParameters.LOGGER_AR_ASK).toString())) {\r\n \t\t\t\t\tif (ln.length > 0) {\r\n \t\t\t\t\t\t// Cache the absolute log-path\r\n \t\t\t\t\t\tString logabspath;\r\n \t\t\t\t\t\tif (model.getLoggingGlbParameter(\"path\").equalsIgnoreCase(\"\") || (model.getLoggingGlbParameter(\"path\").equalsIgnoreCase(\".\"))) {\r\n \t\t\t\t\t\t\tlogabspath = new File(\"\").getAbsolutePath() + File.separator;\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tlogabspath = new File(model.getLoggingGlbParameter(\"path\")).getAbsolutePath() + File.separator;\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t// Find if the logfiles have data in them:\r\n \t\t\t\t\t\ttry {\r\n \t\t\t\t\t\t\t//Code to remove duplicate file names from the list to obtain a unique list of File names.\r\n \t\t\t\t\t\t\tArrays.sort(ln);\r\n \t\t\t\t\t\t\tint k = 0;\r\n \t\t\t\t\t\t\tfor (int i = 0; i < ln.length; i++){\r\n \t\t\t\t\t\t\t\tif (i > 0 && ln[i].equals(ln[i -1])){\r\n \t\t\t\t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tln[k++] = ln[i];\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tString[] unique = new String[k];\r\n \t\t\t\t\t\t\tSystem.arraycopy(ln, 0, unique, 0, k);\r\n \r\n \t\t\t\t\t\t\tfor (String element : unique) {\r\n \t\t\t\t\t\t\t\t// if the files have data, print what will be overwritten\r\n \t\t\t\t\t\t\t\tif (new File(logabspath + element).length() > 0) {\r\n \t\t\t\t\t\t\t\t\t\tln2 = ln2 + element + \", \";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t// remove the trailing comma\r\n \t\t\t\t\t\t\tif (ln2 != \"\") {\r\n \t\t\t\t\t\t\t\tln2 = ln2.substring(0, ln2.length() - 2);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\t\te.printStackTrace();\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\tif (ln2 != \"\") {\r\n \t\t\t\t\t\t\t// Find frame to show dialog\r\n \t\t\t\t\t\t\tComponent parent = mainWindow;\r\n \t\t\t\t\t\t\tif (resultsWindow != null && resultsWindow.isFocused()) {\r\n \t\t\t\t\t\t\t\tparent = resultsWindow;\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t\tint resultValue = JOptionPane.showConfirmDialog(parent, \"This operation will modify the following logfile(s): \" + ln2\r\n \t\t\t\t\t\t\t\t\t+ \". \" + \"Continue anyway?\", \"JMT - Warning\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n \t\t\t\t\t\t\tif (resultValue == JOptionPane.NO_OPTION) {\r\n \t\t\t\t\t\t\t\treturn;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\t//System.out.println(\"Empty file\");\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t} // end confirmation if file exists\r\n \t\t\t// Correct eventual problems on preloading for closed classes\r\n \t\t\tmodel.manageJobs();\r\n \t\t\tmc = new ModelChecker(model, model, model, model, false);\r\n \t\t\tpw = new JModelProblemsWindow(mainWindow, mc, this);\r\n \t\t\tif (!mc.isEverythingOkNormal()) {\r\n \t\t\t\tpw.show();\r\n \t\t\t}\r\n \t\t\tif (mc.isEverythingOkNormal() || ((!mc.isEverythingOkNormal()) && (pw.continued()))) {\r\n \t\t\t\tif (!model.isParametricAnalysisEnabled()) {\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\t// Removes previous ResultsWindow\r\n \t\t\t\t\t\tif (resultsWindow != null) {\r\n \t\t\t\t\t\t\tresultsWindow.dispose();\r\n \t\t\t\t\t\t\tshowResults.setEnabled(false);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tFile temp = File.createTempFile(\"~JModelSimulation\", \".xml\");\r\n \t\t\t\t\t\ttemp.deleteOnExit();\r\n \t\t\t\t\t\tXMLWriter.writeXML(temp, model);\r\n \t\t\t\t\t\t// Creates results data structure\r\n \t\t\t\t\t\tmodel.setSimulationResults(new ResultsModel(model.getPollingInterval()));\r\n \t\t\t\t\t\tshowResults.setEnabled(true);\r\n \t\t\t\t\t\tdispatcher = new DispatcherThread(this, model, (ResultsModel) model.getSimulationResults());\r\n \t\t\t\t\t\tdispatcher.startSimulation(temp);\r\n \t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\thandleException(e);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\t// Removes previous ResultsWindow\r\n \t\t\t\t\tshowResults.setEnabled(false);\r\n \t\t\t\t\tif (resultsWindow != null) {\r\n \t\t\t\t\t\tresultsWindow.dispose();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (progressWindow == null) {\r\n \t\t\t\t\t\tprogressWindow = new PAProgressWindow(mainWindow, simulate, pauseSimulation, stopSimulation, model\r\n \t\t\t\t\t\t\t\t.getParametricAnalysisModel());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tbatchThread = new PADispatcherThread(this, model, progressWindow);\r\n \t\t\t\t\tchangeSimActionsState(false, true, true);\r\n \t\t\t\t\tprogressWindow.initialize(model.getParametricAnalysisModel().getNumberOfSteps());\r\n \t\t\t\t\tprogressWindow.start();\r\n \t\t\t\t\tprogressWindow.show();\r\n \t\t\t\t\tbatchThread.start();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tif (!model.isParametricAnalysisEnabled()) {\r\n \t\t\t\tdispatcher.restartSimulation();\r\n \t\t\t} else {\r\n \t\t\t\tbatchThread.restartSimulation();\r\n \t\t\t}\r\n \t\t}\r\n \t}",
"public void onStartRunning();",
"@Override\n public void userRequestedAction()\n {\n inComm = true;\n view.disableAction();\n\n // switch to loading ui\n view.setActionText(\"Loading...\");\n view.setStatusText(loadingMessages[rand.nextInt(loadingMessages.length)]);\n view.setStatusColor(COLOR_WAITING);\n view.loadingAnimation();\n\n // switch the status of the system\n if (isArmed) disarmSystem();\n else armSystem();\n isArmed = !isArmed;\n\n // notify PubNub\n }",
"public void run()\r\n\t\t{\n\t\t\ttheVMKClient.sendMessageToServer(m);\r\n\t\t}",
"public void simulationStarted( SimulationEvent evt )\r\n {\r\n assert sim == evt.getSimulator();\r\n \r\n simTimeSinceUpdate = 0;\r\n repaint();\r\n }",
"public void startSimulation();",
"@Override\n\tvoid showMsg() {\n\t\tSystem.out.println(\"Sample\");\n\t}",
"protected void logToScreen() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tdisplayInfo = !displayInfo;\r\n\t\t\t\tint procCount = processors.count();\r\n\t\t\t\tSimulatorPDUProcessor proc;\r\n\t\t\t\tfor (int i = 0; i < procCount; i++) {\r\n\t\t\t\t\tproc = (SimulatorPDUProcessor) processors.get(i);\r\n\t\t\t\t\tproc.setDisplayInfo(displayInfo);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfactory.setDisplayInfo(displayInfo);\r\n\t\t}\r\n\t}",
"void onSuccessfulStarted();",
"public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tif (LoginActivity.netManager.getViewState(str, true) != null) {\n\t\t\t\t\tStateView = LoginActivity.netManager.getViewState(str, true);\n\t\t\t\t\tmsg.what = STATEVIEW_SUCCESS;\n\t\t\t\t} else\n\t\t\t\t\tmsg.what = STATEVIEW_FALSE;\n\t\t\t\thandler1.sendMessage(msg);\n\t\t\t}",
"@Override\r\n public void run() {\n addUIMessage(new byte[]{Message.UI_MESSAGE, Message.PRIVATE_CALL_RINGING});\r\n }",
"public void start() {\r\n view.addListener(this);\r\n view.makeVisible();\r\n view.display();\r\n }",
"@Override\r\n\tpublic void processArrival(SimulationData simData, RunDataClient client) {\r\n\t}",
"@Override\n\t\tpublic void start(Bundle msgData) {\n\n\t\t}",
"public abstract void displayMsgBeforeRun();",
"public void start() {\n System.out.println(\"This vehicle starts\");\n }",
"public void run() {\n\t\t\t\tui = new GUI();\n\t\t\t\tui.generateUI();\n\t\t\t\tui.showUI(true);\n\n\t\t\t\t// Start sim ticking - sim is initialized below *before* this is called\n\t\t\t\tsim.newSim();\n\t\t\t\tsim.start();\n\t\t\t}",
"public void run() {\n\t\t\t\t\tif (_uiContainer.isDisposed()) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsetStatusMessage(UI.EMPTY_STRING);\r\n\t\t\t\t}",
"@Override\n\tprotected void start() {\n\t\tif (Cfg.DEBUG) {\n\t\t\tCheck.log(TAG + \" (actualStart)\");\n\t\t}\n\t\treadChatMessages();\n\t}",
"@Override\n public void onMessageReceived(MessageEvent messageEvent) {\n String path=messageEvent.getPath();\n Toast.makeText(this,\"Mensaje Recibido\",Toast.LENGTH_SHORT).show();\n this.controller.ControlKIT(path);\n\n }",
"public void startTest(){\n\t\t\tMainUIHandler.sendEmptyMessage(UI_START_TEST);\t\n\t\t}",
"public void handleStart()\n {\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }",
"public void run() {\n startSignalR();\n }",
"public void onMissionStart() {\n\n }",
"public void mo15789a() {\n if (mo15791c()) {\n C1557c.m7458a(f11337e, \"Publishing new messaging session event.\");\n this.f11340c.mo15485a(C4485k.f11123a, C4485k.class);\n this.f11341d = true;\n return;\n }\n C1557c.m7458a(f11337e, \"Messaging session not started.\");\n }",
"public static void displayMsg() {\n\t\tSystem.out.println(\"Welcome Visit Count \"+count++);\n\t}",
"@Override\n public void updateView(Message msg)\n {\n \n }",
"public SimulationView() {\n initComponents();\n }",
"@Override\r\n public void simulationStarted() {\n if (this.running == true) {\r\n this.stopSound();\r\n }\r\n\r\n // start the sound module thread\r\n this.soundThread.start();\r\n\r\n // stop the background sound if it is playing\r\n this.playBackgroundSound(false);\r\n\r\n // the simulation is now running\r\n this.runSimulationState = true;\r\n }",
"public void start() {\r\n if (ticks != 0) {\r\n if (uiCreator.isPresent()) {\r\n uiCreator.get().createUI(simulator);\r\n } else {\r\n simulator.start();\r\n }\r\n }\r\n }",
"@Override\n public void simulationPeriodic() {\n }",
"public void OnRun()\r\n {\r\n try\r\n {\r\n Init();\r\n }\r\n catch(Exception ex)\r\n {\r\n eventLogger.error(ex);\r\n }\r\n \r\n try\r\n {\r\n this.types = this.config.getTypes();\r\n \r\n// this.checkList = dao.CheckLastRun();\r\n \r\n// if (checkList.size()>0)\r\n// {\r\n// Vector<Integer> checkListLastRun = checkList;\r\n// \r\n// checkList = new Vector<Integer>();\r\n// \r\n// CollectInvitees(true);\r\n// CollectInvitees(false);\r\n// \r\n// // lasttime missing some mails\r\n// RemoveSearched(checkListLastRun);\r\n// }\r\n// else\r\n// {\r\n dao.CleanChecklist();\r\n \r\n CollectInvitees(true);\r\n CollectInvitees(false);\r\n \r\n for(Integer id : this.checkList)\r\n {\r\n dao.BuildChecklist(id);\r\n }\r\n// }\r\n \r\n SendEmails();\r\n }\r\n catch(Exception ex)\r\n {\r\n eventLogger.warn(ex);\r\n }\r\n }",
"protected void serverStarted()\n {\n // System.out.println\n // (\"Server listening for connections on port \" + getPort());\n }",
"public void runModel(){\n\t\tcurrentView.getDynamicModelView().getModel().setProgressMonitor(progressMonitor);\r\n\t\tnew Thread(currentView.getDynamicModelView().getModel()).start();\r\n\r\n\t\tsetStatusBarText(\"Ready\");\r\n\t}",
"@Override\n \t\t\tpublic void run() {\n \t\t\t\tMessage msg = new Message();\n \t\t\t\tmsg.what = 0;\n \t\t\t\t\n \t\t\t\t// Retrieve the seeds list\n \t\t\t\tmsg.obj = getList();\n \t\t\t\thandler.sendMessage(msg);\n \t\t\t}",
"@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }",
"public ControlView (SimulationController sc){\n myProperties = ResourceBundle.getBundle(\"english\");\n myStartBoolean = false;\n mySimulationController = sc;\n myRoot = new HBox();\n myPropertiesList = sc.getMyPropertiesList();\n setView();\n\n }",
"private void broadcast() {\n for (int key : bootstrapMap.keySet()) {\n bootstrapMap.get(key).getBroadcastView().show(Colors.BLUE + gameService.getCurrentPlayer().getName() + Colors.NOCOLOR, lastAnswer);\n }\n gameService.upDateCurrentPlayer();\n }",
"@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }",
"@Override\r\n\tpublic void tellStarting() {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t\t// Not used here\r\n\t}",
"private void timerEngine(){\n SensorController me = this;\n //generate new value or send existing to server\n if(isValueGeneratorRunning()){\n logger.trace(\"Generating new sensor value\");\n //create new values\n try{\n getModel().getValues().stream()\n .filter(Value::isGenerateValue) //if new value should be generated\n .forEach(v -> {\n Object next = v.nextValue();\n if (next != null) {\n Platform.runLater(() -> v.setValue(next));\n }\n }); //do it\n }catch (IllegalArgumentException e){\n adapterController.sendError(toString() + \" -> cannot generate new value!\",e,false);\n }\n logger.trace(\"Building sensor message\");\n //create XML message with new values\n XMLmessage = adapterController.getAdapter().getProtocol()\n .buildSensorMessage(adapterController.getAdapter().getProtocol().buildAdapterMessage(adapterController.getAdapter()), getModel());\n //change engine to send message mod\n setRunValueGenerator(false);\n }else if(getModel().getStatus()){\n //if sensor's message doesn't exist, error is showed\n if(XMLmessage == null){\n adapterController.sendError(toString() + \" doesn't have XML message to send\",null,false);\n return;\n }\n //if we have means to send message and adapter is registered, send message to adapter\n if(adapterController.getServerReceiver() != null || adapterController.getAdapter().getRegistered()){\n //full message contains information about adapter\n if(isFullMessage()){\n //used in \"Performance simulation\"\n adapterController.sendMessage(me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }else{\n //short message contains information only about sensor\n //used in \"Detailed simulation\"\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" trying to send message.\");\n adapterController.sendMessage(\"Sensor \" + me.toString() + \" --> data sent\",XMLmessage,me, OutMessage.Type.SENSOR_MESSAGE);\n }\n //change engine to generate value mod\n setRunValueGenerator(true);\n }\n }\n }",
"public void display() {\n\t\ttry{\n\t\t\tload();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"error\");\n\t\t}\n\t\tfor (ModelObserver mo : controllers){\n\t\t\tmo.init();\n\t\t}\n\t}",
"public synchronized void run() {\r\n\t\tsetName(\"I02 - Load messages\");\r\n\t\tboolean run = true;\r\n\t\twhile (run) {\r\n\t\t\tif (tablaMensajes.isDisposed() || vista.getEmpleadoActual().getEmplId()==0) run = false;\r\n\t\t\telse {\r\n\t\t\t\tif (!tabFolder.isDisposed()) {\r\n\t\t\t\t\t// Cargar remitentes\r\n\t\t\t\t\tremitentes = new ArrayList<String>();\r\n\t\t\t\t\t// Añadir nombre remitentes a lista remitentes\r\n\t\t\t\t\tfor (int i = 0; i < vista.getTodosMensajesEntrantes().size(); i++) {\r\n\t\t\t\t\t\tremitentes.add(vista.getEmpleado(vista.getTodosMensajesEntrantes().get(i).getRemitente()).getNombreCompleto());\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Actualizar tabla\r\n\t\t\t\t\tif (!tabFolder.isDisposed()) {\r\n\t\t\t\t\t\ttabFolder.getDisplay().asyncExec(new Runnable () {\r\n\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\tmostrarMensajes();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// TODO Espera 5 segundos (¿Como lo dejamos?)\r\n\t\t\t\t\twait(5000);\r\n\t\t\t\t\t//desplazarVentanaMensajes(0);\r\n\t\t\t\t\t//vista.loadTodosMensajes();\r\n\t\t\t\t\tnotify();\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void emitChangeView() {\n \n int view = getCurrentViewNumber();\n Object lpid = getLocalServerID();\n \n JDSUtility.debug(\"[emitChangeView()] s\" + lpid + \", at time \" + getClockValue() + \", is going to emit a change view message for (v + 1 = \" + (view + 1) + \")\");\n\n /* the replica makes sure that no timer is currently working. If the view change was trigged by a suspect of failure of the primary then probably it's \n been already true. */\n revokeSendBatch();\n revokeViewChange();\n\n /* an exponetial timeout has to be considered to guarantee liveness when the end-to-end delay is too long (it's prevent uncessary view-changes)*/\n PBFTTimeoutDetector ttask = (PBFTTimeoutDetector) getViewTimer().getTask();\n long timeout = (Long) ttask.get(\"TIMEOUT\");\n ttask.put(\"TIMEOUT\", 2 * timeout);\n\n /* the replica moves to the next view. After that, this replica isn't accepting any message from view v < v+1. */\n setCurrentViewNumber(view +1);\n \n /* clean-up the sets P (prepare set) and Q (pre-prepare set)*/\n preprepareset.clear();\n prepareset.clear();\n\n long lcwm = getLCWM();\n long hcwm = getHCWM();\n\n /* compute Q (pre-prepare set) and P (prepare set) */\n for(long seqn = lcwm + 1; seqn <=hcwm; seqn++){\n /*If I have a prepare then its digests will be added to pre-prepared and prepared sets */\n PBFTPrepare pr = getPrepareInfo().get(lpid, seqn);\n if(pr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, pr.getSequenceNumber(), null);\n pp.getDigests().addAll(pr.getDigests());\n preprepareset.add(pp);\n \n prepareset.add(new PBFTPrepare(pp, null));\n\n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n\n continue;\n }\n\n /*If I have a pre-prepare then its digests will be added to pre-prepared set*/\n PBFTPrePrepare ppr = getPrePrepareInfo().get(seqn);\n if(ppr != null){\n PBFTPrePrepare pp = new PBFTPrePrepare(view, ppr.getSequenceNumber(), null);\n pp.getDigests().addAll(ppr.getDigests());\n preprepareset.add(pp);\n \n for(String digest: pp.getDigests()){\n getRequestInfo().assign(digest, RequestState.WAITING);\n getRequestInfo().assign(digest, (Long)null);\n }\n } \n }\n\n \n try{\n doRollback();\n }catch(Exception e){\n e.printStackTrace();\n }\n\n /* update the controls for sequence number execution */\n getStateLog().setNextPrePrepareSEQ(lcwm + 1);\n getStateLog().setNextExecuteSEQ (lcwm + 1);\n\n PBFTChangeView cv = createChangeViewMessage();\n \n try {\n /* gets the root of the checkpoint partition tree */\n PartEntry centry = rStateManager.getPart(0, 0);\n\n /* adds the pair (last stable sequence number and state digest) to compose checkpoint set C */\n if(centry != null){\n cv.addCheckpoint(centry.getPartCheckpoint(), centry.getDigest());\n }else{\n cv.addCheckpoint(lcwm, \"\");\n }\n } catch (Exception ex) {\n Logger.getLogger(PBFTServer.class.getName()).log(Level.SEVERE, null, ex);\n cv.getCheckpointSet().clear();\n cv.addCheckpoint(lcwm, \"\");\n }\n\n /* add the pre-prepare set to current change-view message*/\n cv.getPrePrepareSet().clear();\n cv.getPrePrepareSet().addAll(preprepareset);\n\n /* add the prepare set to current change-view message*/\n cv.getPrepareSet().clear();\n cv.getPrepareSet().addAll(prepareset);\n\n /*emit the change view message to group of replicas */\n emit(cv, getLocalGroup().minus(getLocalProcess()));\n\n getChangeViewInfo().setMinimumViewNumber(view);\n getChangeViewInfo().put(cv);\n\n if(isPrimary()){\n getNewViewConstructor().addChangeView(cv);\n }else{\n finalizeNewViewConstructor();\n }\n\n getChangeViewInfo().gc(view);\n getChangeViewACKInfo().gc(view);\n getNewViewConstructor().gc(view);\n getNewViewInfo().gc(view);\n getPrePrepareInfo().gc(view);\n getPrepareInfo().gc(view);\n getPrePreparebackupInfo().gc(view);\n getCommitInfo().gc(view);\n\n\n emitChangeViewACK();\n\n\n uncertanty = true; \n }",
"@Override\n\tpublic void onStart() {\n\t\tsuper.onStart();\n\t\tdisplayEvent();\n\t}",
"public void printMsg() {\n System.out.println(\"This is an example RMI program\");\n }",
"private void listen() {\n try {\n this.console.println(MapControl.checkListen(FireSwamp.getPlayer().getPlayerPosition(),\n FireSwamp.getCurrentGame().getGameMap()));\n } catch (MapControlException ex) {\n Logger.getLogger(GameMenuView.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void initialiseView() {\n \tnoTasksMessageView = (TextView)findViewById(R.id.noTasksRunning);\r\n \ttaskKillWarningView = (TextView)findViewById(R.id.progressStatusMessage);\r\n\r\n \tIterator<Progress> jobsIterator = JobManager.iterator();\r\n \twhile (jobsIterator.hasNext()) {\r\n \t\tProgress job = jobsIterator.next();\r\n \t\tfindOrCreateUIControl(job);\r\n \t}\r\n\r\n // allow call back and continuation in the ui thread after JSword has been initialised\r\n \tfinal Handler uiHandler = new Handler();\r\n \tfinal Runnable uiUpdaterRunnable = new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n \t\t\tProgress prog = progressNotificationQueue.poll();\r\n \t\t\tif (prog!=null) {\r\n \t\t\t\tupdateProgress(prog);\r\n \t\t\t}\r\n\t\t\t}\r\n };\r\n\r\n // listen for Progress changes and call the above Runnable to update the ui\r\n\t\tworkListener = new WorkListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic void workProgressed(WorkEvent ev) {\r\n\t\t\t\tcallUiThreadUpdateHandler(ev);\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void workStateChanged(WorkEvent ev) {\r\n\t\t\t\tcallUiThreadUpdateHandler(ev);\r\n\t\t\t}\r\n\t\t\tprivate void callUiThreadUpdateHandler(WorkEvent ev) {\r\n\t\t\t\tProgress prog = ev.getJob();\r\n\t\t\t\tprogressNotificationQueue.offer(prog);\r\n \t\t\t// switch back to ui thread to continue\r\n \t\t\tuiHandler.post(uiUpdaterRunnable);\r\n\t\t\t}\r\n\t\t};\r\n\t\tJobManager.addWorkListener(workListener);\r\n\r\n\t\t// give new jobs a chance to start then show 'No Job' msg if nothing running\r\n\t\tuiHandler.postDelayed(\r\n\t\t\tnew Runnable() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tif (!JobManager.iterator().hasNext()) {\r\n\t\t\t\t\t\tshowNoTaskMsg(true);\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}, 4000);\r\n }",
"void onServerStarted();",
"@Override\n public void startTimeLoop() {\n MyLog.log(\"startTimeLoop::\");\n // handler.sendEmptyMessage(5);\n }",
"public void run() {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tAlertDialog.showInformMessage(message);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tUiApplication.getUiApplication().pushScreen(new HomeScreen());\n\t\t\t\t\t\t}",
"public void run() {\r\n System.out.println(\"Start sim\");\r\n for (; isRunning;) {\r\n //int horLaneNum = optView.getUserHorNum();\r\n //if (horLaneNum == 1) {\r\n horX++;\r\n horSTX = horSTX;\r\n horSTY = horSTY;\r\n verY++;\r\n view.repaint();\r\n try {\r\n Thread.sleep(10);\r\n }\r\n catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }",
"public void handleTickReceived() {\n if (this.mVisible) {\n updateIndication();\n }\n }",
"protected void onTick() {\n\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (userRequest != null) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"Essayez reservation du tourisme \" + userRequest.getTourism().getAddressDestination());\n\t\t\t\t\tDFAgentDescription tmp = new DFAgentDescription();\n\t\t\t\t\tServiceDescription sd = new ServiceDescription();\n\t\t\t\t\tsd.setType(\"Reservation tour \");\n\t\t\t\t\ttmp.addServices(sd);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tDFAgentDescription[] result = DFService.search(myAgent, tmp);\n\t\t\t\t\t\tbrokerAgent = new AID[result.length];\n\t\t\t\t\t\tfor (int i = 0; i < result.length; ++i) {\n\t\t\t\t\t\t\tbrokerAgent[i] = result[i].getName();\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (FIPAException fe) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tfe.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tmyAgent.addBehaviour(new RequestPerformer());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Agent utilisateur: n'a pas la demande\");\n\t\t\t\t}\n\t\t\t}",
"public void start() {\n System.out.println(\"Machine started.\");\n }",
"public void startSesChangeBodyStatusUi(Model model) throws CommandException {\n Body body = toAdd.getBody();\n String notifContent = \"Body Id: \" + body.getIdNum()\n + \"\\nName: \" + body.getName()\n + \"\\nNext of Kin has been uncontactable. Please contact the police\";\n\n Runnable changeUi = () -> Platform.runLater(() -> {\n if (body.getBodyStatus().equals(Optional.of(CONTACT_POLICE))) {\n UpdateCommand up = new UpdateCommand(body.getIdNum(), new UpdateBodyDescriptor(body));\n up.setUpdateFromNotif(true);\n try {\n up.execute(model);\n\n NotifWindow notifWindow = new NotifWindow();\n notifWindow.setTitle(\"Contact Police!\");\n notifWindow.setContent(notifContent);\n notifWindow.display();\n // ses.shutdown();\n } catch (CommandException e) {\n logger.info(\"Error updating the body and fridge \");\n }\n }\n NotificationButton.getInstanceOfNotifButton().setIconNumber(model.getNumberOfNotifs());\n });\n\n ses.schedule(changeUi, period, timeUnit);\n }",
"public void testPeriodic() {\n LiveWindow.run();\n //init.start();\n }",
"@Override\r\n\tpublic void windowstartUpData() {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}",
"protected void onBegin() {}",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tString[] notify_cmd={\"msg\",user,\"启动中\"};\n\t\t\t\t\t\t\t\tdisplayText(\"启动中\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tRuntime.getRuntime().exec(notify_cmd);\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\tString mssage_in=\"appium msg\";\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\twhile(true){\n\t\t\t\t\t\t\t\t\t\tif((mssage_in=br.readLine())!=null){\n\t\t\t\t\t\t\t\t\t\t\tMyFrame.displayText(mssage_in);\n\t\t\t\t\t\t\t\t\t\t\tpw.println(mssage_in);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"@Override\n\tpublic void gameStarted() {\n\t\tupdatePosition(0,0,0);\n//\t\tstartSendingPositionsThread();\n\t}",
"@Override\n public void onStart(ITestContext tc) {\n StatusPrinter.printRunStart();\n }",
"public void onStart() {\r\n\t\tLog.w(LOG_TAG, \"Simple iMeeting base view = \" + this\r\n\t\t\t\t+ \" onStart method not implement\");\r\n\t}",
"public void update(){\n\t\tSystem.out.println(\"Return From Observer Pattern: \\n\" + theModel.getObserverState() \n\t\t+ \"\\n\");\n\t}",
"@Override \n protected void startup() {\n GretellaView view = new GretellaView(this);\n show( view );\n view.initView(); \n }",
"protected void serverStarted()\n {\n System.out.println(\"Server listening for connections on port \" + getPort());\n }",
"public void launchNewSession(){\r\n framework.launchNewMAV(getArrayMappedToData(), this.experiment, \"Multiple Experiment Viewer - Cluster Viewer\", Cluster.GENE_CLUSTER);\r\n }",
"public void start() {\n notifyStart();\n simloop();\n notifyStop();\n }",
"public void sendeSpielStarten();",
"public void launch() {\n view.setEditMode(false); \n view.setComments(report.getComments().toArray());\n \n view.addCommentsListSelectionListener(new CommentsListSelectionListener());\n view.addEditButtonActionListener(new EditButtonActionListener());\n view.addDiscardButtonActionListener(new DiscardChangesActionListener());\n view.addSaveButtonActionListener(new SaveCommentChangesActionListener());\n view.addNewCommentActionListener(new NewCommentActionListener());\n \n view.setVisible(true);\n \n refreshView();\n \n /**\n * Craig - TC B2c: Real time updates\n * Register this controller as an observer\n */\n AppObservable.getInstance().addObserver(this);\n }",
"@Override\n\tpublic void run() {\n\t\t\n\t\tMain.msg_receiver.addNewMessageListener(new NewMessageListener () {\n\t\t\t@Override public void aMessageHasBeenReceived(Message msg) {\n\t\t\t\t\n\t\t\t\tif(!(Main.connecting | Main.connected)) return;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"messaged recu de : \" + msg.getEmetteur().pseudo);\n\t\t\t\t\n\t\t\t\t//If the message is from the user itself(like a broadcast) exclude it\n\t\t\t\tif(msg.getEmetteur().ip.equals(Main.local_host))return;\t\n\t\t\t\tDefaultTableModel model = (DefaultTableModel) Main.frame_gui.table.getModel();\n\t\t\t\t\n\t\t\t\t//First, message paring and casting to the correct type\n\t\t\t\t//If the message is a check\n\t\t\t\tif(msg instanceof MsgCheck) {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Check recu\");\n\t\t\t\t\tMsgCheck message = (MsgCheck) msg;\t\n\t\t\t\t\t\n\t\t\t\t\t//If it is a message from blank_user and asking an answer\n\t\t\t\t\tif(message.need_an_answer & message.getEmetteur().pseudo.equals(Main.blank.pseudo)) {\n\t\t\t\t\t\t//Then send a check back without asking for an answer\n\t\t\t\t\t\tSystem.out.println(\"Check avec demande de reponse\");\n\t\t\t\t\t\tMain.msg_sender.sendCheck(false, Main.me, message.getEmetteur());\n\t\t\t\t\t}\n\n\t\t\t\t\t//If it is check not asking an answer\n\t\t\t\t\telse if(!message.need_an_answer) {\n\t\t\t\t\t\t//Then add the user to the list of connected people\n\t\t\t\t\t\tSystem.out.println(\"Check sans demande de reponse\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!Main.hm_users.containsKey(message.getEmetteur().pseudo)) {\n\t\t\t\t\t\t\tMain.hm_users.put(message.getEmetteur().pseudo, message.getEmetteur().ip);\n\t\t\t\t\t\t\tSystem.out.println(\"User added: \" + message.getEmetteur().pseudo);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmodel.addRow(new Object[]{message.getEmetteur().pseudo});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(msg instanceof MsgNewPseudo) {\n\t\t\t\t\tSystem.out.println(\"Message new pseudo recu\");\n\t\t\t\t\t//Remplacer l'ancien user par le nouveau dans les liste d'utilisateurs\n\t\t\t\t\t//connectés et dans la sauvegarde des messages\n\t\t\t\t\tMsgNewPseudo message = (MsgNewPseudo) msg;\n\t\t\t\t\t\n\t\t\t\t\tif(Save_msg.open_conection.containsKey(message.getEmetteur())) {\n\t\t\t\t\t\tSave_msg.open_conection.remove(message.getEmetteur());\n\t\t\t\t\t\tSave_msg.open_conection.put(message.new_me, true);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(Save_msg.conversations.containsKey(message.getEmetteur().pseudo)){\n\t\t\t\t\t\tString str = Save_msg.conversations.get(message.getEmetteur().pseudo);\n\t\t\t\t\t\tSave_msg.conversations.remove(message.getEmetteur().pseudo);\n\t\t\t\t\t\t\n\t\t\t\t\t\tstr = str + \"=== \" + message.getEmetteur().pseudo + \" became \" + message.new_me.pseudo + \" ===\\n\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tSave_msg.conversations.put(message.new_me.pseudo, str);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//actualisation du texte si on est entrain de discuter avec la personne et de l'entete\n\t\t\t\t\t\tint i = Main.frame_gui.table.getSelectedRow();\n\t\t\t\t\t\tif(i != -1) {\n\t\t\t\t\t\t\tif(Main.frame_gui.table.getValueAt(Main.frame_gui.table.getSelectedRow(), 0).equals(msg.getEmetteur().pseudo) | Main.frame_gui.table.getValueAt(Main.frame_gui.table.getSelectedRow(), 0).equals(\"** \" + msg.getEmetteur().pseudo)) {\n\t\t\t\t\t\t\t\tMain.frame_gui.textPane.setText(str);\n\t\t\t\t\t\t\t\tMain.frame_gui.lblChoisirUnCorrespondant.setText(\"Conversation with \" + message.new_me.pseudo);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//modification du pseudo dans la liste des utilisateurs\n\t\t\t\t\t\tfor (int i2 = Main.frame_gui.table.getRowCount() - 1; i2 >= 0; --i2) {\n\t\t\t\t\t\t\t//Notification\n\t\t\t\t\t\t\tString str2 = (String) model.getValueAt(i2, 0);\n\t\t\t\t\t\t\tif(str2.equals(msg.getEmetteur().pseudo)) model.setValueAt(message.new_me.pseudo, i2, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tMain.hm_users.remove(message.getEmetteur().pseudo);\n\t\t\t\t\t\tMain.hm_users.put(message.new_me.pseudo, message.new_me.ip);\n\t\t\t\t\t\tSystem.out.println(Main.hm_users);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSave_msg.Save_messages();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//If the message is a bye, remove the sender from the list of connected users\n\t\t\t\telse if(msg instanceof MsgGoodbye) {\n\t\t\t\t\tSystem.out.println(\"Message goodbye recu\");\n\t\t\t\t\tSystem.out.println(\"User removed: \" + msg.getEmetteur().pseudo);\n\t\t\t\t\tMain.hm_users.remove(msg.getEmetteur().pseudo);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Pour supprimer un utilisateur de la table \n\t\t\t\t\tfor (int i = model.getRowCount() - 1; i >= 0; --i) {\n\t\t\t\t\t\tif (model.getValueAt(i, 0).equals(msg.getEmetteur().pseudo) | model.getValueAt(i, 0).equals(\"** \"+ msg.getEmetteur().pseudo)) {\n\t\t\t\t\t\t\tmodel.removeRow(i);\n\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If the message is a text message\n\t\t\t\telse if(msg instanceof MsgTxt) {\n\t\t\t\t\t\n\t\t\t\t\tif(!Main.hm_users.containsKey(msg.getEmetteur().pseudo)) {\n\t\t\t\t\t\tSystem.out.println(Main.hm_users);\n\t\t\t\t\t\tMain.hm_users.put(msg.getEmetteur().pseudo, msg.getEmetteur().ip);\t\t\t\t\t\t\n\t\t\t\t\t\tmodel.addRow(new Object[]{msg.getEmetteur().pseudo});\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Message receive from \"+ msg.getEmetteur().pseudo);\n\t\t\t\t\tSystem.out.println(msg.toTxt());\n\t\t\t\t\t\n\t\t\t\t\tString entete = null;\n\t\t\t\t\tif(!Save_msg.conversations.containsKey(msg.getEmetteur().pseudo)) entete=\"\";\n\t\t\t\t\telse entete = Save_msg.conversations.get(msg.getEmetteur().pseudo);\n\t\t\t\t\t\n\t\t\t\t\tString str = entete + (msg.getHorodatation() + \" : \" + msg.getEmetteur().pseudo + \" -> Moi : \\n\" + msg.toTxt() + \"\\n\\n\");\n\t\t\t\t\tSave_msg.conversations.remove(msg.getEmetteur().pseudo);\n\t\t\t\t\tSave_msg.conversations.put(msg.getEmetteur().pseudo, str);\n\t\t\t\t\t\n\t\t\t\t\tint i = Main.frame_gui.table.getSelectedRow();\n\t\t\t\t\tif(i != -1) {\n\t\t\t\t\t\tif(Main.frame_gui.table.getValueAt(Main.frame_gui.table.getSelectedRow(), 0).equals(msg.getEmetteur().pseudo) | Main.frame_gui.table.getValueAt(Main.frame_gui.table.getSelectedRow(), 0).equals(\"** \" + msg.getEmetteur().pseudo)) {\n\t\t\t\t\t\t\tMain.frame_gui.textPane.setText(str);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t//Notify the user from who he get a new message\n\t\t\t\t\tfor (int i1 = Main.frame_gui.table.getRowCount() - 1; i1 >= 0; --i1) {\n\t\t\t\t\t\t//Notification\n\t\t\t\t\t\tSystem.out.println(\"On Notifie\");\n\t\t\t\t\t\tString str1 = (String) model.getValueAt(i1, 0);\n\t\t\t\t\t\tif(i1==i & i != -1) return;\n\t\t\t\t\t\tif(str1.equals(msg.getEmetteur().pseudo)) model.setValueAt(\"** \" + str1, i1, 0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSave_msg.Save_messages();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"@Override protected void startup() {\n show(new FFTView(this));\n }",
"@Override\n public void simulationPeriodic() {\n }",
"public void start() {\r\n message = \"Now I'm starting up...\";\r\n repaint();\r\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tMinetunes.writeChatMessage(mc.theWorld, twd\n\t\t\t\t\t\t.downloadExampleWorld(beQuiet,\n\t\t\t\t\t\t\t\tTDConfig.MC_CURRENT_VERSION));\n\t\t\t}",
"private void initialize() {\n\t\tframe = new JFrame();\n\t\tframe.setBounds(100, 100, 650, 410);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\t/*JButton btnStatusView = new JButton(\"Status view\");\n\t\tbtnStatusView.setBounds(520, 335, 100, 25);\n\t\tbtnStatusView.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString action = e.getActionCommand();\n\t\t\t\tif (action.equals(\"Status view\")) {\n\t\t\t\t\t// point(3,5,5,4);\n\t\t\t\t\t// point(1,3,6,1);\n\t\t\t\t\t// point(2,155,142,3);\n\t\t\t\t\t// point(4,15,50,2);\n\t\t\t\t}\n\t\t\t} \n\t\t});\n\t\tframe.getContentPane().add(btnStatusView);*/\n\n\t\tframe.getContentPane().add(new TPanel(10, 10, 300, 150));\n\t\tframe.getContentPane().add(new TPanel(10, 171, 300, 150));\n\t\tframe.getContentPane().add(new TPanel(320, 171, 300, 150));\n\t\tframe.getContentPane().add(new TPanel(320, 10, 300, 150));\n\t\t\n\t\ttry \n\t\t{\n\t\t\tobserver = new ServerSocket(port);\n\t\t} catch (IOException e2) \n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\t\t\n\t\t//for (int i=0; i < numSubjects;i++)\n\t\t\tnew Thread()\n\t\t\t{\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\t//String ipCliente;\n\t\t\t\t\t//int porta;\n\t\t\t\t\tSocket cliente = null;\n\t\t\t\t\tArrayList<Data> dataReceived;\n\t\t\t\t\tlong initialTime = System.currentTimeMillis();\n\t\t\t\t\twhile(!observer.isClosed())\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"esperando atualizacao do Subject: \");\n\t\t\t\t\t\t\tcliente = observer.accept();\n\t\t\t\t\t\t\tSystem.out.println(\"Observer conectado: \"+cliente.getInetAddress().getHostAddress());\n\t\t\t\t\t\t\tObjectInputStream input = new ObjectInputStream(cliente.getInputStream());\n\t\t\t\t\t\t\ttry \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdataReceived= (ArrayList<Data>) input.readObject();\n\t\t\t\t\t\t\t\tSystem.out.println(\"Tempo decorrido desde a ultima \"\n\t\t\t\t\t\t\t\t\t\t+ \"atualizacao \" + (System.currentTimeMillis()-initialTime));\n\t\t\t\t\t\t\t\tinitialTime = System.currentTimeMillis();\n\t\t\t\t\t\t\t\tinput.close();\n\t\t\t\t\t\t\t\tcliente.close();\n\t\t\t\t\t\t\t\tfor(Data it:dataReceived) {\n\t\t\t\t\t\t\t\t\tCliente.this.point(it.getFramePos(), it.getPosX(), it.getPosY(),\n\t\t\t\t\t\t\t\t\t\t\tit.getColor(), it.getSize());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (IOException e1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcliente.close();\n\t\t\t\t\t\t\t\tthis.run();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}.start();\t\n\n\t}"
]
| [
"0.6497786",
"0.62589455",
"0.61455345",
"0.60999244",
"0.60584927",
"0.60581326",
"0.603688",
"0.5929316",
"0.59230995",
"0.58407515",
"0.5840514",
"0.5780054",
"0.57756364",
"0.57752085",
"0.5772284",
"0.57434684",
"0.57434684",
"0.57093006",
"0.56940985",
"0.56911904",
"0.5662673",
"0.56525165",
"0.5647516",
"0.5645548",
"0.5642946",
"0.5642689",
"0.56391335",
"0.5621439",
"0.5607791",
"0.5595276",
"0.55893594",
"0.5579789",
"0.5578813",
"0.5578532",
"0.55742604",
"0.5571257",
"0.55670494",
"0.55632",
"0.5557439",
"0.5551771",
"0.55502397",
"0.55469286",
"0.55382645",
"0.55382645",
"0.55382645",
"0.55382645",
"0.55294627",
"0.5526367",
"0.5508391",
"0.5506996",
"0.5503369",
"0.55004966",
"0.54934984",
"0.54874015",
"0.5481627",
"0.547503",
"0.54696673",
"0.5468191",
"0.5462436",
"0.54593533",
"0.5458639",
"0.5451372",
"0.5448436",
"0.5445434",
"0.54439354",
"0.54431766",
"0.5439266",
"0.543872",
"0.5436051",
"0.54349506",
"0.54317755",
"0.542883",
"0.542387",
"0.5423416",
"0.54152316",
"0.5411463",
"0.541118",
"0.5407931",
"0.5406867",
"0.54009104",
"0.5392103",
"0.53920263",
"0.5391961",
"0.5389183",
"0.538604",
"0.5379494",
"0.53742695",
"0.5373453",
"0.53704256",
"0.53695923",
"0.53690314",
"0.5364598",
"0.5359757",
"0.5359267",
"0.535444",
"0.53512",
"0.53487265",
"0.53474146",
"0.53467256",
"0.53453237"
]
| 0.5505336 | 50 |
This is received whenever the simulation displayed by this view has stopped running | public void simulationFinished() {
// Stop sending regular repaint messages
autoUpdater.stop();
// Ensure display is up-to-date
repaint();
// Start following the mouse again
addMouseListener(mouseFollower);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void stop() {}",
"public void simulationTerminating() {\n }",
"public void stopped();",
"public void stop() {\r\n isRunning = false;\r\n System.out.println(\"Stop sim\");\r\n }",
"@Override\n public void stop() {\n }",
"@Override\r\n public void stop() {\r\n }",
"@Override\r\n public void stop() {\r\n }",
"@Override\n public void onStop() {\n }",
"@Override\r\n public void stop() {\r\n\r\n }",
"@Override\n public void onStop()\n {\n }",
"@Override\r\n protected void onStop() {\n }",
"public void stopping() {\n super.stopping();\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"public void simulationTerminated() {\n }",
"public abstract void stopped();",
"@Override\n public void stop() {\n\n }",
"@Override\n protected void onStop() {\n }",
"public void onStop() {\n super.onStop();\n getDelegate().d();\n }",
"@Override\n\t\t\tpublic void onStop() {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void onStop() {\n\n\t\t\t}",
"@Override\n\tpublic void stop() {\n\t\tif (view != null)\n\t\t\tview.stop();\n\t}",
"public void onStop () {\t\t\n\t\t\n\t}",
"public void onStop() {\r\n\t\tLog.w(LOG_TAG, \"Simple iMeeting base view = \" + this\r\n\t\t\t\t+ \" onStop method not implement\");\r\n\t}",
"@Override public void stop() {\n }",
"void onStopped();",
"public void onStop() {\n }",
"public void onStop() {\n\t }",
"public static void stopSimulation()\r\n {\r\n stopSimulation=true;\r\n }",
"@Override public void stop () {\n }",
"@Override\r\n\tprotected void onStop() {\n\t\t\r\n\t}",
"@Override\n\tpublic void onStop() {\n\n\t}",
"public void onStop() {\n super.onStop();\n mo4364b().mo4305d();\n }",
"@Override\r\n\tpublic void stop() {\n\t\t\r\n\t}",
"@Override\n\t\tpublic void stop() {\n\t\t\t// Nothing to do for now\n\t\t}",
"public void onStop(LoadScenarioInfo loadScenarioInfo){\n }",
"@Override\n\tpublic void gameStopped() {\n\t}",
"@Override\n\tpublic void stop() {\n\t}",
"@Override\n\tpublic void stop() {\n\t}",
"public void onStop();",
"@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n\tpublic void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"public void onStop() {\n }",
"public void onStop() {\n }",
"@Override\n\tprotected void onStop() {\n\t\tSystem.out.println(\"onStop\");\n\t}",
"protected void onStopped() {\n // Do nothing.\n }",
"@Override\n\tprotected void onStop() {\n\t\tSystem.out.println(\"---onStop---\");\n\t\tsuper.onStop();\n\t}",
"@Override\r\n protected void onStop() {\n super.onStop();\r\n }",
"@Override\n public void onStop() {\n super.onStop();\n }",
"@Override\n public void onStop() {\n super.onStop();\n }",
"@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n public void simulationEnded() {\n this.soundThread = null;\r\n\r\n // end the module thread\r\n this.running = false;\r\n\r\n // the simulation is not running\r\n this.runSimulationState = false;\r\n\r\n // play the background sound\r\n this.playBackgroundSound(true);\r\n }",
"public void stopping();",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"@Override\n protected void onStop() {\n super.onStop();\n }",
"@Override\n public void run() {\n stop();\n }",
"public static void stop(){\n printStatic(\"Stopped vehicle\");\n }",
"public void stop(){\n return;\n }",
"public void stop()\r\n {\r\n breakoutAnimator = null;\r\n }",
"protected void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"protected void onStop() {\n\t\tsuper.onStop();\r\n\t}",
"@Override\r\n public void onStop() {\r\n super.onStop();\r\n\r\n\r\n }",
"@Override\n\t\tprotected void onStop() {\n\t\t\tsuper.onStop();\n\t\t}",
"public void onStop() {\n\n }",
"@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}",
"@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}",
"@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}",
"@Override\n\tpublic void onStop() {\n\t\tsuper.onStop();\n\t}",
"@Override\n\tprotected void onStop()\n\t{\n\t\tsuper.onStop();\n\t}",
"protected void onStop ()\n\t{\n\t\tsuper.onStop ();\n\t}",
"@Override\n\tpublic void stop()\n\t\t{\n\t\t}",
"public void stop() {}",
"@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tSystem.out.println(\"onStop...\");\n\t}",
"@Override\n protected void onStop() {\n status = 0;\n super.onStop();\n }",
"@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t\t//snakeView.stop();\r\n\t\tinsertResult(app.getName(), snakeView.maxRezultat); // klic funkcije za shranjevanje v bazo\r\n\t}",
"@Override\n public void stop() {\n telemetry.addData(\"Say\", \"It Stopped!\");\n }"
]
| [
"0.6908369",
"0.68891567",
"0.6867456",
"0.6820975",
"0.681422",
"0.67856663",
"0.67856663",
"0.6777656",
"0.67650145",
"0.6739005",
"0.6738034",
"0.67334306",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6730435",
"0.6708766",
"0.67021096",
"0.67015886",
"0.669143",
"0.66846097",
"0.6678385",
"0.66776675",
"0.66776675",
"0.6665884",
"0.6663992",
"0.6653807",
"0.66440845",
"0.6643206",
"0.66414404",
"0.6626926",
"0.66132504",
"0.6612208",
"0.66092527",
"0.66055894",
"0.66034377",
"0.6591335",
"0.65862906",
"0.6566783",
"0.6558734",
"0.6550233",
"0.6550233",
"0.6549683",
"0.6540323",
"0.6540323",
"0.6540323",
"0.6526704",
"0.65202343",
"0.65202343",
"0.6506671",
"0.65039706",
"0.6500415",
"0.65000737",
"0.6496047",
"0.6496047",
"0.6495353",
"0.6495353",
"0.6495353",
"0.6484178",
"0.64831036",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64745325",
"0.64712876",
"0.64712876",
"0.64712876",
"0.64712876",
"0.64712876",
"0.64687115",
"0.64518726",
"0.6447548",
"0.64463586",
"0.6440647",
"0.6440647",
"0.64321685",
"0.6426079",
"0.64247894",
"0.64189637",
"0.64189637",
"0.64189637",
"0.64189637",
"0.64148957",
"0.64129823",
"0.64125687",
"0.6405165",
"0.63990396",
"0.6392928",
"0.6390697",
"0.63834405"
]
| 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) throws IOException, DuplicateNameException {
AbCServer srvr=new AbCServer();
srvr.start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
System.out.println("(log) KcmMemberScr.displayFunc(KcmMemberVO _kmvo) entered"); | public static void displayFunc(KcmMemberVO _kmvo){
System.out.print(" " + _kmvo.getKmem());
System.out.print(" " + _kmvo.getKid());
System.out.print(" " + _kmvo.getKpw());
System.out.print(" " + _kmvo.getKname());
System.out.print(" " + _kmvo.getKemail());
System.out.print(" " + _kmvo.getKhp());
System.out.print(" " + _kmvo.getKbirth());
System.out.print(" " + _kmvo.getKpostno());
System.out.print(" " + _kmvo.getKjuso());
System.out.print(" " + _kmvo.getKdeleteYN());
System.out.print(" " + _kmvo.getKinsertdate());
System.out.println(" " + _kmvo.getKupdatedate());
// System.out.println("(log) KcmMemberScr.displayFunc(KcmMemberVO _kmvo) left");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void printMsg(){\n\tdisplay();\n }",
"public String toString ()\n {\n return \"function:\" + _vname;\n }",
"@Override\n\tvoid showMsg() {\n\t\tSystem.out.println(\"Sample\");\n\t}",
"void vorbereiten(){\n\t\tSystem.out.println(\"vorbereiten \");\n\t}",
"public static void displayMsg() {\n\t}",
"private void syso() {\nSystem.out();\r\n}",
"public void display() {\n\t}",
"public void display() {\n\t\t\n\t}",
"public void display() {\n\t\t\n\t}",
"public void display() {\n\t\tSystem.out.println(\"display..\");\n\t}",
"public void display()\r\n\t{\r\n\t\t\r\n\t}",
"void show() {\r\n System.out.println(\"regno:\"+regno + \"\\n name\"+ name + \"\\n marks :\" + m1+\",\"+m2+\",\"+m3);\r\n }",
"public void printYourself(){\n\t}",
"void show() {\n\t\tSystem.out.println(\"k: \" + k);\n\t}",
"private void display3(){\n\t\tSystem.out.println(\"Private Method inside interface\");\n\t}",
"public String display();",
"public void staffname() {\nSystem.out.println(\"staff name\");\n\t}",
"public void show() {\n\tSystem.out.println(\"show-method\");\t\n\t}",
"protected void display() {\n\r\n\t}",
"public void printRecipt(){\n\n }",
"public void display2(){\n System.out.println(\"codegym\");\n }",
"final void show() {\n\t\tSystem.out.println(\">> This is show of CC\");\n\t}",
"public void print() {\n print$$dsl$guidsl$guigs();\n System.out.print( \" eqn =\" + eqn );\n }",
"static void print (Object output){\r\n \t\tSystem.out.println(output);\r\n \t}",
"public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}",
"void show() {\n System.out.print(\"show\");\n }",
"private void showMsg1(String string) { TODO Auto-generated method stub\n//\n }",
"private void showMsg1(String string) { TODO Auto-generated method stub\n//\n }",
"void printCheck();",
"private static void printFunctionCalls() {\n dvm.printFunctionCalls();\n }",
"@Override\n\tvoid show() {\n\t\tSystem.out.println(\"Test\");\n\t}",
"void msgDisplay(String s);",
"void printMST();",
"private static void print(Object msg){\n if (WAMClient.Debug){\n System.out.println(msg);\n }\n\n }",
"public void printToViewConsole(String arg);",
"private void sysout() {\nSystem.out.println(\"pandiya\");\n}",
"public void display(){\r\n System.out.println(\"_____________________valuues of__[th]__constuctor_________________________\");\r\n System.out.println(\"No_of_people = \"+NO_OF_PEOPLE);\r\n System.out.println(\"EVENT_NUBMBER = \"+EVENT_NUMBER);}",
"static void print (){\n \t\tSystem.out.println();\r\n \t}",
"@Override\r\n\tpublic void display() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSystem.out.println(\"Im a mallard Duck!\");\r\n\t}",
"private void psvm() {\n\t\tSystem.out.println(\"test\");\r\n\t}",
"@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Hyunjun\");\n\t}",
"public void display() {\n\tSystem.out.println(\"student id is \"+studentid+\"\\t\"+\"student name is \"+studentName+\"\\t\"+\"marks is \"+marks);\r\n}",
"@Override\n public void display(){\n System.out.println(\"***************\");\n System.out.println(\"Checking Account\");\n super.display();\n System.out.println(\"Routing Number: \" + routingNumber);\n }",
"public void Display(){\n System.out.println(\"************************************************************\");\n System.out.println(\"Customer Account Number: \"+getAccountNo());\n System.out.println(\"Customer Account Id: \"+getAccountId());\n System.out.println(\"Customer Type: \"+getAccountType());\n System.out.println(\"Customer Balance: $\"+getAccountBal());\n System.out.println(\"Thank you for banking with us!\");\n System.out.println(\"************************************************************\");\n }",
"public void printInfo(){\n\t}",
"public void printInfo(){\n\t}",
"@Override\n\tpublic void display() {\n\t\tSystem.out.println(name);\n\t}",
"public void print () {\n }",
"@Override\n\tpublic void display() {\n\n\t}",
"@Override\n\tpublic void display() {\n\n\t}",
"@Override\n\tpublic void display() {\n\n\t}",
"public void haha(){\n System.out.println(\"thavasi\");\n }",
"void miau() {\r\n\t\tSystem.out.println(\"Miauuuu!\");\r\n\t}",
"@Override\n\tpublic void display() {\n\t\t\n\t}",
"@Override\n\tpublic void display() {\n\t\t\n\t}",
"@Override\r\n\tpublic void display() {\n\r\n\t}",
"private static void log(String aMsg){\n\t System.out.println(aMsg);\n\t }",
"void printParking();",
"public void show() {\n\t\tSystem.out.println(\"show..\");\n\t}",
"public void display();",
"public void display();",
"void display() {\r\n\t\tSystem.out.println(id + \" \" + name);\r\n\t}",
"public static void show() {\n\t\t\n\t}",
"void display(){\r\n System.out.print(\"Display in Class A\");\r\n }",
"void print() {\n\t\n\t}",
"@Override\r\n public void display() { //implements abstract display() method from Division.java\r\n System.out.println(\"Division Name: \" + getDivisionName());\r\n System.out.println(\"Account Number: \" + getAccountNumber());\r\n\r\n System.out.println(\"Country: \" + getCountry());\r\n System.out.println(\"Language Spoken: \" + getLanguageSpoken() + \"\\n\");\r\n\r\n }",
"public void show()\n\t{\n\t\tSystem.out.println(\"show\");\n\t}",
"void display(){\n\t \t\r\n\t \t\r\n\t \tSystem.out.println(\"Student id :\" +id);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student name: \" +name);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \tSystem.out.println(\"Student marks: \" +marks);\r\n\t \t //system : system is a class in java language.lang package\r\n\t\t \t//out : out is the static member of system class.It's type PrintStream\r\n\t\t \t//println: which is used to print the output.\r\n\t \t\r\n\t \t}",
"public void displayMessage()\n {\n // getCourseName gets the name of the course\n System.out.printf( \"Welcome to the grade book for\\n%s!\\n\\n\",\n getCourseName() );\n }",
"public void t(){\n System.out.println( \"Some text \"); \n }",
"public void credit(){\n\n System.out.println(\"HSBC\");\n\n\n }",
"@Override\npublic void mutualfund() {\n\t// TODO Auto-generated method stub\n\tSystem.out.println(\"hsbc mutual fund \");\n}",
"@Override\n public void display() {\n\n }",
"public static void printInfo(){\n }",
"public abstract String display();",
"public static void print() { //This is a Java method,Which will print \"Hello World\" on the cmd prompt.\n //Note : Keywords used : -\n //public : for the public access of method anywhere in this file or Another file.\n //static : It is used for a constant variable or a method that is same for every instance of a class.\n //void : returns nothing.\n System.out.println(\"Hello World\");\n }",
"@Override\r\n\tpublic void display() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void display() {\n\t\t\r\n\t}",
"void showInConsole();",
"public void accountElection(){\n System.out.println(\"Elija una de las cuentas\");\n System.out.println(\"\");\n}",
"public void displayTextToConsole();",
"@Override\r\n\t\tvoid k() {\n\t\t\tSystem.out.println(\"k\");\r\n\t\t}",
"private void kk12() {\n\n\t}",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"RedHeadDuck\");\r\n\t}",
"public void PrintMe()\r\n\t{\r\n\t\t/********************************************/\r\n\t\t/* AST NODE TYPE = AST VAR.PARAM_FUNC EXPRESSION */\r\n\t\t/********************************************/\r\n\t\tSystem.out.print(\"AST NODE VAR.PARAM_FUNC EXPRESSION \\n\");\r\n\r\n\t\t/***********************************/\r\n\t\t/* RECURSIVELY PRINT var + expList ... */\r\n\t\t/***********************************/\r\n\t\tif (var != null) var.PrintMe();\r\n//\t\tif (expList != null) expList.PrintMe();\r\n\r\n\t\t/***************************************/\r\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\r\n\t\t/***************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\tString.format(\"EXP VAR PARAM FUNC\\n()%S\", name));\r\n\t\t\r\n\t\t/****************************************/\r\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\r\n\t\t/****************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logEdge(SerialNumber,var.SerialNumber);\r\n//\t\tAST_GRAPHVIZ.getInstance().logEdge(SerialNumber,expList.SerialNumber);\r\n\t}",
"public void transAccElec(){\n System.out.println(\"Elija la cuenta a la que desea efectuar la transferencia\");\n System.out.println(\"\");\n}",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Displaying...\");\r\n\t}",
"void display();",
"void display();",
"void display();",
"public void displayCharacter() {\n System.out.println(\"**************************\");\n System.out.println(p.showDetails());\n System.out.println(\"**************************\"+\"\\n\");\n\n }",
"public void func_70295_k_() {}",
"public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}",
"public void tampilKarakterC(){\r\n System.out.println(\"Saya adalah binatang \");\r\n }",
"public void Makan()\n\t{\n\tSystem.out.println(\"Harimau Makan Daging dan minum susu\");\n\tSystem.out.println();\n\t}",
"public void nhapdltextlh(){\n\n }",
"void display()\r\n\t {\n\t System.out.println(\"a = \" + a + \" b = \" + b);\r\n\t }",
"public void mo21786K() {\n }",
"public void display() {\n System.out.println(toString());\n }",
"@Override\n\tpublic void onMessage(String arg0, String arg1) {\n\t\tSystem.out.print(arg0+arg1);\n\t}"
]
| [
"0.6649655",
"0.6391291",
"0.6307957",
"0.6302251",
"0.62825084",
"0.62623274",
"0.62133056",
"0.6191053",
"0.6191053",
"0.6177503",
"0.61730665",
"0.616335",
"0.61205",
"0.6104659",
"0.6102003",
"0.60886943",
"0.60859126",
"0.6060935",
"0.5998361",
"0.59944385",
"0.59935427",
"0.59695154",
"0.5957077",
"0.5952505",
"0.5939233",
"0.59324986",
"0.5928772",
"0.5928772",
"0.59113497",
"0.587917",
"0.5875902",
"0.58704287",
"0.5868776",
"0.5868272",
"0.586227",
"0.58589375",
"0.58586603",
"0.58577234",
"0.5847772",
"0.58408815",
"0.5834095",
"0.5817793",
"0.5812864",
"0.5807468",
"0.5806099",
"0.5806099",
"0.58060735",
"0.580044",
"0.57961696",
"0.57961696",
"0.57961696",
"0.579595",
"0.57869244",
"0.5779244",
"0.5779244",
"0.57791007",
"0.5773176",
"0.57668555",
"0.5763679",
"0.5755514",
"0.5755514",
"0.57500494",
"0.5747677",
"0.57408625",
"0.573985",
"0.5739783",
"0.57395923",
"0.5738948",
"0.5727884",
"0.57241833",
"0.5723436",
"0.57202697",
"0.57184416",
"0.5717678",
"0.5714021",
"0.5710041",
"0.57085365",
"0.57085365",
"0.5706447",
"0.5705423",
"0.57026213",
"0.56948954",
"0.56947774",
"0.56898713",
"0.5685545",
"0.5685109",
"0.56749105",
"0.56682837",
"0.56682837",
"0.56682837",
"0.56620735",
"0.5658216",
"0.56549716",
"0.56530005",
"0.56435096",
"0.56432855",
"0.56432307",
"0.5642876",
"0.56396043",
"0.56360346"
]
| 0.7951981 | 0 |
TODO Autogenerated method stub | public static void main(String[] args) {
System.out.println("(log) Test.main() entered");
// connect Test
// KcmMemberDAO kdao = null;
// KcmMemberVO kvo = null;
// String inputVal_1 = "";
// String inputVal_2 = "";
//
// Scanner sc = new Scanner(System.in);
// inputVal_1 = sc.nextLine();
// if(sc.hasNext()){
// inputVal_2 = sc.nextLine();
// }
// sc.close();
// System.out.println("inputVal_1 >>> " + inputVal_1);
// System.out.println("inputVal_2 >>> " + inputVal_2);
//
// kvo = new KcmMemberVO();
// kvo.setKid(inputVal_1);
// kvo.setKpw(inputVal_2);
//
// System.out.println("kid >>> " + kvo.getKid());
// System.out.println("kpw >>> " + kvo.getKpw());
//
// kdao = new KcmMemberDAOImpl();
// List<KcmMemberVO> aList = kdao.loginKcmMember(kvo);
// System.out.println("aList.size() >>> " + aList.size());
//
// System.out.println(aList.iterator());
// Iterator<KcmMemberVO> iter = aList.iterator();
// if (iter.hasNext()){
// KcmMemberVO kvo_2 = iter.next();
// System.out.println("kid >>> " + kvo_2.getKid());
// System.out.println("kpw >>> " + kvo_2.getKpw());
// }
// Select All Test
// KcmMemberDAO kdao = null;
//
// kdao = new KcmMemberDAOImpl();
// List<KcmMemberVO> aList = (List<KcmMemberVO>)kdao.selectKcmMember();
//
// Iterator<KcmMemberVO> iter = aList.iterator();
// if (iter != null){
// while (iter.hasNext()){
// KcmMemberVO kvo = iter.next();
// Test.displayFunc(kvo);
// }
// }
// // Insert Test
// String id = "happy";
// String pw = "123452";
// String name = "김하방";
// String email = "[email protected]";
// String hp = "01012485421";
// String birth = "19940410";
// String postno = "11241";
// String juso = "서울시 서대문구 남가좌동";
//
// KcmMemberDAO kdao = null;
// boolean flag = false;
// KcmMemberVO kmvo = new KcmMemberVO();
// kmvo.setKid(id);
// kmvo.setKpw(pw);
// kmvo.setKname(name);
// kmvo.setKemail(email);
// kmvo.setKhp(hp);
// kmvo.setKbirth(birth);
// kmvo.setKpostno(postno);
// kmvo.setKjuso(juso);
//
// kdao = new KcmMemberDAOImpl();
// flag = kdao.insertKcmMember(kmvo);
// if (flag){
// System.out.println(" 회원가입 성공!");
// }
// // search Test
// String mem = "M201912060020";
//
// KcmMemberVO kvo = new KcmMemberVO();
// kvo.setKmem(mem);
//
// KcmMemberDAO kmdao = new KcmMemberDAOImpl();
// List<KcmMemberVO> aList = kmdao.searchKcmMember(kvo);
// Iterator<KcmMemberVO> iter = aList.iterator();
// if (aList.size() > 0){
// while (iter.hasNext()){
// KcmMemberVO kvo_2 = iter.next();
// Test.displayFunc(kvo_2);
// }
// }
// System.err.println("dsdadassssssssssss");
// pw update Test
// String mem = "M201911190005";
// String pw = "qwerqwer";
//
// KcmMemberVO kmvo = new KcmMemberVO();
// kmvo.setKmem(mem);
//
// KcmMemberDAO kmdao = new KcmMemberDAOImpl();
// boolean flag = kmdao.updateKcmMember(kmvo, pw);
// if (flag){
// System.out.println("변경 성공");
// }else{
// System.out.println("실패");
// }
// // delete Test
String mem = "M201912260029";
KcmMemberVO kmvo = new KcmMemberVO();
kmvo.setKmem(mem);
KcmMemberDAO kmdao = new KcmMemberDAOImpl();
boolean flag = kmdao.deleteKcmMember(kmvo);
if (flag){
System.out.println("삭제 성공!");
}
System.out.println("(log) Test.main() left");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
Constructor for a Point with x and y coordinate | public Point(double x, double y) {
this.x = x;
this.y = y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"Point(int x_, int y_){\n x = x_;\n y = y_;\n }",
"public Point(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point(int x, int y)\r\n\t{\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point(double x, double y){\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\r\n\t\tthis.x = x;\tthis.y = y;\r\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n this.xPosition = x;\n this.yPosition = y;\n }",
"public Point(int x, int y)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(double x, double y) {\r\n\t\t//Constructors\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}",
"public Point(double x, double y){\n\t\tsuper();\n\t\tthis.x = x; \n\t\tthis.y = y;\n\t}",
"public Point(int x, int y){\n\t\tthis.x=x; this.y=y;\n\t}",
"public Point(int x, int y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point(int y, int x)\n\t\t{\n\t\t\tthis.y = y;\n\t\t\tthis.x = x;\n\t\t}",
"public Point(float x, float y)\n {\n this.x = x;\n this.y = y;\n }",
"public Point(double x, double y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}",
"public Point(int x,int y){\r\n\t\tthis.pos = x;\r\n\t\tthis.id = y;\r\n\t}",
"public Point(int x, int y) {\n /* DO NOT MODIFY */\n this.x = x;\n this.y = y;\n SLOPE_ORDER = new SlopeOrder();\n }",
"public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }",
"public Point(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}",
"public Point(){\n this.x = 0;\n this.y = 0;\n }",
"public Point(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n this.c = Color.COLORLESS;\r\n }",
"protected Point(double x, double y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Point()\n\t{ \n\t\t// Instantiate default properties\n\t\tx = 0;\n\t\ty = 0;\n\t}",
"Point(Double x, Double y) {\n\t\tthis.setX(x);\n\t\tthis.setY(y);\n\t}",
"public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }",
"public MyPoint1 (double x, double y) {}",
"public MyPoint1(double x, int y) {\n this.x = x;\n this.y = y;\n }",
"public Point(int x, int y) {\r\n /* DO NOT MODIFY */\r\n this.x = x;\r\n this.y = y;\r\n\t\tSLOPE_ORDER = new SlopeOrderComparator(this);\r\n }",
"Point() {\n this.x = 0;\n this.y = 0;\n }",
"private GoodPoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point(int xcoord, int ycoord)\n\t{\n\t\tthis.x= xcoord;\n\t\tthis.y= ycoord;\n\t\tcountOfPoints++;\n\t}",
"public Point(double xCoordinate, double yCoordinate){\r\n\t\tthis.xCoordinate = xCoordinate;\r\n\t\tthis.yCoordinate = yCoordinate;\r\n\t}",
"public Point()\r\n\t{\r\n\t\tx = y = 0;\r\n\t}",
"public Point(double a, double b) {\n this.x = a;\n this.y = b;\n }",
"public Point(Point obj)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = obj.x;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's x-coordinate\t\n\t\tthis.y = obj.y;\t\t\t\t\t\t\t\t\t\t\t\t// Shallow copy point's y-coordinate\n\t}",
"public Point(String name, int x, int y) {\n setName(name);\n setX(x);\n setY(y);\n }",
"public PointC(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Coordinate(int x,int y)\n {\n this.x = x;\n this.y = y;\n }",
"public Coordinates(int x, int y){\n this.x = x;\n this.y = y;\n }",
"Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point2D(double x, double y){\n this.x = x;\n this.y = y;\n }",
"public Coordinates(int x, int y)\r\n {\r\n xCoord = x;\r\n yCoord = y;\r\n }",
"public Point() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}",
"public Point(int x, int y, Color color) {\r\n this.x = x;\r\n this.y = y;\r\n this.color = color;\r\n }",
"public PointItem(int x, int y) {\r\n\r\n\t\tthis.x = (int) x;\r\n\t\tthis.y = (int) y;\r\n\t\t\r\n\r\n\t}",
"public Point(float x, float y, int id) {\r\n super(x, y, 0);\r\n this.xf = x;\r\n this.yf = y;\r\n this.x = x;\r\n this.y = y;\r\n this.z = 0;\r\n this.id = id;\r\n }",
"public Position(double x, double y) {\n\t\txCoord = x;\n\t\tyCoord = y;\n\t}",
"public Point2D(double x, double y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public Point2D(double x, double y) {\n this.setX(x);\n this.setY(y);\n }",
"public Coordinate(double x, double y) {\r\n this(x, y, Double.NaN, Double.NaN);\r\n }",
"public Location(int x, int y) {\r\n\t\txCoord = x;\r\n\t\tyCoord = y;\r\n\t}",
"public Point() {\n this.x = Math.random();\n this.y = Math.random();\n }",
"public FieldPoint(double x, double y) {\n setX(x);\n setY(y);\n }",
"public Point() {\n }",
"public Point() {\n }",
"public PointImpl( double x, double y, CoordinateSystem crs ) {\n super( crs );\n position = new PositionImpl( x, y );\n empty = false;\n centroid = this;\n }",
"protected Point(final Number xCoordinate, final Number yCoordinate) {\n this.xCoordinate = xCoordinate;\n this.yCoordinate = yCoordinate;\n }",
"public T setPoint(float x, float y) {\n this.startX = x;\n this.startY = y;\n return self();\n }",
"public Position(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public Location(int x, int y)\n {\n this.x = x;\n this.y = y;\n }",
"public Location(int x, int y)\n\t{\n\t\tmX = x;\n\t\tmY = y;\n\t}",
"public Piste(int x, int y){\n\t\tthis.x=x;\n\t\tthis.y=y;\n\t}",
"public Position(int x, int y) {\n this.x = x;\n this.y = y;\n }",
"public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }",
"public Location(int x, int y) {\n\t\t\n\t\tthis.xCoord=xCoord;\n\t\tthis.yCoord=yCoord;\n\t\t\n\t}",
"public PrecisePoint(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public Point2Dd (double x, double y){\r\n this.x = x;\r\n this.y = y;\r\n }",
"Point()\n\t{\n\t\t//default point\n\t\t//this = properties of this object we are working with\n\t\tthis.x=0;\n\t\tthis.y=0;\n\t\tcountOfPoints++;\n\t}",
"public Point2d(double x, double y) {\r\n\t\t this.xCoord = x;\r\n\t\t this.yCoord = y;\r\n\t }",
"public Position(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}",
"public Coord(Double x, Double y) {\n\t\tsetX(x);\n\t\tsetY(y);\n\t}",
"public Point(Vector position) {\n\t\tthis(position, 5.0);\n\t}",
"public static Point createPoint(double x, double y) {\n Point point = new Point();\n point.setX(x);\n point.setY(y);\n\n return point;\n }",
"public Point2d() {\r\n\t // Call two-argument constructor and specify the origin.\r\n\t\t this(0, 0);\r\n\t\t System.out.println(\"Point2d default initiializing\");\r\n\t }",
"public VariablePoint2(double x, double y){\n super(x, y);\n this.x = x;\n this.y = y;\n }",
"public Ponto(int x, int y){\n this.x = x;\n this.y = y;\n }",
"public Coordinates(int x, int y) {\n\t\t\n\t\txPosition = x;\t\t\t// Assigns the x integer\n\t\tyPosition = y;\t\t\t// Assigns the y integer\n\t}",
"public Point2D()\n {\n this.x = this.y = 0f;\n }",
"public Point(int a, int b)\n\t{\n\t\t\n\tint x2 = a;\n\tint y2 = b;\t\n\tdouble D_x = x2;\n\tdouble D_y = y2;\n\t;\n\t\t\n\t\tif (!(Double.isNaN(D_x)) && !(Double.isNaN(D_y))){\n\t\t//if ( (!D_x.equals(null)) && (!D_y.equals(null))){\n\t\t\tif(a==(int)x2) this.x = a;\n\t\t\tif(b==(int)y2) this.y = b;\n\t\t\t\n\t\t\t\n\t\t\t//\tthis.x=0;\n\t\t\t//\tthis.y=0;\n\t\t\t\n\t\t}\n\t\tif (Double.isNaN(D_x)) this.x=0;\n\t\tif (Double.isNaN(D_y)) this.y=0;\t\n\t\t\n\t}",
"public Point2D(int x1,int y1) {\n\t\tx= x1;\n\t\ty=y1;\n\t}",
"public Position2D(double x, double y) {\n this.x = x;\n this.y = y;\n }",
"public PositionComponent(float x, float y) {\n\t\tthis(x, y, 0);\n\t}",
"PointDouble() {\n x = y = 0.0;\n }",
"public Point2Dd (int x, int y){\r\n this.x = (double)x;\r\n this.y = (double)y;\r\n }",
"Point createPoint();",
"public void setPoint(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }",
"public VariablePoint2(){\n super(0, 0);\n x = 0;\n y = 0;\n }"
]
| [
"0.88099146",
"0.8801884",
"0.8786148",
"0.877214",
"0.8747362",
"0.87469774",
"0.8742515",
"0.8733332",
"0.8711299",
"0.8711299",
"0.8711299",
"0.87098885",
"0.8699752",
"0.8696256",
"0.8679102",
"0.8671732",
"0.86603916",
"0.8647926",
"0.8643684",
"0.8643684",
"0.8643684",
"0.855435",
"0.84900624",
"0.8486577",
"0.84576213",
"0.83985716",
"0.8360068",
"0.8315516",
"0.82574403",
"0.8232461",
"0.8227836",
"0.81986827",
"0.81799984",
"0.8172773",
"0.8157032",
"0.81499285",
"0.80744445",
"0.8066677",
"0.80573493",
"0.80486876",
"0.80480605",
"0.79955",
"0.79640454",
"0.79471534",
"0.7927497",
"0.7876295",
"0.77941304",
"0.77867484",
"0.77838117",
"0.77827024",
"0.7779127",
"0.77705026",
"0.7743816",
"0.7716984",
"0.7699153",
"0.76725805",
"0.76511693",
"0.7645802",
"0.7645591",
"0.76163906",
"0.7593418",
"0.759137",
"0.7588062",
"0.7588062",
"0.7566457",
"0.7556234",
"0.75535023",
"0.7537759",
"0.75023764",
"0.7492823",
"0.7491884",
"0.748825",
"0.7471626",
"0.7464051",
"0.74413747",
"0.74396396",
"0.74097145",
"0.7391699",
"0.7383676",
"0.73831946",
"0.7374694",
"0.73488605",
"0.73486626",
"0.7336134",
"0.7334358",
"0.7331145",
"0.73276484",
"0.7318324",
"0.73154163",
"0.72906107",
"0.7271904",
"0.72658145",
"0.72407246",
"0.7201778",
"0.7160183",
"0.71529764"
]
| 0.87140787 | 12 |
TODO Autogenerated method stub | @Override
public void onSelectedDayChange(CalendarView view, int year, int month,
int dayOfMonth) {
bookingDate = dayOfMonth + "-" + (month + 1) + "-" + year;
date = dayOfMonth;
mon = (month + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
Interface for treelike structures based on generic Object. Intended to be called from ITreeContentProvider | public interface ITreeObject {
public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
/**
* Returns immediate parent of this item
* @return immediate parent item or null if this item has no parent or parent is unknown
*/
Object getParent();
/**
* Tells if item has children
* @return true if this item has children
*/
boolean hasChildren();
/**
* Returns number of children
* @return child count
*/
int getChildCount();
/**
* Returns array of child items as generic Objects
* @return array of child items or empty array if item has no children
*/
Object[] getChildArray();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Tree<T extends Comparable<T>> {\n public boolean isEmpty();\n\n public int size();\n\n public T min();\n\n public T max();\n\n public boolean contains(T element);\n\n public boolean add(T element);\n\n public boolean remove(T element);\n\n public Iterator<T> traverse(TreeTraversalOrder order);\n}",
"public TreeIterator<?> treeIterator(Object object)\n {\n return new DomainTreeIterator<Object>(this, object);\n }",
"public interface TreeNode {\n Collection<TreeNode> getChildren();\n boolean isDirectory();\n}",
"public interface TreeElementI extends Serializable\n{\n public void addChild(TreeElementI child);\n public String getId();\n public void setId(String id);\n public String getOutlineTitle();\n public void setOutlineTitle(String outlineTitle);\n public boolean isHasParent();\n public void setHasParent(boolean hasParent);\n public boolean isHasChild();\n public void setHasChild(boolean hasChild);\n public int getLevel();\n public void setLevel(int level);\n public boolean isExpanded();\n public void setExpanded(boolean expanded);\n public ArrayList<TreeElementI> getChildList();\n public TreeElementI getParent();\n public void setParent(TreeElementI parent);\n\n}",
"TreeStorage getTreeStorage();",
"public interface TreeNode{\r\n\t\r\n\t// enumerated node types\r\n\tpublic enum NodeType {\r\n\t\tMIN {\r\n\t\t\t@Override\r\n\t\t\tpublic NodeType opposite() {\r\n\t\t\t\treturn MAX;\r\n\t\t\t}\r\n\t\t}, MAX {\r\n\t\t\t@Override\r\n\t\t\tpublic NodeType opposite() {\r\n\t\t\t\treturn MIN;\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\tpublic abstract NodeType opposite();\r\n\t};\r\n\t\r\n\t// the type of node represented\r\n\tpublic NodeType getNodeType();\r\n\t\r\n\t// a possibly empty list of children\r\n\tpublic List<TreeNode> getChildrenNodes();\r\n\t\r\n\t// request a new child node after executing a move\r\n\tpublic TreeNode getChildNode(GameMove move) throws IllegalArgumentException;\r\n\t\r\n\t// the parent node of the current node\r\n\t// current Node == getParentNode for ROOT\r\n\tpublic TreeNode getParentNode();\r\n \r\n\t// whether the current node is the root node\r\n\tpublic Boolean isRootNode();\r\n \r\n\t// returns an object modeling some external state \r\n\tpublic GameState getGameState();\r\n \r\n\t// depth of node in tree\r\n\tpublic int getDepth();\r\n \r\n\t// evaluates/scores the leaf node\r\n\tpublic int scoreLeafNode();\r\n}",
"public interface BinaryTreeADT<T> extends Iterable<T>\n{\n//Returns the element stored in the root of the tree.\npublic T getRootElement();\n\n//Returns the left subtree of the root.\npublic BinaryTreeADT<T> getLeft();\n\n//Returns the right subtree of the root.\npublic BinaryTreeADT<T> getRight();\n\n//Returns true if the binary tree contains an element that\n//matches the specified element and false otherwise.\npublic boolean contains (T target);\n\n//Returns a reference to the element in the tree matching\n//the specified target.\npublic T find (T target);\n\n//Returns true if the binary tree contains no elements, and\n//false otherwise.\npublic boolean isEmpty();\n\n//Returns the number of elements in this binary tree.\npublic int size();\n\n//Returns the string representation of the binary tree.\npublic String toString();\n\n\n}",
"public interface BinaryTreeADT <T extends Comparable<T>> {\n \n public boolean isEmpty();\n public int size();\n public boolean contains();\n public NodoBT<T> find(T elemento);\n public Iterator<T> imorden();\n public Iterator<T> preorden();\n public Iterator<T> postorden();\n \n \n \n}",
"protected abstract Class<? extends TreeStructure> getTreeType();",
"public String getTreeType();",
"public interface TreeNodeValueModel<T>\r\n\textends WritablePropertyValueModel<T>\r\n{\r\n\r\n\t/**\r\n\t * Return the node's parent node; null if the node\r\n\t * is the root.\r\n\t */\r\n\tTreeNodeValueModel<T> parent();\r\n\r\n\t/**\r\n\t * Return the path to the node.\r\n\t */\r\n\tTreeNodeValueModel<T>[] path();\r\n\r\n\t/**\r\n\t * Return a list value model of the node's child nodes.\r\n\t */\r\n\tListValueModel<TreeNodeValueModel<T>> childrenModel();\r\n\r\n\t/**\r\n\t * Return the node's child at the specified index.\r\n\t */\r\n\tTreeNodeValueModel<T> child(int index);\r\n\r\n\t/**\r\n\t * Return the size of the node's list of children.\r\n\t */\r\n\tint childrenSize();\r\n\r\n\t/**\r\n\t * Return the index in the node's list of children of the specified child.\r\n\t */\r\n\tint indexOfChild(TreeNodeValueModel<T> child);\r\n\r\n\t/**\r\n\t * Return whether the node is a leaf (i.e. it has no children)\r\n\t */\r\n\tboolean isLeaf();\r\n\r\n}",
"public interface Tree<E> extends Iterable<E>\r\n{\r\n //accessor methods\r\n /**\r\n * Returns the Position of the root of the tree.\r\n * @return the Position of the root of the tree\r\n */\r\n Position<E> root();\r\n \r\n /**\r\n * Returns the Position of the parent of given Position.\r\n * @param p Position to check\r\n * @return the Position of the parent of given Position (or null if p is the root). \r\n * @throws IllegalArgumentException if Position isn't valid\r\n */\r\n Position<E> parent(Position<E> p) throws IllegalArgumentException;\r\n \r\n /**\r\n * Returns the number of children of given Position.\r\n * @param p Position to check\r\n * @return the number of children of given Position\r\n * @throws IllegalArgumentException if Position isn't valid\r\n */\r\n int numChildren(Position<E> p) throws IllegalArgumentException;\r\n\r\n /**\r\n * Returns the number of positions (and therefore elements) that are contained in tree.\r\n * @return the number of positions (and therefore elements) that are contained in tree\r\n */\r\n int size();\r\n \r\n \r\n //query methods\r\n /**\r\n * Tests whether given Position has at least one child.\r\n * @param p Position to check\r\n * @return true if given Position has at least one child, false otherwise\r\n * @throws IllegalArgumentException if Position isn't valid \r\n */\r\n boolean isInternal(Position<E> p) throws IllegalArgumentException;\r\n \r\n /**\r\n * Tests whether given Position has any children.\r\n * @param p Position to check\r\n * @return true if given Position does not have children, false otherwise\r\n * @throws IllegalArgumentException if Position isn't valid \r\n */\r\n boolean isExternal(Position<E> p) throws IllegalArgumentException;\r\n \r\n /**\r\n * Tests whether given Position is the root of the tree.\r\n * @param p Position to check\r\n * @return true if given Position is the root, false otherwise\r\n * @throws IllegalArgumentException if Position isn't valid \r\n */\r\n boolean isRoot(Position<E> p) throws IllegalArgumentException;\r\n \r\n /**\r\n * Tests whether tree contains any Positions (and therefore elements).\r\n * @return true if tree doesn't contain any Positions, false otherwise\r\n */\r\n boolean isEmpty();\r\n \r\n \r\n \r\n //additional methods\r\n /**\r\n * Returns an iterable Collection containing the children of given Position.\r\n * @param p Position to check\r\n * @return an iterable Collection containing the children of given Position\r\n * @throws IllegalArgumentException if Position isn't valid\r\n */\r\n Iterable<Position<E>> children(Position<E> p) throws IllegalArgumentException;\r\n \r\n /**\r\n * Returns an iterable Collection of all Positions of the tree.\r\n * @return an iterable Collection of all Positions of the tree.\r\n */\r\n Iterable<Position<E>> positions(); \r\n \r\n /**\r\n * Returns an iterator for all elements in the tree.\r\n * Ensures tree itself is iterable.\r\n * @return an iterator for all elements in the tree\r\n */\r\n @Override\r\n Iterator<E> iterator(); \r\n}",
"@ModelEntity\n\tpublic static interface ModelObject {\n\n\t\tpublic static final String CHILDREN = \"children\";\n\t\tpublic static final String PARENT = \"parent\";\n\n\t\t@Getter(value = PARENT, inverse = CHILDREN)\n\t\tpublic ModelObject getParent();\n\n\t\t@Setter(PARENT)\n\t\tpublic void setParent(ModelObject parent);\n\n\t\t@Getter(value = CHILDREN, cardinality = Cardinality.LIST, inverse = PARENT)\n\t\tpublic List<ModelObject> getChildren();\n\n\t\t@Setter(CHILDREN)\n\t\tpublic void setChildren(List<ModelObject> children);\n\n\t\t@Adder(CHILDREN)\n\t\tpublic void addToChildren(ModelObject child);\n\n\t\t@Remover(CHILDREN)\n\t\tpublic void removeFromChildren(ModelObject child);\n\t}",
"public interface Node {\n\n\tLong getClsId();\n\n\tNode getParent();\n\n\tvoid setParent(Node p);\n\n\tNode[] getChildrenArray();\n\n\tList<Node> getChildrenList();\n\n\tvoid resetChildren(Node[] children);\n\n\tObject getValue(int attr);\n\n\tObject setValue(int attr, Object value);\n\n\tlong getLongValue(int attr);\n\n\tInteger getId();\n}",
"public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}",
"public abstract Type treeCopy();",
"public interface IHierarchyDataAccessor<K,T> {\n \n /**\n * Returns the key from an object\n * @param obj object to return key from\n * @return key\n */\n public K accessKey(T obj);\n \n /**\n * Returns the parent key from an object\n * @param obj object to return parent key from\n * @return parent key\n */\n public K accessParentKey(T obj);\n \n /**\n * Returns the child object list from an object\n * @param obj object to return child object list from\n * @return list with child objects, may be null\n */\n public List<T> accessReadChildElements(T obj);\n \n /**\n * Sets the child object list to an object\n * @param obj object to set child object list to\n * @param childList list with child objects\n */\n public void accessWriteChildElements(T obj, List<T> childList);\n \n}",
"public List<?> getTreePath(Object object)\n {\n LinkedList<Object> result = new LinkedList<Object>();\n result.addFirst(object);\n while ((object = getParent(object)) != null)\n {\n result.addFirst(object);\n }\n \n return result;\n }",
"@jdk.Supported\npublic interface Tree {\n\n /**\n * Enumerates all kinds of trees.\n */\n @jdk.Supported\n public enum Kind {\n\n /**\n * Used for instance of {@link ExtendedASTAnnotationTree}\n * representing AST-level tree annotation \"@@\"\n */\n AST_ANNOTATION(null, \"ASTAnnotation\"), // ExtendedASTAnnotationTree.class ... break API compatility with visitor ...\n\n ANNOTATED_TYPE(AnnotatedTypeTree.class, \"AnnotatedType\", \"AtType\"),\n\n /**\n * Used for instances of {@link AnnotationTree}\n * representing declaration annotations.\n */\n ANNOTATION(AnnotationTree.class, \"Annotation\", \"At\"),\n\n /**\n * Used for instances of {@link AnnotationTree}\n * representing type annotations.\n */\n TYPE_ANNOTATION(AnnotationTree.class, \"TypeAnnotation\", \"Annotation\", \"At\"),\n\n /**\n * Used for instances of {@link ArrayAccessTree}.\n */\n ARRAY_ACCESS(ArrayAccessTree.class, \"ArrayAccess\"),\n\n /**\n * Used for instances of {@link ArrayTypeTree}.\n */\n ARRAY_TYPE(ArrayTypeTree.class, \"ArrayType\"),\n\n /**\n * Used for instances of {@link AssertTree}.\n */\n ASSERT(AssertTree.class, \"Assert\", \"assert\"),\n\n /**\n * Used for instances of {@link AssignmentTree}.\n */\n ASSIGNMENT(AssignmentTree.class, \"Assign\", \"Eq\", \"=\"),\n\n /**\n * Used for instances of {@link BlockTree}.\n */\n BLOCK(BlockTree.class, \"Block\", \"{}\"),\n\n /**\n * Used for instances of {@link BreakTree}.\n */\n BREAK(BreakTree.class, \"Break\", \"break\"),\n\n /**\n * Used for instances of {@link CaseTree}.\n */\n CASE(CaseTree.class, \"Case\", \"case\"),\n\n /**\n * Used for instances of {@link CatchTree}.\n */\n CATCH(CatchTree.class, \"Catch\", \"catch\"),\n\n /**\n * Used for instances of {@link ClassTree} representing classes.\n */\n CLASS(ClassTree.class, \"Class\", \"class\"),\n\n /**\n * Used for instances of {@link CompilationUnitTree}.\n */\n COMPILATION_UNIT(CompilationUnitTree.class, \"CompilationUnit\", \"cu\"),\n\n /**\n * Used for instances of {@link ConditionalExpressionTree}.\n */\n CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class, \"ConditionalExpression\", \"?\"),\n\n /**\n * Used for instances of {@link ContinueTree}.\n */\n CONTINUE(ContinueTree.class, \"Continue\", \"continue\"),\n\n /**\n * Used for instances of {@link DoWhileLoopTree}.\n */\n DO_WHILE_LOOP(DoWhileLoopTree.class, \"DoWhile\", \"do\"),\n\n /**\n * Used for instances of {@link EnhancedForLoopTree}.\n */\n ENHANCED_FOR_LOOP(EnhancedForLoopTree.class, \"EnhancedForLoop\", \"for\"),\n\n /**\n * Used for instances of {@link ExpressionStatementTree}.\n */\n EXPRESSION_STATEMENT(ExpressionStatementTree.class, \"ExpressionStatement\", \"expr;\", \"e;\"),\n\n /**\n * Used for instances of {@link MemberSelectTree}.\n */\n MEMBER_SELECT(MemberSelectTree.class, \"MemberSelect\", \".\"),\n\n /**\n * Used for instances of {@link MemberReferenceTree}.\n */\n MEMBER_REFERENCE(MemberReferenceTree.class, \"MemberReference\", \"#\"),\n\n /**\n * Used for instances of {@link ForLoopTree}.\n */\n FOR_LOOP(ForLoopTree.class, \"ForLoop\", \"for\"),\n\n /**\n * Used for instances of {@link IdentifierTree}.\n */\n IDENTIFIER(IdentifierTree.class, \"Identifier\", \"id\", \"name\"),\n\n /**\n * Used for instances of {@link IfTree}.\n */\n IF(IfTree.class, \"If\", \"if\"),\n\n /**\n * Used for instances of {@link ImportTree}.\n */\n IMPORT(ImportTree.class, \"Import\", \"import\"),\n\n /**\n * Used for instances of {@link InstanceOfTree}.\n */\n INSTANCE_OF(InstanceOfTree.class, \"InstanceOf\", \"instanceof\"),\n\n /**\n * Used for instances of {@link LabeledStatementTree}.\n */\n LABELED_STATEMENT(LabeledStatementTree.class, \"LabeledStatement\", \"label\"),\n\n /**\n * Used for instances of {@link MethodTree}.\n */\n METHOD(MethodTree.class, \"Method\", \"method\"),\n\n /**\n * Used for instances of {@link MethodInvocationTree}.\n */\n METHOD_INVOCATION(MethodInvocationTree.class, \"MethodInvocation\", \"invoke\", \"call\"),\n\n /**\n * Used for instances of {@link ModifiersTree}.\n */\n MODIFIERS(ModifiersTree.class, \"Modifiers\"),\n\n /**\n * Used for instances of {@link NewArrayTree}.\n */\n NEW_ARRAY(NewArrayTree.class, \"NewArray\", \"new\"),\n\n /**\n * Used for instances of {@link NewClassTree}.\n */\n NEW_CLASS(NewClassTree.class, \"NewClass\", \"new\"),\n\n /**\n * Used for instances of {@link LambdaExpressionTree}.\n */\n LAMBDA_EXPRESSION(LambdaExpressionTree.class, \"Lambda\", \"lambda\"),\n\n /**\n * Used for instances of {@link ParenthesizedTree}.\n */\n PARENTHESIZED(ParenthesizedTree.class, \"Parenthesized\"), // should not use prefix with \"(e)\" as it might confuse the parser ?\n\n /**\n * Used for instances of {@link PrimitiveTypeTree}.\n */\n PRIMITIVE_TYPE(PrimitiveTypeTree.class, \"PrimitiveType\", \"type\"),\n\n /**\n * Used for instances of {@link ReturnTree}.\n */\n RETURN(ReturnTree.class, \"Return\", \"return\"),\n\n /**\n * Used for instances of {@link EmptyStatementTree}.\n */\n EMPTY_STATEMENT(EmptyStatementTree.class, \"EmptyStatement\", \"empty\"),\n\n /**\n * Used for instances of {@link SwitchTree}.\n */\n SWITCH(SwitchTree.class, \"Switch\", \"switch\"),\n\n /**\n * Used for instances of {@link SynchronizedTree}.\n */\n SYNCHRONIZED(SynchronizedTree.class, \"Synchronized\", \"synchronized\"),\n\n /**\n * Used for instances of {@link ThrowTree}.\n */\n THROW(ThrowTree.class, \"Throw\", \"throw\"),\n\n /**\n * Used for instances of {@link TryTree}.\n */\n TRY(TryTree.class, \"Try\", \"try\"),\n\n /**\n * Used for instances of {@link ParameterizedTypeTree}.\n */\n PARAMETERIZED_TYPE(ParameterizedTypeTree.class, \"ParameterizedType\", \"type<>\", \"type\"),\n\n /**\n * Used for instances of {@link UnionTypeTree}.\n */\n UNION_TYPE(UnionTypeTree.class, \"UnionType\", \"union\", \"|\", \"uniontype\", \"type\"),\n\n /**\n * Used for instances of {@link IntersectionTypeTree}.\n */\n INTERSECTION_TYPE(IntersectionTypeTree.class, \"IntersectionType\", \"intersectiontype\", \"type\"),\n\n /**\n * Used for instances of {@link TypeCastTree}.\n */\n TYPE_CAST(TypeCastTree.class, \"TypeCast\", \"cast\"), // should not use prefix with \"()\" as it might confuse the parser ?\n\n /**\n * Used for instances of {@link TypeParameterTree}.\n */\n TYPE_PARAMETER(TypeParameterTree.class, \"TypeParameter\", \"type\"),\n\n /**\n * Used for instances of {@link VariableTree}.\n */\n VARIABLE(VariableTree.class, \"Variable\", \"var\", \"vardecl\"),\n\n /**\n * Used for instances of {@link WhileLoopTree}.\n */\n WHILE_LOOP(WhileLoopTree.class, \"WhileLoop\", \"while\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing postfix\n * increment operator {@code ++}.\n */\n POSTFIX_INCREMENT(UnaryTree.class, \"PostfixIncrement\", \"e++\", \"++\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing postfix\n * decrement operator {@code --}.\n */\n POSTFIX_DECREMENT(UnaryTree.class, \"PostfixDecrement\", \"e--\", \"--\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing prefix\n * increment operator {@code ++}.\n */\n PREFIX_INCREMENT(UnaryTree.class, \"PrefixIncrement\", \"++e\", \"++\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing prefix\n * decrement operator {@code --}.\n */\n PREFIX_DECREMENT(UnaryTree.class, \"PrefixDecrement\", \"--e\", \"--\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing unary plus\n * operator {@code +}.\n */\n UNARY_PLUS(UnaryTree.class, \"UnaryPlus\", \"+e\", \"+\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing unary minus\n * operator {@code -}.\n */\n UNARY_MINUS(UnaryTree.class, \"UnaryMinus\", \"-e\", \"-\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing bitwise\n * complement operator {@code ~}.\n */\n BITWISE_COMPLEMENT(UnaryTree.class, \"BitwiseComplement\", \"~\"),\n\n /**\n * Used for instances of {@link UnaryTree} representing logical\n * complement operator {@code !}.\n */\n LOGICAL_COMPLEMENT(UnaryTree.class, \"LogicalComlement\", \"!\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * multiplication {@code *}.\n */\n MULTIPLY(BinaryTree.class, \"Multiply\", \"mult\", \"*\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * division {@code /}.\n */\n DIVIDE(BinaryTree.class, \"Divide\", \"div\", \"/\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * remainder {@code %}.\n */\n REMAINDER(BinaryTree.class, \"Remainder\", \"rem\", \"%\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * addition or string concatenation {@code +}.\n */\n PLUS(BinaryTree.class, \"BinaryPlus\", \"e+e\", \"+\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * subtraction {@code -}.\n */\n MINUS(BinaryTree.class, \"BinaryMinus\", \"e-e\", \"-\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * left shift {@code <<}.\n */\n LEFT_SHIFT(BinaryTree.class, \"LeftShift\", \"<<\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * right shift {@code >>}.\n */\n RIGHT_SHIFT(BinaryTree.class, \"RightShift\", \">>\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * unsigned right shift {@code >>>}.\n */\n UNSIGNED_RIGHT_SHIFT(BinaryTree.class, \"UnsignedRightShift\", \">>>\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * less-than {@code <}.\n */\n LESS_THAN(BinaryTree.class, \"LessThan\", \"lt\", \"<\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * greater-than {@code >}.\n */\n GREATER_THAN(BinaryTree.class, \"GreaterThan\", \"gt\", \">\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * less-than-equal {@code <=}.\n */\n LESS_THAN_EQUAL(BinaryTree.class, \"LessThanEqual\", \"le\", \"<=\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * greater-than-equal {@code >=}.\n */\n GREATER_THAN_EQUAL(BinaryTree.class, \"GreaterThanEqual\", \"ge\", \">=\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * equal-to {@code ==}.\n */\n EQUAL_TO(BinaryTree.class, \"Equals\", \"equals\", \"==\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * not-equal-to {@code !=}.\n */\n NOT_EQUAL_TO(BinaryTree.class, \"NotEquals\", \"notequals\", \"!=\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * bitwise and logical \"and\" {@code &}.\n */\n AND(BinaryTree.class, \"And\", \"and\", \"&\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * bitwise and logical \"xor\" {@code ^}.\n */\n XOR(BinaryTree.class, \"Xor\", \"xor\", \"^\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * bitwise and logical \"or\" {@code |}.\n */\n OR(BinaryTree.class, \"Or\", \"or\", \"|\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * conditional-and {@code &&}.\n */\n CONDITIONAL_AND(BinaryTree.class, \"ConditionalAnd\", \"&&\"),\n\n /**\n * Used for instances of {@link BinaryTree} representing\n * conditional-or {@code ||}.\n */\n CONDITIONAL_OR(BinaryTree.class, \"ConditionalOr\", \"||\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * multiplication assignment {@code *=}.\n */\n MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class, \"MultiplyAssignment\", \"*=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * division assignment {@code /=}.\n */\n DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class, \"DivideAssignment\", \"/=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * remainder assignment {@code %=}.\n */\n REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class, \"RemainderAssignment\", \"%=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * addition or string concatenation assignment {@code +=}.\n */\n PLUS_ASSIGNMENT(CompoundAssignmentTree.class, \"PLusAssignment\", \"+=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * subtraction assignment {@code -=}.\n */\n MINUS_ASSIGNMENT(CompoundAssignmentTree.class, \"MinusAssignment\", \"-=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * left shift assignment {@code <<=}.\n */\n LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class, \"LeftShiftAssignment\", \"<<=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * right shift assignment {@code >>=}.\n */\n RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class, \"RightShiftAssignment\", \">>=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * unsigned right shift assignment {@code >>>=}.\n */\n UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class, \"UnsignedRightShiftAssignment\", \">>>=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * bitwise and logical \"and\" assignment {@code &=}.\n */\n AND_ASSIGNMENT(CompoundAssignmentTree.class, \"AndAssignment\", \"&=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * bitwise and logical \"xor\" assignment {@code ^=}.\n */\n XOR_ASSIGNMENT(CompoundAssignmentTree.class, \"XorAssignment\", \"^=\"),\n\n /**\n * Used for instances of {@link CompoundAssignmentTree} representing\n * bitwise and logical \"or\" assignment {@code |=}.\n */\n OR_ASSIGNMENT(CompoundAssignmentTree.class, \"OrAssignment\", \"|=\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * an integral literal expression of type {@code int}.\n */\n INT_LITERAL(LiteralTree.class, \"IntLiteral\", \"int\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * an integral literal expression of type {@code long}.\n */\n LONG_LITERAL(LiteralTree.class, \"LongLiteral\", \"long\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * a floating-point literal expression of type {@code float}.\n */\n FLOAT_LITERAL(LiteralTree.class, \"FloatLiteral\", \"float\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * a floating-point literal expression of type {@code double}.\n */\n DOUBLE_LITERAL(LiteralTree.class, \"DoubleLiteral\", \"double\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * a boolean literal expression of type {@code boolean}.\n */\n BOOLEAN_LITERAL(LiteralTree.class, \"BooleanLiteral\", \"boolean\", \"bool\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * a character literal expression of type {@code char}.\n */\n CHAR_LITERAL(LiteralTree.class, \"CharLiteral\", \"char\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * a string literal expression of type {@link String}.\n */\n STRING_LITERAL(LiteralTree.class, \"StringLiteral\", \"string\", \"literal\"),\n\n /**\n * Used for instances of {@link LiteralTree} representing\n * the use of {@code null}.\n */\n NULL_LITERAL(LiteralTree.class, \"NullLiteral\", \"null\", \"literal\"),\n\n /**\n * Used for instances of {@link WildcardTree} representing\n * an unbounded wildcard type argument.\n */\n UNBOUNDED_WILDCARD(WildcardTree.class, \"UnboundedWildcard\", \"?\"),\n\n /**\n * Used for instances of {@link WildcardTree} representing\n * an extends bounded wildcard type argument.\n */\n EXTENDS_WILDCARD(WildcardTree.class, \"ExtendsWildcard\", \"?extends\"),\n\n /**\n * Used for instances of {@link WildcardTree} representing\n * a super bounded wildcard type argument.\n */\n SUPER_WILDCARD(WildcardTree.class, \"SuperWildcard\", \"?super\"),\n\n /**\n * Used for instances of {@link ErroneousTree}.\n */\n ERRONEOUS(ErroneousTree.class, \"Erroneous\", \"ERROR\", \"error\"),\n\n /**\n * Used for instances of {@link ClassTree} representing interfaces.\n */\n INTERFACE(ClassTree.class, \"Interface\", \"interface\"),\n\n /**\n * Used for instances of {@link ClassTree} representing enums.\n */\n ENUM(ClassTree.class, \"Enum\", \"enum\"),\n\n /**\n * Used for instances of {@link ClassTree} representing annotation types.\n */\n ANNOTATION_TYPE(ClassTree.class, \"AnnotationType\", \"At\"),\n\n /**\n * An implementation-reserved node. This is the not the node\n * you are looking for.\n */\n OTHER(null, \"Other\");\n\n\n\t\tKind(Class<? extends Tree> intf, String displayName, String... prefixAliases) {\n associatedInterface = intf;\n this.displayName = displayName;\n this.preferredPrefix = (displayName != null)? displayName : toString();\n this.preferredPrefixLowerCase = preferredPrefix.toLowerCase();\n if (prefixAliases == null) prefixAliases = new String[0];\n this.prefixAliases = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(prefixAliases)));\n Set<String> tmpPrefixAliasesLowerCase = new HashSet<String>();\n for(String e : prefixAliases) {\n \ttmpPrefixAliasesLowerCase.add(e.toLowerCase());\n }\n this.prefixAliasesLowerCase = Collections.unmodifiableSet(tmpPrefixAliasesLowerCase);\n }\n\n private final Class<? extends Tree> associatedInterface;\n \n private final String displayName;\n \n private final String preferredPrefix;\n\n private final String preferredPrefixLowerCase;\n\n private final Set<String> prefixAliases;\n \n private final Set<String> prefixAliasesLowerCase;\n\n\n public Class<? extends Tree> asInterface() {\n return associatedInterface;\n }\n\n public String getDisplayName() {\n\t\t\treturn displayName;\n\t\t}\n\n\t\tpublic String preferredPrefix() {\n \treturn preferredPrefix;\n }\n\n public boolean hasAliasPrefix(String prefix) {\n \treturn prefixAliases.contains(prefix);\n }\n\n public boolean acceptPrefix(String prefix) {\n \tif (prefix == null) return false;\n \treturn preferredPrefix.equals(prefix)\n \t\t\t|| prefixAliases.contains(prefix);\n }\n\n public boolean acceptPrefixIgnoreCase(String prefix) {\n \tif (prefix == null) return false;\n \tString prefixLowerCase = prefix.toLowerCase();\n \treturn preferredPrefixLowerCase.equals(prefixLowerCase)\n \t\t\t|| prefixAliasesLowerCase.contains(prefixLowerCase);\n }\n\n }\n\n /**\n * Gets the kind of this tree.\n *\n * @return the kind of this tree.\n */\n Kind getKind();\n\n /**\n * Accept method used to implement the visitor pattern. The\n * visitor pattern is used to implement operations on trees.\n *\n * @param <R> result type of this operation.\n * @param <D> type of additional data.\n */\n <R,D> R accept(TreeVisitor<R,D> visitor, D data);\n\n /**\n * @since jdk1.8-ARN\n */\n List<? extends ASTExtensionTree> getASTExtensions();\n\n /**\n * @since jdk1.8-ARN\n */\n List<ASTAnnotationTree> getASTAnnotations();\n \n \n}",
"public interface INode {\n INode[] children();\n INode getParent();\n void setParent(INode parent);\n INode copySubTree();\n INode copyWholeTree();\n String getNodeChar();\n void setChildren(INode[] newKids);\n void setNodeChar(String c);\n INode getRoot();\n boolean isRoot();\n Bit getBit();\n void setBit(Bit bit);\n void tellChildAboutParent();\n INode addBrackets();\n INode removeBrackets();\n String toPlainText();\n}",
"@Override\n public Class<Object> getObjectType() {\n return Object.class;\n }",
"public interface TreeProcessor<N extends TreeNode<N>> {\n\n /**\n * Will start the processing at the originating node\n * @param origin the node from which the processing will originate\n * @param processor the processor to run on each node\n */\n void process(N origin, TreeNodeProcessor<N> processor);\n\n}",
"public interface TreeInterface extends SymmetricDigraphInterface {\r\n /** Return parent of a tree node.\r\n * @precondition nonNull(node)\r\n */\r\n public IRNode getParent(IRNode node);\r\n\r\n /** The location is a value used by an IRSequence\r\n * to locate an element. For IRArray, it is an integer.\r\n * @precondition nonNull(node)\r\n */\r\n public IRLocation getLocation(IRNode node);\r\n\r\n /** Return the root of a subtree.\r\n */\r\n public IRNode getRoot(IRNode subtree);\r\n\r\n /** Return an enumeration of nodes in the subtree\r\n * starting with leaves and working toward the node given.\r\n * A postorder traversal.\r\n */\r\n public Iteratable<IRNode> bottomUp(IRNode subtree);\r\n\r\n /** Return an enumeration of nodes in the subtree\r\n * starting with this node and working toward the leaves.\r\n * A preorder traversal.\r\n */\r\n public Iteratable<IRNode> topDown(IRNode subtree);\r\n}",
"Collection<Tree<V, E>> getTrees();",
"public interface Tree {\n\n //查找节点\n Node find(int val);\n\n //插入新节点\n boolean insert(int val);\n\n //中序遍历\n void infixOrder(Node current);\n\n //前序遍历\n void preOrder(Node current);\n\n //后序遍历\n void postOrder(Node current);\n\n //找到最大值\n Node findMax();\n\n //找到最小值\n Node findMin();\n\n //删除节点\n boolean delete(int val);\n\n}",
"public interface Node extends Serializable {\n\n\tvoid setOwner(Object owner);\n Object getOwner();\n\n String getName();\n Node getChild(int i);\n List<Node> childList();\n\n Node attach(int id, Node n) throws VetoTypeInduction;\n void induceOutputType(Class type) throws VetoTypeInduction;\n int getInputCount();\n\tClass getInputType(int id);\n List<Class> getInputTypes();\n Class getOutputType();\n Tuple.Two<Class,List<Class>> getType();\n\n Object evaluate();\n\n boolean isTerminal();\n\n <T extends Node> T copy();\n String debugString(Set<Node> set);\n}",
"public TreePart(GenericObjectNode object, Action action) {\n\t\tthis.action = action;\n\t\tthis.object = object;\n\t}",
"protected <T extends BusinessObject> T addAsChild(T object) {\n\t\tif (children == null) {\n\t\t\tchildren = new HashMap<>();\n\t\t}\n\t\tchildren.put(object.nameProperty().getValue().toLowerCase(), object);\t\t\n\t\treturn object;\n\t}",
"public String treeType();",
"TreeNode getTreeNode();",
"public interface BinarySearchTree<T extends Comparable<T>> {\r\n //Add the new element to the tree where it belongs.\r\n public void insert(T element);\r\n\r\n //Search the tree for a given element.\r\n public boolean search(T element);\r\n\r\n //Get the total height of the tree starting at the root.\r\n public int getHeight();\r\n\r\n //Get how many steps the search count took. Also reset the current search count.\r\n public int getSearchSteps();\r\n\r\n //Get how many single rotations have occurred in the tree.\r\n public int getRotations();\r\n\r\n //Return a human-readable name for the tree.\r\n public String getTreeType();\r\n}",
"@Override\n public BSTNode add(T object) {\n\n BSTNode newNode = new Leaf(object);\n\n\n if (object.compareTo(this.data) < 0) {\n // Put the new object below to the left.\n BSTNode convertedLead = new ElementNode(this.data, newNode, null);\n return convertedLead;\n } else {\n // Put the new object below to the right.\n BSTNode convertedLead = new ElementNode(this.data, null, newNode);\n return convertedLead;\n }\n\n }",
"public abstract Type treeCopyNoTransform();",
"public ETreeNode(T userObject) {\n super(userObject);\n children = null; // not initialized (lazy)\n }",
"public interface TreeNodeIdsHandler<T extends BaseEntity> {\n\n //获取待处理根节点列表\n List<String> getRootNodeIds();\n\n //处理原始的根节点列表\n List<String> getRootNodeIdsForQueryTrees(List<String> rootNodeIds);\n\n List<T> getChildrenTree(String nodeId);\n\n TreeNodeGenerateStrategy<T> getTreeNodeGenerateStrategy();\n\n default TreeNodeIdsHandlerResult handle() {\n TreeNodeIdsHandlerResult treeNodeIdsHandlerResult = new TreeNodeIdsHandlerResult();\n List<String> rootNodeIds = getRootNodeIdsForQueryTrees(getRootNodeIds());\n treeNodeIdsHandlerResult.setRootNodeIds(rootNodeIds);\n treeNodeIdsHandlerResult.setAllTreeNodes(getTreeNodes(rootNodeIds));\n return treeNodeIdsHandlerResult;\n }\n\n default List<TreeUtil.TreeNode> getTreeNodes(List<String> rootNodeIds){\n List<T> entities = Lists.newArrayList();\n for (String nodeId : rootNodeIds) {\n entities.addAll(getChildrenTree(nodeId));\n }\n\n return TreeNodeConverter.buildTreeNodeConverter(getTreeNodeGenerateStrategy()).convert(entities);\n }\n}",
"public interface BinaryTree<T> {\t\r\n\t/**\r\n\t * Binary tree Node interface.\r\n\t * @param <T> Node contents\r\n\t */\r\n\tpublic interface BinaryNode<T> { }\r\n\t\r\n\t/**\r\n\t * Searches through the tree for a specified value, returning the Node\r\n\t * containing the value.\r\n\t * @param v The value to search for\r\n\t * @return The Node containing the value\r\n\t */\r\n\tpublic BinaryNode<T> find(T v);\r\n\t\r\n\t/**\r\n\t * Checks whether the tree is empty (i.e., its root is null).\r\n\t * @return {@code true} if the tree is empty, {@code false} otherwise\r\n\t */\r\n\tpublic boolean isEmpty();\r\n}",
"@Override\n\tpublic void visitarObjeto(Objeto o) {\n\t\t\n\t}",
"public interface TreeIterable<T> extends Iterable<T>{\n TreeIterator<T> iterator();\n}",
"public List<RealObject> getChildren();",
"public interface IContainerTreeNode extends IMutableTypeContainer, MutableTreeNode {\r\n}",
"public interface AVLTree<E extends Comparable<E>> extends BinarySortedTree<E>{\n\n boolean isAVLTree(AVLNode<E> current);\n\n interface AVLNode<E>{\n E getData();\n\n AVLNode setData(E data);\n\n AVLNode<E> getParent();\n\n AVLNode setParent(AVLNode<E> parent);\n\n AVLNode<E> getLeft();\n AVLNode setLeft(AVLNode<E> left);\n\n AVLNode<E> getRight();\n\n AVLNode setRight(AVLNode<E> right);\n\n int getHeight();\n\n AVLNode setHeight(int height);\n }\n}",
"public interface TreeBuilder {\r\n\r\n\t/**\r\n\t * Creates the relationship for the give persons in the provided family with given relationshiptype.\r\n\t * @param rt\r\n\t * @param parentId\r\n\t * @param childId\r\n\t * @param familyId\r\n\t * @return - Relationship created with the given type in the given family for the given persons\r\n\t * @throws Exception\r\n\t */\r\n\tpublic Relationship createRelationship(RelationshipType rt, String parentId, String childId, String familyId) throws Exception;\r\n\t/**\r\n\t * Creates a family with given name.\r\n\t * @param name\r\n\t * @return - Family ID of the created family\r\n\t */\r\n\tpublic String createFamily(String name);\r\n\t/**\r\n\t * Provides any one person from the given family.\r\n\t * @param familyId\r\n\t * @return - Person ID from the given family\r\n\t */\r\n\tpublic String getFamilyPerson(String familyId);\r\n\t/**\r\n\t * Provides the Person Id of the root member of this family.\r\n\t * @param familyId\r\n\t * @return - Person ID of the root member in the family.\r\n\t */\r\n\tpublic String getFamilyRoot(String familyId);\r\n\t/**\r\n\t * Checks if the family exists with given ID.\r\n\t * @param familyId\r\n\t * @return boolean\r\n\t */\r\n\tpublic boolean isFamily(String familyId);\r\n}",
"public default Tagged<T> wrap( T object ){\n\t\treturn new Tagged<T>(object);\n\t}",
"private static interface Node {\n\t\t/**\n\t\t * Set value to child node identified by given ID.\n\t\t * \n\t\t * @param childID child ID is a field name or array/list index.\n\t\t * @param value node value.\n\t\t * @throws ConverterException if value is primitive and fail to convert to field type.\n\t\t * @throws IllegalAccessException this exception is required by reflective field signature but never thrown.\n\t\t */\n\t\tvoid setValue(String childID, Object value) throws ConverterException, IllegalAccessException;\n\n\t\t/**\n\t\t * Returns child node identified by its ID or null if not found. A child ID is the field name or array/list index.\n\t\t * \n\t\t * @param childID child ID is a field name or array/list index.\n\t\t * @return child node or null.\n\t\t * @throws IllegalAccessException this exception is required by reflective field signature but never thrown.\n\t\t */\n\t\tNode getChild(String childID) throws IllegalAccessException;\n\t}",
"Object visitObject(ObjectNode node, Object state);",
"public interface IHierarchyAdapter {\r\n\t/**\r\n\t * Liefert die Kindobjekte als Collection oder null<br>\r\n\t * Wird eine Collection von der eigenen Klasse verlangt, soll diese erstellt werden!\r\n\t * @param <T>\r\n\t * @param clz\r\n\t * @return\r\n\t */\r\n\tpublic <T> Collection<T> getChildrenCollection(Class<T> clz);\r\n\t\r\n\t/**\r\n\t * Ist identisch zu {@link IHierarchyAdapter#getChildrenCollection(Class)} zu implementieren,\r\n\t * ohne jedoch eine Collection erstellen zu müssen. (Performance)\r\n\t * @param <T>\r\n\t * @param clz\r\n\t * @return\r\n\t */\r\n\tpublic <T> boolean canGetChildrenCollection(Class<T> clz);\r\n}",
"@Override\n\tpublic void VisitNewObjectNode(NewObjectNode Node) {\n\n\t}",
"public Node createNode(Object object, Class<?> type) {\n\t\t\tif (Types.isKindOf(object.getClass(), List.class)) {\n\t\t\t\treturn new ListNode(object, type);\n\t\t\t}\n\t\t\tif (object.getClass().isArray()) {\n\t\t\t\treturn new ArrayNode(object);\n\t\t\t}\n\t\t\treturn new ObjectNode(object);\n\t\t}",
"public interface MultiListEntity<T> {\n\n public List<T> getMultiListChildData();\n\n public String getData();\n\n}",
"@Override\n public void accept(TreeVisitor visitor) {\n }",
"public MyTree getTree() {\r\n\t\treturn tree;\r\n\t}",
"public void inTrav(ObjectTreeNode tree) {\n if (tree != null) {\n inTrav(tree.getLeft());\n ((TreeComparable)tree.getInfo()).visit();\n inTrav(tree.getRight());\n }\n }",
"public T caseRoot(Root object) {\r\n\t\treturn null;\r\n\t}",
"public abstract Tree extractMenuItems (Object obj) throws SAFSException;",
"public interface BinNode<T> {\n\n /**\n * Returns the element in the node\n * @return the element in the node\n */\n public T getElement();\n \n /**\n * Changes the element of the node to the element provided\n * @param newvalue\n */\n public void setElement(T newvalue);\n \n /**\n * Returns the left child of the node\n * @return the left child\n */\n public BinNode<T> getLeft();\n \n /**\n * Returns the right child of the node\n * @return the right child\n */\n public BinNode<T> getRight();\n \n /**\n * Returns whether or not the node has any non-null children\n * @return whether the node is a leaf\n */\n public boolean isLeaf();\n \n}",
"public interface ObjectGraph {\n\n\t\n\t/**\n\t * As in neo4j, starts a new transaction and associates it with the current thread.\n\t * @return a transaction from NeoService.\n\t */\n\tTransaction beginTx();\n\n\t/**\n\t * Mirror a java object within the neo4j graph. Only fields annotated with {@code}neo\n\t * will be considered.\n\t * @param o\n\t */\n\t<A> void persist(A... o);\n\n\t/**\n\t * removes all data representing an object from the graph.\n\t * \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t */\n\tvoid delete(Object... o);\n\t\n\t\n\t/**\n\t * Looks up a neo4j graph node using it's java object\n\t * mirror. \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t * @return neo4j node represented by o\n\t */\n\tNode get(Object o);\n\t\n\t/**\n\t * Looks up all instances of {@code}type in the graph.\n\t * \n\t * @param type a type previously stored in the graph\n\t * @return a Collection of {@code}type instances.\n\t */\n\t<T> Collection<T> get(Class<T> type);\n\n\t/**\n\t * Type safe lookup of object given it's neo4j nodeid.\n\t * Your domain classes may use {@link Nodeid#id()} to discover\n\t * their neo4j nodeid. \n\t * \n\t * @param t\n\t * @param key neo4j node id.\n\t * @return\n\t */\n\t<T> T get(Class<T> t, long key);\n\n\t\n\t/**\n\t * Return an object represented by <code>node</code> provided\n\t * the node was created by jo4neo.\n\t * \n\t * @param node\n\t * @return an object that mirrors node.\n\t */\n\tObject get(Node node);\n\t\n\t/**\n\t * Looks up the node representation of a given \n\t * uri. This method may update your graph if no node\n\t * was previously allocated for the uri.\n\t * \n\t * @return the node representation of uri.\n\t */\n\tNode get(URI uri);\n\n\n\t/**\n\t * Unmarshal a collections of nodes into objects.\n\t * \n\t */\n\t<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);\n\n\t/**\n\t * Closes this ObjectGraph after which it will be unavailable \n\t * for use. Calling close is necessary, and should be called even\n\t * if the application is halted suddenly. ObjectGraph's maintain \n\t * a lucene index which may become corrupt without proper shutdown.\n\t * \n\t */\n\tvoid close();\n\n\t/**\n\t * Begin fluent interface find. <code>a</code> should be \n\t * a newly constructed instance as it's contents will be modified/initialized\n\t * by this call.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * </code>\n\t * </pre>\n\t * \n\t * @param a\n\t * @return\n\t */\n\t<A> Where<A> find(A a);\n\n\t/**\n\t * Counts child entities without loading objects into memory. This is preferable to \n\t * using Collection.size(), which would load the full collection into memory.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * long numOrders = graph.count(customer.orders);\n\t * </code>\n\t * </pre>\n\t * \n\t * @param values a collection value from a jo4neo annotated field.\n\t * @return\n\t */\n\tlong count(Collection<? extends Object> values);\n\n\t/**\n\t * Returns a collection of entities added since <code>d</code>.\n\t * Type <code>t</code> must be annotated with {@link Timeline}\n\t * \n\t * @see Timeline\n\t * \n\t */\n\t<T> Collection<T> getAddedSince(Class<T> t, Date d);\n\n\t/**\n\t * Returns a collection of entities added bewteen dates from and to.\n\t * Type <code>t</code> must be annotated with {@link Timeline}.\n\t * \n\t * @see Timeline\n\t */\n\t<T> Collection<T> getAddedBetween(Class<T> t, Date from,\n\t\t\tDate to);\n\n\t\n\t/**\n\t * Returns up to <code>max</code> most recently added instances of type <code>t</code>\n\t * \n\t * @param max limit the number of instances returned\n\t * @see neo#recency()\n\t */\n\t<T> Collection<T> getMostRecent(Class<T> t, int max);\n\t\n\t\n\t<T> T getSingle(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> get(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> fullTextQuery(Class<T> t, String indexname, Object value);\n\n}",
"void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}",
"public static TreeModel toTreeModel(Object value)\n {\n if (value instanceof TreeModel)\n return (TreeModel) value;\n\n // if we don't have a treeModel at this point then\n // try to convert the value into a list and create a\n // tree that has no subtrees. it will just be a bunch of\n // root nodes.\n // Later on, if we can recognize some common POJO pattern as\n // being a tree, we can adapt it here.\n return new ChildPropertyTreeModel(value, null);\n }",
"public void insertBST(Object o) {\n ObjectTreeNode p, q;\n \n ObjectTreeNode r = new ObjectTreeNode(o);\n if (root == null)\n root = r;\n else {\n p = root;\n q = root;\n while (q != null) {\n p = q;\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0 )\n q = p.getLeft();\n else\n q = p.getRight();\n }\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0)\n setLeftChild(p, r);\n else\n setRightChild(p, r);\n }\n }",
"@Override\n public List<Person> getChildren(Person object, boolean fullDepth) {\n return getChildren(object);\n }",
"public GenealogyTree(T root) {\r\n tree = (T[]) new Object[SIZE];\r\n tree[0] = root;\r\n }",
"public interface Node {\n @Override\n String toString();\n\n void setValue(String value);\n\n void addAttribiute(String key1, String value);\n\n void addChild(Node child1);\n}",
"public interface IQuadTree<T extends INodeElement<T>>\n{\n\t/**\n\t * Metoda sa vola pri zmene pozicii vrchola.\n\t * \n\t * @param v\n\t * Vertex\n\t * @param old\n\t * Stara pozicia = null tak prvok sa pridava prvykrat\n\t */\n\tpublic void insert(T vertex, Point2D pos);\n\t\n\t/**\n\t * Najdi a vymaz prvok zo stromu.\n\t * @param element\n\t * @param pos\n\t * @return\n\t */\n\tpublic boolean remove(T element, Point2D pos);\n\n\t/**\n\t * Spusti IWalkThrought pre vsetky objekty ktory su v oblasti Rectangle.\n\t * \n\t * @param re\n\t * @param i\n\t */\n\tpublic void walk(Rectangle re, IWalkThrought<T> i);\n\n\t/**\n\t * Prehladaj cely strom a najdi prvok.\n\t * Teda sa nehlada podla pozicie objektu ale vsade.\n\t * \n\t * @param element\n\t * @return\n\t */\n\tpublic Node<T> findSlow(T element);\n\n\t/**\n\t * Vymaz vsetky objekty v strome, ktore su totozne s element.\n\t * \n\t * @param element\n\t */\n\tpublic void removeAll(Object element);\n\n\t/**\n\t * Interface ktory sa spusta na kazdu skupinu vertexov v 1 node.\n\t * Prvky vo vnutri by som nemal modifikovat lebo su v QDtree.\n\t * \n\t * Povodne to bol interface na 1 prvok, ale toto by to malo urychlit.\n\t * \n\t * Interface pri VertexsInRectangle moze spustit vertexi hoci sedia mimo obrazovky.\n\t * O dalsie sa postara JUNG ktory to este raz otestuje\n\t * Alebo ked v jednom NODE su napriklad len 4 prvky tak mozme vypnut dalsiu kontrolu a zobrazit\n\t * to.\n\t * \n\t * @author Lukas Sekerak\n\t * \n\t * @param <T>\n\t */\n\tpublic interface IWalkThrought<T>\n\t{\n\t\tpublic void walkThrought(ArrayList<T> v);\n\t}\n\n\t/**\n\t * Vrat elementy v danej oblasti.\n\t * \n\t * @param point\n\t * @return\n\t */\n\tpublic ArrayList<T> getElements(Point2D point);\n\n\t/**\n\t * Vymaz vsetko v strome.\n\t */\n\tpublic void clear();\n}",
"@Override\n\tpublic void accept(TreeVisitor visitor) {\n\n\t}",
"public void treeStructureChanged(TreeModelEvent e) {\n //To change body of implemented methods use Options | File Templates.\n }",
"public interface RMITreeNode extends Remote {\n\n\t/**\n\t * Set the father of the RMITreeNodeImpl. If it's set to null, the RMITreeNodeImpl becomes a root.\n\t * @param father The father of the RMITreeNodeImpl. If it's null, the RMITreeNodeImpl is a root.\n\t */\n\tpublic void setFather(RMITreeNode father) throws RemoteException;\n\t\n\tpublic void addChild(RMITreeNode child) throws RemoteException;\n\t\n\tpublic void removeChild(int index) throws RemoteException;\n\t\n\tpublic void removeChild(RMITreeNode child) throws RemoteException;\n\t\n\t/**\n\t * Remove every child of the RMITreeNode so it becomes a leaf.\n\t */\n\tpublic void clearChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getFather() throws RemoteException;\n\t\n\tpublic List<RMITreeNode> getChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getChild(int index) throws RemoteException;\n\t\n\tpublic String getName() throws RemoteException;\n\t\n\t/**\n\t * Return a String containing the trace of the propogation since its beginning.\n\t * @return The trace of the propogation.\n\t * @throws RemoteException\n\t */\n\tpublic String getTrace() throws RemoteException;\n\t\n\t/**\n\t * Give data as an array of byte to the RMITreeNode in order to propagate to the leaves of the tree.\n\t * @param data The data to propagate to the leaves of the tree.\n\t * @return The trace of the entire propagation.\n\t * @throws RemoteException\n\t */\n\tpublic String propagate(byte[] data) throws RemoteException;\n\t\n\t/**\n\t * Send data as an array of byte to every children of the RMITreeNode.\n\t * If the node is a leaf, put the message in the trace.\n\t * @param data An array of byte containing the data to send to the children.\n\t * @return The trace of the children receiving the data.\n\t * @throws RemoteException\n\t */\n\tpublic String sendDataToChildren(byte[] data) throws RemoteException;\n\n}",
"public DomainTreeIterator(EditingDomain domain, Object object, boolean includeRoot)\n {\n super(object, includeRoot);\n this.domain = domain;\n }",
"public abstract Object getUnderlyingObject();",
"public interface TreeModel {\n\n double checkAccuracy(DataSource d);\n void crossValidate(DataSource testdata);\n void pessimisticPrune(double z);\n void printTree();\n\n}",
"public TreeTag()\n {\n setNoField(true);\n setRootVisible(true);\n icons = new HashMap<String, Object>();\n }",
"@Override\n\tpublic <K extends BasePojo> List<K> getTreeViewList() throws Exception {\n\t\treturn null;\n\t}",
"public BinarySearchTree(JSONObject object) {\r\n\t\tthis.root = null;\r\n for (Object key : object.keySet()) {\r\n \taddKeyValuePair(String.valueOf(key).toLowerCase(), (String)object.get(key));\r\n }\r\n\t}",
"public interface ComplexDataObjectParser extends IKeyValueObjectParser<Object, ComplexDataObject> {\r\n\r\n}",
"public interface TreeNodeService {\n\n /**\n * Gets tree.\n * 根据parent_id 生成tree\n *\n * @param pid the pid\n * @param list the list\n * @return tree tree\n */\n List<TreeNode> getTree(long pid, List<TreeNode> list);\n\n}",
"public abstract OtTreeNodeWidget copy();",
"public Node encode(Object obj) {\n Node node = null;\n\n if (obj != null) {\n String name = mxCodecRegistry.getName(obj);\n mxObjectCodec enc = mxCodecRegistry.getCodec(name);\n\n if (enc != null) {\n node = enc.encode(this, obj);\n }\n else {\n if (obj instanceof Node) {\n node = ((Node)obj).cloneNode(true);\n }\n else {\n System.err.println(\"No codec for \" + name);\n }\n }\n }\n\n return node;\n }",
"public abstract boolean isObject(T type);",
"interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }",
"public myBinaryTree<T> my_mirror();",
"public void postTrav(ObjectTreeNode tree) {\n if (tree != null) {\n postTrav(tree.getLeft());\n postTrav(tree.getRight());\n ((TreeComparable)tree.getInfo()).visit();\n }\n }",
"public interface LinkTree<E> extends BinaryTree<E> {\n /** Adds a root node to an empty tree */\n public Position<E> addRoot(E e) throws NonEmptyTreeException;\n /** Inserts a left child at a given node. */\n public Position<E> insertLeft(Position<E> v, E e) throws InvalidPositionException;\n /** Inserts a right child at a given node. */\n public Position<E> insertRight(Position<E> v, E e) throws InvalidPositionException;\n /** Removes a node with zero or one child. */\n public E remove(Position<E> v) throws InvalidPositionException;\n /** Attaches two trees to be subtrees of an external node. */\n public void attach(Position<E> v, BinaryTree<E> T1, BinaryTree<E> T2) throws InvalidPositionException;\n}",
"public interface GNode{\n\n\tpublic String getName();\n\tpublic GNode[] getChildren();\n\tpublic ArrayList<GNode> walkGraph(GNode parent);\n\tpublic ArrayList<ArrayList<GNode>> paths(GNode parent);\n\n}",
"@SuppressWarnings(\"unchecked\")\n\t// caused by instanceof simulation\n\tprivate <T extends EObject> List<T> allSubobjectsOfKind(EObject rootObject,\n\t\t\tClass<T> type) {\n\t\tList<T> result = new LinkedList<T>();\n\t\tTreeIterator<EObject> iterator = rootObject.eAllContents();\n\t\twhile (iterator.hasNext()) {\n\t\t\tEObject eObj = iterator.next();\n\t\t\tif (eObj.getClass() == type) { // simulates instanceof\n\t\t\t\tresult.add((T) eObj);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public interface Node extends TreeComponent {\n /**\n * The types of decision tree nodes available.\n */\n enum NodeType {\n Internal,\n Leaf\n }\n\n /**\n * Gets the type of this node.\n * @return The type of node.\n */\n NodeType getType();\n\n void print();\n\n String getClassLabel(DataTuple tuple);\n}",
"public void insertBSTDup(Object o) {\n ObjectTreeNode p, q;\n \n ObjectTreeNode r = new ObjectTreeNode(o);\n if (root == null)\n root = r;\n else {\n p = root;\n q = root;\n while (q != null && ((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) != 0) {\n p = q;\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0)\n q = p.getLeft();\n else\n q = p.getRight();\n }\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0)\n setLeftChild(p, r);\n else if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) > 0)\n setRightChild(p, r);\n else ((TreeComparable)(p.getInfo())).operate((TreeComparable)(r.getInfo()));\n }\n }",
"public Object clone()\n\t{\n\t\treturn new Tree();\n\t}",
"@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}",
"protected void addHierarchyPropertyDescriptor ( Object object )\n {\n itemPropertyDescriptors.add ( createItemPropertyDescriptor ( ( (ComposeableAdapterFactory)adapterFactory ).getRootAdapterFactory (), getResourceLocator (), getString ( \"_UI_Site_hierarchy_feature\" ), getString ( \"_UI_PropertyDescriptor_description\", \"_UI_Site_hierarchy_feature\", \"_UI_Site_type\" ), GlobalPackage.Literals.SITE__HIERARCHY, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null ) );\n }",
"public interface CustomObjectExpansionModel<T> {\n\n static <T> CustomObjectExpansionModel<CustomObject<T>> of(){\n return new CustomObjectExpansionModelImpl<>();\n }\n}",
"@FunctionalInterface\npublic interface TreeGenerator {\n /**\n * Constructs a new tree data structure.\n *\n * @param type\n * the required return type of the tree\n * @param depth\n * the maximum depth of any nodes of the tree\n * @return the newly created tree data structure\n */\n Node generate(Type type, int depth);\n}",
"public void setTree(MyTree t) {\r\n\t\ttree = t;\r\n\t}",
"public interface GeometricalObjectVisitor {\n\n\t/**\n\t * Visits the given line.\n\t * \n\t * @param line\n\t * to visit\n\t */\n\tpublic abstract void visit(Line line);\n\n\t/**\n\t * Visits the given circle.\n\t * \n\t * @param circle\n\t * to visit\n\t */\n\tpublic abstract void visit(Circle circle);\n\n\t/**\n\t * Visits the given filled circle.\n\t * \n\t * @param filledCircle\n\t * to visit\n\t */\n\tpublic abstract void visit(FilledCircle filledCircle);\n\n\tpublic abstract void visit(FilledPolygon filledPolygon);\n}",
"DataTree getDatatypeHierarchy();",
"public GenericDomainObject() {\n\tkeys = new LinkedHashMap<String, Object>();\n\tattributes = new LinkedHashMap<String, Object>();\n }",
"public List<T> accessReadChildElements(T obj);",
"public void setObject(T object)\n\t{\n\t\tthis.object = object;\n\t}",
"boolean visitSmartContainer(Object o);",
"private ObjectClassWrapper findObjectClassWrapperInTree( ObjectClassImpl oc )\n {\n SchemaWrapper schemaWrapper = findSchemaWrapperInTree( oc.getSchema() );\n if ( schemaWrapper == null )\n {\n return null;\n }\n \n // Finding the correct node\n int group = Activator.getDefault().getPreferenceStore().getInt( PluginConstants.PREFS_SCHEMA_VIEW_GROUPING );\n List<TreeNode> children = schemaWrapper.getChildren();\n if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_FOLDERS )\n {\n for ( TreeNode child : children )\n {\n Folder folder = ( Folder ) child;\n if ( folder.getType() == FolderType.OBJECT_CLASS )\n {\n for ( TreeNode folderChild : folder.getChildren() )\n {\n ObjectClassWrapper ocw = ( ObjectClassWrapper ) folderChild;\n if ( ocw.getObjectClass().equals( oc ) )\n {\n return ocw;\n }\n }\n }\n }\n }\n else if ( group == PluginConstants.PREFS_SCHEMA_VIEW_GROUPING_MIXED )\n {\n for ( Object child : children )\n {\n if ( child instanceof ObjectClassWrapper )\n {\n ObjectClassWrapper ocw = ( ObjectClassWrapper ) child;\n if ( ocw.getObjectClass().equals( oc ) )\n {\n return ocw;\n }\n }\n }\n }\n \n return null;\n }",
"public interface NodeManager<K extends Comparable<K>, V> extends Closeable, Monitorable {\n\n /**\n * Returns the root node of the specified <code>BTree</code>.\n * \n * @param btree the BTree.\n * @return the root node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> getRoot(BTree<K, V> btree) throws IOException;\n\n /**\n * Sets the new root node.\n * \n * @param root the new root node.\n * @throws IOException if an I/O problem occurs.\n */\n void setRoot(Node<K, V> root) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified node.\n * \n * @param node the node.\n * @return the decorated node.\n * @throws IOException if an I/O problem occurs.\n */\n @SuppressWarnings(\"unchecked\")\n Node<K, V>[] wrapNodes(Node<K, V>... nodes) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified node.\n * \n * @param node the node.\n * @return the decorated node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> wrapNode(Node<K, V> node) throws IOException;\n\n /**\n * Allows the user of the node to retrieve the original node.\n * \n * @param node the decorated node.\n * @return the node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> unwrapNode(Node<K, V> node) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified value.\n * \n * @param value the value.\n * @return the decorated value.\n * @throws IOException if an I/O problem occurs.\n */\n ValueWrapper<V> wrapValue(V value) throws IOException;\n \n /**\n * {@inheritDoc}\n */\n @Override\n void close();\n}",
"public abstract int getNodeType();"
]
| [
"0.6556851",
"0.63736445",
"0.61401516",
"0.6123832",
"0.6088042",
"0.5918048",
"0.5894614",
"0.5883975",
"0.58781624",
"0.58305824",
"0.5829313",
"0.57495797",
"0.5738761",
"0.5735329",
"0.5725699",
"0.5714407",
"0.57054687",
"0.57004386",
"0.56992704",
"0.5675073",
"0.566309",
"0.56426793",
"0.561503",
"0.5613464",
"0.5610455",
"0.5587852",
"0.55672383",
"0.5537254",
"0.5530812",
"0.5520739",
"0.5498896",
"0.5496607",
"0.54957646",
"0.5474217",
"0.547323",
"0.54703623",
"0.5427197",
"0.5405636",
"0.53895205",
"0.53858536",
"0.53770053",
"0.5361518",
"0.5348948",
"0.5327361",
"0.53227884",
"0.53129697",
"0.5295208",
"0.52940166",
"0.5287692",
"0.5285505",
"0.52758014",
"0.5266633",
"0.5261203",
"0.52546966",
"0.52540153",
"0.5252336",
"0.5243434",
"0.523384",
"0.52323467",
"0.52320516",
"0.5228571",
"0.5226047",
"0.5222055",
"0.5215805",
"0.52113897",
"0.5210774",
"0.5210769",
"0.5207608",
"0.520547",
"0.5204011",
"0.5202155",
"0.520104",
"0.52001935",
"0.5196242",
"0.51953864",
"0.5194826",
"0.518121",
"0.5169577",
"0.516374",
"0.5162345",
"0.5148477",
"0.5148398",
"0.514209",
"0.5139599",
"0.5134014",
"0.51224667",
"0.5120731",
"0.5114045",
"0.5111395",
"0.51037073",
"0.5087039",
"0.5086055",
"0.50855494",
"0.50843483",
"0.50665474",
"0.50621736",
"0.50484776",
"0.5042762",
"0.50425744",
"0.5037398"
]
| 0.7286086 | 0 |
Returns immediate parent of this item | Object getParent(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ILitePackItem getParent();",
"IMenuItem getParent();",
"public String getParent() {\n return _theParent;\n }",
"public String getParent() {\r\n return parent;\r\n }",
"public String getParent() {\n return _parent;\n }",
"public String getParent() {\n return parent;\n }",
"public VisualLexiconNode getParent() {\n \t\treturn parent;\n \t}",
"public BinomialTree<KEY, ITEM> parent()\n\t{\n\t\treturn _parent;\n\t}",
"public String getParent() {\r\n return this.parent;\r\n }",
"public Object getParent() {\r\n return this.parent;\r\n }",
"public XMLPath getParent() {\r\n return this.parent == null ? null : this.parent.get();\r\n }",
"public Object getParent() {\n return this.parent;\n }",
"public Object getParent() {\n return this.parent;\n }",
"public Object getParent() {\n return this.parent;\n }",
"public CompoundExpression getParent (){\n return _parent;\n }",
"public CompoundExpression getParent()\r\n\t\t{\r\n\t\t\treturn _parent;\r\n\t\t}",
"public String getParent(String anItem) { return null; }",
"public String getParent(String anItem) { return null; }",
"public Foo getParent() {\n return parent;\n }",
"public int getParent();",
"public Entity getParent() {\n return parent;\n }",
"public OwObject getParent()\r\n {\r\n return m_Parent;\r\n }",
"public CompositeObject getParent(\n )\n {return (parentLevel == null ? null : (CompositeObject)parentLevel.getCurrent());}",
"@Override\n\tpublic WhereNode getParent() {\n\t\treturn parent;\n\t}",
"public StructuredId getParent()\r\n {\r\n return parent;\r\n }",
"public ParseTreeNode getParent() {\r\n return _parent;\r\n }",
"Node<T> parent();",
"public Instance getParent() {\r\n \t\treturn parent;\r\n \t}",
"MenuEntry getParent();",
"public WidgetParent getParent() {\n return this.m_parent;\n }",
"public int Parent() { return this.Parent; }",
"final MenuContainer getParent_NoClientCode() {\n return parent;\n }",
"public T getParent(T anItem) { return null; }",
"TMNodeModelComposite getParent() {\n return parent;\n }",
"public Node getParent() {\r\n\t\t\treturn parent;\r\n\t\t}",
"public Node getParent() {\r\n\t\t\treturn parent;\r\n\t\t}",
"public Node getParent() {\n return parent;\n }",
"public Node getParent() {\n return parent;\n }",
"public TreeNode getParent ()\r\n {\r\n return parent;\r\n }",
"public Path getParent(\n ) {\n return this.parent;\n }",
"public SearchTreeNode getParent() { return parent; }",
"public IPSComponent peekParent();",
"public abstract T getParent(T anItem);",
"public SearchNode<S, A> getParent() {\r\n\t\treturn parent;\r\n\t}",
"public AppFile getParent(AppFile anItem) { return anItem.getParent(); }",
"public XMLElement getParent()\n/* */ {\n/* 323 */ return this.parent;\n/* */ }",
"public PafDimMember getParent() {\r\n\t\treturn parent;\r\n\t}",
"public IAVLNode getParent() {\n\t\t\treturn this.parent; // to be replaced by student code\n\t\t}",
"public String getParent() {\r\n return (String) getAttributeInternal(PARENT);\r\n }",
"public PageTreeNode getParent() {\n return parent;\n }",
"public String getParentId() {\n return getParent() != null ? getParent().getId() : null;\n }",
"@VTID(9)\r\n @ReturnValue(type=NativeType.Dispatch)\r\n com4j.Com4jObject getParent();",
"public Kit getParent() {\n return this.parent;\n }",
"public SqlFromSubSelect getParent() {\n return parent;\n }",
"IGLProperty getParent();",
"public ProductContainer getParent();",
"public Node getParent(){\n return parent;\n }",
"@Override\r\n\tpublic TreeNode getParent() {\n\t\treturn parent;\r\n\t}",
"public int getParentID() {\n\t\treturn parentID;\n\t}",
"public EventNode getParent() {\n\t\treturn parent;\n\t}",
"public Tree<T> getParent()\n {\n return this.parent;\n }",
"public Optional<Cause> getParent() {\n return this.parent;\n }",
"public int getParentID() {\n\t\treturn _parentID;\n\t}",
"public TreeNode getParent() {\n\t\treturn null;\n\t}",
"public Node getParent();",
"public int getParent_id() {\n return this.parent_id;\n }",
"public TreeNode getParent()\n {\n return mParent;\n }",
"@VTID(7)\r\n void getParent();",
"public Node<T> getParent() {\n return this.parent;\n }",
"@Override\r\n\tpublic TreeNode getParent() {\n\t\treturn this.parent;\r\n\t}",
"public Ent getParent(){\n\t\treturn (Ent)bound.getParent();\n\t}",
"public Integer getParentid() {\n\t\treturn parentid;\n\t}",
"public String getParentId() {\n return getProperty(Property.PARENT_ID);\n }",
"public Resource getParent()\n {\n if(parent == null)\n {\n if(parentId != -1)\n {\n try\n {\n parent = new ResourceRef(coral.getStore().getResource(parentId), coral);\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"corrupted data parent resource #\"+parentId+\n \" does not exist\", e);\n }\n }\n else\n {\n parent = new ResourceRef(null, coral);\n }\n }\n try\n {\n return parent.get();\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"in-memory data incosistency\", e);\n }\n }",
"CoreParentNode coreGetParent();",
"protected LambdaTerm getParent() { return parent; }",
"public FileIndex getParent()\n {\n return( parent );\n }",
"public String getParentName() {\n return parentName;\n }",
"public String getParentName() {\n return parentName;\n }",
"public UpTreeNode<E> getParent() {\n\t\t\treturn parent;\n\t\t}",
"public Node getParentNode() {\n return parentNode;\n }",
"public Comment getParent () {\n return parentComment;\n }",
"public E getParentEntity() {\n return parentEntity;\n }",
"public int getParentNode(){\n\t\treturn parentNode;\n\t}",
"public MenuTree getParent(){\n return this.parentMenuTree;\n }",
"public @Nullable Node<@Nullable T> getParent() {\n return this.parent;\n }",
"@JsProperty\n Node getParentNode();",
"public TreeNode getParent()\r\n\t{\r\n\t\treturn m_parent;\r\n\t}",
"@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();",
"@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();",
"@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();",
"@VTID(9)\n @ReturnValue(type=NativeType.Dispatch)\n com4j.Com4jObject getParent();",
"public abstract Optional<TypeName> parent();",
"@Override\n\tpublic TreeNode getParent() {\n\t\treturn this.parent ;\n\t}",
"public TestResultTable.TreeNode getParent() {\n return parent;\n }",
"public RMParentShape getParent() { return _parent; }",
"Spring getParent() {\n return parent;\n }",
"@Override\n\tpublic Tag getParent() {\n\t\treturn this.parentTag;\n\t}",
"protected Directory getParent() {\n return parent;\n }",
"public Object getParent()\n {\n return traversalStack.get(traversalStack.size() - 2);\n }"
]
| [
"0.7840944",
"0.7766023",
"0.7729814",
"0.77037704",
"0.7698172",
"0.76944274",
"0.76909804",
"0.76693743",
"0.7612053",
"0.75888956",
"0.7586234",
"0.7581663",
"0.7581663",
"0.7581663",
"0.7560674",
"0.7541696",
"0.7530293",
"0.7530293",
"0.75213987",
"0.7516302",
"0.74739116",
"0.7454235",
"0.74398917",
"0.73993284",
"0.7380826",
"0.7376836",
"0.7360873",
"0.7354463",
"0.7344948",
"0.73400927",
"0.7322123",
"0.73149693",
"0.73142755",
"0.73113",
"0.73105866",
"0.73105866",
"0.7302794",
"0.7302794",
"0.7286119",
"0.7274934",
"0.72706085",
"0.7265064",
"0.7264377",
"0.7246855",
"0.724179",
"0.7241122",
"0.7238846",
"0.7236537",
"0.72134906",
"0.7204272",
"0.72032106",
"0.71922886",
"0.7187406",
"0.717688",
"0.71679175",
"0.7166856",
"0.71556467",
"0.71473515",
"0.714562",
"0.7139873",
"0.71285313",
"0.71247053",
"0.71197927",
"0.7115834",
"0.7113379",
"0.7112027",
"0.71117085",
"0.7100155",
"0.70960975",
"0.70838857",
"0.7083245",
"0.70806694",
"0.7069828",
"0.7052453",
"0.7050445",
"0.7049393",
"0.7046037",
"0.7041946",
"0.70369065",
"0.7029958",
"0.7027211",
"0.70264065",
"0.7025108",
"0.70219505",
"0.7017678",
"0.70165735",
"0.7013083",
"0.7003203",
"0.70017195",
"0.70017195",
"0.70017195",
"0.70017195",
"0.69991064",
"0.69898254",
"0.69860035",
"0.69851446",
"0.69833976",
"0.69708705",
"0.696982",
"0.69668394"
]
| 0.7405561 | 23 |
Tells if item has children | boolean hasChildren(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasChildren()\n/* */ {\n/* 487 */ return !this.children.isEmpty();\n/* */ }",
"@Override\r\n \tpublic boolean hasChildren() {\n \t\treturn getChildren().length > 0;\r\n \t}",
"public boolean hasChildren()\n\t{\n\t\treturn !getChildren().isEmpty();\n\t}",
"@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}",
"@Override\n\tpublic boolean hasChildren() {\n\t\treturn this.children!=null && this.children.length>0 ;\n\t}",
"@Override\r\n\tpublic boolean hasChildren() {\n\t\tSystem.out.println(\"this children is=\"+this.children);\r\n\t\tif(this.children==null||this.children.isEmpty()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn !this.children.isEmpty();\r\n\t}",
"public boolean containsChild() {\n return !(getChildList().isEmpty());\n }",
"@objid (\"808c086e-1dec-11e2-8cad-001ec947c8cc\")\n public final boolean hasChildren() {\n return !this.children.isEmpty();\n }",
"public boolean hasChilds() {\n return childs != null && !childs.isEmpty();\n }",
"private boolean _hasChild() {\r\n boolean ret = false;\r\n if (_childs != null && _childs.size() > 0) {\r\n ret = true;\r\n }\r\n\r\n return ret;\r\n }",
"default boolean hasChildren() {\n return iterator().hasNext();\n }",
"boolean hasChildNodes();",
"public boolean HasChildren() {\n\t\treturn left_ptr != null && right_ptr != null;\n\t}",
"public boolean hasChildren(Object element) {\n\t\treturn false;\r\n\t}",
"public final boolean hasChild ()\r\n {\r\n return _value.hasChild();\r\n }",
"@Override\n public boolean currentHasChildren() {\n return ! ((FxContainerNode) currentNode()).isEmpty();\n }",
"@Override\n public boolean currentHasChildren() {\n return ! ((FxContainerNode) currentNode()).isEmpty();\n }",
"public boolean isChild();",
"@Override\r\n\tpublic boolean hasChildren() {\n\t\tif (taskNodeList != null)\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"@Override\r\n\t\tpublic boolean hasChildNodes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}",
"public boolean hasItemExpanded() {\n int childCount = getChildCount();\n for (int i = 0; i < childCount; i++) {\n final View child = getChildAt(i);\n if (((LayoutParams) child.getLayoutParams()).isOpen) {\n return true;\n }\n }\n return false;\n }",
"public static boolean shouldRenderChildren(UIComponent component) {\n for (int i = 0; i < component.getChildCount(); i++) {\n if (component.getChildren().get(i).isRendered()) {\n return true;\n }\n }\n\n return false;\n }",
"boolean hasParent();",
"boolean hasParent();",
"public abstract boolean getRendersChildren();",
"public boolean hasMultipleChildren(String childName) {\n return children(childName).size() > 1;\n }",
"public boolean hasChild(int groupPos) {\n return mChildDataList.get(groupPos) == null ? false : mChildDataList.get(groupPos).size() != 0;\n }",
"@Override\n\t\tpublic boolean isLeaf() {\n\t\t\treturn getChildCount() == 0;\n\t\t}",
"public final boolean isChildrenLayoutNecessary() {\n return isStatusBitsNonZero(CHILDREN_LAYOUT_NECESSARY_BIT);\n }",
"public boolean isSupportsChildren() {\n return supportsChildren;\n }",
"public boolean isLeaf() {\n return children.size() == 0;\n }",
"public boolean isLeaf() {\n return children.size() == 0;\n }",
"protected final boolean isLeaf() {\n return (getChildIds().isEmpty());\n }",
"public boolean getAllowsChildren() { return !isLeaf(); }",
"public boolean hasItem() {\n return null != item;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\tmodCount = root.numChildren();\n\t\treturn (modCount == 0);\n\t}",
"public boolean isLeaf() {\n\t\treturn children.isEmpty();\n\t}",
"public boolean isHaveChildren(List source, Tree tree) {\n\t\tboolean result = false;\r\n\t\tif (tree.getChildrenTrees() != null\r\n\t\t\t\t&& !tree.getChildrenTrees().isEmpty()) {\r\n\t\t\tresult = true;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public boolean hasItem() {\n return this.item != null;\n }",
"public boolean isLeaf() {\r\n return (_children == null) || (_children.size() == 0);\r\n }",
"public boolean hasSubTaxa() {\n\t\treturn !children.isEmpty();\n\t}",
"public boolean getAllowsChildren()\n {\n return true;\n }",
"boolean hasNested();",
"public boolean hasItem() {\n return (this.curItem != null);\n }",
"public boolean isEmpty()\n{\n // If any attributes are not default return false\n if(getMaxTime()!=5 || getFrameRate()!=25 || !SnapUtils.equals(getEndAction(),\"Loop\"))\n return false;\n \n // Iterate over owner children and if any are not empty, return false\n for(int i=0, iMax=getOwner().getChildCount(); i<iMax; i++)\n if(!isEmpty(getOwner().getChild(i)))\n return false;\n \n // Return true since every child was empty\n return true;\n}",
"public boolean isChild(){\r\n return(leftleaf == null) && (rightleaf == null)); \r\n }",
"private boolean isLeaf() {\n return this.children == null;\n }",
"public int getChildCount() {return children.size();}",
"public void setHasChildren(boolean hasChildren) {\n this.hasChildren = hasChildren;\n }",
"public boolean hasChild(String name) {\n return peekObject().getFieldNames().contains(name);\n }",
"private boolean isAllChildCompleted() {\n for (IBlock iBlock : getChildren()) {\n if (iBlock.getType() != BlockType.DISCUSSION && !iBlock.isCompleted()) {\n return false;\n }\n }\n for (IBlock iBlock : getChildren()) {\n if (iBlock.getType() == BlockType.DISCUSSION) {\n iBlock.setCompleted(1);\n }\n }\n return getChildren().size() > 0;\n }",
"public boolean \n childExists\n (\n Comparable key\n ) \n {\n return pChildren.containsKey(key);\n }",
"private boolean hasLeftChild(int i) {\n return leftIndex(i) <= size;\n }",
"public boolean isChild(){\n return false;\n }",
"public Boolean hasItems() {\n return this.hasItems;\n }",
"private boolean hasLeftChild(int index) {\n return leftChild(index) <= size;\n }",
"public boolean isParent(T anItem) { return false; }",
"public boolean isLeaf(){\n\t\treturn (childList == null || childList.size() == 0);\n\t}",
"private boolean isChildContent(List<String> row) {\n\t\tif(row.get(4).isEmpty()&&!row.get(5).isEmpty()&&!row.get(6).isEmpty()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean hasVisibleItems();",
"public boolean hasMoreItems();",
"public boolean isChild(){\n return child;\n }",
"public boolean isChild(){\n return child;\n }",
"boolean hasRecursive();",
"@Override\n \t\tpublic boolean isEmpty() {\n \t\t\treturn (state != null && state.getChildrenCount(currentPage) == 0);\n \t\t}",
"public boolean isChild() {\n\t\treturn false;\n\t}",
"public boolean isNotEmpty(){\n return root != null;\n }",
"default boolean isChild(@NotNull Type type, @NotNull Meta element, @NotNull List<Object> parents) {\r\n return false;\r\n }",
"public boolean getAllowsChildren() {\n\t\treturn false;\n\t}",
"public abstract boolean isParent(T anItem);",
"public boolean hasRecursive() {\n return recursive_ != null;\n }",
"public boolean hasRecursive() {\n return recursiveBuilder_ != null || recursive_ != null;\n }",
"private boolean hasParent(int index) {\n return index > 1;\n }",
"private boolean hasRightChild(int index) {\n return rightChild(index) <= size;\n }",
"public boolean isLeaf()\n/* */ {\n/* 477 */ return this.children.isEmpty();\n/* */ }",
"public boolean contains(Shape shape)\n {\n // checks if the child is in the children list\n return children.contains(shape);\n }",
"public boolean containsNoItems() {\n\t\treturn (this.items.size() == 0);\n\t}",
"@Override\n public int getChildrenCount()\n {\n return children.getSubNodes().size();\n }",
"public boolean isLeaf() {\r\n\t\t\treturn (children.size() == 0);\r\n\t\t}",
"public String getHaschild() {\n return haschild;\n }",
"public Boolean getIsChild() {\n return isChild;\n }",
"default boolean isParent(@NotNull Type type, @NotNull Meta meta, @NotNull List<Object> children) {\r\n return false;\r\n }",
"public boolean isChild(int position) {\n if (mSelectedGroupPos != -1) {\n return position > mSelectedGroupPos && position < mSelectedGroupPos +\n getChildCount(mSelectedGroupPos) + 1;\n }\n return false;\n }",
"public Boolean isParentable();",
"private boolean childrenAreInitialized() {\r\n\t\treturn (securityActor != null);\r\n\t}",
"private boolean hasParent(int i) {\n return i > 1;\n }",
"public int countChildren() {\n return this.children.size();\n }",
"boolean hasParentalStatus();",
"private boolean hasRightChild(int i) {\n return rightIndex(i) <= size;\n }",
"boolean isItEmpty(){\n\t\t\tif (this.items.isEmpty() && (this.receptacle.isEmpty() || findSpecialtyContainers())){//if there's nothing in there.\n\t\t\t\tSystem.out.println(\"\\nThere's nothing here to do anything with.\");\n\t\t\t\treturn true;}\n\t\t\treturn false;\n\t\t}",
"@Override\n public boolean isDefined()\n {\n return getValue() != null || getChildrenCount() > 0\n || getAttributeCount() > 0;\n }",
"public boolean hasParent() {\r\n if (parent == null) \r\n return false;\r\n \r\n return true;\r\n }",
"public boolean hasAChild(Character ch){\n return children.containsKey(ch);\n }",
"public boolean hasChild(String id) {\n\t\treturn childMap.containsKey(id);\n\t}",
"public boolean isHaveChildren(List source, String treeid) {\n\t\tboolean result = false;\r\n\t\tif (source == null || source.isEmpty() || source.size() < 1\r\n\t\t\t\t|| StringUtils.isEmpty(treeid)) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tIterator it = source.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap item = (Map) it.next();\r\n\t\t\tif (item.get(StringPool.TREE_PARENTID) != null) {\r\n\t\t\t\tif (item.get(StringPool.TREE_PARENTID).toString()\r\n\t\t\t\t\t\t.equals(treeid)) {\r\n\t\t\t\t\tresult = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}",
"public boolean isFull() {\n int size = 0;\n for (int i = 0; i < items.length; i++) {\n if (items[i] != null) {\n size++;\n }\n }\n return size == items.length;\n }",
"public boolean isInterestedInAllItems();",
"@Override\n public final int size() {\n return children.size();\n }",
"private boolean isEmpty()\r\n\t{\r\n\t\treturn getRoot() == null;\r\n\t}",
"public boolean hasParent() {\n return getParent() != null;\n }"
]
| [
"0.8356129",
"0.83427",
"0.83176905",
"0.8151436",
"0.8151436",
"0.8130908",
"0.80998033",
"0.80882585",
"0.80119556",
"0.79373974",
"0.78576285",
"0.75949854",
"0.74163324",
"0.73461825",
"0.72844046",
"0.7076238",
"0.7076238",
"0.7075823",
"0.70154",
"0.6950616",
"0.689588",
"0.68517125",
"0.6843302",
"0.6843302",
"0.6832465",
"0.6799632",
"0.67640597",
"0.6731923",
"0.6729338",
"0.6682689",
"0.6670191",
"0.6670191",
"0.6661396",
"0.6653513",
"0.66454077",
"0.66287947",
"0.66209334",
"0.6598572",
"0.65763426",
"0.654913",
"0.65433735",
"0.65299004",
"0.6518324",
"0.65017885",
"0.6481173",
"0.6453632",
"0.64351994",
"0.6431351",
"0.64284307",
"0.6428368",
"0.64234155",
"0.6398706",
"0.6381545",
"0.6366904",
"0.6350976",
"0.6348832",
"0.63458353",
"0.63430256",
"0.6333331",
"0.6330889",
"0.6327256",
"0.6305984",
"0.6305984",
"0.6298788",
"0.62827903",
"0.62653434",
"0.62596226",
"0.6252101",
"0.62479025",
"0.62381893",
"0.6234409",
"0.6211747",
"0.62080306",
"0.6206795",
"0.6200777",
"0.6191278",
"0.6183013",
"0.6174068",
"0.6168958",
"0.6165737",
"0.6147696",
"0.61401856",
"0.61362803",
"0.61219627",
"0.6120845",
"0.6110481",
"0.6110178",
"0.61016405",
"0.60842115",
"0.60806674",
"0.6076883",
"0.60714287",
"0.6050201",
"0.60450184",
"0.6042179",
"0.6040592",
"0.60398024",
"0.6034826",
"0.6011069",
"0.6003599"
]
| 0.8660109 | 0 |
Returns number of children | int getChildCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int countChildren() {\n return this.children.size();\n }",
"public abstract int getNumChildren();",
"public int numberOfChildren() {\n\t\tif(children == null) return 0;\n\t\telse return children.size();\n\t}",
"public int countChildren() {\n return this.children.size();\n }",
"public int getChildCount();",
"public int getChildCount() {return children.size();}",
"int childCount(){\n return this.children.size();\n }",
"int childrenSize();",
"public int getChildCount() {\r\n if (_children == null) {\r\n return 0;\r\n }\r\n return _children.size();\r\n }",
"@Override\n public int getNumChildren() {\n\t return this._children.size();\n }",
"public int getChildCount()\n/* */ {\n/* 500 */ return this.children.size();\n/* */ }",
"public int getChildCount() {\n return this.children.size();\n }",
"public int getChildCount()\n {\n return mChildren.length; // The indexes and constraints\n }",
"@DISPID(11)\n\t// = 0xb. The runtime will prefer the VTID if present\n\t@VTID(20)\n\tint childrenCount();",
"@Override\n public int getChildrenCount()\n {\n return children.getSubNodes().size();\n }",
"@Override\n\tpublic int getChildrenNum() {\n\t\treturn children.size();\n\t}",
"public int childrenSize()\r\n\t{\r\n\t\treturn this.children.size();\r\n\t}",
"public int getChildCount () {\n return childCount;\n }",
"protected int numChildren() {\r\n return 3;\r\n }",
"@Override\n public final int size() {\n return children.size();\n }",
"public StringWithCustomFacts getNumChildren() {\n return numChildren;\n }",
"public int getLengthOfChildren() {\n int length = 0;\n IBiNode childTmp;\n\n if (this.child != null) {\n // length of first child\n length += this.child.getLength();\n\n childTmp = this.child.getSibling();\n while (childTmp != null) {\n // length of 2nd - nth children\n length += childTmp.getLength();\n childTmp = childTmp.getSibling();\n }\n\n }\n\n return length;\n }",
"public int getTotalChildren() {\n\t\treturn _nTotalChildren;\n\t}",
"@Override\n\tpublic int size() {\n\t\tmodCount = root.numChildren();\n\t\treturn modCount;\n\t}",
"@Override\n public int getChildrenCount(String name)\n {\n return children.getSubNodes(name).size();\n }",
"public int size() {\n int count = terminal ? 1 : 0;\n for (Set<String> child : children)\n if (child != null) count += child.size();\n return count;\n }",
"public int getChildCount() { return 0; }",
"public int getChildCount() { return data.length; }",
"abstract long calculateChildCount() throws TskCoreException;",
"@FameProperty(name = \"numberOfChildren\", derived = true)\n public Number getNumberOfChildren() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }",
"private int numChildren(int index){\n\t\t\n\t\tint children = 0;\n\t\t\n\t\tif((index*2) + 1 <= this.currentSize){\n\t\t\tif(array[(index * 2) + 1] != null){\n\t\t\t\tchildren++;\n\t\t\t}\n\t\t}\n\t\tif((index*2) + 1 <= this.currentSize){\n\t\t\tif(array[(index * 2) + 2] != null){\n\t\t\t\tchildren++;\n\t\t\t}\n\t\t}\n\t\treturn children;\n\t}",
"int getNumberOfChildren(int nodeID){\n check(nodeID);\n return nodes_[nodeID].size_;\n }",
"int getChildrenCount(int groupPosition);",
"public int shapeCount()\n {\n // return the number of children in the list\n return children.size();\n }",
"public Integer GetNumOfChild() {\n\t\treturn this.ChildSMILES.size();\n\t}",
"public int childListCount() // 페이징, 검색 뺐음, A반 기준 -> 나중에 반 생성 시 변경하기. ★학부모 정보 제외함 (회원가입안할 시 에러)\r\n\t\t\tthrows Exception {\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement pstmt = null;\r\n\t\tResultSet rs = null;\r\n\t\tint result = 0;\r\n\r\n\t\ttry {\r\n\t\t\tconn = getConnection();\r\n\r\n\t\t\tpstmt = conn.prepareStatement(\"select count(child_num) from child where child_class = 'A'\");\r\n\t\t\trs = pstmt.executeQuery();\r\n\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tresult = rs.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (rs != null)\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t} catch (SQLException ex) {\r\n\t\t\t\t}\r\n\t\t\tif (pstmt != null)\r\n\t\t\t\ttry {\r\n\t\t\t\t\tpstmt.close();\r\n\t\t\t\t} catch (SQLException ex) {\r\n\t\t\t\t}\r\n\t\t\tif (conn != null)\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException ex) {\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public int size() {\r\n\t\tint i = 0;\r\n\t\tif (this.value != 0) {\r\n\t\t\ti++;\r\n\t\t\tif(this.leftChild != null) {\r\n\t\t\t\ti = i + this.leftChild.size();\r\n\t\t\t}\r\n\t\t\tif(rightChild != null){\r\n\t\t\t\ti = i + this.rightChild.size();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn i; \r\n\t}",
"int numChildren(Position<E> p) throws IllegalArgumentException;",
"@Override\n public int getChildrenCount(int groupPosition) {\n return children[groupPosition].length;\n }",
"public static int size(Node root){\r\n int count = 0;\r\n for(int i=0; i<root.children.size(); i++){\r\n Node child = root.children.get(i);\r\n count += size(child);\r\n }\r\n return count + 1;\r\n }",
"@Override\n public int getChildrenCount(int groupPosition)\n {\n return children.get(headers.get(groupPosition)).size();\n }",
"public int size() {\n return tree.count();\n }",
"public int getAccessibleChildrenCount() {\n try {\n return unoAccessibleContext.getAccessibleChildCount();\n } catch (com.sun.star.uno.RuntimeException e) {\n return 0;\n }\n }",
"private int getNumberOfChildren(String elemId) {\n return selenium.getXpathCount(\"//*[@id='\" + elemId + \"']/*\").intValue();\n }",
"@Override\n\tpublic int getChildrenCount(int groupPosition) {\n\t\treturn listChildren.get(listTitles.get(groupPosition)).size();\n\t}",
"@Override\n\tpublic int size() {\n\t\tint s = valCount; // saves value of current node\n\t\tfor (int i = 0; i < childCount; ++i) { // then checks all children\n\t\t\ts += children[i].size();\n\t\t}\n\t\treturn s;\n\t}",
"public abstract int getMaxChildren();",
"public int order()\n\t{\n\t\treturn null == _children ? 0 : _children.size();\n\t}",
"@Override\n public int getChildrenCount(int groupPosition) {\n return getGroup(groupPosition).getChildrenCount();\n }",
"public int size() {\n\t\treturn root.count();\n\t}",
"public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }",
"private static int getNumChildren() {\n Scanner input = new Scanner(System.in);\n\n System.out.print(\"Enter number of children: \");\n int numChildren = input.nextInt();\n return numChildren;\n }",
"@Override\r\n\tpublic int getNumberOfDescendants(Node<T> node) {\r\n\t\tif (node.getChildren() != null) {// Si tiene hijos\r\n\t\t\treturn (node.getChildren()).size();// El tamaņo de la lista de hijos\r\n\t\t}\r\n\t\treturn 0; // Si no tiene entonces 0\r\n\t}",
"@Override\r\n\tpublic int getChildCount(Object parent) {\r\n\t\r\n\t\treturn 0;\r\n\t}",
"public int getAncestorCount() { return _parent!=null? getParent().getAncestorCount() + 1 : 0; }",
"public int getChildCount(Object parent) {\n\t\tint result = 0;\n\t\tFile file = (File) parent;\n\n\t\tif (file instanceof Directory) {\n\t\t\tDirectory directory = (Directory) file;\n\t\t\tresult = directory.getNumberOfChildren();\n\t\t}\n\t\treturn result;\n\t}",
"@Override\n\tpublic int getChildrenCount(int sectionPosition) {\n\t\treturn sections.get(sectionPosition).getArrayChildren().size();\n\t}",
"public int size() {\r\n int count = 0;\r\n for (int i = 0; i < SIZE; i++) {\r\n if (tree[i] != null) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }",
"public int countNodes(){\r\n \treturn count(root);\r\n }",
"public int getAllChildrenNumber(String path) throws KeeperException.NoNodeException {\n return dataTree.getAllChildrenNumber(path);\n }",
"public int countNodes() {\r\n \r\n // call the private countNodes method with root\r\n return countNodes(root);\r\n }",
"private int countChildElements(final Node parent)\r\n {\r\n NodeList listOfChildren = parent.getChildNodes();\r\n return listOfChildren.getLength();\r\n }",
"public int size() \r\n\t{\r\n\t\treturn size(root);\r\n\t}",
"int getParentIdCount();",
"public int size() {\n\t\treturn size(root);\n\t}",
"public int size() {\n\t\treturn size(root);\n\t}",
"public @Override int getViewCount() {\n return getChildren().getChildCount();\n }",
"public final int size() {\r\n return sequentialSize(root);\r\n }",
"public int size() {\n\t\t// TODO\n\t\treturn size(root);\n\t}",
"@Override\n public int getChildrenCount() {\n return 1 + mRecentTabsManager.getRecentlyClosedEntries().size();\n }",
"public int countChildren(Nodo t) {\r\n int count = 0;\r\n if(t == null)\r\n return 0;\r\n if(t.getLeft() != null)\r\n count++;\r\n count += countChildren(t.getLeft());\r\n if(t.getRight() != null)\r\n count++;\r\n count += countChildren(t.getRight());\r\n return count;\r\n }",
"public int size(){\n return size(root);\n }",
"public int size() {\n return size(root);\n }",
"public int size() {\n return size(root);\n }",
"@Override\r\n public int getChildrenCount(int groupPosition) {\n return mDataList.get(\"\" + groupPosition).size();\r\n }",
"@Override\r\n\tpublic int getNumberOfNodes() {\r\n\t\tint contador = 0;// Contador para el recursivo\r\n\t\treturn getNumberOfNodesRec(contador, raiz);\r\n\t}",
"int size()\r\n\t{\r\n\t\treturn size(root);\r\n\t}",
"public int numberOfNodes() {\n return numberOfNodes(root);\n }",
"public int getChildCount(V vertex);",
"@Override\r\n\tpublic int getChildrenCount(int groupPosition) {\n\t\treturn musicMap.get(arrSongHeader.get(groupPosition)).size();\r\n\t}",
"public int size() \n {\n return size(root);\n }",
"@Override\n public int getNumberOfNodes() {\n int numNodes = 0;\n\n if (!isEmpty()) {\n numNodes = root.getNumberOfNodes();\n }\n\n return numNodes;\n }",
"int getNodeCount();",
"int getNodeCount();",
"public int size() {\n if(root == null){\n return 0;\n }\n else{\n return 1 + size(root.lc) + size(root.rc);\n }\n }",
"public int\tgetChildCount(Object parent) {\n \tif (! (parent instanceof IdentityBranch)) return -1;\n \tIdentityBranch ibParent = (IdentityBranch)parent;\n \treturn ibParent.getChildCount();\n }",
"public int countNodes()\n {\n return countNodes(root);\n }",
"public int countNodes()\n {\n return countNodes(root);\n }",
"public int countNodes()\r\n {\r\n return countNodes(root);\r\n }",
"int getNodesCount();",
"int getNodesCount();",
"public int size()\n {\n return _root.size();\n }",
"public int size() \n\t {\n\t\t return size(root);\n\t }",
"public int getRowCount()\n {\n // Get level of the node to be displayed\n int rowCount = displayNode.getLevel();\n \n // Add number of children\n rowCount = rowCount + displayNode.getChildCount();\n \n // Increment by 1 if the root node is being displayed\n if (rootVisible) \n { \n rowCount++; \n }\n \n // Return number of rows\n return rowCount;\n }",
"public int nodeCount(){\r\n\t\treturn size;\r\n\t}",
"public int size()\r\n\t {\r\n\t\t if(root == null)\r\n\t\t {\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t return root.getSubTreeSize();\r\n\t }",
"@Override\n\tpublic int size() {\n\t\treturn size(root);\n\t}",
"public int count( ) {\n if(empty()) {\n return 0;\n } else{\n return countNodes(root);\n }\n }",
"@Override\n public int size() {\n return size(root); }",
"public int size(){\n if(root!=null){ // มี node ใน tree\n return size(root);\n }\n else{\n return 0; // tree เปล่า size 0\n }\n }"
]
| [
"0.88218534",
"0.87664574",
"0.8758004",
"0.8755249",
"0.8747987",
"0.8656182",
"0.86233485",
"0.8559981",
"0.85585666",
"0.8543808",
"0.84548926",
"0.84538764",
"0.8332777",
"0.8309579",
"0.82941645",
"0.826627",
"0.8233127",
"0.82005084",
"0.8097772",
"0.808028",
"0.80445874",
"0.7982173",
"0.7880761",
"0.7821014",
"0.78172565",
"0.7808164",
"0.7779074",
"0.77380395",
"0.7732091",
"0.7698066",
"0.7640485",
"0.7636365",
"0.76064855",
"0.7602193",
"0.7532114",
"0.7438394",
"0.7424821",
"0.74129874",
"0.7408365",
"0.74068594",
"0.738454",
"0.737577",
"0.73489237",
"0.73423874",
"0.7296313",
"0.7268606",
"0.72544825",
"0.7242468",
"0.7209181",
"0.7207391",
"0.72004473",
"0.7099024",
"0.7084539",
"0.7046935",
"0.7030861",
"0.70276123",
"0.70253646",
"0.7014484",
"0.69930196",
"0.6990977",
"0.69895875",
"0.6940198",
"0.69338757",
"0.6932162",
"0.6921343",
"0.6921343",
"0.6920818",
"0.691091",
"0.69066066",
"0.68954027",
"0.6889371",
"0.6866359",
"0.6853587",
"0.6853587",
"0.6850025",
"0.68466586",
"0.6845988",
"0.68202525",
"0.6811969",
"0.6810375",
"0.6806361",
"0.6804297",
"0.67967063",
"0.67967063",
"0.67856294",
"0.6778684",
"0.67729145",
"0.67729145",
"0.67622536",
"0.6755679",
"0.6755679",
"0.67494726",
"0.67447215",
"0.6744524",
"0.67401963",
"0.6735618",
"0.67327476",
"0.6724644",
"0.67229635",
"0.67204386"
]
| 0.88393754 | 0 |
Returns array of child items as generic Objects | Object[] getChildArray(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Collection<ChildType> getChildren();",
"public List<RealObject> getChildren();",
"public interface ITreeObject {\r\n\r\n\tpublic static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; \r\n\t/**\r\n\t * Returns immediate parent of this item\r\n\t * @return immediate parent item or null if this item has no parent or parent is unknown \r\n\t */\r\n\tObject getParent();\r\n\r\n\t/**\r\n\t * Tells if item has children \r\n\t * @return true if this item has children \r\n\t */\r\n\tboolean hasChildren();\r\n\t\r\n\t/**\r\n\t * Returns number of children \r\n\t * @return child count \r\n\t */\r\n\tint getChildCount();\r\n\t\r\n\t/**\r\n\t * Returns array of child items as generic Objects\r\n\t * @return array of child items or empty array if item has no children \r\n\t */\r\n\tObject[] getChildArray();\r\n}",
"List<Tag<? extends Type>> getChildren();",
"public Object[] getChildren(Object o) {\n\t\t\tIDocument entry = ((IDocument)o);\r\n\t\t\treturn entry.toArray();\t\t\t\t\t \r\n\t\t}",
"public List<BaseObject> getAllItems() {\n ArrayList<BaseObject> list = new ArrayList<BaseObject>(ufos);\n list.add(ship);\n list.addAll(bombs);\n list.addAll(rockets);\n return list;\n }",
"public ArrayList<GUIObject> getChildObjects() {\n return new ArrayList<>();\n }",
"T[] getObjects() {\n\t\treturn this.array;\n\t}",
"public Object[] getItems()\n {\n return items.toArray();\n }",
"public List<T> accessReadChildElements(T obj);",
"@Nonnull\n Iterable<? extends T> getChildren();",
"protected abstract List<T> getChildren();",
"public T[] items();",
"public abstract List<Object> getAll();",
"public static List<Artist> makeChild1() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"public List getChildren(){\n List result = new ArrayList();\n Iterator it = getSpecialisation().iterator();\n while(it.hasNext()){\n Generalization g = (Generalization)it.next(); \n result.add(g.getChild());\n //System.out.println(\" \"+getName()+\" Parent:\" +g.getParent().getName());\n }\n return result;\n }",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<T> getList() {\r\n\t\tgetEntityManager().flush();\r\n\t\treturn getEntityManager().createQuery(\r\n\t\t\t\t\"select OBJECT(o) from \" + getClassType().getSimpleName() + \" o order by o.id\")\r\n\t\t\t\t.getResultList();\r\n\t}",
"E[] getAll();",
"private List<IClass> getChildren(IClass cls) {\n\t\tList<IClass> subclasses = new ArrayList<IClass>();\n\t\tCollections.addAll(subclasses, cls.getDirectSubClasses());\n\t\treturn subclasses;\n\t}",
"public Collection<BaseGenerator> \n getChildren() \n {\n return Collections.unmodifiableCollection(pChildren.values());\n }",
"public Human[] getChildren() {\n return children;\n }",
"@Override\n\tpublic Object[] getChildren(Object parentElement) {\n\t\tObject[] children = this.getList(parentElement, POCOutlineContentProvider.KEY_CHILDREN);\n\t\treturn children != null ? children : new Object[0];\n\t}",
"public static List<Artist> makeChild2() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"default <A> A getItemsAs( Class<A> arrayTypeClass ) {\n return DataConverter.get().convert( getRawItems(), arrayTypeClass );\n }",
"public List<ItemTypeDTO> getAll();",
"public ResultMap<BaseNode> listChildren();",
"public ObjectList<DynamicModelPart> getChildren() {\n return this.children;\n }",
"Collection<T> getSimpleModelObjects();",
"public Item[] toItemArray()\r\n {\r\n Item[] a = new Item[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Item) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }",
"@Override\n\tpublic Object[] getChildren(Object arg0) {\n\t\t// This method-chaining is necessary! Why? Otherwise the reference to\n\t\t// the given object (arg0) wouldn't be\n\t\t// available when the ContentProvider (ImportSource in our case) calls\n\t\t// his getParent()-method.\n\t\treturn setChildOrgUnits(arg0).getChildOrgUnits().toArray();\n\t}",
"@JsonIgnore public Collection<Mass> getCarbohydrateContents() {\n final Object current = myData.get(\"carbohydrateContent\");\n if (current == null) return Collections.emptyList();\n if (current instanceof Collection) {\n return (Collection<Mass>) current;\n }\n return Arrays.asList((Mass) current);\n }",
"public <T> Collection<T> getChildrenCollection(Class<T> clz);",
"public static List<Artist> makeChild4() {\n Artist q = new Artist(\"\", true);\n\n return Arrays.asList(q);\n }",
"public XMLElement[] getChildren()\n/* */ {\n/* 532 */ int childCount = getChildCount();\n/* 533 */ XMLElement[] kids = new XMLElement[childCount];\n/* 534 */ this.children.copyInto(kids);\n/* 535 */ return kids;\n/* */ }",
"@Override\r\n public List getComplexChildClasses() throws Exception\r\n {\n return null;\r\n }",
"MergeHandler[] getChildren();",
"public List<T> getItems() {\n return SerDes.unmirrorList(getElement().getItems(), getItemClass());\n }",
"public List<TipoAnimalEntity> obtenerTipoAnimal(){\n List<TipoAnimalEntity> tipoAnimal = persistence.findall();\n return tipoAnimal;\n }",
"abstract public Collection<? extends IZipNode> getChildren();",
"public Item2Vector<Concept> getChildren() { return children; }",
"protected String[] doListChildren()\n {\n return (String[])m_children.toArray( new String[ m_children.size() ] );\n }",
"@DISPID(-2147417075)\n @PropGet\n com4j.Com4jObject children();",
"public AST[] getChildren()\r\n {\n \tif (children == null) {\r\n \t\tList<AST> temp = new java.util.ArrayList<AST>();\r\n \t\ttemp.addAll(fields);\r\n \t\ttemp.addAll(predicates);\r\n \t\ttemp.addAll(constructors);\r\n \t\ttemp.addAll(methods);\r\n \t\tchildren = (AST[]) temp.toArray(new AST[0]);\r\n \t}\r\n \treturn children;\r\n }",
"public Mass getCarbohydrateContent() throws ClassCastException;",
"Collection<Element> getElementTreeFromPlainList() {\n Map<String, Element> values = new HashMap<String, Element>();\n for (String[] s : data) {\n values.put(s[0], new Element(s[2], s[1]));\n }\n\n // creates a result list\n Collection<Element> result = new ArrayList<Element>();\n\n // for each element in the result list that has a parent, put it into it\n // otherwise it is added to the result list\n for (Element e : values.values()) {\n if (e.parent != null) {\n values.get(e.parent).getChildren().add(e);\n } else {\n result.add(e);\n }\n }\n\n return result;\n }",
"Collection<Element> getElementTreeFromPlainList() {\n Map<String, Element> values = new HashMap<String, Element>();\n for (String[] s : data) {\n values.put(s[0], new Element(s[2], s[1]));\n }\n\n // creates a result list\n Collection<Element> result = new ArrayList<Element>();\n\n // for each element in the result list that has a parent, put it into it\n // otherwise it is added to the result list\n for (Element e : values.values()) {\n if (e.parent != null) {\n values.get(e.parent).getChildren().add(e);\n } else {\n result.add(e);\n }\n }\n\n return result;\n }",
"public interface Children {\n\t\n\tpublic void setChild(String children);\n\t\n\tpublic ArrayList<String> getChild();\n\n\tpublic void addChild(Profile children) throws NotToBeChildException;\n\t\n\tpublic void deleteChild(Profile children);\n}",
"public ObjectArrayTemplateElement()\n {\n super(Object[].class, obj -> {\n if (obj instanceof Collection)\n {\n return ((Collection) obj).toArray();\n }\n throw new UnsupportedOperationException(\"Can't convert object (\" + obj.getClass().getName() + \") to Object[]: \" + obj);\n }, Collection.class::isAssignableFrom);\n }",
"public List<Item> getValues() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not an object.\");\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate Entity[] castEntityAsArray(final Entity entity)\n\t{\n\t\t// determine the type of class this is at runtime and create an array for it\n\t\tClass<? extends Entity> anyTypeClass = (Class<? extends Entity>) entity.getClass();\n\t\tEntity[] newArray = (Entity[]) Array.newInstance(anyTypeClass, 1);\n\t\tnewArray[0] = entity;\n\t\treturn newArray;\n\t}",
"public Collection getChildren(int wantedMask)\n {\n final int mask = wantedMask & ALL_TYPES_MASK;\n\n return new ChildrenCollection(mask, objectNode.getChildren());\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic T[] asArray() {\n\t\t// have to use explicit cast because we cannot use the alternative signature of toArray(T[]), as you cannot instantiate an array of a\n\t\t// type parameter (not even an empty array)\n\t\treturn (T[]) this.itemList.toArray();\n\t}",
"java.util.List<io.opencannabis.schema.commerce.OrderItem.Item> \n getItemList();",
"@Override\n public Object build() {\n return this.getChildren().stream()\n .map(child -> (org.opensearch.search.aggregations.AbstractAggregationBuilder) child.build()).collect(Collectors.toList());\n }",
"ArrayList<Expression> getChildren();",
"public Object[] getChildren(Object parentElement) {\n\t\treturn null;\r\n\t}",
"private Object[] elements() {\n return elements.toArray();\n }",
"public Item[] getItems()\n {\n return items;\n }",
"@NotNull\n @Override\n public TreeElement[] getChildren() {\n return callChildren(this, navigationItem);\n }",
"public ArrayList<String> getObjects(){\n ArrayList<String> objs = new ArrayList<>();\n for (int i = 0; i < field.length; i++){\n objs.add(\"Asteroid\");\n }\n return objs;\n }",
"public String[] listChildren()\n/* */ {\n/* 519 */ int childCount = getChildCount();\n/* 520 */ String[] outgoing = new String[childCount];\n/* 521 */ for (int i = 0; i < childCount; i++) {\n/* 522 */ outgoing[i] = getChild(i).getName();\n/* */ }\n/* 524 */ return outgoing;\n/* */ }",
"Object[] toArray();",
"Object[] toArray();",
"Object[] toArray();",
"@SuppressWarnings(\"WeakerAccess\")\n @NonNull\n protected List<T> convert(@NonNull final Object data) {\n final List<Object> objects = CoreReflection.getObjects(data, false);\n if (objects == null) return Collections.singletonList(convertSingle(data));\n\n final ArrayList<T> list = new ArrayList<>();\n for (final Object object: objects)\n if (!CoreReflection.isNotSingle(object))\n list.add(convertSingle(object));\n\n return list;\n }",
"Object getTolist();",
"public List<Item> getItemList();",
"public interface MultiListEntity<T> {\n\n public List<T> getMultiListChildData();\n\n public String getData();\n\n}",
"@Override\n public List<Person> getChildren(Person object, boolean fullDepth) {\n return getChildren(object);\n }",
"@Override\n public Set<T> getItems() {\n return items;\n }",
"public static List<Artist> makeChild3() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"public Node[] getChildren(){\n return children.values().toArray(new Node[0]);\n }",
"private List<SimpleNode> getChildren(SimpleNode node) {\n Class<?> nodeType = node.getClass();\n List<SimpleNode> children = new ArrayList<>();\n for (int i = 0; i < node.jjtGetNumChildren(); i++) {\n children.addAll(flatten(node.jjtGetChild(i), nodeType));\n }\n return children;\n }",
"@SuppressWarnings(\"unchecked\")\n public <T extends Resource> List<T> getChildren(Class<T> type)\n {\n Resource[] allChildren = getChildren();\n List<T> filteredChildren = new ArrayList<T>();\n for(Resource child : allChildren)\n {\n if(type.isAssignableFrom(child.getClass()))\n {\n filteredChildren.add((T)child);\n }\n }\n return filteredChildren;\n }",
"public static List<Artist> makeChild7() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"public Node[] getChildren(){return children;}",
"List<SoftObjectReference> getObjects();",
"public abstract ArrayList<? extends Domain> read();",
"public Resource[] getChildren()\n {\n try\n {\n return coral.getStore().getResource(coral.getStore().getResource(getId()));\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"Unexpected inconsitency\", e);\n }\n }",
"ArrayList<RecipeObject> getRecipes();",
"private Object[] localGetChildren(Object arg0) {\r\n\t\t\tArrayList<Object> returnList = new ArrayList<Object>();\r\n\t\t\tObject[] children = super.getChildren(arg0);\r\n\t\t\tfor (Object child: children) {\r\n\t\t\t\tif (child instanceof IViewSite || \r\n\t\t\t\t\tchild instanceof IWorkspaceRoot || \r\n\t\t\t\t\tchild instanceof IFolder)\r\n\t\t\t\t{\r\n\t\t\t\t\treturnList.add(child);\r\n\t\t\t\t} else if (child instanceof IProject) {\r\n\t\t\t\t\tif (((IProject)child).isOpen()) {\r\n\t\t\t\t\t\treturnList.add(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn returnList.toArray(new Object[returnList.size()]);\r\n\t\t}",
"ArrayList<E> getAll();",
"public static List<Artist> makeChild6() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"@Override\n\t\tpublic List<? extends IObject> getChildren() {\n\t\t\tif (!this.hasChildren()) {\n\t\t\t\treturn new ArrayList<>();\n\t\t\t}\n\t\t\tIterator<IFolder> subfolders = this.folder.subfolder();\n\t\t\treturn Lists.transform(ImmutableList.copyOf(subfolders), new Function<IFolder, FolderTreeObject>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic FolderTreeObject apply(IFolder input) {\n\t\t\t\t\treturn new FolderTreeObject(input, FolderTreeObject.this.rootFolder);\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"List<Node<T>> children();",
"public List<Ent> getChildList(){\n\t\tif(this.childList != null){\n\t\t\treturn Collections.unmodifiableList(this.childList);\n\t\t}else{\n\t\t\treturn new ArrayList<Ent>();\n\t\t}\n\t}",
"public Object[] getFilteredChildren() {\n\t\treturn getFilteredChildren(txTableViewer);\n\t}",
"public List<XML2JSONObject> getChildren() {\r\n return _childs;\r\n }",
"@Override\n public LiveWebModel[] getChildren() {\n return pages;\n }",
"public ArrayList getChildren()\n {\n return children;\n }",
"protected java.util.Map get_ChildClasses()\n {\n return __mapChildren;\n }",
"protected java.util.Map get_ChildClasses()\n {\n return __mapChildren;\n }",
"protected java.util.Map get_ChildClasses()\n {\n return __mapChildren;\n }",
"@SuppressWarnings(\"unchecked\")\n\t// caused by instanceof simulation\n\tprivate <T extends EObject> List<T> allSubobjectsOfKind(EObject rootObject,\n\t\t\tClass<T> type) {\n\t\tList<T> result = new LinkedList<T>();\n\t\tTreeIterator<EObject> iterator = rootObject.eAllContents();\n\t\twhile (iterator.hasNext()) {\n\t\t\tEObject eObj = iterator.next();\n\t\t\tif (eObj.getClass() == type) { // simulates instanceof\n\t\t\t\tresult.add((T) eObj);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"java.util.List<com.rpg.framework.database.Protocol.Item> \n getItemsList();",
"public ArrayList getChildren() {\n return m_values;\n }",
"void loadChilds() throws ApplicationException {\n\t\t\t// iterate over childs\n\t\t\tGenericIterator list = element.getChildren();\n\t\t\twhile (list.hasNext()) {\n\t\t\t\tnew Item(this.parentItem, (GenericObjectNode) list.next());\n\t\t\t}\n\t\t}",
"public static List<Artist> makeChild5() {\n Artist q = new Artist(\"\", true);\n return Arrays.asList(q);\n }",
"@Override\n\t\tpublic Object[] toArray() {\n\t\t\treturn snapshot().toArray();\n\t\t}",
"@Override\n\tpublic ArrayList<Object[]> tousEmplo() {\n\t\tfor (Employe emplo : treeMap.values()) {\n\t\t\tObject[] aux = { emplo.getId(), emplo.getNom(), emplo.getPrenom(),\n\t\t\t\t\templo.getDate_N(), emplo.getSexe(), emplo.getRue(),\n\t\t\t\t\templo.getNumero(), emplo.getVille(), emplo.getPay(),\n\t\t\t\t\templo.getTelef(), emplo.getClass().getName().substring(13) };\n\t\t\tarray.add(aux);\n\t\t}\n\t\treturn array;\n\t}"
]
| [
"0.65088713",
"0.63814247",
"0.6176516",
"0.6120424",
"0.61040795",
"0.6035966",
"0.5960544",
"0.59089625",
"0.58880144",
"0.58819145",
"0.5848955",
"0.58325094",
"0.58100647",
"0.5793748",
"0.5735431",
"0.5716159",
"0.5714628",
"0.5686397",
"0.56674975",
"0.5662709",
"0.5638633",
"0.5637673",
"0.5637345",
"0.5613828",
"0.5571829",
"0.5531446",
"0.5514452",
"0.5511858",
"0.5486035",
"0.5486003",
"0.5485313",
"0.5481191",
"0.54728526",
"0.5461779",
"0.54554003",
"0.54523784",
"0.54506475",
"0.5437789",
"0.54325914",
"0.5424424",
"0.54171604",
"0.54146963",
"0.5412165",
"0.540477",
"0.53935087",
"0.53935087",
"0.53881043",
"0.5380609",
"0.53795177",
"0.53729427",
"0.53719866",
"0.5370864",
"0.53695595",
"0.53628254",
"0.53601044",
"0.5350998",
"0.53492975",
"0.5344004",
"0.5339695",
"0.53381604",
"0.5333766",
"0.5329707",
"0.5329707",
"0.5329707",
"0.53293335",
"0.5328319",
"0.5328176",
"0.53215367",
"0.5310796",
"0.5302627",
"0.53026253",
"0.5284095",
"0.5279195",
"0.52661073",
"0.52648956",
"0.52576524",
"0.52520734",
"0.5251961",
"0.52186865",
"0.52173877",
"0.5216674",
"0.5213832",
"0.52055454",
"0.52055347",
"0.51910037",
"0.51908165",
"0.518525",
"0.51825297",
"0.51810503",
"0.5175065",
"0.51608855",
"0.51608855",
"0.51608855",
"0.5151813",
"0.5148706",
"0.51409906",
"0.51344687",
"0.51302767",
"0.5127337",
"0.51258826"
]
| 0.71852475 | 0 |
get data source from application context | public DataSource getDataSource(){
// open/read the applicliation context file
// belove instruction to ger absolute path of current java apps
//URL location = NaicsUtility.class.getProtectionDomain().getCodeSource().getLocation();
//System.out.println(location);
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("./../db.xml");
DataSource dataSource = null;
try{
dataSource = (DataSource) appContext.getBean("dataSource");
} catch ( Exception ex ) {
logger.log( Level.SEVERE, "ERROR: can't create spring context and data source from application context", ex.getMessage() );
} finally {
appContext.close();
}
return dataSource;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public DataSource getDataSource(Context appContext) {\n // As per\n // http://goo.gl/clVKsG\n // we can rely on the application context never changing, so appContext is only\n // used once (during initialization).\n if (ds == null) {\n //ds = new InMemoryDataSource();\n //ds = new GeneratedDataSource();\n ds = new CacheDataSource(appContext, 20000);\n }\n \n return ds;\n }",
"String getDataSource();",
"protected DataSource getDataSource() {\n\t\treturn dataSource;\n\t}",
"@Override\n public String getDataSource()\n {\n return dataSource;\n }",
"@Override\n\tpublic DataSource getDataSource() {\t\t\n\t\treturn dataSource;\n\t}",
"public DataSource getDataSource() {\n return _dataSource;\n }",
"public String getDataSource() {\n return dataSource;\n }",
"public synchronized String getDataSource(){\n\t\treturn dataSource;\n\t}",
"public String getDataSource() {\n return dataSource;\n }",
"public static DataSource getDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), true);\n }",
"public String getDatasource()\r\n\t{\r\n\t\treturn _dataSource;\r\n\t}",
"public static DataSource getDataSource(){\n try {\n Context context = new InitialContext();\n DataSource ds = (DataSource) context.lookup(\"jdbc/oracle\");\n return ds;\n } catch (NamingException ex) {\n Logger.getLogger(DataSourceBean.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }",
"@Override\n\tpublic DataSource getDataSource() {\n\t\tif(this.dataSource == null) {\n\t\t\ttry {\n\t\t\t\tInitialContext initialContext = new InitialContext();\n\t\t\t\tthis.dataSource = (DataSource) initialContext.lookup(\"java:comp/env/jdbc/DefaultDB\");\n\t\t\t} catch(NamingException e){\n\t\t\t\tthrow new IllegalStateException(e);\n\t\t\t}\n\t\t}\n\t\treturn this.dataSource;\n\t}",
"public DataSource getDataSource() {\r\n return dataSource;\r\n }",
"public DataSource getDataSource() {\n return dataSource;\n }",
"public DataSource getDataSource() {\n return datasource;\n }",
"public DataSource getDataSource() {\n return dataSource;\n }",
"public DataSource getDataSource() {\n return dataSource;\n }",
"public DataSource getDatasource() {\n return datasource;\n }",
"private DataSource getDataSource(DataSourceConfig key) {\n\t\tDataSource dataSource = adminService.getComponent(key.getBeanName(), DataSource.class);\n\t\treturn dataSource;\n\t}",
"public DataSource getDataSource() {\n\t\treturn this.dataSource;\n\t}",
"public DataSource getDataSource()\n\t{\n\t\tLOGGER.info(\"Getting DataSource object\");\n\t\treturn this.dataSource;\n\t}",
"@Profile(\"production\")\r\n @Bean(name=\"DataSourceBean\") \r\n public DataSource getDataSource(){\r\n final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();\r\n dsLookup.setResourceRef(true);\r\n DataSource dataSource = dsLookup.getDataSource(\"jdbc/eshop_db\"); \t \r\n return dataSource;\r\n }",
"public DataSource getDataSource() {\n\t\treturn dataSource;\n\t}",
"String afficherDataSource();",
"public EODataSource queryDataSource();",
"public SimpleDriverDataSource getDataSource() {\n\t\tString path = context.getRealPath(\"/\");\n\t\tString dbpath = path + Utility.DB_PATH;\n\t\tSimpleDriverDataSource dataSource = new SimpleDriverDataSource();\n\t\tFileInputStream fileInputStreamSystemSettings = null;\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tfileInputStreamSystemSettings = new FileInputStream(dbpath);\n\t\t\ttry {\n\t\t\t\tprop.load(fileInputStreamSystemSettings);\n\t\t\t\ttry {\n\t\t\t\t\t// set datasource parameters\n\t\t\t\t\t// set driver\n\t\t\t\t\tdataSource.setDriver(new com.mysql.jdbc.Driver());\n\t\t\t\t\t// set username\n\t\t\t\t\tdataSource.setUsername(prop.getProperty(\"jdbc.username\"));\n\t\t\t\t\t// set password\n\t\t\t\t\tdataSource.setPassword(prop.getProperty(\"jdbc.password\"));\n\t\t\t\t\t// set jdbc url\n\t\t\t\t\tdataSource.setUrl(prop.getProperty(\"jdbc.url\"));\n\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileInputStreamSystemSettings.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn dataSource;\n\t}",
"public String readDataSourcePreferences(){\n\n String dataSourceURL = \"\";\n\n // Get the preferences\n final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences( context );\n\n Boolean dataSourceEnabled = sharedPreferences.getBoolean(\"data_source_check\", false);\n String dataSourcePreference = sharedPreferences.getString( \"data_source\", \"\" );\n\n if ( dataSourceEnabled ) {\n Log.d(\"DATA SOURCE\", sharedPreferences.getString(\"data_source\", \"\"));\n if ( dataSourcePreference.equals( \"Ninguna\" ) ) {\n dataSourceURL = \"http://opendata.caceres.es/sparql\"; // default value\n }\n else {\n dataSourceURL = dataSourcePreference;\n }\n }\n else {\n dataSourceURL = \"http://opendata.caceres.es/sparql\"; // default value\n }\n\n return dataSourceURL;\n }",
"@Bean\n\tpublic DataSource getDataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL)\n\t\t\t\t.addScript(\"crate-db.sql\")\n\t\t\t\t.addScript(\"insert-db.sql\")\n\t\t\t\t.build();\n\t\treturn db;\n\t}",
"@Bean(name = \"dataSource\")\n\tpublic DataSource dataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript(\"db/create-db.sql\").addScript(\"db/insert-data.sql\").build();\n\t\treturn db;\n\t}",
"EDataSourceType getDataSource();",
"public static MyTownDatasource getDatasource() {\n return datasource;\n }",
"public DataSourceFactory getDataSourceFactory() {\n return database;\n }",
"public static JRDataSource getDataSource() {\n\t\treturn new CustomDataSource(1000);\n\t}",
"private DataSource.Factory buildDataSourceFactory() {\n return ((DemoApplication) getApplication()).buildDataSourceFactory();\n }",
"public DataSource getDataSource(CConnection connection)\n\t{\n\t\t//throw new UnsupportedOperationException(\"Not supported/implemented\");\n\t\tif (m_ds != null)\n\t\t\treturn m_ds;\n\t\t\n\t\t//org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource();\n\t\torg.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();\n\t\tds.setDataSourceName(\"CompiereDS\");\n\t\tds.setServerName(connection.getDbHost());\n\t\tds.setDatabaseName(connection.getDbName());\n\t\tds.setUser(connection.getDbUid());\n\t\tds.setPassword(connection.getDbPwd());\n\t\tds.setPortNumber(connection.getDbPort());\n\t\tds.setMaxConnections(50);\n\t\tds.setInitialConnections(20);\n\t\t\n\t\t//new InitialContext().rebind(\"DataSource\", source);\t\t\n\t\tm_ds = ds;\n\t\t\n\t\treturn m_ds;\n\t}",
"@Bean\r\n\tpublic DataSource getDataSource() {\r\n\t\tfinal HikariDataSource dataSource = new HikariDataSource();\r\n\t\t/*\r\n\t\t * The Following is the Oracle Database Configuration With Hikari Datasource\r\n\t\t */\r\n\t\tdataSource.setMaximumPoolSize(maxPoolSize);\r\n\t\tdataSource.setMinimumIdle(minIdleTime);\r\n\t\tdataSource.setDriverClassName(driver);\r\n\t\tdataSource.setJdbcUrl(url);\r\n\t\tdataSource.addDataSourceProperty(\"user\", userName);\r\n\t\tdataSource.addDataSourceProperty(\"password\", password);\r\n\t\tdataSource.addDataSourceProperty(\"cachePrepStmts\", cachePrepareStmt);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSize\", prepareStmtCacheSize);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSqlLimit\", prepareStmtCacheSqlLimit);\r\n\t\tdataSource.addDataSourceProperty(\"useServerPrepStmts\", useServerPrepareStmt);\r\n\t\treturn dataSource;\r\n\t}",
"public FetchingAllDataModel() {\n\n context = AppController.getInstance().getApplicationContext();\n }",
"public DataSource getConfigDatasource() {\n return configDatasource;\n }",
"DataStore getDataStore ();",
"public static String getTestdataContext() {\r\n if (testdataContext == null) {\r\n testdataContext = PropertiesProvider.getInstance().getProperty(\"testdata.context\", \"/testdata\");\r\n }\r\n return testdataContext;\r\n }",
"@Bean\r\n public DataSource dataSource() {\r\n String message = messageSource.getMessage(\"begin\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n dataSource.setDriverClassName(propDatabaseDriver);\r\n dataSource.setUrl(propDatabaseUrl);\r\n dataSource.setUsername(propDatabaseUserName);\r\n dataSource.setPassword(propDatabasePassword);\r\n\r\n message = messageSource.getMessage(\"end\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n return dataSource;\r\n }",
"public String getDataSourceName()\n {\n return dataSourceName;\n }",
"public SpyDataSource getSpyDataSource()\n {\n return _spyDataSource;\n }",
"private DataSource initializeDataSourceFromSystemProperty() {\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\n dataSource.setDriverClassName(System.getProperty(PropertyName.JDBC_DRIVER, PropertyDefaultValue.JDBC_DRIVER));\n dataSource.setUrl(System.getProperty(PropertyName.JDBC_URL, PropertyDefaultValue.JDBC_URL));\n dataSource.setUsername(System.getProperty(PropertyName.JDBC_USERNAME, PropertyDefaultValue.JDBC_USERNAME));\n dataSource.setPassword(System.getProperty(PropertyName.JDBC_PASSWORD, PropertyDefaultValue.JDBC_PASSWORD));\n\n return dataSource;\n }",
"public static DataSource getDs() {\n return ds;\n }",
"private DataSource getDataSource() throws PermissionException {\n if (dataSource != null) {\n return dataSource;\n }\n\n if (dataSourceService == null) {\n throw new PermissionException(\"Datasource service is null. Cannot retrieve datasource \" +\n permissionConfig.getDatasourceName());\n }\n\n try {\n dataSource = (DataSource) dataSourceService.getDataSource(permissionConfig.getDatasourceName());\n } catch (DataSourceException e) {\n throw new PermissionException(\"Unable to retrieve the datasource: \" +\n permissionConfig.getDatasourceName(), e);\n }\n return dataSource;\n }",
"@Bean(name=\"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tBasicDataSource dataSource = new BasicDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/elearningforum\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"\");\n\t\tdataSource.addConnectionProperty(\"useUnicode\", \"yes\");\n\t\tdataSource.addConnectionProperty(\"characterEncoding\", \"UTF-8\");\n\t\treturn dataSource;\n\t}",
"public DataSourcesImpl dataSources() {\n return this.dataSources;\n }",
"@Bean(name = \"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tDriverManagerDataSource dataSource = new DriverManagerDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.cj.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/test_db\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"password\");\n\t\treturn dataSource;\n\t}",
"@Override\r\n protected DataSource selectAnyDataSource() {\n if (dataSourcesMtApp.isEmpty()) {\r\n List<MasterTenant> masterTenants = masterTenantRepo.findAll();\r\n LOG.info(\">>>> selectAnyDataSource() -- Total tenants:\" + masterTenants.size());\r\n for (MasterTenant masterTenant : masterTenants) {\r\n dataSourcesMtApp.put(masterTenant.getTenantId(),\r\n DataSourceUtil.createAndConfigureDataSource(masterTenant));\r\n }\r\n }\r\n return this.dataSourcesMtApp.values().iterator().next();\r\n }",
"public DataSourceRegistry getDataSourceRegistry();",
"DataSources retrieveDataSources() throws RepoxException;",
"@Override\n\tpublic Datastore getDatastore() {\n\t\treturn SKBeanUtils.getDatastore();\n\t}",
"protected String getDataSourceId() {\n return getDataSourceId(sourceComboBox);\n }",
"@Override\r\n protected boolean isUseDataSource() {\r\n return true;\r\n }",
"public DataSource getDataSource(final QueriesConfig qryConfig) throws DBMissingValueException {\n validate(qryConfig);\n\n final var connectionString = qryConfig.getConnectionString();\n\n var dataSource = DATA_SOURCES.get(connectionString);\n\n if (dataSource==null) {\n try {\n LOCK.lock();\n dataSource = DATA_SOURCES.get(connectionString);\n if (dataSource==null) {\n LOG.trace(String.format(\"Registering %s to pool.\", connectionString));\n Class.forName(qryConfig.getJdbcDriver());\n\n final var basicDataSource = new BasicDataSource();\n basicDataSource.setUrl(connectionString);\n\n if (qryConfig.getWindowsAuthentication()==null) {\n basicDataSource.setUsername(qryConfig.getUsername());\n basicDataSource.setPassword(qryConfig.getPassword());\n }\n\n basicDataSource.setMinIdle(dbPoolConfig.getMinIdle());\n basicDataSource.setMaxIdle(dbPoolConfig.getMaxIdle());\n basicDataSource.setMaxOpenPreparedStatements(dbPoolConfig.getMaxOpenPreparedStatements());\n dataSource = basicDataSource;\n\n DATA_SOURCES.put(connectionString, dataSource);\n }\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(e);\n } finally {\n LOCK.unlock();\n }\n }\n else {\n LOG.trace(String.format(\"Retrieve %s from pool.\", connectionString));\n }\n\n return dataSource;\n }",
"public DataSource getDataSource(ProceedingJoinPoint point) {\n MethodSignature signature = (MethodSignature) point.getSignature();\n Class<? extends Object> targetClass = point.getTarget().getClass();\n DataSource targetDataSource = targetClass.getAnnotation(DataSource.class);\n if (targetDataSource != null) {\n return targetDataSource;\n } else {\n Method method = signature.getMethod();\n DataSource dataSource = method.getAnnotation(DataSource.class);\n return dataSource;\n }\n }",
"@Override\n protected LoadedSource loadSource(Context context) {\n JpaClassConfig config = context.get(JpaClassConfig.class);\n Connection connection = null;\n try {\n connection = connect(config.getConnection());\n List<JavaType> result = new ArrayList<JavaType>();\n result.addAll(addEntityTypesFromTable(connection, context));\n result.addAll(addEntityTypesFromNamedSql(connection, context));\n LoadedSourceImpl loadedSource = new LoadedSourceImpl();\n loadedSource.setJavaTypes(result);\n if (context.contains(ClassLoader.class)) {\n loadedSource.setClassLoader(context.get(ClassLoader.class));\n }\n return loadedSource;\n } finally {\n\n try {\n if (connection != null) connection.close();\n } catch (SQLException ignore) {\n }\n }\n\n }",
"protected abstract String getDatasourceName();",
"DatasetFileService getSource();",
"public RDFCompositeDataSource getDatabase() //readonly\n\t{\n\t\tif(rdfCompositeDataSource == null) {\n\t\t\tString attr = StringUtils.trimToNull(getAttribute(\"datasources\"));\n\t\t\tif(attr != null) {\n\t\t\t\tRDFService rdfService = null; //TODO get the RDFService\n\t\t\t\trdfCompositeDataSource = new RDFCompositeDataSourceImpl(rdfService); //TODO should we ask the RDFService for this?\n\t\t\t\tfor(String uri : attr.split(\"\\\\s+\")) {\n\t\t\t\t\trdfCompositeDataSource.addDataSource(rdfService.getDataSource(uri));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rdfCompositeDataSource;\n\t}",
"@Override\n\tpublic HashMap<String, String> getData() {\n\t\treturn dataSourceApi.getData();\n\t}",
"protected String getDataSourceScript(DataSource ds, LocalContainer container)\n {\n ConfigurationBuilder builder = this.createConfigurationBuilder(container);\n String configurationEntry = builder.toConfigurationEntry(ds);\n return configurationEntry;\n }",
"@Bean(destroyMethod = \"close\")\n\tpublic DataSource dataSource() {\n\t\tHikariConfig config = Utils.getDbConfig(dataSourceClassName, url, port, \"postgres\", user, password);\n\n try {\n\t\t\tlogger.info(\"Configuring datasource {} {} {}\", dataSourceClassName, url, user);\n config.setMinimumIdle(0);\n\t\t\tHikariDataSource ds = new HikariDataSource(config);\n\t\t\ttry {\n\t\t\t\tString dbExist = \"SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = lower('\"+databaseName+\"')\";\n\t\t\t\tPreparedStatement statementdbExist = ds.getConnection().prepareStatement(dbExist);\n\t\t\t\tif(statementdbExist.executeQuery().next()) {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tds.close();\n\t\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\t} else {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tString sql = \"CREATE DATABASE \" + databaseName;\n\t\t\t\t\tPreparedStatement statement = ds.getConnection().prepareStatement(sql);\n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tds.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"ERROR Configuring datasource SqlException {} {} {}\", e);\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t} catch (Exception ee) {\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\tlogger.debug(\"ERROR Configuring datasource catch \", ee);\n\t\t\t}\n\t\t\tHikariConfig config2 = Utils.getDbConfig(dataSourceClassName, url, port, databaseName, user, password);\n\t\t\treturn new HikariDataSource(config2);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR in database configuration \", e);\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}",
"public ArrayList getDataSources() {\n return dataSources;\n }",
"@Override\r\n public DataSource selectDataSource(String tenantIdentifier) {\n\r\n tenantIdentifier = initializeTenantIfLost(tenantIdentifier);\r\n\r\n if (!this.dataSourcesMtApp.containsKey(tenantIdentifier)) {\r\n List<MasterTenant> masterTenants = masterTenantRepo.findAll();\r\n LOG.info(\r\n \">>>> selectDataSource() -- tenant:\" + tenantIdentifier + \" Total tenants:\" + masterTenants.size());\r\n for (MasterTenant masterTenant : masterTenants) {\r\n dataSourcesMtApp.put(masterTenant.getTenantId(),\r\n DataSourceUtil.createAndConfigureDataSource(masterTenant));\r\n }\r\n }\r\n return this.dataSourcesMtApp.get(tenantIdentifier);\r\n }",
"Database getDataBase() {\n return database;\n }",
"public DataStoreEnvironment getDataStoreEnvironment (){\n\t\treturn _dataStoreEnvironment;\n\t}",
"public KMLDataSourceModel getDataSourceModel()\r\n {\r\n return myDataSourceModel;\r\n }",
"@Provides\r\n @Named(\"source\")\r\n public BackendInstanceWrapper provideSourceWrapper() {\r\n return backendInstanceWrapper(sourceDB);\r\n }",
"@Bean\n @Profile(\"Prod\")\n public DataSource jndiDataSource(){\n \tJndiObjectFactoryBean bean = new JndiObjectFactoryBean();\n \tbean.setJndiName(\"dataSource\");\n \tbean.setProxyInterface(DataSource.class);\n \tbean.setResourceRef(true);\n \treturn (DataSource) bean.getObject();\n }",
"@Singleton\n@Component(modules = AppModule.class)\npublic interface AppComponent {\n\n GeekZoneApplication getApplication();\n\n LocalDataSourceManager getLocalDataSourceManager();\n\n RemoteDataSourceManager getRemoteDataSourceManager();\n}",
"public static Datamining getInstance (Context context) {\r\n if (datamining == null) {\r\n datamining = new Datamining(context);\r\n }\r\n return datamining;\r\n }",
"@Bean(name = \"dataSource\")\n @ConfigurationProperties(prefix = \"spring.datasource\")\n public DataSource dataSource() {\n return DataSourceBuilder.create().build();\n }",
"public int getDatasource() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((Integer) __getCache(\"datasource\")).intValue());\n }",
"public ConfigSource getConfigSource() {\n return _configSource;\n }",
"@Override\n public Set<Datasource> getDatasources() throws ConfigurationException {\n Context context = getContext();\n Set<Datasource> result = new HashSet<>();\n int length = context.getResource().length;\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n // Tomcat 5.5.x or Tomcat 6.0.x\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n String username = context.getResourceUsername(i);\n String url = context.getResourceUrl(i);\n String password = context.getResourcePassword(i);\n String driverClassName = context.getResourceDriverClassName(i);\n if (name != null && username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n if (tomeeVersion != null) {\n TomeeResources actualResources = getResources(false);\n if (actualResources != null) {\n result.addAll(getTomeeDatasources(actualResources));\n }\n }\n } else {\n // Tomcat 5.0.x\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n // find the resource params for the selected resource\n for (int j = 0; j < resourceParams.length; j++) {\n if (name.equals(resourceParams[j].getName())) {\n Parameter[] params = resourceParams[j].getParameter();\n HashMap paramNameValueMap = new HashMap(params.length);\n for (Parameter parameter : params) {\n paramNameValueMap.put(parameter.getName(), parameter.getValue());\n }\n String username = (String) paramNameValueMap.get(\"username\"); // NOI18N\n String url = (String) paramNameValueMap.get(\"url\"); // NOI18N\n String password = (String) paramNameValueMap.get(\"password\"); // NOI18N\n String driverClassName = (String) paramNameValueMap.get(\"driverClassName\"); // NOI18N\n if (username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n }\n }\n }\n return result;\n }",
"public static DataSource getNonTXDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), false);\n }",
"@Bean\n public DataSource dataSource() {\n PGSimpleDataSource dataSource = new PGSimpleDataSource();\n dataSource.setServerName(hostName);\n dataSource.setDatabaseName(databaseName);\n dataSource.setUser(databaseUser);\n dataSource.setPassword(databasePassword);\n return dataSource;\n }",
"@Singleton\n@Component(modules = {DataRepositoryModule.class, ApplicationModule.class})\npublic interface DataRepositoryComponent {\n\n DataSource getDataSource();\n}",
"public String getDataSrc() {\n return dataSrc;\n }",
"public DataSourcePool() throws NamingException, \r\n SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {\r\n InitialContext ctx = new InitialContext();\r\n //DataSource ds =(DataSource)ctx.lookup(\"java:jboss/jdbc/webapp\");\r\n DataSource ds =(DataSource)ctx.lookup(\"java:jboss/datasources/WebApp\");\r\n connection = ds.getConnection();\r\n }",
"public DataSource(Context context) {\n dbHelper = new MySQLiteHelper(context);\n database = dbHelper.getWritableDatabase();\n dbHelper.close();\n }",
"public int getDatasource() throws java.rmi.RemoteException;",
"public String getDataSourceUri() {\n\t\treturn dataSourceUri;\n\t}",
"@Bean\n public DataSource dataSource() {\n EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n EmbeddedDatabase db = builder\n .setType(EmbeddedDatabaseType.HSQL) //.H2 or .DERBY\n .addScript(\"db/sql/create-db.sql\")\n .addScript(\"db/sql/insert-data.sql\")\n .build();\n return db;\n }",
"@Bean\n public DataSource dataSource() {\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\n dataSource.setDriverClassName(env.getRequiredProperty(DRIVER_CLASS_NAME));\n dataSource.setUrl(env.getRequiredProperty(DATABASE_URL));\n dataSource.setUsername(env.getRequiredProperty(DATABASE_USERNAME));\n dataSource.setPassword(env.getRequiredProperty(DATABASE_PASSWORD));\n\n return dataSource;\n }",
"public static MovieListRemoteDataSource getInstance(){\n if(movieListDataSource == null){\n movieListDataSource = new MovieListRemoteDataSource();\n }\n\n return movieListDataSource;\n }",
"public String getDataSourceType () {\n return dataSourceType;\n }",
"private DataSourceInstanceItem getSrcDataSourceInstance(DataSourceInstanceItem item) {\r\n if (item == null) { return null; }\r\n\r\n DataSourceInstanceDao dsiDao = DiscourseDbDaoFactory.DEFAULT.getDataSourceInstanceDao();\r\n DataSourceInstanceItem result = dsiDao.findBySourceId((Long)item.getId());\r\n return result;\r\n }",
"public DataService getDataService()\r\n\t{\r\n\t\treturn dataService;\r\n\t}",
"@Profile(\"development\")\r\n @Bean(name=\"DataSourceBean\") \r\n public DataSource getDevDataSource(){\r\n\t\t\r\n //Create dataSource for HSQLDB connection.\r\n\t\t\r\n\t BasicDataSource dataSource = new BasicDataSource();\r\n\t dataSource.setDriverClassName(\"org.hsqldb.jdbc.JDBCDriver\");\r\n\t //Create HSQLDB in memory. \r\n\t dataSource.setUrl(\"jdbc:hsqldb:mem:mymemdb;ifexists=false;sql.syntax_mys=true\");\r\n\t //Create HSQLDB in file located in the application folder.\r\n //dataSource.setUrl(\"jdbc:hsqldb:file:mymemdb;ifexists=false;sql.syntax_mys=true\");\r\n\t dataSource.setUsername(\"sa\");\r\n\t dataSource.setPassword(\"\");\r\n\t\t\t\t\r\n return dataSource;\r\n }",
"public static DataSource MySqlConn() throws SQLException {\n\t\t\n\t\t/**\n\t\t * check if the database object is already defined\n\t\t * if it is, return the connection, \n\t\t * no need to look it up again\n\t\t */\n\t\tif (MySql_DataSource != null){\n\t\t\treturn MySql_DataSource;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t/**\n\t\t\t * This only needs to run one time to get the database object\n\t\t\t * context is used to lookup the database object in MySql\n\t\t\t * MySql_Utils will hold the database object\n\t\t\t */\n\t\t\tif (context == null) {\n\t\t\t\tcontext = new InitialContext();\n\t\t\t}\n\t\t\tContext envContext = (Context)context.lookup(\"java:/comp/env\");\n\t\t\tMySql_DataSource = (DataSource)envContext.lookup(\"jdbc/customers\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return MySql_DataSource;\n\t}",
"@Bean\n\tpublic DataSourceDao dataSourceDao() {\n\t\tDataSourceDao metadata = new DataSourceDao();\n\t\tmetadata.put(\"rslite\", dsRSLite());\n\t\tmetadata.put(\"rastreosat\", dsRS());\n\t\tmetadata.put(\"entel\", dsEntel());\n\t\tmetadata.put(\"mongo\", dsMongo());\n\t\treturn metadata;\n\t}",
"public ConfigContext getConfigContext() {\n\n return (ConfigContext)getSource();\n\n }",
"DataContextVariable createDataContextVariable();",
"public DataSourceListType invokeQueryDatasources() throws TsResponseException {\n checkSignedIn();\n final String url = getUriBuilder().path(QUERY_DATA_SOURCES).build(m_siteId).toString();\n final TsResponse response = get(url);\n return response.getDatasources();\n }",
"public static synchronized DataSource getGlobalDataSource() throws SQLException {\n // Try to obtain a connection\n if (globalDataSource != null) {\n return globalDataSource;\n }\n try {\n final Context c = EJBLookup.getInitialContext();\n for (String path : getPossibleJndiNames(DS_GLOBAL_CONFIG)) {\n try {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Trying JNDI path \" + path + \"...\");\n }\n globalDataSource = (DataSource) c.lookup(path);\n if (LOG.isInfoEnabled()) {\n LOG.info(\"Found global datasource under JNDI path \" + path);\n }\n break;\n } catch (NamingException e) {\n // try next path\n }\n }\n if (globalDataSource == null) {\n //try the weird geronimo logic as last resort\n Object o = null;\n try {\n o = EJBLookup.getInitialContext().lookup(\"jca:/console.dbpool/flexiveConfiguration/JCAManagedConnectionFactory/flexiveConfiguration\");\n globalDataSource = (DataSource) o.getClass().getMethod(\"$getResource\").invoke(o);\n } catch (NoSuchMethodException e) {\n if (o instanceof DataSource)\n return (DataSource) o;\n String sErr = \"Unable to retrieve Connection to [\" + DS_GLOBAL_CONFIG + \"]: JNDI resource is no DataSource and method $getResource not found!\";\n LOG.error(sErr);\n throw new SQLException(sErr);\n } catch (NamingException e) {\n // not bound, try next path\n } catch (Exception e) {\n final String msg = \"Unable to retrieve Connection to [\" + DS_GLOBAL_CONFIG + \"]: \" + e.getMessage();\n LOG.error(msg);\n throw new SQLException(msg);\n }\n }\n if (globalDataSource == null) {\n globalDataSource = tryGetDefaultDataSource(\n c, GlobalConfigurationEngineBean.DEFAULT_DS_CONFIG, new DefaultGlobalDataSourceInitializer()\n );\n }\n if (globalDataSource == null) {\n final String msg = \"Unable to retrieve Connection to [\" + DS_GLOBAL_CONFIG + \"]: no datasource found in JNDI\";\n LOG.error(msg);\n throw new SQLException(msg);\n }\n return globalDataSource;\n } catch (NamingException exc) {\n String msg = \"Naming Exception, unable to retrieve Connection to [\" + DS_GLOBAL_CONFIG\n + \"]: \" + exc.getMessage();\n LOG.error(msg);\n throw new SQLException(msg);\n }\n }",
"@Bean\r\n public DataSource getDataSource() throws IOException {\r\n\tDriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n\tProperties prop = new Properties();\r\n\tString propFileName = \"config.propertise\";\r\n\r\n\tinputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\r\n\r\n\tif (inputStream != null) {\r\n\t prop.load(inputStream);\r\n\t} else {\r\n\t throw new FileNotFoundException(\"property file '\" + propFileName + \"' not found in the classpath\");\r\n\t}\r\n\r\n\tString url = prop.getProperty(\"database.url\");\r\n\tString driver = prop.getProperty(\"database.driver\");\r\n\tString username = prop.getProperty(\"database.username\");\r\n\tString password = prop.getProperty(\"database.password\");\r\n\r\n\tdataSource.setDriverClassName(driver);\r\n\tdataSource.setUrl(url);\r\n\tdataSource.setUsername(username);\r\n\tdataSource.setPassword(password);\r\n\r\n\treturn dataSource;\r\n }"
]
| [
"0.7375492",
"0.710195",
"0.6999771",
"0.6860788",
"0.6803394",
"0.6790814",
"0.6775805",
"0.67751694",
"0.6761575",
"0.67535233",
"0.6733285",
"0.6658415",
"0.6645243",
"0.6622294",
"0.66219383",
"0.6606725",
"0.66007525",
"0.66007525",
"0.65911156",
"0.65514356",
"0.64891064",
"0.64788646",
"0.6465102",
"0.64408195",
"0.64068997",
"0.6396427",
"0.6298017",
"0.62648606",
"0.62621635",
"0.621839",
"0.6217893",
"0.61990064",
"0.6188252",
"0.6160406",
"0.6125975",
"0.6084125",
"0.6073632",
"0.60709757",
"0.6070056",
"0.6042775",
"0.60006624",
"0.598841",
"0.5985226",
"0.5978072",
"0.59652185",
"0.5959657",
"0.5951234",
"0.5925688",
"0.59253937",
"0.5916379",
"0.58627015",
"0.5852077",
"0.5843539",
"0.5832609",
"0.5815903",
"0.5797959",
"0.57649",
"0.57356715",
"0.57305735",
"0.57268023",
"0.5720462",
"0.5708862",
"0.5706343",
"0.5701993",
"0.5700937",
"0.5697923",
"0.5695933",
"0.5686153",
"0.5676987",
"0.56599975",
"0.5657679",
"0.5644852",
"0.5632786",
"0.56263953",
"0.5624388",
"0.56243575",
"0.5623658",
"0.56215924",
"0.5619812",
"0.5619795",
"0.5617864",
"0.56067413",
"0.5604195",
"0.5594458",
"0.5592508",
"0.55820286",
"0.5577685",
"0.55721503",
"0.5561355",
"0.55547404",
"0.5552173",
"0.5549662",
"0.55178",
"0.5516378",
"0.5506764",
"0.5486065",
"0.54850566",
"0.5466489",
"0.54640645",
"0.54640466"
]
| 0.7454886 | 0 |
METHODES CONSTRUCTEUR D'ARITE NULLE. | public MotifCellFactoryObservable() {
super();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void MontaValores(){\r\n // 0;0;-23,3154166666667;-51,1447783333333;0 // Extrai os valores e coloca no objetos\r\n // Dis;Dir;Lat;Long;Velocidade\r\n // Quebra de Rota lat=-999.999 long=-999.999 ==> Marca ...\r\n \r\n int ind=0;\r\n NMEAS=NMEA.replace(\",\" , \".\");\r\n \r\n //1)\r\n dists=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind));\r\n Distancia=Double.valueOf(dists);\r\n ind=ind+dists.length()+1;\r\n \r\n //2)\r\n dirs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Direcao=Double.valueOf(dirs);\r\n ind=ind+dirs.length()+1;\r\n \r\n //3)\r\n lats=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Lat=Double.valueOf(lats);\r\n ind=ind+lats.length()+1;\r\n \r\n //4)\r\n longs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Long=Double.valueOf(longs);\r\n ind=ind+longs.length()+1;\r\n \r\n //5)\r\n vels=NMEAS.substring(ind,NMEAS.length());\r\n // Transforma de Knots para Km/h\r\n Velocidade=Double.valueOf(vels)/100*1.15152*1.60934;\r\n vels=String.valueOf(Velocidade);\r\n ind=ind+vels.length()+1;\r\n \r\n }",
"public Electrodomestico() {\r\n this.precioBase = PRECIO_BASE_POR_DEFECTO;\r\n this.color = COLOR_POR_DEFECTO;\r\n this.consumoEnergetico = CONSUMO_POR_DEFECTO;\r\n this.peso = PESO_POR_DEFECTO;\r\n\r\n }",
"public void mostraDados() {\n System.out.println(\"O canal atual é: \" + tv.getCanal());\n System.out.println(\"O volume atual é: \" + tv.getVolume());\n System.out.println(\"--------------------------------------\");\n }",
"public Data() {\n\t\tCalendar now = new GregorianCalendar();\n\t\tthis.anno = now.get(Calendar.YEAR);\n\t\tthis.giorno = now.get(Calendar.DAY_OF_MONTH);\n\t\tthis.mese = Data.MESI[now.get(Calendar.MONTH)];\n\t}",
"public Mencacao()\r\n {\r\n texto = \"\";\r\n deUtilizador = \"\";\r\n data = new GregorianCalendar();\r\n }",
"public void init() {\n //De leden mogen niet extreem obesitas hebben. Onder of gelijk aan 180kg.\n Valerie= 40;\n Jeroen=100;\n Hans=80;\n\n // Teller begint bij 0. Stel: staaf is 80 hoog.\n // 180 is waar de grafiek begint.\n nulpunt=180; //Dit is het nulpunt van de staaf\n som_v = nulpunt - Valerie;\n som_j = nulpunt - Jeroen;\n som_h = nulpunt - Hans;\n }",
"public void Millas_M(){\r\n System.out.println(\"Cálcular Metros o Kilometros de Millas Marinas\");\r\n System.out.println(\"Ingrese un valor en Millas Marinas\");\r\n cadena =numero.next(); \r\n valor = metodo.Doble(cadena);\r\n valor = metodo.NegativoD(valor);\r\n totalM = valor * 1852 ;\r\n Millas_KM(totalM);\r\n }",
"public Electrodomestico() {\r\n\t\tthis.precioBase = PRECIO_BASE;\r\n\t\tthis.color = COLOR_DEFAULT;\r\n\t\tthis.consumoEnergetico = CONSUMO_DEFAULT;\r\n\t\tthis.peso = PESO_BASE;\r\n\t}",
"@Override\n public Coup meilleurCoup(Plateau _plateau, Joueur _joueur, boolean _ponder) {\n \n _plateau.sauvegardePosition(0);\n \n /* On créé un noeud père, qui est le noeud racine de l'arbre. On définit arbitrairement le joueur associé (\n (0 ou 1, il importe peu de savoir quel joueur correspond à ce nombre, cette information étant déjà portée par \n j1 et j2 dans l'algorithme. Le tout est de faire alterner cette valeur à chaque niveau de l'arbre. */\n \n Noeud pere = new Noeud();\n pere.joueurAssocie = 0;\n \n // On définit ici c, le coefficient d'arbitrage entre exploration et exploitation. Ce dernier est théroquement optimal pour una valeur égale à sqrt(2).\n \n double c = 10 * Math.sqrt(2);\n double[] resultat = new double[2];\n \n // Conditions de fonctionnement par itération\n \n //int i = 1;\n //int nbTours = 10000;\n \n //while(i <= nbTours){\n \n // Conditions de fonctionnement en mode \"compétition\" (100 ms pour se décider au maximum).\n \n long startTime = System.currentTimeMillis();\n \n while((System.currentTimeMillis()-startTime) < 100){\n\n // La valeur résultat ne sert à rien fondamentalement ici, elle sert uniquement pour le bon fonctionnement de l'algorithme en lui même.\n // On restaure le plateau à chaque tour dans le MCTS (Sélection - Expension - Simulation - Backpropagation). \n \n resultat = MCTS(pere, _plateau, this.j_humain, this.j_ordi, c, this.is9x9, this.methodeSimulation);\n _plateau.restaurePosition(0);\n \n //i++;\n }\n\n // On doit maintenant choisir le meilleur coup parmi les fils du noeud racine, qui correspondent au coup disponibles pour l'IA.\n \n double maxValue = 0;\n int maxValueIndex = 0;\n \n for(int j = 0; j < pere.fils.length; j++){\n \n double tauxGain = ((double)pere.fils[j].nbPartiesGagnees / (double)pere.fils[j].nbPartiesJouees);\n\n // On choisirat le coup qui maximise le taux de gain des parties simulées.\n \n if(tauxGain >= maxValue){\n maxValueIndex = j;\n maxValue = tauxGain;\n \n }\n }\n \n // On retourne le coup associé au taux de gain le plus élevé.\n\n return pere.fils[maxValueIndex].coupAssocie;\n }",
"void stampaStatisticheNodo() {\r\n for(Object obj : this.nodes)\r\n {\r\n Nodo n = (Nodo)obj;\r\n \r\n TransportLayer tl = n.myTransportLayer;\r\n tl.stampaStatistiche();\r\n \r\n // System.out.println(\"=====STAMPA STATISTICHE NODO NETWORK LAYER====\");\r\n NetworkLayer nl = n.myNetLayer;\r\n // String s = nl.getStat();\r\n nl.stampaStatistiche();\r\n // System.out.println(s);\r\n // System.out.println(\"=====FINE====\");\r\n \r\n physicalLayer pl = n.myPhyLayer;\r\n pl.stampaStatistiche();\r\n }\r\n }",
"public Persoon(){\n geboorteDag = 0;\n geboorteMaand = 0;\n geboorteJaar = 0;\n nieuweGeslacht = 'x';\n }",
"public Transportadora() {\r\n super();\r\n this.nif = \"\";\r\n this.raio = 0;\r\n this.precoKm = 0;\r\n this.classificacao = new Classificacao();\r\n this.estaLivre = true;\r\n this.velocidadeMed = 0;\r\n this.kmsTotal = 0;\r\n this.capacidade = 0;\r\n }",
"public void getVentasdeUNMes(int m) {\r\n double vMes[] = new double[nv];\r\n int i;\r\n for (i = 0; i < nv; i++) {\r\n vMes[i] = ventas[i][m];\r\n }\r\n getMostrarVec(vMes);\r\n }",
"@Override\n public synchronized void demarrer(){\n if(modele.getQuiterJeu()){return;}\n modele.getMoteurJeu().setEtapeJeu(this);\n // apercu dans le termial pour debuger\n System.out.println(\"-----------------nom joueur: \"+modele.getJoueurCourant().getNom());\n System.out.print(\" humain: \"+modele.getJoueurCourant().estHumain());\n System.out.print(\" stand: \"+modele.getJoueurCourant().getMainCourant().getStand());\n System.out.print(\" perdu: \"+modele.getJoueurCourant().getMainCourant().estPerdu());\n System.out.print(\" blackjack: \"+modele.getJoueurCourant().getMainCourant().estBlackJack());\n System.out.println(\" jeu: \"+modele.getJoueurCourant().getMainCourant().getJeu().toString());\n //-------------------------------------------------\n // On ne fait pas une boucle ici pour que l'observer\n // puisse acceder a son observé et se mettre a jour\n //-------------------------------------------------\n new Thread(){\n @Override\n public void run() {\n try {\n // si plus de carte\n if(modele.getPioche().getCartes().size() < 1){\n for(Carte carte:modele.getDefausse().getCartes()){\n carte.setFaceCarte(Face.VERSO);\n modele.getPioche().ajouterDessous(carte);\n }\n modele.getDefausse().vider();\n modele.getPioche().melanger();\n }\n \n \n // si il peut plus jouer\n if(modele.getJoueurCourant().getMainCourant().estBlackJack() || modele.getJoueurCourant().getMainCourant().estPerdu() \n || modele.getJoueurCourant().getMainCourant().getStand() || modele.getJoueurCourant().getMainCourant().est21()\n || modele.getJoueurCourant().getMainCourant().getAAbandonner() || modele.getJoueurCourant().getAPerduJeu()){\n \n // si le joueur a une autre main\n if(modele.getJoueurCourant().mainSuivant()){\n Thread.sleep(2000);\n demarrer();\n \n }\n // sinon si il y a un joueur suivant on fait joueur suivant\n else if(modele.joueurSuivant()){\n Thread.sleep(2000);\n demarrer();\n }else{\n modele.getMoteurJeu().setEtapeJeu(etapeSuivant);\n Thread.sleep(2000);\n modele.setMessage(modele.getCroupier().getNom()+\" plays\");\n // on affiche les carte du croupier\n for(Carte carte: modele.getCroupier().getMainCourant().getJeu().getCartes()){\n carte.setFaceCarte(Face.RECTO);\n }\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++++++++\");\n Thread.sleep(3000);\n demarrerEtapeSuivant();\n\n }\n\n }\n // sinon\n else{\n modele.setMessage(modele.getJoueurCourant().getNom()+\" plays\");\n if(!modele.getJoueurCourant().estHumain()){\n modele.getJoueurCourant().jouer(modele.getPioche(),modele.getDefausse());\n Thread.sleep(3000);\n demarrer();\n }\n \n\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }.start();\n \n }",
"@Test\n public void testValladoTEMEofDate() {\n AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2000, 182),\n new TimeComponents(0.78495062 * Constants.JULIAN_DAY),\n TimeScalesFactory.getUTC());\n\n // TEME\n PVCoordinates pvTEME =\n new PVCoordinates(new Vector3D(-9060473.73569, 4658709.52502, 813686.73153),\n new Vector3D(-2232.832783, -4110.453490, -3157.345433));\n\n // reference position in EME2000\n // note that Valado's book gives\n // PVCoordinates pvEME2000Ref =\n // new PVCoordinates(new Vector3D(-9059941.3786, 4659697.2000, 813958.8875),\n // new Vector3D(-2233.348094, -4110.136162, -3157.394074));\n // the values we use here are slightly different, they were computed using\n // Vallado's C++ companion code to the book, using the teme_j2k function with\n // all 106 nutation terms and the 2 corrections elements of the equation of the equinoxes\n PVCoordinates pvEME2000Ref =\n new PVCoordinates(new Vector3D(-9059941.5224999374914, 4659697.1225837596648, 813957.72947647583351),\n new Vector3D(-2233.3476939179299769, -4110.1362849403413335, -3157.3941963060194738));\n\n Transform t = FramesFactory.getTEME().getTransformTo(FramesFactory.getEME2000(), t0);\n\n PVCoordinates pvEME2000Computed = t.transformPVCoordinates(pvTEME);\n PVCoordinates delta = new PVCoordinates(pvEME2000Computed, pvEME2000Ref);\n Assertions.assertEquals(0.0, delta.getPosition().getNorm(), 0.025);\n Assertions.assertEquals(0.0, delta.getVelocity().getNorm(), 1.0e-4);\n\n }",
"public Electrodomestico() {\r\n this.color = Colores.BLANCO;\r\n this.consumoEnergetico = Letra.F;\r\n this.precioBase = precioDefecto;\r\n this.peso = pesoDefecto;\r\n }",
"public Mensaje (double monto) {\n this.respuesta = true;\n this.monto = monto;\n }",
"public double[] momentosDeZernike(){\r\n\t\tdouble[] retorno = new double[9];\r\n\t\tdouble xDistancia = 0;\r\n\t\tdouble yDistancia = 0;\r\n\t\tdouble raio = 0;\r\n\t\tdouble angulo = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < imagem.length; i++) {\r\n\t\t\t\r\n\t\t\txDistancia = i - this.xMassa;\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < imagem[i].length; j++) {\r\n\t\t\t\t\r\n\t\t\t\t yDistancia = j - this.yMassa;\r\n\t\t\t\t \r\n\t\t\t\t raio = Math.sqrt(xDistancia*xDistancia + yDistancia*yDistancia);\r\n\t\t\t\t \r\n\t\t\t\t angulo = Math.atan(yDistancia/xDistancia);\r\n\t\t\t\t \r\n\t\t\t\t for(int l=0; l<retorno.length; l++){\r\n\t\t\t\t\t retorno[l] += imagem[i][j] * (this.calcularV(raio, angulo, l));\r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < retorno.length; i++) {\r\n\t\t\tif(i == 0 ){\r\n\t\t\t\t\r\n\t\t\t\tretorno[i] *= 1/Math.PI;\r\n\t\t\t\t\r\n\t\t\t}else if(i == 1){\r\n\t\t\t\t\r\n\t\t\t\tretorno[i] *= (1+1)/Math.PI;\r\n\t\t\t\t\r\n\t\t\t}else if(i == 2 || i == 3){\r\n\t\t\t\t\r\n\t\t\t\tretorno[i] *= (2+1)/Math.PI;\r\n\t\t\t\t\r\n\t\t\t}else if(i == 4 || i == 5){\r\n\t\t\t\t\r\n\t\t\t\tretorno[i] *= (3+1)/Math.PI;\r\n\t\t\t\t\r\n\t\t\t}else if (i == 6 || i == 7 || i == 8){\r\n\t\t\t\t\r\n\t\t\t\tretorno[i] *= (4+1)/Math.PI; \r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn retorno;\r\n\t}",
"public DobbeltLenketListe() {\n this.hode= null;\n this.hale= null;\n antall=0; }",
"public MetalNode(int date1){\n date = date1;\n }",
"private void laskeMatkojenPituus() {\n matkojenpituus = 0.0;\n\n for (Matka m : matkat) {\n matkojenpituus += m.getKuljettumatka();\n }\n\n }",
"public Fecha () {\n\t\tthis.ahora = Calendar.getInstance();\n\t\tahora.set(2018, 3, 1, 15, 15, 0);\t \n\t\taño = ahora.get(Calendar.YEAR);\n\t\tmes = ahora.get(Calendar.MONTH) + 1; // 1 (ENERO) y 12 (DICIEMBRE)\n\t\tdia = ahora.get(Calendar.DAY_OF_MONTH);\n\t\thr_12 = ahora.get(Calendar.HOUR);\n\t\thr_24 = ahora.get(Calendar.HOUR_OF_DAY);\n\t\tmin = ahora.get(Calendar.MINUTE);\n\t\tseg = ahora.get(Calendar.SECOND);\n\t\tam_pm = v_am_pm[ahora.get(Calendar.AM_PM)]; //ahora.get(Calendar.AM_PM)=> 0 (AM) y 1 (PM)\n\t\tmes_nombre = v_mes_nombre[ahora.get(Calendar.MONTH)];\n\t\tdia_nombre = v_dia_nombre[ahora.get(Calendar.DAY_OF_WEEK) - 1];\n\n\t}",
"public Jefatura(String nom,double sue, int agno,int mes,int dia){\r\n \r\n super(nom,sue,agno,mes,dia); \r\n \r\n }",
"public Memoria(Espacio[] espacios) {\r\n\t\tthis.numEspacios = espacios.length;\r\n\t\tthis.espacios = espacios;\r\n\t\ttamaņo = 0;\r\n\t\tfor (int i = 0; i < numEspacios; i++) {\r\n\t\t\ttamaņo += espacios[i].getTamaņo();\r\n\t\t}\r\n\t}",
"public void tempoDeDescoberta(){\r\n \tfor(int i=0; i<d.length; i++){\r\n \t\tSystem.out.println(\"d[\"+i+\"] :: \"+d[i]);\r\n \t}\r\n }",
"public Muestra(String nombreMuestra,Float peso, Float profundidadInicial,Float profundidadFinal,OperadorDeLaboratorio operador,\r\n\t\t\t\t\tUsuario usuario, Ubicacion ubicacion, AASHTO aashto, SUCS sucs,Cliente cliente,java.sql.Date fecha) {\r\n\t\tthis.nombreMuestra = nombreMuestra;\r\n\t\tthis.profundidadInicial = profundidadInicial;\r\n\t\tthis.profundidadFinal = profundidadFinal;\r\n\t\tthis.peso = peso;\r\n\t\tthis.operadorLaboratorio = operador;\r\n\t\tthis.cliente = cliente;\r\n\t\tthis.usuario = usuario;\r\n\t\tthis.ubicacion = ubicacion;\r\n\t\tthis.aashto = aashto;\r\n\t\tthis.sucs = sucs;\r\n\t\tthis.fecha = fecha;\r\n\t\tD10= new Float(0);\r\n\t\tD30= new Float(0);\r\n\t\tD60= new Float(0);\r\n\t\tthis.gradoCurvatura = new Float(0);\r\n\t\tthis.coeficienteUniformidad = new Float(0);\r\n\t\tindicePlasticidad = new Float(0);\r\n\t\tlimitePlastico = new Float(0);\r\n\t\tlimiteLiquido = new Float(0);\r\n\t}",
"@Override\n\tpublic double getMassaInterna()\n\t{\n\t\treturn 0.0;\n\t}",
"public int fondMagasin(){\n\tint total =this.jeton;\n\tfor(Caisse c1 : this.lesCaisses){\n\ttotal = c1.getTotal()+total;\n\t}\n\treturn total;\n}",
"public void tocarTelefone() {\n System.out.println(\"Telefone \" + getNumero() + \" está tocando!\");\n notificarTodos();\n }",
"public String Dime_datos_generales() {\n\t\t\n\t\treturn \"la plataforma del veiculo tiene \"+ rueda+\" ruedas\"+\n\t\t\"\\nmide \"+ largo/1000+\" metros con un ancho de \"+ancho+\n\t\t\"cm\"+\"\\nun peso de platafrorma de \"+peso;\n\t}",
"public void initTempsPassage() {\r\n\t\tlong dureeTotale = heureDepart.getTime();\r\n\t\ttempsPassage = new Date[getItineraire().size()][2];\r\n\r\n\t\tfor (int i = 0; i < getItineraire().size(); i++) {\r\n\t\t\tfor (int j = 0; j < getItineraire().get(i).getTroncons().size(); j++) {\r\n\t\t\t\tdureeTotale += getItineraire().get(i).getTroncons().get(j).getLongueur() * 1000 / VITESSE;// Duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// des\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// trajets\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// seconde\r\n\r\n\t\t\t}\r\n\t\t\tif (i < listeLivraisons.size()) {\r\n\t\t\t\tif (listeLivraisons.get(i).getDebutPlageHoraire() != null\r\n\t\t\t\t\t\t&& listeLivraisons.get(i).getDebutPlageHoraire().getTime() > dureeTotale) {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t\ttempsPassage[i][1] = new Date(listeLivraisons.get(i).getDebutPlageHoraire().getTime());\r\n\t\t\t\t\tdureeTotale = listeLivraisons.get(i).getDebutPlageHoraire().getTime();\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t}\r\n\t\t\t\tdureeTotale += listeLivraisons.get(i).getDuree() * 1000; // duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// de\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// livraison\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ms\r\n\t\t\t} else {\r\n\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theureArrivee = new Date(dureeTotale);\r\n\t}",
"public Nodo(String molecula) throws Exception {\n valor = molecula;\n nodoIzq = nodoDer = null;\n if (valor.length() > 1) {\n conectorPrincipal = buscarConectorPrincipal(valor);\n System.out.println(\"conector principal\" + conectorPrincipal);\n if (conectorPrincipal == '0') {\n throw new Exception(\"La expresion no es FBF\");\n }\n generarArbol();\n } else {\n try {\n conectorPrincipal = valor.charAt(0);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Cadena De Caracteres Vacia\");\n }\n\n }\n }",
"public void dodajZmiju() {\n\t\t\n\t\tint i = this.zmija.get(0).i;\n\t\tint j = this.zmija.get(0).j;\n\t\tthis.tabla[i][j] = 'O';\n\t\t\n\t\tfor (int k = 1; k < this.zmija.size(); k++) {\n\t\t\ti = this.zmija.get(k).i;\n\t\t\tj = this.zmija.get(k).j;\n\t\t\tthis.tabla[i][j] = 'o';\n\t\t}\t\n\t}",
"public void dodajZmijuPocetak() {\n\t\tthis.zmija.add(new Cvor(1,4));\n\t\tthis.zmija.add(new Cvor(1,3));\n\t\tthis.zmija.add(new Cvor(1,2));\n\t\t\n\t\tint i = this.zmija.get(0).i;\n\t\tint j = this.zmija.get(0).j;\n\t\tthis.tabla[i][j] = 'O';\n\t\t\n\t\tfor (int k = 1; k < this.zmija.size(); k++) {\n\t\t\ti = this.zmija.get(k).i;\n\t\t\tj = this.zmija.get(k).j;\n\t\t\tthis.tabla[i][j] = 'o';\n\t\t}\t\n\t}",
"float znajdzOstatecznaCene()\n\t{\n\t\t//getInput(\"znajdzOstatecznaCene\");\n\t\t//print (\"znajdzOstatecznaCene \"+iteracja);\n\t\t\n\t\t//debug\n\t\tBoolean debug = false;\n\t\tif (LokalneCentrum.getCurrentHour().equals(\"03:00\"))\n\t\t{\n\t\t\tprint(\"03:00 on the clock\",debug);\n\t\t\tdebug=false;\n\t\t}\n\t\t\n\t\t//wszystkie ceny jakie byly oglaszan ne na najblizszy slot w \n\t\tArrayList<Float> cenyNaNajblizszySlot =znajdzOstatecznaCeneCenaNaNajblizszeSloty();\n\t\t\n\t\t\n\t\t//Stworzenie cen w raportowaniu\n\t\tint i=0;\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\trynekHistory.kontraktDodajCene(cenyNaNajblizszySlot.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tprint(\"ceny na najblizszy slot \"+cenyNaNajblizszySlot.size());\n\n\t\t\n\t\t//do rpzerobienia problemu minimalizacji na maksymalizacje\n\t\tint inverter =-1;\n\t\t\n\t\ti=0;\n\t\tfloat cena =cenyNaNajblizszySlot.get(i);\n\t\tfloat minimuCena =cena;\t\t\n\t\tfloat minimumValue =inverter*funkcjaRynku2(cena, false,true);\n\t\ti++;\n\t\t\n\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), minimuCena);\n\t\t\n\t\twhile (i<cenyNaNajblizszySlot.size())\n\t\t{\n\t\t\tcena =cenyNaNajblizszySlot.get(i);\n\t\t\tfloat value =inverter*funkcjaRynku2(cena, false,true);\t\t\t\n\n\t\t\trynekHistory.kontraktDodajWartoscFunkcjiRynku(funkcjaRynku2(cena, false), cena);\n\n\t\t\tif (value<minimumValue)\n\t\t\t{\n\t\t\t\tminimuCena =cena;\n\t\t\t\tminimumValue = value;\n\n\t\t\t}\n\t\t\t\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tif(debug)\n\t\t{\n\t\t\tgetInput(\"03:00 end\");\n\t\t}\n\t\t\n\t\t//getInput(\"znajdzOstatecznaCene - nto finished\");\n\t\treturn minimuCena;\n\t\t\n\t}",
"public RoyaumeDuFeu() {\n this.lGeantDeFeu = new LinkedList<>();\n for (int i = 0; i < 12; i++) {\n lGeantDeFeu.add(new GeantDeFeu());\n }\n\n }",
"public Parametros() {\r\n semilla = SEMILLA_DEFECTO;\r\n numeroPistas = NUMERO_PISTAS_DEFECTO;\r\n duracionSlot = DURACION_SLOT_DEFECTO;\r\n frecuencia = FRECUENCIA_DEFECTO;\r\n duracionMedia = DURACION_MEDIA_DEFECTO;\r\n duracionDesviacion = DURACION_DESVIACION_DEFECTO;\r\n duracionMinima = DURACION_MINIMA_DEFECTO;\r\n demoraMedia = DEMORA_MEDIA_DEFECTO;\r\n demoraDesviacion = DEMORA_DESVIACION_DEFECTO;\r\n }",
"public void inicialAleatorio() {\n //aqui adiciona naquele vetor que de auxilio\n alocacao.add(Estados.ELETRICISTAS);\n alocacao.add(Estados.ELETRICISTAS2);\n alocacao.add(Estados.QUALIDADE);\n alocacao.add(Estados.QUALIDADE2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL3);\n alocacao.add(Estados.PLANEJAMENTO);\n\n //biblioteca que sorteia aleatoriamente os departamentos\n Collections.shuffle(alocacao);\n\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = alocacao.get(i);\n\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = alocacao.get(i + 4);\n }\n\n }",
"public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }",
"public static void main(String[] args) {\n System.out.println(\"Test de la partie 1:\");\n System.out.println(\"--------------------\");\n\n Position position1 = new Position(0, 1);\n Position position2 = new Position(1, 0);\n Position position3 = new Position(1, 1);\n\n Neurone neuron1 = new Neurone(position1, 0.5);\n Neurone neuron2 = new Neurone(position2, 1.0);\n Neurone neuron3 = new Neurone(position3, 2.0);\n\n neuron1.connexion(neuron2);\n neuron2.connexion(neuron3);\n neuron1.recoitStimulus(10);\n\n System.out.println(\"Signaux : \");\n System.out.println(neuron1.getSignal());\n System.out.println(neuron2.getSignal());\n System.out.println(neuron3.getSignal());\n\n System.out.println();\n System.out.println(\"Premiere connexion du neurone 1\");\n System.out.println(neuron1.getConnexion(0));\n\n\n // FIN TEST DE LA PARTIE 1\n\n // TEST DE LA PARTIE 2\n System.out.println(\"Test de la partie 2:\");\n System.out.println(\"--------------------\");\n\n Position position5 = new Position(0, 0);\n NeuroneCumulatif neuron5 = new NeuroneCumulatif(position5, 0.5);\n neuron5.recoitStimulus(10);\n neuron5.recoitStimulus(10);\n System.out.println(\"Signal du neurone cumulatif -> \" + neuron5.getSignal());\n\n // FIN TEST DE LA PARTIE 2\n\n // TEST DE LA PARTIE 3\n System.out.println();\n System.out.println(\"Test de la partie 3:\");\n System.out.println(\"--------------------\");\n Cerveau cerveau = new Cerveau();\n\n // parametres de construction du neurone:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeurone(new Position(0,0), 0.5);\n cerveau.ajouterNeurone(new Position(0,1), 0.2);\n cerveau.ajouterNeurone(new Position(1,0), 1.0);\n\n // parametres de construction du neurone cumulatif:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeuroneCumulatif(new Position(1,1), 0.8);\n cerveau.creerConnexions();\n cerveau.stimuler(0, 10);\n\n System.out.println(\"Signal du 3eme neurone -> \" + cerveau.sonder(3));\n System.out.println(cerveau);\n // FIN TEST DE LA PARTIE 3\n }",
"public Data(int dia, int mes, int ano){\r\n \r\n if (dia> 31) {\r\n System.out.println(\"Dia Invalido\");\r\n System.exit(0);\r\n }\r\n if (mes> 12) {\r\n System.out.println(\"Mes Invalido\");\r\n System.exit(0);\r\n }\r\n if (((mes == 4) || (mes == 6) || (mes == 9) || (mes == 11)) && (dia > 30)) {\r\n System.out.println(\"Mes Invalido\");\r\n System.exit(0);\r\n }\r\n if (mes == 2) {\r\n \r\n if((ano % 400 == 0) || ((ano % 4 == 0) && (ano % 100 != 0))){\r\n\t\t\tif(dia > 29){\r\n System.out.println(\"Ano Invalido\");\r\n System.exit(0);\r\n }\r\n }\r\n else{\r\n if(dia > 28){\r\n System.out.println(\"Dia Invalido\");\r\n System.exit(0);\r\n }\r\n } \r\n }\r\n this.dia = dia;\r\n this.mes = mes;\r\n this.ano = ano;\r\n }",
"public static void pocetniMeni() {\r\n\t\tSystem.out\r\n\t\t\t\t.println(\"***********************************************\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 1 ako zelite vidjeti kalendar(za dati mjesec i godinu)\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 2 za pregled podsjetnika za dati mjesec i godinu\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 3 da pregledate podsjetnik za datu godinu\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 4 ako zelite da pogledate sve podsjetnike!\\n\"\r\n\t\t\t\t\t\t+ \"Unesite 5 ako zelite da upisete neki podsjetnik!\\n\"\r\n\t\t\t\t\t\t+ \":::::::::::::::::::::::::::::::::::::::::::::::\");\r\n\t}",
"public void testOctaedre() {\n\t\t\t\n\t\t\tSolide i = Octaedre.octaedre();\n\t\t\t\n\t\t\t/* creation de points qui ont les memes coordonnees que ceux qui \n\t\t\t * constituent notre solide (car octaedre() n'a pas de parametres)\n\t\t\t */\n\t\t\t\n\t\t\tPoint p1 = new Point(-25, 0,-25);\n\t\t\tPoint p2 = new Point(-25, 0,25);\n\t\t\tPoint p3 = new Point(25, 0,-25);\n\t\t\tPoint p4 = new Point(25,0,25);\n\t\t\tfloat hauteur = (float) (50/Math.sqrt(2));\n\t\t\t// on se sert de la hauteur pour donnee les coordonees des sommets manquant\n\t\t\tPoint p5 = new Point(0, hauteur,0);\n\t\t\tPoint p6 = new Point(0,-hauteur,0);\n\t\t\t\n\t\t\t//On teste si les points de l'octaedre i sont bien les memes que ceux créés\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getAbscisse()==(p1.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(1).getAbscisse()==(p2.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(5).getAbscisse()==(p3.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(3).getAbscisse()==(p4.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(2).getAbscisse()==(p5.getAbscisse()));\n\t\t\tassertTrue(i.getPoint().get(0).getAbscisse()==(p6.getAbscisse()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getOrdonnee()==(p1.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(1).getOrdonnee()==(p2.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(5).getOrdonnee()==(p3.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(3).getOrdonnee()==(p4.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(2).getOrdonnee()==(p5.getOrdonnee()));\n\t\t\tassertTrue(i.getPoint().get(0).getOrdonnee()==(p6.getOrdonnee()));\n\t\t\t\n\t\t\tassertTrue(i.getPoint().get(4).getProfondeur()==(p1.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(1).getProfondeur()==(p2.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(5).getProfondeur()==(p3.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(3).getProfondeur()==(p4.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(2).getProfondeur()==(p5.getProfondeur()));\n\t\t\tassertTrue(i.getPoint().get(0).getProfondeur()==(p6.getProfondeur()));\n\t\t\t\n\t\t\t//On teste si les faces de l'octaedre contiennent bien les points créés\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(0).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(0).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(1).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(1).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(2).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(2).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(3).contient(p1));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(3).contient(p6));\n\t\t\n\t\t\tassertTrue(i.getFaces().get(4).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(4).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(5).contient(p3));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(5).contient(p6));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(6).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(6).contient(p5));\n\t\t\t\n\t\t\tassertTrue(i.getFaces().get(7).contient(p2));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p4));\n\t\t\tassertTrue(i.getFaces().get(7).contient(p6));\n\t\t\t\n\t\t\t\n\t\t\t\n\t}",
"separador(){\r\n uno = null;\r\n dos = null;\r\n tres = null;\r\n cero = null;\r\n }",
"public ManipularEstudiantes() {\n initComponents();\n cme = new Control_Mantenimiento_Estudiante(this);\n this.gUI_botones2.agregar_eventos(cme);\n }",
"@Override\n public String toString() {\n return \"Ultima Manutencao em: \"+this.ultimaManun+\" km's.\";\n }",
"public MatkaKokoelma() {\n tallentaja = new TXTTallentaja();\n matkat = new ArrayList<Matka>();\n matkojenkesto = 0.0;\n }",
"@Override\npublic String toString() {// PARA MOSTRAR LOS DATOS DE ESTA CLASE\n// TODO Auto-generated method stub\nreturn MuestraCualquiera();\n}",
"public static void main(String[] args)\n\t{\n\t\tPoint point_test = new Point(2,2);\n\t\tdouble niveauContamination_test = 0;\n\t\tString fonction_test = \"Citoyens\";\n\t\tint joursMalades_test = 0;\n\t\tdouble probaTransmettre_test = 0;\n\t\tboolean etatMortalite_test = false;\n\t\tdouble risqueMortalite_test = 0;\n\t\tdouble risqueMaladie_test = 0;\n\t\tint joursGueris_test = 0;\n\t\tboolean etatMaladie_test = false;\n\t\tboolean existence_test = false;\n\t\tCitoyen c1 = new Medecin(\"FAN\",point_test,niveauContamination_test,risqueMaladie_test,probaTransmettre_test,risqueMortalite_test);\n\t\tCitoyen c2 = new Medecin(\"JIANG\",point_test,niveauContamination_test,risqueMaladie_test,probaTransmettre_test,risqueMortalite_test,\"Medecin\",true,10);\n\t\tPoint coord = new Point(2,2);\n\t\tcoord = c1.getCoordonnees();\n\t\tSystem.out.println(\"x = \"+coord.getLigne()+\": y = \"+coord.getColonne());\n\t\t\n\t\tpoint_test.setCoordonnees(8,8);\n\t\tc2.setCoordonnees(point_test);\n\t\tcoord = c2.getCoordonnees();\n\t\tSystem.out.println(\"x = \"+coord.getLigne()+\": y = \"+coord.getColonne());\n\t\tif(c2.getExistence())\tSystem.out.println(\"L'existence = true.\");\n\t\telse\tSystem.out.println(\"L'existence = false.\");\n\t\t\n\t\tSystem.out.println(\"INFORMATIONS\");\n\t\tSystem.out.println(c2.toString());\n\t}",
"private void obtenerGastosDiariosMes() {\n\t\t// Obtenemos las fechas actuales inicial y final\n\t\tCalendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n int diaFinalMes = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n\t\tList<Movimiento> movimientos = this.movimientoService.obtenerMovimientosFechaUsuario(idUsuario, LocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(),1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(), diaFinalMes));\n\t\tList<Double> listaGastos = new ArrayList<Double>();\n\t\tList<String> listaFechas = new ArrayList<String>();\n\t\t\n\t\tDate fechaUtilizadaActual = null;\n\t\tdouble gastoDiario = 0;\n\t\t\n\t\tfor (Iterator iterator = movimientos.iterator(); iterator.hasNext();) {\n\t\t\tMovimiento movimiento = (Movimiento) iterator.next();\n\t\t\tif(fechaUtilizadaActual == null) { //Comprobamos si se acaba de entrar en el bucle para inicializar la fecha del movimiento\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha();\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Si hemos cambiado de fecha del movimiento se procede a guardar los datos recogidos\n\t\t\tif(!fechaUtilizadaActual.equals(movimiento.getFecha())) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t\tgastoDiario = 0; // Reiniciamos el contador del gasto\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha(); // Almacenemos la fecha del nuevo gasto\n\t\t\t}\n\t\t\t\n\t\t\t// Si el movimiento que se ha realizado es un gasto lo sumamos al contador de gasto\n\t\t\tif(movimiento.getTipo().equals(TipoMovimiento.GASTO)) {\n\t\t\t\tgastoDiario += movimiento.getCantidad();\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Comprobamos si es el ultimo item del iterador y almacenamos sus datos\n\t\t\tif(!iterator.hasNext()) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.listadoGastosDiariosDiagrama = new Double[listaGastos.size()];\n\t\tthis.listadoGastosDiariosDiagrama = listaGastos.toArray(this.listadoGastosDiariosDiagrama);\n\t\tthis.fechasDiagrama = new String[listaFechas.size()];\n\t\tthis.fechasDiagrama = listaFechas.toArray(this.fechasDiagrama);\n\t\t\n\t}",
"public void limpiarMesa() {\n for (int i = 0; i < mesa.length; i++) {\n mesa[i][1] = 0;\n }\n }",
"public void datos(Temperatura t1){\n //Pizarra x = new Pizarra();\n //Dialog d = new Dialog();\n String v;\n float numero;\n //char n; \n //x.setVisible(true);\n //n = r.charAt(0);\n \n switch(opc){\n case 1:\n do\n v = d.readString(\"Ingresa la temperatura en grados Farenheit\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setFaren(numero);\n break;\n case 2:\n do\n v = d.readString(\"Ingresa la temperatura en grados Celsius\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setCelsius(numero);\n break;\n }\n }",
"private void inicializarVariablesControlRonda() {\n\t\ttieneAs = new int[4];\n\t\tfor(int i=0;i<tieneAs.length;i++) {\n\t\t\ttieneAs[i]=0;\n\t\t}\n\t\tidJugadores = new String[3];\n\t\tvalorManos = new int[4];\n\t\t\n\t\tmazo = new Baraja();\n\t\tCarta carta;\n\t\tganador = new ArrayList<String>();\n\t\tapuestasJugadores = new int[3];\n\t\tmanoJugador1 = new ArrayList<Carta>();\n\t\tmanoJugador2 = new ArrayList<Carta>();\n\t\tmanoJugador3 = new ArrayList<Carta>();\n\t\tmanoDealer = new ArrayList<Carta>();\n\t\tparejaNombreGanancia = new ArrayList<Pair<String,Integer>>(); \n\t\t\n\t\t// gestiona las tres manos en un solo objeto para facilitar el manejo del hilo\n\t\tmanosJugadores = new ArrayList<ArrayList<Carta>>(4);\n\t\tmanosJugadores.add(manoJugador1);\n\t\tmanosJugadores.add(manoJugador2);\n\t\tmanosJugadores.add(manoJugador3);\n\t\tmanosJugadores.add(manoDealer);\n\t\t// reparto inicial jugadores 1 y 2\n\t\tfor (int i = 1; i <= 2; i++) {\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador1.add(carta);\n\t\t\tcalcularValorMano(carta, 0);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador2.add(carta);\n\t\t\tcalcularValorMano(carta, 1);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador3.add(carta);\n\t\t\tcalcularValorMano(carta, 2);\n\t\t}\n\t\t// Carta inicial Dealer\n\t\tcarta = mazo.getCarta();\n\t\tmanoDealer.add(carta);\n\t\tcalcularValorMano(carta, 3);\n\n\t\t\n\t}",
"public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}",
"public String getEmisora(){\n return Float.toString(emisora);\n }",
"@Test\n public void getMese() {\n EAMese eaMesePrevisto;\n EAMese eaMeseOttenuto;\n\n eaMesePrevisto = EAMese.maggio;\n sorgente = \"maggio\";\n eaMeseOttenuto = EAMese.getMese(sorgente);\n assertNotNull(eaMeseOttenuto);\n assertEquals(eaMesePrevisto, eaMeseOttenuto);\n\n eaMesePrevisto = EAMese.ottobre;\n sorgente = \"ott\";\n eaMeseOttenuto = EAMese.getMese(sorgente);\n assertNotNull(eaMeseOttenuto);\n assertEquals(eaMesePrevisto, eaMeseOttenuto);\n }",
"public Celula() { // Sentinela\n\t\tthis.item = new Jogador();\n\t\tproximo = null;\n\t}",
"public Calculadora(){\n this.operador1 = 0.0;\n this.operador2 = 0.0;\n this.resultado = 0.0;\n }",
"public datosTaller() {\n this.cedulaCliente = new int[100]; //Atributo de la clase\n this.nombreCliente = new String[100]; //Atributo de la clase\n this.compraRealizada = new String[100]; //Atributo de la clase\n this.valorCompra = new float[100]; //Atributo de la clase\n this.posicionActual = 0; //Inicializacion de la posicion en la que se almacenan datos\n }",
"Etudiant(String prenom, String nom, double note) {\n this.prenom = prenom;\n this.nom = nom;\n this.note = note;\n\n addNote(note);\n addEtudiant();\n\n }",
"public Nodo() {\n this.valor = 0;\n this.proximo=null;\n\n }",
"public void obtener() {\r\n \t\r\n \tif (raiz!=null)\r\n {\r\n int informacion = raiz.dato;\r\n raiz = raiz.sig;\r\n end = raiz;\r\n System.out.println(\"Obtenemos el dato de la cima: \"+informacion);\r\n }\r\n else\r\n {\r\n System.out.println(\"No hay datos en la pila\");\r\n }\r\n }",
"@Test\n public void testDajMeteoPrognoze() throws Exception {\n System.out.println(\"dajMeteoPrognoze\");\n int id = 0;\n String adresa = \"\";\n EJBContainer container = javax.ejb.embeddable.EJBContainer.createEJBContainer();\n MeteoIoTKlijent instance = (MeteoIoTKlijent)container.getContext().lookup(\"java:global/classes/MeteoIoTKlijent\");\n MeteoPrognoza[] expResult = null;\n MeteoPrognoza[] result = instance.dajMeteoPrognoze(id, adresa);\n assertArrayEquals(expResult, result);\n container.close();\n // TODO review the generated test code and remove the default call to fail.\n }",
"@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}",
"public Coordenada (Datum _d, double x, double y, double z,\r\n\t\t byte _zona, boolean _hemisferio_N)\r\n {\r\n d = _d;\r\n X = x;\r\n Y = y;\r\n Z = z; // Altura ortometrica, sobre NMMA\r\n zona = _zona;\r\n zona_ori = _zona;\r\n hemisferio_N = _hemisferio_N;\r\n GenerarCoordenadasGeograficas();\r\n }",
"@Test\n void mostraTutti() {\n EAMese[] matrice = EAMese.values();\n assertNotNull(matrice);\n assertEquals(12, matrice.length);\n\n System.out.println();\n String sep = \" - \";\n int k=0;\n for (EAMese mese : matrice) {\n System.out.println(++k+sep+mese.getLungo() + sep + mese.getBreve() + sep + mese.getGiorni());\n }// end of for cycle\n\n }",
"private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}",
"public void actualizarPantallaJuego(float delta)\r\n {\r\n //recuadroInfoJuego.actualizarTiempo(delta); // Con esto actualizamos el tiempo del HUD\r\n\r\n // Con el siguiente ciclo actualizamos el movimiento o posicion de los monstruos\r\n for (int i=0; i < enemigos.size(); i++)\r\n {\r\n // Metodo encargado de renovar las posiciones dado un diferencial de tiempo\r\n enemigos.get(i).actualizarPosicion(delta);\r\n\r\n // En caso que el enemigo haya muerto entonces\r\n if (enemigos.get(i).haMuerto())\r\n {\r\n // Se lo pasamos al jugador contrario de modo que\r\n try\r\n {\r\n // Le enviamos un mensaje sobre que tipo de enemigo debe generar de manera aleatoria\r\n String aux = \"Transferir enemigo: \" + enemigos.get(i).getTipo() + \"\\n\";\r\n socketCliente.getOutputStream().write(aux.getBytes());\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n // Se suma su valor en puntaje al puntaje general obtenido por el usuario\r\n recuadroInfoJuego.agregarPuntaje(enemigos.get(i).getPuntaje());\r\n\r\n // Luego, se suma uno al numero total de enemigos eliminados por el jugador\r\n recuadroInfoJuego.anotarEnemigo();\r\n\r\n // Y se elimina el monstruo de la lista de enemigos\r\n enemigos.remove(i);\r\n i = i - 1;\r\n }\r\n }\r\n\r\n // Si ya se cumplio el tiempo para generar otro monstruo entonces\r\n if (contaTiempo >= tiempoParaGeneracion)\r\n {\r\n // Agregamos un nuevo enemigo aleatorio en coordenas generadas tambien de manera aleatoria\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), MathUtils.random(1,5), true));\r\n\r\n // Y reseteamos el contador de tiempo\r\n contaTiempo = 0;\r\n }\r\n\r\n // O si se detecto que me pasaron un monstruo entonces\r\n if (enemigoTransferido != -1)\r\n {\r\n // Genero el tipo de monstruo especificado en coordenadas aleatorias\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), enemigoTransferido, true));\r\n\r\n // Y reinicio el dectector de monstruos tranferidos\r\n enemigoTransferido = -1;\r\n }\r\n\r\n contaTiempo = contaTiempo + delta; // Por ultimo se cuenta el tiempo\r\n }",
"public void calculEtatSuccesseur() { \r\n\t\tboolean haut = false,\r\n\t\t\t\tbas = false,\r\n\t\t\t\tgauche = false,\r\n\t\t\t\tdroite = false,\r\n\t\t\t\thautGauche = false,\r\n\t\t\t\tbasGauche = false,\r\n\t\t\t\thautDroit = false,\r\n\t\t\t\tbasDroit = false;\r\n\t\t\r\n\t\tString blanc = \" B \";\r\n\t\tString noir = \" N \";\r\n\t\tfor(Point p : this.jetonAdverse()) {\r\n\t\t\tString [][]plateau;\r\n\t\t\tplateau= copieEtat();\r\n\t\t\tint x = (int) p.getX();\r\n\t\t\tint y = (int) p.getY();\r\n\t\t\tif(this.joueurActuel.getCouleur() == \"noir\") { //dans le cas ou le joueur pose un pion noir\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) { //on regarde uniquement le centre du plateaau \r\n\t\t\t\t\t//on reinitialise x,y et plateau a chaque étape\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tdroite = getDroite(x,y,blanc);\r\n\t\t\t\t\thaut = getHaut(x, y, blanc);\r\n\t\t\t\t\tbas = getBas(x, y, blanc);\r\n\t\t\t\t\tgauche = getGauche(x, y, blanc);\r\n\t\t\t\t\thautDroit = getDiagHautdroite(x, y, blanc);\r\n\t\t\t\t\thautGauche = getDiagHautGauche(x, y, blanc);\r\n\t\t\t\t\tbasDroit = getDiagBasDroite(x, y, blanc);\r\n\t\t\t\t\tbasGauche = getDiagBasGauche(x, y, blanc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y-1]==noir) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(droite) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//1\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==noir) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(bas) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==noir) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(gauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(haut) {\r\n\t\t\t\t\t\t\t//System.out.println(\"regarde en dessous\");\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==noir) {\r\n\t\t\t\t\t\tif(hautGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(basGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit : OK!\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(hautDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==noir) {\r\n\t\t\t\t\t\tif(basDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t//System.out.println(\"ajouté!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {//si le joueur actuel a les pions blanc\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x][y-1]==blanc) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(getDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}//1.1\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==blanc) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getBas(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2.2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==blanc) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getGauche(x, y, noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3.3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == blanc) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getHaut(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4.4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5.5\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//6.6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautdroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7.7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8.8\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public double[] getVentasXMes() {\r\n double vMes[] = new double[nm];\r\n int j;\r\n for (j = 0; j < nm; j++) {\r\n vMes[j] = getVentasMes(j);\r\n }\r\n return vMes;\r\n }",
"public static void main (String [] args){\r\n Jefatura jefe_RR=new Jefatura(\"Jeanpool\",55000,2006,9,25);\r\n jefe_RR.estableceIncentivo(2570);\r\n Empleado [] misEmpleados=new Empleado[6];\r\n misEmpleados[0]=new Empleado(\"Paco Gomez\",85000,1990,12,17);\r\n misEmpleados[1]=new Empleado(\"Ana Lopez\",95000,1995,06,02);\r\n misEmpleados[2]=new Empleado(\"Maria Martin\",105000,2002,03,15);\r\n misEmpleados[3]=new Empleado(\"Jeanpool Guerrero\");\r\n misEmpleados[4]=jefe_RR;/**--Polimorfismo: Prinicipio de sustitucion*/\r\n misEmpleados[5]=new Jefatura(\"Maria\",95000,1999,5,26);\r\n Jefatura jefa_Finanzas=(Jefatura)misEmpleados[5];/** CASTING CONVERTIR UN OBJETO A otro */\r\n jefa_Finanzas.estableceIncentivo(55000);\r\n \r\n \r\n \r\n /** for(int i=0;i<3; i++){\r\n misEmpleados[i].subeSueldo(5);\r\n \r\n }\r\n \r\n for(int i=0;i<3;i++){\r\n System.out.println(\"Nombre \"+misEmpleados[i].dimeNombre() + \"Sueldo: \"+misEmpleados[i].dimeSueldo()+ \"Fecha Alta: \"+misEmpleados[i].dameFechaContrato());\r\n }\r\n */\r\n\r\n for(Empleado elementos:misEmpleados){\r\n \r\n elementos.subeSueldo(5);\r\n \r\n }\r\n \r\n for(Empleado elementos:misEmpleados){\r\n System.out.println(\"Nombre: \"+elementos.dimeNombre()+ \" Sueldo: \"+elementos.dimeSueldo()+ \" Alta Contrato: \"+elementos.dameFechaContrato());\r\n }\r\n \r\n }",
"public ListaDE() {\n\n\t\tprimero = ultimo = null;\n\t\ttotal = 0;\n\n\t}",
"public void ordenaPontos(){\r\n\t\tloja.ordenaPontos();\r\n\t}",
"public static void main(String[] args) {\n\t\tElectrodomestico[] electrodomesticos = new Electrodomestico[10];\n\t\t\n\t\telectrodomesticos[0] = new Lavadora();\n\t\telectrodomesticos[1] = new Television(29, true);\n\t\telectrodomesticos[2] = new Television();\n\t\telectrodomesticos[3] = new Electrodomestico((float)1555.8, 20);\n\t\telectrodomesticos[4] = new Lavadora(800, 30);\n\t\telectrodomesticos[5] = new Television(699, 55);\n\t\telectrodomesticos[6] = new Lavadora(2900, 81);\n\t\telectrodomesticos[7] = new Electrodomestico();\n\t\telectrodomesticos[8] = new Electrodomestico(567, \"rojo\", 'a', 78);\n\t\telectrodomesticos[9] = new Lavadora(45);\n\t\t//electrodomesticos[10] = new Television(67, false);\n\t\t\n\t\tint precioT = 0, precioE = 0, precioL = 0;\n\t\t\n\t\tfor (Electrodomestico electrodomestico : electrodomesticos) {\n\t\t\tif(electrodomestico instanceof Television) {\n\t\t\t\telectrodomestico.precioFinal();\n\t\t\t\tSystem.out.println(\"Precio televisor: \" + electrodomestico.getPrecioBase());\n\t\t\t\tprecioT += electrodomestico.getPrecioBase();\n\t\t\t} else if(electrodomestico instanceof Lavadora){\n\t\t\t\telectrodomestico.precioFinal();\n\t\t\t\tSystem.out.println(\"Precio lavadora: \" + electrodomestico.getPrecioBase());\n\t\t\t\tprecioL += electrodomestico.getPrecioBase();\n\t\t\t} else {\n\t\t\t\telectrodomestico.precioFinal();\n\t\t\t\tSystem.out.println(\"Precio electrodomestico: \" + electrodomestico.getPrecioBase());\n\t\t\t\tprecioE += electrodomestico.getPrecioBase();\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\nTelevisores\\nEl precio total de los televisores es de: \" + precioT);\n\t\tSystem.out.println(\"\\nLavadoras\\nEl precio total de las lavadoras es de: \" + precioL);\n\t\tSystem.out.println(\"\\nElectrodomesticos\\nEl precio total de los electrodomestricos es de: \" + (precioT + precioL + precioE));\n\t}",
"public void tipoDatos() {\n\t\tint num = 10;\n\t\t// Texto STring\n\t\tString cadena = \"cadena\";\n\n\t\t// Decimale O flotante\n\t\tdouble decimal = 12.16;\n\t\tfloat fl = new Float(10);\n\t\t// Bolean\n\t\tboolean bl = true;\n\n\t\t// ARREGLOS\n\t\t// string\n\t\tString[] veString = new String[5];\n\t\tveString[0] = \"hola mundo\";\n\t\tveString[1] = \"hola mundo\";\n\t\tveString[2] = \"hola mundo\";\n\t\tveString[3] = \"hola mundo\";\n\t\tveString[4] = \"hola mundo\";\n\n\t\tint[] varNum = new int[] { 0, 1, 2, 3, 4, 5 };\n\n\t}",
"public void consultaDinero(){\r\n System.out.println(this.getMonto());\r\n }",
"public Decyzja(Wycieczka wycieczka, Przodownik numerLegitymacji, String czyZatwierdzona, Date data, String uzasadnienie){\n this.numerWycieczki = wycieczka;\n this.PrzodowniknumerLegitymacji = numerLegitymacji;\n this.czyZatwierdzona = czyZatwierdzona;\n this.data = data;\n this.uzasadnienie = uzasadnienie;\n }",
"public Empleados(String nom, double sue,int agno,int mes,int dia) {\r\n\t\t\r\n\t\tnombre=nom;\r\n\t\tsueldo=sue;\r\n\t\tGregorianCalendar calendario=new GregorianCalendar(agno,mes-1,dia);\r\n\t\taltaContrato=calendario.getTime();\r\n\t}",
"double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\n }",
"public Monte() {\n\t\tmonte = new ArrayList<Carta>();\n\t}",
"public static void main(String[] args) {\n Alumno aaDatos []; // El identificador es nulo\n \n aaDatos = new Alumno[tam];//Creamos un arreglo de 10 \n //alumnos - AQUI HABRA PREGUNTA\n for (int i = 0; i < aaDatos.length; i++) {\n aaDatos[i]= new Alumno(\"Dany\",\"16550518\", 0);//Para cada lugar de arreglo se crea un objeto de la clase alumno\n \n }\n for (Alumno aaDatos1: aaDatos) {\n System.out.println(\"Nombre: \"+ aaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaDatos1.getiCar());\n \n }\n \n \n //CREAMOS UNA COPIA DEL ARREGLO\n Alumno aaCopiaDatos [];\n aaCopiaDatos = new Alumno [tam];\n \n for (int i = 0; i < aaCopiaDatos.length; i++) {\n aaCopiaDatos[i]= new Alumno(aaDatos[i].getsNom(), // <<<Se llenan todos los datos que pide el constructor por argumentos\n aaDatos[i].getsMatri(), \n aaDatos[i].getiCar());\n \n }\n for (Alumno aaCopiaDatos1 : aaCopiaDatos) {\n System.out.println(\"Nombre: \"+ aaCopiaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaCopiaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaCopiaDatos1.getiCar());\n }\n System.out.println(aaDatos);\n System.out.println(aaCopiaDatos);\n }",
"public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }",
"public Momentum() {\r\n m1 = m2 = v1 = v2 = p1 = p2 = comx = cv = 0.0;\r\n xp1 = 0.0;\r\n xp2 = 900.0;\r\n m1 = 2.0;\r\n m2 = 1.0;\r\n v1 = 1.0;\r\n v2 = -1.0;\r\n\r\n //m1 = m2 = 1.0;\r\n //v1 = 2.0;\r\n //v2 = -4.0;\r\n d = dc = 8.0;\r\n }",
"private void laskeMatkojenKesto() {\n matkojenkesto = 0.0;\n\n for (Matka m : matkat) {\n matkojenkesto += m.getKesto();\n }\n }",
"public Moto(float cilindrada,String _patente, int _cantRuedas)\n {\n super(_patente, _cantRuedas, eMarca.ZANELLA);\n this._cilindrada=cilindrada;\n }",
"private void dodajToken() throws SmartScriptParserException {\n\t\tif (echoNodeTokeni == null) {\n\t\t\techoNodeTokeni = new ArrayBackedIndexedCollection();\n\t\t}\n\n\t\tif (Character.isLetter(gradiTekst.toString().charAt(0))) {\n\t\t\techoNodeTokeni.add(new TokenVariable(gradiTekst.toString()));\n\t\t}\n\t\telse if (provjeriInteger(gradiTekst.toString())) {\n\t\t\techoNodeTokeni.add(new TokenConstantInteger(Integer.parseInt(gradiTekst.toString())));\n\t\t}\n\t\telse if (provjeriDouble(gradiTekst.toString())) {\n\t\t\techoNodeTokeni.add(new TokenConstantDouble(Double.parseDouble(gradiTekst.toString())));\n\t\t}\n\t\telse if (gradiTekst.toString().charAt(0) == '@') {\n\t\t\techoNodeTokeni.add(new TokenFunction(gradiTekst.toString().substring(1)));\n\t\t}\n\t\telse if (gradiTekst.toString().charAt(0) == '\"') {\n\t\t\techoNodeTokeni.add(new TokenString(String.format(gradiTekst.toString().substring(1,\n\t\t\t\t\tgradiTekst.toString().length() - 1))));\n\t\t}\n\t\telse if (gradiTekst.toString().charAt(0) == '+' || gradiTekst.toString().charAt(0) == '-'\n\t\t\t\t|| gradiTekst.toString().charAt(0) == '*' || gradiTekst.toString().charAt(0) == '/') {\n\t\t\techoNodeTokeni.add(new TokenOperator(gradiTekst.toString()));\n\t\t}\n\t\telse {\n\t\t\tthrow new SmartScriptParserException(\"Greska u Token parametrima\");\n\t\t}\n\t}",
"public Campo() {\r\n this.primoGrande = new BigInteger(\"20835161731609124123432674631212444\"\r\n + \"8251235562226470491514186331217050270460481\");\r\n this.limite = new BigInteger[2];\r\n System.out.println(\"Campo: \" + this.primoGrande);\r\n this.setDominio();\r\n }",
"public TableModelMedicionTemporal(float[][] datos, String[] encabezado) {\r\n\r\n\t\tcolumnNames = encabezado;\r\n\t\tthis.datos = datos;\r\n\t}",
"public Summalista()\r\n\t{\r\n\t\tthis.summa = 0;\r\n\t\tthis.alkiot = 0;\r\n\t}",
"@Override\n\tpublic void teclaCorrigeDigitada() {\n\t\t\n\t}",
"public java.lang.String getIdentificadorODE()\r\n {\r\n return this.identificadorODE;\r\n }",
"void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}",
"public void teken(){\n removeAll();\n \n //eerste tekening\n if(tekenEerste != false){\n tekenMuur();\n tekenSleutel();\n veld[9][9] = 6;\n tekenEerste = false;\n tekenBarricade();\n }\n \n //methode die de speler de waarde van de sleutel geeft aanroepen\n sleutelWaarde();\n \n //de methode van het spel einde aanroepen\n einde();\n \n //vernieuwd veld aanroepen\n veld = speler.nieuwVeld(veld);\n \n //het veld tekenen\n for(int i = 0; i < coordinaten.length; i++) {\n for(int j = 0; j < coordinaten[1].length; j++){\n switch (veld[i][j]) {\n case 1: //de sleutels\n if(i == sleutel100.getY() && j == sleutel100.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel1002.getY() && j == sleutel1002.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel200.getY() && j == sleutel200.getX()){\n coordinaten[i][j] = new SleutelVakje(200);\n }\n else if (i == sleutel300.getY() && j == sleutel300.getX()){\n coordinaten[i][j] = new SleutelVakje(300);\n } break;\n case 2: //de muren\n coordinaten[i][j] = new MuurVakje();\n break;\n // de barricades\n case 3:\n coordinaten[i][j] = new BarricadeVakje(100);\n break;\n case 4:\n coordinaten[i][j] = new BarricadeVakje(200);\n break;\n case 5:\n coordinaten[i][j] = new BarricadeVakje(300);\n break;\n case 6: // het eindveld vakje\n coordinaten[i][j] = new EindveldVakje();\n break;\n default: // het normale vakje\n coordinaten[i][j] = new CoordinaatVakje();\n break;\n }\n //de speler\n coordinaten[speler.getY()][speler.getX()] = new SpelerVakje();\n \n //het veld aan de JPanel toevoegen\n add(coordinaten[i][j]);\n }\n }\n System.out.println(\"Speler waarde = \" + speler.getSleutelWaarde());\n revalidate();\n repaint();\n }",
"private Boolean esMejor() {\n if(debug) {\n System.out.println(\"**********************esMejor\");\n }\n \n if(this.solOptima == null || (this.sol.pesoEmparejamiento < this.solOptima.pesoEmparejamiento)) return true;\n else return false;\n }",
"public misDatos() {\n\tinitComponents();\n\tsetLocationRelativeTo(null);\n\tthis.nombre.setText(nodo.getContenido().getNombre());\n\tthis.apellido.setText(nodo.getContenido().getApellido());\n\tthis.carrera.setText(nodo.getContenido().getCarrera());\n\tthis.carnet.setText(Integer.toString(nodo.getContenido().getCarnet()));\n\n }",
"public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}",
"public int getPontosTimeMandante() {\r\n return pontosTimeMandante;\r\n }",
"public java.lang.String getMEINS() {\n return MEINS;\n }",
"public java.lang.String getMEINS() {\n return MEINS;\n }",
"private void ZeigeAlleKontakte() throws Exception {\n\t\r\n\t\tList<Kontakt> kontaktarray = new ArrayList<Kontakt>();\r\n\t\r\n\t\tKontaktService service = (KontaktService) Naming.lookup (\"rmi://localhost:1099/KontaktService\");\r\n\t\t\r\n\t\tkontaktarray = service.getKontakte();\r\n\t\r\n\t\tKontakt k = new Kontakt();\r\n\t\t\r\n\t\tString xAusgabe = \"\"; \r\n\t\tIterator<Kontakt> iterator = kontaktarray.iterator();\r\n\t\twhile (iterator.hasNext()) {\r\n\t\t\t\r\n\t\t\tk = iterator.next();\r\n\t\t\t\r\n\t\t\txAusgabe = Objects.toString(k.getcId());\r\n\t\t\txAusgabe += \" ; \";\r\n\t\t\txAusgabe += k.getcNName();\r\n\t\t\txAusgabe += \" ; \";\r\n\t\t\txAusgabe += k.getcVName();\r\n\t\t\t// TODO: Restliche Felder ausgeben\r\n\t\t\t\r\n\t\t\tSystem.out.println(xAusgabe);\t\t\t\t\r\n\t\t\t}\r\n\t}",
"private void m1do() {\n for (int i = 0; i < 2; i++) {\n this.my[i] = null;\n }\n for (int i2 = 0; i2 < 2; i2++) {\n this.mz[i2] = 0;\n }\n this.mC = 0.0d;\n this.lf = 0;\n }"
]
| [
"0.6755881",
"0.59981745",
"0.5888508",
"0.57506496",
"0.57257235",
"0.5706368",
"0.56694764",
"0.5657638",
"0.55908436",
"0.55879104",
"0.55872625",
"0.5584629",
"0.55776507",
"0.55271226",
"0.55115986",
"0.5489856",
"0.5475688",
"0.5455248",
"0.5439337",
"0.54335284",
"0.5428133",
"0.5422138",
"0.5421296",
"0.5419783",
"0.54195845",
"0.5414768",
"0.5397854",
"0.539279",
"0.5377427",
"0.5376086",
"0.53744924",
"0.53721637",
"0.5361957",
"0.53578043",
"0.5356427",
"0.53334486",
"0.53314483",
"0.532814",
"0.53274316",
"0.5326533",
"0.5324912",
"0.53233665",
"0.53211814",
"0.5312144",
"0.530521",
"0.52998245",
"0.5298648",
"0.5287628",
"0.52859735",
"0.5284288",
"0.5279824",
"0.5276551",
"0.52714235",
"0.5271365",
"0.52681553",
"0.52678955",
"0.5257671",
"0.52531415",
"0.52520996",
"0.52329683",
"0.5228171",
"0.52248865",
"0.5223758",
"0.52211463",
"0.5214275",
"0.52098334",
"0.5209248",
"0.52087206",
"0.5208474",
"0.5208155",
"0.52079403",
"0.5199958",
"0.5192281",
"0.5188254",
"0.5181795",
"0.51814765",
"0.51737475",
"0.51702446",
"0.51694655",
"0.51670265",
"0.5159749",
"0.5159732",
"0.51587695",
"0.51573324",
"0.5153306",
"0.5149952",
"0.51486474",
"0.5147569",
"0.514696",
"0.51450455",
"0.5142984",
"0.51403624",
"0.5137737",
"0.5135824",
"0.51343447",
"0.51335657",
"0.51334846",
"0.5127516",
"0.5127516",
"0.51219004",
"0.51189315"
]
| 0.0 | -1 |
Created by Wally1 on 11/06/2016. | public interface OrganizationInteractor {
interface onOrganization{
void onErrorName();
void onErrorTel();
void onErrorAddres();
void onCreate(boolean s);
}
boolean createOrganization(String name,String tel,String dir, onOrganization listener);
Organization getOrganiation(int i);
void delteOrganization(int i);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void mo51373a() {\n }",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"public void mo38117a() {\n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private static void cajas() {\n\t\t\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"private void m50366E() {\n }",
"public void mo12628c() {\n }",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"protected void mo6255a() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"public final void mo91715d() {\n }",
"public void mo6081a() {\n }",
"private void poetries() {\n\n\t}",
"private void kk12() {\n\n\t}",
"public void mo12930a() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n protected void getExras() {\n }",
"public void mo21779D() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"public Pitonyak_09_02() {\r\n }",
"private Rekenhulp()\n\t{\n\t}",
"public void mo21877s() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"private void init() {\n\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"public void mo9848a() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void init() {\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n public void init() {\n }",
"@Override\n public void memoria() {\n \n }",
"public void mo3376r() {\n }",
"public void mo1531a() {\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"public void mo21878t() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"private TMCourse() {\n\t}",
"@Override\n public void init() {}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"public void mo21785J() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void m23075a() {\n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n void init() {\n }"
]
| [
"0.6098719",
"0.6018274",
"0.59224385",
"0.58828264",
"0.58544546",
"0.58497",
"0.58246577",
"0.5804394",
"0.58016825",
"0.575713",
"0.575713",
"0.56949395",
"0.5689027",
"0.5687629",
"0.5683553",
"0.56419206",
"0.56419206",
"0.56419206",
"0.56419206",
"0.56419206",
"0.56419206",
"0.56419206",
"0.5634053",
"0.5616454",
"0.5612652",
"0.5610232",
"0.56062067",
"0.5594932",
"0.5594601",
"0.55881125",
"0.55746806",
"0.55684215",
"0.5565491",
"0.5561962",
"0.5561962",
"0.5561962",
"0.5561962",
"0.5561962",
"0.5556183",
"0.55547327",
"0.5549488",
"0.5548788",
"0.5543202",
"0.553249",
"0.55281776",
"0.55145806",
"0.54913324",
"0.54760593",
"0.54748833",
"0.54715866",
"0.5469093",
"0.54679066",
"0.54661477",
"0.54661477",
"0.5460996",
"0.5459478",
"0.5454451",
"0.54541546",
"0.54541546",
"0.54519635",
"0.54485506",
"0.54485506",
"0.54485506",
"0.54460347",
"0.54454327",
"0.5442152",
"0.5439112",
"0.5438607",
"0.5427026",
"0.5424366",
"0.5424366",
"0.5424366",
"0.5424365",
"0.5420505",
"0.54098463",
"0.54089546",
"0.5406394",
"0.5404798",
"0.5399829",
"0.5397712",
"0.53952575",
"0.53948474",
"0.5394108",
"0.5393427",
"0.53860444",
"0.53857684",
"0.53851926",
"0.53756833",
"0.53756833",
"0.53756833",
"0.53756833",
"0.53756833",
"0.53756833",
"0.537426",
"0.53736",
"0.53735894",
"0.53735006",
"0.53735006",
"0.53735006",
"0.5369266",
"0.5361242"
]
| 0.0 | -1 |
Created by PC6 on 25.04.2017. | public interface FeedbackService {
void add(String subject, String text, Date date, Task task, User user);
void edit(int id, String subject, String text, Date date);
void delete(int id);
Feedback findById(int id);
List<Feedback> findAllForTask(Task task);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"public final void mo51373a() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo38117a() {\n }",
"public void mo4359a() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public Pitonyak_09_02() {\r\n }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n public void memoria() {\n \n }",
"private void poetries() {\n\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void mo6081a() {\n }",
"Petunia() {\r\n\t\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private Rekenhulp()\n\t{\n\t}",
"private void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"protected MetadataUGWD() {/* intentionally empty block */}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n public int describeContents() { return 0; }",
"private void m50366E() {\n }",
"private TMCourse() {\n\t}",
"protected void mo6255a() {\n }",
"public void gored() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"public void mo55254a() {\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void init() {\n }",
"@Override\n void init() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n public void init() {}",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"private zza.zza()\n\t\t{\n\t\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void create () {\n\n\t}",
"public void mo12930a() {\n }",
"@Override\n protected void init() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"public void mo12628c() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"private MetallicityUtils() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"private void init() {\n\n\n\n }",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}"
]
| [
"0.57652986",
"0.57026404",
"0.5677089",
"0.5655216",
"0.5620874",
"0.5556887",
"0.5556887",
"0.5533072",
"0.5518606",
"0.5509078",
"0.55026853",
"0.5497029",
"0.54651856",
"0.5454786",
"0.5453004",
"0.5435199",
"0.54341733",
"0.54056793",
"0.5402582",
"0.5394887",
"0.5391446",
"0.53864396",
"0.5370474",
"0.53422856",
"0.5333112",
"0.5333112",
"0.53294164",
"0.53294164",
"0.53294164",
"0.53294164",
"0.53294164",
"0.53294164",
"0.53294164",
"0.5314452",
"0.53143513",
"0.5303253",
"0.5288573",
"0.52757436",
"0.5273589",
"0.5262907",
"0.5262907",
"0.5262907",
"0.5262907",
"0.5262907",
"0.5258956",
"0.52520865",
"0.52512485",
"0.5247601",
"0.5243594",
"0.5226256",
"0.5224368",
"0.5223297",
"0.5222055",
"0.5214542",
"0.51983684",
"0.5188416",
"0.5181688",
"0.5173685",
"0.5173515",
"0.5161588",
"0.5157124",
"0.51567495",
"0.51567495",
"0.51567495",
"0.515211",
"0.51513404",
"0.5148079",
"0.5144472",
"0.5144472",
"0.5144472",
"0.5144436",
"0.5143285",
"0.51393515",
"0.51359326",
"0.5131458",
"0.5131458",
"0.51312935",
"0.51280415",
"0.5120711",
"0.51153207",
"0.51151335",
"0.5112881",
"0.5110426",
"0.5106613",
"0.5106613",
"0.5106613",
"0.5106613",
"0.5106613",
"0.5106613",
"0.51056725",
"0.51027524",
"0.50966305",
"0.50923043",
"0.50923043",
"0.50923043",
"0.50847185",
"0.508471",
"0.50844824",
"0.50844824",
"0.5078917",
"0.50739807"
]
| 0.0 | -1 |
Check fields depending on type of question | private boolean checkType() {
if (CorrectAnswer.getText().equals("") || typeQuestion.getValue() == null) {
if (typeQuestion.getValue() == null)
errorMsg += "Which type of question do you want?\n";
if (CorrectAnswer.getText().equals(""))
errorMsg += "There is no Correct Answer\n";
return false;
} else {
switch ((String) typeQuestion.getValue()) {
// case TrueFalse : it must true or false
case "TrueFalse" : {
if(CorrectAnswer.getText().equalsIgnoreCase("true") || CorrectAnswer.getText().equalsIgnoreCase("false"))
return true;
errorMsg += "The answer has to be True or False\n";
return false;
}
// case MCQ : the answer has to be in the list of the different proposed answers
case "MCQ" :
// each answer is different from the others
if(TextAnswer1.getText().equals(TextAnswer2.getText())
|| TextAnswer1.getText().equals(TextAnswer3.getText())
|| TextAnswer2.getText().equals(TextAnswer3.getText())) {
errorMsg += "You can not have multiple times the same answer !!!\n";
return false;
}
if(CorrectAnswer.getText().equals(TextAnswer1.getText())
|| CorrectAnswer.getText().equals(TextAnswer2.getText())
|| CorrectAnswer.getText().equals(TextAnswer3.getText()))
return true;
errorMsg += "There must be a Correct Answer !\n";
return false;
// case ShortAnswer : if there is an answer it is good
default:
return true;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void checkFields(){\n }",
"boolean hasField3();",
"boolean hasField4();",
"boolean hasField2();",
"boolean hasField1();",
"private void checkModels()\n {\n if (myDataType != null)\n {\n SpecialKey specialKey = myDataType.getMetaDataInfo().getSpecialTypeForKey(myField.get());\n if (specialKey instanceof TimeKey)\n {\n if (!(myCriterionValue instanceof DateModel))\n {\n switchValueModels(DateModel.class);\n }\n }\n else\n {\n if (myCriterionValue instanceof DateModel)\n {\n switchValueModels(GhostTextModel.class);\n }\n }\n }\n }",
"boolean hasFieldTypeId();",
"private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }",
"@Override\n\tprotected Boolean isValid(String[] fields) {\n\t\t//check - evnet_id, yes, maybe, invited, no\n return (fields.length > 4);\n\t}",
"private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}",
"boolean hasSecondField();",
"boolean hasField0();",
"public abstract boolean isTypeCorrect();",
"boolean hasFieldId();",
"@Test\n\tpublic void testFieldCRUDConfig() {\n\t\tfinal IntrospectionResult introspection = getIntrospection();\n\t\tfinal String entityInputTypeName = Entity6.class.getSimpleName() + schemaConfig.getInputTypeNameSuffix();\n\t\tfinal IntrospectionFullType entityInputType = getFullType(introspection, entityInputTypeName);\n\t\tfinal String entity6TypeName = Entity6.class.getSimpleName();\n\t\tfinal IntrospectionFullType entityType = getFullType(introspection, entity6TypeName);\n\t\t// Check field attr1 is not readable\n\t\tfinal Optional<IntrospectionTypeField> attr1Field = getOptionalField(entityType, \"attr1\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a readable field [{}] in [{}].\", \"typeField\", entity6TypeName),\n\t\t\t\tattr1Field.isPresent());\n\t\t// Check field attr2 is not saveable\n\t\tfinal Optional<IntrospectionInputValue> attr2InputField = getOptionalInputField(entityInputType, \"attr2\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a not saveable field [{}] in [{}].\", \"attr2\", entityInputTypeName),\n\t\t\t\tattr2InputField.isPresent());\n\t\t// Check field attr3 is not nullable\n\t\tassertInputField(entityInputType, \"attr3\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr4 is not nullableForCreate\n\t\tassertInputField(entityInputType, \"attr4\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr5 is not nullableForUpdate\n\t\tassertInputField(entityInputType, \"attr5\", IntrospectionTypeKindEnum.SCALAR, Scalars.GraphQLString.getName());\n\t\t// Check field attr6 is not filterable\n\t\tfinal String entityFilterTypeName = Entity6.class.getSimpleName()\n\t\t\t\t+ schemaConfig.getQueryGetListFilterEntityTypeNameSuffix();\n\t\tfinal IntrospectionFullType entityFilterInputType = getFullType(introspection, entityFilterTypeName);\n\t\tfinal Optional<IntrospectionInputValue> attr4IinputField = getOptionalInputField(entityFilterInputType,\n\t\t\t\t\"attr6\");\n\t\tAssert.assertFalse(\n\t\t\t\tMessage.format(\"There shouldn't be a filterable field [{}] in [{}].\", \"attr6\", entityFilterTypeName),\n\t\t\t\tattr4IinputField.isPresent());\n\t\t// Check field attr7 is mandatory\n\t\t// Check field attr8 is mandatory for update\n\t\t// Check field attr9 is mandatory for create\n\n\t\t// Check field attr10 is not readable for ROLE1\n\t\t// Check field attr10 is not readable for ROLE1\n\n\t\t// Check field attr11 is not saveable for ROLE1\n\n\t\t// Check field attr12 is not nullable for ROLE1\n\n\t\t// Check field attr13 is not nullable for update for ROLE1\n\n\t\t// Check field attr14 is not nullable for create for ROLE1\n\n\t\t// Check field attr15 is mandatory for ROLE1\n\n\t\t// Check field attr16 is mandatory for update for ROLE1\n\n\t\t// Check field attr17 is mandatory for create for ROLE1\n\n\t\t// Check field attr18 is not readable for ROLE1 and ROLE2\n\n\t\t// Check field attr19 is not readable for ROLE1 and ROLE2\n\n\t\t// Check field attr20 is not readable for ROLE1 and not saveable ROLE2\n\n\t\t// Check field attr21 is not readable and not nullable for ROLE1 and\n\t\t// ROLE2\n\n\t\t// Check field attr21 is readable and nullable for other roles than ROLE\n\t\t// 1 and ROLE2\n\n\t\t// Check field attr22 is readable for ROLE1\n\n\t\t// Check field attr22 is not readable for everybody except ROLE1\n\t}",
"private static void validate(int type, int field, int match, String value) {\n if ((type != Type.SONG) && (field == Field.PLAY_COUNT || field == Field.SKIP_COUNT)) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have years\n if (type != Type.SONG && field == Field.YEAR) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n // Only Songs have dates added\n if (type != Type.SONG && field == Field.DATE_ADDED) {\n throw new IllegalArgumentException(type + \" type does not have field \" + field);\n }\n\n if (field == Field.ID) {\n // IDs can only be compared by equals or !equals\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS\n || match == Match.LESS_THAN || match == Match.GREATER_THAN) {\n throw new IllegalArgumentException(\"ID cannot be compared by method \" + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n } else if (field == Field.NAME) {\n // Names can't be compared by < or >... that doesn't even make sense...\n if (match == Match.GREATER_THAN || match == Match.LESS_THAN) {\n throw new IllegalArgumentException(\"Name cannot be compared by method \"\n + match);\n }\n } else if (field == Field.SKIP_COUNT || field == Field.PLAY_COUNT\n || field == Field.YEAR || field == Field.DATE_ADDED) {\n // Numeric values can't be compared by contains or !contains\n if (match == Match.CONTAINS || match == Match.NOT_CONTAINS) {\n throw new IllegalArgumentException(field + \" cannot be compared by method \"\n + match);\n }\n // Make sure the value is actually a number\n try {\n //noinspection ResultOfMethodCallIgnored\n Long.parseLong(value);\n } catch (NumberFormatException e) {\n Crashlytics.logException(e);\n throw new IllegalArgumentException(\"ID cannot be compared to value \" + value);\n }\n }\n }",
"private boolean checkField(Field field) {\n if (field.isAnnotationPresent(Transient.class) || field.isAnnotationPresent(JsonIgnore.class)) {\n return false;\n }\n\n return (field.isAnnotationPresent(Column.class) || field.isAnnotationPresent(Id.class) ||\n field.isAnnotationPresent(ManyToOne.class) || field.isAnnotationPresent(ManyToMany.class) ||\n field.isAnnotationPresent(OneToOne.class) || field.isAnnotationPresent(OneToMany.class) ||\n field.isAnnotationPresent(ElementCollection.class) || field.isAnnotationPresent(Embedded.class));\n }",
"private boolean checkfields() {\n try {\n Integer.parseInt(checknum.getText().toString());\n Integer.parseInt(banknum.getText().toString());\n Integer.parseInt(branchnum.getText().toString());\n Integer.parseInt(accountnum.getText().toString()); //was commented\n\n } catch (NumberFormatException e) { // at least one of these numbers is not Integer\n return false;\n }\n\n if (checknum.getText().toString().equals(null) || banknum.getText().toString().equals(null) ||branchnum.getText().toString().equals(null)|| accountnum.getText().toString().equals(null))\n return false; // At least one of the fields is empty\n\n return true;\n }",
"static boolean model_field_type_and_attrs(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"model_field_type_and_attrs\")) return false;\n if (!nextTokenIs(b, ENTITY_NAME)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = field_type(b, l + 1);\n r = r && model_field_type_and_attrs_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }",
"@Override\n protected boolean accept(Field f) {\n\t\t return !Collection.class.isAssignableFrom(f.getType()) &&\n\t\t \t\t!List.class.isAssignableFrom(f.getType()) &&\n\t\t \t\t\t\t!BaseEntity.class.isAssignableFrom(f.getType())\n\t\t \t\t\t\t&& acceptToStringField(f);\n\t\t }",
"private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }",
"public void testFields() {\n assertTrue( tInteger.name().isEqualTo(Ocl.getFor(\"Integer\")).isTrue() );\n assertTrue( tOclString.name().isEqualTo(Ocl.getFor(\"String\")).isTrue() );\n assertTrue( tPersonFQ.name().isEqualTo(Ocl.getFor(\"Person\")).isTrue() );\n Ocl.JAVA_CLASS_NAMES=true;\n assertTrue( tPerson1.name().isEqualTo(Ocl.getFor(\"tudresden.ocl.lib.test.Person\")).isTrue() );\n Ocl.JAVA_CLASS_NAMES=false;\n assertTrue( tPersonFQ.attributes().includes(Ocl.getFor(\"isUnemployed\")).isTrue() );\n assertTrue( tPerson1.attributes().includes(Ocl.getFor(\"employer\")).isTrue() );\n assertTrue( tPersonFQ.associationEnds().includes(Ocl.getFor(\"managedCompanies\")).isTrue() );\n assertTrue( tPersonFQ.associationEnds().includes(Ocl.getFor(\"isMarried\")).isTrue() );\n assertTrue( tPersonFQ.operations().includes(Ocl.getFor(\"managedCompanies\")).not().isTrue() );\n assertTrue( tPersonFQ.operations().includes(Ocl.getFor(\"firstName\")).not().isTrue() );\n assertTrue( tPersonFQ.operations().includes(Ocl.getFor(\"getFive\")).isTrue() );\n assertTrue( tInteger.operations().includes(Ocl.getFor(\"add\")).isTrue() );\n }",
"private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}",
"protected abstract List<TemporalField> validFields();",
"private boolean checkFields() {\n if (editTxtName.getText().equals(\"\")) return false;//name\n if (editTxtDesc.getText().equals(\"\")) return false;//desc\n if (editClrColor.getValue() == null) return false;//color\n if (oldEnvironment == null) return false;//environment is null\n return true;//everything is valid\n }",
"abstract protected boolean checkType(String myType);",
"private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }",
"public boolean hasFieldErrors();",
"protected boolean exploreFields(PreflightContext ctx, List<PDField> lFields) throws IOException\n {\n if (lFields != null)\n {\n // the list can be null if the field doesn't have children\n for (Object obj : lFields)\n {\n if (obj instanceof PDField)\n {\n if (!validateField(ctx, (PDField) obj))\n {\n return false;\n }\n }\n else if (obj instanceof PDAnnotationWidget)\n {\n // \"A field's children in the hierarchy may also include widget annotations\"\n ContextHelper.validateElement(ctx, ((PDAnnotationWidget) obj).getCOSObject(), ANNOTATIONS_PROCESS);\n }\n else\n {\n addValidationError(ctx, new ValidationError(ERROR_SYNTAX_BODY,\n \"Field can only have fields or widget annotations as KIDS\"));\n }\n }\n }\n return true;\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case HEADER_TRANSPORT:\n return isSetHeaderTransport();\n case UUID_FICHA:\n return isSetUuidFicha();\n case TP_CDS_ORIGEM:\n return isSetTpCdsOrigem();\n case TURNO:\n return isSetTurno();\n case CNS_CIDADAO:\n return isSetCnsCidadao();\n case CNS_RESPONSAVEL_FAMILIAR:\n return isSetCnsResponsavelFamiliar();\n case DATA_REALIZACAO_TESTE_OLHINHO:\n return isSetDataRealizacaoTesteOlhinho();\n case CO_RESULTADO_TESTE_OLHINHO:\n return isSetCoResultadoTesteOlhinho();\n case DATA_REALIZACAO_EXAME_FUNDO_OLHO:\n return isSetDataRealizacaoExameFundoOlho();\n case CO_RESULTADO_EXAME_FUNDO_OLHO:\n return isSetCoResultadoExameFundoOlho();\n case DATA_REALIZACAO_TESTE_ORELHINHA:\n return isSetDataRealizacaoTesteOrelhinha();\n case CO_RESULTADO_TESTE_ORELHINHA:\n return isSetCoResultadoTesteOrelhinha();\n case DATA_REALIZACAO_USTRANSFONTANELA:\n return isSetDataRealizacaoUSTransfontanela();\n case CO_RESULTADO_US_TRANSFONTANELA:\n return isSetCoResultadoUsTransfontanela();\n case DATA_REALIZACAO_TOMOGRAFIA_COMPUTADORIZADA:\n return isSetDataRealizacaoTomografiaComputadorizada();\n case CO_RESULTADO_TOMOGRAFIA_COMPUTADORIZADA:\n return isSetCoResultadoTomografiaComputadorizada();\n case DATA_REALIZACAO_RESSONANCIA_MAGNETICA:\n return isSetDataRealizacaoRessonanciaMagnetica();\n case CO_RESULTADO_RESSONANCIA_MAGNETICA:\n return isSetCoResultadoRessonanciaMagnetica();\n case CPF_CIDADAO:\n return isSetCpfCidadao();\n case CPF_RESPONSAVEL_FAMILIAR:\n return isSetCpfResponsavelFamiliar();\n }\n throw new IllegalStateException();\n }",
"private boolean checkInputType(int inputType,int fieldId){\n if(fieldId>0){ //native\n if(inputType==1 || inputType==17 || inputType==65537)return true;\n }else{ //web\n if(inputType==161)return true;\n }\n return false;\n }",
"private boolean getTests() {\n boolean genderTest = genderSpinner.getValue().equals(currentContact.getGender());\n boolean birthdayTest = dateModel.getValue().equals(currentContact.getBirthday());\n boolean emailTest = emailField.getText().equals(currentContact.getEmail());\n boolean mobileTest = mobileField.getText().equals(currentContact.getMobile());\n boolean homeTest = homeField.getText().equals(currentContact.getHome());\n boolean motherTest = motherField.getText().equals(currentContact.getMother());\n boolean fatherTest = fatherField.getText().equals(currentContact.getFather());\n boolean addressTest = addressArea.getText().equals(currentContact.getAddress());\n return genderTest && birthdayTest && emailTest && mobileTest && homeTest && motherTest && fatherTest && addressTest;\n }",
"public static boolean handleFieldRead(Node x, Node y, Node f) {\n\t\tif(ImmutabilityPreferences.isInferenceRuleLoggingEnabled()){\n\t\t\tString values = \"x:\" + getTypes(x).toString() + \", f:\" + getTypes(f).toString() + \", y:\" + getTypes(y).toString();\n\t\t\tLog.info(\"TREAD (x=y.f, x=\" + x.getAttr(XCSG.name) + \", y=\" + y.getAttr(XCSG.name) + \", f=\" + f.getAttr(XCSG.name) + \")\\n\" + values);\n\t\t}\n\t\t\n\t\tboolean typesChanged = false;\n\t\t\n\t\tif(ImmutabilityPreferences.isFieldAdaptationsEnabled()){\n\t\t\t// qy adapt qf <: qx\n\t\t\t// = qx :> qy adapt qf\n\t\t\t// FSE 2012 version\n\t\t\tif(XGreaterThanEqualYFieldAdaptZConstraintSolver.satisify(x, y, f)){\n\t\t\t\ttypesChanged = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// qy adapt qf <: qx\n\t\t\t// = qx :> qy adapt qf\n\t\t\t// vanilla OOPSLA 2012 version\n\t\t\tif(XGreaterThanEqualYMethodAdaptZConstraintSolver.satisify(x, y, f)){\n\t\t\t\ttypesChanged = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn typesChanged;\n\t}",
"public boolean shouldSkipField(FieldAttributes f) {\n\t\t return f.getName().equals(\"user_id\")\n || f.getName().equals(\"owner\")\n || f.getName().equals(\"recipient\")\n || f.getName().equals(\"isGood\")\n || f.getName().equals(\"reward\");\n\t\t}",
"private void verifyField() {\n try {\n if (type != Function.class && type != Foreign.class)\n throw new DataMapperException(\"The field annotated with @ColumnName must be of type Function or Foreign\");\n String[] nameDefaultValue = (String[]) ColumnName.class.getDeclaredMethod(\"name\").getDefaultValue();\n\n checkNameParameter(nameDefaultValue);\n } catch (NoSuchMethodException e) {\n throw new DataMapperException(e);\n }\n }",
"boolean hasFieldEnum();",
"@Override\n\tprotected boolean verifyFields() {\n\t\treturn false;\n\t}",
"boolean hasHasRestraintType();",
"private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case UCARID:\n return isSetUcarid();\n case UCARSERIALNUMBER:\n return isSetUcarserialnumber();\n case UCARSTATUS:\n return isSetUcarstatus();\n case CARPROVICEID:\n return isSetCarproviceid();\n case CARCITYID:\n return isSetCarcityid();\n case COLOR:\n return isSetColor();\n case DRIVINGMILEAGE:\n return isSetDrivingmileage();\n case COMPLETERATE:\n return isSetCompleterate();\n case CARSOURCE1L:\n return isSetCarsource1l();\n case ISVIDEO:\n return isSetIsvideo();\n case FIRSTPICTRUE:\n return isSetFirstpictrue();\n case CARTYPE:\n return isSetCartype();\n case SOURCE:\n return isSetSource();\n case ISNEGLECT:\n return isSetIsneglect();\n case PICTURECOUNT:\n return isSetPicturecount();\n case PICTURENUMBER:\n return isSetPicturenumber();\n case DISPLAYPRICE:\n return isSetDisplayprice();\n case STATUSMODIFYTIME:\n return isSetStatusmodifytime();\n case CREATETIME:\n return isSetCreatetime();\n case BUYCARDATE:\n return isSetBuycardate();\n case CARPUBLISHTIME:\n return isSetCarpublishtime();\n case UCARPICWHOLEPATH:\n return isSetUcarpicwholepath();\n case ISDEALERRECOMMEND:\n return isSetIsdealerrecommend();\n case ISAUTHENTICATED:\n return isSetIsauthenticated();\n case ISRECOMMENDGL:\n return isSetIsrecommendgl();\n case ISOWNCAR:\n return isSetIsowncar();\n case C2BPRICE:\n return isSetC2bprice();\n case ISTOP:\n return isSetIstop();\n case STATEDESCRIPTION:\n return isSetStatedescription();\n case ISWARRANTY:\n return isSetIswarranty();\n case WARRANTYTYPES:\n return isSetWarrantytypes();\n case ISSHOWMR:\n return isSetIsshowmr();\n case CARPROVINCENAME:\n return isSetCarprovincename();\n case CARCITYNAME:\n return isSetCarcityname();\n case CARDISTRICTID:\n return isSetCardistrictid();\n case CARDISTRICTNAME:\n return isSetCardistrictname();\n case SLOGAN:\n return isSetSlogan();\n case B2BPRICE:\n return isSetB2bprice();\n case ISB2B:\n return isSetIsb2b();\n case MAINBRANDID:\n return isSetMainbrandid();\n case PRODUCERID:\n return isSetProducerid();\n case COUNTRY:\n return isSetCountry();\n case BRANDID:\n return isSetBrandid();\n case CARLEVEL:\n return isSetCarlevel();\n case CARLEVELVALUE:\n return isSetCarlevelvalue();\n case CARID:\n return isSetCarid();\n case GEARBOXTYPE:\n return isSetGearboxtype();\n case GEARBOXTYPESTRING:\n return isSetGearboxtypestring();\n case EXHAUSTVALUE:\n return isSetExhaustvalue();\n case CARYEAR:\n return isSetCaryear();\n case CARREFERPRICE:\n return isSetCarreferprice();\n case ENVIRSTANDARD:\n return isSetEnvirstandard();\n case CONSUMPTION:\n return isSetConsumption();\n case OILTYPE:\n return isSetOiltype();\n case ENGINELOCATION:\n return isSetEnginelocation();\n case BODYDOORS:\n return isSetBodydoors();\n case SEATNUMMIN:\n return isSetSeatnummin();\n case SEATNUMMAX:\n return isSetSeatnummax();\n case ISWAGON:\n return isSetIswagon();\n case DRIVETYPE:\n return isSetDrivetype();\n case ISAGENCY:\n return isSetIsagency();\n case CSBODYFORM:\n return isSetCsbodyform();\n case BRANDATTR:\n return isSetBrandattr();\n case ISMARKINGVENDOR:\n return isSetIsmarkingvendor();\n case COUNTRYVALUE:\n return isSetCountryvalue();\n case USERID:\n return isSetUserid();\n case SUPERIORID:\n return isSetSuperiorid();\n case VENDORNAME:\n return isSetVendorname();\n case VENDORTYPE:\n return isSetVendortype();\n case CONTACT:\n return isSetContact();\n case ISJDVENDOR:\n return isSetIsjdvendor();\n case ISINCTRANSFER:\n return isSetIsinctransfer();\n case USERTYPE:\n return isSetUsertype();\n case ISACTIVITY:\n return isSetIsactivity();\n case MEMBERTYPE:\n return isSetMembertype();\n case ISBANGMAI:\n return isSetIsbangmai();\n case DVQFLAG:\n return isSetDvqflag();\n case ISBANGMAICHE:\n return isSetIsbangmaiche();\n case BAIDUMAP:\n return isSetBaidumap();\n case DISTANCE:\n return isSetDistance();\n case LINKMAN:\n return isSetLinkman();\n case CARTYPECONFIG:\n return isSetCartypeconfig();\n case SITEID:\n return isSetSiteid();\n case CARTITLE:\n return isSetCartitle();\n case CARLEVELSECOND:\n return isSetCarlevelsecond();\n case ISCHECKREPORTJSON:\n return isSetIscheckreportjson();\n case CLICKCOUNT:\n return isSetClickcount();\n case CRMCUSTOMERID:\n return isSetCrmcustomerid();\n case BOOST:\n return isSetBoost();\n case BOOSTC:\n return isSetBoostc();\n case BOOSTAPP:\n return isSetBoostapp();\n case SCORE:\n return isSetScore();\n case COSTRATE:\n return isSetCostrate();\n }\n throw new IllegalStateException();\n }",
"void check()\n {\n checkUsedType(responseType);\n checkUsedType(requestType);\n }",
"private boolean areFieldsValid() {\n // Whether the values from the fields can be inserted into the database without conflict.\n boolean retVal = true;\n\n if (vehicleId == -1) {\n // Then we don't know which vehicle to attach this issue to. This should never happen\n return false;\n // TODO: Display something to the user\n }\n\n // If we're creating a new Issue, we need to create the Issue object\n if (issue == null) {\n // A new issue is not fixed, and thus will be open.\n // Try to get the open status id and ensure it properly fetched\n int openIssueId = dbHelper.getOpenIssueStatusId();\n if (openIssueId != -1) {\n issue = new Issue(mTitle.getText().toString().trim(), vehicleId, openIssueId);\n }\n }\n\n // Convert the EditText fields to strings\n String checkTitle = mTitle.getText().toString().trim();\n String checkDescription = mDescription.getText().toString().trim();\n String checkPriority = mPriority.getText().toString().trim();\n\n if (checkTitle.isEmpty()) {\n retVal = false;\n eTitle.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else if (!VerifyUtil.isStringSafe(checkTitle)) {\n retVal = false;\n eTitle.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessageInvalidCharacters));\n } else {\n eTitle.setError(null);\n issue.setTitle(checkTitle);\n }\n\n if (checkDescription.isEmpty()) {\n retVal = false;\n eDescription.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else if (!VerifyUtil.isTextSafe(checkDescription)) {\n retVal = false;\n eDescription.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessageInvalidCharacters));\n } else {\n eDescription.setError(null);\n issue.setDescription(checkDescription);\n }\n\n if (checkPriority.isEmpty()) {\n retVal = false;\n ePriority.setError(getResources().getString(R.string.vehicleSettingsActivity_errorValidationEditTextMessage));\n } else {\n ePriority.setError(null);\n issue.setPriority(priorityStringToInt(checkPriority));\n }\n\n return retVal;\n }",
"public void testFields()\n {\n TestUtils.testNoAddedFields(getTestedClass(), null);\n }",
"private boolean checkField(int number){\n if(field.get(number).isActive()){\n return false;\n }\n return true;\n }",
"private boolean shouldCheck(Field f)\r\n {\r\n boolean fieldChecked = f.getAnnotation(Unchecked.class) == null;\r\n return fieldChecked && f.getDeclaringClass().getAnnotation(Unchecked.class) == null;\r\n }",
"public interface Field {\n\n FieldType getType();\n\n FieldCardinality getCardinality();\n\n boolean isRequired();\n\n boolean isOptional();\n\n boolean isRepeated();\n\n String getName();\n}",
"private void checkFields() {\n if (month.getText().toString().isEmpty()) {\n month.setError(\"enter a month\");\n month.requestFocus();\n return;\n }\n if (day.getText().toString().isEmpty()) {\n day.setError(\"enter a day\");\n day.requestFocus();\n return;\n }\n if (year.getText().toString().isEmpty()) {\n year.setError(\"enter a year\");\n year.requestFocus();\n return;\n }\n if (hour.getText().toString().isEmpty()) {\n hour.setError(\"enter an hour\");\n hour.requestFocus();\n return;\n }\n if (minute.getText().toString().isEmpty()) {\n minute.setError(\"enter the minute\");\n minute.requestFocus();\n return;\n }\n if (AMorPM.getText().toString().isEmpty()) {\n AMorPM.setError(\"enter AM or PM\");\n AMorPM.requestFocus();\n return;\n }\n if (place.getText().toString().isEmpty()) {\n place.setError(\"enter the place\");\n place.requestFocus();\n return;\n }\n }",
"private boolean isAcceptable(final Field field) {\n return Modifier.isStatic(field.getModifiers())\n && (field.getType() == String.class || field.getType().isAssignableFrom(List.class) || field.getType()\n .isArray() && field.getType().getComponentType() == String.class);\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case INNER_STR:\n return isSetInner_str();\n case INNER_DOUBLE:\n return isSetInner_double();\n }\n throw new IllegalStateException();\n }",
"boolean hasCriterionType();",
"private void fillMandatoryFields() {\n\n }",
"private void fillMandatoryFields_custom() {\n\n }",
"public abstract FieldReport validate(int fieldSequence, Object fieldValue);",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case BEG_TIME:\n return isSetBegTime();\n case END_TIME:\n return isSetEndTime();\n case DATE:\n return isSetDate();\n case OFFICE:\n return isSetOffice();\n case PLAN:\n return isSetPlan();\n case TICKETS:\n return isSetTickets();\n case AVAILABLE:\n return isSetAvailable();\n }\n throw new IllegalStateException();\n }",
"public boolean checkInput(){\n if(spelerIDField.getText().equals(\"\") || typeField.getText().equals(\"\") || codeField.getText().equals(\"\") || heeftBetaaldField.getText().equals(\"\")){\n return true;\n } else { return false; }\n }",
"public static boolean meetsRequirements(Object candidate){\n\t\tif(candidate == null){return false;}\n\t\t\n\t\tif(!(candidate instanceof IField)){return false;}\n\t\t\n\t\tIType typeToTest = ModelBuilderUtil.createIFieldType((IField)candidate);\n\t\t\n\t\tif(typeToTest == null){return false;}\n\t\t\n\t\ttry{\n\t\t\tString[] interfaces = typeToTest.getSuperInterfaceTypeSignatures();\n\t\t\t\n\t\t\tfor(String curInterface : interfaces){\n\t\t\t\tIType testing = ModelBuilderUtil.getJavaElement(typeToTest, \n\t\t\t\t\t\tcurInterface);\n\t\t\t\tif((testing != null)&&(testing.getFullyQualifiedName()\n\t\t\t\t\t\t.equalsIgnoreCase(ParseConstants.MECHANISM))){return true;}\n\t\t\t\tif(ModelBuilderUtil.isInterface(testing, \n\t\t\t\t\t\tParseConstants.MECHANISM)){return true;}\n\t\t\t}\n\t\t}catch(Exception e){return false;}\n\t\t\n\t\treturn false;\n\t}",
"@Test\n\tpublic void testCheckForEmptyFields() {\n\t\t\n\t\t// Case 1: when all fields are present\n\t\tRequestData requestDataObj1 = new RequestData();\n\t\trequestDataObj1.setDomain(\"PBTV\");\n\t\trequestDataObj1.setOwningBusinessEntity(\"CH\");\n\t\trequestDataObj1.setSourceSystemName(\"CDI\");\n\t\tboolean expectedResponse1 = true;\n\t\tboolean response1 = tokenisationMainObj.checkForEmptyFields(requestDataObj1);\n\t\tassertEquals(response1, expectedResponse1);\n\n\t\t// Case 2: when any of them is empty\n\t\tRequestData requestDataObj2 = new RequestData();\n\t\trequestDataObj2.setDomain(\"PBTV\");\n\t\trequestDataObj2.setOwningBusinessEntity(\"CH\");\n\t\trequestDataObj2.setSourceSystemName(\"\");\n\t\tboolean expectedResponse2 = false;\n\t\tboolean response2 = tokenisationMainObj.checkForEmptyFields(requestDataObj2);\n\t\tassertEquals(response2, expectedResponse2);\n\t}",
"public static void checkEnterAnswersFields() {\r\n\t\tcheckNoSuchElementExceptionByName(\"answer1\", \"\\\"Enter answer\\\" field\");\r\n\t}",
"private boolean checkAllFields() {\n formValues.clear();\n\n if (genderRadio != null) {\n RadioButton gender = (RadioButton) findViewById(genderRadio.getCheckedRadioButtonId());\n formValues.add(gender.getText().toString());\n }\n\n boolean shouldPassToActivity = true;\n for (Map.Entry<EditText, Boolean> entry : map.entrySet()) {\n if (!checkFieldColor(entry.getKey(), entry.getValue())) shouldPassToActivity = false;\n if (shouldPassToActivity) formValues.add(entry.getKey().getText().toString());\n }\n\n return shouldPassToActivity;\n }",
"public abstract List<String> requiredFields();",
"protected boolean haveDependingFields(EventType event1, EventType event2) {\r\n\t\treturn !getCommonFields(event1, event2).isEmpty();\r\n\t}",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ASK_PRICE:\n return isSetAskPrice();\n case BID_PRICE:\n return isSetBidPrice();\n case ASK_VOLUME:\n return isSetAskVolume();\n case BID_VOLUME:\n return isSetBidVolume();\n case REQUEST_ID:\n return isSetRequestID();\n case BUSINESS_UNIT:\n return isSetBusinessUnit();\n case ASK_OFFSET_FLAG:\n return isSetAskOffsetFlag();\n case BID_OFFSET_FLAG:\n return isSetBidOffsetFlag();\n case ASK_HEDGE_FLAG:\n return isSetAskHedgeFlag();\n case BID_HEDGE_FLAG:\n return isSetBidHedgeFlag();\n case QUOTE_LOCAL_ID:\n return isSetQuoteLocalID();\n case EXCHANGE_ID:\n return isSetExchangeID();\n case PARTICIPANT_ID:\n return isSetParticipantID();\n case CLIENT_ID:\n return isSetClientID();\n case EXCHANGE_INST_ID:\n return isSetExchangeInstID();\n case TRADER_ID:\n return isSetTraderID();\n case INSTALL_ID:\n return isSetInstallID();\n case NOTIFY_SEQUENCE:\n return isSetNotifySequence();\n case ORDER_SUBMIT_STATUS:\n return isSetOrderSubmitStatus();\n case TRADING_DAY:\n return isSetTradingDay();\n case SETTLEMENT_ID:\n return isSetSettlementID();\n case QUOTE_SYS_ID:\n return isSetQuoteSysID();\n case INSERT_DATE:\n return isSetInsertDate();\n case INSERT_TIME:\n return isSetInsertTime();\n case CANCEL_TIME:\n return isSetCancelTime();\n case QUOTE_STATUS:\n return isSetQuoteStatus();\n case CLEARING_PART_ID:\n return isSetClearingPartID();\n case SEQUENCE_NO:\n return isSetSequenceNo();\n case ASK_ORDER_SYS_ID:\n return isSetAskOrderSysID();\n case BID_ORDER_SYS_ID:\n return isSetBidOrderSysID();\n }\n throw new IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case ADULT:\n return isSetAdult();\n case BACKDROP_PATH:\n return isSetBackdrop_path();\n case BELONGS_TO_COLLECTION:\n return isSetBelongs_to_collection();\n case BUDGET:\n return isSetBudget();\n case GENRES:\n return isSetGenres();\n case HOMEPAGE:\n return isSetHomepage();\n case ID:\n return isSetId();\n case IMDB_ID:\n return isSetImdb_id();\n case ORIGINAL_LANGUAGE:\n return isSetOriginal_language();\n case ORIGINAL_TITLE:\n return isSetOriginal_title();\n case OVERVIEW:\n return isSetOverview();\n case POPULARITY:\n return isSetPopularity();\n case POSTER_PATH:\n return isSetPoster_path();\n case PRODUCTION_COMPANIES:\n return isSetProduction_companies();\n case PRODUCTION_COUNTRIES:\n return isSetProduction_countries();\n case RELEASE_DATE:\n return isSetRelease_date();\n case REVENUE:\n return isSetRevenue();\n case RUNTIME:\n return isSetRuntime();\n case SPOKEN_LANGUAGES:\n return isSetSpoken_languages();\n case STATUS:\n return isSetStatus();\n case TAGLINE:\n return isSetTagline();\n case TITLE:\n return isSetTitle();\n case VIDEO:\n return isSetVideo();\n case VOTE_AVERAGE:\n return isSetVote_average();\n case VOTE_COUNT:\n return isSetVote_count();\n }\n throw new IllegalStateException();\n }",
"private boolean fieldsAreFilled(){\n return !textboxName.isEnabled() && !textboxInitialValue.isEnabled();\n }",
"public static boolean isValidField(int whichField) {\r\n\t\tboolean valid = false;\r\n\t\ttry {\r\n\t\t\tDataDictionary dictionary = CurrentFIXDataDictionary\r\n\t\t\t\t\t.getCurrentFIXDataDictionary().getDictionary();\r\n\t\t\tvalid = dictionary.isField(whichField);\r\n\t\t} catch (Exception anyException) {\r\n\t\t\t// Ignore\r\n\t\t}\r\n\t\treturn valid;\r\n\t}",
"@Override\n\tpublic boolean isValid(SchemaField field, Data data) {\n\t\treturn false;\n\t}",
"private static boolean recordTypeFields_1(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"recordTypeFields_1\")) return false;\n while (true) {\n int c = current_position_(b);\n if (!recordTypeFields_1_0(b, l + 1)) break;\n if (!empty_element_parsed_guard_(b, \"recordTypeFields_1\", c)) break;\n }\n return true;\n }",
"@Override\r\n\tprotected boolean validateFields(String action) {\r\n\t\t// Booleano para indicar que hubo error\r\n\t\tisError = false;\r\n\t\t// IRI Concepto\r\n\t\tif (this.isBlanks(object.getDcoiricaf())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages.getMessage(\"se010_iriDetail\")));\r\n\t\t}\r\n\t\t// Concepto Semántico\r\n\t\tif (this.isBlanks(object.getCosccosak())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t.getMessage(\"se010_semanticConcept\")));\r\n\t\t}\r\n\t\t// Valida relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\t// Valor Relacion\r\n\t\t\tif (this.isBlanks(relco.getDrcvalraf())) {\r\n\t\t\t\tisError = true;\r\n\t\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t\t.getMessage(\"se010_valueRelation\")));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Retorna\r\n\t\treturn !isError;\r\n\t}",
"@Override\n\tpublic boolean checkTypes() {\n\t\treturn false;\n\t}",
"private Boolean checkFields(String title, String description) {\n if (title.trim().length() > 30) {\n Toast.makeText(getActivity(), R.string.too_long_title, Toast.LENGTH_SHORT).show();\n } else if (description.trim().length() > 150) {\n Toast.makeText(getActivity(), R.string.too_long_description, Toast.LENGTH_SHORT).show();\n } else if (title.trim().length() == 0 || title.isEmpty()) {\n Toast.makeText(getActivity(), R.string.title_field_empty, Toast.LENGTH_SHORT).show();\n } else if (description.trim().length() == 0 || description.isEmpty()) {\n Toast.makeText(getActivity(), R.string.description_field_empty, Toast.LENGTH_SHORT).show();\n } else if (!isValidDate()) {\n Toast.makeText(getActivity(), R.string.wrong_date, Toast.LENGTH_SHORT).show();\n } else {\n return false;\n }\n return true;\n }",
"boolean hasReqardTypeFifteen();",
"boolean hasIsPersonType();",
"public interface FieldValidator {\n static boolean validateStringIfPresent(Object o, int len) {\n return o == null || o instanceof String && !((String) o).isEmpty() && ((String) o).length() < len;\n }\n\n static boolean validateString(Object o, int len) {\n return !(o == null || !(o instanceof String) || ((String) o).isEmpty() || (((String) o).length() > len));\n }\n\n static boolean validateInteger(Object o) {\n if (o == null) {\n return false;\n }\n try {\n Integer.valueOf(o.toString());\n } catch (NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n static boolean validateDateWithFormat(Object o, DateTimeFormatter formatter, boolean allowedInPast) {\n if (o == null) {\n return false;\n }\n try {\n LocalDate date = LocalDate.parse(o.toString(), formatter);\n if (!allowedInPast) {\n return date.isAfter(LocalDate.now());\n }\n } catch (DateTimeParseException e) {\n return false;\n }\n return true;\n }\n\n static boolean validateJsonIfPresent(Object o) {\n return o == null || o instanceof JsonObject && !((JsonObject) o).isEmpty();\n }\n\n static boolean validateJson(Object o) {\n return !(o == null || !(o instanceof JsonObject) || ((JsonObject) o).isEmpty());\n }\n\n static boolean validateJsonArrayIfPresent(Object o) {\n return o == null || o instanceof JsonArray && !((JsonArray) o).isEmpty();\n }\n\n static boolean validateJsonArray(Object o) {\n return !(o == null || !(o instanceof JsonArray) || ((JsonArray) o).isEmpty());\n }\n\n static boolean validateDeepJsonArrayIfPresent(Object o, FieldValidator fv) {\n if (o == null) {\n return true;\n } else if (!(o instanceof JsonArray) || ((JsonArray) o).isEmpty()) {\n return false;\n } else {\n JsonArray array = (JsonArray) o;\n for (Object element : array) {\n if (!fv.validateField(element)) {\n return false;\n }\n }\n }\n return true;\n }\n\n static boolean validateDeepJsonArray(Object o, FieldValidator fv) {\n if (o == null || !(o instanceof JsonArray) || ((JsonArray) o).isEmpty()) {\n return false;\n }\n JsonArray array = (JsonArray) o;\n for (Object element : array) {\n if (!fv.validateField(element)) {\n return false;\n }\n }\n return true;\n }\n\n static boolean validateBoolean(Object o) {\n return o != null && o instanceof Boolean;\n }\n\n static boolean validateBooleanIfPresent(Object o) {\n return o == null || o instanceof Boolean;\n }\n\n static boolean validateUuid(Object o) {\n try {\n UUID uuid = UUID.fromString((String) o);\n return true;\n } catch (IllegalArgumentException e) {\n return false;\n }\n }\n\n static boolean validateUuidIfPresent(String o) {\n return o == null || validateUuid(o);\n }\n\n boolean validateField(Object value);\n\n Pattern EMAIL_PATTERN =\n Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n\n static boolean validateEmail(Object o) {\n Matcher matcher = EMAIL_PATTERN.matcher((String) o);\n return matcher.matches();\n }\n}",
"@Override\n public boolean highlightEmptyFields() {\n boolean returnValue = false;\n if (titleField.getText().toString().trim().isEmpty()) {\n titleField.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (descriptionField.getText().toString().trim().isEmpty()) {\n descriptionField.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (questionField.getText().toString().trim().isEmpty()) {\n questionField.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (answer1Field.getText().toString().trim().isEmpty()) {\n answer1Field.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (answer2Field.getText().toString().trim().isEmpty()) {\n answer2Field.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (answer3Field.getText().toString().trim().isEmpty()) {\n answer3Field.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (answer4Field.getText().toString().trim().isEmpty()) {\n answer4Field.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n if (answer5Field.getText().toString().trim().isEmpty()) {\n answer5Field.setError(\"This field cannot be empty\");\n returnValue = true;\n }\n\n return returnValue;\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case BROKER_ID:\n return isSetBrokerID();\n case ACCOUNT_ID:\n return isSetAccountID();\n case ALGORITHM:\n return isSetAlgorithm();\n case MEMO:\n return isSetMemo();\n case CURRENCY_ID:\n return isSetCurrencyID();\n }\n throw new IllegalStateException();\n }",
"private boolean validateFields() {\r\n\t\tif (txUsuario.getText().equals(\"\") || txPassword.getText().equals(\"\")\r\n\t\t\t\t|| checkAdmin.isIndeterminate()|| checkTPV.isIndeterminate())\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"private void validateType(Errors errors, MultiValueConstraints con, List<String> answers) {\n for (int i=0; i < answers.size(); i++) {\n validateMultiValueType(errors, con, answers.get(i));\n }\n if (!con.getAllowOther()) {\n for (int i=0; i < answers.size(); i++) {\n if (!isEnumeratedValue(con, answers.get(i))) {\n rejectField(errors, \"constraints\", \"%s is not an enumerated value for this question\", answers.get(i));\n }\n }\n }\n }",
"boolean hasFirstField();",
"String getTestFieldTypeId();",
"public boolean validateInputFields(){\n if(titleText.getText().isEmpty() || descriptionText.getText().isEmpty()){\n showError(true, \"All fields are required. Please complete.\");\n return false;\n }\n if(locationCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a location.\");\n return false;\n }\n if(contactCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a contact.\");\n return false;\n }\n if(typeCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select the type.\");\n return false;\n }\n if(customerCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a customer.\");\n return false;\n }\n if(userCombo.getSelectionModel().isEmpty()){\n showError(true, \"Please select a user.\");\n return false;\n }\n return true;\n }",
"private boolean checkForType(IfStmt ifStmt, FieldDeclaration compareVariable) {\n boolean isOfType = false;\n BinaryExpr ifAsBinary = ifStmt.getCondition().asBinaryExpr();\n String comparedTypeName = compareVariable.getVariables().get(0).getNameAsString();\n if (!ifAsBinary.getLeft().isNullLiteralExpr()) {\n isOfType |= ifAsBinary.getLeft().asNameExpr().getNameAsString().equals(\n comparedTypeName);\n }\n if (!ifAsBinary.getRight().isNullLiteralExpr()) {\n isOfType |= ifAsBinary.getRight().asNameExpr().getNameAsString().equals(\n comparedTypeName);\n }\n return isOfType;\n }",
"boolean hasReqardTypeThree();",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case ID:\n return isSetId();\n case TITLE:\n return isSetTitle();\n case SALARY_TOP:\n return isSetSalary_top();\n case SALARY_BOTTOM:\n return isSetSalary_bottom();\n case PUBLISH_DATE:\n return isSetPublish_date();\n case DEPARTMENT:\n return isSetDepartment();\n case VISITNUM:\n return isSetVisitnum();\n case IN_HB:\n return isSetIn_hb();\n case COUNT:\n return isSetCount();\n case COMPANY_ABBR:\n return isSetCompany_abbr();\n case COMPANY_LOGO:\n return isSetCompany_logo();\n case COMPANY_NAME:\n return isSetCompany_name();\n case IS_NEW:\n return isSetIs_new();\n case CITY:\n return isSetCity();\n case PRIORITY:\n return isSetPriority();\n case PUBLISHER:\n return isSetPublisher();\n case ACCOUNTABILITIES:\n return isSetAccountabilities();\n case TOTAL_NUM:\n return isSetTotal_num();\n case CANDIDATE_SOURCE:\n return isSetCandidate_source();\n case REQUIREMENT:\n return isSetRequirement();\n case CITY_ENAME:\n return isSetCity_ename();\n case IS_REFERRAL:\n return isSetIs_referral();\n case EMPLOYMENT_TYPE:\n return isSetEmployment_type();\n case EMPLOYMENT_TYPE_NAME:\n return isSetEmployment_type_name();\n case PUBLISHER_NAME:\n return isSetPublisher_name();\n case UPDATE_TIME:\n return isSetUpdate_time();\n case DEGREE_ABOVE:\n return isSetDegree_above();\n case DEGREE:\n return isSetDegree();\n case EXPERIENCE_ABOVE:\n return isSetExperience_above();\n case EXPERIENCE:\n return isSetExperience();\n case TEAM_ID:\n return isSetTeam_id();\n case TOTAL_BONUS:\n return isSetTotal_bonus();\n case HB_STATUS:\n return isSetHb_status();\n }\n throw new java.lang.IllegalStateException();\n }",
"boolean hasReqardTypeThirty();",
"@Override\n\tprotected boolean checkDataStructure(Data data) throws ImportitException {\n\t\tdata.setDatabase(39);\n\t\tdata.setGroup(3);\n\t\tboolean validDb = checkDatabaseName(data);\n\t\tboolean validHead = false;\n\t\tboolean validTable = false;\n\t\tboolean existImportantFields = false;\n\t\tif (validDb) {\n\t\t\tList<Field> headerFields = data.getHeaderFields();\n\t\t\tList<Field> tableFields = data.getTableFields();\n\t\t\tvalidHead = false;\n\t\t\tvalidTable = false;\n\t\t\ttry {\n\n\t\t\t\tvalidHead = checkWarehouseGroupProperties(headerFields, data.getOptionCode().useEnglishVariables());\n\t\t\t\tvalidTable = checkFieldList(tableFields, 39, 3, false, data.getOptionCode().useEnglishVariables());\n\t\t\t\tString[] checkDataCustomerPartProperties = checkDataWarehouseGroupProperties(data);\n\t\t\t\texistImportantFields = checkDataCustomerPartProperties.length == 2;\n\n\t\t\t} catch (ImportitException e) {\n\t\t\t\tlogger.error(e);\n\t\t\t\tdata.appendError(Util.getMessage(\"err.structure.check\", e.getMessage()));\n\t\t\t}\n\t\t}\n\t\tif (validTable && validHead && validDb & existImportantFields) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"boolean getFieldTypeIdNull();",
"public boolean hasField (String f) {\n return getFieldTypMap().containsKey(f);\n }",
"public void check()\n {\n typeDec.check();\n }",
"public boolean isSet(_Fields field) {\r\n if (field == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n\r\n switch (field) {\r\n case HOST:\r\n return isSetHost();\r\n case DATABASE:\r\n return isSetDatabase();\r\n case USER_NAME:\r\n return isSetUserName();\r\n case PASSWORD:\r\n return isSetPassword();\r\n case TABLE_NAME:\r\n return isSetTableName();\r\n case HIVE_TALEB:\r\n return isSetHiveTaleb();\r\n }\r\n throw new IllegalStateException();\r\n }",
"public boolean isSet(_Fields field) {\r\n if (field == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n\r\n switch (field) {\r\n case HOST:\r\n return isSetHost();\r\n case DATABASE:\r\n return isSetDatabase();\r\n case USER_NAME:\r\n return isSetUserName();\r\n case PASSWORD:\r\n return isSetPassword();\r\n case TABLE_NAME:\r\n return isSetTableName();\r\n case HIVE_TALEB:\r\n return isSetHiveTaleb();\r\n }\r\n throw new IllegalStateException();\r\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case VERSION:\n return isSetVersion();\n case AM_HANDLE:\n return isSetAm_handle();\n case USER:\n return isSetUser();\n case QUEUE:\n return isSetQueue();\n case RESOURCES:\n return isSetResources();\n case GANG:\n return isSetGang();\n case RESERVATION_ID:\n return isSetReservation_id();\n }\n throw new IllegalStateException();\n }",
"@Override\n\tprotected Boolean isHeader(String[] fields) {\n\t\t//check\n return (isValid(fields) && fields[0].equals(\"event\") && fields[1].equals(\"yes\") && fields[2].equals(\"maybe\") && fields[3].equals(\"invited\") && fields[4].equals(\"no\"));\n\t}",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case IS_STAR:\n return isSetIs_star();\n case IS_DISTINCT:\n return isSetIs_distinct();\n case OP:\n return isSetOp();\n }\n throw new IllegalStateException();\n }",
"boolean isValidFieldConfig(String collectionName,String fieldName) {\n if (getFieldConfigValue(collectionName,fieldName,\"name\")==null) return false;\n if (getFieldConfigValue(collectionName,fieldName,\"type\")==null) return false;\n return true;\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case VERSION:\n return isSetVersion();\n case APP_ID:\n return isSetApp_id();\n case BRAND:\n return isSetBrand();\n case POINT:\n return isSetPoint();\n case CAMPAIGN_TYPE:\n return isSetCampaign_type();\n case POINT_MULTIPLY:\n return isSetPoint_multiply();\n case SNAPEARN_ID:\n return isSetSnapearn_id();\n case RECEIPT_NUMBER:\n return isSetReceipt_number();\n case OUTLET_ID:\n return isSetOutlet_id();\n case OPERATOR_ID:\n return isSetOperator_id();\n case REJECTED_REASON:\n return isSetRejected_reason();\n }\n throw new IllegalStateException();\n }",
"boolean hasFieldNested();",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case APP_CODE:\n return isSetAppCode();\n case REQUEST_DATE:\n return isSetRequestDate();\n case SIGN:\n return isSetSign();\n case SP_ID:\n return isSetSpID();\n case OUT_ORDER_ID:\n return isSetOutOrderID();\n case DEVICE_NO:\n return isSetDeviceNo();\n case DEVICE_TYPE:\n return isSetDeviceType();\n case PROVINCE_ID:\n return isSetProvinceID();\n case CUST_ID:\n return isSetCustID();\n case NUM:\n return isSetNum();\n case REMARK:\n return isSetRemark();\n case ACTIVE_ID:\n return isSetActiveID();\n case EXP_TIME:\n return isSetExpTime();\n }\n throw new IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new IllegalArgumentException();\n }\n\n switch (field) {\n case PID:\n return isSetPid();\n case EXCEPTION_ID:\n return isSetExceptionId();\n case USER_ID:\n return isSetUserId();\n case REPORT_DATE:\n return isSetReportDate();\n case UN_ASSURE_CONDITION:\n return isSetUnAssureCondition();\n case HOUSE_PROPERY_CONDITION:\n return isSetHouseProperyCondition();\n case REMARK:\n return isSetRemark();\n case CREATE_DATE:\n return isSetCreateDate();\n case CREATE_ID:\n return isSetCreateId();\n case UPDATE_DATE:\n return isSetUpdateDate();\n case UPDATE_ID:\n return isSetUpdateId();\n case PROJECT_ID:\n return isSetProjectId();\n case LEGAL_LIST:\n return isSetLegalList();\n }\n throw new IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\n if (field == null) {\n throw new java.lang.IllegalArgumentException();\n }\n\n switch (field) {\n case PATIENT_ID:\n return isSetPatient_id();\n case EXAM_DATE:\n return isSetExam_date();\n case DOCTOR_TO_ORDER:\n return isSetDoctor_to_order();\n case EXAM_RECORDS:\n return isSetExam_records();\n }\n throw new java.lang.IllegalStateException();\n }",
"public boolean isSet(_Fields field) {\r\n if (field == null) {\r\n throw new IllegalArgumentException();\r\n }\r\n\r\n switch (field) {\r\n case HOST:\r\n return isSetHost();\r\n case DATABASE:\r\n return isSetDatabase();\r\n case USER_NAME:\r\n return isSetUserName();\r\n case PASSWORD:\r\n return isSetPassword();\r\n case TABLE_NAME:\r\n return isSetTableName();\r\n case HIVE_TALEB:\r\n return isSetHiveTaleb();\r\n case KEYFIELD:\r\n return isSetKeyfield();\r\n }\r\n throw new IllegalStateException();\r\n }"
]
| [
"0.65744877",
"0.6466454",
"0.636774",
"0.6295495",
"0.6275029",
"0.61666644",
"0.61112696",
"0.60965776",
"0.60863376",
"0.60474944",
"0.6029587",
"0.5986657",
"0.5928526",
"0.5866466",
"0.5849677",
"0.58150786",
"0.58066946",
"0.5752626",
"0.5687504",
"0.5684489",
"0.56636226",
"0.56553686",
"0.5652191",
"0.5622468",
"0.5618879",
"0.56123954",
"0.5584647",
"0.555326",
"0.5518825",
"0.54921",
"0.54704446",
"0.54531765",
"0.5441368",
"0.5425714",
"0.54069984",
"0.5406597",
"0.54013246",
"0.53964096",
"0.53939235",
"0.5387307",
"0.53700775",
"0.5369908",
"0.5358383",
"0.5351842",
"0.5331262",
"0.5325867",
"0.53213245",
"0.53196675",
"0.531378",
"0.5308198",
"0.5305555",
"0.52983",
"0.5260158",
"0.525194",
"0.5249995",
"0.52492595",
"0.5240849",
"0.52363425",
"0.5233635",
"0.52322775",
"0.52260983",
"0.52253383",
"0.5222763",
"0.52095914",
"0.5200964",
"0.51946825",
"0.51918447",
"0.5188483",
"0.51870567",
"0.51761633",
"0.5174949",
"0.5174765",
"0.5162144",
"0.5158951",
"0.5158395",
"0.5157147",
"0.51514006",
"0.5147265",
"0.5137236",
"0.51348996",
"0.51311487",
"0.51297826",
"0.5128505",
"0.5127023",
"0.51145816",
"0.51106894",
"0.51089925",
"0.5104542",
"0.51037246",
"0.51037246",
"0.50978696",
"0.50812685",
"0.507972",
"0.5075975",
"0.50624466",
"0.5053614",
"0.5049701",
"0.504038",
"0.5038273",
"0.50247526"
]
| 0.5959518 | 12 |
Create a new question | private void creatingNewQuestion() {
AbstractStatement<?> s;
ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());
switch ((String) typeQuestion.getValue()) {
case "TrueFalse":
// just to be sure the answer corresponds to the json file
Boolean answer = CorrectAnswer.getText().equalsIgnoreCase("true");
s = new TrueFalse<>(Text.getText(), answer);
break;
case "MCQ":
s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());
break;
default:
s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());
break;
}
lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));
lq.writeJson(ThemesController.getThemeSelected());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createQuestion(int sid,int qid,String qtype,String qtitle,String answer_a,String answer_b,String answer_c,String answer_d);",
"public void addQuestion(Question question);",
"public void createSurvey(int tid);",
"@Test\r\n\tpublic void testCreate() {\r\n\t\tQuestion q = new Question(\"Empty\", 1, 20, quizzes, null, choices);\r\n\t\tdao.create(q);\r\n\t}",
"private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }",
"@WebMethod Question createQuestion(Event event, String question, double betMinimum) throws EventFinished, QuestionAlreadyExist;",
"private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }",
"@WebMethod Question createQuestion(Event event, String question, float betMinimum) throws EventFinished, QuestionAlreadyExist;",
"private void addQuestion(Questions question) {\n ContentValues cv = new ContentValues();\n cv.put(QuestionsTable.Column_Question, question.getQuestion());\n cv.put(QuestionsTable.Column_Option1, question.getOption1());\n cv.put(QuestionsTable.Column_Option2, question.getOption2());\n cv.put(QuestionsTable.Column_Option3, question.getOption3());\n cv.put(QuestionsTable.Column_Option4, question.getOption4());\n cv.put(QuestionsTable.Column_Answer_Nr, question.getAnswerNr());\n db.insert(QuestionsTable.Table_name, null, cv);\n }",
"public QueryQuestions saveQuestion(String question) {\n String uniqueId = UUID.randomUUID().toString();\n QueryQuestions queryQuestions1 = new QueryQuestions(uniqueId,question);\n QueryQuestions savedQueryQuestions = questionRepository.save(queryQuestions1);\n return savedQueryQuestions;\n }",
"public boolean createQuestion(int qID, int cID, String q, String a1, String a2, String a3, String a4, String a5, int correctAns) {\n try {\n Connection con = Database.createDBconnection();\n String ins = \"INSERT into question (question_ID, category_ID, question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value) values ('\"\n + qID + \"','\" + cID + \"','\" + q + \"','\" + a1 + \"','\" + a2 + \"','\" + a3 + \"','\" + a4 + \"','\" + a5 + \"','\" + correctAns + \"','\" + 10 + \"');\";\n Statement ins_stmt = con.createStatement();\n ins_stmt.executeUpdate(ins);\n\n Database.closeDBconnection(con);\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"public QuestionEntity createQuestion(QuestionEntity questionEntity) {\n entityManager.persist(questionEntity);\n return questionEntity;\n }",
"@Override\n public void add(Question q) {\n try {\n c = DBConncetion.getConnection();\n int type = q.getType() == MultipleChoice ? 1 : 2; // 1 = MC , 2 = FB\n System.out.println(type);\n String sql = \"Insert into mainquestion \\n\" +\n \"Values (?,?,?,?,0,0,0)\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,q.getTitle());\n pstmt.setString(3,String.valueOf(q.getTime()));\n pstmt.setString(4,String.valueOf(type));\n pstmt.executeUpdate();\n if (type == 1) {\n sql = \"Insert into multiplechoice \\n\" +\n \"Values (?,?,?,?,?,?)\";\n MultipleChoice mc = (MultipleChoice) q;\n String[] answers = mc.getAnswers();\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,answers[0]);\n pstmt.setString(3,answers[1]);\n pstmt.setString(4,answers[2]);\n pstmt.setString(5,answers[3]);\n pstmt.setString(6,mc.getCorrectAnswers());\n pstmt.executeUpdate();\n } else {\n sql = \"Insert into fill_blank Values(?,?)\";\n FillBlank fb = (FillBlank) q;\n pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.setString(2,fb.getCorrectAnswer());\n pstmt.executeUpdate();\n }\n } catch (Exception e) {\n throw new LoadSaveException(\"Error while adding\");\n }\n }",
"public void addQuestion(Question quest) {\n ContentValues values = new ContentValues();\n values.put(KEY_QUES, quest.getQUESTION());\n values.put(KEY_ANSWER, quest.getANSWER());\n values.put(KEY_OPTA, quest.getOPTA());\n values.put(KEY_OPTB, quest.getOPTB());\n values.put(KEY_OPTC, quest.getOPTC());\n // Inserting Row\n db.insert(TABLE_NAME_QUEST, null, values);\n }",
"int createSurvey(List<Question> questions, String userId);",
"@WebMethod\n\tpublic Question createQuestion(Event event, String question, float betMinimum)\n\t\t\tthrows EventFinished, QuestionAlreadyExist {\n\n\t\t// The minimum bed must be greater than 0\n\t\tdbManager.open(false);\n\t\tQuestion qry = null;\n\n\t\tif (new Date().compareTo(event.getEventDate()) > 0)\n\t\t\tthrow new EventFinished(ResourceBundle.getBundle(\"Etiquetas\").getString(\"ErrorEventHasFinished\"));\n\n\t\tqry = dbManager.createQuestion(event, question, betMinimum);\n\n\t\tdbManager.close();\n\n\t\treturn qry;\n\t}",
"public Question(){}",
"@Test\n\tpublic void testSaveQuestion() {\n\t\tAssert.assertEquals(\"qna.sms.question-posted.no-replies\", questionSmsCommand.execute(\n\t\t\t\tnew ParsedMessage(USER_UPDATE, CMD, SITE, \"new question\", 1), ShortMessageCommand.MESSAGE_TYPE_SMS,\"1234\" ));\n\t\tString id = bundleLogicStub.getLastParameters()[1].toString();\n\t\tQnaQuestion question = questionLogic.getQuestionById(Long.valueOf(id));\n\t\tAssert.assertEquals(\"new question\", question.getQuestionText());\n\t\tAssert.assertEquals(USER_UPDATE, question.getOwnerId());\n\t\tAssert.assertEquals(\"1234\", question.getOwnerMobileNr());\n\t\tAssert.assertEquals(1, questionLogic.getAllQuestions(LOCATION1_ID).size()); \n\t}",
"QuestionPick addPickDetail(Question question);",
"public void addQ (Question Q)\n {\n newQuestion = Q;\n \n enqueue();\n }",
"void addQuestionAnswer(Answer answer);",
"public void addTopicQuestion(int id, int tId, int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_TID, tId);\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_TOPICS_QUESTIONS, null, values);\r\n\r\n db.close();\r\n }",
"public void addExamTopicQuestion(int id, int eId, int tId, int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_ID, id);\r\n values.put(KEY_EID, eId);\r\n values.put(KEY_TID, tId);\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_EXAMS_TOPICS_QUESTIONS, null, values);\r\n\r\n db.close();\r\n }",
"public abstract void generateQuestion();",
"public Question() {\n\n }",
"public void addQuestionNote(int qId){\r\n SQLiteDatabase db = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(KEY_QID, qId);\r\n\r\n db.insert(TABLE_QUESTION_NOTES, null, values);\r\n\r\n db.close();\r\n }",
"public void testContentCreationTest() {\n\t\tQuestion question = new Question(\"Q title test\", \"Q body test\", \"Q author id test\");\n\t\tAnswer answer = new Answer(\"A body test\", \"A author id test\");\n\t\tReply reply = new Reply(\"R body test\", \"R author id test\");\n\t\tUser user = new User();\n\t\t//adds the question of the topic to an array of saved questions\n\t\tquestion.addAnswer(answer);\n\t\tquestion.addReply(reply);\n\t\t//question.setFavourite(user);\n\t\t//answer.setFavourite(user);\n\t\tanswer.addReply(reply);\n\t\t//tests if answer added to question is correct\n\t\tassertTrue(question.getAnswerCount() == 1);\n\t\t//smoke test code reply and answers.\n\t\tassertTrue(question.getReplies().get(0).getId().equals(reply.getId()));\n\t\tassertTrue(question.getAnswers().get(0).equals(answer));\n\t}",
"public Question() {\n\t\tthis(\"QUESTION\", null);\n\t}",
"@PostMapping(value=\"/add\")\n\tpublic Question addQuestion(@RequestBody Question question) throws EmptyInputException{\n\t\t Question t = questionObj.addQuestion(question);\n\t\t LOGGER.info(\"Adding Questions\");\n\t\t return t;\n\t}",
"public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }",
"void addQuest(Question quest){\r\n\t\t//if the test bank does not contain this topic, create a new one and add question\r\n\t\tif(!bank.containsKey(quest.getTopic())){\r\n\t\t\tquest.setID(0);\r\n\t\t\tbank.put(quest.getTopic(), new ArrayList<Question>());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}else{\r\n\t\t\tquest.setID(bank.get(quest.getTopic()).size());\r\n\t\t\tbank.get(quest.getTopic()).add(quest);\r\n\t\t}\r\n\t}",
"void addQuestions(String surveyId, List<Question> questions);",
"public Question(String statement, String answer){\n this.statement = statement;\n this.answer = answer;\n }",
"private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}",
"public void addQuestion(String questionText, String correctChoice,\n String incorrectChoice1, String incorrectChoice2, String incorrectChoice3,\n String explanation, String user) {\n Question question = new Question();\n question.setQuestionText(questionText);\n question.setCorrectChoice(correctChoice);\n question.setIncorrectChoice1(incorrectChoice1);\n question.setIncorrectChoice2(incorrectChoice2);\n question.setIncorrectChoice3(incorrectChoice3);\n question.setExplanation(explanation);\n question.setCreatedBy(user);\n questionDao.create(question);\n\n }",
"public void addQuestion(Question question) {\n \t\tquestion.setId(questionIdCounter);\n \t\tquestions.add(question);\n \t\tquestionIdCounter++;\n \t}",
"public void AddQuestionToBank(ActionEvent actionEvent) throws IOException {\n QuestionModel questionModel = new QuestionModel();\n ArrayList<QuestionModel> questionBank = DBObject.getInstance().getQuestionBank();\n if(questionName.getText() != null && question.getText() != null && subjects.getValue() != null){\n if(className.getValue() != null && answer.getText() != null){\n if (easy.isSelected() || medium.isSelected() || hard.isSelected()) {\n questionModel.setQuestionName(questionName.getText());\n questionModel.setPointsPossible(Integer.parseInt(points.getText()));\n questionModel.setClassNumber(className.getValue().toString());\n questionModel.setSubject(subjects.getValue().toString());\n questionModel.setQuestion(question.getText());\n questionModel.getQuestionHelper().setAnswer(answer.getText());\n questionModel.setHint(hint.getText());\n if(easy.isSelected()){\n questionModel.setDifficulty(1);\n }\n else if(medium.isSelected()){\n questionModel.setDifficulty(2);\n }\n else if(hard.isSelected()){\n questionModel.setDifficulty(3);\n }\n SetUpNewView(questionBank, questionModel);\n }\n }\n }\n }",
"public Question createQuestion(String description, String className, String answer, String points) throws IOException\n {\n try {\n int nbPoints = Integer.parseInt(points);\n return new Question(description, AnswerFactory.getInstance().buildAnswer(className, answer), nbPoints);\n }\n catch (NumberFormatException e) {\n throw new IOException(\"Bad format\");\n }\n }",
"@RequestMapping(path = \"/question/create\", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<QuestionResponse> createQuestion(@RequestHeader(\"authorization\") final String authTokenString, QuestionRequest question)\n throws AuthorizationFailedException, Exception {\n /* 1. we first need to check whether the jwt token received is ok or not */\n UserAuthEntity isValidRequestor = createQuestionBusinessService.performAuthTokenValidation(authTokenString);\n\n /* 2. if you are here, it means that we have found a valid requesting user and no exception was thrown */\n /* and create the question in the database */\n QuestionEntitiy questionEntitiy = new QuestionEntitiy();\n questionEntitiy.setContent(question.getContent());\n questionEntitiy.setDate(ZonedDateTime.now());\n questionEntitiy.setUuid(UUID.randomUUID().toString());\n questionEntitiy.setUser(isValidRequestor.getUser());\n QuestionEntitiy persistedQuestion = createQuestionBusinessService.createQuestion(questionEntitiy);\n\n /* 3. finally send the response back to the client side */\n QuestionResponse qResponse = new QuestionResponse();\n qResponse.setId(persistedQuestion.getUuid());\n qResponse.setStatus(\"QUESTION CREATED\");\n return new ResponseEntity(qResponse, HttpStatus.OK);\n }",
"public void addQuestions() {\n\t\tboolean addNewQuestion = true;\n\t\tString text;\n\t\tQuestion q;\n\t\tString promptResponse;\n\t\t\n\t\twhile (addNewQuestion) {\n\t\t\tSystem.out.print(\"Enter question: \");\n\t\t\ttext = System.console().readLine();\n\t\t\tq = new QuestionImpl(questionId, text);\n\t\t\tthis.questionId++;\n\t\t\tq.addAnswers();\n\t\t\tthis.questions.add(q);\n\n\t\t\tSystem.out.print(\"Hit Return to add another question or q to quit: \");\n\t\t\tpromptResponse = System.console().readLine();\n\t\t\tif (promptResponse.equals(\"q\") ||\n\t\t\t\t\tpromptResponse.equals(\"Q\") ||\n\t\t\t\t\tpromptResponse.equals(\"quit\") ||\n\t\t\t\t\tpromptResponse.equals(\"Quit\")) {\n\t\t\t\taddNewQuestion = false;\n\t\t\t}\n\t\t}\n\t}",
"public void addQuestion()\r\n\t{\r\n\t\tScanner in = new Scanner (System.in);\r\n\t\tString question, a1, a2, a3, a4, correctAnswer;\r\n\r\n\t\tSystem.out.println(\"Please enter a question: \");\r\n\t\tquestion = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #1: \");\r\n\t\ta1 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #2: \");\r\n\t\ta2 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #3: \");\r\n\t\ta3 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter answer choice #4: \");\r\n\t\ta4 = in.nextLine();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter the correct answer (number): \");\r\n\t\tcorrectAnswer = in.nextLine();\r\n\t\t\r\n\t\t//checks input\r\n\t\twhile( !( correctAnswer.equalsIgnoreCase(\"1\") || correctAnswer.equalsIgnoreCase(\"2\") || correctAnswer.equalsIgnoreCase(\"3\") || correctAnswer.equalsIgnoreCase(\"4\") ) )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid entry. Enter again:\");\r\n\t\t\tcorrectAnswer = in.nextLine();\r\n\t\t}\r\n\t\tQuestion q = new Question ( question, a1, a2, a3, a4, correctAnswer );\r\n\t\t\r\n\t\tquestions.add(q);\r\n\t}",
"public QuestionInfo (String pergunta){\r\n this.question = pergunta;\r\n }",
"private void addQuestion() {\n if (modifiable()) {\n try {\n this.questions.add(Question.fromInput(gradeable()));\n } catch (UserInputException e) {\n System.err.println(e.getMessage());\n }\n } else {\n System.err.println(\"Can not modify this by add a question.\");\n }\n }",
"public static QuizQuestion createEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(DEFAULT_TEXT)\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }",
"protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }",
"public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}",
"public static void insertQuestion(int i) { \n\t\ttry {\n\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"myform1\\\"]/div/div/div/input\")).sendKeys(QandA.getQuestion(i));\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\tSystem.out.println(e.getMessage()+ \" ERROR IN INSERT QUESTION\");\n\t\t}\n\t\tMethods.clickNextBtn();\n\t}",
"public void addOpenAnswerQuestion(String question) {\n cmbQuestionType.select(questionType);\n txbQuestion.type(question);\n btnAddQuestion.clickAndWait();\n }",
"protected abstract void insertQuestionTx(QuestionImpl question);",
"public void createEssay() {\n Question q = new Essay(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Essay question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many answers does this question have?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns > numChoices || numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n this.o.setDisplay(\"Enter correct answer(s)\\n\");\n this.o.getDisplay();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n ans = this.in.getUserInput();\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n\n this.survey.addQuestion(q);\n }",
"public void setQuestion(String question) {\n this.question = question;\n }",
"public Quiz insertQuiz() {\n\n\t\tQuiz q = new Quiz();\n\t\tq.setStartedAt(new Date());\n\t\tq.setCounter(0);\n\n\t\treturn quizRepo.save(q);\n\n\t}",
"public void saveQuestion(Questions q) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction tx = session.beginTransaction();\n\t\tsession.save(q);\n\t\ttx.commit();\n\t\tsession.close();\n\t}",
"public void addQuestion(Question a) {\n quesCollec.add(a);\n }",
"public void insertQuestion(Pregunta p){\n\t\tpreguntas.persist(p);\n\t}",
"public void newQuest(String name) {\n\t\t//Prevent NullPointerExcpetions\n\t\tif (name == null) {\n\t\t\tbakeInstance.getLogger().info(\"[Bake] Null name for new generated quest. Falling back to default quest selection.\");\n\t\t\tnewQuest();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (QuestCfg.getString(\"quests.\" + name + \".type\", \"N/A\").equals(\"N/A\")) {\n\t\t\tbakeInstance.getLogger().info(\"[Bake] Invalid name (\" + name + \") for new generated quest. Falling back to default quest selection.\");\n\t\t\t//Invalid quest name\n\t\t\tnewQuest();\n\t\t} else {\n\t\t\t//Valid quest name\n\t\t\tactiveQuest = new Quest(QuestCfg, name);\n\t\t}\n\t}",
"@WebMethod\r\n public Question createQuestion(Event event, String question, float betMinimum, float odds) throws EventFinished, QuestionAlreadyExist{\r\n\t \r\n\t //The minimum bed must be greater than 0\r\n\t DataAccess dBManager=new DataAccess();\r\n\t\tQuestion qry=null;\r\n\t\t\r\n\t //TODO Uncomment after testing\t\r\n//\t\tif(new Date().compareTo(event.getEventDate())>0)\r\n//\t\t\tthrow new EventFinished(ResourceBundle.getBundle(\"Etiquetas\").getString(\"ErrorEventHasFinished\"));\r\n\t\t \r\n\t\todds = 1/odds*100;\r\n\t\t\r\n\t\tqry=dBManager.createQuestion(event,question,betMinimum, odds);\r\n\t\t \r\n\t\tSystem.out.println(\" The odds are: \" + odds);\r\n\r\n\t\tdBManager.close();\r\n\t\t\r\n\t\treturn qry;\r\n }",
"public void addQuestion(Question question) {\n\t\tquestions.add(question);\n\t}",
"public Question(String q, String a){ //initializes the question and answer\n\t\t\tquestion = q;\n\t\t\tanswer = a;\n\t\t}",
"public com.vportal.portlet.vfaq.model.FAQComment create(long id);",
"@Test\n\tpublic void testSaveNewQuestionModerated() {\n\t\tAssert.assertTrue(optionsLogic.getOptionsForLocation(LOCATION3_ID).isModerated());\n\n\t\tQnaQuestion question = new QnaQuestion();\n\t\tquestion.setQuestionText(\"blah blah blah\");\n\t\tquestion.setAnonymous(false);\n\t\tquestion.setNotify(false);\n\t\t\n\t\t// Test with invalid\n\t\texternalLogicStub.currentUserId = USER_LOC_3_NO_UPDATE_1;\n\t\ttry {\n\t\t\tquestionLogic.saveQuestion(question, LOCATION3_ID);\n\t\t\tAssert.fail(\"Should have thrown exception\");\n\t\t} catch (SecurityException se) {\n\t\t\tAssert.assertNotNull(se);\n\t\t}\n\n\t\t\n\t\t// Test with valid\n\t\texternalLogicStub.currentUserId = USER_LOC_3_UPDATE_1;\n\t\ttry {\n\t\t\tquestionLogic.saveQuestion(question, LOCATION3_ID);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail(\"Should not have thrown exception\");\n\t\t}\n\n\t\tAssert.assertEquals(question.getOwnerId(), USER_LOC_3_UPDATE_1);\n\t\tAssert.assertEquals(question.getLocation(), LOCATION3_ID);\n\t\tAssert.assertEquals(question.getViews(), Integer.valueOf(0));\n\t\tAssert.assertFalse(question.isPublished());\n\t\tAssert.assertNull(question.getCategory());\n\n\t\tAssert.assertTrue(questionLogic.existsQuestion(question.getId()));\n\t}",
"int insert(Question record);",
"int insert(Question record);",
"int insert(Question record);",
"int insert(Question record);",
"public QuestionTF() {}",
"@Override\n\tpublic Answer create(long answerId) {\n\t\tAnswer answer = new AnswerImpl();\n\n\t\tanswer.setNew(true);\n\t\tanswer.setPrimaryKey(answerId);\n\n\t\tanswer.setCompanyId(CompanyThreadLocal.getCompanyId());\n\n\t\treturn answer;\n\t}",
"public Question(String text, String type, String crrAnswer)\n {\n this.type = type;\n this.text = text;\n this.textCrrAnswer = crrAnswer;\n\n this.mcCrrAnswer = -1;\n this.id = Utility.generateUUID();\n }",
"Question(String ques, String opt1, String opt2, String opt3, String opt4) {\n this.ques = ques;\n this.opt1 = opt1;\n this.opt2 = opt2;\n this.opt3 = opt3;\n this.opt4 = opt4;\n }",
"@Override\n\tpublic boolean addQuestion(QuestionObject question) {\n\t\tif (question != null && !questionComposite.checkExist(question)) {\n\t\t\tquestionComposite.add(question);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"@Override\n\tpublic int topicAdd(QuestionBean q) {\n\t\tString sql = \"insert into topic(title,result,subjectName,difficulty,type,score) values('\"+q.getTitle()+\"','\"+q.getResult()+\"',\"+q.getSubjectName()+\",'\"+q.getDifficulty()+\"',\"+q.getType()+\",\"+q.getScore()+\")\";\n\t\t//int result = jt.update(sql, q.getTitle(),q.getResult(),q.getSubjectName(),q.getDifficulty(),q.getType(),q.getScore());\n\t\tKeyHolder keyHolder = new GeneratedKeyHolder();\n\t\tjt.update(new PreparedStatementCreator() {\n\t\t\t@Override\n\t\t\tpublic java.sql.PreparedStatement createPreparedStatement(java.sql.Connection arg0) throws SQLException {\n\t\t\t\tPreparedStatement ps = arg0.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n\t\t\t\treturn ps;\n\t\t\t}\n\t\t}, keyHolder);\n\t\tSystem.out.println(\"新增加的primarykey:\"+keyHolder.getKey().intValue());\n\t\treturn keyHolder.getKey().intValue();\n\t}",
"void create(Trubriques trubriques);",
"public void newQuest() {\n\t\tList <String> quests;\n\t\tif (activeQuest == null) {\n\t\t\tquests = QuestCfg.getStringList(\"quests.names\");\n\t\t} else {\n\t\t\tquests = activeQuest.getSuccessors();\n\t\t\tif (quests == null) {\n\t\t\t\tquests = QuestCfg.getStringList(\"quests.names\");\n\t\t\t}\n\t\t}\n\t\tbakeInstance.getLogger().info(\"[BAKE] Choosing new quest. Quests available: \" + quests.toString());\n\t\tint questID = (int) Math.round(Math.random()*(quests.size()-1));\n\t\tactiveQuest = new Quest(QuestCfg, quests.get(questID));\n\t}",
"public Question(String text, String type, String[] answers, int crrAnswer)\n {\n this.type = type;\n this.text = text;\n this.answers = answers;\n this.mcCrrAnswer = crrAnswer;\n\n this.id = Utility.generateUUID();\n }",
"public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}",
"public FAQ(String question, String answer){\n\t\tthis.question = question;\n\t\tthis.answer = answer;\n\t}",
"public String createQuiz() {\n quiz = quizEJB.createQuiz(quiz);\n quizList = quizEJB.listQuiz();\n FacesContext.getCurrentInstance().addMessage(\"successForm:successInput\", new FacesMessage(FacesMessage.SEVERITY_INFO, \"Success\", \"New record added successfully\"));\n return \"quiz-list.xhtml\";\n }",
"public void addQuestionOS(QuestionOS quest) {\n ContentValues values = new ContentValues();\n values.put(KEY_QUES, quest.getQUESTION());\n values.put(KEY_ANSWER, quest.getANSWER());\n values.put(KEY_OPTA, quest.getOPTA());\n values.put(KEY_OPTB, quest.getOPTB());\n values.put(KEY_OPTC, quest.getOPTC());\n values.put(KEY_OPTD, quest.getOPTD());\n // Inserting Row\n dbase.insert(TABLE_QUEST, null, values);\n }",
"@Transactional\r\n\tprotected void createQuestionInstruction(QuestionTransferObject newQuestdto, \r\n\t\t\tModuleTransferObject moduledto, String instString) {\r\n\t\t\r\n\t\tif (instString == null || instString.length() == 0)\r\n\t\t\treturn; //Nothing to do\r\n\t\t\r\n\t\tString sizedUpInstr = instString;\r\n\r\n\t\t/* (Snippet copied from FormModuleEditAction (FB)\r\n\t\t * \r\n\t\t * Truncate instruction string to fit in LONG_NAME field (255 characters)\r\n\t\t * Refer to GF# 12379 for guidance on this\r\n\t\t */\r\n\r\n\t\tif (sizedUpInstr.length() > MAX_LONG_NAME_LENGTH) { \r\n\t\t\tsizedUpInstr = sizedUpInstr.substring(0, MAX_LONG_NAME_LENGTH);\r\n\t\t}\r\n\r\n\t\tInstruction instr = new InstructionTransferObject();\r\n\t\tinstr.setLongName(sizedUpInstr);\r\n\t\tinstr.setDisplayOrder(0);\r\n\t\tinstr.setVersion(new Float(1));\r\n\t\tinstr.setAslName(\"DRAFT NEW\");\r\n\t\tinstr.setContext(moduledto.getContext());\r\n\t\tinstr.setPreferredDefinition(instString);\r\n\t\tinstr.setCreatedBy(moduledto.getCreatedBy());\r\n\t\tnewQuestdto.setInstruction(instr);\r\n\t\t\r\n\t\tquestInstructionV2Dao.createInstruction(instr, newQuestdto.getQuesIdseq());\r\n \r\n\t}",
"public Question insertQuestion(Question question, boolean isUndoOrRedo)\n\t\t\tthrows StorageException, ConstraintCheckingException {\n\t\ttry {\n\t\t\tContentValues questionValues = new ContentValues();\n\t\t\tquestionValues.put(\"_ID\", question.get_Id());\n\t\t\tquestionValues.put(\"TYPE\", question.getType());\n\t\t\tquestionValues.put(\"TITLE\", question.getTitle());\n\t\t\tquestionValues.put(\"ANSWER\", question.getAnswer());\n\t\t\tquestionValues.put(\"QUESTIONSET_ID\", question.get_idQuestionSet());\n\t\t\tUri uri = contentResolver.insert(LocalStorageContentProvider.QUESTION_URI, questionValues);\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t}\n\t\tif (!isUndoOrRedo) {\n\t\t\tthis.getQuestionInsertedList().add(question);\n\t\t}\n\t\treturn question;\n\t}",
"int insert(QuestionOne record);",
"public QuestionsRecord() {\n\t\tsuper(sooth.entities.tables.Questions.QUESTIONS);\n\t}",
"public void create() {\n io.writeLine(\"Enter correct answer(T/F)\");\n String answer = io.readLine();\n while (!answer.equals(\"T\") && !answer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n answer = io.readLine();\n }\n rightAnswers.add(answer);\n }",
"public void setQuestion(String question) {\n\t\tthis.question = question;\n\t}",
"@Test\n\tpublic void testSaveNewQuestionUnmoderated() {\n\t\tAssert.assertFalse(optionsLogic.getOptionsForLocation(LOCATION1_ID).isModerated());\n\t\texternalLogicStub.currentUserId = USER_UPDATE;\n\t\t\n\t\t\n\t\tQnaQuestion question = new QnaQuestion();\n\t\tquestion.setQuestionText(\"blah blah blah\");\n\t\tquestion.setAnonymous(false);\n\t\tquestion.setNotify(false);\n\t\ttry {\n\t\t\tquestionLogic.saveQuestion(question, LOCATION1_ID);\n\t\t} catch (Exception e) {\n\t\t\tAssert.fail(\"Should not have thrown exception\");\n\t\t}\n\n\t\tAssert.assertEquals(question.getOwnerId(), USER_UPDATE);\n\t\tAssert.assertEquals(question.getLocation(), LOCATION1_ID);\n\t\tAssert.assertEquals(question.getViews(), Integer.valueOf(0));\n\t\tAssert.assertTrue(question.isPublished());\n\t\tAssert.assertTrue(questionLogic.existsQuestion(question.getId()));\n\t}",
"public DecideQuestion(){\n\t\tsuper(0); /** call relation -> PromptQuestion.java */\n\t}",
"public AnswerEntity createAnswer(AnswerEntity answerEntity) {\n entityManager.persist(answerEntity);\n return answerEntity;\n }",
"public void addQue(String test_name,String que_type,String que,ArrayList<String> options,String ans,String points)\n\t{\n\t\t \n\t Entity xyz=new Entity(\"question\");\n\t xyz.setProperty(\"test_name\",test_name);\n\t xyz.setProperty(\"que_type\",que_type);\n\t xyz.setProperty(\"que\",que);\n\t xyz.setProperty(\"options\",options);\n\t xyz.setProperty(\"ans\",ans);\n\t xyz.setProperty(\"points\",points);\n\t ds.put(xyz);\n\t \n //For question_count and total points. Added in Test entity\t \n\t \n\t long count=0;\n\t double total=0;\n\t Filter test_nameFilter = new FilterPredicate(\"test_name\", FilterOperator.EQUAL,test_name);\n\n\t Query q = new Query(\"Test\").setFilter(test_nameFilter);\n\t\t PreparedQuery pq = ds.prepare(q);\n\t\t Entity abc=pq.asSingleEntity();\n\t\t if(abc!=null)\n\t\t {\n\t\t\t count=(long)abc.getProperty(\"que_count\")+1;\n\t\t\t total=(double)abc.getProperty(\"total_points\")+Double.parseDouble(points);\n\t\t\t abc.setProperty(\"que_count\",count);\n\t\t\t abc.setProperty(\"total_points\",total);\n\t\t ds.put(abc);\n\t\t }\n\t\t \n\t}",
"@Override\n\tpublic Questions addQuestions(long testId, Questions question) throws TestMSException {\n\t\treturn null;\n\t}",
"public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}",
"public Question(int id, String question_text) {\n\n this.questionText = question_text;\n\n this.pictureId = id;\n }",
"public static QuizQuestion createUpdatedEntity(EntityManager em) {\n QuizQuestion quizQuestion = new QuizQuestion()\n .text(UPDATED_TEXT)\n .description(UPDATED_DESCRIPTION);\n // Add required entity\n Quiz quiz;\n if (TestUtil.findAll(em, Quiz.class).isEmpty()) {\n quiz = QuizResourceIT.createUpdatedEntity(em);\n em.persist(quiz);\n em.flush();\n } else {\n quiz = TestUtil.findAll(em, Quiz.class).get(0);\n }\n quizQuestion.setQuiz(quiz);\n return quizQuestion;\n }",
"void add(String question, long time, boolean correct);",
"public void addQuiz(Quiz quiz){\n \t\tString id = quiz.getQuizId();\n \t\tString date = quiz.getDateCreated();\n \t\tString creatorId = quiz.getCreatorId();\n \t\tint numQuestions = quiz.getNumQuestions();\n \t\tboolean isRandom = quiz.getIsRandom();\n \t\tboolean isOnePage = quiz.getIsOnePage();\n \t\tboolean isImmediate = quiz.getIsImmediate();\n \t\tint numTimesTaken = 0;\n \t\tString imageURL = quiz.getImageURL();\n \t\tString description = quiz.getDescription();\n \t\tString query = \"INSERT INTO quizzes VALUES('\" + id + \"', '\" + date + \"', '\" + creatorId + \"', \" \n \t\t\t\t+ numQuestions + \", \" + isRandom + \", \" + isOnePage + \", \" + isImmediate + \", \" \n \t\t\t\t+ numTimesTaken + \", '\" + imageURL + \"', '\" + description + \"');\";\n \t\tsqlUpdate(query);\n \t\t\n \t\t// TODO!!!! add each question as well\n \t\tArrayList<Question> questions = quiz.getQuestions();\n \t\tfor(Question q : questions){\n \t\t\tint questionNum = q.getNumber();\n \t\t\t/*ArrayList<String> answers = q.getAnswers();\n \t\t\tfor (String a : answers){\n \t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t}*/\n \t\t\tif(q instanceof MultipleChoice){\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tquery = \"INSERT INTO multiple_choice VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"', '\" + answers.get(0) + \"', '\" + answers.get(1) + \"', '\" + answers.get(2) + \"', '\" + answers.get(3) + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', \" + questionNum + \", '\" + ((MultipleChoice) q).getCorrectAnswer() + \"');\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t} else if(q instanceof QuestionResponse){\n \t\t\t\tquery = \"INSERT INTO question_response VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} else if(q instanceof Picture){\n \t\t\t\tquery = \"INSERT INTO picture VALUES('\" + id + \"', '\" + questionNum + \"', '\" + q.getQuestion() + \"', '\" + ((Picture) q).getUrl() + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} else if(q instanceof FillInBlank){\n \t\t\t\tArrayList<String> questionsArray = ((FillInBlank) q).getQuestions();\n \t\t\t\tquery = \"INSERT INTO fill_in_the_blank VALUES('\" + id + \"', '\" + questionNum + \"', '\" + questionsArray.get(0) + \"', '\" + questionsArray.get(1) + \"')\";\n \t\t\t\tsqlUpdate(query);\n \t\t\t\tArrayList<String> answers = q.getAnswers();\n \t\t\t\tfor (String a : answers){\n \t\t\t\t\tquery = \"INSERT INTO answers VALUES('\" + id + \"', '\" + questionNum + \"', '\" + a + \"');\";\n \t\t\t\t\tsqlUpdate(query);\n \t\t\t\t}\n \t\t\t} \n \t\t}\n \t}",
"protected void insertQuestion(final QuestionImpl question)\n\t{\n\t\tthis.sqlService.transact(new Runnable()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tinsertQuestionTx(question);\n\t\t\t}\n\t\t}, \"insertQuestion: \" + question.getId());\n\t}",
"@Override\n\tpublic int saveQuiz(Quiz newQuiz) {\n\t\ttry {\n\t\t\tConnection database = ds.getConnection();\n\t\t\tString statement = \"INSERT INTO quiz(quiz_id, subject, quiz_description)\\r\\n\" + \n\t\t\t\t\t\"VALUES(QUIZ_ID_SEQ.nextval,?,?)\";\n\t\t\t\n\t\t\tPreparedStatement ps = database.prepareStatement(statement);\n\t\t\tps.setString(1, newQuiz.getSubject());\n\t\t\tps.setString(2, newQuiz.getDescription());\n\t\t\t\n\t\t\treturn ps.executeUpdate();\n\t\t\n\t\t} catch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn 0;\n\t\t}\n\t}",
"Question getQuestion();",
"public void setQuestion(String newQuestion) {\n question = newQuestion;\n }",
"public static void main(){\n \n \n String question = \"There are 10 types of people in this world, those who understand binary and those who don't.\";\n String answer = \"true\";\n \n Question tfQuest = new Question (question, answer);\n tfQuest.getAnswer();\n \n }",
"@Override\n\tpublic Questions addQuestion(BigInteger testId, Questions question) throws UserException {\n\t\treturn null;\n\t}"
]
| [
"0.8194488",
"0.74686027",
"0.7388215",
"0.72980994",
"0.7146689",
"0.70772743",
"0.704275",
"0.7034408",
"0.7032499",
"0.6971038",
"0.69608843",
"0.69329756",
"0.6868901",
"0.6778647",
"0.67370063",
"0.67245454",
"0.6721196",
"0.66453063",
"0.6634768",
"0.662168",
"0.6607402",
"0.65970284",
"0.6582006",
"0.6579928",
"0.6535226",
"0.6517981",
"0.6506093",
"0.64687616",
"0.6462723",
"0.644464",
"0.6441979",
"0.64419174",
"0.64199615",
"0.6409968",
"0.64043146",
"0.6396338",
"0.63961303",
"0.63873935",
"0.63585037",
"0.6348496",
"0.632036",
"0.63041204",
"0.6300393",
"0.627097",
"0.6258903",
"0.62441987",
"0.62346077",
"0.62057537",
"0.62051827",
"0.62030447",
"0.6199409",
"0.61893237",
"0.61849606",
"0.61794776",
"0.61780846",
"0.6174712",
"0.61679405",
"0.61611724",
"0.6151287",
"0.6148679",
"0.6143594",
"0.61336887",
"0.61336887",
"0.61336887",
"0.61336887",
"0.61115575",
"0.61070764",
"0.6095297",
"0.6085703",
"0.6078082",
"0.60657156",
"0.6059149",
"0.6034475",
"0.6034154",
"0.6031777",
"0.60314566",
"0.6030594",
"0.60210323",
"0.60192484",
"0.601454",
"0.60054517",
"0.5994885",
"0.5994192",
"0.59610933",
"0.59567094",
"0.5954997",
"0.59501106",
"0.5937709",
"0.5933494",
"0.5921342",
"0.5912473",
"0.5896577",
"0.5884023",
"0.58790743",
"0.5871714",
"0.5866399",
"0.5863651",
"0.5859139",
"0.58560556",
"0.5851487"
]
| 0.830308 | 0 |
Change availability of field's answers | private void setAvailability(boolean b) {
TextAnswer1.setVisible(b);
TextAnswer2.setVisible(b);
TextAnswer3.setVisible(b);
TextAnswer1.setDisable(!b);
TextAnswer2.setDisable(!b);
TextAnswer3.setDisable(!b);
LabelAnswer1.setVisible(b);
LabelAnswer2.setVisible(b);
LabelAnswer3.setVisible(b);
// if not, we should not be able to write in the TextFields (I reset them to prevent errors)
if (!b) {
TextAnswer1.setText("");
TextAnswer2.setText("");
TextAnswer3.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateFields() {\n\t\tsetNumComboBox();\n\t\tquestionNoList.setSelectedIndex(questionNo - 1);\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tques.setText(testGenerator.getQuestionText(questionNo));\n\t\tans1.setText(testGenerator.getAnswerText(questionNo, 1));\n\t\tans2.setText(testGenerator.getAnswerText(questionNo, 2));\n\t\tanswer1.setSelected(testGenerator.isAnswerCorrect(questionNo, 1));\n\t\tanswer2.setSelected(testGenerator.isAnswerCorrect(questionNo, 2));\n\t\tdisableThreeAndFour();\n\n\t\tif(numAnswers >= 3) {\n\t\t\tans3.setText(testGenerator.getAnswerText(questionNo, 3));\n\t\t\tanswer3.setSelected(testGenerator.isAnswerCorrect(questionNo, 3));\n\t\t\tenableThreeDisableFour();\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tanswer4.setSelected(testGenerator.isAnswerCorrect(questionNo, 4));\n\t\t\tans4.setText(testGenerator.getAnswerText(questionNo, 4));\n\t\t\tenableThreeAndFour();\n\t\t}\n\n\t\tif(questionNo < getNumQuestions()) \n\t\t\tnextQuestion.setEnabled(true);\n\t\telse\n\t\t\tnextQuestion.setEnabled(false);\n\n\t\tif(questionNo == 1) \n\t\t\tprevQuestion.setEnabled(false);\n\t\telse\n\t\t\tprevQuestion.setEnabled(true);\n\t}",
"public void setAnswer(String newAnswer){\n this.answer = newAnswer; \n }",
"private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}",
"private void setAnswer() {\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n setValue();\n }\n }",
"public void changeAnswers(String question, ArrayList<Integer> choices) {\r\n Random randomGenerator = new Random();\r\n boolean hasChange = randomGenerator.nextBoolean();\r\n\r\n // if boolean is true, student will change answer by jumping back to submitAnswer()\r\n if (hasChange) {\r\n System.out.println(studentID + \" is changing answer...\");\r\n studentAnswer.clear();\r\n submitAnswer(question, choices);\r\n }\r\n }",
"private void updateQuestion() {\r\n\r\n //The code below resets the option\r\n mOption1.setVisibility(View.VISIBLE);\r\n mOption2.setVisibility(View.VISIBLE);\r\n mOption3.setVisibility(View.VISIBLE);\r\n mNext.setVisibility(View.INVISIBLE);\r\n\r\n int questionSize = 12;\r\n\r\n if (mQuestionNumber < questionSize) {\r\n\r\n mQuestionView.setText((questionsDB.getQuestion(mQuestionNumber)));\r\n mOption1.setText(questionsDB.getChoice1(mQuestionNumber));\r\n mOption2.setText(questionsDB.getChoice2(mQuestionNumber));\r\n mOption3.setText(questionsDB.getChoice3(mQuestionNumber));\r\n\r\n mAnswer = questionsDB.getCorrectAnswer(mQuestionNumber);\r\n mQuestionNumber++;\r\n timeLeftInMillis = COUNTDOWN_IN_MILLIS;\r\n startCountDown();\r\n\r\n\r\n } else {\r\n displayScore();\r\n }\r\n\r\n }",
"private void updateQuestion(){\n mchoice1.setChecked(false);\n mchoice2.setChecked(false);\n mchoice3.setChecked(false);\n mchoice4.setChecked(false);\n\n if (mQuestonNumber < mQuizLibrary.getLength()){\n //menset setiap textview dan radiobutton untuk diubah jadi pertanyaan\n sQuestion.setText(mQuizLibrary.getQuestion(mQuestonNumber));\n //mengatur opsi sesuai pada optional A\n mchoice1.setText(mQuizLibrary.getChoice(mQuestonNumber, 1)); //Pilihan Ganda ke 1\n //mengatur opsi sesuai pada optional B\n mchoice2.setText(mQuizLibrary.getChoice(mQuestonNumber, 2)); //Pilihan Ganda ke 2\n //mengatur opsi sesuai pada optional C\n mchoice3.setText(mQuizLibrary.getChoice(mQuestonNumber, 3)); //Pilihan Ganda ke 3\n //mengatur opsi sesuai pada optional D\n mchoice4.setText(mQuizLibrary.getChoice(mQuestonNumber, 4)); //Pilihan Ganda ke 4\n\n manswer = mQuizLibrary.getCorrect(mQuestonNumber);\n //untuk mengkoreksi jawaban yang ada di class QuizBank sesuai nomor urut\n mQuestonNumber++; //update pertanyaan\n }else{\n Toast.makeText(Quiz.this, \"ini pertanyaan terakhir\", Toast.LENGTH_LONG).show();\n Intent i = new Intent (Quiz.this, HighestScore.class);\n i.putExtra(\"score\", mScore); //UNTUK MENGIRIM NILAI KE activity melalui intent\n startActivity(i);\n }\n }",
"@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}",
"public void modify() {\n io.writeLine(\"Enter the new correct answer\");\n String newAnswer = io.readLine();\n while (!newAnswer.equals(\"T\") && !newAnswer.equals(\"F\")) {\n io.writeLine(\"Please put in T or F\");\n newAnswer = io.readLine();\n }\n rightAnswers.set(0, newAnswer);\n }",
"public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }",
"public static void changeQuestion(int qid, String username) {\n\t\t\tboolean flag = false;\n\t\t\tString a2 = null;\n \t\tint d = 0;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tif ((qid <= 12) || (qid == 14)) {\n\t\t\t\t\t\ta2 = JOptionPane.showInputDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.PLAIN_MESSAGE);\n \t\t\t\tflag = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\td = JOptionPane.showConfirmDialog(null, qid + \" Update your answer\", \"QUESTIONNAIRE\", JOptionPane.YES_NO_OPTION,JOptionPane.PLAIN_MESSAGE);\n \t\t\t\ta2 = String.valueOf(d);\n \t\t\tflag = true;\n \t\t\t} \n \t\t\tif (a2.equals(null) || (d == -1)) {\n \t\t\t\tthrow new NullPointerException();\n \t\t\t}\n \t\t} catch (NullPointerException e1) {\n \t\t\tJOptionPane.showMessageDialog(null, \"Please insert your answer\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n \t\t\tflag = false;\n \t\t}\n \t\t}while (flag == false);\n\t\t\tif (checkQuestion(qid, a2) == false) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"We regret to inform you that you are no longer compatible as a blood donor.\", \"ALERT MESSAGE\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\tSystem.exit(0);\n\t\t\t} else {\n\t\t\t\tupdateTableAnswers(qid, username, a2);\n\t\t\t}\n\t\t\t\n\t\t\treturn;\t\n\t\t}",
"public void answer(Properties answers) {\n/* 56 */ setAnswer(answers);\n/* 57 */ QuestionParser.parseManageAllianceQuestion(this);\n/* */ }",
"public void setAnswer(MCQChoice answer)\n\t{\n\t\tmcqAnswer = answer;\n\t}",
"public void setAnswer(double correctResponse)\n { \n answer = correctResponse; \n }",
"public void question() {\n\t\tlead.answer(this);\n\t}",
"public void setAnswer(String answer) {\r\n this.answer = answer;\r\n }",
"public void setCorrect_answer(String correct_answer) {\n this.correct_answer=correct_answer;\n }",
"public void modifyQuestion(String text) {\n // TODO implement here\n }",
"private void enableFieldBasedOnUpdateMethod() {\r\n if (updateMethod.getSelectedItem() == CompetitiveGroup.UpdateMethod.ALVAREZ_SQUIRE) {\r\n tfSynpaseDecayPercent.setEnabled(true);\r\n } else if (updateMethod.getSelectedItem() == CompetitiveGroup.UpdateMethod.RUMM_ZIPSER) {\r\n tfSynpaseDecayPercent.setEnabled(false);\r\n }\r\n }",
"private void checkFill(FyQuestion q, FyAnswer a) {\n\t\tList<FyQuestionItem> is = q.getItems();\r\n\t\tDouble avg = q.getScore() != 0 ? q.getScore() / is.size() : 0;\t\r\n\t\ta.setGoal(0.0);\r\n\t\tfor (int i = 0; i < is.size(); i++) {\r\n\t\t\tif (a.getAnswers()[i].equals(is.get(i).getContent())) {\r\n\t\t\t\ta.setGoal(avg + (a.getGoal() != null ? a.getGoal() : 0.0));\r\n\t\t\t}\r\n\t\t}\r\n\t\ta.setIsGrade(true);\r\n\t}",
"private void updateQuestion(){\n\t\tint question = mQuestionBank[mCurrentIndex].getQuestion();\n\t\tmQuestionTextView.setText(question);\n\t}",
"public void setAnswerFields (LSPField[] answerFields) {\r\n this.answerFields = answerFields;\r\n }",
"void setQuestionType(QuestionType type);",
"public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }",
"private void updateQuestion(){\n int question = mQuestionBank[mCurrentIndex].getmQuestion();\n mQuestionTextView.setText(question);\n }",
"public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }",
"private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }",
"public void setQuestion(){\n txt_question.setText(arrayList.get(quesAttempted).getQuestion());\n txt_optionA.setText(arrayList.get(quesAttempted).getOptionA());\n txt_optionB.setText(arrayList.get(quesAttempted).getOptionB());\n txt_optionC.setText(arrayList.get(quesAttempted).getOptionC());\n txt_optionD.setText(arrayList.get(quesAttempted).getOptionD());\n txt_que_count.setText(\"Que: \"+(quesAttempted+1)+\"/\"+totalQues);\n txt_score.setText(\"Score: \"+setScore);\n }",
"public void saveQuestion(){\n\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString setAnswerBox = Integer.toString(numAnswers);\n\n\t\ttestGenerator.setQuestionText(questionNo, ques.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 1, ans1.getText());\n\t\ttestGenerator.setAnswerText(questionNo, 2, ans2.getText());\n\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 1, answer1.isSelected());\n\t\ttestGenerator.setIsAnswerCorrect(questionNo, 2, answer2.isSelected());\n\n\t\tif((setAnswerBox.equals(\"3\")) || setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 3, ans3.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 3, answer3.isSelected());\n\t\t}\n\n\t\tif(setAnswerBox.equals(\"4\")) {\n\t\t\ttestGenerator.setAnswerText(questionNo, 4, ans4.getText()); \t\n\t\t\ttestGenerator.setIsAnswerCorrect(questionNo, 4, answer4.isSelected());\n\t\t}\n\t}",
"@Override\n public void resetQuestion() {\n super.resetQuestion();\n hadSecondChance = false;\n currentTeam = null;\n originalTeam = null;\n teamHasAnswered.clear();\n //reset teamHasAnswered map so all teams get a chance to anaswer again\n for (int i = 0; i < numTeams; i++) teamHasAnswered.put(i, false);\n }",
"private void checkAsk(FyQuestion q, FyAnswer a) {\n\t\treturn;\r\n\t}",
"public void presetYesNo() {\n pollOptions.clear();\n pollOptions.add(\"Yes\");\n pollOptions.add(\"No\");\n CreatePollLogic.reDrawOptionList(optionContainer, pollOptions, optionArea);\n }",
"public void setQuestion(String newQuestion) {\n question = newQuestion;\n }",
"public void changeAvailability() {\n\t\tavailability = !availability;\n\t}",
"public void setQuestions(){\r\n question.setTestname(test.getText().toString());\r\n question.setQuestion(ques.getText().toString());\r\n question.setOption1(opt1.getText().toString());\r\n question.setOption2(opt2.getText().toString());\r\n question.setOption3(opt3.getText().toString());\r\n int num = Integer.parseInt(correct.getText().toString());\r\n question.setAnswerNumber(num);\r\n long check = db.addToDb(question);\r\n if(check == -1){\r\n Toast.makeText(getBaseContext(), \"Question already exists\", Toast.LENGTH_LONG).show();\r\n }else{\r\n Toast.makeText(getBaseContext(), \"Question added\", Toast.LENGTH_LONG).show();\r\n }\r\n }",
"public void setSecurity_answer(String security_answer);",
"public void swapEquivalVisivility() {\n EquSelectors.setVisibility(Equival.isChecked()? View.VISIBLE : View.GONE);\n if(EquSelectors.getVisibility() == View.GONE){\n EquWord.setChecked(false);\n EquTran.setChecked(false);\n }\n\n WordText.setHint(getText(Equival.isChecked()? R.string.hint_for_equ_word : R.string.hint_for_word));\n TranText.setHint(getText(Equival.isChecked()? R.string.hint_for_equ_tran : R.string.hint_for_tran));\n InfoText.setHint(getText(Equival.isChecked()? R.string.hint_for_equ_info : R.string.hint_for_info));\n syncronizeForEquivalence();\n }",
"public void setAnswers(int answers) {\n this.answers = answers;\n }",
"@BindingAdapter(\"android:answers\")\n public static void setAnswers(RecyclerView recyclerView, Question question)\n {\n if (question != null && question.answers != null && question.answers.size() > 0)\n {\n question.answers.forEach(x -> x.active.set(false));\n recyclerView.setItemViewCacheSize(20);\n recyclerView.setDrawingCacheEnabled(true);\n recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);\n LinearLayoutManager layoutManager = new LinearLayoutManager(recyclerView.getContext(), LinearLayoutManager.VERTICAL, false);\n recyclerView.setLayoutManager(layoutManager);\n\n AnswerAdapter answerAdapter = new AnswerAdapter(question.answers);\n recyclerView.setAdapter(answerAdapter);\n\n ItemClickSupport.addTo(recyclerView)\n .setOnItemClickListener((rv, position, v) ->\n {\n Answer a = answerAdapter.getItem(position);\n if (a != null)\n {\n if (!question.multiple.get())\n {\n question.answers.stream().filter(x -> x.getId() != a.getId()).forEach(x -> x.active.set(false));\n }\n a.active.set(!a.active.get());\n }\n });\n }\n }",
"public void setResponse(MultipleChoiceQuestionResponse response) {\n group.getToggles().get(response.getAnswer()).setSelected(true);\n }",
"public void setIsAsked(boolean isAnswered) {\n\t\tthis.isAsked = isAnswered;\n\t}",
"public void setAnswer1(String answer1) {\r\n this.answer1 = answer1;\r\n }",
"private void updateQuestion()\r\n {\r\n if(noOfQuestion == 10) //last question.\r\n {\r\n //Toast.makeText(getApplicationContext(), \"Questions Limit Reached!!\", Toast.LENGTH_SHORT).show();\r\n\r\n questionsTV.setVisibility(View.GONE);\r\n questionNoTV.setVisibility(View.GONE);\r\n answer1Btn.setVisibility(View.GONE);\r\n answer2Btn.setVisibility(View.GONE);\r\n answer3Btn.setVisibility(View.GONE);\r\n viewLBBtn.setVisibility(View.VISIBLE);\r\n congratsImgView.setVisibility(View.VISIBLE);\r\n starImgView.setVisibility(View.VISIBLE);\r\n\r\n if(backgroundMusicPlayer.isPlaying()) {\r\n backgroundMusicPlayer.stop();\r\n }\r\n congratsMPlayer.start();\r\n clapSoundPlayer.start();\r\n }\r\n else\r\n {\r\n noOfQuestion++; //increment the number of question.\r\n resetButtonsPosition(answer1Btn, answer2Btn, answer3Btn, 0);\r\n\r\n //update the view with next question and answers.\r\n questionsTV.setText(questionsAndAnswersLibrary.getQuestion(questionNo));\r\n answer1Btn.setText(questionsAndAnswersLibrary.getAnswerChoice1(questionNo));\r\n answer2Btn.setText(questionsAndAnswersLibrary.getAnswerChoice2(questionNo));\r\n answer3Btn.setText(questionsAndAnswersLibrary.getAnswerChoice3(questionNo));\r\n\r\n correctAnswer = questionsAndAnswersLibrary.getCorrectAnswer(questionNo);\r\n questionNo++;\r\n\r\n moveButtons(answer1Btn);\r\n moveButtons(answer2Btn);\r\n moveButtons(answer3Btn);\r\n }\r\n }",
"public void mo23023f() {\n this.f26122b.edit().putLong(\"has.ask.rate.at\", -1).apply();\n }",
"public void setNumNewQuestions() {\n\t\tif(newQuestions && checkNewQuestions().equals(\"\")) {\n\t\t\tanswerChoiceList.setSelectedIndex(2);\n\t\t}\n\t\tif(newQuestions && questionNo == noOfQuestions) {\n\t\t\tnewQuestions = false;\n\t\t}\n\t}",
"public int get_correctAnswer(){return this._correctAnswer;}",
"@Test\n\tpublic void updateTestPaperQuestion() throws Exception {\n\t}",
"public void changePowerUp(boolean powerUpQuestion)\n {\n this.currentState = ClientStateName.POWERUP;\n setChanged();\n notifyObservers(currentState);\n }",
"@Override\r\n\tpublic void checkAnswer() {\n\t\t\r\n\t}",
"public void setCorrectFlag(){\n\t\tcorrectFlag = true;\n\t}",
"void addQuestionAnswer(Answer answer);",
"private void setAnswerForLastQuestion() {\n\n DbHelper dbhelper = new DbHelper(context);\n questionNo = questionNo + 1;\n QuizAnswer answer = new QuizAnswer();\n answer.setQuizId(quizId);\n answer.setQuestionId(questionId);\n int optionId = shareprefs.getInt(\"optionId\", 0);\n answer.setOptionId(optionId);\n int correctAns = shareprefs.getInt(\"correctAns\", 0);\n answer.setAnswer(correctAns);\n answer.setContentId(contentId);\n boolean flage = dbhelper.upsertQuizAnswerEntity(answer);\n if (flage) {\n shareprefs.edit().clear().commit();//clear select OptionPreferences\n Intent mIntent = new Intent(this, QuizResultActivity.class);\n mIntent.putExtra(\"quizId\", quizId);\n mIntent.putExtra(\"contentId\", contentId);\n mIntent.putExtra(\"totalQuestion\", questionList.size());\n startActivityForResult(mIntent,1);\n }\n }",
"private boolean modifiable() {\n // Only allow un-answered tests/surveys to be modified\n return this.completed.size() == 0;\n }",
"@FXML\n private void _submitAnswer(ActionEvent _event) {\n Game currentGame = GameFactory.getCurrentGameInstance();\n currentGame.processAnswer(_answerInput.getText());\n Map<String, Object> data = currentGame.createMap();\n updateView(data);\n this._answerInput.setText(\"\");\n if (!currentGame.gameOver) {\n this._submitBtn.setDisable(true);\n this._nxtQuestion.setDisable(false);\n } else {\n this._submitBtn.setDisable(true);\n this._nxtQuestion.setDisable(true);\n }\n }",
"public void setQuestions() {\n\t\tString question1 = str1 + _QwdQuestionFst;\n\t\tSpannableString sb1 = new SpannableString(question1);\n\t\tsb1.setSpan(new ForegroundColorSpan(Color.BLACK), str1.length() ,\n\t\t\t\tsb1.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_1.setText(sb1);\n\n\t\tString question2 = str2 + _QwdQuestionSec;\n\t\tSpannableString sb2 = new SpannableString(question2);\n\t\tsb2.setSpan(new ForegroundColorSpan(Color.BLACK), str2.length() ,\n\t\t\t\tsb2.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);\n\t\t_FPTV_Question_2.setText(sb2);\n\t}",
"public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"private void checkAnswer()\r\n\t{\r\n\t\t//Submission to the model and getting 'true' if correct and 'false' otherwise\r\n\t\tboolean response = quizModel.isCorrect(group.getSelection().getActionCommand());\r\n\t\t\r\n\t\t//Updating score label based on result\r\n\t\tif (response == true)\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Correct answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"<br>Incorrect answer!\" + \"</div></html>\");\r\n\t\t}\r\n\t}",
"public void showCorrectAnswers() {\n holders.forEach(QuizViewHolder::showCorrectAnswer);\n }",
"private void answerYesOrNo() {\n List<String> Yes = additionalDB.get(\"Yes\");\n List<String> No = additionalDB.get(\"No\");\n if (random.nextBoolean())\n \tresponsesList.add(new Response(getRandomElementFromList(Yes)));\n else responsesList.add(new Response(getRandomElementFromList(No)));\n }",
"protected void markAsCorrect(Answer a, Boolean b) {\n if (a.getQuestion().getAuthor().equals(this)) {\n if(b && a.getQuestion().hasCorrectAnswer()) \n \t return;\n else\t\t \n \t this.setFlag(a, \"correct\", b);\n }\n }",
"public void reset() {\n for (Map.Entry<String, Question> questionEntry : mQuestions.entrySet()) {\n Map<String, Option> options = questionEntry.getValue().getOptions();\n for (Map.Entry<String, Option> optionEntry : options.entrySet()) {\n optionEntry.getValue().setIsCorrect(false);\n }\n }\n }",
"private void setAnswers(HttpServletRequest request, SectionInstanceDto currentSection,\r\n\t\t\tQuestionInstanceDto currentQuestion, String questionMapperId, Boolean calledFromSubmit) {\r\n\t\tList<SectionInstanceDto> sectionInstanceDtos = (List<SectionInstanceDto>) request.getSession()\r\n\t\t\t\t.getAttribute(\"sectionInstanceDtos\");\r\n\t\tfor (SectionInstanceDto sectionInstanceDto : sectionInstanceDtos) {\r\n\t\t\tif (sectionInstanceDto.getSection().getSectionName()\r\n\t\t\t\t\t.equals(currentSection.getSection().getSectionName())) {\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * Get the corresponding Question from section from the session object\r\n\t\t\t\t */\r\n\t\t\t\tfor (QuestionInstanceDto questionInstanceDto : currentSection.getQuestionInstanceDtos()) {\r\n\r\n\t\t\t\t\tif (questionInstanceDto.getQuestionMapperInstance().getQuestionMapper().getId()\r\n\t\t\t\t\t\t\t.equals(Long.valueOf(questionMapperId))) {\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Add code for evaluating coding engine Q\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tif (questionInstanceDto.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t\t\t.getQuestion().getQuestionType() == null) {\r\n\t\t\t\t\t\t\tquestionInstanceDto.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t\t\t\t.getQuestion().setQuestionType(QuestionType.MCQ);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tString type = questionInstanceDto.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t\t\t.getQuestion().getQuestionType().getType();\r\n\t\t\t\t\t\tQuestion q = questionInstanceDto.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t\t\t.getQuestion();\r\n\t\t\t\t\t\tif (type != null && type.equals(QuestionType.CODING.getType())) {\r\n\t\t\t\t\t\t\tevaluateCodingAnswer(currentQuestion, questionInstanceDto);// here\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// questionInstanceDto\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// is\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// updated\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// with\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// compilation\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// results\r\n\t\t\t\t\t\t\tsectionInstanceDto.setQuestionInstanceDtos(\r\n\t\t\t\t\t\t\t\t\tcurrentSection.getQuestionInstanceDtos());\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * End Add code for evaluating coding engine Q\r\n\t\t\t\t\t\t */\r\n\r\n\t\t\t\t\t\tString userChoices = \"\";\r\n\t\t\t\t\t\tif (currentQuestion.getOne()) {\r\n\t\t\t\t\t\t\tuserChoices = \"Choice 1\";\r\n\t\t\t\t\t\t\tquestionInstanceDto.setOne(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setOne(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (currentQuestion.getTwo()) {\r\n\t\t\t\t\t\t\tif (userChoices.length() > 0) {\r\n\t\t\t\t\t\t\t\tuserChoices += \"-Choice 2\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setTwo(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tuserChoices = \"Choice 2\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setTwo(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setTwo(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (currentQuestion.getThree()) {\r\n\t\t\t\t\t\t\tif (userChoices.length() > 0) {\r\n\t\t\t\t\t\t\t\tuserChoices += \"-Choice 3\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setThree(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tuserChoices = \"Choice 3\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setThree(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setThree(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (currentQuestion.getFour()) {\r\n\t\t\t\t\t\t\tif (userChoices.length() > 0) {\r\n\t\t\t\t\t\t\t\tuserChoices += \"-Choice 4\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setFour(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tuserChoices = \"Choice 4\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setFour(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setFour(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (currentQuestion.getFive()) {\r\n\t\t\t\t\t\t\tif (userChoices.length() > 0) {\r\n\t\t\t\t\t\t\t\tuserChoices += \"-Choice 5\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setFive(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tuserChoices = \"Choice 5\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setFive(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setFive(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (currentQuestion.getSix()) {\r\n\t\t\t\t\t\t\tif (userChoices.length() > 0) {\r\n\t\t\t\t\t\t\t\tuserChoices += \"-Choice 6\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setSix(true);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tuserChoices = \"Choice 6\";\r\n\t\t\t\t\t\t\t\tquestionInstanceDto.setSix(true);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tquestionInstanceDto.setSix(false);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tquestionInstanceDto.getQuestionMapperInstance().setUserChoices(userChoices);\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Confidence based assessment\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tquestionInstanceDto.getQuestionMapperInstance()\r\n\t\t\t\t\t\t\t\t.setConfidence(currentQuestion.getConfidence());\r\n\t\t\t\t\t\tquestionInstanceDto.setConfidence(currentQuestion.getConfidence());\r\n\t\t\t\t\t\tquestionInstanceDto.setRadioAnswer(currentQuestion.getRadioAnswer());\r\n\t\t\t\t\t\tsectionInstanceDto.setQuestionInstanceDtos(\r\n\t\t\t\t\t\t\t\tcurrentSection.getQuestionInstanceDtos());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void q7Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q7option4);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ7) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ7 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public void updateAnswer(String text) {\n\t\tclearAnswer();\n\t\t\n\t\t// Add new label with the string\n\t\tlbl.setText(text);\n\t\tvPanel.add(lbl);\n\n\t\treturn;\n\t}",
"public void updateButtons(){\n\t\tif (Player.getPlayer(this).questManager.atMaxNumQuests()) {\n\t\t\tcreateQuest.setEnabled(false);\n\t\t} else {\n\t\t\tcreateQuest.setEnabled(true);\n\t\t}\n\t\tif (selectedQuest != null){\n\t\t\tdeleteQuest.setEnabled(true);\n\t\t\tcompleteQuest.setEnabled(true);\n\t\t} else {\n\t\t\tdeleteQuest.setEnabled(false);\n\t\t\tcompleteQuest.setEnabled(false);\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tcheckAnswer(false);\n\t\t\t\t\n\t\t\t}",
"void acceptQueAnswersClicked();",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tcheckAnswer(true);\n\t\t\t\t\n\t\t\t}",
"public void q6Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q6option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ6) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ6 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"private void setQuestionView()\n\t{\n txtQNumber.setText(qid + 1 + \"/\" + numberOfQuestions);\n\t\ttxtQuestion.setText(currentQ.getQUESTION());\n\t\ttxtReference.setText(currentQ.getREFERENCE());\n\t\trda.setText(currentQ.getOPTA());\n\t\trdb.setText(currentQ.getOPTB());\n\t\trdc.setText(currentQ.getOPTC());\n\t\trdd.setText(currentQ.getOPTD());\n\t\tqid++;\n\t}",
"public void setSelectionStrategy( IAnswerSelectionStrategy iass );",
"public void presetTrueFalse() {\n pollOptions.clear();\n pollOptions.add(\"True\");\n pollOptions.add(\"False\");\n CreatePollLogic.reDrawOptionList(optionContainer, pollOptions, optionArea);\n }",
"public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }",
"public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"@Test//ExSkip\n public void fieldAsk() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Place a field where the response to our ASK field will be placed.\n FieldRef fieldRef = (FieldRef) builder.insertField(FieldType.FIELD_REF, true);\n fieldRef.setBookmarkName(\"MyAskField\");\n builder.writeln();\n\n Assert.assertEquals(\" REF MyAskField\", fieldRef.getFieldCode());\n\n // Insert the ASK field and edit its properties to reference our REF field by bookmark name.\n FieldAsk fieldAsk = (FieldAsk) builder.insertField(FieldType.FIELD_ASK, true);\n fieldAsk.setBookmarkName(\"MyAskField\");\n fieldAsk.setPromptText(\"Please provide a response for this ASK field\");\n fieldAsk.setDefaultResponse(\"Response from within the field.\");\n fieldAsk.setPromptOnceOnMailMerge(true);\n builder.writeln();\n\n Assert.assertEquals(\n \" ASK MyAskField \\\"Please provide a response for this ASK field\\\" \\\\d \\\"Response from within the field.\\\" \\\\o\",\n fieldAsk.getFieldCode());\n\n // ASK fields apply the default response to their respective REF fields during a mail merge.\n DataTable table = new DataTable(\"My Table\");\n table.getColumns().add(\"Column 1\");\n table.getRows().add(\"Row 1\");\n table.getRows().add(\"Row 2\");\n\n FieldMergeField fieldMergeField = (FieldMergeField) builder.insertField(FieldType.FIELD_MERGE_FIELD, true);\n fieldMergeField.setFieldName(\"Column 1\");\n\n // We can modify or override the default response in our ASK fields with a custom prompt responder,\n // which will occur during a mail merge.\n doc.getFieldOptions().setUserPromptRespondent(new MyPromptRespondent());\n doc.getMailMerge().execute(table);\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.ASK.docx\");\n testFieldAsk(table, doc); //ExSkip\n }",
"public boolean hasAnswers() {\n return fieldSetFlags()[20];\n }",
"public void setAvailable(boolean x){\n availabile = x;\n }",
"public void setQuestion(){\n String welcomeTextString = \"Welcome \" + getIntent().getStringExtra(\"name\") + \"!\";\n welcomeText.setText(welcomeTextString);\n\n //Setting Question title, description, and answers\n questionTitle.setText(questions[currentQuestion-1][0]);\n questionDescription.setText(questions[currentQuestion-1][1]);\n ans1.setText(questions[currentQuestion-1][2]);\n ans2.setText(questions[currentQuestion-1][3]);\n ans3.setText(questions[currentQuestion-1][4]);\n\n //Save correct answer\n correctAnswer = questions[currentQuestion-1][5];\n\n //Set progress bar and progress text\n progressBar.setProgress(currentQuestion);\n progressText.setText(currentQuestion.toString() + \"/5\");\n\n //Clear selection of buttons if any are already selected\n ans1.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans2.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n ans3.setBackgroundColor(getResources().getColor(R.color.ans_btn));\n }",
"public void setAnswers(java.util.List<java.lang.CharSequence> value) {\n this.Answers = value;\n }",
"private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}",
"public void onYesButtonClicked() {\n changeAfterClientPick();\n }",
"private void setQuestion() {\n Question.setText(gen.getQuestion() + \"\\t\\tProblem # \" + currentQuestion + \"/\" + numQuestions);\n }",
"public void changeComboOption(int numAnswers) {\n\t\tif(numAnswers == 2)\n\t\t\tanswerChoiceList.setSelectedIndex(0);\n\t\telse if(numAnswers == 3)\n\t\t\tanswerChoiceList.setSelectedIndex(1);\n\t\telse if(numAnswers == 4)\n\t\t\tanswerChoiceList.setSelectedIndex(2);\n\t}",
"public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}",
"public void onAssigned(View view) {\n if (checked==1) {\n checked = 0;\n } else {\n checked=1;\n }\n }",
"public void setForua(boolean newValue);",
"public void setAnswerText1(String answerText1) {\r\n\t\tthis.answerText1 = answerText1;\r\n\t}",
"public void q3Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q3option1);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ3) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ3 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }",
"public abstract void editQuestion();",
"public void updateQ4scoreAndGoToNext(View view){\r\n EditText q1Correct;\r\n q1Correct = (EditText) findViewById(R.id.q1Answer);\r\n String inputText = q1Correct.getText().toString();\r\n String rightAnswer = \"TextView\";\r\n\r\n if (inputText.equals(rightAnswer)) {\r\n q1Score = q1Score + 1;\r\n Toast toast = Toast.makeText(this, \"Great Job! 1 point added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n } else {\r\n q1Score = 0;\r\n Toast toast = Toast.makeText(this, \"Better luck next time, 0 points added.\", Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n\r\n Intent i = new Intent(this, Question2Activity.class);\r\n startActivity(i);\r\n }",
"public void setOkToEditQuestion(String string) {\r\n\t\t_okToEditQuestion = string;\r\n\t}",
"public void reset (View view) {\n score = 0;\n name = findViewById(R.id.name_editText);\n name.getText().clear();\n email = findViewById(R.id.email_editText);\n email.getText().clear();\n optionOne = findViewById(R.id.option_one);\n optionOne.clearCheck();\n optionTwo = findViewById(R.id.option_two);\n optionTwo.clearCheck();\n optionThree = findViewById(R.id.option_three);\n optionThree.clearCheck();\n questionFourAns = findViewById(R.id.question_four_ans);\n questionFourAns.setText(\"\");\n questionFiveAns = findViewById(R.id.question_five_ans);\n questionFiveAns.setText(\"\");\n optionSixA = findViewById(R.id.option_six_a);\n optionSixA.setChecked(false);\n optionSixB = findViewById(R.id.option_six_b);\n optionSixB.setChecked(false);\n optionSixC = findViewById(R.id.option_six_c);\n optionSixC.setChecked(false);\n optionSixD = findViewById(R.id.option_six_d);\n optionSixD.setChecked(false);\n optionSixE = findViewById(R.id.option_six_e);\n optionSixE.setChecked(false);\n optionSevenA = findViewById(R.id.option_seven_a);\n optionSevenA.setChecked(false);\n optionSevenB = findViewById(R.id.option_seven_b);\n optionSevenB.setChecked(false);\n optionSevenC = findViewById(R.id.option_seven_c);\n optionSevenC.setChecked(false);\n optionSevenD = findViewById(R.id.option_seven_d);\n optionSevenD.setChecked(false);\n optionSevenE = findViewById(R.id.option_seven_e);\n optionSevenE.setChecked(false);\n optionEightA = findViewById(R.id.option_eight_a);\n optionEightA.setChecked(false);\n optionEightB = findViewById(R.id.option_eight_b);\n optionEightB.setChecked(false);\n optionEightC = findViewById(R.id.option_eight_c);\n optionEightC.setChecked(false);\n optionEightD = findViewById(R.id.option_eight_d);\n optionEightD.setChecked(false);\n optionEightE = findViewById(R.id.option_eight_e);\n optionEightE.setChecked(false);\n optionNineA = findViewById(R.id.option_nine_a);\n optionNineA.setChecked(false);\n optionNineB = findViewById(R.id.option_nine_b);\n optionNineB.setChecked(false);\n optionNineC = findViewById(R.id.option_nine_c);\n optionNineC.setChecked(false);\n optionNineD = findViewById(R.id.option_nine_d);\n optionNineD.setChecked(false);\n optionNineE = findViewById(R.id.option_nine_e);\n optionNineE.setChecked(false);\n optionTenA = findViewById(R.id.option_ten_a);\n optionTenA.setChecked(false);\n optionTenB = findViewById(R.id.option_ten_b);\n optionTenB.setChecked(false);\n optionTenC = findViewById(R.id.option_ten_c);\n optionTenC.setChecked(false);\n optionTenD = findViewById(R.id.option_ten_d);\n optionTenD.setChecked(false);\n optionTenE = findViewById(R.id.option_ten_e);\n optionTenE.setChecked(false);\n mySwitch = findViewById(R.id.switch1);\n mySwitch.setChecked(false);\n mySwitch.setVisibility(View.GONE);\n TextView targetView = name;\n targetView.getParent().requestChildFocus(targetView, targetView);\n }",
"public void checkAnswers(View v) {\n int correct = 0;\n\n //Question 1 answer\n RadioButton a1 = (RadioButton) findViewById(R.id.q1_a2);\n\n if (a1.isChecked()) {\n correct++;\n } else {\n TextView q1 = (TextView) findViewById(R.id.question_1);\n q1.setTextColor(Color.RED);\n }\n\n //Question 2 answer\n RadioButton a2 = (RadioButton) findViewById(R.id.q2_a2);\n\n if (a2.isChecked()) {\n correct++;\n } else {\n TextView q2 = (TextView) findViewById(R.id.question_2);\n q2.setTextColor(Color.RED);\n }\n\n //Question 3\n CheckBox a3_1 = (CheckBox) findViewById(R.id.q3_a1);\n CheckBox a3_2 = (CheckBox) findViewById(R.id.q3_a2);\n CheckBox a3_3 = (CheckBox) findViewById(R.id.q3_a3);\n\n if (a3_1.isChecked() && a3_2.isChecked() && a3_3.isChecked()) {\n correct++;\n } else {\n TextView q3 = (TextView) findViewById(R.id.question_3);\n q3.setTextColor(Color.RED);\n }\n\n //Question 4\n EditText a4 = (EditText) findViewById(R.id.q4_a);\n\n if (a4.getText().toString().equalsIgnoreCase(getResources().getString(R.string.q4_a))) {\n correct++;\n } else {\n TextView q4 = (TextView) findViewById(R.id.question_4);\n q4.setTextColor(Color.RED);\n }\n\n //Question 5\n RadioButton a5 = (RadioButton) findViewById(R.id.q5_a3);\n\n if (a5.isChecked()) {\n correct++;\n } else {\n TextView q5 = (TextView) findViewById(R.id.question_5);\n q5.setTextColor(Color.RED);\n }\n\n //Question 6\n RadioButton a6 = (RadioButton) findViewById(R.id.q6_a1);\n\n if (a6.isChecked()) {\n correct++;\n } else {\n TextView q6 = (TextView) findViewById(R.id.question_6);\n q6.setTextColor(Color.RED);\n }\n\n //Question 7\n EditText a7 = (EditText) findViewById(R.id.q7_a);\n\n if (a7.getText().toString().equalsIgnoreCase(getResources().getString(R.string.q7_a))) {\n correct++;\n } else {\n TextView q7 = (TextView) findViewById(R.id.question_7);\n q7.setTextColor(Color.RED);\n }\n\n //Question 8\n RadioButton a8 = (RadioButton) findViewById(R.id.q8_a1);\n\n if (a8.isChecked()) {\n correct++;\n } else {\n TextView q8 = (TextView) findViewById(R.id.question_8);\n q8.setTextColor(Color.RED);\n }\n\n //Toast\n Context context = getApplicationContext();\n CharSequence text = \"Score: \" + correct + \"/8\";\n int duration = Toast.LENGTH_SHORT;\n Toast.makeText(context, text, duration).show();\n }",
"private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }",
"private boolean checkAnswered(){\n int checkedRadioButtonId = Question.getCheckedRadioButtonId();\n\n // If no option selected, the question hasn't been answered\n if (checkedRadioButtonId == -1) {\n return false;\n }\n // If an option is selected, the question as been answered\n else{\n return true;\n }\n }",
"private void validateQuestion(){\n int checkedRadioButtonId = Question.getCheckedRadioButtonId();\n\n // If the correct question has been chosen, update the score & display a toast message\n if (checkedRadioButtonId == R.id.radio4_question1) {\n score = score + 2;\n }\n }",
"private void ans1Option() {\n RadioButton radioButtonA = (RadioButton) findViewById(R.id.radio_button_A);\n RadioButton radioButtonB = (RadioButton) findViewById(R.id.radio_button_B);\n RadioButton radioButtonC = (RadioButton) findViewById(R.id.radio_Button_C);\n RadioButton radioButtonD = (RadioButton) findViewById(R.id.radio_Button_D);\n radioButtonA.setText(R.string.que1Opt1);\n radioButtonB.setText(R.string.que1Opt2);\n radioButtonC.setText(R.string.que1Opt3);\n radioButtonD.setText(R.string.que1Opt4);\n }",
"public void setSecurity_question(String security_question);",
"Boolean getIsAnswered();",
"public void updateSurvey(String question, int yes, int no) {\n ContentValues updateCounts = new ContentValues();\n updateCounts.put(OPT1_COUNT_COL, yes);\n updateCounts.put(OPT2_COUNT_COL, no);\n String[] whereArgs = {question};\n String where = QUESTION_COL + \" = ?\";\n\n int rowsChanged = db.update(DB_TABLE, updateCounts, where, whereArgs);\n }"
]
| [
"0.6546547",
"0.6471377",
"0.63503706",
"0.62928164",
"0.6269685",
"0.622596",
"0.62109387",
"0.6193082",
"0.6074805",
"0.594266",
"0.59393644",
"0.5938447",
"0.59237117",
"0.59050906",
"0.5833158",
"0.5781875",
"0.577347",
"0.5738085",
"0.57355726",
"0.57351816",
"0.5716302",
"0.5711783",
"0.56887937",
"0.56881934",
"0.56742764",
"0.5665714",
"0.56573033",
"0.5656847",
"0.56495434",
"0.56331897",
"0.5609728",
"0.55886626",
"0.558013",
"0.5570071",
"0.5566977",
"0.5542475",
"0.55371314",
"0.552576",
"0.548957",
"0.54856884",
"0.54493684",
"0.54448473",
"0.54437846",
"0.5436252",
"0.5421056",
"0.5410123",
"0.5387877",
"0.5380519",
"0.53796214",
"0.5376493",
"0.5373575",
"0.53679353",
"0.5359658",
"0.5355961",
"0.53535545",
"0.53400517",
"0.5336945",
"0.53319705",
"0.53277445",
"0.53214073",
"0.53031474",
"0.5287506",
"0.52690953",
"0.52670634",
"0.52593756",
"0.52589834",
"0.5250561",
"0.5249782",
"0.5248485",
"0.5237939",
"0.5232021",
"0.5219177",
"0.52167636",
"0.52068245",
"0.5198872",
"0.5196336",
"0.51949775",
"0.51948875",
"0.51940864",
"0.5180162",
"0.51787263",
"0.5176405",
"0.5174458",
"0.5173594",
"0.51733565",
"0.51712304",
"0.51711965",
"0.5170069",
"0.5168771",
"0.51644886",
"0.51614773",
"0.51610196",
"0.5157861",
"0.5153475",
"0.5147647",
"0.5147614",
"0.51449555",
"0.5137957",
"0.5137302",
"0.5135369"
]
| 0.610296 | 8 |
this class managers all other iconRenderers | public IconRenderer()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void registerRenderers() {\n\n\t}",
"private void initBaseIcons() {\n iconMonitor = new ImageIcon( getClass().getResource(\"/system.png\") );\n iconBattery = new ImageIcon( getClass().getResource(\"/klaptopdaemon.png\") );\n iconSearch = new ImageIcon( getClass().getResource(\"/xmag.png\") );\n iconJava = new ImageIcon( getClass().getResource(\"/java-icon.png\") );\n iconPrinter = new ImageIcon( getClass().getResource(\"/printer.png\") );\n iconRun = new ImageIcon( getClass().getResource(\"/run.png\") );\n }",
"public void registerIcons(IIconRegister iconRegister) {\n/* 51 */ this.itemIcon = iconRegister.registerIcon(\"forgottenrelics:Soul_Tome\");\n/* */ }",
"public RendererArbol() {\n setLeafIcon(new ImageIcon(\"src/vista/images/icons8_JSON_15px_2.png\"));\n setOpenIcon(new ImageIcon(\"src/vista/images/icons8_Open_18px.png\"));\n setClosedIcon(new ImageIcon(\"src/vista/images/icons8_Folder_18px.png\"));\n }",
"private void setIcons(){\n\t\tfinal List<BufferedImage> icons = new ArrayList<BufferedImage>();\n\t\ttry {\n\t\t\ticons.add(ImageLoader.getBufferedImage(SMALL_ICON_PATH));\n\t\t\ticons.add(ImageLoader.getBufferedImage(BIG_ICON_PATH));\n\t\t} catch (IOException e) {\n\t\t\tmanager.handleException(e);\n\t\t}\n\t\tif(icons.size() > 0)\n\t\t\tsetIconImages(icons);\n\t}",
"private void initIcons() {\n \n \n addIcon(lblFondoRest, \"src/main/java/resource/fondo.png\");\n addIcon(lblCheckRest, \"src/main/java/resource/check.png\");\n \n }",
"public void registerRenderer() {}",
"public void registerRenderer() {}",
"@SideOnly(Side.CLIENT)\n/* 31: */ public void registerIcons(IIconRegister iconRegister) {}",
"private void updateBaseIcon() {\n this.squareIcon.setDecoratedIcon( getSelectedBaseIcon() );\n this.radialIcon.setDecoratedIcon( getSelectedBaseIcon() );\n }",
"public void replaceIcons(){\n int nb = this.listGraphFrame.size();\n int x = 0;\n int y = this.getHeight()-DataProcessToolPanel.ICON_HEIGHT;\n for (int i=0; i<nb; i++){\n InternalGraphFrame gFrame = listGraphFrame.get(i);\n if(gFrame.isIcon() && gFrame.getDesktopIcon() != null){\n JInternalFrame.JDesktopIcon icon = gFrame.getDesktopIcon();\n icon.setBounds(x, y, icon.getWidth(), icon.getHeight());\n if(x+(2*DataProcessToolPanel.ICON_WIDTH) < getWidth()){\n x += DataProcessToolPanel.ICON_WIDTH;\n }else{\n x = 0;\n y = y-DataProcessToolPanel.ICON_HEIGHT;\n }\n }\n }\n }",
"public MyRenderer( Icon[] icon ) {\n treeIcon = icon;\n }",
"private void setIcons() {\n ImageIcon imgProd = new ImageIcon(\"Images/articulos.png\");\n btArticulosReportes.setIcon(imgProd);\n ImageIcon imgTickets = new ImageIcon(\"Images/ticket.png\");\n btTicketsReportes.setIcon(imgTickets);\n ImageIcon imgVentas = new ImageIcon(\"Images/venta.png\");\n btVentasReportes.setIcon(imgVentas);\n ImageIcon imgClientes = new ImageIcon(\"Images/cliente.png\");\n btClientesReportes.setIcon(imgClientes);\n ImageIcon imgProveedores = new ImageIcon(\"Images/proveedor.png\");\n btProveedorReportes.setIcon(imgProveedores);\n ImageIcon imgEmpleados = new ImageIcon(\"Images/empleado.png\");\n btEmpleadosReportes.setIcon(imgEmpleados);\n ImageIcon imgCategorias = new ImageIcon(\"Images/categoria.png\");\n btCategoriaReportes.setIcon(imgCategorias);\n ImageIcon imgPedidos = new ImageIcon(\"Images/pedido.png\");\n btPedidosReportes.setIcon(imgPedidos);\n \n }",
"public AlternateImageRenderer() {\r\n super(\"\");\r\n images = new Image[2];\r\n try {\r\n Resources imageRes = UIDemoMain.getResource(\"images\");\r\n images[0] = imageRes.getImage(\"sady.png\");\r\n images[1] = imageRes.getImage(\"smily.png\");\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n setUIID(\"ListRenderer\");\r\n }",
"private void initBusyIcons() {\n /** \"JBusyComponent\" tabs\n * Since theses icons are used inside a {@link JBusyComponent}, they don't need to bound explicitely it's model.\n * The JBusyComponent will bounds it's own BusyModel when it need\n */\n this.printingAdvancedIcon = new RadialBusyIcon( this.iconPrinter );\n this.printingBasicIcon = new InfiniteBusyIcon();\n\n /** \"BusyIcon\" tabs\n */\n this.squareIcon = new DefaultBusyIcon( getSelectedBaseIcon() );\n this.radialIcon = new RadialBusyIcon( getSelectedBaseIcon() );\n this.squareIcon.setModel( this.modelIcon );\n this.radialIcon.setModel( this.modelIcon );\n\n /** \"Hub\" tabs\n */\n this.iconHub = new RadialBusyIcon( iconJava );\n this.iconHub.setModel( this.modelHub );\n }",
"@Override\r\n\tpublic IconsApi getIconsApi() {\r\n\t\treturn this;\r\n\t}",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"radarlogoIcon.png\")));\n }",
"@Override\n public boolean isIcon(){\n return super.isIcon() || speciallyIconified;\n }",
"public void iconSetup(){\r\n chessboard.addRedIcon(\"Assets/PlusR.png\");\r\n chessboard.addRedIcon(\"Assets/TriangleR.png\");\r\n chessboard.addRedIcon(\"Assets/ChevronR.png\");\r\n chessboard.addRedIcon(\"Assets/SunR.png\"); \r\n chessboard.addRedIcon(\"Assets/ArrowR.png\");\r\n \r\n chessboard.addBlueIcon(\"Assets/PlusB.png\");\r\n chessboard.addBlueIcon(\"Assets/TriangleB.png\");\r\n chessboard.addBlueIcon(\"Assets/ChevronB.png\");\r\n chessboard.addBlueIcon(\"Assets/SunB.png\");\r\n chessboard.addBlueIcon(\"Assets/ArrowB.png\");\r\n }",
"public interface PluginIcons {\n\n Icon playFirst = IconLoader.getIcon(\"/icons/play_first.svg\", PluginIcons.class);\n Icon playPrevious = IconLoader.getIcon(\"/icons/play_back.svg\", PluginIcons.class);\n Icon play = IconLoader.getIcon(\"/icons/toolWindowRun.svg\", PluginIcons.class);\n Icon pause = IconLoader.getIcon(\"/icons/pause.svg\", PluginIcons.class);\n Icon playNext = IconLoader.getIcon(\"/icons/play_forward.svg\", PluginIcons.class);\n Icon playLast = IconLoader.getIcon(\"/icons/play_last.svg\", PluginIcons.class);\n Icon volume = IconLoader.getIcon(\"/icons/volume_up.svg\", PluginIcons.class);\n Icon volumeOff = IconLoader.getIcon(\"/icons/volume_off.svg\", PluginIcons.class);\n Icon autoPlayOff = IconLoader.getIcon(\"/icons/infinity.svg\", PluginIcons.class);\n Icon autoPlayOn = IconLoader.getIcon(\"/icons/infinity_on.svg\", PluginIcons.class);\n Icon showCodeOff = IconLoader.getIcon(\"/icons/showCode.svg\", PluginIcons.class);\n Icon showCodeOn = IconLoader.getIcon(\"/icons/showCode_on.svg\", PluginIcons.class);\n Icon jumpToCode = IconLoader.getIcon(\"/icons/stepOutCodeBlock.svg\", PluginIcons.class);\n Icon playCodecast = IconLoader.getIcon(\"/icons/play_codecast.svg\", PluginIcons.class);\n Icon refresh = IconLoader.getIcon(\"/icons/refresh.svg\", PluginIcons.class);\n}",
"@Override\n @SideOnly(Side.CLIENT)\n public void registerIcons(final IconRegister register) {\n itemIcon = register.registerIcon(TextureHelper.getTextureFromName(this.getUnlocalizedName(), Locations.TEXTURE + \"tools/\"));\n }",
"public interface IconManager {\n\n\t/**\n\t * Fetch an icon\n\t * \n\t * @param id\n\t * Icon id\n\t * @param size\n\t * Required icon size\n\t * @return Icon\n\t */\n\tIcon getIcon(String id, IconSize size);\n\n\t/**\n\t * Returns the URL to an icon.\n\t * \n\t * @param id\n\t * Icon id\n\t * @param size\n\t * Required icon size\n\t * @return URL to the icon\n\t */\n\tURL getIconURL(String iconId, IconSize medium);\n\n}",
"@Override\r\n\t\tpublic void requestIcon(String arg0) {\n\t\t\t\r\n\t\t}",
"private void setIcon() {\n \n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"iconabc.png\")));\n }",
"@SideOnly(Side.CLIENT)\r\n/* 55: */ public void registerBlockIcons(IIconRegister par1IIconRegister)\r\n/* 56: */ {\r\n/* 57: 55 */ nodeBase = par1IIconRegister.registerIcon(\"extrautils:extractor_base\");\r\n/* 58: 56 */ nodeSideEnergy = par1IIconRegister.registerIcon(\"extrautils:extractor_energy\");\r\n/* 59: 57 */ nodeSideEnergyHyper = par1IIconRegister.registerIcon(\"extrautils:extractor_energy_hyper\");\r\n/* 60: 58 */ nodeSideLiquid = par1IIconRegister.registerIcon(\"extrautils:extractor_liquid\");\r\n/* 61: 59 */ nodeSideExtract = par1IIconRegister.registerIcon(\"extrautils:extractor_extract\");\r\n/* 62: 60 */ particle = par1IIconRegister.registerIcon(\"extrautils:particle\");\r\n/* 63: 61 */ super.registerBlockIcons(par1IIconRegister);\r\n/* 64: */ }",
"private void setIcons() {\r\n \t\r\n \tbackground = new ImageIcon(\"images/image_mainmenu.png\").getImage();\r\n \tstart = new ImageIcon(\"images/button_start.png\");\r\n \thowto = new ImageIcon(\"images/button_howtoplay.png\");\r\n \toptions = new ImageIcon(\"images/button_options.png\");\r\n \tlboards = new ImageIcon(\"images/button_lboards.png\");\r\n \texit = new ImageIcon(\"images/button_exit.png\");\t\r\n }",
"public void registerIcons(IconRegister register)\n {\n this.blockIcon = register.registerIcon(\"decoBlockMud\");\n }",
"@Override\n\tpublic void setIcon(int resId) {\n\t\t\n\t}",
"private void setICon() {\r\n \r\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"IconImage_1.png\")));\r\n }",
"protected MancalaBoardRenderer(){\n pieceRenderer_ = MancalaBinRenderer.getRenderer();\n }",
"@Override\n public void registerIcons(IIconRegister iconRegister) {\n faceIcons = new IIcon[6];\n int i;\n for (i=0; i < faceIcons.length; ++i) {\n faceIcons[i] = iconRegister.registerIcon(TestItemRenderingMod.MODID+\":NumberedFace\"+i);\n }\n\n this.itemIcon = faceIcons[3]; // make the default icon (2D) equal the \"3\" face\n }",
"public void setMainIcon(IconReference ref);",
"private void createIcons() {\n wRook = new ImageIcon(\"./src/Project3/wRook.png\");\r\n wBishop = new ImageIcon(\"./src/Project3/wBishop.png\");\r\n wQueen = new ImageIcon(\"./src/Project3/wQueen.png\");\r\n wKing = new ImageIcon(\"./src/Project3/wKing.png\");\r\n wPawn = new ImageIcon(\"./src/Project3/wPawn.png\");\r\n wKnight = new ImageIcon(\"./src/Project3/wKnight.png\");\r\n\r\n bRook = new ImageIcon(\"./src/Project3/bRook.png\");\r\n bBishop = new ImageIcon(\"./src/Project3/bBishop.png\");\r\n bQueen = new ImageIcon(\"./src/Project3/bQueen.png\");\r\n bKing = new ImageIcon(\"./src/Project3/bKing.png\");\r\n bPawn = new ImageIcon(\"./src/Project3/bPawn.png\");\r\n bKnight = new ImageIcon(\"./src/Project3/bKnight.png\");\r\n }",
"public void registerIcons(IconRegister par1IconRegister) {\n\t\tthis.blockIcon = par1IconRegister.registerIcon(\"melon_side\");\n\t\tthis.theIcon = par1IconRegister.registerIcon(\"melon_top\");\n\t}",
"public void initIcons(){\n\t \troot_iconsFileNames = new ArrayList<String>();\n\t root_iconsBitmaps = new ArrayList<Bitmap>(); \n \t\ttry{\n \t\t\tResources res = this.getResources();\n \t\t\tInputStream iconInputStream = res.openRawResource(R.raw.icons);\n \t\t\tZipInputStream zipStream = new ZipInputStream(iconInputStream);\n \t\t ZipEntry entry;\n\n \t\t while ((entry = zipStream.getNextEntry()) != null) {\n \t\t \t//file name may start with MACOSX. This is strange, ignore it.\n \t\t \tString fileName = entry.getName();\n \t\t \tif(fileName.length() > 1){\n\t \t\t \tif(fileName.contains(\".png\") && !entry.isDirectory()){\n\t \t\t \t\tif(!fileName.contains(\"MACOSX\")){ //OSX adds junk sometimes, ignore it\n\t \t\t \t\t\tfileName = fileName.replace(\"icons/\",\"\");\n\t \t\t \t\t\tBitmap iconBitmap = BitmapFactory.decodeStream(zipStream); \n\t \t\t \t\t\troot_iconsFileNames.add(fileName);\n\t \t\t \t\t\troot_iconsBitmaps.add(iconBitmap);\n\t \t\t \t\t\t//Log.i(\"ZZ\", \"loading bitmaps: \" + fileName); \n\t \t\t \t\t}\n\t \t\t \t} //macosx\n\t \t\t } // fileName\n \t\t }//end while\n \t\t \n \t\t //clean up\n \t\t if(zipStream != null){\n \t\t \tzipStream.close();\n \t\t }\n \t\t \n \t\t}catch(Exception ex){\n \t\t\t Log.i(\"ZZ\", \"getZippedIcon: \" + ex.toString()); \n \t\t}\t \n\t }",
"public abstract String typeIcon();",
"@SideOnly(Side.CLIENT)\n\t@Override\n\tpublic void registerIcons(IIconRegister par1IconRegister)\n\t{\n\t\tthis.Icon = par1IconRegister.registerIcon(\"quiverchevsky:weapons/RPG\");\n\t\tthis.Icon_Empty = par1IconRegister.registerIcon(\"quiverchevsky:weapons/RPG_Empty\");\n\t}",
"private void setIconsMenus() {\n ImageIcon iconNew = new javax.swing.ImageIcon(getClass().getResource(\"/image/novo.png\"));\n ImageIcon iconSearch = new javax.swing.ImageIcon(getClass().getResource(\"/image/procurar.19px.png\"));\n\n JMenuItem[] miNew = new JMenuItem[]{miModuloNovo, miIrradiacaoGlobalMesNovo, miInversorNovo,\n miProjetoNovo, miUsuarioNovo, miNovoCliente, miFornecedorNovo, miEPNovo};\n for (JMenuItem mi : miNew) {\n mi.setIcon(iconNew);\n mi.setMnemonic(KeyEvent.VK_N);\n }\n\n JMenuItem[] miSearch = new JMenuItem[]{miModuloPesquisar, miIrradiacaoGlobalMesPesquisar, miInversorPesquisar,\n miProjetoPesquisar, miUsuarioPesquisar, miPesquisarCliente, miFornecedorPesquisar, miEPPesquisar};\n for (JMenuItem mi : miSearch) {\n mi.setIcon(iconSearch);\n mi.setMnemonic(KeyEvent.VK_P);\n }\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"/Icons/logo musica.png\")));\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"icon.png\")));\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"podologia32x32.png\")));\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"../Imagens/icon.png\")));\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"iconeframe.png\")));\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"iconeframe.png\")));\n }",
"public void setupIcons() {\n try {\n tabLayout.getTabAt(0).setCustomView(getTabView(R.string.ic_user_black_bg, 0));\n tabLayout.getTabAt(1).setCustomView(getTabView(R.string.ic_hot_or_burn, 1));\n tabLayout.getTabAt(2).setCustomView(getTabView(R.string.ic_chat_1, 0));\n\n viewPager.addOnPageChangeListener(this);\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"img/icon.png\")));\n }",
"public void registerRenders() {\n }",
"public void lightIcons() {\n teamPhoto.setImage((new Image(\"/Resources/Images/emptyTeamLogo.png\")));\n copyIcon.setImage((new Image(\"/Resources/Images/black/copy_black.png\")));\n helpPaneIcon.setImage((new Image(\"/Resources/Images/black/help_black.png\")));\n if (user.getUser().getProfilePhoto() == null) {\n accountPhoto.setImage((new Image(\"/Resources/Images/black/big_profile_black.png\")));\n }\n }",
"private void setIcon(){\r\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"images.png\")));\r\n }",
"public Sniffer() { \n initComponents(); \n setLocationRelativeTo(getRootPane());\n setIconImage(Toolkit.getDefaultToolkit().getImage(MainFrame.class.getResource(\"/views/images/sam_icon.png\")));\n }",
"private void loadAndSetIcon()\n\t{\t\t\n\t\ttry\n\t\t{\n\t\t\twindowIcon = ImageIO.read (getClass().getResource (\"calculator.png\"));\n\t\t\tsetIconImage(windowIcon);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\t\t\n\t}",
"public void renderManager()\n {\n switch(activeManager)\n {\n case 0: \n ti.renderTileManager();\n break;\n case 1:\n in.renderInputImageManager();\n break;\n case 2:\n ou.renderOutputImageManager();\n break;\n case 3:\n ab.renderAboutManager();\n break;\n }\n }",
"private void SetIcon() {\n \n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"appIcon.png\")));\n }",
"private void createUIComponents() {\n Fond = new JLabel(new ImageIcon(\"maxresdefault.jpg\"));\r\n Fond.setIcon(new ImageIcon(\"maxresdefault.jpg\"));\r\n }",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"croissant.png\")));\n }",
"public void registerTileEntitySpecialRenderer()\n {\n }",
"protected TreeIconHandler createDefaultIconHandler()\n {\n return DEF_ICON_HANDLER;\n }",
"@Override\n public void onPackageIconChanged() {\n }",
"public void disposeResources() {\n Arrays.fill(icons, null);\n iconComponent.removeAncestorListener(this);\n }",
"@Override\n\tpublic void registerItemRenderer(Item item, int meta, String id) {\n\t}",
"void setIcon(){\n URL pathIcon = getClass().getResource(\"/sigepsa/icono.png\");\n Toolkit kit = Toolkit.getDefaultToolkit();\n Image img = kit.createImage(pathIcon);\n setIconImage(img);\n }",
"@Override\n public void setRenderer(Object arg0)\n {\n \n }",
"Icon createIcon();",
"private void setIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"MainLogo.png\")));\n }",
"private void setIcon() {\n this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"logo.ico\")));\n }",
"@Override\n\tpublic List<Icon> getAllIcon() {\n\t\treturn this.menuDao.getAllIcon();\n\t}",
"public void clearMainIcon();",
"@Override\n public void setIconURI(String arg0)\n {\n \n }",
"private void initButtonIcons() {\n\t\t\n\t\tbuttons[0][0].setIcon(Icon.returnIcon(\"white_rook\"));\n\t\tbuttons[1][0].setIcon(Icon.returnIcon(\"white_knight\"));\n\t\tbuttons[2][0].setIcon(Icon.returnIcon(\"white_bishop\"));\n\t\tbuttons[3][0].setIcon(Icon.returnIcon(\"white_queen\"));\n\t\tbuttons[4][0].setIcon(Icon.returnIcon(\"white_king\"));\n\t\tbuttons[5][0].setIcon(Icon.returnIcon(\"white_bishop\"));\n\t\tbuttons[6][0].setIcon(Icon.returnIcon(\"white_knight\"));\n\t\tbuttons[7][0].setIcon(Icon.returnIcon(\"white_rook\"));\n\t\t\n\t\tfor (int x = 0; x <= 7; x++)\n\t\t\tfor (int y = 2; y < 6; y++)\n\t\t\t\tbuttons[x][y].setIcon(null);\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tbuttons[i][1].setIcon(Icon.returnIcon(\"white_pawn\"));\n\t\t\tbuttons[i][6].setIcon(Icon.returnIcon(\"black_pawn\"));\n\t\t}\n\t\t\n\t\tbuttons[0][7].setIcon(Icon.returnIcon(\"black_rook\"));\n\t\tbuttons[1][7].setIcon(Icon.returnIcon(\"black_knight\"));\n\t\tbuttons[2][7].setIcon(Icon.returnIcon(\"black_bishop\"));\n\t\tbuttons[3][7].setIcon(Icon.returnIcon(\"black_queen\"));\n\t\tbuttons[4][7].setIcon(Icon.returnIcon(\"black_king\"));\n\t\tbuttons[5][7].setIcon(Icon.returnIcon(\"black_bishop\"));\n\t\tbuttons[6][7].setIcon(Icon.returnIcon(\"black_knight\"));\n\t\tbuttons[7][7].setIcon(Icon.returnIcon(\"black_rook\"));\n\t}",
"private static IconResource initIconResource() {\n\t\tIconResource iconResource = new IconResource(Configuration.SUPERVISOR_LOGGER);\n\t\t\n\t\ticonResource.addResource(IconTypeAWMS.HOME.name(), iconPath + \"home.png\");\n\t\ticonResource.addResource(IconTypeAWMS.INPUT_ORDER.name(), iconPath + \"input-order.png\");\n\t\ticonResource.addResource(IconTypeAWMS.OUTPUT_ORDER.name(), iconPath + \"output-order.png\");\n\t\ticonResource.addResource(IconTypeAWMS.PLUS.name(), iconPath + \"plus.png\");\n\t\ticonResource.addResource(IconTypeAWMS.MINUS.name(), iconPath + \"minus.png\");\n\t\ticonResource.addResource(IconTypeAWMS.EDIT.name(), iconPath + \"edit.png\");\n\t\ticonResource.addResource(IconTypeAWMS.CONFIRM.name(), iconPath + \"confirm.png\");\n\t\ticonResource.addResource(IconTypeAWMS.CANCEL.name(), iconPath + \"cancel.png\");\n\t\ticonResource.addResource(IconTypeAWMS.USER.name(), iconPath + \"user.png\");\n\t\t\n\t\treturn iconResource;\n\t}",
"public Component getTreeCellRendererComponent(\n JTree tree, //stablo koje se prikazuje\n Object value, //stavka koja se iscrtava \n boolean sel, //da li je stavka selektovana\n boolean expanded,\n boolean leaf, //da li je list\n int row,\n boolean hasFocus) {\n super.getTreeCellRendererComponent(tree, value, sel,expanded, leaf, row,hasFocus);\n \n \n if (value instanceof Entity ) {\n URL imageURL = getClass().getResource(\"gui_icons/table1.png\");\n Icon icon = null;\n if (imageURL != null) \n icon = new ImageIcon(imageURL);\n setIcon(icon);\n \n } else if (value instanceof InformationResource ) {\n \t URL imageURL=getClass().getResource(\"gui_icons/file.jpg\");\n Icon icon = null;\n if (imageURL != null) \n icon = new ImageIcon(imageURL);\n setIcon(icon);\n \n } else if (value instanceof Attribute ) {\n \t URL imageURL=getClass().getResource(\"gui_icons/attribute.png\");\n Icon icon = null;\n if (imageURL != null) \n icon = new ImageIcon(imageURL);\n setIcon(icon);\n \n } else if (value instanceof AttributeConstraint) {\n \tAttributeConstraint ac = (AttributeConstraint) value;\n \t URL imageURL=null;\n \t if (ac.getConstraintType() == ConstraintType.PRIMARY_KEY) imageURL=getClass().getResource(\"gui_icons/primary.png\");\n \t else if(ac.getConstraintType() == ConstraintType.FOREIGN_KEY) imageURL=getClass().getResource(\"gui_icons/imported.jpg\");\n \t else if(ac.getConstraintType() == ConstraintType.NOT_NULL) imageURL=getClass().getResource(\"gui_icons/notnull.png\");\n Icon icon = null;\n if (imageURL != null) \n icon = new ImageIcon(imageURL);\n setIcon(icon);\n \n } \n return this;\n}",
"private void reloadIconBaseDirs() {\n\t\t\n\t\t// Load dirs from XDG_DATA_DIRS\n\t\tString xdg_dir_env = System.getenv(\"XDG_DATA_DIRS\");\n\t\tif(xdg_dir_env != null && !xdg_dir_env.isEmpty()) {\n\t\t\tString[] xdg_dirs = xdg_dir_env.split(\":\");\n\t\t\tfor(String xdg_dir : xdg_dirs) {\n\t\t\t\taddDirToList(new File(xdg_dir, \"icons\"), iconBaseDirs);\n\t\t\t\taddDirToList(new File(xdg_dir, \"pixmaps\"), iconBaseDirs);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Load user's icon dir\n\t\taddDirToList(new File(System.getProperty(\"user.home\"), \".icons\"), iconBaseDirs);\n\t\taddDirToList(new File(System.getProperty(\"user.home\"), \".local/share/icons\"), iconBaseDirs);\n\t\t\n\t}",
"private DuakIcons()\r\n {\r\n }",
"public void updateBuffIcons() {\n controller.getUIController().clearActiveEffectsGrid();\n for (int i = 0; i < map.getCurrentTurnHero().getHeroBuffs().size(); i++) {\n controller.getUIController().addActiveEffectIcon((AbstractBuff) map.getCurrentTurnHero().getHeroBuffs().get(i), i);\n }\n }",
"public void cargarIconoX() {\r\n\t\tClassLoader cl = getClass().getClassLoader();\r\n\t\tURL url = cl.getResource(RUTA_ICONO_CERRAR);\r\n\t\tImageIcon imageIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(url));\r\n\t\tlblEmoticon.setIcon(imageIcon);\r\n\t}",
"public ImageIcon getHandlerImageIcon();",
"public static void registerRenders() {\n for(Block block : modBlocks)\n BlockHelper.registerRender(block);\n }",
"@Override\n public Image getIconImage() {\n Image retValue = Toolkit.getDefaultToolkit().\n getImage(ClassLoader.getSystemResource(\"Imagenes/Icono.png\"));\n return retValue;\n}",
"IconUris iconUris();",
"private void iconImage() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"icon.jpg\")));\n }",
"Icon getPlotterIcon();",
"public void setIcon(Image i) {icon = i;}",
"public void registerIcons(IconRegister var1)\n {\n this.blockIcon = var1.registerIcon(\"Aether:Aether Portal\");\n }",
"public static Collection<TreeRendererDescriptor> registeredRenderers() {\n return Collections.unmodifiableCollection(REGISTRY.values());\n }",
"public void registerRenderInformation() {\n\t}",
"private void SetIcon() {\n setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource(\"Icon.png.png\")));\n }",
"public void registerIcons(IconRegister var1)\n {\n for (int var2 = 0; var2 < m_sBaseTextureNames.length; ++var2)\n {\n for (int var3 = 0; var3 < 4; ++var3)\n {\n this.m_IconArray[var2][var3] = var1.registerIcon(m_sBaseTextureNames[var2] + var3);\n }\n }\n }",
"public List<Image> getIcons() {\n\t\tImageIcon icon64 = new ImageIcon(getClass().getResource(\"/resources/frame_icon64.png\"));\n\t\tImageIcon icon128 = new ImageIcon(getClass().getResource(\"/resources/frame_icon128.png\"));\n\t\t\n\t\tList<Image> icons = new ArrayList<Image>();\n\t\ticons.add(icon64.getImage());\n\t\ticons.add(icon128.getImage());\n\t\t\n\t\treturn icons;\n\t}",
"public String getIconHandler()\n {\n return iconHandler;\n }",
"public EiconPanel() {\n initComponents();\n }",
"private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}",
"public static interface IconComponent {\n void setIcon(Icon i);\n\n void addAncestorListener(AncestorListener l);\n\n void removeAncestorListener(AncestorListener l);\n }",
"protected Image loadIcon() {\n /*\n * Icon by http://www.artua.com/, retrieved here:\n * http://www.iconarchive.com/show/star-wars-icons-by-artua.html\n */\n return new ImageLoader().loadIcon(\"moon.png\");\n }",
"@Override\n\tpublic void setIcon(Drawable icon) {\n\t\t\n\t}",
"public PanelIconos() {\n initComponents();\n }",
"public void GenerateIcons() {\n icons = new ImageIcon[8];\n icons[0] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[1] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[2] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[3] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[4] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[5] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[6] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n icons[7] = new ImageIcon(new BufferedImage(28, 32, BufferedImage.TYPE_4BYTE_ABGR));\n Graphics g;\n Graphics2D g2;\n Color transparent = new Color(0, 0, 0, 0);\n\n // 0 = up, left leg up\n try {\n g = icons[0].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 20, 4);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(4, 10, 20, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(0, 12, 4, 8);\n g.fillRect(24, 12, 4, 6);\n g.fillRect(4, 22, 8, 8);\n g.fillRect(16, 20, 8, 12);\n g.setColor(Color.black);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 26, 8, 2);\n g.fillRect(16, 28, 8, 2);\n\n // 1 = up, right leg up\n try {\n g = icons[1].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 20, 4);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(4, 10, 20, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(0, 12, 4, 6);\n g.fillRect(24, 12, 4, 8);\n g.fillRect(4, 20, 8, 12);\n g.fillRect(16, 22, 8, 8);\n g.setColor(Color.black);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 28, 8, 2);\n g.fillRect(16, 26, 8, 2);\n\n // 2 = down, left(side) leg up\n try {\n g = icons[2].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 20, 4);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(4, 10, 20, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(0, 12, 4, 8);\n g.fillRect(24, 12, 4, 6);\n g.fillRect(4, 22, 8, 8);\n g.fillRect(16, 20, 8, 12);\n g.setColor(Color.black);\n g.fillRect(8, 2, 4, 2);\n g.fillRect(16, 2, 4, 2);\n g.fillRect(12, 4, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 26, 8, 2);\n g.fillRect(16, 28, 8, 2);\n\n // 3 = down, right(side) leg up\n try {\n g = icons[3].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 20, 4);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(4, 10, 20, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(0, 12, 4, 6);\n g.fillRect(24, 12, 4, 8);\n g.fillRect(4, 20, 8, 12);\n g.fillRect(16, 22, 8, 8);\n g.setColor(Color.black);\n g.fillRect(8, 2, 4, 2);\n g.fillRect(16, 2, 4, 2);\n g.fillRect(12, 4, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 28, 8, 2);\n g.fillRect(16, 26, 8, 2);\n\n // 4 = left, Stand\n try {\n g = icons[4].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(20, 2, 4, 4);\n g.fillRect(4, 4, 4, 2);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(12, 10, 8, 18);\n g.fillRect(8, 12, 4, 12);\n g.fillRect(8, 30, 12, 2);\n g.setColor(Color.black);\n g.fillRect(12, 2, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(12, 28, 8, 2);\n\n // 5 = left, walk\n try {\n g = icons[5].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(20, 2, 4, 4);\n g.fillRect(4, 4, 4, 2);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(4, 12, 20, 4);\n g.fillRect(0, 14, 4, 4);\n g.fillRect(24, 14, 4, 6);\n g.fillRect(4, 24, 8, 8);\n g.fillRect(16, 22, 8, 10);\n g.fillRect(0, 30, 4, 2);\n g.setColor(Color.black);\n g.fillRect(12, 2, 4, 2);\n g.fillRect(16, 14, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 28, 8, 2);\n g.fillRect(16, 28, 8, 2);\n\n // 6 = right, Stand\n try {\n g = icons[6].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 4, 4);\n g.fillRect(20, 4, 4, 2);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(8, 10, 8, 18);\n g.fillRect(16, 12, 4, 12);\n g.fillRect(8, 30, 12, 2);\n g.setColor(Color.black);\n g.fillRect(12, 2, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(8, 28, 8, 2);\n\n // 7 = right, walk\n try {\n g = icons[7].getImage().getGraphics();\n }\n catch (NullPointerException e) {\n System.out.println(\"Could not get Graphics pointer to GameCursor Image\");\n return;\n }\n g2 = (Graphics2D) g;\n g2.setBackground(transparent);\n g2.clearRect(0, 0, 28, 32);\n g.setColor(Color.white);\n g.fillRect(8, 0, 12, 8);\n g.fillRect(4, 2, 4, 4);\n g.fillRect(20, 4, 4, 2);\n g.fillRect(12, 8, 4, 2);\n g.fillRect(8, 10, 12, 14);\n g.fillRect(4, 12, 20, 4);\n g.fillRect(0, 14, 4, 6);\n g.fillRect(24, 14, 4, 4);\n g.fillRect(4, 22, 8, 10);\n g.fillRect(16, 24, 8, 8);\n g.fillRect(24, 30, 4, 2);\n g.setColor(Color.black);\n g.fillRect(12, 2, 4, 2);\n g.fillRect(8, 14, 4, 2);\n g.fillRect(8, 18, 12, 2);\n g.fillRect(4, 28, 8, 2);\n g.fillRect(16, 28, 8, 2);\n currentIcon = icons[6].getImage();\n\n }",
"@Override\r\n protected void layoutChildren () {\r\n /* Custom children positioning */\r\n super.layoutChildren();\r\n\r\n if (noDataIcon.isVisible()) {\r\n noDataIcon.relocate((getWidth() - noDataIcon.getLayoutBounds().getWidth()) / 2,\r\n (getHeight() - noDataIcon.getLayoutBounds().getHeight()) / 2);\r\n }\r\n\r\n if (innerContainer != null) {\r\n innerContainer.relocate((getWidth() - innerContainer.getLayoutBounds().getWidth()) / 2,\r\n (getHeight() - innerContainer.getLayoutBounds().getHeight()) / 2);\r\n }\r\n\r\n if (currentIcon != null) {\r\n currentIcon.relocate(\r\n suffixLabel.getBoundsInParent().getMinX() + innerContainer.getBoundsInParent().getMinX(),\r\n suffixLabel.getBoundsInParent().getMinY() + innerContainer.getBoundsInParent().getMinY()\r\n - currentIcon.getLayoutBounds().getHeight() + 2);\r\n }\r\n\r\n }",
"@Override\n\t\tprotected void paintComponent(Graphics g) {\n\t\t\tint width = getWidth();\n\t\t\tint height = getHeight();\n\t\t\tint x = (width - icon.getIconWidth()) / 2;\n\t\t\tint y = icon.getIconHeight() / 2;\n\t\t\tg.setColor(Color.darkGray);\n\t\t\tg.fillRect(0, 0, width, height);\n\t\t\ticon.paintIcon(this, g, x, y);\n\t\t}",
"public HashMap<String,Image> getIcons(){\n\t\treturn iconMap;\n\t}",
"public Iterator<RendererBean> renderers()\r\n {\r\n return _renderers.values().iterator();\r\n }"
]
| [
"0.6756284",
"0.6696675",
"0.65466094",
"0.65382594",
"0.6492521",
"0.6418514",
"0.64033115",
"0.64033115",
"0.63206077",
"0.6226507",
"0.6208715",
"0.619193",
"0.61503226",
"0.6099603",
"0.60735285",
"0.6033728",
"0.60313934",
"0.60095596",
"0.5992316",
"0.5964548",
"0.5953642",
"0.59259826",
"0.59189415",
"0.59161067",
"0.58893514",
"0.58823854",
"0.5880052",
"0.5839875",
"0.58355546",
"0.58301896",
"0.58243275",
"0.5766341",
"0.57653093",
"0.575967",
"0.5757162",
"0.5755987",
"0.57475466",
"0.57330555",
"0.57272565",
"0.5706911",
"0.570506",
"0.5700274",
"0.5691174",
"0.5691174",
"0.56894267",
"0.5686989",
"0.5679702",
"0.5672549",
"0.5660421",
"0.5651227",
"0.564809",
"0.56403613",
"0.563386",
"0.5619864",
"0.5616576",
"0.5611813",
"0.5609305",
"0.5609042",
"0.5604765",
"0.559813",
"0.559724",
"0.5585626",
"0.5557063",
"0.5544081",
"0.55307865",
"0.5528052",
"0.55263764",
"0.5521933",
"0.55137664",
"0.55050397",
"0.5494007",
"0.5491735",
"0.5487409",
"0.54852617",
"0.5479782",
"0.54645777",
"0.5456466",
"0.5445739",
"0.54436755",
"0.5441259",
"0.5437891",
"0.5431635",
"0.54310143",
"0.54292893",
"0.54282117",
"0.54253423",
"0.5424738",
"0.5423373",
"0.5422856",
"0.5410662",
"0.54067063",
"0.5406698",
"0.5404449",
"0.5398555",
"0.5398478",
"0.5396678",
"0.53872883",
"0.53863764",
"0.53786665",
"0.53584164"
]
| 0.6991014 | 0 |
TODO Autogenerated method stub | protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
/ Getters & Setters | public int getId() {
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Set method_1559();",
"@Override\r\n\tpublic void get() {\n\t\t\r\n\t}",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\n public void get() {}",
"@Override\n\tpublic void getData() {\n\t\t\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"public void get() {\n }",
"public void setdat()\n {\n }",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"@Override\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" UML Marker \"> \n // #[regen=yes,id=DCE.E1700BD9-298C-DA86-4BFF-194B41A6CF5E]\n // </editor-fold> \n protected String getProperties() {\n\n return \"Size = \" + size + \", Index = \" + value;\n\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"public int getAge() {return age;}",
"private void assignment() {\n\n\t\t\t}",
"private PropertyAccess() {\n\t\tsuper();\n\t}",
"public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"public void setAge(int age) { this.age = age; }",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n public void memoria() {\n \n }",
"public String getName () { return this.name; }",
"String setValue();",
"private ReadProperty()\r\n {\r\n\r\n }",
"private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n String get();",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"@Override\n void init() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"String getName(){return this.name;}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tpublic void initValue() {\n\t\t\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\npublic void setAttributes() {\n\t\n}",
"@Override\n protected void updateProperties() {\n }",
"@Override\n public void init() {\n }",
"public String getName(){return this.name;}",
"@Override\n protected void init() {\n }",
"@Override\r\n public String toString() {\n return super.toString();\r\n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n public String toString() {\n return super.toString();\r\n }",
"@Override\n\tprotected void getDataFromUCF() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n //Method for getting output from String declaration\n //First set of accessor/mutator that returns value as String\n public String toString(){\n return \"[\"+name+\",\"+type+\",\"+value+\"]\";\n }",
"public String getNombre()\r\n/* 17: */ {\r\n/* 18:41 */ return this.nombre;\r\n/* 19: */ }",
"@Override\n public String toString() {\n return (super.toString());\n\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n protected void initData() {\n }",
"@Override\n protected void initData() {\n }",
"private Get() {}",
"private Get() {}",
"public String getAuthor(){return author;}",
"@Override\n public void perish() {\n \n }",
"@Override\n public String toString () {\n return super.toString();\n }",
"public Book getBook() \t\t{ return this.myBook; }",
"public void setName(String name){this.name=name;}",
"public int getAge(){\n return age;\n }",
"@Override\n public String getName(){\n return Name; \n }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n/* 62: */ }",
"public int getlife(){\r\n return life;\r\n}",
"public String getNombre()\r\n/* 113: */ {\r\n/* 114:204 */ return this.nombre;\r\n/* 115: */ }",
"private void setData() {\n\n }",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"public abstract String get();",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void initializeValues() {\n\n\t}",
"public String getValue() {\n/* 99 */ return this.value;\n/* */ }",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"public int getAge()\r\n {\r\n return age;\r\n }",
"@Override\n\tpublic void setData() {\n\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Test\r\n\tpublic void testGettersSetters()\r\n\t{\r\n\t\tPerson p = new Person(42);\r\n\t\tp.setDisplayName(\"Fred\");\r\n\t\tassertEquals(\"Fred\", p.getFullname());\r\n\t\tp.setPassword(\"hunter2\");\r\n\t\tassertEquals(\"hunter2\", p.getPassword());\r\n\t\tassertEquals(42, p.getID());\r\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n protected void initialize() {\n\n \n }",
"public Student getStudent() { return student; }",
"@Test\n public void testSongGettersSetters() {\n Integer id = 4;\n String title=\"title\",uri = \"uri\";\n\n Song song = new Song();\n song.setId(id);\n song.setTitle(title);\n song.setUri(uri);\n\n assertEquals(\"Problem with id\",id, song.getId());\n assertEquals(\"Problem with title\",title, song.getTitle());\n assertEquals(\"Problem with uri\",uri, song.getUri());\n }",
"public String getID(){return ID;}",
"public String getName(){return name;}"
]
| [
"0.66695607",
"0.6621256",
"0.6552936",
"0.6535096",
"0.62308425",
"0.6183343",
"0.6167108",
"0.61540556",
"0.614458",
"0.60767335",
"0.601773",
"0.60148233",
"0.5981592",
"0.5948035",
"0.59308684",
"0.59025115",
"0.5880023",
"0.58750594",
"0.5861366",
"0.586052",
"0.586052",
"0.58564156",
"0.5854017",
"0.58526653",
"0.58521914",
"0.5845947",
"0.5839145",
"0.58358985",
"0.58296335",
"0.5828616",
"0.5828616",
"0.5828616",
"0.5828616",
"0.5828616",
"0.5828616",
"0.5828448",
"0.5822938",
"0.5820369",
"0.58198583",
"0.5818409",
"0.58070356",
"0.5802639",
"0.5801274",
"0.57993174",
"0.579453",
"0.579453",
"0.57927626",
"0.5776067",
"0.5767143",
"0.5764664",
"0.57626444",
"0.57609797",
"0.57590455",
"0.5756007",
"0.5754836",
"0.5745994",
"0.573759",
"0.57365894",
"0.57218546",
"0.572015",
"0.57179457",
"0.571414",
"0.5713997",
"0.57104844",
"0.57104844",
"0.5707429",
"0.5707429",
"0.5699056",
"0.56965744",
"0.5692791",
"0.56877136",
"0.5686146",
"0.5683443",
"0.5682161",
"0.56797504",
"0.56797504",
"0.56797504",
"0.56790966",
"0.56784505",
"0.56784487",
"0.56757796",
"0.56751156",
"0.56751156",
"0.56725943",
"0.56703985",
"0.56703985",
"0.56672907",
"0.5665608",
"0.5665354",
"0.5665354",
"0.56652856",
"0.5663774",
"0.56582046",
"0.56578624",
"0.56562245",
"0.56502587",
"0.5649788",
"0.56490976",
"0.56484884",
"0.5642279",
"0.5641098"
]
| 0.0 | -1 |
TODO Autogenerated method stub | private void doDBProcessing() throws InterruptedException {
Thread.sleep(5000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
Sample usage: "curl $HOST:$PORT/recommendation?productId=1". | @GetMapping(
value = "/recommendation",
produces = "application/json")
List<Recommendation> getRecommendations(
@RequestParam(value = "productId", required = true) int productId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unchecked\")\n@Test\n public void testProductSelection() {\n\t \n\t\tRestAssured.baseURI = baseURL;\n\t\tRequestSpecification request = RestAssured.given();\n\t\t\n\t\t\n\t\trequest.header(\"Content-Type\", \"application/json\");\n\t\t\n\n\t\tJSONObject jobj = new JSONObject();\n\t\t\n\t\tjobj.put(\"product_id\",\"56c815cc56685df2014df1fb\"); //Fetching the product ID from the Login API response\n\t\t\n\t\trequest.body(jobj.toJSONString());\n\n\t\tResponse resp = request.post(\"/product_selection\");\n\t\t\n\t\t\n\t\tint statusCode = resp.getStatusCode();\n\t\tAssert.assertEquals(statusCode,200, \"Status Code is not 200\");\n }",
"@Test\n public void GETProductService_ProductCall() {\n givenHeaders().\n when().\n get(_url_prodservice).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETProductService_ProductCall Test Run Result\");\n }",
"public QueryRequest<Review> byProductId(String productId);",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"DescribeProductResult describeProduct(DescribeProductRequest describeProductRequest);",
"@Headers({\n \"Accept: application/json\",\n \"User-Agent: Mozilla/5.0\"\n })\n @GET(\"/products/\")\n Call<List<Product>> listProduct();",
"CafeProduct getProductById(final Integer productId);",
"@GET(\"/books/{isbn}/commercialOffers\")\n Call<Offers> getBestOffers(@Path(\"isbn\") String param);",
"@GetMapping(path = \"/products/{id}\")\n Product getProductById(@RequestHeader(HttpHeaders.AUTHORIZATION) String token, @PathVariable Long id);",
"public static void sendFavoriteProduct(final Context context, final Product product)\r\n {\r\n final SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n final long id = sharedPreferencesManager.retrieveUser().getId();\r\n\r\n final String fixedURL = Utils.fixUrl(Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT\r\n + \"/users/\" + id + \"/\" + product.getId() + \"/\" + Properties.ACTION_FAVORITE);\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para anadir/quitar un producto de favoritos\");\r\n\r\n final StringRequest stringRequest = new StringRequest(Request.Method.GET\r\n , fixedURL\r\n , new Response.Listener<String>()\r\n {\r\n @Override\r\n public void onResponse(final String response)\r\n {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se recibe respuesta del servidor: \" + response);\r\n\r\n AsyncTask.execute(new Runnable()\r\n {\r\n @Override\r\n public void run()\r\n {\r\n synchronized (RestClientSingleton.class)\r\n {\r\n if (!response.equals(Properties.PRODUCT_NOT_FOUND) || !response.equals(Properties.USER_NOT_FOUND))\r\n {\r\n User user = sharedPreferencesManager.retrieveUser();\r\n\r\n // Si contiene el producto, es que se quiere quitar de favoritos.\r\n if (user.getFavoriteProducts().contains(product.getId()))\r\n {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se elimina el producto de favoritos\");\r\n user.getFavoriteProducts().remove(product.getId());\r\n\r\n } else {\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se añade el producto de favoritos: \" + product.getId());\r\n user.getFavoriteProducts().add(product.getId());\r\n }\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Se actualiza el usuario en las SharedPreferences\");\r\n sharedPreferencesManager.insertUser(user);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n , new Response.ErrorListener()\r\n {\r\n @Override\r\n public void onErrorResponse(VolleyError error)\r\n {\r\n ExceptionPrinter.printException(\"REST_CLIENT_SINGLETON\", error);\r\n }\r\n });\r\n\r\n VolleySingleton.getInstance(context).addToRequestQueue(stringRequest);\r\n }",
"@SuppressWarnings(\"unused\")\n\tprivate List<Product> getrecommendedProductsAsync(Product product) throws InterruptedException {\n\t\t\n\t\tList<Product> recommendedProducts = new ArrayList<Product>();\n\t\tRecommendationsRequest request = RecommendationsRequest.newBuilder().addAllProductCategory(product.getCategories()).build();\n\t\tfinal CountDownLatch finishLatch = new CountDownLatch(1);\n\t\t\n\t\t// Async callback\n\t\tStreamObserver<ListRecommendationsResponse> responseObserver = new StreamObserver<ListRecommendationsResponse>() {\n\t\t\t@Override\n\t\t\tpublic void onNext(ListRecommendationsResponse response) {\n\t\t\t\tfor (String pid : response.getProductIdsList()) {\n\t\t\t\t\trecommendedProducts.add(productService.findProductById(pid).get());\n\t\t\t\t}\n\t\t\t\trecommendedProducts.remove(product);\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onCompleted() {\n\t\t\t\tfinishLatch.countDown();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\tfinishLatch.countDown();\n\t\t\t}\n\t\t};\n\n\t\t// Async call to recommendations microservice\n\t\tasyncStub.listRecommendations(request, responseObserver);\t\t\n\t\tfinishLatch.await();\n\t\t\n\t\treturn recommendedProducts;\n\t}",
"@RequestMapping(\"/product/{productId}\")\n public ResponseEntity<ProductAggregated> getProduct(@PathVariable int productId) {\n ResponseEntity<Product> productResult = integration.getProduct(productId);\n\n if (!productResult.getStatusCode().is2xxSuccessful()) {\n // We can't proceed, return whatever fault we got from the getProduct call\n return util.createResponse(null, productResult.getStatusCode());\n }\n\n // 2. Get optional recommendations\n List<Recommendation> recommendations = null;\n try {\n ResponseEntity<List<Recommendation>> recommendationResult = integration.getRecommendations(productId);\n if (!recommendationResult.getStatusCode().is2xxSuccessful()) {\n // Something went wrong with getRecommendations, simply skip the recommendation-information in the response\n } else {\n recommendations = recommendationResult.getBody();\n }\n } catch (Exception e) {\n e.getStackTrace();\n }\n\n\n // 3. Get optional reviews\n ResponseEntity<List<Review>> reviewsResult = integration.getReviews(productId);\n List<Review> reviews = null;\n if (!reviewsResult.getStatusCode().is2xxSuccessful()) {\n // Something went wrong with getReviews, simply skip the review-information in the response\n } else {\n reviews = reviewsResult.getBody();\n }\n\n return util.createOkResponse(new ProductAggregated(productResult.getBody(), recommendations, reviews));\n }",
"@GetMapping(\"/product/ratings\")\n\tpublic List<Product> getProductsByRatingsAndCategoryAndFeatured(){\n\t\tList<Product> list = productRepository.getProductsByRatingsAndCategoryAndFeatured(\"MOBILE\",true);\n\t\treturn list;\n\t}",
"@Test\r\n\tpublic void findStore() {\n\r\n\t\tRestAssured.baseURI= \"https://api.bestbuy.com/v1/products/6341359/stores.json?\";\r\n\r\n\t\t//\t\tproducts/6341359/stores.json?postalCode=95125&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t//\t\tproducts(manufacturer=apple&search=iPhone 11 Pro)?format=json&show=name,regularPrice,salePrice&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\t\t// products(manufacturer=apple&search=iPhone 11 64GB&inStorePickup=true)+stores(region=RI)?format=json&show=sku,name,stores.storeId,stores.name,stores.address&apiKey=qUh3qMK14GdwAs9bO59QRSCJ\r\n\r\n\t\t// Map<String, String> parametersMap = new HashMap<String, String>();\r\n\t\t//parametersMap.put(\"products\", \"products/6341359/\");\r\n\r\n\r\n\r\n\r\n\t\tResponse response = RestAssured\r\n\t\t\t\t.given()\r\n\t\t\t\t.log().all()\r\n\t\t\t\t.accept(ContentType.JSON)\r\n\t\t\t\t.queryParam(\"postalCode\",\"95125\")\r\n\t\t\t\t.queryParam(\"apiKey\",\"qUh3qMK14GdwAs9bO59QRSCJ\")\r\n\t\t\t\t.get();\r\n\r\n\t\tresponse.prettyPrint();\r\n\r\n\t\tSystem.out.println(\" Response code : \" + response.getStatusCode());\r\n\r\n\t}",
"List<Review> getReviewByProductId(Integer productId);",
"private List<Product> getrecommendedProductsSync(Product product) {\n\t\t\n\t\tList<Product> recommendedProducts = new ArrayList<Product>();\n\t\tRecommendationsRequest request = RecommendationsRequest.newBuilder().addAllProductCategory(product.getCategories()).build();\n\t\t\n\t\t// Blocking call to remote recommendation microservice\n\t\ttry {\n\t\t\tListRecommendationsResponse response = blockingStub.withDeadlineAfter(2, TimeUnit.SECONDS).listRecommendations(request);\n\t\t\tfor (String pid : response.getProductIdsList()) {\n\t\t\t\trecommendedProducts.add(productService.findProductById(pid).get());\n\t\t\t}\n\t\t}\n\t\tcatch (StatusRuntimeException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\trecommendedProducts.remove(product);\n\t\treturn recommendedProducts;\n\t}",
"@GetMapping(\"/product/{id}\")\n\tpublic Product getProductById(@PathVariable(\"id\") Long id);",
"@GetMapping(\"/product/{productid}\") \nprivate Products getProducts(@PathVariable(\"productid\") int productid) \n{ \nreturn productsService.getProductsById(productid); \n}",
"SearchProductsResult searchProducts(SearchProductsRequest searchProductsRequest);",
"public static void sendViewedProduct(final Context context, final Product product)\r\n {\r\n SharedPreferencesManager sharedPreferencesManager = new SharedPreferencesManager(context);\r\n\r\n User user = sharedPreferencesManager.retrieveUser();\r\n long id = user.getId();\r\n\r\n String fixedURL = Utils.fixUrl(Properties.SERVER_URL + \":\" + Properties.SERVER_SPRING_PORT\r\n + \"/users/\" + id + \"/\" + product.getId() + \"/\" + Properties.ACTION_VIEWED);\r\n\r\n Log.d(Properties.TAG, \"[REST_CLIENT_SINGLETON] Conectando con: \" + fixedURL + \" para marcar el producto como visto\");\r\n\r\n StringRequest stringRequest = new StringRequest(Request.Method.GET\r\n , fixedURL\r\n , new Response.Listener<String>()\r\n {\r\n @Override\r\n public void onResponse(String response) {}\r\n }\r\n , new Response.ErrorListener()\r\n {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {}\r\n });\r\n\r\n VolleySingleton.getInstance(context).addToRequestQueue(stringRequest);\r\n }",
"private void startRateProductAct() {\n Intent intent = new Intent(this, ReviewProductActivity.class);\n intent.putExtra(PRODUCT_IMAGE, mProductDetailsViewModel.mPrimaryImage);\n intent.putExtra(PRODUCT_COLOUR, mProductDetailsViewModel.mColor);\n intent.putExtra(PRODUCT_NAME, mBinding.tvPdpProductName.getText().toString());\n intent.putExtra(PRICE, mBinding.tvPdpProductPrice.getText().toString());\n intent.putExtra(PARENT_PRODUCT_ID, mParentProductId);\n intent.putExtra(PRODUCT_ID, mProductId);\n startActivity(intent);\n }",
"Product getProductById(Integer productId);",
"Product getProductById(Integer productId);",
"public static void getAssignedProduct(String productId , ITestContext context ){\n\t\t \n\t\t //SET URL\n\t\t customerId= (context.getAttribute(\"customerId\")).toString();//need to add validation for customerId\n\t\t String CONTEXT_PATH=\"mcss/ecommerce/customer/\" +customerId + \"/product/\" + productId;\n\t\t \n\t\t//Execute REST\n\t\t Response response =get( CONTEXT_PATH );\n \n\t\t \n\n\t\t //Validations:\n\t\t ResponseBody body = response.getBody();\n\t\t assertEquals( 200 ,response.getStatusCode(),\"Status Code is not as expected\");\n\t\t assertEquals( \"AC\" ,response.body().path(\"Product.status\"),\"AP status is not correct \");\n\t\t assertEquals( productId ,response.body().path(\"Product.id\"),\"AP status is not correct \");\n\t\t \n\t\t //Product validations \n\t\t assertNotEquals( null, response.body().path(\"Product.serviceId\"), \"ServiceId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productOfferingProductSpecID\"), \"productOfferingProductSpecID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.productTypeX9\"), \"productTypeX9 is null\");//EQ,IPTV\n\t\t assertNotEquals( null, response.body().path(\"Product.hasPendingOrders\"), \"hasPendingOrders is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.ceaseActionAllowed\"), \"ceaseActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.changeActionAllowed\"), \"changeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogOfferingId\"), \"catalogOfferingId is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.lineOfBusiness\"), \"lineOfBusiness is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.spoName\"), \"spoName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.resumeActionAllowed\"), \"resumeActionAllowed is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.catalogItemID\"), \"catalogItemID\");\n\t\t// plan validations only if product is not Equipment for Equipment can be if it has Repeator\n\t\t if ( !(response.body().path(\"Product.productTypeX9\")).equals(\"EQ\") ){\n\t\t assertNotEquals( null, response.body().path(\"Product.plan\"), \"plan is null\"); // optional \n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemName\"), \"plan.catalogItemName is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemImages\"), \"plan.catalogItemImages is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.planRank\"), \"plan.planRank is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemID\"), \"plan.catalogItemID is null\");\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.catalogItemDescription\"), \"plan.catalogItemDescription is null\");//optional\n\t\t assertNotEquals( null, response.body().path(\"Product.plan.id\"), \"plan.id is null\");\n\t\t }\n\t\t //services validations \n\t\t assertNotEquals( null, response.body().path(\"Product.services\"), \"services are null!\"); // optional \n\t\t assertNotEquals( 0, response.body().path(\"Product.services.size()\"), \" Services Array is empty !\"); // optional \n\t\t// assertNotEquals( null, ((RestAssuredBased) response.body()).get(\"/Product\").jsonPath().getList(\"Product.services.[0].businessType\"), \"Services.businessType is null!\"); \n\t/*\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemID\"), \"Services.catalogItemID is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemName\"), \"Services.catalogItemName is null!\"); \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].catalogItemDescription\"), \"catalogItemDescription is null!\"); //optional\n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].initialActivationDate\"), \"Services.initialActivationDate is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].id\"), \"Services.id is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].serviceType\"), \"Services.serviceType is null!\");// \n\t\t assertNotEquals( null, response.body().path(\"Product.services.[0].status\"), \"Services.status is null!\");// */\n\t\t \n\t\t \n\t\t //Savinq Info \n\t\t /*\n context.setAttribute( \"customerId\", body.path(\"ClientUserContext.customerId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personId\", body.path(\"ClientUserContext.personId\" ));\n context.setAttribute( \"personObjIdX\", body.path(\"ClientUserContext.personObjIdX\" ));\n */\n\t }",
"@Test\r\n\tpublic void createProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"id\", \"7\"); // Cast\r\n\t\trequestParams.put(\"name\", \"Mangao\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.post(\"\");\r\n\t\tSystem.out.println(\"POST Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 201);\r\n\r\n\t}",
"ProductCatelogueResponse getProduct(int catelogueId,int productId);",
"@Override\r\n\tpublic List<DemoProduct> getProducts(String color, Integer howMany) throws Exception {\n\t\tHttpCall.HttpRequest request = new HttpCall.HttpRequest();\r\n\t\trequest.path = QUERY_PRODUCTS_URL;\r\n\t\tMap<String, String> params = new HashMap<>();\r\n\t\tparams.put(\"color\",color);\r\n\t\tparams.put(\"howMany\",howMany.toString());\r\n\t\trequest.params = params;\r\n\t\t\r\n\t\tException error = null;\r\n\t\tString json = null;\r\n\t\tList<DemoProduct> prods = new ArrayList<>();\r\n\t\t\r\n\t\ttry{\r\n\t\t json = get (request);\r\n\t\t prods = gson.fromJson(json, new TypeToken<List<DemoProductImpl>>(){}.getType());\r\n\t\t}catch(Exception e){\r\n\t\t\tif(e instanceof com.google.gson.JsonSyntaxException) {\r\n\t\t\t\terror = (new Gson()).fromJson(json, Exception.class);\r\n\t\t\t} else {\r\n\t\t\t\terror =e;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(prods == null){\r\n\t\t\tif(error == null) error = (new Gson()).fromJson(json, Exception.class);\r\n\t\t\t if(error!=null) throw new Exception(error.getLocalizedMessage());\r\n\t\t}\r\n\r\n\t\treturn prods;\r\n\t}",
"public static String GetRequestDemoMethod(String entityType, String itemId) {\n try {\n HashMap<String, String> awsCreds = getApiResponse();\n\n //Create client\n URL url = new URL(BaseConnectionString + entityType + \"/\" + itemId);\n AWS4SignerForAuthorizationHeader auth = new AWS4SignerForAuthorizationHeader(url, \"GET\", \"execute-api\", \"us-east-1\");\n Map<String, String> headers = new HashMap<>();\n headers.put(\"content-type\", \"application/json\");\n headers.put(\"x-amz-security-token\", awsCreds.get(\"sessionToken\"));\n headers.put(\"x-api-key\", ConfigSetup.getCredentials().get(\"xApiKey\"));\n\n\n String authorization = auth.computeSignature(headers, new HashMap<>(), AWS4SignerBase.EMPTY_BODY_SHA256, awsCreds.get(\"accessKey\"), awsCreds.get(\"secretKey\"));\n client = (HttpURLConnection) url.openConnection();\n\n headers.put(\"Authorization\", authorization);\n client.setRequestMethod(\"GET\");\n\n client.connect();\n String response = HttpUtils.invokeHttpRequest(url, \"GET\", headers, null);\n return response;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n } finally {\n if (client != null) {\n client.disconnect();\n }\n }\n }",
"public void retrieveProductFromDatabase(){\r\n // retrieve product from the database here\r\n System.out.println(\"Product Retrieved using ID --> \" + this.productId);\r\n \r\n }",
"@RequestMapping(\"/product/{productId}\")\n public ProductAggregated getProduct(@PathVariable int productId) {\n\n \tLOG.info(\"Starting the product details call....\");\n\t\t//RX java implementation............\n\t\tProductAggregated pa = getProductDetails(productId);\n\t\tLOG.info(\"End of the product details call....\");\n\n \t\n \treturn pa;\n }",
"@GET\n\t@Path(\"{id}\") // http://localhost:8080/myretail-services/products/id/16696652\n\t@Produces(MediaType.TEXT_PLAIN)\n\tpublic String getProductInfo(@PathParam(\"id\") String id) throws JSONException {\n\t\t\n\t\tWebTarget target = ClientBuilder.newClient().target(\"http://redsky.target.com/v2/pdp/tcin/\" + id\n\t\t\t\t+ \"?excludes=taxonomy,price,promotion,bulk_ship,rating_and_review_reviews,rating_and_review_statistics,question_answer_statistics/\");\n\t\tResponse response = target.request().get();\n\t\tString pName = response.readEntity(String.class).toString();\n\n\t\tint b = pName.indexOf(\"general_description\") + BEGOFFSET;\n\t\tint e = pName.indexOf(\"}\", b) - 1;\n\n\t\tJSONObject json = new JSONObject();\n\n\t\tjson.put(\"name\", pName.substring(b, e));\n\t\tjson.put(\"id\", Integer.parseInt(id));\n\t\tjson.put(\"current_price\", new JSONObject(productPrice.getProductPrice(id)));\n\t\treturn json.toString();\n\t}",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String productSetDisplayName = request.getParameter(\"productSetDisplayName\");\n String productCategory = request.getParameter(\"productCategory\");\n String businessId = request.getParameter(\"businessId\");\n String sortOrder = request.getParameter(\"sortOrder\");\n String searchId = request.getParameter(\"searchId\");\n\n // Set parameters to apprpriate defaults, if necessary.\n if (businessId.equals(\"getFromDatabase\")) {\n businessId = userService.getCurrentUser().getUserId();\n }\n if (productCategory.equals(\"none\")) {\n productCategory = null;\n }\n String productSetId = null;\n ProductSetEntity productSet = null;\n if (!productSetDisplayName.equals(\"none\")) {\n // true indicates we are searching with the displayname instead of the id.\n productSet = ServletLibrary.retrieveProductSetInfo(datastore, productSetDisplayName, true);\n }\n if (productSet != null) {\n productSetId = productSet.getProductSetId();\n }\n\n // Search database based on the filters. \n List<ProductEntity> products = \n ServletLibrary.findProducts(datastore, \n businessId,\n productSetId, \n productCategory, \n sortOrder);\n\n if (searchId != null) {\n SearchInfo searchInfo = ServletLibrary.retrieveSearchInfo(datastore, searchId);\n\n if (searchInfo.getGcsUrl() != null) {\n \n String generalProductSetId = \"cloudberryAllProducts\";\n List <String> productSearchIds = ProductSearchLibrary.getSimilarProductsGcs(generalProductSetId, \n searchInfo.getProductCategory(), changeGcsFormat(searchInfo.getGcsUrl()));\n List<ProductEntity> imageSearchProducts = new ArrayList<>();\n productSearchIds.forEach(productId->imageSearchProducts.add(ServletLibrary.retrieveProductInfo(datastore, productId)));\n\n Set<ProductEntity> uniqueProducts = new HashSet<>(products);\n List<ProductEntity> productsDisplayed = new ArrayList<>();\n for (ProductEntity product : imageSearchProducts) {\n if (uniqueProducts.contains(product)) productsDisplayed.add(product);\n }\n products = productsDisplayed;\n }\n\n // Text query if it is specified, will take in this list and output a new\n // list that satisfies the query.\n if (searchInfo.getTextSearch() != null) {\n products = TextSearchLibrary.textSearch(datastore, products, \n searchInfo.getTextSearch());\n }\n }\n\n // Send the response.\n String json = gson.toJson(products);\n response.setContentType(\"application/json;\");\n response.getWriter().println(json);\n }",
"@CrossOrigin()\r\n @GetMapping(\"/products/discover\")\r\n Stream<ProductEntity> getDiscoveryProducts() {\n return productRepository\r\n .findAll(PageRequest.of(0, 3, Sort.by(\"numberOfPurchases\").descending()))\r\n .get();\r\n }",
"private void getProductHandler(RoutingContext routingContext) {\n\n HttpServerResponse httpServerResponse = routingContext.response();\n\n try {\n\n Long productId = Long.parseLong(routingContext.request().getParam(\"productId\"));\n Instant start = Instant.now();\n\n logger.info(\"Received the get request for the productid \" + productId + \" at \" + start);\n Product inputProduct = new Product.ProductBuilder(productId).build();\n\n // Create future for external api call\n Future<Product> externalApiPromise =\n Future.future(promise -> messagingExternalApiVerticle(promise, productId));\n\n // Create future for DB call\n Future<Product> productDBPromise =\n Future.future(promise -> callDBService(promise, inputProduct, DBAction.GET));\n\n // Concatenate result from external api and database future\n CompositeFuture.all(externalApiPromise, productDBPromise)\n .setHandler(\n result -> {\n if (result.succeeded()) {\n Product productInfo = externalApiPromise.result();\n Product productDBInfo = productDBPromise.result();\n\n productInfo.setPrice(productDBInfo.getPrice());\n productInfo.setCurrency(productDBInfo.getCurrency());\n productInfo.setLast_updated(productDBInfo.getLast_updated());\n\n logger.info(\"The retrieved product is \" + productInfo.toString());\n\n Gson gson = new GsonBuilder().create();\n String json = gson.toJson(productInfo);\n\n Long duration = Duration.between(start, Instant.now()).toMillis();\n logger.info(\n \"Total time taken to process the request \" + duration + \" milli-seconds\");\n\n httpServerResponse.setStatusCode(SUCCESS_CODE);\n httpServerResponse.end(new JsonObject(json).encodePrettily());\n\n } else {\n logger.error(result.cause());\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \"\n + result.cause().getMessage()\n + \". Please try again after sometime.\");\n }\n });\n\n } catch (Exception e) {\n logger.error(e);\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \" + e.getMessage() + \". Please try again after sometime.\");\n }\n }",
"@GET(Url.END_POINT)\n Call<ArrayList<Recipe>> getRecipes();",
"Product getProductById(Integer productID);",
"@GetMapping(VERSION + \"/product/{productId}\")\n public ResponseEntity<?> retrieveProductDetails(@PathVariable(\"productId\") String productId) {\n ProductDto productDto = productCompositeService.fetchProductById(productId);\n return ResponseEntity.ok().body(productDto);\n }",
"@CrossOrigin\n @RequestMapping(method = RequestMethod.GET, path = \"/item/restaurant/{restaurant_id}\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<ItemListResponse> getItemsByPopularity(\n @PathVariable(\"restaurant_id\") final String restaurantId) throws RestaurantNotFoundException {\n\n //Fetching the restaurant info. if restaurant Id entered is valid\n RestaurantEntity restaurantEntity = restaurantService.restaurantByUUID(restaurantId);\n\n //Fetching all items of restaurant in order of popularity\n List<ItemEntity> itemList = itemService.getItemsByPopularity(restaurantEntity);\n\n ItemListResponse itemListResponse = new ItemListResponse();\n\n //Considering only top 5 items..\n int count = 0;\n for (ItemEntity itemEntity : itemList) {\n if (count < 5) {\n ItemList items = new ItemList()\n .id(UUID.fromString(itemEntity.getUuid()))\n .itemName(itemEntity.getItemName())\n .price(itemEntity.getPrice())\n .itemType(ItemList.ItemTypeEnum.fromValue(itemEntity.getType().getValue()));\n itemListResponse.add(items);\n count = count + 1;\n } else {\n break;\n }\n }\n //Sending response with the desired body and required status code.\n return new ResponseEntity<ItemListResponse>(itemListResponse, HttpStatus.OK);\n }",
"public static JSONObject getProductPrices(String item) {\n JSONObject returnJson = new JSONObject();\n\n String productDetailsUrl = \"https://api.zinc.io/v1/products/\" + item + \"/offers?retailer=amazon\";\n String clientToken = Constants.zincClientToken + \":\";\n\n URL url = null;\n HttpURLConnection conn = null;\n\n try {\n url = new URL(productDetailsUrl);\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Accept\", \"application/json\"); // maybe i don't need this?\n\n String encoded = new String(new Base64().encode(clientToken.getBytes()));\n conn.setRequestProperty(\"Authorization\", \"Basic \" + encoded);\n\n if (conn.getResponseCode() != 200) {\n System.out.println(\"Failed : HTTP error code : \" + conn.getResponseCode());\n }\n\n InputStreamReader reader = new InputStreamReader((conn.getInputStream()));\n BufferedReader br = new BufferedReader(reader);\n\n String output = \"\";\n String jsonText = \"\";\n// System.out.println(\"Output from Server .... \\n\");\n while ((output = br.readLine()) != null) {\n jsonText += output;\n }\n// System.out.println(jsonText);\n\n returnJson = new JSONObject(jsonText);\n\n } catch (MalformedURLException ex) {\n ex.printStackTrace();\n } catch (IOException ex) {\n ex.printStackTrace();\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return returnJson;\n }",
"private void displayProductComment() {\n WooCommerceService service = ServiceGenerator.createService(WooCommerceService.class);\n final Call<ProductReviewsResponse> productReviewsResponseCall = service.getProductReviewsById(productId);\n productReviewsResponseCall.enqueue(new Callback<ProductReviewsResponse>() {\n @Override\n public void onResponse(Call<ProductReviewsResponse> call, Response<ProductReviewsResponse> response) {\n ProductReviewsResponse productReviewsResponse = response.body();\n List<ProductReview> productReviews = productReviewsResponse.getProductReviews();\n recyclerViewAdapter = new CommentAdapter(productReviews);\n recyclerView.setAdapter(recyclerViewAdapter);\n }\n\n @Override\n public void onFailure(Call<ProductReviewsResponse> call, Throwable t) {\n Log.e(\"ERROR\", t.getMessage());\n }\n });\n }",
"public void makeRequest() {\n Request newRequest = new Request();\n\n if (mProduct == null) {\n Toast.makeText(getContext(), \"BAD\", Toast.LENGTH_LONG).show();\n return;\n }\n\n newRequest.setClient(ParseUser.getCurrentUser());\n newRequest.setProduct(mProduct);\n newRequest.setBeaut(mBeaut);\n\n Date dateTime = new Date(selectedAppointmet.appDate.getTimeInMillis());\n newRequest.setDateTime(dateTime);\n // TODO: uncomment below line when dataset is clean and products have lengths\n// newRequest.setLength(mProduct.getLength());\n newRequest.setLength(1);\n newRequest.setSeat(selectedAppointmet.seatId);\n newRequest.setDescription(rComments.getText().toString());\n\n sendRequest(newRequest);\n }",
"@ResponseBody\r\n @RequestMapping(method = RequestMethod.GET, path=\"/item/restaurant/{restaurant_id}\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\r\n public ResponseEntity<ItemListResponse> getItemsByPopularity(@PathVariable(\"restaurant_id\") final String restaurantId) throws RestaurantNotFoundException\r\n {\r\n // Gets the restaurant by UUID\r\n RestaurantEntity restaurantEntity = restaurantService.restaurantByUUID(restaurantId);\r\n //Get items by no of times the item is ordered from restaurant\r\n List<ItemEntity> itemEntities = itemService.getItemsByPopularity(restaurantEntity);\r\n //Create response item list\r\n ItemListResponse itemListResponse = new ItemListResponse();\r\n for (ItemEntity itemEntity : itemEntities) {\r\n ItemList itemList = new ItemList();\r\n itemList.setId(UUID.fromString(itemEntity.getUuid()));\r\n itemList.setItemName(itemEntity.getItemName());\r\n itemList.setPrice(itemEntity.getPrice());\r\n itemList.setItemType(ItemList.ItemTypeEnum.valueOf(itemEntity.getType().toString()));\r\n itemListResponse.add(itemList);\r\n }\r\n return new ResponseEntity<ItemListResponse>(itemListResponse, HttpStatus.OK);\r\n }",
"public Product getProduct(long id, HttpServletRequest request) {\n RestTemplate restTemplate = new RestTemplate();\n Product product = new Product();\n String requestUrl = String.format(\"%s://%s:%d/products/\" + id, request.getScheme(), request.getServerName(), request.getServerPort());\n try {\n product = restTemplate.getForObject(requestUrl, Product.class);\n return product;\n } catch (Exception e) {\n return product;\n }\n }",
"@Test\n public void testFindProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"private void get_products_search()\r\n\r\n {\n MakeWebRequest.MakeWebRequest(\"get\", AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n AppConfig.SALES_RETURN_PRODUCT_LIST + \"[\" + Chemist_ID + \",\"+client_id +\"]\", this, true);\r\n\r\n// MakeWebRequest.MakeWebRequest(\"out_array\", AppConfig.SALES_RETURN_PRODUCT_LIST, AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n// null, this, false, j_arr.toString());\r\n //JSONArray jsonArray=new JSONArray();\r\n }",
"public interface RecommendationStrategy {\n\tRecommendationResultsHolder getRecommendationResults(Product product, String type);\n\n}",
"List<Product> retrieveProducts();",
"public void getProduct() {\n\t\tUtil.debug(\"getProduct\",this);\n\t\ttry {\n\t\t\tinputStream.skip(inputStream.available());\n\t\t} catch (IOException e) {\n\t\t\tUtil.log(e.getStackTrace().toString(),this);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\toutputStream.write(new byte[] { 'x', 13 });\n\t\t} catch (IOException e) {\n\t\t\tUtil.log(e.getStackTrace().toString(),this);\n\t\t\treturn;\n\t\t}\n\n\t\t// wait for reply\n\t\tUtil.delay(RESPONSE_DELAY);\n\t}",
"@GET(\"random.php\")\n Call<MealData> getRandomMeal();",
"@Override\n\t\tprotected String doInBackground(String... params) {\n\t\t\tHttpClient httpclient = new DefaultHttpClient();\n\t \t\n\t\t HttpPost httppost = new HttpPost(\"http://\"+WelcomeActivity.host+\":8080/OMSsell/SellProduct\");\n\n\t\t try {\n\t\t // Add your data\n\t\t List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);\n\t\t nameValuePairs.add(new BasicNameValuePair(\"ids\",params[0]));\n\t\t httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\t\t HttpResponse response = httpclient.execute(httppost);\n\t\t jsonString=readJson(response);\n\t\t } catch (ClientProtocolException e) {\n\t\t \te.printStackTrace();\n\t\t } catch (IOException e) {\n\t\t \te.printStackTrace();\n\t\t }\n\t \n\t return null;\n\t \t}",
"@RequestMapping(\"/{userId}\")\n public List<CatalogItem> getCatalog(@PathVariable(\"userId\") String userId){\n\n List<Rating> ratings = Arrays.asList(\n new Rating( \"1234\", 4),\n new Rating( \"5678\", 5)\n );\n\n //For each movieId, call movie info Service and get details\n /*return ratings.stream().map(rating -> new CatalogItem(\"Tranformers\", \"Test\", 4))\n .collect(Collectors.toList());*/\n return ratings.stream().map( rating -> {\n Movie movie = restTemplate.getForObject( \"http://localhost:8083/movies/\" + rating.getMovieId(), Movie.class);\n return new CatalogItem( movie.getName(), \"Test\", rating.getRating() );\n })\n .collect(Collectors.toList() );\n\n //Put them all together\n /*return Collections.singletonList(\n //new CatalogItem(\"Tranformers\", \"Test\", 4)\n );*/\n\n \n }",
"@Test\n public void testFindAllProduct() throws Exception {\n // Mock method\n when(productRepository.findAll()).thenReturn(products);\n\n testResponseData(RequestInfo.builder()\n .request(get(PRODUCT_ENDPOINT))\n .token(memberToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }",
"@Test\n public void testGetProductsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.getProductsIdAction(\"{id}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Product\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }",
"public void linkProduct() {\n Product result;\n String supplierID = getToken(\"Enter supplier ID: \");\n if (warehouse.searchSupplier(supplierID) == null) {\n System.out.println(\"No such supplier!\");\n return;\n }\n do {\n String productID = getToken(\"Enter product ID: \");\n result = warehouse.linkProduct(supplierID, productID);\n if (result != null) {\n System.out.println(\"Product [\" + productID + \"] assigned to supplier: [\" + supplierID + \"]\");\n }\n else {\n System.out.println(\"Product could not be assigned\");\n }\n if (!yesOrNo(\"Assign more products to supplier: [\" + supplierID + \"]\")) {\n break;\n }\n } while (true);\n }",
"private JSONObject gatherShopStyleProductInfo(String productId){\n try {\n //provides access to by sending requests through http protocol to other http servers\n HttpClient http = HttpClientBuilder.create().build();\n\n //address to call, port 80 is a default\n //port number 443 for https connection (usually)\n HttpHost host = new HttpHost(\"api.shopstyle.com\", 80, \"http\");\n\n //reference to location we are trying to retrieve data from\n //query here is for information on one specific product\n String productUrl = \"http://api.shopstyle.com/api/v2/products/\" + productId + \"?pid=uid5921-39054839-10\";\n HttpGet getPage = new HttpGet(productUrl);\n\n //execute HTTP request and get HTTP response back\n HttpResponse resp = http.execute(host, getPage);\n\n // Put the JSON to a string object\n String jsonString = EntityUtils.toString(resp.getEntity());\n JSONObject obj = new JSONObject(jsonString);\n\n return obj;\n\n }catch (java.io.IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"private void defaultRecommendationShouldBeFound(String filter) throws Exception {\n restRecommendationMockMvc.perform(get(\"/api/recommendations?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(jsonPath(\"$.[*].id\").value(hasItem(recommendation.getId().intValue())))\n .andExpect(jsonPath(\"$.[*].description\").value(hasItem(DEFAULT_DESCRIPTION)));\n\n // Check, that the count call also returns 1\n restRecommendationMockMvc.perform(get(\"/api/recommendations/count?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE))\n .andExpect(content().string(\"1\"));\n }",
"@Test\r\n\tpublic void updateProductDetails() {\r\n\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Banana\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.put(\"/5\");\r\n\t\tSystem.out.println(\"Update Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}",
"private void getProducto(String isbn) throws UnsupportedEncodingException {\n String soql = \"SELECT ProductCode, Name FROM Product2 WHERE isActive = true AND ISBN__c = \" + isbn + \".0\";\n RestRequest restRequest = RestRequest.getRequestForQuery(getString(R.string.api_version), soql);\n\n client.sendAsync(restRequest, new AsyncRequestCallback() {\n @Override\n public void onSuccess(RestRequest request, RestResponse result) {\n try {\n sfResult = result.asJSONObject().getJSONArray(\"records\");\n\n Log.d(\"RequestResponse\", String.valueOf((sfResult != null)));\n if (sfResult != null) {\n if (sfResult.length() > 0) {\n String lineStr;\n for (int i = 0; i < sfResult.length(); i++) {\n lineStr = sfResult.getJSONObject(i).getString(\"ProductCode\") + \" - \" + sfResult.getJSONObject(i).getString(\"Name\");\n agregarProducto(lineStr, \"0\");\n }\n } else {\n makeToast(getApplicationContext(), \"No se han encontrado resultados para \" + scanResult);\n }\n }\n } catch (Exception e) {\n onError(e);\n }\n }\n\n @Override\n public void onError(Exception exception) {\n VolleyError volleyError = (VolleyError) exception;\n NetworkResponse response = volleyError.networkResponse;\n String json = new String(response.data);\n Log.e(\"RestError\", exception.toString());\n Log.e(\"RestError\", json);\n Toast.makeText(MainActivity.this,\n MainActivity.this.getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()),\n Toast.LENGTH_LONG).show();\n }\n });\n }",
"void viewProductById(long id);",
"public static void main(String[] args) {\n\t\t\n\t\tRestAssured.baseURI = \"https://chercher.tech/sample/api/books.xml\";\n\t\t\n\t\tRequestSpecification httpRequest = RestAssured.given();\n\t\tResponse response = httpRequest.get();\n\t\t\n\t\tString responseBody = response.xmlPath().getString(\"bookstore.book.title[1]\");\n\t\tSystem.out.println(\"Response Body is => \" + responseBody);\n\n\t}",
"private void receiveData()\n {\n Intent i = getIntent();\n productSelected = Paper.book().read(Prevalent.currentProductKey);\n vendorID = i.getStringExtra(\"vendorID\");\n if (productSelected != null) {\n\n productName = i.getStringExtra(\"productName\");\n productImage = i.getStringExtra(\"imageUrl\");\n productLongDescription = i.getStringExtra(\"productLongDescription\");\n productCategory = i.getStringExtra(\"productCategory\");\n productPrice = i.getStringExtra(\"productPrice\");\n productSizesSmall = i.getStringExtra(\"productSizesSmall\");\n productSizesMedium = i.getStringExtra(\"productSizesMedium\");\n productSizesLarge = i.getStringExtra(\"productSizesLarge\");\n productSizesXL = i.getStringExtra(\"productSizesXL\");\n productSizesXXL = i.getStringExtra(\"productSizesXXL\");\n productSizesXXXL = i.getStringExtra(\"productSizesXXXL\");\n productQuantity = i.getStringExtra(\"productQuantity\");\n }\n }",
"public interface RetroiftService {\n @GET(\"catalog\")\n Call<CgBaseEntity> getCategories(@Query(\"key\") String key);\n\n @FormUrlEncoded\n @POST(\"query\")\n Call<BookBaseEntity> getBookList(@Field(\"catalog_id\") String id, @Field(\"pn\") String\n pn, @Field(\"rn\") String rn, @Field(\"key\") String key);\n\n}",
"@Test\n\tpublic void findPricingPrice() throws Exception{\n\t\tmvc.perform(get(new URI(\"/services/price?vehicleId=2\"))\n\t\t\t\t.accept(MediaType.APPLICATION_JSON_UTF8))\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))\n\t\t\t\t.andExpect(jsonPath(\"vehicleId\",is(2)));\n\t}",
"private String getCatalog(String myURl) throws IOException{\r\n InputStream inputStreamFromServer = null;\r\n String responseAsString = null;\r\n try {\r\n //Creates and configures the HttpURLConnection\r\n URL url = new URL(myURl);\r\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\r\n httpURLConnection.setRequestMethod(\"GET\");\r\n httpURLConnection.setConnectTimeout(15000);\r\n httpURLConnection.setDoInput(true);\r\n\r\n //Starts the query\r\n httpURLConnection.connect();\r\n\r\n //gets response code\r\n int responseCode = httpURLConnection.getResponseCode();\r\n QuantityDictionay.debugLog(\"The response code is: \"+responseCode);\r\n\r\n //gets the connection Input Stream\r\n inputStreamFromServer = httpURLConnection.getInputStream();\r\n\r\n //Convert the input stream to String\r\n responseAsString= inputStreamToString(inputStreamFromServer);\r\n\r\n }catch (IOException e){\r\n\r\n e.printStackTrace();\r\n QuantityDictionay.debugLog(\"Exception thrown on GetProductCatalogTask.getCatalog\");\r\n\r\n }\r\n return responseAsString;\r\n }",
"@GetMapping(\"/product/{id}/reviews\")\n public ListProduct getAllInfoForProduct(@PathVariable long id, HttpSession session) throws BaseException {\n return this.reviewService.getAllInfoForProduct(id, session);\n }",
"public Optional<Product> getProduct(String productId);",
"@GET\n @Path(\"productList\")\n public Response productList(@DefaultValue(\"0\") @QueryParam(\"prefVis\") int prefVis) throws SQLException, ClassNotFoundException {\n ArrayList<Product> pro = new ArrayList();\n pro = daoPro.productList(prefVis);\n// value = daoPro.productList(prefVis);\n if (value != null) {\n Gson s = new Gson();\n\n return Response.ok(s.toJson(pro)).build();\n } else {\n return Response.status(Response.Status.BAD_REQUEST).entity(new Gson().toJson(\"No se encontraron productos para mostrar.\")).build();\n }\n }",
"private void search(String product) {\n // ..\n }",
"@GetMapping(path = \"/products/{id}\")\n public ResponseEntity<Product> getProductById(@PathVariable(name=\"id\") Long id){\n Product product = productService.findById(id);\n if (product!=null)\n return ResponseEntity.ok(product);\n return ResponseEntity.notFound().build();\n }",
"@Override\n\tpublic void searchProduct(HashMap<String, String> searchKeys) {\n\t\tQueryStringFormatter formatter=new QueryStringFormatter(\"http://shopper.cnet.com/1770-5_9-0.html\");\n\t\t\n\t\ttry\n\t\t{\n//\t\t\tformatter.addQuery(\"url\", \"search-alias\");\n\t\t\tif(searchKeys.get(ProductSearch.BRAND_NAME)!=null && searchKeys.get(ProductSearch.PRODUCT_NAME)!=null)\n\t\t\t{\n\t\t\t\tformatter.addQuery(\"query\",(String)searchKeys.get(ProductSearch.BRAND_NAME) +\" \"+ (String)searchKeys.get(ProductSearch.PRODUCT_NAME)+\" \" );\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tString color=(String)searchKeys.get(ProductSearch.COLOR);\n\t\t\tString min=(String)searchKeys.get(ProductSearch.MIN_PRICE);\n\t\t\tString max=(String)searchKeys.get(ProductSearch.MAX_PRICE);\n\t\t\tif(color!=null){\n\t\t\t\tformatter.addQuery(\"color\",color);\n\t\t\t}\n\t\t\tif(min.length()>0&&max.length()>0)\n\t\t\t{\n\t\t\t//formatter.addQuery(\"color\",(String)searchKeys.get(HeadPhonesSearch.COLOR_S)+\" Price between $\"+(String)searchKeys.get(HeadPhonesSearch.MIN_PRICE)+\" to $\"+(String)searchKeys.get(HeadPhonesSearch.MAX_PRICE));\n\t\t\t\t\n\t\t\t\tformatter.addQuery(\" Price between $\",min +\" to $\"+max);\n\t\t\t}\n\t\t\tformatter.addQuery(\"tag\",\"srch\");\n\t\t\t\n\t\t\tString finalQueryString=\"http://shopper.cnet.com/1770-5_9-0.html\"+formatter.getQueryString();\n\t\t\tSystem.out.println(\"query string :\"+formatter.getQueryString());\n\t\t\tSystem.out.println(\"Query:\"+finalQueryString);\n\t\t\tprocessMyNodes(finalQueryString);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\t\t\t\n\t\t\n\t}",
"@Test\n public void testGetProductsSearchAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.getProductsSearchAction(\"{text}\", \"{filter}\", \"{selectedFacets}\", \"{queryFacets}\", \"{sort}\", -1, -1);\n List<Integer> expectedResults = Arrays.asList(200, 400);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/PagedResponseProduct\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }",
"private Future<JsonObject> fetchItem(String id) {\n Promise<JsonObject> p = Promise.promise();\n client\n .get(catPort, catHost, catItemPath)\n .addQueryParam(ID, id)\n .send()\n .onFailure(\n ar -> {\n ar.printStackTrace();\n p.fail(INTERNALERROR);\n })\n .onSuccess(\n obj -> {\n JsonObject res = obj.bodyAsJsonObject();\n if (obj.statusCode() == 200)\n {\n if (res.getString(STATUS).equals(status.SUCCESS.toString().toLowerCase()))\n p.complete(obj.bodyAsJsonObject().getJsonArray(RESULTS).getJsonObject(0));\n }\n else{\n if (obj.statusCode() == 404)\n p.fail(ITEMNOTFOUND + id);\n else{\n LOGGER.error(\"failed fetchItem: \" + res);\n p.fail(INTERNALERROR);\n }\n\n }\n });\n return p.future();\n }",
"public static void main(String args[]) throws IOException{\n final Client client = ClientBuilder.newClient();\r\n final WebTarget product = client.target(\"http://localhost:8080/product-rs/webresources\").path(\"/Product/Product/4/xml\");\r\n \r\n //post the message\r\n product.request(\"text/xml\").post(Entity.xml(new Product()));\r\n \r\n System.err.println(\"Message Product Posted\");\r\n System.in.read();\r\n \r\n Product p = product.request(\"text/xml\").get(Product.class);\r\n System.err.println(\"Message Product Posted\");\r\n \r\n }",
"public interface GetDealItems {\n @GET(\"?route=dealitem\")\n Call<DealItemsResult> getDealitems();\n\n @GET(\"?route=dealitem&id={id}\")\n Call<Dealitem> select(@Path(\"id\") int id);\n}",
"public static void main(String[] args) throws IOException {\n PredictionServiceConnector con = new PredictionServiceConnector(\"127.0.0.1\", 5000);\n List<AttributeValuePair> query = Lists.newArrayList(\n new AttributeValuePair(Attributes.get().getFromId(\"5579088\"), \"25\"),\n new AttributeValuePair(Attributes.get().getFromId(\"3675717\"), \"1\"),\n new AttributeValuePair(Attributes.get().getFromId(\"5594105\"), \"5\"),\n new AttributeValuePair(Attributes.get().getFromId(\"3673271\"), \"1\"),\n new AttributeValuePair(Attributes.get().getFromId(\"4087191\"), \"6.5\")\n );\n Optional<PredictionWithConfidence> res = con.requestPrediction(query, \"\");\n System.out.println(res);\n }",
"public interface ApiService {\n\n @GET(\"products.json\")\n Call<Product> loadProduct();\n\n}",
"public interface TappMarketService {\n\n @GET(\"product-categories\")\n Call<List<Category>> getCategories();\n\n @GET(\"product-categories/{id}\")\n Call<JsonObject> getSubcategoriesJsonObject(\n @Path(\"id\") String id);\n\n @GET(\"product-categories/{id}\")\n Call<Subcategory> getSubcategories(\n @Path(\"id\") String id);\n\n @GET(\"product-categories/{id}\")\n Call<ProductList> getProducts(\n @Path(\"id\") String id);\n\n}",
"private void newVolume(){\n Intent intent = getIntent();\n\n id = intent.getStringExtra(\"Id\");\n\n newUrl = \"https://www.googleapis.com/books/v1/volumes/\"+id;\n\n // Request a string response from the provided URL.\n StringRequest stringRequest = new StringRequest(Request.Method.GET, newUrl,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.d(\"RESPONSE\", \"onResponse: \" + response);\n\n parseJSONResponse(response);\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"SHIT\", \"onErrorResponse: wrong\");\n }\n });\n queue.add(stringRequest);\n }",
"public static void DemoMethod() {\n System.out.println(GetRequestDemoMethod(\"catalog-item\", \"1541\"));\n System.out.println(PostEntityDemoMethod(\"catalog-item\", CatalogItemEpisodePostExampleJson));\n System.out.println(UpdateEntityDemoMethod(\"catalog-item\", \"1561\", CatalogItemEpisodePutExampleJson));\n System.out.println(DeleteEntityDemoMethod(\"catalog-item\", \"1557\"));\n }",
"public static void main(String[] args) {\n\r\n\t\tchar pwd1 = '\"';\r\n\t\tString pwd2 = \"ewf\";\r\n\t\tString pwd = \"dnXhw98r$W3d23D?\" + pwd1 + pwd2;\r\n\r\n\t\tString uri = \"https://chevronproductsuklim-dev.outsystemsenterprise.com/LubeChartWS/rest/eWave/GetRecommendedProductDelta?From=2017-10-07\";\r\n\r\n\t\tRestTemplate restTemplate = new RestTemplate();\r\n\t\tObject str = restTemplate.exchange(uri, HttpMethod.GET,\r\n\t\t\t\tnew HttpEntity<String>(createHeaders(\"eWaveLCUser\", pwd)), String.class);\r\n\t\tSystem.out.println(str);\r\n\t}",
"public static int doGetList(Result r) {\n // Make an HTTP GET passing the name on the URL line\n r.setValue(\"\");\n String response = \"\";\n HttpURLConnection conn;\n int status = 0;\n try {\n \n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n // tell the server what format we want back\n conn.setRequestProperty(\"Accept\", \"text/plain\");\n // wait for response\n status = conn.getResponseCode();\n // If things went poorly, don't try to read any response, just return.\n if (status != 200) {\n // not using msg\n String msg = conn.getResponseMessage();\n return conn.getResponseCode();\n }\n String output = \"\";\n // things went well so let's read the response\n BufferedReader br = new BufferedReader(new InputStreamReader(\n (conn.getInputStream()))); \n while ((output = br.readLine()) != null) {\n response += output; \n } \n conn.disconnect();\n \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n // return value from server\n // set the response object\n r.setValue(response);\n // return HTTP status to caller\n return status;\n }",
"@GetMapping(path = \"/products/search/{query}\")\n public ResponseEntity<List<Product>> searchProducts(@PathVariable(name=\"query\") String query){\n return ResponseEntity.ok(productService.search(query));\n }",
"@GetMapping(\"/findProduct/{productid}\")\n @ResponseBody\n public ResponseEntity<ProductEntity> findProductByID(@PathVariable Integer productid) {\n ProductEntity productResponse = productService.viewproductbyid(productid);\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }",
"public void productBarcodeHandler(JSONObject response) {\n try {\n JSONObject productInfo = response.getJSONObject(\"product\");\n JSONArray keywords = productInfo.getJSONArray(\"_keywords\");\n\n String name = productInfo.getString(\"product_name\");\n int resID = R.drawable.food_misc;\n\n for (int i = 0; i < keywords.length(); i++) {\n String keyword = keywords.getString(i);\n\n if (keyword.contains(\" \")) {\n keyword = keyword.replace(\" \", \"_\");\n }\n\n int resource = this.getResources().getIdentifier(\"food_\" + keyword, \"drawable\", this.getPackageName());\n if (resource != 0) {\n resID = resource;\n break;\n }\n }\n\n Intent intent = new Intent(this, ItemEntry.class);\n intent.putExtra(\"FOOD_NAME\", name);\n intent.putExtra(\"FOOD_PIC\", resID);\n startActivity(intent);\n }\n catch (Exception e) {\n Toast.makeText(getApplicationContext(),\"ERROR finding product!\", Toast.LENGTH_LONG).show();\n Log.e(\"UPC Scan Error:\", e.getMessage());\n e.printStackTrace();\n }\n }",
"@GetMapping(\"\")\n @ResponseBody\n public List<Product> findAlProductsByCateId(@RequestParam(\"categoryid\") String cateId){\n List<Product> productList = new ArrayList<>();\n try {\n long id = Long.parseLong(cateId);\n productList = productService.findAllProductsByCateId(id);\n } catch (Exception e) {\n e.getMessage();\n }\n return productList;\n }",
"public interface RestaurantEndpoints {\n @GET(\"/restaurants\")\n Call<ArrayList<GETRestaurantResponse>> getRestaurants(@Query(\"priceeq\") String priceEquals,\n @Query(\"pricelte\") String priceLte,\n @Query(\"pricegte\") String priceGte,\n @Query(\"city\") String city,\n @Query(\"name\") String name,\n @Query(\"address\") String address);\n @GET(\"/restaurant_statistics\")\n Call<GETRestaurantStatisticsResponse> getRestaurantStatistics(@Query(\"name\") String name, @Query(\"address\") String address);\n\n @PUT(\"/restaurants\")\n Call<Void> updateRestaurantOwner(@Body PUTRestaurantRequest putRestaurantRequest);\n\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(\"http://youfood.ddns.net\")\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n RestaurantEndpoints restaurantEndpoints = retrofit.create(RestaurantEndpoints.class);\n}",
"@Test\r\n\tpublic void deleteProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Almond\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.delete(\"/7\");\r\n\t\tSystem.out.println(\"DELETE Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}",
"public Product getProduct(long productId) {\n\t\tProduct product = restTemplate.getForObject(\"http://PRODUCT-SERVICE/products/product-id/\" + productId, Product.class);\n\t\treturn product;\n\t}",
"@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET, produces = \"application/json\")\n\tpublic ResponseEntity<Product> getSingleProduct(@PathVariable int productId) {\n\t\tProduct productById = pm.getProductById(productId);\n\t\tif (productById != null) {\n\t\t\treturn new ResponseEntity<Product>(productById, HttpStatus.OK);\n\t\t}\n\t\treturn new ResponseEntity<Product>(productById, HttpStatus.NOT_FOUND);\n\t}",
"@GET\n @Path(\"/getRecipes\")\n public Response getRecipes(\n @QueryParam(\"items\") String ingredients\n ){\n\n try {\n String decodedRecipes = URLDecoder.decode(ingredients, \"UTF-8\");\n } catch (Exception e){\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(\"Error\")\n .build();\n }\n\n String baseURL = \"https://api.edamam.com/search\";\n Client client = ClientBuilder.newClient();\n\n WebTarget target = client.target(baseURL)\n .queryParam(\"app_id\", \"d1fc9900\")\n .queryParam(\"app_key\", \"a9307ac9d85fe8df2ad5d37597245915\")\n .queryParam(\"q\", ingredients);\n String response = target.request().get(String.class);\n\n JSONObject jsonObject = new JSONObject(response);\n\n String recipes = jsonObject.get(\"hits\").toString();\n\n JSONArray array = new JSONArray(recipes);\n\n StringBuilder results = new StringBuilder();\n for(int i = 0; i < array.length(); i++){\n JSONObject object = (JSONObject) array.get(i);\n JSONObject recipeObject = (JSONObject) object.get(\"recipe\");\n\n //System.out.println(recipeObject.keySet());\n// System.out.println(\"Label: \" + recipeObject.get(\"label\"));\n// System.out.println(\"Image: \" + recipeObject.get(\"image\"));\n// System.out.println(\"URL: \" + recipeObject.get(\"url\"));\n// System.out.println();\n\n JSONObject data = new JSONObject();\n data.put(\"label\", recipeObject.get(\"label\"));\n data.put(\"image\", recipeObject.get(\"image\"));\n data.put(\"url\", recipeObject.get(\"url\"));\n\n results.append(data.toString() + \"∑\");\n }\n\n System.out.println(results.toString());\n\n return Response.ok(results.toString()).build();\n\n // Parsing JSON response\n\n//\n// ObjectMapper objectMapper = new ObjectMapper();\n//\n// try{\n// Map<String, Object> map = objectMapper.readValue(response, new TypeReference<Map<String, Object>>() {\n// });\n//\n// //StringTokenizer tokenizer = new StringTokenizer(map.get(\"hits\").toString(), \"recipe=\");\n// // System.out.println(map.get(\"hits\"));\n// //System.out.println(map.keySet());\n//\n// }\n// catch (Exception e){\n// System.out.println(\"Error parsing string\");\n// }\n// return null;\n }",
"@Test\n @OperateOnDeployment(\"server\")\n public void shouldGetResourceMatchingId() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(200).and().expect().body(\"name\",\n equalTo(\"Audiences\")).and().expect().body(\"sort\", equalTo(15)).when().get(getBaseTestUrl() + \"/1/category/get/json/1\");\n }",
"@Override\n\t\tpublic void searchProduct(HashMap<String, String> searchKeys) {\n\t\t\t \n\t\t\tQueryStringFormatter formatter=new QueryStringFormatter(\"http://www.target.com/s\");\n\t\t\ttry{\n\t\t\t\t//formatter.addQuery1(\"query\", \"ca77b9b4beca91fe414314b86bb581f8en20\");\n\t\t\t\t\n\t\t\t\tString color=(String)searchKeys.get(ProductSearch.COLOR);\n\t\t\t\tString min=(String)searchKeys.get(ProductSearch.MIN_PRICE);\n\t\t\t\tString max=(String)searchKeys.get(ProductSearch.MAX_PRICE);\n\t\t\t\t\n\t\t\t\tif((searchKeys.get(ProductSearch.BRAND_NAME)!=null) && (searchKeys.get(ProductSearch.PRODUCT_NAME)!=null)){\n\t\t\t\t\t\n\t\t\t\tformatter.addQuery1(\"searchTerm\",(String)searchKeys.get(ProductSearch.BRAND_NAME)+\" \"+(String)searchKeys.get(ProductSearch.PRODUCT_NAME));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(color!=null){\n\t\t\t\tformatter.addQuery1(\"\",color);\n\t\t\t\t}\n\t\t\t\tif(min.length()>0&&max.length()>0)\n\t\t\t\t{\n\t\t\t\t//formatter.addQuery(\"color\",(String)searchKeys.get(HeadPhonesSearch.COLOR_S)+\" Price between $\"+(String)searchKeys.get(HeadPhonesSearch.MIN_PRICE)+\" to $\"+(String)searchKeys.get(HeadPhonesSearch.MAX_PRICE));\n\t\t\t\t\t\n\t\t\t\t\tformatter.addQuery1(\" Price between $\",min +\" to $\"+max);\n\t\t\t\t}\n\t\t\t\tString finalQueryString=\"http://www.target.com/s\"+formatter.getQueryString();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Query:\"+finalQueryString);\n\t\t\t\tprocessMyNodes(finalQueryString);\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}",
"public interface PromotionEndpoints {\n\n @GET(\"/promotions\")\n Call<ArrayList<GETPromotionResponse>> getPromotionsForRestaurant(\n @Query(\"restaurant_name\") String name, @Query(\"restaurant_address\") String address);\n\n @POST(\"/promotions\")\n Call<Void> createPromotion(@Body POSTPromotionRequest createPromotionRequest);\n\n @DELETE(\"/promotions\")\n Call<Void> deletePromotion(@Query(\"restaurant_name\") String name,\n @Query(\"restaurant_address\") String address,\n @Query(\"date\") String date,\n @Query(\"description\") String description);\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(\"http://youfood.ddns.net\")\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n PromotionEndpoints promotionEndpoints = retrofit.create(PromotionEndpoints.class);\n}",
"Product getProductDetails(int idproduct) throws DataBaseException;",
"@GetMapping(\"/product\")\n public String productList(Model model) {\n List<Product> productList = sportyShoesService.getProductList();\n model.addAttribute(\"productList\", productList);\n model.addAttribute(\"appName\", appName);\n return \"product\";\n }",
"Product findProductById(Long id);",
"Product getProductByProductName(String productName);",
"@RequestMapping(method = RequestMethod.GET, value = \"{sku}\")\n\tpublic ResponseEntity<?> getCatalogItem(@PathVariable String sku) {\n\t\tBraveSpanContext openTracingContext = getTracingContext();\n\t\tio.opentracing.Span span = tracer.buildSpan(\"GetCatalogByIdFromService\").asChildOf(openTracingContext)\n\t\t\t\t.withTag(\"Description\", \"Get Catalog Item\")\n\t\t\t\t.withTag(\"http_request_url\", request.getRequestURI()).start();\n\t\tbrave.Span braveSpan = ((BraveSpan) span).unwrap();\n\t\tbraveSpan.kind(Kind.SERVER);\n\t\tSummary.Timer requestTimer = Prometheus.requestLatency.startTimer();\n\t\ttry {\n\t\t\tPrometheus.getCounters.inc();\n\t\t\tPrometheus.inProgressRequests.inc();\n\t\t\tio.opentracing.Span mongospan = tracer.buildSpan(\"MongoService\").asChildOf(span)\n\t\t\t\t\t.withTag(\"Description\", \"MongoDB Service Call\").start();\n\t\t\tbrave.Span braveMongoSpan = ((BraveSpan) mongospan).unwrap();\n\t\t\tCatalog catalogItem = service.getCatalogItem(sku, mongospan);\n\t\t\tbraveMongoSpan.finish();\n\t\t\tif (catalogItem == null) {\n\t\t\t\treturn new ResponseEntity<>(HttpStatus.NOT_FOUND);\n\t\t\t} else {\n\t\t\t\treturn new ResponseEntity<>(catalogItem, HttpStatus.OK);\n\t\t\t}\n\t\t} catch (Exception exc) {\n\t\t\tPrometheus.requestFailures.inc();\n\t\t\tlog.error(\"Error in getCatalogItem\", exc);\n\t\t\tspan.setTag(\"error\", exc.getMessage());\n\t\t\treturn new ResponseEntity<>(exc.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t} finally {\n\t\t\trequestTimer.observeDuration();\n\t\t\tPrometheus.inProgressRequests.dec();\n\t\t\tspan.finish();\n\t\t}\n\t}",
"@RequestMapping(value = \"/products/{productId}\", method = RequestMethod.GET)\n\t public ResponseEntity<ProductData> getProductDetails(@PathVariable int productId){\t\t\t\t\t\n\t ProductData product = productService.getProduct(productId);\n\t return new ResponseEntity<>(product, HttpStatus.OK);\n\t }",
"public interface RecipeService {\n\n @GET(\"/search\")\n Observable<SearchResult> search(@Query(\"q\") String q,\n @Query(\"app_id\") String appid,\n @Query(\"app_key\") String appkey,\n @Query(\"from\") String from,\n @Query(\"to\") String to);\n\n}"
]
| [
"0.6053634",
"0.594346",
"0.5770166",
"0.5769567",
"0.57565576",
"0.567018",
"0.5609908",
"0.55631477",
"0.55294394",
"0.5464955",
"0.54465926",
"0.5403859",
"0.5367094",
"0.53591055",
"0.5335217",
"0.5314748",
"0.52932334",
"0.5279105",
"0.5203749",
"0.5198371",
"0.51965684",
"0.51847",
"0.51847",
"0.5146745",
"0.5144",
"0.51438093",
"0.5129091",
"0.51234937",
"0.51221895",
"0.51122826",
"0.5111117",
"0.5104654",
"0.50862944",
"0.5085921",
"0.5068989",
"0.50578535",
"0.5056158",
"0.5025151",
"0.50220066",
"0.5015024",
"0.50067675",
"0.5004317",
"0.50037295",
"0.5003282",
"0.49797934",
"0.4978549",
"0.49703863",
"0.49608684",
"0.49316365",
"0.49287257",
"0.49144453",
"0.49064174",
"0.4903238",
"0.48919758",
"0.4884625",
"0.48810872",
"0.4876715",
"0.48678663",
"0.4865955",
"0.4850737",
"0.4847752",
"0.48431855",
"0.4841084",
"0.48387578",
"0.4836971",
"0.48337945",
"0.48301747",
"0.48280445",
"0.48243365",
"0.48155382",
"0.48102784",
"0.48014978",
"0.48004028",
"0.47993645",
"0.47886464",
"0.47857833",
"0.4774267",
"0.4770238",
"0.4769278",
"0.47668487",
"0.47661918",
"0.47635567",
"0.47617528",
"0.47495216",
"0.47426066",
"0.47381413",
"0.47380677",
"0.47369674",
"0.47301832",
"0.47296435",
"0.4725614",
"0.47230756",
"0.47227865",
"0.4722347",
"0.4722118",
"0.47162375",
"0.4713295",
"0.4708858",
"0.46986496",
"0.46966708"
]
| 0.7273634 | 0 |
$1.00 for first thirty minutes, and any portion of 30 min after | public double getCost(int miles, int time) {
return 1.00 + (time / 30 );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test public void shouldGive60MinFor150cent() {\r\n // First hour: $1.5\r\n assertEquals( 60 /*minutes*/, rs.calculateTime(150) ); \r\n }",
"@Test public void shouldGive240MinFor950cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 4 * 60 /*minutes*/ , rs.calculateTime(950) ); \r\n }",
"@Test public void shouldGive120MinFor350cent() {\r\n // Two hours: $1.5+2.0\r\n assertEquals( 2 * 60 /*minutes*/ , rs.calculateTime(350) ); \r\n }",
"@Test public void shouldGive180MinFor650cent() {\r\n // Three hours: $1.5+2.0+3.0\r\n assertEquals( 3 * 60 /*minutes*/ , rs.calculateTime(650) ); \r\n }",
"public void addMinutes(int minutes)\n {\n\n int h = minutes / 60;\n int m = minutes - (h * 60);\n\n hour += h;\n\n if (minute == 30 && m == 30)\n {\n minute = 0;\n hour++;\n }\n else\n {\n minute += m;\n }\n }",
"public int getMinuteFraction()\n {\n return (((int)(hours*100.0)%100)*60)/100;\n }",
"private static String minuteInWord(final int minute) {\n\t\tif( minute == 0 ) {\n\t\t\treturn \"o' clock\";\n\t\t}else if(minute == 15 || minute == 30) {\n\t\t\treturn getFromNumber(minute).getWord();\n\t\t} else {\n\t\t\treturn getFromNumber(minute).getWord() + (minute > 1 ? \" minutes\" : \" minute\");\n\t\t}\n\t}",
"void milestone4(int inputSeconds){\n int days = inputSeconds / 86400;\n int seconds = inputSeconds % 86400;\n int hours = seconds / 3600;\n seconds = seconds % 3600;\n int minutes = seconds / 60;\n seconds = seconds % 60;\n\n System.out.println(\"Day/s: \" + days);\n System.out.println(\"Hour/s: \" + hours);\n System.out.println(\"Minute/s: \" + minutes);\n System.out.println(\"Second/s: \" + seconds);\n }",
"public MyTime nextMinute(){\n\t\tint second = getSeconds();\n\t\tint minute = getMinute();\n\t\tint hour = getHours();\n\t\t\n\t\tif (minute!=59){\n\t\t\tminute++;\n\t\t}\n\t\telse{\n\t\t\tminute = 0;\n\t\t\tif (hours!=23){\n\t\t\t\thour++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\thour = 0;\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\t\n\t\treturn new MyTime(hour,minute,second);\n\t}",
"@Override\n public int getTimeForNextTicInSeconds() {\n int seconds = Calendar.getInstance().get(Calendar.SECOND);\n return 60 - seconds;\n }",
"public static String hoursMinutesSeconds(double t) {\n int hours = (int) t/3600;\n int rem = (int) t - hours*3600;\n int mins = rem / 60;\n int secs = rem - mins*60;\n //return String.format(\"%2d:%02d:%02d\", hours, mins, secs);\n return String.format(\"%d:%02d:%02d\", hours, mins, secs);\n }",
"Integer getMinute();",
"public static void main(String[] args) {\n\t\tint sec=60;\n\t\t int secondsAfter15 = 0;\n\t for(int i=1;i<=30;i++) {\n\t \tsecondsAfter15=60*i;\n\t }\n\t System.out.println(secondsAfter15);\n\t\t/*\n\t\t * Напиши код, который считает сколько секунд прошло с 15:00, если на часах\n\t\t * 15:30. Выведи результат на экран. Требования:\n\t\t * \n\t\t * Программа должна выводить текст.\n\t\t * \n\t\t * Выведенный текст должен быть целым положительным числом.\n\t\t * \n\t\t * Выведенное число должно быть кратно 60.\n\t\t * \n\t\t * Выводимое число должно соответствовать заданию.\n\t\t */\n\t}",
"private double convertSecondsToMinutes(int seconds) {\r\n int sec = seconds;\r\n int min = 0;\r\n while (sec > 60) {\r\n sec -= 60;\r\n min++;\r\n }\r\n return Double.valueOf(min + \".\" + sec);\r\n }",
"public static void main(String[] args) {\n for (int t =0; t<=30; t++) {\n\t if (t<10) {\n\t System.out.println(\"The time is 07:\" + \"0\" +t);\n }else {\n\t System.out.println(\"The time is 07:\" +t);\n }\n\t\n\t}\n\tint min = 0;\n\twhile (min<=30) {\n\t\tif (min <10) {\n\t\t\t System.out.println(\"The time is 07:\" + \"0\" +min);\t\n\t\t}else {\n\t\t\t System.out.println(\"The time is 07:\" +min);\n\t\t}\n\tmin++;\n\t}\n\tint minute = 0;\n\tdo {\n\t\tif (minute<10) {\n\t\t\t System.out.println(\"The time is 07:\" + \"0\" +minute);\n\t\t}else {\n\t\t\t System.out.println(\"The time is 07:\" +minute);\n\t\t}\n\tminute++;\n\t}while (minute<31);\n\t}",
"private int secToMin(int sec){\n return sec/60;\n }",
"public DateTimeFormatterBuilder appendSecondOfMinute(int minDigits) {\r\n return appendDecimal(DateTimeFieldType.secondOfMinute(), minDigits, 2);\r\n }",
"@Test\n public void testSplitTime(){\n \tCountDownTimer s = new CountDownTimer();\n \ts.splitTime(3975);\n \tassertEquals(s.toString(), \"1:06:15\");\n \t\n \ts.splitTime(45);\n \tassertEquals(s.toString(), \"0:00:45\");\n \t\n }",
"protected String mo3406c() {\n return \"Minute\";\n }",
"public static String FormatDateTimeToNearestMinute(long apiDateTime)\n {\n ZonedDateTime dateTime = Instant.ofEpochSecond(apiDateTime).atZone(ZoneOffset.UTC);\n\n // Round to the nearest whole minute.\n if (dateTime.getSecond() >= 30)\n {\n dateTime = dateTime.truncatedTo(ChronoUnit.MINUTES).plus(1, ChronoUnit.MINUTES);\n }\n\n return dateTime.format(FMT_DT_AS_MINUTES);\n }",
"private String readableTime(Integer minutes) {\r\n String time = \"\";\r\n if (minutes / 60.0 > 1) {\r\n time = (minutes / 60) + \" hrs, \"\r\n + (minutes % 60) + \" min\";\r\n } else {\r\n time = minutes + \" min\";\r\n }\r\n return time;\r\n }",
"public int getIntervalMinutes();",
"private int convertProgressToMinutes(int progress) {\n return progress * MINUTE_PER_PROGRESS;\n }",
"public void uneMinuteDePlus() {\n\t\tthis.m = m+1 > 59 ? 0 : m+1;\n\t}",
"public static String m34537a(long j) {\n Formatter format;\n if (j <= 0 || j >= LogBuilder.MAX_INTERVAL) {\n return \"00:00\";\n }\n long j2 = j / 1000;\n int i = (int) (j2 % 60);\n int i2 = (int) ((j2 / 60) % 60);\n int i3 = (int) (j2 / 3600);\n Formatter formatter = new Formatter(new StringBuilder(), Locale.getDefault());\n if (i3 > 0) {\n format = formatter.format(\"%d:%02d:%02d\", Integer.valueOf(i3), Integer.valueOf(i2), Integer.valueOf(i));\n } else {\n format = formatter.format(\"%02d:%02d\", Integer.valueOf(i2), Integer.valueOf(i));\n }\n return format.toString();\n }",
"private static String hhhmmss(double totalseconds)\n {\n final int SECONDS_PER_MINUTE = 60;\n final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60;\n\n int hours = (int) (totalseconds / SECONDS_PER_HOUR);\n int minutes = (int) ((totalseconds % SECONDS_PER_HOUR)) / SECONDS_PER_MINUTE;\n double seconds = totalseconds % SECONDS_PER_MINUTE;\n\n return String.format(\"%d:%02d:%05.2f\", hours, minutes, seconds);\n }",
"private static String hhhmmss(double totalseconds)\n {\n final int SECONDS_PER_MINUTE = 60;\n final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60;\n\n int hours = (int) (totalseconds / SECONDS_PER_HOUR);\n int minutes = (int) ((totalseconds % SECONDS_PER_HOUR)) / SECONDS_PER_MINUTE;\n double seconds = totalseconds % SECONDS_PER_MINUTE;\n\n return String.format(\"%d:%02d:%05.2f\", hours, minutes, seconds);\n }",
"public String getFormattedTimeFromStart() {\r\n if (history.getNumberOfJumpsSoFar() == 0) {\r\n return \"00:00\";\r\n }\r\n\r\n double time = history.getTimeFromStart();\r\n double maxTime = 59.59;\r\n if (time < maxTime) {\r\n return String.format(\"%02d:%02d\", (int) (time % 60), (int) (time * 100 % 100));\r\n } else {\r\n return \"59:59\";\r\n }\r\n }",
"public int getMinute() { return this.minute; }",
"private String formatTime(int seconds){\n return String.format(\"%02d:%02d\", seconds / 60, seconds % 60);\n }",
"private String secondsToMinutesAndSeconds(double seconds) {\n\t\tint numberOfminutes = (int) (seconds / 60);\n\t\tint numberOfSeconds = (int) (seconds % 60);\n\t\tif (numberOfSeconds < 10) {\n\t\t\treturn numberOfminutes + \":0\" + numberOfSeconds;\n\t\t} else {\n\t\t\treturn numberOfminutes + \":\" + numberOfSeconds;\n\t\t}\n\t}",
"public int getMinutes(){\n return (int) ((totalSeconds%3600)/60);\n }",
"public DateTimeFormatterBuilder appendMinuteOfHour(int minDigits) {\r\n return appendDecimal(DateTimeFieldType.minuteOfHour(), minDigits, 2);\r\n }",
"public static String getDurationString(long minutes, long seconds) {\n if(minutes>=0 && (seconds >=0 && seconds<=59)){\n// minutes = hours/60;\n// seconds = hours/3600;\n long hours = minutes / 60;\n long remainingMinutes = minutes % 60;\n\n return hours + \" h \" + remainingMinutes + \"m \" + seconds + \"s\";\n }\n else\n\n {\n return \"invalid value\";\n }\n }",
"public static int secondsAfterMidnight(String t) {\n int seconds; //initializing seconds, will be returned to main.\n t.toLowerCase(); //setting all input to lowercase so it is easier to handle.\n if (t.length() == 10){ //if input is 10 characters\n // if statement below checks whether each character is appropriate before continuing.\n if((t.startsWith(\"0\") || t.startsWith(\"1\"))&& Character.isDigit(t.charAt(1))&& \n t.charAt(2) == ':' && Character.isDigit(t.charAt(3))&& Character.isDigit(t.charAt(4))&&\n t.charAt(5) == ':' && Character.isDigit(t.charAt(6))&& Character.isDigit(t.charAt(7))&&\n (t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n // Characters converted to numeric values and hours, minutes, and seconds are\n // calculated below.\n int hours = Character.getNumericValue(t.charAt(0))*10 \n + Character.getNumericValue(t.charAt(1));\n //if hours is equal to 12 such as 12:35, switched to 0:35, for easier calc.\n if(hours == 12){ \n hours = 0;\n }\n int minutes = Character.getNumericValue(t.charAt(3))*10 \n + Character.getNumericValue(t.charAt(4));\n seconds = Character.getNumericValue(t.charAt(6))*10 \n + Character.getNumericValue(t.charAt(7)); \n if(minutes < 60 && seconds < 60){//checks whether minute and second input is below 60.\n if(t.endsWith(\"pm\")){ //adding 43200 (12 hours in seconds) if time is pm.\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1; //if proper input is not given, seconds set to -1.\n }\n } else {\n seconds = -1; //improper input leads to seconds set to -1.\n }\n //below is for input that has 9 characters, such as 9:12:23am, instead of 09:12:23am. The code below\n // is very similar to to code for 10 characters above. \n }else if (t.length() == 9){\n if(Character.isDigit(t.charAt(0))&& t.charAt(1) == ':' && Character.isDigit(t.charAt(2))\n && Character.isDigit(t.charAt(3))&& t.charAt(4) == ':' && Character.isDigit(t.charAt(5))\n && Character.isDigit(t.charAt(6))&&(t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n int hours = Character.getNumericValue(t.charAt(0));\n int minutes = Character.getNumericValue(t.charAt(2))*10 \n + Character.getNumericValue(t.charAt(3));\n seconds = Character.getNumericValue(t.charAt(5))*10 \n + Character.getNumericValue(t.charAt(6)); \n if(minutes < 60 && seconds < 60){\n if(t.endsWith(\"pm\")){\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1;\n }\n } else {\n seconds = -1;\n }\n }else{ // if input has neither 10 or 9 characters, input not proper.\n seconds = -1;\n }\n return seconds; //seconds is returned to main.\n}",
"public void advanceTime(){\n\t\tminute++;\r\n\t\twhile (minute > 59) {\r\n\t\t\tminute -= 60;\r\n\t\t\thour++;\r\n\t\t}\r\n\t\twhile (hour > 23) {\r\n\t\t\thour -= 24;\r\n\t\t\tday++;\r\n\t\t}\r\n\t\twhile (day > 6) {\r\n\t\t\tday -= 7;\r\n\t\t\tweek++;\r\n\t\t\ttotalMoney += abonnementen * 40;\r\n\t\t}\r\n\t\twhile(week > 51) {\r\n\t\t\tweek -= 52;\r\n\t\t}\r\n\t\t//System.out.println(\"advanceTime: \"+\"week: \"+ week + \" day: \"+ day +\" hour: \" + hour +\" minute: \"+ minute+ \" Money earned = \" + Math.round(totalMoney));\r\n\t}",
"public Clock (double tic) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // 1\n\t\tif (tic <= 0.0 || tic > 1800.0) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid tic value\");\n\t\t}\n\t\tthis.tic = tic;\n\t}",
"static long getMinutesPart(Duration d) {\n long u = (d.getSeconds() / 60) % 60;\n\n return u;\n }",
"public static DateTime floorToTenMinutes(DateTime value) {\n return floorToMinutePeriod(value, 10);\n }",
"@Test\n public void floorToTenMinutes() throws Exception {\n DateTime dt0 = new DateTime(2009,6,24,23,29,30,789,DateTimeZone.UTC);\n\n Assert.assertNull(DateTimeUtil.floorToTenMinutes(null));\n \n // floor to nearest half hour\n DateTime dt1 = DateTimeUtil.floorToTenMinutes(dt0);\n\n Assert.assertEquals(2009, dt1.getYear());\n Assert.assertEquals(6, dt1.getMonthOfYear());\n Assert.assertEquals(24, dt1.getDayOfMonth());\n Assert.assertEquals(23, dt1.getHourOfDay());\n Assert.assertEquals(20, dt1.getMinuteOfHour());\n Assert.assertEquals(0, dt1.getSecondOfMinute());\n Assert.assertEquals(0, dt1.getMillisOfSecond());\n Assert.assertEquals(DateTimeZone.UTC, dt1.getZone());\n\n DateTime dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,0,0,0));\n Assert.assertEquals(new DateTime(2009,6,24,10,0,0,0), dt3);\n\n dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,1,23,456));\n Assert.assertEquals(new DateTime(2009,6,24,10,0,0,0), dt3);\n\n dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,30,12,56));\n Assert.assertEquals(new DateTime(2009,6,24,10,30,0,0), dt3);\n\n dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,59,59,999));\n Assert.assertEquals(new DateTime(2009,6,24,10,50,0,0), dt3);\n\n dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,55,59,999));\n Assert.assertEquals(new DateTime(2009,6,24,10,50,0,0), dt3);\n\n dt3 = DateTimeUtil.floorToTenMinutes(new DateTime(2009,6,24,10,46,59,999));\n Assert.assertEquals(new DateTime(2009,6,24,10,40,0,0), dt3);\n }",
"public void setMinute(int value) {\n this.minute = value;\n }",
"private String getMinutesText(LocalDateTime dateTime1, LocalDateTime dateTime2) {\n Duration duration = Duration.between(dateTime1, dateTime2);\n long minutesToDeadline = Math.abs(duration.toMinutes());\n\n if (minutesToDeadline == 1){\n return VALUE_ONE_MINUTE;\n } else {\n return minutesToDeadline + WORD_SPACE + UNIT_MINUTES;\n }\n }",
"public static final Function<Date,Date> addMinutes(final int amount) {\r\n return new Add(Calendar.MINUTE, amount);\r\n }",
"public int interval() {\n return 30;\n }",
"private static void increment_time()\n\t{\n\t\ttime_of_day = time_of_day + 1;\n\t\tif(time_of_day>=120)\n\t\t{\n\t\t\ttime_of_day=time_of_day-120;\n\t\t}\n\t}",
"public static void chargeHire(int minutes) {\n int time = minutes;\n double cost;\n\n if(time >= 0 && time <30) {\n cost = 0;\n }\n else {\n if(time >30 && time < 60) {\n cost = 0.5;\n }\n else {\n if(time > 60 && time < 120) {\n cost = 1.50;\n }\n else{\n if(time > 120 && time <180) {\n cost = 6.50;\n }\n else {\n\n int numOfHalfHours = (time/30);\n int b = (numOfHalfHours - 5);\n int c = (b*2);\n cost = (6.50 + c);\n }\n }\n }\n }\n System.out.println(\"€\" +cost);\n if(cost <= accountBalance) {\n accountBalance = (accountBalance - cost);\n// System.out.println(\"Bike rent successful! you have been charged\" + cost);\n Receipt.printSlip(cost);\n }\n else {\n System.out.println(\"There were insuficient funds in your account.\" + \"\\n\" +\n \"We will now charge the credit card you have provided us instead.\");\n }\n }",
"public static DateTime floorToFiveMinutes(DateTime value) {\n return floorToMinutePeriod(value, 5);\n }",
"static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }",
"private void advanceTime(){\n\t minute++;\n\t while (minute > 59) {\n\t minute -= 60;\n\t hour++;\n\t }\n\t while (hour > 23) {\n\t hour -= 24;\n\t day++;\n\t }\n\t while (day > 6) {\n\t day -= 7;\n\t }\n\n\t }",
"public static DateTime floorToHalfHour(DateTime value) {\n return floorToMinutePeriod(value, 30);\n }",
"public String getMinutes();",
"@Test\n public void computeFactor_WinterTimeHour() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-28 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-28 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.HOUR,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n if (DateTimeHandling.isDayLightSaving(startTimeUsage, endTimeUsage)) {\n // then day has 25 hours\n assertEquals(25, factor, 0);\n } else {\n // then day has 24 hours\n assertEquals(24, factor, 0);\n }\n }",
"public Time( int minutes ) {\n this.minutes = minutes;\n }",
"public static String timeInWords(final int h, final int m) {\n\n\t\tif(m == 0) {\n\t\t\treturn getFromNumber(h).getWord() + \" \" + minuteInWord(m);\n\t\t} else if (m > 30) {\n\t\t\treturn minuteInWord(60 - m) + \" to \" + getFromNumber(h + 1).getWord();\n\t\t} else {\n\t\t\treturn minuteInWord(m) + \" past \" + getFromNumber(h).getWord();\n\t\t}\n\n }",
"@Test\n\tpublic void test() throws InterruptedException {\n\t\tString firstTime = Time.main();\n\t\tString[] splitFirst = firstTime.split(\":\");\n\t\tThread.sleep(5000);\n\t\tString secondTime = Time.main();\n\t\tString[] splitSecond = secondTime.split(\":\");\n\t\t\n\t\t\n\t\tif(Integer.parseInt(splitFirst[2])>=55) //if first time was >= 55 seconds\n\t\t{\n\t\t\tassertEquals(Integer.parseInt(splitSecond[2]),(Integer.parseInt(splitFirst[2])+5)%60); //seconds should increase by 5 mod 60\n\n\t\t\tif(Integer.parseInt(splitFirst[1])==59) //if first time was 59 minutes\n\t\t\t{ \n\t\t\t\tassertTrue(splitFirst[1].equals(\"00\")); //reset to zero minutes\n\t\t\t\t\n\t\t\t\tif(Integer.parseInt(splitFirst[0])==23) //if first time was 23 hours\n\t\t\t\t\tassertTrue(splitFirst[0].equals(\"00\")); //reset to zero hours\n\t\t\t\telse //if first time is not 23 hours\n\t\t\t\t\tassertEquals(Integer.parseInt(splitFirst[0])+1, Integer.parseInt(splitSecond[0])); //hours should increase by 1\n\t\t\t}\n\t\t\telse //if first time was not 59 minutes\n\t\t\t{\n\t\t\t\tassertEquals(Integer.parseInt(splitFirst[1])+1, Integer.parseInt(splitSecond[1])); //minutes should increase by 1\n\t\t\t\tassertTrue(splitFirst[0].equals(splitSecond[0])); //hours should not change\n\t\t\t}\n\t\t}\n\t\telse //if first time was <= 55 seconds\n\t\t{\n\t\t\tassertEquals(Integer.parseInt(splitSecond[2]),(Integer.parseInt(splitFirst[2])+5)); //seconds should increase by 5\n\t\t\tassertTrue(splitFirst[1].equals(splitSecond[1])); //minutes should not change\n\t\t\tassertTrue(splitFirst[0].equals(splitSecond[0])); //hours should not change\n\t\t\t\n\t\t}\n\t\t\n\t}",
"private static String doFormat(long hours, long minutes, long seconds) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif (hours != 0) {\n\t\t\tsb.append(hours);\n\t\t\tsb.append(\"h\");\n\t\t}\n\t\tif (minutes != 0) {\n\t\t\tsb.append(minutes);\n\t\t\tsb.append(\"m\");\n\t\t}\n\t\tif (seconds != 0 || sb.length() == 0) {\n\t\t\tsb.append(seconds);\n\t\t\tsb.append(\"s\");\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public DateTimeFormatterBuilder appendFractionOfMinute(int minDigits, int maxDigits) {\r\n return appendFraction(DateTimeFieldType.minuteOfDay(), minDigits, maxDigits);\r\n }",
"public void setMinute(int value) {\n this.minute = value;\n }",
"public static String time_str(double t) {\n int hours = (int) t/3600;\n int rem = (int) t - hours*3600;\n int mins = rem / 60;\n int secs = rem - mins*60;\n return String.format(\"%02d:%02d:%02d\", hours, mins, secs);\n //return hoursMinutesSeconds(t);\n }",
"private int getMinute() {\n\t\tString time = getPersistedString(this.defaultValue);\n\t\tif (time == null || !time.matches(VALIDATION_EXPRESSION)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn Integer.valueOf(time.split(\":|/\")[1]);\n\t}",
"private String intTime(long l){\r\n String s=\"\";\r\n s+=(char)(((l/1000)/60)+'0')+\":\"+(char)((((l/1000)%60)/10)+'0')+(char)((((l/1000)%60)%10)+'0'); \r\n return s;\r\n }",
"private String formatTime(long nanoSeconds)\n {\n int hours, minutes, remainder, totalSecondsNoFraction;\n double totalSeconds, seconds;\n\n totalSeconds = (double) nanoSeconds / 1000000000.0;\n\n hours = (int) totalSeconds / 3600;\n totalSeconds -= hours * 3600;\n\n minutes = (int) totalSeconds / 60;\n totalSeconds -= minutes * 60;\n\n seconds = totalSeconds;\n\n // Formatting the string that conatins hours, minutes and seconds\n StringBuilder result = new StringBuilder(\"\");\n if (hours > 0) {\n if (hours < 10)\n result.append(\"0\");\n result.append(hours);\n }\n else\n result.append(\"00\");\n result.append(\":\");\n if (minutes > 0) {\n if (minutes < 10)\n result.append(\"0\");\n result.append(minutes);\n }\n else\n result.append(\"00\");\n result.append(\":\");\n if (seconds > 0) {\n if (seconds < 10)\n result.append(\"0\");\n DecimalFormat df = new DecimalFormat(\"##.00\");\n result.append(df.format(seconds));\n }\n else\n result.append(\"00\");\n return result.toString();\n }",
"private void updateTime() \r\n\t {\r\n\t\t \r\n\t\t \tif(Hours.getValue() < 12)\r\n\t\t \t{\r\n\t\t \t\tdisplayString = Hours.getDisplayValue() + \":\" + Minutes.getDisplayValue() + \":\" + Seconds.getDisplayValue() + \" am\";\r\n\t\t System.out.println(displayString);\r\n\t\t \t}\r\n\t\t \t\r\n\t\t \telse if (Hours.getValue() > 12 && Hours.getValue() < 24 )\r\n\t\t \t{\r\n\t\t \t\tdisplayString = Hours.getDisplayValue() + \":\" + Minutes.getDisplayValue() + \":\" + Seconds.getDisplayValue() + \" pm\";\r\n\t\t System.out.println(displayString);\r\n\t\t \t}\r\n\t }",
"private String getMinutesInTime(int time) {\n String hour = String.valueOf(time / 60);\n String minutes = String.valueOf(time % 60);\n\n if(minutes.length() < 2) {\n minutes = \"0\" + minutes;\n }\n\n return hour + \":\" + minutes;\n\n }",
"long getIntervalInSeconds();",
"public MyTime nextSecond(){\n\t\tint second = getSeconds();\n\t\tint minute = getMinute();\n\t\tint hour = getHours();\n\t\tif (second != 59){\n\t\t\tsecond++; \n\t\t}\n\t\telse{\n\t\t\tif (minute!=59){\n\t\t\t\tminute++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tminute = 0;\n\t\t\t\tif (hours!=23){\n\t\t\t\t\thour++;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\thour = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsecond = 0;\n\t\t}\n\t\t\n\t\treturn new MyTime(hour,minute,second);\n\t}",
"private String formatTime(long length) {\n\t\tString hms = \"\";\n\t\tif(length < 3600000) {\n\t\t\thms = String.format(\"%02d:%02d\",\n\t\t\t\t\tTimeUnit.MILLISECONDS.toMinutes(length) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(length)),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toSeconds(length) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(length)));\n\t\t} else {\n\t\t\thms = String.format(\"%02d:%02d:%02d\", TimeUnit.MILLISECONDS.toHours(length),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toMinutes(length) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(length)),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toSeconds(length) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(length)));\n\t\t}\n\n\t\treturn hms;\n\t}",
"private static String createDueTime(final int seconds) {\n return String.format(\n Locale.getDefault(), \"_$%010d$_\",\n System.currentTimeMillis() / 1000 + seconds\n );\n }",
"private void getOneToteTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}",
"public static LocalTime time1(double maxMinutes)\n\t{\n\t\t//declare variables\n\t\tString str;\n\t\tlong newMaxMinutes;\n\t\t\n\t\t//create new scanner object\n\t\tScanner keyboard = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"Please enter your time of departure as hh:mm AM or PM: \");\n\t\tstr = keyboard.nextLine(); //gets user input\n\t\tString t = str.toString(); //converts user input\n\t\tDateTimeFormatter x = DateTimeFormatter.ofPattern(\"hh:mm a\"); //provides format for user input\n\t\tLocalTime time1 = LocalTime.parse(t, x); //parses converted input and format\n\t\tnewMaxMinutes = Math.round(maxMinutes); //converts maxMinutes to long with Math.round function\n\t\tLocalTime arrive = time1.plusMinutes(newMaxMinutes); //adds minutes of maxMinutes to time1 using time class\n\t\t\n\t\treturn arrive;\n\t\t\n\t}",
"private int normalizeTime() {\n int currentTimeSeconds = (int) (System.currentTimeMillis() / 1000);\n\n // The graphing interval in minutes\n // TODO not hardcoded :3\n int interval = 30;\n\n // calculate the devisor denominator\n int denom = interval * 60;\n\n return (int) Math.round((currentTimeSeconds - (denom / 2d)) / denom) * denom;\n }",
"private void setTimeText(int minutes) {\n TextView textTime = (TextView) getView().findViewById(R.id.text_limit);\n setTimeText(minutes, textTime);\n }",
"public DateTimeFormatterBuilder appendMinuteOfDay(int minDigits) {\r\n return appendDecimal(DateTimeFieldType.minuteOfDay(), minDigits, 4);\r\n }",
"public String secondsToMinutes(int seconds){\n int minutes = 0;\n while(seconds >= 60){\n seconds -= 60;\n minutes++;\n }\n String sec;\n if(seconds < 10){\n sec = \"0\" + seconds;\n }else{\n sec = seconds + \"\";\n }\n String time = minutes + \":\" + sec;\n return time;\n }",
"protected void processTimer(){\n if(timer != null){\n timer.cancel();\n timer = null;\n }\n // Verificamos si el partido esta en progreso\n if(match.status == Match.STATUS_PENDING || match.status == Match.STATUS_ENDED){\n return;\n }\n // Creamos temporizador 90 * 60 * 1000 = 5.400.000\n timer = new CountDownTimer(5400000, 1000) {\n @Override\n public void onTick(long l) {\n // Calcular los segundos que pasaron\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }\n\n @Override\n public void onFinish() {\n\n }\n }.start();\n }",
"static int calcCoolingTime(int temperature, int amount) {\n // the time in melting reipes assumes updating 5 times a second\n // we update 20 times a second, so get roughly a quart of those values\n return IMeltingRecipe.calcTimeForAmount(temperature, amount);\n }",
"private KilometersPerHour() {}",
"public String FormatTime(int hour, int minute) {\n\n String time;\n time = \"\";\n String formattedMinute;\n\n if (minute / 10 == 0) {\n formattedMinute = \"0\" + minute;\n } else {\n formattedMinute = \"\" + minute;\n }\n\n\n if (hour == 0) {\n time = \"12\" + \":\" + formattedMinute + \" AM\";\n } else if (hour < 12) {\n time = hour + \":\" + formattedMinute + \" AM\";\n } else if (hour == 12) {\n time = \"12\" + \":\" + formattedMinute + \" PM\";\n } else {\n int temp = hour - 12;\n time = temp + \":\" + formattedMinute + \" PM\";\n }\n\n\n return time;\n }",
"public int getMinute() {\n return minute;\n }",
"static long getSecondsPart(Duration d) {\n long u = d.getSeconds() % 60;\n\n return u;\n }",
"public String format(int par1) {\n\t\tdouble var2 = (double) par1 / 20.0D;\n\t\tdouble var4 = var2 / 60.0D;\n\t\tdouble var6 = var4 / 60.0D;\n\t\tdouble var8 = var6 / 24.0D;\n\t\tdouble var10 = var8 / 365.0D;\n\t\treturn var10 > 0.5D ? StatBase.getDecimalFormat().format(var10) + \" y\"\n\t\t\t\t: (var8 > 0.5D ? StatBase.getDecimalFormat().format(var8) + \" d\" : (var6 > 0.5D ? StatBase.getDecimalFormat().format(var6) + \" h\" : (var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + \" m\" : var2 + \" s\")));\n\t}",
"public final flipsParser.minute_return minute() throws RecognitionException {\n flipsParser.minute_return retval = new flipsParser.minute_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token string_literal379=null;\n Token string_literal380=null;\n Token string_literal381=null;\n Token string_literal382=null;\n\n CommonTree string_literal379_tree=null;\n CommonTree string_literal380_tree=null;\n CommonTree string_literal381_tree=null;\n CommonTree string_literal382_tree=null;\n RewriteRuleTokenStream stream_257=new RewriteRuleTokenStream(adaptor,\"token 257\");\n RewriteRuleTokenStream stream_254=new RewriteRuleTokenStream(adaptor,\"token 254\");\n RewriteRuleTokenStream stream_256=new RewriteRuleTokenStream(adaptor,\"token 256\");\n RewriteRuleTokenStream stream_255=new RewriteRuleTokenStream(adaptor,\"token 255\");\n\n try {\n // flips.g:564:2: ( ( 'min' | 'mins' | 'minute' | 'minutes' ) -> MINUTE )\n // flips.g:564:4: ( 'min' | 'mins' | 'minute' | 'minutes' )\n {\n // flips.g:564:4: ( 'min' | 'mins' | 'minute' | 'minutes' )\n int alt144=4;\n switch ( input.LA(1) ) {\n case 254:\n {\n alt144=1;\n }\n break;\n case 255:\n {\n alt144=2;\n }\n break;\n case 256:\n {\n alt144=3;\n }\n break;\n case 257:\n {\n alt144=4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 144, 0, input);\n\n throw nvae;\n }\n\n switch (alt144) {\n case 1 :\n // flips.g:564:5: 'min'\n {\n string_literal379=(Token)match(input,254,FOLLOW_254_in_minute3275); \n stream_254.add(string_literal379);\n\n\n }\n break;\n case 2 :\n // flips.g:564:11: 'mins'\n {\n string_literal380=(Token)match(input,255,FOLLOW_255_in_minute3277); \n stream_255.add(string_literal380);\n\n\n }\n break;\n case 3 :\n // flips.g:564:18: 'minute'\n {\n string_literal381=(Token)match(input,256,FOLLOW_256_in_minute3279); \n stream_256.add(string_literal381);\n\n\n }\n break;\n case 4 :\n // flips.g:564:27: 'minutes'\n {\n string_literal382=(Token)match(input,257,FOLLOW_257_in_minute3281); \n stream_257.add(string_literal382);\n\n\n }\n break;\n\n }\n\n\n\n // AST REWRITE\n // elements: \n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 565:2: -> MINUTE\n {\n adaptor.addChild(root_0, (CommonTree)adaptor.create(MINUTE, \"MINUTE\"));\n\n }\n\n retval.tree = root_0;\n }\n\n retval.stop = input.LT(-1);\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }",
"private String getFormattedTime(int totalElapsedSeconds)\n {\n int minutes = totalElapsedSeconds / 60;\n int seconds = totalElapsedSeconds - (minutes * 60);\n String timerText = String.format(\"%02d\", minutes)\n + \":\" + String.format(\"%02d\", seconds);\n return timerText;\n }",
"public String countTime(int miliseconds) {\n \tString timeInMinutes = new String();\n \tint minutes = miliseconds / 60000;\n \tint seconds = (miliseconds % 60000)/1000;\n \ttimeInMinutes = minutes + \":\" + (seconds<10?\"0\" + seconds:seconds);\n\t\treturn timeInMinutes;\n }",
"@Test\n public void floorToMinute() throws Exception {\n DateTime dt0 = new DateTime(2009,6,24,23,30,30,789,DateTimeZone.forID(\"America/Los_Angeles\"));\n\n //\n // floor to nearest minute\n //\n DateTime dt1 = DateTimeUtil.floorToMinute(dt0);\n\n Assert.assertEquals(2009, dt1.getYear());\n Assert.assertEquals(6, dt1.getMonthOfYear());\n Assert.assertEquals(24, dt1.getDayOfMonth());\n Assert.assertEquals(23, dt1.getHourOfDay());\n Assert.assertEquals(30, dt1.getMinuteOfHour());\n Assert.assertEquals(0, dt1.getSecondOfMinute());\n Assert.assertEquals(0, dt1.getMillisOfSecond());\n Assert.assertEquals(DateTimeZone.forID(\"America/Los_Angeles\"), dt1.getZone());\n\n //\n // floor null\n //\n DateTime dt2 = DateTimeUtil.floorToMinute(null);\n Assert.assertNull(dt2);\n }",
"int main()\n{\n int p;\n float t;\n cin>>p>>t;\n if(t>13.30)\n if( p <= 13)\n cout<<\"$\"<<2<<\".00\";\n \telse\n cout<<\"$\"<<5<<\".00\";\n else\n if( p <= 13)\n cout<<\"$\"<<4<<\".00\";\n else\n cout<<\"$\"<<8<<\".00\";\n \n}",
"@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tlong diff = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\n\t\t\tif(diff<0){//凌晨1点30分之前则等待\n\t\t\t\tThread.sleep(0-diff);\n\t\t\t\tupdateMonthKline();\n\t\t\t}else{//凌晨1点30分后则立即启动\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t\n\t\t\twhile (true){\n\t\t\t\tlong diff11 = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\tThread.sleep(1000l*60*60*24-diff11);\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static String trackDurationConverter(int secondsInput)\r\n {\r\n String result;\r\n if(secondsInput > 0)\r\n {\r\n String tmpSec = \"\"; \r\n int tmpMin = 0;\r\n\r\n String seconds = Integer.toString(secondsInput % 60);\r\n String minutes = Integer.toString((secondsInput/60) % 60);\r\n String hours = Integer.toString((secondsInput/60) / 60);\r\n\r\n seconds = Integer.parseInt(seconds) < 9 ? \"0\"+seconds : seconds;\r\n minutes = Integer.parseInt(minutes) < 9 ? \"0\"+minutes : minutes;\r\n hours = Integer.parseInt(hours) < 9 ? \"0\"+hours : hours;\r\n\r\n if(Integer.parseInt(seconds) <= 30)\r\n {\r\n tmpSec = \"30\";\r\n tmpMin = Integer.parseInt(minutes);\r\n }\r\n else\r\n {\r\n tmpSec = \"00\";\r\n tmpMin = Integer.parseInt(minutes) + 1;\r\n }\r\n String tmpResult = tmpMin < 9 ? \"0\"+Integer.toString(tmpMin) : Integer.toString(tmpMin);\r\n String typeOfTime = tmpResult.equals(\"00\") ? \" sec\" : \" min\";\r\n\r\n result = \"circa \" + tmpResult + \":\" + tmpSec + typeOfTime;\r\n return result;\r\n }\r\n else\r\n {\r\n return result = \"-1\";\r\n }\r\n }",
"public int getMinute()\n {\n return minute;\n }",
"public int getMinute() {\n return minute;\n }",
"public void setDuration (int sec) {\n String hoursText = \"\", minutesText = \"\", synthez = \"\";\n\n if (sec < 60) {\n synthez = \"less than one minute\";\n synthez = String.format(TEMPLATE, synthez);\n setText(Html.fromHtml(synthez)+\".\", BufferType.SPANNABLE);\n return;\n }\n\n if (sec >= 3600) {\n hoursText += sec/3600+\" Hour\";\n if (sec/3600 > 1) {\n hoursText+=\"s\";\n }\n hoursText+=\" \";\n }\n if (((sec%3600)/ 60) > 0) {\n minutesText+= ((sec%3600)/ 60)+ \" minute\";\n if (((sec%3600)/ 60 ) > 1) {\n minutesText+=\"s\";\n }\n minutesText+=\" \";\n }\n synthez = hoursText+minutesText;\n synthez = String.format(TEMPLATE, synthez);\n setText(Html.fromHtml(synthez)+\".\", BufferType.SPANNABLE);\n }",
"public interface ConversationalTimeFormatter {\n public String transform(Integer hour, Integer minutes);\n}",
"public static String milToStandard(int milTime){\n\n String output;\n int tempHours = milTime / 100;\n String ampm;\n if(tempHours - 12 < 0){\n if(tempHours == 0){tempHours = 12;}\n ampm = \"AM\";\n }\n else{\n tempHours = tempHours - 12;\n if(tempHours == 0){tempHours = 12;}\n ampm = \"PM\";\n }\n output = tempHours+\":\";\n int tempMins = milTime % 100;\n if(tempMins < 10){ output = output + \"0\" + tempMins + ampm;}\n else{ output = output + tempMins + ampm;}\n\n return output;\n\n }",
"@Override\n public void run() {\n sec++;\n if (sec > 9) {\n sec = 0;\n min++;\n }\n timer.setText(String.format(\"%02d\", sec) + \":\" + String.format(\"%02d\", min));\n handler.postDelayed(this, 1000);\n }",
"public static void main(String[] args) {\n System.out.println(solution(\"02:03:55\",\"00:14:15\",\n new String[] {\"01:20:15-01:45:14\", \n \"00:40:31-01:00:00\",\n \"00:25:50-00:48:29\",\n \"01:30:59-01:53:29\", \n \"01:37:44-02:02:30\"}));\n \n // \"01:00:00\"\n System.out.println(solution(\"99:59:59\", \"25:00:00\",\n new String[] {\"69:59:59-89:59:59\",\n \"01:00:00-21:00:00\",\n \"79:59:59-99:59:59\",\n \"11:00:00-31:00:00\"}));\n \n // \"00:00:00\"\n System.out.println(solution(\"50:00:00\", \"50:00:00\",\n new String[] {\"15:36:51-38:21:49\",\n \"10:14:18-15:36:51\",\n \"38:21:49-42:51:45\"}));\n \n }",
"@Override\n\tpublic int withIntervalInSeconds() {\n\t\treturn 10;\n\t}",
"@Override\r\n public LocalDateTime bake_350degrees(LocalDateTime time) {\r\n System.out.println(\"Baking \"+quantity+\" batch(es) of cookies\");\r\n for(int count = 1; count <= quantity; count++) {\r\n \t time = time.plusMinutes(20);\r\n }\r\n return time;\r\n }",
"public void updateTimer( int secondsLeft ) {\n int minutes = secondsLeft / 60;\n int seconds = secondsLeft - (minutes * 60);\n\n String secondsString = Integer.toString(seconds);\n\n if(seconds <= 9) {\n secondsString = \"0\" + secondsString;\n }\n\n timerTextView.setText(Integer.toString(minutes) + \":\" + secondsString);\n// getRandomQuestion();\n }",
"public void moveForward() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t // 2\n\t\tseconds += tic;\n\t\tif (seconds >= 60.0) {\n\t\t\tseconds -= 60.0;\n\t\t\tminutes++;\n\t\t\tif (minutes == 60) {\n\t\t\t\tminutes = 0;\n\t\t\t\thours++;\n\t\t\t}\n\t\t}\n\t}",
"Period mo20733e();",
"public static void main(String[] args) {\n\t\tint seconds = 3910 ; // 1 hour 5 minutes and 10 seconds \r\n\t\t\r\n\t\tint minutes , hours ; \r\n\t\t\r\n\t\tminutes = seconds / 60 ; \r\n\t\tSystem.out.println(\" The minutes is : \" + minutes );\r\n\t\t\r\n\t\t// how many seconds remaining after getting minutes part \r\n\t\t\r\n\t\tint remainingSecondsAfterMinute = seconds % 60 ; \r\n\t\tSystem.out.println(\" The remianing seconds after minute is : \" + remainingSecondsAfterMinute );\r\n\t\t\r\n\t\t// we can use minute as below \r\n\t\t// hours = minutes / 60 ; \r\n\t\t// or we can use seconds directly\r\n\t\thours = seconds / 3600 ; \r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\" Hours is \" + hours);\r\n\t\t\r\n\t\t// Task : convert the seconds to real life example of \r\n\t\t// 3910 seconds is 1 hour 5 minute and 10 seconds \r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}"
]
| [
"0.6492051",
"0.63792807",
"0.63470465",
"0.601531",
"0.5853354",
"0.572046",
"0.5699488",
"0.5613981",
"0.5531339",
"0.5505608",
"0.55033594",
"0.54969096",
"0.5478216",
"0.54087394",
"0.5376232",
"0.53678685",
"0.53399324",
"0.5314739",
"0.5239512",
"0.5231412",
"0.5219772",
"0.52129734",
"0.51667017",
"0.5149976",
"0.51452255",
"0.5139384",
"0.5139384",
"0.51250607",
"0.5120916",
"0.5112986",
"0.5108056",
"0.5106977",
"0.5100027",
"0.5089304",
"0.50388104",
"0.50340044",
"0.50040054",
"0.50038004",
"0.50032735",
"0.49852443",
"0.4982094",
"0.49791744",
"0.49749154",
"0.49736267",
"0.49661762",
"0.49604666",
"0.4950206",
"0.49447453",
"0.4941398",
"0.4941313",
"0.4937461",
"0.4927716",
"0.492396",
"0.49205709",
"0.49175256",
"0.49151105",
"0.49144578",
"0.49098498",
"0.49095997",
"0.49074972",
"0.48883328",
"0.4870012",
"0.48656866",
"0.48644537",
"0.48619",
"0.48579907",
"0.48564175",
"0.48549548",
"0.48521033",
"0.4849942",
"0.48488596",
"0.48422435",
"0.4823649",
"0.48203412",
"0.48154354",
"0.4812848",
"0.48086917",
"0.4799454",
"0.47993568",
"0.47871467",
"0.47831696",
"0.47771192",
"0.47740334",
"0.47725865",
"0.47702685",
"0.47612393",
"0.4756807",
"0.4755395",
"0.47551632",
"0.47536188",
"0.4751809",
"0.47454584",
"0.47453758",
"0.4739207",
"0.47378942",
"0.47350636",
"0.47260505",
"0.47236812",
"0.4708797",
"0.47063023",
"0.47045082"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseClicked(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
System.out.println("mx: " + mx + " my: " + my);
windowm.findWindowByPosition(mx, my);
repaint();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mousePressed(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseReleased(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseEntered(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseExited(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseDragged(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void mouseMoved(MouseEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyTyped(KeyEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyPressed(KeyEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyReleased(KeyEvent e) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
]
| [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
"0.6076905",
"0.6041205",
"0.6024897",
"0.60200036",
"0.59985113",
"0.5967729",
"0.5967729",
"0.5965808",
"0.5949083",
"0.5941002",
"0.59236866",
"0.5909713",
"0.59030116",
"0.589475",
"0.58857024",
"0.58837134",
"0.586915",
"0.58575684",
"0.5850424",
"0.5847001",
"0.5824116",
"0.5810248",
"0.5809659",
"0.58069366",
"0.58069366",
"0.5800507",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.5792168",
"0.57900196",
"0.5790005",
"0.578691",
"0.578416",
"0.578416",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5774115",
"0.5761079",
"0.57592577",
"0.57592577",
"0.5749888",
"0.5749888",
"0.5749888",
"0.5748457",
"0.5733414",
"0.5733414",
"0.5733414",
"0.57209575",
"0.57154554",
"0.57149583",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.57140404",
"0.571194",
"0.57043016",
"0.56993437",
"0.5696782",
"0.5687825",
"0.5677794",
"0.5673577",
"0.5672046",
"0.5669512",
"0.5661156",
"0.56579345",
"0.5655569",
"0.5655569",
"0.5655569",
"0.56546396",
"0.56543446",
"0.5653163",
"0.56502634"
]
| 0.0 | -1 |
Factory will create new instances of calculators, these are lightweight, each thread should use the factory as a given calculator should NOT be shared across thread (unless you know what you're doing) as the startDate, current date and working week would be shared. Once created, the set of holidays will NOT change even if a new set is registered; one needs to get a new DateCalculator to get the new set. | public interface KitCalculatorsFactory<E> {
/**
* Create a new CurrencyDateCalculatorBuilder specialised for 2 currencies, including WorkingWeek, calendars registered and CurrencyCalculatorConfig.
*
* NOTE that USD currency holiday must also be registered.
*
* @param ccy1
* first currency, will pickup the holiday set for this ccy.
* @param ccy2
* second currency, will pick up the holiday set for this ccy.
* @param spotLag
* the number of days between tradeDate and spotDate.
* @return a new CurrencyDateCalculatorBuilder
* @exception IllegalArgumentException
* if the type is not null or a valid value.
* @since 1.4.0
*/
CurrencyDateCalculatorBuilder<E> getDefaultCurrencyDateCalculatorBuilder(String ccy1, String ccy2, SpotLag spotLag);
CurrencyDateCalculator<E> buildCurrencyDateCalculator(CurrencyDateCalculatorBuilder<E> builder);
/**
* Create a new IMMUTABLE CurrencyDateCalculator specialised for 2 currencies, including WorkingWeek, calendars
* registered and CurrencyCalculatorConfig.
*
* NOTE that USD currency holiday must also be registered.
*
* @param ccy1
* first currency, will pickup the holiday set for this ccy.
* @param ccy2
* second currency, will pick up the holiday set for this ccy.
* @param spotLag
* the number of days between tradeDate and spotDate.
* @return a new CurrencyDateCalculator
* @exception IllegalArgumentException
* if the type is not null or a valid value.
* @since 1.4.0
*/
CurrencyDateCalculator<E> getDefaultCurrencyDateCalculator(String ccy1, String ccy2, SpotLag spotLag);
/**
* Use this method register a specific currency config, if not provided then the DefaultCurrencyCalculatorConfig will be given.
* @param config that specifies the set of currencies subject to USD T+1.
*/
void setCurrencyCalculatorConfig(CurrencyCalculatorConfig config);
CurrencyCalculatorConfig getCurrencyCalculatorConfig();
/**
* Create a new DateCalculator for a given name and type of handling.
*
* @param name
* calendar name (holidays set interested in). If there is set of
* holidays with that name, it will return a DateCalculator with
* an empty holiday set (will work on Weekend only).
* @param holidayHandlerType
* typically one of the value of HolidayHandlerType or null.
* @return a new DateCalculator
* @exception IllegalArgumentException
* if the type is not null or a valid value.
*/
DateCalculator<E> getDateCalculator(String name, String holidayHandlerType);
/**
* Use this method to register a holidays calendar.
*
* @param calendarName
* the calendar name to register these holidays under.
* @param holidaysCalendar
* the holiday calendar (non-working days with boundaries).
*/
KitCalculatorsFactory<E> registerHolidays(String calendarName, HolidayCalendar<E> holidaysCalendar);
/**
* @return true if the holiday calendar name is registered.
*/
boolean isHolidayCalendarRegistered(String calendarName);
/**
* @return an immutable Holiday Calendar name that is registered.
*/
HolidayCalendar<E> getHolidayCalendar(String calendarName);
/**
* @return an immutable set of registered calendar names
*/
Set<String> getRegisteredHolidayCalendarNames();
/**
* Unregister a given holiday calendar
* @param calendarName
* the calendar name to unregister.
*/
KitCalculatorsFactory<E> unregisterHolidayCalendar(String calendarName);
/**
* unregister all holiday calendars;
*/
KitCalculatorsFactory<E> unregisterAllHolidayCalendars();
// -----------------------------------------------------------------------
//
// ObjectLab, world leaders in the design and development of bespoke
// applications for the securities financing markets.
// www.ObjectLab.co.uk
//
// -----------------------------------------------------------------------
/**
* Create a new PeriodCountCalculator.
*
* @return a PeriodCountCalculator
*/
PeriodCountCalculator<E> getPeriodCountCalculator();
/**
* Create a new IMMDateCalculator.
*
* @return an IMMDateCalculator
*/
IMMDateCalculator<E> getIMMDateCalculator();
/**
* Create a new holiday handler of given type
* @param holidayHandlerType
* @return a new handler
* @throws IllegalArgumentException if the holidayHandlerType is unsupported
* @since 1.4.0
*/
HolidayHandler<E> getHolidayHandler(String holidayHandlerType);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DateCalculator<E> getDateCalculator(String name, String holidayHandlerType);",
"KitCalculatorsFactory<E> registerHolidays(String calendarName, HolidayCalendar<E> holidaysCalendar);",
"KitCalculatorsFactory<E> unregisterAllHolidayCalendars();",
"Calcul createCalcul();",
"public interface HolidayService {\n\t\n\tvoid load();\n\t\n\tDate getNextWorkingDay(Message message);\n\t\n}",
"AutoevaluacionFactory getAutoevaluacionFactory();",
"public static MoneyFactory getInstance() {\n\t\treturn factory;\n\t}",
"KitCalculatorsFactory<E> unregisterHolidayCalendar(String calendarName);",
"public interface Calculator extends CalculatorEventContainer, HistoryControl<CalculatorHistoryState> {\n\n void init();\n\n /*\n **********************************************************************\n *\n * CALCULATIONS\n *\n **********************************************************************\n */\n\n void evaluate();\n\n void evaluate(@NotNull Long sequenceId);\n\n void simplify();\n\n @NotNull\n CalculatorEventData evaluate(@NotNull JsclOperation operation,\n @NotNull String expression);\n\n @NotNull\n CalculatorEventData evaluate(@NotNull JsclOperation operation,\n @NotNull String expression,\n @NotNull Long sequenceId);\n\n /*\n **********************************************************************\n *\n * CONVERSION\n *\n **********************************************************************\n */\n\n boolean isConversionPossible(@NotNull Generic generic, @NotNull NumeralBase from, @NotNull NumeralBase to);\n\n @NotNull\n CalculatorEventData convert(@NotNull Generic generic, @NotNull NumeralBase to);\n\n /*\n **********************************************************************\n *\n * EVENTS\n *\n **********************************************************************\n */\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data);\n\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Object source);\n\n @NotNull\n CalculatorEventData fireCalculatorEvent(@NotNull CalculatorEventType calculatorEventType, @Nullable Object data, @NotNull Long sequenceId);\n\n\t@NotNull\n\tPreparedExpression prepareExpression(@NotNull String expression) throws CalculatorParseException;\n}",
"@Override\n protected void populateHolidays() {\n holidays.put(beginDate(), new Holiday(\"Christmas\", beginDate(), calendar, \"Matthew 1:18-25, Luke 2:1-20\"));\n Calendar holyInnocents = new GregorianCalendar(calendar.getYear() - 1, Calendar.DECEMBER, 28);\n holidays.put(holyInnocents, new Holiday(\"Holy Innocents\", holyInnocents, calendar, \"Matthew 2:13-23\"));\n Calendar epiphany = new GregorianCalendar(calendar.getYear(), Calendar.JANUARY, 6);\n holidays.put(epiphany, new Holiday(\"Epiphany\", epiphany, calendar, \"Matthew 2:1-12\"));\n Calendar presentation = new GregorianCalendar(calendar.getYear(), Calendar.FEBRUARY, 2);\n holidays.put(presentation, new Holiday(\"Presentation\", presentation, calendar, \"Luke 2:21-25\"));\n Calendar annunciation = new GregorianCalendar(calendar.getYear(), Calendar.MARCH, 25);\n if (endDate().compareTo(annunciation) < 0) holidays.put(annunciation, new Holiday(\"Annunciation\", annunciation, calendar, \"Luke 1:26-38\"));\n\n Calendar ashWednesday = (Calendar)holyWeek.beginDate().clone();\n ashWednesday.add(Calendar.DATE, -39);\n holidays.put(ashWednesday, new Holiday(\"Ash Wednesday\", ashWednesday, calendar,\n \"Matthew 3:13-4:11\", \"Mark 1:9-13\", \"Luke 3:21,22, 4:1-13\"));\n\n }",
"public PeriodFactoryImpl() {\n\t\tsuper();\n\t}",
"private Callback<DatePicker, DateCell> getDayCellFactory() {\n try {\n final Callback<DatePicker, DateCell> dayCellFactory = new Callback<>() {\n\n @Override\n public DateCell call(final DatePicker datePicker) {\n return new DateCell() {\n @Override\n public void updateItem(LocalDate item, boolean empty) {\n super.updateItem(item, empty);\n\n // Disable all days before today + weekend days\n if (item.isBefore(LocalDate.now()) || item.getDayOfWeek() == DayOfWeek.SATURDAY\n || item.getDayOfWeek() == DayOfWeek.SUNDAY) {\n // disable the 'button'\n setDisable(true);\n // make them red\n setStyle(\"-fx-background-color: #ffc0cb;\");\n }\n }\n };\n }\n };\n return dayCellFactory;\n } catch (Exception e) {\n logger.log(Level.SEVERE, e.toString());\n }\n return null;\n }",
"public static void main(String[] args) {\n FoodFactory factory = new AmericanFoodFactory();\n Food food = factory.makeFood(\"A\");\n System.out.println(food.getName());\n\n //jdk这里使用了简单工厂模式\n Calendar instance = Calendar.getInstance(TimeZone.getDefault());\n\n }",
"public Long calculateAging(LocalDateTime endDateParam, LocalDateTime startDateParam, KPITicketResponTime sourceData,\n\t\t\tList<KPIServiceHourRest> ticketRests, List<ITSMTicketHolidayDate> ticketHolidays) {\n\t\tboolean validStart = false;\n\t\tLong totalAging=new Long(0L);\n\t\tdo {\n\t\t\tswitch (startDateParam.getDayOfWeek()) {\n\t\t\t\tcase DateTimeConstants.MONDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\tif (sourceData.getMondayFlag().intValue() == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// // if working\n\t\t\t\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t * @ Compare Only Time in date\n\t\t\t\t\t\t\t\t\t\t\t\t\t * @ start < start work\n\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(sourceData.getMondayFromTime()))<0){\n\t\t\t\t\t \t\t // set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t /** menghilangkan menit dan detik, jika tidak \n\t\t\t\t\t \t\t maka hanya tgl saja yang berubah, jam tidak \n\t\t\t\t\t \t\t contoh 01/01/2017 17:20:00 plus(1) --> 01/02/2017 17:20:00 */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getMondayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getMondayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getMondayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t }else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(sourceData.getMondayToTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add to next day \n\t\t\t\t\t \t\t // if start >= work end\n\t\t\t\t\t\t \t // ubah jam ke 00:00:00 \n\t\t\t\t\t\t \t // +1 -> netx day with 00:00:00\n\t\t\t\t\t\t \t // move 00:00:00 ke jam mulai bekerja\n\t\t\t\t\t\t \t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 start work (PINDAHKAN JAM 00:00:00 ke jam mulai bekerja)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getMondayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getMondayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getMondayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >=work start dan start <= work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.MONDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}else{ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t/**jika tidak ada ini maka akan loop terus menerus di hari berikutnya jika hari ini libur\n\t\t\t\t\t\t\t\t\t\t\t\t\t * jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t * SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t * move to next day ke hari senin */\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t} // end cast monday\n\t\t\t\tcase DateTimeConstants.TUESDAY: {\n\t\t\t\t\t // untuk hari selasa \n\t\t\t\t\t if(sourceData.getTuesdayFlag().intValue()==1){\n\t\t\t\t\t \t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t \t //start < start work\n\t\t\t\t\t \t// @@ jika dari LocalDateTime di masukan ke new DateTime, maka variabel LocalDateTime harus ke toDateTime\n\t\t\t\t\t\t\t\t\t\t\t\t\t// @@ jika dari Date di masukan ke new DateTime, maka variabel tidak dirubah jadi apa2\n\t\t\t\t\t \t \n\t\t\t\t\t \t if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(sourceData.getTuesdayFromTime()))<0){\n\t\t\t\t \t\t // set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getTuesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getTuesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getTuesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t \t }else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(sourceData.getTuesdayToTime()))>0){\n\t\t\t\t\t \t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getTuesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getTuesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getTuesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t \t }else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.TUESDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \t \n\t\t\t\t\t }else{// end flag tuesday\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**jika tidak ada ini maka akan loop terus menerus di hari berikutnya jika hari ini libur\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * move to next day ke hari senin */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\tbreak;} // end cast TUESDAY\n\t\t\t\tcase DateTimeConstants.WEDNESDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(sourceData.getWednesdayFlag().intValue()==1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start< start work\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getWednesdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getWednesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getWednesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getWednesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(sourceData.getWednesdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getWednesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getWednesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getWednesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.WEDNESDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}//end flag wednesday\n\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**jika tidak ada ini maka akan loop terus menerus di hari berikutnya jika hari ini libur\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * move to next day ke hari senin */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t// besok \n\t\t\t\tbreak;} // end cast WEDNESDAY\n\t\t\t\tcase DateTimeConstants.THURSDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(sourceData.getThursdayFlag().intValue()==1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start< work start\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getThursdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getThursdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getThursdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getThursdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getThursdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getThursdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getThursdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getThursdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.THURSDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**jika tidak ada ini maka akan loop terus menerus di hari berikutnya jika hari ini libur\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * move to next day ke hari senin */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t break;} // end cast THURSDAY\n\t\t\t\tcase DateTimeConstants.FRIDAY: {\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(sourceData.getFridayFlag().intValue()==1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start< work start\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getFridayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getFridayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getFridayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getFridayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getFridayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getFridayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getFridayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getFridayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.FRIDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}// end if flag\n\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**jika tidak ada ini maka akan loop terus menerus di hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * move to next day ke hari senin */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;} // end cast FRIDAY\n\t\t\t\tcase DateTimeConstants.SATURDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(sourceData.getSaturdayFlag().intValue()==1){\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start< work start\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getSaturdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getSaturdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getSaturdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayToTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getSaturdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getSaturdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getSaturdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.SATURDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;} // end cast SATURDAY\n\t\t\t\tcase DateTimeConstants.SUNDAY: {\n\t\t\t\t\t if(sourceData.getSundayFlag().intValue()==1){\n\n\t\t\t\t\t \t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParam,endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// will get next day with time 00:00:00\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp).plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t \t// start< work start\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusHours(sourceData.getSaturdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusMinutes(sourceData.getSaturdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponStart=localReponStart.plusSeconds(sourceData.getSaturdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayToTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if start>work end, pindahkan ke besoknya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(sourceData.getSaturdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(sourceData.getSaturdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(sourceData.getSaturdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * if start >work start dan start < work end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * check rest break\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidStart=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean isStartOnRest=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.SUNDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// if response start >= rest start AND response start < rest end\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// means response start is within rest time\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move response start to rest end \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam setelah istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusHours(restEnd.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusMinutes(restEnd.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusSeconds(restEnd.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//startDateParam=endRest\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisStartOnRest=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(isStartOnRest)break;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}// end else\n\t\t\t\t\t \t \n\t\t\t\t\t }// end if flag\n\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jika tidak masuk add ke hari berikutnya\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// SUNDAY\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//move to next day ke hari senin\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate startDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localstartDateParam=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//+1 day\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalstartDateParam=localstartDateParam.plusDays(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartDateParam=localstartDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\tbreak;} // end cast SUNDAY\n\t\t\t}// END SWITCH\n\t\t\t\n\t\t\tif(startDateParam.compareTo(endDateParam) > 0){\n\t\t\t\t// current response start > response end\n\t\t\t\t// then out of loop, no need further check (aging should be 0)\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!validStart);\n\t\t/**\n\t\t * \n\t\t * Memindahkan End ke tempat yang benar\n\t\t * Jika end di jam istirahat, maka pindahkan end ke sebelum istirahat\n\t\t * Jika end setelah istirahat, maka \n\t\t * untuk perhitungan hari itu di awal mulai bekerja hitung waktu detiknya sampai istirahat\n\t\t * \n\t\t * */\n\t\t\n\t\tSystem.out.println(\" Start Respon : \"+startDateParam);\n\t\tboolean validEnd=false;\n\t\tdo{\n\t\t\tswitch (endDateParam.getDayOfWeek()) {\n\t\t\tcase DateTimeConstants.MONDAY: { \n\t\t\t\t\t\t\t\t\t\t\t//respon end < start work\n\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getMondayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getMondayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getMondayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getMondayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getMondayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getMondayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getMondayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getMondayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\t/*** Lojik **\n\t\t\t\t\t\t\t\t\t\t\t\t * respondEnd=11:30\n\t\t\t\t\t\t\t\t\t\t\t\t * restStart=11:30 AM, restEnd=1:00:00 PM\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(endDateParam>restStart && endDateParam<restEnd){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t1. \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 11:30> ? N, Y\n\t\t\t\t\t\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.MONDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.TUESDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getTuesdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getTuesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getTuesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getTuesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getTuesdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getTuesdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getTuesdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getTuesdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.TUESDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.WEDNESDAY: {\n\t\t\t\t // END RESPON < END WORK\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getWednesdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getWednesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getWednesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getWednesdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getWednesdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getWednesdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getWednesdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getWednesdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.WEDNESDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESPON EDN DI MOVE KE JAM MULAI ISTIRAHAT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.THURSDAY: {\n\t\t\t\t // END RESPON < END WORK\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getThursdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getThursdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getThursdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getThursdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getThursdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getThursdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getThursdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getThursdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.THURSDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESPON EDN DI MOVE KE JAM MULAI ISTIRAHAT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.FRIDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t// END RESPON < END WORK\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getFridayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getFridayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getFridayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getFridayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getFridayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getFridayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getFridayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getFridayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.FRIDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESPON EDN DI MOVE KE JAM MULAI ISTIRAHAT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.SATURDAY: {\n\t\t\t\t\t\t\t\t\t\t\t\t// END RESPON < END WORK\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getSaturdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getSaturdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getSaturdayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getSaturdayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getSaturdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getSaturdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getSaturdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.SATURDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0 \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESPON EDN DI MOVE KE JAM MULAI ISTIRAHAT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\tcase DateTimeConstants.SUNDAY: {\n\t\t\t\t\t\t\t\t\t\t\t// END RESPON < END WORK\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getSundayFromTime().getTime()))<0){\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getSundayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getSundayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getSundayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else if(CustomDateUtils.compareTime(new DateTime(endDateParam.toDate().getTime()), new DateTime(sourceData.getSundayToTime().getTime()))>0){\n\t\t\t\t\t\t\t\t\t\t\t\t//respon end > end work\t\n\t\t\t\t\t\t\t\t\t\t\t\t// set hour date startDateParam, to hour :00:00:00 {datestartDateParam 00:00:00}\n\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusHours(sourceData.getSundayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusMinutes(sourceData.getSundayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\tlocalReponEnd=localReponEnd.plusSeconds(sourceData.getSundayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localReponEnd;\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t// CHECK RESPON END IN REST\n\t\t\t\t\t\t\t\t\t\t\t\tfor(KPIServiceHourRest ticketRest:ticketRests){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(DateTimeConstants.SUNDAY==ticketRest.getDay()){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restStart.toDateTime()))>=0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& CustomDateUtils.compareTime(new DateTime(endDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tDate endDateParamTemp=Utils.removeTime(endDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDateTime localendDateParam=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESPON EDN DI MOVE KE JAM MULAI ISTIRAHAT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// jam :00:00:00 move ke jam mulai istirahat\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusHours(restStart.toDate().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusMinutes(restStart.toDate().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocalendDateParam=localendDateParam.plusSeconds(restStart.toDate().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tendDateParam=localendDateParam;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tvalidEnd=true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;}\n\t\t\t}\n\t\t}while(!validEnd);\n\t\t\n\t\t\n\t\tLong totalAgingInSameDays=new Long(0L);\n\t\tLong totalAgingFirstDays=new Long(0L);\n\t\tLong totalAgingBetweenDays=new Long(0L);\n\t\tLong totalAgingLastDays=new Long(0L);\n\t\tif(startDateParam.compareTo(endDateParam)<0){\n long diff =(Utils.removeTime(endDateParam.toDate()).getTime() - Utils.removeTime(startDateParam.toDate()).getTime());\n Long days = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);\n // check apakah ada rentang hari antara startDateParam dan endDateParam\n if(days.intValue()==0){\n\t\t // Jika selisih hari adalah 0, berarti start dan respon ada pada hari yang sama, hitung pada hari yang sama \n\t\t // it's mean end - start secara langsung \n\t\t // karena jam istirahat berpengaruh pada aging, memperhatikan, apakah end setelah istirahat, past istirahat atau sebelum istirahat\n \t // sedangkan start sudah otomatis di atur di if paling atas\n \t // jadi tidak memperhatikan start\n\t\t // KASUS 1\n \t\t switch (endDateParam.getDayOfWeek()) {\n \t\t \t\tcase DateTimeConstants.MONDAY: { \n\t\t \t\t \t\t\tif(sourceData.getMondayFlag()==1){\n\t\t\t \t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t \t //cek holiday\n\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t\t Integer day=DateTimeConstants.MONDAY;\n\t\t\t\t\t\t\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondMondayRest();\n\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t \t\t \t\t\t}else{\n\t\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t\t \t\t \t\t\t}\n\t\t break;\n\t\t }\n \t\t \t\t case DateTimeConstants.TUESDAY: {\n \t\t \t\t\t \n\t \t\t \t\t\tif(sourceData.getTuesdayFlag()==1){\n\t \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t Integer day=DateTimeConstants.TUESDAY;\n\t\t Integer totalSecondRest=sourceData.getSecondTuesdayRest();\n\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t \t\t \t\t\t }\n\t \t\t \t\t\t}else{\n\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t \t\t \t\t\t}\n \t\t \t\t\t break;}\n \t\t \t\t case DateTimeConstants.WEDNESDAY: {\n\t\t \t\t \t\t\tif(sourceData.getWednesdayFlag()==1){\n\t\t \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t\t\t Integer day=DateTimeConstants.WEDNESDAY;\n\t\t \t\t \t\t\t\t\t Integer totalSecondRest=sourceData.getSecondWednesdayRest();\n\t\t \t\t \t\t\t\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t\t \t\t \t\t\t\t }\n\t\t \t\t \t\t\t}else{\n\t\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t\t \t\t \t\t\t}\n break;}\n \t\t \t\t case DateTimeConstants.THURSDAY: {\n\t\t\t \t\t \t\t\tif(sourceData.getThursdayFlag()==1){\n\t\t\t \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t \t\t \t\t\t\t\t Integer day=DateTimeConstants.THURSDAY;\n\t\t\t Integer totalSecondRest=sourceData.getSecondThursdayRest();\n\t\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t\t\t \t\t \t\t\t\t }\n\t\t\t \t\t \t\t\t}else{\n\t\t\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t\t\t \t\t \t\t\t}\n break;}\n \t\t \t\t \n \t\t \t\t case DateTimeConstants.FRIDAY: {\n\t\t \t\t \t\t\tif(sourceData.getFridayFlag()==1){\n\t\t \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t\t\t Integer day=DateTimeConstants.FRIDAY;\n\t\t Integer totalSecondRest=sourceData.getSecondFridayRest();\n\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t\t \t\t \t\t\t\t }\n\t\t \t\t \t\t\t}else{\n\t\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t\t \t\t \t\t\t}\n \t\t \t\t\t break;}\n \t\t \t\t case DateTimeConstants.SATURDAY: {\n \t\t \t\t\t \n\t\t \t\t \t\t\tif(sourceData.getSaturdayFlag()==1){\n\t\t \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t\t\t Integer day=DateTimeConstants.SATURDAY;\n\t\t Integer totalSecondRest=sourceData.getSecondSaturdayRest();\n\t\t totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n\t\t \t\t \t\t\t\t }\n\t\t \t\t \t\t\t}else{\n\t\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t\t \t\t \t\t\t}\n \t\t \t\t\t \n \t\t \t\t\t break;}\n \t\t \t\tcase DateTimeConstants.SUNDAY: {\n \t\t \t\t\t\n \t\t \t\t\tif(sourceData.getSundayFlag()==1){\n \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t boolean isHoliday=isEndDateParamIsHolidayDate(endDateParam,includeHoliday,ticketHolidays);\n\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t totalAgingInSameDays=0L;\n\t\t\t\t\t\t\t\t\t }else{\n \t\t \t\t\t\t\t Integer day=DateTimeConstants.SUNDAY;\n Integer totalSecondRest=sourceData.getSecondSundayRest();\n totalAgingInSameDays=getTotalAgingFromSameDay(day,endDateParam,startDateParam,totalSecondRest,ticketRests);\n \t\t \t\t\t\t }\n\t \t\t \t\t\t}else{\n\t \t\t \t\t\t\ttotalAgingInSameDays=0L;\n\t \t\t \t\t\t}\n \t\t \t\t\t\n \t\t \t\t\t break;}\n \t\t\n \t\t }\n \t\t \n\n \t\tLong detik=totalAgingInSameDays;\n \t Long menit=detik/60;\n \t Long jam=menit/60;\n \t \n \t\tSystem.out.println(\" Detik in Same Days \"+detik+\" Menit \"+menit+\" Jam \"+jam);\n }else{\n \t // Jika rentang hari >0 \n\t\t\t \t // Menghitung Hari Pertama \n\t\t\t \t // Memperhatikan Start - Sampai End. Respon End nya di isi end kerja\n\t\t\t \t // JIKA HARI YANG BERBEDA , MAKA PISAHKAN PERHITUNGAN \n\t\t\t \t\n \t \t\t\t // PERHITUNGAN HARI PERTAMA\n\t\t\t \t LocalDateTime endDateParamForLastDay=LocalDateTime.fromDateFields(endDateParam.toDate());\n\t\t\t \t LocalDateTime endDateParamForFirstDay=LocalDateTime.fromDateFields(endDateParam.toDate());\n\t\t\t \t LocalDateTime startDateParamForFirstDay=LocalDateTime.fromDateFields(startDateParam.toDate());\n\t\t\t \t \n\t\t \t\t switch (startDateParam.getDayOfWeek()) {\n\t\t\t \t\t \t\tcase DateTimeConstants.MONDAY: { \n\t\t\t\t Integer day=DateTimeConstants.MONDAY;\n\t\t\t\t Integer totalSecondRest=sourceData.getSecondMondayRest();\n\t\t\t\t // End di isi respon start\n\t\t\t\t // karena tgl akhir bekerja terkadang tidak sesuai dengan \n\t\t\t\t // database , jadi untuk mendapatkan hari yang sama, tgl yang sama \n\t\t\t\t // dan diisi work end pada respon start\n\t\t\t\t //Start berbeda2, work end sama\n\t\t\t\t if(sourceData.getMondayFlag()==1){\n\t\t\t\t\t\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t \ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t \t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getMondayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getMondayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getMondayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t \t\ttotalAgingFirstDays=0L;\n\t\t\t\t \t}\n\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t \t\t \t\tcase DateTimeConstants.TUESDAY: { \n\t\t\t\t\t\t\t \t\t if(sourceData.getTuesdayFlag()==1){\n\t\t\t\t\t\t\t \t\t \tInteger includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t \t\t \t\t\t Integer day=DateTimeConstants.TUESDAY;\n\t\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondTuesdayRest();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getTuesdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getTuesdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getTuesdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t \t\t \t\ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t\t \t\t \t}\n\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t \t\t \t\t\n\t\t\t \t\t \t\tcase DateTimeConstants.WEDNESDAY: { \n\t\t\t \t\t \t\t\t\n\t\t\t\t \t\t \t\t if(sourceData.getWednesdayFlag()==1){\n\t\t\t\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t\t \t\t\t Integer day=DateTimeConstants.WEDNESDAY;\n\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondWednesdayRest();\n\t\t\t\t\t\t \n\t\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getWednesdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getWednesdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getWednesdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t\t \t\ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t \t\t \t}\n\t\t\t break;\n\t\t\t\t }\n\t\t\t\t \t\t \tcase DateTimeConstants.THURSDAY: { \n\t\t\t\t\t\t\t \t\tif(sourceData.getThursdayFlag()==1){\n\t\t\t\t\t\t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t\t }else{\t \n\t\t\t\t\t\t\t \t\t\t\t\t Integer day=DateTimeConstants.THURSDAY;\n\t\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondThursdayRest();\n\t\t\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getThursdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getThursdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getThursdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t \t\t\ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t\t \t\t}\n\t\t\t\t \t\t \t\t\n\t\t\t break;\n\t\t\t\t }\n\t\t\t\t \t\t \t\n\t\t\t\t\t \t\t case DateTimeConstants.FRIDAY: { \n\t\t\t\t\t\t\t\t if(sourceData.getFridayFlag()==1){\n\t\t\t\t\t\t\t\t \tInteger includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t \t\t Integer day=DateTimeConstants.FRIDAY;\n\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondFridayRest();\n\t\t\t\t\t\t \n\t\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getFridayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getFridayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getFridayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t \t\ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t \t\t\t break;\n\t\t\t\t }\n\t\t\t\t\t \t\t \n\t\t\t\t\t \t\t case DateTimeConstants.SATURDAY: { \n\t\t\t\t\t \t\t\t \n\t\t\t\t\t \t\t\t if(sourceData.getSaturdayFlag()==1){\n\t\t\t\t\t \t\t\t \tInteger includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t \t\t Integer day=DateTimeConstants.SATURDAY;\n\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondSaturdayRest();\n\t\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getSaturdayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getSaturdayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getSaturdayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t \t\ttotalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t break;\n\t\t\t\t }\n\t\t\t\t\t \t\t case DateTimeConstants.SUNDAY: { \n\t\t\t\t\t \t\t\t if(sourceData.getSundayFlag()==1){\n\t\t\t\t\t \t\t\t\tInteger includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(startDateParamForFirstDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t \t totalAgingFirstDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t \t\t\t\t\t Integer day=DateTimeConstants.SUNDAY;\n\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondSundayRest();\n\t\t\t\t\t Date endDateParamTemp=Utils.removeTime(startDateParam.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponEnd=LocalDateTime.fromDateFields(endDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour end work \n\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusHours(sourceData.getSundayToTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusMinutes(sourceData.getSundayToTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t localReponEnd=localReponEnd.plusSeconds(sourceData.getSundayToTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t\t\t endDateParamForFirstDay=localReponEnd;\n\t\t\t\t\t totalAgingFirstDays=calculateTotalAgingForFirstDay(day,endDateParamForFirstDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t \t\t\t\t\ttotalAgingFirstDays=0L;\n\t\t\t\t \t\t\t\t}\n\t\t\t break;\n\t\t\t\t }\n\t\t \t\t }\n\t\t \t\t Long detikAgingFisrtDay=totalAgingFirstDays;\n\t\t \t\t Long menitAgingFisrtDay=detikAgingFisrtDay/60;\n\t\t \t\t Long jamAgingFisrtDay=menitAgingFisrtDay/60;\n\t\t \t\t \n\t\t \t\t System.out.println(\"\\n First Day : Detik \"+detikAgingFisrtDay +\"Menit : \"+menitAgingFisrtDay+\" Jam : \"+jamAgingFisrtDay);\n\t\t \t\t //=========================================\n\t\t \t\t //END HARI PERTAMA\n\t\t \t\t //==========================================\n \t\t \n\t\t\t \t // START CALCULATE BETWEEN DAYS \n\t\t\t \t // cek jika diantara tanggal tengah ada yang libur atau \n\t\t \t\t System.out.println(\"Rentang Hari \"+days);\n\t\t \t\t System.out.println(\"======================\");\n\t\t \t\t System.out.println(\"Start Between Days\");\n\t\t \t\t Long tempBetweenDays=new Long(0L);\n\t\t\t \t for (int i=1; i<days; i++) {\n\t\t\t\t\t\t\t\t LocalDateTime curentStartWork=startDateParam.plusDays(i);\n\t\t\t\t\t\t\t\t if(curentStartWork.getDayOfWeek()==DateTimeConstants.MONDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getMondayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getMondayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.TUESDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getTuesdayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getTuesdayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.WEDNESDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getWednesdayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getWednesdayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.THURSDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getThursdayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getThursdayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.FRIDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getFridayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getFridayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.SATURDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getSaturdayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getSaturdayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else if(curentStartWork.getDayOfWeek()==DateTimeConstants.SUNDAY){\n\t\t\t\t\t\t\t\t\t if(sourceData.getSundayFlag()==1){\n\t\t\t\t\t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(curentStartWork, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=Long.valueOf(sourceData.getSundayWorkSec());\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t System.out.println(\"Hari Ke \"+i+\" \"+tempBetweenDays);\n\t\t\t\t\t\t\t\t totalAgingBetweenDays=totalAgingBetweenDays+tempBetweenDays;\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }\n\t\t\t \t \n\t\t\t \tSystem.out.println(\"End Between Days.... \");\n\t\t\t \t // END CALCULATE BETWEEN DAYS \n\t\t\t \t \n\t\t\t \t Long detikBetweenDays=totalAgingBetweenDays;\n\t\t\t \t\t\tLong menitBetweenDay=detikBetweenDays/60;\n\t\t\t \t\t\tLong jamBetweenDay=menitBetweenDay/60;\n\t\t\t \t\t\t\n\t\t\t \t\tSystem.out.println(\"\\n Detik between days :\"+detikBetweenDays+\" Menit : \"+menitBetweenDay+\" Jam : \"+jamBetweenDay);\n \t \n\t\t\t \t \n\t\t\t // CALCULATE LAST DAYS\n \t\t // yang harus di ke defaul adalah hari starnya\n \t\t // karena akan mengambil waktu dari end - start, waktu pada hari itu\n \t\t \n \t\t // RESPON_START=REMOVE_TGL(RESPON_END)+JAM,MENIT,DETIK START WORK (untuk memastikan tanggal sama)\n \t\t // TERKADANG TANGGAL START WORK DI DATABASE TANGGALNYA BERBEDA , MISAL TANGGAL 2016-02-02, padahal ticket 2017\n \t\t switch (endDateParamForLastDay.getDayOfWeek()) {\n \t\t \t\tcase DateTimeConstants.MONDAY: { \n \n \t\t \t\t\t\t\tif(sourceData.getMondayFlag()==1){\n \t\t \t\t\t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t Integer day=DateTimeConstants.MONDAY;\n\t\t\t\t\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondMondayRest();\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t // move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getMondayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getMondayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getMondayFromTime().getSeconds());\n\t\t\t\t\t\t\t\t\t\t startDateParam=localReponStart;\n\t\t\t\t\t\t\t\t\t\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t }\n \t\t \t\t\t\t\t}else{\n \t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n \t\t \t\t\t\t\t}\n\t break;\n\t }\n \t\t \t\tcase DateTimeConstants.TUESDAY: { \n \t\t \t\t\tif(sourceData.getTuesdayFlag()==1){\n \t\t \t\t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t }else{\n\t \t\t \t\t\t Integer day=DateTimeConstants.TUESDAY;\n\t Integer totalSecondRest=sourceData.getSecondTuesdayRest();\n\t\n\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getTuesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getTuesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getTuesdayFromTime().getSeconds());\n\t startDateParam=localReponStart;\n\t \n\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t }else{\n\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n\t \t\t\t\t\t}\n\t break;\n\t }\n \t\t \t\t\n \t\t \t\tcase DateTimeConstants.WEDNESDAY: { \n \t\t \t\t\tif(sourceData.getWednesdayFlag()==1){\n \t\t \t\t\t \n \t\t \t\t\t\tboolean isIncludeHoliday=false;\n \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t }else{\n \t\t \t\t\t\t Integer day=DateTimeConstants.WEDNESDAY;\n\t Integer totalSecondRest=sourceData.getSecondWednesdayRest();\n\t\n\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getWednesdayFromTime().getHours());\n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getWednesdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getWednesdayFromTime().getSeconds());\n\t startDateParam=localReponStart;\n\t \n totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t }\n \t\t \t\t\t }else{\n\t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n\t\t \t\t\t\t\t}\n break;\n }\n \t\t \tcase DateTimeConstants.THURSDAY: {\n\t\t\t\t\t \t\t if(sourceData.getThursdayFlag()==1){\n\t\t\t\t\t \t\t\tboolean isIncludeHoliday=false;\n\t\t\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }else{\t\t\n\t\t\t\t\t\t \t\t \t Integer day=DateTimeConstants.THURSDAY;\n\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondThursdayRest();\n\t\t\t\t\t\n\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getThursdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getThursdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getThursdayFromTime().getSeconds());\n\t\t\t\t\t startDateParam=localReponStart;\n\t\t\t\t \n\t\t\t\t\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t}else{\n\t\t \t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n\t\t \t\t \t\t\t\t\t}\n\t\t break;\n\t\t }\n \t\t \t\n\t\t\t\t \t\t case DateTimeConstants.FRIDAY: { \n\t\t\t\t \t\t\tif(sourceData.getFridayFlag()==1){\n\t\t\t\t \t\t\t\tboolean isIncludeHoliday=false;\n\t\t\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t }else{\t\n\t\t\t\t\t\t \t\t\t Integer day=DateTimeConstants.FRIDAY;\n\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondFridayRest();\n\t\t\t\t\t\n\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getFridayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getFridayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getFridayFromTime().getSeconds());\n\t\t\t\t\t startDateParam=localReponStart;\n\t\t\t\t\t \n\t\t\t\t\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n\t\t \t\t \t\t\t\t\t}\n\t\t\t break;\n\t\t\t }\n\t \t\t \n\t\t\t \t\t case DateTimeConstants.SATURDAY: { \n\t\t\t \t\t\t if(sourceData.getSaturdayFlag()==1){\n\t\t\t\t \t\t\t \tboolean isIncludeHoliday=false;\n\t\t\t\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t \t\t\t Integer day=DateTimeConstants.SATURDAY;\n\t\t\t\t\t\t Integer totalSecondRest=sourceData.getSecondSaturdayRest();\n\t\t\t\t\t\t\n\t\t\t\t\t\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getSaturdayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getSaturdayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getSaturdayFromTime().getSeconds());\n\t\t\t\t\t\t startDateParam=localReponStart;\n\t\t\t\t\t\t \n\t\t\t\t\t\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t }else{\n\t\t \t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n\t\t \t\t \t\t\t\t\t}\n\t\t break;\n\t\t }\n\t\t \t\t case DateTimeConstants.SUNDAY: { \n\t\t \t\t\t if(sourceData.getSaturdayFlag()==1){\n\t\t \t\t\t\tboolean isIncludeHoliday=false;\n\t \t\t \t\t\t Integer includeHoliday=sourceData.getIncludeHoliday();\n\t\t\t\t\t\t\t boolean isHoliday=isTheDateIsHolidayDate(endDateParamForLastDay, endDateParamForFirstDay, includeHoliday, ticketHolidays);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t if(isHoliday){\n\t\t\t\t\t\t\t\t tempBetweenDays=0L;\n\t\t\t\t\t\t\t }else{\n\t\t\t\t \t\t\t Integer day=DateTimeConstants.SUNDAY;\n\t\t\t Integer totalSecondRest=sourceData.getSecondSundayRest();\n\t\t\t\n\t\t\t Date startDateParamTemp=Utils.removeTime(endDateParamForLastDay.toDate());\n\t\t\t\t\t\t\t\t\t LocalDateTime localReponStart=LocalDateTime.fromDateFields(startDateParamTemp);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// move Date with hour 00:00:00 to hour start work \n\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusHours(sourceData.getSundayFromTime().getHours());\n\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusMinutes(sourceData.getSundayFromTime().getMinutes());\n\t\t\t\t\t\t\t\t\t localReponStart=localReponStart.plusSeconds(sourceData.getSundayFromTime().getSeconds());\n\t\t\t startDateParam=localReponStart;\n\t\t\t \n\t\t\t totalAgingLastDays=getTotalAgingFromLastDay(day,endDateParamForLastDay,startDateParam,totalSecondRest,ticketRests);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }else{\n \t\t \t\t\t\t\t\ttotalAgingLastDays=0L;\n \t\t \t\t\t\t\t }\n\t break;\n\t }\n \t\t }\n \t\t \n\t \t\t//END CALCULATE LAST DAYS\n\t \t\t//END CALCULATE LAST DAYS\n\t \t\t//END CALCULATE LAST DAYS\n \t\t \n } // END IF DAYS>0\n\t\t}else{\n\t\t\t//Jika end>start \n\t\t\ttotalAging=0L;\n\t\t}\n\t\t\n\t\tLong detik=totalAgingLastDays;\n\t\tLong menit=detik/60;\n\t\tSystem.out.println(\" \\n ============================== \\n Last Day : \"+detik+\" Menit Last day : \"+menit+\" Jam : \"+menit/60);\n\t\tSystem.out.println(\"=================================\\n\");\n\t\tSystem.out.println(\" \\n Respon End : \"+endDateParam+\" \\n\\n totalAgingInSameDays :\"+totalAgingInSameDays+\" totalAgingFirstDays :\"+totalAgingFirstDays+\" totalAgingBetweenDays :\"+totalAgingBetweenDays+\" totalAgingLastDays :\"+totalAgingLastDays);\n\t\t\n\t\t\n\t\ttotalAging=totalAgingInSameDays+totalAgingFirstDays+totalAgingBetweenDays+totalAgingLastDays;\n\t\treturn totalAging;\n\t}",
"public void setupDays() {\n\n //if(days.isEmpty()) {\n days.clear();\n int day_number = today.getActualMaximum(Calendar.DAY_OF_MONTH);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEEE\");\n SimpleDateFormat sdfMonth = new SimpleDateFormat(\"MMM\");\n today.set(Calendar.DATE, 1);\n for (int i = 1; i <= day_number; i++) {\n OrariAttivita data = new OrariAttivita();\n data.setId_utente(mActualUser.getID());\n\n //Trasformare in sql date\n java.sql.Date sqldate = new java.sql.Date(today.getTimeInMillis());\n data.setGiorno(sqldate.toString());\n\n data.setDay(i);\n data.setMonth(today.get(Calendar.MONTH) + 1);\n\n data.setDay_of_week(today.get(Calendar.DAY_OF_WEEK));\n Date date = today.getTime();\n String day_name = sdf.format(date);\n data.setDay_name(day_name);\n data.setMonth_name(sdfMonth.format(date));\n\n int indice;\n\n if (!attivitaMensili.isEmpty()) {\n if ((indice = attivitaMensili.indexOf(data)) > -1) {\n OrariAttivita temp = attivitaMensili.get(indice);\n if (temp.getOre_totali() == 0.5) {\n int occurence = Collections.frequency(attivitaMensili, temp);\n if (occurence == 2) {\n for (OrariAttivita other : attivitaMensili) {\n if (other.equals(temp) && other.getCommessa() != temp.getCommessa()) {\n data.setOtherHalf(other);\n data.getOtherHalf().setModifica(true);\n }\n }\n\n }\n }\n data.setFromOld(temp);\n data.setModifica(true);\n }\n }\n isFerie(data);\n\n\n //Aggiungi la data alla lista\n days.add(data);\n\n //Aggiugni un giorno alla data attuale\n today.add(Calendar.DATE, 1);\n }\n\n today.setTime(actualDate);\n\n mCalendarAdapter.notifyDataSetChanged();\n mCalendarList.setAdapter(mCalendarAdapter);\n showProgress(false);\n }",
"public interface CalculatorService {\n\n\tpublic double add(double arg1, double arg2); \n\tpublic double sub(double arg1, double arg2); \n\tpublic double div(double arg1, double arg2);\n\tpublic double mult(double arg1, double arg2);\n}",
"public List<Demand> generateDemand(CalculationReq request, List<Calculation> calculations,\n\t\t\tMap<String, Object> masterMap, boolean isForConnectionNo) {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tMap<String, Object> financialYearMaster = (Map<String, Object>) masterMap\n\t\t\t\t.get(SWCalculationConstant.BILLING_PERIOD);\n\t\tLong fromDate = (Long) financialYearMaster.get(SWCalculationConstant.STARTING_DATE_APPLICABLES);\n\t\tLong toDate = (Long) financialYearMaster.get(SWCalculationConstant.ENDING_DATE_APPLICABLES);\n\t\t\n\t\t// List that will contain Calculation for old demands\n\t\tList<Calculation> updateCalculations = new LinkedList<>();\n\t\tList<Calculation> createCalculations = new LinkedList<>();\n\t\tif (!CollectionUtils.isEmpty(calculations)) {\n\t\t\t// Collect required parameters for demand search\n\t\t\tString tenantId = calculations.get(0).getTenantId();\n\t\t\tLong fromDateSearch = null;\n\t\t\tLong toDateSearch = null;\n\t\t\tSet<String> consumerCodes;\n\t\t\tif (isForConnectionNo) {\n\t\t\t\tfromDateSearch = fromDate;\n\t\t\t\ttoDateSearch = toDate;\n\t\t\t\tconsumerCodes = calculations.stream().map(calculation -> calculation.getConnectionNo())\n\t\t\t\t\t\t.collect(Collectors.toSet());\n\t\t\t} else {\n\t\t\t\tconsumerCodes = calculations.stream().map(calculation -> calculation.getApplicationNO())\n\t\t\t\t\t\t.collect(Collectors.toSet());\n\t\t\t}\n\n\t\t\tList<Demand> demands = searchDemand(tenantId, consumerCodes, fromDateSearch, toDateSearch, request.getRequestInfo(), null,\n\t\t\t\t\trequest.getDisconnectRequest());\n\t\t\tSet<String> connectionNumbersFromDemands = new HashSet<>();\n\t\t\tif (!CollectionUtils.isEmpty(demands))\n\t\t\t\tconnectionNumbersFromDemands = demands.stream().map(Demand::getConsumerCode)\n\t\t\t\t\t\t.collect(Collectors.toSet());\n\t\t\t// List that will contain Calculation for new demands\n\t\t\t// If demand already exists add it updateCalculations else\n\t\t\t// createCalculations\n\t\t\tfor (Calculation calculation : calculations) {\n\t\t\t\tif (request.getDisconnectRequest() != null && request.getDisconnectRequest()) {\n\t\t\t\t\tdemands = searchDemandForDisconnectionRequest(calculation.getTenantId(), consumerCodes, null,\n\t\t\t\t\t\t\ttoDateSearch, request.getRequestInfo(), null, request.getDisconnectRequest());\n\t\t\t\t\tif (!CollectionUtils.isEmpty(demands) &&\n\t\t\t\t\t\t\t!(demands.get(0).getDemandDetails().get(0).getCollectionAmount().doubleValue() == 0.0)) {\n\t\t\t\t\t\tcreateCalculations.add(calculation);\n\t\t\t\t\t} else if (CollectionUtils.isEmpty(demands)) {\n\t\t\t\t\t\tcalculation.getApplicationNO();\n\t\t\t\t\t\tcreateCalculations.add(calculation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdateCalculations.add(calculation);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!connectionNumbersFromDemands.contains(isForConnectionNo ? calculation.getConnectionNo() : calculation.getApplicationNO())) {\n\t\t\t\t\t\tcreateCalculations.add(calculation);\n\t\t\t\t\t} else\n\t\t\t\t\t\tupdateCalculations.add(calculation);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tList<Demand> createdDemands = new ArrayList<>();\n\t\tif (!CollectionUtils.isEmpty(createCalculations))\n\t\t\tcreatedDemands = createDemand(request.getRequestInfo(), createCalculations, masterMap, isForConnectionNo);\n\n\t\tif (!CollectionUtils.isEmpty(updateCalculations))\n\t\t\tcreatedDemands = updateDemandForCalculation(request.getRequestInfo(), updateCalculations, fromDate, toDate, isForConnectionNo,\n\t\t\t\t\trequest.getDisconnectRequest());\n\t\treturn createdDemands;\n\t}",
"public interface StockPriceDataSource {\n\n /**\n * daily prices\n * @param date required date, can be today\n * @return list of deals for the day\n */\n List<StockTrade> getDayPrices(LocalDate date) throws IOException;\n}",
"private void calculateFinancialStartDate(DepreciationCriteria criteria) {\n\t\tLong todate = criteria.getToDate();\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(todate);\n\t\tint year = calendar.get(Calendar.YEAR);\n\t\tint month = calendar.get(Calendar.MONTH);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 23);\n\t\tcalendar.set(Calendar.MINUTE, 59);\n\t\tcriteria.setToDate(calendar.getTimeInMillis());\n\n\t\t// choosing the finacial year based on todate month\n\t\tif (month < 3) {\n\t\t\tcriteria.setFinancialYear(year-1+\"-\"+year);\n\t\t\tyear = year - 1;\n\t\t}else\n\t\t\tcriteria.setFinancialYear(year+\"-\"+(year+1));\n\n\t\t// setting from date value\n\t\tcalendar.set(Calendar.YEAR, year);\n\t\tcalendar.set(Calendar.MONTH, Calendar.APRIL);\n\t\tcalendar.set(Calendar.DATE, 1);\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\tcriteria.setFromDate(calendar.getTimeInMillis());\n\t\tSystem.err.println(\"from date calculated : \" + criteria.getFromDate());\n\t}",
"public static Date getForecastStartDate(ScheduleGroupData scheduleGroupData, Date calculationDate, int offset)\n {\n Date startDate = null;\n String dayOfWeekStr = null;\n int dayOfWeekInt = 0;\n \n dayOfWeekInt = scheduleGroupData.getSkdgrpStartdow();\n \n //defaults to sunday if start dow is not properly set\n switch(dayOfWeekInt)\n { \t\n \tcase 1:\n \t dayOfWeekStr = PTSHelper.SUNDAY; \n \t break;\n \tcase 2:\n \t dayOfWeekStr = PTSHelper.MONDAY;\n \t break;\n \tcase 3:\n \t dayOfWeekStr = PTSHelper.TUESDAY;\n \t break;\n \tcase 4:\n \t dayOfWeekStr = PTSHelper.WEDNESDAY;\n \t break;\n \tcase 5:\n \t dayOfWeekStr = PTSHelper.THURSDAY;\n \t break;\n \tcase 6:\n \t dayOfWeekStr = PTSHelper.FRIDAY;\n \t break;\n \tcase 7:\n \t dayOfWeekStr = PTSHelper.SATURDAY;\n \t break; \t\n \tdefault:\n \t dayOfWeekStr = PTSHelper.SUNDAY; \n \t \tbreak;\n }\n \n startDate = DateHelper.addDays(calculationDate, offset);\n startDate = DateHelper.nextDay(startDate, dayOfWeekStr);\n \n return startDate;\n }",
"public interface EvaluatorFactory {\n Evaluator createEvaluator(RelationalOperator operator);\n}",
"static DataFrameFactory factory() {\n return DataFrameFactory.getInstance();\n }",
"public interface Calculator {\n double calculate(double start, double end, double step);\n}",
"public InterestRateMonteCarloProductFactory(final LocalDate referenceDate) {\n\t\tsuper();\n\t\tthis.referenceDate = referenceDate;\n\t}",
"private Date getFrom(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n switch(ph) {\n case TODAY:\n return date.getTime();\n case YESTERDAY:\n date.add(Calendar.DAY_OF_MONTH, -1);\n return date.getTime();\n case THIS_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n return date.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n date.add(Calendar.DAY_OF_MONTH, -7);\n return date.getTime();\n case THIS_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case LAST_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n date.add(Calendar.MONTH, -1);\n return date.getTime();\n case T12_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -12);\n return date.getTime();\n case T24_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -24);\n return date.getTime();\n case T2_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -48);\n return date.getTime();\n case T3_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -72);\n return date.getTime();\n case T4_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -96);\n return date.getTime();\n case T5_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -120);\n return date.getTime();\n case T6_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -144);\n return date.getTime();\n case T7_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -168);\n return date.getTime();\n }\n return null;\n }",
"public interface EquationFactory {\n\n /**\n * Creates a new ready-to-use data structure from configuration file\n *\n * @param file the configuration\n *\n * @return a map between group and the equation of the particular group\n *\n * @throws IOException if any IO errors occur.\n */\n Map<String, Equation> compile(File file) throws IOException;\n\n /**\n * Creates a new ready-to-use data structure from input stream\n *\n * @param stream the stream configuration\n *\n * @return a map between group and the equation of the particular group\n *\n * @throws IOException if any IO errors occur.\n */\n Map<String, Equation> compile(InputStream stream) throws IOException;\n\n}",
"public interface DateInterface \n{\n /*\n Dada uma data, determina a sua estação do ano (Primavera, Verão, Outono ou Inverno) de acordo com o hemisfério Norte.\n */\n public String estacaoDoAno(LocalDate d);\n \n /*\n Determina o dia da semana do primeiro dia de um ano.\n */\n public DayOfWeek primeiroDiaSemanaAno(int ano);\n \n /*\n Determina o dia da semana de uma data.\n */\n public DayOfWeek diaDaSemana(LocalDate d);\n \n /*\n Determina o dia do ano de uma data (por exemplo, 10/01/2018 corresponde ao 10º dia do ano de 2018).\n */\n public int diaDoAno(LocalDate d);\n \n /*\n Determina em que trimestre do ano uma data se situa.\n */\n public int trimestre(LocalDate d);\n \n /*\n Determina o número de semanas completas entre duas datas, sendo uma delas a atual.\n */\n public long numSemanasAteData(LocalDate d);\n \n /*\n Determina se um ano é bissexto ou não.\n */\n public boolean anoBissexto(Year ano);\n \n /*\n Determina o século, o milénio e a era de uma data.\n */\n public TuploSeculoMilenioEra seculoMilenioEraData(LocalDate d);\n \n /*\n Determina quanto tempo falta até à próxima passagem do cometa Halley. Mostra o resultado em dias totais, meses totais\n e anos totais.\n */\n public ParDataDiaMesAno cometaHalley();\n \n /*\n Determina o número de dias úteis entre duas dadas datas.\n */\n public int diasUteisEntreDatas(LocalDate d1, LocalDate d2);\n \n /*\n Determina quantos fins-de-semanas completos um ano tem. Caso o ano inserido possua um sábado ou um domingo extra, \n estes também são sinalizados.\n */\n public ParFimDeSemana numFinsDeSemanaAno(int ano);\n \n /*\n Determina quantos dias faltam até ao próximo Natal.\n */\n public long diasAteNatal();\n \n /*\n Determina o salário de um indivíduo sabendo quanto ganha por hora e o ano que pretende calcular. Apresenta o resultado\n em dias, semanas, meses e ano.\n */\n public SalarioAno salarioDiaMesSemanaAno(float salarioHora, int ano); \n \n /*\n Determina o número de dias úteis (isto é, que não são fins-de-semana) de um ano.\n */\n public int numDiasUteisAno(int ano);\n \n /*\n Determina em que dias são os fins-de-semana de um dado mês. Por exemplo, em Janeiro de 2018 o primeiro fim-de-semana\n ocorre nos dias 6 (Sábado) e 7 (Domingo).\n */\n public Map<Integer, DayOfWeek> finsDeSemanaDoMes(int ano, int mes);\n \n /*\n A uma dada data são somados anos, meses, semanas e dias.\n */\n public LocalDate somaData(LocalDate d, int ano, int mes, int semanas, int dias);\n \n /*\n A uma dada data são subtraidos anos, meses, semanas e dias.\n */\n public LocalDate subtraiData(LocalDate d, int ano, int mes, int semanas, int dias);\n \n /*\n Dado um número de dias, calcula a data daqui a esse número de dias e apresenta ainda qual o dia da semana e quantos\n dias úteis faltam até lá.\n */\n public TuploDataDia_SemanaDias_Uteis eventoDaquiXDias(int dias);\n \n /*\n Dado um número de dias úteis, calcula a data daqui a esse número de dias e apresenta ainda qual o dia da semana.\n */\n public ParDataDiaDaSemana eventoDaquiXDiasUteis(int dias);\n \n /*\n Determina qual a data da próxima Black Friday e quantos dias faltam até essa data.\n */\n public ParDataDia proxBlackFriday();\n \n /*\n Calcula a data da Páscoa de um determinado ano.\n */\n public LocalDate proxPascoa(int ano);\n \n /*\n Para um dado ano apresenta a data dos feriados nacionais e em que dia da semana ocorrem.\n */\n public Map<String, MonthDay> dataFeriadosNacionais(int ano);\n \n /*\n Calcula a diferença entre duas datas. Apresenta o resultado em anos, meses e dias. Por exemplo, de 01/01/2018 até \n 10/02/2018 existe uma diferença de 0 anos, 1 mês e 9 dias.\n */\n public static TuploAnosMesesDias difEntreDatas(LocalDate d1, LocalDate d2)\n { \n boolean stop = false;\n boolean stop2 = false;\n long dias;\n int meses;\n int anos;\n \n anos = 0;\n meses = 0;\n dias = 0;\n\n while((d1.getYear() != d2.getYear() || d1.getMonthValue() != d2.getMonthValue())&&!stop && !stop2)\n {\n \n \n while(d1.getMonthValue() != d2.getMonthValue() && !stop2)\n {\n if(d1.getYear() == (d2.getYear() - 1) && d1.getMonthValue() == 12 && d2.getMonthValue() == 1 && d2.getDayOfMonth() < d1.getDayOfMonth())\n {\n stop2 = true;\n dias = 31 - d1.getDayOfMonth() + d2.getDayOfMonth();\n }\n if(stop2 == false)\n {\n YearMonth anoMes = YearMonth.of(d1.getYear(), d1.getMonth());\n int daysInMonth = anoMes.lengthOfMonth(); \n\n if(((d2.getYear() - d1.getYear()) == 0) \n &&((d2.getMonthValue() - d1.getMonthValue()) == 1)\n &&(d1.getDayOfMonth() > d2.getDayOfMonth()))\n {\n\n dias = d2.getDayOfMonth() + daysInMonth - d1.getDayOfMonth(); \n stop = true;\n break;\n }\n\n meses++;\n\n d1 = d1.plusMonths(1);\n }\n }\n if(stop2 == false)\n {\n if(d1.getMonthValue() == d2.getMonthValue() && d1.getYear() !=d2.getYear())\n {\n meses++;\n d1 = d1.plusMonths(1);\n }\n }\n }\n \n if(d1.getMonthValue() == d2.getMonthValue())\n {\n dias = d2.getDayOfMonth() - d1.getDayOfMonth();\n }\n\n while(meses > 12)\n {\n anos++;\n meses-=12;\n }\n \n return new TuploAnosMesesDias(anos, meses, dias);\n \n }\n}",
"@Test\n public void computeFactor_WinterTimeDay() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-21 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-30 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.DAY,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(10, factor, 0);\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tDate date = new Date();\r\n\t\t\r\n\t\tLocalDate diaHoy = LocalDate.now();\r\n\t\tLocalDate diaFin = diaHoy.plusDays(15);\r\n\t\t\r\n\t\tCursoVacacional curso1 = new CursoVacacional();\r\n\t\tcurso1.setNombre(\"Volley Principiantes\");\r\n\t\tcurso1.setFechaInicio(diaHoy);\r\n\t\tcurso1.setFechaFin(diaFin);\r\n\t\t\r\n\t\tSystem.out.println(\"Nombre: \" +curso1.getNombre());\r\n\t\tSystem.out.println(\"F I: \" + curso1.getFechaInicio());\r\n\t\tSystem.out.println(\"F F: \" + curso1.getFechaFin());\r\n\t\t\r\n\t\tLocalDate diaHoy2 = LocalDate.now();\r\n\t\tLocalDate diaQueInicio = diaHoy2.minusDays(2);\r\n\t\tLocalDate diaQueFinaliza = diaQueInicio.plusDays(20);\r\n\t\t\r\n\t\tCursoVacacional curso2 = new CursoVacacional();\r\n\t\tcurso2.setNombre(\"Volley Principiantes\");\r\n\t\tcurso2.setFechaInicio(diaHoy);\r\n\t\tcurso2.setFechaFin(diaFin);\r\n\t\t\r\n\t\tSystem.out.println(\"Nombre: \" +curso2.getNombre());\r\n\t\tSystem.out.println(\"F I: \" + curso2.getFechaInicio());\r\n\t\tSystem.out.println(\"F F: \" + curso2.getFechaFin());\r\n\t\t\r\n\t\t\r\n\t}",
"@Test\r\n public void testifHoliday() {\r\n LocalDate date1 = LocalDate.parse(\"2018-01-12\");\r\n assertTrue(DateUtil.ifHoliday(date1));\r\n\r\n date1 = LocalDate.parse(\"2018-01-14\");\r\n assertFalse(DateUtil.ifHoliday(date1));\r\n }",
"private static IWorkingDays getWorkingDaysStrategy(Currency currency) {\n if ((currency.getCurrencyCode().equals(\"AED\")) ||\n (currency.getCurrencyCode().equals(\"SAR\")))\n {\n return ArabiaWorkingDays.getInstance();\n }\n return DefaultWorkingDays.getInstance();\n }",
"public Holiday<GregorianCalendar> getHoliday() {\n return _holiday;\n }",
"public interface StockPECalculator extends StockCalculator{\n BigDecimal calculatePE(Stock stock, LocalDate calculationDate);\n\n}",
"public static PeriodFactory init() {\n\t\ttry {\n\t\t\tPeriodFactory thePeriodFactory = (PeriodFactory)EPackage.Registry.INSTANCE.getEFactory(PeriodPackage.eNS_URI);\n\t\t\tif (thePeriodFactory != null) {\n\t\t\t\treturn thePeriodFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new PeriodFactoryImpl();\n\t}",
"private ProxyCalendar getFactoryProxyCalendar(Class type) {\n // we don't lock here; ok if two proxies get generated for same type\n ProxyCalendar proxy = (ProxyCalendar) _proxies.get(type);\n if (proxy == null) {\n ClassLoader l = GeneratedClasses.getMostDerivedLoader(type,\n ProxyCalendar.class);\n Class pcls = loadBuildTimeProxy(type, l);\n if (pcls == null)\n pcls = generateAndLoadProxyCalendar(type, true, l);\n proxy = (ProxyCalendar) instantiateProxy(pcls, null, null);\n _proxies.put(type, proxy);\n }\n return proxy;\n }",
"@Test\n public void testOrderFactoryDaySales() {\n OrderController orderController = orderFactory.getOrderController();\n // create a 2 seater table // default is vacant\n tableFactory.getTableController().addTable(2);\n // add a menu item to the menu\n menuFactory.getMenu().addMenuItem(MENU_NAME, MENU_PRICE, MENU_TYPE, MENU_DESCRIPTION);\n\n // order 3 of the menu item\n HashMap<MenuItem, Integer> orderItems = new HashMap<>();\n HashMap<SetItem, Integer> setOrderItems = new HashMap<>();\n orderItems.put(menuFactory.getMenu().getMenuItem(1), 3);\n\n // create 2 of this order\n orderController.addOrder(STAFF_NAME, 1, false, orderItems, setOrderItems);\n orderController.addOrder(STAFF_NAME, 2, false, orderItems, setOrderItems);\n\n // create order invoices\n orderController.addOrderInvoice(orderController.getOrder(1));\n orderController.addOrderInvoice(orderController.getOrder(2));\n\n Calendar date = orderController.getOrderInvoice(1).getDate(); // lazy manually type\n int day = date.get(Calendar.DAY_OF_MONTH);\n int month = date.get(Calendar.MONTH);\n int year = date.get(Calendar.YEAR);\n\n // run the day sales report\n // total revenue should be 3 * MENU_PRICE * 2, and the service charge should be 0.1 * 3 * MENU_PRICE * 2\n assertEquals((double)(3 * MENU_PRICE * 2 + 3 * 2 * MENU_PRICE * 0.1), orderController.viewDaySalesReport(day, month, year));\n }",
"CurrencyDateCalculator<E> getDefaultCurrencyDateCalculator(String ccy1, String ccy2, SpotLag spotLag);",
"public interface RentalFactory {\n\n Rental createRental(String pickUpdate, String returnDate, List<PaymentMethod> paymentMethod);\n\n}",
"public Holidays (){\n name= \"Exotic Beach Holiday of a Lifetime\";\n cost = 5000;\n location = \"Fesdu Island, Maldives\";\n type = \"beach\";\n }",
"DataFactory getDataFactory();",
"CalculatorController(){\n\t\tintegrationStrategy.put(IntegrationType.RECTANGLES, new CalculatorByRectangles());\n\t\tintegrationStrategy.put(IntegrationType.TRAPEZES, new CalculatorByTrapezes());\n\t\tintegrationStrategy.put(IntegrationType.INTEGRAL, new CalculatorByIntegration());\n\t}",
"IMMDateCalculator<E> getIMMDateCalculator();",
"@Test\n public void shouldDisplayDaysExcludingWeekEndsSaturday() {\n LocalDate date = LocalDate.of(2018,11,17);\n LocalDate newDate = LocalDate.of(2018,11,26);\n int offset = 5;\n int direction = 1;\n System.out.println(calcDate(date,offset,direction));\n\n assertEquals(newDate,calcDate(date,offset,direction),\"Should be equal\");\n\n }",
"@Test\n public void computeFactor_SummerTimeWeek() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-13 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-25 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-03-01 00:00:00\", \"2012-04-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.WEEK,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(2, factor, 0);\n }",
"Demo1Factory getDemo1Factory();",
"@Test\n public void computeFactor_SummerTimeDay() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-22 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-03-31 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-03-01 00:00:00\", \"2012-04-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.DAY,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(10, factor, 0);\n }",
"protected abstract void calcNextDate();",
"public static SchedulerFactory schedulerFactory() {\r\n if (schedulerFactory == null) {\r\n \r\n Properties props = new Properties();\r\n for (String key : GrouperClientConfig.retrieveConfig().propertyNames()) {\r\n if (key.startsWith(\"org.quartz.\")) {\r\n String value = GrouperClientConfig.retrieveConfig().propertyValueString(key);\r\n if (value == null) {\r\n value = \"\";\r\n }\r\n props.put(key, value);\r\n }\r\n }\r\n \r\n try {\r\n schedulerFactory = new StdSchedulerFactory(props);\r\n } catch (SchedulerException se) {\r\n throw new RuntimeException(se);\r\n }\r\n }\r\n return schedulerFactory;\r\n }",
"public void initAlgorithm() {\n executor.scheduleAtFixedRate(scheduledThoughtsProducer::periodicalThoughtsCheck, 1, 5,TimeUnit.MINUTES);\n// executor.scheduleAtFixedRate(scheduledThoughtsProducer::periodicalThoughtsCheck, 2, 10,TimeUnit.SECONDS);\n\n // every day perform random thought dice roll\n // also roll for random time: 10am - 9pm\n Cron4j.scheduler.schedule(Cron4j.EVERY_DAY_AT_10_AM, () -> {\n int produceThoughtDice = (int) (Math.random() * 3); // 66% yes, 33% no\n if (produceThoughtDice < 2) {\n int timeShift = (int) (Math.random() * 12); // 0-11\n executor.schedule(scheduledThoughtsProducer::periodicalThoughtProduceSuitable, timeShift, TimeUnit.HOURS);\n } else {\n System.out.println(\"Thought not produced today because of the dice: \" + produceThoughtDice);\n }\n });\n// Cron4j.scheduler.schedule(Cron4j.EVERY_MINUTE, () -> {\n// executor.schedule(scheduledThoughtsProducer::periodicalThoughtProduceSuitable, 0, TimeUnit.SECONDS);\n// });\n\n // every week perform a statistical overview\n // should be not very long and with a lot of variations\n Cron4j.scheduler.schedule(Cron4j.EVERY_WEEK_SUNDAY_18_PM, () -> {\n// Cron4j.scheduler.schedule(Cron4j.EVERY_MINUTE, () -> {\n executor.schedule(scheduledThoughtsProducer::periodicalWeeklyThoughts, 0, TimeUnit.SECONDS);\n });\n\n // start the scheduler\n Cron4j.scheduler.start();\n }",
"public static void main( String[] args )\n {\n Calculator calculator = new Calculator(2.2f);\n// Calculator calculator2 = new Calculator(3f);\n// calculator.name = \"calc\";\n// //System.out.println(Calculator.name);\n// calculator.add(5f);\n// System.out.println(calculator2.name);\n// System.out.println(calculator.getTotal());\n// calculator2.subtract(2f);\n// System.out.println(calculator2.getTotal());\n//\n// calculator.add(5f).subtract(1f).add(2.5f);\n// System.out.println(calculator.getTotal());\n\n for (int i = 0; i < 10; i++) {\n calculator.add(i);\n System.out.println(calculator.getTotal());\n }\n }",
"public interface ICalculator {\n\n /**\n * Calculator type\n * \n * @author alex\n *\n */\n public enum CalculatorType {\n\tIterative(\"Iterative calculator\"), Eratosthenes(\"Eratosthenes calculator\");\n\n\tprivate String description;\n\n\tprivate CalculatorType(String desc) {\n\t description = desc;\n\t}\n\n\tpublic String getDescription() {\n\t return description;\n\t}\n }\n\n default void validateInput(int start, int end) throws IllegalArgumentException {\n\tif (end <= start) {\n\t throw new IllegalArgumentException(\"Invalid input parameters: \" + start + \" :: \" + end);\n\t}\n }\n\n static boolean isPrime(int number) {\n\tif (number == 1 || number == 2 || number == 3) {\n\t return true;\n\t}\n\tif (number < 10) {\n\t for (int i = 2; i < number; i++) {\n\t\tif (number % i == 0) {\n\t\t return false;\n\t\t}\n\t }\n\t} else {\n\t for (int i = 2; i <= Math.sqrt(number); i++) {\n\t\tif (number % i == 0) {\n\t\t return false;\n\t\t}\n\t }\n\t}\n\treturn true;\n }\n\n CalculatorType getCalculatorType();\n\n /**\n * Initialises the algorithm\n * \n * @param concurrency\n * @param start\n * @param end\n * @param service\n */\n ICalculator init(int concurrency, int start, int end, ExecutorCompletionService<Collection<Integer>> service);\n\n /**\n * Executes the algorithm\n * \n * @param segmentStart\n * @param segmentEnd\n * @return\n * @throws IllegalArgumentException\n */\n Collection<Integer> findPrimeNumbers(int segmentStart, int segmentEnd) throws IllegalArgumentException;\n\n /**\n * Returns start of the search\n * \n * @return\n */\n int getStartSearch();\n\n /**\n * Sets start of search\n * \n * @param startSearch\n */\n void setStartSearch(int startSearch);\n\n /**\n * Returns end of the search\n * \n * @return\n */\n int getEndSearch();\n\n /**\n * Sets end of search\n * \n * @param endSearch\n */\n void setEndSearch(int endSearch);\n\n /**\n * Returns start of the interval\n * \n * @return\n */\n int getStartSegment();\n\n /**\n * Sets start of segment\n * \n * @param startSegment\n */\n void setStartSegment(int startSegment);\n\n /**\n * Returns end of the interval\n * \n * @return\n */\n int getEndSegment();\n\n /**\n * Sets end of segment\n * \n * @param endSegment\n */\n void setEndSegment(int endSegment);\n\n /**\n * Returns step\n * \n * @return\n */\n int getStep();\n\n /**\n * Sets the step\n * \n * @param step\n */\n void setStep(int step);\n\n}",
"public void createCalender(LocalDate localDate) {\n this.datePicker = new DatePicker(localDate);\n datePicker.setShowWeekNumbers(false);\n datePicker.setDayCellFactory(new Callback<>() {\n @Override\n public DateCell call(DatePicker param) {\n return new DateCell() {\n @Override\n public void updateItem(LocalDate item, boolean empty) {\n super.updateItem(item, empty);\n if (empty || item == null) {\n setText(null);\n setGraphic(null);\n\n } else {\n\n StackPane dayCellPane = new StackPane();\n Circle circle = new Circle(15);\n\n Label label = new Label();\n label.setText(getText());\n label.setTextFill(Color.WHITE);\n label.setLabelFor(circle);\n label.setStyle(\"-fx-font-weight: bold; -fx-border-color: transparent\");\n label.setFont(Font.font(\"Helvetica\", 15));\n\n if (markedDates.containsKey(item)) {\n switch (markedDates.get(item)) {\n case 3:\n label.setStyle(\"-fx-font-weight: bold; -fx-text-fill: black\");\n circle.setFill(Color.web(\"#FF0000\"));\n break;\n\n case 2:\n label.setStyle(\"-fx-font-weight: bold; -fx-text-fill: black\");\n circle.setFill(Color.web(\"#FF9A00\"));\n break;\n\n case 1:\n label.setStyle(\"-fx-font-weight: bold; -fx-text-fill: black\");\n circle.setFill(Color.web(\"#FFE600\"));\n break;\n\n default:\n circle.setFill(Color.GREEN);\n }\n } else {\n circle.setFill(Color.TRANSPARENT);\n }\n if (item.getDayOfWeek().getValue() == 7 || item.getDayOfWeek().getValue() == 6) {\n label.setTextFill(Color.web(\"#29F6E8\"));\n }\n dayCellPane.getChildren().addAll(circle, label);\n dayCellPane.setPrefSize(50, 50);\n setGraphic(dayCellPane);\n setText(\"\");\n }\n }\n };\n }\n });\n DatePickerSkin datepopup = new DatePickerSkin(datePicker);\n Node out = datepopup.getPopupContent();\n for (Node node : out.lookupAll(\".day-name-cell\")) {\n if (node.toString().contains(\"Sun\") || node.toString().contains(\"Sat\")) {\n node.setStyle(\"-fx-text-fill: #29F6E8\");\n }\n }\n for (Node node : out.lookupAll(\".button\")) {\n node.setFocusTraversable(false);\n }\n for (Node node : out.lookupAll(\".day-cell\")) {\n node.setOnMouseClicked(event -> {\n try {\n DateCell dateCell = (DateCell) node;\n dateClicked = true;\n executeCommand(\"taskcal \" + dateCell.getItem().format(format));\n dateClicked = false;\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid date\");\n }\n });\n }\n this.calendarPanel.getChildren().addAll(out);\n }",
"public static HolidaysCalendar getHolidaysCalendar(String country) {\r\n HolidaysCalendar holidaysCalendar;\r\n if (country != null) {\r\n holidaysCalendar = (HolidaysCalendar) calendarCache.get(country);\r\n if (holidaysCalendar == null) {\r\n holidaysCalendar = initHolidaysCalendar(country);\r\n calendarCache.put(country, holidaysCalendar);\r\n }\r\n } else {\r\n holidaysCalendar = DEFAULT_HOLLYDAY_CALENDAR;\r\n }\r\n return holidaysCalendar;\r\n }",
"@Test\n public void computeFactor_WinterTimeWeek() {\n long startTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-17 00:00:00\");\n long endTimeUsage = DateTimeHandling\n .calculateMillis(\"2012-10-27 23:59:59\");\n BillingInput billingInput = BillingInputFactory.newBillingInput(\n \"2012-10-01 00:00:00\", \"2012-11-01 00:00:00\");\n\n // when\n double factor = calculator.computeFactor(PricingPeriod.WEEK,\n billingInput, startTimeUsage, endTimeUsage, true, true);\n\n // then\n assertEquals(2, factor, 0);\n }",
"public interface SchedulerProvider {\n\n Scheduler ui();\n\n Scheduler computation();\n\n Scheduler io();\n\n}",
"public interface SchedulerProvider {\r\n\r\n Scheduler computation();\r\n\r\n Scheduler io();\r\n\r\n Scheduler ui();\r\n}",
"private List<Demand> createDemand(RequestInfo requestInfo, List<Calculation> calculations,\n\t\t\tMap<String, Object> masterMap,boolean isForConnectionNO) {\n\t\tList<Demand> demands = new LinkedList<>();\n\t\tSet<String> sewerageConnectionIds = new HashSet<>();\n\t\tfor (Calculation calculation : calculations) {\n\n\t\t\tSewerageConnection connection = calculation.getSewerageConnection();\n\n\t\t\tif (connection == null)\n\t\t\t\tthrow new CustomException(\"EG_SW_INVALID_SEWERAGE_CONNECTION\",\n\t\t\t\t\t\t\"Demand cannot be generated for \"\n\t\t\t\t\t\t\t\t+ (isForConnectionNO ? calculation.getConnectionNo() : calculation.getApplicationNO())\n\t\t\t\t\t\t\t\t+ \" Sewerage Connection with this number does not exist \");\n\t\t\t\n\t\t\tSewerageConnectionRequest sewerageConnectionRequest = SewerageConnectionRequest.builder()\n\t\t\t\t\t.sewerageConnection(connection).requestInfo(requestInfo).build();\n\t\t\t\n\t\t\tProperty property = sWCalculationUtil.getProperty(sewerageConnectionRequest);\n\t\t\tString tenantId = calculation.getTenantId();\n\t\t\tString consumerCode = isForConnectionNO ? calculation.getConnectionNo() : calculation.getApplicationNO();\n\t\t\tsewerageConnectionIds.add(consumerCode);\n\t\t\tUser owner = property.getOwners().get(0).toCommonUser();\n\t\t\tif (!CollectionUtils.isEmpty(sewerageConnectionRequest.getSewerageConnection().getConnectionHolders())) {\n\t\t\t\towner = sewerageConnectionRequest.getSewerageConnection().getConnectionHolders().get(0).toCommonUser();\n\t\t\t}\n\t\t\towner = getPlainOwnerDetails(requestInfo,owner.getUuid(), tenantId);\n\t\t\tList<DemandDetail> demandDetails = new LinkedList<>();\n\t\t\t\n\t\t\tcalculation.getTaxHeadEstimates().forEach(taxHeadEstimate -> {\n\t\t\t\tdemandDetails.add(DemandDetail.builder().taxAmount(taxHeadEstimate.getEstimateAmount())\n\t\t\t\t\t\t.taxHeadMasterCode(taxHeadEstimate.getTaxHeadCode()).collectionAmount(BigDecimal.ZERO)\n\t\t\t\t\t\t.tenantId(calculation.getTenantId()).build());\n\t\t\t});\n\t\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tMap<String, Object> financialYearMaster = (Map<String, Object>) masterMap\n\t\t\t\t\t.get(SWCalculationConstant.BILLING_PERIOD);\n\n\t\t\tLong fromDate = (Long) financialYearMaster.get(SWCalculationConstant.STARTING_DATE_APPLICABLES);\n\t\t\tLong toDate = (Long) financialYearMaster.get(SWCalculationConstant.ENDING_DATE_APPLICABLES);\n\t\t\tLong expiryDate = (Long) financialYearMaster.get(SWCalculationConstant.Demand_Expiry_Date_String);\n\t\t\tBigDecimal minimumPayableAmount = isForConnectionNO ? configs.getMinimumPayableAmount() : calculation.getTotalAmount();\n\t\t\tString businessService = isForConnectionNO ? configs.getBusinessService() : ONE_TIME_FEE_SERVICE_FIELD;\n\t\t\n\t\t\taddRoundOffTaxHead(calculation.getTenantId(), demandDetails);\n\t\t\tMap<String, String> additionalDetailsMap = new HashMap<>();\n\t\t\tadditionalDetailsMap.put(\"propertyId\", property.getPropertyId());\n\t\t\tdemands.add(Demand.builder().consumerCode(consumerCode).demandDetails(demandDetails).payer(owner)\n\t\t\t\t\t.minimumAmountPayable(minimumPayableAmount).tenantId(calculation.getTenantId()).taxPeriodFrom(fromDate)\n\t\t\t\t\t.taxPeriodTo(toDate).consumerType(\"sewerageConnection\").businessService(businessService)\n\t\t\t\t\t.status(StatusEnum.valueOf(\"ACTIVE\")).billExpiryTime(expiryDate).additionalDetails(additionalDetailsMap).build());\n\t\t}\n\n\t\tString billingcycle = calculatorUtils.getBillingCycle(masterMap);\n\t\tDemandNotificationObj notificationObj = DemandNotificationObj.builder()\n\t\t\t\t.requestInfo(requestInfo)\n\t\t\t\t.tenantId(calculations.get(0).getTenantId())\n\t\t\t\t.sewerageConnetionIds(sewerageConnectionIds)\n\t\t\t\t.billingCycle(billingcycle)\n\t\t\t\t.build();\n\t\tList<Demand> demandRes = demandRepository.saveDemand(requestInfo, demands,notificationObj);\n\t\tif(isForConnectionNO)\n\t\t\tfetchBill(demandRes, requestInfo,masterMap);\n\t\treturn demandRes;\n\t}",
"ConferenceScheduleBuilderService createEventsFromStartToLunch();",
"@Test\n void scCreation() {\n StandardCalc sc = new StandardCalc();\n }",
"public Factory() {\n\t\tnb_rounds = 0; \n\t\tnb_to_train = 0; \n\t\ttraining_queue = new LinkedList<Pair<Soldier, Integer>>(); \n\t\tcurrent = null;\n\t}",
"PeriodCountCalculator<E> getPeriodCountCalculator();",
"public EnergySchedulingFactoryImpl() {\n\t\tsuper();\n\t}",
"public static CLONDATAFactory init() {\n\t\ttry {\n\t\t\tCLONDATAFactory theCLONDATAFactory = (CLONDATAFactory) EPackage.Registry.INSTANCE.getEFactory(\n\t\t\t\tCLONDATAPackage.eNS_URI);\n\t\t\tif (theCLONDATAFactory != null) {\n\t\t\t\treturn theCLONDATAFactory;\n\t\t\t}\n\t\t} catch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new CLONDATAFactoryImpl();\n\t}",
"public static void main(String[] args) throws SolverException, CloneNotSupportedException {\n\t\tLocalDate referenceDate = LocalDate.of(2018,9,24);\n\n\t\t/*\n\t\t * Define the calibration spec generators for our calibration products\n\t\t */\n\t\tFunction<String,String> frequencyForTenor = (tenor) -> {\n\t\t\tswitch(tenor) {\n\t\t\tcase \"3M\":\n\t\t\t\treturn \"quarterly\";\n\t\t\tcase \"6M\":\n\t\t\t\treturn \"semiannual\";\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(\"Unkown tenor \" + tenor);\n\t\t};\n\n\t\tBiFunction<String, Double, CalibrationSpec> deposit = (maturity, rate) -> {\n\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"tenor\", \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\tScheduleInterface scheduleInterfacePay = null;\n\t\t\tdouble calibrationTime = scheduleInterfaceRec.getPayment(scheduleInterfaceRec.getNumberOfPeriods()-1);\n\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-OIS-\" + maturity, \"Deposit\", scheduleInterfaceRec, \"\", rate, \"discount-EUR-OIS\", scheduleInterfacePay, null, 0.0, null, \"discount-EUR-OIS\", calibrationTime);\n\t\t\treturn calibrationSpec;\n\t\t};\n\n\t\tBiFunction<String, Double, CalibrationSpec> swapSingleCurve = (maturity, rate) -> {\n\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 1);\n\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 1);\n\t\t\tdouble calibrationTime = scheduleInterfaceRec.getPayment(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-OIS-\" + maturity, \"Swap\", scheduleInterfaceRec, \"forward-EUR-OIS\", 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, \"\", rate, \"discount-EUR-OIS\", \"discount-EUR-OIS\", calibrationTime);\n\t\t\treturn calibrationSpec;\n\t\t};\n\n\t\tFunction<String,BiFunction<String, Double, CalibrationSpec>> fra = (tenor) -> {\n\t\t\treturn (fixing, rate) -> {\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, fixing, tenor, \"tenor\", \"act/360\", \"first\", \"modified_following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\t\tString curveName = \"forward-EUR-\" + tenor;\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenor + \"-\" + fixing, \"FRA\", scheduleInterfaceRec, curveName, rate, \"discount-EUR-OIS\", null, null, 0.0, null, curveName, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\tFunction<String,BiFunction<String, Double, CalibrationSpec>> swap = (tenor) -> {\n\t\t\treturn (maturity, rate) -> {\n\t\t\t\tString frequencyRec = frequencyForTenor.apply(tenor);\n\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyRec, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, \"annual\", \"E30/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\t\t\t\tString curveName = \"forward-EUR-\" + tenor;\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenor + maturity, \"Swap\", scheduleInterfaceRec, curveName, 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, \"\", rate, \"discount-EUR-OIS\", curveName, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\tBiFunction<String,String,BiFunction<String, Double, CalibrationSpec>> swapBasis = (tenorRec,tenorPay) -> {\n\t\t\treturn (maturity, rate) -> {\n\t\t\t\tString curveNameRec = \"forward-EUR-\" + tenorRec;\n\t\t\t\tString curveNamePay = \"forward-EUR-\" + tenorPay;\n\n\t\t\t\tString frequencyRec = frequencyForTenor.apply(tenorRec);\n\t\t\t\tString frequencyPay = frequencyForTenor.apply(tenorPay);\n\n\t\t\t\tScheduleInterface scheduleInterfaceRec = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyRec, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tScheduleInterface scheduleInterfacePay = ScheduleGenerator.createScheduleFromConventions(referenceDate, 2, \"0D\", maturity, frequencyPay, \"act/360\", \"first\", \"following\", new BusinessdayCalendarExcludingTARGETHolidays(), 0, 0);\n\t\t\t\tdouble calibrationTime = scheduleInterfaceRec.getFixing(scheduleInterfaceRec.getNumberOfPeriods() - 1);\n\n\t\t\t\tCalibrationSpec calibrationSpec = new CalibratedCurves.CalibrationSpec(\"EUR-\" + tenorRec + \"-\" + tenorPay + maturity, \"Swap\", scheduleInterfaceRec, curveNameRec, 0.0, \"discount-EUR-OIS\", scheduleInterfacePay, curveNamePay, rate, \"discount-EUR-OIS\", curveNameRec, calibrationTime);\n\t\t\t\treturn calibrationSpec;\n\t\t\t};\n\t\t};\n\n\t\t/*\n\t\t * Generate empty curve template (for cloning during calibration)\n\t\t */\n\t\tdouble[] times = { 0.0 };\n\t\tdouble[] discountFactors = { 1.0 };\n\t\tboolean[] isParameter = { false };\n\n\t\tDiscountCurve discountCurveOIS = DiscountCurve.createDiscountCurveFromDiscountFactors(\"discount-EUR-OIS\", referenceDate, times, discountFactors, isParameter, InterpolationMethod.LINEAR, ExtrapolationMethod.CONSTANT, InterpolationEntity.LOG_OF_VALUE);\n\t\tForwardCurveInterface forwardCurveOIS = new ForwardCurveFromDiscountCurve(\"forward-EUR-OIS\", \"discount-EUR-OIS\", referenceDate, \"3M\");\n\t\tForwardCurveInterface forwardCurve3M = new ForwardCurve(\"forward-EUR-3M\", referenceDate, \"3M\", new BusinessdayCalendarExcludingTARGETHolidays(), BusinessdayCalendarInterface.DateRollConvention.FOLLOWING, Curve.InterpolationMethod.LINEAR, Curve.ExtrapolationMethod.CONSTANT, Curve.InterpolationEntity.VALUE,ForwardCurve.InterpolationEntityForward.FORWARD, \"discount-EUR-OIS\");\n\t\tForwardCurveInterface forwardCurve6M = new ForwardCurve(\"forward-EUR-6M\", referenceDate, \"6M\", new BusinessdayCalendarExcludingTARGETHolidays(), BusinessdayCalendarInterface.DateRollConvention.FOLLOWING, Curve.InterpolationMethod.LINEAR, Curve.ExtrapolationMethod.CONSTANT, Curve.InterpolationEntity.VALUE,ForwardCurve.InterpolationEntityForward.FORWARD, \"discount-EUR-OIS\");\n\n\t\tAnalyticModel forwardCurveModel = new AnalyticModel(new CurveInterface[] { discountCurveOIS, forwardCurveOIS, forwardCurve3M, forwardCurve6M });\n\n\t\tList<CalibrationSpec> calibrationSpecs = new LinkedList<>();\n\n\t\t/*\n\t\t * Calibration products for OIS curve: Deposits\n\t\t */\n\t\tcalibrationSpecs.add(deposit.apply(\"1D\", 0.202 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"1W\", 0.195 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"2W\", 0.193 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"3W\", 0.193 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"1M\", 0.191 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"2M\", 0.185 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"3M\", 0.180 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"4M\", 0.170 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"5M\", 0.162 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"6M\", 0.156 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"7M\", 0.150 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"8M\", 0.145 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"9M\", 0.141 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"10M\", 0.136 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"11M\", 0.133 / 100.0));\n\t\tcalibrationSpecs.add(deposit.apply(\"12M\", 0.129 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for OIS curve: Swaps\n\t\t */\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"15M\", 0.118 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"18M\", 0.108 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"21M\", 0.101 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"2Y\", 0.101 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"3Y\", 0.194 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"4Y\", 0.346 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"5Y\", 0.534 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"6Y\", 0.723 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"7Y\", 0.895 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"8Y\", 1.054 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"9Y\", 1.189 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"10Y\", 1.310 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"11Y\", 1.423 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"12Y\", 1.520 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"15Y\", 1.723 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"20Y\", 1.826 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"25Y\", 1.877 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"30Y\", 1.910 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"40Y\", 2.025 / 100.0));\n\t\tcalibrationSpecs.add(swapSingleCurve.apply(\"50Y\", 2.101 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 3M curve: FRAs\n\t\t */\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"0D\", 0.322 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"1M\", 0.329 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"2M\", 0.328 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"3M\", 0.326 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"6M\", 0.323 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"9M\", 0.316 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"12M\", 0.360 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"3M\").apply(\"15M\", 0.390 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 3M curve: swaps\n\t\t */\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"2Y\", 0.380 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"3Y\", 0.485 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"4Y\", 0.628 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"5Y\", 0.812 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"6Y\", 0.998 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"7Y\", 1.168 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"8Y\", 1.316 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"9Y\", 1.442 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"10Y\", 1.557 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"12Y\", 1.752 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"15Y\", 1.942 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"20Y\", 2.029 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"25Y\", 2.045 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"30Y\", 2.097 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"40Y\", 2.208 / 100.0));\n\t\tcalibrationSpecs.add(swap.apply(\"3M\").apply(\"50Y\", 2.286 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 6M curve: FRAs\n\t\t */\n\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"0D\", 0.590 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"1M\", 0.597 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"2M\", 0.596 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"3M\", 0.594 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"6M\", 0.591 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"9M\", 0.584 / 100.0));\n\t\tcalibrationSpecs.add(fra.apply(\"6M\").apply(\"12M\", 0.584 / 100.0));\n\n\t\t/*\n\t\t * Calibration products for 6M curve: tenor basis swaps\n\t\t * Note: the fixed bases is added to the second argument tenor (here 3M).\n\t\t */\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"2Y\", 0.255 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"3Y\", 0.245 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"4Y\", 0.227 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"5Y\", 0.210 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"6Y\", 0.199 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"7Y\", 0.189 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"8Y\", 0.177 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"9Y\", 0.170 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"10Y\", 0.164 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"12Y\", 0.156 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"15Y\", 0.135 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"20Y\", 0.125 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"25Y\", 0.117 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"30Y\", 0.107 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"40Y\", 0.095 / 100.0));\n\t\tcalibrationSpecs.add(swapBasis.apply(\"6M\",\"3M\").apply(\"50Y\", 0.088 / 100.0));\n\n\t\t/*\n\t\t * Calibrate\n\t\t */\n\t\tCalibratedCurves calibratedCurves = new CalibratedCurves(calibrationSpecs.toArray(new CalibrationSpec[calibrationSpecs.size()]), forwardCurveModel, 1E-15);\n\n\t\t/*\n\t\t * Get the calibrated model\n\t\t */\n\t\tAnalyticModelInterface calibratedModel = calibratedCurves.getModel();\n\t\t\n\t\tdouble[] strikes = {-0.005,\n\t\t\t\t-0.0025,\n\t\t\t\t-0.0013,\n\t\t\t\t0.0,\n\t\t\t\t0.0025,\n\t\t\t\t0.005,\n\t\t\t\t0.01,\n\t\t\t\t0.015,\n\t\t\t\t0.02,\n\t\t\t\t0.03,\n\t\t\t\t0.05};\n\t\t\n\t\n\t\tdouble[][] volatilities = \n\t\t\t{{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0028,0.0031,0.0038,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0037,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0025,0.0024,0.0027,0.0031,0.0038,0.0043,0.0052,0.0061,0.0069,0.0085,0.0114},\n\t\t\t\t\t{0.0040,0.0043,0.0045,0.0047,0.0049,0.0052,0.0058,0.0065,0.0072,0.0087,0.0114},\n\t\t\t\t\t{0.0047,0.0049,0.0051,0.0053,0.0055,0.0057,0.0062,0.0068,0.0075,0.0089,0.0115},\n\t\t\t\t\t{0.0050,0.0052,0.0053,0.0054,0.0056,0.0058,0.0063,0.0069,0.0075,0.0088,0.0113},\n\t\t\t\t\t{0.0055,0.0056,0.0057,0.0058,0.0060,0.0061,0.0065,0.0070,0.0076,0.0088,0.0113},\n\t\t\t\t\t{0.0055,0.0056,0.0057,0.0058,0.0060,0.0061,0.0064,0.0069,0.0074,0.0084,0.0107},\n\t\t\t\t\t{0.0058,0.0059,0.0061,0.0061,0.0062,0.0064,0.0066,0.0070,0.0074,0.0083,0.0103},\n\t\t\t\t\t{0.0058,0.0059,0.0059,0.0060,0.0062,0.0063,0.0066,0.0069,0.0073,0.0081,0.0099},\n\t\t\t\t\t{0.0060,0.0061,0.0062,0.0063,0.0064,0.0065,0.0067,0.0069,0.0072,0.0079,0.0095},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0063,0.0063,0.0066,0.0068,0.0071,0.0079,0.0095},\n\t\t\t\t\t{0.0061,0.0062,0.0062,0.0062,0.0064,0.0065,0.0066,0.0068,0.0071,0.0077,0.0092},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0062,0.0063,0.0065,0.0067,0.0070,0.0077,0.0091},\n\t\t\t\t\t{0.0060,0.0061,0.0062,0.0062,0.0063,0.0063,0.0066,0.0067,0.0070,0.0075,0.0089},\n\t\t\t\t\t{0.0060,0.0060,0.0060,0.0061,0.0062,0.0063,0.0064,0.0067,0.0069,0.0075,0.0088},\n\t\t\t\t\t{0.0060,0.0061,0.0061,0.0062,0.0062,0.0063,0.0064,0.0067,0.0068,0.0073,0.0086},\n\t\t\t\t\t{0.0058,0.0058,0.0059,0.0059,0.0060,0.0061,0.0063,0.0065,0.0067,0.0073,0.0085},\n\t\t\t\t\t{0.0058,0.0059,0.0060,0.0060,0.0060,0.0061,0.0063,0.0065,0.0067,0.0071,0.0083},\n\t\t\t\t\t{0.0059,0.0059,0.0060,0.0060,0.0061,0.0061,0.0063,0.0064,0.0066,0.0070,0.0081},\n\t\t\t\t\t{0.0059,0.0060,0.0061,0.0061,0.0061,0.0062,0.0063,0.0064,0.0065,0.0069,0.0079},\n\t\t\t\t\t{0.0056,0.0057,0.0057,0.0057,0.0058,0.0059,0.0060,0.0062,0.0065,0.0069,0.0081},\n\t\t\t\t\t{0.0056,0.0057,0.0057,0.0057,0.0058,0.0059,0.0060,0.0062,0.0064,0.0068,0.0079},\n\t\t\t\t\t{0.0057,0.0057,0.0057,0.0058,0.0058,0.0059,0.0060,0.0061,0.0063,0.0067,0.0077},\n\t\t\t\t\t{0.0057,0.0057,0.0057,0.0058,0.0058,0.0059,0.0060,0.0061,0.0063,0.0066,0.0076},\n\t\t\t\t\t{0.0057,0.0057,0.0058,0.0058,0.0058,0.0059,0.0059,0.0060,0.0062,0.0065,0.0074},\n\t\t\t\t\t{0.0057,0.0058,0.0058,0.0058,0.0059,0.0059,0.0059,0.0060,0.0061,0.0064,0.0073},\n\t\t\t\t\t{0.0054,0.0054,0.0054,0.0055,0.0055,0.0056,0.0058,0.0059,0.0061,0.0065,0.0076},\n\t\t\t\t\t{0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0059,0.0060,0.0065,0.0075},\n\t\t\t\t\t{0.0054,0.0053,0.0054,0.0054,0.0055,0.0055,0.0057,0.0058,0.0060,0.0064,0.0074},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0055,0.0055,0.0056,0.0058,0.0059,0.0063,0.0073},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0059,0.0062,0.0071},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0058,0.0061,0.0070},\n\t\t\t\t\t{0.0053,0.0053,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0061,0.0069},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0057,0.0060,0.0068},\n\t\t\t\t\t{0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0056,0.0059,0.0067},\n\t\t\t\t\t{0.0053,0.0053,0.0054,0.0054,0.0054,0.0054,0.0054,0.0055,0.0055,0.0058,0.0066},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0053,0.0054,0.0055,0.0057,0.0060,0.0070},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0053,0.0055,0.0056,0.0060,0.0069},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0053,0.0054,0.0056,0.0059,0.0068},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0051,0.0052,0.0052,0.0054,0.0055,0.0058,0.0067},\n\t\t\t\t\t{0.0051,0.0051,0.0051,0.0051,0.0051,0.0051,0.0052,0.0053,0.0055,0.0058,0.0066},\n\t\t\t\t\t{0.0050,0.0051,0.0051,0.0050,0.0051,0.0051,0.0052,0.0053,0.0054,0.0057,0.0066},\n\t\t\t\t\t{0.0050,0.0050,0.0051,0.0050,0.0051,0.0051,0.0051,0.0052,0.0054,0.0056,0.0065},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0051,0.0051,0.0051,0.0052,0.0053,0.0056,0.0064},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0051,0.0053,0.0055,0.0063},\n\t\t\t\t\t{0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0050,0.0051,0.0052,0.0054,0.0063},\n\t\t\t\t\t{0.0050,0.0049,0.0049,0.0050,0.0050,0.0051,0.0051,0.0052,0.0053,0.0057,0.0065},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0050,0.0050,0.0050,0.0051,0.0052,0.0053,0.0057,0.0065},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0053,0.0056,0.0064},\n\t\t\t\t\t{0.0049,0.0049,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0056,0.0064},\n\t\t\t\t\t{0.0049,0.0048,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0052,0.0056,0.0063},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0049,0.0049,0.0049,0.0050,0.0050,0.0051,0.0055,0.0063},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0048,0.0049,0.0049,0.0049,0.0050,0.0051,0.0055,0.0062},\n\t\t\t\t\t{0.0048,0.0048,0.0048,0.0048,0.0048,0.0049,0.0049,0.0050,0.0051,0.0054,0.0062},\n\t\t\t\t\t{0.0048,0.0047,0.0048,0.0048,0.0048,0.0048,0.0048,0.0049,0.0050,0.0054,0.0061},\n\t\t\t\t\t{0.0047,0.0047,0.0047,0.0048,0.0048,0.0048,0.0048,0.0049,0.0050,0.0053,0.0061}};\n\t\t\n\t\tdouble[] maturities = {0.5000,1.0000,1.5000,2.0000,2.5000,3.0000,3.5000,4.0000,4.5000,5.0000,\n\t\t\t\t5.5000,6.0000,6.5000,7.0000,7.5000,8.0000,8.5000,9.0000,9.5000,10.0000,\n\t\t\t\t10.5000,11.0000,11.5000,12.0000,12.5000,13.0000,13.5000,14.0000,14.5000,\n\t\t\t\t15.0000,15.5000,16.0000,16.5000,17.0000,17.5000,18.0000,18.5000,19.0000,\n\t\t\t\t19.5000,20.0000,20.5000,21.0000,21.5000,22.0000,22.5000,23.0000,23.5000,\n\t\t\t\t24.0000,24.5000,25.0000,25.5000,26.0000,26.5000,27.0000,27.5000,28.0000,\n\t\t\t\t28.5000,29.0000,29.5000};\n\t\t\n\t\tint[] indeces = {7,9,10,11,12,13,14,15,16,17,18,19}; //chose the index of the maturities we want to calibrate\n\t\t\n\t\t//Target caplet data\n\t\tQuotingConvention convention = QuotingConvention.VOLATILITYNORMAL;\n\t\t\n\t\tArrayList<CapletSmileData> smiles = new ArrayList<CapletSmileData>();\n\t\t\n\t\tfor(int i = 0; i<indeces.length; i++) {\n\t\t\tint index = indeces[i];\n\t\t\tdouble[] values = volatilities[index];\n\t\t\tdouble time = maturities[index];\n\t\t\tCapletSmileData ithSmile = new CapletSmileData(\"forward-EUR-6M\",\"discount-EUR-OIS\",referenceDate,strikes,time, values, convention);\n\t\t\tsmiles.add(ithSmile);\n\t\t}\n\t\t\n\t\tCapletSmileData[] smileArray = new CapletSmileData[smiles.size()];\n\t\tsmileArray = smiles.toArray(new CapletSmileData[smiles.size()]);\n\t\t\n\t\tCapletSurfaceData surface = new CapletSurfaceData(smileArray, calibratedModel);\n\t\t\n\t\tOptimizerFactoryInterface optimizerFactory = new OptimizerFactoryLevenbergMarquardt(300 /* maxIterations */, 8 /* maxThreads */);\n\n\t\t\n\t\tdouble[] initialParameters = new double[] {0.1, 0.2,0.1, 0.3,0.1,0.7,0.4,0.6,0.1,0.2,0.1} /* initialParameters */;\n\t\tdouble[] parameterStep = new double[] {0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01, 0.01} /* parameterStep */;\n\t\t\n\t\tint numberOfPoints = 4096*16;\n\t\tdouble gridSpacing = 0.005;\n\t\tnet.finmath.interpolation.RationalFunctionInterpolation.InterpolationMethod intMethod = net.finmath.interpolation.RationalFunctionInterpolation.InterpolationMethod.LINEAR;\n\t\tnet.finmath.interpolation.RationalFunctionInterpolation.ExtrapolationMethod extMethod = net.finmath.interpolation.RationalFunctionInterpolation.ExtrapolationMethod.CONSTANT;\n\t\t\n\t\tCapletByCarrMadan pricer = new CapletByCarrMadan(\"forward-EUR-6M\", 5.0,strikes,numberOfPoints,gridSpacing,intMethod,extMethod);\n\t\t\t\n\t\t\n\t\tdouble b = 0.3;\n\t\tdouble sigma = 0.08512087176733757;\n\t\tdouble eta = 0.8006437480710635;\n\t\tdouble zeta = 1.9;\n\t\tdouble alpha = 1.0596981657639444;\n\t\tdouble[] initialValues = {0.01, 0.02};\n\t\tdouble[] immigrationRates = {0.1, 0.3};\n\t\tdouble[] lambda = {1, 1};\n\t\n\t\t\n\t\tMultiCurveTenor threeMonth = new MultiCurveTenor(0.25, \"3M\");\n\t\tMultiCurveTenor sixMonth = new MultiCurveTenor(0.5, \"6M\");\n\t\tMultiCurveTenor[] tenors = {threeMonth,sixMonth};\n\t\t\n\t\tdouble[] tenorLengths = {0.25,0.6};\n\t\tString[] tenorNames = {\"3M\", \"6M\"};\n\t\t\n\t\tdouble timeHorizon = 12.0;\t\t\n\t\tint numberOfTimeSteps = 40;\n\t\t\n\t\tScalarParameterInformationInterface[] lambdaInfo = \n\t\t\t{new ScalarParameterInformation(false, new PositivityConstraint()),\n\t\t\t\t\tnew ScalarParameterInformation(false, new PositivityConstraint())};\n\t\tScalarParameterInformationInterface[] immigrationRatesInfo =\n\t\t\t{new ScalarParameterInformation(true, new BoundConstraint(1E-5,10.0)),\n\t\t\t\t\tnew ScalarParameterInformation(true, new BoundConstraint(1E-5,10.0))};\n\t\t\n\t\tScalarParameterInformationInterface bInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface sigmaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface etaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface zetaInfo = new ScalarParameterInformation(true, new PositivityConstraint());\n\t\tScalarParameterInformationInterface alphaInfo = new ScalarParameterInformation(true, new BoundConstraint(1, 2));\n\t\t\n\t\tScalarParameterInformationInterface[] initialValuesInfo = \n\t\t\t{new ScalarParameterInformation(true, new PositivityConstraint()),\n\t\t\t\t\tnew ScalarParameterInformation(true, new PositivityConstraint())};\n\t\t\n\t\tboolean functionVConstraint = true;\n\t\tboolean expMomentConstraint = true;\n\t\t\n\t\tCBIProcessInterface cbiProcess = new FlowOfTemperedAlphaStableCBIprocess(timeHorizon, numberOfTimeSteps, initialValues, immigrationRates, b, sigma, \n\t\t\t\t eta, zeta, alpha,lambda, \n\t\t\t\tlambdaInfo, immigrationRatesInfo, \n\t\t\t\tbInfo, sigmaInfo, etaInfo, \n\t\t\t\tzetaInfo, alphaInfo, initialValuesInfo,\n\t\t\t\tfunctionVConstraint, expMomentConstraint);\n\t\t\n\t\tCBIDrivenMultiCurveModel model = new CBIDrivenMultiCurveModel(calibratedModel, cbiProcess, tenorLengths, tenorNames);\n\t\t\n\t\t//CBIDrivenMultiCurveModel model = new CBIDrivenMultiCurveModel(timeHorizon, numberOfTimeSteps, calibratedModel, tenors, initialValues, immigrationRates, b, sigma, eta, zeta, alpha, lambda);\n\t\t\n\t\tCapletCalibrationProblem problem = new CapletCalibrationProblem(surface, model, optimizerFactory, pricer,initialParameters,parameterStep);\n\t\t\n\t\tSystem.out.println(\"Calibration started\");\n\t\t\n\t\tlong startMillis\t= System.currentTimeMillis();\n\t\tnet.finmath.fouriermethod.calibration.CapletCalibrationProblem.OptimizationResult result = problem.runCalibration();\n\t\tlong endMillis\t\t= System.currentTimeMillis();\n\t\t\n\t\tdouble calculationTime = ((endMillis-startMillis)/1000.0);\n\t\t\n\t\tSystem.out.println(\"Calibration completed in: \" +calculationTime + \" seconds\");\n\t\t\n\t\tSystem.out.println(\"The solver required \" + result.getIterations() + \" iterations.\");\n\t\tSystem.out.println(\"RMSQE \" +result.getRootMeanSquaredError());\n\t\t\n\t\tdouble[] parameters = result.getModel().getParameters();\n\t\tfor(int i =0; i<parameters.length; i++) {\n\t\t\tSystem.out.println(parameters[i]);\n\t\t}\n\t\t\n\t\tArrayList<String> errorsOverview = result.getCalibrationOutput();\n\t\t\n\t\tfor(String myString : errorsOverview)\n\t\t\tSystem.out.println(myString);\n\t\t\n\t\tSystem.out.println(result.getModel().getClass());\n\t\t\n\t\t\n\t\tSystem.out.println(\"Finished.\");\n\t\n\t\t\n\t}",
"public Calculator() {\r\n\t\tsuper();\r\n\t}",
"private boolean makeCalendarByDays() {\n if (calendar != null) {\n for (Date date:calendar.keySet()) {\n Date startDay;\n if (date.getTime() > date.getTime() - 3600000 * 2 - date.getTime() % 86400000)\n startDay = new Date(date.getTime() + 3600000 * 22 - date.getTime() % 86400000);\n else startDay = new Date(date.getTime() - 3600000 * 2 - date.getTime() % 86400000);\n calendarByDays.put(startDay, calendar.get(date));\n }\n return true;\n }\n return false;\n }",
"private ProxyDate getFactoryProxyDate(Class type) {\n // we don't lock here; ok if two proxies get generated for same type\n ProxyDate proxy = (ProxyDate) _proxies.get(type);\n if (proxy == null) {\n ClassLoader l = GeneratedClasses.getMostDerivedLoader(type,\n ProxyDate.class);\n Class pcls = loadBuildTimeProxy(type, l);\n if (pcls == null)\n pcls = generateAndLoadProxyDate(type, true, l);\n proxy = (ProxyDate) instantiateProxy(pcls, null, null);\n _proxies.put(type, proxy);\n }\n return proxy;\n }",
"public interface Calculator {\n //add method\n double add(double x, double y);\n\n //subtract method\n double subtract(double x, double y);\n\n //mulpiply method\n double multiply(double x, double y);\n\n //Divide method\n double divide(double x, double y) throws IllegalArgumentException;\n}",
"public static ExecutionFactory init() {\n\t\ttry {\n\t\t\tExecutionFactory theExecutionFactory = (ExecutionFactory)EPackage.Registry.INSTANCE.getEFactory(ExecutionPackage.eNS_URI);\n\t\t\tif (theExecutionFactory != null) {\n\t\t\t\treturn theExecutionFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new ExecutionFactoryImpl();\n\t}",
"@Test\n public void testOrderFactoryDaySales2() {\n OrderController orderController = orderFactory.getOrderController();\n // create a 2 seater table // default is vacant\n tableFactory.getTableController().addTable(2);\n // add a menu item to the menu\n menuFactory.getMenu().addMenuItem(MENU_NAME, MENU_PRICE, MENU_TYPE, MENU_DESCRIPTION);\n\n // order 3 of the menu item\n HashMap<MenuItem, Integer> orderItems = new HashMap<>();\n HashMap<SetItem, Integer> setOrderItems = new HashMap<>();\n orderItems.put(menuFactory.getMenu().getMenuItem(1), 3);\n\n // create 2 of this order\n orderController.addOrder(STAFF_NAME, 1, true, orderItems, setOrderItems);\n orderController.addOrder(STAFF_NAME, 2, false, orderItems, setOrderItems);\n\n // create order invoices\n orderController.addOrderInvoice(orderController.getOrder(1));\n orderController.addOrderInvoice(orderController.getOrder(2));\n\n Calendar date = orderController.getOrderInvoice(1).getDate(); // lazy manually type\n int day = date.get(Calendar.DAY_OF_MONTH);\n int month = date.get(Calendar.MONTH);\n int year = date.get(Calendar.YEAR);\n\n // run the day sales report\n // total revenue should be 3 * MENU_PRICE * 1.8, and the service charge should be 0.1 * 3 * MENU_PRICE * 0.8 + 0.1 * 3 * MENU_PRICE\n assertEquals((double)((3 * MENU_PRICE * 1.8) + (3 * MENU_PRICE * 0.1 * 0.8) + (3 * MENU_PRICE * 0.1)), orderController.viewDaySalesReport(day, month, year));\n }",
"private List<Demand> updateDemandForCalculation(RequestInfo requestInfo, List<Calculation> calculations,\n\t\t\tLong fromDate, Long toDate, boolean isForConnectionNo, Boolean isDisconnectionRequest) {\n\n\t\tList<Demand> demands = new LinkedList<>();\n\t\tLong fromDateSearch = isForConnectionNo ? fromDate : null;\n\t\tLong toDateSearch = isForConnectionNo ? toDate : null;\n\n\t\tfor (Calculation calculation : calculations) {\n\t\t\tSet<String> consumerCodes = new HashSet<>();\n\t\t\tconsumerCodes = isForConnectionNo\n\t\t\t\t\t? Collections.singleton(calculation.getSewerageConnection().getConnectionNo())\n\t\t\t\t\t: Collections.singleton(calculation.getSewerageConnection().getApplicationNo());\n\t\t\tList<Demand> searchResult = new ArrayList<>();\n\t\t\tif (isDisconnectionRequest)\n\t\t\t\tsearchResult = searchDemandForDisconnectionRequest(calculation.getTenantId(), consumerCodes, null, toDateSearch,\n\t\t\t\t\t\trequestInfo, null, isDisconnectionRequest);\n\t\t\telse\n\t\t\t\tsearchResult = searchDemand(calculation.getTenantId(), consumerCodes, fromDateSearch, toDateSearch, requestInfo,\n\t\t\t\t\t\tnull, isDisconnectionRequest);\n\n\t\t\tif (CollectionUtils.isEmpty(searchResult))\n\t\t\t\tthrow new CustomException(\"EG_SW_INVALID_DEMAND_UPDATE\", \"No demand exists for Number: \"\n\t\t\t\t\t\t+ consumerCodes.toString());\n\t\t\tDemand demand = searchResult.get(0);\n\t\t\tString tenantId = calculation.getTenantId();\n\t\t\tList<DemandDetail> demandDetails = demand.getDemandDetails();\n\t\t\tList<DemandDetail> updatedDemandDetails = getUpdatedDemandDetails(calculation, demandDetails, isDisconnectionRequest);\n\t\t\tdemand.setDemandDetails(updatedDemandDetails);\n\n\t\t\tif(isForConnectionNo){\n\t\t\t\tSewerageConnection connection = calculation.getSewerageConnection();\n\t\t\t\tif (connection == null) {\n\t\t\t\t\tList<SewerageConnection> sewerageConnectionList = calculatorUtils.getSewerageConnection(requestInfo,\n\t\t\t\t\t\t\tcalculation.getConnectionNo(),calculation.getTenantId());\n\t\t\t\t\tint size = sewerageConnectionList.size();\n\t\t\t\t\tconnection = sewerageConnectionList.get(size-1);\n\n\t\t\t\t}\n\n\t\t\t\tif(connection.getApplicationType().equalsIgnoreCase(\"MODIFY_SEWERAGE_CONNECTION\")){\n\t\t\t\t\tSewerageConnectionRequest sewerageConnectionRequest = SewerageConnectionRequest.builder().sewerageConnection(connection)\n\t\t\t\t\t\t\t.requestInfo(requestInfo).build();\n\t\t\t\t\tProperty property = sWCalculationUtil.getProperty(sewerageConnectionRequest);\n\t\t\t\t\tUser owner = property.getOwners().get(0).toCommonUser();\n\t\t\t\t\tif (!CollectionUtils.isEmpty(sewerageConnectionRequest.getSewerageConnection().getConnectionHolders())) {\n\t\t\t\t\t\towner = sewerageConnectionRequest.getSewerageConnection().getConnectionHolders().get(0).toCommonUser();\n\t\t\t\t\t}\n\t\t\t\t\towner = getPlainOwnerDetails(requestInfo,owner.getUuid(), tenantId);\n\t\t\t\t\tif(!(demand.getPayer().getUuid().equalsIgnoreCase(owner.getUuid())))\n\t\t\t\t\t\tdemand.setPayer(owner);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdemands.add(demand);\n\t\t}\n\n\t\tlog.info(\"Updated Demand Details \" + demands.toString());\n\t\treturn demandRepository.updateDemand(requestInfo, demands);\n\t}",
"SchedulersFactory getSchedulersFactory();",
"public void startDateQuestionSet() {\n this.dateQuestionSet = new HashSet<>();//creates a new dateQuestionSet\n for (Question q : this.getForm().getQuestionList()) {//for every question in the question list of the current form\n if (q.getType().getId() == 4) {//if the question is type Date Question\n Quest newQuest = new Quest();//creates a new Quest\n newQuest.setqQuestion(q);//adds the current question to the new Quest\n this.dateQuestionSet.add(newQuest);//adds the new Quest to the new dateQuestionSet\n }\n }\n }",
"protected abstract Object doCalculations();",
"public StoredDay(LocalDate date) {\n this.date = date;\n this.recipes = new StoredRecipe[0];\n }",
"public interface IFactory {\n\t/**\n\t * créer un service transactionel (un proxy de service) gérant les Users\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract IUserService createUserService(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table utilisateur (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract IUtilisateurDAO createUserDAO(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table cursus (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract ICursusDAO createCursusDAO(ITransactional caller);\n\n\t/**\n\t * créer un dao transactionel dédié à la table competence (un proxy de dao)\n\t * \n\t * @param caller\n\t * objet transactionel appelant ce service. null si début de\n\t * transaction\n\t * @return\n\t */\n\tpublic abstract ICompetenceDAO createCompetenceDAO(ITransactional caller);\n\n\tpublic abstract INiveauxDAO createNiveauDAO(ITransactional caller);\n\n\tpublic abstract IProfilDAO createProfilDAO(ITransactional caller);\n\n\tpublic abstract IGroupeDAO createGroupeDAO(ITransactional caller);\n\n\tpublic abstract IFenetreDAO createFenetreDAO(ITransactional caller);\n\n\tpublic abstract IFonctionDAO createFonctionDAO(ITransactional caller);\n\n\tpublic abstract INatureDAO createNatureDAO(ITransactional caller);\n\n\tpublic abstract IDroitDAO createDroitDAO(ITransactional caller);\n\n\tpublic abstract ISecurityService createSecurityService(ITransactional caller);\n\n\tpublic abstract IProjectService createProjectService(ITransactional caller);\n\n\tpublic abstract IKeywordDAO createKeywordDAO(ITransactional caller);\n\n\tpublic abstract IStatutDAO createStatutDAO(ITransactional caller);\n\n\tpublic abstract IAdresseDAO createAdresseDAO(ITransactional caller);\n\t\n}",
"public static QuizFactory getFactoryInstance(){\n\t\tif (defQuizFactory == null)\n\t\t\tdefQuizFactory = new DefaultQuizFactory();\n\t\t\n\t\treturn defQuizFactory;\n\t}",
"public static CostFactory init() {\n\t\ttry {\n\t\t\tCostFactory theCostFactory = (CostFactory)EPackage.Registry.INSTANCE.getEFactory(CostPackage.eNS_URI);\n\t\t\tif (theCostFactory != null) {\n\t\t\t\treturn theCostFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new CostFactoryImpl();\n\t}",
"public Set<Calendar> getHolidays(String str){\r\n\t\tswitch(str) {\r\n\t\t\tcase \"EUR\": return holidaysEuro;\r\n\t\t\tcase \"USD\": return holidaysUsd;\r\n\t\t\tdefault: return new HashSet<>();\r\n\t\t}\r\n\t}",
"public static final BondStream Create (\n\t\tfinal int iMaturityDate,\n\t\tfinal int iEffectiveDate,\n\t\tfinal int iFinalMaturityDate,\n\t\tfinal int iFirstCouponDate,\n\t\tfinal int iInterestAccrualStartDate,\n\t\tfinal int iFreq,\n\t\tfinal double dblCoupon,\n\t\tfinal java.lang.String strCouponDC,\n\t\tfinal java.lang.String strAccrualDC,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPay,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapReset,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapMaturity,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapEffective,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPeriodEnd,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapAccrualEnd,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapPeriodStart,\n\t\tfinal org.drip.analytics.daycount.DateAdjustParams dapAccrualStart,\n\t\tfinal java.lang.String strMaturityType,\n\t\tfinal boolean bPeriodsFromForward,\n\t\tfinal java.lang.String strCalendar,\n\t\tfinal java.lang.String strCurrency,\n\t\tfinal org.drip.state.identifier.FloaterLabel floaterLabel,\n\t\tfinal org.drip.state.identifier.EntityCDSLabel creditLabel)\n\t{\n\t\tboolean bCouponEOMAdj = null == strCouponDC ? false : strCouponDC.toUpperCase().contains (\"EOM\");\n\n\t\tint iCouponDCIndex = null == strCouponDC ? -1 : strCouponDC.indexOf (\" NON\");\n\n\t\tjava.lang.String strCouponDCAdj = -1 != iCouponDCIndex ? strCouponDC.substring (0, iCouponDCIndex) :\n\t\t\tstrCouponDC;\n\n\t\tboolean bAccrualEOMAdj = null == strAccrualDC ? false : strAccrualDC.toUpperCase().contains (\"EOM\");\n\n\t\tint iAccrualDCIndex = null == strAccrualDC ? -1 : strAccrualDC.indexOf (\" NON\");\n\n\t\tjava.lang.String strAccrualDCAdj = -1 != iAccrualDCIndex ? strAccrualDC.substring (0,\n\t\t\tiAccrualDCIndex) : strAccrualDC;\n\n\t\torg.drip.analytics.date.JulianDate dtEffective = new org.drip.analytics.date.JulianDate\n\t\t\t(iEffectiveDate);\n\n\t\torg.drip.analytics.date.JulianDate dtMaturity = new org.drip.analytics.date.JulianDate\n\t\t\t(iMaturityDate);\n\n\t\tjava.lang.String strTenor = (12 / iFreq) + \"M\";\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = null;\n\n\t\ttry {\n\t\t\torg.drip.param.period.UnitCouponAccrualSetting ucas = new\n\t\t\t\torg.drip.param.period.UnitCouponAccrualSetting (iFreq, strCouponDCAdj, bCouponEOMAdj,\n\t\t\t\t\tstrAccrualDCAdj, bAccrualEOMAdj, strCurrency, false,\n\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.ACCRUAL_COMPOUNDING_RULE_GEOMETRIC);\n\n\t\t\torg.drip.param.period.CompositePeriodSetting cps = new\n\t\t\t\torg.drip.param.period.CompositePeriodSetting (iFreq, strTenor, strCurrency, dapPay, 1., null,\n\t\t\t\t\tnull, null, creditLabel);\n\n\t\t\tjava.util.List<java.lang.Integer> lsStreamEdgeDate = bPeriodsFromForward ?\n\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.ForwardEdgeDates (dtEffective, dtMaturity,\n\t\t\t\t\tstrTenor, dapAccrualEnd, org.drip.analytics.support.CompositePeriodBuilder.LONG_STUB) :\n\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.BackwardEdgeDates (dtEffective,\n\t\t\t\t\t\t\tdtMaturity, strTenor, dapAccrualEnd,\n\t\t\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.LONG_STUB);\n\n\t\t\tif (null == floaterLabel) {\n\t\t\t\torg.drip.param.period.ComposableFixedUnitSetting cfus = new\n\t\t\t\t\torg.drip.param.period.ComposableFixedUnitSetting (strTenor,\n\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.EDGE_DATE_SEQUENCE_SINGLE, null,\n\t\t\t\t\t\t\tdblCoupon, 0., strCurrency);\n\n\t\t\t\tlsCouponPeriod = org.drip.analytics.support.CompositePeriodBuilder.FixedCompositeUnit\n\t\t\t\t\t(lsStreamEdgeDate, cps, ucas, cfus);\n\t\t\t} else {\n\t\t\t\torg.drip.param.period.ComposableFloatingUnitSetting cfus = new\n\t\t\t\t\torg.drip.param.period.ComposableFloatingUnitSetting (strTenor,\n\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.EDGE_DATE_SEQUENCE_SINGLE, null,\n\t\t\t\t\t\t\tfloaterLabel,\n\t\t\t\t\t\t\t\torg.drip.analytics.support.CompositePeriodBuilder.REFERENCE_PERIOD_IN_ADVANCE,\n\t\t\t\t\tdblCoupon);\n\n\t\t\t\tlsCouponPeriod = org.drip.analytics.support.CompositePeriodBuilder.FloatingCompositeUnit\n\t\t\t\t\t(lsStreamEdgeDate, cps, cfus);\n\t\t\t}\n\n\t\t\treturn new BondStream (lsCouponPeriod, iFinalMaturityDate, strMaturityType);\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}",
"@Test\n public void testCreateFactory() {\n setFactory(\"ThaiMoneyFactory\");\n assertEquals(ThaiMoneyFactory.class, moneyFactory.getClass());\n assertNotEquals(MalayMoneyFactory.class, moneyFactory.getClass());\n assertEquals(currency, \"Baht\");\n setFactory(\"MalayMoneyFactory\");\n assertEquals(MalayMoneyFactory.class, moneyFactory.getClass());\n assertNotEquals(ThaiMoneyFactory.class, moneyFactory.getClass());\n assertEquals(currency, \"Ringgit\");\n }",
"Sticker.Factory getStickerFactory();",
"public interface IFactory {\n Operation CreateOperation();\n\n}",
"@Override\n\tpublic Treatment createRadiology( List<Date> dates) {\n\t\tRadiology radiology = new Radiology();\n\t\tradiology.setDates(dates);\n\t\tradiology.setTreatmentType(TreatmentType.RADIOLOGY.getTag());\n\t\treturn radiology;\n\t}",
"@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}",
"public interface TimeService {\n\n Calendar getCalendar();\n\n Calendar createCalendarFromDate(Date date);\n\n long getTimeDifference(Calendar startDate, Calendar endDate);\n\n long getTimeDifferenceInDays(Calendar startDate, Calendar endDate);\n\n long getTimeDifferenceInHours(Calendar startDate, Calendar endDate);\n\n long getTimeDifferenceInMinutes(Calendar startDate, Calendar endDate);\n\n}",
"public static DatePickerUtil getInstance() {\n if (singletonDatePickerInstance == null) {\n // Create new instance\n singletonDatePickerInstance = new DatePickerUtil();\n\n // Set Picker Ranges\n singletonDatePickerInstance.mInitData(30, 24);\n }\n\n return singletonDatePickerInstance;\n }",
"private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }",
"abstract public Date getServiceAppointment();",
"public interface DateInfo {\n\n String getDateFormat();\n\n Calendar getTodayCalendar();\n\n}",
"public interface DataSource {\n\n Report getSalaryReport(String departmentId, LocalDate dateFrom, LocalDate dateTo);\n\n}",
"public HolidayOffer(LocalDate startingLocalDate, Double price, Double deposit, String description, House offeredHouse, LocalDate finishLocalDate) {\n\t\tsuper(startingLocalDate, price, deposit, description, offeredHouse);\n\t\tthis.finishDate = finishLocalDate;\n\t}",
"public static ArrayList<LocalDate> getPhDates() {\r\n \tArrayList<Date> phDates = phRepo.findAllPublicHolidayDates();\r\n \tArrayList<LocalDate> phLocalDates = new ArrayList<LocalDate>();\r\n \t\r\n\t\tfor(Date phDate : phDates) {\r\n\t\t\tphLocalDates.add(phDate.toLocalDate());\r\n\t\t}\r\n\t\t\r\n\t\treturn phLocalDates;\r\n }",
"public ExecutionFactoryImpl() {\n\t\tsuper();\n\t}",
"public PriceFactory getCurrentPriceFactory()\r\n\t{\n\t\treturn OrderManager.getInstance().getPriceFactory();\r\n\t}",
"@Test\n public void testCreateLegalMoney() {\n setFactory(\"ThaiMoneyFactory\");\n double[] thaiValue = {1, 2, 5, 10, 20, 50, 100, 500, 1000};\n for (double val : thaiValue) {\n assertEquals(makeValuable(val), moneyFactory.createMoney(val));\n }\n setFactory(\"MalayMoneyFactory\");\n double[] malayValue = {0.05, 0.10, 0.20, 0.50, 1, 2, 5, 10, 20, 50, 100};\n for (double val : malayValue) {\n assertEquals(makeValuable(val), moneyFactory.createMoney(val));\n }\n }",
"public static CacheManagerExecutorServiceFactory getInstance() {\n return SINGLETON;\n }",
"@Test\n public void shouldDisplayDaysExcludingWeekEndsSaturdayPlus5Days() {\n LocalDate date = LocalDate.of(2018,11,24);\n LocalDate newDate = LocalDate.of(2018,11,16);\n int offset = 5;\n int direction = -1;\n System.out.println(calcDate(date,offset,direction));\n\n assertEquals(newDate,calcDate(date,offset,direction),\"Should be equal\");\n\n }",
"@Test\n void calculateDaysRentedTooLowTest() throws Exception {\n ToolType toolType = ToolType.JACKHAMMER; // weekendFree: true holidayFree: true\n String toolCode = \"JAKR\";\n String brand = \"Werner\";\n int discount = 0;\n int daysRented = 0;\n LocalDate checkoutDate = createDate(\"2015-09-03\");\n\n Tool tool = createTool(toolType, toolCode, brand);\n\n List<Tool> tools = Arrays.asList(tool);\n Order order = new Order(tools, checkoutDate, daysRented);\n\n List<LocalDate> holidays = createHolidays(checkoutDate.getYear());\n RentalAgreement rentAgmt = createRentalAgreement(order, discount, holidays);\n\n Assertions.assertThrows(Exception.class, ()->\n rentAgmt.calculate(), \"Expected calculate() to throw Exception but it didn't\"\n );\n }",
"QuestionnaireFactory getQuestionnaireFactory();"
]
| [
"0.6549371",
"0.6355808",
"0.61550415",
"0.5588537",
"0.5438899",
"0.53470504",
"0.5285051",
"0.51849484",
"0.5174851",
"0.5164485",
"0.5125897",
"0.51244533",
"0.50901824",
"0.5056432",
"0.50406593",
"0.50350565",
"0.5030872",
"0.5011663",
"0.4970549",
"0.49542865",
"0.49487808",
"0.49302897",
"0.49148586",
"0.49016082",
"0.4892628",
"0.48532808",
"0.48403466",
"0.4820754",
"0.4812641",
"0.48116034",
"0.48017937",
"0.4779269",
"0.47746655",
"0.4755903",
"0.4751951",
"0.47494736",
"0.4748359",
"0.4737001",
"0.4731156",
"0.4727907",
"0.47187117",
"0.47102574",
"0.4710095",
"0.47073248",
"0.46940726",
"0.4692895",
"0.46880448",
"0.46819678",
"0.4675034",
"0.46719915",
"0.4663036",
"0.46626884",
"0.46562016",
"0.46546945",
"0.46418902",
"0.4636545",
"0.46256337",
"0.46164963",
"0.46071422",
"0.46025184",
"0.4601379",
"0.45935902",
"0.45919535",
"0.4582778",
"0.45741233",
"0.45593306",
"0.4558033",
"0.45553735",
"0.4549312",
"0.454318",
"0.45415226",
"0.4537257",
"0.45341244",
"0.45312747",
"0.45308653",
"0.4530538",
"0.4527217",
"0.4525754",
"0.45255482",
"0.45231625",
"0.4522854",
"0.45211804",
"0.45126724",
"0.45044133",
"0.4500597",
"0.44975102",
"0.4497299",
"0.4496286",
"0.44959807",
"0.4494559",
"0.4490819",
"0.44882601",
"0.44848698",
"0.44815236",
"0.44801208",
"0.4476616",
"0.44760746",
"0.44710582",
"0.44698626",
"0.44670343"
]
| 0.6457189 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.