⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formattersimpl.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   FormattersImpl.java

package org.gudy.azureus2.pluginsimpl.local.utils;

import java.io.IOException;
import java.util.Comparator;
import java.util.Map;
import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.utils.Formatters;

public class FormattersImpl
	implements Formatters
{

	public FormattersImpl()
	{
	}

	public String formatByteCountToKiBEtc(long bytes)
	{
		return DisplayFormatters.formatByteCountToKiBEtc(bytes);
	}

	public String formatByteCountToKiBEtcPerSec(long bytes)
	{
		return DisplayFormatters.formatByteCountToKiBEtcPerSec(bytes);
	}

	public String formatPercentFromThousands(long thousands)
	{
		return DisplayFormatters.formatPercentFromThousands((int)thousands);
	}

	public String formatByteArray(byte data[], boolean no_spaces)
	{
		return ByteFormatter.nicePrint(data, no_spaces);
	}

	public String encodeBytesToString(byte bytes[])
	{
		return ByteFormatter.encodeString(bytes);
	}

	public byte[] decodeBytesFromString(String str)
	{
		return ByteFormatter.decodeString(str);
	}

	public String formatDate(long millis)
	{
		return DisplayFormatters.formatCustomDateTime(millis);
	}

	public String formatTimeOnly(long millis)
	{
		return DisplayFormatters.formatCustomTimeOnly(millis);
	}

	public String formatTimeOnly(long millis, boolean with_secs)
	{
		return DisplayFormatters.formatCustomTimeOnly(millis, with_secs);
	}

	public String formatDateOnly(long millis)
	{
		return DisplayFormatters.formatCustomDateOnly(millis);
	}

	public String formatTimeFromSeconds(long seconds)
	{
		return DisplayFormatters.formatTime(seconds * 1000L);
	}

	public String formatETAFromSeconds(long seconds)
	{
		return TimeFormatter.format(seconds);
	}

	public byte[] bEncode(Map map)
		throws IOException
	{
		return BEncoder.encode(map);
	}

	public Map bDecode(byte data[])
		throws IOException
	{
		return BDecoder.decode(data);
	}

	public String base32Encode(byte data[])
	{
		return Base32.encode(data);
	}

	public byte[] base32Decode(String data)
	{
		return Base32.decode(data);
	}

	public Comparator getAlphanumericComparator(final boolean ignore_case)
	{
		return new Comparator() {

			final boolean val$ignore_case;
			final FormattersImpl this$0;

			public int compare(Object o1, Object o2)
			{
				if ((o1 instanceof String) && (o2 instanceof String))
				{
					String s1 = (String)o1;
					String s2 = (String)o2;
					int l1 = s1.length();
					int l2 = s2.length();
					int c1_pos = 0;
					for (int c2_pos = 0; c1_pos < l1 && c2_pos < l2;)
					{
						char c1 = s1.charAt(c1_pos++);
						char c2 = s2.charAt(c2_pos++);
						if (Character.isDigit(c1) && Character.isDigit(c2))
						{
							int n1_pos = c1_pos - 1;
							int n2_pos = c2_pos - 1;
							for (; c1_pos < l1 && Character.isDigit(s1.charAt(c1_pos)); c1_pos++);
							for (; c2_pos < l2 && Character.isDigit(s2.charAt(c2_pos)); c2_pos++);
							int n1_length = c1_pos - n1_pos;
							int n2_length = c2_pos - n2_pos;
							if (n1_length != n2_length)
								return n1_length - n2_length;
							int i = 0;
							while (i < n1_length) 
							{
								char nc1 = s1.charAt(n1_pos++);
								char nc2 = s2.charAt(n2_pos++);
								if (nc1 != nc2)
									return nc1 - nc2;
								i++;
							}
						} else
						{
							if (ignore_case)
							{
								c1 = Character.toLowerCase(c1);
								c2 = Character.toLowerCase(c2);
							}
							if (c1 != c2)
								return c1 - c2;
						}
					}

					return l1 - l2;
				} else
				{
					return 0;
				}
			}

			
			{
				this$0 = FormattersImpl.this;
				ignore_case = flag;
				super();
			}
		};
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -