Search in sources :

Example 1 with ImmutableListMultimap

use of com.google.common.collect.ImmutableListMultimap in project buck by facebook.

the class IjModuleGraph method createModules.

/**
   * Create all the modules we are capable of representing in IntelliJ from the supplied graph.
   *
   * @param targetGraph graph whose nodes will be converted to {@link IjModule}s.
   * @return map which for every BuildTarget points to the corresponding IjModule. Multiple
   * BuildTarget can point to one IjModule (many:one mapping), the BuildTargets which
   * can't be prepresented in IntelliJ are missing from this mapping.
   */
private static ImmutableMap<BuildTarget, IjModule> createModules(IjProjectConfig projectConfig, TargetGraph targetGraph, IjModuleFactory moduleFactory, final int minimumPathDepth) {
    final BlockedPathNode blockedPathTree = createAggregationHaltPoints(projectConfig, targetGraph);
    ImmutableListMultimap<Path, TargetNode<?, ?>> baseTargetPathMultimap = targetGraph.getNodes().stream().filter(input -> IjModuleFactory.SUPPORTED_MODULE_DESCRIPTION_CLASSES.contains(input.getDescription().getClass())).collect(MoreCollectors.toImmutableListMultimap(targetNode -> {
        Path path;
        Path basePath = targetNode.getBuildTarget().getBasePath();
        if (targetNode.getConstructorArg() instanceof AndroidResourceDescription.Arg) {
            path = basePath;
        } else {
            path = simplifyPath(basePath, minimumPathDepth, blockedPathTree);
        }
        return path;
    }, targetNode -> targetNode));
    ImmutableMap.Builder<BuildTarget, IjModule> moduleMapBuilder = new ImmutableMap.Builder<>();
    for (Path baseTargetPath : baseTargetPathMultimap.keySet()) {
        ImmutableSet<TargetNode<?, ?>> targets = ImmutableSet.copyOf(baseTargetPathMultimap.get(baseTargetPath));
        IjModule module = moduleFactory.createModule(baseTargetPath, targets);
        for (TargetNode<?, ?> target : targets) {
            moduleMapBuilder.put(target.getBuildTarget(), module);
        }
    }
    return moduleMapBuilder.build();
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) TargetGraph(com.facebook.buck.rules.TargetGraph) TargetNode(com.facebook.buck.rules.TargetNode) Set(java.util.Set) HashMap(java.util.HashMap) JavacOptions(com.facebook.buck.jvm.java.JavacOptions) BuildTarget(com.facebook.buck.model.BuildTarget) AndroidResourceDescription(com.facebook.buck.android.AndroidResourceDescription) HashSet(java.util.HashSet) Objects(java.util.Objects) Stream(java.util.stream.Stream) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) Map(java.util.Map) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) JavaLibraryDescription(com.facebook.buck.jvm.java.JavaLibraryDescription) Path(java.nio.file.Path) Nullable(javax.annotation.Nullable) MoreCollectors(com.facebook.buck.util.MoreCollectors) Path(java.nio.file.Path) TargetNode(com.facebook.buck.rules.TargetNode) ImmutableMap(com.google.common.collect.ImmutableMap) AndroidResourceDescription(com.facebook.buck.android.AndroidResourceDescription) BuildTarget(com.facebook.buck.model.BuildTarget)

Example 2 with ImmutableListMultimap

use of com.google.common.collect.ImmutableListMultimap in project immutables by immutables.

the class SourceOrdering method getAllAccessorsProvider.

/**
   * While we have {@link SourceOrdering}, there's still a problem: We have inheritance hierarchy
   * and
   * we want to have all defined or inherited accessors returned as members of target type, like
   * {@link Elements#getAllMembers(TypeElement)}, but we need to have them properly and stably
   * sorted.
   * This implementation doesn't try to correctly resolve order for accessors inherited from
   * different supertypes(interfaces), just something that stable and reasonable wrt source ordering
   * without handling complex cases.
   * @param elements the elements utility
   * @param types the types utility
   * @param type the type to traverse
   * @return provider of all accessors in source order and mapping
   */
