org.xith3d.utility.general
Class SparseClusteredMatrix<T>

java.lang.Object
  extended by org.xith3d.utility.general.SparseClusteredMatrix<T>
All Implemented Interfaces:
SparseMatrixInterface<T>

public class SparseClusteredMatrix<T>
extends java.lang.Object
implements SparseMatrixInterface<T>

Implements a sparse matrix interface optimized for data that is likely to be clustered in 2dimensional space, where most of the empty space is surrounding a cluster of elements. :Id: SparseClusteredMatrix.java,v 1.5 2003/02/24 00:13:51 wurp Exp $ :Log: SparseClusteredMatrix.java,v $ Revision 1.5 2003/02/24 00:13:51 wurp Formatted all java code for cvs (strictSunConvention.xml) Revision 1.4 2001/06/20 04:05:42 wurp added log4j. Revision 1.3 2001/01/28 07:52:20 wurp Removed from Id and Log in log comments. Added several new commands to AdminApp Unfortunately, several other changes that I have lost track of. Try diffing this version with the previous one. Revision 1.2 2000/12/16 22:07:33 wurp Added Id and Log to almost all of the files that didn't have it. It's possible that the script screwed something up. I did a commit and an update right before I ran the script, so if a file is screwed up you should be able to fix it by just going to the version before this one.


Constructor Summary
SparseClusteredMatrix()
           
 
Method Summary
 T elementAt(int x, int z)
           
 void elementsWithin(java.util.ArrayList<T> within, java.util.ArrayList<T> without, int x1, int z1, int x2, int z2)
          Fills two ArrayLists, one with elements within certain bounds, the other with the ones that are within the bounds.
 void insertAt(int x, int z, T obj)
          Inserts an object into the matrix at the coordinates specified.
 void removeAt(int x, int z)
          Remove the object at the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseClusteredMatrix

public SparseClusteredMatrix()
Method Detail

insertAt

public void insertAt(int x,
                     int z,
                     T obj)
Inserts an object into the matrix at the coordinates specified.

Specified by:
insertAt in interface SparseMatrixInterface<T>

removeAt

public void removeAt(int x,
                     int z)
Remove the object at the specified location. If there is no object there then nothing happens.

Specified by:
removeAt in interface SparseMatrixInterface<T>

elementAt

public T elementAt(int x,
                   int z)
Specified by:
elementAt in interface SparseMatrixInterface<T>
Returns:
the object at the location specicied. If no object is there then null is returned;

elementsWithin

public void elementsWithin(java.util.ArrayList<T> within,
                           java.util.ArrayList<T> without,
                           int x1,
                           int z1,
                           int x2,
                           int z2)
Fills two ArrayLists, one with elements within certain bounds, the other with the ones that are within the bounds.