public class Material
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
Material()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Material component)
This operation adds a component to this material, effectively marking
this Materials as being a composite of others.
|
java.lang.Object |
clone()
This operation clones the material and creates a completely new material
with the same information.
|
void |
copy(Material material)
This operation copies the content of the incoming material into this
material.
|
boolean |
equals(java.lang.Object other)
This operation overrides Object.equals() to tailor its behavior for
materials.
|
java.util.List<Material> |
getComponents()
This operation returns the list of materials that compose this material.
|
java.lang.String |
getName()
Get the name of the material.
|
java.util.Map<java.lang.String,java.lang.Double> |
getProperties()
This operation returns the full set of properties for this material.
|
double |
getProperty(java.lang.String key)
This operation returns the value of the material property with the given
name.
|
int |
getSize()
Get the size of the Material
|
int |
hashCode()
This operation overrides Object.hashCode to return the proper hash for
Materials.
|
void |
setName(java.lang.String matName)
Set the name of the material
|
void |
setProperty(java.lang.String key,
double value)
This operation sets value of the material property with the given name.
|
void |
setSize(int matSize)
This operation sets the size of the material.
|
public java.lang.String getName()
public void setName(java.lang.String matName)
matName
- The name of the material. There are no restrictions on what it
may be.public int getSize()
public void setSize(int matSize)
matSize
- The size of the material. There are no restrictions on what it
may be. Technically a negative value here would be really
stupid, put it is possible for now.public double getProperty(java.lang.String key)
key
- The key/name of the property whose value should be returnedpublic void setProperty(java.lang.String key, double value)
key
- The key/name of the property whose value should be setvalue
- the propertypublic java.util.Map<java.lang.String,java.lang.Double> getProperties()
public java.util.List<Material> getComponents()
public void addComponent(Material component)
component
- The material that is a component of this material.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The other Object to compare against this onepublic int hashCode()
hashCode
in class java.lang.Object
public void copy(Material material)
material
- the material to copypublic java.lang.Object clone()
clone
in class java.lang.Object