public static AccessorProvider getAllAccessorsProvider(final Elements elements, final Types types, final TypeElement type) {
    class CollectedOrdering extends Ordering<Element> {

        class Intratype {

            Ordering<String> ordering;

            int rank;
        }

        final Map<String, Intratype> accessorOrderings = Maps.newLinkedHashMap();

        final List<TypeElement> linearizedTypes = Lists.newArrayList();

        final Predicate<String> accessorNotYetInOrderings = Predicates.not(Predicates.in(accessorOrderings.keySet()));

        final ArrayListMultimap<String, TypeElement> accessorMapping = ArrayListMultimap.create();

        CollectedOrdering() {
            traverse(type);
            traverseObjectForInterface();
        }

        private void traverseObjectForInterface() {
            if (type.getKind() == ElementKind.INTERFACE) {
                traverse(elements.getTypeElement(Object.class.getName()));
            }
        }

        void traverse(@Nullable TypeElement element) {
            if (element == null || isJavaLangObject(element)) {
                return;
            }
            collectEnclosing(element);
            traverse(asTypeElement(element.getSuperclass()));
            for (TypeMirror implementedInterface : element.getInterfaces()) {
                traverse(asTypeElement(implementedInterface));
            }
        }

        @Nullable
        TypeElement asTypeElement(TypeMirror type) {
            if (type.getKind() == TypeKind.DECLARED) {
                return (TypeElement) ((DeclaredType) type).asElement();
            }
            return null;
        }

        void collectEnclosing(TypeElement type) {
            FluentIterable<String> accessorsInType = FluentIterable.from(SourceOrdering.getEnclosedElements(type)).filter(IsParameterlessNonstaticNonobject.PREDICATE).transform(ToSimpleName.FUNCTION);
            for (String accessor : accessorsInType) {
                accessorMapping.put(accessor, type);
            }
            List<String> accessors = accessorsInType.filter(accessorNotYetInOrderings).toList();
            Intratype intratype = new Intratype();
            intratype.rank = linearizedTypes.size();
            intratype.ordering = Ordering.explicit(accessors);
            for (String name : accessors) {
                accessorOrderings.put(name, intratype);
            }
            linearizedTypes.add(type);
        }

        @Override
        public int compare(Element left, Element right) {
            String leftKey = ToSimpleName.FUNCTION.apply(left);
            String rightKey = ToSimpleName.FUNCTION.apply(right);
            Intratype leftIntratype = accessorOrderings.get(leftKey);
            Intratype rightIntratype = accessorOrderings.get(rightKey);
            if (leftIntratype == null || rightIntratype == null) {
                // FIXME figure out why it happens (null)
                return Boolean.compare(leftIntratype == null, rightIntratype == null);
            }
            return leftIntratype == rightIntratype ? leftIntratype.ordering.compare(leftKey, rightKey) : Integer.compare(leftIntratype.rank, rightIntratype.rank);
        }
    }
    final CollectedOrdering ordering = new CollectedOrdering();
    final ImmutableList<ExecutableElement> sortedList = ordering.immutableSortedCopy(disambiguateMethods(ElementFilter.methodsIn(elements.getAllMembers(type))));
    return new AccessorProvider() {

        ImmutableListMultimap<String, TypeElement> accessorMapping = ImmutableListMultimap.copyOf(ordering.accessorMapping);

        @Override
        public ImmutableListMultimap<String, TypeElement> accessorMapping() {
            return accessorMapping;
        }

        @Override
        public ImmutableList<ExecutableElement> get() {
            return sortedList;
        }
    };
}
Also used : TypeElement(javax.lang.model.element.TypeElement) TypeElement(javax.lang.model.element.TypeElement) ExecutableElement(javax.lang.model.element.ExecutableElement) Element(javax.lang.model.element.Element) ExecutableElement(javax.lang.model.element.ExecutableElement) Predicate(com.google.common.base.Predicate) TypeMirror(javax.lang.model.type.TypeMirror) Ordering(com.google.common.collect.Ordering) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) ArrayListMultimap(com.google.common.collect.ArrayListMultimap) Map(java.util.Map) IdentityHashMap(java.util.IdentityHashMap) Nullable(javax.annotation.Nullable)

