Jump to content
  • 0

[Question] About Fastmap


Question

Posted

FastMap=has a predictable iteration order, which is the order in which keys are inserted into the map

 

My question is that.

 

Could anyone ilustrate me a simple 5 lanes codes how works this class..  i would like to know the logic of this class

 

(Yeah, i know there are tons of  share  custom codes that have been shared but i need just a simple one with the idea of working of this class, i am not lazy.Just  Curious.)

 

I would appreciate every possible answer.

9 answers to this question

Recommended Posts

  • 0
Posted

I'm not sure 100%, I usually work with FastList.

 

 

package com.custom;
 
import java.util.Map;
 
import javolution.util.FastMap;
 
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
/**
 * @author Wyatt
 */
 
public class Test
{
private final FastMap<Integer, L2PcInstance> players_map = new FastMap<>();
 
public L2PcInstance[] getAllPlayers()
{
return players_map.values().toArray(new L2PcInstance[0]);
}
 
public void addPlayer(int index, L2PcInstance player)
{
players_map.put(index, player);
}
 
public Map<Integer, L2PcInstance> getPlayerList()
{
return players_map;
}
 
public L2PcInstance getPlayer(int index)
{
return players_map.get(index);
}
 
public boolean isPlayerInside(L2PcInstance player)
{
return players_map.containsValue(player);
}
 
public boolean isKeyUsed(int index)
{
return players_map.containsValue(index);
}
}
  • 0
Posted

I love the way you think...  T H A N K YOU this website is really  source of knowledge and especially you and the 5 others you are professors of l2j.Thanks god that you exist guys :) 

  • 0
Posted

A regular Java counterpart of FastList is LinkedList. There is no counterpart for FastMap, but you almost never need a map to be ordered. The only use of it is in geoengine, where order has to be kept (but can be reworked to avoid that state).

 

So basically said, the only uses of order is for things like buffs array, where order is important. Here a LinkedList can and should be used.

 

A FastMap got almost no use (I gave you the only legit use and it depends of the pack you use), and often can be replaced by regular HashMap. If you need a concurrent version (concurrent = can be used by multiple sources in same time), use ConcurrentHashMap.

 

FastMap methods are similar to HashMap (with some addition). You can read the associated javadoc to know each of them.

  • 0
Posted (edited)

i havent even bother to learn some basics of java yet when i watch all these codes here now *the one you listed as example*

 

im wondering my self ,how can u understand this logic ,how do u know what they do ,how can u make connections so damn easy, whats the java logic after all ,im not that great with english but thats not the issue

 

would i understand if i start learn it? i dont know ,seems complicated and very hard from a standard newbie view

Edited by Karasu
  • 0
Posted (edited)

You can understand some points of java just by logic... ofc it can seem complicated for a newbie, but like all things...

 

For example:

return players_map.values().toArray(new L2PcInstance[0]);
What would .values() mean? to get the values of your map? -> logic

 

players_map.put(index, player);
What would .put() mean? to put a value inside your map? -> logic

 

return players_map.get(index);
What would .get() mean? to get a value from your map? -> logic

 

return players_map.containsValue(player);
What would .containsValue() mean? to know if something is inside your map? -> logic Edited by ^Wyatt
  • 0
Posted

i havent even bother to learn some basics of java yet when i watch all these codes here now *the one you listed as example*

 

im wondering my self ,how can u understand this logic ,how do u know what they do ,how can u make connections so damn easy, whats the java logic after all ,im not that great with english but thats not the issue

 

would i understand if i start learn it? i dont know ,seems complicated and very hard from a standard newbie view

 

did you go to school ? have you ever studied proggraming ?

 

if both answers are "no", then I feal sorry about you, but you will never "get it" that easy or completly

  • 0
Posted

did you go to school ? have you ever studied proggraming ?

 

if both answers are "no", then I feal sorry about you, but you will never "get it" that easy or completly

 

whats "did you go to school" suppose to mean???????????????????????????????

 

im finishing highschool this year but my profile was about something else

 

ive started all of that things with l2 like 1 month ago, i am not interested enough to learn java, wont bring me any benefits and it takes time ,time that i dont have

  • 0
Posted

whats "did you go to school" suppose to mean? ???? ???? ???? ???? ???? ???? ??????

 

im finishing highschool this year but my profile was about something else

 

ive started all of that things with l2 like 1 month ago, i am not interested enough to learn java, wont bring me any benefits and it takes time ,time that i dont have

 

It means that in the last classes of high-school you are able to learn the basic programming languages, without that your gonna have hard time

  • 0
Posted (edited)

ive started all of that things with l2 like 1 month ago, i am not interested enough to learn java, wont bring me any benefits and it takes time ,time that i dont have

If you are "not interested enough to learn java" and u have no time to spend on it "coz it won't bring u any benefits", just avoid posting here trying to receive help anymore.

Jesus, attitudes like that makes me thing why did I even try to help you.

 

Topic locked since it's going offtopic.

Edited by ^Wyatt
Guest
This topic is now closed to further replies.


  • Posts

    • Seems legit, for sure deserves a try!
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • +8? Isnt +5 max per one stat?
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock