Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ObjectBox {
- List collection;
- /**
- * Instantiates a new Object box.
- */
- public ObjectBox() {
- this.collection = new ArrayList<>();
- }
- ObjectBox(final Object[] array) {
- collection = Arrays.asList(array);
- Collections.sort(collection);
- }
- /**
- * Add a new Element to Collection
- *
- * @param o the Object
- */
- public void add(final Object o){
- collection.add(o);
- }
- /**
- * Deletes a given Object
- * in existing Data
- *
- * @param o the Object
- */
- public void delete(final Object o){
- collection.remove(o);
- }
- //TODO
- @Override
- public int hashCode() {
- return super.hashCode();
- }
- //TODO
- @Override
- public boolean equals(Object obj) {
- return super.equals(obj);
- }
- @Override
- public String toString() {
- return super.toString();
- }
- @Override
- public int hashCode() {
- int result = 31;
- result = 17 * result + (collection != null ? collection.hashCode() : 0);
- return result;
- }
Add Comment
Please, Sign In to add comment