Example 3 with ImmutableListMultimap

use of com.google.common.collect.ImmutableListMultimap in project presto by prestodb.

the class InCodeGenerator method generateExpression.

@Override
public BytecodeNode generateExpression(Signature signature, BytecodeGeneratorContext generatorContext, Type returnType, List<RowExpression> arguments) {
    BytecodeNode value = generatorContext.generate(arguments.get(0));
    List<RowExpression> values = arguments.subList(1, arguments.size());
    ImmutableList.Builder<BytecodeNode> valuesBytecode = ImmutableList.builder();
    for (int i = 1; i < arguments.size(); i++) {
        BytecodeNode testNode = generatorContext.generate(arguments.get(i));
        valuesBytecode.add(testNode);
    }
    Type type = arguments.get(0).getType();
    Class<?> javaType = type.getJavaType();
    SwitchGenerationCase switchGenerationCase = checkSwitchGenerationCase(type, values);
    Signature hashCodeSignature = internalOperator(HASH_CODE, BIGINT, ImmutableList.of(type));
    MethodHandle hashCodeFunction = generatorContext.getRegistry().getScalarFunctionImplementation(hashCodeSignature).getMethodHandle();
    ImmutableListMultimap.Builder<Integer, BytecodeNode> hashBucketsBuilder = ImmutableListMultimap.builder();
    ImmutableList.Builder<BytecodeNode> defaultBucket = ImmutableList.builder();
    ImmutableSet.Builder<Object> constantValuesBuilder = ImmutableSet.builder();
    for (RowExpression testValue : values) {
        BytecodeNode testBytecode = generatorContext.generate(testValue);
        if (testValue instanceof ConstantExpression && ((ConstantExpression) testValue).getValue() != null) {
            ConstantExpression constant = (ConstantExpression) testValue;
            Object object = constant.getValue();
            switch(switchGenerationCase) {
                case DIRECT_SWITCH:
                case SET_CONTAINS:
                    constantValuesBuilder.add(object);
                    break;
                case HASH_SWITCH:
                    try {
                        int hashCode = toIntExact(Long.hashCode((Long) hashCodeFunction.invoke(object)));
                        hashBucketsBuilder.put(hashCode, testBytecode);
                    } catch (Throwable throwable) {
                        throw new IllegalArgumentException("Error processing IN statement: error calculating hash code for " + object, throwable);
                    }
                    break;
                default:
                    throw new IllegalArgumentException("Not supported switch generation case: " + switchGenerationCase);
            }
        } else {
            defaultBucket.add(testBytecode);
        }
    }
    ImmutableListMultimap<Integer, BytecodeNode> hashBuckets = hashBucketsBuilder.build();
    ImmutableSet<Object> constantValues = constantValuesBuilder.build();
    LabelNode end = new LabelNode("end");
    LabelNode match = new LabelNode("match");
    LabelNode noMatch = new LabelNode("noMatch");
    LabelNode defaultLabel = new LabelNode("default");
    Scope scope = generatorContext.getScope();
    BytecodeNode switchBlock;
    BytecodeBlock switchCaseBlocks = new BytecodeBlock();
    LookupSwitch.LookupSwitchBuilder switchBuilder = lookupSwitchBuilder();
    switch(switchGenerationCase) {
        case DIRECT_SWITCH:
            // For these types, it's safe to not use presto HASH_CODE and EQUAL operator.
            for (Object constantValue : constantValues) {
                switchBuilder.addCase(toIntExact((Long) constantValue), match);
            }
            switchBuilder.defaultCase(defaultLabel);
            switchBlock = new BytecodeBlock().comment("lookupSwitch(<stackValue>))").dup(javaType).append(new IfStatement().condition(new BytecodeBlock().dup(javaType).invokeStatic(InCodeGenerator.class, "isInteger", boolean.class, long.class)).ifFalse(new BytecodeBlock().pop(javaType).gotoLabel(defaultLabel))).longToInt().append(switchBuilder.build());
            break;
        case HASH_SWITCH:
            for (Map.Entry<Integer, Collection<BytecodeNode>> bucket : hashBuckets.asMap().entrySet()) {
                LabelNode label = new LabelNode("inHash" + bucket.getKey());
                switchBuilder.addCase(bucket.getKey(), label);
                Collection<BytecodeNode> testValues = bucket.getValue();
                BytecodeBlock caseBlock = buildInCase(generatorContext, scope, type, label, match, defaultLabel, testValues, false);
                switchCaseBlocks.append(caseBlock.setDescription("case " + bucket.getKey()));
            }
            switchBuilder.defaultCase(defaultLabel);
            Binding hashCodeBinding = generatorContext.getCallSiteBinder().bind(hashCodeFunction);
            switchBlock = new BytecodeBlock().comment("lookupSwitch(hashCode(<stackValue>))").dup(javaType).append(invoke(hashCodeBinding, hashCodeSignature)).invokeStatic(Long.class, "hashCode", int.class, long.class).append(switchBuilder.build()).append(switchCaseBlocks);
            break;
        case SET_CONTAINS:
            Set<?> constantValuesSet = toFastutilHashSet(constantValues, type, registry);
            Binding constant = generatorContext.getCallSiteBinder().bind(constantValuesSet, constantValuesSet.getClass());
            switchBlock = new BytecodeBlock().comment("inListSet.contains(<stackValue>)").append(new IfStatement().condition(new BytecodeBlock().comment("value").dup(javaType).comment("set").append(loadConstant(constant)).invokeStatic(FastutilSetHelper.class, "in", boolean.class, javaType.isPrimitive() ? javaType : Object.class, constantValuesSet.getClass())).ifTrue(jump(match)));
            break;
        default:
            throw new IllegalArgumentException("Not supported switch generation case: " + switchGenerationCase);
    }
    BytecodeBlock defaultCaseBlock = buildInCase(generatorContext, scope, type, defaultLabel, match, noMatch, defaultBucket.build(), true).setDescription("default");
    BytecodeBlock block = new BytecodeBlock().comment("IN").append(value).append(ifWasNullPopAndGoto(scope, end, boolean.class, javaType)).append(switchBlock).append(defaultCaseBlock);
    BytecodeBlock matchBlock = new BytecodeBlock().setDescription("match").visitLabel(match).pop(javaType).append(generatorContext.wasNull().set(constantFalse())).push(true).gotoLabel(end);
    block.append(matchBlock);
    BytecodeBlock noMatchBlock = new BytecodeBlock().setDescription("noMatch").visitLabel(noMatch).pop(javaType).push(false).gotoLabel(end);
    block.append(noMatchBlock);
    block.visitLabel(end);
    return block;
}
Also used : LabelNode(com.facebook.presto.bytecode.instruction.LabelNode) ImmutableList(com.google.common.collect.ImmutableList) ConstantExpression(com.facebook.presto.sql.relational.ConstantExpression) IfStatement(com.facebook.presto.bytecode.control.IfStatement) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) BytecodeNode(com.facebook.presto.bytecode.BytecodeNode) BytecodeBlock(com.facebook.presto.bytecode.BytecodeBlock) RowExpression(com.facebook.presto.sql.relational.RowExpression) IntegerType(com.facebook.presto.spi.type.IntegerType) DateType(com.facebook.presto.spi.type.DateType) Type(com.facebook.presto.spi.type.Type) BigintType(com.facebook.presto.spi.type.BigintType) LookupSwitch(com.facebook.presto.bytecode.control.LookupSwitch) Scope(com.facebook.presto.bytecode.Scope) Signature(com.facebook.presto.metadata.Signature) Collection(java.util.Collection) Map(java.util.Map) MethodHandle(java.lang.invoke.MethodHandle)

