Examples of LongArrayList


Examples of cern.colt.list.LongArrayList

* This method can be used to iterate over the keys of the receiver.
*
* @return the keys.
*/
public LongArrayList keys() {
  LongArrayList list = new LongArrayList(size());
  keys(list);
  return list;
}
View Full Code Here

Examples of cern.colt.list.LongArrayList

/**
* Returns a string representation of the receiver, containing
* the String representation of each key-value pair, sorted ascending by key.
*/
public String toString() {
  LongArrayList theKeys = keys();
  theKeys.sort();

  StringBuffer buf = new StringBuffer();
  buf.append("[");
  int maxIndex = theKeys.size() - 1;
  for (int i = 0; i <= maxIndex; i++) {
    long key = theKeys.get(i);
      buf.append(String.valueOf(key));
    buf.append("->");
      buf.append(String.valueOf(get(key)));
    if (i < maxIndex) buf.append(", ");
  }
View Full Code Here

Examples of cern.colt.list.LongArrayList

/**
* Returns a string representation of the receiver, containing
* the String representation of each key-value pair, sorted ascending by value, according to natural ordering.
*/
public String toStringByValue() {
  LongArrayList theKeys = new LongArrayList();
  keysSortedByValue(theKeys);

  StringBuffer buf = new StringBuffer();
  buf.append("[");
  int maxIndex = theKeys.size() - 1;
  for (int i = 0; i <= maxIndex; i++) {
    long key = theKeys.get(i);
      buf.append(String.valueOf(key));
    buf.append("->");
      buf.append(String.valueOf(get(key)));
    if (i < maxIndex) buf.append(", ");
  }
View Full Code Here

Examples of cern.colt.list.LongArrayList

* This method can be used to iterate over the keys of the receiver.
*
* @return the keys.
*/
public LongArrayList keys() {
  LongArrayList list = new LongArrayList(size());
  keys(list);
  return list;
}
View Full Code Here

Examples of cern.colt.list.LongArrayList

/**
* Returns a string representation of the receiver, containing
* the String representation of each key-value pair, sorted ascending by key.
*/
public String toString() {
  LongArrayList theKeys = keys();
  theKeys.sort();

  StringBuffer buf = new StringBuffer();
  buf.append("[");
  int maxIndex = theKeys.size() - 1;
  for (int i = 0; i <= maxIndex; i++) {
    long key = theKeys.get(i);
      buf.append(String.valueOf(key));
    buf.append("->");
      buf.append(String.valueOf(get(key)));
    if (i < maxIndex) buf.append(", ");
  }
View Full Code Here

Examples of cern.colt.list.LongArrayList

/**
* Returns a string representation of the receiver, containing
* the String representation of each key-value pair, sorted ascending by value, according to natural ordering.
*/
public String toStringByValue() {
  LongArrayList theKeys = new LongArrayList();
  keysSortedByValue(theKeys);

  StringBuffer buf = new StringBuffer();
  buf.append("[");
  int maxIndex = theKeys.size() - 1;
  for (int i = 0; i <= maxIndex; i++) {
    long key = theKeys.get(i);
      buf.append(String.valueOf(key));
    buf.append("->");
      buf.append(String.valueOf(get(key)));
    if (i < maxIndex) buf.append(", ");
  }
View Full Code Here

Examples of com.carrotsearch.hppc.LongArrayList

    private final LongArrayList mapKeysInCurrentTx;
    private final LongProcedure newTransactionProcedure;

    public LongIDVertexCache() {
        map = new LongObjectOpenHashMap<>(AbstractIDVertexCache.INITIAL_CAPACITY);
        mapKeysInCurrentTx = new LongArrayList(AbstractIDVertexCache.INITIAL_TX_CAPACITY);
        newTransactionProcedure = new VertexConverterLP();
    }
View Full Code Here

Examples of com.gs.collections.impl.list.mutable.primitive.LongArrayList

        return target;
    }

    public MutableLongCollection collectLong(LongFunction<? super V> longFunction)
    {
        return this.collectLong(longFunction,  new LongArrayList(this.size()));
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.LongArrayList

    this.gzipped = gzipped;
    this.phrase = phrase;
   
    initBuffers();

    LongArrayList p = new LongArrayList();
    pointers = new ObjectArrayList<EliasFanoMonotoneLongBigList>( file.length );
    firstDocument = new int[ file.length + 1 ];
    int count = 0;
   
    final ProgressLogger pl = new ProgressLogger( LOGGER );
    pl.expectedUpdates = file.length;
    pl.itemsName = "files";
    pl.start( "Scanning files..." );
   
    // Scan files and retrieve page pointers
    for( String f : file ) {
      p.clear();
      final FastBufferedInputStream fbis = gzipped ? new FastBufferedInputStream( new GZIPInputStream( new FileInputStream( f ) ) ) : new FastBufferedInputStream( new FileInputStream( f ) );
      long position;
      for(;;) {
        position = fbis.position();
        if ( readLine( fbis ) == -1 ) break;
        if ( startsWith( lineBuffer, DOC_MARKER ) ) p.add( position );
        if ( phrase && startsWith( lineBuffer, SENTENCE_MARKER ) ) p.add( position );
      }
     
      count += p.size();
      p.add( fbis.position() );
      fbis.close();
     
      pointers.add( new EliasFanoMonotoneLongBigList( p ) );
      firstDocument[ pointers.size() ] = count;
     
View Full Code Here

Examples of it.unimi.dsi.fastutil.longs.LongArrayList

 
    public void testSemiExternalOffsetListGammaCoding() throws IOException {

    long[] offsets = { 10, 300, 450, 650, 1000, 1290, 1699 };
    LongList listOffsets = new LongArrayList( offsets );

    SemiExternalOffsetList list = new SemiExternalOffsetList( buildInputStream( listOffsets ), 1, listOffsets.size() );
    for ( int i = 0; i < offsets.length; ++i ) {
      assertEquals( ( "test failed for index: " + i ), offsets[ i ], list.getLong( i ) );
    }

    list = new SemiExternalOffsetList( buildInputStream( listOffsets ), 2, listOffsets.size() );
    for ( int i = 0; i < offsets.length; ++i ) {
      assertEquals( ( "test failed for index: " + i ), offsets[ i ], list.getLong( i ) );
    }

    list = new SemiExternalOffsetList( buildInputStream( listOffsets ), 4, listOffsets.size() );
    for ( int i = 0; i < offsets.length; ++i ) {
      assertEquals( ( "test failed for index: " + i ), offsets[ i ], list.getLong( i ) );
    }

    list = new SemiExternalOffsetList( buildInputStream( listOffsets ), 7, listOffsets.size() );
    for ( int i = 0; i < offsets.length; ++i ) {
      assertEquals( ( "test failed for index: " + i ), offsets[ i ], list.getLong( i ) );
    }
   
    list = new SemiExternalOffsetList( buildInputStream( listOffsets ), 8, listOffsets.size() );
    for ( int i = 0; i < offsets.length; ++i ) {
      assertEquals( ( "test failed for index: " + i ), offsets[ i ], list.getLong( i ) );
    }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.