|  |  |  | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Collections; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("locDirectionService") | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean isAsc(Integer row, String direction, Long hostId) { | 
|---|
|  |  |  | List<ArrayList<Integer>> list = null; | 
|---|
|  |  |  | if(direction.equals("inner")){ | 
|---|
|  |  |  | list = this.getInnerList(hostId); | 
|---|
|  |  |  | } else if (direction.equals("outer")) { | 
|---|
|  |  |  | list = this.getOuterList(hostId); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | list = this.getNaturalList(hostId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ArrayList<Integer> obj = null; | 
|---|
|  |  |  | for (ArrayList<Integer> arrayList : list) { | 
|---|
|  |  |  | if(arrayList.contains(row)){ | 
|---|
|  |  |  | obj = arrayList; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (obj != null && obj.size() >= 2) { | 
|---|
|  |  |  | Integer i0 = obj.get(0); | 
|---|
|  |  |  | Integer i1 = obj.get(1); | 
|---|
|  |  |  | return i0 - i1 < 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<Integer> getInnerDeepRow(Long hostId) { | 
|---|
|  |  |  | ArrayList<Integer> data = new ArrayList<>(); | 
|---|
|  |  |  | List<ArrayList<Integer>> innerList = getInnerList(hostId); | 
|---|
|  |  |  | for (ArrayList<Integer> list : innerList) { | 
|---|
|  |  |  | data.add(list.get(0)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|