de.grogra.imp3d.objects
Class SceneTree.Leaf

java.lang.Object
  extended by de.grogra.imp3d.objects.SceneTree.Node
      extended by de.grogra.imp3d.objects.SceneTree.Leaf
Direct Known Subclasses:
SceneTreeWithShader.Leaf
Enclosing class:
SceneTree

public static class SceneTree.Leaf
extends SceneTree.Node

This represents a leaf in a SceneTree. A leaf contains a reference to an object of the graph for which the method SceneTree.acceptLeaf(Object, boolean) has returned true. E.g., think of all nodes having a 3D shape.

Author:
Ole Kniemeyer

Field Summary
 boolean asNode
          Is object a node or an edge?
 java.lang.Object object
          The object of the original graph for which this leaf has been created.
 long pathId
           
 
Fields inherited from class de.grogra.imp3d.objects.SceneTree.Node
next
 
Constructor Summary
SceneTree.Leaf(java.lang.Object object, boolean asNode, long pathId)
           
 
Method Summary
 void accept(SceneTree.Visitor visitor)
           
 boolean getBoolean(BooleanAttribute a)
          Returns the value of attribute a for the object of this leaf.
 byte getByte(ByteAttribute a)
          Returns the value of attribute a for the object of this leaf.
 char getChar(CharAttribute a)
          Returns the value of attribute a for the object of this leaf.
 double getDouble(DoubleAttribute a)
          Returns the value of attribute a for the object of this leaf.
 float getFloat(FloatAttribute a)
          Returns the value of attribute a for the object of this leaf.
 int getInt(IntAttribute a)
          Returns the value of attribute a for the object of this leaf.
 long getLong(LongAttribute a)
          Returns the value of attribute a for the object of this leaf.
 java.lang.Object getObject(ObjectAttribute a)
          Returns the value of attribute a for the object of this leaf.
 java.lang.Object getObject(java.lang.Object placeIn, ObjectAttribute a)
          Returns the value of attribute a for the object of this leaf.
 short getShort(ShortAttribute a)
          Returns the value of attribute a for the object of this leaf.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

asNode

public final boolean asNode
Is object a node or an edge?


object

public final java.lang.Object object
The object of the original graph for which this leaf has been created.


pathId

public final long pathId
Constructor Detail

SceneTree.Leaf

public SceneTree.Leaf(java.lang.Object object,
                      boolean asNode,
                      long pathId)
Method Detail

accept

public final void accept(SceneTree.Visitor visitor)
Specified by:
accept in class SceneTree.Node

getBoolean

public boolean getBoolean(BooleanAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getByte

public byte getByte(ByteAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getChar

public char getChar(CharAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getDouble

public double getDouble(DoubleAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getFloat

public float getFloat(FloatAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getInt

public int getInt(IntAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getLong

public long getLong(LongAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getObject

public java.lang.Object getObject(ObjectAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

getObject

public java.lang.Object getObject(java.lang.Object placeIn,
                                  ObjectAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
placeIn - an instance for the result may be provided by the caller
a - the attribute to read

getShort

public short getShort(ShortAttribute a)
Returns the value of attribute a for the object of this leaf.

Parameters:
a - the attribute to read

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object