Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
キー オブジェクトと、このキーに関連するインスタンスのリストを含む hashMap を作成する必要があります。マップの作成中に、キー オブジェクト (vocKey) が既に存在するかどうかを確認したいのですが、Voc キーの新しいインスタンスを作成せず、vocData のリストに新しい行を追加するだけです。
private HashMap<vocKey,List<vocData>> vocabulary = new HashMap<vocKey,List<vocData>>();
List<vocData> data = vocabulary.get(key); if (data == null) { data = new ArrayList(); vocabulary.put(key, data); } data.add(...);