/** Contains the directory paths that have already been created in the
* output POI filesystem and maps them to their corresponding
* {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */
- private final Map<String,DirectoryEntry> paths = new HashMap<String,DirectoryEntry>();
+ private final Map<String,DirectoryEntry> paths = new HashMap<>();
/** Contains the directory paths that have already been created in the
* output POI filesystem and maps them to their corresponding
* {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */
- private final Map<String, DirectoryEntry> paths = new HashMap<String, DirectoryEntry>();
+ private final Map<String, DirectoryEntry> paths = new HashMap<>();
/** So we known which sheet we're on */
private int sheetIndex = -1;
private BoundSheetRecord[] orderedBSRs;
- private List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>();
+ private List<BoundSheetRecord> boundSheetRecords = new ArrayList<>();
// For handling formulas with string results
private int nextRow;
// whose items are neither bulleted or numbered - into that cell.
row = sheet.createRow(1);
cell = row.createCell(0);
- ArrayList<String> listItems = new ArrayList<String>();
+ ArrayList<String> listItems = new ArrayList<>();
listItems.add("List Item One.");
listItems.add("List Item Two.");
listItems.add("List Item Three.");
// to preserve order.
row = sheet.createRow(4);
cell = row.createCell(0);
- ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<MultiLevelListItem>();
- listItems = new ArrayList<String>();
+ ArrayList<MultiLevelListItem> multiLevelListItems = new ArrayList<>();
+ listItems = new ArrayList<>();
listItems.add("ML List Item One - Sub Item One.");
listItems.add("ML List Item One - Sub Item Two.");
listItems.add("ML List Item One - Sub Item Three.");
// item
multiLevelListItems.add(new MultiLevelListItem("List Item Two.", null));
multiLevelListItems.add(new MultiLevelListItem("List Item Three.", null));
- listItems = new ArrayList<String>();
+ listItems = new ArrayList<>();
listItems.add("ML List Item Four - Sub Item One.");
listItems.add("ML List Item Four - Sub Item Two.");
listItems.add("ML List Item Four - Sub Item Three.");
* @param parent
*/
public PendingPaintings(JComponent parent) {
- paintings = new ArrayList<Painting>();
+ paintings = new ArrayList<>();
parent.putClientProperty(PENDING_PAINTINGS, this);
}
public ExtendableTreeCellRenderer()
{
- renderers = new HashMap<Class<?>,TreeCellRenderer>();
+ renderers = new HashMap<>();
register(Object.class, new DefaultTreeCellRenderer()
{
@Override
{
this.filename = filename;
this.rootNode = rootNode;
- pathToNode = new HashMap<Object,MutableTreeNode>(15); // Should be a reasonable guess.
+ pathToNode = new HashMap<>(15); // Should be a reasonable guess.
}
* create a library of cell styles
*/
private static Map<String, CellStyle> createStyles(Workbook wb){
- Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+ Map<String, CellStyle> styles = new HashMap<>();
DataFormat df = wb.createDataFormat();
CellStyle style;
* cell styles used for formatting calendar sheets
*/
private static Map<String, CellStyle> createStyles(Workbook wb){
- Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+ Map<String, CellStyle> styles = new HashMap<>();
short borderColor = IndexedColors.GREY_50_PERCENT.getIndex();
Cell cell;
}
- List<String> listOfDifferences = new ArrayList<String>();
+ List<String> listOfDifferences = new ArrayList<>();
public static void main(String args[]) throws Exception {
if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
* cell styles used for formatting calendar sheets
*/
private static Map<String, CellStyle> createStyles(Workbook wb){
- Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+ Map<String, CellStyle> styles = new HashMap<>();
CellStyle style;
Font titleFont = wb.createFont();
}
static Map<String, CellStyle> createStyles(Workbook wb) {
- Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+ Map<String, CellStyle> styles = new HashMap<>();
CellStyle style;
Font headerFont = wb.createFont();
* Create a library of cell styles
*/
private static Map<String, CellStyle> createStyles(Workbook wb){
- Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
+ Map<String, CellStyle> styles = new HashMap<>();
CellStyle style;
Font titleFont = wb.createFont();
titleFont.setFontHeightInPoints((short)18);
Sheet sheet = null;
Row row = null;
int lastRowNum = 0;
- this.csvData = new ArrayList<ArrayList<String>>();
+ this.csvData = new ArrayList<>();
System.out.println("Converting files contents to CSV format.");
private void rowToCSV(Row row) {
Cell cell = null;
int lastCellNum = 0;
- ArrayList<String> csvLine = new ArrayList<String>();
+ ArrayList<String> csvLine = new ArrayList<>();
// Check to ensure that a row was recovered from the sheet as it is
// possible that one or more rows between other populated rows could be
CheckFunctionsSupported check = new CheckFunctionsSupported(wb);
// Fetch all the problems
- List<FormulaEvaluationProblems> problems = new ArrayList<CheckFunctionsSupported.FormulaEvaluationProblems>();
+ List<FormulaEvaluationProblems> problems = new ArrayList<>();
for (int sn=0; sn<wb.getNumberOfSheets(); sn++) {
problems.add(check.getEvaluationProblems(sn));
}
// Produce an overall summary
- Set<String> unsupportedFunctions = new TreeSet<String>();
+ Set<String> unsupportedFunctions = new TreeSet<>();
for (FormulaEvaluationProblems p : problems) {
unsupportedFunctions.addAll(p.unsupportedFunctions);
}
return getEvaluationProblems(workbook.getSheetAt(sheetIndex));
}
public FormulaEvaluationProblems getEvaluationProblems(Sheet sheet) {
- Set<String> unsupportedFunctions = new HashSet<String>();
- Map<CellReference,Exception> unevaluatableCells = new HashMap<CellReference, Exception>();
+ Set<String> unsupportedFunctions = new HashSet<>();
+ Map<CellReference,Exception> unevaluatableCells = new HashMap<>();
for (Row r : sheet) {
for (Cell c : r) {
return ErrorEval.NA;
}
};
- _functionsByName = new HashMap<String, FreeRefFunction>();
+ _functionsByName = new HashMap<>();
_functionsByName.put("BDP", NA);
_functionsByName.put("BDH", NA);
_functionsByName.put("BDS", NA);
@SuppressWarnings({"unchecked"})
private static <K, V> Map<K, V> mapFor(Object... mapping) {
- Map<K, V> map = new HashMap<K, V>();
+ Map<K, V> map = new HashMap<>();
for (int i = 0; i < mapping.length; i += 2) {
map.put((K) mapping[i], (V) mapping[i + 1]);
}
}
// now add css for each used style
- Set<CellStyle> seen = new HashSet<CellStyle>();
+ Set<CellStyle> seen = new HashSet<>();
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
Sheet sheet = wb.getSheetAt(i);
Iterator<Row> rows = sheet.rowIterator();
private String lastContents;
private boolean nextIsString;
private boolean inlineStr;
- private final LruCache<Integer,String> lruCache = new LruCache<Integer,String>(50);
+ private final LruCache<Integer,String> lruCache = new LruCache<>(50);
private static class LruCache<A,B> extends LinkedHashMap<A, B> {
private final int maxEntries;
// You can add multiple spans for one row
Object span = start_column + ":" + end_column;
- List<Object> spanList = new ArrayList<Object>();
+ List<Object> spanList = new ArrayList<>();
spanList.add(span);
//add spns to the row
* Create a library of cell styles.
*/
private static Map<String, XSSFCellStyle> createStyles(XSSFWorkbook wb){
- Map<String, XSSFCellStyle> styles = new HashMap<String, XSSFCellStyle>();
+ Map<String, XSSFCellStyle> styles = new HashMap<>();
XSSFDataFormat fmt = wb.createDataFormat();
XSSFCellStyle style1 = wb.createCellStyle();
* cell styles used for formatting calendar sheets
*/
private static Map<String, XSSFCellStyle> createStyles(XSSFWorkbook wb){
- Map<String, XSSFCellStyle> styles = new HashMap<String, XSSFCellStyle>();
+ Map<String, XSSFCellStyle> styles = new HashMap<>();
XSSFCellStyle style;
XSSFFont titleFont = wb.createFont();
private LinkedList<ExcelAntUserDefinedFunction> functions ;
public ExcelAntTask() {
- tests = new LinkedList<ExcelAntTest>() ;
- functions = new LinkedList<ExcelAntUserDefinedFunction>() ;
+ tests = new LinkedList<>() ;
+ functions = new LinkedList<>() ;
}
public void addPrecision( ExcelAntPrecision prec ) {
public ExcelAntTest() {
- evaluators = new LinkedList<ExcelAntEvaluateCell>();
- failureMessages = new LinkedList<String>();
- testTasks = new LinkedList<Task>();
+ evaluators = new LinkedList<>();
+ failureMessages = new LinkedList<>();
+ testTasks = new LinkedList<>();
}
public void setPrecision( double precision ) {
private Workbook workbook;
- private final Map<String, FreeRefFunction> xlsMacroList = new HashMap<String, FreeRefFunction>();
+ private final Map<String, FreeRefFunction> xlsMacroList = new HashMap<>();
/**
* Constructs an instance using a String that contains the fully qualified
* @return
*/
public List<String> getSheets() {
- ArrayList<String> sheets = new ArrayList<String>();
+ ArrayList<String> sheets = new ArrayList<>();
int sheetCount = workbook.getNumberOfSheets();
*/
public static ExcelAntWorkbookUtil getInstance(String fileName) {
if(workbookUtilMap == null) {
- workbookUtilMap = new HashMap<String, ExcelAntWorkbookUtil>();
+ workbookUtilMap = new HashMap<>();
}
if(workbookUtilMap.containsKey(fileName)) {
// map file extensions to the actual mappers
- static final Map<String, FileHandler> HANDLERS = new HashMap<String, FileHandler>();
+ static final Map<String, FileHandler> HANDLERS = new HashMap<>();
static {
// Excel
HANDLERS.put(".xls", new HSSFFileHandler());
HANDLERS.put("spreadsheet/BigSSTRecordCR", new NullFileHandler());
HANDLERS.put("spreadsheet/test_properties1", new NullFileHandler());
- Map<String,String> passmap = new HashMap<String,String>();
+ Map<String,String> passmap = new HashMap<>();
passmap.put("slideshow/Password_Protected-hello.ppt", "hello");
passmap.put("slideshow/Password_Protected-56-hello.ppt", "hello");
passmap.put("slideshow/Password_Protected-np-hello.ppt", "hello");
return Collections.unmodifiableSet(hashSet(a));
}
private static Set<String> hashSet(String... a) {
- return new HashSet<String>(Arrays.asList(a));
+ return new HashSet<>(Arrays.asList(a));
}
// Old Word Documents where we can at least extract some text
System.out.println("Handling " + scanner.getIncludedFiles().length + " files");
- List<Object[]> files = new ArrayList<Object[]>();
+ List<Object[]> files = new ArrayList<>();
for(String file : scanner.getIncludedFiles()) {
file = file.replace('\\', '/'); // ... failures/handlers lookup doesn't work on windows otherwise
if (IGNORED.contains(file)) {
import org.apache.xmlbeans.XmlException;
public abstract class AbstractFileHandler implements FileHandler {
- public static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<String>();
+ public static final Set<String> EXPECTED_EXTRACTOR_FAILURES = new HashSet<>();
static {
// password protected files without password
// ... currently none ...
private static final Set<String> unmodifiableHashSet(String... a) {
- return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(a)));
+ return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(a)));
}
// TODO: still fails on some records... RecordsStresser.handleWorkbook(wb);
}
- private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<String>();
+ private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<>();
static {
// encrypted
EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/35897-type4.xls");
}
}
- private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<String>();
+ private static final Set<String> EXPECTED_ADDITIONAL_FAILURES = new HashSet<>();
static {
// expected sheet-id not found
// EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/52348.xlsx");
this.code = code;
}
- private static final Map<Integer, HyperlinkType> map = new HashMap<Integer, HyperlinkType>();
+ private static final Map<Integer, HyperlinkType> map = new HashMap<>();
static {
for (HyperlinkType type : values()) {
map.put(type.getCode(), type);
private static NavigableMap<Integer,Range> UCS_RANGES;
static {
- UCS_RANGES = new TreeMap<Integer,Range>();
+ UCS_RANGES = new TreeMap<>();
UCS_RANGES.put(0x0000, new Range(0x007F, LATIN));
UCS_RANGES.put(0x0080, new Range(0x00A6, LATIN));
UCS_RANGES.put(0x00A9, new Range(0x00AF, LATIN));
* @return the FontGroup
*/
public static List<FontGroupRange> getFontGroupRanges(String runText) {
- List<FontGroupRange> ttrList = new ArrayList<FontGroupRange>();
+ List<FontGroupRange> ttrList = new ArrayList<>();
FontGroupRange ttrLast = null;
final int rlen = (runText != null) ? runText.length() : 0;
for(int cp, i = 0, charCount; i < rlen; i += charCount) {
*/
public abstract class AbstractEscherOptRecord extends EscherRecord
{
- private List<EscherProperty> properties = new ArrayList<EscherProperty>();
+ private List<EscherProperty> properties = new ArrayList<>();
/**
* Add a property to this record.
@Override
protected Object[][] getAttributeMap() {
- List<Object> attrList = new ArrayList<Object>(properties.size()*2+2);
+ List<Object> attrList = new ArrayList<>(properties.size() * 2 + 2);
attrList.add("properties");
attrList.add(properties.size());
for ( EscherProperty property : properties ) {
* @return The map containing the id/constructor pairs.
*/
protected static Map<Short, Constructor<? extends EscherRecord>> recordsToMap(Class<?>[] recClasses) {
- Map<Short, Constructor<? extends EscherRecord>> result = new HashMap<Short, Constructor<? extends EscherRecord>>();
+ Map<Short, Constructor<? extends EscherRecord>> result = new HashMap<>();
final Class<?>[] EMPTY_CLASS_ARRAY = new Class[0];
for (Class<?> recClass : recClasses) {
*/
private int _remainingLength;
- private final List<EscherRecord> _childRecords = new ArrayList<EscherRecord>();
+ private final List<EscherRecord> _childRecords = new ArrayList<>();
@Override
public int fillFields(byte[] data, int pOffset, EscherRecordFactory recordFactory) {
*/
@Override
public List<EscherRecord> getChildRecords() {
- return new ArrayList<EscherRecord>(_childRecords);
+ return new ArrayList<>(_childRecords);
}
/**
* @return EscherContainer children
*/
public List<EscherContainerRecord> getChildContainers() {
- List<EscherContainerRecord> containers = new ArrayList<EscherContainerRecord>();
+ List<EscherContainerRecord> containers = new ArrayList<>();
for (EscherRecord r : this) {
if(r instanceof EscherContainerRecord) {
containers.add((EscherContainerRecord) r);
@Override
protected Object[][] getAttributeMap() {
- List<Object> chList = new ArrayList<Object>(_childRecords.size()*2+2);
+ List<Object> chList = new ArrayList<>(_childRecords.size() * 2 + 2);
chList.add("children");
chList.add(_childRecords.size());
int count = 0;
// private int field_2_numIdClusters;
private int field_3_numShapesSaved;
private int field_4_drawingsSaved;
- private final List<FileIdCluster> field_5_fileIdClusters = new ArrayList<FileIdCluster>();
+ private final List<FileIdCluster> field_5_fileIdClusters = new ArrayList<>();
private int maxDgId;
public static class FileIdCluster {
@Override
protected Object[][] getAttributeMap() {
- List<Object> fldIds = new ArrayList<Object>();
+ List<Object> fldIds = new ArrayList<>();
fldIds.add("FileId Clusters");
fldIds.add(field_5_fileIdClusters.size());
for (FileIdCluster fic : field_5_fileIdClusters) {
private static final Map<Short, EscherPropertyMetaData> properties = initProps();
private static Map<Short, EscherPropertyMetaData> initProps() {
- Map<Short, EscherPropertyMetaData> m = new HashMap<Short, EscherPropertyMetaData>();
+ Map<Short, EscherPropertyMetaData> m = new HashMap<>();
addProp(m, TRANSFORM__ROTATION, "transform.rotation");
addProp(m, PROTECTION__LOCKROTATION, "protection.lockrotation");
addProp(m, PROTECTION__LOCKASPECTRATIO, "protection.lockaspectratio");
* @return The new properties
*/
public List<EscherProperty> createProperties(byte[] data, int offset, short numProperties) {
- List<EscherProperty> results = new ArrayList<EscherProperty>();
+ List<EscherProperty> results = new ArrayList<>();
int pos = offset;
@Override
protected Object[][] getAttributeMap() {
int numCh = getChildRecords().size();
- List<Object> chLst = new ArrayList<Object>(numCh*2+2);
+ List<Object> chLst = new ArrayList<>(numCh * 2 + 2);
chLst.add("children");
chLst.add(numCh);
for (EscherRecord er : getChildRecords()) {
private List<EscherRecord> _childRecords;
public UnknownEscherRecord() {
- _childRecords = new ArrayList<EscherRecord>();
+ _childRecords = new ArrayList<>();
}
@Override
@Override
protected Object[][] getAttributeMap() {
int numCh = getChildRecords().size();
- List<Object> chLst = new ArrayList<Object>(numCh*2+2);
+ List<Object> chLst = new ArrayList<>(numCh * 2 + 2);
chLst.add("children");
chLst.add(numCh);
for (EscherRecord er : _childRecords) {
throws IOException
{
// All the embedded directories we spotted
- List<Entry> dirs = new ArrayList<Entry>();
+ List<Entry> dirs = new ArrayList<>();
// For anything else not directly held in as a POIFS directory
- List<InputStream> nonPOIFS = new ArrayList<InputStream>();
+ List<InputStream> nonPOIFS = new ArrayList<>();
// Find all the embedded directories
DirectoryEntry root = ext.getRoot();
return new POITextExtractor[0];
}
- ArrayList<POITextExtractor> e = new ArrayList<POITextExtractor>();
+ ArrayList<POITextExtractor> e = new ArrayList<>();
for (Entry dir : dirs) {
e.add(createExtractor(
(DirectoryNode) dir
/**
* The custom properties
*/
- private final HashMap<Long,CustomProperty> props = new HashMap<Long,CustomProperty>();
+ private final HashMap<Long,CustomProperty> props = new HashMap<>();
/**
* Maps property IDs to property names and vice versa.
*/
- private final TreeBidiMap<Long,String> dictionary = new TreeBidiMap<Long,String>();
+ private final TreeBidiMap<Long,String> dictionary = new TreeBidiMap<>();
/**
* Tells whether this object is pure or not.
* @return the list of properties
*/
public List<CustomProperty> properties() {
- List<CustomProperty> list = new ArrayList<CustomProperty>(props.size());
+ List<CustomProperty> list = new ArrayList<>(props.size());
for (Long l : dictionary.keySet()) {
list.add(props.get(l));
}
*/
@Override
public Collection<Object> values() {
- List<Object> list = new ArrayList<Object>(props.size());
+ List<Object> list = new ArrayList<>(props.size());
for (Long l : dictionary.keySet()) {
list.add(props.get(l).getValue());
}
@Override
public Set<Entry<String, Object>> entrySet() {
- Map<String,Object> set = new LinkedHashMap<String,Object>(props.size());
+ Map<String,Object> set = new LinkedHashMap<>(props.size());
for (Entry<Long,String> se : dictionary.entrySet()) {
set.put(se.getValue(), props.get(se.getKey()).getValue());
}
throw new HPSFRuntimeException("Illegal internal format of Document SummaryInformation stream: second section is missing.");
}
- List<Section> l = new LinkedList<Section>(getSections());
+ List<Section> l = new LinkedList<>(getSections());
clearSections();
int idx = 0;
for (Section s : l) {
private void write(NPOIFSFileSystem fs) throws IOException {
// For tracking what we've written out, so far
- List<String> excepts = new ArrayList<String>(2);
+ List<String> excepts = new ArrayList<>(2);
// Write out our HPFS properties, with any changes
writeProperties(fs, excepts);
/**
* The sections in this {@link PropertySet}.
*/
- private final List<Section> sections = new ArrayList<Section>();
+ private final List<Section> sections = new ArrayList<>();
/**
/**
* This section's properties.
*/
- private final Map<Long,Property> properties = new LinkedHashMap<Long,Property>();
+ private final Map<Long,Property> properties = new LinkedHashMap<>();
/**
* This member is {@code true} if the last call to {@link
* seconds pass reads the other properties.
*/
/* Pass 1: Read the property list. */
- final TreeBidiMap<Long,Long> offset2Id = new TreeBidiMap<Long,Long>();
+ final TreeBidiMap<Long,Long> offset2Id = new TreeBidiMap<>();
for (int i = 0; i < propertyCount; i++) {
/* Read the property ID. */
long id = (int)leis.readUInt();
/* Compare all properties except the dictionary (id 0) and
* the codepage (id 1 / ignored) as they must be handled specially. */
- Set<Long> propIds = new HashSet<Long>(properties.keySet());
+ Set<Long> propIds = new HashSet<>(properties.keySet());
propIds.addAll(s.properties.keySet());
propIds.remove(0L);
propIds.remove(1L);
*/
private boolean readDictionary(LittleEndianByteArrayInputStream leis, final int length, final int codepage)
throws UnsupportedEncodingException {
- Map<Long,String> dic = new HashMap<Long,String>();
+ Map<Long,String> dic = new HashMap<>();
/*
* Read the number of dictionary entries.
public void setDictionary(final Map<Long,String> dictionary) throws IllegalPropertySetDataException {
if (dictionary != null) {
if (this.dictionary == null) {
- this.dictionary = new TreeMap<Long,String>();
+ this.dictionary = new TreeMap<>();
}
this.dictionary.putAll(dictionary);
/* Initialize the number-to-name and number-to-length map: */
static {
- Map<Long,String> number2Name = new HashMap<Long,String>(NUMBER_TO_NAME_LIST.length, 1.0F);
- Map<Long,Integer> number2Len = new HashMap<Long,Integer>(NUMBER_TO_NAME_LIST.length, 1.0F);
+ Map<Long,String> number2Name = new HashMap<>(NUMBER_TO_NAME_LIST.length, 1.0F);
+ Map<Long,Integer> number2Len = new HashMap<>(NUMBER_TO_NAME_LIST.length, 1.0F);
for (Object[] nn : NUMBER_TO_NAME_LIST) {
number2Name.put((Long)nn[0], (String)nn[1]);
if (isLogUnsupportedTypes())
{
if (unsupportedMessage == null) {
- unsupportedMessage = new LinkedList<Long>();
+ unsupportedMessage = new LinkedList<>();
}
Long vt = Long.valueOf(ex.getVariantType());
if (!unsupportedMessage.contains(vt))
//of allocating array of length "length".
//If the length is corrupted and crazily big but < Integer.MAX_VALUE,
//this will trigger a RuntimeException "Buffer overrun" in lei.checkPosition
- List<TypedPropertyValue> values = new ArrayList<TypedPropertyValue>();
+ List<TypedPropertyValue> values = new ArrayList<>();
int paddedType = (_type == Variant.VT_VARIANT) ? 0 : _type;
for ( int i = 0; i < length; i++ ) {
TypedPropertyValue value = new TypedPropertyValue(paddedType, null);
* @param map The instance to be created is backed by this map.
*/
private PropertyIDMap(Object[][] idValues) {
- Map<Long,String> m = new HashMap<Long,String>(idValues.length);
+ Map<Long,String> m = new HashMap<>(idValues.length);
for (Object[] idValue : idValues) {
m.put((Long)idValue[0], (String)idValue[1]);
}
* The default section ID map. It maps section format IDs to {@link PropertyIDMap PropertyIDMaps}
*/
private static ThreadLocal<Map<ClassID,PropertyIDMap>> defaultMap =
- new ThreadLocal<Map<ClassID,PropertyIDMap>>();
+ new ThreadLocal<>();
/**
* <p>The SummaryInformation's section's format ID.</p>
public static SectionIDMap getInstance() {
Map<ClassID,PropertyIDMap> m = defaultMap.get();
if (m == null) {
- m = new HashMap<ClassID,PropertyIDMap>();
+ m = new HashMap<>();
m.put(SUMMARY_INFORMATION_ID, PropertyIDMap.getSummaryInformationProperties());
m.put(DOCUMENT_SUMMARY_INFORMATION_ID[0], PropertyIDMap.getDocumentSummaryInformationProperties());
defaultMap.set(m);
}
private static List<Integer> getIndexesByName(String[] params, HSSFWorkbook workbook) {
- List<Integer> list = new ArrayList<Integer>();
+ List<Integer> list = new ArrayList<>();
int pos = getAttributeIndex(SHEET_NAME_PARAM, params);
if (-1 != pos) {
if (pos >= params.length) {
}
private static List<Integer> getIndexesByIdArray(String[] params) {
- List<Integer> list = new ArrayList<Integer>();
+ List<Integer> list = new ArrayList<>();
int pos = getAttributeIndex(SHEET_INDEXES_PARAM, params);
if (-1 != pos) {
if (pos >= params.length) {
}
private static List<Integer> getSheetsIndexes(String[] params, HSSFWorkbook workbook) {
- List<Integer> list = new ArrayList<Integer>();
+ List<Integer> list = new ArrayList<>();
list.addAll(getIndexesByIdArray(params));
list.addAll(getIndexesByName(params, workbook));
if (0 == list.size()) {
*/
public static Record[] createRecords(InputStream is, PrintWriter ps, BiffRecordListener recListener, boolean dumpInterpretedRecords)
throws org.apache.poi.util.RecordFormatException {
- List<Record> temp = new ArrayList<Record>();
+ List<Record> temp = new ArrayList<>();
RecordInputStream recStream = new RecordInputStream(is);
while (true) {
_hexDumpWriter = hexDumpWriter;
_zeroAlignEachRecord = zeroAlignEachRecord;
_noHeader = noHeader;
- _headers = new ArrayList<String>();
+ _headers = new ArrayList<>();
}
@Override
}
public List<String> getRecentHeaders() {
List<String> result = _headers;
- _headers = new ArrayList<String>();
+ _headers = new ArrayList<>();
return result;
}
private static String formatRecordDetails(int globalOffset, int sid, int size, int recordCounter) {
*/
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs,
BoundSheetRecord[] bounds, SSTRecord sst) {
- List<Record> wbRecords = new ArrayList<Record>();
+ List<Record> wbRecords = new ArrayList<>();
// Core Workbook records go first
if(bounds != null) {
*/
public static class SheetRecordCollectingListener implements HSSFListener {
private final HSSFListener childListener;
- private final List<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>();
- private final List<ExternSheetRecord> externSheetRecords = new ArrayList<ExternSheetRecord>();
+ private final List<BoundSheetRecord> boundSheetRecords = new ArrayList<>();
+ private final List<ExternSheetRecord> externSheetRecords = new ArrayList<>();
private SSTRecord sstRecord;
public SheetRecordCollectingListener(HSSFListener childListener) {
private final HSSFListener _childListener;
private final HSSFDataFormatter _formatter;
private final NumberFormat _defaultFormat;
- private final Map<Integer, FormatRecord> _customFormatRecords = new HashMap<Integer, FormatRecord>();
- private final List<ExtendedFormatRecord> _xfRecords = new ArrayList<ExtendedFormatRecord>();
+ private final Map<Integer, FormatRecord> _customFormatRecords = new HashMap<>();
+ private final List<ExtendedFormatRecord> _xfRecords = new ArrayList<>();
/**
* Creates a format tracking wrapper around the given listener, using
/** Creates a new instance of HSSFRequest */
public HSSFRequest() {
- _records = new HashMap<Short, List<HSSFListener>>(50); // most folks won't listen for too many of these
+ _records = new HashMap<>(50); // most folks won't listen for too many of these
}
/**
List<HSSFListener> list = _records.get(Short.valueOf(sid));
if (list == null) {
- list = new ArrayList<HSSFListener>(1); // probably most people will use one listener
+ list = new ArrayList<>(1); // probably most people will use one listener
_records.put(Short.valueOf(sid), list);
}
list.add(lsnr);
private int nextRow = -1;
public TextListener() {
- sheetNames = new ArrayList<String>();
+ sheetNames = new ArrayList<>();
}
public void processRecord(Record record) {
String thisText = null;
*/
public class DrawingManager2 {
private final EscherDggRecord dgg;
- private final List<EscherDgRecord> drawingGroups = new ArrayList<EscherDgRecord>();
+ private final List<EscherDgRecord> drawingGroups = new ArrayList<>();
public DrawingManager2( EscherDggRecord dgg ) {
_mergedCellsTable = new MergedCellsTable();
RowRecordsAggregate rra = null;
- List<RecordBase> records = new ArrayList<RecordBase>(128);
+ List<RecordBase> records = new ArrayList<>(128);
_records = records; // needed here due to calls to findFirstRecordLocBySid before we're done
int dimsloc = -1;
* @return the cloned sheet
*/
public InternalSheet cloneSheet() {
- List<Record> clonedRecords = new ArrayList<Record>(_records.size());
+ List<Record> clonedRecords = new ArrayList<>(_records.size());
for (int i = 0; i < _records.size(); i++) {
RecordBase rb = _records.get(i);
if (rb instanceof RecordAggregate) {
}
private InternalSheet() {
_mergedCellsTable = new MergedCellsTable();
- List<RecordBase> records = new ArrayList<RecordBase>(32);
+ List<RecordBase> records = new ArrayList<>(32);
if (log.check( POILogger.DEBUG ))
log.log(POILogger.DEBUG, "Sheet createsheet from scratch called");
* @return never <code>null</code>, typically empty array
*/
public NoteRecord[] getNoteRecords() {
- List<NoteRecord> temp = new ArrayList<NoteRecord>();
+ List<NoteRecord> temp = new ArrayList<>();
for(int i=_records.size()-1; i>=0; i--) {
RecordBase rec = _records.get(i);
if (rec instanceof NoteRecord) {
private InternalWorkbook() {
records = new WorkbookRecordList();
- boundsheets = new ArrayList<BoundSheetRecord>();
- formats = new ArrayList<FormatRecord>();
- hyperlinks = new ArrayList<HyperlinkRecord>();
+ boundsheets = new ArrayList<>();
+ formats = new ArrayList<>();
+ hyperlinks = new ArrayList<>();
numxfs = 0;
numfonts = 0;
maxformatid = -1;
uses1904datewindowing = false;
- escherBSERecords = new ArrayList<EscherBSERecord>();
- commentRecords = new LinkedHashMap<String, NameCommentRecord>();
+ escherBSERecords = new ArrayList<>();
+ commentRecords = new LinkedHashMap<>();
}
/**
public static InternalWorkbook createWorkbook(List<Record> recs) {
LOG.log(DEBUG, "Workbook (readfile) created with reclen=", recs.size());
InternalWorkbook retval = new InternalWorkbook();
- List<Record> records = new ArrayList<Record>(recs.size() / 3);
+ List<Record> records = new ArrayList<>(recs.size() / 3);
retval.records.setRecords(records);
boolean eofPassed = false;
LOG.log( DEBUG, "creating new workbook from scratch" );
InternalWorkbook retval = new InternalWorkbook();
- List<Record> records = new ArrayList<Record>( 30 );
+ List<Record> records = new ArrayList<>(30);
retval.records.setRecords(records);
List<FormatRecord> formats = retval.formats;
public ExternalBookBlock(RecordStream rs) {
_externalBookRecord = (SupBookRecord) rs.getNext();
- List<Object> temp = new ArrayList<Object>();
+ List<Object> temp = new ArrayList<>();
while(rs.peekNextClass() == ExternalNameRecord.class) {
temp.add(rs.getNext());
}
_workbookRecordList = workbookRecordList;
RecordStream rs = new RecordStream(inputList, startIndex);
- List<ExternalBookBlock> temp = new ArrayList<ExternalBookBlock>();
+ List<ExternalBookBlock> temp = new ArrayList<>();
while(rs.peekNextClass() == SupBookRecord.class) {
temp.add(new ExternalBookBlock(rs));
}
_externSheetRecord = null;
}
- _definedNames = new ArrayList<NameRecord>();
+ _definedNames = new ArrayList<>();
// collect zero or more DEFINEDNAMEs id=0x18,
// with their comments if present
while(true) {
}
private static ExternSheetRecord readExtSheetRecord(RecordStream rs) {
- List<ExternSheetRecord> temp = new ArrayList<ExternSheetRecord>(2);
+ List<ExternSheetRecord> temp = new ArrayList<>(2);
while(rs.peekNextClass() == ExternSheetRecord.class) {
temp.add((ExternSheetRecord) rs.getNext());
}
public LinkTable(int numberOfSheets, WorkbookRecordList workbookRecordList) {
_workbookRecordList = workbookRecordList;
- _definedNames = new ArrayList<NameRecord>();
+ _definedNames = new ArrayList<>();
_externalBookBlocks = new ExternalBookBlock[] {
new ExternalBookBlock(numberOfSheets),
};
* @param rs the record stream
*/
public RowBlocksReader(RecordStream rs) {
- List<Record> plainRecords = new ArrayList<Record>();
- List<Record> shFrmRecords = new ArrayList<Record>();
- List<CellReference> firstCellRefs = new ArrayList<CellReference>();
- List<Record> arrayRecords = new ArrayList<Record>();
- List<Record> tableRecords = new ArrayList<Record>();
- List<Record> mergeCellRecords = new ArrayList<Record>();
+ List<Record> plainRecords = new ArrayList<>();
+ List<Record> shFrmRecords = new ArrayList<>();
+ List<CellReference> firstCellRefs = new ArrayList<>();
+ List<Record> arrayRecords = new ArrayList<>();
+ List<Record> tableRecords = new ArrayList<>();
+ List<Record> mergeCellRecords = new ArrayList<>();
Record prevRec = null;
while(!RecordOrderer.isEndOfRowBlock(rs.peekNextSid())) {
import org.apache.poi.hssf.record.Record;
public final class WorkbookRecordList {
- private List<Record> records = new ArrayList<Record>();
+ private List<Record> records = new ArrayList<>();
/** holds the position of the protect record */
private int protpos;
public AbstractEscherHolderRecord()
{
- escherRecords = new ArrayList<EscherRecord>();
+ escherRecords = new ArrayList<>();
}
public AbstractEscherHolderRecord(RecordInputStream in)
{
- escherRecords = new ArrayList<EscherRecord>();
+ escherRecords = new ArrayList<>();
if (! DESERIALISE ) {
rawDataContainer.concatenate(in.readRemainder());
} else {
/**
* Maps shape container objects to their {@link TextObjectRecord} or {@link ObjRecord}
*/
- private final Map<EscherRecord, Record> shapeToObj = new HashMap<EscherRecord, Record>();
+ private final Map<EscherRecord, Record> shapeToObj = new HashMap<>();
/**
* list of "tail" records that need to be serialized after all drawing group records
*/
- private final Map<Integer, NoteRecord> tailRec = new LinkedHashMap<Integer, NoteRecord>();
+ private final Map<Integer, NoteRecord> tailRec = new LinkedHashMap<>();
/**
* create new EscherAggregate
public static EscherAggregate createAggregate(List<RecordBase> records, int locFirstDrawingRecord) {
// Keep track of any shape records created so we can match them back to the object id's.
// Textbox objects are also treated as shape objects.
- final List<EscherRecord> shapeRecords = new ArrayList<EscherRecord>();
+ final List<EscherRecord> shapeRecords = new ArrayList<>();
EscherRecordFactory recordFactory = new DefaultEscherRecordFactory() {
public EscherRecord createRecord(byte[] data, int offset) {
EscherRecord r = super.createRecord(data, offset);
byte[] buffer = new byte[size];
// Serialize escher records into one big data structure and keep note of ending offsets.
- final List <Integer>spEndingOffsets = new ArrayList<Integer>();
- final List <EscherRecord> shapes = new ArrayList<EscherRecord>();
+ final List <Integer>spEndingOffsets = new ArrayList<>();
+ final List <EscherRecord> shapes = new ArrayList<>();
int pos = 0;
for (Object record : records) {
EscherRecord e = (EscherRecord) record;
List<EscherRecord> records = getEscherRecords();
int rawEscherSize = getEscherRecordSize(records);
byte[] buffer = new byte[rawEscherSize];
- final List<Integer> spEndingOffsets = new ArrayList<Integer>();
+ final List<Integer> spEndingOffsets = new ArrayList<>();
int pos = 0;
for (EscherRecord e : records) {
pos += e.serialize(pos, buffer, new EscherSerializationListener() {
_stringsPerBucket = in.readShort();
int nInfos = in.remaining() / InfoSubRecord.ENCODED_SIZE;
- ArrayList<InfoSubRecord> lst = new ArrayList<InfoSubRecord>(nInfos);
+ ArrayList<InfoSubRecord> lst = new ArrayList<>(nInfos);
while (in.available() > 0) {
InfoSubRecord info = new InfoSubRecord(in);
public ExternSheetRecord() {
- _list = new ArrayList<RefSubRecord>();
+ _list = new ArrayList<>();
}
public ExternSheetRecord(RecordInputStream in) {
- _list = new ArrayList<RefSubRecord>();
+ _list = new ArrayList<>();
int nItems = in.readShort();
public ObjRecord() {
- subrecords = new ArrayList<SubRecord>(2);
+ subrecords = new ArrayList<>(2);
// TODO - ensure 2 sub-records (ftCmo 15h, and ftEnd 00h) are always created
_uninterpretedData = null;
}
}
*/
- subrecords = new ArrayList<SubRecord>();
+ subrecords = new ArrayList<>();
ByteArrayInputStream bais = new ByteArrayInputStream(subRecordData);
LittleEndianInputStream subRecStream = new LittleEndianInputStream(bais);
CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)SubRecord.createSubRecord(subRecStream, 0);
}
protected PageBreakRecord() {
- _breaks = new ArrayList<Break>();
- _breakMap = new HashMap<Integer, Break>();
+ _breaks = new ArrayList<>();
+ _breakMap = new HashMap<>();
}
public PageBreakRecord(RecordInputStream in)
{
int nBreaks = in.readShort();
- _breaks = new ArrayList<Break>(nBreaks + 2);
- _breakMap = new HashMap<Integer, Break>();
+ _breaks = new ArrayList<>(nBreaks + 2);
+ _breakMap = new HashMap<>();
for(int k = 0; k < nBreaks; k++) {
Break br = new Break(in);
public PaletteRecord() {
PColor[] defaultPalette = createDefaultPalette();
- _colors = new ArrayList<PColor>(defaultPalette.length);
+ _colors = new ArrayList<>(defaultPalette.length);
for (PColor element : defaultPalette) {
_colors.add(element);
}
public PaletteRecord(RecordInputStream in) {
int field_1_numcolors = in.readShort();
- _colors = new ArrayList<PColor>(field_1_numcolors);
+ _colors = new ArrayList<>(field_1_numcolors);
for (int k = 0; k < field_1_numcolors; k++) {
_colors.add(new PColor(in));
}
* most of org.apache.poi.hssf.record.*
*/
private static Map<Integer, I_RecordCreator> recordsToMap(Class<? extends Record> [] records) {
- Map<Integer, I_RecordCreator> result = new HashMap<Integer, I_RecordCreator>();
- Set<Class<?>> uniqueRecClasses = new HashSet<Class<?>>(records.length * 3 / 2);
+ Map<Integer, I_RecordCreator> result = new HashMap<>();
+ Set<Class<?>> uniqueRecClasses = new HashSet<>(records.length * 3 / 2);
for (Class<? extends Record> recClass : records) {
if(!Record.class.isAssignableFrom(recClass)) {
*/
public static List<Record> createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException {
- List<Record> records = new ArrayList<Record>(NUM_RECORDS);
+ List<Record> records = new ArrayList<>(NUM_RECORDS);
RecordFactoryInputStream recStream = new RecordFactoryInputStream(in, true);
*/
public RecordFactoryInputStream(InputStream in, boolean shouldIncludeContinueRecords) {
RecordInputStream rs = new RecordInputStream(in);
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
StreamEncryptionInfo sei = new StreamEncryptionInfo(rs, records);
if (sei.hasEncryption()) {
rs = sei.createDecryptingStream(in);
{
field_1_num_strings = 0;
field_2_num_unique_strings = 0;
- field_3_strings = new IntMapper<UnicodeString>();
+ field_3_strings = new IntMapper<>();
deserializer = new SSTDeserializer(field_3_strings);
}
// we initialize our fields
field_1_num_strings = in.readInt();
field_2_num_unique_strings = in.readInt();
- field_3_strings = new IntMapper<UnicodeString>();
+ field_3_strings = new IntMapper<>();
deserializer = new SSTDeserializer(field_3_strings);
// Bug 57456: some Excel Sheets send 0 as field=1, but have some random number in field_2,
throw new RecordFormatException("Mismatch number of rules");
}
header = pHeader;
- rules = new ArrayList<CFRuleBase>(pRules.length);
+ rules = new ArrayList<>(pRules.length);
for (CFRuleBase pRule : pRules) {
checkRuleType(pRule);
rules.add(pRule);
public boolean updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx) {
CellRangeAddress[] cellRanges = header.getCellRanges();
boolean changed = false;
- List<CellRangeAddress> temp = new ArrayList<CellRangeAddress>();
+ List<CellRangeAddress> temp = new ArrayList<>();
for (CellRangeAddress craOld : cellRanges) {
CellRangeAddress craNew = shiftRange(shifter, craOld, currentExternSheetIx);
if (craNew == null) {
public ChartSubstreamRecordAggregate(RecordStream rs) {
_bofRec = (BOFRecord) rs.getNext();
- List<RecordBase> temp = new ArrayList<RecordBase>();
+ List<RecordBase> temp = new ArrayList<>();
while (rs.peekNextClass() != EOFRecord.class) {
if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) {
if (_psBlock != null) {
* Creates an empty aggregate
*/
public ColumnInfoRecordsAggregate() {
- records = new ArrayList<ColumnInfoRecord>();
+ records = new ArrayList<>();
}
public ColumnInfoRecordsAggregate(RecordStream rs) {
this();
* Creates an empty ConditionalFormattingTable
*/
public ConditionalFormattingTable() {
- _cfHeaders = new ArrayList<CFRecordsAggregate>();
+ _cfHeaders = new ArrayList<>();
}
public ConditionalFormattingTable(RecordStream rs) {
- List<CFRecordsAggregate> temp = new ArrayList<CFRecordsAggregate>();
+ List<CFRecordsAggregate> temp = new ArrayList<>();
while (rs.peekNextClass() == CFHeaderRecord.class ||
rs.peekNextClass() == CFHeader12Record.class) {
temp.add(CFRecordsAggregate.createCFAggregate(rs));
if (_begin.getSid() != UserSViewBegin.sid) {
throw new IllegalStateException("Bad begin record");
}
- List<RecordBase> temp = new ArrayList<RecordBase>();
+ List<RecordBase> temp = new ArrayList<>();
while (rs.peekNextSid() != UserSViewEnd.sid) {
if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) {
if (_psBlock != null) {
public DataValidityTable(RecordStream rs) {
_headerRec = (DVALRecord) rs.getNext();
- List<DVRecord> temp = new ArrayList<DVRecord>();
+ List<DVRecord> temp = new ArrayList<>();
while (rs.peekNextClass() == DVRecord.class) {
temp.add((DVRecord) rs.getNext());
}
public DataValidityTable() {
_headerRec = new DVALRecord();
- _validationList = new ArrayList<DVRecord>();
+ _validationList = new ArrayList<>();
}
public void visitContainedRecords(RecordVisitor rv) {
* Creates an empty aggregate
*/
public MergedCellsTable() {
- _mergedRegions = new ArrayList<CellRangeAddress>();
+ _mergedRegions = new ArrayList<>();
}
/**
public PLSAggregate(RecordStream rs) {
_pls = rs.getNext();
if (rs.peekNextSid()==ContinueRecord.sid) {
- List<ContinueRecord> temp = new ArrayList<ContinueRecord>();
+ List<ContinueRecord> temp = new ArrayList<>();
while (rs.peekNextSid()==ContinueRecord.sid) {
temp.add((ContinueRecord)rs.getNext());
}
* The indicator of such records is a non-zero GUID,
* see {@link org.apache.poi.hssf.record.HeaderFooterRecord#getGuid()}
*/
- private final List<HeaderFooterRecord> _sviewHeaderFooters = new ArrayList<HeaderFooterRecord>();
+ private final List<HeaderFooterRecord> _sviewHeaderFooters = new ArrayList<>();
private Record _printSize;
public PageSettingsBlock(RecordStream rs) {
- _plsRecords = new ArrayList<PLSAggregate>();
+ _plsRecords = new ArrayList<>();
while(true) {
if (!readARecord(rs)) {
break;
* Creates a PageSettingsBlock with default settings
*/
public PageSettingsBlock() {
- _plsRecords = new ArrayList<PLSAggregate>();
+ _plsRecords = new ArrayList<>();
_rowBreaksRecord = new HorizontalPageBreakRecord();
_columnBreaksRecord = new VerticalPageBreakRecord();
_header = new HeaderRecord("");
private static void shiftBreaks(PageBreakRecord breaks, int start, int stop, int count) {
Iterator<PageBreakRecord.Break> iterator = breaks.getBreaksIterator();
- List<PageBreakRecord.Break> shiftedBreak = new ArrayList<PageBreakRecord.Break>();
+ List<PageBreakRecord.Break> shiftedBreak = new ArrayList<>();
while(iterator.hasNext())
{
PageBreakRecord.Break breakItem = iterator.next();
public void positionRecords(List<RecordBase> sheetRecords) {
// Take a copy to loop over, so we can update the real one
// without concurrency issues
- List<HeaderFooterRecord> hfRecordsToIterate = new ArrayList<HeaderFooterRecord>(_sviewHeaderFooters);
+ List<HeaderFooterRecord> hfRecordsToIterate = new ArrayList<>(_sviewHeaderFooters);
- final Map<String, HeaderFooterRecord> hfGuidMap = new HashMap<String, HeaderFooterRecord>();
+ final Map<String, HeaderFooterRecord> hfGuidMap = new HashMap<>();
for(final HeaderFooterRecord hf : hfRecordsToIterate) {
hfGuidMap.put(HexDump.toHex(hf.getGuid()), hf);
if (svm == null) {
throw new IllegalArgumentException("SharedValueManager must be provided.");
}
- _rowRecords = new TreeMap<Integer, RowRecord>();
+ _rowRecords = new TreeMap<>();
_valuesAgg = new ValueRecordsAggregate();
- _unknownRecords = new ArrayList<Record>();
+ _unknownRecords = new ArrayList<>();
_sharedValueManager = svm;
}
}
_arrayRecords = toList(arrayRecords);
_tableRecords = tableRecords;
- Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<SharedFormulaRecord, SharedFormulaGroup>(nShF * 3 / 2);
+ Map<SharedFormulaRecord, SharedFormulaGroup> m = new HashMap<>(nShF * 3 / 2);
for (int i = 0; i < nShF; i++) {
SharedFormulaRecord sfr = sharedFormulaRecords[i];
m.put(sfr, new SharedFormulaGroup(sfr, firstCells[i]));
* @return a modifiable list, independent of the supplied array
*/
private static <Z> List<Z> toList(Z[] zz) {
- List<Z> result = new ArrayList<Z>(zz.length);
+ List<Z> result = new ArrayList<>(zz.length);
for (int i = 0; i < zz.length; i++) {
result.add(zz[i]);
}
private SharedFormulaGroup findFormulaGroupForCell(final CellReference cellRef) {
if(null == _groupsCache) {
- _groupsCache = new HashMap<Integer,SharedFormulaGroup>(_groupsBySharedFormulaRecord.size());
+ _groupsCache = new HashMap<>(_groupsBySharedFormulaRecord.size());
for(SharedFormulaGroup group: _groupsBySharedFormulaRecord.values()) {
_groupsCache.put(getKeyForCache(group._firstCell),group);
}
field_3_string = (isCompressed) ? in.readCompressedUnicode(cc) : in.readUnicodeLEString(cc);
if (isRichText() && (runCount > 0)) {
- field_4_format_runs = new ArrayList<FormatRun>(runCount);
+ field_4_format_runs = new ArrayList<>(runCount);
for (int i=0;i<runCount;i++) {
field_4_format_runs.add(new FormatRun(in));
}
*/
public void addFormatRun(FormatRun r) {
if (field_4_format_runs == null) {
- field_4_format_runs = new ArrayList<FormatRun>();
+ field_4_format_runs = new ArrayList<>();
}
int index = findFormatRunAt(r._character);
str.field_2_optionflags = field_2_optionflags;
str.field_3_string = field_3_string;
if (field_4_format_runs != null) {
- str.field_4_format_runs = new ArrayList<FormatRun>();
+ str.field_4_format_runs = new ArrayList<>();
for (FormatRun r : field_4_format_runs) {
str.field_4_format_runs.add(new FormatRun(r._character, r._fontIndex));
}
* using a {@link ThreadLocal} in order to avoid further overloading the various public APIs
* (e.g. {@link HSSFWorkbook}) that need this functionality.
*/
- private static final ThreadLocal<String> _userPasswordTLS = new ThreadLocal<String>();
+ private static final ThreadLocal<String> _userPasswordTLS = new ThreadLocal<>();
/**
* Sets the BIFF8 encryption/decryption password for the current thread.
{
private String _fontName;
private int _height;
- private final Map<Character, Integer> charWidths = new HashMap<Character, Integer>();
+ private final Map<Character, Integer> charWidths = new HashMap<>();
/**
* Construct the font details with the given name and height.
return Short.MIN_VALUE;
}
};
- private static final ThreadLocal<List<FormatRecord>> lastFormats = new ThreadLocal<List<FormatRecord>>();
- private static final ThreadLocal<String> getDataFormatStringCache = new ThreadLocal<String>();
+ private static final ThreadLocal<List<FormatRecord>> lastFormats = new ThreadLocal<>();
+ private static final ThreadLocal<String> getDataFormatStringCache = new ThreadLocal<>();
/**
* Get the contents of the format string, by looking up
public final class HSSFDataFormat implements DataFormat {
private static final String[] _builtinFormats = BuiltinFormats.getAll();
- private final Vector<String> _formats = new Vector<String>();
+ private final Vector<String> _formats = new Vector<>();
private final InternalWorkbook _workbook;
private boolean _movedBuiltins; // Flag to see if need to
// check the built in list
// the new locations of the fonts
// Remember that one underlying unicode string
// may be shared by multiple RichTextStrings!
- HashSet<UnicodeString> doneUnicodeStrings = new HashSet<UnicodeString>();
+ HashSet<UnicodeString> doneUnicodeStrings = new HashSet<>();
for(int sheetNum=0; sheetNum<workbook.getNumberOfSheets(); sheetNum++) {
HSSFSheet s = workbook.getSheetAt(sheetNum);
for (Row row : s) {
*/
public final class HSSFPatriarch implements HSSFShapeContainer, Drawing<HSSFShape> {
// private static POILogger log = POILogFactory.getLogger(HSSFPatriarch.class);
- private final List<HSSFShape> _shapes = new ArrayList<HSSFShape>();
+ private final List<HSSFShape> _shapes = new ArrayList<>();
private final EscherSpgrRecord _spgrRecord;
private final EscherContainerRecord _mainSpgrContainer;
/**
* contains coordinates of comments we iterate over
*/
- Set<String> coordinates = new HashSet<String>(tailRecords.size());
+ Set<String> coordinates = new HashSet<>(tailRecords.size());
for(NoteRecord rec : tailRecords.values()){
String noteRef = new CellReference(rec.getRow(),
rec.getColumn()).formatAsString(); // A1-style notation
*/
@Override
public void clear() {
- ArrayList <HSSFShape> copy = new ArrayList<HSSFShape>(_shapes);
+ ArrayList <HSSFShape> copy = new ArrayList<>(_shapes);
for (HSSFShape shape: copy){
removeShape(shape);
}
* sheet.
*/
public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
- private final List<HSSFShape> shapes = new ArrayList<HSSFShape>();
+ private final List<HSSFShape> shapes = new ArrayList<>();
private EscherSpgrRecord _spgrRecord;
public HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord) {
}
public void clear() {
- ArrayList <HSSFShape> copy = new ArrayList<HSSFShape>(shapes);
+ ArrayList <HSSFShape> copy = new ArrayList<>(shapes);
for (HSSFShape shape: copy){
removeShape(shape);
}
*/
protected HSSFSheet(HSSFWorkbook workbook) {
_sheet = InternalSheet.createSheet();
- _rows = new TreeMap<Integer, HSSFRow>();
+ _rows = new TreeMap<>();
this._workbook = workbook;
this._book = workbook.getWorkbook();
}
*/
protected HSSFSheet(HSSFWorkbook workbook, InternalSheet sheet) {
this._sheet = sheet;
- _rows = new TreeMap<Integer, HSSFRow>();
+ _rows = new TreeMap<>();
this._workbook = workbook;
this._book = workbook.getWorkbook();
setPropertiesFromSheet(sheet);
@Override
public List<HSSFDataValidation> getDataValidations() {
DataValidityTable dvt = _sheet.getOrCreateDataValidityTable();
- final List<HSSFDataValidation> hssfValidations = new ArrayList<HSSFDataValidation>();
+ final List<HSSFDataValidation> hssfValidations = new ArrayList<>();
RecordVisitor visitor = new RecordVisitor() {
private HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(getWorkbook());
*/
@Override
public void removeMergedRegions(Collection<Integer> indices) {
- for (int i : (new TreeSet<Integer>(indices)).descendingSet()) {
+ for (int i : (new TreeSet<>(indices)).descendingSet()) {
_sheet.removeMergedRegion(i);
}
}
*/
@Override
public List<CellRangeAddress> getMergedRegions() {
- List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>();
+ List<CellRangeAddress> addresses = new ArrayList<>();
int count = _sheet.getNumMergedRegions();
for (int i=0; i < count; i++) {
addresses.add(_sheet.getMergedRegionAt(i));
*/
@Override
public List<HSSFHyperlink> getHyperlinkList() {
- final List<HSSFHyperlink> hyperlinkList = new ArrayList<HSSFHyperlink>();
+ final List<HSSFHyperlink> hyperlinkList = new ArrayList<>();
for (RecordBase rec : _sheet.getRecords()) {
if (rec instanceof HyperlinkRecord) {
HyperlinkRecord link = (HyperlinkRecord) rec;
int lastColumn = range.getLastColumn();
int height = lastRow - firstRow + 1;
int width = lastColumn - firstColumn + 1;
- List<HSSFCell> temp = new ArrayList<HSSFCell>(height * width);
+ List<HSSFCell> temp = new ArrayList<>(height * width);
for (int rowIn = firstRow; rowIn <= lastRow; rowIn++) {
for (int colIn = firstColumn; colIn <= lastColumn; colIn++) {
HSSFRow row = getRow(rowIn);
patriarch = createDrawingPatriarch();
}
- Map<CellAddress, HSSFComment> locations = new TreeMap<CellAddress, HSSFComment>();
+ Map<CellAddress, HSSFComment> locations = new TreeMap<>();
findCellCommentLocations(patriarch, locations);
return locations;
}
NameRecord.BUILTIN_PRINT_TITLE, sheetIndex);
}
- List<Ptg> ptgList = new ArrayList<Ptg>();
+ List<Ptg> ptgList = new ArrayList<>();
if (setBoth) {
final int exprsSize = 2 * 11 + 1; // 2 * Area3DPtg.SIZE + UnionPtg.SIZE
ptgList.add(new MemFuncPtg(exprsSize));
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);
}
/**
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.
* @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);
}
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);
* @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);
*/
@Override
public Iterator<Sheet> sheetIterator() {
- return new SheetIterator<Sheet>();
+ return new SheetIterator<>();
}
/**
@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
* and that's not something you should normally do
*/
protected void resetFontCache() {
- fonts = new HashMap<Short, HSSFFont>();
+ fonts = new HashMap<>();
}
/**
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");
public SheetRecordCollector() {
_totalSize = 0;
- _list = new ArrayList<Record>(128);
+ _list = new ArrayList<>(128);
}
public int getTotalSize() {
return _totalSize;
@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);
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();
}
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);
*/
public List<HSSFObjectData> getAllEmbeddedObjects()
{
- List<HSSFObjectData> objects = new ArrayList<HSSFObjectData>();
+ List<HSSFObjectData> objects = new ArrayList<>();
for (HSSFSheet sheet : _sheets)
{
getAllEmbeddedObjects(sheet, objects);
/** The font metrics property file we're using */
private static Properties fontMetricsProps;
/** Our cache of font details we've already looked up */
- private static final Map<String, FontDetails> fontDetailsMap = new HashMap<String, FontDetails>();
+ private static final Map<String, FontDetails> fontDetailsMap = new HashMap<>();
private StaticFontMetrics() {}
private static Map<Integer,HSSFColor> createColorsByIndexMap() {
Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass();
- Map<Integer,HSSFColor> result = new HashMap<Integer,HSSFColor>(eList.size() * 3 / 2);
+ Map<Integer,HSSFColor> result = new HashMap<>(eList.size() * 3 / 2);
for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) {
Integer index1 = (int)colorRef.getKey().getIndex();
private static Map<String,HSSFColor> createColorsByHexStringMap() {
Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass();
- Map<String,HSSFColor> result = new HashMap<String,HSSFColor>(eList.size());
+ Map<String,HSSFColor> result = new HashMap<>(eList.size());
for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) {
String hexString = colorRef.getKey().getHexString();
@Removal(version="3.18")
private static synchronized Map<HSSFColorPredefined,HSSFColor> mapEnumToColorClass() {
if (enumList == null) {
- enumList = new EnumMap<HSSFColorPredefined,HSSFColor>(HSSFColorPredefined.class);
+ enumList = new EnumMap<>(HSSFColorPredefined.class);
// AUTOMATIC is not add to list
addHSSFColorPredefined(HSSFColorPredefined.BLACK);
addHSSFColorPredefined(HSSFColorPredefined.BROWN);
* a large amount of time.
*/
public class LazilyConcatenatedByteArray {
- private final List<byte[]> arrays = new ArrayList<byte[]>(1);
+ private final List<byte[]> arrays = new ArrayList<>(1);
/**
* Clears the array (sets the concatenated length back to zero.
byte buf[] = new byte[8];
bos.write(buf, 0, 8); // skip header
- List<StreamDescriptorEntry> descList = new ArrayList<StreamDescriptorEntry>();
+ List<StreamDescriptorEntry> descList = new ArrayList<>();
int block = 0;
for (Entry entry : entries.getRoot()) {
final int indentLevel,
final String indentString)
{
- List<String> objects = new ArrayList<String>();
+ List<String> objects = new ArrayList<>();
if (viewable instanceof POIFSViewable)
{
POIFSReaderRegistry()
{
- omnivorousListeners = new HashSet<POIFSReaderListener>();
- selectiveListeners = new HashMap<POIFSReaderListener, Set<DocumentDescriptor>>();
- chosenDocumentDescriptors = new HashMap<DocumentDescriptor,Set<POIFSReaderListener>>();
+ omnivorousListeners = new HashSet<>();
+ selectiveListeners = new HashMap<>();
+ chosenDocumentDescriptors = new HashMap<>();
}
/**
{
// this listener has not registered before
- descriptors = new HashSet<DocumentDescriptor>();
+ descriptors = new HashSet<>();
selectiveListeners.put(listener, descriptors);
}
DocumentDescriptor descriptor = new DocumentDescriptor(path,
{
// nobody was listening for this document before
- listeners = new HashSet<POIFSReaderListener>();
+ listeners = new HashSet<>();
chosenDocumentDescriptors.put(descriptor, listeners);
}
listeners.add(listener);
Iterator<POIFSReaderListener> getListeners(final POIFSDocumentPath path, final String name)
{
- Set<POIFSReaderListener> rval = new HashSet<POIFSReaderListener>(omnivorousListeners);
+ Set<POIFSReaderListener> rval = new HashSet<>(omnivorousListeners);
Set<POIFSReaderListener> selectiveListenersInner =
chosenDocumentDescriptors.get(new DocumentDescriptor(path, name));
property.getName()
});
}
- _byname = new HashMap<String, Entry>();
- _entries = new ArrayList<Entry>();
+ _byname = new HashMap<>();
+ _entries = new ArrayList<>();
Iterator<Property> iter = property.getChildren();
while (iter.hasNext())
*/
public Iterator<Object> getViewableIterator()
{
- List<Object> components = new ArrayList<Object>();
+ List<Object> components = new ArrayList<>();
components.add(getProperty());
Iterator<Entry> iter = _entries.iterator();
public Iterator<Object> getViewableIterator()
{
- List<Object> components = new ArrayList<Object>();
+ List<Object> components = new ArrayList<>();
components.add(getProperty());
if (_document != null) {
}
// Next, check entries and their types/sizes
- Map<String,Integer> aSizes = new HashMap<String, Integer>();
+ Map<String,Integer> aSizes = new HashMap<>();
final int isDirectory = -12345;
for (Entry a : dirA) {
String aName = a.getName();
this.directory = directory;
// Process the excludes
- this.excludes = new HashSet<String>();
- this.childExcludes = new HashMap<String, List<String>>();
+ this.excludes = new HashSet<>();
+ this.childExcludes = new HashMap<>();
for (String excl : excludes) {
int splitAt = excl.indexOf('/');
if (splitAt == -1) {
String child = excl.substring(0, splitAt);
String childExcl = excl.substring(splitAt+1);
if (! this.childExcludes.containsKey(child)) {
- this.childExcludes.put(child, new ArrayList<String>());
+ this.childExcludes.put(child, new ArrayList<>());
}
this.childExcludes.get(child).add(childExcl);
}
}
public Set<String> getEntryNames() {
- Set<String> names = new HashSet<String>();
+ Set<String> names = new HashSet<>();
for (String name : directory.getEntryNames()) {
if (!excludes.contains(name)) {
names.add(name);
{
_header = new HeaderBlock(bigBlockSize);
_property_table = new NPropertyTable(_header);
- _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<BATBlock>(), _header);
- _xbat_blocks = new ArrayList<BATBlock>();
- _bat_blocks = new ArrayList<BATBlock>();
+ _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<>(), _header);
+ _xbat_blocks = new ArrayList<>();
+ _bat_blocks = new ArrayList<>();
_root = null;
if(newFS) {
// Finally read the Small Stream FAT (SBAT) blocks
BATBlock sfat;
- List<BATBlock> sbats = new ArrayList<BATBlock>();
+ List<BATBlock> sbats = new ArrayList<>();
_mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), sbats, _header);
nextAt = _header.getSBATStart();
for(int i=0; i<_header.getSBATCount() && nextAt != POIFSConstants.END_OF_CHAIN; i++) {
* @param stream the InputStream we read data from
*/
public OPOIFSDocument(String name, POIFSBigBlockSize bigBlockSize, InputStream stream) throws IOException {
- List<DocumentBlock> blocks = new ArrayList<DocumentBlock>();
+ List<DocumentBlock> blocks = new ArrayList<>();
_size = 0;
_bigBigBlockSize = bigBlockSize;
{
HeaderBlock header_block = new HeaderBlock(bigBlockSize);
_property_table = new PropertyTable(header_block);
- _documents = new ArrayList<OPOIFSDocument>();
+ _documents = new ArrayList<>();
_root = null;
}
// create a list of BATManaged objects: the documents plus the
// property table and the small block table
- List<Object> bm_objects = new ArrayList<Object>();
+ List<Object> bm_objects = new ArrayList<>();
bm_objects.addAll(_documents);
bm_objects.add(_property_table);
// property table, the small block store, the small block
// allocation table, the block allocation table, and the
// extended block allocation table blocks)
- List<Object> writers = new ArrayList<Object>();
+ List<Object> writers = new ArrayList<>();
writers.add(header_block_writer);
writers.addAll(_documents);
final ModuleMap modules = new ModuleMap();
findMacros(fs.getRoot(), modules);
- Map<String, String> moduleSources = new HashMap<String, String>();
+ Map<String, String> moduleSources = new HashMap<>();
for (Map.Entry<String, Module> entry : modules.entrySet()) {
Module module = entry.getValue();
if (module.buf != null && module.buf.length > 0) { // Skip empty modules
// See https://bz.apache.org/bugzilla/show_bug.cgi?id=58480,
// http://stackoverflow.com/questions/3602783/file-access-synchronized-on-java-object and
// http://bugs.java.com/view_bug.do?bug_id=4724038 for related discussions
- private List<ByteBuffer> buffersToClean = new ArrayList<ByteBuffer>();
+ private List<ByteBuffer> buffersToClean = new ArrayList<>();
public FileBackedDataSource(File file) throws FileNotFoundException {
this(newSrcFile(file, "r"), true);
public DirectoryProperty(String name)
{
super();
- _children = new ArrayList<Property>();
- _children_names = new HashSet<String>();
+ _children = new ArrayList<>();
+ _children_names = new HashSet<>();
setName(name);
setSize(0);
setPropertyType(PropertyConstants.DIRECTORY_TYPE);
final int offset)
{
super(index, array, offset);
- _children = new ArrayList<Property>();
- _children_names = new HashSet<String>();
+ _children = new ArrayList<>();
+ _children_names = new HashSet<>();
}
/**
private static List<Property> buildProperties(final Iterator<ByteBuffer> dataSource,
final POIFSBigBlockSize bigBlockSize) throws IOException
{
- List<Property> properties = new ArrayList<Property>();
+ List<Property> properties = new ArrayList<>();
while(dataSource.hasNext()) {
ByteBuffer bb = dataSource.next();
* Prepare to be written
*/
public void preWrite() {
- List<Property> pList = new ArrayList<Property>();
+ List<Property> pList = new ArrayList<>();
// give each property its index
int i=0;
for (Property p : _properties) {
static List<Property> convertToProperties(ListManagedBlock [] blocks)
throws IOException
{
- List<Property> properties = new ArrayList<Property>();
+ List<Property> properties = new ArrayList<>();
for (ListManagedBlock block : blocks) {
byte[] data = block.getData();
public PropertyTableBase(final HeaderBlock header_block)
{
_header_block = header_block;
- _properties = new ArrayList<Property>();
+ _properties = new ArrayList<>();
addProperty(new RootProperty());
}
// property has no children
return;
}
- Stack<Property> children = new Stack<Property>();
+ Stack<Property> children = new Stack<>();
children.push(_properties.get(index));
while (!children.empty())
*/
ListManagedBlock[] fetchBlocks(int startBlock, int headerPropertiesStartBlock,
BlockList blockList) throws IOException {
- List<ListManagedBlock> blocks = new ArrayList<ListManagedBlock>();
+ List<ListManagedBlock> blocks = new ArrayList<>();
int currentBlock = startBlock;
boolean firstPass = true;
ListManagedBlock dataBlock = null;
public RawDataBlockList(final InputStream stream, POIFSBigBlockSize bigBlockSize)
throws IOException
{
- List<RawDataBlock> blocks = new ArrayList<RawDataBlock>();
+ List<RawDataBlock> blocks = new ArrayList<>();
while (true)
{
final RootProperty root)
{
_sbat = new BlockAllocationTableWriter(bigBlockSize);
- _small_blocks = new ArrayList<SmallDocumentBlock>();
+ _small_blocks = new ArrayList<>();
_root = root;
for (OPOIFSDocument doc : documents)
{
int _blocks_per_big_block = getBlocksPerBigBlock(bigBlockSize);
- List<SmallDocumentBlock> sdbs = new ArrayList<SmallDocumentBlock>();
+ List<SmallDocumentBlock> sdbs = new ArrayList<>();
for (int j = 0; j < blocks.length; j++)
{
import org.apache.poi.util.JvmBugs;
public class DrawFactory {
- protected static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<DrawFactory>();
+ protected static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<>();
/**
* Set a custom draw factory for the current thread.
@SuppressWarnings("unchecked")
Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(Drawable.FONT_MAP);
if (fontMap == null) {
- fontMap = new HashMap<String,String>();
+ fontMap = new HashMap<>();
graphics.setRenderingHint(Drawable.FONT_MAP, fontMap);
}
}
protected Collection<Outline> computeOutlines(Graphics2D graphics) {
- List<Outline> lst = new ArrayList<Outline>();
+ List<Outline> lst = new ArrayList<>();
FreeformShape<?,?> fsh = (FreeformShape<?, ?>) getShape();
Path2D sh = fsh.getPath();
}
graphics.setPaint(line);
- List<Outline> lst = new ArrayList<Outline>();
+ List<Outline> lst = new ArrayList<>();
LineDecoration deco = getShape().getLineDecoration();
Outline head = getHeadDecoration(graphics, deco, stroke);
if (head != null) {
: (Map<String, CustomGeometry>)graphics.getRenderingHint(Drawable.PRESET_GEOMETRY_CACHE);
if (presets == null) {
- presets = new HashMap<String,CustomGeometry>();
+ presets = new HashMap<>();
if (graphics != null) {
graphics.setRenderingHint(Drawable.PRESET_GEOMETRY_CACHE, presets);
}
protected Collection<Outline> computeOutlines(Graphics2D graphics) {
final SimpleShape<?,?> sh = getShape();
- List<Outline> lst = new ArrayList<Outline>();
+ List<Outline> lst = new ArrayList<>();
CustomGeometry geom = sh.getGeometry();
if(geom == null) {
return lst;
protected TextParagraph<?,?,?> paragraph;
double x, y;
- protected List<DrawTextFragment> lines = new ArrayList<DrawTextFragment>();
+ protected List<DrawTextFragment> lines = new ArrayList<>();
protected String rawText;
protected DrawTextFragment bullet;
protected int autoNbrIdx;
}
protected AttributedString getAttributedString(Graphics2D graphics, StringBuilder text){
- List<AttributedStringData> attList = new ArrayList<AttributedStringData>();
+ List<AttributedStringData> attList = new ArrayList<>();
if (text == null) {
text = new StringBuilder();
}
*/
public List<Object> getAhXYOrAhPolar() {
if (ahXYOrAhPolar == null) {
- ahXYOrAhPolar = new ArrayList<Object>();
+ ahXYOrAhPolar = new ArrayList<>();
}
return this.ahXYOrAhPolar;
}
*/
public List<Object> getEGColorChoice() {
if (egColorChoice == null) {
- egColorChoice = new ArrayList<Object>();
+ egColorChoice = new ArrayList<>();
}
return this.egColorChoice;
}
*/
public List<CTConnectionSite> getCxn() {
if (cxn == null) {
- cxn = new ArrayList<CTConnectionSite>();
+ cxn = new ArrayList<>();
}
return this.cxn;
}
*/
public List<CTGeomGuide> getGd() {
if (gd == null) {
- gd = new ArrayList<CTGeomGuide>();
+ gd = new ArrayList<>();
}
return this.gd;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
public List<CTOfficeArtExtension> getExt() {
if (ext == null) {
- ext = new ArrayList<CTOfficeArtExtension>();
+ ext = new ArrayList<>();
}
return this.ext;
}
*/
public List<Object> getCloseOrMoveToOrLnTo() {
if (closeOrMoveToOrLnTo == null) {
- closeOrMoveToOrLnTo = new ArrayList<Object>();
+ closeOrMoveToOrLnTo = new ArrayList<>();
}
return this.closeOrMoveToOrLnTo;
}
*/
public List<CTAdjPoint2D> getPt() {
if (pt == null) {
- pt = new ArrayList<CTAdjPoint2D>();
+ pt = new ArrayList<>();
}
return this.pt;
}
*/
public List<CTPath2D> getPath() {
if (path == null) {
- path = new ArrayList<CTPath2D>();
+ path = new ArrayList<>();
}
return this.path;
}
*/
public List<CTAdjPoint2D> getPt() {
if (pt == null) {
- pt = new ArrayList<CTAdjPoint2D>();
+ pt = new ArrayList<>();
}
return this.pt;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
public List<JAXBElement<?>> getEGColorTransform() {
if (egColorTransform == null) {
- egColorTransform = new ArrayList<JAXBElement<?>>();
+ egColorTransform = new ArrayList<>();
}
return this.egColorTransform;
}
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSRgbColor.class)
public JAXBElement<CTGammaTransform> createCTSRgbColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSRgbColor.class)
public JAXBElement<CTInverseGammaTransform> createCTSRgbColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSRgbColor.class)
public JAXBElement<CTPositivePercentage> createCTSRgbColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSRgbColor.class)
public JAXBElement<CTFixedPercentage> createCTSRgbColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSRgbColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTSRgbColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSRgbColor.class)
public JAXBElement<CTAngle> createCTSRgbColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSRgbColor.class)
public JAXBElement<CTInverseTransform> createCTSRgbColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSRgbColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSRgbColor.class)
public JAXBElement<CTComplementTransform> createCTSRgbColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSRgbColor.class)
public JAXBElement<CTPercentage> createCTSRgbColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSRgbColor.class)
public JAXBElement<CTPositivePercentage> createCTSRgbColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSRgbColor.class)
public JAXBElement<CTGrayscaleTransform> createCTSRgbColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSystemColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSystemColor.class)
public JAXBElement<CTGammaTransform> createCTSystemColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSystemColor.class)
public JAXBElement<CTInverseGammaTransform> createCTSystemColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSystemColor.class)
public JAXBElement<CTPositivePercentage> createCTSystemColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSystemColor.class)
public JAXBElement<CTFixedPercentage> createCTSystemColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSystemColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTSystemColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSystemColor.class)
public JAXBElement<CTAngle> createCTSystemColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSystemColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSystemColor.class)
public JAXBElement<CTInverseTransform> createCTSystemColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSystemColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSystemColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSystemColor.class)
public JAXBElement<CTComplementTransform> createCTSystemColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSystemColor.class)
public JAXBElement<CTPercentage> createCTSystemColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSystemColor.class)
public JAXBElement<CTPositivePercentage> createCTSystemColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSystemColor.class)
public JAXBElement<CTGrayscaleTransform> createCTSystemColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSystemColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSystemColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSchemeColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSchemeColor.class)
public JAXBElement<CTGammaTransform> createCTSchemeColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSchemeColor.class)
public JAXBElement<CTInverseGammaTransform> createCTSchemeColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSchemeColor.class)
public JAXBElement<CTPositivePercentage> createCTSchemeColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSchemeColor.class)
public JAXBElement<CTFixedPercentage> createCTSchemeColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSchemeColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTSchemeColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSchemeColor.class)
public JAXBElement<CTAngle> createCTSchemeColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSchemeColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSchemeColor.class)
public JAXBElement<CTInverseTransform> createCTSchemeColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSchemeColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTSchemeColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSchemeColor.class)
public JAXBElement<CTComplementTransform> createCTSchemeColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSchemeColor.class)
public JAXBElement<CTPercentage> createCTSchemeColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSchemeColor.class)
public JAXBElement<CTPositivePercentage> createCTSchemeColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSchemeColor.class)
public JAXBElement<CTGrayscaleTransform> createCTSchemeColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSchemeColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTSchemeColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTScRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTScRgbColor.class)
public JAXBElement<CTGammaTransform> createCTScRgbColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTScRgbColor.class)
public JAXBElement<CTInverseGammaTransform> createCTScRgbColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTScRgbColor.class)
public JAXBElement<CTPositivePercentage> createCTScRgbColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTScRgbColor.class)
public JAXBElement<CTFixedPercentage> createCTScRgbColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTScRgbColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTScRgbColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTScRgbColor.class)
public JAXBElement<CTAngle> createCTScRgbColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTScRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTScRgbColor.class)
public JAXBElement<CTInverseTransform> createCTScRgbColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTScRgbColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTScRgbColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTScRgbColor.class)
public JAXBElement<CTComplementTransform> createCTScRgbColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTScRgbColor.class)
public JAXBElement<CTPercentage> createCTScRgbColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTScRgbColor.class)
public JAXBElement<CTPositivePercentage> createCTScRgbColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTScRgbColor.class)
public JAXBElement<CTGrayscaleTransform> createCTScRgbColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTScRgbColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTScRgbColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTHslColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTHslColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTHslColor.class)
public JAXBElement<CTGammaTransform> createCTHslColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTHslColor.class)
public JAXBElement<CTInverseGammaTransform> createCTHslColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTHslColor.class)
public JAXBElement<CTPositivePercentage> createCTHslColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTHslColor.class)
public JAXBElement<CTFixedPercentage> createCTHslColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTHslColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTHslColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTHslColor.class)
public JAXBElement<CTAngle> createCTHslColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTHslColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTHslColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTHslColor.class)
public JAXBElement<CTInverseTransform> createCTHslColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTHslColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTHslColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTHslColor.class)
public JAXBElement<CTComplementTransform> createCTHslColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTHslColor.class)
public JAXBElement<CTPercentage> createCTHslColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTHslColor.class)
public JAXBElement<CTPositivePercentage> createCTHslColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTHslColor.class)
public JAXBElement<CTGrayscaleTransform> createCTHslColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTHslColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTHslColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorLum(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLum_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTPresetColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorAlpha(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTPresetColor.class)
public JAXBElement<CTGammaTransform> createCTPresetColorGamma(CTGammaTransform value) {
- return new JAXBElement<CTGammaTransform>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGamma_QNAME, CTGammaTransform.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTPresetColor.class)
public JAXBElement<CTInverseGammaTransform> createCTPresetColorInvGamma(CTInverseGammaTransform value) {
- return new JAXBElement<CTInverseGammaTransform>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInvGamma_QNAME, CTInverseGammaTransform.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorRedOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTPresetColor.class)
public JAXBElement<CTPositivePercentage> createCTPresetColorAlphaMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTPresetColor.class)
public JAXBElement<CTFixedPercentage> createCTPresetColorAlphaOff(CTFixedPercentage value) {
- return new JAXBElement<CTFixedPercentage>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorAlphaOff_QNAME, CTFixedPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorGreenOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTPresetColor.class)
public JAXBElement<CTPositiveFixedAngle> createCTPresetColorHue(CTPositiveFixedAngle value) {
- return new JAXBElement<CTPositiveFixedAngle>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHue_QNAME, CTPositiveFixedAngle.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorRedMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRedMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorSatOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorGreenMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreenMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorBlue(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlue_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorSat(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSat_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorRed(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorRed_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorSatMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorSatMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorBlueMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTPresetColor.class)
public JAXBElement<CTAngle> createCTPresetColorHueOff(CTAngle value) {
- return new JAXBElement<CTAngle>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueOff_QNAME, CTAngle.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTPresetColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorShade(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorShade_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorLumMod(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumMod_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTPresetColor.class)
public JAXBElement<CTInverseTransform> createCTPresetColorInv(CTInverseTransform value) {
- return new JAXBElement<CTInverseTransform>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorInv_QNAME, CTInverseTransform.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorLumOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorLumOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTPresetColor.class)
public JAXBElement<CTPositiveFixedPercentage> createCTPresetColorTint(CTPositiveFixedPercentage value) {
- return new JAXBElement<CTPositiveFixedPercentage>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorTint_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorGreen(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGreen_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTPresetColor.class)
public JAXBElement<CTComplementTransform> createCTPresetColorComp(CTComplementTransform value) {
- return new JAXBElement<CTComplementTransform>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorComp_QNAME, CTComplementTransform.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTPresetColor.class)
public JAXBElement<CTPercentage> createCTPresetColorBlueOff(CTPercentage value) {
- return new JAXBElement<CTPercentage>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorBlueOff_QNAME, CTPercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTPresetColor.class)
public JAXBElement<CTPositivePercentage> createCTPresetColorHueMod(CTPositivePercentage value) {
- return new JAXBElement<CTPositivePercentage>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorHueMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value);
}
/**
*/
@XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTPresetColor.class)
public JAXBElement<CTGrayscaleTransform> createCTPresetColorGray(CTGrayscaleTransform value) {
- return new JAXBElement<CTGrayscaleTransform>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTPresetColor.class, value);
+ return new JAXBElement<>(_CTSRgbColorGray_QNAME, CTGrayscaleTransform.class, CTPresetColor.class, value);
}
}
import java.util.Map;
public class Context {
- final Map<String, Double> _ctx = new HashMap<String, Double>();
+ final Map<String, Double> _ctx = new HashMap<>();
final IAdjustableShape _props;
final Rectangle2D _anchor;
* Definition of a custom geometric shape
*/
public class CustomGeometry implements Iterable<Path>{
- final List<Guide> adjusts = new ArrayList<Guide>();
- final List<Guide> guides = new ArrayList<Guide>();
- final List<Path> paths = new ArrayList<Path>();
+ final List<Guide> adjusts = new ArrayList<>();
+ final List<Guide> guides = new ArrayList<>();
+ final List<Path> paths = new ArrayList<>();
Path textBounds;
public CustomGeometry(CTCustomGeometry2D geom) {
}
public Path(boolean fill, boolean stroke){
- commands = new ArrayList<PathCommand>();
+ commands = new ArrayList<>();
_w = -1;
_h = -1;
_fill = (fill) ? PaintModifier.NORM : PaintModifier.NONE;
_w = spPath.isSetW() ? spPath.getW() : -1;
_h = spPath.isSetH() ? spPath.getH() : -1;
- commands = new ArrayList<PathCommand>();
+ commands = new ArrayList<>();
for(Object ch : spPath.getCloseOrMoveToOrLnTo()){
if(ch instanceof CTPath2DMoveTo){
private static final Map<String,PresetColor> lookupOoxmlId;
static {
- lookupOoxmlId = new HashMap<String,PresetColor>();
+ lookupOoxmlId = new HashMap<>();
for(PresetColor pc : PresetColor.values()) {
if (pc.ooxmlId != null) {
lookupOoxmlId.put(pc.ooxmlId, pc);
public CellElapsedFormatter(String pattern) {
super(pattern);
- specs = new ArrayList<TimeSpec>();
+ specs = new ArrayList<>();
StringBuffer desc = CellFormatPart.parseFormat(pattern,
CellFormatType.ELAPSED, new ElapsedPartHandler());
/** Maps a format string to its parsed version for efficiencies sake. */
private static final Map<Locale, Map<String, CellFormat>> formatCache =
- new WeakHashMap<Locale, Map<String, CellFormat>>();
+ new WeakHashMap<>();
/**
* Returns a {@link CellFormat} that applies the given format. Two calls
public static synchronized CellFormat getInstance(Locale locale, String format) {
Map<String, CellFormat> formatMap = formatCache.get(locale);
if (formatMap == null) {
- formatMap = new WeakHashMap<String, CellFormat>();
+ formatMap = new WeakHashMap<>();
formatCache.put(locale, formatMap);
}
CellFormat fmt = formatMap.get(format);
this.format = format;
CellFormatPart defaultTextFormat = new CellFormatPart(locale, "@");
Matcher m = ONE_PART.matcher(format);
- List<CellFormatPart> parts = new ArrayList<CellFormatPart>();
+ List<CellFormatPart> parts = new ArrayList<>();
while (m.find()) {
try {
private static final Map<String, Integer> TESTS;
static {
- TESTS = new HashMap<String, Integer>();
+ TESTS = new HashMap<>();
TESTS.put("<", LT);
TESTS.put("<=", LE);
TESTS.put(">", GT);
private static final Map<String, Color> NAMED_COLORS;
static {
- NAMED_COLORS = new TreeMap<String, Color>(
+ NAMED_COLORS = new TreeMap<>(
String.CASE_INSENSITIVE_ORDER);
Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
private final Special afterInteger;
private final Special afterFractional;
private final boolean showGroupingSeparator;
- private final List<Special> specials = new ArrayList<Special>();
- private final List<Special> integerSpecials = new ArrayList<Special>();
- private final List<Special> fractionalSpecials = new ArrayList<Special>();
- private final List<Special> numeratorSpecials = new ArrayList<Special>();
- private final List<Special> denominatorSpecials = new ArrayList<Special>();
- private final List<Special> exponentSpecials = new ArrayList<Special>();
- private final List<Special> exponentDigitSpecials = new ArrayList<Special>();
+ private final List<Special> specials = new ArrayList<>();
+ private final List<Special> integerSpecials = new ArrayList<>();
+ private final List<Special> fractionalSpecials = new ArrayList<>();
+ private final List<Special> numeratorSpecials = new ArrayList<>();
+ private final List<Special> denominatorSpecials = new ArrayList<>();
+ private final List<Special> exponentSpecials = new ArrayList<>();
+ private final List<Special> exponentDigitSpecials = new ArrayList<>();
private final int maxDenominator;
private final String numeratorFmt;
private final String denominatorFmt;
}
}
- Set<CellNumberStringMod> mods = new TreeSet<CellNumberStringMod>();
+ Set<CellNumberStringMod> mods = new TreeSet<>();
StringBuffer output = new StringBuffer(localiseFormat(desc));
if (exponent != null) {
private Special slash;
private Special exponent;
private Special numerator;
- private final List<Special> specials = new LinkedList<Special>();
+ private final List<Special> specials = new LinkedList<>();
private boolean improperFraction;
public String handlePart(Matcher m, String part, CellFormatType type, StringBuffer descBuf) {
public CellEvaluationFrame(FormulaCellCacheEntry cce) {
_cce = cce;
- _sensitiveInputCells = new HashSet<CellCacheEntry>();
+ _sensitiveInputCells = new HashSet<>();
}
public CellCacheEntry getCCE() {
return _cce;
new CollaboratingWorkbooksEnvironment(evaluatorsByName, evaluators);
}
public static void setupFormulaEvaluator(Map<String,FormulaEvaluator> evaluators) {
- Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<String, WorkbookEvaluator>(evaluators.size());
+ Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<>(evaluators.size());
for (Map.Entry<String,FormulaEvaluator> swb : evaluators.entrySet()) {
String wbName = swb.getKey();
FormulaEvaluator eval = swb.getValue();
this(toUniqueMap(workbookNames, evaluators, nItems), evaluators);
}
private static Map<String, WorkbookEvaluator> toUniqueMap(String[] workbookNames, WorkbookEvaluator[] evaluators, int nItems) {
- Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<String, WorkbookEvaluator>(nItems * 3 / 2);
+ Map<String, WorkbookEvaluator> evaluatorsByName = new HashMap<>(nItems * 3 / 2);
for(int i=0; i<nItems; i++) {
String wbName = workbookNames[i];
WorkbookEvaluator wbEval = evaluators[i];
return evaluatorsByName;
}
private CollaboratingWorkbooksEnvironment(Map<String, WorkbookEvaluator> evaluatorsByName, WorkbookEvaluator[] evaluators) {
- IdentityHashMap<WorkbookEvaluator, String> uniqueEvals = new IdentityHashMap<WorkbookEvaluator, String>(evaluators.length);
+ IdentityHashMap<WorkbookEvaluator, String> uniqueEvals = new IdentityHashMap<>(evaluators.length);
for (Map.Entry<String, WorkbookEvaluator> me : evaluatorsByName.entrySet()) {
String uniEval = uniqueEvals.put(me.getValue(), me.getKey());
if (uniEval != null) {
* Completely dismantles all workbook environments that the supplied evaluators are part of
*/
private void unhookOldEnvironments(WorkbookEvaluator[] evaluators) {
- Set<CollaboratingWorkbooksEnvironment> oldEnvs = new HashSet<CollaboratingWorkbooksEnvironment>();
+ Set<CollaboratingWorkbooksEnvironment> oldEnvs = new HashSet<>();
for(int i=0; i<evaluators.length; i++) {
oldEnvs.add(evaluators[i].getEnvironment());
}
* there's no guarantee instances won't be recreated on the fly by some implementation.
* So we use sheet name.
*/
- private final Map<String, List<EvaluationConditionalFormatRule>> formats = new HashMap<String, List<EvaluationConditionalFormatRule>>();
+ private final Map<String, List<EvaluationConditionalFormatRule>> formats = new HashMap<>();
/**
* Evaluating rules for cells in their region(s) is expensive, so we want to cache them,
* <p>
* CellReference implements equals().
*/
- private final Map<CellReference, List<EvaluationConditionalFormatRule>> values = new HashMap<CellReference, List<EvaluationConditionalFormatRule>>();
+ private final Map<CellReference, List<EvaluationConditionalFormatRule>> values = new HashMap<>();
public ConditionalFormattingEvaluator(Workbook wb, WorkbookEvaluatorProvider provider) {
this.workbook = wb;
}
final SheetConditionalFormatting scf = sheet.getSheetConditionalFormatting();
final int count = scf.getNumConditionalFormattings();
- rules = new ArrayList<EvaluationConditionalFormatRule>(count);
+ rules = new ArrayList<>(count);
formats.put(sheetName, rules);
for (int i=0; i < count; i++) {
ConditionalFormatting f = scf.getConditionalFormattingAt(i);
if (rules == null) {
// compute and cache them
- rules = new ArrayList<EvaluationConditionalFormatRule>();
+ rules = new ArrayList<>();
Sheet sheet = null;
if (cellRef.getSheetName() != null) sheet = workbook.getSheet(cellRef.getSheetName());
* @return unmodifiable List of all cells in the rule's region matching the rule's condition
*/
public List<Cell> getMatchingCells(EvaluationConditionalFormatRule rule) {
- final List<Cell> cells = new ArrayList<Cell>();
+ final List<Cell> cells = new ArrayList<>();
final Sheet sheet = rule.getSheet();
for (CellRangeAddress region : rule.getRegions()) {
* there's no guarantee instances won't be recreated on the fly by some implementation.
* So we use sheet name.
*/
- private final Map<String, List<? extends DataValidation>> validations = new HashMap<String, List<? extends DataValidation>>();
+ private final Map<String, List<? extends DataValidation>> validations = new HashMap<>();
private final Workbook workbook;
private final WorkbookEvaluator workbookEvaluator;
String formula = val.getFormula1();
- final List<ValueEval> values = new ArrayList<ValueEval>();
+ final List<ValueEval> values = new ArrayList<>();
if (val.getExplicitListValues() != null && val.getExplicitListValues().length > 0) {
// assumes parsing interprets the overloaded property right for XSSF
* Depending on the rule type, it may want to know about certain values in the region when evaluating {@link #matches(Cell)},
* such as top 10, unique, duplicate, average, etc. This collection stores those if needed so they are not repeatedly calculated
*/
- private final Map<CellRangeAddress, Set<ValueAndFormat>> meaningfulRegionValues = new HashMap<CellRangeAddress, Set<ValueAndFormat>>();
+ private final Map<CellRangeAddress, Set<ValueAndFormat>> meaningfulRegionValues = new HashMap<>();
private final int priority;
private final int formattingIndex;
limit = allValues.size() * limit / 100;
}
if (allValues.size() <= limit) {
- return new HashSet<ValueAndFormat>(allValues);
+ return new HashSet<>(allValues);
}
- return new HashSet<ValueAndFormat>(allValues.subList(0, limit));
+ return new HashSet<>(allValues.subList(0, limit));
}
}).contains(cv);
case UNIQUE_VALUES:
List<ValueAndFormat> values = allValues;
Collections.sort(values);
- final Set<ValueAndFormat> unique = new HashSet<ValueAndFormat>();
+ final Set<ValueAndFormat> unique = new HashSet<>();
for (int i=0; i < values.size(); i++) {
final ValueAndFormat v = values.get(i);
List<ValueAndFormat> values = allValues;
Collections.sort(values);
- final Set<ValueAndFormat> dup = new HashSet<ValueAndFormat>();
+ final Set<ValueAndFormat> dup = new HashSet<>();
for (int i=0; i < values.size(); i++) {
final ValueAndFormat v = values.get(i);
final ConditionFilterData conf = rule.getFilterConfiguration();
// actually ordered, so iteration order is predictable
- List<ValueAndFormat> values = new ArrayList<ValueAndFormat>(getMeaningfulValues(region, false, new ValueFunction() {
+ List<ValueAndFormat> values = new ArrayList<>(getMeaningfulValues(region, false, new ValueFunction() {
@Override
public Set<ValueAndFormat> evaluate(List<ValueAndFormat> allValues) {
List<ValueAndFormat> values = allValues;
double total = 0;
ValueEval[] pop = new ValueEval[values.size()];
- for (int i=0; i < values.size(); i++) {
+ for (int i = 0; i < values.size(); i++) {
ValueAndFormat v = values.get(i);
total += v.value.doubleValue();
pop[i] = new NumberEval(v.value.doubleValue());
}
-
- final Set<ValueAndFormat> avgSet = new LinkedHashSet<ValueAndFormat>(1);
+
+ final Set<ValueAndFormat> avgSet = new LinkedHashSet<>(1);
avgSet.add(new ValueAndFormat(new Double(values.size() == 0 ? 0 : total / values.size()), null));
-
+
final double stdDev = values.size() <= 1 ? 0 : ((NumberEval) AggregateFunction.STDEV.evaluate(pop, 0, 0)).getNumberValue();
avgSet.add(new ValueAndFormat(new Double(stdDev), null));
return avgSet;
return values;
}
- List<ValueAndFormat> allValues = new ArrayList<ValueAndFormat>((region.getLastColumn() - region.getFirstColumn()+1) * (region.getLastRow() - region.getFirstRow() + 1));
+ List<ValueAndFormat> allValues = new ArrayList<>((region.getLastColumn() - region.getFirstColumn() + 1) * (region.getLastRow() - region.getFirstRow() + 1));
for (int r=region.getFirstRow(); r <= region.getLastRow(); r++) {
final Row row = sheet.getRow(r);
public EvaluationTracker(EvaluationCache cache) {
_cache = cache;
- _evaluationFrames = new ArrayList<CellEvaluationFrame>();
- _currentlyEvaluatingCells = new HashSet<FormulaCellCacheEntry>();
+ _evaluationFrames = new ArrayList<>();
+ _currentlyEvaluatingCells = new HashSet<>();
}
/**
public FormulaCellCache() {
// assumes the object returned by EvaluationCell.getIdentityKey() has a well behaved hashCode+equals
- _formulaEntriesByCell = new HashMap<Object, FormulaCellCacheEntry>();
+ _formulaEntriesByCell = new HashMap<>();
}
public CellCacheEntry[] getCacheEntries() {
if (nUsed < 1) {
usedSet = Collections.emptySet();
} else {
- usedSet = new HashSet<CellCacheEntry>(nUsed * 3 / 2);
+ usedSet = new HashSet<>(nUsed * 3 / 2);
for (int i = 0; i < nUsed; i++) {
usedSet.add(usedCells[i]);
}
/** get arguments to a function */
private ParseNode[] Arguments() {
//average 2 args per function
- List<ParseNode> temp = new ArrayList<ParseNode>(2);
+ List<ParseNode> temp = new ArrayList<>(2);
SkipWhite();
if(look == ')') {
return ParseNode.EMPTY_ARRAY;
}
private ParseNode parseArray() {
- List<Object[]> rowsData = new ArrayList<Object[]>();
+ List<Object[]> rowsData = new ArrayList<>();
while(true) {
Object[] singleRowData = parseArrayRow();
rowsData.add(singleRowData);
}
private Object[] parseArrayRow() {
- List<Object> temp = new ArrayList<Object>();
+ List<Object> temp = new ArrayList<>();
while (true) {
temp.add(parseArrayItem());
SkipWhite();
if (ptgs == null || ptgs.length == 0) {
throw new IllegalArgumentException("ptgs must not be null");
}
- Stack<String> stack = new Stack<String>();
+ Stack<String> stack = new Stack<>();
for (Ptg ptg : ptgs) {
// TODO - what about MemNoMemPtg?
private BlankCellRectangleGroup _currentRectangleGroup;
public BlankCellSheetGroup() {
- _rectangleGroups = new ArrayList<BlankCellRectangleGroup>();
+ _rectangleGroups = new ArrayList<>();
_currentRowIndex = -1;
}
private final Map<BookSheetKey, BlankCellSheetGroup> _sheetGroupsByBookSheet;
public FormulaUsedBlankCellSet() {
- _sheetGroupsByBookSheet = new HashMap<BookSheetKey, BlankCellSheetGroup>();
+ _sheetGroupsByBookSheet = new HashMap<>();
}
public void addCell(int bookIndex, int sheetIndex, int rowIndex, int columnIndex) {
}
private static Map<OperationPtg, Function> initialiseInstancesMap() {
- Map<OperationPtg, Function> m = new HashMap<OperationPtg, Function>(32);
+ Map<OperationPtg, Function> m = new HashMap<>(32);
put(m, EqualPtg.instance, RelationalOperationEval.EqualEval);
put(m, GreaterEqualPtg.instance, RelationalOperationEval.GreaterEqualEval);
private Map<Loc, PlainValueCellCacheEntry> _plainValueEntriesByLoc;
public PlainCellCache() {
- _plainValueEntriesByLoc = new HashMap<Loc, PlainValueCellCacheEntry>();
+ _plainValueEntriesByLoc = new HashMap<>();
}
public void put(Loc key, PlainValueCellCacheEntry cce) {
_plainValueEntriesByLoc.put(key, cce);
_workbook = workbook;
_evaluationListener = evaluationListener;
_cache = new EvaluationCache(evaluationListener);
- _sheetIndexesBySheet = new IdentityHashMap<EvaluationSheet, Integer>();
- _sheetIndexesByName = new IdentityHashMap<String, Integer>();
+ _sheetIndexesBySheet = new IdentityHashMap<>();
+ _sheetIndexesByName = new IdentityHashMap<>();
_collaboratingWorkbookEnvironment = CollaboratingWorkbooksEnvironment.EMPTY;
_workbookIx = 0;
_stabilityClassifier = stabilityClassifier;
dbgEvaluationOutputIndent++;
}
- Stack<ValueEval> stack = new Stack<ValueEval>();
+ Stack<ValueEval> stack = new Stack<>();
for (int i = 0, iSize = ptgs.length; i < iSize; i++) {
// since we don't know how to handle these yet :(
Ptg ptg = ptgs[i];
* @return names of functions supported by POI
*/
public static Collection<String> getSupportedFunctionNames(){
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
lst.addAll(FunctionEval.getSupportedFunctionNames());
lst.addAll(AnalysisToolPak.getSupportedFunctionNames());
return Collections.unmodifiableCollection(lst);
* @return names of functions NOT supported by POI
*/
public static Collection<String> getNotSupportedFunctionNames(){
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
lst.addAll(FunctionEval.getNotSupportedFunctionNames());
lst.addAll(AnalysisToolPak.getNotSupportedFunctionNames());
return Collections.unmodifiableCollection(lst);
}
private Map<String, FreeRefFunction> createFunctionsMap() {
- Map<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(108);
+ Map<String, FreeRefFunction> m = new HashMap<>(108);
r(m, "ACCRINT", null);
r(m, "ACCRINTM", null);
*/
public static Collection<String> getSupportedFunctionNames(){
AnalysisToolPak inst = (AnalysisToolPak)instance;
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
for(Map.Entry<String, FreeRefFunction> me : inst._functionsByName.entrySet()){
FreeRefFunction func = me.getValue();
if(func != null && !(func instanceof NotImplemented)){
*/
public static Collection<String> getNotSupportedFunctionNames(){
AnalysisToolPak inst = (AnalysisToolPak)instance;
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
for(Map.Entry<String, FreeRefFunction> me : inst._functionsByName.entrySet()){
FreeRefFunction func = me.getValue();
if (func instanceof NotImplemented) {
if (arg instanceof StringEval) {
return new double[]{ evaluateDateArg(arg, srcCellRow, srcCellCol) };
} else if (arg instanceof AreaEvalBase) {
- List<Double> valuesList = new ArrayList<Double>();
+ List<Double> valuesList = new ArrayList<>();
AreaEvalBase area = (AreaEvalBase) arg;
for (int i = area.getFirstRow(); i <= area.getLastRow(); i++) {
for (int j = area.getFirstColumn(); j <= area.getLastColumn(); j++) {
* Evaluations for formula errors
*/
public final class ErrorEval implements ValueEval {
- private static final Map<FormulaError,ErrorEval> evals = new HashMap<FormulaError, ErrorEval>();
+ private static final Map<FormulaError,ErrorEval> evals = new HashMap<>();
/** <b>#NULL!</b> - Intersection of two cell ranges is empty */
public static final ErrorEval NULL_INTERSECTION = new ErrorEval(FormulaError.NULL);
* @since 3.8 beta6
*/
public static Collection<String> getSupportedFunctionNames() {
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
for (int i = 0; i < functions.length; i++) {
Function func = functions[i];
FunctionMetadata metaData = FunctionMetadataRegistry.getFunctionByIndex(i);
* @since 3.8 beta6
*/
public static Collection<String> getNotSupportedFunctionNames() {
- Collection<String> lst = new TreeSet<String>();
+ Collection<String> lst = new TreeSet<>();
for (int i = 0; i < functions.length; i++) {
Function func = functions[i];
if (func != null && (func instanceof NotImplementedFunction)) {
* Handling of a list of values, e.g. the 2nd argument in RANK(A1,(B1,B2,B3),1)
*/
public class RefListEval implements ValueEval {
- private final List<ValueEval> list = new ArrayList<ValueEval>();
+ private final List<ValueEval> list = new ArrayList<>();
public RefListEval(ValueEval v1, ValueEval v2) {
add(v1);
public ForkedEvaluationSheet(EvaluationSheet masterSheet) {
_masterSheet = masterSheet;
- _sharedCellsByRowCol = new HashMap<RowColKey, ForkedEvaluationCell>();
+ _sharedCellsByRowCol = new HashMap<>();
}
@Override
public ForkedEvaluationWorkbook(EvaluationWorkbook master) {
_masterBook = master;
- _sharedSheetsByName = new HashMap<String, ForkedEvaluationSheet>();
+ _sharedSheetsByName = new HashMap<>();
}
public ForkedEvaluationCell getOrCreateUpdatableCell(String sheetName, int rowIndex,
public FunctionDataBuilder(int sizeEstimate) {
_maxFunctionIndex = -1;
- _functionDataByName = new HashMap<String,FunctionMetadata>(sizeEstimate * 3 / 2);
- _functionDataByIndex = new HashMap<Integer,FunctionMetadata>(sizeEstimate * 3 / 2);
- _mutatingFunctionIndexes = new HashSet<Integer>();
+ _functionDataByName = new HashMap<>(sizeEstimate * 3 / 2);
+ _functionDataByIndex = new HashMap<>(sizeEstimate * 3 / 2);
+ _mutatingFunctionIndexes = new HashSet<>();
}
public void add(int functionIndex, String functionName, int minParams, int maxParams,
// except in these cases
"LOG10", "ATAN2", "DAYS360", "SUMXMY2", "SUMX2MY2", "SUMX2PY2",
};
- private static final Set<String> DIGIT_ENDING_FUNCTION_NAMES_SET = new HashSet<String>(Arrays.asList(DIGIT_ENDING_FUNCTION_NAMES));
+ private static final Set<String> DIGIT_ENDING_FUNCTION_NAMES_SET = new HashSet<>(Arrays.asList(DIGIT_ENDING_FUNCTION_NAMES));
public static FunctionMetadataRegistry createRegistry() {
try {
public static final FreeRefFunction instance = new FactDouble();
//Caching of previously calculated factorial for speed
- static HashMap<Integer, BigInteger> cache = new HashMap<Integer, BigInteger>();
+ static HashMap<Integer, BigInteger> cache = new HashMap<>();
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval numberVE) {
int number;
public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) {
double result;
try {
- List<Double> temp = new ArrayList<Double>();
+ List<Double> temp = new ArrayList<>();
for (int i = 0; i < args.length; i++) {
collectValues(args[i], temp);
}
}
// ignore the first arg, this is the function-type, we check for the length above
- final List<ValueEval> list = new ArrayList<ValueEval>(Arrays.asList(args).subList(1, args.length));
+ final List<ValueEval> list = new ArrayList<>(Arrays.asList(args).subList(1, args.length));
Iterator<ValueEval> it = list.iterator();
* Extra data (beyond <tt>size</tt>) may be read if and <tt>ArrayPtg</tt>s are present.
*/
public static Ptg[] readTokens(int size, LittleEndianInput in) {
- List<Ptg> temp = new ArrayList<Ptg>(4 + size / 2);
+ List<Ptg> temp = new ArrayList<>(4 + size / 2);
int pos = 0;
boolean hasArrayPtgs = false;
while (pos < size) {
ptg.write(out);
if (ptg instanceof ArrayPtg) {
if (arrayPtgs == null) {
- arrayPtgs = new ArrayList<Ptg>(5);
+ arrayPtgs = new ArrayList<>(5);
}
arrayPtgs.add(ptg);
}
private final Collection<UDFFinder> _usedToolPacks;
public AggregatingUDFFinder(UDFFinder ... usedToolPacks) {
- _usedToolPacks = new ArrayList<UDFFinder>(usedToolPacks.length);
+ _usedToolPacks = new ArrayList<>(usedToolPacks.length);
_usedToolPacks.addAll(Arrays.asList(usedToolPacks));
}
throw new IllegalArgumentException(
"Mismatch in number of function names and implementations");
}
- HashMap<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(nFuncs * 3 / 2);
+ HashMap<String, FreeRefFunction> m = new HashMap<>(nFuncs * 3 / 2);
for (int i = 0; i < functionImpls.length; i++) {
m.put(functionNames[i].toUpperCase(Locale.ROOT), functionImpls[i]);
}
public IndexedUDFFinder(UDFFinder... usedToolPacks) {
super(usedToolPacks);
- _funcMap = new HashMap<Integer, String>();
+ _funcMap = new HashMap<>();
}
@Override
* Represents a type of a conditional formatting rule
*/
public class ConditionType {
- private static Map<Integer,ConditionType> lookup = new HashMap<Integer, ConditionType>();
+ private static Map<Integer,ConditionType> lookup = new HashMap<>();
/**
* This conditional formatting rule compares a cell value
* A map to cache formats.
* Map<String,Format> formats
*/
- private final Map<String,Format> formats = new HashMap<String,Format>();
+ private final Map<String,Format> formats = new HashMap<>();
private final boolean emulateCSV;
StringBuilder sb = new StringBuilder();
char[] chars = formatStr.toCharArray();
boolean mIsMonth = true;
- List<Integer> ms = new ArrayList<Integer>();
+ List<Integer> ms = new ArrayList<>();
boolean isElapsed = false;
for(int j=0; j<chars.length; j++) {
char c = chars[j];
return -1;
}
};
- private static ThreadLocal<String> lastFormatString = new ThreadLocal<String>();
- private static ThreadLocal<Boolean> lastCachedResult = new ThreadLocal<Boolean>();
+ private static ThreadLocal<String> lastFormatString = new ThreadLocal<>();
+ private static ThreadLocal<Boolean> lastCachedResult = new ThreadLocal<>();
private static boolean isCached(String formatString, int formatIndex) {
String cachedFormatString = lastFormatString.get();
return repr;
}
- private static final Map<String, FormulaError> smap = new HashMap<String, FormulaError>();
- private static final Map<Byte, FormulaError> bmap = new HashMap<Byte, FormulaError>();
- private static final Map<Integer, FormulaError> imap = new HashMap<Integer, FormulaError>();
+ private static final Map<String, FormulaError> smap = new HashMap<>();
+ private static final Map<Byte, FormulaError> bmap = new HashMap<>();
+ private static final Map<Integer, FormulaError> imap = new HashMap<>();
static{
for (FormulaError error : values()) {
bmap.put(error.getCode(), error);
}
public static <T> ChartDataSource<T> fromArray(T[] elements) {
- return new ArrayDataSource<T>(elements);
+ return new ArrayDataSource<>(elements);
}
public static ChartDataSource<Number> fromNumericCellRange(Sheet sheet, CellRangeAddress cellRangeAddress) {
* @return an array of affected merged regions, doesn't contain deleted ones
*/
public List<CellRangeAddress> shiftMergedRegions(int startRow, int endRow, int n) {
- List<CellRangeAddress> shiftedRegions = new ArrayList<CellRangeAddress>();
- Set<Integer> removedIndices = new HashSet<Integer>();
+ List<CellRangeAddress> shiftedRegions = new ArrayList<>();
+ Set<Integer> removedIndices = new HashSet<>();
//move merged regions completely if they fall within the new region boundaries when they are shifted
int size = sheet.getNumMergedRegions();
for (int i = 0; i < size; i++) {
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(
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());
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
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);
}
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,
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
- )));
+ )));
* @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());
}
public static String[] tokenize( String format ) {
- List<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<>();
DateFormatTokenizer tokenizer = new DateFormatTokenizer(format);
String token;
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" );
}
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]" );
* Create a PropertyTemplate object
*/
public PropertyTemplate() {
- _propertyTemplate = new HashMap<CellAddress, Map<String, Object>>();
+ _propertyTemplate = new HashMap<>();
}
/**
}
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());
}
* @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);
* @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);
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);
@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() {
return result;
}
public Iterator<K> iterator() {
- return new ArrayIterator<K>(_flattenedArray);
+ return new ArrayIterator<>(_flattenedArray);
}
private static final class ArrayIterator<D> implements Iterator<D> {
* Returns immutable Bitfield instances.
*/
public class BitFieldFactory {
- private static Map<Integer, BitField> instances = new HashMap<Integer, BitField>();
+ private static Map<Integer, BitField> instances = new HashMap<>();
public static BitField getInstance(int mask) {
BitField f = instances.get(Integer.valueOf(mask));
{
int characterCount = 0;
byte b = (byte) 0;
- List<Byte> bytes = new ArrayList<Byte>();
+ List<Byte> bytes = new ArrayList<>();
final char a = 'a' - 10;
final char A = 'A' - 10;
while ( true ) {
public IntMapper(final int initialCapacity)
{
- elements = new ArrayList<T>(initialCapacity);
- valueKeyMap = new HashMap<T,Integer>(initialCapacity);
+ elements = new ArrayList<>(initialCapacity);
+ valueKeyMap = new HashMap<>(initialCapacity);
}
/**
*/
public static final Charset CHARSET_1252 = Charset.forName("CP1252");
- private static final ThreadLocal<TimeZone> userTimeZone = new ThreadLocal<TimeZone>();
- private static final ThreadLocal<Locale> userLocale = new ThreadLocal<Locale>();
+ private static final ThreadLocal<TimeZone> userTimeZone = new ThreadLocal<>();
+ private static final ThreadLocal<Locale> userLocale = new ThreadLocal<>();
/**
* As time zone information is not stored in any format, it can be
/**
* Map of POILogger instances, with classes as keys
*/
- private static final Map<String,POILogger> _loggers = new HashMap<String,POILogger>();
+ private static final Map<String,POILogger> _loggers = new HashMap<>();
/**
* A common instance of NullLogger, as it does nothing
private static synchronized void initMsCodepointMap() {
if (msCodepointToUnicode != null) return;
- msCodepointToUnicode = new HashMap<Integer,Integer>();
+ msCodepointToUnicode = new HashMap<>();
int i=0xF020;
for (int ch : symbolMap_f020) {
msCodepointToUnicode.put(i++, ch);
public abstract List<PackagePart> getAllEmbedds() throws OpenXML4JException;
protected final void load(POIXMLFactory factory) throws IOException {
- Map<PackagePart, POIXMLDocumentPart> context = new HashMap<PackagePart, POIXMLDocumentPart>();
+ Map<PackagePart, POIXMLDocumentPart> context = new HashMap<>();
try {
read(factory, context);
} catch (OpenXML4JException e){
//force all children to commit their changes into the underlying OOXML Package
// TODO Shouldn't they be committing to the new one instead?
- Set<PackagePart> context = new HashSet<PackagePart>();
+ Set<PackagePart> context = new HashSet<>();
onSave(context);
context.clear();
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
private PackagePart packagePart;
private POIXMLDocumentPart parent;
- private Map<String,RelationPart> relations = new LinkedHashMap<String,RelationPart>();
+ private Map<String,RelationPart> relations = new LinkedHashMap<>();
/**
* The RelationPart is a cached relationship between the document, which contains the RelationPart,
* @return child relations
*/
public final List<POIXMLDocumentPart> getRelations(){
- List<POIXMLDocumentPart> l = new ArrayList<POIXMLDocumentPart>();
+ List<POIXMLDocumentPart> l = new ArrayList<>();
for (RelationPart rp : relations.values()) {
l.add(rp.getDocumentPart());
}
* @return child relations
*/
public final List<RelationPart> getRelationParts() {
- List<RelationPart> l = new ArrayList<RelationPart>(relations.values());
+ List<RelationPart> l = new ArrayList<>(relations.values());
return Collections.unmodifiableList(l);
}
if (!pp.hasRelationships()) return;
PackageRelationshipCollection rels = packagePart.getRelationships();
- List<POIXMLDocumentPart> readLater = new ArrayList<POIXMLDocumentPart>();
+ List<POIXMLDocumentPart> readLater = new ArrayList<>();
// scan breadth-first, so parent-relations are hopefully the shallowest element
for (PackageRelationship rel : rels) {
@SuppressWarnings("deprecation")
public class POIXMLTypeLoader {
- private static ThreadLocal<SchemaTypeLoader> typeLoader = new ThreadLocal<SchemaTypeLoader>();
+ private static ThreadLocal<SchemaTypeLoader> typeLoader = new ThreadLocal<>();
// TODO: Do these have a good home like o.a.p.openxml4j.opc.PackageNamespaces and PackageRelationshipTypes?
// These constants should be common to all of POI and easy to use by other applications such as Tika
// when reading properties in separate workbooks in multiple threads
// DEFAULT_XML_OPTIONS.setUnsynchronized();
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a");
map.put("http://schemas.openxmlformats.org/drawingml/2006/chart", "c");
map.put("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "wp");
*/
public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException, OpenXML4JException, XmlException {
// All the embedded directories we spotted
- ArrayList<Entry> dirs = new ArrayList<Entry>();
+ ArrayList<Entry> dirs = new ArrayList<>();
// For anything else not directly held in as a POIFS directory
- ArrayList<InputStream> nonPOIFS = new ArrayList<InputStream>();
+ ArrayList<InputStream> nonPOIFS = new ArrayList<>();
// Find all the embedded directories
DirectoryEntry root = ext.getRoot();
return new POITextExtractor[0];
}
- ArrayList<POITextExtractor> textExtractors = new ArrayList<POITextExtractor>();
+ ArrayList<POITextExtractor> textExtractors = new ArrayList<>();
for (Entry dir : dirs) {
textExtractors.add(createExtractor((DirectoryNode) dir));
}
* Initialize the package instance.
*/
private void init() {
- this.partMarshallers = new HashMap<ContentType, PartMarshaller>(5);
- this.partUnmarshallers = new HashMap<ContentType, PartUnmarshaller>(2);
+ this.partMarshallers = new HashMap<>(5);
+ this.partUnmarshallers = new HashMap<>(2);
try {
// Add 'default' unmarshaller
pkg.packageProperties = new PackagePropertiesPart(pkg,
PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
pkg.packageProperties.setCreatorProperty("Generated by Apache POI OpenXML4J");
- pkg.packageProperties.setCreatedProperty(new Nullable<Date>(new Date()));
+ pkg.packageProperties.setCreatedProperty(new Nullable<>(new Date()));
} catch (InvalidFormatException e) {
// Should never happen
throw new IllegalStateException(e);
* @return All part associated to the specified content type.
*/
public ArrayList<PackagePart> getPartsByContentType(String contentType) {
- ArrayList<PackagePart> retArr = new ArrayList<PackagePart>();
+ ArrayList<PackagePart> retArr = new ArrayList<>();
for (PackagePart part : partList.sortedValues()) {
if (part.getContentType().equals(contentType)) {
retArr.add(part);
if (relationshipType == null) {
throw new IllegalArgumentException("relationshipType");
}
- ArrayList<PackagePart> retArr = new ArrayList<PackagePart>();
+ ArrayList<PackagePart> retArr = new ArrayList<>();
for (PackageRelationship rel : getRelationshipsByType(relationshipType)) {
PackagePart part = getPart(rel);
if (part != null) {
throw new IllegalArgumentException("name pattern must not be null");
}
Matcher matcher = namePattern.matcher("");
- ArrayList<PackagePart> result = new ArrayList<PackagePart>();
+ ArrayList<PackagePart> result = new ArrayList<>();
for (PackagePart part : partList.sortedValues()) {
PackagePartName partName = part.getPartName();
if (matcher.reset(partName.getName()).matches()) {
}
}
}
- return new ArrayList<PackagePart>(partList.sortedValues());
+ return new ArrayList<>(partList.sortedValues());
}
/**
* HashSet use to store this collection part names as string for rule
* M1.11 optimized checking.
*/
- private HashSet<String> registerPartNameStr = new HashSet<String>();
+ private HashSet<String> registerPartNameStr = new HashSet<>();
- private final HashMap<PackagePartName, PackagePart> packagePartLookup = new HashMap<PackagePartName, PackagePart>();
+ private final HashMap<PackagePartName, PackagePart> packagePartLookup = new HashMap<>();
/**
* avoids paying the high cost of Natural Ordering per insertion.
*/
public Collection<PackagePart> sortedValues() {
- ArrayList<PackagePart> packageParts = new ArrayList<PackagePart>(packagePartLookup.values());
+ ArrayList<PackagePart> packageParts = new ArrayList<>(packagePartLookup.values());
Collections.sort(packageParts);
return packageParts;
/**
* A lookup of internal relationships to avoid
*/
- private HashMap<String, PackageRelationship> internalRelationshipsByTargetName = new HashMap<String, PackageRelationship>();
+ private HashMap<String, PackageRelationship> internalRelationshipsByTargetName = new HashMap<>();
/**
* Constructor.
*/
PackageRelationshipCollection() {
- relationshipsByID = new TreeMap<String, PackageRelationship>();
- relationshipsByType = new TreeMap<String, PackageRelationship>();
+ relationshipsByID = new TreeMap<>();
+ relationshipsByType = new TreeMap<>();
}
/**
* specified type contain in this collection.
*/
public Iterator<PackageRelationship> iterator(String typeFilter) {
- ArrayList<PackageRelationship> retArr = new ArrayList<PackageRelationship>();
+ ArrayList<PackageRelationship> retArr = new ArrayList<>();
for (PackageRelationship rel : relationshipsByID.values()) {
if (rel.getRelationshipType().equals(typeFilter))
retArr.add(rel);
this.subType = mMediaType.group(2);
// Parameters
- this.parameters = new HashMap<String, String>();
+ this.parameters = new HashMap<>();
// Java RegExps are unhelpful, and won't do multiple group captures
// See http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#cg
if (mMediaType.groupCount() >= 5) {
public ContentTypeManager(InputStream in, OPCPackage pkg)
throws InvalidFormatException {
this.container = pkg;
- this.defaultContentType = new TreeMap<String, String>();
+ this.defaultContentType = new TreeMap<>();
if (in != null) {
try {
parseContentTypesFile(in);
private void addOverrideContentType(PackagePartName partName,
String contentType) {
if (overrideContentType == null)
- overrideContentType = new TreeMap<PackagePartName, String>();
+ overrideContentType = new TreeMap<>();
overrideContentType.put(partName, contentType);
}
* value might be used by an application's user interface to facilitate
* navigation of a large set of documents. end example]
*/
- protected Nullable<String> category = new Nullable<String>();
+ protected Nullable<String> category = new Nullable<>();
/**
* The status of the content.
* [Example: Values might include "Draft", "Reviewed", and "Final". end
* example]
*/
- protected Nullable<String> contentStatus = new Nullable<String>();
+ protected Nullable<String> contentStatus = new Nullable<>();
/**
* The type of content represented, generally defined by a specific use and
* "Exam". end example] [Note: This property is distinct from MIME content
* types as defined in RFC 2616. end note]
*/
- protected Nullable<String> contentType = new Nullable<String>();
+ protected Nullable<String> contentType = new Nullable<>();
/**
* Date of creation of the resource.
*/
- protected Nullable<Date> created = new Nullable<Date>();
+ protected Nullable<Date> created = new Nullable<>();
/**
* An entity primarily responsible for making the content of the resource.
*/
- protected Nullable<String> creator = new Nullable<String>();
+ protected Nullable<String> creator = new Nullable<>();
/**
* An explanation of the content of the resource.
* to a graphical representation of content, and a free-text account of the
* content. end example]
*/
- protected Nullable<String> description = new Nullable<String>();
+ protected Nullable<String> description = new Nullable<>();
/**
* An unambiguous reference to the resource within a given context.
*/
- protected Nullable<String> identifier = new Nullable<String>();
+ protected Nullable<String> identifier = new Nullable<>();
/**
* A delimited set of keywords to support searching and indexing. This is
* typically a list of terms that are not available elsewhere in the
* properties.
*/
- protected Nullable<String> keywords = new Nullable<String>();
+ protected Nullable<String> keywords = new Nullable<>();
/**
* The language of the intellectual content of the resource.
* [Note: IETF RFC 3066 provides guidance on encoding to represent
* languages. end note]
*/
- protected Nullable<String> language = new Nullable<String>();
+ protected Nullable<String> language = new Nullable<>();
/**
* The user who performed the last modification. The identification is
* [Example: A name, email address, or employee ID. end example] It is
* recommended that this value be as concise as possible.
*/
- protected Nullable<String> lastModifiedBy = new Nullable<String>();
+ protected Nullable<String> lastModifiedBy = new Nullable<>();
/**
* The date and time of the last printing.
*/
- protected Nullable<Date> lastPrinted = new Nullable<Date>();
+ protected Nullable<Date> lastPrinted = new Nullable<>();
/**
* Date on which the resource was changed.
*/
- protected Nullable<Date> modified = new Nullable<Date>();
+ protected Nullable<Date> modified = new Nullable<>();
/**
* The revision number.
* [Example: This value might indicate the number of saves or revisions,
* provided the application updates it after each revision. end example]
*/
- protected Nullable<String> revision = new Nullable<String>();
+ protected Nullable<String> revision = new Nullable<>();
/**
* The topic of the content of the resource.
*/
- protected Nullable<String> subject = new Nullable<String>();
+ protected Nullable<String> subject = new Nullable<>();
/**
* The name given to the resource.
*/
- protected Nullable<String> title = new Nullable<String>();
+ protected Nullable<String> title = new Nullable<>();
/**
* The version number. This value is set by the user or by the application.
*/
- protected Nullable<String> version = new Nullable<String>();
+ protected Nullable<String> version = new Nullable<>();
/*
* Getters and setters
if (modified.hasValue()) {
return getDateValue(modified);
}
- return getDateValue(new Nullable<Date>(new Date()));
+ return getDateValue(new Nullable<>(new Date()));
}
/**
*/
private Nullable<String> setStringValue(String s) {
if (s == null || s.equals("")) {
- return new Nullable<String>();
+ return new Nullable<>();
}
- return new Nullable<String>(s);
+ return new Nullable<>(s);
}
/**
*/
private Nullable<Date> setDateValue(String dateStr) throws InvalidFormatException {
if (dateStr == null || dateStr.equals("")) {
- return new Nullable<Date>();
+ return new Nullable<>();
}
Matcher m = TIME_ZONE_PAT.matcher(dateStr);
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
Date d = df.parse(dateTzStr, new ParsePosition(0));
if (d != null) {
- return new Nullable<Date>(d);
+ return new Nullable<>(d);
}
}
}
df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
Date d = df.parse(dateTzStr, new ParsePosition(0));
if (d != null) {
- return new Nullable<Date>(d);
+ return new Nullable<>(d);
}
}
//if you're here, no pattern matched, throw exception
* work with the entries at-will.
*/
public ZipInputStreamZipEntrySource(ThresholdInputStream inp) throws IOException {
- zipEntries = new ArrayList<FakeZipEntry>();
+ zipEntries = new ArrayList<>();
boolean going = true;
while(going) {
byte certVerifier[];
}
- private List<AgileCertificateEntry> certList = new ArrayList<AgileCertificateEntry>();
+ private List<AgileCertificateEntry> certList = new ArrayList<>();
private int keyBits = -1;
private int blockSize = -1;
public AgileEncryptionVerifier clone() throws CloneNotSupportedException {
AgileEncryptionVerifier other = (AgileEncryptionVerifier)super.clone();
// TODO: deep copy of certList
- other.certList = new ArrayList<AgileCertificateEntry>(certList);
+ other.certList = new ArrayList<>(certList);
return other;
}
protected void marshallEncryptionDocument(EncryptionDocument ed, LittleEndianByteArrayOutputStream os) {
XmlOptions xo = new XmlOptions();
xo.setCharacterEncoding("UTF-8");
- Map<String,String> nsMap = new HashMap<String,String>();
+ Map<String,String> nsMap = new HashMap<>();
nsMap.put(passwordUri.toString(),"p");
nsMap.put(certificateUri.toString(), "c");
xo.setUseDefaultNamespace();
private static final POILogger LOG = POILogFactory.getLogger(KeyInfoKeySelector.class);
- private List<X509Certificate> certChain = new ArrayList<X509Certificate>();
+ private List<X509Certificate> certChain = new ArrayList<>();
@SuppressWarnings("unchecked")
@Override
void setSignatureConfig(SignatureConfig signatureConfig);
}
- private ThreadLocal<OPCPackage> opcPackage = new ThreadLocal<OPCPackage>();
- private ThreadLocal<XMLSignatureFactory> signatureFactory = new ThreadLocal<XMLSignatureFactory>();
- private ThreadLocal<KeyInfoFactory> keyInfoFactory = new ThreadLocal<KeyInfoFactory>();
- private ThreadLocal<Provider> provider = new ThreadLocal<Provider>();
+ private ThreadLocal<OPCPackage> opcPackage = new ThreadLocal<>();
+ private ThreadLocal<XMLSignatureFactory> signatureFactory = new ThreadLocal<>();
+ private ThreadLocal<KeyInfoFactory> keyInfoFactory = new ThreadLocal<>();
+ private ThreadLocal<Provider> provider = new ThreadLocal<>();
- private List<SignatureFacet> signatureFacets = new ArrayList<SignatureFacet>();
+ private List<SignatureFacet> signatureFacets = new ArrayList<>();
private HashAlgorithm digestAlgo = HashAlgorithm.sha1;
private Date executionTime = new Date();
private PrivateKey key;
* Map of namespace uris to prefix
* If a mapping is specified, the corresponding elements will be prefixed
*/
- Map<String,String> namespacePrefixes = new HashMap<String,String>();
+ Map<String,String> namespacePrefixes = new HashMap<>();
/**
* Inits and checks the config object.
/*
* Add ds:References that come from signing client local files.
*/
- List<Reference> references = new ArrayList<Reference>();
+ List<Reference> references = new ArrayList<>();
for (DigestInfo digestInfo : safe(digestInfos)) {
byte[] documentDigestValue = digestInfo.digestValue;
/*
* Invoke the signature facets.
*/
- List<XMLObject> objects = new ArrayList<XMLObject>();
+ List<XMLObject> objects = new ArrayList<>();
for (SignatureFacet signatureFacet : signatureConfig.getSignatureFacets()) {
LOG.log(POILogger.DEBUG, "invoking signature facet: " + signatureFacet.getClass().getSimpleName());
signatureFacet.preSign(document, references, objects);
*/
protected void writeDocument(Document document) throws MarshalException {
XmlOptions xo = new XmlOptions();
- Map<String,String> namespaceMap = new HashMap<String,String>();
+ Map<String,String> namespaceMap = new HashMap<>();
for(Map.Entry<String,String> entry : signatureConfig.getNamespacePrefixes().entrySet()){
namespaceMap.put(entry.getValue(), entry.getKey());
}
* e.g. to register id attributes or set prefixes for registered namespaces
*/
public class SignatureMarshalListener implements EventListener, SignatureConfigurable {
- ThreadLocal<EventTarget> target = new ThreadLocal<EventTarget>();
+ ThreadLocal<EventTarget> target = new ThreadLocal<>();
SignatureConfig signatureConfig;
public void setEventTarget(EventTarget target) {
this.target.set(target);
, List<Reference> references
, List<XMLObject> objects)
throws XMLSignatureException {
- List<Transform> transforms = new ArrayList<Transform>();
+ List<Transform> transforms = new ArrayList<>();
Transform envelopedTransform = newTransform(CanonicalizationMethod.ENVELOPED);
transforms.add(envelopedTransform);
Transform exclusiveTransform = newTransform(CanonicalizationMethod.EXCLUSIVE);
* Construct the ds:KeyInfo element using JSR 105.
*/
KeyInfoFactory keyInfoFactory = signatureConfig.getKeyInfoFactory();
- List<Object> x509DataObjects = new ArrayList<Object>();
+ List<Object> x509DataObjects = new ArrayList<>();
X509Certificate signingCertificate = signatureConfig.getSigningCertificateChain().get(0);
- List<XMLStructure> keyInfoContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> keyInfoContent = new ArrayList<>();
if (signatureConfig.isIncludeKeyValue()) {
KeyValue keyValue;
, List<XMLObject> objects)
throws XMLSignatureException {
- List<Reference> manifestReferences = new ArrayList<Reference>();
+ List<Reference> manifestReferences = new ArrayList<>();
addManifestReferences(manifestReferences);
Manifest manifest = getSignatureFactory().newManifest(manifestReferences);
- List<XMLStructure> objectContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> objectContent = new ArrayList<>();
objectContent.add(manifest);
addSignatureTime(document, objectContent);
OPCPackage ooxml = signatureConfig.getOpcPackage();
List<PackagePart> relsEntryNames = ooxml.getPartsByContentType(ContentTypes.RELATIONSHIPS_PART);
- Set<String> digestedPartNames = new HashSet<String>();
+ Set<String> digestedPartNames = new HashSet<>();
for (PackagePart pp : relsEntryNames) {
final String baseUri = pp.getPartName().getName().replaceFirst("(.*)/_rels/.*", "$1");
}
if (parameterSpec.hasSourceIds()) {
- List<Transform> transforms = new ArrayList<Transform>();
+ List<Transform> transforms = new ArrayList<>();
transforms.add(newTransform(RelationshipTransformService.TRANSFORM_URI, parameterSpec));
transforms.add(newTransform(CanonicalizationMethod.INCLUSIVE));
String uri = normalizePartName(pp.getPartName().getURI(), baseUri)
ctTime.setValue(nowStr);
Element n = (Element)document.importNode(ctTime.getDomNode(),true);
- List<XMLStructure> signatureTimeContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> signatureTimeContent = new ArrayList<>();
signatureTimeContent.add(new DOMStructure(n));
SignatureProperty signatureTimeSignatureProperty = getSignatureFactory()
.newSignatureProperty(signatureTimeContent, "#" + signatureConfig.getPackageSignatureId(),
"idSignatureTime");
- List<SignatureProperty> signaturePropertyContent = new ArrayList<SignatureProperty>();
+ List<SignatureProperty> signaturePropertyContent = new ArrayList<>();
signaturePropertyContent.add(signatureTimeSignatureProperty);
SignatureProperties signatureProperties = getSignatureFactory()
.newSignatureProperties(signaturePropertyContent, null);
List<Reference> references,
List<XMLObject> objects)
throws XMLSignatureException {
- List<XMLStructure> objectContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> objectContent = new ArrayList<>();
SignatureInfoV1Document sigV1 = SignatureInfoV1Document.Factory.newInstance();
CTSignatureInfoV1 ctSigV1 = sigV1.addNewSignatureInfoV1();
Element n = (Element)document.importNode(ctSigV1.getDomNode(), true);
n.setAttributeNS(XML_NS, XMLConstants.XMLNS_ATTRIBUTE, MS_DIGSIG_NS);
- List<XMLStructure> signatureInfoContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> signatureInfoContent = new ArrayList<>();
signatureInfoContent.add(new DOMStructure(n));
SignatureProperty signatureInfoSignatureProperty = getSignatureFactory()
.newSignatureProperty(signatureInfoContent, "#" + signatureConfig.getPackageSignatureId(),
"idOfficeV1Details");
- List<SignatureProperty> signaturePropertyContent = new ArrayList<SignatureProperty>();
+ List<SignatureProperty> signaturePropertyContent = new ArrayList<>();
signaturePropertyContent.add(signatureInfoSignatureProperty);
SignatureProperties signatureProperties = getSignatureFactory()
.newSignatureProperties(signaturePropertyContent, null);
/**
* Office 2010 list of signed types (extensions).
*/
- private static final Set<String> signed = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
- "activeXControlBinary","aFChunk","attachedTemplate","attachedToolbars","audio","calcChain","chart","chartColorStyle",
- "chartLayout","chartsheet","chartStyle","chartUserShapes","commentAuthors","comments","connections","connectorXml",
- "control","ctrlProp","customData","customData","customProperty","customXml","diagram","diagramColors",
- "diagramColorsHeader","diagramData","diagramDrawing","diagramLayout","diagramLayoutHeader","diagramQuickStyle",
- "diagramQuickStyleHeader","dialogsheet","dictionary","documentParts","downRev","drawing","endnotes","externalLink",
- "externalLinkPath","font","fontTable","footer","footnotes","functionPrototypes","glossaryDocument","graphicFrameDoc",
- "groupShapeXml","handoutMaster","hdphoto","header","hyperlink","image","ink","inkXml","keyMapCustomizations",
- "legacyDiagramText","legacyDocTextInfo","mailMergeHeaderSource","mailMergeRecipientData","mailMergeSource","media",
- "notesMaster","notesSlide","numbering","officeDocument","officeDocument","oleObject","package","pictureXml",
- "pivotCacheDefinition","pivotCacheRecords","pivotTable","powerPivotData","presProps","printerSettings","queryTable",
- "recipientData","settings","shapeXml","sharedStrings","sheetMetadata","slicer","slicer","slicerCache","slicerCache",
- "slide","slideLayout","slideMaster","slideUpdateInfo","slideUpdateUrl","smartTags","styles","stylesWithEffects",
- "table","tableSingleCells","tableStyles","tags","theme","themeOverride","timeline","timelineCache","transform",
- "ui/altText","ui/buttonSize","ui/controlID","ui/description","ui/enabled","ui/extensibility","ui/extensibility",
- "ui/helperText","ui/imageID","ui/imageMso","ui/keyTip","ui/label","ui/lcid","ui/loud","ui/pressed","ui/progID",
- "ui/ribbonID","ui/showImage","ui/showLabel","ui/supertip","ui/target","ui/text","ui/title","ui/tooltip",
- "ui/userCustomization","ui/visible","userXmlData","vbaProject","video","viewProps","vmlDrawing",
- "volatileDependencies","webSettings","wordVbaData","worksheet","wsSortMap","xlBinaryIndex",
- "xlExternalLinkPath/xlAlternateStartup","xlExternalLinkPath/xlLibrary","xlExternalLinkPath/xlPathMissing",
- "xlExternalLinkPath/xlStartup","xlIntlMacrosheet","xlMacrosheet","xmlMaps"
+ private static final Set<String> signed = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
+ "activeXControlBinary", "aFChunk", "attachedTemplate", "attachedToolbars", "audio", "calcChain", "chart", "chartColorStyle",
+ "chartLayout", "chartsheet", "chartStyle", "chartUserShapes", "commentAuthors", "comments", "connections", "connectorXml",
+ "control", "ctrlProp", "customData", "customData", "customProperty", "customXml", "diagram", "diagramColors",
+ "diagramColorsHeader", "diagramData", "diagramDrawing", "diagramLayout", "diagramLayoutHeader", "diagramQuickStyle",
+ "diagramQuickStyleHeader", "dialogsheet", "dictionary", "documentParts", "downRev", "drawing", "endnotes", "externalLink",
+ "externalLinkPath", "font", "fontTable", "footer", "footnotes", "functionPrototypes", "glossaryDocument", "graphicFrameDoc",
+ "groupShapeXml", "handoutMaster", "hdphoto", "header", "hyperlink", "image", "ink", "inkXml", "keyMapCustomizations",
+ "legacyDiagramText", "legacyDocTextInfo", "mailMergeHeaderSource", "mailMergeRecipientData", "mailMergeSource", "media",
+ "notesMaster", "notesSlide", "numbering", "officeDocument", "officeDocument", "oleObject", "package", "pictureXml",
+ "pivotCacheDefinition", "pivotCacheRecords", "pivotTable", "powerPivotData", "presProps", "printerSettings", "queryTable",
+ "recipientData", "settings", "shapeXml", "sharedStrings", "sheetMetadata", "slicer", "slicer", "slicerCache", "slicerCache",
+ "slide", "slideLayout", "slideMaster", "slideUpdateInfo", "slideUpdateUrl", "smartTags", "styles", "stylesWithEffects",
+ "table", "tableSingleCells", "tableStyles", "tags", "theme", "themeOverride", "timeline", "timelineCache", "transform",
+ "ui/altText", "ui/buttonSize", "ui/controlID", "ui/description", "ui/enabled", "ui/extensibility", "ui/extensibility",
+ "ui/helperText", "ui/imageID", "ui/imageMso", "ui/keyTip", "ui/label", "ui/lcid", "ui/loud", "ui/pressed", "ui/progID",
+ "ui/ribbonID", "ui/showImage", "ui/showLabel", "ui/supertip", "ui/target", "ui/text", "ui/title", "ui/tooltip",
+ "ui/userCustomization", "ui/visible", "userXmlData", "vbaProject", "video", "viewProps", "vmlDrawing",
+ "volatileDependencies", "webSettings", "wordVbaData", "worksheet", "wsSortMap", "xlBinaryIndex",
+ "xlExternalLinkPath/xlAlternateStartup", "xlExternalLinkPath/xlLibrary", "xlExternalLinkPath/xlPathMissing",
+ "xlExternalLinkPath/xlStartup", "xlIntlMacrosheet", "xlMacrosheet", "xmlMaps"
)));
}
\ No newline at end of file
private static final String XADES_TYPE = "http://uri.etsi.org/01903#SignedProperties";
- private Map<String, String> dataObjectFormatMimeTypes = new HashMap<String, String>();
+ private Map<String, String> dataObjectFormatMimeTypes = new HashMap<>();
@Override
}
// add XAdES ds:Object
- List<XMLStructure> xadesObjectContent = new ArrayList<XMLStructure>();
+ List<XMLStructure> xadesObjectContent = new ArrayList<>();
Element qualDocElSrc = (Element)qualifyingProperties.getDomNode();
Element qualDocEl = (Element)document.importNode(qualDocElSrc, true);
xadesObjectContent.add(new DOMStructure(qualDocEl));
objects.add(xadesObject);
// add XAdES ds:Reference
- List<Transform> transforms = new ArrayList<Transform>();
+ List<Transform> transforms = new ArrayList<>();
Transform exclusiveTransform = newTransform(CanonicalizationMethod.INCLUSIVE);
transforms.add(exclusiveTransform);
Reference reference = newReference
// marshal XAdES-C
// XAdES-X Type 1 timestamp
- List<Node> timeStampNodesXadesX1 = new ArrayList<Node>();
+ List<Node> timeStampNodesXadesX1 = new ArrayList<>();
timeStampNodesXadesX1.add(nlSigVal.item(0));
timeStampNodesXadesX1.add(signatureTimeStamp.getDomNode());
timeStampNodesXadesX1.add(completeCertificateRefs.getDomNode());
* Relationship Transform parameter specification class.
*/
public static class RelationshipTransformParameterSpec implements TransformParameterSpec {
- List<String> sourceIds = new ArrayList<String>();
+ List<String> sourceIds = new ArrayList<>();
public void addRelationshipReference(String relationshipId) {
sourceIds.add(relationshipId);
}
public RelationshipTransformService() {
super();
LOG.log(POILogger.DEBUG, "constructor");
- this.sourceIds = new ArrayList<String>();
+ this.sourceIds = new ArrayList<>();
}
/**
// keep only those relationships which id is registered in the sourceIds
Element root = doc.getDocumentElement();
NodeList nl = root.getChildNodes();
- TreeMap<String,Element> rsList = new TreeMap<String,Element>();
+ TreeMap<String,Element> rsList = new TreeMap<>();
for (int i=nl.getLength()-1; i>=0; i--) {
Node n = nl.item(i);
if ("Relationship".equals(n.getLocalName())) {
* Default constructor.
*/
public RevocationData() {
- this.crls = new ArrayList<byte[]>();
- this.ocsps = new ArrayList<byte[]>();
+ this.crls = new ArrayList<>();
+ this.ocsps = new ArrayList<>();
}
/**
Collection<X509CertificateHolder> certificates = timeStampToken.getCertificates().getMatches(null);
X509CertificateHolder signerCert = null;
- Map<X500Name, X509CertificateHolder> certificateMap = new HashMap<X500Name, X509CertificateHolder>();
+ Map<X500Name, X509CertificateHolder> certificateMap = new HashMap<>();
for (X509CertificateHolder certificate : certificates) {
if (signerCertIssuer.equals(certificate.getIssuer())
&& signerCertSerialNumber.equals(certificate.getSerialNumber())) {
if (signerCert == null) {
throw new RuntimeException("TSP response token has no signer certificate");
}
- List<X509Certificate> tspCertificateChain = new ArrayList<X509Certificate>();
+ List<X509Certificate> tspCertificateChain = new ArrayList<>();
JcaX509CertificateConverter x509converter = new JcaX509CertificateConverter();
x509converter.setProvider("BC");
X509CertificateHolder certificate = signerCert;
if (null == patriarch){
return Collections.emptyList();
}
- List<EmbeddedData> embeddings = new ArrayList<EmbeddedData>();
+ List<EmbeddedData> embeddings = new ArrayList<>();
extractAll(patriarch, embeddings);
return embeddings;
}
}
this.lowerbound = lowerbound;
this.upperbound = upperbound;
- this.segments = new LinkedList<Segment>();
+ this.segments = new LinkedList<>();
segments.add(new Segment(lowerbound, upperbound));
}
}
void build() throws IOException, ClassNotFoundException {
- List<Class<?>> lst = new ArrayList<Class<?>>();
+ List<Class<?>> lst = new ArrayList<>();
//collect unit tests
String exclude = StringUtil.join("|",
"BaseTestXWorkbook",
ClassLoader appLoader = ClassLoader.getSystemClassLoader();
try {
Vector<Class<?>> classes = (Vector<Class<?>>) _classes.get(appLoader);
- Map<String, Class<?>> map = new HashMap<String, Class<?>>();
+ Map<String, Class<?>> map = new HashMap<>();
for (Class<?> cls : classes) {
// e.g. proxy-classes, ...
ProtectionDomain pd = cls.getProtectionDomain();
public class SplineCollector {
SplineStart _start;
- ArrayList<SplineKnot> _knots = new ArrayList<SplineKnot>();
+ ArrayList<SplineKnot> _knots = new ArrayList<>();
public SplineCollector(SplineStart start) {
_start = start;
protected PageContentsType _pageContents;
// shapes without parents
- protected List<XDGFShape> _toplevelShapes = new ArrayList<XDGFShape>();
- protected Map<Long, XDGFShape> _shapes = new HashMap<Long, XDGFShape>();
- protected List<XDGFConnection> _connections = new ArrayList<XDGFConnection>();
+ protected List<XDGFShape> _toplevelShapes = new ArrayList<>();
+ protected Map<Long, XDGFShape> _shapes = new HashMap<>();
+ protected List<XDGFConnection> _connections = new ArrayList<>();
/**
* @since POI 3.14-Beta1
protected VisioDocumentType _document;
- Map<Long, XDGFStyleSheet> _styleSheets = new HashMap<Long, XDGFStyleSheet>();
+ Map<Long, XDGFStyleSheet> _styleSheets = new HashMap<>();
// defaults
long _defaultFillStyle;
MastersType _mastersObject;
// key: id of master
- protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
+ protected Map<Long, XDGFMaster> _masters = new HashMap<>();
/**
* @since POI 3.14-Beta1
throw new POIXMLException(e);
}
- Map<String, MasterType> masterSettings = new HashMap<String, MasterType>();
+ Map<String, MasterType> masterSettings = new HashMap<>();
for (MasterType master: _mastersObject.getMasterArray()) {
masterSettings.put(master.getRel().getId(), master);
}
public class XDGFPageContents extends XDGFBaseContents {
- protected Map<Long, XDGFMaster> _masters = new HashMap<Long, XDGFMaster>();
+ protected Map<Long, XDGFMaster> _masters = new HashMap<>();
protected XDGFPage _page;
/**
PagesType _pagesObject;
// ordered by page number
- List<XDGFPage> _pages = new ArrayList<XDGFPage>();
+ List<XDGFPage> _pages = new ArrayList<>();
/**
* @since POI 3.14-Beta1
/**
* A map to lookup POIXMLRelation by its relation type
*/
- private static final Map<String, XDGFRelation> _table = new HashMap<String, XDGFRelation>();
+ private static final Map<String, XDGFRelation> _table = new HashMap<>();
public static final XDGFRelation DOCUMENT = new XDGFRelation(
"application/vnd.ms-visio.drawing.main+xml",
_text = new XDGFText(text, this);
if (shapeSheet.isSetShapes()) {
- _shapes = new ArrayList<XDGFShape>();
+ _shapes = new ArrayList<>();
for (ShapeSheetType shape : shapeSheet.getShapes().getShapeArray())
_shapes.add(new XDGFShape(this, shape, parentPage, document));
}
//
public Iterable<GeometrySection> getGeometrySections() {
- return new CombinedIterable<GeometrySection>(_geometry,
+ return new CombinedIterable<>(_geometry,
_masterShape != null ? _masterShape._geometry : null);
}
protected SheetType _sheet;
// cells
- protected Map<String, XDGFCell> _cells = new HashMap<String, XDGFCell>();
+ protected Map<String, XDGFCell> _cells = new HashMap<>();
// sections
- protected Map<String, XDGFSection> _sections = new HashMap<String, XDGFSection>();
+ protected Map<String, XDGFSection> _sections = new HashMap<>();
// special: geometry sections (key: index, value: section)
- protected SortedMap<Long, GeometrySection> _geometry = new TreeMap<Long, GeometrySection>();
+ protected SortedMap<Long, GeometrySection> _geometry = new TreeMap<>();
// special: character section
protected CharacterSection _character;
*/
@Override
public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
- return new ArrayList<PackagePart>();
+ return new ArrayList<>();
}
//
Double _fontSize;
Color _fontColor;
- Map<String, XDGFCell> _characterCells = new HashMap<String, XDGFCell>();
+ Map<String, XDGFCell> _characterCells = new HashMap<>();
public CharacterSection(SectionType section, XDGFSheet containingSheet) {
super(section, containingSheet);
GeometrySection _master;
// rows
- SortedMap<Long, GeometryRow> _rows = new TreeMap<Long, GeometryRow>();
+ SortedMap<Long, GeometryRow> _rows = new TreeMap<>();
public GeometrySection(SectionType section, XDGFSheet containingSheet) {
super(section, containingSheet);
}
public Iterable<GeometryRow> getCombinedRows() {
- return new CombinedIterable<GeometryRow>(_rows,
+ return new CombinedIterable<>(_rows,
_master == null ? null : _master._rows);
}
static final ObjectFactory<XDGFSection, SectionType> _sectionTypes;
static {
- _sectionTypes = new ObjectFactory<XDGFSection, SectionType>();
+ _sectionTypes = new ObjectFactory<>();
try {
_sectionTypes.put("LineGradient", GenericSection.class, SectionType.class, XDGFSheet.class);
_sectionTypes.put("FillGradient", GenericSection.class, SectionType.class, XDGFSheet.class);
protected SectionType _section;
protected XDGFSheet _containingSheet;
- protected Map<String, XDGFCell> _cells = new HashMap<String, XDGFCell>();
+ protected Map<String, XDGFCell> _cells = new HashMap<>();
public XDGFSection(SectionType section, XDGFSheet containingSheet) {
static final ObjectFactory<GeometryRow, RowType> _rowTypes;
static {
- _rowTypes = new ObjectFactory<GeometryRow, RowType>();
+ _rowTypes = new ObjectFactory<>();
try {
_rowTypes.put("ArcTo", ArcTo.class, RowType.class);
_rowTypes.put("Ellipse", Ellipse.class, RowType.class);
public class ObjectFactory<T, X extends XmlObject> {
- Map<String, Constructor<? extends T>> _types = new HashMap<String, Constructor<? extends T>>();
+ Map<String, Constructor<? extends T>> _types = new HashMap<>();
public void put(String typeName, Class<? extends T> cls, Class<?>... varargs) throws NoSuchMethodException, SecurityException {
_types.put(typeName, cls.getDeclaredConstructor(varargs));
PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS);
_presentation = doc.getPresentation();
- Map<String, XSLFSlideMaster> masterMap = new HashMap<String, XSLFSlideMaster>();
- Map<String, XSLFSlide> shIdMap = new HashMap<String, XSLFSlide>();
+ Map<String, XSLFSlideMaster> masterMap = new HashMap<>();
+ Map<String, XSLFSlide> shIdMap = new HashMap<>();
for (RelationPart rp : getRelationParts()) {
POIXMLDocumentPart p = rp.getDocumentPart();
if (p instanceof XSLFSlide) {
}
}
- _masters = new ArrayList<XSLFSlideMaster>(masterMap.size());
+ _masters = new ArrayList<>(masterMap.size());
for (CTSlideMasterIdListEntry masterId : _presentation.getSldMasterIdLst().getSldMasterIdList()) {
XSLFSlideMaster master = masterMap.get(masterId.getId2());
_masters.add(master);
}
- _slides = new ArrayList<XSLFSlide>(shIdMap.size());
+ _slides = new ArrayList<>(shIdMap.size());
if (_presentation.isSetSldIdLst()) {
for (CTSlideIdListEntry slId : _presentation.getSldIdLst().getSldIdList()) {
XSLFSlide sh = shIdMap.get(slId.getId2());
public List<XSLFPictureData> getPictureData() {
if(_pictures == null){
List<PackagePart> mediaParts = getPackage().getPartsByName(Pattern.compile("/ppt/media/.*?"));
- _pictures = new ArrayList<XSLFPictureData>(mediaParts.size());
+ _pictures = new ArrayList<>(mediaParts.size());
for(PackagePart part : mediaParts){
XSLFPictureData pd = new XSLFPictureData(part);
pd.setIndex(_pictures.size());
Integer themeIndex = 1;
// TODO: check if that list can be replaced by idx = Math.max(idx,themeIdx)
- List<Integer> themeIndexList = new ArrayList<Integer>();
+ List<Integer> themeIndexList = new ArrayList<>();
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFTheme) {
themeIndexList.add(XSLFRelation.THEME.getFileNameIndex(p));
public List<DrawingTextBody> getDrawingText() {
CTGroupShape gs = data.getSpTree();
- List<DrawingTextBody> out = new ArrayList<DrawingTextBody>();
+ List<DrawingTextBody> out = new ArrayList<>();
processShape(gs, out);
return out;
}
public List<DrawingParagraph> getText() {
- List<DrawingParagraph> paragraphs = new ArrayList<DrawingParagraph>();
+ List<DrawingParagraph> paragraphs = new ArrayList<>();
for(DrawingTextBody textBody : getDrawingText()) {
paragraphs.addAll(Arrays.asList(textBody.getParagraphs()));
}
*/
@Override
public void clear() {
- List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes());
+ List<XSLFShape> shapes = new ArrayList<>(getShapes());
for(XSLFShape shape : shapes){
removeShape(shape);
}
@Override
public List<List<XSLFTextParagraph>> getTextParagraphs() {
- List<List<XSLFTextParagraph>> tp = new ArrayList<List<XSLFTextParagraph>>();
+ List<List<XSLFTextParagraph>> tp = new ArrayList<>();
for (XSLFShape sh : super.getShapes()) {
if (sh instanceof XSLFTextShape) {
XSLFTextShape txt = (XSLFTextShape)sh;
/**
* A map to lookup POIXMLRelation by its relation type
*/
- private static final Map<String, XSLFRelation> _table = new HashMap<String, XSLFRelation>();
+ private static final Map<String, XSLFRelation> _table = new HashMap<>();
public static final XSLFRelation MAIN = new XSLFRelation(
"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",
}
protected static List<XSLFShape> buildShapes(CTGroupShape spTree, XSLFSheet sheet){
- List<XSLFShape> shapes = new ArrayList<XSLFShape>();
+ List<XSLFShape> shapes = new ArrayList<>();
XmlCursor cur = spTree.newCursor();
try {
for (boolean b=cur.toFirstChild();b;b=cur.toNextSibling()) {
*/
@Override
public void clear() {
- List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes());
+ List<XSLFShape> shapes = new ArrayList<>(getShapes());
for(XSLFShape shape : shapes){
removeShape(shape);
}
void initPlaceholders() {
if(_placeholders == null) {
- _placeholders = new ArrayList<XSLFTextShape>();
- _placeholderByIdMap = new HashMap<Integer, XSLFSimpleShape>();
- _placeholderByTypeMap = new HashMap<Integer, XSLFSimpleShape>();
+ _placeholders = new ArrayList<>();
+ _placeholderByIdMap = new HashMap<>();
+ _placeholderByTypeMap = new HashMap<>();
for(XSLFShape sh : getShapes()){
if(sh instanceof XSLFTextShape){
private Map<String, XSLFSlideLayout> getLayouts(){
if(_layouts == null){
- _layouts = new HashMap<String, XSLFSlideLayout>();
+ _layouts = new HashMap<>();
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFSlideLayout){
XSLFSlideLayout layout = (XSLFSlideLayout)p;
presentationDoc =
PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS);
- embedds = new LinkedList<PackagePart>();
+ embedds = new LinkedList<>();
for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) {
PackagePart corePart = getCorePart();
PackagePart slidePart = corePart.getRelatedPart(corePart.getRelationship(ctSlide.getId2()));
_table = (CTTable)xo;
xc.dispose();
- _rows = new ArrayList<XSLFTableRow>(_table.sizeOfTrArray());
+ _rows = new ArrayList<>(_table.sizeOfTrArray());
for(CTTableRow row : _table.getTrArray()) {
_rows.add(new XSLFTableRow(row, this));
}
_row = row;
_table = table;
CTTableCell[] tcArray = _row.getTcArray();
- _cells = new ArrayList<XSLFTableCell>(tcArray.length);
+ _cells = new ArrayList<>(tcArray.length);
for(CTTableCell cell : tcArray) {
_cells.add(new XSLFTableCell(cell, table));
}
is.close();
_tblStyleLst = styleDoc.getTblStyleLst();
CTTableStyle[] tblStyleArray = _tblStyleLst.getTblStyleArray();
- _styles = new ArrayList<XSLFTableStyle>(tblStyleArray.length);
+ _styles = new ArrayList<>(tblStyleArray.length);
for(CTTableStyle c : tblStyleArray){
_styles.add(new XSLFTableStyle(c));
}
XSLFTextParagraph(CTTextParagraph p, XSLFTextShape shape){
_p = p;
- _runs = new ArrayList<XSLFTextRun>();
+ _runs = new ArrayList<>();
_shape = shape;
XmlCursor c = _p.newCursor();
/*package*/ XSLFTextShape(XmlObject shape, XSLFSheet sheet) {
super(shape, sheet);
- _paragraphs = new ArrayList<XSLFTextParagraph>();
+ _paragraphs = new ArrayList<>();
CTTextBody txBody = getTextBody(false);
if (txBody != null) {
for (CTTextParagraph p : txBody.getPArray()) {
CTBaseStyles elems = _theme.getThemeElements();
CTColorScheme scheme = elems.getClrScheme();
// The color scheme is responsible for defining a list of twelve colors.
- _schemeColors = new HashMap<String, CTColor>(12);
+ _schemeColors = new HashMap<>(12);
for(XmlObject o : scheme.selectPath("*")){
CTColor c = (CTColor)o;
String name = c.getDomNode().getLocalName();
}
private static Set<Integer> slideIndexes(final int slideCount, String range) {
- Set<Integer> slideIdx = new TreeSet<Integer>();
+ Set<Integer> slideIdx = new TreeSet<>();
if ("-1".equals(range)) {
for (int i=0; i<slideCount; i++) {
slideIdx.add(i);
@Internal
public class XSSFBCommentsTable extends XSSFBParser {
- private Map<CellAddress, XSSFBComment> comments = new TreeMap<CellAddress, XSSFBComment>();
- private Queue<CellAddress> commentAddresses = new LinkedList<CellAddress>();
- private List<String> authors = new ArrayList<String>();
+ private Map<CellAddress, XSSFBComment> comments = new TreeMap<>();
+ private Queue<CellAddress> commentAddresses = new LinkedList<>();
+ private List<String> authors = new ArrayList<>();
//these are all used only during parsing, and they are mutable!
private int authorId = -1;
}
- private final List<XSSFHyperlinkRecord> hyperlinkRecords = new ArrayList<XSSFHyperlinkRecord>();
+ private final List<XSSFHyperlinkRecord> hyperlinkRecords = new ArrayList<>();
//cache the relId to hyperlink url from the sheet's .rels
- private Map<String, String> relIdToHyperlink = new HashMap<String, String>();
+ private Map<String, String> relIdToHyperlink = new HashMap<>();
public XSSFBHyperlinksTable(PackagePart sheetPart) throws IOException {
//load the urls from the sheet .rels
*/
public Map<CellAddress, List<XSSFHyperlinkRecord>> getHyperLinks() {
Map<CellAddress, List<XSSFHyperlinkRecord>> hyperlinkMap =
- new TreeMap<CellAddress, List<XSSFHyperlinkRecord>>(new TopLeftCellAddressComparator());
+ new TreeMap<>(new TopLeftCellAddressComparator());
for (XSSFHyperlinkRecord hyperlinkRecord : hyperlinkRecords) {
CellAddress cellAddress = new CellAddress(hyperlinkRecord.getCellRangeAddress().getFirstRow(),
hyperlinkRecord.getCellRangeAddress().getFirstColumn());
List<XSSFHyperlinkRecord> list = hyperlinkMap.get(cellAddress);
if (list == null) {
- list = new ArrayList<XSSFHyperlinkRecord>();
+ list = new ArrayList<>();
}
list.add(hyperlinkRecord);
hyperlinkMap.put(cellAddress, list);
for (XSSFHyperlinkRecord record : hyperlinkRecords) {
if (CellRangeUtil.intersect(targetCellRangeAddress, record.getCellRangeAddress()) != CellRangeUtil.NO_INTERSECTION) {
if (overlapping == null) {
- overlapping = new ArrayList<XSSFHyperlinkRecord>();
+ overlapping = new ArrayList<>();
}
overlapping.add(record);
}
Unimplemented(-1);
private static final Map<Integer, XSSFBRecordType> TYPE_MAP =
- new HashMap<Integer, XSSFBRecordType>();
+ new HashMap<>();
static {
for (XSSFBRecordType type : XSSFBRecordType.values()) {
/**
* The shared strings table.
*/
- private List<String> strings = new ArrayList<String>();
+ private List<String> strings = new ArrayList<>();
/**
* @param pkg The {@link OPCPackage} to use as basis for the shared-strings table.
* @return a defensive copy of strings
*/
public List<String> getItems() {
- List<String> ret = new ArrayList<String>(strings.size());
+ List<String> ret = new ArrayList<>(strings.size());
ret.addAll(strings);
return ret;
}
@Internal
public class XSSFBStylesTable extends XSSFBParser {
- private final SortedMap<Short, String> numberFormats = new TreeMap<Short,String>();
- private final List<Short> styleIds = new ArrayList<Short>();
+ private final SortedMap<Short, String> numberFormats = new TreeMap<>();
+ private final List<Short> styleIds = new ArrayList<>();
private boolean inCellXFS;
private boolean inFmts;
String uniqueCount = attributes.getValue("uniqueCount");
if(uniqueCount != null) this.uniqueCount = Integer.parseInt(uniqueCount);
- this.strings = new ArrayList<String>(this.uniqueCount);
- this.phoneticStrings = new HashMap<Integer, String>();
+ this.strings = new ArrayList<>(this.uniqueCount);
+ this.phoneticStrings = new HashMap<>();
characters = new StringBuffer();
} else if ("si".equals(localName)) {
characters.setLength(0);
private static final POILogger log = POILogFactory.getLogger(XSSFBReader.class);
private static final Set<String> WORKSHEET_RELS =
- Collections.unmodifiableSet(new HashSet<String>(
+ Collections.unmodifiableSet(new HashSet<>(
Arrays.asList(new String[]{
XSSFRelation.WORKSHEET.getRelation(),
XSSFRelation.CHARTSHEET.getRelation(),
}
private static class SheetRefLoader extends XSSFBParser {
- List<XSSFSheetRef> sheets = new LinkedList<XSSFSheetRef>();
+ List<XSSFSheetRef> sheets = new LinkedList<>();
private SheetRefLoader(InputStream is) {
super(is);
public class XSSFReader {
private static final Set<String> WORKSHEET_RELS =
- Collections.unmodifiableSet(new HashSet<String>(
+ Collections.unmodifiableSet(new HashSet<>(
Arrays.asList(new String[]{
XSSFRelation.WORKSHEET.getRelation(),
XSSFRelation.CHARTSHEET.getRelation(),
*/
try {
//step 1. Map sheet's relationship Id and the corresponding PackagePart
- sheetMap = new HashMap<String, PackagePart>();
+ sheetMap = new HashMap<>();
OPCPackage pkg = wb.getPackage();
Set<String> worksheetRels = getSheetRelationships();
for(PackageRelationship rel : wb.getRelationships()){
throw new POIXMLException(e);
}
- List<XSSFSheetRef> validSheets = new ArrayList<XSSFSheetRef>();
+ List<XSSFSheetRef> validSheets = new ArrayList<>();
for (XSSFSheetRef xssfSheetRef : xmlSheetRefReader.getSheetRefs()) {
//if there's no relationship id, silently skip the sheet
String sheetId = xssfSheetRef.getId();
*/
public List<XSSFShape> getShapes() {
PackagePart sheetPkg = getSheetPart();
- List<XSSFShape> shapes= new LinkedList<XSSFShape>();
+ List<XSSFShape> shapes= new LinkedList<>();
// Do we have a comments relationship? (Only ever one if so)
try {
PackageRelationshipCollection drawingsList = sheetPkg.getRelationshipsByType(XSSFRelation.DRAWINGS.getRelation());
private static final String ID = "id";
private static final String NAME = "name";
- private final List<XSSFSheetRef> sheetRefs = new LinkedList<XSSFSheetRef>();
+ private final List<XSSFSheetRef> sheetRefs = new LinkedList<>();
// read <sheet name="Sheet6" sheetId="4" r:id="rId6"/>
// and add XSSFSheetRef(id="rId6", name="Sheet6") to sheetRefs
private void init() {
if (commentsTable != null) {
- commentCellRefs = new LinkedList<CellAddress>();
+ commentCellRefs = new LinkedList<>();
//noinspection deprecation
for (CTComment comment : commentsTable.getCTComments().getCommentList().getCommentArray()) {
commentCellRefs.add(new CellAddress(comment.getRef()));
protected SheetTextExtractor() {
this.output = new StringBuffer();
this.firstCellOfRow = true;
- this.headerFooterMap = includeHeadersFooters ? new HashMap<String, String>() : null;
+ this.headerFooterMap = includeHeadersFooters ? new HashMap<>() : null;
}
@Override
doc.appendChild(root);
- List<String> xpaths = new Vector<String>();
- Map<String,XSSFSingleXmlCell> singleXmlCellsMappings = new HashMap<String,XSSFSingleXmlCell>();
- Map<String,XSSFTable> tableMappings = new HashMap<String,XSSFTable>();
+ List<String> xpaths = new Vector<>();
+ Map<String,XSSFSingleXmlCell> singleXmlCellsMappings = new HashMap<>();
+ Map<String,XSSFTable> tableMappings = new HashMap<>();
for(XSSFSingleXmlCell simpleXmlCell : singleXMLCells) {
xpaths.add(simpleXmlCell.getXpath());
private Set<STXmlDataType.Enum> xmlDataTypes;
private DataType(STXmlDataType.Enum... xmlDataTypes) {
- this.xmlDataTypes = new HashSet<STXmlDataType.Enum>(Arrays.asList(xmlDataTypes));
+ this.xmlDataTypes = new HashSet<>(Arrays.asList(xmlDataTypes));
}
public static DataType getDataType(STXmlDataType.Enum xmlDataType) {
*/
public Map<CellAddress, XSSFComment> getCellComments() {
prepareCTCommentCache();
- final TreeMap<CellAddress, XSSFComment> map = new TreeMap<CellAddress, XSSFComment>();
+ final TreeMap<CellAddress, XSSFComment> map = new TreeMap<>();
for (final Entry<CellAddress, CTComment> e: commentRefs.entrySet()) {
map.put(e.getKey(), new XSSFComment(this, e.getValue(), null));
private void prepareCTCommentCache() {
// Create the cache if needed
if(commentRefs == null) {
- commentRefs = new HashMap<CellAddress, CTComment>();
+ commentRefs = new HashMap<>();
for (CTComment comment : comments.getCommentList().getCommentArray()) {
commentRefs.put(new CellAddress(comment.getRef()), comment);
}
public List<String> getSheetNames() {
CTExternalSheetName[] sheetNames =
link.getExternalBook().getSheetNames().getSheetNameArray();
- List<String> names = new ArrayList<String>(sheetNames.length);
+ List<String> names = new ArrayList<>(sheetNames.length);
for (CTExternalSheetName name : sheetNames) {
names.add(name.getVal());
}
public List<Name> getDefinedNames() {
CTExternalDefinedName[] extNames =
link.getExternalBook().getDefinedNames().getDefinedNameArray();
- List<Name> names = new ArrayList<Name>(extNames.length);
+ List<Name> names = new ArrayList<>(extNames.length);
for (CTExternalDefinedName extName : extNames) {
names.add(new ExternalName(extName));
}
MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
mapInfo = doc.getMapInfo();
- maps= new HashMap<Integer, XSSFMap>();
+ maps= new HashMap<>();
for(CTMap map :mapInfo.getMapArray()){
maps.put((int)map.getID(), new XSSFMap(map,this));
}
/**
* Array of individual string items in the Shared String table.
*/
- private final List<CTRst> strings = new ArrayList<CTRst>();
+ private final List<CTRst> strings = new ArrayList<>();
/**
* Maps strings and their indexes in the <code>strings</code> arrays
*/
- private final Map<String, Integer> stmap = new HashMap<String, Integer>();
+ private final Map<String, Integer> stmap = new HashMap<>();
/**
* An integer representing the total count of strings in the workbook. This count does not
* @return all the SimpleXmlCell contained in this SingleXmlCells element
*/
public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){
- List<XSSFSingleXmlCell> list = new Vector<XSSFSingleXmlCell>();
+ List<XSSFSingleXmlCell> list = new Vector<>();
for(CTSingleXmlCell singleXmlCell: singleXMLCells.getSingleXmlCellArray()){
list.add(new XSSFSingleXmlCell(singleXmlCell,this));
* Table of styles shared across all sheets in a workbook.
*/
public class StylesTable extends POIXMLDocumentPart {
- private final SortedMap<Short, String> numberFormats = new TreeMap<Short,String>();
- private final List<XSSFFont> fonts = new ArrayList<XSSFFont>();
- private final List<XSSFCellFill> fills = new ArrayList<XSSFCellFill>();
- private final List<XSSFCellBorder> borders = new ArrayList<XSSFCellBorder>();
- private final List<CTXf> styleXfs = new ArrayList<CTXf>();
- private final List<CTXf> xfs = new ArrayList<CTXf>();
-
- private final List<CTDxf> dxfs = new ArrayList<CTDxf>();
- private final Map<String, TableStyle> tableStyles = new HashMap<String, TableStyle>();
+ private final SortedMap<Short, String> numberFormats = new TreeMap<>();
+ private final List<XSSFFont> fonts = new ArrayList<>();
+ private final List<XSSFCellFill> fills = new ArrayList<>();
+ private final List<XSSFCellBorder> borders = new ArrayList<>();
+ private final List<CTXf> styleXfs = new ArrayList<>();
+ private final List<CTXf> xfs = new ArrayList<>();
+
+ private final List<CTDxf> dxfs = new ArrayList<>();
+ private final Map<String, TableStyle> tableStyles = new HashMap<>();
private IndexedColorMap indexedColors = new DefaultIndexedColorMap();
// will be called more frequently than getTrackedColumns(). The O(1) cost of insertion, removal, and membership operations
// outweigh the infrequent O(n*log n) cost of sorting getTrackedColumns().
// Memory consumption for a HashMap and TreeMap is about the same
- private final Map<Integer, ColumnWidthPair> maxColumnWidths = new HashMap<Integer, ColumnWidthPair>();
+ private final Map<Integer, ColumnWidthPair> maxColumnWidths = new HashMap<>();
// untrackedColumns stores columns have been explicitly untracked so they aren't implicitly re-tracked by trackAllColumns
// Using a HashSet instead of a TreeSet because we don't care about order.
- private final Set<Integer> untrackedColumns = new HashSet<Integer>();
+ private final Set<Integer> untrackedColumns = new HashSet<>();
private boolean trackAllColumns;
/**
* @since 3.14beta1
*/
public SortedSet<Integer> getTrackedColumns() {
- SortedSet<Integer> sorted = new TreeSet<Integer>(maxColumnWidths.keySet());
+ SortedSet<Integer> sorted = new TreeSet<>(maxColumnWidths.keySet());
return Collections.unmodifiableSortedSet(sorted);
}
private static final Boolean UNDEFINED = null;
private final SXSSFSheet _sheet; // parent sheet
- private final SortedMap<Integer, SXSSFCell> _cells = new TreeMap<Integer, SXSSFCell>();
+ private final SortedMap<Integer, SXSSFCell> _cells = new TreeMap<>();
private short _style = -1; // index of cell style in style table
private short _height = -1; // row height in twips (1/20 point)
private boolean _zHeight; // row zero-height (this is somehow different than being hidden)
{
/*package*/ final XSSFSheet _sh;
private final SXSSFWorkbook _workbook;
- private final TreeMap<Integer,SXSSFRow> _rows=new TreeMap<Integer,SXSSFRow>();
+ private final TreeMap<Integer,SXSSFRow> _rows= new TreeMap<>();
private final SheetDataWriter _writer;
private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE;
private final AutoSizeColumnTracker _autoSizeColumnTracker;
private final XSSFWorkbook _wb;
- private final Map<SXSSFSheet,XSSFSheet> _sxFromXHash = new HashMap<SXSSFSheet,XSSFSheet>();
- private final Map<XSSFSheet,SXSSFSheet> _xFromSxHash = new HashMap<XSSFSheet,SXSSFSheet>();
+ private final Map<SXSSFSheet,XSSFSheet> _sxFromXHash = new HashMap<>();
+ private final Map<XSSFSheet,SXSSFSheet> _xFromSxHash = new HashMap<>();
private int _randomAccessWindowSize = DEFAULT_WINDOW_SIZE;
*/
@Override
public Iterator<Sheet> sheetIterator() {
- return new SheetIterator<Sheet>();
+ return new SheetIterator<>();
}
private final class SheetIterator<T extends Sheet> implements Iterator<T> {
return _tableCache;
}
// FIXME: use org.apache.commons.collections.map.CaseInsensitiveMap
- _tableCache = new HashMap<String, XSSFTable>();
+ _tableCache = new HashMap<>();
for (Sheet sheet : _uBook) {
for (XSSFTable tbl : ((XSSFSheet)sheet).getTables()) {
/**
* Interestingly, this is initialized after the enum instances, so using an {@link EnumMap} works.
*/
- private static final Map<XSSFBuiltinTableStyle, TableStyle> styleMap = new EnumMap<XSSFBuiltinTableStyle, TableStyle>(XSSFBuiltinTableStyle.class);
+ private static final Map<XSSFBuiltinTableStyle, TableStyle> styleMap = new EnumMap<>(XSSFBuiltinTableStyle.class);
private XSSFBuiltinTableStyle() {
}
*/
private CTChart chart;
- List<XSSFChartAxis> axis = new ArrayList<XSSFChartAxis>();
+ List<XSSFChartAxis> axis = new ArrayList<>();
/**
* Create a new SpreadsheetML chart
*/
@Override
public CellRangeAddress[] getFormattingRanges() {
- ArrayList<CellRangeAddress> lst = new ArrayList<CellRangeAddress>();
+ ArrayList<CellRangeAddress> lst = new ArrayList<>();
for (Object stRef : _cf.getSqref()) {
String[] regions = stRef.toString().split(" ");
for (final String region : regions) {
private final CTCfRule _cfRule;
private XSSFSheet _sh;
- private static Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<STCfType.Enum, ConditionType>();
- private static Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<STCfType.Enum, ConditionFilterType>();
+ private static Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<>();
+ private static Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<>();
static {
typeLookup.put(STCfType.CELL_IS, ConditionType.CELL_VALUE_IS);
typeLookup.put(STCfType.EXPRESSION, ConditionType.FORMULA);
private XSSFDataValidationConstraint validationConstraint;
private CellRangeAddressList regions;
- static Map<Integer,STDataValidationOperator.Enum> operatorTypeMappings = new HashMap<Integer,STDataValidationOperator.Enum>();
- static Map<STDataValidationOperator.Enum,Integer> operatorTypeReverseMappings = new HashMap<STDataValidationOperator.Enum,Integer>();
- static Map<Integer,STDataValidationType.Enum> validationTypeMappings = new HashMap<Integer,STDataValidationType.Enum>();
- static Map<STDataValidationType.Enum,Integer> validationTypeReverseMappings = new HashMap<STDataValidationType.Enum,Integer>();
- static Map<Integer,STDataValidationErrorStyle.Enum> errorStyleMappings = new HashMap<Integer,STDataValidationErrorStyle.Enum>();
+ static Map<Integer,STDataValidationOperator.Enum> operatorTypeMappings = new HashMap<>();
+ static Map<STDataValidationOperator.Enum,Integer> operatorTypeReverseMappings = new HashMap<>();
+ static Map<Integer,STDataValidationType.Enum> validationTypeMappings = new HashMap<>();
+ static Map<STDataValidationType.Enum,Integer> validationTypeReverseMappings = new HashMap<>();
+ static Map<Integer,STDataValidationErrorStyle.Enum> errorStyleMappings = new HashMap<>();
static {
errorStyleMappings.put(DataValidation.ErrorStyle.INFO, STDataValidationErrorStyle.INFORMATION);
}
CellRangeAddress[] cellRangeAddresses = cellRangeAddressList.getCellRangeAddresses();
- List<String> sqref = new ArrayList<String>();
+ List<String> sqref = new ArrayList<>();
for (int i = 0; i < cellRangeAddresses.length; i++) {
CellRangeAddress cellRangeAddress = cellRangeAddresses[i];
sqref.add(cellRangeAddress.formatAsString());
* Returns all charts in this drawing.
*/
public List<XSSFChart> getCharts() {
- List<XSSFChart> charts = new ArrayList<XSSFChart>();
+ List<XSSFChart> charts = new ArrayList<>();
for(POIXMLDocumentPart part : getRelations()) {
if(part instanceof XSSFChart) {
charts.add((XSSFChart)part);
* @return list of shapes in this drawing
*/
public List<XSSFShape> getShapes(){
- List<XSSFShape> lst = new ArrayList<XSSFShape>();
+ List<XSSFShape> lst = new ArrayList<>();
XmlCursor cur = drawing.newCursor();
try {
if (cur.toFirstChild()) {
* @return list of shapes in this shape group
*/
public List<XSSFShape> getShapes(XSSFShapeGroup groupshape){
- List<XSSFShape> lst = new ArrayList<XSSFShape>();
+ List<XSSFShape> lst = new ArrayList<>();
XmlCursor cur = groupshape.getCTGroupShape().newCursor();
try {
addShapes(cur, lst);
public EvaluationCell getCell(int rowIndex, int columnIndex) {
// cache for performance: ~30% speedup due to caching
if (_cellCache == null) {
- _cellCache = new HashMap<CellKey, EvaluationCell>(_xs.getLastRowNum()*3);
+ _cellCache = new HashMap<>(_xs.getLastRowNum() * 3);
for (final Row row : _xs) {
final int rowNum = row.getRowNum();
for (final Cell cell : row) {
* @return the list of Single Xml Cells that provide a map rule to this mapping.
*/
public List<XSSFSingleXmlCell> getRelatedSingleXMLCell() {
- List<XSSFSingleXmlCell> relatedSimpleXmlCells = new ArrayList<XSSFSingleXmlCell>();
+ List<XSSFSingleXmlCell> relatedSimpleXmlCells = new ArrayList<>();
int sheetNumber = mapInfo.getWorkbook().getNumberOfSheets();
for (int i = 0; i < sheetNumber; i++) {
* @return the list of all Tables that provide a map rule to this mapping
*/
public List<XSSFTable> getRelatedTables() {
- List<XSSFTable> tables = new ArrayList<XSSFTable>();
+ List<XSSFTable> tables = new ArrayList<>();
for (Sheet sheet : mapInfo.getWorkbook()) {
for (RelationPart rp : ((XSSFSheet)sheet).getRelationParts()) {
if (rp.getRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation())) {
@Beta
public List<Integer> getRowLabelColumns() {
if (pivotTableDefinition.getRowFields() != null) {
- List<Integer> columnIndexes = new ArrayList<Integer>();
+ List<Integer> columnIndexes = new ArrayList<>();
for (CTField f : pivotTableDefinition.getRowFields().getFieldArray()) {
columnIndexes.add(f.getX());
}
/**
* A map to lookup POIXMLRelation by its relation type
*/
- private static final Map<String, XSSFRelation> _table = new HashMap<String, XSSFRelation>();
+ private static final Map<String, XSSFRelation> _table = new HashMap<>();
public static final XSSFRelation WORKBOOK = new XSSFRelation(
TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){
int length = 0;
- TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>();
+ TreeMap<Integer, CTRPrElt> formats = new TreeMap<>();
//noinspection deprecation - for performance reasons!
for (CTRElt r : entry.getRArray()) {
String txt = r.getT();
protected XSSFRow(CTRow row, XSSFSheet sheet) {
_row = row;
_sheet = sheet;
- _cells = new TreeMap<Integer, XSSFCell>();
+ _cells = new TreeMap<>();
for (CTCell c : row.getCArray()) {
XSSFCell cell = new XSSFCell(this, c);
// Performance optimization for bug 57840: explicit boxing is slightly faster than auto-unboxing, though may use more memory
// Remove MergedRegions in dest row
final int destRowNum = getRowNum();
int index = 0;
- final Set<Integer> indices = new HashSet<Integer>();
+ final Set<Integer> indices = new HashSet<>();
for (CellRangeAddress destRegion : getSheet().getMergedRegions()) {
if (destRowNum == destRegion.getFirstRow() && destRowNum == destRegion.getLastRow()) {
indices.add(index);
protected CTSheet sheet;
protected CTWorksheet worksheet;
- private final SortedMap<Integer, XSSFRow> _rows = new TreeMap<Integer, XSSFRow>();
+ private final SortedMap<Integer, XSSFRow> _rows = new TreeMap<>();
private List<XSSFHyperlink> hyperlinks;
private ColumnHelper columnHelper;
private CommentsTable sheetComments;
worksheet = newSheet();
initRows(worksheet);
columnHelper = new ColumnHelper(worksheet);
- hyperlinks = new ArrayList<XSSFHyperlink>();
+ hyperlinks = new ArrayList<>();
}
private void initRows(CTWorksheet worksheetParam) {
_rows.clear();
- tables = new TreeMap<String, XSSFTable>();
- sharedFormulas = new HashMap<Integer, CTCellFormula>();
- arrayFormulas = new ArrayList<CellRangeAddress>();
+ tables = new TreeMap<>();
+ sharedFormulas = new HashMap<>();
+ arrayFormulas = new ArrayList<>();
for (CTRow row : worksheetParam.getSheetData().getRowArray()) {
XSSFRow r = new XSSFRow(row, this);
// Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory
* and initialize the internal array of XSSFHyperlink objects
*/
private void initHyperlinks() {
- hyperlinks = new ArrayList<XSSFHyperlink>();
+ hyperlinks = new ArrayList<>();
if(!worksheet.isSetHyperlinks()) {
return;
*/
@Override
public List<CellRangeAddress> getMergedRegions() {
- List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>();
+ List<CellRangeAddress> addresses = new ArrayList<>();
CTMergeCells ctMergeCells = worksheet.getMergeCells();
if(ctMergeCells == null) {
return addresses;
if (startRowNum > endRowNum) {
throw new IllegalArgumentException("getRows: startRowNum must be less than or equal to endRowNum");
}
- final List<XSSFRow> rows = new ArrayList<XSSFRow>();
+ final List<XSSFRow> rows = new ArrayList<>();
if (createRowIfMissing) {
for (int i = startRowNum; i <= endRowNum; i++) {
XSSFRow row = getRow(i);
}
CTMergeCells ctMergeCells = worksheet.getMergeCells();
- List<CTMergeCell> newMergeCells = new ArrayList<CTMergeCell>(ctMergeCells.sizeOfMergeCellArray());
+ List<CTMergeCell> newMergeCells = new ArrayList<>(ctMergeCells.sizeOfMergeCellArray());
int idx = 0;
for (CTMergeCell mc : ctMergeCells.getMergeCellArray()) {
throw new IllegalArgumentException("Specified row does not belong to this sheet");
}
// collect cells into a temporary array to avoid ConcurrentModificationException
- ArrayList<XSSFCell> cellsToDelete = new ArrayList<XSSFCell>();
+ ArrayList<XSSFCell> cellsToDelete = new ArrayList<>();
for (Cell cell : row) {
cellsToDelete.add((XSSFCell)cell);
}
// FIXME: (performance optimization) this should be moved outside the for-loop so that hyperlinks only needs to be iterated over once.
// also remove any hyperlinks associated with this row
if (hyperlinks != null) {
- for (XSSFHyperlink link : new ArrayList<XSSFHyperlink>(hyperlinks)) {
+ for (XSSFHyperlink link : new ArrayList<>(hyperlinks)) {
CellReference ref = new CellReference(link.getCellRef());
if (ref.getRow() == rownum) {
hyperlinks.remove(link);
// then do the actual moving and also adjust comments/rowHeight
// we need to sort it in a way so the shifting does not mess up the structures,
// i.e. when shifting down, start from down and go up, when shifting up, vice-versa
- SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<XSSFComment, Integer>(new Comparator<XSSFComment>() {
+ SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<>(new Comparator<XSSFComment>() {
@Override
public int compare(XSSFComment o1, XSSFComment o2) {
int row1 = o1.getRow();
int row2 = o2.getRow();
-
- if(row1 == row2) {
+
+ if (row1 == row2) {
// ordering is not important when row is equal, but don't return zero to still
// get multiple comments per row into the map
return o1.hashCode() - o2.hashCode();
}
// when shifting down, sort higher row-values first
- if(n > 0) {
+ if (n > 0) {
return row1 < row2 ? 1 : -1;
} else {
// sort lower-row values first when shifting up
rowShifter.updateHyperlinks(shifter);
//rebuild the _rows map
- Map<Integer, XSSFRow> map = new HashMap<Integer, XSSFRow>();
+ Map<Integer, XSSFRow> map = new HashMap<>();
for(XSSFRow r : _rows.values()) {
// Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory
final Integer rownumI = new Integer(r.getRowNum()); // NOSONAR
int lastColumn = range.getLastColumn();
int height = lastRow - firstRow + 1;
int width = lastColumn - firstColumn + 1;
- List<XSSFCell> temp = new ArrayList<XSSFCell>(height*width);
+ List<XSSFCell> temp = new ArrayList<>(height * width);
for (int rowIn = firstRow; rowIn <= lastRow; rowIn++) {
for (int colIn = firstColumn; colIn <= lastColumn; colIn++) {
XSSFRow row = getRow(rowIn);
@Override
public List<XSSFDataValidation> getDataValidations() {
- List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
+ List<XSSFDataValidation> xssfValidations = new ArrayList<>();
CTDataValidations dataValidations = this.worksheet.getDataValidations();
if( dataValidations!=null && dataValidations.getCount() > 0 ) {
for (CTDataValidation ctDataValidation : dataValidations.getDataValidationArray()) {
* Returns any tables associated with this Sheet
*/
public List<XSSFTable> getTables() {
- return new ArrayList<XSSFTable>(tables.values());
+ return new ArrayList<>(tables.values());
}
/**
*/
@Beta
public List<XSSFPivotTable> getPivotTables() {
- List<XSSFPivotTable> tables = new ArrayList<XSSFPivotTable>();
+ List<XSSFPivotTable> tables = new ArrayList<>();
for (XSSFPivotTable table : getWorkbook().getPivotTables()) {
if (table.getParent() == this) {
tables.add(table);
* @return Map of error type to the range(s) where they are ignored.
*/
public Map<IgnoredErrorType, Set<CellRangeAddress>> getIgnoredErrors() {
- Map<IgnoredErrorType, Set<CellRangeAddress>> result = new LinkedHashMap<IgnoredErrorType, Set<CellRangeAddress>>();
+ Map<IgnoredErrorType, Set<CellRangeAddress>> result = new LinkedHashMap<>();
if (worksheet.isSetIgnoredErrors()) {
for (CTIgnoredError err : worksheet.getIgnoredErrors().getIgnoredErrorList()) {
for (IgnoredErrorType errType : XSSFIgnoredErrorHelper.getErrorTypes(err)) {
if (!result.containsKey(errType)) {
- result.put(errType, new LinkedHashSet<CellRangeAddress>());
+ result.put(errType, new LinkedHashSet<>());
}
for (Object ref : err.getSqref()) {
result.get(errType).add(CellRangeAddress.valueOf(ref.toString()));
CellRangeAddress[] mergeCellRanges = CellRangeUtil.mergeCellRanges(regions);
CTConditionalFormatting cf = _sheet.getCTWorksheet().addNewConditionalFormatting();
- List<String> refs = new ArrayList<String>();
+ List<String> refs = new ArrayList<>();
for(CellRangeAddress a : mergeCellRanges) refs.add(a.formatAsString());
cf.setSqref(refs);
this.drawing = drawing;
this.ctShape = ctShape;
- _paragraphs = new ArrayList<XSSFTextParagraph>();
+ _paragraphs = new ArrayList<>();
// initialize any existing paragraphs - this will be the default body paragraph in a new shape,
// or existing paragraphs that have been loaded from the file
public String getText() {
final int MAX_LEVELS = 9;
StringBuilder out = new StringBuilder();
- List<Integer> levelCount = new ArrayList<Integer>(MAX_LEVELS); // maximum 9 levels
+ List<Integer> levelCount = new ArrayList<>(MAX_LEVELS); // maximum 9 levels
XSSFTextParagraph p = null;
// initialise the levelCount array - this maintains a record of the numbering to be used at each level
*/
public List<XSSFXmlColumnPr> getXmlColumnPrs() {
if (xmlColumnPr==null) {
- xmlColumnPr = new ArrayList<XSSFXmlColumnPr>();
+ xmlColumnPr = new ArrayList<>();
for (CTTableColumn column: getTableColumns()) {
if (column.getXmlColumnPr()!=null) {
XSSFXmlColumnPr columnPr = new XSSFXmlColumnPr(this,column,column.getXmlColumnPr());
if (columnMap == null) {
// FIXME: replace with org.apache.commons.collections.map.CaseInsensitiveMap
final int count = getTableColumns().length;
- columnMap = new HashMap<String, Integer>(count * 3 / 2);
+ columnMap = new HashMap<>(count * 3 / 2);
int i = 0;
for (CTTableColumn column : getTableColumns()) {
private final String name;
private final int index;
- private final Map<TableStyleType, DifferentialStyleProvider> elementMap = new EnumMap<TableStyleType, DifferentialStyleProvider>(TableStyleType.class);
+ private final Map<TableStyleType, DifferentialStyleProvider> elementMap = new EnumMap<>(TableStyleType.class);
/**
* @param index style definition index or built-in ordinal depending on use
this.name = tableStyle.getName();
this.index = index;
- List<CTDxf> dxfList = new ArrayList<CTDxf>();
+ List<CTDxf> dxfList = new ArrayList<>();
// CT* classes don't handle "mc:AlternateContent" elements, so get the Dxf instances manually
XmlCursor cur = dxfs.newCursor();
XSSFTextParagraph(CTTextParagraph p, CTShape ctShape){
_p = p;
_shape = ctShape;
- _runs = new ArrayList<XSSFTextRun>();
+ _runs = new ArrayList<>();
for(XmlObject ch : _p.selectPath("*")){
if(ch instanceof CTRegularTextRun){
*/
private static final Pattern ptrn_shapeId = Pattern.compile("_x0000_s(\\d+)");
- private List<QName> _qnames = new ArrayList<QName>();
- private List<XmlObject> _items = new ArrayList<XmlObject>();
+ private List<QName> _qnames = new ArrayList<>();
+ private List<XmlObject> _items = new ArrayList<>();
private String _shapeTypeId;
private int _shapeId = 1024;
}
XmlObject root = XmlObject.Factory.parse(doc, DEFAULT_XML_OPTIONS);
- _qnames = new ArrayList<QName>();
- _items = new ArrayList<XmlObject>();
+ _qnames = new ArrayList<>();
+ _items = new ArrayList<>();
for(XmlObject obj : root.selectPath("$this/xml/*")) {
Node nd = obj.getDomNode();
QName qname = new QName(nd.getNamespaceURI(), nd.getLocalName());
}
// Create arrays for parts attached to the workbook itself
- pivotTables = new ArrayList<XSSFPivotTable>();
- pivotCaches = new ArrayList<CTPivotCache>();
+ pivotTables = new ArrayList<>();
+ pivotCaches = new ArrayList<>();
}
@Override
this.workbook = doc.getWorkbook();
ThemesTable theme = null;
- Map<String, XSSFSheet> shIdMap = new HashMap<String, XSSFSheet>();
- Map<String, ExternalLinksTable> elIdMap = new HashMap<String, ExternalLinksTable>();
+ Map<String, XSSFSheet> shIdMap = new HashMap<>();
+ Map<String, ExternalLinksTable> elIdMap = new HashMap<>();
for(RelationPart rp : getRelationParts()){
POIXMLDocumentPart p = rp.getDocumentPart();
if(p instanceof SharedStringsTable) {
// Load individual sheets. The order of sheets is defined by the order
// of CTSheet elements in the workbook
- sheets = new ArrayList<XSSFSheet>(shIdMap.size());
+ sheets = new ArrayList<>(shIdMap.size());
//noinspection deprecation
for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) {
parseSheet(shIdMap, ctSheet);
// Load the external links tables. Their order is defined by the order
// of CTExternalReference elements in the workbook
- externalLinks = new ArrayList<ExternalLinksTable>(elIdMap.size());
+ externalLinks = new ArrayList<>(elIdMap.size());
if (this.workbook.isSetExternalReferences()) {
for (CTExternalReference er : this.workbook.getExternalReferences().getExternalReferenceArray()) {
ExternalLinksTable el = elIdMap.get(er.getId());
stylesSource = (StylesTable)createRelationship(XSSFRelation.STYLES, XSSFFactory.getInstance());
stylesSource.setWorkbook(this);
- namedRanges = new ArrayList<XSSFName>();
- namedRangesByName = new ArrayListValuedHashMap<String, XSSFName>();
- sheets = new ArrayList<XSSFSheet>();
- pivotTables = new ArrayList<XSSFPivotTable>();
+ namedRanges = new ArrayList<>();
+ namedRangesByName = new ArrayListValuedHashMap<>();
+ sheets = new ArrayList<>();
+ pivotTables = new ArrayList<>();
}
/**
public List<XSSFPictureData> getAllPictures() {
if(pictures == null){
List<PackagePart> mediaParts = getPackage().getPartsByName(Pattern.compile("/xl/media/.*?"));
- pictures = new ArrayList<XSSFPictureData>(mediaParts.size());
+ pictures = new ArrayList<>(mediaParts.size());
for(PackagePart part : mediaParts){
pictures.add(new XSSFPictureData(part));
}
*/
@Override
public Iterator<Sheet> sheetIterator() {
- return new SheetIterator<Sheet>();
+ return new SheetIterator<>();
}
/**
}
//adjust indices of names ranges
- List<XSSFName> toRemove = new ArrayList<XSSFName>();
+ List<XSSFName> toRemove = new ArrayList<>();
for (XSSFName nm : namedRanges) {
CTDefinedName ct = nm.getCTName();
if(!ct.isSetLocalSheetId()) {
}
private void reprocessNamedRanges() {
- namedRangesByName = new ArrayListValuedHashMap<String, XSSFName>();
- namedRanges = new ArrayList<XSSFName>();
+ namedRangesByName = new ArrayListValuedHashMap<>();
+ namedRanges = new ArrayList<>();
if(workbook.isSetDefinedNames()) {
for(CTDefinedName ctName : workbook.getDefinedNames().getDefinedNameArray()) {
createAndStoreName(ctName);
*/
@Override
public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
- List<PackagePart> embedds = new LinkedList<PackagePart>();
+ List<PackagePart> embedds = new LinkedList<>();
for(XSSFSheet sheet : sheets){
// Get the embeddings for the workbook
* @return a collection of custom XML mappings defined in this workbook
*/
public Collection<XSSFMap> getCustomXMLMappings(){
- return mapInfo == null ? new ArrayList<XSSFMap>() : mapInfo.getAllXSSFMaps();
+ return mapInfo == null ? new ArrayList<>() : mapInfo.getAllXSSFMaps();
}
/**
cache.setCacheId(tableId);
cache.setId(rId);
if(pivotCaches == null) {
- pivotCaches = new ArrayList<CTPivotCache>();
+ pivotCaches = new ArrayList<>();
}
pivotCaches.add(cache);
return cache;
private List<Series> series;
public XSSFLineChartData() {
- series = new ArrayList<Series>();
+ series = new ArrayList<>();
}
static class Series extends AbstractXSSFChartSeries implements LineChartSeries {
private List<Series> series;
public XSSFScatterChartData() {
- series = new ArrayList<Series>();
+ series = new ArrayList<>();
}
/**
}
public void cleanColumns() {
- TreeSet<CTCol> trackedCols = new TreeSet<CTCol>(CTColComparator.BY_MIN_MAX);
+ TreeSet<CTCol> trackedCols = new TreeSet<>(CTColComparator.BY_MIN_MAX);
CTCols newCols = CTCols.Factory.newInstance();
CTCols[] colsArray = worksheet.getColsArray();
int i = 0;
// class then we could keep trackedCols as state,
// making this log(N) rather than Nlog(N). We do this for the initial
// read above.
- TreeSet<CTCol> trackedCols = new TreeSet<CTCol>(
+ TreeSet<CTCol> trackedCols = new TreeSet<>(
CTColComparator.BY_MIN_MAX);
trackedCols.addAll(cols.getColList());
addCleanColIntoCols(cols, newCol, trackedCols);
private List<CTCol> getOverlappingCols(final CTCol newCol, final TreeSet<CTCol> trackedCols) {
CTCol lower = trackedCols.lower(newCol);
NavigableSet<CTCol> potentiallyOverlapping = lower == null ? trackedCols : trackedCols.tailSet(lower, overlaps(lower, newCol));
- List<CTCol> overlapping = new ArrayList<CTCol>();
+ List<CTCol> overlapping = new ArrayList<>();
for (CTCol existing : potentiallyOverlapping) {
if (overlaps(newCol, existing)) {
overlapping.add(existing);
}
public static Set<IgnoredErrorType> getErrorTypes(CTIgnoredError err) {
- Set<IgnoredErrorType> result = new LinkedHashSet<IgnoredErrorType>();
+ Set<IgnoredErrorType> result = new LinkedHashSet<>();
for (IgnoredErrorType errType : IgnoredErrorType.values()) {
if (XSSFIgnoredErrorHelper.isSet(errType, err)) {
result.add(errType);
for (int j = conditionalFormattingArray.length - 1; j >= 0; j--) {
CTConditionalFormatting cf = conditionalFormattingArray[j];
- ArrayList<CellRangeAddress> cellRanges = new ArrayList<CellRangeAddress>();
+ ArrayList<CellRangeAddress> cellRanges = new ArrayList<>();
for (Object stRef : cf.getSqref()) {
String[] regions = stRef.toString().split(" ");
for (String region : regions) {
}
boolean changed = false;
- List<CellRangeAddress> temp = new ArrayList<CellRangeAddress>();
+ List<CellRangeAddress> temp = new ArrayList<>();
for (CellRangeAddress craOld : cellRanges) {
CellRangeAddress craNew = shiftRange(shifter, craOld, sheetIndex);
if (craNew == null) {
ctWorksheet.removeConditionalFormatting(j);
continue;
}
- List<String> refs = new ArrayList<String>();
+ List<String> refs = new ArrayList<>();
for(CellRangeAddress a : temp) refs.add(a.formatAsString());
cf.setSqref(refs);
}
ZIG_ZAG_STITCH(191);
- private static Map<Integer, Borders> imap = new HashMap<Integer, Borders>();
+ private static Map<Integer, Borders> imap = new HashMap<>();
static {
for (Borders p : values()) {
*/
ALL(4);
- private static Map<Integer, BreakClear> imap = new HashMap<Integer, BreakClear>();
+ private static Map<Integer, BreakClear> imap = new HashMap<>();
static {
for (BreakClear p : values()) {
*/
TEXT_WRAPPING(3);
- private static Map<Integer, BreakType> imap = new HashMap<Integer, BreakType>();
+ private static Map<Integer, BreakType> imap = new HashMap<>();
static {
for (BreakType p : values()) {
AT_LEAST(3);
- private static Map<Integer, LineSpacingRule> imap = new HashMap<Integer, LineSpacingRule>();
+ private static Map<Integer, LineSpacingRule> imap = new HashMap<>();
static {
for (LineSpacingRule p : values()) {
LOW_KASHIDA(9),
THAI_DISTRIBUTE(10);
- private static Map<Integer, ParagraphAlignment> imap = new HashMap<Integer, ParagraphAlignment>();
+ private static Map<Integer, ParagraphAlignment> imap = new HashMap<>();
static {
for (ParagraphAlignment p : values()) {
*/
AUTO(5);
- private static Map<Integer, TextAlignment> imap = new HashMap<Integer, TextAlignment>();
+ private static Map<Integer, TextAlignment> imap = new HashMap<>();
static {
for (TextAlignment p : values()) {
*/
NONE(18);
- private static Map<Integer, UnderlinePatterns> imap = new HashMap<Integer, UnderlinePatterns>();
+ private static Map<Integer, UnderlinePatterns> imap = new HashMap<>();
static {
for (UnderlinePatterns p : values()) {
*/
SUBSCRIPT(3);
- private static Map<Integer, VerticalAlign> imap = new HashMap<Integer, VerticalAlign>();
+ private static Map<Integer, VerticalAlign> imap = new HashMap<>();
static {
for (VerticalAlign p : values()) {
public class XWPFDocument extends POIXMLDocument implements Document, IBody {
private static final POILogger LOG = POILogFactory.getLogger(XWPFDocument.class);
- protected List<XWPFFooter> footers = new ArrayList<XWPFFooter>();
- protected List<XWPFHeader> headers = new ArrayList<XWPFHeader>();
- protected List<XWPFComment> comments = new ArrayList<XWPFComment>();
- protected List<XWPFHyperlink> hyperlinks = new ArrayList<XWPFHyperlink>();
- protected List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>();
- protected List<XWPFTable> tables = new ArrayList<XWPFTable>();
- protected List<XWPFSDT> contentControls = new ArrayList<XWPFSDT>();
- protected List<IBodyElement> bodyElements = new ArrayList<IBodyElement>();
- protected List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>();
- protected Map<Long, List<XWPFPictureData>> packagePictures = new HashMap<Long, List<XWPFPictureData>>();
- protected Map<Integer, XWPFFootnote> endnotes = new HashMap<Integer, XWPFFootnote>();
+ protected List<XWPFFooter> footers = new ArrayList<>();
+ protected List<XWPFHeader> headers = new ArrayList<>();
+ protected List<XWPFComment> comments = new ArrayList<>();
+ protected List<XWPFHyperlink> hyperlinks = new ArrayList<>();
+ protected List<XWPFParagraph> paragraphs = new ArrayList<>();
+ protected List<XWPFTable> tables = new ArrayList<>();
+ protected List<XWPFSDT> contentControls = new ArrayList<>();
+ protected List<IBodyElement> bodyElements = new ArrayList<>();
+ protected List<XWPFPictureData> pictures = new ArrayList<>();
+ protected Map<Long, List<XWPFPictureData>> packagePictures = new HashMap<>();
+ protected Map<Integer, XWPFFootnote> endnotes = new HashMap<>();
protected XWPFNumbering numbering;
protected XWPFStyles styles;
protected XWPFFootnotes footnotes;
*/
@Override
public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
- List<PackagePart> embedds = new LinkedList<PackagePart>();
+ List<PackagePart> embedds = new LinkedList<>();
// Get the embeddings for the workbook
PackagePart part = getPackagePart();
* @return all Pictures in this package
*/
public List<XWPFPictureData> getAllPackagePictures() {
- List<XWPFPictureData> result = new ArrayList<XWPFPictureData>();
+ List<XWPFPictureData> result = new ArrayList<>();
Collection<List<XWPFPictureData>> values = packagePictures.values();
for (List<XWPFPictureData> list : values) {
result.addAll(list);
void registerPackagePictureData(XWPFPictureData picData) {
List<XWPFPictureData> list = packagePictures.get(picData.getChecksum());
if (list == null) {
- list = new ArrayList<XWPFPictureData>(1);
+ list = new ArrayList<>(1);
packagePictures.put(picData.getChecksum(), list);
}
if (!list.contains(picData)) {
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
public class XWPFFootnote implements Iterable<XWPFParagraph>, IBody {
- private List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>();
- private List<XWPFTable> tables = new ArrayList<XWPFTable>();
- private List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>();
- private List<IBodyElement> bodyElements = new ArrayList<IBodyElement>();
+ private List<XWPFParagraph> paragraphs = new ArrayList<>();
+ private List<XWPFTable> tables = new ArrayList<>();
+ private List<XWPFPictureData> pictures = new ArrayList<>();
+ private List<IBodyElement> bodyElements = new ArrayList<>();
private CTFtnEdn ctFtnEdn;
private XWPFFootnotes footnotes;
*/
public class XWPFFootnotes extends POIXMLDocumentPart {
protected XWPFDocument document;
- private List<XWPFFootnote> listFootnote = new ArrayList<XWPFFootnote>();
+ private List<XWPFFootnote> listFootnote = new ArrayList<>();
private CTFootnotes ctFootnotes;
/**
* Parent of XWPF headers and footers
*/
public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBody {
- List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>();
- List<XWPFTable> tables = new ArrayList<XWPFTable>();
- List<XWPFPictureData> pictures = new ArrayList<XWPFPictureData>();
- List<IBodyElement> bodyElements = new ArrayList<IBodyElement>();
+ List<XWPFParagraph> paragraphs = new ArrayList<>();
+ List<XWPFTable> tables = new ArrayList<>();
+ List<XWPFPictureData> pictures = new ArrayList<>();
+ List<IBodyElement> bodyElements = new ArrayList<>();
CTHdrFtr headerFooter;
XWPFDocument document;
}
public void readHdrFtr() {
- bodyElements = new ArrayList<IBodyElement>();
- paragraphs = new ArrayList<XWPFParagraph>();
- tables = new ArrayList<XWPFTable>();
+ bodyElements = new ArrayList<>();
+ paragraphs = new ArrayList<>();
+ tables = new ArrayList<>();
// parse the document with cursor and add
// the XmlObject to its lists
XmlCursor cursor = headerFooter.newCursor();
* @author Philipp Epp
*/
public class XWPFNumbering extends POIXMLDocumentPart {
- protected List<XWPFAbstractNum> abstractNums = new ArrayList<XWPFAbstractNum>();
- protected List<XWPFNum> nums = new ArrayList<XWPFNum>();
+ protected List<XWPFAbstractNum> abstractNums = new ArrayList<>();
+ protected List<XWPFNum> nums = new ArrayList<>();
boolean isNew;
private CTNumbering ctNumbering;
* create a new XWPFNumbering object for use in a new document
*/
public XWPFNumbering() {
- abstractNums = new ArrayList<XWPFAbstractNum>();
- nums = new ArrayList<XWPFNum>();
+ abstractNums = new ArrayList<>();
+ nums = new ArrayList<>();
isNew = true;
}
}
// Build up the character runs
- runs = new ArrayList<XWPFRun>();
- iruns = new ArrayList<IRunElement>();
+ runs = new ArrayList<>();
+ iruns = new ArrayList<>();
buildRunsInOrderFromXml(paragraph);
// Look for bits associated with the runs
/**
* A map to lookup POIXMLRelation by its relation type
*/
- private static final Map<String, XWPFRelation> _table = new HashMap<String, XWPFRelation>();
+ private static final Map<String, XWPFRelation> _table = new HashMap<>();
public static final XWPFRelation DOCUMENT = new XWPFRelation(
"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",
// Look for any text in any of our pictures or drawings
StringBuilder text = new StringBuilder();
- List<XmlObject> pictTextObjs = new ArrayList<XmlObject>();
+ List<XmlObject> pictTextObjs = new ArrayList<>();
pictTextObjs.addAll(Arrays.asList(r.getPictArray()));
pictTextObjs.addAll(Arrays.asList(r.getDrawingArray()));
for (XmlObject o : pictTextObjs) {
// Do we have any embedded pictures?
// (They're a different CTPicture, under the drawingml namespace)
- pictures = new ArrayList<XWPFPicture>();
+ pictures = new ArrayList<>();
for (XmlObject o : pictTextObjs) {
for (CTPicture pict : getCTPictures(o)) {
XWPFPicture picture = new XWPFPicture(pict, this);
}
private List<CTPicture> getCTPictures(XmlObject o) {
- List<CTPicture> pics = new ArrayList<CTPicture>();
+ List<CTPicture> pics = new ArrayList<>();
XmlObject[] picts = o.selectPath("declare namespace pic='" + CTPicture.type.getName().getNamespaceURI() + "' .//pic:pic");
for (XmlObject pict : picts) {
if (pict instanceof XmlAnyTypeImpl) {
// private final IBody part;
// private final XWPFDocument document;
- private List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>();
- private List<XWPFTable> tables = new ArrayList<XWPFTable>();
- private List<XWPFRun> runs = new ArrayList<XWPFRun>();
- private List<XWPFSDT> contentControls = new ArrayList<XWPFSDT>();
- private List<ISDTContents> bodyElements = new ArrayList<ISDTContents>();
+ private List<XWPFParagraph> paragraphs = new ArrayList<>();
+ private List<XWPFTable> tables = new ArrayList<>();
+ private List<XWPFRun> runs = new ArrayList<>();
+ private List<XWPFSDT> contentControls = new ArrayList<>();
+ private List<ISDTContents> bodyElements = new ArrayList<>();
public XWPFSDTContent(CTSdtContentRun sdtRun, IBody part, IRunBody parent) {
for (CTR ctr : sdtRun.getRArray()) {
*/
public class XWPFStyles extends POIXMLDocumentPart {
private CTStyles ctStyles;
- private List<XWPFStyle> listStyle = new ArrayList<XWPFStyle>();
+ private List<XWPFStyle> listStyle = new ArrayList<>();
private XWPFLatentStyles latentStyles;
private XWPFDefaultRunStyle defaultRunStyle;
* @return a list of all styles which were used by this method
*/
public List<XWPFStyle> getUsedStyleList(XWPFStyle style) {
- List<XWPFStyle> usedStyleList = new ArrayList<XWPFStyle>();
+ List<XWPFStyle> usedStyleList = new ArrayList<>();
usedStyleList.add(style);
return getUsedStyleList(style, usedStyleList);
}
static {
// populate enum maps
- xwpfBorderTypeMap = new EnumMap<XWPFBorderType, STBorder.Enum>(XWPFBorderType.class);
+ xwpfBorderTypeMap = new EnumMap<>(XWPFBorderType.class);
xwpfBorderTypeMap.put(XWPFBorderType.NIL, STBorder.Enum.forInt(STBorder.INT_NIL));
xwpfBorderTypeMap.put(XWPFBorderType.NONE, STBorder.Enum.forInt(STBorder.INT_NONE));
xwpfBorderTypeMap.put(XWPFBorderType.SINGLE, STBorder.Enum.forInt(STBorder.INT_SINGLE));
xwpfBorderTypeMap.put(XWPFBorderType.DASHED, STBorder.Enum.forInt(STBorder.INT_DASHED));
xwpfBorderTypeMap.put(XWPFBorderType.DOT_DASH, STBorder.Enum.forInt(STBorder.INT_DOT_DASH));
- stBorderTypeMap = new HashMap<Integer, XWPFBorderType>();
+ stBorderTypeMap = new HashMap<>();
stBorderTypeMap.put(STBorder.INT_NIL, XWPFBorderType.NIL);
stBorderTypeMap.put(STBorder.INT_NONE, XWPFBorderType.NONE);
stBorderTypeMap.put(STBorder.INT_SINGLE, XWPFBorderType.SINGLE);
this.part = part;
this.ctTbl = table;
- tableRows = new ArrayList<XWPFTableRow>();
+ tableRows = new ArrayList<>();
// is an empty table: I add one row and one column as default
if (table.sizeOfTrArray() == 0)
static {
// populate enum maps
- alignMap = new EnumMap<XWPFVertAlign, STVerticalJc.Enum>(XWPFVertAlign.class);
+ alignMap = new EnumMap<>(XWPFVertAlign.class);
alignMap.put(XWPFVertAlign.TOP, STVerticalJc.Enum.forInt(STVerticalJc.INT_TOP));
alignMap.put(XWPFVertAlign.CENTER, STVerticalJc.Enum.forInt(STVerticalJc.INT_CENTER));
alignMap.put(XWPFVertAlign.BOTH, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTH));
alignMap.put(XWPFVertAlign.BOTTOM, STVerticalJc.Enum.forInt(STVerticalJc.INT_BOTTOM));
- stVertAlignTypeMap = new HashMap<Integer, XWPFVertAlign>();
+ stVertAlignTypeMap = new HashMap<>();
stVertAlignTypeMap.put(STVerticalJc.INT_TOP, XWPFVertAlign.TOP);
stVertAlignTypeMap.put(STVerticalJc.INT_CENTER, XWPFVertAlign.CENTER);
stVertAlignTypeMap.put(STVerticalJc.INT_BOTH, XWPFVertAlign.BOTH);
// NB: If a table cell does not include at least one block-level element, then this document shall be considered corrupt.
if (cell.sizeOfPArray() < 1)
cell.addNewP();
- bodyElements = new ArrayList<IBodyElement>();
- paragraphs = new ArrayList<XWPFParagraph>();
- tables = new ArrayList<XWPFTable>();
+ bodyElements = new ArrayList<>();
+ paragraphs = new ArrayList<>();
+ tables = new ArrayList<>();
XmlCursor cursor = ctTc.newCursor();
cursor.selectPath("./*");
*/
public List<ICell> getTableICells() {
- List<ICell> cells = new ArrayList<ICell>();
+ List<ICell> cells = new ArrayList<>();
//Can't use ctRow.getTcList because that only gets table cells
//Can't use ctRow.getSdtList because that only gets sdts that are at cell level
XmlCursor cursor = ctRow.newCursor();
*/
public List<XWPFTableCell> getTableCells() {
if (tableCells == null) {
- List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>();
+ List<XWPFTableCell> cells = new ArrayList<>();
for (CTTc tableCell : ctRow.getTcArray()) {
cells.add(new XWPFTableCell(tableCell, this, table.getBody()));
}
}
private static void traverse(POIXMLDocument doc) throws IOException{
- HashMap<String,POIXMLDocumentPart> context = new HashMap<String,POIXMLDocumentPart>();
+ HashMap<String,POIXMLDocumentPart> context = new HashMap<>();
for (RelationPart p : doc.getRelationParts()){
traverse(p, context);
}
POIXMLDocumentPart part = new POIXMLDocumentPart();
part.prepareForCommit();
part.commit();
- part.onSave(new HashSet<PackagePart>());
+ part.onSave(new HashSet<>());
assertNull(part.getRelationById(null));
assertNull(part.getRelationId(null));
Date dateCreated = LocaleUtil.getLocaleCalendar(2010, 6, 15, 10, 0, 0).getTime();
- cp.setCreated(new Nullable<Date>(dateCreated));
+ cp.setCreated(new Nullable<>(dateCreated));
assertEquals(dateCreated, cp.getCreated());
XWPFDocument doc2 = XWPFTestDataSamples.writeOutAndReadBack(doc);
*/
@Test
public void testGetDirectory() {
- TreeMap<String, String> expectedValue = new TreeMap<String, String>();
+ TreeMap<String, String> expectedValue = new TreeMap<>();
expectedValue.put("/dir1/test.doc", "/dir1");
expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2");
@Override
protected void setUp() throws Exception {
- values = new TreeMap<PackagePartName, String>();
+ values = new TreeMap<>();
// Expected values
- expectedValues = new TreeMap<PackagePartName, String>();
+ expectedValues = new TreeMap<>();
expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"),
"application/vnd.openxmlformats-package.relationships+xml");
TreeMap<PackagePartName, String> expectedValues;
TreeMap<PackagePartName, String> values;
- values = new TreeMap<PackagePartName, String>();
+ values = new TreeMap<>();
// Expected values
- expectedValues = new TreeMap<PackagePartName, String>();
+ expectedValues = new TreeMap<>();
expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"),
"application/vnd.openxmlformats-package.relationships+xml");
TreeMap<PackagePartName, String> expectedValues;
TreeMap<PackagePartName, String> values;
- values = new TreeMap<PackagePartName, String>();
+ values = new TreeMap<>();
// Expected values
- expectedValues = new TreeMap<PackagePartName, String>();
+ expectedValues = new TreeMap<>();
expectedValues.put(PackagingURIHelper.createPartName("/_rels/.rels"),
"application/vnd.openxmlformats-package.relationships+xml");
OPCPackage pkg = OPCPackage.open(filepath, PackageAccess.READ_WRITE);
try {
List<PackagePart> rs = pkg.getPartsByName(Pattern.compile("/word/.*?\\.xml"));
- HashMap<String, PackagePart> selected = new HashMap<String, PackagePart>();
+ HashMap<String, PackagePart> selected = new HashMap<>();
for(PackagePart p : rs)
selected.put(p.getPartName().getName(), p);
props.setKeywordsProperty("MyKeywords");
props.setLanguageProperty("MyLanguage");
props.setLastModifiedByProperty("Julien Chable");
- props.setLastPrintedProperty(new Nullable<Date>(dateToInsert));
- props.setModifiedProperty(new Nullable<Date>(dateToInsert));
+ props.setLastPrintedProperty(new Nullable<>(dateToInsert));
+ props.setModifiedProperty(new Nullable<>(dateToInsert));
props.setRevisionProperty("2");
props.setTitleProperty("MyTitle");
props.setSubjectProperty("MySubject");
props.setCreatedProperty((String)null);
assertEquals("", props.getCreatedPropertyString());
assertNull(props.getCreatedProperty().getValue());
- props.setCreatedProperty(new Nullable<Date>());
+ props.setCreatedProperty(new Nullable<>());
assertEquals("", props.getCreatedPropertyString());
assertNull(props.getCreatedProperty().getValue());
- props.setCreatedProperty(new Nullable<Date>(date));
+ props.setCreatedProperty(new Nullable<>(date));
assertEquals(strDate, props.getCreatedPropertyString());
assertEquals(date, props.getCreatedProperty().getValue());
props.setCreatedProperty(strDate);
props.setLastPrintedProperty((String)null);
assertEquals("", props.getLastPrintedPropertyString());
assertNull(props.getLastPrintedProperty().getValue());
- props.setLastPrintedProperty(new Nullable<Date>());
+ props.setLastPrintedProperty(new Nullable<>());
assertEquals("", props.getLastPrintedPropertyString());
assertNull(props.getLastPrintedProperty().getValue());
- props.setLastPrintedProperty(new Nullable<Date>(date));
+ props.setLastPrintedProperty(new Nullable<>(date));
assertEquals(strDate, props.getLastPrintedPropertyString());
assertEquals(date, props.getLastPrintedProperty().getValue());
props.setLastPrintedProperty(strDate);
assertNull(props.getModifiedProperty().getValue());
props.setModifiedProperty((String)null);
assertNull(props.getModifiedProperty().getValue());
- props.setModifiedProperty(new Nullable<Date>());
+ props.setModifiedProperty(new Nullable<>());
assertNull(props.getModifiedProperty().getValue());
- props.setModifiedProperty(new Nullable<Date>(date));
+ props.setModifiedProperty(new Nullable<>(date));
assertEquals(strDate, props.getModifiedPropertyString());
assertEquals(date, props.getModifiedProperty().getValue());
props.setModifiedProperty(strDate);
File filename) throws IOException {
// store the zip content in memory
// let s assume it is not Go ;-)
- TreeMap<String, ByteArrayOutputStream> zipContent = new TreeMap<String, ByteArrayOutputStream>();
+ TreeMap<String, ByteArrayOutputStream> zipContent = new TreeMap<>();
byte data[] = new byte[BUFFER_SIZE];
/* Open file to decompress */
HashAlgorithm haList[] = { HashAlgorithm.sha1, HashAlgorithm.sha256, HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.md5 };
ChainingMode cmList[] = { ChainingMode.cbc, ChainingMode.cfb };
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
for (CipherAlgorithm ca : caList) {
for (HashAlgorithm ha : haList) {
for (ChainingMode cm : cmList) {
sic.setOpcPackage(pkg);
SignatureInfo si = new SignatureInfo();
si.setSignatureConfig(sic);
- List<X509Certificate> result = new ArrayList<X509Certificate>();
+ List<X509Certificate> result = new ArrayList<>();
for (SignaturePart sp : si.getSignatureParts()) {
if (sp.validate()) {
result.add(sp.getSigner());
sic.setOpcPackage(pkg);
SignatureInfo si = new SignatureInfo();
si.setSignatureConfig(sic);
- List<X509Certificate> result = new ArrayList<X509Certificate>();
+ List<X509Certificate> result = new ArrayList<>();
for (SignaturePart sp : si.getSignatureParts()) {
if (sp.validate()) {
result.add(sp.getSigner());
sic.setOpcPackage(pkg);
SignatureInfo si = new SignatureInfo();
si.setSignatureConfig(sic);
- List<X509Certificate> result = new ArrayList<X509Certificate>();
+ List<X509Certificate> result = new ArrayList<>();
for (SignaturePart sp : si.getSignatureParts()) {
if (sp.validate()) {
result.add(sp.getSigner());
si.setSignatureConfig(sic);
// hash > sha1 doesn't work in excel viewer ...
si.confirmSignature();
- List<X509Certificate> result = new ArrayList<X509Certificate>();
+ List<X509Certificate> result = new ArrayList<>();
for (SignaturePart sp : si.getSignatureParts()) {
if (sp.validate()) {
result.add(sp.getSigner());
* We need at least 2 certificates for the XAdES-C complete certificate
* refs construction.
*/
- List<X509Certificate> certificateChain = new ArrayList<X509Certificate>();
+ List<X509Certificate> certificateChain = new ArrayList<>();
certificateChain.add(x509);
certificateChain.add(x509);
signatureConfig.setSigningCertificateChain(certificateChain);
Key key = keystore.getKey("poitest", password.toCharArray());
Certificate chainList[] = keystore.getCertificateChain("poitest");
- List<X509Certificate> certChain = new ArrayList<X509Certificate>();
+ List<X509Certificate> certChain = new ArrayList<>();
for (Certificate c : chainList) {
certChain.add((X509Certificate)c);
}
// verify: signature
si.getSignatureConfig().setOpcPackage(pkgCopy);
- List<X509Certificate> result = new ArrayList<X509Certificate>();
+ List<X509Certificate> result = new ArrayList<>();
for (SignaturePart sp : si.getSignatureParts()) {
if (sp.validate()) {
result.add(sp.getSigner());
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = img.createGraphics();
- Map<String,String> fallbackMap = new HashMap<String,String>();
+ Map<String,String> fallbackMap = new HashMap<>();
fallbackMap.put("NoSuchFont", "Mona");
// in XSLF the fonts default to the theme fonts (Calibri), if the font group is not overridden
// see XSLFTextRun.XSLFTextInfo.getCTTextFont
fis.close();
EmbeddedExtractor ee = new EmbeddedExtractor();
- List<EmbeddedData> edList = new ArrayList<EmbeddedData>();
+ List<EmbeddedData> edList = new ArrayList<>();
for (Sheet s : wb) {
edList.addAll(ee.extractAll(s));
}
fis.close();
EmbeddedExtractor ee = new EmbeddedExtractor();
- List<EmbeddedData> edList = new ArrayList<EmbeddedData>();
+ List<EmbeddedData> edList = new ArrayList<>();
for (Sheet s : wb) {
edList.addAll(ee.extractAll(s));
}
@Test
public void testNullMaster() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(2L, "B2");
base.put(3L, "B3");
- testIteration(new CombinedIterable<String>(base, null), "B1", "B2",
+ testIteration(new CombinedIterable<>(base, null), "B1", "B2",
"B3");
}
@Test
public void testNoMatchesBaseFirst() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(2L, "B2");
base.put(3L, "B3");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(4L, "M4");
master.put(5L, "M5");
master.put(6L, "M6");
- testIteration(new CombinedIterable<String>(base, master), "B1", "B2",
+ testIteration(new CombinedIterable<>(base, master), "B1", "B2",
"B3", "M4", "M5", "M6");
}
@Test
public void testNoMatchesMasterFirst() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(4L, "B4");
base.put(5L, "B5");
base.put(6L, "B6");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(1L, "M1");
master.put(2L, "M2");
master.put(3L, "M3");
- testIteration(new CombinedIterable<String>(base, master), "M1", "M2",
+ testIteration(new CombinedIterable<>(base, master), "M1", "M2",
"M3", "B4", "B5", "B6");
}
@Test
public void testInterleaved1() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(3L, "B3");
base.put(5L, "B5");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(2L, "M2");
master.put(4L, "M4");
master.put(6L, "M6");
- testIteration(new CombinedIterable<String>(base, master), "B1", "M2",
+ testIteration(new CombinedIterable<>(base, master), "B1", "M2",
"B3", "M4", "B5", "M6");
}
@Test
public void testInterleaved2() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(2L, "B2");
base.put(5L, "B5");
base.put(6L, "B6");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(3L, "M3");
master.put(4L, "M4");
master.put(7L, "M7");
master.put(8L, "M8");
- testIteration(new CombinedIterable<String>(base, master), "B1", "B2",
+ testIteration(new CombinedIterable<>(base, master), "B1", "B2",
"M3", "M4", "B5", "B6", "M7", "M8");
}
@Test
public void testAllMatching() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(2L, "B2");
base.put(3L, "B3");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(1L, "M1");
master.put(2L, "M2");
master.put(3L, "M3");
- testIteration(new CombinedIterable<String>(base, master), "B1", "B2",
+ testIteration(new CombinedIterable<>(base, master), "B1", "B2",
"B3");
}
@Test
public void testAllMatching2() {
- SortedMap<Long, String> base = new TreeMap<Long, String>();
+ SortedMap<Long, String> base = new TreeMap<>();
base.put(1L, "B1");
base.put(2L, "B2");
base.put(3L, "B3");
- SortedMap<Long, String> master = new TreeMap<Long, String>();
+ SortedMap<Long, String> master = new TreeMap<>();
master.put(1L, "M1");
master.put(2L, "M2");
master.put(3L, "M3");
master.put(4L, "M4");
- testIteration(new CombinedIterable<String>(base, master), "B1", "B2",
+ testIteration(new CombinedIterable<>(base, master), "B1", "B2",
"B3", "M4");
}
}
@Parameters(name="{0}")
public static Collection<String> data() {
- final Set<String> data = new TreeSet<String>();
+ final Set<String> data = new TreeSet<>();
for (String f : files.split(", ?")) {
if (basedir == null) {
data.add(f);
strData.setPtArray(null); // unset old axis text
numData.setPtArray(null); // unset old values
- Map<String, Double> pieModel = new LinkedHashMap<String, Double>();
+ Map<String, Double> pieModel = new LinkedHashMap<>();
pieModel.put("First", 1.0);
pieModel.put("Second", 3.0);
pieModel.put("Third", 4.0);
XMLSlideShow ppt2 = XSLFTestDataSamples.writeOutAndReadBack(ppt1);
ppt1.close();
// pictures keyed by file name
- Map<String, XSLFPictureData> pics = new HashMap<String, XSLFPictureData>();
+ Map<String, XSLFPictureData> pics = new HashMap<>();
for(XSLFPictureData p : ppt2.getPictureData()){
pics.put(p.getFileName(), p);
}
// an instance of all SXSSFWorkbooks opened by this TestDataProvider,
// so that the temporary files created can be disposed up by cleanup()
- private final Collection<SXSSFWorkbook> instances = new ArrayList<SXSSFWorkbook>();
+ private final Collection<SXSSFWorkbook> instances = new ArrayList<>();
private SXSSFITestDataProvider() {
// enforce singleton
private List<String> getSheets(String testFileName) throws Exception {
OPCPackage pkg = OPCPackage.open(_ssTests.openResourceAsStream(testFileName));
- List<String> sheetTexts = new ArrayList<String>();
+ List<String> sheetTexts = new ArrayList<>();
XSSFBReader r = new XSSFBReader(pkg);
// assertNotNull(r.getWorkbookData());
OPCPackage pkg = XSSFTestDataSamples.openSamplePackage("61034.xlsx");
XSSFReader reader = new XSSFReader(pkg);
XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) reader.getSheetsData();
- Set<String> seen = new HashSet<String>();
+ Set<String> seen = new HashSet<>();
while (iter.hasNext()) {
InputStream stream = iter.next();
String sheetName = iter.getSheetName();
ExcelExtractor ole2Extractor =
new ExcelExtractor(HSSFTestDataSamples.openSampleWorkbook("SampleSS.xls"));
- Map<String, POITextExtractor> extractors = new HashMap<String, POITextExtractor>();
+ Map<String, POITextExtractor> extractors = new HashMap<>();
extractors.put("SampleSS.xlsx", ooxmlExtractor);
extractors.put("SampleSS.xls", ole2Extractor);
}
private List<String> readStrings(String filename) throws IOException {
- List<String> strs = new ArrayList<String>();
+ List<String> strs = new ArrayList<>();
POIDataSamples samples = POIDataSamples.getSpreadSheetInstance();
BufferedReader br = new BufferedReader(
new InputStreamReader(samples.openResourceAsStream(filename), "UTF-8"));
simple = XSSFTestDataSamples.openSampleWorkbook(testFileSimple);
complex = XSSFTestDataSamples.openSampleWorkbook(testFileComplex);
// Files and descriptions
- Map<String,XSSFWorkbook> workbooks = new LinkedHashMap<String, XSSFWorkbook>();
+ Map<String,XSSFWorkbook> workbooks = new LinkedHashMap<>();
workbooks.put(testFileSimple, simple);
workbooks.put("Re-Saved_" + testFileSimple, simpleRS);
workbooks.put(testFileComplex, complex);
// afterwards, a test function can check whether these files were encrypted or not
public class TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource extends SXSSFWorkbookWithCustomZipEntrySource {
- private final List<File> tempFiles = new ArrayList<File>();
+ private final List<File> tempFiles = new ArrayList<>();
List<File> getTempFiles() {
- return new ArrayList<File>(tempFiles);
+ return new ArrayList<>(tempFiles);
}
@Override
private AutoSizeColumnTracker tracker;
private static final SortedSet<Integer> columns;
static {
- SortedSet<Integer>_columns = new TreeSet<Integer>();
+ SortedSet<Integer>_columns = new TreeSet<>();
_columns.add(0);
_columns.add(1);
_columns.add(3);
public void trackAndUntrackColumn() {
assumeTrue(tracker.getTrackedColumns().isEmpty());
tracker.trackColumn(0);
- Set<Integer> expected = new HashSet<Integer>();
+ Set<Integer> expected = new HashSet<>();
expected.add(0);
assertEquals(expected, tracker.getTrackedColumns());
tracker.untrackColumn(0);
private static final SortedSet<Integer> columns;
static {
- SortedSet<Integer>_columns = new TreeSet<Integer>();
+ SortedSet<Integer>_columns = new TreeSet<>();
_columns.add(0);
_columns.add(1);
_columns.add(3);
sheet = workbook.createSheet();
sheet.trackColumnForAutoSizing(0);
- SortedSet<Integer> expected = new TreeSet<Integer>();
+ SortedSet<Integer> expected = new TreeSet<>();
expected.add(0);
assertEquals(expected, sheet.getTrackedColumnsForAutoSizing());
sheet = workbook.createSheet();
sheet.trackColumnsForAutoSizing(columns);
- SortedSet<Integer> sorted = new TreeSet<Integer>(columns);
+ SortedSet<Integer> sorted = new TreeSet<>(columns);
assertEquals(sorted, sheet.getTrackedColumnsForAutoSizing());
sheet.autoSizeColumn(sorted.first(), useMergedCells);
sheet = workbook.getSheetAt( 0 );
evaluator = new XSSFFormulaEvaluator(workbook);
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
processFunctionGroup(data, SS.START_OPERATORS_ROW_INDEX, null);
processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null);
sheet = workbook.getSheet( SS.TEST_SHEET_NAME );
evaluator = new XSSFFormulaEvaluator(workbook);
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null);
* .xlsx supports 64000 cell styles, the style indexes after
* 32,767 must not be -32,768, then -32,767, -32,766
*/
- @SuppressWarnings("resource")
@Test
public void bug57880() throws IOException {
int numStyles = 33000;
}
assertEquals(numStyles, wb.getNumCellStyles());
- // avoid OOM in gump run
+ // avoid OOM in Gump run
File file = XSSFTestDataSamples.writeOutAndClose(wb, "bug57880");
//noinspection UnusedAssignment
wb = null;
assertNotNull(sheet);
Map<String, Object[]> data;
- data = new TreeMap<String, Object[]>();
+ data = new TreeMap<>();
data.put("1", new Object[]{"ID", "NAME", "LASTNAME"});
data.put("2", new Object[]{2, "Amit", "Shukla"});
data.put("3", new Object[]{1, "Lokesh", "Gupta"});
public void test51998() throws IOException {
Workbook wb = XSSFTestDataSamples.openSampleWorkbook("51998.xlsx");
- Set<String> sheetNames = new HashSet<String>();
+ Set<String> sheetNames = new HashSet<>();
for (int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
sheetNames.add(wb.getSheetName(sheetNum));
// Everything is fine at this point, cell is red
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put(CellUtil.BORDER_BOTTOM, BorderStyle.THIN);
CellUtil.setCellStyleProperties(cell, properties);
}
// Setup the environment
- Map<String,FormulaEvaluator> evaluators = new HashMap<String, FormulaEvaluator>();
+ Map<String,FormulaEvaluator> evaluators = new HashMap<>();
evaluators.put("ref2-56737.xlsx", evaluator);
evaluators.put("56737.xlsx",
_testDataProvider.openSampleWorkbook("56737.xlsx").getCreationHelper().createFormulaEvaluator());
sheet.addMergedRegion(region_3);
sheet.addMergedRegion(region_4);
// test invalid indexes OOBE
- Set<Integer> rmIdx = new HashSet<Integer>(Arrays.asList(5,6));
+ Set<Integer> rmIdx = new HashSet<>(Arrays.asList(5, 6));
sheet.removeMergedRegions(rmIdx);
- rmIdx = new HashSet<Integer>(Arrays.asList(1,3));
+ rmIdx = new HashSet<>(Arrays.asList(1, 3));
sheet.removeMergedRegions(rmIdx);
assertEquals("A1:B2", ctWorksheet.getMergeCells().getMergeCellArray(0).getRef());
assertEquals("E5:F6", ctWorksheet.getMergeCells().getMergeCellArray(1).getRef());
// read the original sheet header order
XSSFRow row = wb1.getSheetAt(0).getRow(0);
- List<String> headers = new ArrayList<String>();
+ List<String> headers = new ArrayList<>();
for (Cell cell : row) {
headers.add(cell.getStringCellValue());
}
* @see #testXmlAttached()
*/
public void testXmlDetached(){
- List<CTRow> rows = new ArrayList<CTRow>();
+ List<CTRow> rows = new ArrayList<>();
int i = 0;
try {
for(;;){
*/
public void testXmlAttached(){
printMemoryUsage("before");
- List<CTRow> rows = new ArrayList<CTRow>();
+ List<CTRow> rows = new ArrayList<>();
int i = 0;
//top-level element in sheet.xml
CTWorksheet sh = CTWorksheet.Factory.newInstance();
public void testNewLinesBetweenRuns() throws Exception {
XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug55142.docx");
List<AbstractXWPFSDT> sdts = extractAllSDTs(doc);
- List<String> targs = new ArrayList<String>();
+ List<String> targs = new ArrayList<>();
//these test newlines and tabs in paragraphs/body elements
targs.add("Rich-text1 abcdefghi");
targs.add("Rich-text2 abcd\t\tefgh");
private List<AbstractXWPFSDT> extractAllSDTs(XWPFDocument doc) {
- List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>();
+ List<AbstractXWPFSDT> sdts = new ArrayList<>();
List<XWPFHeader> headers = doc.getHeaderList();
for (XWPFHeader header : headers) {
}
private List<AbstractXWPFSDT> extractSDTsFromBodyElements(List<IBodyElement> elements) {
- List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>();
+ List<AbstractXWPFSDT> sdts = new ArrayList<>();
for (IBodyElement e : elements) {
if (e instanceof XWPFSDT) {
XWPFSDT sdt = (XWPFSDT) e;
private List<AbstractXWPFSDT> extractSDTsFromTable(XWPFTable table) {
- List<AbstractXWPFSDT> sdts = new ArrayList<AbstractXWPFSDT>();
+ List<AbstractXWPFSDT> sdts = new ArrayList<>();
for (XWPFTableRow r : table.getRows()) {
for (ICell c : r.getTableICells()) {
if (c instanceof XWPFSDTCell) {
@Test
public void testGetUsedStyles() throws IOException {
XWPFDocument sampleDoc = XWPFTestDataSamples.openSampleDocument("Styles.docx");
- List<XWPFStyle> testUsedStyleList = new ArrayList<XWPFStyle>();
+ List<XWPFStyle> testUsedStyleList = new ArrayList<>();
XWPFStyles styles = sampleDoc.getStyles();
XWPFStyle style = styles.getStyle("berschrift1");
testUsedStyleList.add(style);
// Loop over the definitions, building the commands
// and getting their values
- ArrayList<Command> commandList = new ArrayList<Command>();
+ ArrayList<Command> commandList = new ArrayList<>();
for(CommandDefinition cdef : commandDefinitions) {
int type = cdef.getType();
int offset = cdef.getOffset();
/**
* Key is a Chunk's type, value is an array of its CommandDefinitions
*/
- private final Map<Integer, CommandDefinition[]> chunkCommandDefinitions =
- new HashMap<Integer, CommandDefinition[]>();
+ private final Map<Integer, CommandDefinition[]> chunkCommandDefinitions =
+ new HashMap<>();
/**
* What the name is of the chunk table definitions file?
* This file comes from the scratchpad resources directory.
throw new IllegalStateException("Expecting start xxx, found " + line);
}
int chunkType = Integer.parseInt(line.substring(6));
- ArrayList<CommandDefinition> defsL = new ArrayList<CommandDefinition>();
+ ArrayList<CommandDefinition> defsL = new ArrayList<>();
// Data entries
while( (line = inp.readLine()) != null ) {
* @return An array of each Text item in the document
*/
public String[] getAllText() {
- ArrayList<String> text = new ArrayList<String>();
+ ArrayList<String> text = new ArrayList<>();
for(Stream stream : hdgf.getTopLevelStreams()) {
findText(stream, text);
}
* Process the contents of the stream out into chunks
*/
public void findChunks() {
- ArrayList<Chunk> chunksA = new ArrayList<Chunk>();
+ ArrayList<Chunk> chunksA = new ArrayList<>();
if(getPointer().getOffset() == 0x64b3) {
int i = 0;
private static class HemfPlusParser {
public static List<HemfPlusRecord> parse(byte[] bytes) {
- List<HemfPlusRecord> records = new ArrayList<HemfPlusRecord>();
+ List<HemfPlusRecord> records = new ArrayList<>();
int offset = 0;
while (offset < bytes.length) {
if (offset + 12 > bytes.length) {
int currentOffset = 4 + 16;//4 public comment identifier, 16 for outputrect
long countFormats = LittleEndian.getUInt(rawBytes, currentOffset);
currentOffset += LittleEndianConsts.INT_SIZE;
- List<EmrFormat> emrFormatList = new ArrayList<EmrFormat>();
+ List<EmrFormat> emrFormatList = new ArrayList<>();
for (long i = 0; i < countFormats; i++) {
emrFormatList.add(new EmrFormat(rawBytes, currentOffset));
currentOffset += 4 * LittleEndianConsts.INT_SIZE;
}
- List<HemfMultiFormatsData> list = new ArrayList<HemfMultiFormatsData>();
+ List<HemfMultiFormatsData> list = new ArrayList<>();
for (EmrFormat emrFormat : emrFormatList) {
byte[] data = IOUtils.safelyAllocate(emrFormat.size, MAX_RECORD_LENGTH);
System.arraycopy(rawBytes, emrFormat.offset-4, data, 0, emrFormat.size);
* and list methods to get all of them.
*/
public final class Attachment {
- private final List<TNEFAttribute> attributes = new ArrayList<TNEFAttribute>();
- private final List<MAPIAttribute> mapiAttributes = new ArrayList<MAPIAttribute>();
+ private final List<TNEFAttribute> attributes = new ArrayList<>();
+ private final List<MAPIAttribute> mapiAttributes = new ArrayList<>();
protected void addAttribute(TNEFAttribute attr) {
attributes.add(attr);
@SuppressWarnings("unused")
private int fileId;
- private final List<TNEFAttribute> messageAttributes = new ArrayList<TNEFAttribute>();
- private final List<MAPIAttribute> mapiAttributes = new ArrayList<MAPIAttribute>();
- private final List<Attachment> attachments = new ArrayList<Attachment>();
+ private final List<TNEFAttribute> messageAttributes = new ArrayList<>();
+ private final List<MAPIAttribute> mapiAttributes = new ArrayList<>();
+ private final List<Attachment> attachments = new ArrayList<>();
public HMEFMessage(InputStream inp) throws IOException {
try {
// First up, get the number of attributes
int count = LittleEndian.readInt(inp);
- List<MAPIAttribute> attrs = new ArrayList<MAPIAttribute>();
+ List<MAPIAttribute> attrs = new ArrayList<>();
// Now, read each one in in turn
for(int i=0; i<count; i++) {
* ones, so we can't just re-use the HSMF ones.
*/
public final class TNEFProperty {
- private static Map<Integer, List<TNEFProperty>> properties = new HashMap<Integer, List<TNEFProperty>>();
+ private static Map<Integer, List<TNEFProperty>> properties = new HashMap<>();
// Types taken from http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefattributetype%28v=EXCHG.140%29.aspx
public static final int TYPE_TRIPLES = 0x0000;
// Store it for lookup
if(! properties.containsKey(id)) {
- properties.put(id, new ArrayList<TNEFProperty>());
+ properties.put(id, new ArrayList<>());
}
properties.get(id).add(this);
}
DefaultEscherRecordFactory erf =
new DefaultEscherRecordFactory();
- ArrayList<EscherRecord> ec = new ArrayList<EscherRecord>();
+ ArrayList<EscherRecord> ec = new ArrayList<>();
byte data[] = getData();
int left = data.length;
while(left > 0) {
}
public List<OLEShape> getOLEShapes() {
- List<OLEShape> list = new ArrayList<OLEShape>();
+ List<OLEShape> list = new ArrayList<>();
for (HSLFSlide slide : _slides) {
for (HSLFShape shape : slide.getShapes()) {
// Not currently using _notes, as that can have the notes of
// master sheets in. Grab Slide list, then work from there,
// but ensure no duplicates
- Set<Integer> seenNotes = new HashSet<Integer>();
+ Set<Integer> seenNotes = new HashSet<>();
String headerText = "";
String footerText = "";
HeadersFooters hf = _show.getNotesHeadersFooters();
* strings, one per text record
*/
public List<String> getTextAsVector() {
- List<String> textV = new ArrayList<String>();
+ List<String> textV = new ArrayList<>();
// Set to the start of the file
int walkPos = 0;
}
}
- private List<TabStop> tabStops = new ArrayList<TabStop>();
+ private List<TabStop> tabStops = new ArrayList<>();
public TabStopPropCollection() {
super(0, 0x100000, "tabStops");
@Override
public TabStopPropCollection clone() {
TabStopPropCollection other = (TabStopPropCollection)super.clone();
- other.tabStops = new ArrayList<TabStop>();
+ other.tabStops = new ArrayList<>();
for (TabStop ts : tabStops) {
TabStop tso = new TabStop(ts.getPosition(), ts.getType());
other.tabStops.add(tso);
// indentLevel is only valid for paragraph collection
// if it's set to -1, it must be omitted - see 2.9.36 TextMasterStyleLevel
private short indentLevel;
- private final Map<String,TextProp> textProps = new HashMap<String,TextProp>();
+ private final Map<String,TextProp> textProps = new HashMap<>();
private int maskSpecial;
private final TextPropType textPropType;
/** Fetch the TextProps that define this styling in the record order */
public List<TextProp> getTextPropList() {
- List<TextProp> orderedList = new ArrayList<TextProp>();
+ List<TextProp> orderedList = new ArrayList<>();
for (TextProp potProp : getPotentialProperties()) {
TextProp textProp = textProps.get(potProp.getName());
if (textProp != null) {
}
public void removeSlideListWithText(SlideListWithText slwt) {
- ArrayList<SlideListWithText> lst = new ArrayList<SlideListWithText>();
+ ArrayList<SlideListWithText> lst = new ArrayList<>();
for(SlideListWithText s : slwts) {
if(s != slwt) lst.add(s);
else {
* Returns all the ExHyperlinks
*/
public ExHyperlink[] getExHyperlinks() {
- ArrayList<ExHyperlink> links = new ArrayList<ExHyperlink>();
+ ArrayList<ExHyperlink> links = new ArrayList<>();
for(int i=0; i<_children.length; i++) {
if(_children[i] instanceof ExHyperlink) {
links.add( (ExHyperlink)_children[i] );
*/
public final class FontCollection extends RecordContainer {
- private final Map<String,HSLFFontInfo> fonts = new LinkedHashMap<String,HSLFFontInfo>();
+ private final Map<String,HSLFFontInfo> fonts = new LinkedHashMap<>();
private byte[] _header;
protected FontCollection(byte[] source, int start, int len) {
*/
public class HSLFEscherClientDataRecord extends EscherClientDataRecord {
- private final List<Record> _childRecords = new ArrayList<Record>();
+ private final List<Record> _childRecords = new ArrayList<>();
public List<? extends Record> getHSLFChildRecords() {
return _childRecords;
// Find our children
_children = Record.findChildRecords(source,start+8,len-8);
- ArrayList<TxMasterStyleAtom> tx = new ArrayList<TxMasterStyleAtom>();
- ArrayList<ColorSchemeAtom> clr = new ArrayList<ColorSchemeAtom>();
+ ArrayList<TxMasterStyleAtom> tx = new ArrayList<>();
+ ArrayList<ColorSchemeAtom> clr = new ArrayList<>();
// Find the interesting ones in there
for(int i=0; i<_children.length; i++) {
if(_children[i] instanceof SlideAtom) {
LittleEndian.putShort(_header, 2, (short)getRecordType());
LittleEndian.putInt(_header, 4, _data.length);
- indents = new ArrayList<IndentProp>();
+ indents = new ArrayList<>();
}
/**
*/
private void read() {
int pos = 0;
- indents = new ArrayList<IndentProp>(_data.length/6);
+ indents = new ArrayList<>(_data.length / 6);
while (pos <= _data.length - 6) {
int count = LittleEndian.getInt(_data, pos);
private byte[] _header;
private long _type;
- private final List<EscherRecord> childRecords = new ArrayList<EscherRecord>();
+ private final List<EscherRecord> childRecords = new ArrayList<>();
private EscherTextboxWrapper[] textboxWrappers;
//cached EscherDgRecord
textboxWrappers = findInDgContainer(dgContainer);
} else {
// Find and EscherTextboxRecord's, and wrap them up
- final List<EscherTextboxWrapper> textboxes = new ArrayList<EscherTextboxWrapper>();
+ final List<EscherTextboxWrapper> textboxes = new ArrayList<>();
findEscherTextboxRecord(childRecords, textboxes);
this.textboxWrappers = textboxes.toArray(new EscherTextboxWrapper[textboxes.size()]);
}
}
private EscherTextboxWrapper[] findInDgContainer(final EscherContainerRecord dgContainer) {
- final List<EscherTextboxWrapper> found = new LinkedList<EscherTextboxWrapper>();
+ final List<EscherTextboxWrapper> found = new LinkedList<>();
final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer);
final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer);
for (EscherContainerRecord spContainer : spContainers) {
protected EscherContainerRecord[] findAllEscherContainerRecordOfType(RecordTypes type, EscherContainerRecord parent) {
if (null == parent) { return new EscherContainerRecord[0]; }
final List<EscherContainerRecord> children = parent.getChildContainers();
- final List<EscherContainerRecord> result = new LinkedList<EscherContainerRecord>();
+ final List<EscherContainerRecord> result = new LinkedList<>();
for (EscherContainerRecord child : children) {
if (type.typeID == child.getRecordId()) {
result.add(child);
}
public StyleTextProp9Atom[] getNumberedListInfo() {
- final List<StyleTextProp9Atom> result = new LinkedList<StyleTextProp9Atom>();
+ final List<StyleTextProp9Atom> result = new LinkedList<>();
EscherContainerRecord dgContainer = getDgContainer();
final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer);
final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer);
// base number for these entries
// count * 32 bit offsets
// Repeat as many times as you have data
- _slideLocations = new HashMap<Integer,Integer>();
+ _slideLocations = new HashMap<>();
_ptrData = new byte[len-8];
System.arraycopy(source,start+8,_ptrData,0,_ptrData.length);
}
private void normalizePersistDirectory() {
- TreeMap<Integer,Integer> orderedSlideLocations = new TreeMap<Integer,Integer>(_slideLocations);
+ TreeMap<Integer,Integer> orderedSlideLocations = new TreeMap<>(_slideLocations);
@SuppressWarnings("resource")
BufAccessBAOS bos = new BufAccessBAOS(); // NOSONAR
* Default method for finding child records of a container record
*/
public static Record[] findChildRecords(byte[] b, int start, int len) {
- List<Record> children = new ArrayList<Record>(5);
+ List<Record> children = new ArrayList<>(5);
// Jump our little way along, creating records as we go
int pos = start;
*/
public Record removeChild(Record ch) {
Record rm = null;
- ArrayList<Record> lst = new ArrayList<Record>();
+ ArrayList<Record> lst = new ArrayList<>();
for(Record r : _children) {
if(r != ch) {
lst.add(r);
private static final Map<Short,RecordTypes> LOOKUP;
static {
- LOOKUP = new HashMap<Short,RecordTypes>();
+ LOOKUP = new HashMap<>();
for(RecordTypes s : values()) {
LOOKUP.put(s.typeID, s);
}
// Group our children together into SlideAtomsSets
// That way, model layer code can just grab the sets to use,
// without having to try to match the children together
- List<SlideAtomsSet> sets = new ArrayList<SlideAtomsSet>();
+ List<SlideAtomsSet> sets = new ArrayList<>();
for(int i=0; i<_children.length; i++) {
if(_children[i] instanceof SlidePersistAtom) {
// Find where the next SlidePersistAtom is
*/
protected StyleTextProp9Atom(byte[] source, int start, int len) {
// Get the header.
- final List<TextPFException9> schemes = new LinkedList<TextPFException9>();
+ final List<TextPFException9> schemes = new LinkedList<>();
header = new byte[8];
System.arraycopy(source,start, header,0,8);
this.version = LittleEndian.getShort(header, 0);
reserved = new byte[0];
// Set empty lists, ready for when they call setParentTextSize
- paragraphStyles = new ArrayList<TextPropCollection>();
- charStyles = new ArrayList<TextPropCollection>();
+ paragraphStyles = new ArrayList<>();
+ charStyles = new ArrayList<>();
}
LittleEndian.putInt(_header,4,10);
// Set empty paragraph and character styles
- paragraphStyles = new ArrayList<TextPropCollection>();
- charStyles = new ArrayList<TextPropCollection>();
+ paragraphStyles = new ArrayList<>();
+ charStyles = new ArrayList<>();
addParagraphTextPropCollection(parentTextSize);
addCharacterTextPropCollection(parentTextSize);
public TextSpecInfoRun[] getTextSpecInfoRuns(){
LittleEndianByteArrayInputStream bis = new LittleEndianByteArrayInputStream(_data); // NOSONAR
- List<TextSpecInfoRun> lst = new ArrayList<TextSpecInfoRun>();
+ List<TextSpecInfoRun> lst = new ArrayList<>();
while (bis.available() > 0) {
lst.add(new TextSpecInfoRun(bis));
}
short levels = LittleEndian.getShort(_data, 0);
pos += LittleEndian.SHORT_SIZE;
- paragraphStyles = new ArrayList<TextPropCollection>(levels);
- charStyles = new ArrayList<TextPropCollection>(levels);
+ paragraphStyles = new ArrayList<>(levels);
+ charStyles = new ArrayList<>(levels);
for(short i = 0; i < levels; i++) {
TextPropCollection prprops = new TextPropCollection(0, TextPropType.paragraph);
Rectangle2D bounds = path.getBounds2D();
PathIterator it = path.getPathIterator(new AffineTransform());
- List<byte[]> segInfo = new ArrayList<byte[]>();
- List<Point2D.Double> pntInfo = new ArrayList<Point2D.Double>();
+ List<byte[]> segInfo = new ArrayList<>();
+ List<Point2D.Double> pntInfo = new ArrayList<>();
boolean isClosed = false;
int numPoints = 0;
while (!it.isDone()) {
public List<HSLFShape> getShapes() {
// Our escher container record should contain several
// SpContainers, the first of which is the group shape itself
- List<HSLFShape> shapeList = new ArrayList<HSLFShape>();
+ List<HSLFShape> shapeList = new ArrayList<>();
boolean isFirst = true;
for (EscherRecord r : getSpContainer()) {
if (isFirst) {
*/
@SuppressWarnings("resource")
protected static List<HSLFHyperlink> find(List<HSLFTextParagraph> paragraphs){
- List<HSLFHyperlink> lst = new ArrayList<HSLFHyperlink>();
+ List<HSLFHyperlink> lst = new ArrayList<>();
if (paragraphs == null || paragraphs.isEmpty()) return lst;
HSLFTextParagraph firstPara = paragraphs.get(0);
HSLFEscherClientDataRecord cldata = shape.getClientData(false);
if (exobj != null && cldata != null) {
- List<HSLFHyperlink> lst = new ArrayList<HSLFHyperlink>();
+ List<HSLFHyperlink> lst = new ArrayList<>();
find(cldata.getHSLFChildRecords(), exobj, lst);
return lst.isEmpty() ? null : lst.get(0);
}
public final class HSLFNotes extends HSLFSheet implements Notes<HSLFShape,HSLFTextParagraph> {
protected static final POILogger logger = POILogFactory.getLogger(HSLFNotes.class);
- private List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>();
+ private List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>();
/**
* Constructs a Notes Sheet from the given Notes record.
throw new IllegalStateException("spgr not found");
}
- List<HSLFShape> shapeList = new ArrayList<HSLFShape>();
+ List<HSLFShape> shapeList = new ArrayList<>();
boolean isFirst = true;
for (EscherRecord r : spgr) {
if (isFirst) {
public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTextParagraph> {
private int _slideNo;
private SlideAtomsSet _atomSet;
- private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>();
+ private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>();
private HSLFNotes _notes; // usermodel needs to set this
/**
* @author Yegor Kozlov
*/
public final class HSLFSlideMaster extends HSLFMasterSheet {
- private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>();
+ private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>();
/**
* all TxMasterStyleAtoms available in this master
enum LoadSavePhase {
INIT, LOADED
}
- private static final ThreadLocal<LoadSavePhase> loadSavePhase = new ThreadLocal<LoadSavePhase>();
+ private static final ThreadLocal<LoadSavePhase> loadSavePhase = new ThreadLocal<>();
// What we're based on
private final HSLFSlideShowImpl _hslfSlideShow;
private Document _documentRecord;
// Friendly objects for people to deal with
- private final List<HSLFSlideMaster> _masters = new ArrayList<HSLFSlideMaster>();
- private final List<HSLFTitleMaster> _titleMasters = new ArrayList<HSLFTitleMaster>();
- private final List<HSLFSlide> _slides = new ArrayList<HSLFSlide>();
- private final List<HSLFNotes> _notes = new ArrayList<HSLFNotes>();
+ private final List<HSLFSlideMaster> _masters = new ArrayList<>();
+ private final List<HSLFTitleMaster> _titleMasters = new ArrayList<>();
+ private final List<HSLFSlide> _slides = new ArrayList<>();
+ private final List<HSLFNotes> _notes = new ArrayList<>();
private FontCollection _fonts;
// For logging
*/
private void findMostRecentCoreRecords() {
// To start with, find the most recent in the byte offset domain
- Map<Integer,Integer> mostRecentByBytes = new HashMap<Integer,Integer>();
+ Map<Integer,Integer> mostRecentByBytes = new HashMap<>();
for (Record record : _hslfSlideShow.getRecords()) {
if (record instanceof PersistPtrHolder) {
PersistPtrHolder pph = (PersistPtrHolder) record;
// We'll also want to be able to turn the slide IDs into a position
// in this array
- _sheetIdToCoreRecordsLookup = new HashMap<Integer,Integer>();
+ _sheetIdToCoreRecordsLookup = new HashMap<>();
Integer[] allIDs = mostRecentByBytes.keySet().toArray(new Integer[mostRecentByBytes.size()]);
Arrays.sort(allIDs);
for (int i = 0; i < allIDs.length; i++) {
_sheetIdToCoreRecordsLookup.put(allIDs[i], i);
}
- Map<Integer,Integer> mostRecentByBytesRev = new HashMap<Integer,Integer>(mostRecentByBytes.size());
+ Map<Integer,Integer> mostRecentByBytesRev = new HashMap<>(mostRecentByBytes.size());
for (Map.Entry<Integer,Integer> me : mostRecentByBytes.entrySet()) {
mostRecentByBytesRev.put(me.getValue(), me.getKey());
}
findMasterSlides();
// Having sorted out the masters, that leaves the notes and slides
- Map<Integer,Integer> slideIdToNotes = new HashMap<Integer,Integer>();
+ Map<Integer,Integer> slideIdToNotes = new HashMap<>();
// Start by finding the notes records
findNotesSlides(slideIdToNotes);
_slides.get(newSlideNumber - 1).setSlideNumber(newSlideNumber);
_slides.get(oldSlideNumber - 1).setSlideNumber(oldSlideNumber);
- ArrayList<Record> lst = new ArrayList<Record>();
+ ArrayList<Record> lst = new ArrayList<>();
for (SlideAtomsSet s : sas) {
lst.add(s.getSlidePersistAtom());
lst.addAll(Arrays.asList(s.getSlideRecords()));
SlideListWithText slwt = _documentRecord.getSlideSlideListWithText();
SlideAtomsSet[] sas = slwt.getSlideAtomsSets();
- List<Record> records = new ArrayList<Record>();
- List<SlideAtomsSet> sa = new ArrayList<SlideAtomsSet>(Arrays.asList(sas));
+ List<Record> records = new ArrayList<>();
+ List<SlideAtomsSet> sa = new ArrayList<>(Arrays.asList(sas));
HSLFSlide removedSlide = _slides.remove(index);
_notes.remove(removedSlide.getNotes());
int notesId = removedSlide.getSlideRecord().getSlideAtom().getNotesID();
if (notesId != 0) {
SlideListWithText nslwt = _documentRecord.getNotesSlideListWithText();
- records = new ArrayList<Record>();
- ArrayList<SlideAtomsSet> na = new ArrayList<SlideAtomsSet>();
+ records = new ArrayList<>();
+ ArrayList<SlideAtomsSet> na = new ArrayList<>();
for (SlideAtomsSet ns : nslwt.getSlideAtomsSets()) {
if (ns.getSlidePersistAtom().getSlideIdentifier() == notesId) {
continue;
}
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);
olemap.put("Workbook", ClassID.EXCEL97); // as per BIFF8 spec
olemap.put("WORKBOOK", ClassID.EXCEL97); // Typically from third party programs
// As we go along, update, and hand over, to any Position Dependent
// records we happen across
Map<RecordTypes,PositionDependentRecord> interestingRecords =
- new HashMap<RecordTypes,PositionDependentRecord>();
+ new HashMap<>();
try {
_hslfSlideShow.updateAndWriteDependantRecords(null,interestingRecords);
UserEditAtom uea = null;
PersistPtrHolder pph = null;
- TreeMap<Integer,Integer> slideLocations = new TreeMap<Integer,Integer>();
- TreeMap<Integer,Record> recordMap = new TreeMap<Integer,Record>();
- List<Integer> obsoleteOffsets = new ArrayList<Integer>();
+ TreeMap<Integer,Integer> slideLocations = new TreeMap<>();
+ TreeMap<Integer,Record> recordMap = new TreeMap<>();
+ List<Integer> obsoleteOffsets = new ArrayList<>();
int duplicatedCount = 0;
for (Record r : records) {
assert(r instanceof PositionDependentRecord);
int deaOffset = -1;
PersistPtrHolder ptr = null;
UserEditAtom uea = null;
- List<Record> recordList = new ArrayList<Record>();
+ List<Record> recordList = new ArrayList<>();
for (Record r : records) {
if (r instanceof DocumentEncryptionAtom) {
deaOffset = ((DocumentEncryptionAtom)r).getLastOnDiskOffset();
return records;
}
- TreeMap<Integer,Integer> tm = new TreeMap<Integer,Integer>(ptr.getSlideLocationsLookup());
+ TreeMap<Integer,Integer> tm = new TreeMap<>(ptr.getSlideLocationsLookup());
ptr.clear();
int maxSlideId = -1;
for (Map.Entry<Integer,Integer> me : tm.entrySet()) {
private Record[] read(byte[] docstream, int usrOffset) throws IOException {
//sort found records by offset.
//(it is not necessary but SlideShow.findMostRecentCoreRecords() expects them sorted)
- NavigableMap<Integer, Record> records = new TreeMap<Integer, Record>(); // offset -> record
- Map<Integer, Integer> persistIds = new HashMap<Integer, Integer>(); // offset -> persistId
+ NavigableMap<Integer, Record> records = new TreeMap<>(); // offset -> record
+ Map<Integer, Integer> persistIds = new HashMap<>(); // offset -> persistId
initRecordOffsets(docstream, usrOffset, records, persistIds);
HSLFSlideShowEncrypted decryptData = new HSLFSlideShowEncrypted(docstream, records);
* This is lazily called as and when we want to touch pictures.
*/
private void readPictures() throws IOException {
- _pictures = new ArrayList<HSLFPictureData>();
+ _pictures = new ArrayList<>();
// if the presentation doesn't contain pictures - will use a null set instead
if (!getDirectory().hasEntry("Pictures")) {
// For position dependent records, hold where they were and now are
// As we go along, update, and hand over, to any Position Dependent
// records we happen across
- Map<Integer, Integer> oldToNewPositions = new HashMap<Integer, Integer>();
+ Map<Integer, Integer> oldToNewPositions = new HashMap<>();
// First pass - figure out where all the position dependent
// records are going to end up, in the new scheme
throw new HSLFException("UserEditAtom or PersistPtr can't be determined.");
}
- Map<Integer, Integer> persistIds = new HashMap<Integer, Integer>();
+ Map<Integer, Integer> persistIds = new HashMap<>();
for (Map.Entry<Integer, Integer> entry : ptr.getSlideLocationsLookup().entrySet()) {
persistIds.put(oldToNewPositions.get(entry.getValue()), entry.getKey());
}
_records = encryptedSS.updateEncryptionRecord(_records);
// The list of entries we've written out
- List<String> writtenEntries = new ArrayList<String>(1);
+ List<String> writtenEntries = new ArrayList<>(1);
// Write out the Property Streams
writeProperties(outFS, writtenEntries);
*/
public HSLFObjectData[] getEmbeddedObjects() {
if (_objects == null) {
- List<HSLFObjectData> objects = new ArrayList<HSLFObjectData>();
+ List<HSLFObjectData> objects = new ArrayList<>();
for (Record r : _records) {
if (r instanceof ExOleObjStg) {
objects.add(new HSLFObjectData((ExOleObjStg) r));
* @return the array with the sound data
*/
public static HSLFSoundData[] find(Document document){
- ArrayList<HSLFSoundData> lst = new ArrayList<HSLFSoundData>();
+ ArrayList<HSLFSoundData> lst = new ArrayList<>();
Record[] ch = document.getChildRecords();
for (int i = 0; i < ch.length; i++) {
if(ch[i].getRecordType() == RecordTypes.SoundCollection.typeID){
protected void afterInsert(HSLFSheet sh){
super.afterInsert(sh);
- Set<HSLFLine> lineSet = new HashSet<HSLFLine>();
+ Set<HSLFLine> lineSet = new HashSet<>();
for (HSLFTableCell row[] : cells) {
for (HSLFTableCell c : row) {
addShape(c);
}
private void cellListToArray() {
- List<HSLFTableCell> htc = new ArrayList<HSLFTableCell>();
+ List<HSLFTableCell> htc = new ArrayList<>();
for (HSLFShape h : getShapes()) {
if (h instanceof HSLFTableCell) {
htc.add((HSLFTableCell)h);
throw new IllegalStateException("HSLFTable without HSLFTableCells");
}
- SortedSet<Double> colSet = new TreeSet<Double>();
- SortedSet<Double> rowSet = new TreeSet<Double>();
+ SortedSet<Double> colSet = new TreeSet<>();
+ SortedSet<Double> rowSet = new TreeSet<>();
// #1 pass - determine cols and rows
for (HSLFTableCell sh : htc) {
}
cells = new HSLFTableCell[rowSet.size()][colSet.size()];
- List<Double> colLst = new ArrayList<Double>(colSet);
- List<Double> rowLst = new ArrayList<Double>(rowSet);
+ List<Double> colLst = new ArrayList<>(colSet);
+ List<Double> rowLst = new ArrayList<>(rowSet);
// #2 pass - assign shape to table cells
for (HSLFTableCell sh : htc) {
}
private void fitLinesToCells() {
- List<LineRect> lines = new ArrayList<LineRect>();
+ List<LineRect> lines = new ArrayList<>();
for (HSLFShape h : getShapes()) {
if (h instanceof HSLFLine) {
lines.add(new LineRect((HSLFLine)h));
private TextPropCollection _masterStyle;
protected TextRulerAtom _ruler;
- protected final List<HSLFTextRun> _runs = new ArrayList<HSLFTextRun>();
+ protected final List<HSLFTextRun> _runs = new ArrayList<>();
protected HSLFTextShape _parentShape;
private HSLFSheet _sheet;
private int shapeId;
* For a given PPDrawing, grab all the TextRuns
*/
public static List<List<HSLFTextParagraph>> findTextParagraphs(PPDrawing ppdrawing, HSLFSheet sheet) {
- List<List<HSLFTextParagraph>> runsV = new ArrayList<List<HSLFTextParagraph>>();
+ List<List<HSLFTextParagraph>> runsV = new ArrayList<>();
for (EscherTextboxWrapper wrapper : ppdrawing.getTextboxWrappers()) {
List<HSLFTextParagraph> p = findTextParagraphs(wrapper, sheet);
if (p != null) {
} else {
// create a new container
// TODO: ... is this case really happening?
- rv = new ArrayList<HSLFTextParagraph>(rv);
+ rv = new ArrayList<>(rv);
rv.addAll(r);
}
}
* @param records the records to build from
*/
protected static List<List<HSLFTextParagraph>> findTextParagraphs(Record[] records) {
- List<List<HSLFTextParagraph>> paragraphCollection = new ArrayList<List<HSLFTextParagraph>>();
+ List<List<HSLFTextParagraph>> paragraphCollection = new ArrayList<>();
int[] recordIdx = { 0 };
String rawText = (tchars != null) ? tchars.getText() : tbytes.getText();
StyleTextPropAtom styles = findStyleAtomPresent(header, rawText.length());
- List<HSLFTextParagraph> paragraphs = new ArrayList<HSLFTextParagraph>();
+ List<HSLFTextParagraph> paragraphs = new ArrayList<>();
paragraphCollection.add(paragraphs);
// split, but keep delimiter
/**
* TextRun object which holds actual text and format data
*/
- private List<HSLFTextParagraph> _paragraphs = new ArrayList<HSLFTextParagraph>();
+ private List<HSLFTextParagraph> _paragraphs = new ArrayList<>();
/**
* Escher container which holds text attributes such as
* @return null, if there's no alternative representation, otherwise the text shape
*/
public TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getMetroShape() {
- HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>> mbs = new HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>>(this);
+ HSLFMetroShape<TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>> mbs = new HSLFMetroShape<>(this);
return mbs.getShape();
}
}
\ No newline at end of file
* Title masters define the design template for slides with a Title Slide layout.
*/
public final class HSLFTitleMaster extends HSLFMasterSheet {
- private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<List<HSLFTextParagraph>>();
+ private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>();
/**
* Constructs a TitleMaster
ChunkGroup[] chunkGroups = POIFSChunkParser.parse(poifsDir);
// Grab interesting bits
- ArrayList<AttachmentChunks> attachments = new ArrayList<AttachmentChunks>();
- ArrayList<RecipientChunks> recipients = new ArrayList<RecipientChunks>();
+ ArrayList<AttachmentChunks> attachments = new ArrayList<>();
+ ArrayList<RecipientChunks> recipients = new ArrayList<>();
for(ChunkGroup group : chunkGroups) {
// Should only ever be one of each of these
if(group instanceof Chunks) {
private String poifsName;
/** Holds all the chunks that were found. */
- private List<Chunk> allChunks = new ArrayList<Chunk>();
+ private List<Chunk> allChunks = new ArrayList<>();
public AttachmentChunks(String poifsName) {
this.poifsName = poifsName;
* Normally a property will have zero chunks (fixed sized) or one chunk
* (variable size), but in some cases (eg Unknown) you may get more.
*/
- private Map<MAPIProperty, List<Chunk>> allChunks = new HashMap<MAPIProperty, List<Chunk>>();
+ private Map<MAPIProperty, List<Chunk>> allChunks = new HashMap<>();
/** Type of message that the MSG represents (ie. IPM.Note) */
private StringChunk messageClass;
@Override
public Chunk[] getChunks() {
- ArrayList<Chunk> chunks = new ArrayList<Chunk>(allChunks.size());
+ ArrayList<Chunk> chunks = new ArrayList<>(allChunks.size());
for (List<Chunk> c : allChunks.values()) {
chunks.addAll(c);
}
// And add to the main list
if (allChunks.get(prop) == null) {
- allChunks.put(prop, new ArrayList<Chunk>());
+ allChunks.put(prop, new ArrayList<>());
}
allChunks.get(prop).add(chunk);
}
* http://msdn.microsoft.com/en-us/library/ms526356%28v=exchg.10%29.aspx
*/
public class MAPIProperty {
- private static Map<Integer, MAPIProperty> attributes = new HashMap<Integer, MAPIProperty>();
+ private static Map<Integer, MAPIProperty> attributes = new HashMap<>();
public static final MAPIProperty AB_DEFAULT_DIR =
new MAPIProperty(0x3d06, BINARY, "AbDefaultDir", "PR_AB_DEFAULT_DIR");
public static final String NAME = "__nameid_version1.0";
/** Holds all the chunks that were found. */
- private List<Chunk> allChunks = new ArrayList<Chunk>();
+ private List<Chunk> allChunks = new ArrayList<>();
public Chunk[] getAll() {
return allChunks.toArray(new Chunk[allChunks.size()]);
* Holds properties, indexed by type. If a property is multi-valued, or
* variable length, it will be held via a {@link ChunkBasedPropertyValue}.
*/
- private Map<MAPIProperty, PropertyValue> properties = new HashMap<MAPIProperty, PropertyValue>();
+ private Map<MAPIProperty, PropertyValue> properties = new HashMap<>();
/**
* The ChunkGroup that these properties apply to. Used when matching chunks
*/
public Map<MAPIProperty, List<PropertyValue>> getProperties() {
Map<MAPIProperty, List<PropertyValue>> props =
- new HashMap<MAPIProperty, List<PropertyValue>>(properties.size());
+ new HashMap<>(properties.size());
for (MAPIProperty prop : properties.keySet()) {
props.put(prop, getValues(prop));
}
protected void matchVariableSizedPropertiesToChunks() {
// Index the Parent Group chunks for easy lookup
// TODO Is this the right way?
- Map<Integer, Chunk> chunks = new HashMap<Integer, Chunk>();
+ Map<Integer, Chunk> chunks = new HashMap<>();
for (Chunk chunk : parentGroup.getChunks()) {
chunks.put(chunk.getChunkId(), chunk);
}
}
/** Holds all the chunks that were found. */
- private List<Chunk> allChunks = new ArrayList<Chunk>();
+ private List<Chunk> allChunks = new ArrayList<>();
@Override
public Map<MAPIProperty, List<PropertyValue>> getProperties() {
* http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefpropertytype%28v=EXCHG.140%29.aspx
*/
public final class Types {
- private static Map<Integer, MAPIType> builtInTypes = new HashMap<Integer, MAPIType>();
- private static Map<Integer, MAPIType> customTypes = new HashMap<Integer, Types.MAPIType>();
+ private static Map<Integer, MAPIType> builtInTypes = new HashMap<>();
+ private static Map<Integer, MAPIType> customTypes = new HashMap<>();
/** Unspecified */
public static final MAPIType UNSPECIFIED = new MAPIType(0x0000,
public TypesLister() {}
public void listByName(PrintStream out) {
- ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll());
+ ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll());
Collections.sort(all, new Comparator<MAPIProperty>() {
public int compare(MAPIProperty a, MAPIProperty b) {
return a.name.compareTo(b.name);
list(all, out);
}
public void listById(PrintStream out) {
- ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll());
+ ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll());
Collections.sort(all, new Comparator<MAPIProperty>() {
public int compare(MAPIProperty a, MAPIProperty b) {
if(a.id < b.id) return -1;
public static ChunkGroup[] parse(DirectoryNode node) throws IOException {
Chunks mainChunks = new Chunks();
- ArrayList<ChunkGroup> groups = new ArrayList<ChunkGroup>();
+ ArrayList<ChunkGroup> groups = new ArrayList<>();
groups.add(mainChunks);
// Find our top level children
return 0;
}
- final List<Element> emptyCells = new ArrayList<Element>( maxColIx );
+ final List<Element> emptyCells = new ArrayList<>(maxColIx);
if ( isOutputRowNumbers() )
{
final CellRangeAddress[][] mergedRanges = ExcelToHtmlUtils
.buildMergedRangesMap( sheet );
- final List<Element> emptyRowElements = new ArrayList<Element>(
- physicalNumberOfRows );
+ final List<Element> emptyRowElements = new ArrayList<>(
+ physicalNumberOfRows);
int maxSheetColumns = 1;
for ( int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++ )
{
private String cssClassPrefixTable = "t";
- private Map<Short, String> excelStyleToClass = new LinkedHashMap<Short, String>();
+ private Map<Short, String> excelStyleToClass = new LinkedHashMap<>();
private final HtmlDocumentFacade htmlDocumentFacade;
if ( maxColIx <= 0 )
return 0;
- final List<Element> emptyCells = new ArrayList<Element>( maxColIx );
+ final List<Element> emptyCells = new ArrayList<>(maxColIx);
if ( isOutputRowNumbers() )
{
final CellRangeAddress[][] mergedRanges = ExcelToHtmlUtils
.buildMergedRangesMap( sheet );
- final List<Element> emptyRowElements = new ArrayList<Element>(
- physicalNumberOfRows );
+ final List<Element> emptyRowElements = new ArrayList<>(
+ physicalNumberOfRows);
int maxSheetColumns = 1;
for ( int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++ )
{
@SuppressWarnings("unused")
private ChartTitleFormatRecord chartTitleFormat;
private SeriesTextRecord chartTitleText;
- private List<ValueRangeRecord> valueRanges = new ArrayList<ValueRangeRecord>();
+ private List<ValueRangeRecord> valueRanges = new ArrayList<>();
private HSSFChartType type = HSSFChartType.Unknown;
- private List<HSSFSeries> series = new ArrayList<HSSFSeries>();
+ private List<HSSFSeries> series = new ArrayList<>();
public enum HSSFChartType {
Area {
public void createBarChart( HSSFWorkbook workbook, HSSFSheet parentSheet )
{
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add( createMSDrawingObjectRecord() );
records.add( createOBJRecord() );
records.add( createBOFRecord() );
* these charts yet, as this is very limited support
*/
public static HSSFChart[] getSheetCharts(HSSFSheet sheet) {
- List<HSSFChart> charts = new ArrayList<HSSFChart>();
+ List<HSSFChart> charts = new ArrayList<>();
HSSFChart lastChart = null;
HSSFSeries lastSeries = null;
// Find records of interest
return null;
}
- List<Ptg> ptgList = new ArrayList<Ptg>();
+ List<Ptg> ptgList = new ArrayList<>();
int rowCount = (range.getLastRow() - range.getFirstRow()) + 1;
int colCount = (range.getLastColumn() - range.getFirstColumn()) + 1;
}
public HSSFSeries createSeries() throws Exception {
- ArrayList<RecordBase> seriesTemplate = new ArrayList<RecordBase>();
+ ArrayList<RecordBase> seriesTemplate = new ArrayList<>();
boolean seriesTemplateFilled = false;
int idx = 0;
HSSFSeries newSeries = null;
/* duplicate record of the template series */
- ArrayList<RecordBase> clonedRecords = new ArrayList<RecordBase>();
+ ArrayList<RecordBase> clonedRecords = new ArrayList<>();
for(final RecordBase record : seriesTemplate) {
Record newRecord = null;
private static final Charset DEFAULT_CHARSET = LocaleUtil.CHARSET_1252;
private final Graphics2D graphicsCtx;
- private final List<HwmfDrawProperties> propStack = new LinkedList<HwmfDrawProperties>();
+ private final List<HwmfDrawProperties> propStack = new LinkedList<>();
private HwmfDrawProperties prop = new HwmfDrawProperties();
- private List<HwmfObjectTableEntry> objectTable = new ArrayList<HwmfObjectTableEntry>();
+ private List<HwmfObjectTableEntry> objectTable = new ArrayList<>();
/** Bounding box from the placeable header */
private final Rectangle2D bbox;
private final AffineTransform initialAT;
*/
public static class WmfPolyPolygon implements HwmfRecord {
- private List<Path2D> polyList = new ArrayList<Path2D>();
+ private List<Path2D> polyList = new ArrayList<>();
@Override
public HwmfRecordType getRecordType() {
*/
private int start;
- private List<PaletteEntry> palette = new ArrayList<PaletteEntry>();
+ private List<PaletteEntry> palette = new ArrayList<>();
@Override
public int init(LittleEndianInputStream leis, long recordSize, int recordFunction) throws IOException {
}
protected List<PaletteEntry> getPaletteCopy() {
- List<PaletteEntry> newPalette = new ArrayList<PaletteEntry>();
+ List<PaletteEntry> newPalette = new ArrayList<>();
for (PaletteEntry et : palette) {
newPalette.add(new PaletteEntry(et));
}
HwmfDrawProperties props = ctx.getProperties();
List<PaletteEntry> palette = props.getPalette();
if (palette == null) {
- palette = new ArrayList<PaletteEntry>();
+ palette = new ArrayList<>();
}
int start = getPaletteStart();
for (int i=palette.size(); i<start; i++) {
HwmfDrawProperties props = ctx.getProperties();
List<PaletteEntry> palette = props.getPalette();
if (palette == null) {
- palette = new ArrayList<PaletteEntry>();
+ palette = new ArrayList<>();
}
for (int i=palette.size(); i<numberOfEntries; i++) {
palette.add(new PaletteEntry());
List<PaletteEntry> src = getPaletteCopy();
int start = getPaletteStart();
if (dest == null) {
- dest = new ArrayList<PaletteEntry>();
+ dest = new ArrayList<>();
}
for (int i=dest.size(); i<start; i++) {
dest.add(new PaletteEntry());
public class HwmfPicture {
private static final POILogger logger = POILogFactory.getLogger(HwmfPicture.class);
- final List<HwmfRecord> records = new ArrayList<HwmfRecord>();
+ final List<HwmfRecord> records = new ArrayList<>();
final HwmfPlaceableHeader placeableHeader;
final HwmfHeader header;
structures.add( structure );
}
- private final Set<Bookmark> bookmarkStack = new LinkedHashSet<Bookmark>();
+ private final Set<Bookmark> bookmarkStack = new LinkedHashSet<>();
private FontReplacer fontReplacer = new DefaultFontReplacer();
* should process char-by-char (slow) or find a correct way to
* reconstruct the structure of range -- sergey
*/
- List<Structure> structures = new LinkedList<Structure>();
+ List<Structure> structures = new LinkedList<>();
if ( wordDocument instanceof HWPFDocument )
{
final HWPFDocument doc = (HWPFDocument) wordDocument;
}
}
- structures = new ArrayList<Structure>( structures );
+ structures = new ArrayList<>(structures);
Collections.sort( structures );
int previous = range.getStartOffset();
if ( structure.structure instanceof Bookmark )
{
// other bookmarks with same boundaries
- List<Bookmark> bookmarks = new LinkedList<Bookmark>();
+ List<Bookmark> bookmarks = new LinkedList<>();
for ( Bookmark bookmark : ( (HWPFDocument) wordDocument )
.getBookmarks()
.getBookmarksStartedBetween( structure.start,
*/
static int[] buildTableCellEdgesArray( Table table )
{
- Set<Integer> edges = new TreeSet<Integer>();
+ Set<Integer> edges = new TreeSet<>();
for ( int r = 0; r < table.numRows(); r++ )
{
public static class NumberingState
{
- private final Map<String, Integer> levels = new HashMap<String, Integer>();
+ private final Map<String, Integer> levels = new HashMap<>();
}
/**
* Map from tag name, to map linking known styles and css class names
*/
- private Map<String, Map<String, String>> stylesheet = new LinkedHashMap<String, Map<String, String>>();
+ private Map<String, Map<String, String>> stylesheet = new LinkedHashMap<>();
private Element stylesheetElement;
protected Element title;
public String getOrCreateCssClass( String classNamePrefix, String style )
{
if ( !stylesheet.containsKey( classNamePrefix ) )
- stylesheet.put( classNamePrefix, new LinkedHashMap<String, String>(
- 1 ) );
+ stylesheet.put( classNamePrefix, new LinkedHashMap<>(
+ 1) );
Map<String, String> styleToClassName = stylesheet.get( classNamePrefix );
String knownClass = styleToClassName.get( style );
return wordToFoConverter.getDocument();
}
- private List<Element> endnotes = new ArrayList<Element>( 0 );
+ private List<Element> endnotes = new ArrayList<>(0);
protected final FoDocumentFacade foDocumentFacade;
private boolean outputCharactersLanguage;
- private Set<String> usedIds = new LinkedHashSet<String>();
+ private Set<String> usedIds = new LinkedHashSet<>();
/**
* Creates new instance of {@link WordToFoConverter}. Can be used for output
private static final POILogger logger = POILogFactory.getLogger( WordToHtmlConverter.class );
- private final Deque<BlockProperies> blocksProperies = new LinkedList<BlockProperies>();
+ private final Deque<BlockProperies> blocksProperies = new LinkedList<>();
private final HtmlDocumentFacade htmlDocumentFacade;
private void buildParagraphs()
{
- paragraphs = new LinkedHashMap<Integer, String>();
+ paragraphs = new LinkedHashMap<>();
StringBuilder part = new StringBuilder();
String text = _doc.getDocumentText();
.getFileInformationBlock().getFcPlcfbtePapx(), doc
.getFileInformationBlock().getLcbPlcfbtePapx(), 4 );
- List<PAPX> papxs = new ArrayList<PAPX>();
+ List<PAPX> papxs = new ArrayList<>();
int length = binTable.length();
for ( int x = 0; x < length; x++ )
private PlexOfCps descriptorsLim = new PlexOfCps( 0 );
- private List<String> names = new ArrayList<String>( 0 );
+ private List<String> names = new ArrayList<>(0);
public BookmarksTables( byte[] tableStream, FileInformationBlock fib )
{
int namesLength = fib.getLcbSttbfbkmk();
if ( namesStart != 0 && namesLength != 0 )
- this.names = new ArrayList<String>( Arrays.asList( SttbUtils
- .readSttbfBkmk( tableStream, namesStart ) ) );
+ this.names = new ArrayList<>(Arrays.asList(SttbUtils
+ .readSttbfBkmk(tableStream, namesStart)));
int firstDescriptorsStart = fib.getFcPlcfbkf();
int firstDescriptorsLength = fib.getLcbPlcfbkf();
.getLogger( CHPBinTable.class );
/** List of character properties.*/
- protected List<CHPX> _textRuns = new ArrayList<CHPX>();
+ protected List<CHPX> _textRuns = new ArrayList<>();
public CHPBinTable()
{
start = System.currentTimeMillis();
}
- List<CHPX> oldChpxSortedByStartPos = new ArrayList<CHPX>( _textRuns );
+ List<CHPX> oldChpxSortedByStartPos = new ArrayList<>(_textRuns);
Collections.sort( oldChpxSortedByStartPos,
PropertyNode.StartComparator.instance );
Long.valueOf( System.currentTimeMillis() - start ), " ms" );
start = System.currentTimeMillis();
- final Map<CHPX, Integer> chpxToFileOrder = new IdentityHashMap<CHPX, Integer>();
+ final Map<CHPX, Integer> chpxToFileOrder = new IdentityHashMap<>();
{
int counter = 0;
for ( CHPX chpx : _textRuns )
List<Integer> textRunsBoundariesList;
{
- Set<Integer> textRunsBoundariesSet = new HashSet<Integer>();
+ Set<Integer> textRunsBoundariesSet = new HashSet<>();
for ( CHPX chpx : _textRuns )
{
textRunsBoundariesSet.add( Integer.valueOf( chpx.getStart() ) );
textRunsBoundariesSet.add( Integer.valueOf( chpx.getEnd() ) );
}
textRunsBoundariesSet.remove( Integer.valueOf( 0 ) );
- textRunsBoundariesList = new ArrayList<Integer>(
- textRunsBoundariesSet );
+ textRunsBoundariesList = new ArrayList<>(
+ textRunsBoundariesSet);
Collections.sort( textRunsBoundariesList );
}
Long.valueOf( System.currentTimeMillis() - start ), " ms" );
start = System.currentTimeMillis();
- List<CHPX> newChpxs = new LinkedList<CHPX>();
+ List<CHPX> newChpxs = new LinkedList<>();
int lastTextRunStart = 0;
for ( Integer objBoundary : textRunsBoundariesList )
{
&& oldChpxSortedByStartPos.get( startPosition ).getStart() >= boundary )
startPosition--;
- List<CHPX> chpxs = new LinkedList<CHPX>();
+ List<CHPX> chpxs = new LinkedList<>();
for ( int c = startPosition; c < oldChpxSortedByStartPos.size(); c++ )
{
CHPX chpx = oldChpxSortedByStartPos.get( c );
continue;
}
- this._textRuns = new ArrayList<CHPX>( newChpxs );
+ this._textRuns = new ArrayList<>(newChpxs);
logger.log( POILogger.DEBUG, "CHPX rebuilded in ",
Long.valueOf( System.currentTimeMillis() - start ), " ms (",
{
private static final int FC_SIZE = 4;
- private ArrayList<CHPX> _chpxList = new ArrayList<CHPX>();
+ private ArrayList<CHPX> _chpxList = new ArrayList<>();
private ArrayList<CHPX> _overFlow;
// see if we couldn't fit some
if ( index != size )
{
- _overFlow = new ArrayList<CHPX>();
+ _overFlow = new ArrayList<>();
_overFlow.addAll( _chpxList.subList( index, size ) );
}
Charset charset) throws IOException {
//skips through the prms before we reach the piece table. These contain data
//for actual fast saved files
- List<SprmBuffer> sprmBuffers = new LinkedList<SprmBuffer>();
+ List<SprmBuffer> sprmBuffers = new LinkedList<>();
while (tableStream[offset] == GRPPRL_TYPE) {
offset++;
int size = LittleEndian.getShort(tableStream, offset);
private final ArrayList<EscherRecord> escherRecords;
public EscherRecordHolder() {
- escherRecords = new ArrayList<EscherRecord>();
+ escherRecords = new ArrayList<>();
}
public EscherRecordHolder(byte[] data, int offset, int size) {
public List<? extends EscherContainerRecord> getDgContainers()
{
- List<EscherContainerRecord> dgContainers = new ArrayList<EscherContainerRecord>(
- 1 );
+ List<EscherContainerRecord> dgContainers = new ArrayList<>(
+ 1);
for ( EscherRecord escherRecord : getEscherRecords() )
{
if ( escherRecord.getRecordId() == (short) 0xF002 )
public List<? extends EscherContainerRecord> getDggContainers()
{
- List<EscherContainerRecord> dggContainers = new ArrayList<EscherContainerRecord>(
- 1 );
+ List<EscherContainerRecord> dggContainers = new ArrayList<>(
+ 1);
for ( EscherRecord escherRecord : getEscherRecords() )
{
if ( escherRecord.getRecordId() == (short) 0xF000 )
public List<? extends EscherContainerRecord> getBStoreContainers()
{
- List<EscherContainerRecord> bStoreContainers = new ArrayList<EscherContainerRecord>(
- 1 );
+ List<EscherContainerRecord> bStoreContainers = new ArrayList<>(
+ 1);
for ( EscherContainerRecord dggContainer : getDggContainers() )
{
for ( EscherRecord escherRecord : dggContainer.getChildRecords() )
public List<? extends EscherContainerRecord> getSpgrContainers()
{
- List<EscherContainerRecord> spgrContainers = new ArrayList<EscherContainerRecord>(
- 1 );
+ List<EscherContainerRecord> spgrContainers = new ArrayList<>(
+ 1);
for ( EscherContainerRecord dgContainer : getDgContainers() )
{
for ( EscherRecord escherRecord : dgContainer.getChildRecords() )
public List<? extends EscherContainerRecord> getSpContainers()
{
- List<EscherContainerRecord> spContainers = new ArrayList<EscherContainerRecord>(
- 1 );
+ List<EscherContainerRecord> spContainers = new ArrayList<>(
+ 1);
for ( EscherContainerRecord spgrContainer : getSpgrContainers() )
{
for ( EscherRecord escherRecord : spgrContainer.getChildRecords() )
private static final int FIELD_SIZE = LittleEndian.INT_SIZE * 2;
- private Map<Integer, UnhandledDataStructure> _unknownMap = new HashMap<Integer, UnhandledDataStructure>();
+ private Map<Integer, UnhandledDataStructure> _unknownMap = new HashMap<>();
private int[] _fields;
public final class FSPATable
{
- private final Map<Integer, GenericPropertyNode> _byStart = new LinkedHashMap<Integer, GenericPropertyNode>();
+ private final Map<Integer, GenericPropertyNode> _byStart = new LinkedHashMap<>();
public FSPATable( byte[] tableStream, FileInformationBlock fib,
FSPADocumentPart part )
public FSPA[] getShapes()
{
- List<FSPA> result = new ArrayList<FSPA>( _byStart.size() );
+ List<FSPA> result = new ArrayList<>(_byStart.size());
for ( GenericPropertyNode propertyNode : _byStart.values() )
{
result.add( new FSPA( propertyNode.getBytes(), 0 ) );
private static ArrayList<PlexOfField> toArrayList( PlexOfCps plexOfCps )
{
if ( plexOfCps == null )
- return new ArrayList<PlexOfField>();
+ return new ArrayList<>();
- ArrayList<PlexOfField> fields = new ArrayList<PlexOfField>(
- plexOfCps.length() );
+ ArrayList<PlexOfField> fields = new ArrayList<>(
+ plexOfCps.length());
for ( int i = 0; i < plexOfCps.length(); i++ )
{
GenericPropertyNode propNode = plexOfCps.getProperty( i );
public FieldsTables( byte[] tableStream, FileInformationBlock fib )
{
- _tables = new HashMap<FieldsDocumentPart, PlexOfCps>(
- FieldsDocumentPart.values().length );
+ _tables = new HashMap<>(
+ FieldsDocumentPart.values().length);
for ( FieldsDocumentPart part : FieldsDocumentPart.values() )
{
* fields FIBFieldHandler will load it content into
* UnhandledDataStructure and save them on save.
*/
- HashSet<Integer> knownFieldSet = new HashSet<Integer>();
+ HashSet<Integer> knownFieldSet = new HashSet<>();
knownFieldSet.add( Integer.valueOf( FIBFieldHandler.STSHF ) );
knownFieldSet.add( Integer.valueOf( FIBFieldHandler.CLX ) );
knownFieldSet.add( Integer.valueOf( FIBFieldHandler.DOP ) );
/**
* Both PlfLst and the following LVLs
*/
- private final LinkedHashMap<Integer, ListData> _listMap = new LinkedHashMap<Integer, ListData>();
+ private final LinkedHashMap<Integer, ListData> _listMap = new LinkedHashMap<>();
private PlfLfo _plfLfo;
public ListTables()
//and it is recorded in the first short.
- List<OldFfn> ffns = new ArrayList<OldFfn>();
+ List<OldFfn> ffns = new ArrayList<>();
int fontTableLength = LittleEndian.getShort(buf, offset);
int endOfTableOffset = offset + length;
// In the interest of our sanity, now sort the text pieces
// into order, if they're not already
Collections.sort(_textPieces);
- _textPiecesFCOrder = new ArrayList<TextPiece>(_textPieces);
+ _textPiecesFCOrder = new ArrayList<>(_textPieces);
Collections.sort(_textPiecesFCOrder, new FCComparator());
}
private static final POILogger logger = POILogFactory
.getLogger( PAPBinTable.class );
- protected final ArrayList<PAPX> _paragraphs = new ArrayList<PAPX>();
+ protected final ArrayList<PAPX> _paragraphs = new ArrayList<>();
public PAPBinTable()
{
start = System.currentTimeMillis();
}
- List<PAPX> oldPapxSortedByEndPos = new ArrayList<PAPX>( paragraphs );
+ List<PAPX> oldPapxSortedByEndPos = new ArrayList<>(paragraphs);
Collections.sort( oldPapxSortedByEndPos,
PropertyNode.EndComparator.instance );
Long.valueOf( System.currentTimeMillis() - start ), " ms" );
start = System.currentTimeMillis();
- final Map<PAPX, Integer> papxToFileOrder = new IdentityHashMap<PAPX, Integer>();
+ final Map<PAPX, Integer> papxToFileOrder = new IdentityHashMap<>();
{
int counter = 0;
for ( PAPX papx : paragraphs )
Long.valueOf( System.currentTimeMillis() - start ), " ms" );
start = System.currentTimeMillis();
- List<PAPX> newPapxs = new LinkedList<PAPX>();
+ List<PAPX> newPapxs = new LinkedList<>();
int lastParStart = 0;
int lastPapxIndex = 0;
for ( int charIndex = 0; charIndex < docText.length(); charIndex++ )
final int endExclusive = charIndex + 1;
boolean broken = false;
- List<PAPX> papxs = new LinkedList<PAPX>();
+ List<PAPX> papxs = new LinkedList<>();
for ( int papxIndex = lastPapxIndex; papxIndex < oldPapxSortedByEndPos
.size(); papxIndex++ )
{
private static final int BX_SIZE = 13;
private static final int FC_SIZE = 4;
- private ArrayList<PAPX> _papxList = new ArrayList<PAPX>();
+ private ArrayList<PAPX> _papxList = new ArrayList<>();
private ArrayList<PAPX> _overFlow;
/**
// see if we couldn't fit some
if ( index != size )
{
- _overFlow = new ArrayList<PAPX>();
+ _overFlow = new ArrayList<>();
_overFlow.addAll( _papxList.subList( index, size ) );
}
escherRecordFactory );
offset += recordSize;
- _blipRecords = new LinkedList<EscherRecord>();
+ _blipRecords = new LinkedList<>();
while ( ( offset - startOffset ) < _picf.getLcb() )
{
EscherRecord nextRecord = escherRecordFactory.createRecord(
* @return a list of Picture objects found in current document
*/
public List<Picture> getAllPictures() {
- ArrayList<Picture> pictures = new ArrayList<Picture>();
+ ArrayList<Picture> pictures = new ArrayList<>();
Range range = _document.getOverallRange();
for (int i = 0; i < range.numCharacterRuns(); i++) {
private List<GenericPropertyNode> _props;
public PlexOfCps(int sizeOfStruct) {
- _props = new ArrayList<GenericPropertyNode>();
+ _props = new ArrayList<>();
_cbStruct = sizeOfStruct;
}
_iMac = (cb - 4) / (4 + cbStruct);
_cbStruct = cbStruct;
- _props = new ArrayList<GenericPropertyNode>(_iMac);
+ _props = new ArrayList<>(_iMac);
for (int x = 0; x < _iMac; x++) {
_props.add(getProperty(x, buf, start));
private final static POILogger _logger = POILogFactory.getLogger(SectionTable.class);
private static final int SED_SIZE = 12;
- protected List<SEPX> _sections = new ArrayList<SEPX>();
+ protected List<SEPX> _sections = new ArrayList<>();
protected List<TextPiece> _text;
/** So we can know if things are unicode or not */
// int _multiple;
int _cpMin;
- protected ArrayList<TextPiece> _textPieces = new ArrayList<TextPiece>();
- protected ArrayList<TextPiece> _textPiecesFCOrder = new ArrayList<TextPiece>();
+ protected ArrayList<TextPiece> _textPieces = new ArrayList<>();
+ protected ArrayList<TextPiece> _textPiecesFCOrder = new ArrayList<>();
public TextPieceTable() {
}
// In the interest of our sanity, now sort the text pieces
// into order, if they're not already
Collections.sort(_textPieces);
- _textPiecesFCOrder = new ArrayList<TextPiece>(_textPieces);
+ _textPiecesFCOrder = new ArrayList<>(_textPieces);
Collections.sort(_textPiecesFCOrder, new FCComparator());
}
@Override
public int[][] getCharIndexRanges(int startBytePosInclusive,
int endBytePosExclusive) {
- List<int[]> result = new LinkedList<int[]>();
+ List<int[]> result = new LinkedList<>();
for (TextPiece textPiece : _textPiecesFCOrder) {
final int tpStart = textPiece.getPieceDescriptor()
.getFilePosition();
@Internal
public final class HWPFFileSystem
{
- private Map<String, ByteArrayOutputStream> _streams = new HashMap<String, ByteArrayOutputStream>();
+ private Map<String, ByteArrayOutputStream> _streams = new HashMap<>();
public HWPFFileSystem()
{
}
public static byte[] compressCharacterProperty(CharacterProperties newCHP, CharacterProperties oldCHP)
{
- List<byte[]> sprmList = new ArrayList<byte[]>();
+ List<byte[]> sprmList = new ArrayList<>();
int size = 0;
if (newCHP.isFRMarkDel() != oldCHP.isFRMarkDel())
{
// page numbers links to Word97-2007BinaryFileFormat(doc)Specification.pdf, accessible from microsoft.com
- List<byte[]> sprmList = new ArrayList<byte[]>();
+ List<byte[]> sprmList = new ArrayList<>();
int size = 0;
// Page 50 of public specification begins
int[] tabPositions = pap.getRgdxaTab();
TabDescriptor[] tabDescriptors = pap.getRgtbd();
- Map<Integer, TabDescriptor> tabMap = new HashMap<Integer, TabDescriptor>();
+ Map<Integer, TabDescriptor> tabMap = new HashMap<>();
for (int x = 0; x < tabPositions.length; x++)
{
tabMap.put(Integer.valueOf(tabPositions[x]), tabDescriptors[x]);
tabPositions = new int[tabMap.size()];
tabDescriptors = new TabDescriptor[tabPositions.length];
- List<Integer> list = new ArrayList<Integer>(tabMap.keySet());
+ List<Integer> list = new ArrayList<>(tabMap.keySet());
Collections.sort(list);
for (int x = 0; x < tabPositions.length; x++)
public static byte[] compressSectionProperty(SectionProperties newSEP)
{
int size = 0;
- List<byte[]> sprmList = new ArrayList<byte[]>();
+ List<byte[]> sprmList = new ArrayList<>();
if (newSEP.getCnsPgn() != DEFAULT_SEP.getCnsPgn())
{
public static byte[] compressTableProperty(TableProperties newTAP)
{
int size = 0;
- List<byte[]> sprmList = new ArrayList<byte[]>();
+ List<byte[]> sprmList = new ArrayList<>();
if (newTAP.getJc() != 0)
{
if ( nodes == null || nodes.isEmpty() )
return Collections.emptyList();
- List<Bookmark> result = new ArrayList<Bookmark>( nodes.size() );
+ List<Bookmark> result = new ArrayList<>(nodes.size());
for ( GenericPropertyNode node : nodes )
{
result.add( getBookmark( node ) );
if ( endLookupIndex < 0 )
endLookupIndex = -( endLookupIndex + 1 );
- Map<Integer, List<Bookmark>> result = new LinkedHashMap<Integer, List<Bookmark>>();
+ Map<Integer, List<Bookmark>> result = new LinkedHashMap<>();
for ( int lookupIndex = startLookupIndex; lookupIndex < endLookupIndex; lookupIndex++ )
{
int s = sortedStartPositions[lookupIndex];
if ( sortedDescriptors != null )
return;
- Map<Integer, List<GenericPropertyNode>> result = new HashMap<Integer, List<GenericPropertyNode>>();
+ Map<Integer, List<GenericPropertyNode>> result = new HashMap<>();
for ( int b = 0; b < bookmarksTables.getDescriptorsFirstCount(); b++ )
{
GenericPropertyNode property = bookmarksTables
List<GenericPropertyNode> atPositionList = result.get( positionKey );
if ( atPositionList == null )
{
- atPositionList = new LinkedList<GenericPropertyNode>();
+ atPositionList = new LinkedList<>();
result.put( positionKey, atPositionList );
}
atPositionList.add( property );
.entrySet() )
{
indices[counter++] = entry.getKey().intValue();
- List<GenericPropertyNode> updated = new ArrayList<GenericPropertyNode>(
- entry.getValue() );
+ List<GenericPropertyNode> updated = new ArrayList<>(
+ entry.getValue());
Collections.sort( updated, PropertyNode.EndComparator.instance );
entry.setValue( updated );
}
public FieldsImpl( FieldsTables fieldsTables )
{
- _fieldsByOffset = new HashMap<FieldsDocumentPart, Map<Integer, FieldImpl>>(
- FieldsDocumentPart.values().length );
+ _fieldsByOffset = new HashMap<>(
+ FieldsDocumentPart.values().length);
for ( FieldsDocumentPart part : FieldsDocumentPart.values() )
{
List<PlexOfField> plexOfFields )
{
if ( plexOfFields == null || plexOfFields.isEmpty() )
- return new HashMap<Integer, FieldImpl>();
+ return new HashMap<>();
Collections.sort( plexOfFields, comparator );
- List<FieldImpl> fields = new ArrayList<FieldImpl>(
- plexOfFields.size() / 3 + 1 );
+ List<FieldImpl> fields = new ArrayList<>(
+ plexOfFields.size() / 3 + 1);
parseFieldStructureImpl( plexOfFields, 0, plexOfFields.size(), fields );
- HashMap<Integer, FieldImpl> result = new HashMap<Integer, FieldImpl>(
- fields.size() );
+ HashMap<Integer, FieldImpl> result = new HashMap<>(
+ fields.size());
for ( FieldImpl field : fields )
{
result.put( Integer.valueOf( field.getFieldStartOffset() ), field );
if ( anchorToIndexMap != null )
return;
- Map<Integer, Integer> result = new HashMap<Integer, Integer>();
+ Map<Integer, Integer> result = new HashMap<>();
for ( int n = 0; n < notesTables.getDescriptorsCount(); n++ )
{
int anchorPosition = notesTables.getDescriptor( n ).getStart();
public Collection<OfficeDrawing> getOfficeDrawings()
{
- List<OfficeDrawing> result = new ArrayList<OfficeDrawing>();
+ List<OfficeDrawing> result = new ArrayList<>();
for ( FSPA fspa : _fspaTable.getShapes() )
{
result.add( getOfficeDrawing( fspa ) );
*/
public class PictureRunMapper {
private PicturesTable picturesTable;
- private Set<Picture> claimed = new HashSet<Picture>();
+ private Set<Picture> claimed = new HashSet<>();
private Map<Integer, Picture> lookup;
private List<Picture> nonU1based;
private List<Picture> all;
all = picturesTable.getAllPictures();
// Build the Offset-Picture lookup map
- lookup = new HashMap<Integer, Picture>();
+ lookup = new HashMap<>();
for (Picture p : all) {
lookup.put(p.getStartOffset(), p);
}
// These are \u0008 escher floating ones, ones
// found outside the normal text, and who
// knows what else...
- nonU1based = new ArrayList<Picture>();
+ nonU1based = new ArrayList<>();
nonU1based.addAll(all);
Range r = doc.getRange();
for (int i = 0; i < r.numCharacterRuns(); i++) {
_paragraphs = _doc.getParagraphTable().getParagraphs();
_characters = _doc.getCharacterTable().getTextRuns();
_text = _doc.getText();
- _parent = new WeakReference<Range>(null);
+ _parent = new WeakReference<>(null);
sanityCheckStartEnd();
}
_paragraphs = parent._paragraphs;
_characters = parent._characters;
_text = parent._text;
- _parent = new WeakReference<Range>(parent);
+ _parent = new WeakReference<>(parent);
sanityCheckStartEnd();
sanityCheck();
if ( _rowsFound )
return;
- _rows = new ArrayList<TableRow>();
+ _rows = new ArrayList<>();
int rowStart = 0;
int rowEnd = 0;
final short expectedCellsCount = _tprops.getItcMac();
int lastCellStart = 0;
- List<TableCell> cells = new ArrayList<TableCell>(
- expectedCellsCount + 1 );
+ List<TableCell> cells = new ArrayList<>(
+ expectedCellsCount + 1);
for ( int p = 0; p < numParagraphs(); p++ )
{
Paragraph paragraph = getParagraph( p );
long lastX = -1;
long fudgeFactorX = 1000;//derive this from the font or frame/bounds information
StringBuilder sb = new StringBuilder();
- Set<String> expectedParts = new HashSet<String>();
+ Set<String> expectedParts = new HashSet<>();
expectedParts.add("C:\\Users\\tallison\\");
expectedParts.add("testPDF.pdf");
int foundExpected = 0;
//test that the HemfCommentEMFPlus record at offset 1
//contains 6 HemfCommentEMFPlus records within it
- List<HemfPlusRecordType> expected = new ArrayList<HemfPlusRecordType>();
+ List<HemfPlusRecordType> expected = new ArrayList<>();
expected.add(HemfPlusRecordType.setPixelOffsetMode);
expected.add(HemfPlusRecordType.setAntiAliasMode);
expected.add(HemfPlusRecordType.setCompositingQuality);
// Find the location of the PersistPtrIncrementalBlocks and
// UserEditAtoms
Record[] r = wss.getRecords();
- Map<Integer,Record> pp = new HashMap<Integer,Record>();
- Map<Integer,Object> ue = new HashMap<Integer,Object>();
+ Map<Integer,Record> pp = new HashMap<>();
+ Map<Integer,Object> ue = new HashMap<>();
ue.put(Integer.valueOf(0),Integer.valueOf(0)); // Will show 0 if first
int pos = 0;
int lastUEPos = -1;
}
private static List<HSLFHyperlink> findHyperlinks(List<HSLFTextParagraph> paras) {
- List<HSLFHyperlink> links = new ArrayList<HSLFHyperlink>();
+ List<HSLFHyperlink> links = new ArrayList<>();
for (HSLFTextParagraph p : paras) {
for (HSLFTextRun r : p) {
HSLFHyperlink hl = r.getHyperlink();
private void textBoxSet(String filename) throws IOException {
HSLFSlideShow ss = new HSLFSlideShow(_slTests.openResourceAsStream(filename));
for (HSLFSlide sld : ss.getSlides()) {
- ArrayList<String> lst1 = new ArrayList<String>();
+ ArrayList<String> lst1 = new ArrayList<>();
for (List<HSLFTextParagraph> txt : sld.getTextParagraphs()) {
for (HSLFTextParagraph p : txt) {
for (HSLFTextRun r : p) {
}
}
- ArrayList<String> lst2 = new ArrayList<String>();
+ ArrayList<String> lst2 = new ArrayList<>();
for (HSLFShape sh : sld.getShapes()) {
if (sh instanceof HSLFTextShape){
HSLFTextShape tbox = (HSLFTextShape)sh;
assertNotNull(exObjList);
// Within that, grab out the Hyperlink atoms
- List<ExHyperlink> linksA = new ArrayList<ExHyperlink>();
+ List<ExHyperlink> linksA = new ArrayList<>();
for (Record ch : exObjList._children) {
if(ch instanceof ExHyperlink) {
linksA.add((ExHyperlink) ch);
* There must be a TxMasterStyleAtom per each type of text defined in TextHeaderAtom
*/
protected TxMasterStyleAtom[] getMasterStyles(){
- List<TxMasterStyleAtom> lst = new ArrayList<TxMasterStyleAtom>();
+ List<TxMasterStyleAtom> lst = new ArrayList<>();
Record[] coreRecs = _ppt.getMostRecentCoreRecords();
for (final Record coreRec : coreRecs) {
HSLFSlideShow ppt = open("42474-2.ppt");
//map slide number and starting phrase of its notes
- Map<Integer, String> notesMap = new HashMap<Integer, String>();
+ Map<Integer, String> notesMap = new HashMap<>();
notesMap.put(Integer.valueOf(4), "For decades before calculators");
notesMap.put(Integer.valueOf(5), "Several commercial applications");
notesMap.put(Integer.valueOf(6), "There are three variations of LNS that are discussed here");
List<List<HSLFTextParagraph>> paras = slide.get(0).getTextParagraphs();
assertEquals(4, paras.size());
- Set<String> expected = new HashSet<String>();
+ Set<String> expected = new HashSet<>();
expected.add("\u201CHAPPY BIRTHDAY SCOTT\u201D");
expected.add("Have a HAPPY DAY");
expected.add("PS Nobody is allowed to hassle Scott TODAY\u2026");
assertEquals("Second run", HSLFTextParagraph.getRawText(slTr.get(2)));
// Check the shape based text runs
- List<HSLFTextParagraph> lst = new ArrayList<HSLFTextParagraph>();
+ List<HSLFTextParagraph> lst = new ArrayList<>();
for (HSLFShape shape : slide.getShapes()) {
if (shape instanceof HSLFTextShape){
List<HSLFTextParagraph> textRun = ((HSLFTextShape)shape).getTextParagraphs();
// setup fonts (especially needed, when run under *nix systems)
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- Map<String,String> fontMap = new HashMap<String,String>();
- Map<String,String> fallbackMap = new HashMap<String,String>();
+ Map<String,String> fontMap = new HashMap<>();
+ Map<String,String> fallbackMap = new HashMap<>();
for (String fontFile[] : fontFiles) {
File f = new File(fontFile[0]);
public void read() throws IOException {
HSLFSlideShow ppt = HSLFTestDataSamples.getSlideShow("text_shapes.ppt");
- List<String> lst1 = new ArrayList<String>();
+ List<String> lst1 = new ArrayList<>();
HSLFSlide slide = ppt.getSlides().get(0);
for (HSLFShape shape : slide.getShapes()) {
assertTrue("Expected TextShape but found " + shape.getClass().getName(), shape instanceof HSLFTextShape);
lst1.add(rawText);
}
- List<String> lst2 = new ArrayList<String>();
+ List<String> lst2 = new ArrayList<>();
for (List<HSLFTextParagraph> paras : slide.getTextParagraphs()) {
lst2.add(HSLFTextParagraph.getRawText(paras));
}
HSLFSlide slide = ppt.getSlides().get(0);
- Map<String,HSLFTextShape> map = new HashMap<String,HSLFTextShape>();
+ Map<String,HSLFTextShape> map = new HashMap<>();
for (HSLFShape shape : slide.getShapes()) {
if(shape instanceof HSLFTextShape){
HSLFTextShape tx = (HSLFTextShape)shape;
// Ask to have the values looked up
Map<MAPIProperty,List<PropertyValue>> props = mainChunks.getProperties();
- HashSet<Class<? extends PropertyValue>> seenTypes =
- new HashSet<Class<? extends PropertyValue>>();
+ HashSet<Class<? extends PropertyValue>> seenTypes =
+ new HashSet<>();
for (List<PropertyValue> pvs : props.values()) {
for (PropertyValue pv : pvs) {
seenTypes.add(pv.getClass());
@Parameterized.Parameters(name="{index}: {0}")
public static Iterable<Object[]> files() {
- List<Object[]> files = new ArrayList<Object[]>();
+ List<Object[]> files = new ArrayList<>();
File directory = POIDataSamples.getDocumentInstance().getFile(
"../spreadsheet" );
for ( final File child : directory.listFiles( new FilenameFilter()
@Parameterized.Parameters(name="{index}: {0}")
public static Iterable<Object[]> files() {
- List<Object[]> files = new ArrayList<Object[]>();
+ List<Object[]> files = new ArrayList<>();
File directory = POIDataSamples.getDocumentInstance().getFile(
"../document" );
for ( final File child : directory.listFiles( new FilenameFilter()
@Override
@SuppressForbidden("Test only")
public List<Field> run() throws Exception {
- List<Field> flds = new ArrayList<Field>();
+ List<Field> flds = new ArrayList<>();
for (Class<?> c = expected.getClass(); c != null; c = c.getSuperclass()) {
Field[] fs = c.getDeclaredFields();
AccessibleObject.setAccessible(fs, true);
@Parameters(name="{index}: {0} using {1}")
public static Iterable<Object[]> files() {
- final List<Object[]> files = new ArrayList<Object[]>();
+ final List<Object[]> files = new ArrayList<>();
_samples.getFile("").listFiles(new FileFilter() {
@Override
@Test
public void recreate() throws IOException, HPSFException {
/* Read the POI filesystem's property set streams: */
- Map<String,PropertySet> psMap = new HashMap<String,PropertySet>();
+ Map<String,PropertySet> psMap = new HashMap<>();
/* Create a new POI filesystem containing the origin file's
* property set streams: */
final POIFSFileSystem poiFs = new POIFSFileSystem();
final PropertySet ps1 = new PropertySet();
final Section s = ps1.getSections().get(0);
- final Map<Long,String> m = new HashMap<Long,String>(3, 1.0f);
+ final Map<Long,String> m = new HashMap<>(3, 1.0f);
m.put(Long.valueOf(1), "String 1");
m.put(Long.valueOf(2), "String 2");
m.put(Long.valueOf(3), "String 3");
final POIFSFileSystem poiFs = new POIFSFileSystem();
final PropertySet ps1 = new PropertySet();
final Section s = ps1.getSections().get(0);
- final Map<Long,String> m = new HashMap<Long, String>(3, 1.0f);
+ final Map<Long,String> m = new HashMap<>(3, 1.0f);
m.put(Long.valueOf(1), "String 1");
m.put(Long.valueOf(2), "String 2");
m.put(Long.valueOf(3), "String 3");
final int ID_2 = 3;
final String NAME_1 = "Schl\u00fcssel \u00e4";
final String VALUE_1 = "Wert 1";
- final Map<Long,String> dictionary = new HashMap<Long, String>();
+ final Map<Long,String> dictionary = new HashMap<>();
DocumentSummaryInformation dsi = PropertySetFactory.newDocumentSummaryInformation();
CustomProperties cps;
*/
public static List<POIFile> readPOIFiles(final File poiFs, final String... poiFiles)
throws FileNotFoundException, IOException {
- final List<POIFile> files = new ArrayList<POIFile>();
+ final List<POIFile> files = new ArrayList<>();
POIFSReader r = new POIFSReader();
POIFSReaderListener pfl = new POIFSReaderListener() {
@Override
* @exception IOException if an I/O exception occurs
*/
public static List<POIFile> readPropertySets(final File poiFs) throws IOException {
- final List<POIFile> files = new ArrayList<POIFile>(7);
+ final List<POIFile> files = new ArrayList<>(7);
final POIFSReader r = new POIFSReader();
POIFSReaderListener pfl = new POIFSReaderListener() {
@Override
public ExpectedException thrown = ExpectedException.none();
protected static final Map<String,Class<? extends Throwable>> EXCLUDED =
- new HashMap<String,Class<? extends Throwable>>();
+ new HashMap<>();
@Parameters(name="{index}: {0}")
public static Iterable<Object[]> files() {
dataDirName = "test-data";
}
- List<Object[]> files = new ArrayList<Object[]>();
+ List<Object[]> files = new ArrayList<>();
findFile(files, dataDirName + "/spreadsheet");
findFile(files, dataDirName + "/hpsf");
private static final class MockHSSFListener implements HSSFListener {
public MockHSSFListener() {}
- private final List<Record> _records = new ArrayList<Record>();
- private final List<Record> _frecs = new ArrayList<Record>();
+ private final List<Record> _records = new ArrayList<>();
+ private final List<Record> _frecs = new ArrayList<>();
@Override
public void processRecord(Record record) {
private static final class MockHSSFListener implements HSSFListener {
public MockHSSFListener() {}
- private final List<Record> _records = new ArrayList<Record>();
+ private final List<Record> _records = new ArrayList<>();
@Override
public void processRecord(Record record) {
}
private static class MockHSSFListener implements HSSFListener {
- private final List<Record> records = new ArrayList<Record>();
+ private final List<Record> records = new ArrayList<>();
public MockHSSFListener() {}
public Record[] getRecords() {
private static final class MockHSSFListener implements HSSFListener {
public MockHSSFListener() {}
- private final List<Record> _records = new ArrayList<Record>();
+ private final List<Record> _records = new ArrayList<>();
private final boolean logToStdOut = false;
@Override
}
}
if(info != null){
- info.aggRecords = new ArrayList<RecordBase>(
+ info.aggRecords = new ArrayList<>(
records.subList(info.startRecordIndex, info.endRecordIndex + 1));
}
return info;
*/
private static void assertWriteAndReadBack(HSSFWorkbook wb) throws IOException {
// map aggregate info by sheet index
- Map<Integer, DrawingAggregateInfo> aggs = new HashMap<Integer, DrawingAggregateInfo>();
+ Map<Integer, DrawingAggregateInfo> aggs = new HashMap<>();
for(int i = 0; i < wb.getNumberOfSheets(); i++){
HSSFSheet sheet = wb.getSheetAt(i);
DrawingAggregateInfo info = DrawingAggregateInfo.get(sheet);
"+2eqbvLdxQ0ndhy5KJ/lc1ZZK9okY5X/gSbrHZTH1vE/ozagTcwAAAA=";
byte[] dgBytes = decompress(data);
- List<EscherRecord> records = new ArrayList<EscherRecord>();
+ List<EscherRecord> records = new ArrayList<>();
EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
int pos = 0;
while (pos < dgBytes.length) {
};
final List<Record> recList = Arrays.asList(recs);
final WorkbookRecordList wrl = new WorkbookRecordList();
- final Map<String, NameCommentRecord> commentRecords = new LinkedHashMap<String, NameCommentRecord>();
+ final Map<String, NameCommentRecord> commentRecords = new LinkedHashMap<>();
final LinkTable lt = new LinkTable(recList, 0, wrl, commentRecords);
assertNotNull(lt);
workbook = new HSSFWorkbook(poifs);
sheet = workbook.getSheetAt(0);
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
for (int rowIdx = 0; true; rowIdx++) {
HSSFRow row = sheet.getRow(rowIdx);
@Test
public void testCreateSheet() {
// Check we're adding row and cell aggregates
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add(BOFRecord.createSheetBOF());
records.add( new DimensionsRecord() );
records.add(createWindow2Record());
*/
@Test
public void testMovingMergedRegion() {
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
CellRangeAddress[] cras = {
new CellRangeAddress(0, 1, 0, 2),
*/
@Test
public void testRowAggregation() {
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add(InternalSheet.createBOF());
records.add(new DimensionsRecord());
@Test
public void testUncalcSize_bug45066() {
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add(BOFRecord.createSheetBOF());
records.add(new UncalcedRecord());
records.add(new DimensionsRecord());
nr.setColumn((short) colIx);
nr.setValue(3.0);
- List<Record> inRecs = new ArrayList<Record>();
+ List<Record> inRecs = new ArrayList<>();
inRecs.add(BOFRecord.createSheetBOF());
inRecs.add(new RowRecord(rowIx));
inRecs.add(nr);
r2.setStr(new HSSFRichTextString("Aggregated"));
NoteRecord n2 = new NoteRecord();
- List<Record> recordStream = new ArrayList<Record>();
+ List<Record> recordStream = new ArrayList<>();
recordStream.add(InternalSheet.createBOF());
recordStream.add( d1 );
recordStream.add( r1 );
confirmAggregatedRecords(recordStream);
- recordStream = new ArrayList<Record>();
+ recordStream = new ArrayList<>();
recordStream.add(InternalSheet.createBOF());
recordStream.add( d1 );
recordStream.add( r1 );
confirmAggregatedRecords(recordStream);
- recordStream = new ArrayList<Record>();
+ recordStream = new ArrayList<>();
recordStream.add(InternalSheet.createBOF());
recordStream.add( d1 );
recordStream.add( r1 );
bs2.setPositionOfBof(33);
bs3.setPositionOfBof(22);
- List<BoundSheetRecord> l = new ArrayList<BoundSheetRecord>();
+ List<BoundSheetRecord> l = new ArrayList<>();
l.add(bs1);
l.add(bs2);
l.add(bs3);
ObjRecord r2 = new ObjRecord();
- List<RecordBase> records = new ArrayList<RecordBase>();
+ List<RecordBase> records = new ArrayList<>();
records.add( d1 );
records.add( r1 );
records.add( d2 );
};
public void testMCTable_bug46009() {
MergedCellsTable mct = new MergedCellsTable();
- List<Record> recList = new ArrayList<Record>();
+ List<Record> recList = new ArrayList<>();
CellRangeAddress[] cras = new CellRangeAddress[] {
new CellRangeAddress(0, 0, 0, 3),
};
RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes));
- IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>();
+ IntMapper<UnicodeString> strings = new IntMapper<>();
SSTDeserializer deserializer = new SSTDeserializer( strings );
deserializer.manufactureStrings(1, in );
byte[] continueBytes = readSampleHexData("evencontinuation.txt", "continue1", ContinueRecord.sid);
RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes));
- IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>();
+ IntMapper<UnicodeString> strings = new IntMapper<>();
SSTDeserializer deserializer = new SSTDeserializer( strings );
deserializer.manufactureStrings( 2, in);
RecordInputStream in = TestcaseRecordInputStream.create(concat(header, concat(continue1, continue2)));
- IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>();
+ IntMapper<UnicodeString> strings = new IntMapper<>();
SSTDeserializer deserializer = new SSTDeserializer( strings );
deserializer.manufactureStrings( 2, in);
byte[] continueBytes = readSampleHexData("extendedtextstrings.txt", "rich-continue1", ContinueRecord.sid);
RecordInputStream in = TestcaseRecordInputStream.create(concat(header, continueBytes));
- IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>();
+ IntMapper<UnicodeString> strings = new IntMapper<>();
SSTDeserializer deserializer = new SSTDeserializer( strings );
deserializer.manufactureStrings( 1, in);
continueBytes = readSampleHexData("extendedtextstrings.txt", "norich-continue1", ContinueRecord.sid);
in = TestcaseRecordInputStream.create(concat(header, continueBytes));
- strings = new IntMapper<UnicodeString>();
+ strings = new IntMapper<>();
deserializer = new SSTDeserializer( strings );
deserializer.manufactureStrings( 1, in);
private static final int COMPRESSED_PLAIN_STRING_OVERHEAD = 3;
private static final int OPTION_FIELD_SIZE = 1;
- private final IntMapper<UnicodeString> strings = new IntMapper<UnicodeString>();
+ private final IntMapper<UnicodeString> strings = new IntMapper<>();
private void confirmSize(int expectedSize) {
ContinuableRecordOutput cro = ContinuableRecordOutput.createForCountingOnly();
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet();
- List<Record> recs = new ArrayList<Record>();
+ List<Record> recs = new ArrayList<>();
CFHeaderBase header = new CFHeaderRecord();
CFRuleBase rule1 = CFRuleRecord.create(sheet, "7");
CFRuleBase rule2 = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "2", "5");
private static final class CIRCollector implements RecordVisitor {
- private final List<Record> _list = new ArrayList<Record>();
+ private final List<Record> _list = new ArrayList<>();
@Override
public void visitRecord(Record r) {
private final ValueRecordsAggregate valueRecord = new ValueRecordsAggregate();
private List<CellValueRecordInterface> getValueRecords() {
- List<CellValueRecordInterface> list = new ArrayList<CellValueRecordInterface>();
+ List<CellValueRecordInterface> list = new ArrayList<>();
for ( CellValueRecordInterface rec : valueRecord ) {
list.add(rec);
}
*/
@Test
public void testSharedFormula() {
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add(new FormulaRecord());
records.add(new SharedFormulaRecord());
records.add(new WindowTwoRecord());
}
private static List<Record> testData() {
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
FormulaRecord formulaRecord = new FormulaRecord();
BlankRecord blankRecord = new BlankRecord();
formulaRecord.setRow(1);
private final List<ChartTitleFormatRecord> chartTitleFormatRecords;
public ChartTitleFormatRecordGrabber() {
- chartTitleFormatRecords = new ArrayList<ChartTitleFormatRecord>();
+ chartTitleFormatRecords = new ArrayList<>();
}
@Override
private final List<Record> _list;
public RecordCollector() {
- _list = new ArrayList<Record>(128);
+ _list = new ArrayList<>(128);
}
@Override
private static int[] diffInternal(InputStream isA, InputStream isB, int[] allowableDifferenceRegions)
throws IOException {
int offset = 0;
- List<Integer> temp = new ArrayList<Integer>();
+ List<Integer> temp = new ArrayList<>();
while (true) {
int b = isA.read();
int b2 = isB.read();
"Good", "Heading 1", "Heading 2", "Heading 3", "Heading 4", "Input", "Linked Cell",
"Neutral", "Note", "Output", "Title", "Total", "Warning Text");
- List<String> collecteddStyles = new ArrayList<String>();
+ List<String> collecteddStyles = new ArrayList<>();
for (int i = 0; i < numCellStyles; i++) {
HSSFCellStyle cellStyle = wb.getCellStyleAt(i);
String styleName = cellStyle.getUserStyleName();
@Test
public void bug51675() throws Exception {
- final List<Short> list = new ArrayList<Short>();
+ final List<Short> list = new ArrayList<>();
HSSFWorkbook wb = openSample("51675.xls");
HSSFSheet sh = wb.getSheetAt(0);
InternalSheet ish = HSSFTestHelper.getSheetForTest(sh);
}
private static List<Integer> arrayToList(int[] array) {
- List<Integer> list = new ArrayList<Integer>(array.length);
+ List<Integer> list = new ArrayList<>(array.length);
for ( Integer element : array ) {
list.add(element);
}
@Test
public void testCheckRecordOrder() {
final SanityChecker c = new SanityChecker();
- List<Record> records = new ArrayList<Record>();
+ List<Record> records = new ArrayList<>();
records.add(new BOFRecord());
records.add(INTERFACEHDR);
records.add(createBoundSheetRec());
else
{
Set<POIFSReaderListener> registeredListeners =
- new HashSet<POIFSReaderListener>();
+ new HashSet<>();
while (listeners.hasNext())
{
Iterator<POIFSReaderListener> listeners =
registry.getListeners(path, name);
Set<POIFSReaderListener> registeredListeners =
- new HashSet<POIFSReaderListener>();
+ new HashSet<>();
while (listeners.hasNext())
{
{
this.filesystem = filesystem;
root = this.filesystem.getRoot();
- dataMap = new HashMap<DocumentDescriptor, byte[]>();
+ dataMap = new HashMap<>();
}
/**
fsD = new POIFSFileSystem();
assertEquals(0, fsD.getRoot().getEntryCount());
- EntryUtils.copyNodes(fs, fsD, new ArrayList<String>());
+ EntryUtils.copyNodes(fs, fsD, new ArrayList<>());
assertEquals(3, fsD.getRoot().getEntryCount());
assertNotNull(fsD.getRoot().getEntry(dirA.getName()));
assertNotNull(fsD.getRoot().getEntry(dirB.getName()));
}
protected DirectoryNode[] openSamples(InputStream[] inps, boolean oldFails) throws Exception {
NPOIFSFileSystem nfs = new NPOIFSFileSystem(inps[0]);
- if (openedFSs == null) openedFSs = new ArrayList<NPOIFSFileSystem>();
+ if (openedFSs == null) openedFSs = new ArrayList<>();
openedFSs.add(nfs);
OPOIFSFileSystem ofs = null;
public void testHeavilyNestedReWrite() throws Exception {
for (DirectoryNode root : openSSSample("ex42570-20305.xls", false)) {
// Record the structure
- Map<String,Integer> entries = new HashMap<String, Integer>();
+ Map<String,Integer> entries = new HashMap<>();
fetchSizes("/", root, entries);
// Prepare to copy
}
public void testNoFiltering() throws Exception {
- FilteringDirectoryNode d = new FilteringDirectoryNode(fs.getRoot(), new HashSet<String>());
+ FilteringDirectoryNode d = new FilteringDirectoryNode(fs.getRoot(), new HashSet<>());
assertEquals(3, d.getEntryCount());
assertEquals(dirA.getName(), d.getEntry(dirA.getName()).getName());
for (File f : files) {
NPOIFSFileSystem fs = new NPOIFSFileSystem(f, true);
- List<Entry> entries = new ArrayList<Entry>();
+ List<Entry> entries = new ArrayList<>();
findOle10(entries, fs.getRoot(), "/", "");
for (Entry e : entries) {
DirectoryNode vba = (DirectoryNode)vba_project.getEntry(VBA);
DirectoryProperty p = (DirectoryProperty)vba.getProperty();
- List<Property> lst = new ArrayList<Property>();
+ List<Property> lst = new ArrayList<>();
for (Iterator<Property> it = p.getChildren(); it.hasNext();){
Property ch = it.next();
lst.add(ch);
}
static {
- final Map<POIDataSamples, String> _expectedMacroContents = new HashMap<POIDataSamples, String>();
+ final Map<POIDataSamples, String> _expectedMacroContents = new HashMap<>();
final POIDataSamples[] dataSamples = {
POIDataSamples.getSpreadSheetInstance(),
POIDataSamples.getSlideShowInstance(),
private void verifyChildren(int count) {
Iterator<Property> iter = _property.getChildren();
- List<Property> children = new ArrayList<Property>();
+ List<Property> children = new ArrayList<>();
while (iter.hasNext())
{
throws IOException
{
super(new ByteArrayInputStream(new byte[ 0 ]), POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS);
- _list = new ArrayList<RawDataBlock>();
+ _list = new ArrayList<>();
_array = null;
}
public void testGetBATBlockAndIndex() throws Exception {
HeaderBlock header = new HeaderBlock(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS);
- List<BATBlock> blocks = new ArrayList<BATBlock>();
+ List<BATBlock> blocks = new ArrayList<>();
int offset;
// that includes a reserved (XBAT) block, and one that
// points off into space somewhere
BlockListImpl list = create();
- List<RawDataBlock> raw_blocks = new ArrayList<RawDataBlock>();
+ List<RawDataBlock> raw_blocks = new ArrayList<>();
byte[] data = new byte[ 512 ];
int offset = 0;
public void testCreatePropertyBlocks() throws Exception {
// test with 0 properties
- List<Property> properties = new ArrayList<Property>();
+ List<Property> properties = new ArrayList<>();
BlockWritable[] blocks =
PropertyBlock.createPropertyBlockArray(POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS,properties);
public final class TestSmallBlockTableWriter extends TestCase {
public void testWritingConstructor() throws IOException {
- List<OPOIFSDocument> documents = new ArrayList<OPOIFSDocument>();
+ List<OPOIFSDocument> documents = new ArrayList<>();
documents.add(
new OPOIFSDocument(
throws IOException
{
ByteArrayInputStream stream = new ByteArrayInputStream(_testdata);
- List<DocumentBlock> documents = new ArrayList<DocumentBlock>();
+ List<DocumentBlock> documents = new ArrayList<>();
while (true)
{
{
for (int j = 0; j <= 8; j++)
{
- List<SmallDocumentBlock> blocks = new ArrayList<SmallDocumentBlock>();
+ List<SmallDocumentBlock> blocks = new ArrayList<>();
for (int k = 0; k < j; k++)
{
readFlags(workbook);
- Set<String> runCategories = new TreeSet<String>(
+ Set<String> runCategories = new TreeSet<>(
String.CASE_INSENSITIVE_ORDER);
String runCategoryList = flagString("Categories", "");
if (runCategoryList != null) {
*/
private void readFlags(Workbook wb) {
Sheet flagSheet = wb.getSheet("Flags");
- testFlags = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
+ testFlags = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
if (flagSheet != null) {
int end = flagSheet.getLastRowNum();
// Skip the header row, therefore "+ 1"
public EvalListener(HSSFWorkbook wb) {
_book = wb;
- _logList = new ArrayList<String>();
- _formulaCellsByCacheEntry = new HashMap<ICacheEntry,EvaluationCell>();
- _plainCellLocsByCacheEntry = new HashMap<ICacheEntry, Loc>();
+ _logList = new ArrayList<>();
+ _formulaCellsByCacheEntry = new HashMap<>();
+ _plainCellLocsByCacheEntry = new HashMap<>();
}
@Override
public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) {
FormulaEvaluator lMainWorkbookEvaluator = mainWorkbook.getCreationHelper().createFormulaEvaluator();
FormulaEvaluator lSourceEvaluator = sourceWorkbook.getCreationHelper().createFormulaEvaluator();
- Map<String,FormulaEvaluator> workbooks = new HashMap<String, FormulaEvaluator>();
+ Map<String,FormulaEvaluator> workbooks = new HashMap<>();
workbooks.put(MAIN_WORKBOOK_FILENAME, lMainWorkbookEvaluator);
workbooks.put(SOURCE_DUMMY_WORKBOOK_FILENAME, lSourceEvaluator);
lMainWorkbookEvaluator.setupReferencedWorkbooks(workbooks);
public MockAreaEval(String... holidays) {
this(0, 0, 0, holidays.length - 1);
- this.holidays = new ArrayList<ValueEval>();
+ this.holidays = new ArrayList<>();
for (String holiday : holidays) {
this.holidays.add(new StringEval(holiday));
}
public MockAreaEval(String... holidays) {
this(0, 0, 0, holidays.length - 1);
- this.holidays = new ArrayList<ValueEval>();
+ this.holidays = new ArrayList<>();
for (String holiday : holidays) {
this.holidays.add(new StringEval(holiday));
}
sheet = workbook.getSheetAt( 0 );
evaluator = new HSSFFormulaEvaluator(workbook);
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
processFunctionGroup(data, SS.START_OPERATORS_ROW_INDEX, null);
processFunctionGroup(data, SS.START_FUNCTIONS_ROW_INDEX, null);
public FunctionDataCollector(PrintStream ps) {
_ps = ps;
- _allFunctionsByIndex = new HashMap<Integer, FunctionData>();
- _allFunctionsByName = new HashMap<String, FunctionData>();
- _groupFunctionIndexes = new HashSet<Integer>();
- _groupFunctionNames = new HashSet<String>();
+ _allFunctionsByIndex = new HashMap<>();
+ _allFunctionsByName = new HashMap<>();
+ _groupFunctionIndexes = new HashSet<>();
+ _groupFunctionNames = new HashSet<>();
}
public void addFuntion(int funcIx, boolean hasFootnote, String funcName, int minParams, int maxParams,
public EFFDocHandler(FunctionDataCollector fdc) {
_fdc = fdc;
- _elemNameStack = new Stack<String>();
+ _elemNameStack = new Stack<>();
_isInsideTable = false;
- _rowData = new ArrayList<String>();
+ _rowData = new ArrayList<>();
_textNodeBuffer = new StringBuffer();
- _rowNoteFlags = new ArrayList<Boolean>();
+ _rowNoteFlags = new ArrayList<>();
}
private boolean matchesTargetPath() {
HSSFWorkbook workbook = HSSFTestDataSamples.openSampleWorkbook(filename);
confirmReadMeSheet(workbook, clazz);
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
int nSheets = workbook.getNumberOfSheets();
for(int sheetIdx=1; sheetIdx< nSheets; sheetIdx++) {
Workbook wb3 = _testDataProvider.createWorkbook();
wb3.createSheet().createRow(1).createCell(0).setCellValue(otherCellText);
- Map<String,FormulaEvaluator> evaluators = new HashMap<String, FormulaEvaluator>();
+ Map<String,FormulaEvaluator> evaluators = new HashMap<>();
evaluators.put(refLocal, wb3.getCreationHelper().createFormulaEvaluator());
evaluators.put(refHttp, wb3.getCreationHelper().createFormulaEvaluator());
Workbook wb = _testDataProvider.createWorkbook();
Sheet sheet = wb.createSheet();
- Map<Integer, CellRangeAddress> mergedRegions = new HashMap<Integer, CellRangeAddress>();
+ Map<Integer, CellRangeAddress> mergedRegions = new HashMap<>();
for (int r=0; r<10; r++) {
CellRangeAddress region = new CellRangeAddress(r, r, 0, 1);
mergedRegions.put(r, region);
}
private static <T> void assertCollectionEquals(Collection<T> expected, Collection<T> actual) {
- Set<T> e = new HashSet<T>(expected);
- Set<T> a = new HashSet<T>(actual);
+ Set<T> e = new HashSet<>(expected);
+ Set<T> a = new HashSet<>(actual);
assertEquals(e, a);
}
sheet.shiftRows(4, sheet.getLastRowNum(), 1);
// all regions should still start at row 3, and elongate by 1 row
- List<CellRangeAddress> expectedMergedRegions = new ArrayList<CellRangeAddress>();
+ List<CellRangeAddress> expectedMergedRegions = new ArrayList<>();
CellRangeAddress A4_B8 = CellRangeAddress.valueOf("A4:B8"); //A4:B7 should be elongated by 1 row
CellRangeAddress C4_D8 = CellRangeAddress.valueOf("C4:D8"); //C4:B7 should be elongated by 1 row
expectedMergedRegions.add(A4_B8);
"\u004a", "\u004a", "\u0041", "\u0053", "\u004f", "\u004e", "\u0044");
- Map<Locale, List<String>> testMap = new HashMap<Locale, List<String>>();
+ Map<Locale, List<String>> testMap = new HashMap<>();
testMap.put(germanLocale, germanResultList);
testMap.put(russianLocale, russianResultList);
testMap.put(austrianLocale, austrianResultList);
// Add multiple border properties to cell should create a single new style
int styCnt1 = wb.getNumCellStyles();
- Map<String, Object> props = new HashMap<String, Object>();
+ Map<String, Object> props = new HashMap<>();
props.put(CellUtil.BORDER_TOP, BorderStyle.THIN);
props.put(CellUtil.BORDER_BOTTOM, BorderStyle.THIN);
props.put(CellUtil.BORDER_LEFT, BorderStyle.THIN);
public void setFillForegroundColorBeforeFillBackgroundColor() throws IOException {
Workbook wb1 = _testDataProvider.createWorkbook();
Cell A1 = wb1.createSheet().createRow(0).createCell(0);
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put(CellUtil.FILL_PATTERN, FillPatternType.BRICKS);
properties.put(CellUtil.FILL_FOREGROUND_COLOR, IndexedColors.BLUE.index);
properties.put(CellUtil.FILL_BACKGROUND_COLOR, IndexedColors.RED.index);
public void setFillForegroundColorBeforeFillBackgroundColorEnum() throws IOException {
Workbook wb1 = _testDataProvider.createWorkbook();
Cell A1 = wb1.createSheet().createRow(0).createCell(0);
- Map<String, Object> properties = new HashMap<String, Object>();
+ Map<String, Object> properties = new HashMap<>();
properties.put(CellUtil.FILL_PATTERN, FillPatternType.BRICKS);
properties.put(CellUtil.FILL_FOREGROUND_COLOR, IndexedColors.BLUE.index);
properties.put(CellUtil.FILL_BACKGROUND_COLOR, IndexedColors.RED.index);
private static ComparisonExample[] initExamples() {
- List<ComparisonExample> temp = new ArrayList<ComparisonExample>();
+ List<ComparisonExample> temp = new ArrayList<>();
addStepTransition(temp, 0x4010000000000005L);
addStepTransition(temp, 0x4010000000000010L);
writeHeaderRow(wb, sheet);
_sheet = sheet;
_rowIndex = 1;
- _replacementNaNs = new ArrayList<Long>();
+ _replacementNaNs = new ArrayList<>();
}
public void addTestRow(long rawBits, String expectedExcelRendering) {
*/
@Internal
public class DummyPOILogger extends POILogger {
- public List<String>logged = new ArrayList<String>();
+ public List<String>logged = new ArrayList<>();
public void reset() {
- logged = new ArrayList<String>();
+ logged = new ArrayList<>();
}
@Override