gov.nist.microanalysis.EPQLibrary
Class MaterialFactory

java.lang.Object
  extended by gov.nist.microanalysis.EPQLibrary.MaterialFactory

public class MaterialFactory
extends java.lang.Object

A class to faciliate constructing common Material instances.

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

Field Summary
static java.lang.String Al2O3
           
static java.util.List BaseMaterials
           
static java.lang.String CaCO3
           
static java.lang.String Ice
           
static java.lang.String K1080
           
static java.lang.String K227
           
static java.lang.String K2450
           
static java.lang.String K2451
           
static java.lang.String K2466
           
static java.lang.String K2469
           
static java.lang.String K2472
           
static java.lang.String K2496
           
static java.lang.String K309
           
static java.lang.String K3189
           
static java.lang.String K411
           
static java.lang.String K412
           
static java.lang.String K961
           
static java.lang.String MagnesiumOxide
           
static double[] mElementalDensities
           
 java.util.Map mLibrary
           
static java.lang.String Mylar
           
static java.lang.String Nothing
           
static java.lang.String ParaleneC
           
static java.lang.String PerfectVacuum
           
static java.lang.String RynasAlTiAlloy
           
static java.lang.String SiliconDioxide
           
static java.lang.String SS316
           
static java.lang.String UraniumOxide
           
static java.lang.String VanadiumPentoxide
           
 
Constructor Summary
MaterialFactory()
          MaterialFactory - A constructor that adds the default materials.
MaterialFactory(java.io.Reader r)
          MaterialFactory - Create a material factory from the XML library specified by the Reader r.
 
Method Summary
 void addMaterial(Material mat)
          addMaterial - Add a material to the current library.
 void append(java.io.Reader r)
          append - Append the materials in the XML library specified in the Reader R to the current library.
static boolean canCreate(Element el)
           
static Composition createMaterial(java.lang.String name)
          createMaterial - Creates the material based on the type identified as one of the integer constants listed above.
static Material createPureElement(Element el)
          createPureElement - Create a simple material based on a pure element and a nominal density for a typical solid manifestation of this element.
static double estimatedDensity(Material mat)
          estimatedDensity - Compute an estimated density for a mixture of the element specified by the Material.
 Material getMaterial(java.lang.String name)
          getMaterial - Get the Material specified by the given name.
 java.lang.String[] getMaterialNames()
          getMaterialNames - Get a list of the names of the available materials.
 void write(java.io.Writer wr)
          write - Write the current library to the specified Writer as an XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

K3189

public static final java.lang.String K3189
See Also:
Constant Field Values

RynasAlTiAlloy

public static final java.lang.String RynasAlTiAlloy
See Also:
Constant Field Values

Mylar

public static final java.lang.String Mylar
See Also:
Constant Field Values

VanadiumPentoxide

public static final java.lang.String VanadiumPentoxide
See Also:
Constant Field Values

SiliconDioxide

public static final java.lang.String SiliconDioxide
See Also:
Constant Field Values

Ice

public static final java.lang.String Ice
See Also:
Constant Field Values

PerfectVacuum

public static final java.lang.String PerfectVacuum
See Also:
Constant Field Values

CaCO3

public static final java.lang.String CaCO3
See Also:
Constant Field Values

Al2O3

public static final java.lang.String Al2O3
See Also:
Constant Field Values

SS316

public static final java.lang.String SS316
See Also:
Constant Field Values

UraniumOxide

public static final java.lang.String UraniumOxide
See Also:
Constant Field Values

K227

public static final java.lang.String K227
See Also:
Constant Field Values

K309

public static final java.lang.String K309
See Also:
Constant Field Values

K411

public static final java.lang.String K411
See Also:
Constant Field Values

K412

public static final java.lang.String K412
See Also:
Constant Field Values

K961

public static final java.lang.String K961
See Also:
Constant Field Values

K1080

public static final java.lang.String K1080
See Also:
Constant Field Values

K2450

public static final java.lang.String K2450
See Also:
Constant Field Values

K2451

public static final java.lang.String K2451
See Also:
Constant Field Values

K2466

public static final java.lang.String K2466
See Also:
Constant Field Values

K2469

public static final java.lang.String K2469
See Also:
Constant Field Values

K2472

public static final java.lang.String K2472
See Also:
Constant Field Values

K2496

public static final java.lang.String K2496
See Also:
Constant Field Values

ParaleneC

public static final java.lang.String ParaleneC
See Also:
Constant Field Values

MagnesiumOxide

public static final java.lang.String MagnesiumOxide
See Also:
Constant Field Values

Nothing

public static final java.lang.String Nothing
See Also:
Constant Field Values

mLibrary

public java.util.Map mLibrary

BaseMaterials

public static java.util.List BaseMaterials

mElementalDensities

public static final double[] mElementalDensities
Constructor Detail

MaterialFactory

public MaterialFactory()
MaterialFactory - A constructor that adds the default materials.


MaterialFactory

public MaterialFactory(java.io.Reader r)
MaterialFactory - Create a material factory from the XML library specified by the Reader r.

Parameters:
r - Reader
Method Detail

canCreate

public static boolean canCreate(Element el)

createMaterial

public static Composition createMaterial(java.lang.String name)
createMaterial - Creates the material based on the type identified as one of the integer constants listed above.

Parameters:
name - String - One of the predefined named constants
Returns:
Material

createPureElement

public static Material createPureElement(Element el)
                                  throws EPQException
createPureElement - Create a simple material based on a pure element and a nominal density for a typical solid manifestation of this element.

Parameters:
el - Element
Returns:
Material
Throws:
EPQException

append

public void append(java.io.Reader r)
append - Append the materials in the XML library specified in the Reader R to the current library.

Parameters:
r - Reader

write

public void write(java.io.Writer wr)
write - Write the current library to the specified Writer as an XML file.

Parameters:
wr - Writer

addMaterial

public void addMaterial(Material mat)
addMaterial - Add a material to the current library.

Parameters:
mat - Material

estimatedDensity

public static double estimatedDensity(Material mat)
estimatedDensity - Compute an estimated density for a mixture of the element specified by the Material. The assumption is that the density of the Material is the weight percent weighted average of the densities of the constituent elements. (Ok! So its just an estimate.)

Parameters:
mat - Material
Returns:
double

getMaterialNames

public java.lang.String[] getMaterialNames()
getMaterialNames - Get a list of the names of the available materials.

Returns:
String[]

getMaterial

public Material getMaterial(java.lang.String name)
getMaterial - Get the Material specified by the given name.

Parameters:
name - String
Returns:
Material