-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.java
More file actions
56 lines (55 loc) · 2.03 KB
/
handler.java
File metadata and controls
56 lines (55 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sortingalgojava;
/**
*
* @author Makregio
*/
public abstract class handler extends drawUI {
public static boolean blank(){
boolean boo = false;
for(loop=0; loop<txtin.length;loop++){
if(txtin[loop].getText().equals("")){
boo = true;
warning = " Textbox is not filled";
break;
}
}
return boo;
}
public static boolean notNum(){
boolean boo = false;
for(loop = 0; loop<txtin.length;loop++){
char txtvalue [] = txtin[loop].getText().toCharArray();
for(int charLength=0; charLength < txtvalue.length; charLength++){
if(txtin[loop].getText().charAt(charLength) >= (int)'a' && txtin[loop].getText().charAt(charLength) <= (int)'z'){
boo = true;
warning = " Textbox is filled with letters";
}
else if(txtin[loop].getText().charAt(charLength) >= (int)'A' && txtin[loop].getText().charAt(charLength) <= (int)'Z'){
boo = true;
warning = " Textbox is filled with letters";
}
else if(txtin[loop].getText().charAt(charLength) == (int)' '){
boo = true;
warning = " Textbox is filled with spaces";
}
else if(!(txtin[loop].getText().charAt(charLength) >= (int)'0' && txtin[loop].getText().charAt(charLength) <= (int)'9')){
boo = true;
warning = "Textbox is filled with special characters";
}
}
}
return boo;
}
public static boolean isSorted(int [] list){
boolean boo = true;
for(loop = 0; loop < list.length-1; loop++){
if(list[loop] > list[loop+1])
boo = false;
}
return boo;
}
}