Java Reference
In-Depth Information
significantly for nontrivial equations and also makes it more susceptible to bugs. (The
String class in Java does provide a “ + ” operator for appending two strings.)
Floating-point limitations - The early versions of Java provided only 32- and 64-bit
floating-point regardless of whether the host machine provided for greater precision.
This insured that for the same program the JVMs produced exactly the same result
on all machines. However, in Java 1.2 it became possible to use a wider exponent
(but not significand) representation if available on the platform. The keyword modifier
strictfp forces the floating-point calculations to follow the previous lower precision
mode to ensure exactly the same results on all machines. We discuss floating-point
representations and operations in Chapter 2.
So for some types of intensive mathematical processing, such as those using very
large arrays, it may be difficult to achieve the performance levels of C or Fortran,
especially when that code has been optimized over many years of use. In such
cases, it may be advantageous to let Java provide a graphical user interface and
networking tools, but keep the C/Fortran program as a calculation engine inside
the Java body. Chapter 22 discusses how to link Java with native code.
1.6 Real-world Java applications in science
and engineering
Java has been used extensively for several years now to solve real-world program-
ming challenges in numerous areas of endeavor. While applications in science
and engineering may be less well known, there certainly are many and we present
afew examples here.
AJava-based system called Maestro provided for data visualization, collabo-
ration, and command and control services for the NASA JPL team in charge of
the Mars rovers that landed on the Red Planet in January 2004. James Gosling
called it the “the coolest Java app ever” [1]. The system provides an elaborate set
of tools for analyzing images, 3D modeling of the terrain around a rover, and col-
laborative planning for rover maneuvers and experimental operations. Figure 1.1
shows a display of a special version of Maestro made available to the public for
personal use. You can use it “to create your own driving and science activities,
using all of the rover's instruments to enact your own day of mission operations.”
Large sets of actual data and imagery can be downloaded for different periods of
the mission [2].
One of us is part of team working on a project known as SensorNet that is
using Java-based web services to enable the collection and archiving of data from
sensors that are distributed nationwide [3]. Web services involve the exchange
of data in XML (Extensible Markup Language) format via web client/server
systems. (We give an introduction to Web services in Chapter 21.) SensorNet
uses web services and open standards so that sensor information is available to a
wide variety of users in a standard format. Java was chosen as the implementation
Search WWH ::




Custom Search