Skip to content

Commit

Permalink
Added Seshat demos
Browse files Browse the repository at this point in the history
  • Loading branch information
keilw committed Oct 9, 2023
1 parent 9ccefd8 commit 65b68b5
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package tech.uom.demo.basic.quantity;

import static tech.units.indriya.unit.Units.CELSIUS;

import javax.measure.Quantity;
import javax.measure.quantity.Temperature;

import tech.units.indriya.quantity.Quantities;

public class TemperatureDemo {

public static void main(String[] args) {
final Quantity<Temperature> t1 = Quantities.getQuantity(2, CELSIUS);
final Quantity<Temperature> t2 = Quantities.getQuantity(1, CELSIUS);
final Quantity<Temperature> t3 = t1.add(t2);
System.out.println(t3);
}
}
2 changes: 1 addition & 1 deletion console/impl/jscience/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>uom-console-impl-demos</artifactId>
<version>2.2-SNAPSHOT</version>
</parent>
<artifactId>jscience</artifactId>
<artifactId>jscience-demo</artifactId>
<name>JScience 4 Console Demos</name>
<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions console/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<modules>
<module>jscience</module>
<module>seshat</module>
</modules>

<dependencyManagement>
Expand Down
32 changes: 32 additions & 0 deletions console/impl/seshat/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tech.uom.demo.console.impl</groupId>
<artifactId>uom-console-impl-demos</artifactId>
<version>2.2-SNAPSHOT</version>
</parent>
<artifactId>seshat-demos</artifactId>
<name>Seshat Console Demos</name>
<!-- ======================================================= -->
<!-- Build Settings -->
<!-- ======================================================= -->
<properties>
<jdkVersion>11</jdkVersion>
<project.build.javaVersion>${jdkVersion}</project.build.javaVersion>
<maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
</properties>

<dependencies>
<dependency>
<groupId>javax.measure</groupId>
<artifactId>unit-api</artifactId>
</dependency>
<dependency>
<groupId>tech.uom</groupId>
<artifactId>seshat</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Units of Measurement Demos for Java
* Copyright (c) 2005-2023, Werner Keil and others.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of JSR-385, Unit-API nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package tech.uom.demo.impl.seshat;

import javax.measure.quantity.*;

import tech.uom.seshat.Quantities;
import tech.uom.seshat.Units;

import javax.measure.Quantity;

public class TemperatureDemo {
public static void main(String[] args) {
final Quantity<Temperature> t1 = Quantities.create( 2, Units.CELSIUS);
final Quantity<Temperature> t2 = Quantities.create( 1, Units.CELSIUS);
final Quantity<Temperature> t3 = t1.add(t2);
System.out.println(t3);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static tech.uom.demo.java17.unit.TemperatureUnit.CELSIUS;

public class TemperatureDemo {
public class TemperatureQuantityDemo {

public static void main(String[] args) {
var temp1 = new TemperatureQuantity(30, CELSIUS);
Expand Down

0 comments on commit 65b68b5

Please sign in to comment.