com.browseengine.bobo.util
Class MutableSparseFloatArray

java.lang.Object
  extended by com.browseengine.bobo.util.SparseFloatArray
      extended by com.browseengine.bobo.util.MutableSparseFloatArray

public class MutableSparseFloatArray
extends SparseFloatArray

Author:
spackle

Constructor Summary
MutableSparseFloatArray(float[] floats)
           
 
Method Summary
 void condense()
          An expensive, but necessary, operation to internally conserve space as things grow.
 float[] expand()
          See superexpand().
 float get(int idx)
           
 boolean isDirty()
           
 void set(int idx, float val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableSparseFloatArray

public MutableSparseFloatArray(float[] floats)
Method Detail

isDirty

public boolean isDirty()

get

public float get(int idx)
Overrides:
get in class SparseFloatArray

set

public void set(int idx,
                float val)

expand

public float[] expand()
See superexpand(). Future modifications to this may or may not affect values stored in the returned array. Modifications to the returned array, cause this object instance to become unusable, as from this point on all operations are UNDEFINED.

Overrides:
expand in class SparseFloatArray
Returns:
the expanded primitive float array rep. of this.

condense

public void condense()
An expensive, but necessary, operation to internally conserve space as things grow. Might be useful to call outside of the automatic maintenance, when you expect very few new non-zero values, just changes to existing values, in the future. Uses an expanded form of the float array as scratch space in memory, so be careful that you have enough memory, and try doing this one at a time.



Copyright © 2011. All Rights Reserved.