tazerman2 Posted May 5, 2018 Posted May 5, 2018 a class method is same player.put(mpla,mpla); with this class player.set(mpla,mpla); the first method use protected FastMap<PcInstance> and second use protected FastList<PcInstance>
0 SweeTs Posted May 5, 2018 Posted May 5, 2018 Where is the question? Btw, I would simply use ArrayList and HashMap instead.
0 Tony360 Posted May 5, 2018 Posted May 5, 2018 (edited) ArrayList : https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html HashMap : https://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html Edited May 5, 2018 by Tony360
0 SweeTs Posted May 6, 2018 Posted May 6, 2018 Still, no idea what he wants here :D Btw, as it's a Map, you must have 2 params, Map<L2PcInstance, Long> for example and list uses one List<PcInstance>. Map uses .put List uses .add
0 Nightw0lf Posted May 6, 2018 Posted May 6, 2018 best is putifabsent sweety xD but the main difference is that they are both FastSomething if you want more spesific answer you have to be more spesific in your question
0 tazerman2 Posted May 6, 2018 Author Posted May 6, 2018 so for fastlist is players.add(text) and for fastmap is players.put(text) ? just i need learng from list about fastlist, fastmap etc.
0 Sdw Posted May 6, 2018 Posted May 6, 2018 You are comparing a list to a map. A map is a mapping of key/values where list is simply a list of items.
0 SweeTs Posted May 6, 2018 Posted May 6, 2018 Map player.put(a, b) List player.add(a) As said above, screw javolution. Work with ArrayList and HashMap instead.
0 tazerman2 Posted May 6, 2018 Author Posted May 6, 2018 (edited) tnx all and big tnx to melron with practice he help me full now can lock topic :) Edited May 6, 2018 by tazerman2
0 Nightw0lf Posted May 6, 2018 Posted May 6, 2018 example: if (getPlayers().containsKey(player.getObjectId())) getPlayers().put(player.getObjectId(), player); or getPlayers().remove(player.getObjectId(), player);
Question
tazerman2
a class method is same player.put(mpla,mpla); with this class player.set(mpla,mpla);
the first method use protected FastMap<PcInstance> and second use protected FastList<PcInstance>
11 answers to this question
Recommended Posts