diff --git a/.gitattributes b/.gitattributes index 7b4e9c4..1a798b9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ *.txt text *.md text +*.yml text *.html text *.css text diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9ad95aa --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +# Travis CI + +language: java + +sudo: false + +jdk: + - oraclejdk8 + - oraclejdk7 + - openjdk7 + +cache: + directories: + - $HOME/.m2 + +# EOF diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d54c78..e94ef82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,17 @@ DoubDabC Changelog =================== +## WIP +Released on 20XX-XX-XX + +## v1.102.6 +Released on 2017-02-19 +- Speed-up Arabic-num converting +- Add .travis.yml for Travis CI #18 +- Add header to Javadoc pages + ## v1.102.4 -Released on 2017-02-XX +Released on 2017-02-02 - Speed-up converting - Add static code analysis report plugin. (checkstyle,PMD,FindBugs) - Add code coverage report plugin. (Jacoco) diff --git a/README.md b/README.md index 344aeca..58a2d9b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # DoubDabC # +[![Build Status](https://travis-ci.org/olyutorskii/DoubDabC.svg?branch=master)] +(https://travis-ci.org/olyutorskii/DoubDabC) + ----------------------------------------------------------------------- ## What is DoubDabC ? ## diff --git a/pom.xml b/pom.xml index e26f1bb..a44f0a9 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ io.github.olyutorskii doubdabc - 1.102.4 + 1.102.6 jar DoubDabC @@ -93,7 +93,7 @@ en -Duser.language=en - 0.7.8 + 0.7.9 2.17 6.19 @@ -208,7 +208,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.0 + 3.6.1 1.7 1.7 @@ -225,7 +225,6 @@ maven-surefire-plugin 2.19.1 - false true @@ -411,6 +410,7 @@ true protected ${javadoc.locale} +
${project.name} ${project.version} API
true diff --git a/src/main/java/io/github/olyutorskii/doubdabc/DecimalOut.java b/src/main/java/io/github/olyutorskii/doubdabc/DecimalOut.java index c674767..a587f32 100644 --- a/src/main/java/io/github/olyutorskii/doubdabc/DecimalOut.java +++ b/src/main/java/io/github/olyutorskii/doubdabc/DecimalOut.java @@ -18,11 +18,6 @@ */ public class DecimalOut { - private static final char[] DECCH_TBL = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - }; - - private final BcdRegister decimal; private final int[] intBuf; @@ -70,7 +65,10 @@ private int buildChar(){ for(int idx = 0; idx < precision; idx++){ int digit = this.intBuf[idx]; - char decimalCh = DECCH_TBL[digit]; + + // map [0 - 9](int) to ['0' - '9'](char) + char decimalCh = (char)( digit | 0b0011_0000 ); + this.charBuf[idx] = decimalCh; } diff --git a/src/main/java/io/github/olyutorskii/doubdabc/DecimalText.java b/src/main/java/io/github/olyutorskii/doubdabc/DecimalText.java index bc5fe58..02d6102 100644 --- a/src/main/java/io/github/olyutorskii/doubdabc/DecimalText.java +++ b/src/main/java/io/github/olyutorskii/doubdabc/DecimalText.java @@ -12,11 +12,6 @@ */ public class DecimalText implements CharSequence{ - private static final char[] DECCH_TBL = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - }; - - private final BcdRegister decimal; private final int[] intBuf; private final CharBuffer textOut; @@ -72,7 +67,9 @@ public char charAt(int index) throws IndexOutOfBoundsException{ int digitPos = precision - index - 1; int digit = this.decimal.getDigit(digitPos); - char result = DECCH_TBL[digit]; + // map [0 - 9](int) to ['0' - '9'](char) + char result = (char)( digit | 0b0011_0000 ); + return result; } @@ -124,7 +121,10 @@ private String encodeText(int start, int end){ this.textOut.clear(); for(int idx = start; idx < end; idx++){ int digit = this.intBuf[idx]; - char decimalCh = DECCH_TBL[digit]; + + // map [0 - 9](int) to ['0' - '9'](char) + char decimalCh = (char)( digit | 0b0011_0000 ); + this.textOut.put(decimalCh); }