public enum FreeLimitReachedAction extends Enum<FreeLimitReachedAction>
Following code demonstrates one way of testing performances of GemBox.Spreadsheet.
SpreadsheetInfo.setLicense("FREE-LIMITED-KEY");
SpreadsheetInfo.addFreeLimitReachedListener(args -> args.setFreeLimitReachedAction(FreeLimitReachedAction.CONTINUE_AS_TRIAL));
long start = System.nanoTime();
ExcelFile ef = ExcelFile.load(fileName);
long elapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
System.out.println("Load time: " + elapsed + " milliseconds.");
start = System.nanoTime();
int cellWithValueCount = 0;
for (ExcelWorksheet sheet : ef.getWorksheets())
for (ExcelRow row : sheet.getRows())
for (ExcelCell cell : row.getAllocatedCells())
if (cell.getValue() != null)
++cellWithValueCount;
elapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
System.out.println("Iterate through all used cells time: " + elapsed + " milliseconds. Cells with value: " + cellWithValueCount);
start = System.nanoTime();
ef.save(fileName);
elapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
System.out.println("Save time: " + elapsed + " milliseconds.");
Enum Constant and Description |
---|
CONTINUE_AS_TRIAL
Continue reading/writing using trial mode.
|
STOP
Stop reading/writing.
|
THROW_EXCEPTION
Throw
FreeLimitReachedException . |
Modifier and Type | Method and Description |
---|---|
static FreeLimitReachedAction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FreeLimitReachedAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FreeLimitReachedAction CONTINUE_AS_TRIAL
public static final FreeLimitReachedAction STOP
public static final FreeLimitReachedAction THROW_EXCEPTION
FreeLimitReachedException
.public static FreeLimitReachedAction valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static FreeLimitReachedAction[] values()
for (FreeLimitReachedAction c : FreeLimitReachedAction.values()) System.out.println(c);
© GemBox Ltd. — All rights reserved.