not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.2 KiB

  1. package net.jrtechs.www.DataStructures.Lists;
  2. /**
  3. * Generic interface to define the behavior of
  4. * lists.
  5. *
  6. * @param <E> generic for lists to store
  7. *
  8. * @author Jeffery Russell 8-24-18
  9. */
  10. public interface IList<E>
  11. {
  12. /**
  13. * Adds an element to the list
  14. *
  15. * @param o element to get added
  16. * @return whether element was edded
  17. */
  18. public boolean add(E o);
  19. /**
  20. * Determines if the list contains
  21. * a certain element.
  22. *
  23. * @param o element to see if exists
  24. * @return if element o is in the list
  25. */
  26. public boolean contains(E o);
  27. /**
  28. * Returns the size of the list.
  29. *
  30. * @return size of list
  31. */
  32. public int size();
  33. /**
  34. * Removes an element from the list
  35. *
  36. * @param index of element to remove
  37. * @return element which is removed
  38. */
  39. public E remove(int index);
  40. /**
  41. * Removes an element from the list
  42. *
  43. * @param o element to remove
  44. * @return element which is removed
  45. */
  46. public E remove(E o);
  47. /**
  48. * Returns element at a particular index
  49. *
  50. * @param index of desired element
  51. * @return element at a certain index
  52. */
  53. public E get(int index);
  54. }