Skip to content

help on import javolution.text.TypeFormat; l2jacis

Featured Replies

i noticed on l2jacis is not being used javolution also fastmap changed to hashmap , what about the typeformat ?

 

import javolution.text.TypeFormat;   <--

BLESS_WEAPON_ENCHANT_LEVEL.put(TypeFormat.parseInt(writeData[0]), TypeFormat.parseInt(writeData[1]));

wich iis the new '' typeformat import' and what i'll change for this option i wish to use ! thank you

Solved by melron

  • Solution

Im not sure about what TypeFormat does, but i think stands there to catch NumberFormatException ...

in example:

 

public static void main(String[] args)
{
	String one = "1f";

	System.out.println("TypeFormat : " + TypeFormat.parseInt(one));

	System.out.println("Integer : " + Integer.parseInt(one));
}

static class TypeFormat
{
	public static int parseInt(String val)
	{
		try
		{
			return Integer.parseInt(val);
		} catch (NumberFormatException e)
		{
			return 0;
		}
	}
}

 

Capture.PNG.e6baaebe247400b130324665c7f5c170.PNG

When you don't know something, or you cannot understand it. Simply, use google and find its documentation.

 

In less than 3s of search: http://javolution.org/apidocs/javolution/text/TypeFormat.html

 

Anyway... @melron explained it good. Simple and good.

Create an account or sign in to comment

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.