Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
387d225
at first restoring the original license this project was released und…
Feb 8, 2015
d8b43e3
fixes some source file encoding issues
Feb 8, 2015
156f87d
removes some white spaces at the end of the line
Feb 8, 2015
3f19194
removing generated files Yylex.java
Feb 8, 2015
8d6018a
adds support for files without dimension record (cherry picked from W…
miraculix0815 Feb 8, 2015
ba4c1ce
Merge branch 'cleanup'
miraculix0815 Feb 8, 2015
e9fcc86
removes some obsolete declarations
miraculix0815 Feb 8, 2015
a418067
fixes some typos in javadoc and code style
miraculix0815 Feb 8, 2015
72d9ae7
adds some override annotations and some modifiers to make the visibli…
miraculix0815 Feb 8, 2015
5fa4173
adds the name of a range in a range processing warn message
miraculix0815 Feb 8, 2015
1e1bc60
replaces Log4J with Java default logging to reduce dependencies of th…
miraculix0815 Feb 8, 2015
6e81439
usees unicode bytes in WriteAccessRecord
miraculix0815 Feb 8, 2015
8fccc0e
refacoring of imports to use more general notation and therefor fewer…
miraculix0815 Feb 8, 2015
c2ee76e
replaces for-loops with for-each-loops where appropriate
miraculix0815 Feb 8, 2015
2694f73
uses a try-with-ressources expression for parsing a workbook for bett…
miraculix0815 Feb 8, 2015
4cda803
changes interface of WritableWorkbookImpl.close to match the implmete…
miraculix0815 Feb 8, 2015
b1cd838
refacoring removing braces in if and loop expressions when only one l…
miraculix0815 Feb 8, 2015
508ac90
introducing java-5 generics and java-7 diamond operator getting rid o…
miraculix0815 Feb 8, 2015
04733ae
replacing if-else-expressions with conditionals where appropirate
miraculix0815 Feb 8, 2015
1018b4d
refacoring using fewer temporary variables
miraculix0815 Feb 8, 2015
7908f68
implements Window1Record to support hiding of workbook windows
miraculix0815 Feb 8, 2015
ae31cbf
removes range names when there are already defined to avoid name coll…
miraculix0815 Feb 8, 2015
551f434
changes startColumnCount and startRowCount to native type because the…
miraculix0815 Feb 15, 2015
6225617
refactorings for better performance, and type safety with generics.
miraculix0815 Feb 26, 2015
af2e9cc
fixes error of perserving Fit to pages and outline symbols which led …
miraculix0815 Mar 5, 2015
e00ee6c
enhances page breaks for BIFF 8 (Excel 97) versions
miraculix0815 Mar 7, 2015
26018e9
adapts conversion of BIFF 7 Page Breaks to BIFF 8 to the behaviour of…
miraculix0815 Mar 8, 2015
266118a
adds some test cases for creation of page breaks
miraculix0815 Mar 8, 2015
ea8c47c
adds some test for catching the behavoir of page breaks when insertin…
miraculix0815 Mar 8, 2015
ea23538
changes the interface and implentation of PageBreaks from int[] to Li…
miraculix0815 Mar 14, 2015
e3963db
introduces common interfaces of for readable and writable page breake…
miraculix0815 Mar 14, 2015
457502d
moves all modification function points of page breakes into the page …
miraculix0815 Mar 14, 2015
eec3e13
adds a test for asserting behaviour when removing the column or row c…
miraculix0815 Mar 14, 2015
fe5adb3
adds a test for asserting behaviour when removing the column or row c…
miraculix0815 Mar 14, 2015
1110b40
Merge branch 'master' of https://github.com/miraculix0815/jexcelapi
miraculix0815 Mar 14, 2015
d9332a1
adapts the interface of page breaks and collections in sheets to prep…
miraculix0815 Mar 14, 2015
f91ecf3
fixes some imports
miraculix0815 Mar 14, 2015
57fcaea
merged page_break for support of BIFF 8 enhanced page break support
miraculix0815 Mar 14, 2015
5cf6a51
unites readable and writable ColumnIndex and RowIndex for page breaks
miraculix0815 Mar 14, 2015
95893c6
changes interface for using java.util.nio.Path instead of java.util.File
miraculix0815 Mar 14, 2015
2739681
fixes an error when copying a sheet without page breaks and adds some…
miraculix0815 Mar 15, 2015
2f40113
range names will be written with the given workbook encoding
miraculix0815 Mar 15, 2015
c5311ba
Bug: adding an EmptyCell to a WritableSheet was ignored.
miraculix0815 Aug 20, 2015
1dafa24
ignores ranges of defines names if formula size is zero
miraculix0815 Aug 20, 2015
293145f
refactoring for a more strict code style in NameRecord
miraculix0815 Aug 20, 2015
30d91cd
Excel doesn't store time zone information.
miraculix0815 Aug 26, 2015
9ea5848
adjust zone and DTS when value of date is taken over
miraculix0815 Aug 27, 2015
f6210aa
takes over the build in Database name when coping a sheet
miraculix0815 Sep 1, 2015
4874121
removes tailing zeros from file name in drawing
miraculix0815 Sep 6, 2015
66a9013
refactoring using for-each and try-with-resources
miraculix0815 Sep 6, 2015
a39d3f1
adds toString method for debug purposes
miraculix0815 Nov 23, 2015
368beea
fixes a bug while while copying page breaks
miraculix0815 Nov 23, 2015
bd53e5f
Reads compressed strings in BIFF8 as UTF16 instead of ASCII
miraculix0815 Dec 20, 2019
9775f1a
Refactors class Type as java 5 enum
miraculix0815 Dec 21, 2019
b32e0b2
Makes some fields final
miraculix0815 Dec 21, 2019
ebf92a1
Replaces deprecated Integer constructor with auto boxing
miraculix0815 Dec 21, 2019
6e1086d
Uses switch on enum
miraculix0815 Dec 21, 2019
851608f
Refactor using generics and more final fields
miraculix0815 Dec 21, 2019
030af2c
Refactoring if-else-chain to switch
miraculix0815 Dec 21, 2019
f3fb273
Use more unmodifiable lists instead of copying arrays
miraculix0815 Dec 21, 2019
237ea73
Refactoring using enhanced for-loops
miraculix0815 Dec 21, 2019
98da42a
Refactoring make more fields final
miraculix0815 Dec 21, 2019
4727b68
Format switch statement
miraculix0815 Dec 21, 2019
f6d6d18
Adds test from the excel file format document
miraculix0815 Dec 27, 2019
537ad61
Implements URL encodning for UNC server path and UP_DIR
miraculix0815 Dec 27, 2019
b961a90
Replace ByteArray with StringBuilder
miraculix0815 Dec 28, 2019
9a53f11
Replace chain of if-then-else with switch-case
miraculix0815 Dec 28, 2019
067aaf4
Apply code style
miraculix0815 Dec 28, 2019
3783019
New class CellLocation describe the location of a cell.
miraculix0815 Jan 5, 2020
8b687e7
Move position of drawings when a row is inserted
miraculix0815 May 1, 2020
25f54cc
Move position of drawings when a columnt is inserted
miraculix0815 May 1, 2020
c3409e1
Convert to JDK9 module to use this library in a jlink distribution
miraculix0815 May 1, 2020
d6b9d84
Replace RowRecord array with List<RowRecord>
miraculix0815 May 1, 2020
4ce1670
Remove dependency of numRows after removal of a row
miraculix0815 May 1, 2020
404a76e
Adjust drawings when cell or row has been removed
miraculix0815 May 1, 2020
2db6ae7
Move images accordingly when a row is deleted
miraculix0815 May 3, 2020
a18540c
Add tests for removal of rows from a sheet
miraculix0815 May 4, 2020
f6cbbb0
Encapsulate reading of compressed UTF16 strings in StringHelper
miraculix0815 May 23, 2020
7ce6e03
Read and convert proper UTF16 strings in comments
miraculix0815 May 29, 2020
6116065
Preserve old comment behaviour in CommentBiff7
miraculix0815 May 29, 2020
33d3390
Implement UTF16 in string formular cells.
miraculix0815 May 29, 2020
d11ba52
Add some version information in an enum
miraculix0815 May 30, 2020
7838b7f
Move some more information about unicode in BIFF8 into StringHelper
miraculix0815 May 30, 2020
94afb11
Add new class CellCoordinate
miraculix0815 May 30, 2020
f2a440b
Implement toString for CellCoordinate
miraculix0815 May 30, 2020
40578bf
Manage cells in a map keyed by CellCoordinate
miraculix0815 May 30, 2020
5ab42de
Generify FunctionNames
miraculix0815 May 31, 2020
8c9d700
Remove deprecated methods in favor of the settings API
miraculix0815 Jan 30, 2021
cbc5682
Add getter for BuiltInName
miraculix0815 Jan 30, 2021
6b03e6e
Add methods to add and remove rows and columns to/from print area
miraculix0815 Jan 30, 2021
04444e9
Adapt print area when rows or columns will be added or removed
miraculix0815 Jan 30, 2021
ee0a71b
Omit writing print ranges based on local names and write print ranges…
miraculix0815 Jan 30, 2021
5aa2a11
Implement and test removal of rows and columns in print area
miraculix0815 Jan 30, 2021
33ebca9
Avoid null pointers
miraculix0815 Jan 30, 2021
184b485
Replace array with set
miraculix0815 Jan 30, 2021
6ed7e8a
Remove invalid resource entry for text
miraculix0815 Jul 9, 2021
7827c14
Use generic Stack
miraculix0815 Jul 9, 2021
2b68eda
Cleanup code
miraculix0815 Jul 9, 2021
341e70a
Use generic List
miraculix0815 Jul 9, 2021
fec613d
Cleanup code
miraculix0815 Jul 9, 2021
5e94687
Fix field naming according to convention
miraculix0815 Jul 9, 2021
68d55a4
Use enhanced for-loop
miraculix0815 Jul 9, 2021
1012872
Code cleanup
miraculix0815 Jul 9, 2021
43cff5b
Use enhanced for-loop
miraculix0815 Jul 9, 2021
539c795
Use local name that doesn't hides a field
miraculix0815 Jul 9, 2021
c93720a
Use stream api to collect a list
miraculix0815 Jul 9, 2021
26f1256
Cleanup code
miraculix0815 Jul 9, 2021
bd5330b
Adapt implementation of getName to interface WorkbookMethods
miraculix0815 Jul 9, 2021
f735049
Add test for named ranges in formulas
miraculix0815 Jul 9, 2021
97305a9
Repair range names in test data
miraculix0815 Jul 9, 2021
3150ef5
Write print area names and print title names in the designated order
miraculix0815 Jul 9, 2021
3835389
Code cleanup
miraculix0815 Jul 9, 2021
6e2387c
Use enum for ParseContext
miraculix0815 Jul 9, 2021
0858b71
Code cleanup
miraculix0815 Jul 9, 2021
aba4293
Remove unused Token contructors
miraculix0815 Jul 9, 2021
b2d6b14
Use enum for ParseContext
miraculix0815 Jul 9, 2021
e10adb9
Code cleanup
miraculix0815 Jul 9, 2021
625b76f
Add make token classes for reference, value und array explicit
miraculix0815 Jul 9, 2021
e9afe28
Adds some missing tokens
miraculix0815 Jul 9, 2021
997c389
Inline redundant methods
miraculix0815 Jul 11, 2021
3b8bbfa
Add some token from excel documentation
miraculix0815 Jul 11, 2021
b9f78d8
Rearrange and add some token based on the documentation
miraculix0815 Jul 13, 2021
1a33e6d
Rename some tokens based on the documentation
miraculix0815 Jul 13, 2021
bacefc6
Add test for token
miraculix0815 Jul 13, 2021
4ef9350
Rename some tokens based on the documentation
miraculix0815 Jul 13, 2021
32259b1
Rewrite Token as java enum construct
miraculix0815 Jul 13, 2021
d734c8f
Replace multiple ifs with rule switch expression
miraculix0815 Jul 13, 2021
1ecf97b
Add some notes
miraculix0815 Jul 13, 2021
c08014b
Replace deprecated constructor invocations of primitive wrapper classes
miraculix0815 Feb 9, 2023
9a77666
Replaced raw types with generics
miraculix0815 Feb 9, 2023
bfe2e45
Changes CellType into an enum
miraculix0815 Feb 9, 2023
27a676d
Use enhanced for-loop and try-with-ressources
miraculix0815 Feb 9, 2023
9c37419
Refactors built in format as unmodifiable List
miraculix0815 Feb 9, 2023
b4a2dd0
Removes reference to deprecated for removal class AccessControlException
miraculix0815 Feb 9, 2023
73a171c
Replaces deprecated constructor of Locale
miraculix0815 Feb 9, 2023
79a8007
Refactoring generics, enhanced for loop, instanceof-pattern
miraculix0815 Feb 11, 2023
8b61dbd
Refactoring generics, enhanced for loop and final fields
miraculix0815 Feb 12, 2023
85edb21
Refactors fields from array to List
miraculix0815 Feb 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
497 changes: 162 additions & 335 deletions LICENSE

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion resources/functions_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ tanh=TANHYP
tdist=TVERT
terminate=KANAL.SCHLIESSEN
text=TEXT
text=BOX TEXTFELD
textref=TEXTPOS
time=ZEIT
timevalue=ZEITWERT
Expand Down
4 changes: 4 additions & 0 deletions src/jxl/Cell.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public interface Cell
*/
public int getColumn();

public default CellCoordinate getCoordinate() {
return new CellCoordinate(getColumn(), getRow());
}

/**
* Returns the content type of this cell
*
Expand Down
59 changes: 59 additions & 0 deletions src/jxl/CellCoordinate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

package jxl;

/**
* created 30.05.2020
* @author jan
*/
public class CellCoordinate implements Comparable<CellCoordinate> {

private final int column;
private final int row;

public CellCoordinate(int column, int row) {
this.column = column;
this.row = row;
}

public int getColumn() {
return column;
}

public int getRow() {
return row;
}

@Override
public int hashCode() {
int hash = 7;
hash = 37 * hash + this.column;
hash = 37 * hash + this.row;
return hash;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
return compareTo((CellCoordinate) obj) == 0;
}

@Override
public int compareTo(CellCoordinate that) {
int rowDiff = Integer.compare(this.row, that.row);
if (rowDiff != 0)
return rowDiff;
else
return Integer.compare(this.column, that.column);
}

@Override
public String toString() {
return "Coord(" + column + "," + row + ')';
}

}
61 changes: 61 additions & 0 deletions src/jxl/CellLocation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package jxl;

import java.util.*;
import jxl.write.*;

/**
* This class describes the locatation of a cell whithin a workbook.
* It realizes the value object pattern.
*
* created 2020-01-05
* @author jan
*/
public class CellLocation {

private final WritableSheet sheet;
private final int column, row;

public CellLocation(WritableSheet sheet, int column, int row) {
this.sheet = sheet;
this.column = column;
this.row = row;
}

public WritableSheet getSheet() {
return sheet;
}

public int getColumn() {
return column;
}

public int getRow() {
return row;
}

@Override
public int hashCode() {
int hash = 7;
hash = 37 * hash + Objects.hashCode(this.sheet);
hash = 37 * hash + this.column;
hash = 37 * hash + this.row;
return hash;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final CellLocation other = (CellLocation) obj;
if (this.column != other.column)
return false;
if (this.row != other.row)
return false;
return Objects.equals(this.sheet, other.sheet);
}

}
75 changes: 19 additions & 56 deletions src/jxl/CellType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,70 +22,33 @@
/**
* An enumeration type listing the available content types for a cell
*/
public final class CellType
{

/**
* The text description of this cell type
*/
private String description;

/**
* Private constructor
* @param desc the description of this type
*/
private CellType(String desc)
{
public enum CellType {

// An empty cell can still contain formatting information and comments
EMPTY("Empty"),
LABEL("Label"),
NUMBER("Number"),
BOOLEAN("Boolean"),
ERROR("Error"),
NUMBER_FORMULA("Numerical Formula"),
DATE_FORMULA("Date Formula"),
STRING_FORMULA("String Formula"),
BOOLEAN_FORMULA("Boolean Formula"),
FORMULA_ERROR("Formula Error"),
DATE("Date");

private final String description;

private CellType(String desc) {
description = desc;
}

/**
* Returns a string description of this cell
*
* @return the string description for this type
*/
@Override
public String toString()
{
return description;
}

/**
* An empty cell can still contain formatting information and comments
*/
public static final CellType EMPTY = new CellType("Empty");
/**
*/
public static final CellType LABEL = new CellType("Label");
/**
*/
public static final CellType NUMBER = new CellType("Number");
/**
*/
public static final CellType BOOLEAN = new CellType("Boolean");
/**
*/
public static final CellType ERROR = new CellType("Error");
/**
*/
public static final CellType NUMBER_FORMULA =
new CellType("Numerical Formula");
/**
*/
public static final CellType DATE_FORMULA = new CellType("Date Formula");
/**
*/
public static final CellType STRING_FORMULA = new CellType("String Formula");
/**
*/
public static final CellType BOOLEAN_FORMULA =
new CellType("Boolean Formula");
/**
*/
public static final CellType FORMULA_ERROR = new CellType("Formula Error");
/**
*/
public static final CellType DATE = new CellType("Date");

}


4 changes: 2 additions & 2 deletions src/jxl/Hyperlink.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package jxl;

import java.io.File;
import java.net.URL;
import java.nio.file.Path;

/**
* Hyperlink information. Only URLs or file links are supported
Expand Down Expand Up @@ -102,6 +102,6 @@ public interface Hyperlink
*
* @return the file, or NULL if this hyperlink is not a file
*/
public File getFile();
public Path getFile();
}

5 changes: 2 additions & 3 deletions src/jxl/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@

package jxl;

import java.nio.file.Path;
import jxl.common.LengthUnit;

import java.io.File;

/**
* Accessor functions for an image
*/
Expand Down Expand Up @@ -61,7 +60,7 @@ public interface Image
*
* @return the file which the image references
*/
public File getImageFile();
public Path getImageFile();

/**
* Accessor for the image data
Expand Down
48 changes: 17 additions & 31 deletions src/jxl/Sheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

package jxl;

import java.util.List;
import java.util.regex.Pattern;
import jxl.format.CellFormat;
import jxl.read.biff.*;

/**
* Represents a sheet within a workbook. Provides a handle to the individual
Expand Down Expand Up @@ -89,22 +91,6 @@ public interface Sheet
*/
public String getName();

/**
* Determines whether the sheet is hidden
*
* @return whether or not the sheet is hidden
* @deprecated in favour of the getSettings() method
*/
public boolean isHidden();

/**
* Determines whether the sheet is protected
*
* @return whether or not the sheet is protected
* @deprecated in favour of the getSettings() method
*/
public boolean isProtected();

/**
* Gets the cell whose contents match the string passed in.
* If no match is found, then null is returned. The search is performed
Expand All @@ -121,7 +107,7 @@ public interface Sheet
* If no match is found, then null is returned. The search is performed
* on a row by row basis, so the lower the row number, the more
* efficiently the algorithm will perform
*
*
* @param contents the string to match
* @param firstCol the first column within the range
* @param firstRow the first row of the range
Expand All @@ -130,19 +116,19 @@ public interface Sheet
* @param reverse indicates whether to perform a reverse search or not
* @return the Cell whose contents match the parameter, null if not found
*/
public Cell findCell(String contents,
int firstCol,
int firstRow,
int lastCol,
int lastRow,
public Cell findCell(String contents,
int firstCol,
int firstRow,
int lastCol,
int lastRow,
boolean reverse);

/**
* Gets the cell whose contents match the regular expressionstring passed in.
* If no match is found, then null is returned. The search is performed
* on a row by row basis, so the lower the row number, the more
* efficiently the algorithm will perform
*
*
* @param pattern the regular expression string to match
* @param firstCol the first column within the range
* @param firstRow the first row of the rang
Expand All @@ -151,11 +137,11 @@ public Cell findCell(String contents,
* @param reverse indicates whether to perform a reverse search or not
* @return the Cell whose contents match the parameter, null if not found
*/
public Cell findCell(Pattern pattern,
int firstCol,
public Cell findCell(Pattern pattern,
int firstCol,
int firstRow,
int lastCol,
int lastRow,
int lastCol,
int lastRow,
boolean reverse);

/**
Expand All @@ -182,9 +168,9 @@ public Cell findCell(Pattern pattern,
/**
* Gets the cells which have been merged on this sheet
*
* @return an array of range objects
* @return a List of range objects
*/
public Range[] getMergedCells();
public List<Range> getMergedCells();

/**
* Gets the settings used on a particular sheet
Expand Down Expand Up @@ -260,14 +246,14 @@ public Cell findCell(Pattern pattern,
*
* @return the page breaks on this sheet
*/
public int[] getRowPageBreaks();
public IHorizontalPageBreaks getRowPageBreaks();

/**
* Accessor for the page breaks on this sheet
*
* @return the page breaks on this sheet
*/
public int[] getColumnPageBreaks();
public IVerticalPageBreaks getColumnPageBreaks();

}

Expand Down
Loading