当前位置: 首页>>代码示例>>Java>>正文


Java TLongFunction类代码示例

本文整理汇总了Java中gnu.trove.function.TLongFunction的典型用法代码示例。如果您正苦于以下问题:Java TLongFunction类的具体用法?Java TLongFunction怎么用?Java TLongFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TLongFunction类属于gnu.trove.function包,在下文中一共展示了TLongFunction类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTransformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
public void testTransformValues() {
    int element_count = 20;
    TIntLongMap map = new TIntLongHashMap();
    for ( int i = 1; i <= element_count; i++ ) {
        map.put( i, i );
    }

    class TransformValues implements TLongFunction {
        @Override
        public long execute( long value ) {
            return value * value;
        }
    }

    TransformValues foreach = new TransformValues();
    map.transformValues( foreach );
    for ( int i = 1; i <= element_count; i++ ) {
        assertEquals( i * i, map.get( i ) );
    }
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:21,代码来源:TPrimitivePrimitiveHashMapTest.java

示例2: testTransformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
public void testTransformValues() {
    int element_count = 20;
    TIntLongMap map = new TIntLongOffheapHashMap();
    for ( int i = 1; i <= element_count; i++ ) {
        map.put( i, i );
    }

    class TransformValues implements TLongFunction {
        @Override
        public long execute( long value ) {
            return value * value;
        }
    }

    TransformValues foreach = new TransformValues();
    map.transformValues( foreach );
    for ( int i = 1; i <= element_count; i++ ) {
        assertEquals( i * i, map.get( i ) );
    }
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:21,代码来源:TPrimitivePrimitiveOffheapHashMapTest.java

示例3: testTransformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
public void testTransformValues() {
    int element_count = 20;
    TIntLongMap map = new TIntLongHashMap();
    for ( int i = 1; i <= element_count; i++ ) {
        map.put( i, i );
    }

    class TransformValues implements TLongFunction {
        public long execute( long value ) {
            return value * value;
        }
    }

    TransformValues foreach = new TransformValues();
    map.transformValues( foreach );
    for ( int i = 1; i <= element_count; i++ ) {
        assertEquals( i * i, map.get( i ) );
    }
}
 
开发者ID:leventov,项目名称:trove-over-koloboke-compile,代码行数:20,代码来源:TPrimitivePrimitiveHashMapTest.java

示例4: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/** {@inheritDoc} */
    public void transformValues( TLongFunction function ) {
//        byte[] states = _states;
//        long[] values = _values;
//        for ( int i = values.length; i-- > 0; ) {
//            if ( stateAt(i) == FULL ) {
//                valueAt(i) = function.execute( valueAt(i) );
//            }
//        }
    	int len = unsafe.getInt(addresses[0][0]);
    	for ( int i = len; i-- > 0; ) {
            if ( stateAt(i) == FULL ) {
                valueAt(i, function.execute( valueAt(i)));
            }
        }
    	
    }
 
开发者ID:nickman,项目名称:UnsafeAdapter,代码行数:18,代码来源:UnsafeTLongLongHashMap.java

示例5: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/** {@inheritDoc} */
public void transformValues( TLongFunction function ) {
    byte[] states = _states;
    long[] values = _values;
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            values[i] = function.execute( values[i] );
        }
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TByteLongHashMap.java

示例6: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/**
 * Transform the values in this map using <tt>function</tt>.
 *
 * @param function a <code>TLongFunction</code> value
 */
public void transformValues( TLongFunction function ) {
    Object[] keys = _set;
    long[] values = _values;
    for ( int i = values.length; i-- > 0; ) {
        if ( keys[i] != null && keys[i] != REMOVED ) {
            values[i] = function.execute( values[i] );
        }
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:15,代码来源:TObjectLongHashMap.java

示例7: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/** {@inheritDoc} */
public void transformValues(TLongFunction function) {
    for (TLongLink l = head; got(l);) {
        //
        l.setValue(function.execute(l.getValue()));
        //
        l = l.getNext();
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TLongLinkedList.java

示例8: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void transformValues( TLongFunction function ) {
    byte[] states = _states;
    long[] values = _values;
    for ( int i = values.length; i-- > 0; ) {
        if ( states[i] == FULL ) {
            values[i] = function.execute( values[i] );
        }
    }
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TByteLongHashMap.java

示例9: transformValues

import gnu.trove.function.TLongFunction; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void transformValues( TLongFunction function ) {
    TByteOffheapArray states = _states;
    TLongOffheapArray values = _values;
    for ( int i = capacity(); i-- > 0; ) {
        if ( states.get( i ) == FULL ) {
            values.put( i, function.execute( values.get( i ) ) );
        }
    }
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TFloatLongOffheapHashMap.java


注:本文中的gnu.trove.function.TLongFunction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。