package egovframework.util;

import egovframework.vo.RoadVertexArrVO;

import java.util.ArrayList;
import java.util.List;

public class TrafficData {

    static List<RoadVertexArrVO> roadVertexArr = new ArrayList<>();
    static List<RoadVertexArrVO> ifscVertexArr = new ArrayList<>();
    static List<RoadVertexArrVO> linkVertexArr = new ArrayList<>();

    public static List<RoadVertexArrVO> getRoadVertexArr(){
        return roadVertexArr;
    }
    public static List<RoadVertexArrVO> getIfscVertexArr(){
        return ifscVertexArr;
    }
    public static List<RoadVertexArrVO> getLinkVertexArr(){
        return linkVertexArr;
    }

    public static void setRoadVertexArr(List<RoadVertexArrVO> roadVertexArrVo){
        roadVertexArr = getCloneVO(roadVertexArrVo);
    }
    public static void setIfscVertexArr(List<RoadVertexArrVO> ifscVertexArrVo){
        ifscVertexArr = getCloneVO(ifscVertexArrVo);
    }
    public static void setLinkVertexArr(List<RoadVertexArrVO> linkVertexArrVo){
        linkVertexArr = getCloneVO(linkVertexArrVo);
    }

    public static List<RoadVertexArrVO> getCloneVO(List<RoadVertexArrVO> originVO) {
        List<RoadVertexArrVO> resultVOArr = new ArrayList<>();
        for (RoadVertexArrVO vertexVo : originVO) {
            resultVOArr.add(vertexVo);
        }
        return resultVOArr;
    }

}
