Examples of Quicksorter


Examples of org.jboss.profiler.filecollection.QuickSorter

    /** a ReferenceContainer for the Object passed as parameter */
    public ReferenceContainer selectReferences(MemoryObject object, boolean forward) throws Exception
    {
        MemoryReference key = new MemoryReference();
        QuickSorter sorter = null;
        FileCollection collection = null;
        if (forward)
        {
            key.setReferee(object.getId());
            key.setReferred(-1);

            collection = engine.references;
            sorter = engine.sorter;
        } else
        {
            key.setReferee(-1);
            key.setReferred(object.getId());

            collection = engine.invertedReferences;
            sorter = engine.invertedSorter;
        }

        ReferenceContainer container = new ReferenceContainer(object);

        ArrayList referencesFound = sorter.binarySearchCollection(collection,key);

        Iterator iter = referencesFound.iterator();

        while (iter.hasNext())
        {
View Full Code Here

Examples of quicksort.Quicksorter

public class TestQuickSort {

  @Test
  public void testQuicksortOneValue(){
    Quicksorter qs = new Quicksorter();
   
    int[] expecteds = new int[]{1};
    int[] actuals = qs.qsort(new int[]{1}, 0, 1);
   
    Assert.assertArrayEquals(expecteds, actuals);
  }
View Full Code Here

Examples of quicksort.Quicksorter

    Assert.assertArrayEquals(expecteds, actuals);
  }
 
  @Test
  public void testQuicksortTwoValues(){
    Quicksorter qs = new Quicksorter();
   
    int[] expecteds = new int[]{1, 2};
    int[] actuals = qs.qsort(new int[]{2, 1}, 0, 1);
   
    Assert.assertArrayEquals(expecteds, actuals);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.