foray-commit Mailing List for FOray (Page 42)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
|
From: <vic...@us...> - 2022-12-13 20:18:34
|
Revision: 12851
http://sourceforge.net/p/foray/code/12851
Author: victormote
Date: 2022-12-13 20:18:31 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Move more constants to aXSL.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInteger.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
trunk/foray/foray-render/src/main/java/org/foray/render/Renderer4a.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/AwtRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/awt/viewer/PreviewDialog.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -39,47 +39,10 @@
*/
public final class WellKnownConstants {
- /** The number of centimeters per inch. */
- public static final float CM_PER_INCH = (float) 2.54;
-
- /** The number of millimeters per centimeter. */
- public static final float MM_PER_CM = 10;
-
/** The carriage-return / linefeed combination, cast as a byte array. */
public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED =
new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN, (byte) Basic_Latin_Block.CONTROL_LINE_FEED);
- /** The number of bytes per kilobyte, that is, 1024. */
- public static final short BYTES_PER_KILOBYTE = 1024;
-
- /** The number of kilobytes per megabytes, that is, 1024. */
- public static final short KILOBYTES_PER_MEGABYTE = 1024;
-
- /** The conversion factor between a percentage value and its decimal
- * equivalent, that is, 100. */
- public static final byte PERCENT_CONVERSION = 100;
-
- /** The radix for base-2 numbers, that is, 2. */
- public static final byte RADIX_BASE_2 = 2;
-
- /** The radix for base-8 numbers, that is, 8. */
- public static final byte RADIX_BASE_8 = 8;
-
- /** The radix for base-10 numbers, that is, 10. */
- public static final byte RADIX_BASE_10 = 10;
-
- /** The radix for base-16 numbers, that is, 16. */
- public static final byte RADIX_BASE_16 = 16;
-
- /** The number of degrees in a circle, that is, 360. */
- public static final short DEGREES_PER_CIRCLE = 360;
-
- /** The number of grads in a circle, that is, 400. */
- public static final short GRADS_PER_CIRCLE = 400;
-
- /** The number of milli-units (thousandths of a unit) per unit, which is {@value}. */
- public static final short MILLIUNITS_PER_UNIT = 1000;
-
/** An empty String useful for return values that might return "null", but
* could return this more safely. Using this constant in such cases is
* entirely safe as String instances are immutable. */
@@ -91,12 +54,6 @@
/** Constant defining the largest integral color value, that is, 255. */
public static final short MAXIMUM_INTEGRAL_COLOR_VALUE = 255;
- /** The exponent to use when squaring a value, that is, 2. */
- public static final int SQUARED_EXPONENT = 2;
-
- /** The exponent to use when cubing a value, that is, 3. */
- public static final int CUBED_EXPONENT = 3;
-
/**
* Private constructor. This is a utility class, and should never be instantiated.
*/
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ps/PsUtil.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,7 @@
package org.foray.common.ps;
-import org.foray.common.WellKnownConstants;
+import org.axsl.constants.NumericConstants;
/**
* PostScript-related tools included in the Common module to prevent unnecessary
@@ -123,10 +123,10 @@
final double trouble = modifiedDoubleValue % 1;
if (trouble > (1.0 - (PsUtil.MAGIC_NUMBER_3 / (Math.pow(
- WellKnownConstants.RADIX_BASE_10, radix))))) {
+ NumericConstants.RADIX_BASE_10, radix))))) {
p.append((int) modifiedDoubleValue + 1);
} else if (trouble < (PsUtil.MAGIC_NUMBER_3 / (Math.pow(
- WellKnownConstants.RADIX_BASE_10, radix)))) {
+ NumericConstants.RADIX_BASE_10, radix)))) {
p.append((int) modifiedDoubleValue);
} else {
final String doubleString = Double.toString(modifiedDoubleValue);
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,12 +28,11 @@
package org.foray.core;
-import org.foray.common.WellKnownConstants;
-
import org.axsl.area.AreaTreeException;
import org.axsl.area.AreaTreeFactory;
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
+import org.axsl.constants.MeasurementConstants;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontSelectionConstraints;
import org.axsl.font.FontServer;
@@ -219,11 +218,11 @@
}
final long memoryNow = this.runtime.totalMemory() - this.runtime.freeMemory();
- final long memoryUsed = (memoryNow - this.initialMemory) / WellKnownConstants.BYTES_PER_KILOBYTE;
+ final long memoryUsed = (memoryNow - this.initialMemory) / MeasurementConstants.BYTES_PER_KILOBYTE;
- getSession().logDebug("Initial heap size: " + (this.initialMemory / WellKnownConstants.BYTES_PER_KILOBYTE) +
+ getSession().logDebug("Initial heap size: " + (this.initialMemory / MeasurementConstants.BYTES_PER_KILOBYTE) +
"Kb");
- getSession().logDebug("Current heap size: " + (memoryNow / WellKnownConstants.BYTES_PER_KILOBYTE) + "Kb");
+ getSession().logDebug("Current heap size: " + (memoryNow / MeasurementConstants.BYTES_PER_KILOBYTE) + "Kb");
getSession().logDebug("Total memory used: " + memoryUsed + "Kb");
if (! ForayTarget.MEM_PROFILE_WITH_GC) {
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.font.config.RegisteredFont;
@@ -38,6 +37,7 @@
import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
@@ -309,7 +309,7 @@
if (percent == FontServer.SMALL_CAP_SIMULATION_INVALID) {
return fontSize;
}
- return Math.round(fontSize * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(fontSize * percent / NumericConstants.PERCENT_CONVERSION);
}
@Override
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFont.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,9 @@
package org.foray.font.config;
-import org.foray.common.WellKnownConstants;
import org.foray.font.Font4a;
+import org.axsl.constants.NumericConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConstants;
import org.axsl.font.FontServer;
@@ -256,7 +256,7 @@
final Font4a font = this.getRegisteredFont().getBestFont();
this.simulateSmallCaps = font.getXheight(FontConstants.MILLIPOINTS_PER_POINT);
this.simulateSmallCaps /= font.getAscender(FontConstants.MILLIPOINTS_PER_POINT);
- this.simulateSmallCaps *= WellKnownConstants.PERCENT_CONVERSION;
+ this.simulateSmallCaps *= NumericConstants.PERCENT_CONVERSION;
}
return this.simulateSmallCaps;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.FoPropertyConstants;
@@ -122,7 +122,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAbsoluteOffset.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.prop.CommonPositionPa;
import org.axsl.value.AbsoluteCompass;
@@ -120,7 +120,7 @@
context);
final float percent = value().evalPercentage();
return Math.round(dimensionContainingBlock * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
/* The XSL-FO Standard 1.0 does not specify whether negative values
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractAudioDial.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
@@ -88,7 +88,7 @@
if (pv.canEvalNumeric()) {
final double number = pv.evalNumeric();
if (number >= 0
- && number <= WellKnownConstants.PERCENT_CONVERSION) {
+ && number <= NumericConstants.PERCENT_CONVERSION) {
return pv;
}
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBackgroundPosition.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -35,6 +34,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -98,7 +98,7 @@
final int backgroundImageDimension) {
if (value().canEvalPercentage()) {
final float percent = value().evalPercentage();
- return Math.round(percent / WellKnownConstants.PERCENT_CONVERSION
+ return Math.round(percent / NumericConstants.PERCENT_CONVERSION
* (paddingRectangleDimension
- backgroundImageDimension));
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.obj.FoScalable4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -140,7 +140,7 @@
}
if (value().canEvalPercentage()) {
final float percentage = value().evalPercentage();
- return percentage / WellKnownConstants.PERCENT_CONVERSION;
+ return percentage / NumericConstants.PERCENT_CONVERSION;
}
if (value().canEvalLength()) {
final int length = this.convertValueToLength(value(), fobj,
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.FnLabelEnd;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
import org.axsl.value.RelativeCompass;
@@ -118,7 +118,7 @@
final float percentage = value().evalPercentage();
final int base = context.ipdContainingRefArea();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractMargin.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.fo.obj.SimplePageMaster4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -111,7 +111,7 @@
}
final float percent = value().evalPercentage();
return Math.round(base * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractRelativeDimension.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.DtLengthRange;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.FoPropertyConstants;
import org.axsl.value.RelativeAxis;
@@ -145,7 +145,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAlignmentAdjust.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoInlineContext;
@@ -155,7 +155,7 @@
* @return The computed percentage value.
*/
public static int evalPercentage(final float percent, final FoInlineContext inlineContext) {
- return (int) (percent * inlineContext.alignmentAdjustBase() / WellKnownConstants.PERCENT_CONVERSION);
+ return (int) (percent * inlineContext.alignmentAdjustBase() / NumericConstants.PERCENT_CONVERSION);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAzimuth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -38,6 +37,7 @@
import org.foray.fotree.value.DtAngle;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import java.util.StringTokenizer;
@@ -256,12 +256,12 @@
case LEFTWARDS: {
return (getValueNoInstance(context, fobj)
- PdAzimuth.ANGLE_RELATIVE_INCREMENTOR)
- % WellKnownConstants.DEGREES_PER_CIRCLE;
+ % NumericConstants.DEGREES_PER_CIRCLE;
}
case RIGHTWARDS: {
return (getValueNoInstance(context, fobj)
+ PdAzimuth.ANGLE_RELATIVE_INCREMENTOR)
- % WellKnownConstants.DEGREES_PER_CIRCLE;
+ % NumericConstants.DEGREES_PER_CIRCLE;
}
default: {
break;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundPosition.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.Property;
import org.foray.fotree.PropertyException;
@@ -41,6 +40,7 @@
import org.foray.fotree.value.PropertyCollection;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
@@ -196,7 +196,7 @@
final int backgroundImageDimension) {
if (value().canEvalPercentage()) {
final float percent = value().evalPercentage();
- return Math.round(percent / WellKnownConstants.PERCENT_CONVERSION
+ return Math.round(percent / NumericConstants.PERCENT_CONVERSION
* (paddingRectangleDimension
- backgroundImageDimension));
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.fo.obj.RegionBody4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
@@ -122,7 +122,7 @@
}
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdExtent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -41,6 +40,7 @@
import org.foray.fotree.value.DtWritingMode;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteAxis;
import org.axsl.value.RelativeAxis;
@@ -122,7 +122,7 @@
final int base = computeBase(context, fobj);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSize.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -203,7 +203,7 @@
if (value().canEvalPercentage()) {
final float percentage = value().evalPercentage();
return Math.round(percentage * getBaseFontSize(context,
- fobj) / WellKnownConstants.PERCENT_CONVERSION);
+ fobj) / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalNumeric()) {
return value().evalLength(getBaseFontSize(context, fobj));
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLastLineEndIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -101,7 +101,7 @@
final DtPercentage percentageDT = (DtPercentage) value();
final float percentage = percentageDT.getValue();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -29,7 +29,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -42,6 +41,7 @@
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
@@ -171,7 +171,7 @@
if (length.canEvalPercentage()) {
final float percent = length.evalPercentage();
return Math.round(context.ipdAncestorBlockOrRa() * percent
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
throw this.unexpectedRetrieval();
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPatternWidth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final float percentage = value().evalPercentage();
final int base = context.ipdParentArea();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeight.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.LengthRange;
import org.foray.fotree.Property;
@@ -40,6 +39,7 @@
import org.foray.fotree.value.DtSpace;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.font.Font;
import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
@@ -178,7 +178,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalNumeric()) {
final int fontSize = fobj.traitFontSize(context);
@@ -231,7 +231,7 @@
if (value().canEvalPercentage()) {
/* Not sure from the spec whether percentages are inherited or
* not. It is possible we should return a value of 1.0F here. */
- return value().evalPercentage() / WellKnownConstants.PERCENT_CONVERSION;
+ return value().evalPercentage() / NumericConstants.PERCENT_CONVERSION;
}
if (value().canEvalNumeric()) {
if (value().canEvalLength()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMargin.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -39,6 +38,7 @@
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.ValueCollection;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -145,7 +145,7 @@
base = context.widthContainingBlock();
}
final float percent = value.evalPercentage();
- return Math.round(base * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(base * percent / NumericConstants.PERCENT_CONVERSION);
}
if (value.canEvalLength()) {
return this.convertValueToLength(value, fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPadding.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -39,6 +38,7 @@
import org.foray.fotree.value.PropertyValue;
import org.foray.fotree.value.ValueCollection;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
import org.axsl.value.AbsoluteCompass;
@@ -145,7 +145,7 @@
base = context.widthContainingBlock();
}
final float percent = value.evalPercentage();
- return Math.round(base * percent / WellKnownConstants.PERCENT_CONVERSION);
+ return Math.round(base * percent / NumericConstants.PERCENT_CONVERSION);
}
if (value.canEvalLength()) {
return this.convertValueToLength(value, fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalDistanceBetweenStarts.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final int base = context.ipdAncestorBlockArea();
final float percentage = value().evalPercentage();
return Math.round(percentage * base /
- WellKnownConstants.PERCENT_CONVERSION);
+ NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdProvisionalLabelSeparation.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final int base = context.ipdAncestorBlockArea();
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAltitude.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -117,7 +117,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextDepth.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -117,7 +117,7 @@
final int base = fobj.traitFontSize(context);
final float percentage = value().evalPercentage();
return Math.round(percentage * base
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextIndent.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -109,7 +109,7 @@
final int widthContainingBlock = context.widthContainingBlock();
final float percentage = value().evalPercentage();
return Math.round(percentage * widthContainingBlock
- / WellKnownConstants.PERCENT_CONVERSION);
+ / NumericConstants.PERCENT_CONVERSION);
}
if (value().canEvalLength()) {
return this.convertValueToLength(value(), fobj, context);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVolume.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -37,6 +36,7 @@
import org.foray.fotree.value.Expr;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.NumericConstants;
import org.axsl.fotree.FoContext;
/**
@@ -113,7 +113,7 @@
final double number = pv.evalNumeric();
if (pv.getUnitPower() == Expr.UNIT_POWER_NUMERIC
&& number >= 0
- && number <= WellKnownConstants.PERCENT_CONVERSION) {
+ && number <= NumericConstants.PERCENT_CONVERSION) {
return pv;
}
throw unexpectedValue(value, fobj);
@@ -137,7 +137,7 @@
final float percent = value().evalPercentage();
double product = percent * base;
product = Math.max(product, 0);
- product = Math.min(product, WellKnownConstants.PERCENT_CONVERSION);
+ product = Math.min(product, NumericConstants.PERCENT_CONVERSION);
return product;
}
if (value().canEvalNumeric()) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtAngle.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.NumericConstants;
+
import java.awt.Color;
/**
@@ -76,9 +77,9 @@
*/
public float getValue() {
float returnValue = DtAngle.convertToDegrees(this.value, this.unitID);
- returnValue %= WellKnownConstants.DEGREES_PER_CIRCLE;
+ returnValue %= NumericConstants.DEGREES_PER_CIRCLE;
if (returnValue < 0) {
- returnValue += WellKnownConstants.DEGREES_PER_CIRCLE;
+ returnValue += NumericConstants.DEGREES_PER_CIRCLE;
}
return returnValue;
}
@@ -100,8 +101,8 @@
* Conversion factor is per
* http://www.metrication.com/conversions/tables.htm
*/
- return value * WellKnownConstants.DEGREES_PER_CIRCLE
- / WellKnownConstants.GRADS_PER_CIRCLE;
+ return value * NumericConstants.DEGREES_PER_CIRCLE
+ / NumericConstants.GRADS_PER_CIRCLE;
}
case DtAngle.RADIANS: {
return (float) Math.toDegrees(value);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,9 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import java.awt.Color;
@@ -672,7 +672,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
red = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -685,7 +685,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
green = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -698,7 +698,7 @@
Integer.parseInt(str.substring(0, str.length()
- 1))
* PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
- / WellKnownConstants.PERCENT_CONVERSION;
+ / NumericConstants.PERCENT_CONVERSION;
} else {
blue = Integer.parseInt(str)
/ PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
@@ -758,7 +758,7 @@
final String substring = colorString.substring(startIndex,
startIndex + size);
final int integralColor = Integer.parseInt(substring,
- WellKnownConstants.RADIX_BASE_16);
+ NumericConstants.RADIX_BASE_16);
/* If the short form, integralColor should now have a value between 0
* and 15, inclusive.
* Divide by 15 to put in the range of 0 thru 1.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtFrequency.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.MeasurementConstants;
+
import java.awt.Color;
/**
@@ -76,7 +77,7 @@
return this.quantity;
}
case DtFrequency.UNITS_KILOHERTZ: {
- return this.quantity * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ return this.quantity * MeasurementConstants.HERTZ_PER_KILOHERTZ;
}
}
return -1;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,8 +28,7 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
-
+import org.axsl.constants.MeasurementConstants;
import org.axsl.constants.TypographicConstants;
import java.awt.Color;
@@ -118,13 +117,13 @@
}
case DtLength.UNIT_CENTIMETERS: {
return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
- / WellKnownConstants.CM_PER_INCH
+ / MeasurementConstants.CM_PER_INCH
* TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_MILLIMETERS: {
return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
- / WellKnownConstants.CM_PER_INCH
- / WellKnownConstants.MM_PER_CM
+ / MeasurementConstants.CM_PER_INCH
+ / MeasurementConstants.MM_PER_CM
* TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_POINTS: {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtTime.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.MeasurementConstants;
+
import java.awt.Color;
/**
@@ -75,7 +76,7 @@
public double getValue() {
switch (this.units) {
case DtTime.UNITS_SECONDS: {
- return this.quantity * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ return this.quantity * MeasurementConstants.MILLISECONDS_PER_SECOND;
}
case DtTime.UNITS_MILLISECONDS: {
return this.quantity;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/BatikUaDocument.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -29,8 +29,9 @@
package org.foray.graphic.batik;
import org.foray.common.ForayConstants;
-import org.foray.common.WellKnownConstants;
+import org.axsl.constants.MeasurementConstants;
+
import org.apache.batik.bridge.UserAgentAdapter;
import org.slf4j.LoggerFactory;
@@ -82,9 +83,9 @@
// Length of one pixel in inches.
float temp = 1f / ForayConstants.DEFAULT_SCREEN_RESOLUTION;
/* Apply factor converting inches to centimeters */
- temp *= WellKnownConstants.CM_PER_INCH;
+ temp *= MeasurementConstants.CM_PER_INCH;
/* Apply factor converting centimeters to millimeters. */
- temp *= WellKnownConstants.MM_PER_CM;
+ temp *= MeasurementConstants.MM_PER_CM;
return temp;
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -28,11 +28,11 @@
package org.foray.linebreak;
-import org.foray.common.WellKnownConstants;
import org.foray.common.data.OrderedTreePath4a;
import org.foray.primitive.BooleanUtils;
import org.foray.primitive.sequence.IntArrayBuilder;
+import org.axsl.constants.NumericConstants;
import org.axsl.context.LineBreakContext;
import org.axsl.kp.KpBox;
import org.axsl.kp.KpBranch;
@@ -384,14 +384,14 @@
double d = 0;
final double adjustmentRatioFactor = 1 + (DEMERIT_COMPUTATION_COEFFICIENT
- * Math.pow(Math.abs(adjustmentRatio), WellKnownConstants.CUBED_EXPONENT));
+ * Math.pow(Math.abs(adjustmentRatio), NumericConstants.CUBED_EXPONENT));
if (penaltyCost >= 0) {
- d = Math.pow(adjustmentRatioFactor + penaltyCost, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor + penaltyCost, NumericConstants.SQUARED_EXPONENT);
} else if (penaltyCost > KpPenalty.Quality.FORCED_BREAK.getNumericValue()) {
- d = Math.pow(adjustmentRatioFactor, WellKnownConstants.SQUARED_EXPONENT)
- - Math.pow(penaltyCost, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor, NumericConstants.SQUARED_EXPONENT)
+ - Math.pow(penaltyCost, NumericConstants.SQUARED_EXPONENT);
} else {
- d = Math.pow(adjustmentRatioFactor, WellKnownConstants.SQUARED_EXPONENT);
+ d = Math.pow(adjustmentRatioFactor, NumericConstants.SQUARED_EXPONENT);
}
int demerits = (int) Math.round(d);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java 2022-12-13 18:15:54 UTC (rev 12850)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java 2022-12-13 20:18:31 UTC (rev 12851)
@@ -37,6 +37,8 @@
import org.foray.primitive.NumberUtils;
import org.foray.primitive.StringUtils;
+import org.axsl.constants.MeasurementConstants;
+import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.orthography.OrthographyException;
@@ -1736,7 +1738,7 @@
if (this.trieckmax == this.triecSize) {
overflow("count trie nodes", this.triecSize);
}
- print(this.trieckmax / WellKnownConstants.BYTES_PER_KILOBYTE + "K ");
+ print(this.trieckmax / MeasurementConstants.BYTES_PER_KILOBYTE + "K ");
if (this.trieckmax > this.triecSize - PatGen.NODE_BLOCK_SIZE) {
this.trieckmax = this.triecSize;
} else {
@@ -2064,7 +2066,7 @@
/* Process second char. */
bufferIndex ++;
if (this.xclass[this.buf[bufferIndex]] == PatGen.DIGIT_CLASS) {
- n = WellKnownConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
+ n = NumericConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
} else {
bad = true;
}
@@ -2088,7 +2090,7 @@
/* Process fourth char. */
bufferIndex ++;
if (this.xclass[this.buf[bufferIndex]] == PatGen.DIGIT_CLASS) {
- n = WellKnownConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
+ n = NumericConstants.RADIX_BASE_10 * n + this.xint[this.buf[bufferIndex]];
} else {
bad = true;
}
@@ -3203,11 +3205,11 @@
printLn(this.goodcount + " good, " + this.badcount + " bad, " + this.misscount + " missed");
if ((this.goodcount + this.misscount) > 0) {
final int denominator = this.goodcount + this.misscount;
- final double goodPercentage = WellKnownConstants.PERCENT_CONVERSION * this.goodcount
+ final double goodPercentage = NumericConstants.PERCENT_CONVERSION * this.goodcount
/ denominator;
- final double badPercentage = WellKnownConstants.PERCENT_CONVERSION * this.badcount
+ final double badPercentage = NumericConstants.PERCENT_CONVERSION * this.badcount
/ denominator;
- final double missedPercentage = WellKnownConstants.PERCENT_CONVERSION * this.misscount
+ fina...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-13 18:15:57
|
Revision: 12850
http://sourceforge.net/p/foray/code/12850
Author: victormote
Date: 2022-12-13 18:15:54 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Remove unused foray-fotree dependency on axsl-font.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 17:45:47 UTC (rev 12849)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 18:15:54 UTC (rev 12850)
@@ -28,7 +28,6 @@
package org.foray.fotree;
-import org.foray.common.FontContext4a;
import org.foray.common.FontUtil;
import org.foray.common.WellKnownConstants;
import org.foray.common.data.AbstractOrderedTreeNode;
@@ -75,8 +74,6 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.i18n.Script;
import org.axsl.i18n.WritingSystem;
-import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.OrthographyServer;
import org.axsl.value.AbsoluteDirection;
@@ -157,7 +154,7 @@
* Base class for formatting objects.
*/
public abstract class FoObj extends AbstractOrderedTreeNode<FoObj>
- implements Fo, FoAllProperties, KpContext, AbstractOrderedTreeNode.Convertible<FoObj> {
+ implements Fo, FoAllProperties, AbstractOrderedTreeNode.Convertible<FoObj> {
/** A static empty and immutable list of children, suitable for return by objects that have no children. */
protected static final List<FoObj> EMPTY_CHILD_LIST = Collections.emptyList();
@@ -3605,46 +3602,6 @@
return getParent().getOrthographyServer();
}
- @Override
- public int getIdealWidth(final KpLeaf leaf) {
- final FontUse fontUse = resolvePrimaryFont(null);
- if (leaf instanceof CharSequence) {
- final CharSequence chars = (CharSequence) leaf;
- return fontUse.width(chars, 0, chars.length(), this.traitFontSize(null), 0, 0,
- FontContext4a.DEFAULT, getOrthography());
- }
- /* TODO: Handle non-text items properly. */
- return 0;
- }
-
- @Override
- public int getStretchability(final KpLeaf leaf) {
- if (leaf instanceof CharSequence) {
- final CharSequence chars = (CharSequence) leaf;
- return this.traitWordSpacingMax(null) * chars.length();
- }
- /* TODO: Handle non-text items properly. */
- return 0;
- }
-
- @Override
- public int getShrinkability(final KpLeaf leaf) {
- if (leaf instanceof CharSequence) {
- final CharSequence chars = (CharSequence) leaf;
- return this.traitWordSpacingMin(null) * chars.length();
- }
- /* TODO: Handle non-text items properly. */
- return 0;
- }
-
- @Override
- public int getHyphenCharacterWidth() {
- final FontUse fontUse = resolvePrimaryFont(null);
- final CharSequence hyphenationCharacter = this.traitHyphenationCharacter(null);
- return fontUse.width(hyphenationCharacter, 0, hyphenationCharacter.length(), traitFontSize(null), 0, 0, null,
- null);
- }
-
/**
* Returns the writing system for this FO.
* @return The writing system for this FO.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-13 17:45:50
|
Revision: 12849
http://sourceforge.net/p/foray/code/12849
Author: victormote
Date: 2022-12-13 17:45:47 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove axsl-fotree dependency on axsl-speech.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 12:43:11 UTC (rev 12848)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 17:45:47 UTC (rev 12849)
@@ -79,8 +79,6 @@
import org.axsl.kp.KpLeaf;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.OrthographyServer;
-import org.axsl.speech.SpeechServer;
-import org.axsl.speech.Voice;
import org.axsl.value.AbsoluteDirection;
import org.axsl.value.AbsolutePosition;
import org.axsl.value.ActiveState;
@@ -114,6 +112,7 @@
import org.axsl.value.PageCitationStrategy;
import org.axsl.value.PageNumberTreatment;
import org.axsl.value.PagePosition;
+import org.axsl.value.PitchRelative;
import org.axsl.value.ReferenceOrientation;
import org.axsl.value.RelativeAlign;
import org.axsl.value.RelativeCompass;
@@ -679,14 +678,6 @@
}
/**
- * Returns the speech server.
- * @return The speech server.
- */
- public SpeechServer getSpeechServer() {
- return getFoTree().getSpeechServer();
- }
-
- /**
* Returns the graphic server being used by this tree.
* @return The graphic server being used by this tree.
*/
@@ -2744,6 +2735,11 @@
}
@Override
+ public PitchRelative traitPitchRelative(final FoContext context) {
+ return getPropertyList().traitPitchRelative(this, context);
+ }
+
+ @Override
public double traitPitchRange(final FoContext context) {
return getPropertyList().traitPitchRange(this, context);
}
@@ -2915,20 +2911,6 @@
return getPropertyList().traitWordSpacingPrecedence();
}
- @Override
- public Voice getVoice(final FoContext context) {
- /* Don't spend the memory to cache this value. First, it is not
- * generally used right now. Second, it is (for now anyway) relatively
- * inexpensive to compute. */
- final SpeechServer speechServer = this.getSpeechServer();
- final String[] familyList = getPropertyList().getVoiceFamily(this, context);
- final Voice selectedVoice = speechServer.selectVoiceXsl(familyList);
- if (selectedVoice == null) {
- getFoTree().logError("Error creating Voice.\n" + this.getContextMessage());
- }
- return selectedVoice;
- }
-
/**
* Resolves the font to be used for this object.
* @param context An object that knows how to resolve FO Tree context issues.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-13 12:43:11 UTC (rev 12848)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTree4a.java 2022-12-13 17:45:47 UTC (rev 12849)
@@ -40,7 +40,6 @@
import org.axsl.fotree.FoTree;
import org.axsl.fotree.text.FoOrthographyServer;
import org.axsl.graphic.GraphicServer;
-import org.axsl.speech.SpeechServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -73,9 +72,6 @@
/** The font consumer. */
private FontConsumer fontConsumer;
- /** The speech server. */
- private SpeechServer speechServer;
-
/** The orthography server. */
private FoOrthographyServer orthographyServer;
@@ -142,16 +138,6 @@
}
@Override
- public void setSpeechServer(final SpeechServer server) {
- this.speechServer = server;
- }
-
- @Override
- public SpeechServer getSpeechServer() {
- return this.speechServer;
- }
-
- @Override
public void setOrthographyServer(final FoOrthographyServer orthographyServer) {
this.orthographyServer = orthographyServer;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-13 12:43:11 UTC (rev 12848)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-13 17:45:47 UTC (rev 12849)
@@ -245,6 +245,7 @@
import org.axsl.value.LetterValue;
import org.axsl.value.OddOrEven;
import org.axsl.value.PagePosition;
+import org.axsl.value.PitchRelative;
import org.axsl.value.RelativeAxis;
import org.axsl.value.RelativeCompass;
import org.axsl.value.ShadowEffect;
@@ -4084,7 +4085,7 @@
}
/**
- * Returns the pitch property.
+ * Returns the absolute value (if any) of the pitch property.
* @param fobj The FoObj to which the property belongs.
* @param context An object that knows how to resolve FO Tree context issues.
* @return The pitch property.
@@ -4092,12 +4093,26 @@
public double traitPitch(final FoObj fobj, final FoContext context) {
final PdPitch property = (PdPitch) getProperty(FoPropertyId.PITCH);
if (property != null) {
- return property.getValue(context, fobj);
+ return property.getValueAbsolute(context, fobj);
}
- return PdPitch.getValueNoInstance(context, fobj);
+ return PdPitch.getValueNoInstanceAbsolute(context, fobj);
}
/**
+ * Returns the relative value (if any) of the pitch property.
+ * @param fobj The FoObj to which the property belongs.
+ * @param context An object that knows how to resolve FO Tree context issues.
+ * @return The pitch property.
+ */
+ public PitchRelative traitPitchRelative(final FoObj fobj, final FoContext context) {
+ final PdPitch property = (PdPitch) getProperty(FoPropertyId.PITCH);
+ if (property != null) {
+ return property.getValueRelative(context, fobj);
+ }
+ return PdPitch.getValueNoInstanceRelative(context, fobj);
+ }
+
+ /**
* Returns the pitch-range property.
* @param fobj The FoObj to which the property belongs.
* @param context An object that knows how to resolve FO Tree context issues.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java 2022-12-13 12:43:11 UTC (rev 12848)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdPitch.java 2022-12-13 17:45:47 UTC (rev 12849)
@@ -37,7 +37,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
-import org.axsl.speech.Voice;
+import org.axsl.value.PitchRelative;
/**
* The "pitch" property in XSL-FO.
@@ -99,7 +99,7 @@
* @param fobj The FO for which this value is needed.
* @return The value of this property.
*/
- public double getValue(final FoContext context, final FoObj fobj) {
+ public double getValueAbsolute(final FoContext context, final FoObj fobj) {
if (value() instanceof DtFrequency) {
return ((DtFrequency) value()).getValue();
}
@@ -106,30 +106,33 @@
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
if (keyword == FoValue.INHERIT) {
- return getValueNoInstance(context, fobj);
+ return getValueNoInstanceAbsolute(context, fobj);
}
+ }
+ throw this.unexpectedRetrieval();
+ }
- final Voice voice = fobj.getVoice(context);
+ /**
+ * Returns the value of this property.
+ * @param context An object that knows how to resolve FO context issues.
+ * @param fobj The FO for which this value is needed.
+ * @return The value of this property.
+ */
+ public PitchRelative getValueRelative(final FoContext context, final FoObj fobj) {
+ if (value().canEvalKeyword()) {
+ final FoValue keyword = this.convertValueToFoValue(value());
+ if (keyword == FoValue.INHERIT) {
+ return getValueNoInstanceRelative(context, fobj);
+ }
+
switch (keyword) {
- case X_LOW: {
- return voice.pitchExtraLow();
+ case X_LOW: return PitchRelative.X_LOW;
+ case LOW: return PitchRelative.LOW;
+ case MEDIUM: return PitchRelative.MEDIUM;
+ case HIGH: return PitchRelative.HIGH;
+ case X_HIGH: return PitchRelative.X_HIGH;
+ default: throw this.unexpectedRetrieval();
}
- case LOW: {
- return voice.pitchLow();
- }
- case MEDIUM: {
- return voice.pitchMedium();
- }
- case HIGH: {
- return voice.pitchHigh();
- }
- case X_HIGH: {
- return voice.pitchExtraHigh();
- }
- default: {
- throw this.unexpectedRetrieval();
- }
- }
}
throw this.unexpectedRetrieval();
}
@@ -140,16 +143,28 @@
* @param fobj The FO for which this value is needed.
* @return The initial value for this property.
*/
- public static double getValueNoInstance(final FoContext context,
- final FoObj fobj) {
+ public static double getValueNoInstanceAbsolute(final FoContext context, final FoObj fobj) {
final FoObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitPitch(context);
}
- final Voice voice = fobj.getVoice(context);
- return voice.pitchMedium();
+ return Double.NEGATIVE_INFINITY;
}
+ /**
+ * Returns the default (initial) value for this property.
+ * @param context An object that knows how to resolve FO context issues.
+ * @param fobj The FO for which this value is needed.
+ * @return The initial value for this property.
+ */
+ public static PitchRelative getValueNoInstanceRelative(final FoContext context, final FoObj fobj) {
+ final FoObj parent = fobj.effectiveParent(context);
+ if (parent != null) {
+ return parent.traitPitchRelative(context);
+ }
+ return PitchRelative.MEDIUM;
+ }
+
@Override
protected FoValue[] getValidKeywords() {
return PdPitch.VALID_KEYWORDS;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-13 12:43:14
|
Revision: 12848
http://sourceforge.net/p/foray/code/12848
Author: victormote
Date: 2022-12-13 12:43:11 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove secondary font methods from FoTree and AreaTree.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/LeaderArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -542,9 +542,4 @@
return traitGeneratedBy().getPrimaryFont(this);
}
- @Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -285,9 +285,4 @@
return traitGeneratedBy().getPrimaryFont(this);
}
- @Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -306,9 +306,4 @@
return traitGeneratedBy().getPrimaryFont(this);
}
- @Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/PageNumberCitationLastArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -306,9 +306,4 @@
return traitGeneratedBy().getPrimaryFont(this);
}
- @Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/ScalingValueCitationArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -293,11 +293,6 @@
}
@Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
- @Override
public FontContext fontContext() {
/* TODO: Get this from the FOTree. */
return FontContext4a.DEFAULT;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -462,11 +462,6 @@
return traitGeneratedBy().getPrimaryFont(this);
}
- @Override
- public FontUse getSecondaryFont(final int codePoint) {
- return traitGeneratedBy().getSecondaryFont(this, codePoint);
- }
-
/**
* Returns the hyphenation-character trait for this area.
* @return The hyphenation-character trait for this area.
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextContent4a.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -70,11 +70,6 @@
}
@Override
- public FontUse inlineSecondaryFont(final int codePoint) {
- return effectiveParent().getSecondaryFont(getContext(), codePoint);
- }
-
- @Override
public FontContext inlineFontContext() {
// TODO Auto-generated method stub
return null;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -2961,23 +2961,6 @@
return resolvedFont;
}
- @Override
- public FontUse getSecondaryFont(final FoContext context, final int codePoint) {
- final FontUse secondaryFont = this.getFontConsumer().selectFontXsl(
- this.traitFontSelectionStrategy(context),
- this.traitFontFamily(context),
- this.traitFontStyle(context),
- this.traitFontWeight(context),
- this.traitFontVariant(context),
- this.traitFontStretch(context),
- this.traitFontSize(context),
- codePoint);
- if (secondaryFont == null) {
- getFoTree().logError("Error creating Font.\n" + this.getContextMessage());
- }
- return secondaryFont;
- }
-
/**
* Returns the font-size for the lowercase characters when faux small caps are used by this FO.
* @param context An object that knows how to resolve FO Tree context issues.
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-13 12:20:16 UTC (rev 12847)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pdf/PdfRenderer.java 2022-12-13 12:43:11 UTC (rev 12848)
@@ -484,11 +484,11 @@
return primaryFont;
}
- /* Look for a secondary font that can do the job. */
- final FontUse secondaryFont = area.getSecondaryFont(c);
- if (secondaryFont != null) {
- return secondaryFont;
- }
+// /* Look for a secondary font that can do the job. */
+// final FontUse secondaryFont = area.getSecondaryFont(c);
+// if (secondaryFont != null) {
+// return secondaryFont;
+// }
/* Otherwise, punt. */
return primaryFont;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-13 12:20:19
|
Revision: 12847
http://sourceforge.net/p/foray/code/12847
Author: victormote
Date: 2022-12-13 12:20:16 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Provide AreaTree with an instance of FontServer.
Modified Paths:
--------------
trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
Modified: trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java
===================================================================
--- trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-13 00:04:27 UTC (rev 12846)
+++ trunk/foray/foray-app/src/testFixtures/java/org/foray/app/AreaTreeCreator.java 2022-12-13 12:20:16 UTC (rev 12847)
@@ -32,6 +32,7 @@
import org.foray.area.AreaTreeFactory4a;
import org.foray.area.PageCollection4a;
import org.foray.core.ForayException;
+import org.foray.core.SessionConfig;
import org.foray.fotree.FoTree4a;
import org.foray.fotree.fo.obj.PageSequence4a;
import org.foray.fotree.fo.obj.Root4a;
@@ -39,11 +40,13 @@
import org.foray.pioneer.PioneerLayoutStrategy;
import org.axsl.area.AreaTreeException;
+import org.axsl.font.FontServer;
import org.axsl.fotree.FoTreeException;
import org.axsl.graphic.GraphicServer;
import org.axsl.linebreak.LineBreakerFactory;
import static org.junit.jupiter.api.Assertions.fail;
+import org.mockito.Mockito;
import java.util.Iterator;
@@ -61,6 +64,9 @@
/** The layout factory. */
private PioneerFactory layoutFactory;
+ /** The font server. */
+ private FontServer fontServer;
+
/** The graphic server. */
private GraphicServer graphicServer;
@@ -72,6 +78,8 @@
this.areaTreeFactory = ForaySpecific.makeAreaTreeFactory();
final LineBreakerFactory lbFactory = ForaySpecific.makeLineBreakerFactory();
this.layoutFactory = ForaySpecific.makeLayoutFactory(lbFactory);
+ final SessionConfig sessionConfig = Mockito.mock(SessionConfig.class);
+ this.fontServer = ForaySpecific.makeFontServer(sessionConfig);
this.graphicServer = ForaySpecific.makeGraphicServer();
} catch (final ForayException e) {
fail(e.getMessage());
@@ -106,7 +114,7 @@
fail(e.getMessage());
}
final Root4a root = foTree.getRootFo();
- final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, this.graphicServer);
+ final AreaTree4a areaTree = this.areaTreeFactory.makeAreaTree(foTree, this.fontServer, this.graphicServer);
final PioneerLayoutStrategy layout = this.layoutFactory.makeLayout();
final Iterator<PageSequence4a> iterator = root.getPageSequenceIterator();
while (iterator.hasNext()) {
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-13 00:04:27 UTC (rev 12846)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTree4a.java 2022-12-13 12:20:16 UTC (rev 12847)
@@ -39,6 +39,7 @@
import org.axsl.area.event.AreaTreeEvent;
import org.axsl.area.event.AreaTreeListener;
import org.axsl.font.FontConsumer;
+import org.axsl.font.FontServer;
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoTree;
import org.axsl.fotree.fo.Bookmark;
@@ -105,6 +106,9 @@
/** Factory that knows how to create new linkage instances. */
private LinkFactory linkageFactory = new LinkFactory();
+ /** The font server. */
+ private FontServer fontServer;
+
/** The graphics server. */
private GraphicServer graphicServer;
@@ -112,14 +116,17 @@
* Private Constructor.
* @param foTree The FO tree instance that generates this area tree.
* @param fontConsumer The Font Consumer.
+ * @param fontServer The font server.
* @param graphicServer The graphics server.
*/
- private AreaTree4a(final FoTree foTree, final FontConsumer fontConsumer, final GraphicServer graphicServer) {
+ private AreaTree4a(final FoTree foTree, final FontConsumer fontConsumer, final FontServer fontServer,
+ final GraphicServer graphicServer) {
/* AreaTree has no parent with which to register. And it cannot
* create linkage because the AreaTreeControl isn't registered.*/
this.foTree = foTree;
this.fontConsumer = fontConsumer;
this.documentMetadata = new DocumentMetadata4a(this);
+ this.fontServer = fontServer;
this.graphicServer = graphicServer;
}
@@ -126,11 +133,13 @@
/**
* Package-visible factory method.
* @param foTree The FO tree instance that generates this area tree.
+ * @param fontServer The font server.
* @param graphicServer The graphics server.
* @return The new instance.
*/
- static AreaTree4a makeAreaTree(final FoTree foTree, final GraphicServer graphicServer) {
- final AreaTree4a newAreaTree = new AreaTree4a(foTree, foTree.getFontConsumer(), graphicServer);
+ static AreaTree4a makeAreaTree(final FoTree foTree, final FontServer fontServer,
+ final GraphicServer graphicServer) {
+ final AreaTree4a newAreaTree = new AreaTree4a(foTree, foTree.getFontConsumer(), fontServer, graphicServer);
/*
* These registration steps must take place after the AreaTreeControl
* has been stored.
@@ -480,6 +489,11 @@
}
@Override
+ public FontServer getFontServer() {
+ return this.fontServer;
+ }
+
+ @Override
public GraphicServer getGraphicServer() {
return this.graphicServer;
}
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-12-13 00:04:27 UTC (rev 12846)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaTreeFactory4a.java 2022-12-13 12:20:16 UTC (rev 12847)
@@ -29,6 +29,7 @@
package org.foray.area;
import org.axsl.area.AreaTreeFactory;
+import org.axsl.font.FontServer;
import org.axsl.fotree.FoTree;
import org.axsl.graphic.GraphicServer;
@@ -38,8 +39,9 @@
public class AreaTreeFactory4a implements AreaTreeFactory {
@Override
- public AreaTree4a makeAreaTree(final FoTree foTree, final GraphicServer graphicServer) {
- final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree, graphicServer);
+ public AreaTree4a makeAreaTree(final FoTree foTree, final FontServer fontServer,
+ final GraphicServer graphicServer) {
+ final AreaTree4a areaTree = AreaTree4a.makeAreaTree(foTree, fontServer, graphicServer);
return areaTree;
}
Modified: trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java
===================================================================
--- trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 00:04:27 UTC (rev 12846)
+++ trunk/foray/foray-core/src/main/java/org/foray/core/ForayTarget.java 2022-12-13 12:20:16 UTC (rev 12847)
@@ -292,8 +292,9 @@
private org.axsl.area.AreaTree getCreatedAreaTree() {
if (this.areaTree == null) {
final FoTree foTree = this.document.getFoTreeParser().getFoTree();
+ final FontServer fontServer = this.document.getFontServer();
final GraphicServer graphicServer = this.document.getGraphicServer();
- this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree, graphicServer);
+ this.areaTree = this.getAreaTreeFactory().makeAreaTree(foTree, fontServer, graphicServer);
this.areaTree.registerListener(this);
}
return this.areaTree;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-13 00:04:30
|
Revision: 12846
http://sourceforge.net/p/foray/code/12846
Author: victormote
Date: 2022-12-13 00:04:27 +0000 (Tue, 13 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Rename FoScaled interface to FoScalable.
Modified Paths:
--------------
trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java
Added Paths:
-----------
trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java
Removed Paths:
-------------
trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -99,11 +99,11 @@
return;
} else if (fo instanceof ExternalGraphic) {
final ExternalGraphic externalGraphic = (ExternalGraphic) fo;
- this.children.add(new ScaledContent(externalGraphic, context));
+ this.children.add(new ScalableContent(externalGraphic, context));
return;
} else if (fo instanceof InstreamForeignObject) {
final InstreamForeignObject instreamForeign = (InstreamForeignObject) fo;
- this.children.add(new ScaledContent(instreamForeign, context));
+ this.children.add(new ScalableContent(instreamForeign, context));
return;
} else if (fo instanceof Inline) {
return;
Copied: trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java (from rev 12842, trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java)
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java (rev 0)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ScalableContent.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2022 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.content;
+
+import org.axsl.area.LineArea;
+import org.axsl.content.IndivisibleContent;
+import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoScalable;
+import org.axsl.fotree.fo.ExternalGraphic;
+import org.axsl.kp.KpLeafIterator;
+
+/**
+ * Content wrapper for {@link FoScalable}.
+ */
+public class ScalableContent extends IndivisibleContent4a implements IndivisibleContent {
+
+ /** The wrapped content. */
+ private FoScalable content;
+
+ /**
+ * Constructor.
+ * @param content The wrapped content.
+ * @param context The FO context for this content.
+ */
+ public ScalableContent(final FoScalable content, final FoContext context) {
+ super(context);
+ this.content = content;
+ }
+
+ @Override
+ public FoScalable getContent() {
+ return this.content;
+ }
+
+ @Override
+ public int inlineSizeOptimum(final int lineLength) {
+ /* TODO: Fix this method after we add the context to this class. */
+ return this.content.viewportIpd(null);
+ }
+
+ @Override
+ public int inlineSizeMinimum(final int lineLength) {
+ /* TODO: Fix this method after we add the context to this class. */
+ return inlineSizeOptimum(lineLength);
+ }
+
+ @Override
+ public int inlineSizeMaximum(final int lineLength) {
+ /* TODO: Fix this method after we add the context to this class. */
+ return inlineSizeOptimum(lineLength);
+ }
+
+ @Override
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
+ if (this.content instanceof ExternalGraphic) {
+ final ExternalGraphic externalGraphic = (ExternalGraphic) this.content;
+ lineArea.makeExternalGraphicArea(externalGraphic, -1);
+ }
+ return iterator.nextIndex() + 1;
+ }
+
+}
Deleted: trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -1,88 +0,0 @@
-/*
- * Copyright 2022 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.content;
-
-import org.axsl.area.LineArea;
-import org.axsl.content.IndivisibleContent;
-import org.axsl.fotree.FoContext;
-import org.axsl.fotree.FoScaled;
-import org.axsl.fotree.fo.ExternalGraphic;
-import org.axsl.kp.KpLeafIterator;
-
-/**
- * Content wrapper for {FoScaled}.
- */
-public class ScaledContent extends IndivisibleContent4a implements IndivisibleContent {
-
- /** The wrapped content. */
- private FoScaled content;
-
- /**
- * Constructor.
- * @param content The wrapped content.
- * @param context The FO context for this content.
- */
- public ScaledContent(final FoScaled content, final FoContext context) {
- super(context);
- this.content = content;
- }
-
- @Override
- public FoScaled getContent() {
- return this.content;
- }
-
- @Override
- public int inlineSizeOptimum(final int lineLength) {
- /* TODO: Fix this method after we add the context to this class. */
- return this.content.viewportIpd(null);
- }
-
- @Override
- public int inlineSizeMinimum(final int lineLength) {
- /* TODO: Fix this method after we add the context to this class. */
- return inlineSizeOptimum(lineLength);
- }
-
- @Override
- public int inlineSizeMaximum(final int lineLength) {
- /* TODO: Fix this method after we add the context to this class. */
- return inlineSizeOptimum(lineLength);
- }
-
- @Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
- if (this.content instanceof ExternalGraphic) {
- final ExternalGraphic externalGraphic = (ExternalGraphic) this.content;
- lineArea.makeExternalGraphicArea(externalGraphic, -1);
- }
- return iterator.nextIndex() + 1;
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -43,7 +43,7 @@
import org.foray.fotree.fo.obj.BasicLink4a;
import org.foray.fotree.fo.obj.Block4a;
import org.foray.fotree.fo.obj.Flow4a;
-import org.foray.fotree.fo.obj.FoScaled4a;
+import org.foray.fotree.fo.obj.FoScalable4a;
import org.foray.fotree.fo.obj.FoText4a;
import org.foray.fotree.fo.obj.FoTextCharacters4a;
import org.foray.fotree.fo.obj.Leader4a;
@@ -3182,7 +3182,7 @@
* using "inherit".
* @return The content-height.
*/
- public float getContentHeight(final FoContext context, final FoScaled4a fobjScaled) {
+ public float getContentHeight(final FoContext context, final FoScalable4a fobjScaled) {
return getPropertyList().getContentHeight(this, context, fobjScaled);
}
@@ -3204,7 +3204,7 @@
* using "inherit".
* @return The content-width.
*/
- public float getContentWidth(final FoContext context, final FoScaled4a fobjScaled) {
+ public float getContentWidth(final FoContext context, final FoScalable4a fobjScaled) {
return getPropertyList().getContentWidth(this, context, fobjScaled);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/PropertyList.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -32,7 +32,7 @@
import org.foray.common.i18n.Country4a;
import org.foray.fotree.fo.FoPropertyId;
import org.foray.fotree.fo.FoValue;
-import org.foray.fotree.fo.obj.FoScaled4a;
+import org.foray.fotree.fo.obj.FoScalable4a;
import org.foray.fotree.fo.obj.Region4a;
import org.foray.fotree.fo.prop.AbstractAbsoluteDimension;
import org.foray.fotree.fo.prop.AbstractAbsoluteOffset;
@@ -1863,7 +1863,7 @@
* using "inherit".
* @return The scaling factor that should be applied to the intrinsic width of the content.
*/
- public float getContentWidth(final FoObj fobj, final FoContext context, final FoScaled4a fobjScaled) {
+ public float getContentWidth(final FoObj fobj, final FoContext context, final FoScalable4a fobjScaled) {
final PdContentWidth property = (PdContentWidth) getProperty(FoPropertyId.CONTENT_WIDTH);
if (property == null) {
/* Width scaling is not set. If we are scaling uniformly, use the
@@ -1908,7 +1908,7 @@
* using "inherit".
* @return The scaling factor that should be applied to the intrinsic height of the content.
*/
- public float getContentHeight(final FoObj fobj, final FoContext context, final FoScaled4a fobjScaled) {
+ public float getContentHeight(final FoObj fobj, final FoContext context, final FoScalable4a fobjScaled) {
final PdContentHeight property = (PdContentHeight) getProperty(FoPropertyId.CONTENT_HEIGHT);
if (property == null) {
/* Height scaling is not set. If we are scaling uniformly, use the
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/ExternalGraphic4a.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -49,7 +49,7 @@
/**
* An "external-graphic" object in XSL-FO.
*/
-public class ExternalGraphic4a extends FoScaled4a implements ExternalGraphic {
+public class ExternalGraphic4a extends FoScalable4a implements ExternalGraphic {
/** The parent of this node. */
private FoObj parent;
Copied: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java (from rev 12843, trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java)
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScalable4a.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.fotree.fo.obj;
+
+import org.foray.fotree.FoObj;
+import org.foray.fotree.PropertyList;
+
+import org.axsl.constants.TypographicConstants;
+import org.axsl.fotree.FoContext;
+import org.axsl.fotree.FoScalable;
+import org.axsl.value.FoPropertyConstants;
+
+/**
+ * Abstract base class for inline FOs that are scaleable. This currently
+ * includes external-graphic and instream-foreign-object.
+ */
+public abstract class FoScalable4a extends FoObj implements FoScalable {
+
+ /** The property list for this object. */
+ private PropertyList propertyList;
+
+ /**
+ * Constructor.
+ * @param parent The parent FoObj.
+ * @param propertyList The property list for this FoObj.
+ */
+ public FoScalable4a(final FoObj parent, final PropertyList propertyList) {
+ super(parent);
+ this.propertyList = propertyList;
+ }
+
+ /**
+ * Returns the width of the content.
+ * @param context An object that knows how to resolve FO Tree context
+ * issues.
+ * @return The width, in millipoints, of the content of this object, as
+ * reported by the content itself.
+ */
+ public abstract int intrinsicContentWidth(FoContext context);
+
+ /**
+ * Returns the height of the content.
+ * @param context An object that knows how to resolve FO Tree context
+ * issues.
+ * @return The height, in millipoints, of the content of this object, as
+ * reported by the content itself.
+ */
+ public abstract int intrinsicContentHeight(FoContext context);
+
+ @Override
+ public int viewportIpd(final FoContext context) {
+ /* See XSL-FO Standard 1.0, Section 6.6.5 and 6.6.6, Subsection
+ * "Constraints", first paragraph, for explanation of logic. */
+ final int viewportIPD = this.traitIpDimensionOpt(context);
+ if (viewportIPD != FoPropertyConstants.DIMENSION_AUTO) {
+ return viewportIPD;
+ }
+
+ /* The remaining logic is for the "auto" case.
+ * The CSS2 spec says that for replaced inline content, if
+ * width="auto", it should return the intrinsic width.
+ * See http://www.w3.org/TR/REC-CSS2/visudet.html#q5.
+ * However, the documentation on the fo:external-graphic and
+ * fo:instream-foreign-object say that the "content size" should be
+ * used, and then define it. */
+ final int intrinsicWidth = this.intrinsicContentWidth(context);
+
+ /* We already know that the viewport IPD is dependent on the
+ * content-width.
+ * If the content-width is also dependent on the viewport IPD, then we
+ * have a circular dependency. */
+ if (this.isContentWidthDependentOnPd(context)) {
+ /* We have a circular dependency. See if we can use the other
+ * dimension to compute this one. */
+ if (this.isViewportBpdDependent(context)) {
+ /* The viewport BPD is not specified either, so the user has
+ * given us absolutely nothing by which to compute the
+ * dimensions of this viewport.
+ * We punt by returning the smaller of 1) the intrinsic width,
+ * and 2) the width of the parent area. */
+ return Math.min(intrinsicWidth,
+ context.ipdAncestorBlockOrRa());
+ } else {
+ /* We can use the other dimension to compute this one. */
+ final int viewportBpd = this.viewportBpd(context);
+ final int intrinsicHeight = this.intrinsicContentWidth(context);
+ final float widthToHeight = (float) intrinsicWidth
+ / (float) intrinsicHeight;
+ return Math.round(widthToHeight * viewportBpd);
+ }
+ }
+
+ /* The content-width is not dependent on the viewport IPD, so we can
+ * compute it first, then use it to compute the viewport IPD. */
+ final float scalingFactor = this.getContentWidth(context, this);
+ return Math.round(intrinsicWidth * scalingFactor);
+ }
+
+ /**
+ * Indicates whether the viewport IPD for this graphic can be computed
+ * independent of the viewport BPD.
+ * @param context An object that knows how to resolve FO Tree context
+ * issues.
+ * @return True if and only if the viewport BPD needs to be computed before the IPD
+ * can be.
+ */
+ private boolean isViewportIpdDependent(final FoContext context) {
+ final int viewportIPD = this.traitIpDimensionOpt(context);
+ if (viewportIPD != FoPropertyConstants.DIMENSION_AUTO) {
+ return false;
+ }
+ if (this.isContentWidthDependentOnPd(context)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int viewportBpd(final FoContext context) {
+ /* See XSL-FO Standard 1.0, Section 6.6.5 and 6.6.6, Subsection
+ * "Constraints", first paragraph, for explanation of logic. */
+ final int viewportBPD = this.traitBpDimensionOpt(context);
+ if (viewportBPD != FoPropertyConstants.DIMENSION_AUTO) {
+ return viewportBPD;
+ }
+
+ /* The remaining logic is for the "auto" case.
+ * The CSS2 spec says that for replaced inline content, if
+ * height="auto", it should return the intrinsic height.
+ * See http://www.w3.org/TR/REC-CSS2/visudet.html#q16.
+ * However, the documentation on the fo:external-graphic and
+ * fo:instream-foreign-object say that the "content size" should be
+ * used, and then define it. */
+ final int intrinsicHeight = this.intrinsicContentHeight(context);
+
+ /* We already know that the viewport BPD is dependent on the
+ * content-height.
+ * If the content-height is also dependent on the viewport BPD, then we
+ * have a circular dependency. */
+ if (this.isContentHeightDependentOnPd(context)) {
+ /* We have a circular dependency. See if we can use the other
+ * dimension to compute this one. */
+ if (this.isViewportIpdDependent(context)) {
+ /* The viewport IPD is not specified either, so the user has
+ * given us absolutely nothing by which to compute the
+ * dimensions of this viewport.
+ * We punt by returning the smaller of 1) the intrinsic height,
+ * and 2) the height of the parent area. */
+ return Math.min(intrinsicHeight,
+ context.bpdAncestorBlockOrRa());
+ } else {
+ /* We can use the other dimension to compute this one. */
+ final int viewportIpd = this.viewportIpd(context);
+ final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final float heightToWidth = (float) intrinsicHeight
+ / (float) intrinsicWidth;
+ return Math.round(heightToWidth * viewportIpd);
+ }
+ }
+
+ /* The content-height is not dependent on the viewport BPD, so we can
+ * compute it first, then use it to compute the viewport BPD. */
+ final float scalingFactor = this.getContentHeight(context, this);
+ return Math.round(this.intrinsicContentHeight(context) * scalingFactor);
+ }
+
+ /**
+ * Indicates whether the viewport BPD for this graphic can be computed
+ * independent of the viewport IPD.
+ * @param context An object that knows how to resolve FO Tree context
+ * issues.
+ * @return True if and only if the viewport IPD needs to be computed before the BPD
+ * can be.
+ */
+ private boolean isViewportBpdDependent(final FoContext context) {
+ final int viewportBPD = this.traitBpDimensionOpt(context);
+ if (viewportBPD != FoPropertyConstants.DIMENSION_AUTO) {
+ return false;
+ }
+ if (this.isContentHeightDependentOnPd(context)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Converts a quantity of pixels to a length in millipoints, using the
+ * value passed in pixelsPerInch.
+ * @param pixels The quantity of pixels to be converted to millipoints.
+ * @param pixelsPerInch The resolution, in pixels-per-inch, at which the
+ * conversion should take place.
+ * @return The millipoint equivalent of pixels.
+ */
+ public static int pixelsToMillipoints(final int pixels, final int pixelsPerInch) {
+ return pixels * TypographicConstants.POINTS_PER_INCH
+ * TypographicConstants.MILLIPOINTS_PER_POINT / pixelsPerInch;
+ }
+
+ @Override
+ public int referenceIpd(final FoContext context) {
+ final int intrinsicWidth = this.intrinsicContentWidth(context);
+ final float scaling = this.getContentWidth(context, this);
+ return Math.round(intrinsicWidth * scaling);
+ }
+
+ @Override
+ public int referenceBpd(final FoContext context) {
+ final int intrinsicHeight = this.intrinsicContentHeight(context);
+ final float scaling = this.getContentHeight(context, this);
+ return Math.round(intrinsicHeight * scaling);
+ }
+
+ @Override
+ public PropertyList getPropertyList() {
+ return this.propertyList;
+ }
+
+}
Deleted: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -1,244 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.fotree.fo.obj;
-
-import org.foray.fotree.FoObj;
-import org.foray.fotree.PropertyList;
-
-import org.axsl.constants.TypographicConstants;
-import org.axsl.fotree.FoContext;
-import org.axsl.fotree.FoScaled;
-import org.axsl.value.FoPropertyConstants;
-
-/**
- * Abstract base class for inline FOs that are scaleable. This currently
- * includes external-graphic and instream-foreign-object.
- */
-public abstract class FoScaled4a extends FoObj implements FoScaled {
-
- /** The property list for this object. */
- private PropertyList propertyList;
-
- /**
- * Constructor.
- * @param parent The parent FoObj.
- * @param propertyList The property list for this FoObj.
- */
- public FoScaled4a(final FoObj parent, final PropertyList propertyList) {
- super(parent);
- this.propertyList = propertyList;
- }
-
- /**
- * Returns the width of the content.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return The width, in millipoints, of the content of this object, as
- * reported by the content itself.
- */
- public abstract int intrinsicContentWidth(FoContext context);
-
- /**
- * Returns the height of the content.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return The height, in millipoints, of the content of this object, as
- * reported by the content itself.
- */
- public abstract int intrinsicContentHeight(FoContext context);
-
- @Override
- public int viewportIpd(final FoContext context) {
- /* See XSL-FO Standard 1.0, Section 6.6.5 and 6.6.6, Subsection
- * "Constraints", first paragraph, for explanation of logic. */
- final int viewportIPD = this.traitIpDimensionOpt(context);
- if (viewportIPD != FoPropertyConstants.DIMENSION_AUTO) {
- return viewportIPD;
- }
-
- /* The remaining logic is for the "auto" case.
- * The CSS2 spec says that for replaced inline content, if
- * width="auto", it should return the intrinsic width.
- * See http://www.w3.org/TR/REC-CSS2/visudet.html#q5.
- * However, the documentation on the fo:external-graphic and
- * fo:instream-foreign-object say that the "content size" should be
- * used, and then define it. */
- final int intrinsicWidth = this.intrinsicContentWidth(context);
-
- /* We already know that the viewport IPD is dependent on the
- * content-width.
- * If the content-width is also dependent on the viewport IPD, then we
- * have a circular dependency. */
- if (this.isContentWidthDependentOnPd(context)) {
- /* We have a circular dependency. See if we can use the other
- * dimension to compute this one. */
- if (this.isViewportBpdDependent(context)) {
- /* The viewport BPD is not specified either, so the user has
- * given us absolutely nothing by which to compute the
- * dimensions of this viewport.
- * We punt by returning the smaller of 1) the intrinsic width,
- * and 2) the width of the parent area. */
- return Math.min(intrinsicWidth,
- context.ipdAncestorBlockOrRa());
- } else {
- /* We can use the other dimension to compute this one. */
- final int viewportBpd = this.viewportBpd(context);
- final int intrinsicHeight = this.intrinsicContentWidth(context);
- final float widthToHeight = (float) intrinsicWidth
- / (float) intrinsicHeight;
- return Math.round(widthToHeight * viewportBpd);
- }
- }
-
- /* The content-width is not dependent on the viewport IPD, so we can
- * compute it first, then use it to compute the viewport IPD. */
- final float scalingFactor = this.getContentWidth(context, this);
- return Math.round(intrinsicWidth * scalingFactor);
- }
-
- /**
- * Indicates whether the viewport IPD for this graphic can be computed
- * independent of the viewport BPD.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return True if and only if the viewport BPD needs to be computed before the IPD
- * can be.
- */
- private boolean isViewportIpdDependent(final FoContext context) {
- final int viewportIPD = this.traitIpDimensionOpt(context);
- if (viewportIPD != FoPropertyConstants.DIMENSION_AUTO) {
- return false;
- }
- if (this.isContentWidthDependentOnPd(context)) {
- return true;
- }
- return false;
- }
-
- @Override
- public int viewportBpd(final FoContext context) {
- /* See XSL-FO Standard 1.0, Section 6.6.5 and 6.6.6, Subsection
- * "Constraints", first paragraph, for explanation of logic. */
- final int viewportBPD = this.traitBpDimensionOpt(context);
- if (viewportBPD != FoPropertyConstants.DIMENSION_AUTO) {
- return viewportBPD;
- }
-
- /* The remaining logic is for the "auto" case.
- * The CSS2 spec says that for replaced inline content, if
- * height="auto", it should return the intrinsic height.
- * See http://www.w3.org/TR/REC-CSS2/visudet.html#q16.
- * However, the documentation on the fo:external-graphic and
- * fo:instream-foreign-object say that the "content size" should be
- * used, and then define it. */
- final int intrinsicHeight = this.intrinsicContentHeight(context);
-
- /* We already know that the viewport BPD is dependent on the
- * content-height.
- * If the content-height is also dependent on the viewport BPD, then we
- * have a circular dependency. */
- if (this.isContentHeightDependentOnPd(context)) {
- /* We have a circular dependency. See if we can use the other
- * dimension to compute this one. */
- if (this.isViewportIpdDependent(context)) {
- /* The viewport IPD is not specified either, so the user has
- * given us absolutely nothing by which to compute the
- * dimensions of this viewport.
- * We punt by returning the smaller of 1) the intrinsic height,
- * and 2) the height of the parent area. */
- return Math.min(intrinsicHeight,
- context.bpdAncestorBlockOrRa());
- } else {
- /* We can use the other dimension to compute this one. */
- final int viewportIpd = this.viewportIpd(context);
- final int intrinsicWidth = this.intrinsicContentWidth(context);
- final float heightToWidth = (float) intrinsicHeight
- / (float) intrinsicWidth;
- return Math.round(heightToWidth * viewportIpd);
- }
- }
-
- /* The content-height is not dependent on the viewport BPD, so we can
- * compute it first, then use it to compute the viewport BPD. */
- final float scalingFactor = this.getContentHeight(context, this);
- return Math.round(this.intrinsicContentHeight(context) * scalingFactor);
- }
-
- /**
- * Indicates whether the viewport BPD for this graphic can be computed
- * independent of the viewport IPD.
- * @param context An object that knows how to resolve FO Tree context
- * issues.
- * @return True if and only if the viewport IPD needs to be computed before the BPD
- * can be.
- */
- private boolean isViewportBpdDependent(final FoContext context) {
- final int viewportBPD = this.traitBpDimensionOpt(context);
- if (viewportBPD != FoPropertyConstants.DIMENSION_AUTO) {
- return false;
- }
- if (this.isContentHeightDependentOnPd(context)) {
- return true;
- }
- return false;
- }
-
- /**
- * Converts a quantity of pixels to a length in millipoints, using the
- * value passed in pixelsPerInch.
- * @param pixels The quantity of pixels to be converted to millipoints.
- * @param pixelsPerInch The resolution, in pixels-per-inch, at which the
- * conversion should take place.
- * @return The millipoint equivalent of pixels.
- */
- public static int pixelsToMillipoints(final int pixels, final int pixelsPerInch) {
- return pixels * TypographicConstants.POINTS_PER_INCH
- * TypographicConstants.MILLIPOINTS_PER_POINT / pixelsPerInch;
- }
-
- @Override
- public int referenceIpd(final FoContext context) {
- final int intrinsicWidth = this.intrinsicContentWidth(context);
- final float scaling = this.getContentWidth(context, this);
- return Math.round(intrinsicWidth * scaling);
- }
-
- @Override
- public int referenceBpd(final FoContext context) {
- final int intrinsicHeight = this.intrinsicContentHeight(context);
- final float scaling = this.getContentHeight(context, this);
- return Math.round(intrinsicHeight * scaling);
- }
-
- @Override
- public PropertyList getPropertyList() {
- return this.propertyList;
- }
-
-}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/InstreamForeignObject4a.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -44,7 +44,7 @@
/**
* An "instream-foreign-object" object in XSL-FO.
*/
-public class InstreamForeignObject4a extends FoScaled4a implements InstreamForeignObject {
+public class InstreamForeignObject4a extends FoScalable4a implements InstreamForeignObject {
/** The parent of this node. */
private FoObj parent;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractContentDimension.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -33,7 +33,7 @@
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
import org.foray.fotree.fo.FoValue;
-import org.foray.fotree.fo.obj.FoScaled4a;
+import org.foray.fotree.fo.obj.FoScalable4a;
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
@@ -104,7 +104,7 @@
* @return The scaling factor implied or stated by this property.
*/
public float getValue(final FoContext context, final FoObj fobj,
- final FoScaled4a fobjScaled) {
+ final FoScalable4a fobjScaled) {
if (value().canEvalKeyword()) {
final FoValue keyword = this.convertValueToFoValue(value());
switch (keyword) {
@@ -159,7 +159,7 @@
* @param context An object that knows how to resolve FO Tree context
* issues.
* @return True if the IPD or BPD must be known in order to for
- * {@link #getValue(FoContext, FoObj, FoScaled4a)} to return a useful
+ * {@link #getValue(FoContext, FoObj, FoScalable4a)} to return a useful
* amount.
*/
public boolean dependsOnPd(final FoObj fobj, final FoContext context) {
@@ -213,7 +213,7 @@
* value.
* @return The inherited scaling factor.
*/
- protected abstract float getInheritedValue(FoContext context, FoScaled4a fobjScaled, FoObj parent);
+ protected abstract float getInheritedValue(FoContext context, FoScalable4a fobjScaled, FoObj parent);
/**
* Returns either the intrinsic height or intrinsic width of the graphic,
@@ -225,7 +225,7 @@
* @return The intrinsic dimension of the graphic on the axis being computed
* (height for content-height, width for content-width).
*/
- protected abstract int intrinsicContentDimension(FoScaled4a fobjScaled,
+ protected abstract int intrinsicContentDimension(FoScalable4a fobjScaled,
FoContext context);
/**
@@ -238,7 +238,7 @@
* @return The intrinsic dimension of the graphic on the axis being computed
* (height for content-height, width for content-width).
*/
- protected abstract int viewportDimension(FoScaled4a fobjScaled,
+ protected abstract int viewportDimension(FoScalable4a fobjScaled,
FoContext context);
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentHeight.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.obj.FoScaled4a;
+import org.foray.fotree.fo.obj.FoScalable4a;
import org.axsl.fotree.FoContext;
@@ -62,18 +62,18 @@
@Override
protected float getInheritedValue(final FoContext context,
- final FoScaled4a fobjScaled, final FoObj parent) {
+ final FoScalable4a fobjScaled, final FoObj parent) {
return parent.getContentHeight(context, fobjScaled);
}
@Override
- protected int intrinsicContentDimension(final FoScaled4a fobjScaled,
+ protected int intrinsicContentDimension(final FoScalable4a fobjScaled,
final FoContext context) {
return fobjScaled.intrinsicContentHeight(context);
}
@Override
- protected int viewportDimension(final FoScaled4a fobjScaled,
+ protected int viewportDimension(final FoScalable4a fobjScaled,
final FoContext context) {
return fobjScaled.viewportBpd(context);
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdContentWidth.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -31,7 +31,7 @@
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.FoPropertyId;
-import org.foray.fotree.fo.obj.FoScaled4a;
+import org.foray.fotree.fo.obj.FoScalable4a;
import org.axsl.fotree.FoContext;
@@ -62,18 +62,18 @@
@Override
protected float getInheritedValue(final FoContext context,
- final FoScaled4a fobjScaled, final FoObj parent) {
+ final FoScalable4a fobjScaled, final FoObj parent) {
return parent.getContentWidth(context, fobjScaled);
}
@Override
- protected int intrinsicContentDimension(final FoScaled4a fobjScaled,
+ protected int intrinsicContentDimension(final FoScalable4a fobjScaled,
final FoContext context) {
return fobjScaled.intrinsicContentWidth(context);
}
@Override
- protected int viewportDimension(final FoScaled4a fobjScaled,
+ protected int viewportDimension(final FoScalable4a fobjScaled,
final FoContext context) {
return fobjScaled.viewportBpd(context);
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/ExternalGraphicPnr.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -28,7 +28,7 @@
package org.foray.pioneer;
-import org.foray.content.ScaledContent;
+import org.foray.content.ScalableContent;
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTreeException;
@@ -77,7 +77,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new ScaledContent(this.realFONode, lineArea));
+ return addNonTextContent(lineArea, new ScalableContent(this.realFONode, lineArea));
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java 2022-12-12 22:33:16 UTC (rev 12845)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/InstreamForeignObjectPnr.java 2022-12-13 00:04:27 UTC (rev 12846)
@@ -28,7 +28,7 @@
package org.foray.pioneer;
-import org.foray.content.ScaledContent;
+import org.foray.content.ScalableContent;
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTreeException;
@@ -61,7 +61,7 @@
// Not enough room on the page for this.
return Status.AREA_FULL_NONE;
}
- return addNonTextContent(lineArea, new ScaledContent(this.node, lineArea));
+ return addNonTextContent(lineArea, new ScalableContent(this.node, lineArea));
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 22:33:18
|
Revision: 12845
http://sourceforge.net/p/foray/code/12845
Author: victormote
Date: 2022-12-12 22:33:16 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Remove assertions about messages for IndexOutOfBoundsException. They appear to be inconsistent.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-12-12 22:03:27 UTC (rev 12844)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/SegmentDictionaryWordTests.java 2022-12-12 22:33:16 UTC (rev 12845)
@@ -312,7 +312,6 @@
fail("Expected: " + IndexOutOfBoundsException.class.getName());
} catch (final IndexOutOfBoundsException e) {
/* This is the expected path. */
- assertEquals("-1", e.getMessage());
}
try {
word.wordSegmentAt(3);
@@ -319,7 +318,6 @@
fail("Expected: " + IndexOutOfBoundsException.class.getName());
} catch (final IndexOutOfBoundsException e) {
/* This is the expected path. */
- assertEquals("3", e.getMessage());
}
}
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-12-12 22:03:27 UTC (rev 12844)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/WordWrapperTests.java 2022-12-12 22:33:16 UTC (rev 12845)
@@ -349,7 +349,6 @@
fail("Expected: " + IndexOutOfBoundsException.class.getName());
} catch (final IndexOutOfBoundsException e) {
/* This is the expected path. */
- assertEquals("-1", e.getMessage());
}
try {
this.out.wordSegmentAt(4);
@@ -356,7 +355,6 @@
fail("Expected: " + IndexOutOfBoundsException.class.getName());
} catch (final IndexOutOfBoundsException e) {
/* This is the expected path. */
- assertEquals("4", e.getMessage());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 22:03:30
|
Revision: 12844
http://sourceforge.net/p/foray/code/12844
Author: victormote
Date: 2022-12-12 22:03:27 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Gradle style changes only.
Modified Paths:
--------------
trunk/foray/foray-app/build.gradle
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-common/build.gradle
trunk/foray/foray-content/build.gradle
trunk/foray/foray-core/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-layout/build.gradle
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-mif/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-output/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-pioneer/build.gradle
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-speech/build.gradle
trunk/foray/foray-xml/build.gradle
trunk/foray/foray-zz-attic/build.gradle
Modified: trunk/foray/foray-app/build.gradle
===================================================================
--- trunk/foray/foray-app/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-app/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -8,48 +8,48 @@
description = 'foray-app'
dependencies {
- implementation group: 'javax.servlet', name: 'javax.servlet-api', version: versions.servletApi
- implementation group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver
- implementation group: 'org.apache.ant', name: 'ant', version: versions.ant
- implementation group: 'commons-io', name: 'commons-io', version: versions.commonsIo
- implementation group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
+ implementation (group: 'javax.servlet', name: 'javax.servlet-api', version: versions.servletApi)
+ implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
+ implementation (group: 'org.apache.ant', name: 'ant', version: versions.ant)
+ implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- implementation group: 'org.axsl', name: 'axsl-font', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-ps', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-output', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-galley', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-layout', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-speech', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-mif', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl
+ implementation (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- implementation project(':foray-areatree')
- implementation project(':foray-common')
- implementation project(':foray-core')
- implementation project(':foray-font')
- implementation project(':foray-fotree')
- implementation project(':foray-graphic')
- implementation project(':foray-layout')
- implementation project(':foray-mif')
- implementation project(':foray-orthography')
- implementation project(':foray-output')
- implementation project(':foray-pdf')
- implementation project(':foray-pioneer')
- implementation project(':foray-ps')
- implementation project(':foray-render')
- implementation project(':foray-speech')
- implementation project(':foray-linebreak')
+ implementation (project(':foray-areatree'))
+ implementation (project(':foray-common'))
+ implementation (project(':foray-core'))
+ implementation (project(':foray-font'))
+ implementation (project(':foray-fotree'))
+ implementation (project(':foray-graphic'))
+ implementation (project(':foray-layout'))
+ implementation (project(':foray-mif'))
+ implementation (project(':foray-orthography'))
+ implementation (project(':foray-output'))
+ implementation (project(':foray-pdf'))
+ implementation (project(':foray-pioneer'))
+ implementation (project(':foray-ps'))
+ implementation (project(':foray-render'))
+ implementation (project(':foray-speech'))
+ implementation (project(':foray-linebreak'))
- testFixturesImplementation project(':foray-areatree')
- testFixturesImplementation project(':foray-core')
- testFixturesImplementation project(':foray-fotree')
- testFixturesImplementation project(':foray-pioneer')
+ testFixturesImplementation (project(':foray-areatree'))
+ testFixturesImplementation (project(':foray-core'))
+ testFixturesImplementation (project(':foray-fotree'))
+ testFixturesImplementation (project(':foray-pioneer'))
}
javadoc {
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-areatree/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,9 +7,9 @@
description = 'foray-areatree'
dependencies {
- api group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl
- api group: "org.axsl", name: "axsl-font", version: versions.axsl
- api group: "org.axsl", name: "axsl-fotree", version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-font", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-fotree", version: versions.axsl)
/* We dislike declaring a direct dependency on axsl-galley here as axsl-areatree is intended to be a direct superset
* of it, and a dependency on axsl-areatree should be sufficient. Indeed, from a gradle standpoint it is, as gradle
* handles the transitive dependency properly. However, there is no build pattern (known to us) that allows a module
@@ -16,14 +16,14 @@
* to declare that its API is a direct (non-transitive) superset of another module's API. Since we are using the
* autonomousapps dependency-analysis tool, which (for good reason) dislikes having transitive dependencies
* accidentally leak into the API of client code, we declare a direct dependency on axsl-galley here. */
- api group: "org.axsl", name: "axsl-galley", version: versions.axsl
- api group: "org.axsl", name: "axsl-graphic", version: versions.axsl
- api group: "org.axsl", name: "axsl-i18n", version: versions.axsl
- api group: "org.axsl", name: "axsl-orthography", version: versions.axsl
- api group: "org.axsl", name: "axsl-value", version: versions.axsl
- implementation group: "org.axsl", name: "axsl-constants", version: versions.axsl
+ api (group: "org.axsl", name: "axsl-galley", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-graphic", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-i18n", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-value", version: versions.axsl)
+ implementation (group: "org.axsl", name: "axsl-constants", version: versions.axsl)
- api project(':foray-common')
+ api (project(':foray-common'))
}
javadoc {
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-common/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -19,7 +19,7 @@
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api project(':foray-primitive')
+ api project(':foray-primitive')
}
javadoc {
Modified: trunk/foray/foray-content/build.gradle
===================================================================
--- trunk/foray/foray-content/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-content/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -5,17 +5,17 @@
description = 'foray-content'
dependencies {
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
- api (project(':foray-common'))
+ api (project(':foray-common'))
}
javadoc {
Modified: trunk/foray/foray-core/build.gradle
===================================================================
--- trunk/foray/foray-core/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-core/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,21 +6,21 @@
description = 'foray-core'
dependencies {
- implementation group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver
+ implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
- api group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-font', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-galley', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-layout', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-output', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-speech', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- api project(':foray-common')
- api project(':foray-xml')
+ api (project(':foray-common'))
+ api (project(':foray-xml'))
}
javadoc {
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-font/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -8,20 +8,20 @@
dependencies {
- api group: 'commons-io', name: 'commons-io', version: versions.commonsIo
- implementation group: 'commons-discovery', name: 'commons-discovery', version: versions.commonsDiscovery
- api group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
+ api (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation (group: 'commons-discovery', name: 'commons-discovery', version: versions.commonsDiscovery)
+ api (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api project(':foray-common')
- api (project(':foray-xml'))
+ api (project(':foray-common'))
+ api (project(':foray-xml'))
- testRuntimeOnly (project(':foray-ps'))
+ testRuntimeOnly (project(':foray-ps'))
}
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-fotree/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,20 +7,20 @@
description = 'foray-fotree'
dependencies {
- api group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
- api group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom
+ api (group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom)
+ api (group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-font', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-speech', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-constants', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-value', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
api project(':foray-common')
api project(':foray-xml')
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-graphic/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,30 +7,30 @@
description = 'foray-graphic'
dependencies {
- api (group: 'org.apache.xmlgraphics', name: 'xmlgraphics-commons', version: versions.xmlgraphicsCommons)
- api (group: 'org.apache.xmlgraphics', name: 'batik-bridge', version: versions.batik)
- api (group: 'org.apache.xmlgraphics', name: 'batik-gvt', version: versions.batik)
- implementation (group: 'org.apache.xmlgraphics', name: 'batik-parser', version: versions.batik)
- implementation (group: 'org.apache.xmlgraphics', name: 'batik-transcoder', version: versions.batik)
- implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
- api (group: "org.apache.xmlgraphics", name: "batik-dom", version: versions.batik)
- implementation (group: "org.apache.xmlgraphics", name: "batik-util", version: versions.batik)
- api (group: "xml-apis", name: "xml-apis", version: "1.4.01")
- api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
-// api group: 'net.sourceforge.jeuclid', name: 'jeuclid-core', version: versions.jeuclid
- api (group: 'de.rototor.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
- api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
- api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+ api (group: 'org.apache.xmlgraphics', name: 'xmlgraphics-commons', version: versions.xmlgraphicsCommons)
+ api (group: 'org.apache.xmlgraphics', name: 'batik-bridge', version: versions.batik)
+ api (group: 'org.apache.xmlgraphics', name: 'batik-gvt', version: versions.batik)
+ implementation (group: 'org.apache.xmlgraphics', name: 'batik-parser', version: versions.batik)
+ implementation (group: 'org.apache.xmlgraphics', name: 'batik-transcoder', version: versions.batik)
+ implementation (group: "org.apache.xmlgraphics", name: "batik-anim", version: versions.batik)
+ api (group: "org.apache.xmlgraphics", name: "batik-dom", version: versions.batik)
+ implementation (group: "org.apache.xmlgraphics", name: "batik-util", version: versions.batik)
+ api (group: "xml-apis", name: "xml-apis", version: "1.4.01")
+ api (group: "xml-apis", name: "xml-apis-ext", version: "1.3.04")
+// api (group: 'net.sourceforge.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
+ api (group: 'de.rototor.jeuclid', name: 'jeuclid-core', version: versions.jeuclid)
+ api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
+ api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- api (project(':foray-common'))
- implementation (project(':foray-xml'))
+ api (project(':foray-common'))
+ implementation (project(':foray-xml'))
}
javadoc {
Modified: trunk/foray/foray-layout/build.gradle
===================================================================
--- trunk/foray/foray-layout/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-layout/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -5,9 +5,9 @@
description = 'foray-layout'
dependencies {
- api group: 'org.axsl', name: 'axsl-layout', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
}
javadoc {
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-linebreak/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,20 +6,20 @@
description = 'foray-linebreak'
dependencies {
- api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
- api (group: "org.axsl", name: "axsl-context", version: versions.axsl)
- api (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-context", version: versions.axsl)
+ api (group: "org.axsl", name: "axsl-kp-model", version: versions.axsl)
- api project(':foray-common')
+ api (project(':foray-common'))
- testImplementation project(':foray-orthography')
- testImplementation(group: "org.axsl", name: "axsl-font", version: versions.axsl)
- testImplementation(group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
- testImplementation(group: "org.axsl", name: "axsl-ps", version: versions.axsl)
- testImplementation(project(":foray-ps"))
+ testImplementation (project(':foray-orthography'))
+ testImplementation (group: "org.axsl", name: "axsl-font", version: versions.axsl)
+ testImplementation (group: "org.axsl", name: "axsl-orthography", version: versions.axsl)
+ testImplementation (group: "org.axsl", name: "axsl-ps", version: versions.axsl)
+ testImplementation (project(":foray-ps"))
- testImplementation(testFixtures(group: "org.axsl", name: "axsl-font", version: versions.axsl))
- testImplementation(testFixtures(group: "org.axsl", name: "axsl-kp-model", version: versions.axsl))
+ testImplementation (testFixtures(group: "org.axsl", name: "axsl-font", version: versions.axsl))
+ testImplementation (testFixtures(group: "org.axsl", name: "axsl-kp-model", version: versions.axsl))
}
javadoc {
Modified: trunk/foray/foray-mif/build.gradle
===================================================================
--- trunk/foray/foray-mif/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-mif/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,10 +6,10 @@
description = 'foray-mif'
dependencies {
- api group: 'org.axsl', name: 'axsl-mif', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-output', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- implementation project(':foray-common')
+ implementation (project(':foray-common'))
}
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-orthography/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,22 +7,22 @@
description = 'foray-orthography'
dependencies {
- api group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
- api group: 'commons-io', name: 'commons-io', version: versions.commonsIo
- implementation group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j
+ api (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ api (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ implementation (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api project(':foray-primitive')
- api project(':foray-common')
- api project(':foray-xml')
+ api (project(':foray-primitive'))
+ api (project(':foray-common'))
+ api (project(':foray-xml'))
}
Modified: trunk/foray/foray-output/build.gradle
===================================================================
--- trunk/foray/foray-output/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-output/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,12 +6,12 @@
description = 'foray-output'
dependencies {
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-mif', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
- implementation (project(':foray-common'))
+ implementation (project(':foray-common'))
}
javadoc {
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-pdf/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,21 +7,21 @@
description = 'foray-pdf'
dependencies {
- api group: 'org.apache.xmlgraphics', name: 'batik-awt-util', version: versions.batik
+ api (group: 'org.apache.xmlgraphics', name: 'batik-awt-util', version: versions.batik)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (project(':foray-common'))
+ api (project(':foray-common'))
- testImplementation project(':foray-font')
- testImplementation(project(":foray-ps"))
+ testImplementation (project(':foray-font'))
+ testImplementation (project(":foray-ps"))
}
javadoc {
Modified: trunk/foray/foray-pioneer/build.gradle
===================================================================
--- trunk/foray/foray-pioneer/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-pioneer/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,23 +6,23 @@
description = 'foray-pioneer'
dependencies {
- api group: 'org.axsl', name: 'axsl-content', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-context', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-layout', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-galley', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-font', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-constants', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-value', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-context', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-layout', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-areatree', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-linebreak', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- implementation project(':foray-common')
- api project(':foray-layout')
- implementation project(':foray-content')
+ implementation (project(':foray-common'))
+ api (project(':foray-layout'))
+ implementation (project(':foray-content'))
}
javadoc {
Modified: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-primitive/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,8 +7,8 @@
dependencies {
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
}
javadoc {
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-ps/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,15 +7,15 @@
description = 'foray-ps'
dependencies {
- implementation group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
+ implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- api group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl
- api group: 'org.axsl', name: 'axsl-ps', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation project(':foray-common')
+ implementation (project(':foray-common'))
- testImplementation group: 'commons-io', name: 'commons-io', version: versions.commonsIo
+ testImplementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
}
javadoc {
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-render/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,21 +6,21 @@
description = 'foray-render'
dependencies {
- implementation group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
+ implementation group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-galley', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
- implementation (project(':foray-common'))
- api (project(':foray-output'))
+ implementation (project(':foray-common'))
+ api (project(':foray-output'))
}
javadoc {
Modified: trunk/foray/foray-speech/build.gradle
===================================================================
--- trunk/foray/foray-speech/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-speech/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -5,7 +5,7 @@
description = 'foray-speech'
dependencies {
- api group: 'org.axsl', name: 'axsl-speech', version: versions.axsl
+ api (group: 'org.axsl', name: 'axsl-speech', version: versions.axsl)
}
javadoc {
Modified: trunk/foray/foray-xml/build.gradle
===================================================================
--- trunk/foray/foray-xml/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-xml/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -7,12 +7,11 @@
description = 'foray-xml'
dependencies {
- implementation group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
- implementation group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver
- implementation group: 'org.apache.ws.xmlschema',
- name: 'xmlschema-core', version: '2.3.0'
+ implementation (group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli)
+ implementation (group: 'xml-resolver', name: 'xml-resolver', version: versions.xmlResolver)
+ implementation (group: 'org.apache.ws.xmlschema', name: 'xmlschema-core', version: '2.3.0')
- implementation project(':foray-common')
+ implementation (project(':foray-common'))
}
javadoc {
Modified: trunk/foray/foray-zz-attic/build.gradle
===================================================================
--- trunk/foray/foray-zz-attic/build.gradle 2022-12-12 18:45:59 UTC (rev 12843)
+++ trunk/foray/foray-zz-attic/build.gradle 2022-12-12 22:03:27 UTC (rev 12844)
@@ -6,12 +6,13 @@
description = 'foray-zz-attic'
dependencies {
- implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
- api (group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.2')
+ implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
+ api (group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.2')
api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
- implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
- api (project(':foray-common'))
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+
+ api ((project(':foray-common')))
}
javadoc {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 18:46:02
|
Revision: 12843
http://sourceforge.net/p/foray/code/12843
Author: victormote
Date: 2022-12-12 18:45:59 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Move typographic constants to a new aXSL class.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -45,17 +45,6 @@
/** The number of millimeters per centimeter. */
public static final float MM_PER_CM = 10;
- /** The number of points per inch, that is 72. A "point" is a somewhat
- * nebulous term, but here we use the term as standardized by Adobe in their
- * concept of text space units. */
- public static final int POINTS_PER_INCH = 72;
-
- /** The number of picas per inch, that is, 6. */
- public static final int PICAS_PER_INCH = 6;
-
- /** The number of decipoints per point, that is, 10. */
- public static final int DECIPOINTS_PER_POINT = 10;
-
/** The carriage-return / linefeed combination, cast as a byte array. */
public static final ByteArray ASCII_CARRIAGE_RETURN_LINEFEED =
new ByteArray((byte) Basic_Latin_Block.CONTROL_CARRIAGE_RETURN, (byte) Basic_Latin_Block.CONTROL_LINE_FEED);
@@ -88,8 +77,7 @@
/** The number of grads in a circle, that is, 400. */
public static final short GRADS_PER_CIRCLE = 400;
- /** The number of milli-units (thousandths of a unit) per unit, that is,
- * 1000. */
+ /** The number of milli-units (thousandths of a unit) per unit, which is {@value}. */
public static final short MILLIUNITS_PER_UNIT = 1000;
/** An empty String useful for return values that might return "null", but
@@ -110,8 +98,7 @@
public static final int CUBED_EXPONENT = 3;
/**
- * Private constructor. This is a utility class, and should never be
- * instantiated.
+ * Private constructor. This is a utility class, and should never be instantiated.
*/
private WellKnownConstants() { }
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoScaled4a.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,10 +28,10 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyList;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoScaled;
import org.axsl.value.FoPropertyConstants;
@@ -217,10 +217,9 @@
* conversion should take place.
* @return The millipoint equivalent of pixels.
*/
- public static int pixelsToMillipoints(final int pixels,
- final int pixelsPerInch) {
- return pixels * WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIUNITS_PER_UNIT / pixelsPerInch;
+ public static int pixelsToMillipoints(final int pixels, final int pixelsPerInch) {
+ return pixels * TypographicConstants.POINTS_PER_INCH
+ * TypographicConstants.MILLIPOINTS_PER_POINT / pixelsPerInch;
}
@Override
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdColumnGap.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -37,6 +37,7 @@
import org.foray.fotree.fo.obj.RegionBody4a;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
/**
@@ -51,8 +52,7 @@
};
/** The default gap, which is 12pt, as per the spec, Section 7.25.3. */
- private static final short DEFAULT_GAP = 12
- * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ private static final short DEFAULT_GAP = 12 * TypographicConstants.MILLIPOINTS_PER_POINT;
/** The PropertyValue instance that contains this property's value. */
private PropertyValue value;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderLength.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -42,6 +42,7 @@
import org.foray.fotree.value.DtPercentage;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
@@ -51,10 +52,8 @@
*/
public class PdLeaderLength extends AbstractFoProperty {
- /** The default optimum value, as defined by the XSL-FO 1.0 Specification,
- * Section 7.21.4. */
- private static final int DEFAULT_OPTIMUM_VALUE = 12
- * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ /** The default optimum value, as defined by the XSL-FO 1.1 Specification, Section 7.22.4, which is 12 points. */
+ private static final int DEFAULT_OPTIMUM_VALUE = 12 * TypographicConstants.MILLIPOINTS_PER_POINT;
/** The default optimum value when creating a length-range component. */
private static final DtLength DEFAULT_OPTIMUM_COMPONENT = new DtLength(
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleThickness.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.prop;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
import org.foray.fotree.fo.AbstractFoProperty;
@@ -36,6 +35,7 @@
import org.foray.fotree.fo.FoValue;
import org.foray.fotree.value.PropertyValue;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
/**
@@ -45,8 +45,7 @@
public class PdRuleThickness extends AbstractFoProperty {
/** Initial value per the spec is 1.0pt. */
- private static final short DEFAULT_VALUE = 1
- * WellKnownConstants.MILLIUNITS_PER_UNIT;
+ private static final short DEFAULT_VALUE = 1 * TypographicConstants.MILLIPOINTS_PER_POINT;
/** The PropertyValue instance that contains this property's value. */
private PropertyValue value;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtLength.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -30,6 +30,8 @@
import org.foray.common.WellKnownConstants;
+import org.axsl.constants.TypographicConstants;
+
import java.awt.Color;
@@ -111,30 +113,30 @@
public int getValue(final int fontSize) {
switch (this.units) {
case DtLength.UNIT_INCHES: {
- return Math.round(this.value * WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_CENTIMETERS: {
- return Math.round(this.value * WellKnownConstants.POINTS_PER_INCH
+ return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
/ WellKnownConstants.CM_PER_INCH
- * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_MILLIMETERS: {
- return Math.round(this.value * WellKnownConstants.POINTS_PER_INCH
+ return Math.round(this.value * TypographicConstants.POINTS_PER_INCH
/ WellKnownConstants.CM_PER_INCH
/ WellKnownConstants.MM_PER_CM
- * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_POINTS: {
- return Math.round(this.value * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ return Math.round(this.value * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_PICAS: {
- return Math.round(this.value * WellKnownConstants.PICAS_PER_INCH
- * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ return Math.round(this.value * TypographicConstants.PICAS_PER_INCH
+ * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_PIXELS: {
// for now, assume that 1 pixel = 1 point = 1/72"
- return Math.round(this.value * WellKnownConstants.MILLIUNITS_PER_UNIT);
+ return Math.round(this.value * TypographicConstants.MILLIPOINTS_PER_POINT);
}
case DtLength.UNIT_EMS: {
return Math.round(this.value * fontSize);
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnBodyStart.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,10 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
import java.awt.Color;
@@ -79,7 +79,7 @@
+ provisionalDistanceBetweenStarts;
DtLength lengthDT = null;
- lengthDT = new DtLength(length / WellKnownConstants.MILLIUNITS_PER_UNIT, "pt");
+ lengthDT = new DtLength(length / TypographicConstants.MILLIPOINTS_PER_POINT, "pt");
return lengthDT;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnLabelEnd.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,10 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.FoObj;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.TypographicConstants;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.ListBlock;
@@ -83,7 +83,7 @@
- provisionalLabelSeparation);
DtLength lengthDT = null;
- lengthDT = new DtLength(length / WellKnownConstants.MILLIUNITS_PER_UNIT, "pt");
+ lengthDT = new DtLength(length / TypographicConstants.MILLIPOINTS_PER_POINT, "pt");
return lengthDT;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,11 +28,11 @@
package org.foray.graphic;
-import org.foray.common.WellKnownConstants;
import org.foray.graphic.factory.GraphicFactory;
import org.foray.graphic.output.GraphicOutputFactory;
import org.foray.primitive.sequence.ByteArray;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontConstants;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.output.GraphicOutput;
@@ -265,7 +265,7 @@
}
final int computedWidth = Math.round(
((float) pixelWidth / (float) pixelsPerInch)
- * WellKnownConstants.POINTS_PER_INCH
+ * TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT);
return computedWidth;
}
@@ -297,7 +297,7 @@
}
final int computedHeight = Math.round(
((float) pixelHeight / (float) pixelsPerInch)
- * WellKnownConstants.POINTS_PER_INCH
+ * TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT);
return computedHeight;
}
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -33,10 +33,10 @@
package org.foray.graphic;
-import org.foray.common.WellKnownConstants;
import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.PrimitiveConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
@@ -353,7 +353,7 @@
public int absoluteWidthReal() throws GraphicException {
return Math.round(this.pixelWidth()
/ this.xResolution
- * WellKnownConstants.POINTS_PER_INCH
+ * TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT);
}
@@ -361,7 +361,7 @@
public int absoluteHeightReal() throws GraphicException {
return Math.round(this.pixelHeight()
/ this.yResolution
- * WellKnownConstants.POINTS_PER_INCH
+ * TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT);
}
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -36,11 +36,11 @@
package org.foray.render.pcl;
-import org.foray.common.WellKnownConstants;
import org.foray.render.PrintRenderer;
import org.foray.render.Renderer4a;
import org.axsl.constants.PrimitiveConstants;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConstants;
import org.axsl.galley.ExternalGraphicAreaG5;
@@ -156,8 +156,8 @@
/** The minimum width and height of the document, expressed in decipoints,
* equal to one inch. */
- private static final int MINIMUM_DIMENSION = WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.DECIPOINTS_PER_POINT;
+ private static final int MINIMUM_DIMENSION = TypographicConstants.POINTS_PER_INCH
+ * TypographicConstants.DECIPOINTS_PER_POINT;
/** The current stream to add PCL commands to. */
private PclStream currentStream;
@@ -164,8 +164,8 @@
/** The page height, in decipoints. */
private int pageHeight = Math.round(PclRenderer.DEFAULT_PAGE_HEIGHT
- * WellKnownConstants.POINTS_PER_INCH
- * WellKnownConstants.DECIPOINTS_PER_POINT);
+ * TypographicConstants.POINTS_PER_INCH
+ * TypographicConstants.DECIPOINTS_PER_POINT);
/** The "curdiv" variable for virtual pagination. */
private int curdiv = 0;
@@ -195,7 +195,7 @@
/** X Offset to allow for PCL implicit 1/4" left margin. */
private int xoffset = Math.round(-PclRenderer.DEFAULT_LEFT_MARGIN
* PclRenderer.DEFAULT_LEFT_MARGIN
- * WellKnownConstants.DECIPOINTS_PER_POINT);
+ * TypographicConstants.DECIPOINTS_PER_POINT);
/** The user configuration for this output. */
private DocumentConfiguration configuration;
@@ -329,7 +329,7 @@
final int lineshade = Renderer4a.shadingPercent(stroke);
final int fillshade = Renderer4a.shadingPercent(fill);
- int xpos = this.xoffset + (x / WellKnownConstants.DECIPOINTS_PER_POINT);
+ int xpos = this.xoffset + (x / TypographicConstants.DECIPOINTS_PER_POINT);
if (xpos < 0) {
xpos = 0;
logWarning("Horizontal position out of bounds.");
@@ -337,10 +337,10 @@
this.currentStream.add("\033*v1O\033&a" + xpos + "h"
+ (this.pageHeight
- - (modifiedY / WellKnownConstants.DECIPOINTS_PER_POINT))
+ - (modifiedY / TypographicConstants.DECIPOINTS_PER_POINT))
+ "V" + "\033*c"
- + (w / WellKnownConstants.DECIPOINTS_PER_POINT)
- + "h" + (height / WellKnownConstants.DECIPOINTS_PER_POINT)
+ + (w / TypographicConstants.DECIPOINTS_PER_POINT)
+ + "h" + (height / TypographicConstants.DECIPOINTS_PER_POINT)
+ "V" + "\033*c"
+ lineshade + "G" + "\033*c2P");
if (fillshade != lineshade
@@ -347,7 +347,7 @@
&& (w >= this.pageHeight
|| height >= this.pageHeight)) {
xpos = this.xoffset + ((x + PclRenderer.MARGIN_CONSTANT)
- / WellKnownConstants.DECIPOINTS_PER_POINT);
+ / TypographicConstants.DECIPOINTS_PER_POINT);
if (xpos < 0) {
xpos = 0;
logWarning("Horizontal position out of bounds.");
@@ -355,14 +355,14 @@
this.currentStream.add("\033&a" + xpos + "h"
+ (this.pageHeight - ((modifiedY
+ PclRenderer.MARGIN_CONSTANT))
- / WellKnownConstants.DECIPOINTS_PER_POINT) + "V"
+ / TypographicConstants.DECIPOINTS_PER_POINT) + "V"
+ "\033*c" + ((w - PclRenderer.MARGIN_CONSTANT
- PclRenderer.MARGIN_CONSTANT)
- / WellKnownConstants.DECIPOINTS_PER_POINT)
+ / TypographicConstants.DECIPOINTS_PER_POINT)
+ "h"
+ ((height - PclRenderer.MARGIN_CONSTANT
- PclRenderer.MARGIN_CONSTANT)
- / WellKnownConstants.DECIPOINTS_PER_POINT)
+ / TypographicConstants.DECIPOINTS_PER_POINT)
+ "V" + "\033*c"
+ fillshade + "G" + "\033*c2P");
}
@@ -412,7 +412,7 @@
int grey = 0;
final boolean iscolor = img.getColorSpace().getType()
!= ColorSpace.TYPE_GRAY;
- final int millipointsPerInch = WellKnownConstants.POINTS_PER_INCH
+ final int millipointsPerInch = TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT;
final int xres = (iw * millipointsPerInch) / w;
final int yres = (ih * millipointsPerInch) / h;
@@ -529,7 +529,7 @@
final Graphic img = area.getGraphic();
- int xpos = this.xoffset + (x / WellKnownConstants.DECIPOINTS_PER_POINT);
+ int xpos = this.xoffset + (x / TypographicConstants.DECIPOINTS_PER_POINT);
if (xpos < 0) {
xpos = 0;
logWarning("Horizontal position out of bounds.");
@@ -536,7 +536,7 @@
}
this.currentStream.add("\033&a" + xpos + "h" + (this.pageHeight -
- (y / WellKnownConstants.DECIPOINTS_PER_POINT))
+ (y / TypographicConstants.DECIPOINTS_PER_POINT))
+ "V");
try {
@@ -761,7 +761,7 @@
if (this.paperheight > 0
&& this.divisions == -1) {
this.divisions = this.paperheight / (page.getHeight()
- / WellKnownConstants.DECIPOINTS_PER_POINT);
+ / TypographicConstants.DECIPOINTS_PER_POINT);
}
logDebug("PclRenderer.renderPage() paperheight="
@@ -783,12 +783,12 @@
+ this.fullmargin;
} else {
this.pageHeight = page.getHeight()
- / WellKnownConstants.DECIPOINTS_PER_POINT;
+ / TypographicConstants.DECIPOINTS_PER_POINT;
}
if (this.leftmargin > 0
&& this.curdiv == 0) {
this.currentStream.add("\033&k" + (this.leftmargin
- / WellKnownConstants.PICAS_PER_INCH)
+ / TypographicConstants.PICAS_PER_INCH)
+ "H\033&a1L\033&k12H");
}
renderRegions(page);
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java 2022-12-12 08:07:33 UTC (rev 12842)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/txt/TxtRenderer.java 2022-12-12 18:45:59 UTC (rev 12843)
@@ -28,10 +28,10 @@
package org.foray.render.txt;
-import org.foray.common.WellKnownConstants;
import org.foray.render.PrintRenderer;
import org.foray.render.Renderer4a;
+import org.axsl.constants.TypographicConstants;
import org.axsl.font.FontConstants;
import org.axsl.galley.ExternalGraphicAreaG5;
import org.axsl.galley.ForeignContentMathG5;
@@ -95,10 +95,10 @@
* 100. */
private static final int MILLIPOINTS_PER_DECIPOINT =
FontConstants.MILLIPOINTS_PER_POINT
- / WellKnownConstants.DECIPOINTS_PER_POINT;
+ / TypographicConstants.DECIPOINTS_PER_POINT;
/** Constant for the number of millipoints per inch, that is, 72,000. */
- private static final int MILLIPOINTS_PER_INCH = WellKnownConstants.POINTS_PER_INCH
+ private static final int MILLIPOINTS_PER_INCH = TypographicConstants.POINTS_PER_INCH
* FontConstants.MILLIPOINTS_PER_POINT;
/** The standard page size, in inches. */
@@ -118,7 +118,7 @@
/** The page height in decipoints??, perhaps. */
private int pageHeight = Math.round(TxtRenderer.STD_PAGE_HEIGHT
- * WellKnownConstants.POINTS_PER_INCH * WellKnownConstants.DECIPOINTS_PER_POINT);
+ * TypographicConstants.POINTS_PER_INCH * TypographicConstants.DECIPOINTS_PER_POINT);
// These variables control the virtual paggination functionality.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 08:07:36
|
Revision: 12842
http://sourceforge.net/p/foray/code/12842
Author: victormote
Date: 2022-12-12 08:07:33 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Move KP test fixtures and tests to aXSL.
Modified Paths:
--------------
trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-linebreak/build.gradle
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaBranch4aTestFixture.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaContentIteratorTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/
trunk/foray/foray-common/src/test/java/org/foray/common/kp/
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/CharContent4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,12 +28,11 @@
package org.foray.content;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.area.LineArea;
import org.axsl.content.CharContent;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.FoTextCharacters;
+import org.axsl.kp.KpLeafIterator;
import org.axsl.value.group.TextModifiers;
/**
@@ -73,7 +72,7 @@
}
@Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator4a iterator, final int endLeafIndex) {
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
return iterator.nextIndex();
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/Content4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,11 +28,10 @@
package org.foray.content;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.area.LineArea;
import org.axsl.content.Content;
import org.axsl.fotree.FoContext;
+import org.axsl.kp.KpLeafIterator;
/**
* Abstract superclass for all FOray implementations of {@link Content}.
@@ -66,6 +65,6 @@
* the first item on the next line.
* @return The index to the next leaf in {@code iterator} that is now unprocessed.
*/
- public abstract int addToLine(LineArea lineArea, KpLeafIterator4a iterator, int endLeafIndex);
+ public abstract int addToLine(LineArea lineArea, KpLeafIterator iterator, int endLeafIndex);
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ContentTree4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -29,7 +29,6 @@
package org.foray.content;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeafIterator4a;
import org.axsl.area.Area;
import org.axsl.area.NormalBlockArea;
@@ -212,7 +211,7 @@
@Override
public KpLeafIterator leafIterator() {
- return new KpLeafIterator4a(this);
+ return new KpLeafIterator(this);
}
@Override
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/LeaderContent.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,12 +28,11 @@
package org.foray.content;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.area.LineArea;
import org.axsl.content.IndivisibleContent;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.Leader;
+import org.axsl.kp.KpLeafIterator;
/**
* Content wrapper for {@link Leader}.
@@ -74,7 +73,7 @@
}
@Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator4a iterator, final int endLeafIndex) {
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
return iterator.nextIndex();
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/PageReferenceContent.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,8 +28,6 @@
package org.foray.content;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.area.LineArea;
import org.axsl.content.IndivisibleContent;
import org.axsl.font.FontUse;
@@ -36,6 +34,7 @@
import org.axsl.fotree.Fo;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.fo.prop.CommonFontPa;
+import org.axsl.kp.KpLeafIterator;
/**
* Content wrapper for {@link org.axsl.fotree.fo.PageNumber}, {@link org.axsl.fotree.fo.PageNumberCitation}, and
@@ -88,7 +87,7 @@
}
@Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator4a iterator, final int endLeafIndex) {
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
return iterator.nextIndex();
}
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/ScaledContent.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,13 +28,12 @@
package org.foray.content;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.area.LineArea;
import org.axsl.content.IndivisibleContent;
import org.axsl.fotree.FoContext;
import org.axsl.fotree.FoScaled;
import org.axsl.fotree.fo.ExternalGraphic;
+import org.axsl.kp.KpLeafIterator;
/**
* Content wrapper for {FoScaled}.
@@ -78,7 +77,7 @@
}
@Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator4a iterator, final int endLeafIndex) {
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
if (this.content instanceof ExternalGraphic) {
final ExternalGraphic externalGraphic = (ExternalGraphic) this.content;
lineArea.makeExternalGraphicArea(externalGraphic, -1);
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -29,7 +29,6 @@
package org.foray.content;
import org.foray.common.FontContext4a;
-import org.foray.common.kp.KpLeafIterator4a;
import org.axsl.area.LineArea;
import org.axsl.constants.PrimitiveConstants;
@@ -106,7 +105,7 @@
public KpLeafIterator leafIterator() {
/* Do NOT pass-through. This wrapper needs to go onto the stack of branches so that the descendant words and
* word segments have {@link KpContext}. */
- return new KpLeafIterator4a(this);
+ return new KpLeafIterator(this);
}
@Override
@@ -151,7 +150,7 @@
}
@Override
- public int addToLine(final LineArea lineArea, final KpLeafIterator4a iterator, final int endLeafIndex) {
+ public int addToLine(final LineArea lineArea, final KpLeafIterator iterator, final int endLeafIndex) {
/* The iterator branch stack tells us where we are. Element 0 is the index into the children of
* contentTree. If there is an element 1, it is because the element in contentTree is a text element,
* and element 1 is the index into its child tokens. If there is an element 2, it is the index into
Modified: trunk/foray/foray-linebreak/build.gradle
===================================================================
--- trunk/foray/foray-linebreak/build.gradle 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/build.gradle 2022-12-12 08:07:33 UTC (rev 12842)
@@ -19,6 +19,7 @@
testImplementation(project(":foray-ps"))
testImplementation(testFixtures(group: "org.axsl", name: "axsl-font", version: versions.axsl))
+ testImplementation(testFixtures(group: "org.axsl", name: "axsl-kp-model", version: versions.axsl))
}
javadoc {
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/FirstFitLbTests.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,9 +28,8 @@
package org.foray.linebreak;
-import org.foray.common.kp.KpBranch4a;
-
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpUserAgent;
@@ -66,7 +65,7 @@
@Test
public void firstFitTestGrimm() {
final KpContext kpContext = createGrimmParaConfig();
- final KpBranch4a para = this.createPara(kpContext);
+ final KpBranchTf para = this.createPara(kpContext);
/* Line width obtained from "Digital Typography," p. 73. We leave it expressed here in Monotype "units". */
final int lineWidth = 390;
final KpUserAgent paraContext = createUserAgent();
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/LineBreaker4aTests.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,17 +28,17 @@
package org.foray.linebreak;
-import org.foray.common.kp.KpBox4a;
-import org.foray.common.kp.KpBranch4a;
-import org.foray.common.kp.KpGlue4a;
-import org.foray.common.kp.KpPenalty4a;
import org.foray.orthography.Punctuation4a;
import org.axsl.context.LineBreakContext;
import org.axsl.font.fixture.MockFont;
import org.axsl.font.fixture.MockFontUse;
+import org.axsl.kp.KpBoxTf;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpContext;
+import org.axsl.kp.KpGlue;
import org.axsl.kp.KpPenalty;
+import org.axsl.kp.KpPenaltyTf;
import org.axsl.kp.KpUserAgent;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -91,12 +91,12 @@
* @param kpContext The context to be used by descendant leaves.
* @return The tokenized content of {@link #TEST_STRING_01}.
*/
- public KpBranch4a createPara(final KpContext kpContext) {
+ public KpBranchTf createPara(final KpContext kpContext) {
final ParaBranch4aTestFixture para = new ParaBranch4aTestFixture(kpContext, '-');
// ----Leaf--- Ideal Cumul
// Index Qty Width Width
// ------ --- ----- -----
- para.addNode(new KpBox4a(18)); // 0 1 18 18 Empty box (indent)
+ para.addNode(new KpBoxTf(18)); // 0 1 18 18 Empty box (indent)
para.addWord("In"); // 1 1 16 34 6+10
para.addSpace(); // 2 1 6 40
para.addWord("olden"); // 3 1 42 82 9+5+10+8+10
@@ -213,7 +213,7 @@
para.addSpace(); // 138 1 6
para.addWord("lime"); // 139 1
para.addNode(Punctuation4a.MANDATORY_HYPHEN); // 140 1
- para.addNode(new KpPenalty4a(0, 50, true)); // 141 1
+ para.addNode(new KpPenaltyTf(0, 50, true)); // 141 1
para.addWord("tree"); // 142 1
para.addSpace(); // 143 1 6
para.addWord("in"); // 144 1
@@ -335,9 +335,9 @@
para.addSpace(); // 268 1 6
para.addWord("play-thing"); // 269 3
para.addNode(Punctuation4a.PERIOD); // 272 1
- para.addNode(KpPenalty4a.DISALLOWED_BREAK); // 273 1
- para.addNode(KpGlue4a.FINISHING_GLUE); // 274 1
- para.addNode(KpPenalty4a.FORCED_BREAK); // 275 1
+ para.addNode(KpPenaltyTf.DISALLOWED_BREAK); // 273 1
+ para.addNode(KpGlue.FINISHING_GLUE); // 274 1
+ para.addNode(KpPenalty.FORCED_BREAK); // 275 1
/* There are 242 lines of code creating the paragraph.
* Each of them adds exactly one node. */
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaBranch4aTestFixture.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaBranch4aTestFixture.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaBranch4aTestFixture.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,10 +28,10 @@
package org.foray.linebreak;
-import org.foray.common.kp.KpBranch4a;
import org.foray.orthography.StringWord;
import org.foray.orthography.Whitespace4a;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpContext;
import java.util.regex.Pattern;
@@ -39,7 +39,7 @@
/**
* Adds some methods that simplify and clarify some tests.
*/
-public class ParaBranch4aTestFixture extends KpBranch4a {
+public class ParaBranch4aTestFixture extends KpBranchTf {
/** Regex pattern used to break compound words into their components. */
private Pattern wordBreaker;
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaContentIteratorTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaContentIteratorTests.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/ParaContentIteratorTests.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -29,9 +29,10 @@
package org.foray.linebreak;
import org.foray.common.data.OrderedTreePath4a;
-import org.foray.common.kp.KpBox4a;
-import org.foray.common.kp.KpBranch4a;
+import org.axsl.kp.KpBoxTf;
+import org.axsl.kp.KpBranchTf;
+
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import org.junit.jupiter.api.Test;
@@ -48,15 +49,15 @@
*/
@Test
public void test01() {
- final KpBranch4a root = new KpBranch4a(null);
- final KpBox4a a = new KpBox4a(0);
- final KpBranch4a b = new KpBranch4a(null);
- final KpBranch4a c = new KpBranch4a(null);
- final KpBranch4a d = new KpBranch4a(null);
- final KpBox4a e = new KpBox4a(0);
- final KpBox4a f = new KpBox4a(0);
- final KpBox4a g = new KpBox4a(0);
- final KpBox4a h = new KpBox4a(0);
+ final KpBranchTf root = new KpBranchTf(null);
+ final KpBoxTf a = new KpBoxTf(0);
+ final KpBranchTf b = new KpBranchTf(null);
+ final KpBranchTf c = new KpBranchTf(null);
+ final KpBranchTf d = new KpBranchTf(null);
+ final KpBoxTf e = new KpBoxTf(0);
+ final KpBoxTf f = new KpBoxTf(0);
+ final KpBoxTf g = new KpBoxTf(0);
+ final KpBoxTf h = new KpBoxTf(0);
/* root has two children, a and b. */
root.addNode(a);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/TotalFitLbTests.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,9 +28,8 @@
package org.foray.linebreak;
-import org.foray.common.kp.KpBranch4a;
-
import org.axsl.context.LineBreakContext;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpUserAgent;
@@ -50,7 +49,7 @@
/* TODO: THE CLASS BEING TESTED IS VERY INCOMPLETE, AND SO IS THIS TEST !!!!!! */
final KpContext kpContext = createGrimmParaConfig();
- final KpBranch4a para = createPara(kpContext);
+ final KpBranchTf para = createPara(kpContext);
final KpUserAgent paraContext = createUserAgent();
/* Line width obtained from "Digital Typography," p. 73.*/
final LineBreakContext lineBreakTarget = createLineBreakTarget(390_000);
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,12 +28,12 @@
package org.foray.linebreak.util;
-import org.foray.common.kp.KpBranch4a;
import org.foray.linebreak.FirstFitLbTests;
import org.foray.primitive.StringUtils;
import org.foray.primitive.sequence.IntArray;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpLeaf;
import java.io.PrintStream;
@@ -81,7 +81,7 @@
final String arrayAsString = args[0];
final IntArray intArray = new IntArray(arrayAsString);
final FirstFitLbTests lb = new FirstFitLbTests();
- final KpBranch4a branch = lb.createPara(null);
+ final KpBranchTf branch = lb.createPara(null);
new DumpLayout(branch, intArray.toArray());
}
Modified: trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java
===================================================================
--- trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpParaBranch.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,10 +28,10 @@
package org.foray.linebreak.util;
-import org.foray.common.kp.KpBranch4a;
import org.foray.linebreak.FirstFitLbTests;
import org.axsl.kp.KpBranch;
+import org.axsl.kp.KpBranchTf;
import org.axsl.kp.KpNode;
import java.io.PrintStream;
@@ -80,7 +80,7 @@
*/
public static void main(final String[] args) {
final FirstFitLbTests lb = new FirstFitLbTests();
- final KpBranch4a branch = lb.createPara(null);
+ final KpBranchTf branch = lb.createPara(null);
new DumpParaBranch(branch);
}
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeafIterator4a;
import org.foray.primitive.StringUtils;
import org.axsl.kp.KpBox;
@@ -121,7 +120,7 @@
@Override
public KpLeafIterator leafIterator() {
- return new KpLeafIterator4a(this);
+ return new KpLeafIterator(this);
}
@Override
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,8 +28,6 @@
package org.foray.orthography;
-import org.foray.common.kp.KpLeafIterator4a;
-
import org.axsl.constants.PrimitiveConstants;
import org.axsl.fotree.text.FoTextToken;
import org.axsl.fotree.text.FoTextTokenFlow;
@@ -132,7 +130,7 @@
@Override
public KpLeafIterator leafIterator() {
- return new KpLeafIterator4a(this);
+ return new KpLeafIterator(this);
}
@Override
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-12-12 06:37:48 UTC (rev 12841)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/FoTextWordsPnr.java 2022-12-12 08:07:33 UTC (rev 12842)
@@ -28,7 +28,6 @@
package org.foray.pioneer;
-import org.foray.common.kp.KpLeafIterator4a;
import org.foray.content.TextTokensContent4a;
import org.axsl.area.AreaNode;
@@ -37,6 +36,7 @@
import org.axsl.area.NormalBlockArea;
import org.axsl.content.TextTokensContent;
import org.axsl.fotree.fo.FoTextWords;
+import org.axsl.kp.KpLeafIterator;
import org.axsl.kp.KpResult;
import org.axsl.kp.KpUserAgent;
import org.axsl.linebreak.LineBreaker;
@@ -96,7 +96,7 @@
/* Run a leaf iterator alongside the iteration of the line-break results, so that we can conveniently retrieve
* the branch indexes. */
- final KpLeafIterator4a iterator = new KpLeafIterator4a(this.node.getFoTokenFlow());
+ final KpLeafIterator iterator = new KpLeafIterator(this.node.getFoTokenFlow());
for (int index = this.nextResultLine; index < this.result.getQtyLines(); index ++) {
final int currentLeafIndex = result.getBreakPosition(index);
final LineArea lineArea = normalBlockArea.makeLineArea(false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 06:37:50
|
Revision: 12841
http://sourceforge.net/p/foray/code/12841
Author: victormote
Date: 2022-12-12 06:37:48 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
1. Remove some non-test dependencies on FOray KP code. 2. Conform to aXSL change: Move more default KP model logic to aXSL.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java 2022-12-12 06:06:07 UTC (rev 12840)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBranch4a.java 2022-12-12 06:37:48 UTC (rev 12841)
@@ -71,83 +71,7 @@
return this.nodes.get(nodeIndex);
}
- @Override
- public int qtyKpLeaves() {
- int returnValue = 0;
- for (int nodeIndex = 0; nodeIndex < qtyKpNodes(); nodeIndex ++) {
- final KpNode node = kpNodeAt(nodeIndex);
- final KpBranch childBranch = KpNode.Type.asBranch(node);
- if (childBranch == null) {
- /* Child node is a leaf. */
- returnValue ++;
- } else {
- /* Child node is a branch. */
- returnValue += childBranch.qtyKpLeaves();
- }
- }
- return returnValue;
- }
-
/**
- * Returns the leaf node at a given index in a given branch.
- * @param branch The branch whose leaf nodes are being searched.
- * @param leafIndex The index to the leaf of {@code branch} to be returned.
- * @return The leaf of {@code branch} at index {@code leafIndex}.
- * @see KpBranch#kpLeafAt(int)
- */
- public static KpLeaf kpLeafAt(final KpBranch branch, final int leafIndex) {
- int runningLeafIndex = 0;
- for (int nodeIndex = 0; nodeIndex < branch.qtyKpNodes(); nodeIndex ++) {
- final KpNode node = branch.kpNodeAt(nodeIndex);
- final KpBranch childBranch = KpNode.Type.asBranch(node);
-
- if (runningLeafIndex == leafIndex) {
- final KpLeaf leaf = KpNode.Type.asLeaf(node);
- if (leaf != null) {
- return leaf;
- } else {
- return childBranch.kpLeafAt(0);
- }
- }
-
- final int additionalLeaves = childBranch == null ? 1 : childBranch.qtyKpLeaves();
- final int newRunningLeafIndex = runningLeafIndex + additionalLeaves;
-
- if (newRunningLeafIndex > leafIndex) {
- /* The leafIndex is a descendant of this node. */
- final int relativeLeafIndex = leafIndex - runningLeafIndex;
- return childBranch.kpLeafAt(relativeLeafIndex);
- }
-
- runningLeafIndex = newRunningLeafIndex;
- }
- throw new IndexOutOfBoundsException("Leaf index out of bounds: " + leafIndex);
- }
-
- @Override
- public KpLeaf kpLeafAt(final int leafIndex) {
- return kpLeafAt(this, leafIndex);
- }
-
- @Override
- public int qtyKpLeavesStrict() {
- int returnValue = 0;
- for (int nodeIndex = 0; nodeIndex < qtyKpNodes(); nodeIndex ++) {
- final KpNode node = kpNodeAt(nodeIndex);
- final KpBranch childBranch = KpNode.Type.asBranch(node);
- if (childBranch == null) {
- /* Child node is a leaf. */
- final KpLeaf leaf = (KpLeaf) node;
- returnValue += leaf.qtyKpLeavesStrict();
- } else {
- /* Child node is a branch. */
- returnValue += childBranch.qtyKpLeavesStrict();
- }
- }
- return returnValue;
- }
-
- /**
* Replaces a node in a branch with a different node. This is useful mostly for testing.
* @param index The index at which the new node should be placed.
* @param newNode The node to replace the node at {@code index}.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-12-12 06:06:07 UTC (rev 12840)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2022-12-12 06:37:48 UTC (rev 12841)
@@ -28,7 +28,6 @@
package org.foray.fotree.fo.obj;
-import org.foray.common.kp.KpPenalty4a;
import org.foray.fotree.FoContainerComplex;
import org.foray.fotree.FoObj;
import org.foray.fotree.Namespace;
@@ -209,7 +208,7 @@
@Override
public int getCost(final KpPenalty.Quality quality) {
/* TODO: This should be more configurable. */
- return KpPenalty4a.DEFAULT_PENALTY;
+ return KpPenalty.DEFAULT_PENALTY;
}
}
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-12 06:06:07 UTC (rev 12840)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java 2022-12-12 06:37:48 UTC (rev 12841)
@@ -30,7 +30,6 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.data.OrderedTreePath4a;
-import org.foray.common.kp.KpPenalty4a;
import org.foray.primitive.BooleanUtils;
import org.foray.primitive.sequence.IntArrayBuilder;
@@ -127,7 +126,7 @@
currentPath.pop();
}
/* Add the paragraph terminator penalty item. */
- final LbNodeWrapper wrapper = new LbNodeWrapper(KpPenalty4a.FORCED_BREAK, kpContext,
+ final LbNodeWrapper wrapper = new LbNodeWrapper(KpPenalty.FORCED_BREAK, kpContext,
this.contentNodes.size(), null);
this.contentNodes.add(wrapper);
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-12 06:06:07 UTC (rev 12840)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2022-12-12 06:37:48 UTC (rev 12841)
@@ -28,7 +28,6 @@
package org.foray.orthography;
-import org.foray.common.kp.KpBranch4a;
import org.foray.common.kp.KpLeafIterator4a;
import org.axsl.constants.PrimitiveConstants;
@@ -37,7 +36,6 @@
import org.axsl.fotree.text.FoWord;
import org.axsl.fotree.text.FoWordSegment;
import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpLeafIterator;
import org.axsl.kp.KpNode;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -133,11 +131,6 @@
}
@Override
- public KpLeaf kpLeafAt(final int leafIndex) {
- return KpBranch4a.kpLeafAt(this, leafIndex);
- }
-
- @Override
public KpLeafIterator leafIterator() {
return new KpLeafIterator4a(this);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 06:06:09
|
Revision: 12840
http://sourceforge.net/p/foray/code/12840
Author: victormote
Date: 2022-12-12 06:06:07 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Move some default code for the kp-model to axsl-kp-model.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBox4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -30,17 +30,13 @@
import org.axsl.kp.KpBox;
import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
/**
* A hard-wired implementation of a Knuth-Plass box.
* Instances of this class are immutable.
*/
-public final class KpBox4a extends KpLeaf4a implements KpBox {
+public final class KpBox4a implements KpBox {
- /** Format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Box (w = %1$d)";
-
/** The width of this box, in millipoints. */
private int width;
@@ -53,26 +49,11 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.BOX;
- }
-
- @Override
public int getIdealWidth(final KpContext config) {
return this.width;
}
@Override
- public int getStretchability(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getShrinkability(final KpContext config) {
- return 0;
- }
-
- @Override
public int qtyKpLeavesStrict() {
return 1;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpBoxChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpBoxChars4a extends KpLeaf4a implements KpBox, CharSequence {
+public final class KpBoxChars4a implements KpBox, CharSequence {
/** The char(s) for this box. */
private String chars;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlue4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -30,20 +30,13 @@
import org.axsl.kp.KpContext;
import org.axsl.kp.KpGlue;
-import org.axsl.kp.KpLeaf;
/**
* A hard-wired implementation of a Knuth-Plass glue item.
* Instances of this class are immutable.
*/
-public final class KpGlue4a extends KpLeaf4a implements KpGlue {
+public final class KpGlue4a implements KpGlue {
- /** A glue instance used near the end of a paragraphy for finishing purposes. */
- public static final KpGlue4a FINISHING_GLUE = new KpGlue4a(0, KpGlue.INFINITE_STRETCHABILITY, 0);
-
- /** Format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Box (w = %1$d, y = %2$d, z = %3$d)";
-
/** The ideal width of this glue, in millipoints. */
private int idealWidth;
@@ -66,11 +59,6 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.GLUE;
- }
-
- @Override
public int getIdealWidth(final KpContext config) {
return this.idealWidth;
}
@@ -86,11 +74,6 @@
}
@Override
- public int qtyKpLeavesStrict() {
- return 1;
- }
-
- @Override
public String toString() {
return String.format(TO_STRING_FORMAT, this.idealWidth, this.stretchability, this.shrinkability);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpGlueChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -36,7 +36,7 @@
* An implementation of Knuth-Plass glue that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpGlueChars4a extends KpLeaf4a implements KpGlue, CharSequence {
+public final class KpGlueChars4a implements KpGlue, CharSequence {
/** Reusable glue item representing a single space character. */
public static final KpGlueChars4a SPACE = new KpGlueChars4a(" ");
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeaf4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -1,54 +0,0 @@
-/*
- * Copyright 2019 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.kp;
-
-import org.axsl.kp.KpLeaf;
-import org.axsl.kp.KpNode;
-
-/**
- * Abstract superclass for FOray implementations of {@link KpLeaf}.
- */
-public abstract class KpLeaf4a implements KpLeaf {
-
- @Override
- public KpNode.Type getKpNodeType() {
- return KpNode.Type.LEAF;
- }
-
- @Override
- public int qtyKpNodes() {
- return 0;
- }
-
- @Override
- public int qtyKpLeaves() {
- return 1;
- }
-
-}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenalty4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.common.kp;
import org.axsl.kp.KpContext;
-import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpPenalty;
import org.axsl.kp.KpUserAgent;
@@ -37,23 +36,8 @@
* A hard-wired implementation of Knuth-Plass penalty.
* Instances of this class are immutable.
*/
-public final class KpPenalty4a extends KpLeaf4a implements KpPenalty {
+public final class KpPenalty4a implements KpPenalty {
- /** The default penalty for a discretionary hyphen using the Knuth-Plass model. Derived from [KP-03], p. 74, Table
- * 1.*/
- public static final int DEFAULT_PENALTY = 50;
-
- /** A penalty instance indicating that a break cannot be taken here under any circumstances. */
- public static final KpPenalty4a DISALLOWED_BREAK =
- new KpPenalty4a(0, KpPenalty.Quality.INFINITE_PENALTY.getNumericValue(), false);
-
- /** A penalty instance indicating that a break must be taken here always. */
- public static final KpPenalty4a FORCED_BREAK =
- new KpPenalty4a(0, KpPenalty.Quality.FORCED_BREAK.getNumericValue(), true);
-
- /** String format used in {@link #toString()}. */
- private static final String TO_STRING_FORMAT = "Penalty (w = %1$d, p = %2$d, f = %3$b)";
-
/** The width of this penalty, in millipoints. */
private int width;
@@ -76,26 +60,6 @@
}
@Override
- public KpLeaf.Type getKpLeafType() {
- return KpLeaf.Type.PENALTY;
- }
-
- @Override
- public int getIdealWidth(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getStretchability(final KpContext config) {
- return 0;
- }
-
- @Override
- public int getShrinkability(final KpContext config) {
- return 0;
- }
-
- @Override
public int getPenaltyWidth(final KpContext config) {
return this.width;
}
@@ -111,11 +75,6 @@
}
@Override
- public int qtyKpLeavesStrict() {
- return 1;
- }
-
- @Override
public String toString() {
return String.format(TO_STRING_FORMAT, this.width, this.cost, this.flagged);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpPenaltyChars4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -37,7 +37,7 @@
* An implementation of Knuth-Plass penalty that wraps text content.
* Instances of this class are immutable.
*/
-public final class KpPenaltyChars4a extends KpLeaf4a implements KpPenalty, CharSequence {
+public final class KpPenaltyChars4a implements KpPenalty, CharSequence {
/** The char(s) for this penalty. */
private String chars;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeaf4a;
import org.foray.common.kp.KpLeafIterator4a;
import org.foray.primitive.StringUtils;
@@ -133,7 +132,7 @@
/**
* The Box portion of the compound break.
*/
- public class Box extends KpLeaf4a implements KpBox {
+ public class Box implements KpBox {
@Override
public Type getKpLeafType() {
@@ -165,7 +164,7 @@
/**
* The Penalty portion of the compound break.
*/
- public class Penalty extends KpLeaf4a implements KpPenalty {
+ public class Penalty implements KpPenalty {
@Override
public Type getKpLeafType() {
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -29,7 +29,6 @@
package org.foray.orthography;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.kp.KpLeaf4a;
import org.foray.primitive.StringUtils;
import org.axsl.fotree.text.FoDiscretionaryHyphen;
@@ -49,7 +48,7 @@
* TODO: This class needs to be made more flexible or at least extendable, so that discretionary breaks other than "-"
* can be accommodated.
*/
-public final class DiscretionaryHyphen4a extends KpLeaf4a implements FoDiscretionaryHyphen {
+public final class DiscretionaryHyphen4a implements FoDiscretionaryHyphen {
/** Pre-built "acceptable" hyphenation point. */
public static final DiscretionaryHyphen4a ACCEPTABLE =
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-12 04:24:24 UTC (rev 12839)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/WordSegment4a.java 2022-12-12 06:06:07 UTC (rev 12840)
@@ -28,8 +28,6 @@
package org.foray.orthography;
-import org.foray.common.kp.KpLeaf4a;
-
import org.axsl.fotree.text.FoWordSegment;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
@@ -42,7 +40,7 @@
/**
* Abstract superclass for FOray {@link WordSegment} implementations.
*/
-public abstract class WordSegment4a extends KpLeaf4a implements FoWordSegment, Serializable {
+public abstract class WordSegment4a implements FoWordSegment, Serializable {
/** Constant needed for serialization. */
private static final long serialVersionUID = -9006099460669286001L;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 04:24:28
|
Revision: 12839
http://sourceforge.net/p/foray/code/12839
Author: victormote
Date: 2022-12-12 04:24:24 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Move primitive test classes from foray-common to foray-primitive.
Added Paths:
-----------
trunk/foray/foray-primitive/src/test/java/org/
trunk/foray/foray-primitive/src/test/java/org/foray/
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/BitUtilsTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/ByteUtilsTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/CharacterUtilsTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/NumberUtilsTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/StringUtilsTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractByteSequenceTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/AbstractIntSequenceTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayBuilderTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/ByteArrayTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayBuilderTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntArrayTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/IntSequenceIteratorTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/LongArrayBuilderTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/LongArrayTests.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/sequence/NibbleArrayBuilderTests.java
Removed Paths:
-------------
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/NumberUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractByteSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractIntSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntSequenceIteratorTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/LongArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/LongArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/NibbleArrayBuilderTests.java
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,205 +0,0 @@
-/*
- * Copyright 2008 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.primitive.BitUtils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * JUnit test class for the class {@link BitUtils}.
- */
-public class BitUtilsTests {
-
- /**
- * Unit test of {@link BitUtils#maskHighOrderBits(byte)}.
- */
- @Test
- public void testMaskHighOrderBits() {
- byte inputByte = (byte) 0xFF;
- byte actualOutput = BitUtils.maskHighOrderBits(inputByte);
- byte expectedOutput = (byte) 0x0F;
- assertEquals(expectedOutput, actualOutput);
-
- inputByte = (byte) 0x00;
- actualOutput = BitUtils.maskHighOrderBits(inputByte);
- expectedOutput = (byte) 0x00;
- assertEquals(expectedOutput, actualOutput);
- }
-
- /**
- * Unit test of {@link BitUtils#maskLowOrderBits(byte)}.
- */
- @Test
- public void testMaskLowOrderBits() {
- byte inputByte = (byte) 0xFF;
- byte actualOutput = BitUtils.maskLowOrderBits(inputByte);
- byte expectedOutput = (byte) 0xF0;
- assertEquals(expectedOutput, actualOutput);
-
- inputByte = (byte) 0x00;
- actualOutput = BitUtils.maskLowOrderBits(inputByte);
- expectedOutput = (byte) 0x00;
- assertEquals(expectedOutput, actualOutput);
- }
-
- /**
- * Test of {@link BitUtils#extractBits(long, int, int)}.
- */
- @Test
- public void testExtractBits() {
- /* Decimal 601. */
- long input = 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0010_0101_1001L;
- assertEquals(1, BitUtils.extractBits(input, 4, 1)); // ...0010010[1]1001
- assertEquals(1, BitUtils.extractBits(input, 4, 2)); // ...001001[01]1001
- assertEquals(5, BitUtils.extractBits(input, 4, 3)); // ...00100[101]1001
- assertEquals(5, BitUtils.extractBits(input, 4, 4)); // ...0010[0101]1001
- assertEquals(5, BitUtils.extractBits(input, 4, 5)); // ...001[00101]1001
- assertEquals(37, BitUtils.extractBits(input, 4, 6)); // ...00[100101]1001
- assertEquals(1, BitUtils.extractBits(input, 0, 1)); // ...00100101100[1]
- assertEquals(1, BitUtils.extractBits(input, 0, 2)); // ...0010010110[01]
- assertEquals(1, BitUtils.extractBits(input, 0, 3)); // ...001001011[001]
- assertEquals(9, BitUtils.extractBits(input, 0, 4)); // ...00100101[1001]
- assertEquals(25, BitUtils.extractBits(input, 0, 5)); // ...0010010[11001]
-
- /* Decimal -601. */
- input = 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1101_1010_0111L;
- assertEquals(0, BitUtils.extractBits(input, 4, 1)); // ...1101101[0]0111
- assertEquals(2, BitUtils.extractBits(input, 4, 2)); // ...110110[10]0111
- assertEquals(2, BitUtils.extractBits(input, 4, 3)); // ...11011[010]0111
- assertEquals(10, BitUtils.extractBits(input, 4, 4)); // ...1101[1010]0111
- assertEquals(26, BitUtils.extractBits(input, 4, 5)); // ...110[11010]0111
- assertEquals(26, BitUtils.extractBits(input, 4, 6)); // ...11[011010]0111
- assertEquals(7, BitUtils.extractBits(input, 31, 3));
- /* The low-order 63 bits, decimal 9,223,372,036,854,775,207. */
- long expected = 0b111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1101_1010_0111L;
- assertEquals(expected, BitUtils.extractBits(input, 0, 63));
- /* The high-order 63 bits, decimal 9,223,372,036,854,775,507. */
- expected = 0b111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1110_1101_0011L;
- assertEquals(expected, BitUtils.extractBits(input, 1, 63));
-
- /* Decimal 7,243,477,050,672,021,504. Binary . */
- input = 0b0110_0100_1000_0110_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L;
- assertEquals(0, BitUtils.extractBits(input, 63, 1)); // [0]110010010000110...
- assertEquals(1, BitUtils.extractBits(input, 62, 2)); // [01]10010010000110...
- assertEquals(3, BitUtils.extractBits(input, 61, 3)); // [011]0010010000110...
- assertEquals(6, BitUtils.extractBits(input, 60, 4)); // [0110]010010000110...
- assertEquals(12, BitUtils.extractBits(input, 59, 5)); // [01100]10010000110...
- assertEquals(25, BitUtils.extractBits(input, 58, 6)); // [011001]0010000110...
-
- /* Test some qtyBits of zero, which should always return 0. */
- assertEquals(0, BitUtils.extractBits(Long.MIN_VALUE, 0, 0));
- assertEquals(0, BitUtils.extractBits(Long.MIN_VALUE, 63, 0));
- assertEquals(0, BitUtils.extractBits(0, 0, 0));
- assertEquals(0, BitUtils.extractBits(0, 63, 0));
- assertEquals(0, BitUtils.extractBits(1, 0, 0));
- assertEquals(0, BitUtils.extractBits(1, 63, 0));
- assertEquals(0, BitUtils.extractBits(601, 8, 0));
- assertEquals(0, BitUtils.extractBits(601, 8, 0));
- assertEquals(0, BitUtils.extractBits(Long.MAX_VALUE, 0, 0));
- assertEquals(0, BitUtils.extractBits(Long.MAX_VALUE, 63, 0));
-
- /* Test some position 0, qtyBits 64, which should always return the input. */
- assertEquals(Long.MIN_VALUE, BitUtils.extractBits(Long.MIN_VALUE, 0, 64));
- assertEquals(-601, BitUtils.extractBits(-601, 0, 64));
- assertEquals(-1, BitUtils.extractBits(-1, 0, 64));
- assertEquals(0, BitUtils.extractBits(0, 0, 64));
- assertEquals(1, BitUtils.extractBits(1, 0, 64));
- assertEquals(601, BitUtils.extractBits(601, 0, 64));
- assertEquals(Long.MAX_VALUE, BitUtils.extractBits(Long.MAX_VALUE, 0, 64));
-
- /* Test some invalid position values. */
- assertEquals(0, BitUtils.extractBits(1, -600, 3));
- assertEquals(0, BitUtils.extractBits(1, -1, 3));
- assertEquals(1, BitUtils.extractBits(1, 64, 3));
- assertEquals(1, BitUtils.extractBits(1, 128, 3));
-
- /* Test some invalid qtyBits values. */
- assertEquals(0, BitUtils.extractBits(1, 1, -600));
- assertEquals(0, BitUtils.extractBits(1, 1, -1));
- assertEquals(0, BitUtils.extractBits(1, 1, 65));
- assertEquals(0, BitUtils.extractBits(1, 1, 128));
- }
-
- /**
- * Test of {@link BitUtils#replaceBits(long, int, int, long)}.
- */
- @Test
- public void testReplaceBits() {
- long input;
- long patch;
- long expected;
-
- /* Decimal 601. */
- input = 0b0010_0101_1001;
- assertEquals(521, BitUtils.replaceBits(input, 4, 5, 0)); // 001<00101>1001 --> 001<00000>1001
- assertEquals(521, BitUtils.replaceBits(input, 4, 5, 0)); // 001<00101>1001 --> 001<00000>1001
- assertEquals(585, BitUtils.replaceBits(input, 4, 5, 4)); // 001<00101>1001 --> 001<00100>1001
- assertEquals(1017, BitUtils.replaceBits(input, 4, 5, 31)); // 001<00101>1001 --> 001<11111>1001
-
- /* Decimal -601. */
- input = 0b1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1111_1101_1010_0111L;
- assertEquals(-1017, BitUtils.replaceBits(input, 4, 5, 0)); // ...1110<11010>0111 --> ...110<00000>0111
-
- input = 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L;
- patch = 0b1111_1111L;
- expected = 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_1111_1111L;
- assertEquals(expected, BitUtils.replaceBits(input, 0, 8, patch));
-
- input = 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L;
- patch = 0b1111_1111;
- expected = 0b0000_0000_0000_0000_0000_0000_1111_1111_0000_0000_0000_0000_0000_0000_0000_0000L;
- assertEquals(expected, BitUtils.replaceBits(input, 32, 8, patch));
-
- input = 0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L;
- patch = 0b1111_1111;
- expected = 0b1111_1111_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L;
- assertEquals(expected, BitUtils.replaceBits(input, 56, 8, patch));
-
- /* Test some qtyBits of zero, which should always return the input value. */
- assertEquals(Long.MIN_VALUE, BitUtils.replaceBits(Long.MIN_VALUE, 0, 0, 1400));
- assertEquals(Long.MIN_VALUE, BitUtils.replaceBits(Long.MIN_VALUE, 63, 0, 1400));
- assertEquals(0, BitUtils.replaceBits(0, 0, 0, 1400));
- assertEquals(0, BitUtils.replaceBits(0, 63, 0, 1400));
- assertEquals(1, BitUtils.replaceBits(1, 0, 0, 1400));
- assertEquals(1, BitUtils.replaceBits(1, 63, 0, 1400));
- assertEquals(601, BitUtils.replaceBits(601, 8, 0, 1400));
- assertEquals(601, BitUtils.replaceBits(601, 8, 0, 1400));
- assertEquals(Long.MAX_VALUE, BitUtils.replaceBits(Long.MAX_VALUE, 0, 0, 1400));
- assertEquals(Long.MAX_VALUE, BitUtils.replaceBits(Long.MAX_VALUE, 63, 0, 1400));
-
- /* Wipe out all bits. */
- assertEquals(0, BitUtils.replaceBits(Long.MIN_VALUE, 0, 64, 0));
-
- /* Set all bits to true. */
- assertEquals(Long.MIN_VALUE, BitUtils.replaceBits(0, 0, 64, Long.MIN_VALUE));
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,119 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.primitive.ByteUtils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link ByteUtils}.
- */
-public class ByteUtilsTests {
-
- /**
- * Tests of {@link ByteUtils#asNibble(char)}.
- */
- @Test
- public void asNibbleTests() {
- assertEquals((byte) 0x00, ByteUtils.asNibble('0'));
- assertEquals((byte) 0x03, ByteUtils.asNibble('3'));
- assertEquals((byte) 0x0F, ByteUtils.asNibble('F'));
- assertEquals((byte) 0x0F, ByteUtils.asNibble('f'));
-
- /* Invalid input. */
- try {
- assertEquals((byte) 0x0F, ByteUtils.asNibble('G'));
- fail("IllegalArgumentException should have been thrown");
- } catch (final IllegalArgumentException e) {
- /* This is the expected branch. */
- }
- }
-
- /**
- * Test of {@link ByteUtils#fromHexChars(CharSequence, int)}.
- */
- @Test
- public void fromHexCharsTests() {
- final String testString = "23FA7E";
-
- assertEquals((byte) 0x23, ByteUtils.fromHexChars(testString, 0));
- assertEquals((byte) 0x3F, ByteUtils.fromHexChars(testString, 1));
- assertEquals((byte) 0xFA, ByteUtils.fromHexChars(testString, 2));
- assertEquals((byte) 0xA7, ByteUtils.fromHexChars(testString, 3));
- assertEquals((byte) 0x7E, ByteUtils.fromHexChars(testString, 4));
-
- /* Null input. */
- try {
- assertEquals((byte) 0x0F, ByteUtils.fromHexChars(null, 0));
- fail("NullPointerException should have been thrown");
- } catch (final NullPointerException e) {
- /* This is the expected branch. */
- }
-
- /* "start" too low. */
- try {
- assertEquals((byte) 0x0F, ByteUtils.fromHexChars(testString, -1));
- fail("StringIndexOutOfBoundsException should have been thrown");
- } catch (final StringIndexOutOfBoundsException e) {
- /* This is the expected branch. */
- }
-
- /* "start" too low. */
- try {
- assertEquals((byte) 0x0F, ByteUtils.fromHexChars(testString, 5));
- fail("StringIndexOutOfBoundsException should have been thrown");
- } catch (final StringIndexOutOfBoundsException e) {
- /* This is the expected branch. */
- }
- }
-
- /**
- * Tests of {@link ByteUtils#toHexCharHigh(byte)}.
- */
- @Test
- public void toHexCharHighTests() {
- assertEquals('F', ByteUtils.toHexCharHigh((byte) 0xF9));
- assertEquals('6', ByteUtils.toHexCharHigh((byte) 0x6C));
- assertEquals('0', ByteUtils.toHexCharHigh((byte) 0x03));
- }
-
- /**
- * Tests of {@link ByteUtils#toHexCharLow(byte)}.
- */
- @Test
- public void toHexCharLowTests() {
- assertEquals('9', ByteUtils.toHexCharLow((byte) 0xF9));
- assertEquals('C', ByteUtils.toHexCharLow((byte) 0x6C));
- assertEquals('3', ByteUtils.toHexCharLow((byte) 0x03));
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,59 +0,0 @@
-/*
- * Copyright 2008 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.primitive.CharacterUtils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * JUnit tests for {@link CharacterUtils}.
- */
-public class CharacterUtilsTests {
-
- /**
- * Tests of {@link CharacterUtils#asHighOrderByte(char)} and {@link CharacterUtils#asLowOrderByte(char)}.
- */
- @Test
- public void testSplittingIntoBytes() {
- char testChar = (char) 0x0000;
- assertEquals((byte) 0x00, CharacterUtils.asHighOrderByte(testChar));
- assertEquals((byte) 0x00, CharacterUtils.asLowOrderByte(testChar));
-
- testChar = (char) 0x0B13;
- assertEquals((byte) 0x0B, CharacterUtils.asHighOrderByte(testChar));
- assertEquals((byte) 0x13, CharacterUtils.asLowOrderByte(testChar));
-
- testChar = (char) 0xFFFF;
- assertEquals((byte) 0xFF, CharacterUtils.asHighOrderByte(testChar));
- assertEquals((byte) 0xFF, CharacterUtils.asLowOrderByte(testChar));
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/NumberUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/NumberUtilsTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/NumberUtilsTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,56 +0,0 @@
-/*
- * Copyright 2021 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.primitive.NumberUtils;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link NumberUtils}.
- */
-public class NumberUtilsTests {
-
-
- /**
- * Test of {@link NumberUtils#intArrayFromString(CharSequence)}.
- */
- @Test
- public void intArrayFromStringTests() {
- final int[] expected = new int[] {3, 13, 39};
-
- int[] actual = NumberUtils.intArrayFromString("[3,13,39]");
- assertArrayEquals(expected, actual);
-
- actual = NumberUtils.intArrayFromString("[ 3 , 13 , 39 ]");
- assertArrayEquals(expected, actual);
-}
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,69 +0,0 @@
-/*
- * Copyright 2009 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.primitive.StringUtils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * JUnit test class for the class {@link StringUtils}.
- */
-public class StringUtilsTests {
-
- /** Array used to test methods using null terminator checks. */
- private static final char[] NULL_TERMINATED_CHAR_ARRAY = new char[] {'a', 'b', 'c', 'd', 'e', 'f', 0x00, 'g', 'h'};
-
- /** String used to test methods using null terminator checks. */
- private static final String NULL_TERMINATED_STRING = new String(StringUtilsTests.NULL_TERMINATED_CHAR_ARRAY);
-
- /**
- * Unit test of the method {@link StringUtils#nullTerminatedLength(char[], int)}.
- */
- @Test
- public void testNullTerminatedLengthCharArray() {
- assertEquals(6, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_CHAR_ARRAY, 0));
- assertEquals(4, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_CHAR_ARRAY, 2));
- assertEquals(0, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_CHAR_ARRAY, 6));
- assertEquals(2, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_CHAR_ARRAY, 7));
- }
-
- /**
- * Unit test of the method {@link StringUtils#nullTerminatedLength(CharSequence, int)}.
- */
- @Test
- public void testNullTerminatedLengthCharSequence() {
- assertEquals(6, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_STRING, 0));
- assertEquals(4, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_STRING, 2));
- assertEquals(0, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_STRING, 6));
- assertEquals(2, StringUtils.nullTerminatedLength(StringUtilsTests.NULL_TERMINATED_STRING, 7));
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractByteSequenceTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractByteSequenceTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractByteSequenceTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,257 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.AbstractByteSequence;
-import org.foray.primitive.sequence.ByteArray;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * JUnit tests of {@link AbstractByteSequence}.
- */
-public class AbstractByteSequenceTests {
-
- /** A test sequence. */
- private ByteArray test1 = new ByteArray("That's one small step for man.");
- /* 0 1 2 */
- /* 012345678901234567890123456789 */
-
- /** A test sequence.
- * 012345678901234567890123456789012345678*/
- private ByteArray test2 = new ByteArray("belly, jelly, smelly, bell, jell, smell.");
- /* 0 1 2 3 */
- /* 012345678901234567890123456789012345678 */
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(int)}.
- */
- @Test
- public void testIndexOfInt() {
- /* Test one in the middle. */
- assertEquals(7, test1.indexOf('o'));
- /* Test first one. */
- assertEquals(0, test1.indexOf('T'));
- /* Test last one. */
- assertEquals(29, test1.indexOf('.'));
- /* Test one that isn't there. */
- assertEquals(-1, test1.indexOf('$'));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(int, int)}.
- */
- @Test
- public void testIndexOfIntInt() {
- /* Test one in the middle. */
- assertEquals(13, test1.indexOf('a', 10));
- /* Test first one. */
- assertEquals(-1, test1.indexOf('T', 10));
- /* Test last one. */
- assertEquals(29, test1.indexOf('.', 10));
- /* Test one that isn't there. */
- assertEquals(-1, test1.indexOf('$', 10));
- /* Test with index too low. Should find the first one. */
- assertEquals(5, test1.indexOf('s', -1));
- /* Test with index too high.*/
- assertEquals(-1, test1.indexOf('s', 30));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(int)}.
- */
- @Test
- public void testLastIndexOfInt() {
- /* Test one in the middle. */
- assertEquals(23, test1.lastIndexOf('o'));
- /* Test first one. */
- assertEquals(0, test1.lastIndexOf('T'));
- /* Test last one. */
- assertEquals(29, test1.lastIndexOf('.'));
- /* Test one that isn't there. */
- assertEquals(-1, test1.lastIndexOf('$'));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(int, int)}.
- */
- @Test
- public void testLastIndexOfIntInt() {
- /* Test one in the middle. */
- assertEquals(2, test1.lastIndexOf('a', 10));
- /* Test first one. */
- assertEquals(0, test1.lastIndexOf('T', 10));
- /* Test last one. */
- assertEquals(-1, test1.lastIndexOf('.', 10));
- /* Test one that isn't there. */
- assertEquals(-1, test1.lastIndexOf('$', 10));
- /* Test with index too low. */
- assertEquals(-1, test1.lastIndexOf('s', -1));
- /* Test with index too high. Should find the last one. */
- assertEquals(17, test1.lastIndexOf('s', 30));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(java.lang.CharSequence)}.
- */
- @Test
- public void testIndexOfCharSequence() {
- /* Test one in the middle. */
- assertEquals(22, test2.indexOf("bell,"));
- /* Test first one. */
- assertEquals(0, test2.indexOf("bell"));
- /* Test last one. */
- assertEquals(34, test2.indexOf("smell."));
- /* Test one that isn't there. */
- assertEquals(-1, test2.indexOf("Colorado"));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(java.lang.CharSequence, int)}.
- */
- @Test
- public void testIndexOfCharSequenceInt() {
- /* Test one in the middle. */
- assertEquals(22, test2.indexOf("bell,", 10));
- /* Test first one. */
- assertEquals(-1, test2.indexOf("belly,", 10));
- /* Test last one. */
- assertEquals(16, test2.indexOf("ell", 10));
- /* Test one that isn't there. */
- assertEquals(-1, test2.indexOf("Colorado", 10));
- /* Test with index too low. Should find the first one. */
- assertEquals(7, test2.indexOf("jelly,", -1));
- /* Test with index too high. */
- assertEquals(-1, test2.indexOf("ell", 45));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(java.lang.CharSequence)}.
- */
- @Test
- public void testLastIndexOfCharSequence() {
- /* Test one in the middle. */
- assertEquals(22, test2.lastIndexOf("bell,"));
- /* Test first one. */
- assertEquals(0, test2.lastIndexOf("belly,"));
- /* Test last one. */
- assertEquals(34, test2.lastIndexOf("smell."));
- /* Test one that isn't there. */
- assertEquals(-1, test2.lastIndexOf("Colorado"));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(java.lang.CharSequence, int)}.
- */
- @Test
- public void testLastIndexOfCharSequenceInt() {
- /* Test one in the middle. */
- assertEquals(22, test2.lastIndexOf("bell,", 25));
- /* Test first one. */
- assertEquals(0, test2.lastIndexOf("belly,", 25));
- /* Test last one. */
- assertEquals(23, test2.lastIndexOf("ell", 25));
- /* Test one that isn't there. */
- assertEquals(-1, test2.lastIndexOf("Colorado", 25));
- /* Test with index too low. */
- assertEquals(-1, test2.lastIndexOf("jelly,", -1));
- /* Test with index too high. Should find the last one.*/
- assertEquals(36, test2.lastIndexOf("ell", 45));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(java.lang.ByteSequence)}.
- */
- @Test
- public void testIndexOfByteSequence() {
- /* Test one in the middle. */
- assertEquals(22, test2.indexOf(new ByteArray("bell,")));
- /* Test first one. */
- assertEquals(0, test2.indexOf(new ByteArray("bell")));
- /* Test last one. */
- assertEquals(34, test2.indexOf(new ByteArray("smell.")));
- /* Test one that isn't there. */
- assertEquals(-1, test2.indexOf(new ByteArray("Colorado")));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#indexOf(java.lang.ByteSequence, int)}.
- */
- @Test
- public void testIndexOfByteSequenceInt() {
- /* Test one in the middle. */
- assertEquals(22, test2.indexOf(new ByteArray("bell,"), 10));
- /* Test first one. */
- assertEquals(-1, test2.indexOf(new ByteArray("belly,"), 10));
- /* Test last one. */
- assertEquals(16, test2.indexOf(new ByteArray("ell"), 10));
- /* Test one that isn't there. */
- assertEquals(-1, test2.indexOf(new ByteArray("Colorado"), 10));
- /* Test with index too low. Should find the first one. */
- assertEquals(7, test2.indexOf(new ByteArray("jelly,"), -1));
- /* Test with index too high. */
- assertEquals(-1, test2.indexOf(new ByteArray("ell"), 45));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(java.lang.ByteSequence)}.
- */
- @Test
- public void testLastIndexOfByteSequence() {
- /* Test one in the middle. */
- assertEquals(22, test2.lastIndexOf(new ByteArray("bell,")));
- /* Test first one. */
- assertEquals(0, test2.lastIndexOf(new ByteArray("belly,")));
- /* Test last one. */
- assertEquals(34, test2.lastIndexOf(new ByteArray("smell.")));
- /* Test one that isn't there. */
- assertEquals(-1, test2.lastIndexOf(new ByteArray("Colorado")));
- }
-
- /**
- * Tests of method {@link AbstractByteSequence#lastIndexOf(java.lang.ByteSequence, int)}.
- */
- @Test
- public void testLastIndexOfByteSequenceInt() {
- /* Test one in the middle. */
- assertEquals(22, test2.lastIndexOf(new ByteArray("bell,"), 25));
- /* Test first one. */
- assertEquals(0, test2.lastIndexOf(new ByteArray("belly,"), 25));
- /* Test last one. */
- assertEquals(23, test2.lastIndexOf(new ByteArray("ell"), 25));
- /* Test one that isn't there. */
- assertEquals(-1, test2.lastIndexOf(new ByteArray("Colorado"), 25));
- /* Test with index too low. */
- assertEquals(-1, test2.lastIndexOf(new ByteArray("jelly,"), -1));
- /* Test with index too high. Should find the last one.*/
- assertEquals(36, test2.lastIndexOf(new ByteArray("ell"), 45));
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractIntSequenceTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractIntSequenceTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractIntSequenceTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,120 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.AbstractIntSequence;
-import org.foray.primitive.sequence.IntArray;
-import org.foray.primitive.sequence.IntArrayBuilder;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests for subclasses of {@link AbstractIntSequence}.
- */
-public class AbstractIntSequenceTests {
-
- /** Array builder available to all tests. */
- private IntArrayBuilder builder;
-
- /**
- * Test setup.
- */
- @BeforeEach
- public void before() {
- final IntArrayBuilder builder = new IntArrayBuilder();
- builder.append(48);
- builder.append(-2041191);
- builder.append(0);
- builder.append(Integer.MAX_VALUE);
- builder.append(211);
- builder.append(Integer.MIN_VALUE);
- this.builder = builder;
- }
-
- /**
- * Standard "indexOf" assertions.
- * @param out The object under test.
- */
- private void indexOfAssertions(final AbstractIntSequence out) {
- assertEquals(0, out.indexOf(48));
- assertEquals(1, out.indexOf(-2041191));
- assertEquals(2, out.indexOf(0));
- assertEquals(3, out.indexOf(Integer.MAX_VALUE));
- assertEquals(4, out.indexOf(211));
- assertEquals(5, out.indexOf(Integer.MIN_VALUE));
-
- assertEquals(-1, out.indexOf(-1));
- assertEquals(-1, out.indexOf(1));
- assertEquals(-1, out.indexOf(-600));
- assertEquals(-1, out.indexOf(Integer.MAX_VALUE - 1));
- assertEquals(-1, out.indexOf(600));
- assertEquals(-1, out.indexOf(Integer.MIN_VALUE + 1));
- }
-
- /**
- * Standard "contains" assertions.
- * @param out The object under test.
- */
- private void containsAssertions(final AbstractIntSequence out) {
- assertTrue(out.contains(48));
- assertTrue(out.contains(-2041191));
- assertTrue(out.contains(0));
- assertTrue(out.contains(Integer.MAX_VALUE));
- assertTrue(out.contains(211));
- assertTrue(out.contains(Integer.MIN_VALUE));
-
- assertFalse(out.contains(-1));
- assertFalse(out.contains(1));
- assertFalse(out.contains(-600));
- assertFalse(out.contains(Integer.MAX_VALUE - 1));
- assertFalse(out.contains(600));
- assertFalse(out.contains(Integer.MIN_VALUE + 1));
- }
-
- /** Test of method {@link AbstractIntSequence#indexOf(int)}. */
- @Test
- public void testIndexOf() {
- indexOfAssertions(this.builder);
-
- final IntArray array = this.builder.toIntArray();
- indexOfAssertions(array);
- }
-
- /** Test of method {@link AbstractIntSequence#contains(int)}. */
- @Test
- public void testContains() {
- containsAssertions(this.builder);
- containsAssertions(this.builder.toIntArray());
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayBuilderTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayBuilderTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,103 +0,0 @@
-/*
- * Copyright 2021 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.ByteArray;
-import org.foray.primitive.sequence.ByteArrayBuilder;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link ByteArrayBuilder}.
- * Note that test coverage for many of the read-only methods in {@link ByteArrayBuilder} can be found in
- * {@link AbstractByteSequenceTests}.
- * Tests in this class are mostly for methods that mutate an instance of the builder.
- */
-public class ByteArrayBuilderTests {
-
- /** A sequence of bytes for testing. */
- private ByteArray testBytes1 = new ByteArray("Some bytes.");
-
- /**
- * Test of {@link ByteArrayBuilder#setLength(int)}, where the new length is smaller.
- */
- @Test
- public void testSetLengthSmaller() {
- final ByteArrayBuilder out = new ByteArrayBuilder();
- out.append(testBytes1);
- assertEquals(11, out.length());
- final int capacityBefore = out.capacity();
-
- out.setLength(3);
- assertEquals(3, out.length());
- assertEquals(new ByteArray("Som"), out);
- assertEquals(capacityBefore, out.capacity());
- }
-
- /**
- * Test of {@link ByteArrayBuilder#setLength(int)}, where the new length is greater.
- */
- @Test
- public void testSetLengthGreater() {
- final ByteArrayBuilder out = new ByteArrayBuilder(12);
- out.append(testBytes1);
- assertEquals(11, out.length());
- assertEquals(12, out.capacity());
-
- out.setLength(14);
- assertEquals(14, out.length());
- assertEquals(testBytes1, out.subSequence(0, testBytes1.length()));
- assertEquals(0, out.byteAt(11));
- assertEquals(0, out.byteAt(12));
- assertEquals(0, out.byteAt(13));
- }
-
- /**
- * Test of {@link ByteArrayBuilder#clear()}.
- */
- @Test
- public void testClear() {
- final ByteArrayBuilder out = new ByteArrayBuilder(12);
- out.append(testBytes1);
- assertEquals(11, out.length());
- assertEquals(12, out.capacity());
-
- out.clear();
- assertEquals(0, out.length());
- assertEquals(12, out.capacity());
- try {
- out.byteAt(0);
- throw new IllegalStateException("IndexOutOfBoundsException expected.");
- } catch (final IndexOutOfBoundsException e) {
- /* This is the expected path. */
- }
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,57 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.ByteArray;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link ByteArray}.
- */
-public class ByteArrayTests {
-
- /**
- * Test of {@link ByteArray#fromHexCharSequence(CharSequence)}.
- */
- @Test
- public void fromHexCharSequenceTests() {
- final String input = "4397CDCC3F8F94FD6C77A64F83E95278";
- final byte[] expected = new byte[] {
- (byte) 0x43, (byte) 0x97, (byte) 0xCD, (byte) 0xCC, (byte) 0x3F, (byte) 0x8F, (byte) 0x94, (byte) 0xFD,
- (byte) 0x6C, (byte) 0x77, (byte) 0xA6, (byte) 0x4F, (byte) 0x83, (byte) 0xE9, (byte) 0x52, (byte) 0x78};
-
- final byte[] actual = ByteArray.fromHexCharSequence(input).toArray();
-
- assertArrayEquals(expected, actual);
-
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,195 +0,0 @@
-/*
- * Copyright 2021 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.IntArray;
-import org.foray.primitive.sequence.IntArrayBuilder;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link IntArrayBuilder}.
- */
-public class IntArrayBuilderTests {
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is of the wrong type.
- */
- @SuppressWarnings("unlikely-arg-type")
- @Test
- public void testEqualsWrongType() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- assertFalse(out.equals("abc"));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the comparison object is null.
- */
- @Test
- public void testEqualsNull() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- assertFalse(out.equals(null));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the length of the comparison object is different.
- */
- @Test
- public void testEqualsDifferentLengths() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(4);
- out.append(4);
- IntArrayBuilder comparison = new IntArrayBuilder();
- comparison.append(4);
- assertFalse(out.equals(comparison));
- comparison = new IntArrayBuilder();
- comparison.append(4);
- comparison.append(4);
- comparison.append(4);
- assertFalse(out.equals(comparison));
- }
-
- /**
- * Test of method {@link IntArrayBuilder#equals(Object)} where the sequences are equal.
- */
- @Test
- public void testEqualsAreEquivalentCharSequenceEquivalent() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(989);
- out.append(4);
- final IntArrayBuilder comparison = new IntArrayBuilder();
- comparison.append(989);
- comparison.append(4);
- assertTrue(out.equals(comparison));
- }
-
- /** Test of method {@link IntArrayBuilder#append(int...)}. */
- @Test
- public void testAppend() {
- final IntArrayBuilder out = new IntArrayBuilder();
- out.append(0);
- out.append(1);
- out.append(2, 3, 4, 5);
- final IntArray expected = new IntArray(new int[] {0, 1, 2, 3, 4, 5});
- assertEquals(expected, out.toIntArray());
- }
-
- /**
- * Test of {@link IntArrayBuilder#insert(int, int)}.
- */
- @Test
- public void insert_Test_001() {
- final IntArrayBuilder out = new IntArrayBuilder();
- final int[] starting = new int[] {0, 1, 2, 3, 4, 5};
- out.append(starting);
- assertEquals(6, out.length());
-
- /* Insert in the middle. */
- out.insert(2, 100);
- assertEquals(7, out.length());
- int[] expected = new int[] {0, 1, 100, 2, 3, 4, 5};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert at the beginning. */
- out.insert(0, 101);
- assertEquals(8, out.length());
- expected = new int[] {101, 0, 1, 100, 2, 3, 4, 5};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert at the end. */
- out.insert(out.length(), 102);
- assertEquals(9, out.length());
- expected = new int[] {101, 0, 1, 100, 2, 3, 4, 5, 102};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert with negative index. */
- try {
- out.insert(-1, 103);
- fail(IndexOutOfBoundsException.class.getName() + " expected");
- } catch (final IndexOutOfBoundsException e) {
- /* Nothing to do here. This is the expected case. */
- }
-
- /* Insert with index greater than length(). */
- try {
- out.insert(out.length() + 1, 104);
- fail(IndexOutOfBoundsException.class.getName() + " expected");
- } catch (final IndexOutOfBoundsException e) {
- /* Nothing to do here. This is the expected case. */
- }
- }
-
- /**
- * Test of {@link IntArrayBuilder#insertSortedUnique(int)}.
- */
- @Test
- public void insertSortedUnique_Test_001() {
- final IntArrayBuilder out = new IntArrayBuilder();
- final int[] starting = new int[] {-20, -10, 0, 10, 20};
- out.append(starting);
- assertEquals(5, out.length());
-
- /* Insert in the middle. */
- int actualIndex = out.insertSortedUnique(5);
- assertEquals(3, actualIndex);
- assertEquals(6, out.length());
- int[] expected = new int[] {-20, -10, 0, 5, 10, 20};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert at the beginning. */
- actualIndex = out.insertSortedUnique(-30);
- assertEquals(0, actualIndex);
- assertEquals(7, out.length());
- expected = new int[] {-30, -20, -10, 0, 5, 10, 20};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert at the end. */
- actualIndex = out.insertSortedUnique(30);
- assertEquals(7, actualIndex);
- assertEquals(8, out.length());
- expected = new int[] {-30, -20, -10, 0, 5, 10, 20, 30};
- assertArrayEquals(expected, out.toArray());
-
- /* Insert one that already exists. */
- try {
- actualIndex = out.insertSortedUnique(10);
- fail(IllegalArgumentException.class.getName() + " expected");
- } catch (final IllegalArgumentException e) {
- /* Nothing to do here. This is the expected case. */
- }
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,113 +0,0 @@
-/*
- * Copyright 2019 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.IntArray;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link IntArray}.
- */
-public class IntArrayTests {
-
- /**
- * Test of method {@link IntArray#equals(Object)} where the comparison object is of the wrong type.
- */
- @SuppressWarnings("unlikely-arg-type")
- @Test
- public void testEqualsWrongType() {
- final int[] theArray = {4};
- final IntArray out = new IntArray(theArray);
- assertFalse(out.equals("abc"));
- }
-
- /**
- * Test of method {@link IntArray#equals(Object)} where the comparison object is null.
- */
- @Test
- public void testEqualsNull() {
- final int[] theArray = {4};
- final IntArray out = new IntArray(theArray);
- assertFalse(out.equals(null));
- }
-
- /**
- * Test of method {@link IntArray#equals(Object)} where the length of the comparison object is different.
- */
- @Test
- public void testEqualsDifferentLengths() {
- final int[] theArray = {4, 4};
- final IntArray out = new IntArray(theArray);
-
- final int[] comparisonArray1 = {4};
- final IntArray comparison1 = new IntArray(comparisonArray1);
- assertFalse(out.equals(comparison1));
-
- final int[] comparisonArray2 = {4, 4, 4};
- final IntArray comparison2 = new IntArray(comparisonArray2);
- assertFalse(out.equals(comparison2));
- }
-
- /**
- * Test of method {@link IntArray#equals(Object)} where the sequences are equal.
- */
- @Test
- public void testEqualsAreEquivalentCharSequenceEquivalent() {
- final int[] theArray = {989, 4, -10388};
- final IntArray out = new IntArray(theArray);
-
- final int[] comparisonArray = {989, 4, -10388};
- final IntArray comparison = new IntArray(comparisonArray);
- assertTrue(out.equals(comparison));
- }
-
- /**
- * Tests of method {@link IntArray#lastInt()}.
- */
- @Test
- public void testLastInt() {
- IntArray out = new IntArray(10, 11, 12);
- assertEquals(12, out.lastInt());
-
- /* Internal array is empty. */
- out = new IntArray();
- try {
- out.lastInt();
- fail("Should have thrown an ArrayIndexOutOfBoundsException here.");
- } catch (final ArrayIndexOutOfBoundsException e) {
- /* This is the expected case. */
- }
- }
-
-}
Deleted: trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntSequenceIteratorTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntSequenceIteratorTests.java 2022-12-12 04:04:30 UTC (rev 12838)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntSequenceIteratorTests.java 2022-12-12 04:24:24 UTC (rev 12839)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.sequence.IntArray;
-import org.foray.primitive.sequence.IntSequenceIterator;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-import org.junit.jupiter.api.Test;
-
-import java.util.NoSuchElementException;
-
-/**
- * Tests of {@link IntSequenceIterator}.
- */
-public class IntSequenceIteratorTests {
-
- /** An array useful for testing the iterator. */
- private IntArray array1 = new IntArray(5, -5, 100, -100, Integer.MAX_VALUE, Integer.MIN_VALUE);
-
- /**
- * Test of {@link IntSequenceIterator#IntSequenceIterator(org.axsl.utility.sequence.IntSequence, false)}.
- */
- @Test
- pu...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-12 04:04:38
|
Revision: 12838
http://sourceforge.net/p/foray/code/12838
Author: victormote
Date: 2022-12-12 04:04:30 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Move primitive sequence classes from foray-common to foray-primitive.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeafIterator4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractByteSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/AbstractIntSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/ByteArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/IntSequenceIteratorTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/LongArrayBuilderTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/LongArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/sequence/NibbleArrayBuilderTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/RegisteredFontContent.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubSubtable.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx01x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx01x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx02x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx03x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx04x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx05x03.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x02.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx06x03.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx07x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/OtfLookupGsubx08x01.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGsub.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserAfm.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsSerializer.java
trunk/foray/foray-font/src/test/java/org/foray/font/format/ttf/OtfLookupGsubTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PdfGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/FirstFitLb.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/ParaContentIterator.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerJavaBreakIterator.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/PatternTree.java
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/eng.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/fin.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/hun.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/ita.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/mah.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/pol.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/por.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/rus.jbso
trunk/foray/foray-orthography/src/main/resources/resources/org/foray/orthography/hyphPatterns/spa.jbso
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfResources.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfAnnotList.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfNameDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPage4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPages.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/filespec/PdfFileSpec.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/function/PdfFunction.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfColor4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfPattern4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfShading.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXformEps.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationExplicit4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfOutline4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfOutlineItem4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfPageLabel.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/action/PdfGoTo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/action/PdfGoToRemote.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfBorderStyle.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfCrossRefInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfHeader.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfSerializer.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfDate.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfNameTree.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfNumberTree.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCharProcs.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidSystemInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfEncoding4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfLiteralString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfName.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfArrayTests.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentInfo4aTests.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentTests.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/serial/PdfParserTests.java
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSet4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetExtendedRoman.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetWindowsAnsi.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/Encoding4aLatinExtra.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCe.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingExpertSubset.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingIsoLatin1.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacExpert.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacRoman.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingMacStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingPdfDoc.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingStandard.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingSymbol.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingWinAnsi.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingZapfDingbats.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/java2d/Java2dSystemDict.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/pdf/PdfSystemDict.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/readonly/ReadOnlySystemDict.java
trunk/foray/foray-ps/src/test/java/org/foray/ps/encode/EncodingVector4aTests.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractByteSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractCharSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractIntSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractLongSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/AbstractShortSequence.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/BooleanSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceSubset.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/NibbleArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArrayBuilder.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortSequenceIterator.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/package-info.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,7 +28,7 @@
package org.foray.common;
-import org.foray.common.sequence.ByteArray;
+import org.foray.primitive.sequence.ByteArray;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.FontConstants;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,8 +28,8 @@
package org.foray.common.data;
-import org.foray.common.sequence.ByteArray;
-import org.foray.common.sequence.ByteSequenceSubset;
+import org.foray.primitive.sequence.ByteArray;
+import org.foray.primitive.sequence.ByteSequenceSubset;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequencePlus;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizerConfig.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,7 +28,7 @@
package org.foray.common.data;
-import org.foray.common.sequence.ByteArray;
+import org.foray.primitive.sequence.ByteArray;
import java.util.List;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,7 +28,7 @@
package org.foray.common.data;
-import org.foray.common.sequence.IntArray;
+import org.foray.primitive.sequence.IntArray;
/**
* Implementation of {@link OrderedTreePath}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,8 +28,8 @@
package org.foray.common.data;
-import org.foray.common.sequence.LongArrayBuilder;
import org.foray.primitive.BitUtils;
+import org.foray.primitive.sequence.LongArrayBuilder;
/**
* Packs an array of integers into less space by knowing the maximum number of bits that are needed to represent them,
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesIterator.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesIterator.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,8 +28,8 @@
package org.foray.common.data;
-import org.foray.common.sequence.CharArrayBuilder;
-import org.foray.common.sequence.IntArrayBuilder;
+import org.foray.primitive.sequence.CharArrayBuilder;
+import org.foray.primitive.sequence.IntArrayBuilder;
import java.util.Iterator;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeafIterator4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeafIterator4a.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/kp/KpLeafIterator4a.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -29,7 +29,7 @@
package org.foray.common.kp;
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.foray.common.sequence.IntArrayBuilder;
+import org.foray.primitive.sequence.IntArrayBuilder;
import org.axsl.kp.KpBranch;
import org.axsl.kp.KpContext;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -28,8 +28,8 @@
package org.foray.common.primitive;
-import org.foray.common.sequence.IntArrayBuilder;
import org.foray.primitive.StringUtils;
+import org.foray.primitive.sequence.IntArrayBuilder;
/**
* Utilities related to {@link CharSequence}.
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -1,772 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.foray.primitive.ByteUtils;
-
-import org.axsl.primitive.sequence.BytePrimitiveIterator;
-import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.primitive.sequence.ByteSequencePlus;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.nio.charset.Charset;
-
-/**
- * Abstract superclass for byte sequence classes.
- *
- * Note that many of the methods in this class were adapted from {@link java.lang.String}.
- */
-public abstract class AbstractByteSequence extends AbstractSequence implements ByteSequencePlus {
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = -1357351215576051840L;
-
- /** Byte array containing all whitespace characters. */
- private static final ByteArray WHITESPACE_CHARS = new ByteArray(" \n\r\t");
-
- @Override
- public String toString() {
- return new String(toArray(), java.nio.charset.Charset.forName("US-ASCII"));
- }
-
- @Override
- public String toString(final java.nio.charset.Charset charset) {
- return new String(toArray(), charset);
- }
-
- @Override
- public String toString(final String charsetName) throws UnsupportedEncodingException {
- return new String(toArray(), charsetName);
- }
-
- @Override
- public CharSequence charSubSequence(final int start, final int end) {
- return subSequence(start, end).toString();
- }
-
- @Override
- public CharSequence charSubSequence(final int start, final int end, final Charset charset) {
- return subSequence(start, end).toString(charset);
- }
-
- @Override
- public CharSequence charSubSequence(final int start, final int end, final String charsetName)
- throws UnsupportedEncodingException {
- return subSequence(start, end).toString(charsetName);
- }
-
- @Override
- public boolean equals(final Object other) {
- if (other == null) {
- return false;
- }
- if (! (other instanceof ByteSequence)) {
- return false;
- }
- final ByteSequence otherSequence = (ByteSequence) other;
- if (length() != otherSequence.length()) {
- return false;
- }
- for (int index = 0; index < length(); index ++) {
- if (byteAt(index) != otherSequence.byteAt(index)) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public String difference(final Object other) {
- if (other == null) {
- return "Comparison object is null.";
- }
- if (! (other instanceof ByteSequence)) {
- return "Comparison object is not a byte sequence.";
- }
- final ByteSequence otherSequence = (ByteSequence) other;
-
- final StringBuilder builder = new StringBuilder();
- if (length() != otherSequence.length()) {
- builder.append(String.format("Lengths are different: this %d, other %d.", this.length(),
- otherSequence.length()));
- }
-
- final int maxIndex = Math.min(this.length(), otherSequence.length());
- int diffIndex = -1;
- for (int index = 0; index < maxIndex; index ++) {
- if (byteAt(index) != otherSequence.byteAt(index)) {
- diffIndex = index;
- break;
- }
- }
- if (diffIndex < 0
- && length() != otherSequence.length()) {
- diffIndex = maxIndex + 1;
- }
-
- if (diffIndex > -1) {
- if (builder.length() > 0) {
- builder.append(" ");
- }
- builder.append(String.format("First difference is at index %d.", diffIndex));
- }
-
- return builder.toString();
- }
-
- @Override
- public int indexOf(final int aByte) {
- return indexOf(aByte, 0);
- }
-
- @Override
- public int indexOf(final int aByte, final int fromIndex) {
- if (aByte < Byte.MIN_VALUE
- || aByte > Byte.MAX_VALUE) {
- return -1;
- }
- final int max = length();
- int startIndex = fromIndex;
- if (fromIndex < 0) {
- startIndex = 0;
- } else if (fromIndex >= max) {
- return -1;
- }
- for (int i = startIndex; i < max; i++) {
- if (byteAt(i) == aByte) {
- return i;
- }
- }
- return -1;
- }
-
- @Override
- public int indexOf(final CharSequence str) {
- return indexOf(str, 0);
- }
-
- @Override
- public int indexOf(final CharSequence str, final int fromIndex) {
- return indexOf(0, length(), str, 0, str.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param fromIndex the index to begin searching from.
- * @return The index where {@code target} was found, or -1 if not found.
- * @see java.lang.String#indexOf(char[], int, int, String, int)
- */
- int indexOf(final int sourceOffset, final int sourceCount, final CharSequence target, final int fromIndex) {
- return indexOf(sourceOffset, sourceCount, target, 0, target.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param targetOffset offset of the target sequence.
- * @param targetCount count of the target sequence.
- * @param fromIndex the index to begin searching from.
- * @return The index where {@code target} was found, or -1 if not found.
- * @see java.lang.String#indexOf(char[], int, int, char[], int, int, int)
- */
- int indexOf(final int sourceOffset, final int sourceCount, final CharSequence target, final int targetOffset,
- final int targetCount, final int fromIndex) {
- if (fromIndex >= sourceCount) {
- return targetCount == 0 ? sourceCount : -1;
- }
- int startIndex = fromIndex;
- if (fromIndex < 0) {
- startIndex = 0;
- }
- if (targetCount == 0) {
- return startIndex;
- }
-
- final char first = target.charAt(targetOffset);
- final int max = sourceOffset + (sourceCount - targetCount);
-
- for (int i = sourceOffset + startIndex; i <= max; i++) {
- /* Look for first character. */
- if (byteAt(i) != first) {
- while (++i <= max && byteAt(i) != first) { }
- }
-
- /* Found first character, now look at the rest of v2 */
- if (i <= max) {
- int j = i + 1;
- final int end = j + targetCount - 1;
- for (int k = targetOffset + 1; j < end && byteAt(j) == target.charAt(k); j++, k++) { }
-
- if (j == end) {
- /* Found whole sequence. */
- return i - sourceOffset;
- }
- }
- }
- return -1;
- }
-
- @Override
- public int indexOf(final ByteSequence str) {
- return indexOf(str, 0);
- }
-
- @Override
- public int indexOf(final ByteSequence str, final int fromIndex) {
- return indexOf(0, length(), str, 0, str.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param fromIndex the index to begin searching from.
- * @return The index where {@code target} was found, or -1 if not found.
- * @see java.lang.String#indexOf(char[], int, int, String, int)
- */
- int indexOf(final int sourceOffset, final int sourceCount, final ByteSequence target, final int fromIndex) {
- return indexOf(sourceOffset, sourceCount, target, 0, target.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param targetOffset offset of the target sequence.
- * @param targetCount count of the target sequence.
- * @param fromIndex the index to begin searching from.
- * @return The index where {@code target} was found, or -1 if not found.
- * @see java.lang.String#indexOf(char[], int, int, char[], int, int, int)
- */
- int indexOf(final int sourceOffset, final int sourceCount, final ByteSequence target, final int targetOffset,
- final int targetCount, final int fromIndex) {
- if (fromIndex >= sourceCount) {
- return targetCount == 0 ? sourceCount : -1;
- }
- int startIndex = fromIndex;
- if (fromIndex < 0) {
- startIndex = 0;
- }
- if (targetCount == 0) {
- return startIndex;
- }
-
- final byte first = target.byteAt(targetOffset);
- final int max = sourceOffset + (sourceCount - targetCount);
-
- for (int i = sourceOffset + startIndex; i <= max; i++) {
- /* Look for first character. */
- if (byteAt(i) != first) {
- while (++i <= max && byteAt(i) != first) { }
- }
-
- /* Found first character, now look at the rest of v2 */
- if (i <= max) {
- int j = i + 1;
- final int end = j + targetCount - 1;
- for (int k = targetOffset + 1; j < end && byteAt(j) == target.byteAt(k); j++, k++) { }
-
- if (j == end) {
- /* Found whole sequence. */
- return i - sourceOffset;
- }
- }
- }
- return -1;
- }
-
- @Override
- public boolean contains(final byte testByte) {
- return indexOf(testByte) > -1;
- }
-
- @Override
- public int lastIndexOf(final int aByte) {
- return lastIndexOf(aByte, length() - 1);
- }
-
- @Override
- public int lastIndexOf(final int aByte, final int fromIndex) {
- int i = Math.min(fromIndex, length() - 1);
- for (; i >= 0; i--) {
- if (byteAt(i) == aByte) {
- return i;
- }
- }
- return -1;
- }
-
- @Override
- public int lastIndexOf(final CharSequence str) {
- return lastIndexOf(str, length());
- }
-
- @Override
- public int lastIndexOf(final CharSequence str, final int fromIndex) {
- return lastIndexOf(0, length(), str, 0, str.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param fromIndex the index to begin searching from.
- * @return The index, or -1 if not found.
- * @see java.lang.String#lastIndexOf(char[], int, int, String, int)
- */
- int lastIndexOf(final int sourceOffset, final int sourceCount, final CharSequence target, final int fromIndex) {
- return lastIndexOf(sourceOffset, sourceCount, target, 0, target.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param targetOffset offset of the target sequence.
- * @param targetCount count of the target sequence.
- * @param fromIndex the index to begin searching from.
- * @return The index, or -1 if not found.
- * @see java.lang.String#lastIndexOf(char[], int, int, char[], int, int, int)
- */
- int lastIndexOf(final int sourceOffset, final int sourceCount, final CharSequence target, final int targetOffset,
- final int targetCount, final int fromIndex) {
- /*
- * Check arguments; return immediately where possible. For
- * consistency, don't check for null str.
- */
- final int rightIndex = sourceCount - targetCount;
- if (fromIndex < 0) {
- return -1;
- }
- int fromIndexAdjusted = fromIndex;
- if (fromIndex > rightIndex) {
- fromIndexAdjusted = rightIndex;
- }
- /* Empty sequence always matches. */
- if (targetCount == 0) {
- return fromIndexAdjusted;
- }
-
- final int strLastIndex = targetOffset + targetCount - 1;
- final char strLastChar = target.charAt(strLastIndex);
- final int min = sourceOffset + targetCount - 1;
- int i = min + fromIndexAdjusted;
-
- startSearchForLastChar:
- while (true) {
- while (i >= min && byteAt(i) != strLastChar) {
- i--;
- }
- if (i < min) {
- return -1;
- }
- int j = i - 1;
- final int start = j - (targetCount - 1);
- int k = strLastIndex - 1;
-
- while (j > start) {
- if (byteAt(j--) != target.charAt(k--)) {
- i--;
- continue startSearchForLastChar;
- }
- }
- return start - sourceOffset + 1;
- }
- }
-
- @Override
- public int lastIndexOf(final ByteSequence str) {
- return lastIndexOf(str, length());
- }
-
- @Override
- public int lastIndexOf(final ByteSequence str, final int fromIndex) {
- return lastIndexOf(0, length(), str, 0, str.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param fromIndex the index to begin searching from.
- * @return The index, or -1 if not found.
- * @see java.lang.String#lastIndexOf(char[], int, int, String, int)
- */
- int lastIndexOf(final int sourceOffset, final int sourceCount, final ByteSequence target, final int fromIndex) {
- return lastIndexOf(sourceOffset, sourceCount, target, 0, target.length(), fromIndex);
- }
-
- /**
- * Used for searches.
- * The source is the sequence being searched, and the target is the sequence being searched for.
- *
- * @param sourceOffset offset of the source sequence.
- * @param sourceCount count of the source sequence.
- * @param target the characters being searched for.
- * @param targetOffset offset of the target sequence.
- * @param targetCount count of the target sequence.
- * @param fromIndex the index to begin searching from.
- * @return The index, or -1 if not found.
- * @see java.lang.String#lastIndexOf(char[], int, int, char[], int, int, int)
- */
- int lastIndexOf(final int sourceOffset, final int sourceCount, final ByteSequence target, final int targetOffset,
- final int targetCount, final int fromIndex) {
- /*
- * Check arguments; return immediately where possible. For
- * consistency, don't check for null str.
- */
- final int rightIndex = sourceCount - targetCount;
- if (fromIndex < 0) {
- return -1;
- }
- int fromIndexAdjusted = fromIndex;
- if (fromIndex > rightIndex) {
- fromIndexAdjusted = rightIndex;
- }
- /* Empty sequence always matches. */
- if (targetCount == 0) {
- return fromIndexAdjusted;
- }
-
- final int strLastIndex = targetOffset + targetCount - 1;
- final byte strLastChar = target.byteAt(strLastIndex);
- final int min = sourceOffset + targetCount - 1;
- int i = min + fromIndexAdjusted;
-
- startSearchForLastChar:
- while (true) {
- while (i >= min && byteAt(i) != strLastChar) {
- i--;
- }
- if (i < min) {
- return -1;
- }
- int j = i - 1;
- final int start = j - (targetCount - 1);
- int k = strLastIndex - 1;
-
- while (j > start) {
- if (byteAt(j--) != target.byteAt(k--)) {
- i--;
- continue startSearchForLastChar;
- }
- }
- return start - sourceOffset + 1;
- }
- }
-
- @Override
- public int countWhitespace(final int start) {
- int count = 0;
- int index = start;
- while (index < length()
- && WHITESPACE_CHARS.indexOf(byteAt(index)) < 0) {
- count ++;
- index ++;
- }
- return count;
- }
-
- @Override
- public int findStartOfLine(final int start) {
- int currIndex = start;
- while (true) {
- if (currIndex >= length()) {
- return -1;
- }
- if (isStartOfLine(currIndex)) {
- return currIndex;
- }
- currIndex ++;
- }
- }
-
- @Override
- public boolean isStartOfLine(final int start) {
- switch (start) {
- case 0: return true;
- default: {
- if (byteAt(start - 1) == '\r') {
- if (byteAt(start) == '\n') {
- return false;
- } else {
- return true;
- }
- } else if (byteAt(start - 1) == '\n') {
- return true;
- }
- return false;
- }
- }
- }
-
- @Override
- public ByteSequencePlus readCurrentLine(final int start) {
- if (start >= length()) {
- return null;
- }
- int end = start + 1;
- while (end < length()) {
- final byte theByte = byteAt(end);
- if (theByte == '\r'
- || theByte == '\n') {
- break;
- }
- end ++;
- }
- return subSequence(start, end);
- }
-
- @Override
- public ByteSequencePlus readNextLine(final int start) {
- final int startOfNextLine = findStartOfLine(start + 1);
- return readCurrentLine(startOfNextLine);
- }
-
- @Override
- public ByteSequencePlus readWord(final int start) {
- int trueStart = start;
- while (trueStart < length()
- && WHITESPACE_CHARS.indexOf(byteAt(trueStart)) > -1) {
- trueStart ++;
- }
- if (trueStart >= length()) {
- return null;
- }
- int end = trueStart;
- while (end < length()
- && WHITESPACE_CHARS.indexOf(byteAt(end)) < 0) {
- end ++;
- }
- if (end == trueStart) {
- return null;
- }
- return subSequence(trueStart, end);
- }
-
- @Override
- public ByteSequencePlus readWord(final int start, final int sequence) {
- int toSkip = sequence - 1;
- int currentStart = start;
- ByteSequencePlus word = readWord(currentStart);
- if (word == null) {
- return null;
- }
- while (toSkip > 0) {
- currentStart += word.length();
- currentStart += countWhitespace(currentStart);
- word = readWord(currentStart);
- if (word == null) {
- return null;
- }
- toSkip --;
- }
- return word;
- }
-
- @Override
- public abstract ByteSequencePlus subSequence(int start, int end);
-
- @Override
- public boolean canParseByte() {
- try {
- parseByte();
- return true;
- } catch (final NumberFormatException e) {
- return false;
- }
- }
-
- @Override
- public byte parseByte() {
- return Byte.parseByte(this.toString());
- }
-
- @Override
- public byte parseByte(final int radix) {
- return Byte.parseByte(this.toString(), radix);
- }
-
- @Override
- public boolean canParseShort() {
- try {
- parseShort();
- return true;
- } catch (final NumberFormatException e) {
- return false;
- }
- }
-
- @Override
- public short parseShort() {
- return Short.parseShort(this.toString());
- }
-
- @Override
- public short parseShort(final int radix) {
- return Short.parseShort(this.toString());
- }
-
- @Override
- public boolean canParseInt() {
- try {
- parseInt();
- return true;
- } catch (final NumberFormatException e) {
- return false;
- }
- }
-
- @Override
- public int parseInt() {
- return Integer.parseInt(this.toString());
- }
-
- @Override
- public int parseInt(final int radix) {
- return Integer.parseInt(this.toString());
- }
-
- @Override
- public boolean canParseLong() {
- try {
- parseLong();
- return true;
- } catch (final NumberFormatException e) {
- return false;
- }
- }
-
- @Override
- public long parseLong() {
- return Long.parseLong(this.toString());
- }
-
- @Override
- public long parseLong(final int radix) {
- return Long.parseLong(this.toString());
- }
-
- @Override
- public boolean canParseDecimal() {
- try {
- parseDecimal();
- return true;
- } catch (final NumberFormatException e) {
- return false;
- }
- }
-
- @Override
- public BigDecimal parseDecimal() {
- return new BigDecimal(this.toString());
- }
-
- @Override
- public void writeTo(final OutputStream output) throws IOException {
- for (int index = 0; index < length(); index ++) {
- final byte theByte = byteAt(index);
- output.write(theByte);
- }
- }
-
- @Override
- public ByteArray toHexByteSequence() {
- final byte[] outBytes = new byte[length() * 2];
- int outIndex = 0;
- for (int index = 0; index < length(); index ++) {
- final byte theByte = byteAt(index);
- final byte highNibble = ByteUtils.toHexCharHigh(theByte);
- outBytes[outIndex] = highNibble;
- outIndex ++;
- final byte lowNibble = ByteUtils.toHexCharLow(theByte);
- outBytes[outIndex] = lowNibble;
- outIndex ++;
- }
- return new ByteArray(outBytes);
- }
-
- @Override
- public ByteSequencePlus asPlus() {
- return this;
- }
-
- @Override
- public BytePrimitiveIterator iterator() {
- return new ByteSequenceIterator(this);
- }
-
- @Override
- public BytePrimitiveIterator iteratorReverse() {
- return new ByteSequenceIterator(this, true);
- }
-
- @Override
- public byte firstElement() {
- return byteAt(0);
- }
-
- @Override
- public byte lastElement() {
- return byteAt(length() - 1);
- }
-
- @Override
- public boolean isEmpty() {
- return this.length() < 1;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.axsl.primitive.sequence.CharPrimitiveIterator;
-import org.axsl.primitive.sequence.CharSequenceMutable;
-import org.axsl.primitive.sequence.CharSequencePlus;
-import org.axsl.primitive.sequence.CharSequenceUtility;
-
-/**
- * Abstract superclass for implementations of {@link CharSequencePlus}.
- */
-public abstract class AbstractCharSequence extends AbstractSequence implements CharSequencePlus {
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = -1486986783061908158L;
-
- @Override
- public int indexOf(final char aChar) {
- for (int index = 0; index < length(); index ++) {
- final int foundChar = charAt(index);
- if (foundChar == aChar) {
- return index;
- }
- }
- return -1;
- }
-
- @Override
- public boolean contains(final char theInt) {
- return indexOf(theInt) > -1;
- }
-
- @Override
- public CharPrimitiveIterator iterator() {
- return new CharSequenceIterator(this);
- }
-
- @Override
- public CharPrimitiveIterator iteratorReverse() {
- return new CharSequenceIterator(this, true);
- }
-
- @Override
- public CharSequencePlus asPlus() {
- return this;
- }
-
- /**
- * Provides an implementation of {@link CharSequenceMutable} from a specified {@link CharSequence}, recasting the
- * specified sequence if possible, otherwise copying its content into a new mutable instance.
- * @param charSequence The sequence for which a mutable instance is needed.
- * @return A mutable sequence.
- */
- public static CharSequenceMutable fromCharSequence(final CharSequence charSequence) {
- if (charSequence == null) {
- return new CharArrayBuilder();
- }
- final CharSequenceMutable mutable = CharSequenceUtility.asMutable(charSequence);
- if (mutable != null) {
- return mutable;
- }
- final CharArrayBuilder builder = new CharArrayBuilder(charSequence.length());
- builder.append(charSequence);
- return builder;
- }
-
- @Override
- public char firstElement() {
- return charAt(0);
- }
-
- @Override
- public char lastElement() {
- return charAt(length() - 1);
- }
-
- @Override
- public boolean isEmpty() {
- return this.length() < 1;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.axsl.primitive.sequence.IntPrimitiveIterator;
-import org.axsl.primitive.sequence.IntSequence;
-import org.axsl.primitive.sequence.IntSequenceMutable;
-import org.axsl.primitive.sequence.IntSequencePlus;
-
-/**
- * Abstract superclass for implementations of {@link IntSequencePlus}.
- */
-public abstract class AbstractIntSequence extends AbstractSequence implements IntSequencePlus {
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = 6308504447450398044L;
-
- @Override
- public int indexOf(final int anInt) {
- for (int index = 0; index < length(); index ++) {
- final int foundInt = intAt(index);
- if (foundInt == anInt) {
- return index;
- }
- }
- return -1;
- }
-
- @Override
- public boolean contains(final int theInt) {
- return indexOf(theInt) > -1;
- }
-
- @Override
- public IntPrimitiveIterator iterator() {
- return new org.foray.common.sequence.IntSequenceIterator(this);
- }
-
- @Override
- public IntPrimitiveIterator iteratorReverse() {
- return new org.foray.common.sequence.IntSequenceIterator(this, true);
- }
-
- @Override
- public IntSequencePlus asPlus() {
- return this;
- }
-
- /**
- * Provides an implementation of {@link IntSequenceMutable} from a specified {@link IntSequence}, recasting the
- * specified sequence if possible, otherwise copying its content into a new mutable instance.
- * @param intSequence The sequence for which a mutable instance is needed.
- * @return A mutable sequence.
- */
- public static IntSequenceMutable fromIntSequence(final IntSequence intSequence) {
- if (intSequence == null) {
- return new IntArrayBuilder();
- }
- final IntSequenceMutable mutable = intSequence.asMutable();
- if (mutable != null) {
- return mutable;
- }
- final IntArrayBuilder builder = new IntArrayBuilder(intSequence.length());
- builder.append(intSequence);
- return builder;
- }
-
- @Override
- public int firstElement() {
- return intAt(0);
- }
-
- @Override
- public int lastElement() {
- return intAt(length() - 1);
- }
-
- @Override
- public boolean isEmpty() {
- return this.length() < 1;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-12 01:06:44 UTC (rev 12837)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-12 04:04:30 UTC (rev 12838)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.sequence;
-
-import org.axsl.primitive.sequence.LongPrimitiveIterator;
-import org.axsl.primitive.sequence.LongSequence;
-import org.axsl.primitive.sequence.LongSequenceMutable;
-import org.axsl.primitive.sequence.LongSequencePlus;
-
-/**
- * Abstract superclass for implementations of {@link LongSequencePlus}.
- */
-public abstract class AbstractLongSequence extends AbstractSequence implements LongSequencePlus {
-
- /** Constant needed for serialization. */
- private static final long serialVersionUID = -4561491878925977191L;
-
- @Override
- public int indexOf(final long aLong) {
- for (int index = 0; index < length(); index ++) {
- final long foundLong = longAt(index);
- if (foundLong == aLong) {
- return index;
- }
- }
- return -1;
- }
-
- @Override
- public boolean contains(final long aLong) {
- return indexOf(aLong) > -1;
- }
-
- @Override
- public LongPrimitiveIterator iterator() {
- return new LongSequenceIterator(this);
- }
-
- @Override
- public LongPrimitiveIterator iteratorReverse() {
- return new LongSequenceIterator(this, true);
- }
-
- @Override
- public LongSequencePlus asPlus() {
- return this;
- }
-
- /**
- * Provides an implementation of {@link LongSequenceMutable} from a specified {@link LongSequence}, recasting the
- * specified sequence if possible, otherwise copying its content into a new mutable instance.
- * @param longSequence The sequence for which a mutable instance is needed.
- * @return A mutable sequence.
- */
- public static LongSequenceMutable fromLongSequence(final LongSequence longSequence) {
- if (longSequence == null) {
- return new LongArrayBuilder();
- }
- final LongSequenceMutable mutable = longSequence.asMutable();
- if (mutable != null) {
- return mutable;
- }
- final LongArrayBuilder builder = new LongArrayBuilder(longSequence.length());
- builder.append(longSequence);
- return builder;
- }
-
- @Override
- public long firstElement() {
- return longAt(0);
- }
-
- @Override
- public long lastElement() {
- return longAt(length() - 1);
- }
-
- @Override
- public boolean isEmpty() {
- return this.length() < 1;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-12 01:06:48
|
Revision: 12837
http://sourceforge.net/p/foray/code/12837
Author: victormote
Date: 2022-12-12 01:06:44 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Move some primitive utility classes to foray-primitive.
Modified Paths:
--------------
trunk/foray/foray-app/src/main/java/org/foray/app/FOray.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
trunk/foray/foray-common/build.gradle
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNode.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesChar.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java
trunk/foray/foray-common/src/main/java/org/foray/common/encoding/Latin1Encoding.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/BitUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharSequenceUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/CharacterUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/NumberUtilsTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/StringUtilsTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/config/FontConfigParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TrueTypeFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableGlyf.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1Metrics.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoTreeParser4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/TotalFitLb.java
trunk/foray/foray-linebreak/src/test/java/org/foray/linebreak/util/DumpLayout.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphenMutating4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Orthography4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/PatternTree.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/DictionaryParser.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/NaturalLanguage.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/util/SpellChecker.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/wrapper/DecoratedWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfItem.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfCrossRefInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfGenericDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfReport.java
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSetParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/GlyphListParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/AsciiHexDecodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EexecDecodeFilter.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-xml/src/main/java/org/foray/xml/ForayXdiff.java
trunk/foray/foray-xml/src/main/java/org/foray/xml/SaxParser.java
trunk/foray/foray-xml/src/main/java/org/foray/xml/dtd/DtdAttribute.java
Added Paths:
-----------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/BitUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/BooleanUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/ByteUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/FloatUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/NumberUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/StringUtils.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/package-info.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BooleanUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/NumberUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
Modified: trunk/foray/foray-app/src/main/java/org/foray/app/FOray.java
===================================================================
--- trunk/foray/foray-app/src/main/java/org/foray/app/FOray.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-app/src/main/java/org/foray/app/FOray.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -29,8 +29,8 @@
package org.foray.app;
import org.foray.common.ConfigurationException;
-import org.foray.common.primitive.StringUtils;
import org.foray.core.ForayException;
+import org.foray.primitive.StringUtils;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/RegionOuterRa4a.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -29,7 +29,7 @@
package org.foray.area;
import org.foray.area.link.Link;
-import org.foray.common.primitive.StringUtils;
+import org.foray.primitive.StringUtils;
import org.axsl.area.AreaTreeException;
import org.axsl.area.RegionOuterRa;
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/build.gradle 2022-12-12 01:06:44 UTC (rev 12837)
@@ -18,6 +18,8 @@
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
implementation (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-value', version: versions.axsl)
+
+ api project(':foray-primitive')
}
javadoc {
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -28,7 +28,7 @@
package org.foray.common.data;
-import org.foray.common.primitive.FloatUtils;
+import org.foray.primitive.FloatUtils;
import org.axsl.ps.BoundingBox;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/PackedIntArray.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -28,8 +28,8 @@
package org.foray.common.data;
-import org.foray.common.primitive.BitUtils;
import org.foray.common.sequence.LongArrayBuilder;
+import org.foray.primitive.BitUtils;
/**
* Packs an array of integers into less space by knowing the maximum number of bits that are needed to represent them,
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNode.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNode.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNode.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -28,7 +28,7 @@
package org.foray.common.data;
-import org.foray.common.primitive.CharacterUtils;
+import org.foray.primitive.CharacterUtils;
/**
* A notional Node for {@link TernaryNodes}, useful mostly for iterators and debugging.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesChar.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesChar.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryNodesChar.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -28,7 +28,7 @@
package org.foray.common.data;
-import org.foray.common.primitive.CharacterUtils;
+import org.foray.primitive.CharacterUtils;
import java.util.Arrays;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -34,7 +34,7 @@
package org.foray.common.data;
import org.foray.common.primitive.CharSequenceUtils;
-import org.foray.common.primitive.StringUtils;
+import org.foray.primitive.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/encoding/Latin1Encoding.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/encoding/Latin1Encoding.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/encoding/Latin1Encoding.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -28,7 +28,7 @@
package org.foray.common.encoding;
-import org.foray.common.primitive.CharacterUtils;
+import org.foray.primitive.CharacterUtils;
/**
* Encoding for the Latin-1 character set, which is a superset of US-ASCII.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -29,7 +29,7 @@
package org.foray.common.i18n;
import org.foray.common.primitive.ObjectUtils;
-import org.foray.common.primitive.StringUtils;
+import org.foray.primitive.StringUtils;
import org.axsl.i18n.Country;
import org.axsl.i18n.Language;
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BitUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,150 +0,0 @@
-/*
- * Copyright 2006 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-/**
- * Utility class containing numeric routines, especially bit operators.
- */
-public final class BitUtils {
-
- /** Mask for zeroing the 4 high-order bits in a byte. */
- private static final byte BYTE_HIGH_ORDER_MASK = (byte) 0x0F;
-
- /** Mark for zeroing the 4 low-order bits in a byte. */
- private static final byte BYTE_LOW_ORDER_MASK = (byte) 0xF0;
-
- /** The maximum bit index in an integer (31). */
- private static final byte MAX_INTEGER_BIT_INDEX = Integer.SIZE - 1;
-
- /** The maximum bit index in a long (63). */
- private static final byte MAX_LONG_BIT_INDEX = Long.SIZE - 1;
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private BitUtils() { }
-
- /**
- * Turns a specific bit in an integer value "on".
- * @param input The integer to be converted.
- * @param bit The bit position to be set. Zero is the low-order bit. If {@code bit} is less than zero or more than
- * 31, an IllegalArgumentException is thrown.
- * @return The converted integer.
- */
- public static int setBit(final int input, final int bit) {
- if (bit < 0
- || bit > MAX_INTEGER_BIT_INDEX) {
- throw new IllegalArgumentException("Bit position is not valid: " + bit);
- }
- int mask = 1;
- mask <<= bit;
- return input | mask;
- }
-
- /**
- * Returns the value of a specific bit.
- * @param input The long to be checked.
- * @param bit The bit position to be checked. Zero is the low-order bit. If {code bit} is less than zero or more
- * than 31, an IllegalArgumentException is thrown.
- * @return True if the bit is on (1), or false if the bit is off (0).
- */
- public static boolean getBit(final long input, final int bit) {
- if (bit < 0
- || bit > MAX_LONG_BIT_INDEX) {
- throw new IllegalArgumentException("Bit position is not valid: " + bit);
- }
- int mask = 1;
- mask <<= bit;
- return (input & mask) != 0;
- }
-
- /**
- * Zeroes the 4 high-order bits in byte.
- * @param input The byte for which the high-order bits should be masked.
- * @return The masked value.
- */
- public static byte maskHighOrderBits(final byte input) {
- return (byte) (input & BitUtils.BYTE_HIGH_ORDER_MASK);
- }
-
- /**
- * Zeroes the 4 low-order bits in byte.
- * @param input The byte for which the low-order bits should be masked.
- * @return The masked value.
- */
- public static byte maskLowOrderBits(final byte input) {
- return (byte) (input & BitUtils.BYTE_LOW_ORDER_MASK);
- }
-
- /**
- * Extracts a range of bits from a long and returns the value as a long.
- * @param input The long containing the bits to be extracted.
- * @param position The position in {@code input} at which the bits should be extracted.
- * Position 0 is the low-order bit, position 63 is the high-order bit.
- * Values outside of that range will produce undefined results.
- * @param qtyBits The number of bits that should be extracted.
- * Values outside of 0 inclusive through 64 inclusive will produce undefined results.
- * @return The extracted value.
- */
- public static long extractBits(final long input, final int position, final int qtyBits) {
- final long rightShifted = input >>> position;
- long mask = -1;
- if (qtyBits < Long.SIZE) {
- mask = (1L << qtyBits) - 1L;
- }
- return rightShifted & mask;
- }
-
- /**
- * Replaces a range of bits in a long with a new value.
- * @param input The long containing the bits to be replaced.
- * @param position The position in {@code input} at which the bits should be replaced.
- * Position 0 is the low-order bit, position 63 is the high-order bit.
- * Values outside of that range will produce undefined results.
- * @param qtyBits The number of bits that should be replaced.
- * Values outside of 0 inclusive through 64 inclusive will produce undefined results.
- * @param newValue The value of the bits that will replace the existing bits.
- * @return The new value.
- */
- public static long replaceBits(final long input, final int position, final int qtyBits, final long newValue) {
- if (qtyBits < 1) {
- return input;
- }
- long leftBits = extractBits(input, position + qtyBits, Long.SIZE - qtyBits);
- leftBits = leftBits << (position + qtyBits);
- final long rightBits = extractBits(input, 0, position);
- /* Strip off any high-order bits that exceed the qtyBits. */
- long middleBits = newValue << (Long.SIZE - qtyBits);
- middleBits = middleBits >>> (Long.SIZE - qtyBits);
- middleBits = middleBits << position;
- return leftBits | middleBits | rightBits;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BooleanUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BooleanUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/BooleanUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,65 +0,0 @@
-/*
- * Copyright 2019 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-/**
- * Utility class containing methods for boolean values.
- */
-public final class BooleanUtils {
-
- /**
- * Private constructor. This is a utility class and should never be
- * instantiated.
- */
- private BooleanUtils() { }
-
- /**
- * Converts a given boolean value into its integer equivalent: 1 if true, 0 if false.
- * @param input The boolean to be converted.
- * @return 1 if {@code input} is true, 0 if false.
- */
- public static byte asInteger(final boolean input) {
- return (byte) (input ? 1 : 0);
- }
-
- /**
- * Indicates whether all elements in an array of booleans are true.
- * @param input The array of booleans to be tested.
- * @return True if and only if all elements in {@code input} are true;
- */
- public static boolean allTrue(final boolean[] input) {
- for (int index = 0; index < input.length; index ++) {
- if (! input[index]) {
- return false;
- }
- }
- return true;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,125 +0,0 @@
-/*
- * Copyright 2020 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.foray.common.sequence.ByteArray;
-
-import org.axsl.constants.PrimitiveConstants;
-
-/**
- * Utilities for bytes.
- */
-public final class ByteUtils {
-
- /** Array of characters representing the hex values of a nibble. */
- private static final ByteArray HEX_CHARS = new ByteArray("0123456789ABCDEF");
-
- /**
- * Private constructor. This is a utility class, and should never be instantiated.
- */
- private ByteUtils() { }
-
- /**
- * Converts a char, representing a hexadecimal character, to its byte value.
- * For example, input of "3" returns 0x03, input of "F" or "f" returns 0x0F.
- * @param theChar The char to be converted.
- * This must be in the range "0" through "9", "A" through "F", or "a" through "f".
- * @return The numeric value of {@code theChar} represented by high-order nibble.
- * @throws IllegalArgumentException for invalid {@code theChar}.
- */
- public static byte asNibble(final char theChar) {
- final byte theByte = (byte) HEX_CHARS.indexOf(Character.toUpperCase(theChar));
- if (theByte < 0) {
- throw new IllegalArgumentException("Not a valid hexadecimal character: " + theChar);
- }
- return theByte;
- }
-
- /**
- * Converts two characters in a {@link CharSequence}, each expected to be the ASCII representation of a nibble,
- * into a byte.
- * For example, the sequence "FF" should be returned as 0xFF, the sequence "06" should return 0x06.
- * @param chars The {@link String} or other {@link CharSequence} containing the hex nibble characters.
- * This can not be null.
- * @param start The index into {@code chars} at which the first byte should be read.
- * This cannot be less than zero, nor more than chars.length() - 2.
- * @return The byte represented by the two characters.
- */
- public static byte fromHexChars(final CharSequence chars, final int start) {
- final int highNibble = asNibble(chars.charAt(start)) << PrimitiveConstants.BITS_PER_NIBBLE;
- final int lowNibble = asNibble(chars.charAt(start + 1));
- return (byte) (highNibble | lowNibble);
- }
-
- /**
- * Converts two bytes, each expected to be the ASCII representation of a nibble, into a byte.
- * For example, the sequence "FF" should be returned as 0xFF, the sequence "06" should return 0x06.
- * @param highOrderByte The byte containing the high order nibble.
- * @param lowOrderByte The byte containing the low order nibble.
- * @return The byte represented by the input bytes.
- */
- public static byte fromHexChars(final byte highOrderByte, final byte lowOrderByte) {
- if (highOrderByte < 0) {
- throw new IllegalArgumentException("Not a valid ASCII character: " + highOrderByte);
- }
- if (lowOrderByte < 0) {
- throw new IllegalArgumentException("Not a valid ASCII character: " + lowOrderByte);
- }
- final char highOrderChar = (char) highOrderByte;
- final char lowOrderChar = (char) lowOrderByte;
-
- final int highNibble = asNibble(highOrderChar) << PrimitiveConstants.BITS_PER_NIBBLE;
- final int lowNibble = asNibble(lowOrderChar);
- return (byte) (highNibble | lowNibble);
- }
-
- /**
- * Returns the high-order nibble of a byte as the ASCII byte that represents that hexadecimal value.
- * For example, the byte 0xF9 should be returned as "F", the sequence "6C" should return "6".
- * @param inputByte The byte whose high-order nibble should be converted to an ASCII hexadecimal digit.
- * @return The ASCII byte representing the value of the high-order nibble of {@code inputByte}.
- */
- public static byte toHexCharHigh(final byte inputByte) {
- byte index = (byte) (inputByte >>> PrimitiveConstants.BITS_PER_NIBBLE);
- index &= PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE;
- return HEX_CHARS.byteAt(index);
- }
-
- /**
- * Returns the low-order nibble of a byte as the ASCII byte that represents that hexadecimal value.
- * For example, the byte 0xF9 should be returned as "9", the sequence "6C" should return "C".
- * @param inputByte The byte whose low-order nibble should be converted to an ASCII hexadecimal digit.
- * @return The ASCII byte representing the value of the low-order nibble of {@code inputByte}.
- */
- public static byte toHexCharLow(final byte inputByte) {
- final byte index = (byte) (inputByte & PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE);
- return HEX_CHARS.byteAt(index);
- }
-
-}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharSequenceUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -29,6 +29,7 @@
package org.foray.common.primitive;
import org.foray.common.sequence.IntArrayBuilder;
+import org.foray.primitive.StringUtils;
/**
* Utilities related to {@link CharSequence}.
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,414 +0,0 @@
-/*
- * Copyright 2009 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.axsl.constants.PrimitiveConstants;
-import org.axsl.unicode.block.Arabic_Presentation_Forms_B_Block;
-import org.axsl.unicode.block.Basic_Latin_Block;
-import org.axsl.unicode.block.CJK_Symbols_and_Punctuation_Block;
-import org.axsl.unicode.block.General_Punctuation_Block;
-import org.axsl.unicode.block.Latin_1_Supplement_Block;
-
-import java.util.List;
-
-/**
- * Utilities related to char and Character.
- */
-public final class CharacterUtils {
-
- /** The maximum printable ASCII character, a tilde ~, 0x7E, 126. */
- public static final char MAX_PRINTABLE_ASCII_CHAR = Basic_Latin_Block.TILDE;
-
- /** The punctuation characters which, when they immediately precede a word, should not be separated from that word
- * during line-breaking. TODO: This list is not comprehensive and should be improved. */
- private static final String ATTACHED_LEADING_PUNCTUATION = new String(new char[] {
- Basic_Latin_Block.LEFT_PARENTHESIS,
- Basic_Latin_Block.LEFT_SQUARE_BRACKET,
- General_Punctuation_Block.LEFT_SINGLE_QUOTATION_MARK,
- General_Punctuation_Block.LEFT_DOUBLE_QUOTATION_MARK,
- });
-
- /** The punctuation characters which, when they immediately follow a word, should not be separated from that word
- * during line-breaking. TODO: This list is not comprehensive and should be improved. */
- private static final String ATTACHED_TRAILING_PUNCTUATION = new String(new char[] {
- Basic_Latin_Block.FULL_STOP, // A period '.'
- Basic_Latin_Block.COMMA,
- Basic_Latin_Block.SEMICOLON,
- Basic_Latin_Block.COLON,
- Basic_Latin_Block.EXCLAMATION_MARK,
- Basic_Latin_Block.QUESTION_MARK,
- Basic_Latin_Block.APOSTROPHE,
- Basic_Latin_Block.QUOTATION_MARK,
- Basic_Latin_Block.RIGHT_PARENTHESIS,
- Basic_Latin_Block.RIGHT_SQUARE_BRACKET,
- General_Punctuation_Block.RIGHT_SINGLE_QUOTATION_MARK,
- General_Punctuation_Block.RIGHT_DOUBLE_QUOTATION_MARK,
- });
-
- /** The punctuation characters which may, depending on context, be treated as intraword punctuation. */
- private static final String POSSIBLE_INTRAWORD_PUNCTUATION = new String(new char[] {
- Basic_Latin_Block.APOSTROPHE, //English example: 'Tis the season
- General_Punctuation_Block.RIGHT_SINGLE_QUOTATION_MARK, //English example: ’Tis the season
- Basic_Latin_Block.LEFT_PARENTHESIS, //English example of alternate spelling:
- Basic_Latin_Block.RIGHT_PARENTHESIS, // pa(e)leography
- Basic_Latin_Block.FULL_STOP, //English example: Section 8.16
- });
-
- /** The punctuation characters which, when they immediately follow a word, can be separated from that word during
- * line-breaking, but which preferably should not be separated. TODO: This list is not comprehensive and should be
- * improved. */
- private static final String DETACHABLE_PUNCTUATION = new String(new char[] {
- General_Punctuation_Block.EN_DASH,
- });
-
- /** The punctuation characters which, when they immediately follow a word, can be separated from that word during
- * line-breaking, but which preferably should not be separated. TODO: This list is not comprehensive and should be
- * improved.*/
- private static final String DETACHED_PUNCTUATION = new String(new char[] {
- General_Punctuation_Block.EM_DASH,
- });
-
- /** The set of characters that are Arabic digits, i.e. "0" through "9". */
- private static final String ARABIC_DIGIT = new String(new char[] {
- Basic_Latin_Block.DIGIT_ZERO,
- Basic_Latin_Block.DIGIT_ONE,
- Basic_Latin_Block.DIGIT_TWO,
- Basic_Latin_Block.DIGIT_THREE,
- Basic_Latin_Block.DIGIT_FOUR,
- Basic_Latin_Block.DIGIT_FIVE,
- Basic_Latin_Block.DIGIT_SIX,
- Basic_Latin_Block.DIGIT_SEVEN,
- Basic_Latin_Block.DIGIT_EIGHT,
- Basic_Latin_Block.DIGIT_NINE,
- });
-
- /** The set of characters that could be included with {@link #ARABIC_DIGIT} codepoints to form an Arabic Numeral. */
- private static final String ARABIC_NUMERAL_ADDITIONAL = new String(new char[] {
- Basic_Latin_Block.FULL_STOP,
- Basic_Latin_Block.COMMA,
- Basic_Latin_Block.HYPHEN_MINUS,
- });
-
- /**
- * Private constructor. This is a utility class, and should never be instantiated.
- */
- private CharacterUtils() { }
-
- /**
- * Converts a List of Character instances into an array of chars.
- * @param list The List of Character instances to be converted to an array.
- * @return The array of chars.
- */
- public static char[] toArray(final List<Character> list) {
- if (list == null) {
- return new char[0];
- }
- final char[] returnArray = new char[list.size()];
- for (int i = 0; i < list.size(); i++) {
- returnArray[i] = list.get(i);
- }
- return returnArray;
- }
-
- /**
- * Indicates whether a given char is an attached leading punctuation mark or not.
- * Attached leading punctuation marks are those which, when they immediately precede a word, should not be separated
- * from that word during line-breaking.
- * @param c The char to be tested.
- * @return True if {@code c} is an attached leading punctuation character.
- */
- public static boolean isAttachedLeadingPunctuation(final int c) {
- return ATTACHED_LEADING_PUNCTUATION.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given char is an attached trailing punctuation mark or not.
- * Attached trailing punctuation marks are those which, when they immediately follow a word, should not be separated
- * from that word during line-breaking.
- * @param c The char to be tested.
- * @return True if {@code c} is an attached punctuation character.
- */
- public static boolean isAttachedTrailingPunctuation(final int c) {
- return ATTACHED_TRAILING_PUNCTUATION.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given char is a punctuation mark or not.
- * @param c The char to be tested.
- * @return True if {@code c} is an attached punctuation character.
- */
- public static boolean isDetachablePunctuation(final int c) {
- return DETACHABLE_PUNCTUATION.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given char is a punctuation mark or not.
- * @param c The char to be tested.
- * @return True if {@code c} is an attached punctuation character.
- */
- public static boolean isDetachedPunctuation(final int c) {
- return DETACHED_PUNCTUATION.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given codepoint is possibly intraword punctuation. i.e. punctuation that is legitimately
- * part of a word.
- * For example, in English, the apostrophe and typographical closing quote can be used to mark contractions or
- * possessives.
- * @param c The codepoint to be tested.
- * @return True if {@code c} is possible intraword punctuation.
- */
- public static boolean isPossibleIntrawordPunctuation(final int c) {
- return POSSIBLE_INTRAWORD_PUNCTUATION.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given character is a punctuation mark.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a punctuation mark.
- */
- public static boolean isPunctuation(final int c) {
- return isAttachedLeadingPunctuation(c)
- || isAttachedTrailingPunctuation(c)
- || isDetachablePunctuation(c)
- || isDetachedPunctuation(c);
- }
-
- /**
- * Converts the 8 bits in a byte to the low-order 8 bits of a char.
- * @param theByte The byte to be converted.
- * @return The char with the same bits as {@code theByte}.
- */
- public static char fromByte(final byte theByte) {
- return (char) (PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT & theByte);
- }
-
- /**
- * Indicates whether an integral type can be safely converted to a char without loss of data.
- * @param theIntegral The integral being tested.
- * @return True if and only if {@code theIntegral} is between {@link Character#MIN_VALUE} inclusive and
- * {@link Character#MAX_VALUE} inclusive.
- */
- public static boolean isInCharacterRange(final long theIntegral) {
- if (theIntegral < Character.MIN_VALUE) {
- return false;
- }
- if (theIntegral > Character.MAX_VALUE) {
- return false;
- }
- return true;
- }
-
- /**
- * Returns the high-order byte in a given char.
- * @param theChar The char to be converted.
- * @return The high-order byte.
- */
- public static byte asHighOrderByte(final char theChar) {
- return (byte) (theChar >>> PrimitiveConstants.BITS_PER_BYTE);
- }
-
- /**
- * Returns the low-order byte in a given char.
- * @param theChar The char to be converted.
- * @return The low-order byte.
- */
- public static byte asLowOrderByte(final char theChar) {
- return (byte) (theChar & PrimitiveConstants.MAX_8_BIT_UNSIGNED_BYTE);
- }
-
- /**
- * Helper method to determine if the character is a
- * space with normal behavior. Normal behavior means that
- * it's not non-breaking.
- * @param c character to inspect
- * @return True if the character is a normal space
- */
- public static boolean isBreakableSpace(final int c) {
- return c == Basic_Latin_Block.SPACE || isFixedWidthSpace(c);
- }
-
- /**
- * Indicates whether a given char is a zero-width space.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a zero-width space character.
- */
- public static boolean isZeroWidthSpace(final int c) {
- return c == General_Punctuation_Block.ZERO_WIDTH_SPACE
- || c == General_Punctuation_Block.WORD_JOINER
- || c == Arabic_Presentation_Forms_B_Block.ZERO_WIDTH_NO_BREAK_SPACE;
- }
-
- /**
- * Indicates whether a given char is a (breakable) fixed-width space.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a fixed-width space character.
- */
- public static boolean isFixedWidthSpace(final int c) {
- return (c >= General_Punctuation_Block.EN_QUAD
-// || c == General_Punctuation_Block.EN_QUAD // 0x2000
-// || c == General_Punctuation_Block.EM_QUAD // 0x2001
-// || c == General_Punctuation_Block.EN_SPACE // 0x2002
-// || c == General_Punctuation_Block.EM_SPACE // 0x2003
-// || c == General_Punctuation_Block.THREE_PER_EM_SPACE // 0x2004
-// || c == General_Punctuation_Block.FOUR_PER_EM_SPACE // 0x2005
-// || c == General_Punctuation_Block.SIX_PER_EM_SPACE // 0x2006
-// || c == General_Punctuation_Block.FIGURE_SPACE // 0x2007
-// || c == General_Punctuation_Block.PUNCTUATION_SPACE // 0x2008
-// || c == General_Punctuation_Block.THIN_SPACE // 0x2009
-// || c == General_Punctuation_Block.HAIR_SPACE // 0x200a
-// || c == General_Punctuation_Block.ZERO_WIDTH_SPACE // 0x200b
- && c <= General_Punctuation_Block.ZERO_WIDTH_SPACE)
- || c == CJK_Symbols_and_Punctuation_Block.IDEOGRAPHIC_SPACE;
- }
-
- /**
- * Indicates whether a given char is an adjustable space.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is an adjustable space character.
- */
- public static boolean isAdjustableSpace(final int c) {
- /* TODO: This list may not be complete. */
- return
- c == Basic_Latin_Block.SPACE
- || c == Latin_1_Supplement_Block.NO_BREAK_SPACE;
- }
-
- /**
- * Indicates whether a given char is a breaking space character.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a breaking space character.
- */
- public static boolean isBreakableSpace(final char c) {
- return c == Basic_Latin_Block.SPACE || isFixedWidthSpace(c);
- }
-
- /**
- * Indicates whether a given char is a non-breaking space character.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a non-breaking space character.
- */
- public static boolean isNonBreakableSpace(final char c) {
- return
- c == Latin_1_Supplement_Block.NO_BREAK_SPACE
- || c == General_Punctuation_Block.NARROW_NO_BREAK_SPACE
- || c == CJK_Symbols_and_Punctuation_Block.IDEOGRAPHIC_SPACE
- || c == General_Punctuation_Block.WORD_JOINER
- || c == Arabic_Presentation_Forms_B_Block.ZERO_WIDTH_NO_BREAK_SPACE;
- }
-
- /**
- * Indicates whether a given char is a space character.
- * @param c The char to be tested.
- * @return True if and only if {@code c} is a space character.
- */
- public static boolean isAnySpace(final char c) {
- return isBreakableSpace(c) || isNonBreakableSpace(c);
- }
-
- /**
- * Indicates whether a given codepoint is an Arabic digit, i.e. "0" through "9".
- * @param c The codepoint to be tested.
- * @return True if and only if {@code c} is an Arabic digit.
- */
- public static boolean isArabicDigit(final int c) {
- return ARABIC_DIGIT.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given codepoint, while not being an Arabic digit, is valid as part of an Arabic numeral.
- * @param c The codepoint to be tested.
- * @return True if and only if {@code c} is not an Arabic digit, but is valid as part of an Arabic numeral.
- */
- public static boolean isArabicNumeralAdditional(final int c) {
- return ARABIC_NUMERAL_ADDITIONAL.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given codepoint is an Arabic numeral character.
- * @param c The codepoint to be tested.
- * @return True if and only if {@code c} is an Arabic numeral character.
- */
- public static boolean isArabicNumeral(final int c) {
- return ARABIC_DIGIT.indexOf(c) > -1
- || ARABIC_NUMERAL_ADDITIONAL.indexOf(c) > -1;
- }
-
- /**
- * Indicates whether a given character is a letter.
- * @param c The codepoint to be tested.
- * @return True if and only if {@code c} is a letter.
- */
- public static boolean isLetter(final int c) {
- final int type = Character.getType(c);
-
- switch (type) {
- /* Ordered by expected frequency of use, for performance. */
- case Character.LOWERCASE_LETTER:
- case Character.UPPERCASE_LETTER:
- case Character.TITLECASE_LETTER:
- case Character.MODIFIER_LETTER:
- case Character.OTHER_LETTER: {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Indicates whether a given Unicode code point is a word break character.
- * @param c The codepoint to be tested.
- * @return True if and only if {@code c} is a word break character.
- */
- public static boolean isWordBreakChar(final int c) {
- switch(c) {
- case ' ': return true;
- case '\r': return true;
- case '\n': return true;
- case '\t': return true;
- }
- return false;
- }
-
- /**
- * Finds the index of the first letter in a character sequence.
- * @param chars The character sequence to be tested.
- * @return The index to the first letter in {@code chars}, or -1 if no lettes is found.
- */
- public static int firstLetter(final CharSequence chars) {
- for (int index = 0; index < chars.length(); index ++) {
- final char c = chars.charAt(index);
- if (isLetter(c)) {
- return index;
- }
- }
- return -1;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/FloatUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,63 +0,0 @@
-/*
- * Copyright 2021 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-/**
- * Utilities for the {@link java.lang.Float} and {@link java.lang.Float#TYPE}.
- */
-public final class FloatUtils {
-
- /**
- * Private constructor. This is a utility class, and should never be instantiated.
- */
- private FloatUtils() { }
-
- /**
- * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Integer#TYPE} without losing
- * any data.
- * @param input The value to be tested.
- * @return True if and only if the float can be cast to {@link java.lang.Integer#TYPE} with no loss of data.
- */
- public static boolean isInteger(final float input) {
- final int asInt = (int) input;
- return asInt == input;
- }
-
- /**
- * Indicates whether a given {@link java.lang.Float#TYPE} can cast to {@link java.lang.Short#TYPE} without losing
- * any data.
- * @param input The value to be tested.
- * @return True if and only if the float can be cast to {@link java.lang.Short#TYPE} with no loss of data.
- */
- public static boolean isShort(final float input) {
- final short asShort = (short) input;
- return asShort == input;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/NumberUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/NumberUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/NumberUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2008 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Utility class for numeric computations not handled in standard classes.
- */
-public final class NumberUtils {
-
- /** Regex pattern for detecting and parsing string representation of an integer array. */
- private static final Pattern INT_ARRAY_PATTERN = Pattern.compile("^\\[\\s*[0-9]+(\\s*,\\s*[0-9]+)*\\s*\\]$");
-
- /**
- * Private Constructor. This class is a utility class and should never be instantiated.
- */
- private NumberUtils() { }
-
- /**
- * Indicates whether the input value is odd.
- * @param input the value to be tested.
- * @return True if {@code input} is odd, false if it is even.
- */
- public static boolean isOdd(final long input) {
- /* See the book "Java Puzzlers", Puzzle 1, for an explanation of this logic. */
- return (input & 1) != 0;
- }
-
- /**
- * Indicates whether a given sequence of characters could be parsed as an Arabic number, for example "1234" or
- * "3.14159" or "-28".
- * @param sequence The sequence containing the codepoints to be tested.
- * @param start The first index to be tested.
- * @param end The index after the last index to be tested.
- * @return True if and only if the characters tested are all Arabic number characters.
- */
- public static boolean isArabicNumber(final CharSequence sequence, final int start, final int end) {
- int digitCount = 0;
- for (int index = start; index < end; index ++) {
- final char c = sequence.charAt(index);
- if (! CharacterUtils.isArabicNumeral(c)) {
- return false;
- }
- if (CharacterUtils.isArabicDigit(c)) {
- digitCount ++;
- }
- }
-
- /* In addition to being all valid characters, at least one of them must be an Arabic digit. */
- return digitCount > 0;
- }
-
- /**
- * Converts a string representation of an integer array into an int[].
- * @param chars A string representation of an integer array.
- * Example 1: "[3,13,39]".
- * Example 2: "[ 3, 13, 39 ]".
- * @return The integer array for the input chars, or null if that chars to do not match an int array pattern.
- */
- public static int[] intArrayFromString(final CharSequence chars) {
- final Matcher matcher = INT_ARRAY_PATTERN.matcher(chars);
- if (! matcher.matches()) {
- return null;
- }
- final String[] strings = chars.toString()
- .replace("[", StringUtils.EMPTY_STRING)
- .replaceAll("]", StringUtils.EMPTY_STRING)
- .replaceAll(" ", "")
- .split(",");
- final int[] returnValue = new int[strings.length];
- for (int index = 0; index < strings.length; index ++) {
- final int element = Integer.parseInt(strings[index]);
- returnValue[index] = element;
- }
- return returnValue;
- }
-
-}
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2022-12-12 00:22:47 UTC (rev 12836)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2022-12-12 01:06:44 UTC (rev 12837)
@@ -1,487 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import org.axsl.constants.PrimitiveConstants;
-
-/**
- * Utility class containing methods that are useful for manipulating or managing
- * strings.
- */
-public final class StringUtils {
-
- /** An empty string suitable for String comparisons or initializations. */
- public static final String EMPTY_STRING = "";
-
- /** A single space. */
- public static final String SINGLE_SPACE = " ";
-
- /** A static capture of the system line separator. */
- public static final String LINE_SEPARATOR = System.getProperty("line.separator");
-
- /** The null terminator character, used to mark the end of Strings in char arrays in some
- * applications, U+0000. */
- public static final char NULL_TERMINATOR = 0;
-
- /** The array of valid hexadecimal digits. */
- public static final char[] HEXADECIMAL_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-
- /** The lowest integer value that cannot be expressed with one base-10
- * digit. */
- private static final int FIRST_HEX_NOT_DECIMAL = 10;
-
- /**
- * Private constructor (should never be instantiated).
- */
- private StringUtils() { }
-
- /**
- * Reports whether an input character is a valid hexadecimal character.
- * Valid hex characters are 0-9, A-F, and a-f.
- * @param input The character to be tested.
- * @return True if and only if the character is a valid hexadecimal character.
- */
- public static boolean isASCIIHex(final int input) {
- // "0" thru "9"
- if (input >= '0'
- && input <= '9') {
- return true;
- }
- // "A" thru "F"
- if (input >= 'A'
- && input <= 'F') {
- return true;
- }
- // "a" thru "f"
- if (input >= 'a'
- && input <= 'f') {
- return true;
- }
- return false;
- }
-
- /**
- * Converts two bytes, each of which must be valid ASCII hex (0-9, A-F,
- * a-f) into the byte that those ASCII characters represent. For example,
- * the bytes "5" (0x35) and "9" (0x39) should be converted into a "Y"
- * (0x59).
- * @param byte1 The high-order byte to be converted.
- * @param byte2 The low-order byte to be converted.
- * @return The byte containing the hex value of the 2 input bytes, or -1 if
- * the input is valid.
- */
- public static byte asciiHexBytesToHex(final byte byte1, final byte byte2) {
- if (! isASCIIHex(byte1)) {
- return -1;
- }
- if (! isASCIIHex(byte2)) {
- return -1;
- }
- // Convert the high-order byte and shift it into the high position.
- final byte convert1 = (byte) (asciiHexByteToHex(byte1)
- << PrimitiveConstants.BITS_PER_NIBBLE);
- // Convert the low-order byte.
- final byte convert2 = asciiHexByteToHex(byte2);
- // "Or" the two half-bytes together and return it.
- return (byte) (convert1 | convert2);
- }
-
- /**
- * Converts one ASCII Hex byte (0-9, A-F, a-f) to the hexadecimal byte that
- * it represents.
- * @param inputByte The ASCII Hex byte to convert.
- * @return The hex equivalent of inputByte.
- */
- public static byte asciiHexByteToHex(final byte inputByte) {
- if (inputByte >= '0'
- && inputByte <= '9') {
- return (byte) (inputByte - '0');
- }
- if (inputByte >= 'A'
- && inputByte <= 'F') {
- return (byte) (inputByte - 'A' + StringUtils.FIRST_HEX_NOT_DECIMAL);
- }
- if (inputByte >= 'a'
- && inputByte <= 'f') {
- return (byte) (inputByte - 'a' + StringUtils.FIRST_HEX_NOT_DECIMAL);
- }
- return 0;
- }
-
- /**
- * Returns a String representing a character's hex value. For example,
- * using the character "Y" (U+0059) as input should return "59", and using
- * "m" (U+006D) as input should return "6D".
- * @param c The character to be converted.
- * @param upperCase Set to true if the a-f hex characters should be
- * converted to uppercase.
- * @param minimumSize The minimum size of the return String. The return
- * value will be padded with sufficient "0" characters at the beginning to
- * ensure this size.
- * @return The String representing c's hex value.
- */
- public static String charToHexString(final char c, final boolean upperCase,
- final int minimumSize) {
- String returnString = Integer.toHexString(c);
- if (upperCase) {
- returnString.toUpperCase();
- }
- int bytesToPad = minimumSize - returnString.length();
- while (bytesToPad > 0) {
- returnString = "0" + returnString;
- bytesToPad --;
- }
- return returnString;
- }
-
- /**
- * Returns a String representing a character's octal value. For example,
- * using the character "Y" (U+0059) as input should return "131", and using
- * "m" (U+006D) as input should return "155".
- * @param c The character to be converted.
- * @param minimumSize The minimum size of the return String. The return
- * value will be padded with sufficient "0" characters at the beginning to
- * ensure this size.
- * @return The String representing c's octal value.
- */
- public static String charToOctalString(final char c,
- final int minimumSize) {
- String returnString = Integer.toOctalString(c);
- int bytesToPad = minimumSize - returnString.length();
- while (bytesToPad > 0) {
- returnString = "0" + returnString;
- bytesToPad --;
- }
- return returnString;
- }
-
- /**
- * Adds linefeeds to the co...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-12 00:22:49
|
Revision: 12836
http://sourceforge.net/p/foray/code/12836
Author: victormote
Date: 2022-12-12 00:22:47 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Store only the Charset names instead of the Charset instances, to avoid the cost of creating and retaining them unnecessarily.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -295,7 +295,7 @@
@Override
public String readStringASCII(final int stringSize) throws IOException {
- return readString(stringSize, CharsetConstants.CHARSET_US_ASCII);
+ return readString(stringSize, Charset.forName(CharsetConstants.CHARSET_US_ASCII_NAME));
}
@Override
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -33,6 +33,7 @@
import org.axsl.constants.CharsetConstants;
import java.io.IOException;
+import java.nio.charset.Charset;
/**
* A TrueType or OpenType Offset Table Record.
@@ -81,7 +82,7 @@
throws IOException {
final TtfOffsetTableRecord entry = new TtfOffsetTableRecord(directory);
/* Read the 4-byte table identifier. */
- entry.tag = raInput.readString(TtfTable.ULONG_BYTES, CharsetConstants.CHARSET_ISO_8859_1);
+ entry.tag = raInput.readString(TtfTable.ULONG_BYTES, Charset.forName(CharsetConstants.CHARSET_ISO_8859_1_NAME));
/* Skip the checkSum. */
raInput.skipBytes(TtfTable.ULONG_BYTES);
/* Read the offset to the table. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -452,13 +452,13 @@
* section, name strings for the Microsoft platform require two bytes
* per character. */
if (platformID == TtfTableName.PLATFORM_MICROSOFT) {
- return CharsetConstants.CHARSET_UTF_16BE;
+ return Charset.forName(CharsetConstants.CHARSET_UTF_16BE_NAME);
}
/* Per the TrueType Font File Specification, in the "name" table
* section, Macintosh fonts require single-byte strings. Also, this is
* the best known default. */
- return CharsetConstants.CHARSET_ISO_8859_1;
+ return Charset.forName(CharsetConstants.CHARSET_ISO_8859_1_NAME);
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -36,6 +36,7 @@
import java.io.IOException;
import java.math.BigDecimal;
+import java.nio.charset.Charset;
/**
* Class representing a TTF "post" (PostScript) table.
@@ -157,7 +158,8 @@
post.glyphNames = new String[numGlyphStrings];
for (int i = 0; i < post.glyphNames.length; i++) {
final int length = raInput.readUnsignedByte();
- post.glyphNames[i] = raInput.readString(length, CharsetConstants.CHARSET_ISO_8859_1);
+ post.glyphNames[i] = raInput.readString(length,
+ Charset.forName(CharsetConstants.CHARSET_ISO_8859_1_NAME));
}
break;
case TtfTablePost.PS_FORMAT_3:
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -39,6 +39,7 @@
import org.axsl.ps.PsServer;
import java.io.IOException;
+import java.nio.charset.Charset;
/**
* Parses an Postscript Font Metrics (PFM) file into an instance of {@link Type1Metrics}.
@@ -219,7 +220,8 @@
this.input.seek(faceOffset);
- this.metrics.setFontFamilyName(this.input.readNullTerminatedString(CharsetConstants.CHARSET_ISO_8859_1));
+ this.metrics.setFontFamilyName(this.input.readNullTerminatedString(
+ Charset.forName(CharsetConstants.CHARSET_ISO_8859_1_NAME)));
}
/**
@@ -244,7 +246,8 @@
}
this.input.seek(driverInfoOffset);
- this.metrics.setPostscriptName(this.input.readNullTerminatedString(CharsetConstants.CHARSET_ISO_8859_1));
+ this.metrics.setPostscriptName(this.input.readNullTerminatedString(
+ Charset.forName(CharsetConstants.CHARSET_ISO_8859_1_NAME)));
if (extMetricsOffset != 0) {
this.input.seek(extMetricsOffset);
Modified: trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
===================================================================
--- trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java 2022-12-12 00:05:24 UTC (rev 12835)
+++ trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java 2022-12-12 00:22:47 UTC (rev 12836)
@@ -152,7 +152,7 @@
@Override
public String readStringASCII(final int stringSize) throws IOException {
- return readString(stringSize, CharsetConstants.CHARSET_US_ASCII);
+ return readString(stringSize, Charset.forName(CharsetConstants.CHARSET_US_ASCII_NAME));
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-12 00:05:26
|
Revision: 12835
http://sourceforge.net/p/foray/code/12835
Author: victormote
Date: 2022-12-12 00:05:24 +0000 (Mon, 12 Dec 2022)
Log Message:
-----------
Remove a dependency on non-sequence code from the sequence code.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -45,7 +45,7 @@
*
* Note that many of the methods in this class were adapted from {@link java.lang.String}.
*/
-public abstract class AbstractByteSequence implements ByteSequencePlus {
+public abstract class AbstractByteSequence extends AbstractSequence implements ByteSequencePlus {
/** Constant needed for serialization. */
private static final long serialVersionUID = -1357351215576051840L;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -36,7 +36,7 @@
/**
* Abstract superclass for implementations of {@link CharSequencePlus}.
*/
-public abstract class AbstractCharSequence implements CharSequencePlus {
+public abstract class AbstractCharSequence extends AbstractSequence implements CharSequencePlus {
/** Constant needed for serialization. */
private static final long serialVersionUID = -1486986783061908158L;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -36,7 +36,7 @@
/**
* Abstract superclass for implementations of {@link IntSequencePlus}.
*/
-public abstract class AbstractIntSequence implements IntSequencePlus {
+public abstract class AbstractIntSequence extends AbstractSequence implements IntSequencePlus {
/** Constant needed for serialization. */
private static final long serialVersionUID = 6308504447450398044L;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -36,7 +36,7 @@
/**
* Abstract superclass for implementations of {@link LongSequencePlus}.
*/
-public abstract class AbstractLongSequence implements LongSequencePlus {
+public abstract class AbstractLongSequence extends AbstractSequence implements LongSequencePlus {
/** Constant needed for serialization. */
private static final long serialVersionUID = -4561491878925977191L;
Added: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2022 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.common.sequence;
+
+/**
+ * Common code for sequences.
+ */
+public class AbstractSequence {
+
+ /** The template for the message for this exception. */
+ private static final String FORMAT = "Index = %d, Size = %d";
+
+ /**
+ * Always throws an IndexOutOfBoundsException with a helpful message.
+ * @param offendingIndex The index value that is out-of-bounds.
+ * @param sizeOfOffendedItem The size of the indexed object whose range was violated.
+ */
+ public void throwIndexOutOfBoundsException(final int offendingIndex, final int sizeOfOffendedItem) {
+ final String message = String.format(FORMAT, offendingIndex, sizeOfOffendedItem);
+ throw new IndexOutOfBoundsException(message);
+ }
+
+}
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractSequence.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -36,7 +36,7 @@
/**
* Abstract superclass for implementations of {@link ShortSequencePlus}.
*/
-public abstract class AbstractShortSequence implements ShortSequencePlus {
+public abstract class AbstractShortSequence extends AbstractSequence implements ShortSequencePlus {
/** Constant needed for serialization. */
private static final long serialVersionUID = 2366533487441850922L;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -33,8 +33,6 @@
package org.foray.common.sequence;
-import org.foray.common.MarkedIndexOutOfBoundsException;
-
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequenceMutable;
@@ -333,7 +331,7 @@
@Override
public byte byteAt(final int index) {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
return this.backingArray[index];
}
@@ -375,7 +373,7 @@
@Override
public void setLength(final int newLength) {
if (newLength < 0) {
- throw new MarkedIndexOutOfBoundsException(newLength, this.length);
+ throwIndexOutOfBoundsException(newLength, this.length);
}
ensureCapacityInternal(newLength);
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -28,8 +28,6 @@
package org.foray.common.sequence;
-import org.foray.common.MarkedIndexOutOfBoundsException;
-
import org.axsl.primitive.sequence.CharSequenceMutable;
import java.util.Arrays;
@@ -219,7 +217,7 @@
@Override
public void setLength(final int newLength) {
if (newLength < 0) {
- throw new MarkedIndexOutOfBoundsException(newLength, this.length);
+ throwIndexOutOfBoundsException(newLength, this.length);
}
ensureCapacityInternal(newLength);
@@ -266,7 +264,7 @@
@Override
public char charAt(final int index) {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
return this.backingArray[index];
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -28,8 +28,6 @@
package org.foray.common.sequence;
-import org.foray.common.MarkedIndexOutOfBoundsException;
-
import org.axsl.primitive.sequence.IntSequence;
import org.axsl.primitive.sequence.IntSequenceMutable;
@@ -81,7 +79,7 @@
@Override
public int intAt(final int index) {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
return this.backingArray[index];
}
@@ -89,10 +87,10 @@
@Override
public IntSequence subSequence(final int start, final int end) {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
if (end > this.length) {
- throw new MarkedIndexOutOfBoundsException(end, this.length);
+ throwIndexOutOfBoundsException(end, this.length);
}
if (start > end) {
throw new IllegalArgumentException("start " + start + " exceeds end " + end);
@@ -183,7 +181,7 @@
@Override
public void setLength(final int newLength) {
if (newLength < 0) {
- throw new MarkedIndexOutOfBoundsException(newLength, this.length);
+ throwIndexOutOfBoundsException(newLength, this.length);
}
ensureCapacity(newLength);
if (newLength > this.length) {
@@ -275,7 +273,7 @@
*/
public IntArrayBuilder deleteIntAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
System.arraycopy(this.backingArray, index + 1, this.backingArray, index, this.length - index - 1);
this.length--;
@@ -295,7 +293,7 @@
*/
public IntArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
int adjustedEnd = end;
if (end > this.length) {
@@ -302,7 +300,7 @@
adjustedEnd = this.length;
}
if (start > adjustedEnd) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
final int len = adjustedEnd - start;
if (len > 0) {
@@ -366,7 +364,7 @@
public void insert(final int index, final int newInt) {
if (index < 0
|| index > length()) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
ensureCapacity(length() + 1);
System.arraycopy(this.backingArray, index, this.backingArray, index + 1, this.length - index);
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -28,8 +28,6 @@
package org.foray.common.sequence;
-import org.foray.common.MarkedIndexOutOfBoundsException;
-
import org.axsl.primitive.sequence.LongPrimitiveIterator;
import org.axsl.primitive.sequence.LongSequence;
import org.axsl.primitive.sequence.LongSequenceMutable;
@@ -83,7 +81,7 @@
@Override
public long longAt(final int index) {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
return this.backingArray[index];
}
@@ -91,10 +89,10 @@
@Override
public LongSequence subSequence(final int start, final int end) {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
if (end > this.length) {
- throw new MarkedIndexOutOfBoundsException(end, this.length);
+ throwIndexOutOfBoundsException(end, this.length);
}
if (start > end) {
throw new StringIndexOutOfBoundsException("Index out of range: " + (end - start));
@@ -219,7 +217,7 @@
*/
public LongArrayBuilder deleteLongAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
System.arraycopy(this.backingArray, index + 1, this.backingArray, index, this.length - index - 1);
this.length--;
@@ -239,7 +237,7 @@
*/
public LongArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
int adjustedEnd = end;
if (end > this.length) {
@@ -246,7 +244,7 @@
adjustedEnd = this.length;
}
if (start > adjustedEnd) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
final int len = adjustedEnd - start;
if (len > 0) {
@@ -307,7 +305,7 @@
@Override
public void setLength(final int newLength) {
if (newLength < 0) {
- throw new MarkedIndexOutOfBoundsException(newLength, this.length);
+ throwIndexOutOfBoundsException(newLength, this.length);
}
ensureCapacity(newLength);
if (newLength > this.length) {
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java 2022-12-11 23:45:50 UTC (rev 12834)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java 2022-12-12 00:05:24 UTC (rev 12835)
@@ -28,8 +28,6 @@
package org.foray.common.sequence;
-import org.foray.common.MarkedIndexOutOfBoundsException;
-
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.primitive.sequence.ShortSequenceMutable;
@@ -81,7 +79,7 @@
@Override
public short shortAt(final int index) {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
return this.backingArray[index];
}
@@ -89,10 +87,10 @@
@Override
public ShortSequence subSequence(final int start, final int end) {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
if (end > this.length) {
- throw new MarkedIndexOutOfBoundsException(end, this.length);
+ throwIndexOutOfBoundsException(end, this.length);
}
if (start > end) {
throw new StringIndexOutOfBoundsException("Index out of range: " + (end - start));
@@ -200,7 +198,7 @@
*/
public ShortArrayBuilder deleteShortAt(final int index) throws IndexOutOfBoundsException {
if ((index < 0) || (index >= this.length)) {
- throw new MarkedIndexOutOfBoundsException(index, this.length);
+ throwIndexOutOfBoundsException(index, this.length);
}
System.arraycopy(this.backingArray, index + 1, this.backingArray, index, this.length - index - 1);
this.length--;
@@ -220,7 +218,7 @@
*/
public ShortArrayBuilder delete(final int start, final int end) throws IndexOutOfBoundsException {
if (start < 0) {
- throw new MarkedIndexOutOfBoundsException(start, this.length);
+ throwIndexOutOfBoundsException(start, this.length);
}
int adjustedEnd = end;
if (end > this.length) {
@@ -273,7 +271,7 @@
@Override
public void setLength(final int newLength) {
if (newLength < 0) {
- throw new MarkedIndexOutOfBoundsException(newLength, this.length);
+ throwIndexOutOfBoundsException(newLength, this.length);
}
ensureCapacity(newLength);
if (newLength > this.length) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 23:45:52
|
Revision: 12834
http://sourceforge.net/p/foray/code/12834
Author: victormote
Date: 2022-12-11 23:45:50 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL changes: Move charset-related constants to aXSL.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
Removed Paths:
-------------
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharsetUtils.java
Deleted: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharsetUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharsetUtils.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharsetUtils.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -1,78 +0,0 @@
-/*
- * Copyright 2016 The FOray Project.
- * http://www.foray.org
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
- * $LastChangedRevision$
- * $LastChangedDate$
- * $LastChangedBy$
- */
-
-package org.foray.common.primitive;
-
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Utilities related to Charsets.
- */
-public final class CharsetUtils {
-
- /** Constant indicating the U.S. ASCII character set. */
- public static final Charset CHARSET_US_ASCII = Charset.forName("US-ASCII");
-
- /** Constant indicating the ISO-8859-1 character set. */
- public static final Charset CHARSET_ISO_8859_1 = Charset.forName("ISO-8859-1");
-
- /** Constant indicating the UTF-8 character set. */
- public static final Charset CHARSET_UTF_8 = Charset.forName("UTF-8");
-
- /** Constant indicating the UTF-16, big-endian character set. */
- public static final Charset CHARSET_UTF_16BE = Charset.forName("UTF-16BE");
-
- /** Constant indicating the UTF-16, little-endian character set. */
- public static final Charset CHARSET_UTF_16LE = Charset.forName("UTF-16LE");
-
- /** Constant indicating the UTF-16 character set. */
- public static final Charset CHARSET_UTF_16 = Charset.forName("UTF-16");
-
- /**
- * The list of standard Java character sets.
- * @see "http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html"
- */
- private static final List<Charset> SUPPORTED_CHAR_ENCODINGS = new ArrayList<Charset>();
- static {
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_US_ASCII);
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_ISO_8859_1);
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_UTF_8);
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_UTF_16BE);
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_UTF_16LE);
- SUPPORTED_CHAR_ENCODINGS.add(CHARSET_UTF_16);
- };
-
- /**
- * Private constructor. This is a utility class and should never be instantiated.
- */
- private CharsetUtils() {
- }
-
-}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,8 +29,8 @@
package org.foray.common.sequence;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
+import org.axsl.constants.CharsetConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequencePlus;
@@ -295,7 +295,7 @@
@Override
public String readStringASCII(final int stringSize) throws IOException {
- return readString(stringSize, CharsetUtils.CHARSET_US_ASCII);
+ return readString(stringSize, CharsetConstants.CHARSET_US_ASCII);
}
@Override
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfOffsetTableRecord.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,8 +29,9 @@
package org.foray.font.format.ttf;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
+import org.axsl.constants.CharsetConstants;
+
import java.io.IOException;
/**
@@ -80,7 +81,7 @@
throws IOException {
final TtfOffsetTableRecord entry = new TtfOffsetTableRecord(directory);
/* Read the 4-byte table identifier. */
- entry.tag = raInput.readString(TtfTable.ULONG_BYTES, CharsetUtils.CHARSET_ISO_8859_1);
+ entry.tag = raInput.readString(TtfTable.ULONG_BYTES, CharsetConstants.CHARSET_ISO_8859_1);
/* Skip the checkSum. */
raInput.skipBytes(TtfTable.ULONG_BYTES);
/* Read the offset to the table. */
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableName.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,9 +29,10 @@
package org.foray.font.format.ttf;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
import org.foray.common.primitive.StringUtils;
+import org.axsl.constants.CharsetConstants;
+
import java.io.IOException;
import java.nio.charset.Charset;
@@ -451,13 +452,13 @@
* section, name strings for the Microsoft platform require two bytes
* per character. */
if (platformID == TtfTableName.PLATFORM_MICROSOFT) {
- return CharsetUtils.CHARSET_UTF_16BE;
+ return CharsetConstants.CHARSET_UTF_16BE;
}
/* Per the TrueType Font File Specification, in the "name" table
* section, Macintosh fonts require single-byte strings. Also, this is
* the best known default. */
- return CharsetUtils.CHARSET_ISO_8859_1;
+ return CharsetConstants.CHARSET_ISO_8859_1;
}
/**
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTablePost.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,8 +29,8 @@
package org.foray.font.format.ttf;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
+import org.axsl.constants.CharsetConstants;
import org.axsl.ps.PsEncoding;
import org.axsl.ps.PsServer;
@@ -157,7 +157,7 @@
post.glyphNames = new String[numGlyphStrings];
for (int i = 0; i < post.glyphNames.length; i++) {
final int length = raInput.readUnsignedByte();
- post.glyphNames[i] = raInput.readString(length, CharsetUtils.CHARSET_ISO_8859_1);
+ post.glyphNames[i] = raInput.readString(length, CharsetConstants.CHARSET_ISO_8859_1);
}
break;
case TtfTablePost.PS_FORMAT_3:
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,10 +29,10 @@
package org.foray.font.format.type1;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
+import org.axsl.constants.CharsetConstants;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.ps.CharSet;
import org.axsl.ps.PsEncoding;
@@ -219,7 +219,7 @@
this.input.seek(faceOffset);
- this.metrics.setFontFamilyName(this.input.readNullTerminatedString(CharsetUtils.CHARSET_ISO_8859_1));
+ this.metrics.setFontFamilyName(this.input.readNullTerminatedString(CharsetConstants.CHARSET_ISO_8859_1));
}
/**
@@ -244,7 +244,7 @@
}
this.input.seek(driverInfoOffset);
- this.metrics.setPostscriptName(this.input.readNullTerminatedString(CharsetUtils.CHARSET_ISO_8859_1));
+ this.metrics.setPostscriptName(this.input.readNullTerminatedString(CharsetConstants.CHARSET_ISO_8859_1));
if (extMetricsOffset != 0) {
this.input.seek(extMetricsOffset);
Modified: trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
===================================================================
--- trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java 2022-12-11 21:04:12 UTC (rev 12833)
+++ trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java 2022-12-11 23:45:50 UTC (rev 12834)
@@ -29,10 +29,10 @@
package org.foray.common.io;
import org.foray.common.RandomAccessInput;
-import org.foray.common.primitive.CharsetUtils;
import org.foray.common.sequence.ByteArrayBuilder;
import org.foray.common.sequence.ByteSequenceParser;
+import org.axsl.constants.CharsetConstants;
import org.axsl.constants.PrimitiveConstants;
import org.apache.commons.io.EndianUtils;
@@ -152,7 +152,7 @@
@Override
public String readStringASCII(final int stringSize) throws IOException {
- return readString(stringSize, CharsetUtils.CHARSET_US_ASCII);
+ return readString(stringSize, CharsetConstants.CHARSET_US_ASCII);
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 21:04:17
|
Revision: 12833
http://sourceforge.net/p/foray/code/12833
Author: victormote
Date: 2022-12-11 21:04:12 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Move some (implementation) well-known constants to aXSL PrimitiveConstants, for greater visibility.
Modified Paths:
--------------
trunk/foray/foray-common/build.gradle
trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
trunk/foray/foray-content/build.gradle
trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfSubSetFile.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgb.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgbIcc.java
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PsGraphics2D.java
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/zzarchive/PatGen.java
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfToUnicodeCmap.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/util/PdfGraphics2D.java
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInterpreter4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsSystemDict4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/GlyphListParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/Ascii85EncodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/AsciiHexEncodeFilter.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/filter/EexecDecodeFilter.java
trunk/foray/foray-render/build.gradle
trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/xml/XmlRenderer.java
trunk/foray/foray-zz-attic/build.gradle
trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/AbstractRandomAccessInput.java
trunk/foray/foray-zz-attic/src/main/java/org/foray/common/io/RandomAccessInputArray.java
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/build.gradle 2022-12-11 21:04:12 UTC (rev 12833)
@@ -11,6 +11,7 @@
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
api (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/WellKnownConstants.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -30,6 +30,7 @@
import org.foray.common.sequence.ByteArray;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.FontConstants;
import org.axsl.unicode.block.Basic_Latin_Block;
@@ -38,62 +39,6 @@
*/
public final class WellKnownConstants {
- /** The maximum unsigned 8-bit value, cast as a byte. */
- public static final byte MAX_8_BIT_UNSIGNED_BYTE = (byte) 0xFF;
-
- /** The maximum unsigned 8-bit value, cast as an int, that is 255 or
- * 0xFF. */
- public static final int MAX_8_BIT_UNSIGNED_INT = 0xFF;
-
- /** The maximum 4-bit value, cast as a byte, that is 0xF. */
- public static final byte MAX_4_BIT_UNSIGNED_BYTE = (byte) 0xF;
-
- /** The maximum unsigned 32-bit value, cast as an int. */
- public static final int MAX_32_BIT_UNSIGNED_INT = 0xFFFFFFFF;
-
- /** The maximum number of values that can be stored in 4 bits, that is,
- * 16. */
- public static final byte MAX_4_BIT_UNSIGNED_VALUES = 16;
-
- /** The maximum number of values that can be stored in 8 bits, that is, 256. */
- public static final short MAX_8_BIT_UNSIGNED_VALUES = 256;
-
- /** The maximum number of values that can be stored in 7 unsigned bits, which is {@value}. */
- public static final short MAX_7_BIT_UNSIGNED_VALUES = 128;
-
- /** The maximum value that can be stored in 7 unsigned bits, which is {@value}. */
- public static final short MAX_7_BIT_UNSIGNED_VALUE = 127;
-
- /** The maximum number of values that can be stored in 16 bits, that is, 65,536. */
- public static final int MAX_16_BIT_UNSIGNED_VALUES = 65536;
-
- /** The number of bytes in a long, that is, 8. */
- public static final byte BYTES_PER_LONG = 8;
-
- /** The number of bytes in an int, that is, 4. */
- public static final byte BYTES_PER_INT = 4;
-
- /** The number of bytes in a short, that is, 2. */
- public static final byte BYTES_PER_SHORT = 2;
-
- /** The number of bits in a byte, that is, 8. */
- public static final byte BITS_PER_BYTE = 8;
-
- /** The number of bits in a nibble, that is, 4. */
- public static final byte BITS_PER_NIBBLE = 4;
-
- /** The number of bits to shift for a one-byte shift. */
- public static final byte SHIFT_1_BYTE = WellKnownConstants.BITS_PER_BYTE * 1;
-
- /** The number of bits to shift for a two-byte shift. */
- public static final byte SHIFT_2_BYTES = WellKnownConstants.BITS_PER_BYTE * 2;
-
- /** The number of bits to shift for a three-byte shift. */
- public static final byte SHIFT_3_BYTES = WellKnownConstants.BITS_PER_BYTE * 3;
-
- /** The number of bits to shift for a four-byte shift. */
- public static final byte SHIFT_4_BYTES = WellKnownConstants.BITS_PER_BYTE * 4;
-
/** The number of centimeters per inch. */
public static final float CM_PER_INCH = (float) 2.54;
@@ -185,9 +130,9 @@
final int int2 = unsignedByteToInt(byte2);
final int int3 = unsignedByteToInt(byte3);
final int int4 = unsignedByteToInt(byte4);
- return (int1 << WellKnownConstants.SHIFT_3_BYTES)
- | (int2 << WellKnownConstants.SHIFT_2_BYTES)
- | (int3 << WellKnownConstants.SHIFT_1_BYTE)
+ return (int1 << PrimitiveConstants.SHIFT_3_BYTES)
+ | (int2 << PrimitiveConstants.SHIFT_2_BYTES)
+ | (int3 << PrimitiveConstants.SHIFT_1_BYTE)
| int4;
}
@@ -197,7 +142,7 @@
* @return The integer equivalent of {@code unsignedByte}.
*/
public static int unsignedByteToInt(final byte unsignedByte) {
- final int converted = unsignedByte & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ final int converted = unsignedByte & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
return converted;
}
@@ -215,7 +160,7 @@
final int start) {
if (byteArray == null
|| start < 0
- || start + WellKnownConstants.BYTES_PER_INT > byteArray.length) {
+ || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
/* Fails silently. */
return 0;
}
@@ -242,11 +187,11 @@
final int start) {
if (byteArray == null
|| start < 0
- || start + WellKnownConstants.BYTES_PER_INT > byteArray.length) {
+ || start + PrimitiveConstants.BYTES_PER_INT > byteArray.length) {
/* Fails silently. */
return 0;
}
- int index = start + WellKnownConstants.BYTES_PER_INT - 1;
+ int index = start + PrimitiveConstants.BYTES_PER_INT - 1;
return unsignedBytesToLong(
byteArray[index--],
byteArray[index--],
@@ -278,7 +223,7 @@
final int start) {
if (byteArray == null
|| start < 0
- || start + WellKnownConstants.BYTES_PER_SHORT > byteArray.length) {
+ || start + PrimitiveConstants.BYTES_PER_SHORT > byteArray.length) {
/* Fails silently. */
return 0;
}
@@ -304,11 +249,11 @@
final int start) {
if (byteArray == null
|| start < 0
- || start + WellKnownConstants.BYTES_PER_SHORT > byteArray.length) {
+ || start + PrimitiveConstants.BYTES_PER_SHORT > byteArray.length) {
/* Fails silently. */
return 0;
}
- int index = start + WellKnownConstants.BYTES_PER_SHORT - 1;
+ int index = start + PrimitiveConstants.BYTES_PER_SHORT - 1;
return (int) unsignedBytesToLong(
(byte) 0,
(byte) 0,
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/ByteUtils.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,9 +28,10 @@
package org.foray.common.primitive;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.constants.PrimitiveConstants;
+
/**
* Utilities for bytes.
*/
@@ -71,7 +72,7 @@
* @return The byte represented by the two characters.
*/
public static byte fromHexChars(final CharSequence chars, final int start) {
- final int highNibble = asNibble(chars.charAt(start)) << WellKnownConstants.BITS_PER_NIBBLE;
+ final int highNibble = asNibble(chars.charAt(start)) << PrimitiveConstants.BITS_PER_NIBBLE;
final int lowNibble = asNibble(chars.charAt(start + 1));
return (byte) (highNibble | lowNibble);
}
@@ -93,7 +94,7 @@
final char highOrderChar = (char) highOrderByte;
final char lowOrderChar = (char) lowOrderByte;
- final int highNibble = asNibble(highOrderChar) << WellKnownConstants.BITS_PER_NIBBLE;
+ final int highNibble = asNibble(highOrderChar) << PrimitiveConstants.BITS_PER_NIBBLE;
final int lowNibble = asNibble(lowOrderChar);
return (byte) (highNibble | lowNibble);
}
@@ -105,8 +106,8 @@
* @return The ASCII byte representing the value of the high-order nibble of {@code inputByte}.
*/
public static byte toHexCharHigh(final byte inputByte) {
- byte index = (byte) (inputByte >>> WellKnownConstants.BITS_PER_NIBBLE);
- index &= WellKnownConstants.MAX_4_BIT_UNSIGNED_BYTE;
+ byte index = (byte) (inputByte >>> PrimitiveConstants.BITS_PER_NIBBLE);
+ index &= PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE;
return HEX_CHARS.byteAt(index);
}
@@ -117,7 +118,7 @@
* @return The ASCII byte representing the value of the low-order nibble of {@code inputByte}.
*/
public static byte toHexCharLow(final byte inputByte) {
- final byte index = (byte) (inputByte & WellKnownConstants.MAX_4_BIT_UNSIGNED_BYTE);
+ final byte index = (byte) (inputByte & PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE);
return HEX_CHARS.byteAt(index);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/CharacterUtils.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,8 +28,7 @@
package org.foray.common.primitive;
-import org.foray.common.WellKnownConstants;
-
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.unicode.block.Arabic_Presentation_Forms_B_Block;
import org.axsl.unicode.block.Basic_Latin_Block;
import org.axsl.unicode.block.CJK_Symbols_and_Punctuation_Block;
@@ -207,7 +206,7 @@
* @return The char with the same bits as {@code theByte}.
*/
public static char fromByte(final byte theByte) {
- return (char) (WellKnownConstants.MAX_8_BIT_UNSIGNED_INT & theByte);
+ return (char) (PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT & theByte);
}
/**
@@ -232,7 +231,7 @@
* @return The high-order byte.
*/
public static byte asHighOrderByte(final char theChar) {
- return (byte) (theChar >>> WellKnownConstants.BITS_PER_BYTE);
+ return (byte) (theChar >>> PrimitiveConstants.BITS_PER_BYTE);
}
/**
@@ -241,7 +240,7 @@
* @return The low-order byte.
*/
public static byte asLowOrderByte(final char theChar) {
- return (byte) (theChar & WellKnownConstants.MAX_8_BIT_UNSIGNED_BYTE);
+ return (byte) (theChar & PrimitiveConstants.MAX_8_BIT_UNSIGNED_BYTE);
}
/**
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/StringUtils.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,7 +28,7 @@
package org.foray.common.primitive;
-import org.foray.common.WellKnownConstants;
+import org.axsl.constants.PrimitiveConstants;
/**
* Utility class containing methods that are useful for manipulating or managing
@@ -106,7 +106,7 @@
}
// Convert the high-order byte and shift it into the high position.
final byte convert1 = (byte) (asciiHexByteToHex(byte1)
- << WellKnownConstants.BITS_PER_NIBBLE);
+ << PrimitiveConstants.BITS_PER_NIBBLE);
// Convert the low-order byte.
final byte convert2 = asciiHexByteToHex(byte2);
// "Or" the two half-bytes together and return it.
@@ -448,11 +448,11 @@
for (int i = 0; i < value.length; i++) {
buffer.append(
HEXADECIMAL_DIGITS[(value[i]
- >>> WellKnownConstants.BITS_PER_NIBBLE)
- & WellKnownConstants.MAX_4_BIT_UNSIGNED_BYTE]);
+ >>> PrimitiveConstants.BITS_PER_NIBBLE)
+ & PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE]);
buffer.append(
HEXADECIMAL_DIGITS[value[i]
- & WellKnownConstants.MAX_4_BIT_UNSIGNED_BYTE]);
+ & PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE]);
}
return buffer.toString();
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/primitive/UnicodeCharUtils.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -30,6 +30,8 @@
import org.foray.common.WellKnownConstants;
+import org.axsl.constants.PrimitiveConstants;
+
import java.util.Arrays;
/**
@@ -204,7 +206,7 @@
* is limited to 0-9, a-z, A-Z. */
int converted = StringUtils.asciiHexByteToHex((byte) c);
final int bitsToShift = nibblesToShift
- * WellKnownConstants.BITS_PER_NIBBLE;
+ * PrimitiveConstants.BITS_PER_NIBBLE;
converted <<= bitsToShift;
result |= converted;
nibblesToShift ++;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -29,9 +29,9 @@
package org.foray.common.sequence;
import org.foray.common.RandomAccessInput;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharsetUtils;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequencePlus;
@@ -108,7 +108,7 @@
if (this.index >= this.sequence.length()) {
throw new EOFException();
}
- final int i = this.sequence.byteAt(this.index) & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ final int i = this.sequence.byteAt(this.index) & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
this.index ++;
return i;
}
@@ -117,7 +117,7 @@
public final short readShort() throws IOException {
final int byte1 = readUnsignedByte();
final int byte2 = readUnsignedByte();
- return (short) ((byte1 << WellKnownConstants.SHIFT_1_BYTE) + byte2);
+ return (short) ((byte1 << PrimitiveConstants.SHIFT_1_BYTE) + byte2);
}
@Override
@@ -124,7 +124,7 @@
public final int readUnsignedShort() throws IOException {
final int byte1 = readUnsignedByte();
final int byte2 = readUnsignedByte();
- return (byte1 << WellKnownConstants.SHIFT_1_BYTE) + byte2;
+ return (byte1 << PrimitiveConstants.SHIFT_1_BYTE) + byte2;
}
@Override
@@ -155,8 +155,8 @@
@Override
public final long readLong() throws IOException {
- final long int1 = (long) (readInt()) << WellKnownConstants.SHIFT_4_BYTES;
- final long int2 = readInt() & WellKnownConstants.MAX_32_BIT_UNSIGNED_INT;
+ final long int1 = (long) (readInt()) << PrimitiveConstants.SHIFT_4_BYTES;
+ final long int2 = readInt() & PrimitiveConstants.MAX_32_BIT_UNSIGNED_INT;
return int1 + int2;
}
@@ -169,7 +169,7 @@
public final char readChar() throws IOException {
final int byte1 = this.readUnsignedByte();
final int byte2 = this.readUnsignedByte();
- return (char) ((byte1 << WellKnownConstants.SHIFT_1_BYTE) + byte2);
+ return (char) ((byte1 << PrimitiveConstants.SHIFT_1_BYTE) + byte2);
}
@Override
@@ -183,9 +183,9 @@
final int byte2 = this.readUnsignedByte();
final int byte3 = this.readUnsignedByte();
final int byte4 = this.readUnsignedByte();
- return (byte1 << WellKnownConstants.SHIFT_3_BYTES)
- + (byte2 << WellKnownConstants.SHIFT_2_BYTES)
- + (byte3 << WellKnownConstants.SHIFT_1_BYTE)
+ return (byte1 << PrimitiveConstants.SHIFT_3_BYTES)
+ + (byte2 << PrimitiveConstants.SHIFT_2_BYTES)
+ + (byte3 << PrimitiveConstants.SHIFT_1_BYTE)
+ (byte4 << 0);
}
@@ -248,9 +248,9 @@
@Override
public final long readUnsignedInt() throws IOException {
long ret = readUnsignedByte();
- ret = (ret << WellKnownConstants.SHIFT_1_BYTE) + readUnsignedByte();
- ret = (ret << WellKnownConstants.SHIFT_1_BYTE) + readUnsignedByte();
- ret = (ret << WellKnownConstants.SHIFT_1_BYTE) + readUnsignedByte();
+ ret = (ret << PrimitiveConstants.SHIFT_1_BYTE) + readUnsignedByte();
+ ret = (ret << PrimitiveConstants.SHIFT_1_BYTE) + readUnsignedByte();
+ ret = (ret << PrimitiveConstants.SHIFT_1_BYTE) + readUnsignedByte();
return ret;
}
@@ -260,9 +260,9 @@
final int byte2 = readUnsignedByte();
final int byte3 = readUnsignedByte();
final int byte4 = readUnsignedByte();
- return (byte4 << WellKnownConstants.SHIFT_3_BYTES)
- + (byte3 << WellKnownConstants.SHIFT_2_BYTES)
- + (byte2 << WellKnownConstants.SHIFT_1_BYTE)
+ return (byte4 << PrimitiveConstants.SHIFT_3_BYTES)
+ + (byte3 << PrimitiveConstants.SHIFT_2_BYTES)
+ + (byte2 << PrimitiveConstants.SHIFT_1_BYTE)
+ byte1;
}
@@ -270,7 +270,7 @@
public int readUnsignedShortLoHi() throws IOException {
final int byte1 = readUnsignedByte();
final int byte2 = readUnsignedByte();
- return (byte2 << WellKnownConstants.SHIFT_1_BYTE) + byte1;
+ return (byte2 << PrimitiveConstants.SHIFT_1_BYTE) + byte1;
}
@Override
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.BitUtils;
import org.foray.common.primitive.NumberUtils;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.primitive.sequence.NibblePrimitiveIterator;
import org.axsl.primitive.sequence.NibbleSequence;
import org.axsl.primitive.sequence.NibbleSequenceMutable;
@@ -169,7 +169,7 @@
} else {
/* If the index is even, place the input nibble into the high-order bits. */
newValue = BitUtils.maskHighOrderBits(oldValue);
- final byte shiftedValue = (byte) (value << WellKnownConstants.BITS_PER_NIBBLE);
+ final byte shiftedValue = (byte) (value << PrimitiveConstants.BITS_PER_NIBBLE);
newValue = (byte) (newValue | shiftedValue);
}
@@ -190,7 +190,7 @@
nibbleValue = BitUtils.maskHighOrderBits(byteValue);
} else {
/* If the index is even, return just the high-order bits. */
- nibbleValue = (byte) (byteValue >>> WellKnownConstants.BITS_PER_NIBBLE);
+ nibbleValue = (byte) (byteValue >>> PrimitiveConstants.BITS_PER_NIBBLE);
/* Have to mask out the high-order bits after the cast, in case the shifted value has
* the high-order bit set, and therefore looks negative -- in that case the caset sets
* all of the high-order bits. */
@@ -248,7 +248,7 @@
*/
private void validateInput(final byte inputByte) {
if (inputByte < 0
- || inputByte > WellKnownConstants.MAX_4_BIT_UNSIGNED_BYTE) {
+ || inputByte > PrimitiveConstants.MAX_4_BIT_UNSIGNED_BYTE) {
throw new IllegalArgumentException("Expected val in the range 0x0 to 0xF: "
+ inputByte);
}
Modified: trunk/foray/foray-content/build.gradle
===================================================================
--- trunk/foray/foray-content/build.gradle 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-content/build.gradle 2022-12-11 21:04:12 UTC (rev 12833)
@@ -5,6 +5,7 @@
description = 'foray-content'
dependencies {
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-content', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
Modified: trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java
===================================================================
--- trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-content/src/main/java/org/foray/content/TextTokensContent4a.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -29,10 +29,10 @@
package org.foray.content;
import org.foray.common.FontContext4a;
-import org.foray.common.WellKnownConstants;
import org.foray.common.kp.KpLeafIterator4a;
import org.axsl.area.LineArea;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.content.TextTokensContent;
import org.axsl.font.FontUse;
import org.axsl.fotree.FoContext;
@@ -173,7 +173,7 @@
/* We are now sitting on a different content element. That means that all of the previous
* content item belongs on this line. */
final TextTokenFlowLocation end =
- foTextTokenFlow.markLocation(tokenIndex, WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUE);
+ foTextTokenFlow.markLocation(tokenIndex, PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUE);
lineArea.makeGlyphAreaSequence(this.content, start, end, false);
return iterator.nextIndex();
}
@@ -187,7 +187,7 @@
}
/* The iterator is out of content. All of this content item goes on this line. */
final TextTokenFlowLocation end =
- foTextTokenFlow.markLocation(tokenIndex, WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUE);
+ foTextTokenFlow.markLocation(tokenIndex, PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUE);
lineArea.makeGlyphAreaSequence(this.content, start, end, false);
return iterator.nextIndex();
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -38,6 +38,7 @@
import org.foray.font.format.ttf.TtfTableGsub;
import org.foray.font.format.type1.Type1Font;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.Font;
import org.axsl.font.FontConsumer;
import org.axsl.font.FontContext;
@@ -640,7 +641,7 @@
return;
}
/* Font is a simple font. */
- if (glyphIndex > WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUES - 1) {
+ if (glyphIndex > PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUES - 1) {
buffer.append("\\");
buffer.append(Integer.toOctalString(glyphIndex));
return;
@@ -685,7 +686,7 @@
for (int i = 0; i < uniBytes.length; i++) {
int b = uniBytes[i];
if (uniBytes[i] < 0) {
- b += WellKnownConstants.MAX_8_BIT_UNSIGNED_VALUES;
+ b += PrimitiveConstants.MAX_8_BIT_UNSIGNED_VALUES;
}
final String hexString = Integer.toHexString(b);
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Subset.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,9 +28,9 @@
package org.foray.font;
-import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.IntArrayBuilder;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.ps.Encoding;
/**
@@ -48,7 +48,7 @@
* The number of elements that should be added to the data arrays as they
* grow in size.
*/
- private int arraySizeIncrement = WellKnownConstants.MAX_8_BIT_UNSIGNED_VALUES;
+ private int arraySizeIncrement = PrimitiveConstants.MAX_8_BIT_UNSIGNED_VALUES;
/**
* Array whose elements are the actually-used glyph indices for the original full font.
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfSubSetFile.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfSubSetFile.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfSubSetFile.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,10 +28,11 @@
package org.foray.font.format.ttf;
-import org.foray.common.WellKnownConstants;
import org.foray.font.Subset;
import org.foray.font.format.FontParser;
+import org.axsl.constants.PrimitiveConstants;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -724,7 +725,7 @@
*/
private short readTTFShort(final byte[] byteArray, final int position)
throws IOException {
- final int byte1 = byteArray[position] << WellKnownConstants.SHIFT_1_BYTE;
+ final int byte1 = byteArray[position] << PrimitiveConstants.SHIFT_1_BYTE;
final int byte2 = byteArray[position + 1];
return (short) (byte1 + byte2);
}
@@ -738,12 +739,12 @@
private short readTTFUShort(final byte[] byteArray, final int position) {
int byte1 = byteArray[position];
if (byte1 < 0) {
- byte1 += WellKnownConstants.MAX_8_BIT_UNSIGNED_VALUES;
+ byte1 += PrimitiveConstants.MAX_8_BIT_UNSIGNED_VALUES;
}
- byte1 = byte1 << WellKnownConstants.SHIFT_1_BYTE;
+ byte1 = byte1 << PrimitiveConstants.SHIFT_1_BYTE;
int byte2 = byteArray[position + 1];
if (byte2 < 0) {
- byte2 += WellKnownConstants.MAX_8_BIT_UNSIGNED_VALUES;
+ byte2 += PrimitiveConstants.MAX_8_BIT_UNSIGNED_VALUES;
}
return (short) (byte1 | byte2);
}
@@ -792,9 +793,9 @@
*/
private void writeUShort(final byte[] byteArray, final int pos,
final int s) {
- final byte b1 = (byte) ((s >> WellKnownConstants.SHIFT_1_BYTE)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
- final byte b2 = (byte) (s & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b1 = (byte) ((s >> PrimitiveConstants.SHIFT_1_BYTE)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b2 = (byte) (s & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
byteArray[pos] = b1;
byteArray[pos + 1] = b2;
}
@@ -808,13 +809,13 @@
*/
private void writeULong(final byte[] byteArray, final long pos,
final long s) {
- final byte b1 = (byte) ((s >> WellKnownConstants.SHIFT_3_BYTES)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
- final byte b2 = (byte) ((s >> WellKnownConstants.SHIFT_2_BYTES)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
- final byte b3 = (byte) ((s >> WellKnownConstants.SHIFT_1_BYTE)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
- final byte b4 = (byte) (s & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b1 = (byte) ((s >> PrimitiveConstants.SHIFT_3_BYTES)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b2 = (byte) ((s >> PrimitiveConstants.SHIFT_2_BYTES)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b3 = (byte) ((s >> PrimitiveConstants.SHIFT_1_BYTE)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte b4 = (byte) (s & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
int outputIndex = (int) pos;
byteArray[outputIndex] = b1;
outputIndex ++;
@@ -863,13 +864,13 @@
for (int i = 0; i < size;
i += TtfSubSetFile.TABLE_BLOCK_SIZE_IN_BYTES) {
int arrayIndex = start + i;
- int l = byteArray[arrayIndex] << WellKnownConstants.SHIFT_3_BYTES;
+ int l = byteArray[arrayIndex] << PrimitiveConstants.SHIFT_3_BYTES;
arrayIndex ++;
- l += byteArray[arrayIndex] << WellKnownConstants.SHIFT_2_BYTES;
+ l += byteArray[arrayIndex] << PrimitiveConstants.SHIFT_2_BYTES;
arrayIndex ++;
- l += byteArray[arrayIndex] << WellKnownConstants.SHIFT_2_BYTES;
+ l += byteArray[arrayIndex] << PrimitiveConstants.SHIFT_2_BYTES;
arrayIndex ++;
- l += byteArray[arrayIndex] << WellKnownConstants.SHIFT_2_BYTES;
+ l += byteArray[arrayIndex] << PrimitiveConstants.SHIFT_2_BYTES;
sum += l;
sum = correctCheckSumForMax(sum);
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/ttf/TtfTableKern.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -29,10 +29,11 @@
package org.foray.font.format.ttf;
import org.foray.common.RandomAccessInput;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.BitUtils;
import org.foray.font.format.Kerning;
+import org.axsl.constants.PrimitiveConstants;
+
import java.io.IOException;
/**
@@ -194,7 +195,7 @@
* @return The shifted value.
*/
private static short subtableFormat(final short coverage) {
- return (short) (coverage >> WellKnownConstants.SHIFT_1_BYTE);
+ return (short) (coverage >> PrimitiveConstants.SHIFT_1_BYTE);
}
@Override
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1MetricsParserPfm.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -29,11 +29,11 @@
package org.foray.font.format.type1;
import org.foray.common.RandomAccessInput;
-import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharsetUtils;
import org.foray.font.FontServer4a;
import org.foray.font.format.Kerning;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.ps.CharSet;
import org.axsl.ps.PsEncoding;
import org.axsl.ps.PsServer;
@@ -146,34 +146,34 @@
this.input.seek(0);
/* Skip dfVersion. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfSize. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_INT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_INT);
/* Skip dfCopyright. */
this.input.skipBytes(Type1MetricsParserPfm.COPYRIGHT_SIZE);
/* Skip dfType. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfPoints. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfVertRes. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfHorizRes. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfAscent. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfInternalLeading. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfExternalLeading. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
this.metrics.setItalic((short) this.input.readUnsignedByte());
@@ -188,10 +188,10 @@
this.metrics.setCharSetID(this.input.readUnsignedByte());
/* Skip dfPixWidth. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfPixHeight. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
this.metrics.setPitchAndFamily(this.input.readUnsignedByte());
@@ -210,10 +210,10 @@
this.input.skipBytes(1);
/* Skip dfWidthBytes. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip dfDevice. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_INT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_INT);
final long faceOffset = this.input.readUnsignedIntLoHi();
@@ -232,7 +232,7 @@
this.input.readUnsignedShortLoHi();
final long extMetricsOffset = this.input.readUnsignedIntLoHi();
final long extentTableOffset = this.input.readUnsignedIntLoHi();
- this.input.skipBytes(WellKnownConstants.BYTES_PER_INT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_INT);
final long kernPairOffset = this.input.readUnsignedIntLoHi();
/* Skip the Track offset. */
this.input.readUnsignedIntLoHi();
@@ -281,19 +281,19 @@
*/
private void loadExtMetrics() throws IOException {
/* Skip the etmSize field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmPointSize field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmOrientation field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmMasterHeight field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmMinScale field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmMaxScale field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmMasterUnits field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
this.metrics.setCapHeight(this.input.readUnsignedShortLoHi());
this.metrics.setXHeight(this.input.readUnsignedShortLoHi());
this.metrics.setLowerCaseAscent(this.input.readUnsignedShortLoHi());
@@ -304,33 +304,33 @@
* the variable stores it in degrees. */
this.metrics.setItalicAngle(this.input.readShortLoHi() * Type1MetricsParserPfm.ITALIC_ANGLE_FACTOR);
/* Skip the etmSuperScript field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmSubScript field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmSuperScriptSize field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmSubScriptSize field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Read the etmUnderlineOffset field. */
this.metrics.setUnderlinePosition((short) this.input.readUnsignedShortLoHi());
/* Read the etmUnderlineWidth field. */
this.metrics.setUnderlineThickness((short) this.input.readUnsignedShortLoHi());
/* Skip the etmDoubleUpperUnderlineOffset field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmDoubleLowerUnderlineOffset field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmDoubleUpperUnderlineWidth field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmDoubleLowerUnderlineWidth field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmStrikeOutOffset field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmStrikeOutWidth field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmKernPairs field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
/* Skip the etmKernTracks field. */
- this.input.skipBytes(WellKnownConstants.BYTES_PER_SHORT);
+ this.input.skipBytes(PrimitiveConstants.BYTES_PER_SHORT);
}
/**
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-fotree/build.gradle 2022-12-11 21:04:12 UTC (rev 12833)
@@ -10,6 +10,7 @@
api group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
api group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
implementation group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl
api group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/parse/PropertyTokenizer.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,9 +28,10 @@
package org.foray.fotree.parse;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.PrimitiveConstants;
+
/**
* Class to tokenize XSL-FO property expressions.
* This class is heavily based on the expression tokenizer in James Clark's XT, an XSLT processor.
@@ -538,7 +539,7 @@
*/
private static boolean isDigit(final char c) {
return c > 0
- && c < WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUES
+ && c < PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUES
&& (PropertyTokenizer.CHAR_MAP[c] & PropertyTokenizer.D) != 0;
}
@@ -550,7 +551,7 @@
*/
private static boolean isHexDigit(final char c) {
return c > 0
- && c < WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUES
+ && c < PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUES
&& (PropertyTokenizer.CHAR_MAP[c] & PropertyTokenizer.H) != 0;
}
@@ -561,7 +562,7 @@
* @return True if and only if The test character is a valid start-of-name character.
*/
private static boolean isNameStartChar(final char c) {
- return c >= WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUES
+ return c >= PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUES
|| c < 0
|| (PropertyTokenizer.CHAR_MAP[c] & PropertyTokenizer.CS) != 0;
}
@@ -573,7 +574,7 @@
* @return True if and only if The test character is a valid name character.
*/
private static boolean isNameChar(final char c) {
- return c > WellKnownConstants.MAX_7_BIT_UNSIGNED_VALUES
+ return c > PrimitiveConstants.MAX_7_BIT_UNSIGNED_VALUES
|| c < 0
|| (PropertyTokenizer.CHAR_MAP[c] & PropertyTokenizer.C_CS)
!= 0;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/DtColor.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -31,6 +31,8 @@
import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.PrimitiveConstants;
+
import java.awt.Color;
import java.awt.color.ColorSpace;
import java.util.ArrayList;
@@ -669,11 +671,11 @@
red =
Integer.parseInt(str.substring(0, str.length()
- 1))
- * WellKnownConstants.MAX_8_BIT_UNSIGNED_INT
+ * PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
/ WellKnownConstants.PERCENT_CONVERSION;
} else {
red = Integer.parseInt(str)
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
}
}
if (st.hasMoreTokens()) {
@@ -682,11 +684,11 @@
green =
Integer.parseInt(str.substring(0, str.length()
- 1))
- * WellKnownConstants.MAX_8_BIT_UNSIGNED_INT
+ * PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
/ WellKnownConstants.PERCENT_CONVERSION;
} else {
green = Integer.parseInt(str)
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
}
}
if (st.hasMoreTokens()) {
@@ -695,11 +697,11 @@
blue =
Integer.parseInt(str.substring(0, str.length()
- 1))
- * WellKnownConstants.MAX_8_BIT_UNSIGNED_INT
+ * PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT
/ WellKnownConstants.PERCENT_CONVERSION;
} else {
blue = Integer.parseInt(str)
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
}
}
}
@@ -763,9 +765,9 @@
* If the long form, integralColor should now have a value between 0 and
* 255, inclusive.
* Divide by 255 to put in the range of 0 thru 1. */
- int divisor = WellKnownConstants.MAX_4_BIT_UNSIGNED_VALUES - 1;
+ int divisor = PrimitiveConstants.MAX_4_BIT_UNSIGNED_VALUES - 1;
if (longFormat) {
- divisor = WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ divisor = PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
}
return (float) integralColor / divisor;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgb.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgb.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgb.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.PrimitiveConstants;
+
import java.awt.Color;
/**
@@ -90,9 +91,9 @@
* or percentage values. If percentages value, they've already
* been converted to reals. */
final double colorVal = numeric.evalNumeric()
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
if (colorVal < 0.0
- || colorVal > WellKnownConstants.MAX_8_BIT_UNSIGNED_INT) {
+ || colorVal > PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT) {
throw new PropertyException("Arguments to rgb() must normalize "
+ "to the range 0 to 1");
}
@@ -105,11 +106,11 @@
public Color eval() {
return new Color(
(float) this.numerics[0].evalNumeric()
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT,
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT,
(float) this.numerics[1].evalNumeric()
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT,
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT,
(float) this.numerics[2].evalNumeric()
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
}
/**
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgbIcc.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgbIcc.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/value/FnRgbIcc.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -28,9 +28,10 @@
package org.foray.fotree.value;
-import org.foray.common.WellKnownConstants;
import org.foray.fotree.PropertyException;
+import org.axsl.constants.PrimitiveConstants;
+
import java.awt.Color;
/**
@@ -146,9 +147,9 @@
* or percentage values. If percentages value, they've already
* been converted to reals. */
final double colorVal = numeric.evalNumeric()
- / WellKnownConstants.MAX_8_BIT_UNSIGNED_INT;
+ / PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT;
if (colorVal < 0.0
- || colorVal > WellKnownConstants.MAX_8_BIT_UNSIGNED_INT) {
+ || colorVal > PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT) {
throw new PropertyException("Arguments to rgb-icc() must normalize "
+ "to the range 0 to 1");
}
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-graphic/build.gradle 2022-12-11 21:04:12 UTC (rev 12833)
@@ -22,6 +22,7 @@
api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
+ api (group: 'org.axsl', name: 'axsl-constants', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -36,6 +36,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.primitive.sequence.ByteSequence;
@@ -217,11 +218,11 @@
* "white" for each of the color channels. */
int column = inputColumn;
byte p = inputByte;
- for (int countr = 0; countr < WellKnownConstants.BITS_PER_BYTE
+ for (int countr = 0; countr < PrimitiveConstants.BITS_PER_BYTE
&& column < this.pixelWidth; countr++) {
byte color = 0;
if ((p & BmpGraphic.BIT_7_MASK) != 0) {
- color = WellKnownConstants.MAX_8_BIT_UNSIGNED_BYTE;
+ color = PrimitiveConstants.MAX_8_BIT_UNSIGNED_BYTE;
}
final int contentIndex = getRawColorSpace().getNumComponents()
* (row * this.pixelWidth + column);
@@ -251,7 +252,7 @@
for (int countr = 0; countr < 2 && column < this.pixelWidth;
countr++) {
p &= BmpGraphic.HIGH_NIBBLE_MASK;
- p >>= WellKnownConstants.BITS_PER_NIBBLE;
+ p >>= PrimitiveConstants.BITS_PER_NIBBLE;
final int pal = p * getRawColorSpace().getNumComponents();
normalizedBytes[getRawColorSpace().getNumComponents()
* (row * this.pixelWidth + column)] =
@@ -262,7 +263,7 @@
normalizedBytes[getRawColorSpace().getNumComponents()
* (row * this.pixelWidth + column) + 2] =
this.colorPalette[pal + 2];
- p <<= WellKnownConstants.BITS_PER_NIBBLE;
+ p <<= PrimitiveConstants.BITS_PER_NIBBLE;
column++;
}
return column;
@@ -396,7 +397,7 @@
if (count2 >= 0) {
final int paletteIndex = countr * numChannels + count2;
palette[paletteIndex] = (byte) (input
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
}
count2--;
}
@@ -421,7 +422,7 @@
} else if (getBitDepth() == BIT_DEPTH_4
|| getBitDepth() == BIT_DEPTH_GRAYSCALE) {
bytesPerRow = this.pixelWidth * getBitDepth() /
- WellKnownConstants.BITS_PER_BYTE;
+ PrimitiveConstants.BITS_PER_BYTE;
} else {
throw new GraphicException("Image (" + getUrl().toString()
+ ") has " + getBitDepth()
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -31,6 +31,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.primitive.sequence.ByteSequence;
@@ -137,12 +138,12 @@
for (int row = 0; row < this.pixelHeight; row++) {
for (int column = 0; column < this.pixelWidth; column++) {
final int p = tmpMap[row * this.pixelWidth + column];
- final byte r = (byte) ((p >> WellKnownConstants.SHIFT_2_BYTES)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
- final byte g = (byte) ((p >> WellKnownConstants.SHIFT_1_BYTE)
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte r = (byte) ((p >> PrimitiveConstants.SHIFT_2_BYTES)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
+ final byte g = (byte) ((p >> PrimitiveConstants.SHIFT_1_BYTE)
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
final byte b = (byte) (p
- & WellKnownConstants.MAX_8_BIT_UNSIGNED_INT);
+ & PrimitiveConstants.MAX_8_BIT_UNSIGNED_INT);
int contentIndex = getRawColorSpace().getNumComponents()
* (row * this.pixelWidth + column);
contentBytes[contentIndex] = r;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-11 20:07:42 UTC (rev 12832)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-11 21:04:12 UTC (rev 12833)
@@ -38,6 +38,7 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.sequence.ByteArray;
+import org.axsl.constants.PrimitiveConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.primitive.sequence.ByteSequence;
@@ -197,7 +198,7 @@
* here calls this method, loadImage().
* See parseBasics() for a comment explaining why. */
findImageSize(contentBytes);
- setBitDepth(WellKnownConstants.BITS_PER_BYTE);
+ setBitDepth(PrimitiveConstants.BITS_PER_BYTE);
if (contentBytes.length > (index + 2) &&
contentBytes[index] == JpegGraphic.MARK &&
@@ -211,7 +212,7 @@
}
if (iccStream.size() > 0) {
final byte[] align = new byte[((iccStream.size())
- ...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-11 20:07:43
|
Revision: 12832
http://sourceforge.net/p/foray/code/12832
Author: victormote
Date: 2022-12-11 20:07:42 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Basic project directories.
Added Paths:
-----------
trunk/foray/foray-primitive/src/
trunk/foray/foray-primitive/src/main/
trunk/foray/foray-primitive/src/main/java/
trunk/foray/foray-primitive/src/main/java/org/
trunk/foray/foray-primitive/src/main/java/org/foray/
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/
trunk/foray/foray-primitive/src/test/
trunk/foray/foray-primitive/src/test/java/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 19:31:25
|
Revision: 12831
http://sourceforge.net/p/foray/code/12831
Author: victormote
Date: 2022-12-11 19:31:23 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Create project foray-primitive.
Modified Paths:
--------------
trunk/foray/settings.gradle
Added Paths:
-----------
trunk/foray/foray-primitive/
trunk/foray/foray-primitive/build.gradle
Added: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle (rev 0)
+++ trunk/foray/foray-primitive/build.gradle 2022-12-11 19:31:23 UTC (rev 12831)
@@ -0,0 +1,18 @@
+plugins {
+ id 'foray.library-conventions'
+ id 'foray.test-conventions'
+}
+
+description = 'foray-primitive'
+
+dependencies {
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
+}
+
+javadoc {
+ options.windowTitle = "FOray Primitives API"
+ options.docTitle = "FOray Primitives API"
+ options.header = "FOray Primitives API ${version}"
+}
+
+/* Last line of script. */
Property changes on: trunk/foray/foray-primitive/build.gradle
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/settings.gradle
===================================================================
--- trunk/foray/settings.gradle 2022-12-11 19:23:34 UTC (rev 12830)
+++ trunk/foray/settings.gradle 2022-12-11 19:31:23 UTC (rev 12831)
@@ -16,6 +16,7 @@
include 'foray-output'
include 'foray-pdf'
include 'foray-pioneer'
+include 'foray-primitive'
include 'foray-ps'
include 'foray-render'
include 'foray-speech'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 19:23:39
|
Revision: 12830
http://sourceforge.net/p/foray/code/12830
Author: victormote
Date: 2022-12-11 19:23:34 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Rename package containing the primitive sequence interfaces.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/MathGraphic4a.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PdfGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/BmpGraphicTests.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/GifGraphicTests.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/JpegGraphicTests.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/PngGraphicTests.java
trunk/foray/foray-graphic/src/test/java/org/foray/graphic/TiffGraphicTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerJavaBreakIterator.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfResources.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfAnnotList.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfNameDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPage4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPages.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/filespec/PdfFileSpec.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/function/PdfFunction.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfColor4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfPattern4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfShading.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXreference.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationExplicit4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfOutline4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfOutlineItem4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfPageLabel.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/action/PdfGoTo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/action/PdfGoToRemote.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/action/PdfUri.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfBorderStyle.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/annotation/PdfLink.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfCrossRefEntry.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfCrossRefInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfGenericStream.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfParser.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfSerializer.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfDate.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfNameTree.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfNumberTree.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCharProcs.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidFont.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfCidSystemInfo.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfEncoding4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFont4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontDescriptor.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/text/PdfFontFileStream.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfLiteralString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfName.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfObject.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfStream.java
trunk/foray/foray-pdf/src/test/java/org/foray/pdf/object/PdfDocumentInfo4aTests.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsFileReal.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsInputFile.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsServer4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/PsStringInput.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/CharSet4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingCustom.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingParser.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/encode/EncodingVector4a.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/java2d/Java2dSystemDict.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/pdf/PdfSystemDict.java
trunk/foray/foray-ps/src/main/java/org/foray/ps/readonly/ReadOnlySystemDict.java
trunk/foray/foray-render/src/main/java/org/foray/render/pcl/PclRenderer.java
trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,9 +31,9 @@
import org.foray.common.sequence.ByteArray;
import org.foray.common.sequence.ByteSequenceSubset;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import org.axsl.unicode.block.Basic_Latin_Block;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequencePlus;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractByteSequence.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,9 +30,9 @@
import org.foray.common.primitive.ByteUtils;
-import org.axsl.utility.sequence.BytePrimitiveIterator;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.BytePrimitiveIterator;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.io.IOException;
import java.io.OutputStream;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractCharSequence.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.CharPrimitiveIterator;
-import org.axsl.utility.sequence.CharSequenceMutable;
-import org.axsl.utility.sequence.CharSequencePlus;
-import org.axsl.utility.sequence.CharSequenceUtility;
+import org.axsl.primitive.sequence.CharPrimitiveIterator;
+import org.axsl.primitive.sequence.CharSequenceMutable;
+import org.axsl.primitive.sequence.CharSequencePlus;
+import org.axsl.primitive.sequence.CharSequenceUtility;
/**
* Abstract superclass for implementations of {@link CharSequencePlus}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractIntSequence.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.IntPrimitiveIterator;
-import org.axsl.utility.sequence.IntSequence;
-import org.axsl.utility.sequence.IntSequenceMutable;
-import org.axsl.utility.sequence.IntSequencePlus;
+import org.axsl.primitive.sequence.IntPrimitiveIterator;
+import org.axsl.primitive.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntSequenceMutable;
+import org.axsl.primitive.sequence.IntSequencePlus;
/**
* Abstract superclass for implementations of {@link IntSequencePlus}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractLongSequence.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.LongPrimitiveIterator;
-import org.axsl.utility.sequence.LongSequence;
-import org.axsl.utility.sequence.LongSequenceMutable;
-import org.axsl.utility.sequence.LongSequencePlus;
+import org.axsl.primitive.sequence.LongPrimitiveIterator;
+import org.axsl.primitive.sequence.LongSequence;
+import org.axsl.primitive.sequence.LongSequenceMutable;
+import org.axsl.primitive.sequence.LongSequencePlus;
/**
* Abstract superclass for implementations of {@link LongSequencePlus}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/AbstractShortSequence.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.ShortPrimitiveIterator;
-import org.axsl.utility.sequence.ShortSequence;
-import org.axsl.utility.sequence.ShortSequenceMutable;
-import org.axsl.utility.sequence.ShortSequencePlus;
+import org.axsl.primitive.sequence.ShortPrimitiveIterator;
+import org.axsl.primitive.sequence.ShortSequence;
+import org.axsl.primitive.sequence.ShortSequenceMutable;
+import org.axsl.primitive.sequence.ShortSequencePlus;
/**
* Abstract superclass for implementations of {@link ShortSequencePlus}.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/BooleanSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.BooleanPrimitiveIterator;
-import org.axsl.utility.sequence.BooleanSequence;
+import org.axsl.primitive.sequence.BooleanPrimitiveIterator;
+import org.axsl.primitive.sequence.BooleanSequence;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,8 +31,8 @@
import org.foray.common.primitive.ByteUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequenceMutable;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequenceMutable;
import java.io.Serializable;
import java.nio.charset.Charset;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -35,8 +35,8 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequenceMutable;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequenceMutable;
import org.apache.commons.io.IOUtils;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,8 +31,8 @@
import org.foray.common.primitive.CharacterUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequenceMutable;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequenceMutable;
import java.io.Serializable;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.BytePrimitiveIterator;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.BytePrimitiveIterator;
+import org.axsl.primitive.sequence.ByteSequence;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceParser.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,8 +32,8 @@
import org.foray.common.WellKnownConstants;
import org.foray.common.primitive.CharsetUtils;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import org.apache.commons.io.EndianUtils;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceSubset.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,9 +28,9 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.ByteSequenceMutable;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequenceMutable;
+import org.axsl.primitive.sequence.ByteSequencePlus;
/**
* A wrapper around another {@link ByteSequence}, providing a view of a subset of that sequence.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArray.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.CharSequenceMutable;
-import org.axsl.utility.sequence.IntSequence;
+import org.axsl.primitive.sequence.CharSequenceMutable;
+import org.axsl.primitive.sequence.IntSequence;
import java.util.Arrays;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,7 +30,7 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.axsl.utility.sequence.CharSequenceMutable;
+import org.axsl.primitive.sequence.CharSequenceMutable;
import java.util.Arrays;
import java.util.EmptyStackException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/CharSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,7 +28,7 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.CharPrimitiveIterator;
+import org.axsl.primitive.sequence.CharPrimitiveIterator;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArray.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,8 +30,8 @@
import org.foray.common.primitive.NumberUtils;
-import org.axsl.utility.sequence.IntSequence;
-import org.axsl.utility.sequence.IntSequenceMutable;
+import org.axsl.primitive.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntSequenceMutable;
import java.util.Arrays;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,8 +30,8 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.axsl.utility.sequence.IntSequence;
-import org.axsl.utility.sequence.IntSequenceMutable;
+import org.axsl.primitive.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntSequenceMutable;
import java.util.Arrays;
import java.util.EmptyStackException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/IntSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.IntPrimitiveIterator;
-import org.axsl.utility.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntPrimitiveIterator;
+import org.axsl.primitive.sequence.IntSequence;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArray.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.LongPrimitiveIterator;
-import org.axsl.utility.sequence.LongSequence;
-import org.axsl.utility.sequence.LongSequenceMutable;
-import org.axsl.utility.sequence.LongSequencePlus;
+import org.axsl.primitive.sequence.LongPrimitiveIterator;
+import org.axsl.primitive.sequence.LongSequence;
+import org.axsl.primitive.sequence.LongSequenceMutable;
+import org.axsl.primitive.sequence.LongSequencePlus;
import java.util.Arrays;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,10 +30,10 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.axsl.utility.sequence.LongPrimitiveIterator;
-import org.axsl.utility.sequence.LongSequence;
-import org.axsl.utility.sequence.LongSequenceMutable;
-import org.axsl.utility.sequence.LongSequencePlus;
+import org.axsl.primitive.sequence.LongPrimitiveIterator;
+import org.axsl.primitive.sequence.LongSequence;
+import org.axsl.primitive.sequence.LongSequenceMutable;
+import org.axsl.primitive.sequence.LongSequencePlus;
import java.util.Arrays;
import java.util.EmptyStackException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/LongSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.LongPrimitiveIterator;
-import org.axsl.utility.sequence.LongSequence;
+import org.axsl.primitive.sequence.LongPrimitiveIterator;
+import org.axsl.primitive.sequence.LongSequence;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/NibbleArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,10 +32,10 @@
import org.foray.common.primitive.BitUtils;
import org.foray.common.primitive.NumberUtils;
-import org.axsl.utility.sequence.NibblePrimitiveIterator;
-import org.axsl.utility.sequence.NibbleSequence;
-import org.axsl.utility.sequence.NibbleSequenceMutable;
-import org.axsl.utility.sequence.NibbleSequencePlus;
+import org.axsl.primitive.sequence.NibblePrimitiveIterator;
+import org.axsl.primitive.sequence.NibbleSequence;
+import org.axsl.primitive.sequence.NibbleSequenceMutable;
+import org.axsl.primitive.sequence.NibbleSequencePlus;
import java.io.Serializable;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArray.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,10 +28,10 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.ShortPrimitiveIterator;
-import org.axsl.utility.sequence.ShortSequence;
-import org.axsl.utility.sequence.ShortSequenceMutable;
-import org.axsl.utility.sequence.ShortSequencePlus;
+import org.axsl.primitive.sequence.ShortPrimitiveIterator;
+import org.axsl.primitive.sequence.ShortSequence;
+import org.axsl.primitive.sequence.ShortSequenceMutable;
+import org.axsl.primitive.sequence.ShortSequencePlus;
import java.util.Arrays;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortArrayBuilder.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,8 +30,8 @@
import org.foray.common.MarkedIndexOutOfBoundsException;
-import org.axsl.utility.sequence.ShortSequence;
-import org.axsl.utility.sequence.ShortSequenceMutable;
+import org.axsl.primitive.sequence.ShortSequence;
+import org.axsl.primitive.sequence.ShortSequenceMutable;
import java.util.Arrays;
import java.util.EmptyStackException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ShortSequenceIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -28,8 +28,8 @@
package org.foray.common.sequence;
-import org.axsl.utility.sequence.ShortPrimitiveIterator;
-import org.axsl.utility.sequence.ShortSequence;
+import org.axsl.primitive.sequence.ShortPrimitiveIterator;
+import org.axsl.primitive.sequence.ShortSequence;
import java.util.NoSuchElementException;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/package-info.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -27,7 +27,7 @@
*/
/**
- * Implementations of the interfaces in {@link org.axsl.utility.sequence}.
+ * Implementations of the interfaces in {@link org.axsl.primitive.sequence}.
* Wrappers of primitive arrays, intended to make array handling more safe and more flexible, and to make code using
* them more fluent.
*/
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -30,8 +30,8 @@
import org.foray.common.sequence.ByteArray;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.unicode.block.Basic_Latin_Block;
-import org.axsl.utility.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -45,11 +45,11 @@
import org.axsl.font.FontServer;
import org.axsl.font.FontUse;
import org.axsl.orthography.Orthography;
+import org.axsl.primitive.sequence.ByteSequence;
+import org.axsl.primitive.sequence.IntSequence;
import org.axsl.ps.CharSet;
import org.axsl.ps.Encoding;
import org.axsl.unicode.block.Basic_Latin_Block;
-import org.axsl.utility.sequence.ByteSequence;
-import org.axsl.utility.sequence.IntSequence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/format/type1/Type1FontParser.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -34,6 +34,7 @@
import org.foray.font.format.FontParserClient;
import org.axsl.font.FontException;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.PsException;
import org.axsl.ps.PsFontDictionary;
import org.axsl.ps.PsFontDirectory;
@@ -42,7 +43,6 @@
import org.axsl.ps.PsInterpreterException;
import org.axsl.ps.PsServer;
import org.axsl.ps.PsSystemDict;
-import org.axsl.utility.sequence.ByteSequence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.common.primitive.XmlCharacterUtils;
import org.foray.common.sequence.IntArrayBuilder;
-import org.axsl.utility.sequence.IntSequencePlus;
+import org.axsl.primitive.sequence.IntSequencePlus;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/BmpGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -38,7 +38,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -34,8 +34,8 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.BoundingBox;
-import org.axsl.utility.sequence.ByteSequence;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/GifGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.Color;
import java.awt.Transparency;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/Graphic4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,7 +36,7 @@
import org.axsl.font.FontConstants;
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.output.GraphicOutput;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.color.ColorSpace;
import java.io.BufferedInputStream;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/JpegGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -40,7 +40,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/MathGraphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/MathGraphic4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/MathGraphic4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import org.w3c.dom.mathml.MathMLDocument;
import org.w3c.dom.svg.SVGDocument;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PdfGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PdfGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PdfGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/PngGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import org.apache.xmlgraphics.image.GraphicsUtil;
import org.apache.xmlgraphics.image.codec.png.PNGDecodeParam;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
import org.apache.batik.anim.dom.SVGOMDocument;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TempImage.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -35,7 +35,7 @@
import org.axsl.graphic.GraphicException;
import org.axsl.graphic.GraphicLink;
import org.axsl.graphic.output.GraphicOutput;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/TiffGraphic.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -39,7 +39,7 @@
import org.axsl.font.FontConstants;
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import org.apache.xmlgraphics.image.codec.tiff.TIFFDecodeParam;
import org.apache.xmlgraphics.image.codec.tiff.TIFFDirectory;
Modified: trunk/foray/foray-graphic/src/test/java/org/foray/graphic/BmpGraphicTests.java
===================================================================
--- trunk/foray/foray-graphic/src/test/java/org/foray/graphic/BmpGraphicTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/test/java/org/foray/graphic/BmpGraphicTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,7 +31,7 @@
import org.foray.common.url.UrlUtil;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Modified: trunk/foray/foray-graphic/src/test/java/org/foray/graphic/GifGraphicTests.java
===================================================================
--- trunk/foray/foray-graphic/src/test/java/org/foray/graphic/GifGraphicTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/test/java/org/foray/graphic/GifGraphicTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,7 +31,7 @@
import org.foray.common.url.UrlUtil;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Modified: trunk/foray/foray-graphic/src/test/java/org/foray/graphic/JpegGraphicTests.java
===================================================================
--- trunk/foray/foray-graphic/src/test/java/org/foray/graphic/JpegGraphicTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/test/java/org/foray/graphic/JpegGraphicTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,7 +31,7 @@
import org.foray.common.url.UrlUtil;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Modified: trunk/foray/foray-graphic/src/test/java/org/foray/graphic/PngGraphicTests.java
===================================================================
--- trunk/foray/foray-graphic/src/test/java/org/foray/graphic/PngGraphicTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/test/java/org/foray/graphic/PngGraphicTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,7 +31,7 @@
import org.foray.common.url.UrlUtil;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Modified: trunk/foray/foray-graphic/src/test/java/org/foray/graphic/TiffGraphicTests.java
===================================================================
--- trunk/foray/foray-graphic/src/test/java/org/foray/graphic/TiffGraphicTests.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-graphic/src/test/java/org/foray/graphic/TiffGraphicTests.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -31,7 +31,7 @@
import org.foray.common.url.UrlUtil;
import org.axsl.graphic.GraphicException;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -34,8 +34,8 @@
import org.foray.common.primitive.StringUtils;
import org.axsl.orthography.optional.Lexer;
+import org.axsl.primitive.sequence.IntSequence;
import org.axsl.unicode.block.Latin_1_Supplement_Block;
-import org.axsl.utility.sequence.IntSequence;
import java.util.ArrayList;
import java.util.Collections;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.orthography.optional.Lexer;
-import org.axsl.utility.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntSequence;
import com.ibm.icu.text.BreakIterator;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerJavaBreakIterator.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerJavaBreakIterator.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerJavaBreakIterator.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.common.sequence.IntArrayBuilder;
import org.axsl.orthography.optional.Lexer;
-import org.axsl.utility.sequence.IntSequence;
+import org.axsl.primitive.sequence.IntSequence;
import java.text.BreakIterator;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Word4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -42,7 +42,7 @@
import org.axsl.kp.KpPenalty;
import org.axsl.orthography.Word;
import org.axsl.orthography.WordSegment;
-import org.axsl.utility.sequence.ByteSequence;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.value.TextTransform;
import org.axsl.value.group.TextModifiers;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -34,7 +34,7 @@
import org.foray.pdf.type.PdfObject;
import org.axsl.pdf.PdfException;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
/**
* <p>A reference to an indirect object, also known as a labeled object.
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfResources.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfResources.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/content/PdfResources.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,7 +36,7 @@
import org.foray.pdf.text.PdfFont4a;
import org.foray.pdf.type.PdfObject;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfAnnotList.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfAnnotList.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfAnnotList.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.pdf.interact.annotation.PdfAnnotation;
import org.foray.pdf.type.PdfObject;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -78,9 +78,9 @@
import org.axsl.pdf.PdfSerializationConfig;
import org.axsl.pdf.PdfVersion;
import org.axsl.pdf.PdfXobject;
+import org.axsl.primitive.sequence.IntPrimitiveIterator;
import org.axsl.ps.Encoding;
import org.axsl.ps.PsServer;
-import org.axsl.utility.sequence.IntPrimitiveIterator;
import java.awt.Color;
import java.awt.LinearGradientPaint;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfNameDictionary.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfNameDictionary.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfNameDictionary.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,7 +36,7 @@
import org.foray.pdf.structure.PdfNameTree;
import org.foray.pdf.type.PdfDictionary;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.Arrays;
import java.util.Collections;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPage4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPage4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPage4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -47,7 +47,7 @@
import org.axsl.pdf.PdfDestinationExplicit.Coordinates;
import org.axsl.pdf.PdfDestinationExplicit.PositionAndZoom;
import org.axsl.pdf.PdfException;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.awt.geom.Rectangle2D;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPages.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPages.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfPages.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.pdf.type.PdfObject;
import org.axsl.pdf.PdfPage;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.ArrayList;
import java.util.Collections;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,7 +36,7 @@
import org.foray.pdf.type.PdfDictionary;
import org.axsl.pdf.PdfVersion;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,7 +36,7 @@
import org.foray.pdf.type.PdfDictionary;
import org.axsl.pdf.PdfException;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.io.FilterOutputStream;
import java.io.IOException;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/filespec/PdfFileSpec.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/filespec/PdfFileSpec.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/filespec/PdfFileSpec.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.pdf.document.PdfDocument4a;
import org.foray.pdf.type.PdfObject;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
/**
* A File Specification Dictionary.
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/function/PdfFunction.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/function/PdfFunction.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/function/PdfFunction.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.foray.pdf.document.PdfDocument4a;
import org.foray.pdf.type.PdfObject;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfColor4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfColor4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfColor4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -32,7 +32,7 @@
import org.foray.common.sequence.ByteArray;
import org.foray.pdf.document.PdfDocument4a;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.awt.Color;
import java.awt.color.ColorSpace;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfPattern4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfPattern4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfPattern4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.foray.pdf.content.PdfResources;
import org.foray.pdf.document.PdfDocument4a;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfShading.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfShading.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfShading.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -34,7 +34,7 @@
import org.foray.pdf.function.PdfFunction;
import org.foray.pdf.type.PdfObject;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
import java.awt.color.ColorSpace;
import java.util.List;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXreference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXreference.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfXreference.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -36,8 +36,8 @@
import org.axsl.graphic.Graphic;
import org.axsl.graphic.GraphicException;
import org.axsl.pdf.PdfException;
+import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.ps.BoundingBox;
-import org.axsl.utility.sequence.ByteSequence;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationExplicit4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationExplicit4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationExplicit4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -40,7 +40,7 @@
import org.foray.pdf.type.PdfObject;
import org.axsl.pdf.PdfDestinationExplicit;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl.primitive.sequence.ByteSequencePlus;
/**
* A PDF Explicit Destination, a destination that points to a specific page / location / view.
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java 2022-12-11 18:42:39 UTC (rev 12829)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java 2022-12-11 19:23:34 UTC (rev 12830)
@@ -33,7 +33,7 @@
import org.foray.pdf.type.PdfObject;
import org.axsl.pdf.PdfDestinationNamed;
-import org.axsl.utility.sequence.ByteSequencePlus;
+import org.axsl...
[truncated message content] |
|
From: <vic...@us...> - 2022-12-11 18:42:41
|
Revision: 12829
http://sourceforge.net/p/foray/code/12829
Author: victormote
Date: 2022-12-11 18:42:39 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Rename of axsl-utility to axsl-primitive.
Modified Paths:
--------------
trunk/foray/foray-common/build.gradle
trunk/foray/foray-font/build.gradle
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-graphic/build.gradle
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-pdf/build.gradle
trunk/foray/foray-ps/build.gradle
trunk/foray/foray-render/build.gradle
trunk/foray/foray-zz-attic/build.gradle
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-common/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -11,7 +11,7 @@
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
api (group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j)
- api (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-kp-model', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-font/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -12,7 +12,7 @@
implementation group: 'commons-discovery', name: 'commons-discovery', version: versions.commonsDiscovery
api group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
- api (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-ps', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-fotree/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -11,7 +11,7 @@
api group: 'org.axsl.org.w3c.dom.mathml', name: 'mathml-dom-java', version: versions.mathMlDom
api group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl
- implementation group: 'org.axsl', name: 'axsl-utility', version: versions.axsl
+ implementation group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl
api group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl
api group: 'org.axsl', name: 'axsl-font', version: versions.axsl
api group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl
Modified: trunk/foray/foray-graphic/build.gradle
===================================================================
--- trunk/foray/foray-graphic/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-graphic/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -22,7 +22,7 @@
api (group: "org.axsl.org.w3c.dom.svg", name:"svg-dom-java", version: versions.svgDom)
api (group: "org.axsl.org.w3c.dom.mathml", name:"mathml-dom-java", version: versions.mathMlDom)
- api (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-orthography/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -11,7 +11,7 @@
api group: 'commons-io', name: 'commons-io', version: versions.commonsIo
implementation group: 'com.ibm.icu', name: 'icu4j', version: versions.icu4j
- api (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-i18n', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-fotree', version: versions.axsl)
Modified: trunk/foray/foray-pdf/build.gradle
===================================================================
--- trunk/foray/foray-pdf/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-pdf/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -10,7 +10,7 @@
api group: 'org.apache.xmlgraphics', name: 'batik-awt-util', version: versions.batik
api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
- api (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ api (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-graphic', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-orthography', version: versions.axsl)
Modified: trunk/foray/foray-ps/build.gradle
===================================================================
--- trunk/foray/foray-ps/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-ps/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -9,7 +9,7 @@
dependencies {
implementation group: 'commons-cli', name: 'commons-cli', version: versions.commonsCli
- api group: 'org.axsl', name: 'axsl-utility', version: versions.axsl
+ api group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl
api group: 'org.axsl', name: 'axsl-ps', version: versions.axsl
implementation project(':foray-common')
Modified: trunk/foray/foray-render/build.gradle
===================================================================
--- trunk/foray/foray-render/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-render/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -8,7 +8,7 @@
dependencies {
implementation group: 'org.axsl.org.w3c.dom.svg', name: 'svg-dom-java', version: versions.svgDom
- implementation (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-output', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-font', version: versions.axsl)
api (group: 'org.axsl', name: 'axsl-pdf', version: versions.axsl)
Modified: trunk/foray/foray-zz-attic/build.gradle
===================================================================
--- trunk/foray/foray-zz-attic/build.gradle 2022-12-11 16:37:14 UTC (rev 12828)
+++ trunk/foray/foray-zz-attic/build.gradle 2022-12-11 18:42:39 UTC (rev 12829)
@@ -9,7 +9,7 @@
implementation (group: 'commons-io', name: 'commons-io', version: versions.commonsIo)
api (group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.2')
- implementation (group: 'org.axsl', name: 'axsl-utility', version: versions.axsl)
+ implementation (group: 'org.axsl', name: 'axsl-primitive', version: versions.axsl)
api (project(':foray-common'))
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 16:37:17
|
Revision: 12828
http://sourceforge.net/p/foray/code/12828
Author: victormote
Date: 2022-12-11 16:37:14 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Remove ComparablePlus interface (from aXSL), as it is too implementation-specific. Moved to org.foray.common.
Modified Paths:
--------------
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutableTokenFlowLocation.java
Added Paths:
-----------
trunk/foray/foray-common/src/main/java/org/foray/common/ComparablePlus.java
trunk/foray/foray-common/src/test/java/org/foray/common/ComparablePlusTests.java
Added: trunk/foray/foray-common/src/main/java/org/foray/common/ComparablePlus.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/ComparablePlus.java (rev 0)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/ComparablePlus.java 2022-12-11 16:37:14 UTC (rev 12828)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2022 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+package org.foray.common;
+
+/**
+ * Enhancements to the {@link Comparable} interface, to improve readability.
+ * @param <T> The type of the objects being compared.
+ */
+public interface ComparablePlus<T> extends Comparable<T> {
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is equal to {@code o}.
+ */
+ default boolean isEqualTo(T o) {
+ return compareTo(o) == 0;
+ }
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is NOT equal to {@code o}.
+ */
+ default boolean isNotEqualTo(T o) {
+ return compareTo(o) != 0;
+ }
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is greater than {@code o}.
+ */
+ default boolean isGreaterThan(T o) {
+ return compareTo(o) > 0;
+ }
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is greater than or equal to {@code o}.
+ */
+ default boolean isGreaterThanOrEqualTo(T o) {
+ return compareTo(o) >= 0;
+ }
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is less than {@code o}.
+ */
+ default boolean isLessThan(T o) {
+ return compareTo(o) < 0;
+ }
+
+ /**
+ * Compares the value of this object to another.
+ * @param o The object to be compared to this.
+ * @return True if and only if this is less than or equal to {@code o}.
+ */
+ default boolean isLessThanOrEqualTo(T o) {
+ return compareTo(o) <= 0;
+ }
+
+}
Property changes on: trunk/foray/foray-common/src/main/java/org/foray/common/ComparablePlus.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-common/src/test/java/org/foray/common/ComparablePlusTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/ComparablePlusTests.java (rev 0)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/ComparablePlusTests.java 2022-12-11 16:37:14 UTC (rev 12828)
@@ -0,0 +1,363 @@
+/*
+ * Copyright 2022 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.common;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test of {@link ComparablePlus}.
+ */
+public class ComparablePlusTests {
+
+ /** A constant. */
+ private final Bogus minus100instance1 = new Bogus(-100);
+ /** A constant. */
+ private final Bogus minus100instance2 = new Bogus(-100);
+ /** A constant. */
+ private final Bogus zeroinstance1 = new Bogus(0);
+ /** A constant. */
+ private final Bogus zeroinstance2 = new Bogus(0);
+ /** A constant. */
+ private final Bogus plus100instance1 = new Bogus(100);
+ /** A constant. */
+ private final Bogus plus100instance2 = new Bogus(100);
+
+ /**
+ * Wraps an primitive int. Used only for testing.
+ */
+ private final class Bogus implements ComparablePlus<Bogus> {
+
+ /** The wrapped value. */
+ private Integer theInteger;
+
+ /**
+ * Constructor.
+ * @param theInteger The wrapped value.
+ */
+ private Bogus(final int theInteger) {
+ this.theInteger = theInteger;
+ }
+
+ @Override
+ public int compareTo(final Bogus o) {
+ return this.theInteger.compareTo(o.theInteger);
+ }
+ }
+
+ /**
+ * Tests of {@link #isEqualTo(Bogus)}.
+ */
+ @Test
+ public void isEqualToTests() {
+ assertTrue(minus100instance1.isEqualTo(minus100instance1));
+ assertTrue(minus100instance1.isEqualTo(minus100instance2));
+ assertFalse(minus100instance1.isEqualTo(zeroinstance1));
+ assertFalse(minus100instance1.isEqualTo(zeroinstance2));
+ assertFalse(minus100instance1.isEqualTo(plus100instance1));
+ assertFalse(minus100instance1.isEqualTo(plus100instance2));
+
+ assertTrue(minus100instance2.isEqualTo(minus100instance1));
+ assertTrue(minus100instance2.isEqualTo(minus100instance2));
+ assertFalse(minus100instance2.isEqualTo(zeroinstance1));
+ assertFalse(minus100instance2.isEqualTo(zeroinstance2));
+ assertFalse(minus100instance2.isEqualTo(plus100instance1));
+ assertFalse(minus100instance2.isEqualTo(plus100instance2));
+
+ assertFalse(zeroinstance1.isEqualTo(minus100instance1));
+ assertFalse(zeroinstance1.isEqualTo(minus100instance2));
+ assertTrue(zeroinstance1.isEqualTo(zeroinstance1));
+ assertTrue(zeroinstance1.isEqualTo(zeroinstance2));
+ assertFalse(zeroinstance1.isEqualTo(plus100instance1));
+ assertFalse(zeroinstance1.isEqualTo(plus100instance2));
+
+ assertFalse(zeroinstance2.isEqualTo(minus100instance1));
+ assertFalse(zeroinstance2.isEqualTo(minus100instance2));
+ assertTrue(zeroinstance2.isEqualTo(zeroinstance1));
+ assertTrue(zeroinstance2.isEqualTo(zeroinstance2));
+ assertFalse(zeroinstance2.isEqualTo(plus100instance1));
+ assertFalse(zeroinstance2.isEqualTo(plus100instance2));
+
+ assertFalse(plus100instance1.isEqualTo(minus100instance1));
+ assertFalse(plus100instance1.isEqualTo(minus100instance2));
+ assertFalse(plus100instance1.isEqualTo(zeroinstance1));
+ assertFalse(plus100instance1.isEqualTo(zeroinstance2));
+ assertTrue(plus100instance1.isEqualTo(plus100instance1));
+ assertTrue(plus100instance1.isEqualTo(plus100instance2));
+
+ assertFalse(plus100instance2.isEqualTo(minus100instance1));
+ assertFalse(plus100instance2.isEqualTo(minus100instance2));
+ assertFalse(plus100instance2.isEqualTo(zeroinstance1));
+ assertFalse(plus100instance2.isEqualTo(zeroinstance2));
+ assertTrue(plus100instance2.isEqualTo(plus100instance1));
+ assertTrue(plus100instance2.isEqualTo(plus100instance2));
+ }
+
+ /**
+ * Tests of {@link #isNotEqualTo(Bogus)}.
+ */
+ @Test
+ public void isNotEqualToTests() {
+ assertFalse(minus100instance1.isNotEqualTo(minus100instance1));
+ assertFalse(minus100instance1.isNotEqualTo(minus100instance2));
+ assertTrue(minus100instance1.isNotEqualTo(zeroinstance1));
+ assertTrue(minus100instance1.isNotEqualTo(zeroinstance2));
+ assertTrue(minus100instance1.isNotEqualTo(plus100instance1));
+ assertTrue(minus100instance1.isNotEqualTo(plus100instance2));
+
+ assertFalse(minus100instance2.isNotEqualTo(minus100instance1));
+ assertFalse(minus100instance2.isNotEqualTo(minus100instance2));
+ assertTrue(minus100instance2.isNotEqualTo(zeroinstance1));
+ assertTrue(minus100instance2.isNotEqualTo(zeroinstance2));
+ assertTrue(minus100instance2.isNotEqualTo(plus100instance1));
+ assertTrue(minus100instance2.isNotEqualTo(plus100instance2));
+
+ assertTrue(zeroinstance1.isNotEqualTo(minus100instance1));
+ assertTrue(zeroinstance1.isNotEqualTo(minus100instance2));
+ assertFalse(zeroinstance1.isNotEqualTo(zeroinstance1));
+ assertFalse(zeroinstance1.isNotEqualTo(zeroinstance2));
+ assertTrue(zeroinstance1.isNotEqualTo(plus100instance1));
+ assertTrue(zeroinstance1.isNotEqualTo(plus100instance2));
+
+ assertTrue(zeroinstance2.isNotEqualTo(minus100instance1));
+ assertTrue(zeroinstance2.isNotEqualTo(minus100instance2));
+ assertFalse(zeroinstance2.isNotEqualTo(zeroinstance1));
+ assertFalse(zeroinstance2.isNotEqualTo(zeroinstance2));
+ assertTrue(zeroinstance2.isNotEqualTo(plus100instance1));
+ assertTrue(zeroinstance2.isNotEqualTo(plus100instance2));
+
+ assertTrue(plus100instance1.isNotEqualTo(minus100instance1));
+ assertTrue(plus100instance1.isNotEqualTo(minus100instance2));
+ assertTrue(plus100instance1.isNotEqualTo(zeroinstance1));
+ assertTrue(plus100instance1.isNotEqualTo(zeroinstance2));
+ assertFalse(plus100instance1.isNotEqualTo(plus100instance1));
+ assertFalse(plus100instance1.isNotEqualTo(plus100instance2));
+
+ assertTrue(plus100instance2.isNotEqualTo(minus100instance1));
+ assertTrue(plus100instance2.isNotEqualTo(minus100instance2));
+ assertTrue(plus100instance2.isNotEqualTo(zeroinstance1));
+ assertTrue(plus100instance2.isNotEqualTo(zeroinstance2));
+ assertFalse(plus100instance2.isNotEqualTo(plus100instance1));
+ assertFalse(plus100instance2.isNotEqualTo(plus100instance2));
+ }
+
+ /**
+ * Tests of {@link #isGreaterThan(Bogus)}.
+ */
+ @Test
+ public void isGreaterThanTests() {
+ assertFalse(minus100instance1.isGreaterThan(minus100instance1));
+ assertFalse(minus100instance1.isGreaterThan(minus100instance2));
+ assertFalse(minus100instance1.isGreaterThan(zeroinstance1));
+ assertFalse(minus100instance1.isGreaterThan(zeroinstance2));
+ assertFalse(minus100instance1.isGreaterThan(plus100instance1));
+ assertFalse(minus100instance1.isGreaterThan(plus100instance2));
+
+ assertFalse(minus100instance2.isGreaterThan(minus100instance1));
+ assertFalse(minus100instance2.isGreaterThan(minus100instance2));
+ assertFalse(minus100instance2.isGreaterThan(zeroinstance1));
+ assertFalse(minus100instance2.isGreaterThan(zeroinstance2));
+ assertFalse(minus100instance2.isGreaterThan(plus100instance1));
+ assertFalse(minus100instance2.isGreaterThan(plus100instance2));
+
+ assertTrue(zeroinstance1.isGreaterThan(minus100instance1));
+ assertTrue(zeroinstance1.isGreaterThan(minus100instance2));
+ assertFalse(zeroinstance1.isGreaterThan(zeroinstance1));
+ assertFalse(zeroinstance1.isGreaterThan(zeroinstance2));
+ assertFalse(zeroinstance1.isGreaterThan(plus100instance1));
+ assertFalse(zeroinstance1.isGreaterThan(plus100instance2));
+
+ assertTrue(zeroinstance2.isGreaterThan(minus100instance1));
+ assertTrue(zeroinstance2.isGreaterThan(minus100instance2));
+ assertFalse(zeroinstance2.isGreaterThan(zeroinstance1));
+ assertFalse(zeroinstance2.isGreaterThan(zeroinstance2));
+ assertFalse(zeroinstance2.isGreaterThan(plus100instance1));
+ assertFalse(zeroinstance2.isGreaterThan(plus100instance2));
+
+ assertTrue(plus100instance1.isGreaterThan(minus100instance1));
+ assertTrue(plus100instance1.isGreaterThan(minus100instance2));
+ assertTrue(plus100instance1.isGreaterThan(zeroinstance1));
+ assertTrue(plus100instance1.isGreaterThan(zeroinstance2));
+ assertFalse(plus100instance1.isGreaterThan(plus100instance1));
+ assertFalse(plus100instance1.isGreaterThan(plus100instance2));
+
+ assertTrue(plus100instance2.isGreaterThan(minus100instance1));
+ assertTrue(plus100instance2.isGreaterThan(minus100instance2));
+ assertTrue(plus100instance2.isGreaterThan(zeroinstance1));
+ assertTrue(plus100instance2.isGreaterThan(zeroinstance2));
+ assertFalse(plus100instance2.isGreaterThan(plus100instance1));
+ assertFalse(plus100instance2.isGreaterThan(plus100instance2));
+ }
+
+ /**
+ * Tests of {@link #isGreaterThanOrEqualTo(Bogus)}.
+ */
+ @Test
+ public void isGreaterThanOrEqualToTests() {
+ assertTrue(minus100instance1.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(minus100instance1.isGreaterThanOrEqualTo(minus100instance2));
+ assertFalse(minus100instance1.isGreaterThanOrEqualTo(zeroinstance1));
+ assertFalse(minus100instance1.isGreaterThanOrEqualTo(zeroinstance2));
+ assertFalse(minus100instance1.isGreaterThanOrEqualTo(plus100instance1));
+ assertFalse(minus100instance1.isGreaterThanOrEqualTo(plus100instance2));
+
+ assertTrue(minus100instance2.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(minus100instance2.isGreaterThanOrEqualTo(minus100instance2));
+ assertFalse(minus100instance2.isGreaterThanOrEqualTo(zeroinstance1));
+ assertFalse(minus100instance2.isGreaterThanOrEqualTo(zeroinstance2));
+ assertFalse(minus100instance2.isGreaterThanOrEqualTo(plus100instance1));
+ assertFalse(minus100instance2.isGreaterThanOrEqualTo(plus100instance2));
+
+ assertTrue(zeroinstance1.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(zeroinstance1.isGreaterThanOrEqualTo(minus100instance2));
+ assertTrue(zeroinstance1.isGreaterThanOrEqualTo(zeroinstance1));
+ assertTrue(zeroinstance1.isGreaterThanOrEqualTo(zeroinstance2));
+ assertFalse(zeroinstance1.isGreaterThanOrEqualTo(plus100instance1));
+ assertFalse(zeroinstance1.isGreaterThanOrEqualTo(plus100instance2));
+
+ assertTrue(zeroinstance2.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(zeroinstance2.isGreaterThanOrEqualTo(minus100instance2));
+ assertTrue(zeroinstance2.isGreaterThanOrEqualTo(zeroinstance1));
+ assertTrue(zeroinstance2.isGreaterThanOrEqualTo(zeroinstance2));
+ assertFalse(zeroinstance2.isGreaterThanOrEqualTo(plus100instance1));
+ assertFalse(zeroinstance2.isGreaterThanOrEqualTo(plus100instance2));
+
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(minus100instance2));
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(zeroinstance1));
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(zeroinstance2));
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(plus100instance1));
+ assertTrue(plus100instance1.isGreaterThanOrEqualTo(plus100instance2));
+
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(minus100instance1));
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(minus100instance2));
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(zeroinstance1));
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(zeroinstance2));
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(plus100instance1));
+ assertTrue(plus100instance2.isGreaterThanOrEqualTo(plus100instance2));
+ }
+
+ /**
+ * Tests of {@link #isLessThan(Bogus)}.
+ */
+ @Test
+ public void isLessThanTests() {
+ assertFalse(minus100instance1.isLessThan(minus100instance1));
+ assertFalse(minus100instance1.isLessThan(minus100instance2));
+ assertTrue(minus100instance1.isLessThan(zeroinstance1));
+ assertTrue(minus100instance1.isLessThan(zeroinstance2));
+ assertTrue(minus100instance1.isLessThan(plus100instance1));
+ assertTrue(minus100instance1.isLessThan(plus100instance2));
+
+ assertFalse(minus100instance2.isLessThan(minus100instance1));
+ assertFalse(minus100instance2.isLessThan(minus100instance2));
+ assertTrue(minus100instance2.isLessThan(zeroinstance1));
+ assertTrue(minus100instance2.isLessThan(zeroinstance2));
+ assertTrue(minus100instance2.isLessThan(plus100instance1));
+ assertTrue(minus100instance2.isLessThan(plus100instance2));
+
+ assertFalse(zeroinstance1.isLessThan(minus100instance1));
+ assertFalse(zeroinstance1.isLessThan(minus100instance2));
+ assertFalse(zeroinstance1.isLessThan(zeroinstance1));
+ assertFalse(zeroinstance1.isLessThan(zeroinstance2));
+ assertTrue(zeroinstance1.isLessThan(plus100instance1));
+ assertTrue(zeroinstance1.isLessThan(plus100instance2));
+
+ assertFalse(zeroinstance2.isLessThan(minus100instance1));
+ assertFalse(zeroinstance2.isLessThan(minus100instance2));
+ assertFalse(zeroinstance2.isLessThan(zeroinstance1));
+ assertFalse(zeroinstance2.isLessThan(zeroinstance2));
+ assertTrue(zeroinstance2.isLessThan(plus100instance1));
+ assertTrue(zeroinstance2.isLessThan(plus100instance2));
+
+ assertFalse(plus100instance1.isLessThan(minus100instance1));
+ assertFalse(plus100instance1.isLessThan(minus100instance2));
+ assertFalse(plus100instance1.isLessThan(zeroinstance1));
+ assertFalse(plus100instance1.isLessThan(zeroinstance2));
+ assertFalse(plus100instance1.isLessThan(plus100instance1));
+ assertFalse(plus100instance1.isLessThan(plus100instance2));
+
+ assertFalse(plus100instance2.isLessThan(minus100instance1));
+ assertFalse(plus100instance2.isLessThan(minus100instance2));
+ assertFalse(plus100instance2.isLessThan(zeroinstance1));
+ assertFalse(plus100instance2.isLessThan(zeroinstance2));
+ assertFalse(plus100instance2.isLessThan(plus100instance1));
+ assertFalse(plus100instance2.isLessThan(plus100instance2));
+ }
+
+ /**
+ * Tests of {@link #isLessThanOrEqualTo(Bogus)}.
+ */
+ @Test
+ public void isLessThanOrEqualToTests() {
+ assertTrue(minus100instance1.isLessThanOrEqualTo(minus100instance1));
+ assertTrue(minus100instance1.isLessThanOrEqualTo(minus100instance2));
+ assertTrue(minus100instance1.isLessThanOrEqualTo(zeroinstance1));
+ assertTrue(minus100instance1.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(minus100instance1.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(minus100instance1.isLessThanOrEqualTo(plus100instance2));
+
+ assertTrue(minus100instance2.isLessThanOrEqualTo(minus100instance1));
+ assertTrue(minus100instance2.isLessThanOrEqualTo(minus100instance2));
+ assertTrue(minus100instance2.isLessThanOrEqualTo(zeroinstance1));
+ assertTrue(minus100instance2.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(minus100instance2.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(minus100instance2.isLessThanOrEqualTo(plus100instance2));
+
+ assertFalse(zeroinstance1.isLessThanOrEqualTo(minus100instance1));
+ assertFalse(zeroinstance1.isLessThanOrEqualTo(minus100instance2));
+ assertTrue(zeroinstance1.isLessThanOrEqualTo(zeroinstance1));
+ assertTrue(zeroinstance1.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(zeroinstance1.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(zeroinstance1.isLessThanOrEqualTo(plus100instance2));
+
+ assertFalse(zeroinstance2.isLessThanOrEqualTo(minus100instance1));
+ assertFalse(zeroinstance2.isLessThanOrEqualTo(minus100instance2));
+ assertTrue(zeroinstance2.isLessThanOrEqualTo(zeroinstance1));
+ assertTrue(zeroinstance2.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(zeroinstance2.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(zeroinstance2.isLessThanOrEqualTo(plus100instance2));
+
+ assertFalse(plus100instance1.isLessThanOrEqualTo(minus100instance1));
+ assertFalse(plus100instance1.isLessThanOrEqualTo(minus100instance2));
+ assertFalse(plus100instance1.isLessThanOrEqualTo(zeroinstance1));
+ assertFalse(plus100instance1.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(plus100instance1.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(plus100instance1.isLessThanOrEqualTo(plus100instance2));
+
+ assertFalse(plus100instance2.isLessThanOrEqualTo(minus100instance1));
+ assertFalse(plus100instance2.isLessThanOrEqualTo(minus100instance2));
+ assertFalse(plus100instance2.isLessThanOrEqualTo(zeroinstance1));
+ assertFalse(plus100instance2.isLessThanOrEqualTo(zeroinstance2));
+ assertTrue(plus100instance2.isLessThanOrEqualTo(plus100instance1));
+ assertTrue(plus100instance2.isLessThanOrEqualTo(plus100instance2));
+ }
+
+}
Property changes on: trunk/foray/foray-common/src/test/java/org/foray/common/ComparablePlusTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutableTokenFlowLocation.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutableTokenFlowLocation.java 2022-12-11 16:15:34 UTC (rev 12827)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/MutableTokenFlowLocation.java 2022-12-11 16:37:14 UTC (rev 12828)
@@ -28,6 +28,8 @@
package org.foray.orthography;
+import org.foray.common.ComparablePlus;
+
import org.axsl.orthography.TextTokenFlow;
import org.axsl.orthography.TextTokenFlowLocation;
@@ -34,7 +36,7 @@
/**
* A mutable version of {@link TextTokenFlowLocation}, useful when iterating locations.
*/
-public class MutableTokenFlowLocation implements TextTokenFlowLocation {
+public class MutableTokenFlowLocation implements TextTokenFlowLocation, ComparablePlus<TextTokenFlowLocation> {
/** The token index. See {@link TextTokenFlow.Location#getTokenIndex()}. */
private int tokenIndex;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2022-12-11 16:15:36
|
Revision: 12827
http://sourceforge.net/p/foray/code/12827
Author: victormote
Date: 2022-12-11 16:15:34 +0000 (Sun, 11 Dec 2022)
Log Message:
-----------
Conform to aXSL change: Move XmlConstants to axsl-constants.
Modified Paths:
--------------
trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java 2022-12-11 15:17:02 UTC (rev 12826)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/svg/SvgUtilities.java 2022-12-11 16:15:34 UTC (rev 12827)
@@ -28,8 +28,8 @@
package org.foray.render.svg;
+import org.axsl.constants.XmlConstants;
import org.axsl.graphic.SvgGraphic;
-import org.axsl.utility.xml.XmlConstants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|