Skip to content

FastList and FastMap question

Featured Replies

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>

 

 

Where is the question?

Btw, I would simply use ArrayList and HashMap instead. 

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

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

  • Author

so for fastlist is players.add(text) and for fastmap is players.put(text) ?

just i need learng from list about fastlist, fastmap etc.

You are comparing a list to a map. A map is a mapping of key/values where list is simply a list of items.

Map player.put(a, b)

List player.add(a)

 

As said above, screw javolution. Work with ArrayList and HashMap instead. 

  • Author

tnx all and big tnx to melron with practice he help me full

now can lock topic :)

Edited by tazerman2

example:

if (getPlayers().containsKey(player.getObjectId()))
            getPlayers().put(player.getObjectId(), player);

or  getPlayers().remove(player.getObjectId(), player);

  • SweeTs locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.