Skip to content

Commit

Permalink
Under constuction #3
Browse files Browse the repository at this point in the history
  • Loading branch information
passoz committed Aug 5, 2022
1 parent 3a01366 commit 6e21985
Show file tree
Hide file tree
Showing 21 changed files with 711 additions and 4 deletions.
9 changes: 9 additions & 0 deletions java/extenso/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

5 changes: 5 additions & 0 deletions java/extenso/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
28 changes: 28 additions & 0 deletions java/extenso/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>extenso</name>
<comment>Project extenso created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1659479287507</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions java/extenso/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/home/fernando/.asdf/installs/java/openjdk-18.0.2
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
32 changes: 32 additions & 0 deletions java/extenso/app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-18/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
34 changes: 34 additions & 0 deletions java/extenso/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1659479287504</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions java/extenso/app/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1
35 changes: 35 additions & 0 deletions java/extenso/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.5/userguide/building_java_projects.html
*/

plugins {
// Apply the application plugin to add support for building a CLI application in Java.
application
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
// Use TestNG framework, also requires calling test.useTestNG() below
testImplementation("org.testng:testng:7.4.0")

// This dependency is used by the application.
implementation("com.google.guava:guava:31.0.1-jre")
}

application {
// Define the main class for the application.
mainClass.set("extenso.App")
}

tasks.named<Test>("test") {
// Use TestNG for unit tests.
useTestNG()
}
11 changes: 11 additions & 0 deletions java/extenso/app/src/main/java/extenso/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package extenso;

public class App {

public static void main(String[] args) {
NumberToText.text(3);
}
}
70 changes: 70 additions & 0 deletions java/extenso/app/src/main/java/extenso/NumberToText.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package extenso;

import java.util.HashMap;

public class NumberToText {
private static HashMap hm;
private static int number;

private static void numberAnalizer() {
String num = String.valueOf(number);
int strSize = num.length();
String[] decomposed = num.split("");
System.out.println(decomposed[0]);
}

public static final String text(int number) {
createMapNumbers();
numberAnalizer();
return "";
}

private static void createMapNumbers() {
hm = new HashMap<String, String>();
hm.put("1", "um");
hm.put("2", "dois");
hm.put("3", "tres");
hm.put("4", "quatro");
hm.put("5", "cinco");
hm.put("6", "seis");
hm.put("7", "sete");
hm.put("8", "oito");
hm.put("9", "nove");
hm.put("10", "dez");
hm.put("11", "onze");
hm.put("12", "doze");
hm.put("13", "treze");
hm.put("14", "quatorze");
hm.put("15", "quinze");
hm.put("16", "dezesseis");
hm.put("17", "dezessete");
hm.put("18", "dezoito");
hm.put("19", "dezenove");
hm.put("2_", "vinte");
hm.put("3_", "trinta");
hm.put("4_", "");
hm.put("5_", "um");
hm.put("6_", "um");
hm.put("7_", "um");
hm.put("8_", "um");
hm.put("9_", "um");
hm.put("100", "cem");
hm.put("1__", "cento");
hm.put("2__", "duzentos");
hm.put("3__", "trezentos");
hm.put("4__", "quatrocentos");
hm.put("5__", "quinhentos");
hm.put("6__", "seiscentos");
hm.put("7__", "setecentos");
hm.put("8__", "oitocentos");
hm.put("9__", "novecentos");
hm.put("___", "mil");
hm.put("1______", "milhão");
hm.put("______", "milhões");
hm.put("1_________", "Bilhão");
hm.put("_________", "bilhões");
hm.put("1____________", "trilhão");
hm.put("____________", "trilhões");
}

}
14 changes: 14 additions & 0 deletions java/extenso/app/src/test/java/extenso/AppTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package extenso;

import org.testng.annotations.*;
import static org.testng.Assert.*;

public class AppTest {
@Test public void appHasAGreeting() {
App classUnderTest = new App();
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
}
}
Binary file added java/extenso/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions java/extenso/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6e21985

Please sign in to comment.