it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap Java Examples

The following examples show how to use it.unimi.dsi.fastutil.ints.Int2BooleanOpenHashMap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChainLockableStrategy.java    From jstarcraft-core with Apache License 2.0 6 votes vote down vote up
public ChainLockableStrategy(Method method) {
    this.configurations = new Int2BooleanOpenHashMap();
    Annotation[][] annotations = method.getParameterAnnotations();
    for (int index = 0; index < annotations.length; index++) {
        for (Annotation annotation : annotations[index]) {
            if (annotation instanceof LockableParameter) {
                this.configurations.put(index, true);
                break;
            }
            if (annotation instanceof LockableElement) {
                // TODO 是否要检查参数的类型为数组/集合/映射
                this.configurations.put(index, false);
                break;
            }
        }
    }
}
 
Example #2
Source File: HashLockableStrategy.java    From jstarcraft-core with Apache License 2.0 6 votes vote down vote up
public HashLockableStrategy(Method method) {
    this.configurations = new Int2BooleanOpenHashMap();
    Annotation[][] annotations = method.getParameterAnnotations();
    for (int index = 0; index < annotations.length; index++) {
        for (Annotation annotation : annotations[index]) {
            if (annotation instanceof LockableParameter) {
                this.configurations.put(index, true);
                break;
            }
            if (annotation instanceof LockableElement) {
                // TODO 是否要检查参数的类型为数组/集合/映射
                this.configurations.put(index, false);
                break;
            }
        }
    }
    this.lockables = new HashLockable[size];
    for (int index = 0; index < size; index++) {
        this.lockables[index] = new HashLockable();
    }
}
 
Example #3
Source File: PrimitiveMaps.java    From tutorials with MIT License 5 votes vote down vote up
private static void fastutilMap() {
    Int2BooleanMap int2BooleanMap = new Int2BooleanOpenHashMap();
    int2BooleanMap.put(1, true);
    int2BooleanMap.put(7, false);
    int2BooleanMap.put(4, true);

    boolean value = int2BooleanMap.get(1);

    Int2BooleanSortedMap int2BooleanSorted = Int2BooleanSortedMaps.EMPTY_MAP;
}