Example 4 with ImmutableListMultimap

use of com.google.common.collect.ImmutableListMultimap in project wombat by PLOS.

the class TemplateModelUtil method getAsMultimap.

static ImmutableListMultimap<String, TemplateModel> getAsMultimap(TemplateModel value) throws TemplateModelException {
    if (value == null)
        return ImmutableListMultimap.of();
    if (value instanceof TemplateHashModelEx) {
        TemplateHashModelEx ftlHash = (TemplateHashModelEx) value;
        ImmutableListMultimap.Builder<String, TemplateModel> builder = ImmutableListMultimap.builder();
        for (TemplateModelIterator iterator = ftlHash.keys().iterator(); iterator.hasNext(); ) {
            String key = iterator.next().toString();
            TemplateModel model = ftlHash.get(key);
            if (model instanceof TemplateSequenceModel) {
                TemplateSequenceModel sequenceModel = (TemplateSequenceModel) model;
                int size = sequenceModel.size();
                for (int i = 0; i < size; i++) {
                    builder.put(key, sequenceModel.get(i));
                }
            } else {
                builder.put(key, model);
            }
        }
        return builder.build();
    }
    throw new TemplateModelException("Hash type expected");
}
Also used : TemplateModelException(freemarker.template.TemplateModelException) TemplateSequenceModel(freemarker.template.TemplateSequenceModel) TemplateModelIterator(freemarker.template.TemplateModelIterator) TemplateHashModelEx(freemarker.template.TemplateHashModelEx) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) TemplateModel(freemarker.template.TemplateModel)

