-
Constructor Summary
Constructors
-
Method Summary
boolean
boolean
Checks if an element is in the table.
boolean
Remove element from Table.
int
Return the amount of elements in the table.
-
Constructor Details
-
HashTable
public HashTable(int size)
-
Method Details
-
add
public boolean add(Integer element)
Description copied from interface: Table
Add Element to Table.
- Specified by:
add
in interface Table<Integer>
- Parameters:
element
- to be added
- Returns:
- true if element could be added, false if not
-
remove
public boolean remove(Integer element)
Description copied from interface: Table
Remove element from Table.
- Specified by:
remove
in interface Table<Integer>
- Parameters:
element
- to be removed.
- Returns:
- true if element was removed, false if not
-
contains
public boolean contains(Integer element)
Description copied from interface: Table
Checks if an element is in the table.
- Specified by:
contains
in interface Table<Integer>
- Parameters:
element
- to be checked
- Returns:
- true if present, false if not
-
size
public int size()
Description copied from interface: Table
Return the amount of elements in the table.
- Specified by:
size
in interface Table<Integer>
- Returns:
- the amount of elements
-