aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
index 69610c5a73..861f3fff5f 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
@@ -217,8 +217,8 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
private HSSFWorkbook(InternalWorkbook book) {
super((DirectoryNode)null);
workbook = book;
- _sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY);
- names = new ArrayList<HSSFName>(INITIAL_CAPACITY);
+ _sheets = new ArrayList<>(INITIAL_CAPACITY);
+ names = new ArrayList<>(INITIAL_CAPACITY);
}
/**
@@ -345,8 +345,8 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
clearDirectory();
}
- _sheets = new ArrayList<HSSFSheet>(INITIAL_CAPACITY);
- names = new ArrayList<HSSFName>(INITIAL_CAPACITY);
+ _sheets = new ArrayList<>(INITIAL_CAPACITY);
+ names = new ArrayList<>(INITIAL_CAPACITY);
// Grab the data from the workbook stream, however
// it happens to be spelled.
@@ -606,7 +606,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
* @param indexes Array of sheets to select, the index is 0-based.
*/
public void setSelectedTabs(int[] indexes) {
- Collection<Integer> list = new ArrayList<Integer>(indexes.length);
+ Collection<Integer> list = new ArrayList<>(indexes.length);
for (int index : indexes) {
list.add(index);
}
@@ -626,7 +626,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
validateSheetIndex(index);
}
// ignore duplicates
- Set<Integer> set = new HashSet<Integer>(indexes);
+ Set<Integer> set = new HashSet<>(indexes);
int nSheets = _sheets.size();
for (int i=0; i<nSheets; i++) {
boolean bSelect = set.contains(i);
@@ -643,7 +643,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
* @return indices of selected sheets
*/
public Collection<Integer> getSelectedTabs() {
- Collection<Integer> indexes = new ArrayList<Integer>();
+ Collection<Integer> indexes = new ArrayList<>();
int nSheets = _sheets.size();
for (int i=0; i<nSheets; i++) {
HSSFSheet sheet = getSheetAt(i);
@@ -946,7 +946,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
*/
@Override
public Iterator<Sheet> sheetIterator() {
- return new SheetIterator<Sheet>();
+ return new SheetIterator<>();
}
/**
@@ -1235,7 +1235,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
@Override
public HSSFFont getFontAt(short idx) {
if(fonts == null) {
- fonts = new HashMap<Short, HSSFFont>();
+ fonts = new HashMap<>();
}
// So we don't confuse users, give them back
@@ -1260,7 +1260,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
* and that's not something you should normally do
*/
protected void resetFontCache() {
- fonts = new HashMap<Short, HSSFFont>();
+ fonts = new HashMap<>();
}
/**
@@ -1401,7 +1401,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
private void write(NPOIFSFileSystem fs) throws IOException {
// For tracking what we've written out, used if we're
// going to be preserving nodes
- List<String> excepts = new ArrayList<String>(1);
+ List<String> excepts = new ArrayList<>(1);
// Write out the Workbook stream
fs.createDocument(new ByteArrayInputStream(getBytes()), "Workbook");
@@ -1445,7 +1445,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
public SheetRecordCollector() {
_totalSize = 0;
- _list = new ArrayList<Record>(128);
+ _list = new ArrayList<>(128);
}
public int getTotalSize() {
return _totalSize;
@@ -1597,7 +1597,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
@Override
public List<HSSFName> getNames(String name) {
- List<HSSFName> nameList = new ArrayList<HSSFName>();
+ List<HSSFName> nameList = new ArrayList<>();
for(HSSFName nr : names) {
if(nr.getNameName().equals(name)) {
nameList.add(nr);
@@ -1970,7 +1970,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
public List<HSSFPictureData> getAllPictures()
{
// The drawing group record always exists at the top level, so we won't need to do this recursively.
- List<HSSFPictureData> pictures = new ArrayList<HSSFPictureData>();
+ List<HSSFPictureData> pictures = new ArrayList<>();
for (Record r : workbook.getRecords()) {
if (r instanceof AbstractEscherHolderRecord) {
((AbstractEscherHolderRecord) r).decode();
@@ -2011,7 +2011,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
}
protected static Map<String,ClassID> getOleMap() {
- Map<String,ClassID> olemap = new HashMap<String,ClassID>();
+ Map<String,ClassID> olemap = new HashMap<>();
olemap.put("PowerPoint Document", ClassID.PPT_SHOW);
for (String str : WORKBOOK_DIR_ENTRY_NAMES) {
olemap.put(str, ClassID.XLS_WORKBOOK);
@@ -2123,7 +2123,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
*/
public List<HSSFObjectData> getAllEmbeddedObjects()
{
- List<HSSFObjectData> objects = new ArrayList<HSSFObjectData>();
+ List<HSSFObjectData> objects = new ArrayList<>();
for (HSSFSheet sheet : _sheets)
{
getAllEmbeddedObjects(sheet, objects);