uknowngithubuser
2/1/2019 - 7:30 AM

Searches for Key-Value Pair in Dictionary #Search #Java

Searches for Key-Value Pair in Dictionary #Search #Java

public boolean dictionarysearch(JTable table, String key, String value){
    ArrayList start = new ArrayList();
    ArrayList values = new ArrayList();
    ArrayList checker = new ArrayList();
    Map<String, String> map = new HashMap<>();    
    // Key must be hall name 
    // Value must be room number

        for(int i = 0;i<table.getModel().getRowCount();i++) {
            map.put(table.getModel().getValueAt(i,2).toString(), table.getModel().getValueAt(i,3).toString());
            }
        System.out.println(map);
        return false;
        }