Example usage for com.google.common.collect Maps newLinkedHashMap

List of usage examples for com.google.common.collect Maps newLinkedHashMap

Introduction

In this page you can find the example usage for com.google.common.collect Maps newLinkedHashMap.

Prototype

public static <K, V> LinkedHashMap<K, V> newLinkedHashMap() 

Source Link

Document

Creates a mutable, empty, insertion-ordered LinkedHashMap instance.

Usage

From source file:org.richfaces.demo.model.tree.adaptors.SourceDirectory.java

public Map<PackageKey, Package> getPackages() {
    if (packagesMap == null && packages != null) {
        packagesMap = Maps.newLinkedHashMap();

        for (Package pkg : packages) {
            packagesMap.put(new PackageKey(pkg.getName()), pkg);
        }/*from  w  w w  .j ava  2 s . c  o m*/
    }

    return packagesMap;
}

From source file:org.jclouds.domain.internal.MutableResourceMetadataImpl.java

public MutableResourceMetadataImpl() {
    userMetadata = Maps.newLinkedHashMap();
}

From source file:org.ldp4j.tutorial.client.ResourceRepository.java

private ResourceRepository() {
    this.resources = Maps.newLinkedHashMap();
}

From source file:org.eclipse.sirius.synchronizer.RefreshPlan.java

/**
 * Creates a new RefreshPlan./*from   w  w w  . j  a  va  2 s.c o  m*/
 * 
 * @param signProvider
 *            the {@link SignatureProvider} to use
 */
public RefreshPlan(SignatureProvider signProvider) {
    outputToCreate = Maps.newLinkedHashMap();
    outputToRefresh = Maps.newLinkedHashMap();
    outputToRemove = HashMultimap.create();
    outputToUpdateMapping = Maps.newHashMap();
    this.signatureProvider = signProvider;

}

From source file:com.ibm.og.json.OGConfig.java

public OGConfig() {
    this.scheme = Scheme.HTTP;
    this.host = null;
    this.port = null;
    this.api = null;
    this.uriRoot = null;
    this.container = new ContainerConfig();
    this.headers = Maps.newLinkedHashMap();
    this.write = new OperationConfig();
    this.overwrite = new OperationConfig();
    this.read = new OperationConfig();
    this.metadata = new OperationConfig();
    this.delete = new OperationConfig();
    this.list = new OperationConfig();
    this.containerList = new OperationConfig();
    this.containerCreate = new OperationConfig();
    this.multipartWrite = new OperationConfig();
    this.filesize = null;
    this.data = DataType.RANDOM;
    this.concurrency = null;
    this.authentication = new AuthenticationConfig();
    this.client = new ClientConfig();
    this.stoppingConditions = new StoppingConditionsConfig();
    this.failingConditions = new FailingConditionsConfig();
    this.objectManager = new ObjectManagerConfig();
    this.shutdownImmediate = true;
    this.virtualHost = false;
}

From source file:com.github.autermann.matlab.MatlabResult.java

/**
 * Creates a new <code>MLResult</code> instance.
 *
 * @param request
 */
public MatlabResult() {
    this.results = Maps.newLinkedHashMap();
}

From source file:com.dtstack.jlogstash.factory.InputFactory.java

@SuppressWarnings({ "rawtypes", "unchecked" })
public static List<BaseInput> getBatchInstance(List<Map> inputs, InputQueueList inputQueueList)
        throws Exception {
    BaseInput.setInputQueueList(inputQueueList);
    List<BaseInput> baseinputs = Lists.newArrayList();
    for (Map input : inputs) {
        Iterator<Entry<String, Map>> inputIT = input.entrySet().iterator();
        while (inputIT.hasNext()) {
            Map.Entry<String, Map> inputEntry = inputIT.next();
            String inputType = inputEntry.getKey();
            Map inputConfig = inputEntry.getValue();
            if (inputConfig == null)
                inputConfig = Maps.newLinkedHashMap();
            Class<?> inputClass = getPluginClass(inputType, PLUGINTYPE, getClassName(inputType, PLUGINTYPE));
            BaseInput baseInput = getInstance(inputType, inputConfig, inputClass);
            baseinputs.add(baseInput);//from   w w  w . j a  va  2  s.  c  om
        }
    }
    return baseinputs;
}

