マップから最初の値と 2 番目の値を取得する最良の方法は何ですか? 私は地図を読んでtableLists
地図から取得しようとしfirst and second value
ています。
ReadTableConnectionInfo
以下は、クラスであるコードです。
private final LinkedHashMap<String, ReadTableConnectionInfo> tableLists;
ReadTableConnectionInfo table = tablePicker();
private ReadTableConnectionInfo tablePicker() {
Random r = new SecureRandom();
ReadTableConnectionInfo table;
if (r.nextFloat() < Read.percentageTable / 100) {
table = get first value from tableLists map
} else {
table = get second value from tableLists map
}
return table;
}