package com.hithomelabs.clients.Benchmarks.Sortables;

import com.hithomelabs.clients.Benchmarks.Sortable;
import com.hithomelabs.princeton1.common.Apple;

import java.util.Random;

public class FewFrequentlyOccuringApples implements Sortable<Apple> {

    Apple[] apples;
    Random random;
    private static final int DEFAULT_SIZE_RANGE = 10;

    public FewFrequentlyOccuringApples(int size){
        random = new Random();
        apples = new Apple[size];
        for (int i = 0; i < size; i++)
            apples[i] = new Apple(random.nextInt(DEFAULT_SIZE_RANGE));
    }

    @Override
    public Apple[] getArray() {
        return apples.clone();
    }

    @Override
    public String getOrdering() {
        return "FEW FREQUENTLY OCCURING";
    }
}
