Skip to content
jeffbrown edited this page Sep 13, 2010 · 13 revisions

Introduction

The groovy-measures library aims to bring a DSL to groovy specifically for dealing with units of measure. For example, groovy-measures supports code like the following:


def distance = 9.meters + 34.centimeters

Using The Library

To use the groovy-measures library you must include the groovy-measures jar file in your application’s CLASSPATH and you must bootstrap the environment by loading the com.g2one.groovy.measures.GroovyMeasures class.


Class.forName 'com.g2one.groovy.measures.GroovyMeasures'

The library makes extensive use of JScience so the JScience jar file must also be on your application’s CLASSPATH.

Clone this wiki locally