| | |
| | | return null; |
| | | } |
| | | |
| | | public List<int[]> getCodeMatrixIdxList(Integer lev, List<String> codeDataList) { |
| | | if (Cools.isEmpty(codeDataList)) { |
| | | return new ArrayList<>(); |
| | | } |
| | | lev = Optional.ofNullable(lev).orElse(MAP_DEFAULT_LEV); |
| | | String[][] codeMatrix = this.getCodeMatrix(lev); |
| | | |
| | | List<int[]> codeMatrixIdxList = new ArrayList<>(); |
| | | |
| | | Map<String, int[]> map = new HashMap<>(); |
| | | Set<String> codeDataSet = new HashSet<>(codeDataList); |
| | | |
| | | for (int i = 0; i < codeMatrix.length; i++) { |
| | | for (int j = 0; j < codeMatrix[i].length; j++) { |
| | | String codeData = codeMatrix[i][j]; |
| | | if (codeDataSet.contains(codeData)) { |
| | | map.put(codeData, new int[]{i, j}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (String codeData : codeDataList) { |
| | | int[] codeMatrixIdx = map.get(codeData); |
| | | if (codeMatrixIdx != null) { |
| | | codeMatrixIdxList.add(codeMatrixIdx); |
| | | } |
| | | } |
| | | return codeMatrixIdxList; |
| | | } |
| | | |
| | | public List<String> queryCodeListFromDynamicNode(Integer lev, String nodeType) { |
| | | if (Cools.isEmpty(nodeType)) { |
| | | return new ArrayList<>(); |