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


Java TLongSet.size方法代码示例

本文整理汇总了Java中gnu.trove.set.TLongSet.size方法的典型用法代码示例。如果您正苦于以下问题:Java TLongSet.size方法的具体用法?Java TLongSet.size怎么用?Java TLongSet.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.set.TLongSet的用法示例。


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

示例1: countUnsupportedNeighbors

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/**
 * Return the number of unsupported blocks connected to any blocks neighboring the given location,
 * which is assumed to contain an air block. The search may bail out early when the count is greater
 * or equal to the given limit, though this cannot be guaranteed.
 */
private int countUnsupportedNeighbors(long pos, int limit) {
    TLongSet supported = new TLongHashSet();
    TLongSet unsupported = new TLongHashSet();

    try {
        for(BlockFace face : NEIGHBORS) {
            if(!this.isSupported(neighborPos(pos, face), supported, unsupported)) {
                if(unsupported.size() >= limit) break;
            }
        }
    }
    catch(MaxSearchVisitsExceeded ex) {
        this.logError(ex);
    }

    return unsupported.size();
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:23,代码来源:FallingBlocksMatchModule.java

示例2: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/** {@inheritDoc) */
public boolean equals( Object other ) {
    if (! ( other instanceof TLongSet ) ) {
        return false;
    }
    final TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            if ( ! that.contains( _set[i] ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:19,代码来源:TLongObjectHashMap.java

示例3: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/** {@inheritDoc} */
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongSet ) ) {
        return false;
    }
    TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            if ( ! that.contains( _set[i] ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:19,代码来源:TLongHashSet.java

示例4: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
public boolean equals( Object other ) {
    if (! ( other instanceof TLongSet ) ) {
        return false;
    }
    final TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            if ( ! that.contains( _set[i] ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:18,代码来源:TLongObjectHashMap.java

示例5: distinct

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
@Override
public Array<T> distinct(int limit) {
    final int capacity = limit < Integer.MAX_VALUE ? limit : 100;
    final TLongSet set = new TLongHashSet(capacity);
    final ArrayBuilder<T> builder = ArrayBuilder.of(capacity, type());
    for (int i=0; i<length(); ++i) {
        final long code = getLong(i);
        if (set.add(code)) {
            final T value = getValue(i);
            builder.add(value);
            if (set.size() >= limit) {
                break;
            }
        }
    }
    return builder.toArray();
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:18,代码来源:SparseArrayWithLongCoding.java

示例6: distinct

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
@Override
public final Array<Long> distinct(int limit) {
    final int capacity = limit < Integer.MAX_VALUE ? limit : 100;
    final TLongSet set = new TLongHashSet(capacity);
    final ArrayBuilder<Long> builder = ArrayBuilder.of(capacity, Long.class);
    for (int i=0; i<length(); ++i) {
        final long value = getLong(i);
        if (set.add(value)) {
            builder.addLong(value);
            if (set.size() >= limit) {
                break;
            }
        }
    }
    return builder.toArray();
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:17,代码来源:SparseArrayOfLongs.java

示例7: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/** {@inheritDoc) */
@Override
public boolean equals( Object other ) {
    if (! ( other instanceof TLongSet ) ) {
        return false;
    }
    final TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            if ( ! that.contains( _set[i] ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TLongObjectHashMap.java

示例8: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongSet ) ) {
        return false;
    }
    TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = _states.length; i-- > 0; ) {
        if ( _states[i] == FULL ) {
            if ( ! that.contains( _set[i] ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TLongHashSet.java

示例9: equals

import gnu.trove.set.TLongSet; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongSet ) ) {
        return false;
    }
    TLongSet that = ( TLongSet ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    for ( int i = capacity(); i-- > 0; ) {
        if ( _states.get(i) == FULL ) {
            if ( ! that.contains( _set.get( i ) ) ) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TLongOffheapHashSet.java


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