aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/ss/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/poi/ss/util')
-rw-r--r--src/java/org/apache/poi/ss/util/AreaReference.java4
-rw-r--r--src/java/org/apache/poi/ss/util/CellRangeAddressList.java2
-rw-r--r--src/java/org/apache/poi/ss/util/CellRangeUtil.java2
-rw-r--r--src/java/org/apache/poi/ss/util/CellUtil.java14
-rw-r--r--src/java/org/apache/poi/ss/util/DateFormatConverter.java6
-rw-r--r--src/java/org/apache/poi/ss/util/PropertyTemplate.java10
-rw-r--r--src/java/org/apache/poi/ss/util/SSCellRange.java4
7 files changed, 21 insertions, 21 deletions
diff --git a/src/java/org/apache/poi/ss/util/AreaReference.java b/src/java/org/apache/poi/ss/util/AreaReference.java
index fab3619b35..44fcab2b6d 100644
--- a/src/java/org/apache/poi/ss/util/AreaReference.java
+++ b/src/java/org/apache/poi/ss/util/AreaReference.java
@@ -236,7 +236,7 @@ public class AreaReference {
if (null == version) {
version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave.
}
- List<AreaReference> refs = new ArrayList<AreaReference>();
+ List<AreaReference> refs = new ArrayList<>();
StringTokenizer st = new StringTokenizer(reference, ",");
while(st.hasMoreTokens()) {
refs.add(
@@ -287,7 +287,7 @@ public class AreaReference {
int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol());
String sheetName = _firstCell.getSheetName();
- List<CellReference> refs = new ArrayList<CellReference>();
+ List<CellReference> refs = new ArrayList<>();
for(int row=minRow; row<=maxRow; row++) {
for(int col=minCol; col<=maxCol; col++) {
CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute());
diff --git a/src/java/org/apache/poi/ss/util/CellRangeAddressList.java b/src/java/org/apache/poi/ss/util/CellRangeAddressList.java
index 8d99198234..7dad2a763d 100644
--- a/src/java/org/apache/poi/ss/util/CellRangeAddressList.java
+++ b/src/java/org/apache/poi/ss/util/CellRangeAddressList.java
@@ -45,7 +45,7 @@ public class CellRangeAddressList {
protected final List<CellRangeAddress> _list;
public CellRangeAddressList() {
- _list = new ArrayList<CellRangeAddress>();
+ _list = new ArrayList<>();
}
/**
* Convenience constructor for creating a <tt>CellRangeAddressList</tt> with a single
diff --git a/src/java/org/apache/poi/ss/util/CellRangeUtil.java b/src/java/org/apache/poi/ss/util/CellRangeUtil.java
index e60230ed8b..892778d457 100644
--- a/src/java/org/apache/poi/ss/util/CellRangeUtil.java
+++ b/src/java/org/apache/poi/ss/util/CellRangeUtil.java
@@ -171,7 +171,7 @@ public final class CellRangeUtil {
return result;
}
private static List<CellRangeAddress> toList(CellRangeAddress[] temp) {
- List<CellRangeAddress> result = new ArrayList<CellRangeAddress>(temp.length);
+ List<CellRangeAddress> result = new ArrayList<>(temp.length);
for (CellRangeAddress range : temp) {
result.add(range);
}
diff --git a/src/java/org/apache/poi/ss/util/CellUtil.java b/src/java/org/apache/poi/ss/util/CellUtil.java
index 855c284469..cab7d8f49b 100644
--- a/src/java/org/apache/poi/ss/util/CellUtil.java
+++ b/src/java/org/apache/poi/ss/util/CellUtil.java
@@ -75,7 +75,7 @@ public final class CellUtil {
public static final String WRAP_TEXT = "wrapText";
private static final Set<String> shortValues = Collections.unmodifiableSet(
- new HashSet<String>(Arrays.asList(
+ new HashSet<>(Arrays.asList(
BOTTOM_BORDER_COLOR,
LEFT_BORDER_COLOR,
RIGHT_BORDER_COLOR,
@@ -86,20 +86,20 @@ public final class CellUtil {
DATA_FORMAT,
FONT,
ROTATION
- )));
+ )));
private static final Set<String> booleanValues = Collections.unmodifiableSet(
- new HashSet<String>(Arrays.asList(
+ new HashSet<>(Arrays.asList(
LOCKED,
HIDDEN,
WRAP_TEXT
- )));
+ )));
private static final Set<String> borderTypeValues = Collections.unmodifiableSet(
- new HashSet<String>(Arrays.asList(
+ new HashSet<>(Arrays.asList(
BORDER_BOTTOM,
BORDER_LEFT,
BORDER_RIGHT,
BORDER_TOP
- )));
+ )));
@@ -334,7 +334,7 @@ public final class CellUtil {
* @see #setFormatProperties(org.apache.poi.ss.usermodel.CellStyle, org.apache.poi.ss.usermodel.Workbook, java.util.Map)
*/
private static Map<String, Object> getFormatProperties(CellStyle style) {
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
put(properties, ALIGNMENT, style.getAlignmentEnum());
put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
put(properties, BORDER_BOTTOM, style.getBorderBottomEnum());
diff --git a/src/java/org/apache/poi/ss/util/DateFormatConverter.java b/src/java/org/apache/poi/ss/util/DateFormatConverter.java
index 4d24a62ec8..cfe403b5af 100644
--- a/src/java/org/apache/poi/ss/util/DateFormatConverter.java
+++ b/src/java/org/apache/poi/ss/util/DateFormatConverter.java
@@ -81,7 +81,7 @@ public class DateFormatConverter {
}
public static String[] tokenize( String format ) {
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
DateFormatTokenizer tokenizer = new DateFormatTokenizer(format);
String token;
@@ -113,7 +113,7 @@ public class DateFormatConverter {
private static Map<String,String> localePrefixes = prepareLocalePrefixes();
private static Map<String,String> prepareTokenConversions() {
- Map<String,String> result = new HashMap<String,String>();
+ Map<String,String> result = new HashMap<>();
result.put( "EEEE", "dddd" );
result.put( "EEE", "ddd" );
@@ -135,7 +135,7 @@ public class DateFormatConverter {
}
private static Map<String,String> prepareLocalePrefixes() {
- Map<String,String> result = new HashMap<String,String>();
+ Map<String,String> result = new HashMap<>();
result.put( "af", "[$-0436]" );
result.put( "am", "[$-45E]" );
diff --git a/src/java/org/apache/poi/ss/util/PropertyTemplate.java b/src/java/org/apache/poi/ss/util/PropertyTemplate.java
index 1b0e27593b..7b310cdbd7 100644
--- a/src/java/org/apache/poi/ss/util/PropertyTemplate.java
+++ b/src/java/org/apache/poi/ss/util/PropertyTemplate.java
@@ -63,7 +63,7 @@ public final class PropertyTemplate {
* Create a PropertyTemplate object
*/
public PropertyTemplate() {
- _propertyTemplate = new HashMap<CellAddress, Map<String, Object>>();
+ _propertyTemplate = new HashMap<>();
}
/**
@@ -83,7 +83,7 @@ public final class PropertyTemplate {
}
private static Map<String, Object> cloneCellProperties(Map<String, Object> properties) {
- Map<String, Object> newProperties = new HashMap<String, Object>();
+ Map<String, Object> newProperties = new HashMap<>();
for(Map.Entry<String, Object> entry : properties.entrySet()) {
newProperties.put(entry.getKey(), entry.getValue());
}
@@ -411,7 +411,7 @@ public final class PropertyTemplate {
* @parm range - {@link CellRangeAddress} range of cells to remove borders.
*/
private void removeBorders(CellRangeAddress range) {
- Set<String> properties = new HashSet<String>();
+ Set<String> properties = new HashSet<>();
properties.add(CellUtil.BORDER_TOP);
properties.add(CellUtil.BORDER_BOTTOM);
properties.add(CellUtil.BORDER_LEFT);
@@ -758,7 +758,7 @@ public final class PropertyTemplate {
* @parm range - {@link CellRangeAddress} range of cells to remove borders.
*/
private void removeBorderColors(CellRangeAddress range) {
- Set<String> properties = new HashSet<String>();
+ Set<String> properties = new HashSet<>();
properties.add(CellUtil.TOP_BORDER_COLOR);
properties.add(CellUtil.BOTTOM_BORDER_COLOR);
properties.add(CellUtil.LEFT_BORDER_COLOR);
@@ -795,7 +795,7 @@ public final class PropertyTemplate {
CellAddress cell = new CellAddress(row, col);
Map<String, Object> cellProperties = _propertyTemplate.get(cell);
if (cellProperties == null) {
- cellProperties = new HashMap<String, Object>();
+ cellProperties = new HashMap<>();
}
cellProperties.put(property, value);
_propertyTemplate.put(cell, cellProperties);
diff --git a/src/java/org/apache/poi/ss/util/SSCellRange.java b/src/java/org/apache/poi/ss/util/SSCellRange.java
index f58a2780e8..e948465567 100644
--- a/src/java/org/apache/poi/ss/util/SSCellRange.java
+++ b/src/java/org/apache/poi/ss/util/SSCellRange.java
@@ -57,7 +57,7 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> {
@SuppressWarnings("unchecked")
B[] flattenedArray = (B[]) Array.newInstance(cellClass, nItems);
flattenedList.toArray(flattenedArray);
- return new SSCellRange<B>(firstRow, firstColumn, height, width, flattenedArray);
+ return new SSCellRange<>(firstRow, firstColumn, height, width, flattenedArray);
}
public int getHeight() {
@@ -109,7 +109,7 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> {
return result;
}
public Iterator<K> iterator() {
- return new ArrayIterator<K>(_flattenedArray);
+ return new ArrayIterator<>(_flattenedArray);
}
private static final class ArrayIterator<D> implements Iterator<D> {