Java 类gnu.trove.iterator.TLongLongIterator 实例源码

项目:bigcat    文件:FragmentSegmentAssignment.java   
@Override
public JsonElement serialize( final FragmentSegmentAssignment src, final Type typeOfSrc, final JsonSerializationContext context )
{
    final JsonObject jsonLut = new JsonObject();
    final TLongLongIterator lutIterator = src.lut.iterator();
    while ( lutIterator.hasNext() )
    {
        lutIterator.advance();
        jsonLut.addProperty( Long.toString( lutIterator.key() ), lutIterator.value() );
    }

    final JsonObject jsonObject = new JsonObject();
    jsonObject.add( "lut", jsonLut );

    return jsonObject;
}
项目:bigcat    文件:FragmentSegmentAssignment.java   
@Override
public JsonElement serialize( final FragmentSegmentAssignment src, final Type typeOfSrc, final JsonSerializationContext context )
{
    final JsonArray fragments = new JsonArray();
    final JsonArray segments = new JsonArray();
    final TLongLongIterator lutIterator = src.lut.iterator();
    while ( lutIterator.hasNext() )
    {
        lutIterator.advance();
        fragments.add( new JsonPrimitive( lutIterator.key() ) );
        segments.add( new JsonPrimitive( lutIterator.value() ) );
    }

    final JsonObject jsonObject = new JsonObject();
    jsonObject.add( "fragments", fragments );
    jsonObject.add( "segments", segments );

    return jsonObject;
}
项目:bigcat    文件:FragmentSegmentAssignment.java   
/**
 * Synchronize the inverse Lookup (segment > [fragments]) with the current
 * forward lookup (fragment > segment)).  The current state of the inverse
 * lookup will be cleared.
 */
protected void syncILut()
{
    ilut.clear();
    final TLongLongIterator lutIterator =  lut.iterator();
    while ( lutIterator.hasNext() )
    {
        lutIterator.advance();
        final long fragmentId = lutIterator.key();
        final long segmentId = lutIterator.value();
        long[] fragments = ilut.get( segmentId );
        if ( fragments == null )
            fragments = new long[]{ fragmentId };
        else
            fragments = ArrayUtils.add( fragments, fragmentId );
        ilut.put( segmentId, fragments);
    }
}
项目:G    文件:TxtGraphUtils.java   
public static void saveLongLongList(String listFile, TLongLongHashMap map) throws FileNotFoundException, IOException {
    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new GZIPOutputStream(new FileOutputStream(listFile))));
    TLongLongIterator iter = map.iterator();
    while (iter.hasNext()) {
        iter.advance();
        bw.append(iter.value() + SEP + iter.key());
        bw.newLine();
    }
    bw.flush();
    bw.close();
}
项目:olca-modules    文件:ProcessImport.java   
private void switchDefaultProviders() {
    log.trace("update default providers");
    dest.getEntityFactory().getCache().evictAll();
    TLongArrayList exchangeIds = new TLongArrayList();
    TLongArrayList providerIds = new TLongArrayList();
    TLongLongIterator it = oldProviderMap.iterator();
    while (it.hasNext()) {
        it.advance();
        long exchangeId = it.key();
        long newId = srcDestIdMap.get(it.value());
        exchangeIds.add(exchangeId);
        providerIds.add(newId);
    }
    updateDefaultProviders(exchangeIds, providerIds);
}
项目:pre-cu    文件:AutoDeltaLongLongMap.java   
public TLongLongIterator iterator() {
    return container.iterator();
}