zj
2025-02-25 dd315d5732e14fcf3df71e0cf213cc442bd8607b
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
package project.futures;
 
import java.util.HashSet;
import java.util.Set;
 
public class FuturesLock {
    private static final Set<String> filter = new HashSet<String>();
//    private static final Set<String> overFilter = new HashSet<String>();
 
    public static boolean add(String order_no) {
        if (!filter.add(order_no)) {
            return false;
        } else {
            return true;
        }
    }
 
    public static void remove(String order_no) {
        filter.remove(order_no);
 
    }
 
//    public static boolean addOver(String order_no) {
//        if (!overFilter.add(order_no)) {
//            return false;
//        } else {
//            return true;
//        }
//    }
}