gov.nist.microanalysis.EPQLibrary
Class Material

java.lang.Object
  extended by gov.nist.microanalysis.EPQLibrary.Composition
      extended by gov.nist.microanalysis.EPQLibrary.Material
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
Gas, GasMixture

public class Material
extends Composition

A simple class for managing a materials properties based on a Composition + density.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nist.microanalysis.EPQLibrary.Composition
mHashCode, STOICIOMETRY, UNDETERMINED, WEIGHT_PCT
 
Constructor Summary
  Material()
           
  Material(Composition comp, double density)
           
protected Material(Element[] elms, double[] weightFracs, double density, java.lang.String name)
          Material - Constructs a material with the specified weight fractions.
 
Method Summary
 double atomsPerCubicMeter(Element elm)
          atomsPerCubicMeter - Computes the numbers of atoms per cubic centimeter for the specified element based on the composition and density of this Material.
 void clear()
          clear - Clear all consistuent elements.
 java.lang.Object clone()
           
 int compareTo(java.lang.Object obj)
           
 void defineByMaterialFraction(Composition[] compositions, double[] matFracs)
          defineByMaterialFraction - Extends defineByMaterialFraction to also compute the density based on the amount of each base material and the density of the base material.
 void defineByWeightFraction(java.util.Map map, double den)
          defineByWeightFraction - Define the composition of this material by weight fraction.
 java.lang.String descriptiveString(boolean normalize)
          descriptiveId - A string describing this material terms of the constituent element's weight percent and the material density.
 boolean equals(java.lang.Object obj)
          equals - Checks whether the value of this object exactly equals the value of the argument object.
 double getDensity()
          getDensity - returns the density of the material in kg pre cubic meter.
 int hashCode()
           
protected  void renormalize()
           
protected  void replicate(Material mat)
           
 void setDensity(double den)
          setDensity - Sets the density of the material in kg pre cubic meter.
 
Methods inherited from class gov.nist.microanalysis.EPQLibrary.Composition
addElement, addElement, addElementByStoiciometry, containsElement, defineByMoleFraction, defineByWeightFraction, defineByWeightFraction, difference, elementSet, fromXML, getElementCount, getElementSet, getName, getNthElementByAtomicFraction, getNthElementByWeight, getOptimalRepresentation, massAbsorptionCoefficient, moleFraction, removeElement, replicate, setName, stoiciometryAvgAtomicNumber, sumWeightPercent, toString, toXML, weightAvgAtomicNumber, weightPercent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Material

public Material()

Material

protected Material(Element[] elms,
                   double[] weightFracs,
                   double density,
                   java.lang.String name)
Material - Constructs a material with the specified weight fractions. If the length of weighFracs is one less than the weight of elms then the last weight fraction is calculated from the others assuming that the sum is 1.0.

Parameters:
elms - Element[] - The elements
weightFracs - double[] - The associated weight fractions
density - double - In SI
name - String - User friendly

Material

public Material(Composition comp,
                double density)
Method Detail

renormalize

protected void renormalize()
Overrides:
renormalize in class Composition

setDensity

public void setDensity(double den)
setDensity - Sets the density of the material in kg pre cubic meter.

Parameters:
den - double

getDensity

public double getDensity()
getDensity - returns the density of the material in kg pre cubic meter.

Returns:
double

defineByWeightFraction

public void defineByWeightFraction(java.util.Map map,
                                   double den)
defineByWeightFraction - Define the composition of this material by weight fraction. The map argument contains a map where the key may be an Integer containing the atomic number, a String containing the abbreviation or full name of the element or an Element object. The value is the weight fraction as a Double.

Parameters:
map - Map - keys are either Integer, String or Element types, values are Double
den - double - in kg/m^3

clear

public void clear()
clear - Clear all consistuent elements. Material -> pure vacuum

Overrides:
clear in class Composition

hashCode

public int hashCode()
Overrides:
hashCode in class Composition

atomsPerCubicMeter

public double atomsPerCubicMeter(Element elm)
atomsPerCubicMeter - Computes the numbers of atoms per cubic centimeter for the specified element based on the composition and density of this Material.

Parameters:
elm - Element
Returns:
double

defineByMaterialFraction

public void defineByMaterialFraction(Composition[] compositions,
                                     double[] matFracs)
defineByMaterialFraction - Extends defineByMaterialFraction to also compute the density based on the amount of each base material and the density of the base material.

Overrides:
defineByMaterialFraction in class Composition
Parameters:
compositions - Compositions[] - The base materials (ie SiO2, MgO,...)
matFracs - double[] - The proportion of each

equals

public boolean equals(java.lang.Object obj)
equals - Checks whether the value of this object exactly equals the value of the argument object.

Overrides:
equals in class Composition
Parameters:
obj - Object
Returns:
boolean

descriptiveString

public java.lang.String descriptiveString(boolean normalize)
descriptiveId - A string describing this material terms of the constituent element's weight percent and the material density.

Overrides:
descriptiveString in class Composition
Parameters:
normalize - Normalize weight percents to 100%?
Returns:
String

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class Composition

replicate

protected void replicate(Material mat)

clone

public java.lang.Object clone()
Overrides:
clone in class Composition