public int[] keys( int[] array ) { synchronized( mutex ) { return m.keys( array ); } }
public int[] keys() { synchronized( mutex ) { return m.keys(); } } public int[] keys( int[] array ) {
public int[] keys() { return m.keys(); } public int[] keys( int[] array ) { return m.keys( array ); }
/** * @return Naturally sorted array of all unique addresses in the graph. */ public int[] getAddresses() { int[] addresses = addressToLocation.keys(); Arrays.sort(addresses); return addresses; }
public int[] keys( int[] array ) { return m.keys( array ); }
@Override public void bindTextures() { if (isDisposed()) { return; } enable(); for (int slot : textureMap.keys()) { Texture texture = textureMap.get(slot); if (texture.isDisposed()) { logger.error("Attempted to bind disposed texture {}", texture); } else { shaderManager.bindTexture(slot, texture); } } }
public static <T> void shiftIntegerMapKeys(int startKey, int shift, TIntObjectMap<T> intToObject) { if (shift == 0) { return; } TIntList keysToShift = new TIntArrayList(intToObject.keys()); // Exclude anything before and including startKey for (int currentKey : keysToShift.toArray()) { if (currentKey <= startKey) { keysToShift.remove(currentKey); } } keysToShift.sort(); if (shift > 0) { // Shifting keys up, so start at the end to avoid overwriting keys. keysToShift.reverse(); } for (int currentKey : keysToShift.toArray()) { T obj = intToObject.get(currentKey); intToObject.remove(currentKey); intToObject.put(currentKey + shift, obj); } } }
@Override public void restart() { TIntObjectMap<JDA> map = this.shards.getMap(); synchronized (map) { Arrays.stream(map.keys()) .sorted() // this ensures shards are started in natural order .forEach(this::restart); } }
@Override public int[] keys() { synchronized( mutex ) { return m.keys(); } } @Override
public int[] keys( int[] array ) { synchronized( mutex ) { return m.keys( array ); } }
public int[] keys() { synchronized( mutex ) { return m.keys(); } } public int[] keys( int[] array ) {
@Override public int[] getChannels() { return positions.keys(); }
public int[] keys() { return m.keys(); } public int[] keys( int[] array ) { return m.keys( array ); }
@Override public int[] keys( int[] array ) { synchronized( mutex ) { return m.keys( array ); } }
/** * Returns a sorted array of occupied indexes. * @return a sorted array of occupied indexes. */ @Override public int[] getSparseIndices() { return reverse(sparseMap.keys()); }
@Override public Iterable<Integer> allKeys() { return Ints.asList(map.keys()); }
/** * Returns an array of input bit indexes indicating the index of the source. * (input vector bit or lateral cell) * @return the sparse array */ public int[] getSparsePotential() { return ArrayUtils.reverse(synapsesBySourceIndex.keys()); }
/** * Returns an array of permanence values * @return */ public double[] getSparsePermanences() { double[] retVal = new double[size]; int[] keys = synapsesBySourceIndex.keys(); for(int x = 0, j = size - 1;x < size;x++, j--) { retVal[j] = synapsesBySourceIndex.get(keys[x]).getPermanence(); } return retVal; }
public static NBTTagList writePositionMap(TIntObjectMap<BlockPos> map) { NBTTagList list = new NBTTagList(); for (int key: map.keys()) { NBTTagCompound tag = new NBTTagCompound(); tag.setInteger("Key", key); writeBlockPos("Value", tag, map.get(key)); list.appendTag(tag); } return list; }
public static NBTTagList writePositionCollection(TIntObjectMap<TIntObjectMap<BlockPos>> mapMap) { NBTTagList idList = new NBTTagList(); for (int mapKey: mapMap.keys()) { NBTTagCompound compound = new NBTTagCompound(); compound.setInteger("Key", mapKey); compound.setTag("Value", writePositionMap(mapMap.get(mapKey))); idList.appendTag(compound); } return idList; }