Example 5 with ImmutableListMultimap

use of com.google.common.collect.ImmutableListMultimap in project LanternServer by LanternPowered.

the class LanternChunkManager method loadTickets.

public void loadTickets() throws IOException {
    final Multimap<String, LanternLoadingTicket> tickets = LanternLoadingTicketIO.load(this.worldFolder, this, this.chunkLoadService);
    final Iterator<Entry<String, LanternLoadingTicket>> it = tickets.entries().iterator();
    final CauseStack causeStack = CauseStack.current();
    while (it.hasNext()) {
        final LanternLoadingTicket ticket = it.next().getValue();
        if (ticket instanceof LanternEntityLoadingTicket) {
            final LanternEntityLoadingTicket ticket0 = (LanternEntityLoadingTicket) ticket;
            final EntityReference ref = ticket0.getEntityReference().orElse(null);
            if (ref != null) {
                causeStack.pushCause(ticket0);
                final LanternChunk chunk = getOrCreateChunk(ref.getChunkCoords(), causeStack, true, true);
                causeStack.popCause();
                final Entity entity = chunk.getEntity(ref.getUniqueId()).orElse(null);
                if (entity != null) {
                    ticket0.bindToEntity(entity);
                } else {
                    // The entity is gone?
                    it.remove();
                }
            } else {
                // The entity is gone?
                it.remove();
            }
        }
    }
    for (Entry<String, Collection<LanternLoadingTicket>> entry : tickets.asMap().entrySet()) {
        final Collection<ChunkTicketManager.Callback> callbacks = this.chunkLoadService.getCallbacks().get(entry.getKey());
        // These maps will be loaded lazily
        ImmutableListMultimap<UUID, LoadingTicket> playerLoadedTickets = null;
        ImmutableList<LoadingTicket> nonPlayerLoadedTickets = null;
        final Set<LoadingTicket> resultPlayerLoadedTickets = entry.getValue().stream().filter(ticket -> ticket instanceof PlayerLoadingTicket).collect(Collectors.toSet());
        final Set<LoadingTicket> resultNonPlayerLoadedTickets = entry.getValue().stream().filter(ticket -> !(ticket instanceof PlayerLoadingTicket)).collect(Collectors.toSet());
        final int maxTickets = this.chunkLoadService.getMaxTicketsById(entry.getKey());
        for (ChunkTicketManager.Callback callback : callbacks) {
            if (callback instanceof ChunkTicketManager.OrderedCallback) {
                if (nonPlayerLoadedTickets == null) {
                    nonPlayerLoadedTickets = ImmutableList.copyOf(resultNonPlayerLoadedTickets);
                    resultNonPlayerLoadedTickets.clear();
                }
                final List<LoadingTicket> result = ((ChunkTicketManager.OrderedCallback) callback).onLoaded(nonPlayerLoadedTickets, this.world, maxTickets);
                checkNotNull(result, "The OrderedCallback#onLoaded method may not return null, " + "error caused by (plugin=%s, clazz=%s)", entry.getKey(), callback.getClass().getName());
                resultNonPlayerLoadedTickets.addAll(result);
            }
            if (callback instanceof ChunkTicketManager.PlayerOrderedCallback) {
                if (playerLoadedTickets == null) {
                    final ImmutableListMultimap.Builder<UUID, LoadingTicket> mapBuilder = ImmutableListMultimap.builder();
                    resultPlayerLoadedTickets.forEach(ticket -> mapBuilder.put(((PlayerLoadingTicket) ticket).getPlayerUniqueId(), ticket));
                    resultPlayerLoadedTickets.clear();
                    playerLoadedTickets = mapBuilder.build();
                }
                final ListMultimap<UUID, LoadingTicket> result = ((ChunkTicketManager.PlayerOrderedCallback) callback).onPlayerLoaded(playerLoadedTickets, this.world);
                checkNotNull(result, "The PlayerOrderedCallback#onPlayerLoaded method may not return null, " + "error caused by (plugin=%s, clazz=%s)", entry.getKey(), callback.getClass().getName());
                resultPlayerLoadedTickets.addAll(result.values());
            }
        }
        final List<LoadingTicket> resultLoadedTickets = new ArrayList<>();
        resultLoadedTickets.addAll(resultPlayerLoadedTickets);
        resultLoadedTickets.addAll(resultNonPlayerLoadedTickets);
        // Lets see how many plugins attempted to add loading tickets
        final int sizeA = resultLoadedTickets.size();
        resultLoadedTickets.retainAll(entry.getValue());
        final int sizeB = resultLoadedTickets.size();
        if (sizeA != sizeB) {
            Lantern.getLogger().warn("The plugin {} attempted to add LoadingTicket's that were previously not present.", entry.getKey());
        }
        // Remove all the tickets that are already released
        resultLoadedTickets.removeIf(ticket -> ((ChunkLoadingTicket) ticket).isReleased());
        if (resultLoadedTickets.size() > maxTickets) {
            Lantern.getLogger().warn("The plugin {} has too many open chunk loading tickets {}. " + "Excess will be dropped", entry.getKey(), resultLoadedTickets.size());
            resultLoadedTickets.subList(maxTickets, resultLoadedTickets.size()).clear();
        }
        // Release all the tickets that were no longer usable
        final List<LoadingTicket> removedTickets = new ArrayList<>(entry.getValue());
        removedTickets.removeAll(resultLoadedTickets);
        removedTickets.forEach(LoadingTicket::release);
        final ImmutableList<LoadingTicket> loadedTickets = ImmutableList.copyOf(resultLoadedTickets);
        for (ChunkTicketManager.Callback callback : callbacks) {
            callback.onLoaded(loadedTickets, this.world);
        }
    }
}
Also used : ImmutableBlockVolume(org.spongepowered.api.world.extent.ImmutableBlockVolume) GenerationPopulator(org.spongepowered.api.world.gen.GenerationPopulator) Arrays(java.util.Arrays) ListMultimap(com.google.common.collect.ListMultimap) ChunkSection(org.lanternpowered.server.world.chunk.LanternChunk.ChunkSection) Inject(com.google.inject.Inject) ChunkTicketManager(org.spongepowered.api.world.ChunkTicketManager) ShortArrayMutableBiomeBuffer(org.lanternpowered.server.util.gen.biome.ShortArrayMutableBiomeBuffer) BiomeGenerationSettings(org.spongepowered.api.world.biome.BiomeGenerationSettings) Random(java.util.Random) BiomeTypes(org.spongepowered.api.world.biome.BiomeTypes) WorldConfig(org.lanternpowered.server.config.world.WorldConfig) BiomeGenerator(org.spongepowered.api.world.gen.BiomeGenerator) EventManager(org.spongepowered.api.event.EventManager) Future(java.util.concurrent.Future) Populator(org.spongepowered.api.world.gen.Populator) DirectoryKeys(org.lanternpowered.server.game.DirectoryKeys) ChunkIOService(org.lanternpowered.server.data.io.ChunkIOService) Map(java.util.Map) BlockRegistryModule(org.lanternpowered.server.game.registry.type.block.BlockRegistryModule) ShortArrayMutableBlockBuffer(org.lanternpowered.server.util.gen.block.ShortArrayMutableBlockBuffer) EntityLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.EntityLoadingTicket) VirtualBiomeType(org.spongepowered.api.world.biome.VirtualBiomeType) Path(java.nio.file.Path) ObjectArrayImmutableBiomeBuffer(org.lanternpowered.server.util.gen.biome.ObjectArrayImmutableBiomeBuffer) PlayerLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.PlayerLoadingTicket) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) CHUNK_SECTIONS(org.lanternpowered.server.world.chunk.LanternChunk.CHUNK_SECTIONS) ImmutableSet(com.google.common.collect.ImmutableSet) CHUNK_AREA(org.lanternpowered.server.world.chunk.LanternChunk.CHUNK_AREA) Extent(org.spongepowered.api.world.extent.Extent) BlockTypes(org.spongepowered.api.block.BlockTypes) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Sponge(org.spongepowered.api.Sponge) Set(java.util.Set) UUID(java.util.UUID) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) LanternGame(org.lanternpowered.server.game.LanternGame) BlockState(org.spongepowered.api.block.BlockState) FastSoftThreadLocal(org.lanternpowered.server.util.concurrent.FastSoftThreadLocal) WorldGenerator(org.spongepowered.api.world.gen.WorldGenerator) Cause(org.spongepowered.api.event.cause.Cause) List(java.util.List) SoftBufferExtentViewDownsize(org.lanternpowered.server.world.extent.SoftBufferExtentViewDownsize) Lantern(org.lanternpowered.server.game.Lantern) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) Entry(java.util.Map.Entry) Optional(java.util.Optional) Queue(java.util.Queue) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) InternalPluginsInfo(org.lanternpowered.server.plugin.InternalPluginsInfo) AtomicShortArrayMutableBlockBuffer(org.lanternpowered.server.util.gen.block.AtomicShortArrayMutableBlockBuffer) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) AbstractMutableBlockBuffer(org.lanternpowered.server.util.gen.block.AbstractMutableBlockBuffer) MutableBlockVolume(org.spongepowered.api.world.extent.MutableBlockVolume) BiomeType(org.spongepowered.api.world.biome.BiomeType) Callable(java.util.concurrent.Callable) Multimap(com.google.common.collect.Multimap) CHUNK_SECTION_VOLUME(org.lanternpowered.server.world.chunk.LanternChunk.CHUNK_SECTION_VOLUME) ImmutableBiomeVolume(org.spongepowered.api.world.extent.ImmutableBiomeVolume) ArrayList(java.util.ArrayList) Vector2i(com.flowpowered.math.vector.Vector2i) HashSet(java.util.HashSet) CHUNK_SECTION_SIZE(org.lanternpowered.server.world.chunk.LanternChunk.CHUNK_SECTION_SIZE) ThreadHelper(org.lanternpowered.server.util.ThreadHelper) CauseStack(org.lanternpowered.server.event.CauseStack) ImmutableList(com.google.common.collect.ImmutableList) ShortArrayImmutableBlockBuffer(org.lanternpowered.server.util.gen.block.ShortArrayImmutableBlockBuffer) LanternWorld(org.lanternpowered.server.world.LanternWorld) CHUNK_BIOME_VOLUME(org.lanternpowered.server.world.chunk.LanternChunkLayout.CHUNK_BIOME_VOLUME) LinkedList(java.util.LinkedList) PluginContainer(org.spongepowered.api.plugin.PluginContainer) Nullable(javax.annotation.Nullable) ExtentBufferHelper(org.lanternpowered.server.world.extent.ExtentBufferHelper) Iterator(java.util.Iterator) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) CHUNK_HEIGHT(org.lanternpowered.server.world.chunk.LanternChunk.CHUNK_HEIGHT) Chunk(org.spongepowered.api.world.Chunk) IOException(java.io.IOException) Entity(org.spongepowered.api.entity.Entity) LoadingTicket(org.spongepowered.api.world.ChunkTicketManager.LoadingTicket) TimeUnit(java.util.concurrent.TimeUnit) StorageType(org.spongepowered.api.world.extent.StorageType) Vector3i(com.flowpowered.math.vector.Vector3i) Named(com.google.inject.name.Named) PlayerEntityLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.PlayerEntityLoadingTicket) MapMaker(com.google.common.collect.MapMaker) Conditions.checkPlugin(org.lanternpowered.server.util.Conditions.checkPlugin) Entity(org.spongepowered.api.entity.Entity) ArrayList(java.util.ArrayList) EntityLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.EntityLoadingTicket) PlayerLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.PlayerLoadingTicket) LoadingTicket(org.spongepowered.api.world.ChunkTicketManager.LoadingTicket) PlayerEntityLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.PlayerEntityLoadingTicket) Entry(java.util.Map.Entry) PlayerLoadingTicket(org.spongepowered.api.world.ChunkTicketManager.PlayerLoadingTicket) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) UUID(java.util.UUID) CauseStack(org.lanternpowered.server.event.CauseStack) ChunkTicketManager(org.spongepowered.api.world.ChunkTicketManager) Collection(java.util.Collection)

Aggregations

ImmutableListMultimap (com.google.common.collect.ImmutableListMultimap)14 Map (java.util.Map)9 ImmutableList (com.google.common.collect.ImmutableList)7 ImmutableSet (com.google.common.collect.ImmutableSet)6 Collection (java.util.Collection)5 List (java.util.List)5 Optional (java.util.Optional)5 ImmutableMap (com.google.common.collect.ImmutableMap)4 Nullable (javax.annotation.Nullable)3 BuildTarget (com.facebook.buck.model.BuildTarget)2 BuildRule (com.facebook.buck.rules.BuildRule)2 BytecodeBlock (com.facebook.presto.bytecode.BytecodeBlock)2 BytecodeNode (com.facebook.presto.bytecode.BytecodeNode)2 Scope (com.facebook.presto.bytecode.Scope)2 IfStatement (com.facebook.presto.bytecode.control.IfStatement)2 LabelNode (com.facebook.presto.bytecode.instruction.LabelNode)2 Splitter (com.google.common.base.Splitter)2 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)2 Iterables (com.google.common.collect.Iterables)2 Lists (com.google.common.collect.Lists)2