Table

作者: 龙剑灵 | 来源:发表于2020-03-03 00:49 被阅读0次
            Table<String, String, String> table = HashBasedTable.create();
            table.put("Language", "Java", "1.8");
            table.put("Language", "Scala", "2.3");
            table.put("Database", "Oracle", "12C");
            table.put("Database", "Mysql", "7.0");
    
            System.out.println(table);//{Language={Java=1.8, Scala=2.3}, Database={Oracle=12C, Mysql=7.0}}
            Map<String, String> database = table.row("Database");
            System.out.println(database);//{Oracle=12C, Mysql=7.0}
    
            System.out.println(database.get("Oracle"));//12C
            System.out.println(table.column("Oracle").get("Database"));//12C
    
            System.out.println(table.column("Oracle"));//Map<String, String> oracle     {Database=12C}
    
            Set<Table.Cell<String, String, String>> cells = table.cellSet();
            //[(Language,Java)=1.8, (Language,Scala)=2.3, (Database,Oracle)=12C, (Database,Mysql)=7.0]
            System.out.println(cells);
    

    相关文章

      网友评论

          本文标题:Table

          本文链接:https://www.haomeiwen.com/subject/bjjokhtx.html