AbstractGas Class


AbstractGas Class

The AbstractGas class is at the top of the gas class hierarchy and is a direct subclass of Object . An abstract class declares methods that all of its concrete (i.e., nonabstract) subclasses must implement. It can also be used to declare constants useful to its subclasses. The AbstractGas class declares seven abstract methods that, when implemented by subclasses, will return the value of state variables associated with a gas mixture. The AbstractGas class also defines a constant representing the Universal Gas Constant. This constant is used in the gas equation of state, Eq. (18.1), and in many other thermodynamic computations as well. The AbstractGas class source code is shown here.

 package TechJava.Gas; public abstract class AbstractGas {   public static final double R = 8.31441;   public abstract double getPressure();   public abstract double getDensity();   public abstract double getMolarMass();   public abstract double getTemperature();   public abstract double getViscosity();   public abstract double getEnthalpy();   public abstract double getEntropy(); } 

The AbstractGas class and all other classes in this example are members of a package called TechJava.Gas . Packages are useful for organizing related classes and interfaces. If we were to develop another gas- related class hierarchy at some future date, we could also include it in the TechJava.Gas package.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net