Compare commits
5 Commits
284cd73b24
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
46a6c01be8
|
|||
|
25a70331f5
|
|||
|
d5fb7b4521
|
|||
|
abf61f5395
|
|||
|
2dfd645577
|
21
README.md
21
README.md
@@ -1,23 +1,15 @@
|
||||
# JavaClasses
|
||||
|
||||
[](https://sonarqube.mattrixwv.com/dashboard?id=JavaClasses)
|
||||
|
||||
This is a set of classes and functions, not part of the standard library, that I have found it helpful to keep around.
|
||||
|
||||
# Installation
|
||||
In order to use these in a program they need to be installed with maven. I normally use `mvn clean package install`. From there you can import them into a maven project using
|
||||
```XML
|
||||
<dependency>
|
||||
<groupId>mattrixwv</groupId>
|
||||
<artifactId>myClasses</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
```
|
||||
Then import them into a program by `import mattrixwv.Algorithms;` or `import mattrixwv.Stopwatch;`.
|
||||
## Stopwatch
|
||||
|
||||
# Stopwatch
|
||||
This is a class that allows you to determine the execution time of an algorithm.
|
||||
You can get specific resolutions of time through their own get functions, all of which return double.
|
||||
However I have built it a function, getStr(), that automatically chooses the best resolution and returns both the number and resolution as a string.
|
||||
|
||||
Example of usage:
|
||||
```Java
|
||||
Stopwatch timer = new Stopwatch();
|
||||
timer.start();
|
||||
@@ -28,6 +20,7 @@ Example of usage:
|
||||
System.out.printf("It took %f milliseconds to run this algorithm", timer.getMilli());
|
||||
```
|
||||
|
||||
# Algorithms
|
||||
This is a class that contains many different algorithms that I have found it useful to keep around. This is used extensively in my ProjectEuler code found at https://bitbucket.org/Mattrixwv/ProjectEuler
|
||||
## Algorithms
|
||||
|
||||
This is a class that contains many different algorithms that I have found it useful to keep around. This is used extensively in my [Project Euler](https://git.mattrixwv.com/ProjectEuler/ProjectEulerJava) project.
|
||||
All methods are overloaded to allow for using Integer, Long, and BigInteger types.
|
||||
|
||||
24
pom.xml
24
pom.xml
@@ -20,14 +20,14 @@
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git://bitbucket.org/Mattrixwv/JavaClasses.git</connection>
|
||||
<developerConnection>scm:git:ssh://bitbucket.org:Mattrixwv/JavaClasses.git</developerConnection>
|
||||
<url>https://bitbucket.org/Mattrixwv/JavaClasses/src</url>
|
||||
<connection>scm:git:git://git.mattrixwv.com/BaseLibraries/JavaClasses.git</connection>
|
||||
<developerConnection>scm:git:ssh://git.mattrixwv.com/BaseLibraries/JavaClasses.git</developerConnection>
|
||||
<url>https://git.mattrixwv.com/BaseLibraries/JavaClasses</url>
|
||||
</scm>
|
||||
|
||||
<groupId>com.mattrixwv</groupId>
|
||||
<artifactId>myClasses</artifactId>
|
||||
<version>1.3.10-SNAPSHOT</version>
|
||||
<version>1.4.1</version>
|
||||
|
||||
<name>myClasses</name>
|
||||
<description>A grouping of functions that I've found useful</description>
|
||||
@@ -77,7 +77,6 @@
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>12.1.9</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>dependency-check</id>
|
||||
@@ -90,6 +89,10 @@
|
||||
</plugin>
|
||||
|
||||
<!--Deployment-->
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
@@ -252,7 +255,7 @@
|
||||
</formats>
|
||||
<nvdApiServerId>nvd</nvdApiServerId>
|
||||
<failBuildOnCVSS>7</failBuildOnCVSS>
|
||||
<ossIndexServerId>ossrh</ossIndexServerId>
|
||||
<ossIndexServerId>ossindex</ossIndexServerId>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -309,15 +312,6 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
@@ -1,28 +1,7 @@
|
||||
//JavaClasses/src/test/java/com/mattrixwv/TestTriple.java
|
||||
//Mattrixwv
|
||||
// Created: 08-20-22
|
||||
//Modified: 04-13-23
|
||||
/*
|
||||
Copyright (C) 2023 Matthew Ellison
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.mattrixwv;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -40,6 +19,8 @@ public class TestTriple{
|
||||
|
||||
@Test
|
||||
public void testConstructor(){
|
||||
triple = new Triple<>(1L, 2L, 3L);
|
||||
|
||||
assertEquals(1L, triple.getA());
|
||||
assertEquals(2L, triple.getB());
|
||||
assertEquals(3L, triple.getC());
|
||||
|
||||
Reference in New Issue
Block a user