This is not a bad way to work:


Here is the stubbed class:

import java.util.List;
import java.util.function.Function;

import linearpub.DynamicList;

public class DynamicArray<E> implements DynamicList<E> {

	//---------------------------------
	// Instance Variables

	private E[] fixedArray;			//sensitive ivar (access only via privateGetFixedArray and privateSetFixedArray)
	private int _size;
	private int initialCapacity;
	private double growthFactor;

	@Override
	public int size() {
		//TODO
		return 0;
	}

	@Override
	public boolean isEmpty() {
		//TODO
		return false;
	}

	@Override
	public E get(int index) {
		//TODO
		return null;
	}

	@Override
	public DynamicList<E> subList(int start, int stop) {
		//TODO
		return null;
	}

	@Override
	public E first() {
		//TODO
		return null;
	}

	@Override
	public E last() {
		//TODO
		return null;
	}

	@Override
	public int find(Function<E, Boolean> searchFct) {
		//TODO
		return 0;
	}

	@Override
	public void addFirst(E newElem) {
		//TODO

	}

	@Override
	public void addLast(E newElem) {
		//TODO

	}

	@Override
	public void add(E newElem) {
		//TODO

	}

	@Override
	public void addAll(DynamicList<E> otherDynList) {
		//TODO

	}

	@Override
	public E set(int index, E newElem) {
		//TODO
		return null;
	}

	@Override
	public void insert(int insertIndex, E newElem) {
		//TODO

	}

	@Override
	public E removeFirst() {
		//TODO
		return null;
	}

	@Override
	public E removeLast() {
		//TODO
		return null;
	}

	@Override
	public void removeAll() {
		//TODO

	}

	@Override
	public E removeIndex(int index) {
		//TODO
		return null;
	}

	@Override
	public E remove(Function<E, Boolean> searchFct) {
		//TODO
		return null;
	}

	@Override
	public List<E> toNativeList() {
		//TODO
		return null;
	}

}



Navigation