public DynamicDateTableColumn( Column column, Concept concept, long[] initialArray ) { super( column, concept, DataType.DATE, initialArray.length ); this.data = new LongsArray( initialArray ); }
@Override public void append( long[] vs ) { append( vs, 0, vs.length ); }
@Override public void append( long v ) { prepForAppend( 1 ); a[n - 1] = v; }
if ( vs == null ) vs = new LongsArray( new long[16], 0 ); dupesNew.put( xyKey, vs ); vs.append( a, i, i + 2 ); singles.append( vs );
@Override public void insert( int i, long v ) { prepForInsert( i, 1 ); a[i] = v; }
@Override public void prepend( long v ) { prepForPrepend( 1 ); a[0] = v; }
@Override public void ensureCapacity( int minCapacity ) { int capacity = a.length; if ( minCapacity > capacity ) { long[] aNew = newArray( capacity, minCapacity ); System.arraycopy( a, 0, aNew, 0, n ); this.a = aNew; } }
@Override public void prepend( long[] vs ) { prepend( vs, 0, vs.length ); }
@Override public void insert( int i, long[] vs ) { insert( i, vs, 0, vs.length ); }
@Override public void set( int i, long[] 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; long[] array = new long[n]; data.copyTo( 0, array, 0, n ); return new SimpleTableColumn( column, concept, type, array, n ); }
if ( vs == null ) vs = new LongsArray( new long[8], 0 ); dupesNew.put( xyKey, vs ); vs.append( v ); singles.append( vs );
@Override public void insert( int i, LongBuffer vs, int c ) { prepForInsert( i, c ); vs.get( a, i, c ); }
@Override public void prepend( LongBuffer vs, int c ) { prepForPrepend( c ); vs.get( a, 0, 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 ) { long[] a = this.a; int capacity = a.length; int n = this.n; int nNew = n + c; if ( nNew > capacity ) { long[] aNew = newArray( capacity, nNew ); System.arraycopy( a, 0, aNew, 0, n ); this.a = aNew; } this.n = nNew; }
@Override public void prepend( Longs vs ) { prepend( vs, 0, vs.n( ) ); }
@Override public void insert( int i, Longs vs ) { insert( i, vs, 0, vs.n( ) ); }
@Override public void addGap( ) { data.append( -1 ); }
public DynamicDateTableColumn( Column column, Concept concept ) { super( column, concept, DataType.DATE, 0 ); this.data = new LongsArray( 10 ); }
@Override public void insert( long value ) { if ( size >= data.n ) data.prepForAppend( ( int ) ( data.n * 0.5 ) ); data.a[size++] = value; } }