foray-commit Mailing List for FOray
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
(4) |
Dec
(23) |
| 2026 |
Jan
(119) |
Feb
(335) |
Mar
(103) |
Apr
(29) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2026-04-26 17:17:34
|
Revision: 14492
http://sourceforge.net/p/foray/code/14492
Author: victormote
Date: 2026-04-26 17:17:33 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Change method names, for greater consistency with BigDecimal. Also, reverse the order of scale and unscaledValue, also for consistency with BigDecimal.
Modified Paths:
--------------
trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-26 16:33:37 UTC (rev 14491)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-26 17:17:33 UTC (rev 14492)
@@ -41,15 +41,15 @@
/** The default male voice. The medium frequency used to create this voice (120 Hz) is derived from the CSS
* specification for the "pitch" property. */
- public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimal32.acquire("120"));
+ public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimal32.valueOf("120"));
/** The default female voice. The medium frequency used to create this voice (210 Hz) is derived from the CSS
* specification for the "pitch" property.*/
- public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimal32.acquire("210"));
+ public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimal32.valueOf("210"));
/** The default child voice. The medium frequency used to create this voice (270 Hz) is estimated relative to that
* for the female voice (210 Hz). */
- public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimal32.acquire("270"));
+ public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimal32.valueOf("270"));
/** The voice to be used when no other can be found. */
public static final Voice4a DEFAULT_VOICE = SpeechServer4a.DEFAULT_VOICE_MALE;
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-26 16:33:37 UTC (rev 14491)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-26 17:17:33 UTC (rev 14492)
@@ -38,20 +38,20 @@
public class Voice4a implements Voice {
/** The default factor by which the "medium" pitch should be adjusted to compute the extra-low frequency. */
- private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimal32.acquire(".8");
+ private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimal32.valueOf(".8");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to compute the low frequency. */
- private static final FixedDecimal FACTOR_LOW = FixedDecimal32.acquire(".9");
+ private static final FixedDecimal FACTOR_LOW = FixedDecimal32.valueOf(".9");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to compute the high frequency. */
- private static final FixedDecimal FACTOR_HIGH = FixedDecimal32.acquire("1.1");
+ private static final FixedDecimal FACTOR_HIGH = FixedDecimal32.valueOf("1.1");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-high frequencey. */
- private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimal32.acquire("1.2");
+ private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimal32.valueOf("1.2");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The normal pitch for the "medium" frequency for this voice. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-26 16:33:40
|
Revision: 14491
http://sourceforge.net/p/foray/code/14491
Author: victormote
Date: 2026-04-26 16:33:37 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Fix some javadoc complaints.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/UniversalProtocolRegistration.java
trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlFactory.java
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 2026-04-26 15:29:38 UTC (rev 14490)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/TernaryTree.java 2026-04-26 16:33:37 UTC (rev 14491)
@@ -80,7 +80,7 @@
* Compressed branches are decompressed as needed when another key with same prefix is inserted.
* This saves a lot of space, especially for long keys.</p>
*
- * @see TernaryTreeMap for a wrapper that implements the {@link java.util.Map} interface.
+ * <p>The {@link TernaryTreeMap} wraps an instance of this class and implements the {@link java.util.Map} interface.</p>
*/
public class TernaryTree implements Cloneable, Serializable {
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/url/UniversalProtocolRegistration.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/url/UniversalProtocolRegistration.java 2026-04-26 15:29:38 UTC (rev 14490)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/url/UniversalProtocolRegistration.java 2026-04-26 16:33:37 UTC (rev 14491)
@@ -32,38 +32,33 @@
package org.foray.common.url;
-
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
/**
- * Registers URL protocols in a universal manner, attempting first to register
- * using a {@link URLStreamHandlerFactory}, then using the Java properties
- * method as a fallback.
- * @see FactoryProtocolRegistration which registers using only the
- * {@link URLStreamHandlerFactory} scheme.
- * @see PropertyProtocolRegistration which registers using only the Java
- * properties scheme.
+ * <p>Registers URL protocols in a universal manner, attempting first to register using a
+ * {@link URLStreamHandlerFactory}, then using the Java properties method as a fallback.</p>
+ *
+ * <p>See {@link FactoryProtocolRegistration} which registers using only the {@link URLStreamHandlerFactory} scheme.</p>
+ *
+ * <p>See {@link PropertyProtocolRegistration} which registers using only the Java properties scheme.</p>
*/
-public class UniversalProtocolRegistration
- implements ProtocolRegistrationStrategy {
+public class UniversalProtocolRegistration implements ProtocolRegistrationStrategy {
/**
- * The object which will actually do the registration. The
- * URLStreamHandlerFactory will first be tried; if it fails, the
- * property-based method will be used as a fallback.
+ * The object which will actually do the registration.
+ * The URLStreamHandlerFactory will first be tried; if it fails, the property-based method will be used as a
+ * fallback.
*/
private ProtocolRegistrationStrategy delegate;
/**
* Package-private constructor.
- * Use
- * {@link ProtocolRegistrationBroker#setStandardRegistrationStrategy(int)}
- * to use this standard registration scheme.
+ * Use {@link ProtocolRegistrationBroker#setStandardRegistrationStrategy(int)} to use this standard registration
+ * scheme.
*/
UniversalProtocolRegistration() {
- final FactoryProtocolRegistration factory =
- new FactoryProtocolRegistration();
+ final FactoryProtocolRegistration factory = new FactoryProtocolRegistration();
if (factory.isValid()) {
this.delegate = factory;
} else {
@@ -72,8 +67,7 @@
}
@Override
- public void registerProtocolHandler(final String protocol,
- final URLStreamHandler handler) {
+ public void registerProtocolHandler(final String protocol, final URLStreamHandler handler) {
this.delegate.registerProtocolHandler(protocol, handler);
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlFactory.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlFactory.java 2026-04-26 15:29:38 UTC (rev 14490)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/url/UrlFactory.java 2026-04-26 16:33:37 UTC (rev 14491)
@@ -33,19 +33,16 @@
import java.net.URLStreamHandler;
/**
- * Creates URL instances using the FOray custom {@link URLStreamHandler}
- * capabilities.
- * The public methods in this class have a one-to-one correspondence with
- * the {@link URL} constructors, and are intended to be a replacement for them.
- * This class essentially interposes itself between the calling code and the
- * {@link URL} constructors to use its own {@link URLStreamHandler} resolution.
- * This is needed because there is no clean way to be assured that the
- * {@link URL} constructors use the desired custom {@link URLStreamHandler}
- * implementation.
+ * <p>Creates URL instances using the FOray custom {@link URLStreamHandler} capabilities.
+ * The public methods in this class have a one-to-one correspondence with the {@link URL} constructors, and are intended
+ * to be a replacement for them.
+ * This class essentially interposes itself between the calling code and the {@link URL} constructors to use its own
+ * {@link URLStreamHandler} resolution.
+ * This is needed because there is no clean way to be assured that the {@link URL} constructors use the desired custom
+ * {@link URLStreamHandler} implementation.</p>
*
- * @see ProtocolRegistrationBroker where the various strategies for dealing with
- * custom {@link URLStreamHandler} implementations are discussed, and where
- * one can be selected.
+ * <p>See {@link ProtocolRegistrationBroker} where the various strategies for dealing with custom
+ * {@link URLStreamHandler} implementations are discussed, and where one can be selected.</p>
*/
public final class UrlFactory {
@@ -64,8 +61,7 @@
* @throws MalformedURLException If an unknown protocol is specified.
* @see URL#URL(java.lang.String) which this method mimics.
*/
- public static URL createURL(final String spec)
- throws MalformedURLException {
+ public static URL createURL(final String spec) throws MalformedURLException {
/* Mimics logic in URL. */
return createURL(null, spec);
}
@@ -78,11 +74,10 @@
* @param file The file on the host.
* @return The newly created URL.
* @throws MalformedURLException If an unknown protocol is specified.
- * @see URL#URL(java.lang.String, java.lang.String, int, java.lang.String)
- * which this method mimics.
+ * @see URL#URL(java.lang.String, java.lang.String, int, java.lang.String) which this method mimics.
*/
- public static URL createURL(final String protocol, final String host,
- final int port, final String file) throws MalformedURLException {
+ public static URL createURL(final String protocol, final String host, final int port, final String file)
+ throws MalformedURLException {
/* Mimics logic in URL. */
return createURL(protocol, host, port, file, null);
}
@@ -96,12 +91,11 @@
* @param handler The stream handler for the URL.
* @return The newly created URL.
* @throws MalformedURLException If an unknown protocol is specified.
- * @see URL#URL(java.lang.String, java.lang.String, int, java.lang.String,
- * java.net.URLStreamHandler) which this method mimics.
+ * @see URL#URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler) which this
+ * method mimics.
*/
- public static URL createURL(final String protocol, final String host,
- final int port, final String file, final URLStreamHandler handler)
- throws MalformedURLException {
+ public static URL createURL(final String protocol, final String host, final int port, final String file,
+ final URLStreamHandler handler) throws MalformedURLException {
URLStreamHandler handlerToUse = handler;
if (handlerToUse == null) {
/* Interposes to use the custom URLStreamHandler registration. */
@@ -118,11 +112,10 @@
* @param file The file on the host.
* @return The newly created URL.
* @throws MalformedURLException If an unknown protocol is specified.
- * @see URL#URL(java.lang.String, java.lang.String, java.lang.String)
- * which this method mimics.
+ * @see URL#URL(java.lang.String, java.lang.String, java.lang.String) which this method mimics.
*/
- public static URL createURL(final String protocol, final String host,
- final String file) throws MalformedURLException {
+ public static URL createURL(final String protocol, final String host, final String file)
+ throws MalformedURLException {
/* Mimics logic in URL. */
return createURL(protocol, host, -1, file);
}
@@ -135,8 +128,7 @@
* @throws MalformedURLException If an unknown protocol is specified.
* @see URL#URL(java.net.URL, java.lang.String) which this method mimics.
*/
- public static URL createURL(final URL context, final String spec)
- throws MalformedURLException {
+ public static URL createURL(final URL context, final String spec) throws MalformedURLException {
/* Mimics logic in URL. */
return createURL(context, spec, null);
}
@@ -148,11 +140,10 @@
* @param handler The stream handler for the URL.
* @return The newly created URL.
* @throws MalformedURLException If an unknown protocol is specified.
- * @see URL#URL(java.net.URL, java.lang.String, java.net.URLStreamHandler)
- * which this method mimics.
+ * @see URL#URL(java.net.URL, java.lang.String, java.net.URLStreamHandler) which this method mimics.
*/
- public static URL createURL(final URL context, final String spec,
- final URLStreamHandler handler) throws MalformedURLException {
+ public static URL createURL(final URL context, final String spec, final URLStreamHandler handler)
+ throws MalformedURLException {
URLStreamHandler handlerToUse = handler;
if (handlerToUse == null) {
/* Interposes to use the custom URLStreamHandler registration. */
@@ -164,23 +155,19 @@
}
/**
- * Provides a custom stream handler for a given protocol, if there is one
- * registered.
+ * Provides a custom stream handler for a given protocol, if there is one registered.
* @param protocol The protocol for which a custom stream handler is sought.
* @return The custom stream handler, or null if none is registered.
*/
- private static URLStreamHandler getCustomURLStreamHandler(
- final String protocol) {
+ private static URLStreamHandler getCustomURLStreamHandler(final String protocol) {
return ProtocolRegistrationBroker.getURLStreamHandler(protocol);
}
/**
* Extracts the protocol portion of a URL specification.
- * @param spec The URL specifications from which a protocol should be
- * extracted.
+ * @param spec The URL specifications from which a protocol should be extracted.
* @return The extracted protocol.
- * @see URL#URL(java.net.URL, java.lang.String, java.net.URLStreamHandler)
- * from which this code is derived.
+ * @see URL#URL(java.net.URL, java.lang.String, java.net.URLStreamHandler) from which this code is derived.
*/
public static String parseProtocol(final String spec) {
int i;
@@ -225,8 +212,7 @@
/**
* Returns true if specified string is a valid protocol name.
- * This method is derived from the {@link URL} method with the same
- * signature.
+ * This method is derived from the {@link URL} method with the same signature.
* @param protocol The String to be tested for validity.
* @return True if and only if the protocol is valid.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-26 15:29:40
|
Revision: 14490
http://sourceforge.net/p/foray/code/14490
Author: victormote
Date: 2026-04-26 15:29:38 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Rename FixedDecimal implementation classes for clarity.
Modified Paths:
--------------
trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-26 04:59:17 UTC (rev 14489)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-26 15:29:38 UTC (rev 14490)
@@ -28,7 +28,7 @@
package org.foray.speech;
-import org.axsl.primitive.fixed.FixedDecimalImpl;
+import org.axsl.primitive.fixed.FixedDecimal32;
import org.axsl.speech.SpeechServer;
import org.axsl.speech.Voice;
@@ -41,15 +41,15 @@
/** The default male voice. The medium frequency used to create this voice (120 Hz) is derived from the CSS
* specification for the "pitch" property. */
- public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimalImpl.acquire("120"));
+ public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimal32.acquire("120"));
/** The default female voice. The medium frequency used to create this voice (210 Hz) is derived from the CSS
* specification for the "pitch" property.*/
- public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimalImpl.acquire("210"));
+ public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimal32.acquire("210"));
/** The default child voice. The medium frequency used to create this voice (270 Hz) is estimated relative to that
* for the female voice (210 Hz). */
- public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimalImpl.acquire("270"));
+ public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimal32.acquire("270"));
/** The voice to be used when no other can be found. */
public static final Voice4a DEFAULT_VOICE = SpeechServer4a.DEFAULT_VOICE_MALE;
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-26 04:59:17 UTC (rev 14489)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-26 15:29:38 UTC (rev 14490)
@@ -29,7 +29,7 @@
package org.foray.speech;
import org.axsl.primitive.fixed.FixedDecimal;
-import org.axsl.primitive.fixed.FixedDecimalImpl;
+import org.axsl.primitive.fixed.FixedDecimal32;
import org.axsl.speech.Voice;
/**
@@ -37,24 +37,21 @@
*/
public class Voice4a implements Voice {
- /** The default factor by which the "medium" pitch should be adjusted to
- * compute the extra-low frequencey. */
- private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimalImpl.acquire(".8");
+ /** The default factor by which the "medium" pitch should be adjusted to compute the extra-low frequency. */
+ private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimal32.acquire(".8");
/* TODO: This is a pure guess. Find some better way of estimating. */
- /** The default factor by which the "medium" pitch should be adjusted to
- * compute the low frequencey. */
- private static final FixedDecimal FACTOR_LOW = FixedDecimalImpl.acquire(".9");
+ /** The default factor by which the "medium" pitch should be adjusted to compute the low frequency. */
+ private static final FixedDecimal FACTOR_LOW = FixedDecimal32.acquire(".9");
/* TODO: This is a pure guess. Find some better way of estimating. */
- /** The default factor by which the "medium" pitch should be adjusted to
- * compute the high frequencey. */
- private static final FixedDecimal FACTOR_HIGH = FixedDecimalImpl.acquire("1.1");
+ /** The default factor by which the "medium" pitch should be adjusted to compute the high frequency. */
+ private static final FixedDecimal FACTOR_HIGH = FixedDecimal32.acquire("1.1");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-high frequencey. */
- private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimalImpl.acquire("1.2");
+ private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimal32.acquire("1.2");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The normal pitch for the "medium" frequency for this voice. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-26 04:59:20
|
Revision: 14489
http://sourceforge.net/p/foray/code/14489
Author: victormote
Date: 2026-04-26 04:59:17 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Fix various javadoc-related problems.
Modified Paths:
--------------
trunk/foray/buildSrc/src/main/groovy/foray.java-library-conventions.gradle
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/package-info.java
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/pattern/package-info.java
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/shading/package-info.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/package-info.java
Modified: trunk/foray/buildSrc/src/main/groovy/foray.java-library-conventions.gradle
===================================================================
--- trunk/foray/buildSrc/src/main/groovy/foray.java-library-conventions.gradle 2026-04-26 02:55:39 UTC (rev 14488)
+++ trunk/foray/buildSrc/src/main/groovy/foray.java-library-conventions.gradle 2026-04-26 04:59:17 UTC (rev 14489)
@@ -5,4 +5,9 @@
id 'java-library'
}
+tasks.withType(Javadoc) {
+ /* We use checkstyle for this purpose. Suppress javadoc direct complaints. */
+ options.addStringOption('Xdoclint:none', '-quiet')
+}
+
/* Last line of script. */
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/package-info.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/package-info.java 2026-04-26 02:55:39 UTC (rev 14488)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/package-info.java 2026-04-26 04:59:17 UTC (rev 14489)
@@ -27,7 +27,7 @@
*/
/**
- * <p>Implementation of the Knuth-Plass line-breaking model. See {@link org.axsl.linebreak} for more information.</p>
+ * <p>Implementation of the Knuth-Plass line-breaking model in axsl-linebreak.</p>
*/
package org.foray.linebreak;
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/pattern/package-info.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/pattern/package-info.java 2026-04-26 02:55:39 UTC (rev 14488)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/pattern/package-info.java 2026-04-26 04:59:17 UTC (rev 14489)
@@ -27,6 +27,6 @@
*/
/**
- * Serializers for {@link org.foray.pdf.graphics.pattern}.
+ * Serializers for PDF pattern classes.
*/
package org.foray.pdfSerial.graphics.pattern;
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/shading/package-info.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/shading/package-info.java 2026-04-26 02:55:39 UTC (rev 14488)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/shading/package-info.java 2026-04-26 04:59:17 UTC (rev 14489)
@@ -27,6 +27,6 @@
*/
/**
- * Serializers for {@link org.foray.pdf.graphics.shading}.
+ * Serializers for PDF shading classes.
*/
package org.foray.pdfSerial.graphics.shading;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/package-info.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/package-info.java 2026-04-26 02:55:39 UTC (rev 14488)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/package-info.java 2026-04-26 04:59:17 UTC (rev 14489)
@@ -27,7 +27,7 @@
*/
/**
- * Implementations of the interfaces in {@link org.axsl.primitive.sequence}.
+ * Implementations of the interfaces in axsl-primitive.
* Wrappers of primitive arrays, intended to make array handling more safe and more flexible, and to make code using
* them more fluent.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-26 02:55:42
|
Revision: 14488
http://sourceforge.net/p/foray/code/14488
Author: victormote
Date: 2026-04-26 02:55:39 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Move the generated Unicode classes to the correct package.
Modified Paths:
--------------
trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java
trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0000_Basic_Latin.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0080_Latin_1_Supplement.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U2000_General_Punctuation.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U3000_CJK_Symbols_and_Punctuation.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/Ufe70_Arabic_Presentation_Forms_B.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/package-info.java
Added Paths:
-----------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/
Removed Paths:
-------------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/
Modified: trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2026-04-26 02:55:39 UTC (rev 14488)
@@ -22,9 +22,9 @@
<!-- Permanently suppress type name checking and Javadoc on variables for Unicode block classes. -->
<suppress checks="TypeName"
- files="src.main.java.org.foray.unicode.gen.block*"/>
+ files="src.main.java.org.foray.unicode.gen*"/>
<suppress checks="JavadocVariable"
- files="src.main.java.org.foray.unicode.gen.block*"/>
+ files="src.main.java.org.foray.unicode.gen*"/>
<!-- Permanently suppress some tests in the test and test fixture directories. -->
<!-- Permanently suppress Javadoc package documentation for test directories. -->
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 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -29,7 +29,7 @@
package org.foray.area;
import org.foray.common.primitive.XmlCharacterUtils;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.area.AreaTreeException;
import org.axsl.font.FontContext;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -30,7 +30,7 @@
import org.foray.area.link.Link;
import org.foray.common.CharSequenceSubset;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.fotree.fo.FoTextCharacters;
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 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -30,7 +30,7 @@
import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.ByteSequenceSubset;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequencePlus;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -29,7 +29,7 @@
package org.foray.common.i18n;
-import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
import org.axsl.i18n.BaselineType;
import org.axsl.i18n.Script;
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 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -29,7 +29,7 @@
package org.foray.common.data;
import org.foray.primitive.sequence.ByteArray;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -32,10 +32,10 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
import org.foray.ps.encode.CharSet;
-import org.foray.unicode.block.U0000_Basic_Latin;
-import org.foray.unicode.block.U0080_Latin_1_Supplement;
-import org.foray.unicode.block.U2000_General_Punctuation;
-import org.foray.unicode.block.U3000_CJK_Symbols_and_Punctuation;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U3000_CJK_Symbols_and_Punctuation;
import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
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 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -35,7 +35,7 @@
import org.foray.primitive.sequence.IntArrayBuilder;
import org.foray.primitive.sequence.ShortArrayBuilder;
import org.foray.ps.encode.CharSet;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.ConsumerFont;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -29,7 +29,7 @@
package org.foray.font.type1;
import org.foray.font.format.FontContent;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.ps.PsFontDictionary;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -30,7 +30,7 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.font.format.FontParser;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import java.io.IOException;
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -30,7 +30,7 @@
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontFamily;
-import org.foray.unicode.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.gen.block.U0080_Latin_1_Supplement;
import org.axsl.font.FontException;
import org.axsl.font.zzz.FontContextMdo;
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -34,7 +34,7 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.fo.FoKeyword;
import org.foray.fotree.fo.NamespaceFo;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.fo.FoText;
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -28,8 +28,8 @@
package org.foray.fotree.fo.obj;
-import org.foray.unicode.block.U0000_Basic_Latin;
-import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
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 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -32,8 +32,8 @@
import org.foray.primitive.CharacterUtils;
import org.foray.primitive.NumberUtils;
import org.foray.primitive.StringUtils;
-import org.foray.unicode.block.U0000_Basic_Latin;
-import org.foray.unicode.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0080_Latin_1_Supplement;
import org.axsl.i18n.WritingSystem;
import org.axsl.orthography.Lexer;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -32,7 +32,7 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
-import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
import org.axsl.fotree.text.FoWhitespace;
import org.axsl.kp.KpContext;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -29,7 +29,7 @@
package org.foray.orthography;
import org.foray.common.i18n.WritingSystem4a;
-import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
import org.axsl.i18n.WritingSystem;
import org.axsl.orthography.Lexer;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -28,7 +28,7 @@
package org.foray.orthography;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.fotree.text.TextTokenFlowLocation;
import org.axsl.value.LinefeedTreatment;
Modified: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -30,7 +30,7 @@
import org.foray.primitive.StringUtils;
import org.foray.primitive.sequence.ByteArray;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -41,7 +41,7 @@
import org.foray.pdf.graphics.PdfColor4a;
import org.foray.pdf.graphics.pattern.PdfPatternAdapter;
import org.foray.pdf.text.PdfFontAdapter;
-import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -28,7 +28,7 @@
package org.foray.pioneer.lb;
-import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -28,11 +28,11 @@
package org.foray.primitive;
-import org.foray.unicode.block.U0000_Basic_Latin;
-import org.foray.unicode.block.U0080_Latin_1_Supplement;
-import org.foray.unicode.block.U2000_General_Punctuation;
-import org.foray.unicode.block.U3000_CJK_Symbols_and_Punctuation;
-import org.foray.unicode.block.Ufe70_Arabic_Presentation_Forms_B;
+import org.foray.unicode.gen.block.U0000_Basic_Latin;
+import org.foray.unicode.gen.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.gen.block.U2000_General_Punctuation;
+import org.foray.unicode.gen.block.U3000_CJK_Symbols_and_Punctuation;
+import org.foray.unicode.gen.block.Ufe70_Arabic_Presentation_Forms_B;
import org.axsl.constants.PrimitiveConstants;
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0000_Basic_Latin.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0000_Basic_Latin.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -26,7 +26,7 @@
* $LastChangedBy$
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
/**
* Unicode(r) code points for the "Basic Latin" block (0x0 thru 0x7f).
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0080_Latin_1_Supplement.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U0080_Latin_1_Supplement.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -26,7 +26,7 @@
* $LastChangedBy$
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
/**
* Unicode(r) code points for the "Latin-1 Supplement" block (0x80 thru 0xff).
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U2000_General_Punctuation.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U2000_General_Punctuation.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U2000_General_Punctuation.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -26,7 +26,7 @@
* $LastChangedBy$
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
/**
* Unicode(r) code points for the "General Punctuation" block (0x2000 thru 0x206f).
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U3000_CJK_Symbols_and_Punctuation.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U3000_CJK_Symbols_and_Punctuation.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/U3000_CJK_Symbols_and_Punctuation.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -26,7 +26,7 @@
* $LastChangedBy$
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
/**
* Unicode(r) code points for the "CJK Symbols and Punctuation" block (0x3000 thru 0x303f).
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/Ufe70_Arabic_Presentation_Forms_B.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/Ufe70_Arabic_Presentation_Forms_B.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/Ufe70_Arabic_Presentation_Forms_B.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -26,7 +26,7 @@
* $LastChangedBy$
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
/**
* Unicode(r) code points for the "Arabic Presentation Forms-B" block (0xfe70 thru 0xfeff).
Modified: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/package-info.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/package-info.java 2026-04-26 02:06:34 UTC (rev 14487)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/block/package-info.java 2026-04-26 02:55:39 UTC (rev 14488)
@@ -42,4 +42,4 @@
* </ol>
*/
-package org.foray.unicode.block;
+package org.foray.unicode.gen.block;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-26 02:06:37
|
Revision: 14487
http://sourceforge.net/p/foray/code/14487
Author: victormote
Date: 2026-04-26 02:06:34 +0000 (Sun, 26 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Move FixedDecimal implementations to aXSL.
Modified Paths:
--------------
trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
Removed Paths:
-------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-25 23:19:54 UTC (rev 14486)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-26 02:06:34 UTC (rev 14487)
@@ -28,8 +28,7 @@
package org.foray.speech;
-import org.foray.primitive.fixed.FixedDecimal4a;
-
+import org.axsl.primitive.fixed.FixedDecimalImpl;
import org.axsl.speech.SpeechServer;
import org.axsl.speech.Voice;
@@ -42,15 +41,15 @@
/** The default male voice. The medium frequency used to create this voice (120 Hz) is derived from the CSS
* specification for the "pitch" property. */
- public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimal4a.acquire("120"));
+ public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimalImpl.acquire("120"));
/** The default female voice. The medium frequency used to create this voice (210 Hz) is derived from the CSS
* specification for the "pitch" property.*/
- public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimal4a.acquire("210"));
+ public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimalImpl.acquire("210"));
/** The default child voice. The medium frequency used to create this voice (270 Hz) is estimated relative to that
* for the female voice (210 Hz). */
- public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimal4a.acquire("270"));
+ public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimalImpl.acquire("270"));
/** The voice to be used when no other can be found. */
public static final Voice4a DEFAULT_VOICE = SpeechServer4a.DEFAULT_VOICE_MALE;
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-25 23:19:54 UTC (rev 14486)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-26 02:06:34 UTC (rev 14487)
@@ -28,9 +28,8 @@
package org.foray.speech;
-import org.foray.primitive.fixed.FixedDecimal4a;
-
import org.axsl.primitive.fixed.FixedDecimal;
+import org.axsl.primitive.fixed.FixedDecimalImpl;
import org.axsl.speech.Voice;
/**
@@ -40,22 +39,22 @@
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-low frequencey. */
- private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimal4a.acquire(".8");
+ private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimalImpl.acquire(".8");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the low frequencey. */
- private static final FixedDecimal FACTOR_LOW = FixedDecimal4a.acquire(".9");
+ private static final FixedDecimal FACTOR_LOW = FixedDecimalImpl.acquire(".9");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the high frequencey. */
- private static final FixedDecimal FACTOR_HIGH = FixedDecimal4a.acquire("1.1");
+ private static final FixedDecimal FACTOR_HIGH = FixedDecimalImpl.acquire("1.1");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-high frequencey. */
- private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimal4a.acquire("1.2");
+ private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimalImpl.acquire("1.2");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The normal pitch for the "medium" frequency for this voice. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-25 23:19:58
|
Revision: 14486
http://sourceforge.net/p/foray/code/14486
Author: victormote
Date: 2026-04-25 23:19:54 +0000 (Sat, 25 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Move generated Unicode classes to FOray. They are just not needed in aXSL.
Modified Paths:
--------------
trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
trunk/foray/foray-areatree/build.gradle
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
trunk/foray/foray-common/build.gradle
trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-font/build.gradle
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java
trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java
trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java
trunk/foray/foray-fotree/build.gradle
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java
trunk/foray/foray-orthography/build.gradle
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java
trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
trunk/foray/foray-pdf-core/build.gradle
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
trunk/foray/foray-pdf-serial/build.gradle
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java
trunk/foray/foray-pioneer/build.gradle
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
trunk/foray/foray-primitive/build.gradle
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
trunk/foray/foray-unicode/build.gradle
Added Paths:
-----------
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U2000_General_Punctuation.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U3000_CJK_Symbols_and_Punctuation.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/Ufe70_Arabic_Presentation_Forms_B.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/package-info.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/UnicodeScriptExtended.java
trunk/foray/foray-unicode/src/main/java/org/foray/unicode/gen/package-info.java
trunk/foray/foray-unicode/src/test/
trunk/foray/foray-unicode/src/test/java/
trunk/foray/foray-unicode/src/test/java/org/
trunk/foray/foray-unicode/src/test/java/org/foray/
trunk/foray/foray-unicode/src/test/java/org/foray/unicode/
trunk/foray/foray-unicode/src/test/java/org/foray/unicode/gen/
trunk/foray/foray-unicode/src/test/java/org/foray/unicode/gen/UnicodeScriptExtendedTests.java
Modified: trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml
===================================================================
--- trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-00-dev/config/checkstyle/checkstyle-suppressions.xml 2026-04-25 23:19:54 UTC (rev 14486)
@@ -20,6 +20,12 @@
<suppress checks="DeclarationOrder"
files="src.main.java.org.foray.orthography.zzarchive.PatGen.*"/>
+ <!-- Permanently suppress type name checking and Javadoc on variables for Unicode block classes. -->
+ <suppress checks="TypeName"
+ files="src.main.java.org.foray.unicode.gen.block*"/>
+ <suppress checks="JavadocVariable"
+ files="src.main.java.org.foray.unicode.gen.block*"/>
+
<!-- Permanently suppress some tests in the test and test fixture directories. -->
<!-- Permanently suppress Javadoc package documentation for test directories. -->
<suppress checks="JavadocPackage" files="src.test.java.*"/>
Modified: trunk/foray/foray-areatree/build.gradle
===================================================================
--- trunk/foray/foray-areatree/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-areatree/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,6 +30,7 @@
api project(":foray-common")
implementation project(":foray-primitive")
+ implementation project(":foray-unicode")
}
javadoc {
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 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextArea.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -29,6 +29,7 @@
package org.foray.area;
import org.foray.common.primitive.XmlCharacterUtils;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.area.AreaTreeException;
import org.axsl.font.FontContext;
@@ -41,7 +42,6 @@
import org.axsl.galley.render.GalleyVisitor;
import org.axsl.galley.render.GalleyVisitorException;
import org.axsl.galley.trait.CharacterTraitsTa;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import org.axsl.value.WhiteSpaceTreatment;
import java.awt.Color;
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/TextAreaCharacters.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,9 +30,9 @@
import org.foray.area.link.Link;
import org.foray.common.CharSequenceSubset;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.fotree.fo.FoTextCharacters;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import java.io.Serializable;
import java.math.BigDecimal;
Modified: trunk/foray/foray-common/build.gradle
===================================================================
--- trunk/foray/foray-common/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-common/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -19,6 +19,7 @@
api libs.axsl.value
api project(":foray-primitive")
+ implementation project(":foray-unicode")
}
javadoc {
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 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/ByteSequenceTokenizer.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,10 +30,10 @@
import org.foray.primitive.sequence.ByteArray;
import org.foray.primitive.sequence.ByteSequenceSubset;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
import org.axsl.primitive.sequence.ByteSequencePlus;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -29,9 +29,10 @@
package org.foray.common.i18n;
+import org.foray.unicode.block.U2000_General_Punctuation;
+
import org.axsl.i18n.BaselineType;
import org.axsl.i18n.Script;
-import org.axsl.unicode.block.U2000_General_Punctuation;
import com.ibm.icu.lang.UScript;
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 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -29,9 +29,9 @@
package org.foray.common.data;
import org.foray.primitive.sequence.ByteArray;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
Modified: trunk/foray/foray-font/build.gradle
===================================================================
--- trunk/foray/foray-font/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -27,6 +27,7 @@
api project(":foray-primitive")
api project(":foray-ps-data")
api project(":foray-xml")
+ implementation project(":foray-unicode")
testImplementation libs.mockito
testRuntimeOnly project(":foray-ps")
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -32,6 +32,10 @@
import org.foray.font.format.Kerning;
import org.foray.font.format.Panose4a;
import org.foray.ps.encode.CharSet;
+import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.block.U3000_CJK_Symbols_and_Punctuation;
import org.axsl.constants.NumericConstants;
import org.axsl.constants.TypographicConstants;
@@ -39,10 +43,6 @@
import org.axsl.font.FontFeatureSimulation;
import org.axsl.font.FontFormat;
import org.axsl.i18n.Script;
-import org.axsl.unicode.block.U0000_Basic_Latin;
-import org.axsl.unicode.block.U0080_Latin_1_Supplement;
-import org.axsl.unicode.block.U2000_General_Punctuation;
-import org.axsl.unicode.block.U3000_CJK_Symbols_and_Punctuation;
import org.axsl.value.BaselineIdentifier;
import org.axsl.value.FontStretch;
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 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -35,6 +35,7 @@
import org.foray.primitive.sequence.IntArrayBuilder;
import org.foray.primitive.sequence.ShortArrayBuilder;
import org.foray.ps.encode.CharSet;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.constants.PrimitiveConstants;
import org.axsl.font.ConsumerFont;
@@ -45,7 +46,6 @@
import org.axsl.primitive.sequence.IntSequence;
import org.axsl.primitive.sequence.ShortSequence;
import org.axsl.ps.Encoding;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import java.io.UnsupportedEncodingException;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1Font.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -29,9 +29,9 @@
package org.foray.font.type1;
import org.foray.font.format.FontContent;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.ps.PsFontDictionary;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import java.util.Arrays;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/type1/Type1FontParserPfa.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,9 +30,8 @@
import org.foray.common.ByteSequenceSearcher;
import org.foray.font.format.FontParser;
+import org.foray.unicode.block.U0000_Basic_Latin;
-import org.axsl.unicode.block.U0000_Basic_Latin;
-
import java.io.IOException;
/**
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/FsType1FontTests.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,11 +30,11 @@
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontFamily;
+import org.foray.unicode.block.U0080_Latin_1_Supplement;
import org.axsl.font.FontException;
import org.axsl.font.zzz.FontContextMdo;
import org.axsl.ps.Encoding;
-import org.axsl.unicode.block.U0080_Latin_1_Supplement;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
Modified: trunk/foray/foray-fotree/build.gradle
===================================================================
--- trunk/foray/foray-fotree/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-fotree/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -39,6 +39,7 @@
api project(":foray-common")
implementation project(":foray-primitive")
api project(":foray-xml")
+ implementation project(":foray-unicode")
testImplementation libs.mockito
testImplementation testFixtures(libs.axsl.fotree)
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoText4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -34,10 +34,10 @@
import org.foray.fotree.PropertyList;
import org.foray.fotree.fo.FoKeyword;
import org.foray.fotree.fo.NamespaceFo;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.fotree.FoTreeException;
import org.axsl.fotree.fo.FoText;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
import org.axsl.value.WhiteSpaceTreatment;
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/obj/FoRefinedText4aTests.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -28,8 +28,9 @@
package org.foray.fotree.fo.obj;
-import org.axsl.unicode.block.U0000_Basic_Latin;
-import org.axsl.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.block.U2000_General_Punctuation;
+
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
Modified: trunk/foray/foray-orthography/build.gradle
===================================================================
--- trunk/foray/foray-orthography/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-orthography/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -23,6 +23,7 @@
api project(":foray-common")
implementation project(":foray-primitive")
api project(":foray-xml")
+ implementation project(":foray-unicode")
testImplementation libs.mockito
testImplementation libs.icu4j
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 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Lexer4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -32,12 +32,12 @@
import org.foray.primitive.CharacterUtils;
import org.foray.primitive.NumberUtils;
import org.foray.primitive.StringUtils;
+import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.block.U0080_Latin_1_Supplement;
import org.axsl.i18n.WritingSystem;
import org.axsl.orthography.Lexer;
import org.axsl.primitive.sequence.IntSequence;
-import org.axsl.unicode.block.U0000_Basic_Latin;
-import org.axsl.unicode.block.U0080_Latin_1_Supplement;
import java.util.ArrayList;
import java.util.List;
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -32,12 +32,12 @@
import org.foray.common.primitive.CharSequenceUtils;
import org.foray.common.primitive.UnicodeCharUtils;
import org.foray.common.primitive.XmlCharacterUtils;
+import org.foray.unicode.block.U2000_General_Punctuation;
import org.axsl.fotree.text.FoWhitespace;
import org.axsl.kp.KpContext;
import org.axsl.kp.KpLeaf;
import org.axsl.kp.KpNode;
-import org.axsl.unicode.block.U2000_General_Punctuation;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.group.TextModifiers;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/LexerEnglishTests.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -29,6 +29,7 @@
package org.foray.orthography;
import org.foray.common.i18n.WritingSystem4a;
+import org.foray.unicode.block.U2000_General_Punctuation;
import org.axsl.i18n.WritingSystem;
import org.axsl.orthography.Lexer;
@@ -35,7 +36,6 @@
import org.axsl.orthography.Lexer.Token;
import org.axsl.orthography.Lexer.TokenType;
import org.axsl.orthography.OrthographyException;
-import org.axsl.unicode.block.U2000_General_Punctuation;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
Modified: trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java
===================================================================
--- trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-orthography/src/test/java/org/foray/orthography/TokenFlow4aTests.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -28,8 +28,9 @@
package org.foray.orthography;
+import org.foray.unicode.block.U0000_Basic_Latin;
+
import org.axsl.fotree.text.TextTokenFlowLocation;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import org.axsl.value.LinefeedTreatment;
import org.axsl.value.TextTransform;
import org.axsl.value.WhiteSpaceTreatment;
Modified: trunk/foray/foray-pdf-core/build.gradle
===================================================================
--- trunk/foray/foray-pdf-core/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pdf-core/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -17,10 +17,10 @@
/* ***** IMPORTANT!! foray-pdf-core must never have dependencies on foray-pdf-parse or foray-pdf-serial. */
- implementation (project(':foray-common'))
- api (project(':foray-primitive'))
- api (project(':foray-ps-data'))
-
+ implementation project(':foray-common')
+ api project(':foray-primitive')
+ api project(':foray-ps-data')
+ implementation project(":foray-unicode")
}
javadoc {
Modified: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/PdfConstants.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -30,9 +30,9 @@
import org.foray.primitive.StringUtils;
import org.foray.primitive.sequence.ByteArray;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.primitive.sequence.ByteSequence;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import java.util.Arrays;
import java.util.List;
Modified: trunk/foray/foray-pdf-serial/build.gradle
===================================================================
--- trunk/foray/foray-pdf-serial/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pdf-serial/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -24,6 +24,7 @@
api project(":foray-primitive")
api project(":foray-pdf-core")
implementation project(":foray-ps-data")
+ implementation project(":foray-unicode")
testImplementation libs.mockito
testImplementation project(":foray-font")
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/svg/PdfGraphics2D.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -41,6 +41,7 @@
import org.foray.pdf.graphics.PdfColor4a;
import org.foray.pdf.graphics.pattern.PdfPatternAdapter;
import org.foray.pdf.text.PdfFontAdapter;
+import org.foray.unicode.block.U0000_Basic_Latin;
import org.axsl.constants.NumericConstants;
import org.axsl.constants.PrimitiveConstants;
@@ -53,7 +54,6 @@
import org.axsl.pdf.PdfColor;
import org.axsl.pdf.PdfPage;
import org.axsl.pdf.graphics.pattern.PdfShadingPattern;
-import org.axsl.unicode.block.U0000_Basic_Latin;
import org.axsl.value.FontStretch;
import org.axsl.value.FontStyle;
import org.axsl.value.FontVariant;
Modified: trunk/foray/foray-pioneer/build.gradle
===================================================================
--- trunk/foray/foray-pioneer/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pioneer/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -20,8 +20,9 @@
implementation libs.axsl.orthography
api libs.axsl.value
- api (project(':foray-layout'))
- implementation (project(':foray-content'))
+ api project(':foray-layout')
+ implementation project(':foray-content')
+ implementation project(":foray-unicode")
}
javadoc {
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/lb/SolitaryLineBreaker.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -28,12 +28,13 @@
package org.foray.pioneer.lb;
+import org.foray.unicode.block.U2000_General_Punctuation;
+
import org.axsl.content.CharContent;
import org.axsl.font.FontConsumer;
import org.axsl.kp.KpUserAgent;
import org.axsl.orthography.Orthography;
import org.axsl.orthography.Word;
-import org.axsl.unicode.block.U2000_General_Punctuation;
import org.axsl.value.group.TextModifiers;
/**
Modified: trunk/foray/foray-primitive/build.gradle
===================================================================
--- trunk/foray/foray-primitive/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-primitive/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -8,6 +8,7 @@
dependencies {
implementation libs.axsl.constants
api libs.axsl.primitive
+ implementation project(":foray-unicode")
}
javadoc {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/CharacterUtils.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -28,12 +28,13 @@
package org.foray.primitive;
+import org.foray.unicode.block.U0000_Basic_Latin;
+import org.foray.unicode.block.U0080_Latin_1_Supplement;
+import org.foray.unicode.block.U2000_General_Punctuation;
+import org.foray.unicode.block.U3000_CJK_Symbols_and_Punctuation;
+import org.foray.unicode.block.Ufe70_Arabic_Presentation_Forms_B;
+
import org.axsl.constants.PrimitiveConstants;
-import org.axsl.unicode.block.U0000_Basic_Latin;
-import org.axsl.unicode.block.U0080_Latin_1_Supplement;
-import org.axsl.unicode.block.U2000_General_Punctuation;
-import org.axsl.unicode.block.U3000_CJK_Symbols_and_Punctuation;
-import org.axsl.unicode.block.Ufe70_Arabic_Presentation_Forms_B;
import java.util.List;
Modified: trunk/foray/foray-unicode/build.gradle
===================================================================
--- trunk/foray/foray-unicode/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
+++ trunk/foray/foray-unicode/build.gradle 2026-04-25 23:19:54 UTC (rev 14486)
@@ -1,5 +1,6 @@
plugins {
id 'foray.java-library-conventions'
+ id "foray.test-conventions"
}
description = 'foray-unicode'
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -0,0 +1,183 @@
+/*
+ * 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.unicode.block;
+
+/**
+ * Unicode(r) code points for the "Basic Latin" block (0x0 thru 0x7f).
+ * See package documentation for links to the Unicode(r) license and terms of use.
+ */
+public final class U0000_Basic_Latin {
+
+ /*
+ * This class was generated by {@link org.foray.unicode.UnicodeParser}.
+ * If changes are needed, it will likely be better to regenerate than to change manually.
+ */
+
+ /*
+ * Since all code points in this block can be contained in one byte, it is tempting to use byte as the type for
+ * them. However, byte is a numeric type, which causes some String-building methods to treat it is a number,
+ * resulting in the numeric value being included in the string instead of the char value: for example "32" instead
+ * of " ".
+ */
+
+ public static final char CONTROL_NULL = 0x0000;
+ public static final char CONTROL_START_OF_HEADING = 0x0001;
+ public static final char CONTROL_START_OF_TEXT = 0x0002;
+ public static final char CONTROL_END_OF_TEXT = 0x0003;
+ public static final char CONTROL_END_OF_TRANSMISSION = 0x0004;
+ public static final char CONTROL_ENQUIRY = 0x0005;
+ public static final char CONTROL_ACKNOWLEDGE = 0x0006;
+ public static final char CONTROL_BELL = 0x0007;
+ public static final char CONTROL_BACKSPACE = 0x0008;
+ public static final char CONTROL_CHARACTER_TABULATION = 0x0009;
+ public static final char CONTROL_LINE_FEED = 0x000a;
+ public static final char CONTROL_LINE_TABULATION = 0x000b;
+ public static final char CONTROL_FORM_FEED = 0x000c;
+ public static final char CONTROL_CARRIAGE_RETURN = 0x000d;
+ public static final char CONTROL_SHIFT_OUT = 0x000e;
+ public static final char CONTROL_SHIFT_IN = 0x000f;
+ public static final char CONTROL_DATA_LINK_ESCAPE = 0x0010;
+ public static final char CONTROL_DEVICE_CONTROL_ONE = 0x0011;
+ public static final char CONTROL_DEVICE_CONTROL_TWO = 0x0012;
+ public static final char CONTROL_DEVICE_CONTROL_THREE = 0x0013;
+ public static final char CONTROL_DEVICE_CONTROL_FOUR = 0x0014;
+ public static final char CONTROL_NEGATIVE_ACKNOWLEDGE = 0x0015;
+ public static final char CONTROL_SYNCHRONOUS_IDLE = 0x0016;
+ public static final char CONTROL_END_OF_TRANSMISSION_BLOCK = 0x0017;
+ public static final char CONTROL_CANCEL = 0x0018;
+ public static final char CONTROL_END_OF_MEDIUM = 0x0019;
+ public static final char CONTROL_SUBSTITUTE = 0x001a;
+ public static final char CONTROL_ESCAPE = 0x001b;
+ public static final char CONTROL_INFORMATION_SEPARATOR_FOUR = 0x001c;
+ public static final char CONTROL_INFORMATION_SEPARATOR_THREE = 0x001d;
+ public static final char CONTROL_INFORMATION_SEPARATOR_TWO = 0x001e;
+ public static final char CONTROL_INFORMATION_SEPARATOR_ONE = 0x001f;
+ public static final char SPACE = 0x0020;
+ public static final char EXCLAMATION_MARK = 0x0021;
+ public static final char QUOTATION_MARK = 0x0022;
+ public static final char NUMBER_SIGN = 0x0023;
+ public static final char DOLLAR_SIGN = 0x0024;
+ public static final char PERCENT_SIGN = 0x0025;
+ public static final char AMPERSAND = 0x0026;
+ public static final char APOSTROPHE = 0x0027;
+ public static final char LEFT_PARENTHESIS = 0x0028;
+ public static final char RIGHT_PARENTHESIS = 0x0029;
+ public static final char ASTERISK = 0x002a;
+ public static final char PLUS_SIGN = 0x002b;
+ public static final char COMMA = 0x002c;
+ public static final char HYPHEN_MINUS = 0x002d;
+ public static final char FULL_STOP = 0x002e;
+ public static final char SOLIDUS = 0x002f;
+ public static final char DIGIT_ZERO = 0x0030;
+ public static final char DIGIT_ONE = 0x0031;
+ public static final char DIGIT_TWO = 0x0032;
+ public static final char DIGIT_THREE = 0x0033;
+ public static final char DIGIT_FOUR = 0x0034;
+ public static final char DIGIT_FIVE = 0x0035;
+ public static final char DIGIT_SIX = 0x0036;
+ public static final char DIGIT_SEVEN = 0x0037;
+ public static final char DIGIT_EIGHT = 0x0038;
+ public static final char DIGIT_NINE = 0x0039;
+ public static final char COLON = 0x003a;
+ public static final char SEMICOLON = 0x003b;
+ public static final char LESS_THAN_SIGN = 0x003c;
+ public static final char EQUALS_SIGN = 0x003d;
+ public static final char GREATER_THAN_SIGN = 0x003e;
+ public static final char QUESTION_MARK = 0x003f;
+ public static final char COMMERCIAL_AT = 0x0040;
+ public static final char LATIN_CAPITAL_LETTER_A = 0x0041;
+ public static final char LATIN_CAPITAL_LETTER_B = 0x0042;
+ public static final char LATIN_CAPITAL_LETTER_C = 0x0043;
+ public static final char LATIN_CAPITAL_LETTER_D = 0x0044;
+ public static final char LATIN_CAPITAL_LETTER_E = 0x0045;
+ public static final char LATIN_CAPITAL_LETTER_F = 0x0046;
+ public static final char LATIN_CAPITAL_LETTER_G = 0x0047;
+ public static final char LATIN_CAPITAL_LETTER_H = 0x0048;
+ public static final char LATIN_CAPITAL_LETTER_I = 0x0049;
+ public static final char LATIN_CAPITAL_LETTER_J = 0x004a;
+ public static final char LATIN_CAPITAL_LETTER_K = 0x004b;
+ public static final char LATIN_CAPITAL_LETTER_L = 0x004c;
+ public static final char LATIN_CAPITAL_LETTER_M = 0x004d;
+ public static final char LATIN_CAPITAL_LETTER_N = 0x004e;
+ public static final char LATIN_CAPITAL_LETTER_O = 0x004f;
+ public static final char LATIN_CAPITAL_LETTER_P = 0x0050;
+ public static final char LATIN_CAPITAL_LETTER_Q = 0x0051;
+ public static final char LATIN_CAPITAL_LETTER_R = 0x0052;
+ public static final char LATIN_CAPITAL_LETTER_S = 0x0053;
+ public static final char LATIN_CAPITAL_LETTER_T = 0x0054;
+ public static final char LATIN_CAPITAL_LETTER_U = 0x0055;
+ public static final char LATIN_CAPITAL_LETTER_V = 0x0056;
+ public static final char LATIN_CAPITAL_LETTER_W = 0x0057;
+ public static final char LATIN_CAPITAL_LETTER_X = 0x0058;
+ public static final char LATIN_CAPITAL_LETTER_Y = 0x0059;
+ public static final char LATIN_CAPITAL_LETTER_Z = 0x005a;
+ public static final char LEFT_SQUARE_BRACKET = 0x005b;
+ public static final char REVERSE_SOLIDUS = 0x005c;
+ public static final char RIGHT_SQUARE_BRACKET = 0x005d;
+ public static final char CIRCUMFLEX_ACCENT = 0x005e;
+ public static final char LOW_LINE = 0x005f;
+ public static final char GRAVE_ACCENT = 0x0060;
+ public static final char LATIN_SMALL_LETTER_A = 0x0061;
+ public static final char LATIN_SMALL_LETTER_B = 0x0062;
+ public static final char LATIN_SMALL_LETTER_C = 0x0063;
+ public static final char LATIN_SMALL_LETTER_D = 0x0064;
+ public static final char LATIN_SMALL_LETTER_E = 0x0065;
+ public static final char LATIN_SMALL_LETTER_F = 0x0066;
+ public static final char LATIN_SMALL_LETTER_G = 0x0067;
+ public static final char LATIN_SMALL_LETTER_H = 0x0068;
+ public static final char LATIN_SMALL_LETTER_I = 0x0069;
+ public static final char LATIN_SMALL_LETTER_J = 0x006a;
+ public static final char LATIN_SMALL_LETTER_K = 0x006b;
+ public static final char LATIN_SMALL_LETTER_L = 0x006c;
+ public static final char LATIN_SMALL_LETTER_M = 0x006d;
+ public static final char LATIN_SMALL_LETTER_N = 0x006e;
+ public static final char LATIN_SMALL_LETTER_O = 0x006f;
+ public static final char LATIN_SMALL_LETTER_P = 0x0070;
+ public static final char LATIN_SMALL_LETTER_Q = 0x0071;
+ public static final char LATIN_SMALL_LETTER_R = 0x0072;
+ public static final char LATIN_SMALL_LETTER_S = 0x0073;
+ public static final char LATIN_SMALL_LETTER_T = 0x0074;
+ public static final char LATIN_SMALL_LETTER_U = 0x0075;
+ public static final char LATIN_SMALL_LETTER_V = 0x0076;
+ public static final char LATIN_SMALL_LETTER_W = 0x0077;
+ public static final char LATIN_SMALL_LETTER_X = 0x0078;
+ public static final char LATIN_SMALL_LETTER_Y = 0x0079;
+ public static final char LATIN_SMALL_LETTER_Z = 0x007a;
+ public static final char LEFT_CURLY_BRACKET = 0x007b;
+ public static final char VERTICAL_LINE = 0x007c;
+ public static final char RIGHT_CURLY_BRACKET = 0x007d;
+ public static final char TILDE = 0x007e;
+ public static final char CONTROL_DELETE = 0x007f;
+
+ /**
+ * Private constructor. This is a utility class and should never be instantiated.
+ */
+ private U0000_Basic_Latin() { }
+
+}
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0000_Basic_Latin.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -0,0 +1,176 @@
+/*
+ * 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.unicode.block;
+
+/**
+ * Unicode(r) code points for the "Latin-1 Supplement" block (0x80 thru 0xff).
+ * See package documentation for links to the Unicode(r) license and terms of use.
+ */
+public final class U0080_Latin_1_Supplement {
+
+ /*
+ * This class was generated by {@link org.foray.unicode.UnicodeParser}.
+ * If changes are needed, it will likely be better to regenerate than to change manually.
+ */
+
+ public static final char CONTROL_0X80 = 0x0080;
+ public static final char CONTROL_0X81 = 0x0081;
+ public static final char CONTROL_BREAK_PERMITTED_HERE = 0x0082;
+ public static final char CONTROL_NO_BREAK_HERE = 0x0083;
+ public static final char CONTROL_0X84 = 0x0084;
+ public static final char CONTROL_NEXT_LINE = 0x0085;
+ public static final char CONTROL_START_OF_SELECTED_AREA = 0x0086;
+ public static final char CONTROL_END_OF_SELECTED_AREA = 0x0087;
+ public static final char CONTROL_CHARACTER_TABULATION_SET = 0x0088;
+ public static final char CONTROL_CHARACTER_TABULATION_WITH_JUSTIFICATION = 0x0089;
+ public static final char CONTROL_LINE_TABULATION_SET = 0x008a;
+ public static final char CONTROL_PARTIAL_LINE_FORWARD = 0x008b;
+ public static final char CONTROL_PARTIAL_LINE_BACKWARD = 0x008c;
+ public static final char CONTROL_REVERSE_LINE_FEED = 0x008d;
+ public static final char CONTROL_SINGLE_SHIFT_TWO = 0x008e;
+ public static final char CONTROL_SINGLE_SHIFT_THREE = 0x008f;
+ public static final char CONTROL_DEVICE_CONTROL_STRING = 0x0090;
+ public static final char CONTROL_PRIVATE_USE_ONE = 0x0091;
+ public static final char CONTROL_PRIVATE_USE_TWO = 0x0092;
+ public static final char CONTROL_SET_TRANSMIT_STATE = 0x0093;
+ public static final char CONTROL_CANCEL_CHARACTER = 0x0094;
+ public static final char CONTROL_MESSAGE_WAITING = 0x0095;
+ public static final char CONTROL_START_OF_GUARDED_AREA = 0x0096;
+ public static final char CONTROL_END_OF_GUARDED_AREA = 0x0097;
+ public static final char CONTROL_START_OF_STRING = 0x0098;
+ public static final char CONTROL_0X99 = 0x0099;
+ public static final char CONTROL_SINGLE_CHARACTER_INTRODUCER = 0x009a;
+ public static final char CONTROL_CONTROL_SEQUENCE_INTRODUCER = 0x009b;
+ public static final char CONTROL_STRING_TERMINATOR = 0x009c;
+ public static final char CONTROL_OPERATING_SYSTEM_COMMAND = 0x009d;
+ public static final char CONTROL_PRIVACY_MESSAGE = 0x009e;
+ public static final char CONTROL_APPLICATION_PROGRAM_COMMAND = 0x009f;
+ public static final char NO_BREAK_SPACE = 0x00a0;
+ public static final char INVERTED_EXCLAMATION_MARK = 0x00a1;
+ public static final char CENT_SIGN = 0x00a2;
+ public static final char POUND_SIGN = 0x00a3;
+ public static final char CURRENCY_SIGN = 0x00a4;
+ public static final char YEN_SIGN = 0x00a5;
+ public static final char BROKEN_BAR = 0x00a6;
+ public static final char SECTION_SIGN = 0x00a7;
+ public static final char DIAERESIS = 0x00a8;
+ public static final char COPYRIGHT_SIGN = 0x00a9;
+ public static final char FEMININE_ORDINAL_INDICATOR = 0x00aa;
+ public static final char LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK = 0x00ab;
+ public static final char NOT_SIGN = 0x00ac;
+ public static final char SOFT_HYPHEN = 0x00ad;
+ public static final char REGISTERED_SIGN = 0x00ae;
+ public static final char MACRON = 0x00af;
+ public static final char DEGREE_SIGN = 0x00b0;
+ public static final char PLUS_MINUS_SIGN = 0x00b1;
+ public static final char SUPERSCRIPT_TWO = 0x00b2;
+ public static final char SUPERSCRIPT_THREE = 0x00b3;
+ public static final char ACUTE_ACCENT = 0x00b4;
+ public static final char MICRO_SIGN = 0x00b5;
+ public static final char PILCROW_SIGN = 0x00b6;
+ public static final char MIDDLE_DOT = 0x00b7;
+ public static final char CEDILLA = 0x00b8;
+ public static final char SUPERSCRIPT_ONE = 0x00b9;
+ public static final char MASCULINE_ORDINAL_INDICATOR = 0x00ba;
+ public static final char RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK = 0x00bb;
+ public static final char VULGAR_FRACTION_ONE_QUARTER = 0x00bc;
+ public static final char VULGAR_FRACTION_ONE_HALF = 0x00bd;
+ public static final char VULGAR_FRACTION_THREE_QUARTERS = 0x00be;
+ public static final char INVERTED_QUESTION_MARK = 0x00bf;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_GRAVE = 0x00c0;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_ACUTE = 0x00c1;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX = 0x00c2;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_TILDE = 0x00c3;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS = 0x00c4;
+ public static final char LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE = 0x00c5;
+ public static final char LATIN_CAPITAL_LETTER_AE = 0x00c6;
+ public static final char LATIN_CAPITAL_LETTER_C_WITH_CEDILLA = 0x00c7;
+ public static final char LATIN_CAPITAL_LETTER_E_WITH_GRAVE = 0x00c8;
+ public static final char LATIN_CAPITAL_LETTER_E_WITH_ACUTE = 0x00c9;
+ public static final char LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX = 0x00ca;
+ public static final char LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS = 0x00cb;
+ public static final char LATIN_CAPITAL_LETTER_I_WITH_GRAVE = 0x00cc;
+ public static final char LATIN_CAPITAL_LETTER_I_WITH_ACUTE = 0x00cd;
+ public static final char LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX = 0x00ce;
+ public static final char LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS = 0x00cf;
+ public static final char LATIN_CAPITAL_LETTER_ETH = 0x00d0;
+ public static final char LATIN_CAPITAL_LETTER_N_WITH_TILDE = 0x00d1;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_GRAVE = 0x00d2;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_ACUTE = 0x00d3;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX = 0x00d4;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_TILDE = 0x00d5;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS = 0x00d6;
+ public static final char MULTIPLICATION_SIGN = 0x00d7;
+ public static final char LATIN_CAPITAL_LETTER_O_WITH_STROKE = 0x00d8;
+ public static final char LATIN_CAPITAL_LETTER_U_WITH_GRAVE = 0x00d9;
+ public static final char LATIN_CAPITAL_LETTER_U_WITH_ACUTE = 0x00da;
+ public static final char LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX = 0x00db;
+ public static final char LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS = 0x00dc;
+ public static final char LATIN_CAPITAL_LETTER_Y_WITH_ACUTE = 0x00dd;
+ public static final char LATIN_CAPITAL_LETTER_THORN = 0x00de;
+ public static final char LATIN_SMALL_LETTER_SHARP_S = 0x00df;
+ public static final char LATIN_SMALL_LETTER_A_WITH_GRAVE = 0x00e0;
+ public static final char LATIN_SMALL_LETTER_A_WITH_ACUTE = 0x00e1;
+ public static final char LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX = 0x00e2;
+ public static final char LATIN_SMALL_LETTER_A_WITH_TILDE = 0x00e3;
+ public static final char LATIN_SMALL_LETTER_A_WITH_DIAERESIS = 0x00e4;
+ public static final char LATIN_SMALL_LETTER_A_WITH_RING_ABOVE = 0x00e5;
+ public static final char LATIN_SMALL_LETTER_AE = 0x00e6;
+ public static final char LATIN_SMALL_LETTER_C_WITH_CEDILLA = 0x00e7;
+ public static final char LATIN_SMALL_LETTER_E_WITH_GRAVE = 0x00e8;
+ public static final char LATIN_SMALL_LETTER_E_WITH_ACUTE = 0x00e9;
+ public static final char LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX = 0x00ea;
+ public static final char LATIN_SMALL_LETTER_E_WITH_DIAERESIS = 0x00eb;
+ public static final char LATIN_SMALL_LETTER_I_WITH_GRAVE = 0x00ec;
+ public static final char LATIN_SMALL_LETTER_I_WITH_ACUTE = 0x00ed;
+ public static final char LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX = 0x00ee;
+ public static final char LATIN_SMALL_LETTER_I_WITH_DIAERESIS = 0x00ef;
+ public static final char LATIN_SMALL_LETTER_ETH = 0x00f0;
+ public static final char LATIN_SMALL_LETTER_N_WITH_TILDE = 0x00f1;
+ public static final char LATIN_SMALL_LETTER_O_WITH_GRAVE = 0x00f2;
+ public static final char LATIN_SMALL_LETTER_O_WITH_ACUTE = 0x00f3;
+ public static final char LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX = 0x00f4;
+ public static final char LATIN_SMALL_LETTER_O_WITH_TILDE = 0x00f5;
+ public static final char LATIN_SMALL_LETTER_O_WITH_DIAERESIS = 0x00f6;
+ public static final char DIVISION_SIGN = 0x00f7;
+ public static final char LATIN_SMALL_LETTER_O_WITH_STROKE = 0x00f8;
+ public static final char LATIN_SMALL_LETTER_U_WITH_GRAVE = 0x00f9;
+ public static final char LATIN_SMALL_LETTER_U_WITH_ACUTE = 0x00fa;
+ public static final char LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX = 0x00fb;
+ public static final char LATIN_SMALL_LETTER_U_WITH_DIAERESIS = 0x00fc;
+ public static final char LATIN_SMALL_LETTER_Y_WITH_ACUTE = 0x00fd;
+ public static final char LATIN_SMALL_LETTER_THORN = 0x00fe;
+ public static final char LATIN_SMALL_LETTER_Y_WITH_DIAERESIS = 0x00ff;
+
+ /**
+ * Private constructor. This is a utility class and should never be instantiated.
+ */
+ private U0080_Latin_1_Supplement() { }
+
+}
Property changes on: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U0080_Latin_1_Supplement.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U2000_General_Punctuation.java
===================================================================
--- trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U2000_General_Punctuation.java (rev 0)
+++ trunk/foray/foray-unicode/src/main/java/org/foray/unicode/block/U2000_General_Punctuation.java 2026-04-25 23:19:54 UTC (rev 14486)
@@ -0,0 +1,159 @@
+/*
+ * 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.unicode.block;
+
+/**
+ * Unicode(r) code points for the "General Punctuation" block (0x2000 thru 0x206f).
+ * See package documentation for links to the Unicode(r) license and terms of use.
+ */
+public final class U2000_General_Punctuation {
+
+ /*
+ * This class was generated by {@link org.foray.unicode.UnicodeParser}.
+ * If changes are needed, it will likely be better to regenerate than to change manually.
+ */
+
+ public static final char EN_QUAD = 0x2000;
+ public static final char EM_QUAD = 0x2001;
+ public static final char EN_SPACE = 0x2002;
+ public static final char EM_SPACE = 0x2003;
+ public static final char THREE_PER_EM_SPACE = 0x2004;
+ public static final char FOUR_PER_EM_SPACE = 0x2005;
+ public static final char SIX_PER_EM_SPACE = 0x2006;
+ public static final char FIGURE_SPACE = 0x2007;
+ public static final char PUNCTUATION_SPACE = 0x2008;
+ public static final char THIN_SPACE = 0x2009;
+ public static final char HAIR_SPACE = 0x200a;
+ public static final char ZERO_WIDTH_SPACE = 0x200b;
+ public static final char ZERO_WIDTH_NON_JOINER = 0x200c;
+ public static final char ZERO_WIDTH_JOINER = 0x200d;
+ public static final char LEFT_TO_RIGHT_MARK = 0x200e;
+ public static final char RIGHT_TO_LEFT_MARK = 0x200f;
+ public static final char HYPHEN = 0x2010;
+ public static final char NON_BREAKING_HYPHEN = 0x2011;
+ public static final char FIGURE_DASH = 0x2012;
+ public static final char EN_DASH = 0x2013;
+ public static final char EM_DASH = 0x2014;
+ public static final char HORIZONTAL_BAR = 0x2015;
+ public static final char DOUBLE_VERTICAL_LINE = 0x2016;
+ public static final char DOUBLE_LOW_LINE = 0x2017;
+ public static final char LEFT_SINGLE_QUOTATION_MARK = 0x2018;
+ public static final char RIGHT_SINGLE_QUOTATION_MARK = 0x2019;
+ public static final char SINGLE_LOW_9_QUOTATION_MARK = 0x201a;
+ public static final char SINGLE_HIGH_REVERSED_9_QUOTATION_MARK = 0x201b;
+ public static final char LEFT_DOUBLE_QUOTATION_MARK = 0x201c;
+ public static final char RIGHT_DOUBLE_QUOTATION_MARK = 0x201d;
+ public static final char DOUBLE_LOW_9_QUOTATION_MARK = 0x201e;
+ public static final char DOUBLE_HIGH_REVERSED_9_QUOTATION_MARK = 0x201f;
+ public static final char DAGGER = 0x2020;
+ public static final char DOUBLE_DAGGER = 0x2021;
+ public static final char BULLET = 0x2022;
+ public static final char TRIANGULAR_BULLET = 0x2023;
+ public static final char ONE_DOT_LEADER = 0x2024;
+ public static final char TWO_DOT_LEADER = 0x2025;
+ public static final char HORIZONTAL_ELLIPSIS = 0x2026;
+ public static final char HYPHENATION_POINT = 0x2027;
+ public static final char LINE_SEPARATOR = 0x2028;
+ public static final char PARAGRAPH_SEPARATOR = 0x2029;
+ public static final char LEFT_TO_RIGHT_EMBEDDING = 0x202a;
+ public static final char RIGHT_TO_LEFT_EMBEDDING = 0x202b;
+ public static final char POP_DIRECTIONAL_FORMATTING = 0x202c;
+ public static final char LEFT_TO_RIGHT_OVERRIDE = 0x202d;
+ public static final char RIGHT_TO_LEFT_OVERRIDE = 0x202e;
+ public static final char NARROW_NO_BREAK_SPACE = 0x202f;
+ public static final char PER_MILLE_SIGN = 0x2030;
+ public static final char PER_TEN_THOUSAND_SIGN = 0x2031;
+ public static final char PRIME = 0x2032;
+ public static final char DOUBLE_PRIME = 0x2033;
+ public static final char TRIPLE_PRIME = 0x2034;
+ public static final char REVERSED_PRIME = 0x2035;
+ public static final char REVERSED_DOUBLE_PRIME = 0x2036;
+ public static final char REVERSED_TRIPLE_PRIME = 0x2037;
+ public static final char CARET = 0x2038;
+ public static final char SINGLE_LEFT_POINTING_ANGLE_QUOTATION_MARK = 0x2039;
+ public static final char SINGLE_RIGHT_POINTING_ANGLE_QUOTATION_MARK = 0x203a;
+ public static final char REFERENCE_MARK = 0x203b;
+ public static final char DOUBLE_EXCLAMATION_MARK = 0x203c;
+ public static final char INTERROBANG = 0x203d;
+ public static final char OVERLINE ...
[truncated message content] |
|
From: <vic...@us...> - 2026-04-25 21:02:48
|
Revision: 14485
http://sourceforge.net/p/foray/code/14485
Author: victormote
Date: 2026-04-25 21:02:45 +0000 (Sat, 25 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Convert some usages of Float to FixedDecimal.
Modified Paths:
--------------
trunk/foray/foray-speech/build.gradle
trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
Modified: trunk/foray/foray-speech/build.gradle
===================================================================
--- trunk/foray/foray-speech/build.gradle 2026-04-25 20:23:33 UTC (rev 14484)
+++ trunk/foray/foray-speech/build.gradle 2026-04-25 21:02:45 UTC (rev 14485)
@@ -6,6 +6,7 @@
dependencies {
api libs.axsl.speech
+ api project(":foray-common")
}
javadoc {
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-25 20:23:33 UTC (rev 14484)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/SpeechServer4a.java 2026-04-25 21:02:45 UTC (rev 14485)
@@ -28,6 +28,8 @@
package org.foray.speech;
+import org.foray.primitive.fixed.FixedDecimal4a;
+
import org.axsl.speech.SpeechServer;
import org.axsl.speech.Voice;
@@ -38,23 +40,20 @@
*/
public class SpeechServer4a implements SpeechServer {
- /** The default male voice. The medium frequency used to create this voice
- * (120 Hz) is derived from the CSS specification for the "pitch"
- * property. */
- public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(120);
+ /** The default male voice. The medium frequency used to create this voice (120 Hz) is derived from the CSS
+ * specification for the "pitch" property. */
+ public static final Voice4a DEFAULT_VOICE_MALE = new Voice4a(FixedDecimal4a.acquire("120"));
- /** The default female voice. The medium frequency used to create this voice
- * (210 Hz) is derived from the CSS specification for the "pitch"
- * property.*/
- public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(210);
+ /** The default female voice. The medium frequency used to create this voice (210 Hz) is derived from the CSS
+ * specification for the "pitch" property.*/
+ public static final Voice4a DEFAULT_VOICE_FEMALE = new Voice4a(FixedDecimal4a.acquire("210"));
- /** The default child voice. The medium frequency used to create this voice
- * (270 Hz) is estimated relative to that for the female voice (210 Hz). */
- public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(270);
+ /** The default child voice. The medium frequency used to create this voice (270 Hz) is estimated relative to that
+ * for the female voice (210 Hz). */
+ public static final Voice4a DEFAULT_VOICE_CHILD = new Voice4a(FixedDecimal4a.acquire("270"));
/** The voice to be used when no other can be found. */
- public static final Voice4a DEFAULT_VOICE =
- SpeechServer4a.DEFAULT_VOICE_MALE;
+ public static final Voice4a DEFAULT_VOICE = SpeechServer4a.DEFAULT_VOICE_MALE;
/**
* Constructor.
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-25 20:23:33 UTC (rev 14484)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-25 21:02:45 UTC (rev 14485)
@@ -28,6 +28,9 @@
package org.foray.speech;
+import org.foray.primitive.fixed.FixedDecimal4a;
+
+import org.axsl.primitive.fixed.FixedDecimal;
import org.axsl.speech.Voice;
/**
@@ -37,26 +40,26 @@
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-low frequencey. */
- private static final float FACTOR_EXTRA_LOW = .8f;
+ private static final FixedDecimal FACTOR_EXTRA_LOW = FixedDecimal4a.acquire(".8");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the low frequencey. */
- private static final float FACTOR_LOW = .9f;
+ private static final FixedDecimal FACTOR_LOW = FixedDecimal4a.acquire(".9");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the high frequencey. */
- private static final float FACTOR_HIGH = 1.1f;
+ private static final FixedDecimal FACTOR_HIGH = FixedDecimal4a.acquire("1.1");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The default factor by which the "medium" pitch should be adjusted to
* compute the extra-high frequencey. */
- private static final float FACTOR_EXTRA_HIGH = 1.2f;
+ private static final FixedDecimal FACTOR_EXTRA_HIGH = FixedDecimal4a.acquire("1.2");
/* TODO: This is a pure guess. Find some better way of estimating. */
/** The normal pitch for the "medium" frequency for this voice. */
- private float pitchMedium;
+ private FixedDecimal pitchMedium;
/**
* Constructor.
@@ -63,33 +66,33 @@
* @param pitchMedium The normal pitch for the "medium" frequency for this
* voice.
*/
- public Voice4a(final float pitchMedium) {
+ public Voice4a(final FixedDecimal pitchMedium) {
this.pitchMedium = pitchMedium;
}
@Override
- public Float pitchExtraLow() {
- return this.pitchMedium * Voice4a.FACTOR_EXTRA_LOW;
+ public FixedDecimal pitchExtraLow() {
+ return this.pitchMedium.multiply(Voice4a.FACTOR_EXTRA_LOW);
}
@Override
- public Float pitchLow() {
- return this.pitchMedium * Voice4a.FACTOR_LOW;
+ public FixedDecimal pitchLow() {
+ return this.pitchMedium.multiply(Voice4a.FACTOR_LOW);
}
@Override
- public Float pitchMedium() {
+ public FixedDecimal pitchMedium() {
return this.pitchMedium;
}
@Override
- public Float pitchHigh() {
- return this.pitchMedium * Voice4a.FACTOR_HIGH;
+ public FixedDecimal pitchHigh() {
+ return this.pitchMedium.multiply(Voice4a.FACTOR_HIGH);
}
@Override
- public Float pitchExtraHigh() {
- return this.pitchMedium * Voice4a.FACTOR_EXTRA_HIGH;
+ public FixedDecimal pitchExtraHigh() {
+ return this.pitchMedium.multiply(Voice4a.FACTOR_EXTRA_HIGH);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-25 20:23:36
|
Revision: 14484
http://sourceforge.net/p/foray/code/14484
Author: victormote
Date: 2026-04-25 20:23:33 +0000 (Sat, 25 Apr 2026)
Log Message:
-----------
Move many conversions from keyword to property values from FoObj to the related property descriptor classes.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdActiveState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundAttachment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBackgroundRepeat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakAfter.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdBreakBefore.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdClear.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdDisplayAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdEmptyCells.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFloat.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontSelectionStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdForcePageCount.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdHyphenationKeep.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderAlignment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLeaderPattern.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineHeightShiftAdjustment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLineStackingStrategy.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdLinefeedTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdMediaUsage.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdOverflow.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdReferenceOrientation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRelativePosition.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRenderingIntent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdRuleStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScaling.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdScalingMethod.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdShowDestination.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpan.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakHeader.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakNumeral.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSpeakPunctuation.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdStartingState.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSuppressAtLineBreak.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdSwitchTo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTableLayout.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlign.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextAlignLast.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdTextTransform.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdUnicodeBidi.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdVisibility.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWhiteSpaceTreatment.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdWrapOption.java
Added Paths:
-----------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBreak.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 2026-04-25 15:35:29 UTC (rev 14483)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2026-04-25 20:23:33 UTC (rev 14484)
@@ -51,7 +51,49 @@
import org.foray.fotree.fo.obj.StaticContent4a;
import org.foray.fotree.fo.obj.Table4a;
import org.foray.fotree.fo.prop.AbstractAllowedAxisScale;
+import org.foray.fotree.fo.prop.AbstractBreak;
+import org.foray.fotree.fo.prop.PdAbsolutePosition;
+import org.foray.fotree.fo.prop.PdActiveState;
+import org.foray.fotree.fo.prop.PdBackgroundAttachment;
+import org.foray.fotree.fo.prop.PdBackgroundRepeat;
import org.foray.fotree.fo.prop.PdChangeBarOffset;
+import org.foray.fotree.fo.prop.PdClear;
+import org.foray.fotree.fo.prop.PdDisplayAlign;
+import org.foray.fotree.fo.prop.PdEmptyCells;
+import org.foray.fotree.fo.prop.PdFloat;
+import org.foray.fotree.fo.prop.PdFontSelectionStrategy;
+import org.foray.fotree.fo.prop.PdForcePageCount;
+import org.foray.fotree.fo.prop.PdHyphenationKeep;
+import org.foray.fotree.fo.prop.PdLeaderAlignment;
+import org.foray.fotree.fo.prop.PdLeaderPattern;
+import org.foray.fotree.fo.prop.PdLineHeightShiftAdjustment;
+import org.foray.fotree.fo.prop.PdLineStackingStrategy;
+import org.foray.fotree.fo.prop.PdLinefeedTreatment;
+import org.foray.fotree.fo.prop.PdMediaUsage;
+import org.foray.fotree.fo.prop.PdOverflow;
+import org.foray.fotree.fo.prop.PdReferenceOrientation;
+import org.foray.fotree.fo.prop.PdRelativePosition;
+import org.foray.fotree.fo.prop.PdRenderingIntent;
+import org.foray.fotree.fo.prop.PdRuleStyle;
+import org.foray.fotree.fo.prop.PdScaling;
+import org.foray.fotree.fo.prop.PdScalingMethod;
+import org.foray.fotree.fo.prop.PdShowDestination;
+import org.foray.fotree.fo.prop.PdSpan;
+import org.foray.fotree.fo.prop.PdSpeak;
+import org.foray.fotree.fo.prop.PdSpeakHeader;
+import org.foray.fotree.fo.prop.PdSpeakNumeral;
+import org.foray.fotree.fo.prop.PdSpeakPunctuation;
+import org.foray.fotree.fo.prop.PdStartingState;
+import org.foray.fotree.fo.prop.PdSuppressAtLineBreak;
+import org.foray.fotree.fo.prop.PdSwitchTo;
+import org.foray.fotree.fo.prop.PdTableLayout;
+import org.foray.fotree.fo.prop.PdTextAlign;
+import org.foray.fotree.fo.prop.PdTextAlignLast;
+import org.foray.fotree.fo.prop.PdTextTransform;
+import org.foray.fotree.fo.prop.PdUnicodeBidi;
+import org.foray.fotree.fo.prop.PdVisibility;
+import org.foray.fotree.fo.prop.PdWhiteSpaceTreatment;
+import org.foray.fotree.fo.prop.PdWrapOption;
import org.foray.fotree.fo.prop.PdWritingMode;
import org.foray.primitive.StringUtils;
@@ -496,10 +538,6 @@
final PropertyList properties = getPropertyList();
for (int index = 0; index < properties.qtyProperties(); index ++) {
final Property property = properties.getProperty(index);
-
-
-
-
if (! property.value().isValidForObject(this)) {
this.throwExceptionContentModelViolation();
}
@@ -753,25 +791,10 @@
return getPropertyList().getColor(this, context);
}
- /**
- * Converts an {@link FoKeyword} wrap-option value to the more generic {@link WrapOption} value.
- * @param foWrapOption The raw FO wrap-option value to be converted.
- * @return The matching WrapOption instance.
- */
- private WrapOption convertWrapOption(final FoKeyword foWrapOption) {
- switch (foWrapOption) {
- case NO_WRAP: return WrapOption.NO_WRAP;
- case WRAP: return WrapOption.WRAP;
- default: throw new IllegalArgumentException(
- "Illegal wrap-option value: " + foWrapOption.getText());
- }
- }
-
@Override
public WrapOption traitWrapOption(final FoContext context) {
- final FoKeyword foWrapOption = getPropertyList().getWrapOption(this,
- context);
- return convertWrapOption(foWrapOption);
+ final FoKeyword keyword = getPropertyList().getWrapOption(this, context);
+ return PdWrapOption.fromKeyword(keyword);
}
@Override
@@ -846,28 +869,13 @@
return getPropertyList().getIndent(this, context, RelativeCompass.START);
}
- /**
- * Converts an {@link FoKeyword} span value to the more generic
- * {@link Span} value.
- * @param foSpan The raw FO span value to be converted.
- * @return The matching Span instance.
- */
- private static Span convertSpan(final FoKeyword foSpan) {
- switch (foSpan) {
- case NONE: return Span.NONE;
- case ALL: return Span.ALL;
- default: throw new IllegalArgumentException("Illegal span value: " + foSpan.getText());
- }
-
- }
-
@Override
public Span traitSpan(final FoContext context) {
/* Only block-level FOs are affected by column-count, so, for all other
* FOs, treat them as if the span trait were "all". */
if (this.isBlockLevelFo()) {
- final FoKeyword foSpan = getPropertyList().getSpan(this, context);
- return convertSpan(foSpan);
+ final FoKeyword keyword = getPropertyList().getSpan(this, context);
+ return PdSpan.fromKeyword(keyword);
}
return Span.ALL;
}
@@ -927,23 +935,8 @@
}
}
- /**
- * Converts an {@link FoKeyword} display-align value to the more generic {@link DisplayAlign} value.
- * @param foDisplayAlign The raw FO display-align value to be converted.
- * @return The matching DisplayAlign instance.
- */
- private static DisplayAlign convertDisplayAlign(final FoKeyword foDisplayAlign) {
- switch (foDisplayAlign) {
- case BEFORE: return DisplayAlign.BEFORE;
- case CENTER: return DisplayAlign.CENTER;
- case AFTER: return DisplayAlign.AFTER;
- default: throw new IllegalArgumentException("Illegal display-align value: " + foDisplayAlign.getText());
- }
- }
-
@Override
public DisplayAlign traitDisplayAlign(final FoContext context) {
- final FoKeyword foDisplayAlign = getPropertyList().getDisplayAlign(this, context);
if (this.relativeAlignApplies()) {
final RelativeAlign foRelativeAlign = this.traitRelativeAlign(context);
switch (foRelativeAlign) {
@@ -951,7 +944,8 @@
case BASELINE: return DisplayAlign.BASELINE;
}
}
- return convertDisplayAlign(foDisplayAlign);
+ final FoKeyword keyword = getPropertyList().getDisplayAlign(this, context);
+ return PdDisplayAlign.fromKeyword(keyword);
}
/**
@@ -988,26 +982,10 @@
return getPropertyList().getNumberColumnsRepeated();
}
- /**
- * Converts a {@link FoKeyword} break-after or break-before value to the more generic {@link Break} value.
- * @param foBreak The raw FO break-after or break-before value to be converted.
- * @return The matching Break instance.
- */
- private static Break convertBreak(final FoKeyword foBreak) {
- switch (foBreak) {
- case AUTO: return Break.AUTO;
- case COLUMN: return Break.COLUMN;
- case PAGE: return Break.PAGE;
- case EVEN_PAGE: return Break.EVEN_PAGE;
- case ODD_PAGE: return Break.ODD_PAGE;
- default: throw new IllegalArgumentException("Illegal break value: " + foBreak.getText());
- }
- }
-
@Override
public Break traitBreakAfter(final FoContext context) {
- final FoKeyword foBreak = getPropertyList().getBreakAfter(this, context);
- return convertBreak(foBreak);
+ final FoKeyword keyword = getPropertyList().getBreakAfter(this, context);
+ return AbstractBreak.fromKeyword(keyword);
}
@Override
@@ -1130,27 +1108,10 @@
return getPropertyList().getLetterValue(this);
}
- /**
- * Converts a {@link FoKeyword} force-page-count value to the more generic {@link ForcePageCount} value.
- * @param foForcePageCount The raw FO force-page-count value to be converted.
- * @return The matching ForcePageCount instance.
- */
- private static ForcePageCount convertForcePageCount(final FoKeyword foForcePageCount) {
- switch (foForcePageCount) {
- case AUTO: return ForcePageCount.AUTO;
- case EVEN: return ForcePageCount.EVEN;
- case ODD: return ForcePageCount.ODD;
- case END_ON_EVEN: return ForcePageCount.END_ON_EVEN;
- case END_ON_ODD: return ForcePageCount.END_ON_ODD;
- case NO_FORCE: return ForcePageCount.NO_FORCE;
- default: throw new IllegalArgumentException("Illegal force-page-count value: " + foForcePageCount.getText());
- }
- }
-
@Override
public ForcePageCount traitForcePageCount(final FoContext context) {
- final FoKeyword foForcePageCount = getPropertyList().getForcePageCount(this, context);
- return convertForcePageCount(foForcePageCount);
+ final FoKeyword keyword = getPropertyList().getForcePageCount(this, context);
+ return PdForcePageCount.fromKeyword(keyword);
}
/**
@@ -1179,27 +1140,10 @@
return getPropertyList().getColumnGap(this, context);
}
- /**
- * Converts an {@link FoKeyword} overflow value to the more generic {@link Overflow} value.
- * @param foOverflow The raw FO overflow value to be converted.
- * @return The matching Overflow instance.
- */
- private static Overflow convertOverflow(final FoKeyword foOverflow) {
- switch (foOverflow) {
- case VISIBLE: return Overflow.VISIBLE;
- case HIDDEN: return Overflow.HIDDEN;
- case SCROLL: return Overflow.SCROLL;
- case AUTO: return Overflow.AUTO;
- case ERROR_IF_OVERFLOW: return Overflow.ERROR_IF_OVERFLOW;
- case REPEAT: return Overflow.REPEAT;
- default: throw new IllegalArgumentException("Illegal overflow value: " + foOverflow.getText());
- }
- }
-
@Override
public Overflow traitOverflow(final FoContext context) {
- final FoKeyword foOverflow = getPropertyList().getOverflow(this, context);
- return convertOverflow(foOverflow);
+ final FoKeyword keyword = getPropertyList().getOverflow(this, context);
+ return PdOverflow.fromKeyword(keyword);
}
@Override
@@ -1225,32 +1169,10 @@
return getPropertyList().getPageHeight(this);
}
- /**
- * Converts an {@link FoKeyword} text-align value to the more generic {@link TextAlign} value.
- * @param foTextAlign The raw FO text-align value to be converted.
- * @return The matching TextAlign instance.
- */
- private static TextAlign convertTextAlign(final FoKeyword foTextAlign) {
- switch (foTextAlign) {
- case START: return TextAlign.START;
- case CENTER: return TextAlign.CENTER;
- case END: return TextAlign.END;
- case JUSTIFY: return TextAlign.JUSTIFY;
- case INSIDE: return TextAlign.INSIDE;
- case OUTSIDE: return TextAlign.OUTSIDE;
- case NOT_A_KEYWORD: return TextAlign.STRING;
- /* As per XSL-FO 1.1 Section 7.16.9, normalize "left" to "start". */
- case LEFT: return TextAlign.START;
- /* As per XSL-FO 1.1 Section 7.16.9, normalize "right" to "end". */
- case RIGHT: return TextAlign.END;
- default: throw new IllegalArgumentException("Illegal text-align value: " + foTextAlign.getText());
- }
- }
-
@Override
public TextAlign traitTextAlign(final FoContext context) {
- final FoKeyword foTextAlign = getPropertyList().getTextAlign(this, context);
- return convertTextAlign(foTextAlign);
+ final FoKeyword keyword = getPropertyList().getTextAlign(this, context);
+ return PdTextAlign.fromKeyword(keyword);
}
@Override
@@ -1258,32 +1180,10 @@
return getPropertyList().getTextAlignString();
}
- /**
- * Converts an {@link FoKeyword} text-align-last value to the more generic {@link TextAlignLast} value.
- * @param foTextAlignLast The raw FO text-align-last value to be converted.
- * @return The matching TextAlignLast instance.
- */
- private static TextAlignLast convertTextAlignLast(final FoKeyword foTextAlignLast) {
- switch (foTextAlignLast) {
- case RELATIVE: return TextAlignLast.RELATIVE;
- case START: return TextAlignLast.START;
- case CENTER: return TextAlignLast.CENTER;
- case END: return TextAlignLast.END;
- case JUSTIFY: return TextAlignLast.JUSTIFY;
- case INSIDE: return TextAlignLast.INSIDE;
- case OUTSIDE: return TextAlignLast.OUTSIDE;
- /* As per XSL-FO 1.1 Section 7.16.10, normalize "left" to "start". */
- case LEFT: return TextAlignLast.START;
- /* As per XSL-FO 1.1 Section 7.16.10, normalize "right" to "end". */
- case RIGHT: return TextAlignLast.END;
- default: throw new IllegalArgumentException("Illegal text-align-last value: " + foTextAlignLast.getText());
- }
- }
-
@Override
public TextAlignLast traitTextAlignLast(final FoContext context) {
- final FoKeyword foTextAlignLast = getPropertyList().getTextAlignLast(this, context);
- return convertTextAlignLast(foTextAlignLast);
+ final FoKeyword keyword = getPropertyList().getTextAlignLast(this, context);
+ return PdTextAlignLast.fromKeyword(keyword);
}
@Override
@@ -1431,24 +1331,11 @@
@Override
public Break traitBreakBefore(final FoContext context) {
- final FoKeyword foBreak = getPropertyList().getBreakBefore(this, context);
- return convertBreak(foBreak);
+ final FoKeyword keyword = getPropertyList().getBreakBefore(this, context);
+ return AbstractBreak.fromKeyword(keyword);
}
/**
- * Converts an {@link FoKeyword} scaling value to the more generic {@link Scaling} value.
- * @param foScaling The raw FO scaling value to be converted.
- * @return The matching Scaling instance.
- */
- private static Scaling convertScaling(final FoKeyword foScaling) {
- switch (foScaling) {
- case UNIFORM: return Scaling.UNIFORM;
- case NON_UNIFORM: return Scaling.NON_UNIFORM;
- default: throw new IllegalArgumentException("Illegal scaling value: " + foScaling.getText());
- }
- }
-
- /**
* Returns the "scaling" trait for this FO.
* @param context An object that knows how to resolve FO Tree context issues.
* @return The "scaling" trait.
@@ -1455,30 +1342,14 @@
* @see "XSL-FO Standard 1.0, Section 7.14.10"
*/
public Scaling traitScaling(final FoContext context) {
- final FoKeyword foScaling = getPropertyList().getScaling(this, context);
- return convertScaling(foScaling);
+ final FoKeyword keyword = getPropertyList().getScaling(this, context);
+ return PdScaling.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} leader-pattern value to the more generic {@link LeaderPattern} value.
- * @param foLeaderPattern The raw FO leader-pattern value to be converted.
- * @return The matching LeaderPattern instance.
- */
- private static LeaderPattern convertLeaderPattern(
- final FoKeyword foLeaderPattern) {
- switch (foLeaderPattern) {
- case SPACE: return LeaderPattern.SPACE;
- case RULE: return LeaderPattern.RULE;
- case DOTS: return LeaderPattern.DOTS;
- case USE_CONTENT: return LeaderPattern.USE_CONTENT;
- default: throw new IllegalArgumentException("Illegal leader-pattern value: " + foLeaderPattern.getText());
- }
- }
-
@Override
public LeaderPattern traitLeaderPattern(final FoContext context) {
- final FoKeyword foLeaderPattern = getPropertyList().getLeaderPattern(this, context);
- return convertLeaderPattern(foLeaderPattern);
+ final FoKeyword keyword = getPropertyList().getLeaderPattern(this, context);
+ return PdLeaderPattern.fromKeyword(keyword);
}
@Override
@@ -1504,28 +1375,10 @@
return getPropertyList().getRuleThickness(this, context);
}
- /**
- * Converts an {@link FoKeyword} rule-style value to the more generic {@link RuleStyle} value.
- * @param foRuleStyle The raw FO rule style to be converted.
- * @return The matching RuleStyle instance.
- */
- private static RuleStyle convertRuleStyle(final FoKeyword foRuleStyle) {
- switch (foRuleStyle) {
- case NONE: return RuleStyle.NONE;
- case DOTTED: return RuleStyle.DOTTED;
- case DASHED: return RuleStyle.DASHED;
- case SOLID: return RuleStyle.SOLID;
- case DOUBLE: return RuleStyle.DOUBLE;
- case GROOVE: return RuleStyle.GROOVE;
- case RIDGE: return RuleStyle.RIDGE;
- default: throw new IllegalArgumentException("Illegal rule style: " + foRuleStyle.getText());
- }
- }
-
@Override
public RuleStyle traitRuleStyle(final FoContext context) {
- final FoKeyword foRuleStyle = getPropertyList().getRuleStyle(this, context);
- return convertRuleStyle(foRuleStyle);
+ final FoKeyword keyword = getPropertyList().getRuleStyle(this, context);
+ return PdRuleStyle.fromKeyword(keyword);
}
@Override
@@ -1533,24 +1386,10 @@
return getPropertyList().getLeaderPatternWidth(this, context);
}
- /**
- * Converts an {@link FoKeyword} leader-alignment value to the more generic {@link LeaderAlignment} value.
- * @param foLeaderAlignment The raw FO leader-alignment to be converted.
- * @return The matching LeaderAlignment instance.
- */
- private static LeaderAlignment convertLeaderAlignment(final FoKeyword foLeaderAlignment) {
- switch (foLeaderAlignment) {
- case NONE: return LeaderAlignment.NONE;
- case REFERENCE_AREA: return LeaderAlignment.REFERENCE_AREA;
- case PAGE: return LeaderAlignment.PAGE;
- default: throw new IllegalArgumentException("Illegal leader-alignment: " + foLeaderAlignment.getText());
- }
- }
-
@Override
public LeaderAlignment traitLeaderAlignment(final FoContext context) {
- final FoKeyword foLeaderAlignment = getPropertyList().getLeaderAlignment(this, context);
- return convertLeaderAlignment(foLeaderAlignment);
+ final FoKeyword keyword = getPropertyList().getLeaderAlignment(this, context);
+ return PdLeaderAlignment.fromKeyword(keyword);
}
@Override
@@ -1558,23 +1397,10 @@
return getPropertyList().getRefId(this, context);
}
- /**
- * Converts an {@link FoKeyword} table-layout value to the more generic {@link TableLayout} value.
- * @param foTableLayout The raw FO leader-alignment to be converted.
- * @return The matching TableLayout instance.
- */
- private static TableLayout convertTableLayout(final FoKeyword foTableLayout) {
- switch (foTableLayout) {
- case AUTO: return TableLayout.AUTO;
- case FIXED: return TableLayout.FIXED;
- default: throw new IllegalArgumentException("Illegal table-layout: " + foTableLayout.getText());
- }
- }
-
@Override
public TableLayout traitTableLayout() {
- final FoKeyword foTableLayout = getPropertyList().getTableLayout();
- return convertTableLayout(foTableLayout);
+ final FoKeyword keyword = getPropertyList().getTableLayout();
+ return PdTableLayout.fromKeyword(keyword);
}
@Override
@@ -1777,25 +1603,10 @@
return getPropertyList().getBackgroundImage(this, context);
}
- /**
- * Converts an {@link FoKeyword} background-repeat value to the more generic {@link BackgroundRepeat} value.
- * @param foBackgroundRepeat The raw FO background-repeat to be converted.
- * @return The matching BackgroundRepeat instance.
- */
- private static BackgroundRepeat convertBackgroundRepeat(final FoKeyword foBackgroundRepeat) {
- switch (foBackgroundRepeat) {
- case REPEAT: return BackgroundRepeat.REPEAT;
- case REPEAT_X: return BackgroundRepeat.REPEAT_X;
- case REPEAT_Y: return BackgroundRepeat.REPEAT_Y;
- case NO_REPEAT: return BackgroundRepeat.NO_REPEAT;
- default: throw new IllegalArgumentException("Illegal background-repeat: " + foBackgroundRepeat.getText());
- }
- }
-
@Override
public BackgroundRepeat traitBackgroundRepeat(final FoContext context) {
- final FoKeyword foBackgroundRepeat = getPropertyList().getBackgroundRepeat(this, context);
- return convertBackgroundRepeat(foBackgroundRepeat);
+ final FoKeyword keyword = getPropertyList().getBackgroundRepeat(this, context);
+ return PdBackgroundRepeat.fromKeyword(keyword);
}
@Override
@@ -1994,45 +1805,16 @@
return getPropertyList().traitContentType(this);
}
- /**
- * Converts an {@link FoKeyword} absolute-position value to the more generic
- * {@link AbsolutePosition} value.
- * @param foAbsolutePosition The raw FO absolute-position to be converted.
- * @return The matching AbsolutePosition instance.
- */
- private static AbsolutePosition convertAbsolutePosition(final FoKeyword foAbsolutePosition) {
- switch (foAbsolutePosition) {
- case AUTO: return AbsolutePosition.AUTO;
- case ABSOLUTE: return AbsolutePosition.ABSOLUTE;
- case FIXED: return AbsolutePosition.FIXED;
- default: throw new IllegalArgumentException("Illegal absolute-position: " + foAbsolutePosition.getText());
- }
- }
-
@Override
public AbsolutePosition traitAbsolutePosition(final FoContext context) {
- final FoKeyword foAbsolutePosition = getPropertyList().traitAbsolutePosition(this, context);
- return convertAbsolutePosition(foAbsolutePosition);
+ final FoKeyword keyword = getPropertyList().traitAbsolutePosition(this, context);
+ return PdAbsolutePosition.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} background-attachment value to the more generic {@link BackgroundAttachment} value.
- * @param foBackgroundAttachment The raw FO background-attachment to be converted.
- * @return The matching BackgroundAttachment instance.
- */
- private static BackgroundAttachment convertBackgroundAttachment(final FoKeyword foBackgroundAttachment) {
- switch (foBackgroundAttachment) {
- case SCROLL: return BackgroundAttachment.SCROLL;
- case FIXED: return BackgroundAttachment.FIXED;
- default: throw new IllegalArgumentException("Illegal background-attachment: " +
- foBackgroundAttachment.getText());
- }
- }
-
@Override
public BackgroundAttachment traitBackgroundAttachment(final FoContext context) {
- final FoKeyword foBackgroundAttachment = getPropertyList().traitBackgroundAttachment(this, context);
- return convertBackgroundAttachment(foBackgroundAttachment);
+ final FoKeyword keyword = getPropertyList().traitBackgroundAttachment(this, context);
+ return PdBackgroundAttachment.fromKeyword(keyword);
}
/**
@@ -2080,146 +1862,43 @@
return convertDirection(foDirection);
}
- /**
- * Converts an {@link FoKeyword} font-selection-strategy value to the more generic
- * {@link org.axsl.font.Font.SelectionStrategy} value.
- * @param foFontSelectionStrategy The raw FO font-selection-strategy to be converted.
- * @return The matching Font.SelectionStrategy instance.
- */
- private static FontSelectionStrategy convertFontSelectionStrategy(final FoKeyword foFontSelectionStrategy) {
- switch (foFontSelectionStrategy) {
- case AUTO: return FontSelectionStrategy.AUTO;
- case CHARACTER_BY_CHARACTER: return FontSelectionStrategy.CHARACTER_BY_CHARACTER;
- default: throw new IllegalArgumentException("Illegal font-selection-strategy: " +
- foFontSelectionStrategy.getText());
- }
- }
-
@Override
public FontSelectionStrategy traitFontSelectionStrategy(final FoContext context) {
- final FoKeyword foFss = getPropertyList().traitFontSelectionStrategy(this, context);
- return convertFontSelectionStrategy(foFss);
+ final FoKeyword keyword = getPropertyList().traitFontSelectionStrategy(this, context);
+ return PdFontSelectionStrategy.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} hyphenation-keep value to the more generic {@link HyphenationKeep} value.
- * @param foHyphenationKeep The raw FO hyphenation-keep to be converted.
- * @return The matching HyphenationKeep instance.
- */
- private static HyphenationKeep convertHyphenationKeep(final FoKeyword foHyphenationKeep) {
- switch (foHyphenationKeep) {
- case AUTO: return HyphenationKeep.AUTO;
- case COLUMN: return HyphenationKeep.COLUMN;
- case PAGE: return HyphenationKeep.PAGE;
- default: throw new IllegalArgumentException("Illegal hyphenation-keep: " + foHyphenationKeep.getText());
- }
- }
-
@Override
public HyphenationKeep traitHyphenationKeep(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitHyphenationKeep(this, context);
- return convertHyphenationKeep(foValue);
+ final FoKeyword keyword = getPropertyList().traitHyphenationKeep(this, context);
+ return PdHyphenationKeep.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} linefeed-treatment value to the more generic {@link LinefeedTreatment} value.
- * @param foLinefeedTreatment The raw FO linefeed-treatment to be converted.
- * @return The matching LinefeedTreatment instance.
- */
- private static LinefeedTreatment convertLinefeedTreatment(final FoKeyword foLinefeedTreatment) {
- switch (foLinefeedTreatment) {
- case IGNORE: return LinefeedTreatment.IGNORE;
- case PRESERVE: return LinefeedTreatment.PRESERVE;
- case TREAT_AS_SPACE: return LinefeedTreatment.TREAT_AS_SPACE;
- case TREAT_AS_ZERO_WIDTH_SPACE: return LinefeedTreatment.TREAT_AS_ZERO_WIDTH_SPACE;
- default: throw new IllegalArgumentException("Illegal linefeed-treatment: " + foLinefeedTreatment.getText());
- }
- }
-
@Override
public LinefeedTreatment traitLinefeedTreatment(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitLinefeedTreatment(this, context);
- return convertLinefeedTreatment(foValue);
+ final FoKeyword keyword = getPropertyList().traitLinefeedTreatment(this, context);
+ return PdLinefeedTreatment.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} line-height-shift-adjustment value to the more generic
- * {@link LineHeightShiftAdjustment} value.
- * @param foLineHeightShiftAdjustment The raw FO line-height-shift-adjustment to be converted.
- * @return The matching LineHeightShiftAdjustment instance.
- */
- private static LineHeightShiftAdjustment convertLineHeightShiftAdjustment(
- final FoKeyword foLineHeightShiftAdjustment) {
- switch (foLineHeightShiftAdjustment) {
- case CONSIDER_SHIFTS: return LineHeightShiftAdjustment.CONSIDER_SHIFTS;
- case DISREGARD_SHIFTS: return LineHeightShiftAdjustment.DISREGARD_SHIFTS;
- default: throw new IllegalArgumentException("Illegal line-height-shift-adjustment: " +
- foLineHeightShiftAdjustment.getText());
- }
- }
-
@Override
public LineHeightShiftAdjustment traitLineHeightShiftAdjustment(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitLineHeightShiftAdjustment(this, context);
- return convertLineHeightShiftAdjustment(foValue);
+ final FoKeyword keyword = getPropertyList().traitLineHeightShiftAdjustment(this, context);
+ return PdLineHeightShiftAdjustment.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} line-stacking-strategy value to the more generic {@link LineStackingStrategy}
- * value.
- * @param foLineStackingStrategy The raw FO line-stacking-strategy to be converted.
- * @return The matching LineStackingStrategy instance.
- */
- private static LineStackingStrategy convertLineStackingStrategy(final FoKeyword foLineStackingStrategy) {
- switch (foLineStackingStrategy) {
- case LINE_HEIGHT: return LineStackingStrategy.LINE_HEIGHT;
- case FONT_HEIGHT: return LineStackingStrategy.FONT_HEIGHT;
- case MAX_HEIGHT: return LineStackingStrategy.MAX_HEIGHT;
- default: throw new IllegalArgumentException("Illegal line-stacking-strategy: " +
- foLineStackingStrategy.getText());
- }
- }
-
@Override
public LineStackingStrategy traitLineStackingStrategy(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitLineStackingStrategy(this, context);
- return convertLineStackingStrategy(foValue);
+ final FoKeyword keyword = getPropertyList().traitLineStackingStrategy(this, context);
+ return PdLineStackingStrategy.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} relative-position value to the more generic {@link RelativePosition} value.
- * @param foRelativePosition The raw FO relative-position to be converted.
- * @return The matching RelativePosition instance.
- */
- private static RelativePosition convertRelativePosition(final FoKeyword foRelativePosition) {
- switch (foRelativePosition) {
- case STATIC: return RelativePosition.STATIC;
- case RELATIVE: return RelativePosition.RELATIVE;
- default: throw new IllegalArgumentException("Illegal relative-position: " + foRelativePosition.getText());
- }
- }
-
@Override
public RelativePosition traitRelativePosition(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitRelativePosition(this, context);
- return convertRelativePosition(foValue);
+ final FoKeyword keyword = getPropertyList().traitRelativePosition(this, context);
+ return PdRelativePosition.fromKeyword(keyword);
}
/**
- * Converts an {@link FoKeyword} scaling-method value to the more generic {@link ScalingMethod} value.
- * @param foScalingMethod The raw FO scaling-method to be converted.
- * @return The matching ScalingMethod instance.
- */
- private static ScalingMethod convertScalingMethod(final FoKeyword foScalingMethod) {
- switch (foScalingMethod) {
- case AUTO: return ScalingMethod.AUTO;
- case INTEGER_PIXELS: return ScalingMethod.INTEGER_PIXELS;
- case RESAMPLE_ANY_METHOD: return ScalingMethod.RESAMPLE_ANY_METHOD;
- default: throw new IllegalArgumentException("Illegal scaling-method: " + foScalingMethod.getText());
- }
- }
-
- /**
* Returns the "scaling-method" trait for this FO.
* @param context An object that knows how to resolve FO Tree context issues.
* @return The "scaling-method" trait.
@@ -2226,72 +1905,26 @@
* @see "XSL-FO Standard 1.0, Section 7.14.11"
*/
public ScalingMethod traitScalingMethod(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitScalingMethod(this, context);
- return convertScalingMethod(foValue);
+ final FoKeyword keyword = getPropertyList().traitScalingMethod(this, context);
+ return PdScalingMethod.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} suppress-at-line-break value to the more generic {@link SuppressAtLineBreak} value.
- * @param foSuppressAtLineBreak The raw FO suppress-at-line-break to be converted.
- * @return The matching SuppressAtLineBreak instance.
- */
- private static SuppressAtLineBreak convertSuppressAtLineBreak(final FoKeyword foSuppressAtLineBreak) {
- switch (foSuppressAtLineBreak) {
- case AUTO: return SuppressAtLineBreak.AUTO;
- case SUPPRESS: return SuppressAtLineBreak.SUPPRESS;
- case RETAIN: return SuppressAtLineBreak.RETAIN;
- default: throw new IllegalArgumentException("Illegal suppress-at-line-break: " +
- foSuppressAtLineBreak.getText());
- }
- }
-
@Override
public SuppressAtLineBreak traitSuppressAtLineBreak(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitSuppressAtLineBreak(this, context);
- return convertSuppressAtLineBreak(foValue);
+ final FoKeyword keyword = getPropertyList().traitSuppressAtLineBreak(this, context);
+ return PdSuppressAtLineBreak.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} unicode-bidi value to the more generic {@link UnicodeBidi} value.
- * @param foUnicodeBidi The raw FO unicode-bidi to be converted.
- * @return The matching UnicodeBidi instance.
- */
- private static UnicodeBidi convertUnicodeBidi(final FoKeyword foUnicodeBidi) {
- switch (foUnicodeBidi) {
- case NORMAL: return UnicodeBidi.NORMAL;
- case EMBED: return UnicodeBidi.EMBED;
- case BIDI_OVERRIDE: return UnicodeBidi.BIDI_OVERRIDE;
- default: throw new IllegalArgumentException("Illegal unicode-bidi: " + foUnicodeBidi.getText());
- }
- }
-
@Override
public UnicodeBidi traitUnicodeBidi(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitUnicodeBidi(this, context);
- return convertUnicodeBidi(foValue);
+ final FoKeyword keyword = getPropertyList().traitUnicodeBidi(this, context);
+ return PdUnicodeBidi.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} white-space-treatment value to the more generic {@link WhiteSpaceTreatment} value.
- * @param foWhiteSpaceTreatment The raw FO white-space-treatment to be converted.
- * @return The matching WhiteSpaceTreatment instance.
- */
- private static WhiteSpaceTreatment convertWhiteSpaceTreatment(final FoKeyword foWhiteSpaceTreatment) {
- switch (foWhiteSpaceTreatment) {
- case IGNORE: return WhiteSpaceTreatment.IGNORE;
- case PRESERVE: return WhiteSpaceTreatment.PRESERVE;
- case IGNORE_IF_BEFORE_LINEFEED: return WhiteSpaceTreatment.IGNORE_IF_BEFORE_LINEFEED;
- case IGNORE_IF_AFTER_LINEFEED: return WhiteSpaceTreatment.IGNORE_IF_AFTER_LINEFEED;
- case IGNORE_IF_SURROUNDING_LINEFEED: return WhiteSpaceTreatment.IGNORE_IF_SURROUNDING_LINEFEED;
- default: throw new IllegalArgumentException("Illegal white-space-treatment: " +
- foWhiteSpaceTreatment.getText());
- }
- }
-
@Override
public WhiteSpaceTreatment traitWhiteSpaceTreatment(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitWhiteSpaceTreatment(this, context);
- return convertWhiteSpaceTreatment(foValue);
+ final FoKeyword keyword = getPropertyList().traitWhiteSpaceTreatment(this, context);
+ return PdWhiteSpaceTreatment.fromKeyword(keyword);
}
@Override
@@ -2299,319 +1932,99 @@
return getPropertyList().traitCaseTitle();
}
- /**
- * Converts an {@link FoKeyword} active-state value to the more generic {@link ActiveState} value.
- * @param foActiveState The raw FO active-state to be converted.
- * @return The matching ActiveState instance.
- */
- private static ActiveState convertActiveState(final FoKeyword foActiveState) {
- switch (foActiveState) {
- case LINK: return ActiveState.LINK;
- case VISITED: return ActiveState.VISITED;
- case ACTIVE: return ActiveState.ACTIVE;
- case HOVER: return ActiveState.HOVER;
- case FOCUS: return ActiveState.FOCUS;
- default: throw new IllegalArgumentException("Illegal active-state: " + foActiveState.getText());
- }
- }
-
@Override
public ActiveState traitActiveState(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitActiveState(this, context);
- return convertActiveState(foValue);
+ final FoKeyword keyword = getPropertyList().traitActiveState(this, context);
+ return PdActiveState.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} clear value to the more generic {@link Clear} value.
- * @param foClear The raw FO clear to be converted.
- * @return The matching Clear instance.
- */
- private static Clear convertClear(final FoKeyword foClear) {
- switch (foClear) {
- case START: return Clear.START;
- case END: return Clear.END;
- case INSIDE: return Clear.INSIDE;
- case OUTSIDE: return Clear.OUTSIDE;
- case BOTH: return Clear.BOTH;
- case NONE: return Clear.NONE;
- default: throw new IllegalArgumentException("Illegal clear: " + foClear.getText());
- }
- }
-
@Override
public Clear traitClear(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitClear(this, context);
- return convertClear(foValue);
+ final FoKeyword keyword = getPropertyList().traitClear(this, context);
+ return PdClear.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} empty-cells value to the more generic {@link EmptyCells} value.
- * @param foEmptyCells The raw FO empty-cells to be converted.
- * @return The matching EmptyCells instance.
- */
- private static EmptyCells convertEmptyCells(final FoKeyword foEmptyCells) {
- switch (foEmptyCells) {
- case SHOW: return EmptyCells.SHOW;
- case HIDE: return EmptyCells.HIDE;
- default: throw new IllegalArgumentException("Illegal empty-cells: " + foEmptyCells.getText());
- }
- }
-
@Override
public EmptyCells traitEmptyCells(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitEmptyCells(this, context);
- return convertEmptyCells(foValue);
+ final FoKeyword keyword = getPropertyList().traitEmptyCells(this, context);
+ return PdEmptyCells.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} float value to the more generic {@link Float} value.
- * @param foFloat The raw FO float to be converted.
- * @return The matching Float instance.
- */
- private static FloatDirection convertFloat(final FoKeyword foFloat) {
- switch (foFloat) {
- case BEFORE: return FloatDirection.BEFORE;
- case START: return FloatDirection.START;
- case END: return FloatDirection.END;
- case INSIDE: return FloatDirection.INSIDE;
- case OUTSIDE: return FloatDirection.OUTSIDE;
- case NONE: return FloatDirection.NONE;
- default: throw new IllegalArgumentException("Illegal float: " + foFloat.getText());
- }
- }
-
@Override
public FloatDirection traitFloat(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitFloat(this, context);
- return convertFloat(foValue);
+ final FoKeyword keyword = getPropertyList().traitFloat(this, context);
+ return PdFloat.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} media-usage value to the more generic {@link MediaUsage} value.
- * @param foMediaUsage The raw FO media-usage to be converted.
- * @return The matching MediaUsage instance.
- */
- private static MediaUsage convertMediaUsage(final FoKeyword foMediaUsage) {
- switch (foMediaUsage) {
- case PAGINATE: return MediaUsage.PAGINATE;
- case BOUNDED_IN_ONE_DIMENSION: return MediaUsage.BOUNDED_IN_ONE_DIMENSION;
- case UNBOUNDED: return MediaUsage.UNBOUNDED;
- default: throw new IllegalArgumentException("Illegal media-usage: " + foMediaUsage.getText());
- }
- }
-
@Override
public MediaUsage traitMediaUsage(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitMediaUsage(this, context);
- return convertMediaUsage(foValue);
+ final FoKeyword keyword = getPropertyList().traitMediaUsage(this, context);
+ return PdMediaUsage.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} reference-orientation value to the more generic {@link ReferenceOrientation} value.
- * @param foReferenceOrientation The raw FO reference-orientation to be converted.
- * @return The matching ReferenceOrientation instance.
- */
- private static ReferenceOrientation convertReferenceOrientation(final FoKeyword foReferenceOrientation) {
- switch (foReferenceOrientation) {
- case NUM_ZERO: return ReferenceOrientation.ROTATION_0_DEGREES;
- case NUM_90: return ReferenceOrientation.ROTATION_90_DEGREES;
- case NUM_180: return ReferenceOrientation.ROTATION_180_DEGREES;
- case NUM_270: return ReferenceOrientation.ROTATION_270_DEGREES;
- case NUM_NEGATIVE_90: return ReferenceOrientation.ROTATION_270_DEGREES;
- case NUM_NEGATIVE_180: return ReferenceOrientation.ROTATION_180_DEGREES;
- case NUM_NEGATIVE_270: return ReferenceOrientation.ROTATION_90_DEGREES;
- default: throw new IllegalArgumentException("Illegal reference-orientation: " +
- foReferenceOrientation.getText());
- }
- }
-
@Override
public ReferenceOrientation traitReferenceOrientation(final FoContext context) {
/* Per XSL-FO Standard 1.0, Section 7.20.3, reference-orientation is
* only applied to FOs that establish a reference-area. */
if (traitIsReferenceArea()) {
- final FoKeyword foValue = getPropertyList().traitReferenceOrientation(this, context);
- return convertReferenceOrientation(foValue);
+ final FoKeyword keyword = getPropertyList().traitReferenceOrientation(this, context);
+ return PdReferenceOrientation.fromKeyword(keyword);
}
return null;
}
- /**
- * Converts an {@link FoKeyword} rendering-intent value to the more generic {@link RenderingIntent} value.
- * @param foRenderingIntent The raw FO rendering-intent to be converted.
- * @return The matching RenderingIntent instance.
- */
- private static RenderingIntent convertRenderingIntent(final FoKeyword foRenderingIntent) {
- switch (foRenderingIntent) {
- case AUTO: return RenderingIntent.AUTO;
- case PERCEPTUAL: return RenderingIntent.PERCEPTUAL;
- case RELATIVE_COLORIMETRIC: return RenderingIntent.RELATIVE_COLORIMETRIC;
- case SATURATION: return RenderingIntent.SATURATION;
- case ABSOLUTE_COLORIMETRIC: return RenderingIntent.ABSOLUTE_COLORIMETRIC;
- default: throw new IllegalArgumentException("Illegal rendering-intent: " + foRenderingIntent.getText());
- }
- }
-
@Override
public RenderingIntent traitRenderingIntent(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitRenderingIntent(this, context);
- return convertRenderingIntent(foValue);
+ final FoKeyword keyword = getPropertyList().traitRenderingIntent(this, context);
+ return PdRenderingIntent.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} show-destination value to the more generic {@link ShowDestination} value.
- * @param foShowDestination The raw FO show-destination to be converted.
- * @return The matching ShowDestination instance.
- */
- private static ShowDestination convertShowDestination(final FoKeyword foShowDestination) {
- switch (foShowDestination) {
- case REPLACE: return ShowDestination.REPLACE;
- case NEW: return ShowDestination.NEW;
- default: throw new IllegalArgumentException("Illegal show-destination: " + foShowDestination.getText());
- }
- }
-
@Override
public ShowDestination traitShowDestination(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitShowDestination(this, context);
- return convertShowDestination(foValue);
+ final FoKeyword keyword = getPropertyList().traitShowDestination(this, context);
+ return PdShowDestination.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} speak-header value to the more generic {@link SpeakHeader} value.
- * @param foSpeakHeader The raw FO speak-header to be converted.
- * @return The matching SpeakHeader instance.
- */
- private static SpeakHeader convertSpeakHeader(final FoKeyword foSpeakHeader) {
- switch (foSpeakHeader) {
- case ONCE: return SpeakHeader.ONCE;
- case ALWAYS: return SpeakHeader.ALWAYS;
- default: throw new IllegalArgumentException("Illegal speak-header: " + foSpeakHeader.getText());
- }
- }
-
@Override
public SpeakHeader traitSpeakHeader(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitSpeakHeader(this, context);
- return convertSpeakHeader(foValue);
+ final FoKeyword keyword = getPropertyList().traitSpeakHeader(this, context);
+ return PdSpeakHeader.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} speak value to the more generic {@link Speak} value.
- * @param foSpeak The raw FO speak to be converted.
- * @return The matching Speak instance.
- */
- private static Speak convertSpeak(final FoKeyword foSpeak) {
- switch (foSpeak) {
- case NORMAL: return Speak.NORMAL;
- case NONE: return Speak.NONE;
- case SPELL_OUT: return Speak.SPELL_OUT;
- default: throw new IllegalArgumentException("Illegal speak: " + foSpeak.getText());
- }
- }
-
@Override
public Speak traitSpeak(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitSpeak(this, context);
- return convertSpeak(foValue);
+ final FoKeyword keyword = getPropertyList().traitSpeak(this, context);
+ return PdSpeak.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} speak-numeral value to the more generic {@link SpeakNumeral} value.
- * @param foSpeakNumeral The raw FO speak-numeral to be converted.
- * @return The matching SpeakNumeral instance.
- */
- private static SpeakNumeral convertSpeakNumeral(final FoKeyword foSpeakNumeral) {
- switch (foSpeakNumeral) {
- case DIGITS: return SpeakNumeral.DIGITS;
- case CONTINUOUS: return SpeakNumeral.CONTINUOUS;
- default: throw new IllegalArgumentException("Illegal speak-numeral: " + foSpeakNumeral.getText());
- }
- }
-
@Override
public SpeakNumeral traitSpeakNumeral(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitSpeakNumeral(this, context);
- return convertSpeakNumeral(foValue);
+ final FoKeyword keyword = getPropertyList().traitSpeakNumeral(this, context);
+ return PdSpeakNumeral.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} speak-punctuation value to the more generic {@link SpeakPunctuation} value.
- * @param foSpeakPunctuation The raw FO speak-punctuation to be converted.
- * @return The matching SpeakPunctuation instance.
- */
- private static SpeakPunctuation convertSpeakPunctuation(final FoKeyword foSpeakPunctuation) {
- switch (foSpeakPunctuation) {
- case CODE: return SpeakPunctuation.CODE;
- case NONE: return SpeakPunctuation.NONE;
- default: throw new IllegalArgumentException("Illegal speak-punctuation: " + foSpeakPunctuation.getText());
- }
- }
-
@Override
public SpeakPunctuation traitSpeakPunctuation(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitSpeakPunctuation(this, context);
- return convertSpeakPunctuation(foValue);
+ final FoKeyword keyword = getPropertyList().traitSpeakPunctuation(this, context);
+ return PdSpeakPunctuation.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} starting-state value to the more generic {@link StartingState} value.
- * @param foStartingState The raw FO starting-state to be converted.
- * @return The matching StartingState instance.
- */
- private static StartingState convertStartingState(final FoKeyword foStartingState) {
- switch (foStartingState) {
- case SHOW: return StartingState.SHOW;
- case HIDE: return StartingState.HIDE;
- default: throw new IllegalArgumentException("Illegal starting-state: " + foStartingState.getText());
- }
- }
-
@Override
public StartingState traitStartingState(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitStartingState(this, context);
- return convertStartingState(foValue);
+ final FoKeyword keyword = getPropertyList().traitStartingState(this, context);
+ return PdStartingState.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} text-transform value to the more generic {@link TextTransform} value.
- * @param foTextTransform The raw FO text-transform to be converted.
- * @return The matching TextTransform instance.
- */
- private static TextTransform convertTextTransform(final FoKeyword foTextTransform) {
- switch (foTextTransform) {
- case CAPITALIZE: return TextTransform.CAPITALIZE;
- case UPPERCASE: return TextTransform.UPPERCASE;
- case LOWERCASE: return TextTransform.LOWERCASE;
- case NONE: return TextTransform.NONE;
- default: throw new IllegalArgumentException("Illegal text-transform: " + foTextTransform.getText());
- }
- }
-
@Override
public TextTransform traitTextTransform(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitTextTransform(this, context);
- return convertTextTransform(foValue);
+ final FoKeyword keyword = getPropertyList().traitTextTransform(this, context);
+ return PdTextTransform.fromKeyword(keyword);
}
- /**
- * Converts an {@link FoKeyword} visibility value to the more generic {@link Visibility} value.
- * @param foVisibility The raw FO visibility to be converted.
- * @return The matching Visibility instance.
- */
- private static Visibility convertVisibility(final FoKeyword foVisibility) {
- switch (foVisibility) {
- case VISIBLE: return Visibility.VISIBLE;
- case HIDDEN: return Visibility.HIDDEN;
- case COLLAPSE: return Visibility.COLLAPSE;
- default: throw new IllegalArgumentException("Illegal visibility: " + foVisibility.getText());
- }
- }
-
@Override
public Visibility traitVisibility(final FoContext context) {
- final FoKeyword foValue = getPropertyList().traitVisibility(this, context);
- return convertVisibility(foValue);
+ final FoKeyword keyword = getPropertyList().traitVisibility(this, context);
+ return PdVisibility.fromKeyword(keyword);
}
@Override
@@ -2783,25 +2196,10 @@
return Script4a.LATIN;
}
- /**
- * Converts an {@link FoKeyword} switch-to value to the more generic {@link SwitchTo} value.
- * @param foSwitchTo The raw FO switch-to to be converted.
- * @return The matching SwitchTo instance.
- */
- private static SwitchTo convertSwitchTo(final FoKeyword foSwitchTo) {
- switch (foSwitchTo) {
- case XSL_PRECEDING: return SwitchTo.XSL_PRECEDING;
- case XSL_FOLLOWING: return SwitchTo.XSL_FOLLOWING;
- case XSL_ANY: return SwitchTo.XSL_ANY;
- case NOT_A_KEYWORD: return SwitchTo.NAME_LIST;
- default: throw new IllegalArgumentException("Illegal switch-to: " + foSwitchTo.getText());
- }
- }
-
@Override
public SwitchTo traitSwitchTo() {
- final FoKeyword foValue = getPropertyList().traitSwitchTo();
- return convertSwitchTo(foValue);
+ final FoKeyword keyword = getPropertyList().traitSwitchTo();
+ return PdSwitchTo.fromKeyword(keyword);
}
@Override
Added: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBreak.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBreak.java (rev 0)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBreak.java 2026-04-25 20:23:33 UTC (rev 14484)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2026 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.prop;
+
+import org.foray.fotree.fo.FoKeyword;
+
+import org.axsl.value.Break;
+
+/**
+ * Abstract superclass for "break" property descriptors.
+ */
+public abstract class AbstractBreak extends AbstractEnumeration {
+
+ /**
+ * Converts a generic {@link FoKeyword} to the corresponding {@link Break}.
+ * @param keyword The keyword to be converted.
+ * @return The instance corresponding to {@code keyword}.
+ */
+ public static Break fromKeyword(final FoKeyword keyword) {
+ switch (keyword) {
+ case AUTO: return Break.AUTO;
+ case COLUMN: return Break.COLUMN;
+ case PAGE: return Break.PAGE;
+ case EVEN_PAGE: return Break.EVEN_PAGE;
+ case ODD_PAGE: return Break.ODD_PAGE;
+ default: throw new IllegalArgumentException("Illegal break value: " + keyword.getText());
+ }
+ }
+
+}
Property changes on: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/AbstractBreak.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java 2026-04-25 15:35:29 UTC (rev 14483)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdAbsolutePosition.java 2026-04-25 20:23:33 UTC (rev 14484)
@@ -35,6 +35,7 @@
import org.foray.fotree.value.PropertyValue;
import org.axsl.fotree.FoContext;
+import org.axsl.value.AbsolutePosition;
/**
* The "absolute-position" property in XSL-FO.
@@ -119,4 +120,18 @@
return FoPropertyId.ABSOLUTE_POSITION;
}
+ /**
+ * Converts a generic {@link FoKeyword} to the corresponding {@link AbsolutePosition}.
+ * @param keyword The keyword to be converted.
+ * @return The instance corresponding to {@code keyword}.
+ */
+ public static AbsolutePosition fromKeyword(final FoKeyword keyword) {
+ switch (keyword) {
+ case AUTO: return AbsolutePosition.AUTO;
+ case ABSOLUTE: return AbsolutePosition.ABSOLUTE;
+ case FIXED: return AbsolutePosition.FIXED;
+ default: throw new IllegalArgumentException("Illegal absolute-position: " + keyword...
[truncated message content] |
|
From: <vic...@us...> - 2026-04-25 15:35:30
|
Revision: 14483
http://sourceforge.net/p/foray/code/14483
Author: victormote
Date: 2026-04-25 15:35:29 +0000 (Sat, 25 Apr 2026)
Log Message:
-----------
Replace main method used for testing with an actual test.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/FoKeywordTests.java
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2026-04-25 15:06:04 UTC (rev 14482)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/FoKeyword.java 2026-04-25 15:35:29 UTC (rev 14483)
@@ -28,7 +28,9 @@
package org.foray.fotree.fo;
-import org.foray.primitive.StringUtils;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
/**
* An enumeration of the XSL-FO property value keywords.
@@ -865,7 +867,7 @@
/** Keep a local copy of the enum array, for performance. */
- private static final FoKeyword[] VALUES = values();
+ private static final List<FoKeyword> VALUES = Arrays.asList(values());
/** The keyword text. */
private String text;
@@ -902,13 +904,13 @@
return null;
}
int low = 0;
- int high = VALUES.length - 1;
+ int high = VALUES.size() - 1;
int mid;
while (low < high) {
mid = (low + high) / 2;
- final int comparison = text.compareTo(VALUES[mid].text);
+ final int comparison = text.compareTo(VALUES.get(mid).text);
if (comparison == 0) {
- return VALUES[mid];
+ return VALUES.get(mid);
}
if (comparison > 0) {
/* text is greater than mid. */
@@ -918,8 +920,8 @@
high = mid - 1;
}
}
- if (text.equals(VALUES[low].text)) {
- return VALUES[low];
+ if (text.equals(VALUES.get(low).text)) {
+ return VALUES.get(low);
}
/* Not found. */
return null;
@@ -926,24 +928,12 @@
}
/**
- * Command-line application that checks the ordering of the items.
- * @param args The command-line args. There are none.
+ * Returns an iterator over the enumeration.
+ * Useful mostly for testing that the ordering of the enumeration is correct.
+ * @return An iterator over the enumeration.
*/
- public static void main(final String[] args) {
- final FoKeyword[] keywords = FoKeyword.VALUES;
- String previous = StringUtils.EMPTY_STRING;
- for (int index = 0; index < keywords.length; index ++) {
- final FoKeyword keyword = keywords[index];
- if (keyword.text.compareTo(previous) <= 0) {
- /* CheckStyle: Allow System.out.print...() in main method. */
- System.out.println("Keyword out of order: " + keyword.text);
- /* CheckStyle: Allow System.exit() in main method. */
- System.exit(0);
- }
- previous = keyword.text;
- }
- /* CheckStyle: Allow System.out.print...() in main method. */
- System.out.println("Enum is properly ordered.");
+ public static Iterator<FoKeyword> iterator() {
+ return VALUES.iterator();
}
}
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/FoKeywordTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/FoKeywordTests.java 2026-04-25 15:06:04 UTC (rev 14482)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/fo/FoKeywordTests.java 2026-04-25 15:35:29 UTC (rev 14483)
@@ -31,6 +31,8 @@
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
+import java.util.Iterator;
+
/**
* Tests of {@link FoKeyword}, especially its binary search.
*/
@@ -37,6 +39,20 @@
public class FoKeywordTests {
/**
+ * Test that the ordering of the enumerated items is correct.
+ */
+ @Test
+ public void testOrder() {
+ final Iterator<FoKeyword> iterator = FoKeyword.iterator();
+ String previousText = "";
+ while (iterator.hasNext()) {
+ final FoKeyword keyword = iterator.next();
+ assertThat(keyword.getText()).isGreaterThan(previousText);
+ previousText = keyword.getText();
+ }
+ }
+
+ /**
* Test of binary search, looking for the first item.
*/
@Test
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-25 15:06:07
|
Revision: 14482
http://sourceforge.net/p/foray/code/14482
Author: victormote
Date: 2026-04-25 15:06:04 +0000 (Sat, 25 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Rename "Float" value class to "FloatDirection" to avoid confusion with java.lang.Float.
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 2026-04-24 18:51:20 UTC (rev 14481)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2026-04-25 15:06:04 UTC (rev 14482)
@@ -85,7 +85,7 @@
import org.axsl.value.Conditionality;
import org.axsl.value.DisplayAlign;
import org.axsl.value.EmptyCells;
-import org.axsl.value.Float;
+import org.axsl.value.FloatDirection;
import org.axsl.value.FontSelectionStrategy;
import org.axsl.value.FontStretch;
import org.axsl.value.FontStyle;
@@ -2368,20 +2368,20 @@
* @param foFloat The raw FO float to be converted.
* @return The matching Float instance.
*/
- private static Float convertFloat(final FoKeyword foFloat) {
+ private static FloatDirection convertFloat(final FoKeyword foFloat) {
switch (foFloat) {
- case BEFORE: return Float.BEFORE;
- case START: return Float.START;
- case END: return Float.END;
- case INSIDE: return Float.INSIDE;
- case OUTSIDE: return Float.OUTSIDE;
- case NONE: return Float.NONE;
+ case BEFORE: return FloatDirection.BEFORE;
+ case START: return FloatDirection.START;
+ case END: return FloatDirection.END;
+ case INSIDE: return FloatDirection.INSIDE;
+ case OUTSIDE: return FloatDirection.OUTSIDE;
+ case NONE: return FloatDirection.NONE;
default: throw new IllegalArgumentException("Illegal float: " + foFloat.getText());
}
}
@Override
- public org.axsl.value.Float traitFloat(final FoContext context) {
+ public FloatDirection traitFloat(final FoContext context) {
final FoKeyword foValue = getPropertyList().traitFloat(this, context);
return convertFloat(foValue);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-24 18:51:23
|
Revision: 14481
http://sourceforge.net/p/foray/code/14481
Author: victormote
Date: 2026-04-24 18:51:20 +0000 (Fri, 24 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Prohibit use of primitive float and double, except in the primitive-specific classes.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java
trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/AreaNode4a.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -819,7 +819,7 @@
}
@Override
- public float normalLineHeightFactor() {
+ public Float normalLineHeightFactor() {
FontUse fontUse = null;
if (this instanceof Area4a) {
final Area4a area = (Area4a) this;
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -198,7 +198,7 @@
}
@Override
- public abstract float getItalicAngle();
+ public abstract Float getItalicAngle();
@Override
public abstract int getStemV();
@@ -230,7 +230,7 @@
public abstract CharSet getCharSet();
@Override
- public float normalLineHeightFactor(
+ public Float normalLineHeightFactor(
final Font.LineHeightAlgorithm algorithm) {
switch (algorithm) {
case DEFAULT:
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FreeStandingFont.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -212,7 +212,7 @@
}
@Override
- public float getItalicAngle() {
+ public Float getItalicAngle() {
return this.italicAngle;
}
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/SystemFont.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -289,11 +289,11 @@
}
@Override
- public float getItalicAngle() {
+ public Float getItalicAngle() {
final FreeStandingFont relatedFSFont =
this.freeStandingFontManifestation();
if (relatedFSFont == null) {
- return 0;
+ return 0f;
}
return relatedFSFont.getItalicAngle();
}
Modified: trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java
===================================================================
--- trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-font-tf/src/main/java/org/foray/font/fixture/MockFont.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -164,9 +164,9 @@
}
@Override
- public float getItalicAngle() {
+ public Float getItalicAngle() {
// TODO Auto-generated method stub
- return 0;
+ return 0f;
}
@Override
@@ -281,9 +281,9 @@
}
@Override
- public float normalLineHeightFactor(final LineHeightAlgorithm algorithm) {
+ public Float normalLineHeightFactor(final LineHeightAlgorithm algorithm) {
// TODO Auto-generated method stub
- return 0;
+ return 0f;
}
@Override
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 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/Block4a.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -190,9 +190,9 @@
}
@Override
- public float getAdjustmentRatioTolerance() {
+ public Float getAdjustmentRatioTolerance() {
// TODO Auto-generated method stub
- return 0;
+ return 0f;
}
@Override
Modified: trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java
===================================================================
--- trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-fotree/src/test/java/org/foray/fotree/AbstractPropertyTests.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -189,7 +189,7 @@
}
@Override
- public float normalLineHeightFactor() {
+ public Float normalLineHeightFactor() {
return 1.2f;
}
Modified: trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java
===================================================================
--- trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-pioneer/src/main/java/org/foray/pioneer/OverrideGraftingContext.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -154,7 +154,7 @@
}
@Override
- public float normalLineHeightFactor() {
+ public Float normalLineHeightFactor() {
return this.wrappedContext.normalLineHeightFactor();
}
Modified: trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java
===================================================================
--- trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-24 16:36:25 UTC (rev 14480)
+++ trunk/foray/foray-speech/src/main/java/org/foray/speech/Voice4a.java 2026-04-24 18:51:20 UTC (rev 14481)
@@ -68,27 +68,27 @@
}
@Override
- public float pitchExtraLow() {
+ public Float pitchExtraLow() {
return this.pitchMedium * Voice4a.FACTOR_EXTRA_LOW;
}
@Override
- public float pitchLow() {
+ public Float pitchLow() {
return this.pitchMedium * Voice4a.FACTOR_LOW;
}
@Override
- public float pitchMedium() {
+ public Float pitchMedium() {
return this.pitchMedium;
}
@Override
- public float pitchHigh() {
+ public Float pitchHigh() {
return this.pitchMedium * Voice4a.FACTOR_HIGH;
}
@Override
- public float pitchExtraHigh() {
+ public Float pitchExtraHigh() {
return this.pitchMedium * Voice4a.FACTOR_EXTRA_HIGH;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-24 16:36:28
|
Revision: 14480
http://sourceforge.net/p/foray/code/14480
Author: victormote
Date: 2026-04-24 16:36:25 +0000 (Fri, 24 Apr 2026)
Log Message:
-----------
Conform to aXSL change: 1. Add methods for basic arithmetic. 2. Add an implementation that wraps a BigDecimal.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java 2026-04-24 01:47:27 UTC (rev 14479)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java 2026-04-24 16:36:25 UTC (rev 14480)
@@ -30,6 +30,8 @@
import org.axsl.primitive.fixed.FixedDecimal;
+import java.math.BigDecimal;
+
/**
* Abstract superclass for fixed-point implementations.
* The unscaledValue is stored in this superclass.
@@ -130,6 +132,17 @@
/**
* Factory method.
+ * @param bd The BigDecimal to be converted to an instance of {@link FixedDecimal4a}.
+ * @return An instance whose values match {@code bd}.
+ * @see org.axsl.primitive.fixed.FixedBigDecimal#FixedBigDecimal(BigDecimal) where a {@link BigDecimal} is wrapped
+ * instead of being converted to a different type.
+ */
+ public static FixedDecimal4a acquire(final BigDecimal bd) {
+ return acquire(bd.scale(), bd.unscaledValue().intValueExact());
+ }
+
+ /**
+ * Factory method.
* @param numeric The numeric string to be converted to a fixed-point.
* @return An instance matching {@code numeric}.
* @throws NumberFormatException For invalid values of {@code numeric}.
@@ -198,4 +211,28 @@
return whole1 - whole2;
}
+ @Override
+ public FixedDecimal add(final FixedDecimal addend) {
+ final BigDecimal result = toBigDecimal().add(addend.toBigDecimal());
+ return acquire(result);
+ }
+
+ @Override
+ public FixedDecimal subtract(final FixedDecimal subtrahend) {
+ final BigDecimal result = toBigDecimal().subtract(subtrahend.toBigDecimal());
+ return acquire(result);
+ }
+
+ @Override
+ public FixedDecimal multiply(final FixedDecimal multiplier) {
+ final BigDecimal result = toBigDecimal().multiply(multiplier.toBigDecimal());
+ return acquire(result);
+ }
+
+ @Override
+ public FixedDecimal divide(final FixedDecimal divisor) {
+ final BigDecimal result = toBigDecimal().divide(divisor.toBigDecimal());
+ return acquire(result);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-24 01:47:30
|
Revision: 14479
http://sourceforge.net/p/foray/code/14479
Author: victormote
Date: 2026-04-24 01:47:27 +0000 (Fri, 24 Apr 2026)
Log Message:
-----------
Rename classes for consistency.
Added Paths:
-----------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_00.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_01.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_02.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_03.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedDecimal4aTests.java
Removed Paths:
-------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Copied: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java (from rev 14478, trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java)
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal4a.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+import org.axsl.primitive.fixed.FixedDecimal;
+
+/**
+ * Abstract superclass for fixed-point implementations.
+ * The unscaledValue is stored in this superclass.
+ * The scale is supplied by subclasses.
+ */
+public abstract class FixedDecimal4a implements FixedDecimal {
+
+ /** Constant for the scale of 0. */
+ protected static final int SCALE_00 = 0;
+
+ /** Constant for the scale of 1. */
+ protected static final int SCALE_01 = 1;
+
+ /** Constant for the scale of 2. */
+ protected static final int SCALE_02 = 2;
+
+ /** Constant for the scale of 3. */
+ protected static final int SCALE_03 = 3;
+
+ /**
+ * Enumeration of configurations for fixed-point classes.
+ */
+ enum Config {
+
+ /** Scale of 0. */
+ CONFIG_00(0, 1),
+
+ /** Scale of 1. */
+ CONFIG_01(1, 10),
+
+ /** Scale of 2. */
+ CONFIG_02(2, 100),
+
+ /** Scale of 3. */
+ CONFIG_03(3, 1000);
+
+ /** The scale for this configuration. */
+ private int scale;
+
+ /** The conversion factor. */
+ private int conversionFactor;
+
+ /**
+ * Constructor.
+ * @param scale The scale for this configuration.
+ * @param conversionFactor The conversion factor for this configuration.
+ */
+ Config(final int scale, final int conversionFactor) {
+ this.scale = scale;
+ this.conversionFactor = conversionFactor;
+ }
+
+ /**
+ * Returns the scale for this configuration.
+ * @return The scale for this configuration.
+ */
+ public int getScale() {
+ return this.scale;
+ }
+
+ /**
+ * Returns the conversionFactor for this configuration.
+ * @return The conversionFactor for this configuration.
+ */
+ public int getConversionFactor() {
+ return this.conversionFactor;
+ }
+
+ }
+
+ /** The unscaledValue of this fixed-point value. */
+ private int unscaledValue;
+
+ /**
+ * Constructor.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
+ */
+ protected FixedDecimal4a(final int unscaledValue) {
+ this.unscaledValue = unscaledValue;
+ }
+
+ /**
+ * Factory method.
+ * @param scale The scale of the fixed-point to be acquired.
+ * @param unscaledValue The unscaledValue of the fixed-point to be acquired.
+ * @return An instance matching {@code scale} and {@code unscaledValue}.
+ * @throws IllegalArgumentException For an unknown scale.
+ */
+ public static FixedDecimal4a acquire(final int scale, final int unscaledValue) {
+ switch (scale) {
+ case SCALE_00: return new FixedDecimal_00(unscaledValue);
+ case SCALE_01: return new FixedDecimal_01(unscaledValue);
+ case SCALE_02: return new FixedDecimal_02(unscaledValue);
+ case SCALE_03: return new FixedDecimal_03(unscaledValue);
+ }
+ throw new IllegalArgumentException("Implementation not found for scale: " + scale);
+ }
+
+ /**
+ * Factory method.
+ * @param numeric The numeric string to be converted to a fixed-point.
+ * @return An instance matching {@code numeric}.
+ * @throws NumberFormatException For invalid values of {@code numeric}.
+ */
+ public static FixedDecimal4a acquire(final CharSequence numeric) {
+ final String numericString = numeric.toString();
+ final int decimalIndex = numericString.indexOf('.');
+ if (decimalIndex < 0) {
+ return acquire(0, Integer.parseInt(numericString));
+ }
+ final int scale = numeric.length() - decimalIndex - 1;
+ final StringBuilder builder = new StringBuilder(numericString);
+ builder.deleteCharAt(decimalIndex);
+ final int unscaledValue = Integer.parseInt(builder.toString());
+ return acquire(scale, unscaledValue);
+ }
+
+ /**
+ * Returns the configuration.
+ * @return The configuration.
+ */
+ public abstract Config getConfig();
+
+ @Override
+ public int unscaledValue() {
+ return this.unscaledValue;
+ }
+
+ @Override
+ public int scale() {
+ return getConfig().getScale();
+ }
+
+ /**
+ * Returns the whole number portion of this fixed-point.
+ * @return The whole number portion of this.
+ * For example, for 123.456, returns 123.
+ */
+ public int whole() {
+ return this.unscaledValue / getConfig().conversionFactor;
+ }
+
+ /**
+ * Returns the fractional portion of this fixed-point.
+ * @return The fractional portion of this.
+ * For example, for 123.456, returns 456.
+ */
+ public int fractional() {
+ return this.unscaledValue % getConfig().conversionFactor;
+ }
+
+ @Override
+ public int compareTo(final FixedDecimal other) {
+ if (this.scale() == other.scale()) {
+ return this.unscaledValue - other.unscaledValue();
+ }
+ final FixedDecimal4a other4a = other instanceof FixedDecimal4a ? (FixedDecimal4a) other :
+ FixedDecimal4a.acquire(other.scale(), other.unscaledValue());
+ final int whole1 = this.whole();
+ final int whole2 = other4a.whole();
+ if (whole1 == whole2) {
+ final int fractional1 = this.fractional();
+ final int fractional2 = other4a.fractional();
+ return fractional1 - fractional2;
+ }
+ return whole1 - whole2;
+ }
+
+}
Copied: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_00.java (from rev 14476, trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java)
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_00.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_00.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 0.
+ * This is the functional equivalent of {@link java.lang.Integer}.
+ */
+public class FixedDecimal_00 extends FixedDecimal4a {
+
+ /**
+ * Constructor.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
+ */
+ protected FixedDecimal_00(final int unscaledValue) {
+ super(unscaledValue);
+ }
+
+ @Override
+ public Config getConfig() {
+ return Config.CONFIG_00;
+ }
+
+}
Copied: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_01.java (from rev 14476, trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java)
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_01.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_01.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 1.
+ */
+public class FixedDecimal_01 extends FixedDecimal4a {
+
+ /**
+ * Constructor.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
+ */
+ protected FixedDecimal_01(final int unscaledValue) {
+ super(unscaledValue);
+ }
+
+ @Override
+ public Config getConfig() {
+ return Config.CONFIG_01;
+ }
+
+}
Copied: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_02.java (from rev 14476, trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java)
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_02.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_02.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 2.
+ */
+public class FixedDecimal_02 extends FixedDecimal4a {
+
+ /**
+ * Constructor.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
+ */
+ protected FixedDecimal_02(final int unscaledValue) {
+ super(unscaledValue);
+ }
+
+ @Override
+ public Config getConfig() {
+ return Config.CONFIG_02;
+ }
+
+}
Copied: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_03.java (from rev 14476, trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java)
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_03.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedDecimal_03.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 3.
+ */
+public class FixedDecimal_03 extends FixedDecimal4a {
+
+ /**
+ * Constructor.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
+ */
+ protected FixedDecimal_03(final int unscaledValue) {
+ super(unscaledValue);
+ }
+
+ @Override
+ public Config getConfig() {
+ return Config.CONFIG_03;
+ }
+
+}
Deleted: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,201 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-import org.axsl.primitive.fixed.FixedDecimal;
-
-/**
- * Abstract superclass for fixed-point implementations.
- * The unscaledValue is stored in this superclass.
- * The scale is supplied by subclasses.
- */
-public abstract class FixedPoint4a implements FixedDecimal {
-
- /** Constant for the scale of 0. */
- protected static final int SCALE_00 = 0;
-
- /** Constant for the scale of 1. */
- protected static final int SCALE_01 = 1;
-
- /** Constant for the scale of 2. */
- protected static final int SCALE_02 = 2;
-
- /** Constant for the scale of 3. */
- protected static final int SCALE_03 = 3;
-
- /**
- * Enumeration of configurations for fixed-point classes.
- */
- enum Config {
-
- /** Scale of 0. */
- CONFIG_00(0, 1),
-
- /** Scale of 1. */
- CONFIG_01(1, 10),
-
- /** Scale of 2. */
- CONFIG_02(2, 100),
-
- /** Scale of 3. */
- CONFIG_03(3, 1000);
-
- /** The scale for this configuration. */
- private int scale;
-
- /** The conversion factor. */
- private int conversionFactor;
-
- /**
- * Constructor.
- * @param scale The scale for this configuration.
- * @param conversionFactor The conversion factor for this configuration.
- */
- Config(final int scale, final int conversionFactor) {
- this.scale = scale;
- this.conversionFactor = conversionFactor;
- }
-
- /**
- * Returns the scale for this configuration.
- * @return The scale for this configuration.
- */
- public int getScale() {
- return this.scale;
- }
-
- /**
- * Returns the conversionFactor for this configuration.
- * @return The conversionFactor for this configuration.
- */
- public int getConversionFactor() {
- return this.conversionFactor;
- }
-
- }
-
- /** The unscaledValue of this fixed-point value. */
- private int unscaledValue;
-
- /**
- * Constructor.
- * @param unscaledValue The unscaledValue of this fixed-point value.
- */
- protected FixedPoint4a(final int unscaledValue) {
- this.unscaledValue = unscaledValue;
- }
-
- /**
- * Factory method.
- * @param scale The scale of the fixed-point to be acquired.
- * @param unscaledValue The unscaledValue of the fixed-point to be acquired.
- * @return An instance matching {@code scale} and {@code unscaledValue}.
- * @throws IllegalArgumentException For an unknown scale.
- */
- public static FixedPoint4a acquire(final int scale, final int unscaledValue) {
- switch (scale) {
- case SCALE_00: return new FixedPoint_00(unscaledValue);
- case SCALE_01: return new FixedPoint_01(unscaledValue);
- case SCALE_02: return new FixedPoint_02(unscaledValue);
- case SCALE_03: return new FixedPoint_03(unscaledValue);
- }
- throw new IllegalArgumentException("Implementation not found for scale: " + scale);
- }
-
- /**
- * Factory method.
- * @param numeric The numeric string to be converted to a fixed-point.
- * @return An instance matching {@code numeric}.
- * @throws NumberFormatException For invalid values of {@code numeric}.
- */
- public static FixedPoint4a acquire(final CharSequence numeric) {
- final String numericString = numeric.toString();
- final int decimalIndex = numericString.indexOf('.');
- if (decimalIndex < 0) {
- return acquire(0, Integer.parseInt(numericString));
- }
- final int scale = numeric.length() - decimalIndex - 1;
- final StringBuilder builder = new StringBuilder(numericString);
- builder.deleteCharAt(decimalIndex);
- final int unscaledValue = Integer.parseInt(builder.toString());
- return acquire(scale, unscaledValue);
- }
-
- /**
- * Returns the configuration.
- * @return The configuration.
- */
- public abstract Config getConfig();
-
- @Override
- public int unscaledValue() {
- return this.unscaledValue;
- }
-
- @Override
- public int scale() {
- return getConfig().getScale();
- }
-
- /**
- * Returns the whole number portion of this fixed-point.
- * @return The whole number portion of this.
- * For example, for 123.456, returns 123.
- */
- public int whole() {
- return this.unscaledValue / getConfig().conversionFactor;
- }
-
- /**
- * Returns the fractional portion of this fixed-point.
- * @return The fractional portion of this.
- * For example, for 123.456, returns 456.
- */
- public int fractional() {
- return this.unscaledValue % getConfig().conversionFactor;
- }
-
- @Override
- public int compareTo(final FixedDecimal other) {
- if (this.scale() == other.scale()) {
- return this.unscaledValue - other.unscaledValue();
- }
- final FixedPoint4a other4a = other instanceof FixedPoint4a ? (FixedPoint4a) other :
- FixedPoint4a.acquire(other.scale(), other.unscaledValue());
- final int whole1 = this.whole();
- final int whole2 = other4a.whole();
- if (whole1 == whole2) {
- final int fractional1 = this.fractional();
- final int fractional2 = other4a.fractional();
- return fractional1 - fractional2;
- }
- return whole1 - whole2;
- }
-
-}
Deleted: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,50 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-/**
- * A fixed-point value with a scale of 0.
- * This is the functional equivalent of {@link java.lang.Integer}.
- */
-public class FixedPoint_00 extends FixedPoint4a {
-
- /**
- * Constructor.
- * @param unscaledValue The unscaledValue of this fixed-point value.
- */
- protected FixedPoint_00(final int unscaledValue) {
- super(unscaledValue);
- }
-
- @Override
- public Config getConfig() {
- return Config.CONFIG_00;
- }
-
-}
Deleted: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,49 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-/**
- * A fixed-point value with a scale of 1.
- */
-public class FixedPoint_01 extends FixedPoint4a {
-
- /**
- * Constructor.
- * @param unscaledValue The unscaledValue of this fixed-point value.
- */
- protected FixedPoint_01(final int unscaledValue) {
- super(unscaledValue);
- }
-
- @Override
- public Config getConfig() {
- return Config.CONFIG_01;
- }
-
-}
Deleted: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,49 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-/**
- * A fixed-point value with a scale of 2.
- */
-public class FixedPoint_02 extends FixedPoint4a {
-
- /**
- * Constructor.
- * @param unscaledValue The unscaledValue of this fixed-point value.
- */
- protected FixedPoint_02(final int unscaledValue) {
- super(unscaledValue);
- }
-
- @Override
- public Config getConfig() {
- return Config.CONFIG_02;
- }
-
-}
Deleted: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,49 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-/**
- * A fixed-point value with a scale of 3.
- */
-public class FixedPoint_03 extends FixedPoint4a {
-
- /**
- * Constructor.
- * @param unscaledValue The unscaledValue of this fixed-point value.
- */
- protected FixedPoint_03(final int unscaledValue) {
- super(unscaledValue);
- }
-
- @Override
- public Config getConfig() {
- return Config.CONFIG_03;
- }
-
-}
Copied: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedDecimal4aTests.java (from rev 14478, trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java)
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedDecimal4aTests.java (rev 0)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedDecimal4aTests.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+import org.axsl.primitive.fixed.FixedDecimal;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests of {@link FixedDecimal4a}.
+ */
+public class FixedDecimal4aTests {
+
+ /**
+ * Tests of {@link FixedDecimal4a#acquire(int, int)}.
+ */
+ @Test
+ public void testNumericFactory() {
+ FixedDecimal out = FixedDecimal4a.acquire(0, 112);
+ assertThat(out.scale()).isEqualTo(0);
+ assertThat(out.unscaledValue()).isEqualTo(112);
+
+ out = FixedDecimal4a.acquire(3, 147_339);
+ assertThat(out.scale()).isEqualTo(3);
+ assertThat(out.unscaledValue()).isEqualTo(147_339);
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#acquire(String)}.
+ */
+ @Test
+ public void testStringFactory() {
+ FixedDecimal out = FixedDecimal4a.acquire("112");
+ assertThat(out.scale()).isEqualTo(0);
+ assertThat(out.unscaledValue()).isEqualTo(112);
+
+ out = FixedDecimal4a.acquire("147.339");
+ assertThat(out.scale()).isEqualTo(3);
+ assertThat(out.unscaledValue()).isEqualTo(147_339);
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#whole()}.
+ */
+ @Test
+ public void testWhole() {
+ FixedDecimal4a out = FixedDecimal4a.acquire(0, 112);
+ assertThat(out.whole()).isEqualTo(112);
+
+ out = FixedDecimal4a.acquire("147.339");
+ assertThat(out.whole()).isEqualTo(147);
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#fractional()}.
+ */
+ @Test
+ public void testFractional() {
+ FixedDecimal4a out = FixedDecimal4a.acquire(0, 112);
+ assertThat(out.fractional()).isEqualTo(0);
+
+ out = FixedDecimal4a.acquire("147.339");
+ assertThat(out.fractional()).isEqualTo(339);
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#compareTo(FixedPoint)}.
+ */
+ @Test
+ public void testCompareTo() {
+ FixedDecimal4a low = FixedDecimal4a.acquire("112");
+ FixedDecimal4a high = FixedDecimal4a.acquire("113");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedDecimal4a.acquire("2147483.646");
+ high = FixedDecimal4a.acquire("2147483.647");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedDecimal4a.acquire(".646");
+ high = FixedDecimal4a.acquire(".647");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedDecimal4a.acquire("110.646");
+ high = FixedDecimal4a.acquire("110.646");
+ assertThat(high.compareTo(low)).isEqualTo(0);
+
+ low = FixedDecimal4a.acquire("110.64");
+ high = FixedDecimal4a.acquire("110.641");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isEqualTo(FixedPoint)}.
+ */
+ @Test
+ public void testIsEqualTo() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("112");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("113");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire(".646");
+ value2 = FixedDecimal4a.acquire(".647");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isEqualTo(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isNotEqualTo(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotEqualTo() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("112");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("113");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire(".646");
+ value2 = FixedDecimal4a.acquire(".647");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isNotEqualTo(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isGreaterThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsGreaterThan() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("113");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("112");
+ assertThat(value1.isGreaterThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire(".647");
+ value2 = FixedDecimal4a.acquire(".646");
+ assertThat(value1.isGreaterThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isNotGreaterThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotGreaterThan() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("113");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("112");
+ assertThat(value1.isNotGreaterThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire(".647");
+ value2 = FixedDecimal4a.acquire(".646");
+ assertThat(value1.isNotGreaterThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isLessThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsLessThan() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("113");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("112");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isLessThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire(".647");
+ value2 = FixedDecimal4a.acquire(".646");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isLessThan(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedDecimal4a#isNotLessThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotLessThan() {
+ FixedDecimal4a value1 = FixedDecimal4a.acquire("113");
+ FixedDecimal4a value2 = FixedDecimal4a.acquire("112");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("2147483.646");
+ value2 = FixedDecimal4a.acquire("2147483.647");
+ assertThat(value1.isNotLessThan(value2)).isFalse();
+
+ value1 = FixedDecimal4a.acquire(".647");
+ value2 = FixedDecimal4a.acquire(".646");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.646");
+ value2 = FixedDecimal4a.acquire("110.646");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedDecimal4a.acquire("110.64");
+ value2 = FixedDecimal4a.acquire("110.641");
+ assertThat(value1.isNotLessThan(value2)).isFalse();
+ }
+
+}
Deleted: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-24 01:32:22 UTC (rev 14478)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-24 01:47:27 UTC (rev 14479)
@@ -1,275 +0,0 @@
-/*
- * Copyright 2026 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.primitive.fixed;
-
-import org.axsl.primitive.fixed.FixedDecimal;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests of {@link FixedPoint4a}.
- */
-public class FixedPoint4aTests {
-
- /**
- * Tests of {@link FixedPoint4a#acquire(int, int)}.
- */
- @Test
- public void testNumericFactory() {
- FixedDecimal out = FixedPoint4a.acquire(0, 112);
- assertThat(out.scale()).isEqualTo(0);
- assertThat(out.unscaledValue()).isEqualTo(112);
-
- out = FixedPoint4a.acquire(3, 147_339);
- assertThat(out.scale()).isEqualTo(3);
- assertThat(out.unscaledValue()).isEqualTo(147_339);
- }
-
- /**
- * Tests of {@link FixedPoint4a#acquire(String)}.
- */
- @Test
- public void testStringFactory() {
- FixedDecimal out = FixedPoint4a.acquire("112");
- assertThat(out.scale()).isEqualTo(0);
- assertThat(out.unscaledValue()).isEqualTo(112);
-
- out = FixedPoint4a.acquire("147.339");
- assertThat(out.scale()).isEqualTo(3);
- assertThat(out.unscaledValue()).isEqualTo(147_339);
- }
-
- /**
- * Tests of {@link FixedPoint4a#whole()}.
- */
- @Test
- public void testWhole() {
- FixedPoint4a out = FixedPoint4a.acquire(0, 112);
- assertThat(out.whole()).isEqualTo(112);
-
- out = FixedPoint4a.acquire("147.339");
- assertThat(out.whole()).isEqualTo(147);
- }
-
- /**
- * Tests of {@link FixedPoint4a#fractional()}.
- */
- @Test
- public void testFractional() {
- FixedPoint4a out = FixedPoint4a.acquire(0, 112);
- assertThat(out.fractional()).isEqualTo(0);
-
- out = FixedPoint4a.acquire("147.339");
- assertThat(out.fractional()).isEqualTo(339);
- }
-
- /**
- * Tests of {@link FixedPoint4a#compareTo(FixedPoint)}.
- */
- @Test
- public void testCompareTo() {
- FixedPoint4a low = FixedPoint4a.acquire("112");
- FixedPoint4a high = FixedPoint4a.acquire("113");
- assertThat(high.compareTo(low)).isGreaterThan(0);
-
- low = FixedPoint4a.acquire("2147483.646");
- high = FixedPoint4a.acquire("2147483.647");
- assertThat(high.compareTo(low)).isGreaterThan(0);
-
- low = FixedPoint4a.acquire(".646");
- high = FixedPoint4a.acquire(".647");
- assertThat(high.compareTo(low)).isGreaterThan(0);
-
- low = FixedPoint4a.acquire("110.646");
- high = FixedPoint4a.acquire("110.646");
- assertThat(high.compareTo(low)).isEqualTo(0);
-
- low = FixedPoint4a.acquire("110.64");
- high = FixedPoint4a.acquire("110.641");
- assertThat(high.compareTo(low)).isGreaterThan(0);
- }
-
- /**
- * Tests of {@link FixedPoint4a#isEqualTo(FixedPoint)}.
- */
- @Test
- public void testIsEqualTo() {
- FixedPoint4a value1 = FixedPoint4a.acquire("112");
- FixedPoint4a value2 = FixedPoint4a.acquire("113");
- assertThat(value1.isEqualTo(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isEqualTo(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire(".646");
- value2 = FixedPoint4a.acquire(".647");
- assertThat(value1.isEqualTo(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isEqualTo(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isEqualTo(value2)).isFalse();
- }
-
- /**
- * Tests of {@link FixedPoint4a#isNotEqualTo(FixedPoint)}.
- */
- @Test
- public void testIsNotEqualTo() {
- FixedPoint4a value1 = FixedPoint4a.acquire("112");
- FixedPoint4a value2 = FixedPoint4a.acquire("113");
- assertThat(value1.isNotEqualTo(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isNotEqualTo(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire(".646");
- value2 = FixedPoint4a.acquire(".647");
- assertThat(value1.isNotEqualTo(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isNotEqualTo(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isNotEqualTo(value2)).isTrue();
- }
-
- /**
- * Tests of {@link FixedPoint4a#isGreaterThan(FixedPoint)}.
- */
- @Test
- public void testIsGreaterThan() {
- FixedPoint4a value1 = FixedPoint4a.acquire("113");
- FixedPoint4a value2 = FixedPoint4a.acquire("112");
- assertThat(value1.isGreaterThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isGreaterThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire(".647");
- value2 = FixedPoint4a.acquire(".646");
- assertThat(value1.isGreaterThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isGreaterThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isGreaterThan(value2)).isFalse();
- }
-
- /**
- * Tests of {@link FixedPoint4a#isNotGreaterThan(FixedPoint)}.
- */
- @Test
- public void testIsNotGreaterThan() {
- FixedPoint4a value1 = FixedPoint4a.acquire("113");
- FixedPoint4a value2 = FixedPoint4a.acquire("112");
- assertThat(value1.isNotGreaterThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isNotGreaterThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire(".647");
- value2 = FixedPoint4a.acquire(".646");
- assertThat(value1.isNotGreaterThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isNotGreaterThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isNotGreaterThan(value2)).isTrue();
- }
-
- /**
- * Tests of {@link FixedPoint4a#isLessThan(FixedPoint)}.
- */
- @Test
- public void testIsLessThan() {
- FixedPoint4a value1 = FixedPoint4a.acquire("113");
- FixedPoint4a value2 = FixedPoint4a.acquire("112");
- assertThat(value1.isLessThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isLessThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire(".647");
- value2 = FixedPoint4a.acquire(".646");
- assertThat(value1.isLessThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isLessThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isLessThan(value2)).isTrue();
- }
-
- /**
- * Tests of {@link FixedPoint4a#isNotLessThan(FixedPoint)}.
- */
- @Test
- public void testIsNotLessThan() {
- FixedPoint4a value1 = FixedPoint4a.acquire("113");
- FixedPoint4a value2 = FixedPoint4a.acquire("112");
- assertThat(value1.isNotLessThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("2147483.646");
- value2 = FixedPoint4a.acquire("2147483.647");
- assertThat(value1.isNotLessThan(value2)).isFalse();
-
- value1 = FixedPoint4a.acquire(".647");
- value2 = FixedPoint4a.acquire(".646");
- assertThat(value1.isNotLessThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.646");
- value2 = FixedPoint4a.acquire("110.646");
- assertThat(value1.isNotLessThan(value2)).isTrue();
-
- value1 = FixedPoint4a.acquire("110.64");
- value2 = FixedPoint4a.acquire("110.641");
- assertThat(value1.isNotLessThan(value2)).isFalse();
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-24 01:32:25
|
Revision: 14478
http://sourceforge.net/p/foray/code/14478
Author: victormote
Date: 2026-04-24 01:32:22 +0000 (Fri, 24 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Rename interface for clarity.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-23 20:20:56 UTC (rev 14477)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-24 01:32:22 UTC (rev 14478)
@@ -28,7 +28,7 @@
package org.foray.primitive.fixed;
-import org.axsl.primitive.fixed.FixedPoint;
+import org.axsl.primitive.fixed.FixedDecimal;
/**
* Abstract superclass for fixed-point implementations.
@@ -35,7 +35,7 @@
* The unscaledValue is stored in this superclass.
* The scale is supplied by subclasses.
*/
-public abstract class FixedPoint4a implements FixedPoint {
+public abstract class FixedPoint4a implements FixedDecimal {
/** Constant for the scale of 0. */
protected static final int SCALE_00 = 0;
@@ -182,7 +182,7 @@
}
@Override
- public int compareTo(final FixedPoint other) {
+ public int compareTo(final FixedDecimal other) {
if (this.scale() == other.scale()) {
return this.unscaledValue - other.unscaledValue();
}
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-23 20:20:56 UTC (rev 14477)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-24 01:32:22 UTC (rev 14478)
@@ -28,7 +28,7 @@
package org.foray.primitive.fixed;
-import org.axsl.primitive.fixed.FixedPoint;
+import org.axsl.primitive.fixed.FixedDecimal;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
@@ -43,7 +43,7 @@
*/
@Test
public void testNumericFactory() {
- FixedPoint out = FixedPoint4a.acquire(0, 112);
+ FixedDecimal out = FixedPoint4a.acquire(0, 112);
assertThat(out.scale()).isEqualTo(0);
assertThat(out.unscaledValue()).isEqualTo(112);
@@ -57,7 +57,7 @@
*/
@Test
public void testStringFactory() {
- FixedPoint out = FixedPoint4a.acquire("112");
+ FixedDecimal out = FixedPoint4a.acquire("112");
assertThat(out.scale()).isEqualTo(0);
assertThat(out.unscaledValue()).isEqualTo(112);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-23 20:20:59
|
Revision: 14477
http://sourceforge.net/p/foray/code/14477
Author: victormote
Date: 2026-04-23 20:20:56 +0000 (Thu, 23 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Add default comparison methods.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-23 19:33:17 UTC (rev 14476)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-23 20:20:56 UTC (rev 14477)
@@ -198,58 +198,4 @@
return whole1 - whole2;
}
- /**
- * Tests for value equality between this and another {@link FixedPoint} value.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is equal to the value of {@code other}.
- */
- public boolean isEqualTo(final FixedPoint other) {
- return this.compareTo(other) == 0;
- }
-
- /**
- * Tests for value equality between this and another {@link FixedPoint} value.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is NOT equal to the value of {@code other}.
- */
- public boolean isNotEqualTo(final FixedPoint other) {
- return ! (this.compareTo(other) == 0);
- }
-
- /**
- * Tests whether the value of this is greater than the value of another {@link FixedPoint}.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is greater than the value of {@code other}.
- */
- public boolean isGreaterThan(final FixedPoint other) {
- return this.compareTo(other) > 0;
- }
-
- /**
- * Tests whether the value of this is greater than the value of another {@link FixedPoint}.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is NOT greater than the value of {@code other}.
- */
- public boolean isNotGreaterThan(final FixedPoint other) {
- return this.compareTo(other) <= 0;
- }
-
- /**
- * Tests whether the value of this is less than the value of another {@link FixedPoint}.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is less than the value of {@code other}.
- */
- public boolean isLessThan(final FixedPoint other) {
- return this.compareTo(other) < 0;
- }
-
- /**
- * Tests whether the value of this is less than the value of another {@link FixedPoint}.
- * @param other The fixed-point value being compared.
- * @return True if and only if the value of this is NOT less than the value of {@code other}.
- */
- public boolean isNotLessThan(final FixedPoint other) {
- return this.compareTo(other) >= 0;
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-23 19:33:20
|
Revision: 14476
http://sourceforge.net/p/foray/code/14476
Author: victormote
Date: 2026-04-23 19:33:17 +0000 (Thu, 23 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Rename method to match similar method in BigDecimal.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -32,7 +32,7 @@
/**
* Abstract superclass for fixed-point implementations.
- * The magnitude is stored in this superclass.
+ * The unscaledValue is stored in this superclass.
* The scale is supplied by subclasses.
*/
public abstract class FixedPoint4a implements FixedPoint {
@@ -100,30 +100,30 @@
}
- /** The magnitude of this fixed-point value. */
- private int magnitude;
+ /** The unscaledValue of this fixed-point value. */
+ private int unscaledValue;
/**
* Constructor.
- * @param magnitude The magnitude of this fixed-point value.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
*/
- protected FixedPoint4a(final int magnitude) {
- this.magnitude = magnitude;
+ protected FixedPoint4a(final int unscaledValue) {
+ this.unscaledValue = unscaledValue;
}
/**
* Factory method.
* @param scale The scale of the fixed-point to be acquired.
- * @param magnitude The magnitude of the fixed-point to be acquired.
- * @return An instance matching {@code scale} and {@code magnitude}.
+ * @param unscaledValue The unscaledValue of the fixed-point to be acquired.
+ * @return An instance matching {@code scale} and {@code unscaledValue}.
* @throws IllegalArgumentException For an unknown scale.
*/
- public static FixedPoint4a acquire(final int scale, final int magnitude) {
+ public static FixedPoint4a acquire(final int scale, final int unscaledValue) {
switch (scale) {
- case SCALE_00: return new FixedPoint_00(magnitude);
- case SCALE_01: return new FixedPoint_01(magnitude);
- case SCALE_02: return new FixedPoint_02(magnitude);
- case SCALE_03: return new FixedPoint_03(magnitude);
+ case SCALE_00: return new FixedPoint_00(unscaledValue);
+ case SCALE_01: return new FixedPoint_01(unscaledValue);
+ case SCALE_02: return new FixedPoint_02(unscaledValue);
+ case SCALE_03: return new FixedPoint_03(unscaledValue);
}
throw new IllegalArgumentException("Implementation not found for scale: " + scale);
}
@@ -143,8 +143,8 @@
final int scale = numeric.length() - decimalIndex - 1;
final StringBuilder builder = new StringBuilder(numericString);
builder.deleteCharAt(decimalIndex);
- final int magnitude = Integer.parseInt(builder.toString());
- return acquire(scale, magnitude);
+ final int unscaledValue = Integer.parseInt(builder.toString());
+ return acquire(scale, unscaledValue);
}
/**
@@ -154,8 +154,8 @@
public abstract Config getConfig();
@Override
- public int magnitude() {
- return this.magnitude;
+ public int unscaledValue() {
+ return this.unscaledValue;
}
@Override
@@ -169,7 +169,7 @@
* For example, for 123.456, returns 123.
*/
public int whole() {
- return this.magnitude / getConfig().conversionFactor;
+ return this.unscaledValue / getConfig().conversionFactor;
}
/**
@@ -178,16 +178,16 @@
* For example, for 123.456, returns 456.
*/
public int fractional() {
- return this.magnitude % getConfig().conversionFactor;
+ return this.unscaledValue % getConfig().conversionFactor;
}
@Override
public int compareTo(final FixedPoint other) {
if (this.scale() == other.scale()) {
- return this.magnitude - other.magnitude();
+ return this.unscaledValue - other.unscaledValue();
}
final FixedPoint4a other4a = other instanceof FixedPoint4a ? (FixedPoint4a) other :
- FixedPoint4a.acquire(other.scale(), other.magnitude());
+ FixedPoint4a.acquire(other.scale(), other.unscaledValue());
final int whole1 = this.whole();
final int whole2 = other4a.whole();
if (whole1 == whole2) {
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -36,10 +36,10 @@
/**
* Constructor.
- * @param magnitude The magnitude of this fixed-point value.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
*/
- protected FixedPoint_00(final int magnitude) {
- super(magnitude);
+ protected FixedPoint_00(final int unscaledValue) {
+ super(unscaledValue);
}
@Override
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -35,10 +35,10 @@
/**
* Constructor.
- * @param magnitude The magnitude of this fixed-point value.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
*/
- protected FixedPoint_01(final int magnitude) {
- super(magnitude);
+ protected FixedPoint_01(final int unscaledValue) {
+ super(unscaledValue);
}
@Override
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -35,10 +35,10 @@
/**
* Constructor.
- * @param magnitude The magnitude of this fixed-point value.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
*/
- protected FixedPoint_02(final int magnitude) {
- super(magnitude);
+ protected FixedPoint_02(final int unscaledValue) {
+ super(unscaledValue);
}
@Override
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -35,10 +35,10 @@
/**
* Constructor.
- * @param magnitude The magnitude of this fixed-point value.
+ * @param unscaledValue The unscaledValue of this fixed-point value.
*/
- protected FixedPoint_03(final int magnitude) {
- super(magnitude);
+ protected FixedPoint_03(final int unscaledValue) {
+ super(unscaledValue);
}
@Override
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 17:27:44 UTC (rev 14475)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-23 19:33:17 UTC (rev 14476)
@@ -45,11 +45,11 @@
public void testNumericFactory() {
FixedPoint out = FixedPoint4a.acquire(0, 112);
assertThat(out.scale()).isEqualTo(0);
- assertThat(out.magnitude()).isEqualTo(112);
+ assertThat(out.unscaledValue()).isEqualTo(112);
out = FixedPoint4a.acquire(3, 147_339);
assertThat(out.scale()).isEqualTo(3);
- assertThat(out.magnitude()).isEqualTo(147_339);
+ assertThat(out.unscaledValue()).isEqualTo(147_339);
}
/**
@@ -59,11 +59,11 @@
public void testStringFactory() {
FixedPoint out = FixedPoint4a.acquire("112");
assertThat(out.scale()).isEqualTo(0);
- assertThat(out.magnitude()).isEqualTo(112);
+ assertThat(out.unscaledValue()).isEqualTo(112);
out = FixedPoint4a.acquire("147.339");
assertThat(out.scale()).isEqualTo(3);
- assertThat(out.magnitude()).isEqualTo(147_339);
+ assertThat(out.unscaledValue()).isEqualTo(147_339);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-22 17:27:47
|
Revision: 14475
http://sourceforge.net/p/foray/code/14475
Author: victormote
Date: 2026-04-22 17:27:44 +0000 (Wed, 22 Apr 2026)
Log Message:
-----------
Add more comparative methods.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 16:52:26 UTC (rev 14474)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 17:27:44 UTC (rev 14475)
@@ -198,4 +198,58 @@
return whole1 - whole2;
}
+ /**
+ * Tests for value equality between this and another {@link FixedPoint} value.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is equal to the value of {@code other}.
+ */
+ public boolean isEqualTo(final FixedPoint other) {
+ return this.compareTo(other) == 0;
+ }
+
+ /**
+ * Tests for value equality between this and another {@link FixedPoint} value.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is NOT equal to the value of {@code other}.
+ */
+ public boolean isNotEqualTo(final FixedPoint other) {
+ return ! (this.compareTo(other) == 0);
+ }
+
+ /**
+ * Tests whether the value of this is greater than the value of another {@link FixedPoint}.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is greater than the value of {@code other}.
+ */
+ public boolean isGreaterThan(final FixedPoint other) {
+ return this.compareTo(other) > 0;
+ }
+
+ /**
+ * Tests whether the value of this is greater than the value of another {@link FixedPoint}.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is NOT greater than the value of {@code other}.
+ */
+ public boolean isNotGreaterThan(final FixedPoint other) {
+ return this.compareTo(other) <= 0;
+ }
+
+ /**
+ * Tests whether the value of this is less than the value of another {@link FixedPoint}.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is less than the value of {@code other}.
+ */
+ public boolean isLessThan(final FixedPoint other) {
+ return this.compareTo(other) < 0;
+ }
+
+ /**
+ * Tests whether the value of this is less than the value of another {@link FixedPoint}.
+ * @param other The fixed-point value being compared.
+ * @return True if and only if the value of this is NOT less than the value of {@code other}.
+ */
+ public boolean isNotLessThan(final FixedPoint other) {
+ return this.compareTo(other) >= 0;
+ }
+
}
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 16:52:26 UTC (rev 14474)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 17:27:44 UTC (rev 14475)
@@ -116,4 +116,160 @@
assertThat(high.compareTo(low)).isGreaterThan(0);
}
+ /**
+ * Tests of {@link FixedPoint4a#isEqualTo(FixedPoint)}.
+ */
+ @Test
+ public void testIsEqualTo() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("112");
+ FixedPoint4a value2 = FixedPoint4a.acquire("113");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire(".646");
+ value2 = FixedPoint4a.acquire(".647");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isEqualTo(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isEqualTo(value2)).isFalse();
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#isNotEqualTo(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotEqualTo() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("112");
+ FixedPoint4a value2 = FixedPoint4a.acquire("113");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire(".646");
+ value2 = FixedPoint4a.acquire(".647");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isNotEqualTo(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isNotEqualTo(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#isGreaterThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsGreaterThan() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("113");
+ FixedPoint4a value2 = FixedPoint4a.acquire("112");
+ assertThat(value1.isGreaterThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire(".647");
+ value2 = FixedPoint4a.acquire(".646");
+ assertThat(value1.isGreaterThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isGreaterThan(value2)).isFalse();
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#isNotGreaterThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotGreaterThan() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("113");
+ FixedPoint4a value2 = FixedPoint4a.acquire("112");
+ assertThat(value1.isNotGreaterThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire(".647");
+ value2 = FixedPoint4a.acquire(".646");
+ assertThat(value1.isNotGreaterThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isNotGreaterThan(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#isLessThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsLessThan() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("113");
+ FixedPoint4a value2 = FixedPoint4a.acquire("112");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isLessThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire(".647");
+ value2 = FixedPoint4a.acquire(".646");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isLessThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isLessThan(value2)).isTrue();
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#isNotLessThan(FixedPoint)}.
+ */
+ @Test
+ public void testIsNotLessThan() {
+ FixedPoint4a value1 = FixedPoint4a.acquire("113");
+ FixedPoint4a value2 = FixedPoint4a.acquire("112");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("2147483.646");
+ value2 = FixedPoint4a.acquire("2147483.647");
+ assertThat(value1.isNotLessThan(value2)).isFalse();
+
+ value1 = FixedPoint4a.acquire(".647");
+ value2 = FixedPoint4a.acquire(".646");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.646");
+ value2 = FixedPoint4a.acquire("110.646");
+ assertThat(value1.isNotLessThan(value2)).isTrue();
+
+ value1 = FixedPoint4a.acquire("110.64");
+ value2 = FixedPoint4a.acquire("110.641");
+ assertThat(value1.isNotLessThan(value2)).isFalse();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-22 16:52:29
|
Revision: 14474
http://sourceforge.net/p/foray/code/14474
Author: victormote
Date: 2026-04-22 16:52:26 +0000 (Wed, 22 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Make FixedPoint implement Comparable.
Modified Paths:
--------------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -49,6 +49,57 @@
/** Constant for the scale of 3. */
protected static final int SCALE_03 = 3;
+ /**
+ * Enumeration of configurations for fixed-point classes.
+ */
+ enum Config {
+
+ /** Scale of 0. */
+ CONFIG_00(0, 1),
+
+ /** Scale of 1. */
+ CONFIG_01(1, 10),
+
+ /** Scale of 2. */
+ CONFIG_02(2, 100),
+
+ /** Scale of 3. */
+ CONFIG_03(3, 1000);
+
+ /** The scale for this configuration. */
+ private int scale;
+
+ /** The conversion factor. */
+ private int conversionFactor;
+
+ /**
+ * Constructor.
+ * @param scale The scale for this configuration.
+ * @param conversionFactor The conversion factor for this configuration.
+ */
+ Config(final int scale, final int conversionFactor) {
+ this.scale = scale;
+ this.conversionFactor = conversionFactor;
+ }
+
+ /**
+ * Returns the scale for this configuration.
+ * @return The scale for this configuration.
+ */
+ public int getScale() {
+ return this.scale;
+ }
+
+ /**
+ * Returns the conversionFactor for this configuration.
+ * @return The conversionFactor for this configuration.
+ */
+ public int getConversionFactor() {
+ return this.conversionFactor;
+ }
+
+ }
+
/** The magnitude of this fixed-point value. */
private int magnitude;
@@ -96,9 +147,55 @@
return acquire(scale, magnitude);
}
+ /**
+ * Returns the configuration.
+ * @return The configuration.
+ */
+ public abstract Config getConfig();
+
@Override
public int magnitude() {
return this.magnitude;
}
+ @Override
+ public int scale() {
+ return getConfig().getScale();
+ }
+
+ /**
+ * Returns the whole number portion of this fixed-point.
+ * @return The whole number portion of this.
+ * For example, for 123.456, returns 123.
+ */
+ public int whole() {
+ return this.magnitude / getConfig().conversionFactor;
+ }
+
+ /**
+ * Returns the fractional portion of this fixed-point.
+ * @return The fractional portion of this.
+ * For example, for 123.456, returns 456.
+ */
+ public int fractional() {
+ return this.magnitude % getConfig().conversionFactor;
+ }
+
+ @Override
+ public int compareTo(final FixedPoint other) {
+ if (this.scale() == other.scale()) {
+ return this.magnitude - other.magnitude();
+ }
+ final FixedPoint4a other4a = other instanceof FixedPoint4a ? (FixedPoint4a) other :
+ FixedPoint4a.acquire(other.scale(), other.magnitude());
+ final int whole1 = this.whole();
+ final int whole2 = other4a.whole();
+ if (whole1 == whole2) {
+ final int fractional1 = this.fractional();
+ final int fractional2 = other4a.fractional();
+ return fractional1 - fractional2;
+ }
+ return whole1 - whole2;
+ }
+
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -43,8 +43,8 @@
}
@Override
- public int scale() {
- return SCALE_00;
+ public Config getConfig() {
+ return Config.CONFIG_00;
}
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -42,8 +42,8 @@
}
@Override
- public int scale() {
- return SCALE_01;
+ public Config getConfig() {
+ return Config.CONFIG_01;
}
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -42,8 +42,8 @@
}
@Override
- public int scale() {
- return 2;
+ public Config getConfig() {
+ return Config.CONFIG_02;
}
}
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -42,8 +42,8 @@
}
@Override
- public int scale() {
- return SCALE_03;
+ public Config getConfig() {
+ return Config.CONFIG_03;
}
}
Modified: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 14:04:45 UTC (rev 14473)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 16:52:26 UTC (rev 14474)
@@ -66,4 +66,54 @@
assertThat(out.magnitude()).isEqualTo(147_339);
}
+ /**
+ * Tests of {@link FixedPoint4a#whole()}.
+ */
+ @Test
+ public void testWhole() {
+ FixedPoint4a out = FixedPoint4a.acquire(0, 112);
+ assertThat(out.whole()).isEqualTo(112);
+
+ out = FixedPoint4a.acquire("147.339");
+ assertThat(out.whole()).isEqualTo(147);
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#fractional()}.
+ */
+ @Test
+ public void testFractional() {
+ FixedPoint4a out = FixedPoint4a.acquire(0, 112);
+ assertThat(out.fractional()).isEqualTo(0);
+
+ out = FixedPoint4a.acquire("147.339");
+ assertThat(out.fractional()).isEqualTo(339);
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#compareTo(FixedPoint)}.
+ */
+ @Test
+ public void testCompareTo() {
+ FixedPoint4a low = FixedPoint4a.acquire("112");
+ FixedPoint4a high = FixedPoint4a.acquire("113");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedPoint4a.acquire("2147483.646");
+ high = FixedPoint4a.acquire("2147483.647");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedPoint4a.acquire(".646");
+ high = FixedPoint4a.acquire(".647");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+
+ low = FixedPoint4a.acquire("110.646");
+ high = FixedPoint4a.acquire("110.646");
+ assertThat(high.compareTo(low)).isEqualTo(0);
+
+ low = FixedPoint4a.acquire("110.64");
+ high = FixedPoint4a.acquire("110.641");
+ assertThat(high.compareTo(low)).isGreaterThan(0);
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-22 14:04:47
|
Revision: 14473
http://sourceforge.net/p/foray/code/14473
Author: victormote
Date: 2026-04-22 14:04:45 +0000 (Wed, 22 Apr 2026)
Log Message:
-----------
Rough-in an implementation of aXSL FixedPoint.
Added Paths:
-----------
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/package-info.java
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/
trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+import org.axsl.primitive.fixed.FixedPoint;
+
+/**
+ * Abstract superclass for fixed-point implementations.
+ * The magnitude is stored in this superclass.
+ * The scale is supplied by subclasses.
+ */
+public abstract class FixedPoint4a implements FixedPoint {
+
+ /** Constant for the scale of 0. */
+ protected static final int SCALE_00 = 0;
+
+ /** Constant for the scale of 1. */
+ protected static final int SCALE_01 = 1;
+
+ /** Constant for the scale of 2. */
+ protected static final int SCALE_02 = 2;
+
+ /** Constant for the scale of 3. */
+ protected static final int SCALE_03 = 3;
+
+ /** The magnitude of this fixed-point value. */
+ private int magnitude;
+
+ /**
+ * Constructor.
+ * @param magnitude The magnitude of this fixed-point value.
+ */
+ protected FixedPoint4a(final int magnitude) {
+ this.magnitude = magnitude;
+ }
+
+ /**
+ * Factory method.
+ * @param scale The scale of the fixed-point to be acquired.
+ * @param magnitude The magnitude of the fixed-point to be acquired.
+ * @return An instance matching {@code scale} and {@code magnitude}.
+ * @throws IllegalArgumentException For an unknown scale.
+ */
+ public static FixedPoint4a acquire(final int scale, final int magnitude) {
+ switch (scale) {
+ case SCALE_00: return new FixedPoint_00(magnitude);
+ case SCALE_01: return new FixedPoint_01(magnitude);
+ case SCALE_02: return new FixedPoint_02(magnitude);
+ case SCALE_03: return new FixedPoint_03(magnitude);
+ }
+ throw new IllegalArgumentException("Implementation not found for scale: " + scale);
+ }
+
+ /**
+ * Factory method.
+ * @param numeric The numeric string to be converted to a fixed-point.
+ * @return An instance matching {@code numeric}.
+ * @throws NumberFormatException For invalid values of {@code numeric}.
+ */
+ public static FixedPoint4a acquire(final CharSequence numeric) {
+ final String numericString = numeric.toString();
+ final int decimalIndex = numericString.indexOf('.');
+ if (decimalIndex < 0) {
+ return acquire(0, Integer.parseInt(numericString));
+ }
+ final int scale = numeric.length() - decimalIndex - 1;
+ final StringBuilder builder = new StringBuilder(numericString);
+ builder.deleteCharAt(decimalIndex);
+ final int magnitude = Integer.parseInt(builder.toString());
+ return acquire(scale, magnitude);
+ }
+
+ @Override
+ public int magnitude() {
+ return this.magnitude;
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint4a.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 0.
+ * This is the functional equivalent of {@link java.lang.Integer}.
+ */
+public class FixedPoint_00 extends FixedPoint4a {
+
+ /**
+ * Constructor.
+ * @param magnitude The magnitude of this fixed-point value.
+ */
+ protected FixedPoint_00(final int magnitude) {
+ super(magnitude);
+ }
+
+ @Override
+ public int scale() {
+ return SCALE_00;
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_00.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 1.
+ */
+public class FixedPoint_01 extends FixedPoint4a {
+
+ /**
+ * Constructor.
+ * @param magnitude The magnitude of this fixed-point value.
+ */
+ protected FixedPoint_01(final int magnitude) {
+ super(magnitude);
+ }
+
+ @Override
+ public int scale() {
+ return SCALE_01;
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_01.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 2.
+ */
+public class FixedPoint_02 extends FixedPoint4a {
+
+ /**
+ * Constructor.
+ * @param magnitude The magnitude of this fixed-point value.
+ */
+ protected FixedPoint_02(final int magnitude) {
+ super(magnitude);
+ }
+
+ @Override
+ public int scale() {
+ return 2;
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_02.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+/**
+ * A fixed-point value with a scale of 3.
+ */
+public class FixedPoint_03 extends FixedPoint4a {
+
+ /**
+ * Constructor.
+ * @param magnitude The magnitude of this fixed-point value.
+ */
+ protected FixedPoint_03(final int magnitude) {
+ super(magnitude);
+ }
+
+ @Override
+ public int scale() {
+ return SCALE_03;
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/FixedPoint_03.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/package-info.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/package-info.java (rev 0)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/package-info.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2026 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$
+ */
+
+/**
+ * Implementations of fixed-point.
+ */
+package org.foray.primitive.fixed;
Property changes on: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/fixed/package-info.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
Added: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
===================================================================
--- trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java (rev 0)
+++ trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java 2026-04-22 14:04:45 UTC (rev 14473)
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2026 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.primitive.fixed;
+
+import org.axsl.primitive.fixed.FixedPoint;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests of {@link FixedPoint4a}.
+ */
+public class FixedPoint4aTests {
+
+ /**
+ * Tests of {@link FixedPoint4a#acquire(int, int)}.
+ */
+ @Test
+ public void testNumericFactory() {
+ FixedPoint out = FixedPoint4a.acquire(0, 112);
+ assertThat(out.scale()).isEqualTo(0);
+ assertThat(out.magnitude()).isEqualTo(112);
+
+ out = FixedPoint4a.acquire(3, 147_339);
+ assertThat(out.scale()).isEqualTo(3);
+ assertThat(out.magnitude()).isEqualTo(147_339);
+ }
+
+ /**
+ * Tests of {@link FixedPoint4a#acquire(String)}.
+ */
+ @Test
+ public void testStringFactory() {
+ FixedPoint out = FixedPoint4a.acquire("112");
+ assertThat(out.scale()).isEqualTo(0);
+ assertThat(out.magnitude()).isEqualTo(112);
+
+ out = FixedPoint4a.acquire("147.339");
+ assertThat(out.scale()).isEqualTo(3);
+ assertThat(out.magnitude()).isEqualTo(147_339);
+ }
+
+}
Property changes on: trunk/foray/foray-primitive/src/test/java/org/foray/primitive/fixed/FixedPoint4aTests.java
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-21 20:39:21
|
Revision: 14472
http://sourceforge.net/p/foray/code/14472
Author: victormote
Date: 2026-04-21 20:39:18 +0000 (Tue, 21 Apr 2026)
Log Message:
-----------
Conform to aXSL changes: Fixes to constant names and types.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-21 19:39:39 UTC (rev 14471)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-21 20:39:18 UTC (rev 14472)
@@ -129,9 +129,9 @@
}
break;
case U2000_General_Punctuation.THIN_SPACE: //thin space (1/5 em)
- return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_THIN_SPACE);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_THIN_SPACE_PER_EM);
case U2000_General_Punctuation.HAIR_SPACE:
- return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_HAIR_SPACE);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_HAIR_SPACE_PER_EM);
case U2000_General_Punctuation.ZERO_WIDTH_SPACE:
return 0;
case U2000_General_Punctuation.NARROW_NO_BREAK_SPACE:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-21 19:39:41
|
Revision: 14471
http://sourceforge.net/p/foray/code/14471
Author: victormote
Date: 2026-04-21 19:39:39 +0000 (Tue, 21 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Move some typographic constants to the class for that purpose.
Modified Paths:
--------------
trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-20 19:15:46 UTC (rev 14470)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/Font4a.java 2026-04-21 19:39:39 UTC (rev 14471)
@@ -53,48 +53,6 @@
*/
public abstract class Font4a implements org.axsl.font.Font {
- /** Constant indicating the ratio between 3-per-em and em. */
- private static final int FACTOR_3_PER_EM = 3;
-
- /** Constant indicating the ratio between 4-per-em and em. */
- private static final int FACTOR_4_PER_EM = 4;
-
- /** Constant indicating the ratio between 6-per-em and em. */
- private static final int FACTOR_6_PER_EM = 6;
-
- /** Constant indicating the ratio between a thin space and em. */
- private static final int FACTOR_THIN_SPACE = 5;
-
- /** Constant indicating the ratio between a hair space and em. */
- private static final int FACTOR_HAIR_SPACE = 10;
-
- /** Constant indicating the default line-height factor. */
- private static final float DEFAULT_LINE_HEIGHT_FACTOR = 1.2F;
-
- /** Constant indicating the default strikeout position. */
- private static final float DEFAULT_STRIKEOUT_POSITION = .375F;
-
- /** Constant for the default strikout size. The computation is equal to
- * 102 / 2048, which factors come from the OpenType manual, Section "OS/2
- * table", for the definition of "yStrikeoutSize", where this ratio is
- * suggested. */
- private static final float DEFAULT_STRIKEOUT_SIZE = 0.0498046875F;
-
- /** Constant for the default underline position. */
- private static final float DEFAULT_UNDERLINE_POSITION = .10F;
-
- /** Constant for the default overline position. */
- private static final float DEFAULT_OVERLINE_POSITION = .10F;
-
- /** Constant for the default hanging baseline position. */
- private static final float DEFAULT_HANGING_BASELINE_POSITION = .3F;
-
- /** Constant used to compute subscript baseline shift amounts. */
- private static final float SUBSCRIPT_SHIFT_FACTOR = .6666666666666666667f;
-
- /** Constant used to compute superscript baseline shift amounts. */
- private static final float SUPERSCRIPT_SHIFT_FACTOR = .6666666666666666667f;
-
/**
* The RegisteredFontContent that is attached to this Font instance.
*/
@@ -159,11 +117,11 @@
case U2000_General_Punctuation.EM_SPACE:
return getUnitsPerEm();
case U2000_General_Punctuation.THREE_PER_EM_SPACE:
- return Math.round(getUnitsPerEm() / Font4a.FACTOR_3_PER_EM);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_3_PER_EM);
case U2000_General_Punctuation.FOUR_PER_EM_SPACE:
- return Math.round(getUnitsPerEm() / Font4a.FACTOR_4_PER_EM);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_4_PER_EM);
case U2000_General_Punctuation.SIX_PER_EM_SPACE:
- return Math.round(getUnitsPerEm() / Font4a.FACTOR_6_PER_EM);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_6_PER_EM);
case U2000_General_Punctuation.PUNCTUATION_SPACE:
metricIndex = metricIndex(U0000_Basic_Latin.FULL_STOP);
if (metricIndex > -1) {
@@ -171,9 +129,9 @@
}
break;
case U2000_General_Punctuation.THIN_SPACE: //thin space (1/5 em)
- return Math.round(getUnitsPerEm() / Font4a.FACTOR_THIN_SPACE);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_THIN_SPACE);
case U2000_General_Punctuation.HAIR_SPACE:
- return Math.round(getUnitsPerEm() / Font4a.FACTOR_HAIR_SPACE);
+ return Math.round(getUnitsPerEm() / TypographicConstants.FACTOR_HAIR_SPACE);
case U2000_General_Punctuation.ZERO_WIDTH_SPACE:
return 0;
case U2000_General_Punctuation.NARROW_NO_BREAK_SPACE:
@@ -277,7 +235,7 @@
switch (algorithm) {
case DEFAULT:
default: {
- return Font4a.DEFAULT_LINE_HEIGHT_FACTOR;
+ return TypographicConstants.DEFAULT_LINE_HEIGHT_FACTOR;
}
}
}
@@ -331,7 +289,7 @@
}
case HANGING: {
return Math.round(fontSize
- * Font4a.DEFAULT_HANGING_BASELINE_POSITION);
+ * TypographicConstants.DEFAULT_HANGING_BASELINE_POSITION);
}
case IDEO_BOTTOM_LEFT: {
/* TODO: This needs to comply with the Note under "text-after-edge"
@@ -375,7 +333,7 @@
* @return The estimated underline position.
*/
public int getEstimatedUnderlinePosition(final int fontSize) {
- final int estimate = -Math.round(fontSize * Font4a.DEFAULT_UNDERLINE_POSITION);
+ final int estimate = -Math.round(fontSize * TypographicConstants.DEFAULT_UNDERLINE_POSITION);
return estimate;
}
@@ -396,7 +354,7 @@
*/
public int getEstimatedOverlinePosition(final int fontSize) {
final int estimate = Math.round(getAscender(fontSize)
- + (fontSize * Font4a.DEFAULT_OVERLINE_POSITION));
+ + (fontSize * TypographicConstants.DEFAULT_OVERLINE_POSITION));
return estimate;
}
@@ -406,7 +364,7 @@
* @return The estimated strikeout size.
*/
protected int getEstimatedStrikeoutSize(final int fontSize) {
- final int estimate = Math.round(fontSize * Font4a.DEFAULT_STRIKEOUT_SIZE);
+ final int estimate = Math.round(fontSize * TypographicConstants.DEFAULT_STRIKEOUT_SIZE);
return estimate;
}
@@ -417,7 +375,7 @@
*/
protected int getEstimatedStrikeoutPosition(final int fontSize) {
final int estimate = Math.round(getAscender(fontSize)
- * Font4a.DEFAULT_STRIKEOUT_POSITION);
+ * TypographicConstants.DEFAULT_STRIKEOUT_POSITION);
return estimate;
}
@@ -426,7 +384,7 @@
/* TODO: Where possible, replace this heuristic with data from the
* font itself. */
final int ascender = getAscender(fontSize);
- final int shift = Math.round(ascender * Font4a.SUBSCRIPT_SHIFT_FACTOR);
+ final int shift = Math.round(ascender * TypographicConstants.SUBSCRIPT_SHIFT_FACTOR);
return shift;
}
@@ -435,7 +393,7 @@
/* TODO: Where possible, replace this heuristic with data from the
* font itself. */
final int ascender = getAscender(fontSize);
- final int shift = Math.round(ascender * -1 * Font4a.SUPERSCRIPT_SHIFT_FACTOR);
+ final int shift = Math.round(ascender * -1 * TypographicConstants.SUPERSCRIPT_SHIFT_FACTOR);
return shift;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-20 19:15:48
|
Revision: 14470
http://sourceforge.net/p/foray/code/14470
Author: victormote
Date: 2026-04-20 19:15:46 +0000 (Mon, 20 Apr 2026)
Log Message:
-----------
Specify font size in the text itself.
Modified Paths:
--------------
trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
Modified: trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo
===================================================================
--- trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2026-04-17 12:39:22 UTC (rev 14469)
+++ trunk/foray/src/dist/resource/fo-examples/basic/fonts.fo 2026-04-20 19:15:46 UTC (rev 14470)
@@ -718,33 +718,15 @@
</fo:block-container>
<fo:block space-after.optimum="10pt" font-family="Helvetica">
- <fo:inline font-size="8.0pt">A</fo:inline>
- <fo:inline font-size="8.1pt">A</fo:inline>
- <fo:inline font-size="8.2pt">A</fo:inline>
- <fo:inline font-size="8.3pt">A</fo:inline>
- <fo:inline font-size="8.4pt">A</fo:inline>
- <fo:inline font-size="8.5pt">A</fo:inline>
- <fo:inline font-size="8.6pt">A</fo:inline>
- <fo:inline font-size="8.7pt">A</fo:inline>
- <fo:inline font-size="8.8pt">A</fo:inline>
- <fo:inline font-size="8.9pt">A</fo:inline>
- <fo:inline font-size="9.0pt">A</fo:inline>
- <fo:inline font-size="9.1pt">A</fo:inline>
- <fo:inline font-size="9.2pt">A</fo:inline>
- <fo:inline font-size="9.3pt">A</fo:inline>
- <fo:inline font-size="9.4pt">A</fo:inline>
- <fo:inline font-size="9.5pt">A</fo:inline>
- <fo:inline font-size="9.6pt">A</fo:inline>
- <fo:inline font-size="9.7pt">A</fo:inline>
- <fo:inline font-size="9.8pt">A</fo:inline>
- <fo:inline font-size="9.9pt">A</fo:inline>
- <fo:inline font-size="10pt">A</fo:inline>
- <fo:inline>---</fo:inline>
- <fo:inline font-size="10.5pt">A</fo:inline>
- <fo:inline font-size="11pt">A</fo:inline>
- <fo:inline font-size="11.5pt">A</fo:inline>
- <fo:inline font-size="12pt">A</fo:inline>
-
+ <fo:inline font-size="8.0pt">8.0pt</fo:inline>
+ <fo:inline font-size="8.5pt">8.5pt</fo:inline>
+ <fo:inline font-size="9.0pt">9.0pt</fo:inline>
+ <fo:inline font-size="9.5pt">9.5pt</fo:inline>
+ <fo:inline font-size="10pt">10pt</fo:inline>
+ <fo:inline font-size="10.5pt">10.5pt</fo:inline>
+ <fo:inline font-size="11.0pt">11.0pt</fo:inline>
+ <fo:inline font-size="11.5pt">11.5pt</fo:inline>
+ <fo:inline font-size="12.0pt">12.0pt</fo:inline>
</fo:block>
</fo:flow>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-17 12:39:25
|
Revision: 14469
http://sourceforge.net/p/foray/code/14469
Author: victormote
Date: 2026-04-17 12:39:22 +0000 (Fri, 17 Apr 2026)
Log Message:
-----------
Add "final" keyword to instance variables in immutable classes.
Modified Paths:
--------------
trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Degrees.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Grads.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Radians.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtBorderStyle.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Hertz.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Kilohertz.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Milliseconds.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Seconds.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromNearestSpecifiedValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromPageMasterRegion.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromParent.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromTableColumn.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnInheritedPropertyValue.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnMergePropertyValues.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DerivativePattern.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java
trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.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/ByteSequenceChars.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/DoubleArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.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/LongArray.java
trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java
Modified: trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java
===================================================================
--- trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-app/src/test/java/org/foray/app/area/AbstractAreaTreeTest.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -36,6 +36,7 @@
import org.foray.font.FreeStandingFont;
import org.foray.font.config.RegisteredFont;
import org.foray.font.config.RegisteredFontFamily;
+import org.foray.linebreak.LineBreakerFactory4a;
import org.axsl.area.AreaNode;
import org.axsl.area.AreaTree;
@@ -130,7 +131,7 @@
* @return The line-breaker factory.
*/
protected LineBreakerFactory getLineBreakerFactory() {
- return null;
+ return new LineBreakerFactory4a();
}
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -45,16 +45,16 @@
/* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
/** The lower-left X value. */
- private int llx;
+ private final int llx;
/** The lower-left Y value. */
- private int lly;
+ private final int lly;
/** The upper-right X value. */
- private int urx;
+ private final int urx;
/** The upper-right Y value. */
- private int ury;
+ private final int ury;
/**
* Constructor.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -45,16 +45,16 @@
/* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
/** The lower-left X value. */
- private short llx;
+ private final short llx;
/** The lower-left Y value. */
- private short lly;
+ private final short lly;
/** The upper-right X value. */
- private short urx;
+ private final short urx;
/** The upper-right Y value. */
- private short ury;
+ private final short ury;
/**
* Constructor.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/OrderedTreePath4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -39,7 +39,7 @@
public class OrderedTreePath4a implements OrderedTreePath {
/** The internal data structure. */
- private IntArray pathIndexes;
+ private final IntArray pathIndexes;
/**
* Constructor.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Country4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -358,16 +358,16 @@
/* Checkstyle: Restart Magic Number checking. */
/** The English name of this country. */
- private String englishName;
+ private final String englishName;
/** The two-character code for this country. */
- private String alpha2Code;
+ private final String alpha2Code;
/** The three-character code for this country. */
- private String alpha3Code;
+ private final String alpha3Code;
/** The numeric code for this country. */
- private short numericCode;
+ private final short numericCode;
/**
* Constructor.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Language4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -701,19 +701,19 @@
}
/** The English name of this language. */
- private String englishName;
+ private final String englishName;
/** The French name of this language. */
- private String frenchName;
+ private final String frenchName;
/** The two-character alpha code for this language. */
- private String alpha2Code;
+ private final String alpha2Code;
/** The three-character alpha code for this language. */
- private String alpha3Code;
+ private final String alpha3Code;
/** The default script to be used for this language. */
- private Script4a defaultScript;
+ private final Script4a defaultScript;
/**
* Constructor.
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/Script4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -449,30 +449,30 @@
/* Checkstyle: Restart Magic Number checking. */
/** The ISO-15924 English name of this script. */
- private String englishName;
+ private final String englishName;
/** The ISO-15924 French name of this script. */
- private String frenchName;
+ private final String frenchName;
/** The ISO-15924 alpha code for this script. */
- private String alphaCode;
+ private final String alphaCode;
/** The ISO-15924 numeric code for this script. */
- private short numericCode;
+ private final short numericCode;
/* ISO-15924 numeric code range from 000 to 999. */
/** The ICU4J code for this script. */
- private short icu4jCode;
+ private final short icu4jCode;
/* ICU4J codes range from -1 to 192 (ICU 66). */
/** The Unicode script corresponding to this ISO-15924 script. */
- private UnicodeScript unicodeScript;
+ private final UnicodeScript unicodeScript;
/** The natural baseline for this script. */
- private BaselineType naturalBaseline;
+ private final BaselineType naturalBaseline;
/** The hyphenation char(s) for this script. */
- private String hyphenationChar;
+ private final String hyphenationChar;
/**
* Private constructor.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/i18n/WritingSystem4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -48,6 +48,10 @@
*/
public final class WritingSystem4a implements WritingSystem {
+ /** ICU4J is not required at runtime. In order to avoid {@link ClassNotFoundException} during initialization, check
+ * now. */
+ public static final boolean IS_ICU4J_PRESENT = isIcu4jPresent();
+
/** The writing system for Latin. */
public static final WritingSystem4a LATIN;
@@ -92,30 +96,28 @@
}
/** The language. */
- private Language4a language;
+ private final Language4a language;
/** The country. */
- private Country4a country;
+ private final Country4a country;
/** The script. */
- private Script4a script;
+ private final Script4a script;
- /** The lazily-loaded (Java) locale for this writing system. Use {@link #toLocale()} to obtain the value. */
- private Locale locale;
+ /** The Java locale for this writing system. */
+ private final Locale locale;
- /** The lazily-loaded (Java) word break iterator for this writing system. Use {@link #getWordBreakIterator()} to
- * obtain the value. */
- private java.text.BreakIterator wordBreakIterator;
+ /** The Java word break iterator for this writing system. */
+ private final java.text.BreakIterator wordBreakIterator;
- /** The lazily-loaded ICU4J locale for this writing system. Use {@link #toULocale()} to obtain the value. */
- private ULocale uLocale;
+ /** The ICU4J locale for this writing system. */
+ private final ULocale uLocale;
- /** The lazily-loaded ICU4J word break iterator for this writing system. Use {@link #getIcu4jWordBreakIterator()} to
- * obtain the value. */
- private com.ibm.icu.text.BreakIterator icu4jWordBreakIterator;
+ /** The ICU4J word break iterator for this writing system. */
+ private final com.ibm.icu.text.BreakIterator icu4jWordBreakIterator;
/** The cached value of the hash code for this instance. */
- private int hash;
+ private final int hash;
/**
* Private constructor. Use {@link #find(Language, Script, Country)} to obtain an instance of this class.
@@ -128,14 +130,46 @@
this.script = script;
this.country = country;
+ final String languageString = this.language == null ?
+ StringUtils.EMPTY_STRING : this.language.getAlpha3Code();
+ final String countryString = this.country == null ? StringUtils.EMPTY_STRING : this.country.getAlpha3Code();
+ this.locale = new Locale(languageString, countryString);
+ this.wordBreakIterator = java.text.BreakIterator.getWordInstance(toLocale());
+
+ if (IS_ICU4J_PRESENT) {
+ this.uLocale = new ULocale(languageString, countryString);
+ this.icu4jWordBreakIterator = com.ibm.icu.text.BreakIterator.getWordInstance(this.locale);
+ } else {
+ this.uLocale = null;
+ this.icu4jWordBreakIterator = null;
+ }
+
/* Cache the hash code for performance. */
- this.hash = ObjectUtils.HASH_CODE_SEED;
- this.hash = ObjectUtils.recomputeHash(this.hash, this.language.hashCode());
- this.hash = ObjectUtils.recomputeHash(this.hash, this.country.hashCode());
- this.hash = ObjectUtils.recomputeHash(this.hash, this.script.hashCode());
+ int hash = ObjectUtils.HASH_CODE_SEED;
+ hash = ObjectUtils.recomputeHash(hash, this.language.hashCode());
+ hash = ObjectUtils.recomputeHash(hash, this.country.hashCode());
+ hash = ObjectUtils.recomputeHash(hash, this.script.hashCode());
+ this.hash = hash;
}
/**
+ * Static method run during initialization to determine whether ICU4J is found in the classpath.
+ * @return True if and only if the ICU4J classes are found at runtime.
+ */
+ private static boolean isIcu4jPresent() {
+ final String ulocaleClassName = "com.ibm.icu.util.ULocale";
+ try {
+ final Class<?> ulocaleClass =
+ Class.forName(ulocaleClassName, false, WritingSystem4a.class.getClassLoader());
+ return ulocaleClass != null;
+ } catch (final ClassNotFoundException e) {
+ /* This is OK. It just means that the ICU4J classes are not available and we can't initialize the related
+ * instance variables. */
+ return false;
+ }
+ }
+
+ /**
* Finds or creates an instance of this class for a given set of parameters.
* @param language The language.
* @param country The country.
@@ -367,20 +401,11 @@
@Override
public Locale toLocale() {
- if (this.locale == null) {
- final String languageString = this.language == null ?
- StringUtils.EMPTY_STRING : this.language.getAlpha3Code();
- final String countryString = this.country == null ? StringUtils.EMPTY_STRING : this.country.getAlpha3Code();
- this.locale = new Locale(languageString, countryString);
- }
return this.locale;
}
@Override
public java.text.BreakIterator getWordBreakIterator() {
- if (this.wordBreakIterator == null) {
- this.wordBreakIterator = java.text.BreakIterator.getWordInstance(toLocale());
- }
return this.wordBreakIterator;
}
@@ -389,12 +414,6 @@
* @return The ICU4J ULocale.
*/
public ULocale toULocale() {
- if (this.uLocale == null) {
- final String languageString = this.language == null ?
- StringUtils.EMPTY_STRING : this.language.getAlpha3Code();
- final String countryString = this.country == null ? StringUtils.EMPTY_STRING : this.country.getAlpha3Code();
- this.uLocale = new ULocale(languageString, countryString);
- }
return this.uLocale;
}
@@ -404,9 +423,6 @@
* @return The {@link com.ibm.icu.text.BreakIterator} to be used for finding word breaks for this writing system.
*/
public com.ibm.icu.text.BreakIterator getIcu4jWordBreakIterator() {
- if (this.icu4jWordBreakIterator == null) {
- this.icu4jWordBreakIterator = com.ibm.icu.text.BreakIterator.getWordInstance(toULocale());
- }
return this.icu4jWordBreakIterator;
}
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/axsl/PvKeywordAxsl.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -31,19 +31,17 @@
import org.foray.fotree.value.PvKeyword;
/**
- * Class encapsulating those property values that are expressed as keywords
- * (e.g. "inherit", "auto", "true", etc.).
- * Instances of this class are immutable and are therefore treated as a group
- * of singletons, one for each possible keyword value.
+ * Class encapsulating those property values that are expressed as keywords (e.g. "inherit", "auto", "true", etc.).
+ * Instances of this class are immutable and are therefore treated as a group of singletons, one for each possible
+ * keyword value.
*/
public final class PvKeywordAxsl extends PvKeyword {
/** Array of the possible keyword values. */
- private static PvKeywordAxsl[] keywords = new PvKeywordAxsl[
- AxslValue.values().length];
+ private static PvKeywordAxsl[] keywords = new PvKeywordAxsl[AxslValue.values().length];
/** The encapsulated keyword enumeration. */
- private AxslValue value;
+ private final AxslValue value;
/**
* Private constructor. Use {@link #getPropertyKeyword(AxslValue)} to obtain an instance of this class.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/PvKeywordFo.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -43,7 +43,7 @@
FoKeyword.values().length];
/** The encapsulated keyword enumeration. */
- private FoKeyword value;
+ private final FoKeyword value;
/**
* Private constructor. Use {@link #getPropertyKeyword(FoKeyword)} to obtain an instance of this class.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Degrees.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Degrees.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Degrees.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -37,7 +37,7 @@
public final class DtAngle_Degrees extends DtAngle {
/** The signed number value. Stored locally to ensure immutability. */
- private BigDecimal value;
+ private final BigDecimal value;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Grads.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Grads.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Grads.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -39,7 +39,7 @@
public final class DtAngle_Grads extends DtAngle {
/** The signed number value. Stored locally to ensure immutability. */
- private BigDecimal value;
+ private final BigDecimal value;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Radians.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Radians.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtAngle_Radians.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -37,7 +37,7 @@
public final class DtAngle_Radians extends DtAngle {
/** The signed number value. Stored locally to ensure immutability. */
- private BigDecimal value;
+ private final BigDecimal value;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtBorderStyle.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtBorderStyle.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtBorderStyle.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -57,11 +57,10 @@
};
/** Array of the instances of this class. */
- private static DtBorderStyle[] keywords = new DtBorderStyle[
- DtBorderStyle.VALID_KEYWORDS.length];
+ private static DtBorderStyle[] keywords = new DtBorderStyle[DtBorderStyle.VALID_KEYWORDS.length];
/** The encapsulated keyword enumeration. */
- private BorderStyle value;
+ private final BorderStyle value;
/**
* Private constructor. Use {@link #getInstance(FoKeyword)} to obtain an instance of this class.
@@ -80,8 +79,7 @@
}
/**
- * Indicates whether a given property value qualifies as a border-style
- * property.
+ * Indicates whether a given property value qualifies as a border-style property.
* @param foValue The property value to be tested.
* @return True if and only if the property qualifies as a border-style property.
*/
@@ -107,18 +105,15 @@
case RIDGE: return BorderStyle.RIDGE;
case INSET: return BorderStyle.INSET;
case OUTSET: return BorderStyle.OUTSET;
- default: throw new IllegalArgumentException("Illegal border style: "
- + foBorderStyle.getText());
+ default: throw new IllegalArgumentException("Illegal border style: " + foBorderStyle.getText());
}
}
/**
* Gets or creates the singleton instance for the specific keyword value.
- * There is no need for multiple instances of this class for the same
- * keyword.
+ * There is no need for multiple instances of this class for the same keyword.
* @param value The value for which the singleton instance is needed.
- * @return The singleton keyword instance, or null if the value is an
- * invalid keyword index.
+ * @return The singleton keyword instance, or null if the value is an invalid keyword index.
*/
public static DtBorderStyle getInstance(final FoKeyword value) {
if (value == null) {
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Hertz.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Hertz.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Hertz.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -39,7 +39,7 @@
public class DtFrequency_Hertz extends DtFrequency {
/** The quantity of units. */
- private BigDecimal quantity;
+ private final BigDecimal quantity;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Kilohertz.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Kilohertz.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtFrequency_Kilohertz.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -39,7 +39,7 @@
public class DtFrequency_Kilohertz extends DtFrequency {
/** The quantity of units. */
- private BigDecimal quantity;
+ private final BigDecimal quantity;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Milliseconds.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Milliseconds.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Milliseconds.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -35,7 +35,7 @@
public final class DtTime_Milliseconds extends DtTime {
/** The number of seconds. Stored locally to ensure immutability. */
- private Number quantity;
+ private final Number quantity;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Seconds.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Seconds.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/datatype/DtTime_Seconds.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -37,7 +37,7 @@
public final class DtTime_Seconds extends DtTime {
/** The number of seconds. Stored locally to ensure immutability. */
- private Number quantity;
+ private final Number quantity;
/**
* Constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromNearestSpecifiedValue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromNearestSpecifiedValue.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromNearestSpecifiedValue.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -53,7 +53,7 @@
new EnumMap<FoPropertyId, FnFromNearestSpecifiedValue>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromPageMasterRegion.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromPageMasterRegion.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromPageMasterRegion.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -51,7 +51,7 @@
new EnumMap<FoPropertyId, FnFromPageMasterRegion>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromParent.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromParent.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromParent.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -53,7 +53,7 @@
new EnumMap<FoPropertyId, FnFromParent>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromTableColumn.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromTableColumn.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnFromTableColumn.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -50,7 +50,7 @@
new EnumMap<FoPropertyId, FnFromTableColumn>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnInheritedPropertyValue.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnInheritedPropertyValue.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnInheritedPropertyValue.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -53,7 +53,7 @@
new EnumMap<FoPropertyId, FnInheritedPropertyValue>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnMergePropertyValues.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnMergePropertyValues.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/function/FnMergePropertyValues.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -51,7 +51,7 @@
new EnumMap<FoPropertyId, FnMergePropertyValues>(FoPropertyId.class);
/** The parameter to this function. */
- private FoPropertyId operand;
+ private final FoPropertyId operand;
/**
* Private constructor.
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/prop/PdFontStretch.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -91,7 +91,7 @@
}
/** The PropertyValue instance that contains this property's value. */
- private PropertyValue value;
+ private final PropertyValue value;
/**
* Private constructor.
Modified: trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java
===================================================================
--- trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-linebreak/src/main/java/org/foray/linebreak/LineBreakResult4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -73,7 +73,7 @@
};
/** The list of line-break instances in this result. */
- private List<LineBreak> lineBreakList;
+ private final List<LineBreak> lineBreakList;
/**
* Constructor.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/CompoundBreak4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -53,10 +53,10 @@
public static final CompoundBreak4a INSTANCE = new CompoundBreak4a();
/** The box portion of this compound break. */
- private CompoundBreak4a.Box box;
+ private final CompoundBreak4a.Box box;
/** The penalty portion of this compound break. */
- private CompoundBreak4a.Penalty penalty;
+ private final CompoundBreak4a.Penalty penalty;
/**
* Private constructor. This class is a singleton, and should be instantiated only within itself.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DerivativePattern.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DerivativePattern.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DerivativePattern.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -43,13 +43,13 @@
public class DerivativePattern {
/** The regex pattern to which input words must "match". */
- private Pattern match;
+ private final Pattern match;
/** The regex replacement string to obtain a possible root. */
- private String replace;
+ private final String replace;
/** The rules that apply to this pattern. */
- private List<DerivativeRule> rules;
+ private final List<DerivativeRule> rules;
/**
* Constructor.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/DiscretionaryHyphen4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -85,7 +85,7 @@
Collections.unmodifiableMap(PENALTY_MAP_INTERNAL);
/** The quality for this instance. */
- private DiscretionaryBreak.Quality quality;
+ private final DiscretionaryBreak.Quality quality;
/**
* Protected constructor. There are only 3 possible normal values, so these are pre-constructed.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/LexerIcu4jBreakIterator.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -29,6 +29,7 @@
package org.foray.orthography;
import org.foray.common.i18n.WritingSystem4a;
+import org.foray.primitive.sequence.IntArray;
import org.foray.primitive.sequence.IntArrayBuilder;
import org.axsl.i18n.WritingSystem;
@@ -61,7 +62,6 @@
@Override
protected IntSequence findRawBreaks(final CharSequence sequence, final WritingSystem writingSystem) {
- final IntArrayBuilder result = new IntArrayBuilder(sequence.length());
BreakIterator wordBreakIterator = this.iteratorMap.get(writingSystem);
if (wordBreakIterator == null) {
final WritingSystem4a ws4a = WritingSystem4a.find(writingSystem);
@@ -68,10 +68,15 @@
wordBreakIterator = ws4a.getIcu4jWordBreakIterator();
this.iteratorMap.put(writingSystem, wordBreakIterator);
}
+ if (wordBreakIterator == null) {
+ /* If it is still null, it is probably because the ICU4J libraries are not present. */
+ return IntArray.EMPTY;
+ }
wordBreakIterator.setText(sequence);
int boundary = wordBreakIterator.first();
+ final IntArrayBuilder result = new IntArrayBuilder(sequence.length());
while (boundary != BreakIterator.DONE) {
result.append(boundary);
boundary = wordBreakIterator.next();
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Punctuation4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -145,7 +145,7 @@
}
/** The content of this punctuation item. */
- private String content;
+ private final String content;
/**
* Private constructor. Use {@link #findInstance(CharSequence)} to obtain an instance of this class.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/SegmentDictionaryWord.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -43,13 +43,13 @@
private static final long serialVersionUID = 8095947731523665430L;
/** The parent dictionary that contains the character data. */
- private SegmentDictionary dictionary;
+ private final SegmentDictionary dictionary;
/** Array of the indexes into the dictionary segments. */
- private char[] segments;
+ private final char[] segments;
/** The encoded part(s) of speech for this word. */
- private char partsOfSpeech;
+ private final char partsOfSpeech;
/**
* Constructor.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/StringWord.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -44,10 +44,10 @@
static final long serialVersionUID = -576778461126231672L;
/** The segments being hyphenated, stored as an array of string segments. */
- private StringWordSegmentUtf16[] segments;
+ private final StringWordSegmentUtf16[] segments;
/** The encoded part(s) of speech for this word. */
- private char partsOfSpeech;
+ private final char partsOfSpeech;
/**
* Constructor for a sequence of segments.
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 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/TokenFlow4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -59,10 +59,10 @@
* of the token index. */
/** The token index. See {@link TextTokenFlowLocation#getTokenIndex()}. */
- private char tokenIndex;
+ private final char tokenIndex;
/** The segment index. See {@link TextTokenFlowLocation#getSegmentIndex()}. */
- private byte segmentIndex;
+ private final byte segmentIndex;
/**
* Constructor.
Modified: trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java
===================================================================
--- trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-orthography/src/main/java/org/foray/orthography/Whitespace4a.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -80,10 +80,10 @@
}
/** The content of this whitespace item. */
- private CharSequence content;
+ private final CharSequence content;
/** The raw char for this whitespace. */
- private char nativeChar;
+ private final char nativeChar;
/**
* Private constructor. Use {@link #findInstance(CharSequence)} to obtain an instance of this class.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -68,7 +68,7 @@
private static final long serialVersionUID = 7028830925894620170L;
/** The internal array. */
- private byte[] array;
+ private final byte[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ByteSequenceChars.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -56,7 +56,7 @@
private static final long serialVersionUID = -1751607833341542464L;
/** The internal sequence. */
- private CharSequence sequence;
+ private final CharSequence sequence;
/**
* Constructor.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/CharArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -44,7 +44,7 @@
private static final long serialVersionUID = -1539531984619174210L;
/** The internal array. */
- private char[] array;
+ private final char[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/DoubleArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -45,7 +45,7 @@
private static final long serialVersionUID = 2965730464073575273L;
/** The internal array. */
- private double[] array;
+ private final double[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/FloatArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -45,7 +45,7 @@
private static final long serialVersionUID = 2128993525299346990L;
/** The internal array. */
- private float[] array;
+ private final float[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/IntArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -53,7 +53,7 @@
private static final long serialVersionUID = -321055952376755507L;
/** The internal array. */
- private int[] array;
+ private final int[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/LongArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -49,7 +49,7 @@
private static final long serialVersionUID = -4526977471486128186L;
/** The internal array. */
- private long[] array;
+ private final long[] array;
/**
* Constructor for an existing array.
Modified: trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java
===================================================================
--- trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java 2026-04-16 20:16:41 UTC (rev 14468)
+++ trunk/foray/foray-primitive/src/main/java/org/foray/primitive/sequence/ShortArray.java 2026-04-17 12:39:22 UTC (rev 14469)
@@ -45,7 +45,7 @@
private static final long serialVersionUID = -4243900857925687263L;
/** The internal array. */
- private short[] array;
+ private final short[] array;
/**
* Constructor for an existing array.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vic...@us...> - 2026-04-16 20:16:43
|
Revision: 14468
http://sourceforge.net/p/foray/code/14468
Author: victormote
Date: 2026-04-16 20:16:41 +0000 (Thu, 16 Apr 2026)
Log Message:
-----------
Conform to aXSL change: Complete unification of BoundingBox.
Modified Paths:
--------------
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java
trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsVectorGraphic4a.java
trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/structure/PdfRectangle.java
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfFormXobjectSrlzr.java
trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfXformEpsSrlzr.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/BoundingBoxInt.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxInt.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -42,6 +42,8 @@
/** Constant needed for serialization. */
private static final long serialVersionUID = -9164196316608860970L;
+ /* Store the elements as primitives to avoid the memory cost of an unnecessary array. */
+
/** The lower-left X value. */
private int llx;
@@ -84,11 +86,6 @@
}
@Override
- public float getCoordinateAsFloat(final int index) {
- return getCoordinate(index);
- }
-
- @Override
public int getCoordinate(final int index) {
switch (index) {
case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/data/BoundingBoxShort.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -86,11 +86,6 @@
}
@Override
- public float getCoordinateAsFloat(final int index) {
- return getCoordinate(index);
- }
-
- @Override
public int getCoordinate(final int index) {
switch (index) {
case BoundingBox.LOWER_LEFT_X_INDEX: return this.llx;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsVectorGraphic4a.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsVectorGraphic4a.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/EpsVectorGraphic4a.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -185,12 +185,12 @@
}
readBBox(fileStart);
if (this.bbox != null) {
- final float xUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
- final float xLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float xUR = this.bbox.getCoordinate(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float xLL = this.bbox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX);
final float pixelWidth = xUR - xLL;
this.pixelWidth = Math.round(pixelWidth);
- final float yUR = this.bbox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
- final float yLL = this.bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ final float yUR = this.bbox.getCoordinate(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float yLL = this.bbox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX);
final float pixelHeight = yUR - yLL;
this.pixelHeight = Math.round(pixelHeight);
} else {
Modified: trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/structure/PdfRectangle.java
===================================================================
--- trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/structure/PdfRectangle.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-pdf-core/src/main/java/org/foray/pdf/structure/PdfRectangle.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -89,10 +89,10 @@
* @param bBox A bounding box.
*/
public PdfRectangle(final BoundingBox bBox) {
- this.llx = BigDecimal.valueOf(bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
- this.lly = BigDecimal.valueOf(bBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
- this.urx = BigDecimal.valueOf(bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX));
- this.ury = BigDecimal.valueOf(bBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX));
+ this.llx = BigDecimal.valueOf(bBox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX));
+ this.lly = BigDecimal.valueOf(bBox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX));
+ this.urx = BigDecimal.valueOf(bBox.getCoordinate(BoundingBox.UPPER_RIGHT_X_INDEX));
+ this.ury = BigDecimal.valueOf(bBox.getCoordinate(BoundingBox.UPPER_RIGHT_Y_INDEX));
}
/**
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfFormXobjectSrlzr.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfFormXobjectSrlzr.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfFormXobjectSrlzr.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -83,10 +83,10 @@
@Override
protected ByteSequencePlus specialXObjectDictEntries() {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
- final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
- final float urx = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_X_INDEX);
- final float ury = boundingBox.getCoordinateAsFloat(BoundingBox.UPPER_RIGHT_Y_INDEX);
+ final float llx = boundingBox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX);
+ final float urx = boundingBox.getCoordinate(BoundingBox.UPPER_RIGHT_X_INDEX);
+ final float ury = boundingBox.getCoordinate(BoundingBox.UPPER_RIGHT_Y_INDEX);
final ByteArrayBuilder builder = new ByteArrayBuilder();
builder.append("/FormType 1");
builder.append(PdfConstants.EOL);
Modified: trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfXformEpsSrlzr.java
===================================================================
--- trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfXformEpsSrlzr.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-pdf-serial/src/main/java/org/foray/pdfSerial/graphics/PdfXformEpsSrlzr.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -98,8 +98,8 @@
@Override
protected AffineTransform getUserSpaceTransform() {
final BoundingBox boundingBox = this.getBoundingBox();
- final float llx = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX);
- final float lly = boundingBox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX);
+ final float llx = boundingBox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX);
+ final float lly = boundingBox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX);
float xTranslate = 0;
if (llx < 0) {
/* If the bounding box of the graphic is negative, adjust it up to
Modified: trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java
===================================================================
--- trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2026-04-16 19:52:15 UTC (rev 14467)
+++ trunk/foray/foray-render/src/main/java/org/foray/render/ps/PsRenderer.java 2026-04-16 20:16:41 UTC (rev 14468)
@@ -684,13 +684,13 @@
buffer.append(x + " " + (y - h) + " translate");
buffer.append("0.0 rotate");
buffer.append((long) (w / bboxw) + " " + (long) (h / bboxh) + " scale");
- buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(-bbox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX));
buffer.append(" ");
- buffer.append(-bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(-bbox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX));
buffer.append(" translate");
- buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_X_INDEX));
+ buffer.append(bbox.getCoordinate(BoundingBox.LOWER_LEFT_X_INDEX));
buffer.append(" ");
- buffer.append(bbox.getCoordinateAsFloat(BoundingBox.LOWER_LEFT_Y_INDEX));
+ buffer.append(bbox.getCoordinate(BoundingBox.LOWER_LEFT_Y_INDEX));
buffer.append(" ");
buffer.append(bboxw);
buffer.append(" ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|