-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransitionFunction.java
More file actions
61 lines (49 loc) · 1.59 KB
/
Copy pathTransitionFunction.java
File metadata and controls
61 lines (49 loc) · 1.59 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
57
58
59
60
61
/*
* Copyright (c) 2021. Developed by dDev Tech. Website: https://www.retopall.com/
*/
package FDA;
import java.util.function.Function;
public class TransitionFunction<T>{
private Function<T,Boolean>transition;
//only change state or also remove from queue and add to current(if ignore = false;)
private boolean read;
private boolean write;
public TransitionFunction(Function<T,Boolean>transition, boolean read, boolean write){
this.read = read;
this.write = write;
this.transition = transition;
}
public Function<T, Boolean> getTransition() {
return transition;
}
public void setTransition(Function<T, Boolean> transition) {
this.transition = transition;
}
public boolean isWrite() {
return write;
}
public void setWrite(boolean write) {
this.write = write;
}
public boolean isRead() {
return read;
}
public void setRead(boolean read) {
this.read = read;
}
public static boolean isLetter(Character character){
return Character.isLetter(character);
}
public static boolean isDigit(Character character){
return Character.isDigit(character);
}
public static boolean isLetterDigit(Character character){
return isLetter(character)||isDigit(character);
}
public static boolean isDelimiter(Character character){
return Character.isWhitespace(character);
}
public static boolean isEscape(Character character){
return character == 'n'||character == 'r'||character == '\"'||character == '\\';
}
}