j3d.org Code

org.j3d.geom.particle
Class ParticleList

java.lang.Object
  extended by org.j3d.geom.particle.ParticleList

public class ParticleList
extends java.lang.Object

A special-case linked-list (buffer) implementation for particle systems.

The implementation uses a double linked list. This class is not meant for use outside of this package and derived classes using this package. The class is made public to allow derived packages to access it, but constructor is left package private to prevent external use.

Version:
$Revision: 2.0 $
Author:
Justin Couch

Method Summary
 void add(Particle o)
          Adds the specified element to this list.
 void clear()
          Removes all of the elements from this set.
 void clearCachedObjects()
          Clean up the internal cache and reduce it to zero.
 Particle current()
          Get the current item that is being pointed to in the list.
 boolean isEmpty()
          Check to see if this set contains elements.
 Particle next()
          Fetch the next item in the list from this one and advance the current pointer to it.
 Particle remove()
          Removes the current element from this set if it is present.
 void reset()
          Reset the list pointer to just before the first item in the list.
 int size()
          Returns the number of elements in this set (its cardinality).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
Returns the number of elements in this set (its cardinality).

Returns:
the number of elements in this set

isEmpty

public boolean isEmpty()
Check to see if this set contains elements.

Returns:
true if this set contains no elements.

reset

public void reset()
Reset the list pointer to just before the first item in the list.


next

public Particle next()
Fetch the next item in the list from this one and advance the current pointer to it. If the list is empty, returns null.

Returns:
The next item in the list.

current

public Particle current()
Get the current item that is being pointed to in the list. If the list is empty, returns null.

Returns:
The current item

add

public void add(Particle o)
Adds the specified element to this list. Duplicate entries are allowed, but null values are not. The Add operation places it at the end of the list, just behind the current pointer.

Parameters:
o - element to be added to this set
Throws:
java.lang.NullPointerException - The passed object was null

remove

public Particle remove()
Removes the current element from this set if it is present.

Returns:
The object that was removed

clear

public void clear()
Removes all of the elements from this set.


clearCachedObjects

public void clearCachedObjects()
Clean up the internal cache and reduce it to zero.


j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org