From source file:org.eclipse.sirius.tools.api.interpreter.context.SiriusInterpreterContextFactory.java

/**
 * Creates the {@link InterpreterContext} allowing to validate the
 * InterpretedExpression of the given target, stored in the given feature.
 * //w w  w  .j  a  va2  s  . c o  m
 * @param element
 *            the element containing the InterpretedExpression (NodeMapping,
 *            ModelOperation...)
 * @param feature
 *            the feature corresponding to the InterpretedExpression to
 *            evaluate ( NodeMapping.semanticCandidatesExpression...)
 * @return the {@link InterpreterContext} allowing to validate the
 *         InterpretedExpression of the given target, stored in the given
 *         feature
 */
public static IInterpreterContext createInterpreterContext(EObject element, EStructuralFeature feature) {
    Collection<String> targetDomainClasses = Sets.newLinkedHashSet();
    Collection<EPackage> avalaiblePackages = Sets.newLinkedHashSet();
    Collection<String> dependencies = Sets.newLinkedHashSet();
    Map<String, VariableType> variables = Maps.newLinkedHashMap();
    boolean requiresTargetType = true;

    // Step 1 : getting the InterpretedExpressionQuery from the given
    // element
    IInterpretedExpressionQuery query = DialectManager.INSTANCE.createInterpretedExpressionQuery(element,
            feature);

    // Step 2 : getting the DomainClass of the target
    Option<Collection<String>> targetDomainClassesOption = query.getTargetDomainClasses();

    // If the considered expression does not need any Target class to be
    // validated
    if (!targetDomainClassesOption.some()) {
        requiresTargetType = false;
    } else {
        for (String domainClass : targetDomainClassesOption.get()) {
            targetDomainClasses.add(domainClass);
        }
    }

    if (!targetDomainClassesOption.some() || !targetDomainClassesOption.get().isEmpty()) {
        // Step 2 : getting the packages to import to evaluate the
        // expression
        avalaiblePackages = query.getPackagesToImport();

        // Step 3 : getting the defined variables
        variables = query.getAvailableVariables();

        // Step 4 : getting the defined variables
        dependencies = query.getDependencies();
    }

    // Step 5 : building the IInterpretedContext
    IInterpreterContext context = DefaultInterpreterContextFactory.createInterpreterContext(element,
            requiresTargetType, feature, VariableType.fromStrings(targetDomainClasses), avalaiblePackages,
            variables, dependencies);
    return context;
}

From source file:rabbit.ui.internal.viewers.CommandLabelProvider.java

/**
 * Constructor.//from  w  w w .  j  ava  2  s . c  o m
 */
public CommandLabelProvider() {
    images = Maps.newLinkedHashMap();
    service = (ICommandImageService) PlatformUI.getWorkbench().getService(ICommandImageService.class);
    gray = PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
}

From source file:org.terasology.rendering.assets.font.FontMeshBuilder.java

public Map<Material, Mesh> createTextMesh(List<String> lines, int width, HorizontalAlign alignment,
        Color baseColor, Color shadowColor) {
    this.defaultColor = baseColor;
    Map<Material, MeshBuilder> meshBuilders = Maps.newLinkedHashMap();
    addLinesToMesh(lines, meshBuilders, width, alignment, shadowColor);

    Map<Material, Mesh> result = Maps.newLinkedHashMap();
    for (Map.Entry<Material, MeshBuilder> entry : meshBuilders.entrySet()) {
        result.put(entry.getKey(), entry.getValue().build());
    }//from  ww  w .j  a  v a 2s.  co m
    return result;
}