Add an isEmpty() to RowSet

This commit is contained in:
Acrobot 2013-11-01 16:51:42 +01:00
parent 023cabd849
commit eb8b6eb393
2 changed files with 10 additions and 1 deletions

View File

@ -36,4 +36,13 @@ public class RowSet {
public int size() {
return rowList.size();
}
/**
* Returns if the RowSet is empty
*
* @return Is the RowSet empty?
*/
public boolean isEmpty() {
return size() == 0;
}
}

View File

@ -84,7 +84,7 @@ public class Table {
*/
public Row getRow(String criteria) throws SQLException {
RowSet rs = select(criteria);
return (rs.size() > 0 ? rs.get(0) : new Row());
return (!rs.isEmpty() ? rs.get(0) : new Row());
}
/**