net.sf.j3d.threeD.raytracer.shaders
Class ShaderSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet
net.sf.j3d.threeD.raytracer.shaders.ShaderSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, Set, ColorProducer, Shader, Producer
- Direct Known Subclasses:
- HighlightShader, ReflectionShader, TextureShader
public class ShaderSet
- extends HashSet
- implements Shader
- Author:
- Mike Murray
- See Also:
- Serialized Form
|
Method Summary |
boolean |
add(Object o)
Adds the specified Object to this set and returns true. |
boolean |
addAll(Collection c)
Adds all of the elements stored by the specified Collection object to this set. |
boolean |
equals(Object o)
|
RGB |
evaluate(Object[] args)
Produces a color using the specified arguments. |
RGB |
shade(ShaderParameters p)
Returns an RGB object that represents the shaded color calculated using the values
of the specified ShaderParameters object. |
String |
toString()
|
ShaderSet
public ShaderSet()
add
public boolean add(Object o)
- Adds the specified Object to this set and returns true.
- Specified by:
add in interface Collection- Specified by:
add in interface Set- Overrides:
add in class HashSet
- Throws:
IllegalArgumentException - If the specified Object is not an instance of Shader.
addAll
public boolean addAll(Collection c)
- Adds all of the elements stored by the specified Collection object to this set.
Returns true if the set changed as a result.
- Specified by:
addAll in interface Collection- Specified by:
addAll in interface Set- Overrides:
addAll in class AbstractCollection
- Throws:
IllegalArgumentException - If an element in the specified Collection object is not
an instance of Shader. Note: Elements that have not yet been added
to the set at the time this error occurs will not be added.
NullPointerException - If the specified Collection object is null.
shade
public RGB shade(ShaderParameters p)
- Description copied from interface:
Shader
- Returns an RGB object that represents the shaded color calculated using the values
of the specified ShaderParameters object.
- Specified by:
shade in interface Shader
- Returns:
- The sum of the values given by the shade method for each Shader object stored by this ShaderSet object.
evaluate
public RGB evaluate(Object[] args)
- Description copied from interface:
ColorProducer
- Produces a color using the specified arguments.
- Specified by:
evaluate in interface ColorProducer
- Parameters:
args - Arguments.
- Returns:
- this.shade(args[0]).
- Throws:
IllegalArgumentException - If args[0] is not a ShaderParameters object.
equals
public boolean equals(Object o)
- Specified by:
equals in interface Collection- Specified by:
equals in interface Set- Overrides:
equals in class AbstractSet
- Returns:
- False.
toString
public String toString()
- Overrides:
toString in class AbstractCollection
- Returns:
- "ShaderSet".