|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.microanalysis.EPQLibrary.Composition
public class Composition
Composition - A class implementing a mechanism for describing the elemental composition of a material.
| Field Summary | |
|---|---|
protected int |
mHashCode
|
static int |
STOICIOMETRY
|
static int |
UNDETERMINED
|
static int |
WEIGHT_PCT
|
| Constructor Summary | |
|---|---|
Composition()
Material - Constructs a Material that is equivalent to a pure vacuum. |
|
Composition(Element[] elms,
double[] weightFracs)
Constructs a Composition with the specified elements in the specified weight fractions. |
|
Composition(Element[] elms,
double[] weightFracs,
java.lang.String name)
Constructs a Composition with the specified weight fractions. |
|
| Method Summary | |
|---|---|
void |
addElement(Element elm,
double wgtFrac)
addElement - Add a specified weight fraction of the specified element to the Material. |
void |
addElement(int atomicNo,
double wgtFrac)
addElement - Add a specified weight fraction of the specified element to the Material. |
void |
addElementByStoiciometry(Element elm,
double moleFrac)
addElementUsingMoleFractions - Add a specified mole fraction of the specified element to the material |
protected void |
clear()
clear - Clear all consistuent elements. |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object o)
|
boolean |
containsElement(Element el)
containsElement - Determines whether the Material contains the specified Element. |
void |
defineByMaterialFraction(Composition[] compositions,
double[] matFracs)
defineByMaterialFraction - Define a new material out of certain fractions (by weight) of other materials. |
void |
defineByMoleFraction(Element[] elms,
double[] moleFracs)
defineByMoleFraction - Define a material by the mole fraction of the constituent elements. |
void |
defineByWeightFraction(Element[] elms,
double[] wgtFracs)
defineByWeightFraction - Define the material composition by weigh fraction from the array of atomic numbers and weight fractions. |
void |
defineByWeightFraction(java.util.Map map)
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 (normalized) weight percent and the material density. |
double |
difference(Composition comp)
difference - Returns a measure (not necessarily the 'optimal' measure) of the difference between this Material and the argument Material. |
static java.util.Set |
elementSet(Composition[] compositions)
elementSet - Get the set of all elements in specified array of Materials. |
boolean |
equals(java.lang.Object obj)
equals - Checks whether the value of this object exactly equals the value of the argument object. |
static Composition |
fromXML(java.lang.String comp)
fromXML - The inverse operation for toXML. |
int |
getElementCount()
getElementCount - Returns the number of elements in this material. |
java.util.Set |
getElementSet()
getElementSet - Returns a Set containing the Element objects that make up this Material. |
java.lang.String |
getName()
getName - Gets either the name provided by the user (setName()) or the default name for this material if no name was specified. |
Element |
getNthElementByAtomicFraction(int n)
getNthElementByAtomicFraction - Returns the n-th largest constituent by atomic fraction |
Element |
getNthElementByWeight(int n)
getNthElementByWeight - Returns the n-th largest constituent by weight percent. |
int |
getOptimalRepresentation()
getOptimalRepresentation - Returns one of STOICIOMETRY, WEIGHT_PCT or UNDETERMINED |
int |
hashCode()
|
double |
massAbsorptionCoefficient(double energy)
massAbsorptionCoefficient - Calculates the mass absorption coefficient for this material at the specified energy. |
double |
moleFraction(Element elm)
moleFraction - Returns the moleFraction of the specified element. |
void |
removeElement(Element el)
removeElement - Entirely remove the specified element from the Material. |
protected void |
renormalize()
|
protected void |
replicate(Composition comp)
|
void |
setName(java.lang.String name)
setName - Provide a name for this material. |
double |
stoiciometryAvgAtomicNumber()
Computes the mean atomic number for the elemental constituents comprising this Material based on their stoichiometric fraction. |
double |
sumWeightPercent()
sumWeightPercent - The un-normalized sum of the weight percents of each element. |
java.lang.String |
toString()
|
java.lang.String |
toXML()
toXML - A matched pair with fromXML. |
double |
weightAvgAtomicNumber()
Computes the mean atomic number for the elemental constituents comprising this Material based on their weight fraction. |
double |
weightPercent(Element elm,
boolean normalized)
weightPercent - Computes the weight percent of the specified element in this Material. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNDETERMINED
public static final int WEIGHT_PCT
public static final int STOICIOMETRY
protected transient int mHashCode
| Constructor Detail |
|---|
public Composition()
public Composition(Element[] elms,
double[] weightFracs)
elms - Element[] - The elementsweightFracs - double[] - The associated weight fractions
public Composition(Element[] elms,
double[] weightFracs,
java.lang.String name)
elms - Element[] - The elementsweightFracs - double[] - The associated weight fractionsname - String - User friendly| Method Detail |
|---|
protected void renormalize()
public java.util.Set getElementSet()
public int getElementCount()
public void addElement(int atomicNo,
double wgtFrac)
atomicNo - intwgtFrac - double
public void addElement(Element elm,
double wgtFrac)
elm - ElementwgtFrac - double
public void addElementByStoiciometry(Element elm,
double moleFrac)
elm - ElementmoleFrac - double
public void defineByWeightFraction(Element[] elms,
double[] wgtFracs)
elms - Element[]wgtFracs - double[]public void defineByWeightFraction(java.util.Map map)
map - Map - keys are either Integer, String or Element types, values
are Double
public void defineByMoleFraction(Element[] elms,
double[] moleFracs)
elms - Element[]moleFracs - double[]public static java.util.Set elementSet(Composition[] compositions)
compositions - Composition[]
public double massAbsorptionCoefficient(double energy)
energy - double - In Joules
public void defineByMaterialFraction(Composition[] compositions,
double[] matFracs)
compositions - Material[] - The base materials (ie SiO2, MgO,...)matFracs - double[] - The proportion of eachpublic void removeElement(Element el)
el - Elementpublic boolean containsElement(Element el)
el - Element
protected void clear()
public double moleFraction(Element elm)
elm - Element
public double weightPercent(Element elm,
boolean normalized)
elm - Elementnormalized - boolean
public double stoiciometryAvgAtomicNumber()
public double weightAvgAtomicNumber()
public double sumWeightPercent()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Object
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String descriptiveString(boolean normalize)
normalize - Normalize weight percentages to 100%
public java.lang.String toXML()
public static Composition fromXML(java.lang.String comp)
throws EPQException
comp - String
EPQExceptionpublic Element getNthElementByWeight(int n)
n - - 1 to getElementCount()
public Element getNthElementByAtomicFraction(int n)
n - - 1 to getElementCount()
public void setName(java.lang.String name)
name - Stringpublic java.lang.String getName()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableprotected void replicate(Composition comp)
public java.lang.Object clone()
clone in class java.lang.Objectpublic double difference(Composition comp)
comp - Composition
public int getOptimalRepresentation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||