Clean up based on NetBeans warnings

This commit is contained in:
Oliver Burn 2010-09-30 15:55:30 +10:00
parent 592a12fa3d
commit 4abb4e9cc5
1 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ public class FastStack<E> implements Iterable<E>
*/
public boolean isEmpty()
{
return mEntries.size() == 0;
return mEntries.isEmpty();
}
/**
@ -67,7 +67,7 @@ public class FastStack<E> implements Iterable<E>
*/
public E peek()
{
if (mEntries.size() == 0) {
if (mEntries.isEmpty()) {
throw new IllegalStateException("FastStack is empty");
}
return mEntries.get(mEntries.size() - 1);
@ -80,7 +80,7 @@ public class FastStack<E> implements Iterable<E>
*/
public E pop()
{
if (mEntries.size() == 0) {
if (mEntries.isEmpty()) {
throw new IllegalStateException("FastStack is empty");
}
return mEntries.remove(mEntries.size() - 1);
@ -120,7 +120,7 @@ public class FastStack<E> implements Iterable<E>
}
/**
* Returns an interator that goes from the oldest element to the newest.
* Returns an iterator that goes from the oldest element to the newest.
* @return an iterator
*/
public Iterator<E> iterator()