public DynamicFloatTableColumn( Column column, Concept concept, float[] initialArray ) { super( column, concept, DataType.FLOAT, initialArray.length ); this.data = new FloatsArray( initialArray ); }
@Override public void insert( float value ) { if ( size >= data.n ) data.prepForAppend( ( int ) ( data.n * 0.5 ) ); data.a[size++] = value; } }
for ( int i = 0; i < triangleCoords.n( ); i += 3*coordsPerRenderTriangleVertex ) float xA = triangleCoords.v( i + 0 ); float yA = triangleCoords.v( i + 1 ); float xB = triangleCoords.v( i + 3 ); float yB = triangleCoords.v( i + 4 ); float xC = triangleCoords.v( i + 6 ); float yC = triangleCoords.v( i + 7 );
@Override public void insert( int i, float v ) { prepForInsert( i, 1 ); a[i] = v; }
@Override public void ensureCapacity( int minCapacity ) { int capacity = a.length; if ( minCapacity > capacity ) { float[] aNew = newArray( capacity, minCapacity ); System.arraycopy( a, 0, aNew, 0, n ); this.a = aNew; } }
@Override public void insert( int i, float[] vs ) { insert( i, vs, 0, vs.length ); }
@Override public void set( int i, float[] vs, int from, int to ) { int c = to - from; ensureCapacity( i + c ); System.arraycopy( vs, from, a, i, c ); n = i + c; }
@Override public TableColumn createTableColumn( Column column, Concept concept, DataType type ) { int n = data.n; float[] array = new float[n]; data.copyTo( 0, array, 0, n ); return new SimpleTableColumn( column, concept, type, array, n ); }
@Override public void insert( int i, float[] vs, int from, int to ) { int c = to - from; prepForInsert( i, c ); System.arraycopy( vs, from, a, i, c ); }
/** * Makes room in this array for new values to be appended. * * When this call returns, the values in <code>this.a</code> on <code>[this.n-c,this.n)</code> * are undefined. Writing meaningful values to these indices is up to the * caller. * * @param c The count of new values that will be appended */ public void prepForAppend( int c ) { float[] a = this.a; int capacity = a.length; int n = this.n; int nNew = n + c; if ( nNew > capacity ) { float[] aNew = newArray( capacity, nNew ); System.arraycopy( a, 0, aNew, 0, n ); this.a = aNew; } this.n = nNew; }
@Override public void insert( int i, FloatBuffer vs ) { insert( i, vs, vs.remaining( ) ); }
@Override public void append( float[] vs ) { append( vs, 0, vs.length ); }
public FloatColumnParser( ) { this.data = new FloatsArray( new float[10], 0 ); }
@Override public void append( float v ) { prepForAppend( 1 ); a[n - 1] = v; }
@Override public void insert( int i, FloatBuffer vs, int c ) { prepForInsert( i, c ); vs.get( a, i, c ); }
/** * Makes room in this array for new values to be prepended. * * When this call returns, the values in <code>this.a</code> on <code>[0,c)</code> * are undefined. Writing meaningful values to these indices is up to the * caller. * * @param c The count of new values that will be inserted */ public void prepForPrepend( int c ) { float[] a = this.a; int capacity = a.length; int n = this.n; int nNew = n + c; if ( nNew > capacity ) { float[] aNew = newArray( capacity, nNew ); System.arraycopy( a, 0, aNew, c, n ); this.a = aNew; } else { System.arraycopy( a, 0, a, c, n ); } this.n = nNew; }
@Override public void insert( int i, Floats vs ) { insert( i, vs, 0, vs.n( ) ); }
public DynamicFloatTableColumn( Column column, Concept concept ) { super( column, concept, DataType.FLOAT, 0 ); this.data = new FloatsArray( 10 ); }