Here you can find the source of sortByNibble(ArrayList
public static void sortByNibble(ArrayList<Character> symbolAL, int delimiter)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static void sortByNibble(ArrayList<Character> symbolAL, int delimiter) { ArrayList<Character> bucketOneAL = new ArrayList<Character>(); ArrayList<Character> bucketTwoAL = new ArrayList<Character>(); for (int i = 0; i < symbolAL.size(); i++) { int tempI = Integer.parseInt(symbolAL.get(i).toString(), 16); if (tempI > delimiter) { bucketTwoAL.add(symbolAL.get(i)); } else { bucketOneAL.add(symbolAL.get(i)); }// w w w .jav a 2 s. c o m } symbolAL.clear(); symbolAL.addAll(bucketOneAL); symbolAL.addAll(bucketTwoAL); } }