I don’t know why, but the Enum class’ usefulness has always eluded me. Early attempts just didn’t work out, and I just found ways around using it. Recently, I am writing a program that needs to have a certain status be toggled between a known, fixed list of values-with a default value if nothing else matches. This real world project accelerated my learning how to use Enum effectively-much more so that the urgency to simply learn more about the language (i.e. no practical application of said knowledge).
I also wanted this magical class to determine for itself which value from the aforementioned list the thing that had the Enum in the first place should be. In other words, I wanted the method to do the determination to be inside the Enum class itself. I didn’t know if this was possible, but as I went over all the other ways to accomplish this, any other solution was too costly and inelegant.
To give you an idea of what I am trying to accomplish, consider this Test.java:
public class Test {
public static void main(String[] args) {
EventType etX = EventType.Default;
EventType etY = EventType.Default; String sEvent = "this is just a test!";
System.out.println("etX.getEventType: " + etX.getEventType(sEvent));
etY = etX.getEventType(sEvent);
System.out.println("print etX: " + etX);
System.out.println("print etY: " + etY);
System.out.println("All EventType(s):");
EventType allEventTypes[] = EventType.values();
for (EventType x: allEventTypes){
System.out.println(x);
}
}
}
Sales Engineers almost always telecommute.

This makes our work environment extremely important to us. Ideas to make your workspace more efficient include:
More »
To setup a test scene, start with the scene from this tutorial.
I’ve cleaned it up by removing the side glass examples, and leaving just the center one. Also, a V-Ray Sphere is a nice touch:
This time we’ll be taking a first look at how to introduce exceptional lighting into your scenes with HDRI, or High Dynamic Range Imaging. HDRI is the best way to add lighting to your scene that is as realistic as it gets.
All dynamic range refers to is the fact that even if you are rendering your scene with the widest range of colors, with the best video card, on the best monitor, it will still not have the range of colors and brightness that your eye can detect.
To start, we’ll just insert a plane into the scene and give it a V-Ray material that has its diffuse channel set to a simple checker pattern. I use this pattern because it is the easiest way to see precisely how your objeccts are inter-relating to/with each other and their environment.

Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 