From da740edd3972fa049c4c8d0e43448c10a6a65dce Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 15 Jun 2025 19:26:12 -0500 Subject: Format & clean up source code --- src/main/java/sevenUnitsGUI/DelegateListModel.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/main/java/sevenUnitsGUI/DelegateListModel.java') diff --git a/src/main/java/sevenUnitsGUI/DelegateListModel.java b/src/main/java/sevenUnitsGUI/DelegateListModel.java index 200eee2..da4f978 100644 --- a/src/main/java/sevenUnitsGUI/DelegateListModel.java +++ b/src/main/java/sevenUnitsGUI/DelegateListModel.java @@ -31,7 +31,7 @@ import javax.swing.AbstractListModel; * the delegated list's methods because the delegate methods handle updating the * list. *

- * + * * @author Adrien Hopkins * @since 2019-01-14 * @since v0.1.0 @@ -46,7 +46,7 @@ final class DelegateListModel extends AbstractListModel /** * The list that this model is a delegate to. - * + * * @since 2019-01-14 * @since v0.1.0 */ @@ -54,7 +54,7 @@ final class DelegateListModel extends AbstractListModel /** * Creates an empty {@code DelegateListModel}. - * + * * @since 2019-04-13 * @since v0.2.0 */ @@ -64,7 +64,7 @@ final class DelegateListModel extends AbstractListModel /** * Creates the {@code DelegateListModel}. - * + * * @param delegate list to delegate * @since 2019-01-14 * @since v0.1.0 @@ -75,8 +75,8 @@ final class DelegateListModel extends AbstractListModel @Override public boolean add(final E element) { - final int index = this.delegate.size(); - final boolean success = this.delegate.add(element); + final var index = this.delegate.size(); + final var success = this.delegate.add(element); this.fireIntervalAdded(this, index, index); return success; } @@ -89,7 +89,7 @@ final class DelegateListModel extends AbstractListModel @Override public boolean addAll(final Collection c) { - boolean changed = false; + var changed = false; for (final E e : c) { if (this.add(e)) { changed = true; @@ -109,7 +109,7 @@ final class DelegateListModel extends AbstractListModel @Override public void clear() { - final int oldSize = this.delegate.size(); + final var oldSize = this.delegate.size(); this.delegate.clear(); if (oldSize >= 1) { this.fireIntervalRemoved(this, 0, oldSize - 1); @@ -177,7 +177,7 @@ final class DelegateListModel extends AbstractListModel @Override public E remove(final int index) { - final E returnValue = this.delegate.get(index); + final var returnValue = this.delegate.get(index); this.delegate.remove(index); this.fireIntervalRemoved(this, index, index); return returnValue; @@ -185,15 +185,15 @@ final class DelegateListModel extends AbstractListModel @Override public boolean remove(final Object o) { - final int index = this.delegate.indexOf(o); - final boolean returnValue = this.delegate.remove(o); + final var index = this.delegate.indexOf(o); + final var returnValue = this.delegate.remove(o); this.fireIntervalRemoved(this, index, index); return returnValue; } @Override public boolean removeAll(final Collection c) { - boolean changed = false; + var changed = false; for (final Object e : c) { if (this.remove(e)) { changed = true; @@ -204,15 +204,15 @@ final class DelegateListModel extends AbstractListModel @Override public boolean retainAll(final Collection c) { - final int oldSize = this.size(); - final boolean returnValue = this.delegate.retainAll(c); + final var oldSize = this.size(); + final var returnValue = this.delegate.retainAll(c); this.fireIntervalRemoved(this, this.size(), oldSize - 1); return returnValue; } @Override public E set(final int index, final E element) { - final E returnValue = this.delegate.get(index); + final var returnValue = this.delegate.get(index); this.delegate.set(index, element); this.fireContentsChanged(this, index, index); return returnValue; -- cgit v1.2.3