List of usage examples for java.util TreeMap put
public V put(K key, V value)
From source file:it.cnr.icar.eric.client.ui.thin.QueryBean.java
private Map<String, ParameterBean> getParameterBeans(QueryType query) { TreeMap<String, ParameterBean> beans = new TreeMap<String, ParameterBean>(); Iterator<ParameterType> queryItr = query.getParameter().iterator(); while (queryItr.hasNext()) { ParameterType param = queryItr.next(); String value = param.getParameterName(); // Replace the dot with an underscore to match the method binding // created by the QueryPanelComponent. Reason is that JSF will // misinterpret the '.' as a method dereference in the method binding. // The replacement must only happen in the key. The value must // retain the '.' so it matches the value of the query parameter // in the stored query. String paramBeanKey = value.replace('.', '_'); beans.put(paramBeanKey, new ParameterBean(value)); }// w w w. j ava2 s. c o m return beans; }
From source file:br.ufrgs.inf.dsmoura.repository.model.loadData.LoadLists.java
private static TreeMap<String, ArrayList<String>> getAllDomainsAndSubDomains() { TreeMap<String, ArrayList<String>> domainsMap = new TreeMap<String, ArrayList<String>>(); String domain6E413974 = "Agricultural And Veterinary Sciences"; ArrayList<String> domain6E413974List = new ArrayList<String>(); domain6E413974List.add("Agriculture, Land And Farm Management"); domain6E413974List.add("Animal Production"); domain6E413974List.add("Crop And Pasture Production"); domain6E413974List.add("Fisheries Sciences"); domain6E413974List.add("Forestry Sciences"); domain6E413974List.add("Horticultural Production"); domain6E413974List.add("Other Agricultural And Veterinary Sciences"); domain6E413974List.add("Veterinary Sciences"); domainsMap.put(domain6E413974, domain6E413974List); String domain4F6DF826 = "Animal Production And Animal Primary Products"; ArrayList<String> domain4F6DF826List = new ArrayList<String>(); domain4F6DF826List.add("Environmentally Sustainable Animal Production"); domain4F6DF826List.add("Fisheries - Aquaculture"); domain4F6DF826List.add("Fisheries - Wild Caught"); domain4F6DF826List.add("Livestock Raising"); domain4F6DF826List.add("Other Animal Production And Animal Primary Products"); domain4F6DF826List.add("Pasture, Browse And Fodder Crops"); domain4F6DF826List.add("Primary Animal Products"); domainsMap.put(domain4F6DF826, domain4F6DF826List); String domain4AEF09CE = "Biological Sciences"; ArrayList<String> domain4AEF09CEList = new ArrayList<String>(); domain4AEF09CEList.add("Biochemistry And Cell Biology"); domain4AEF09CEList.add("Ecology"); domain4AEF09CEList.add("Evolutionary Biology"); domain4AEF09CEList.add("Genetics"); domain4AEF09CEList.add("Microbiology"); domain4AEF09CEList.add("Other Biological Sciences"); domain4AEF09CEList.add("Physiology"); domain4AEF09CEList.add("Plant Biology"); domain4AEF09CEList.add("Zoology"); domainsMap.put(domain4AEF09CE, domain4AEF09CEList); String domain2531174A = "Built Environment And Design"; ArrayList<String> domain2531174AList = new ArrayList<String>(); domain2531174AList.add("Architecture"); domain2531174AList.add("Building"); domain2531174AList.add("Design Practice And Management"); domain2531174AList.add("Engineering Design"); domain2531174AList.add("Other Built Environment And Design"); domain2531174AList.add("Urban And Regional Planning"); domainsMap.put(domain2531174A, domain2531174AList); String domainA530ADD = "Chemical Sciences"; ArrayList<String> domainA530ADDList = new ArrayList<String>(); domainA530ADDList.add("Analytical Chemistry"); domainA530ADDList.add("Inorganic Chemistry"); domainA530ADDList.add("Macromolecular And Materials Chemistry"); domainA530ADDList.add("Medicinal And Biomolecular Chemistry"); domainA530ADDList.add("Organic Chemistry"); domainA530ADDList.add("Other Chemical Sciences"); domainA530ADDList.add("Physical Chemistry"); domainA530ADDList.add("Theoretical And Computational Chemistry"); domainsMap.put(domainA530ADD, domainA530ADDList); String domain68180502 = "Commerce, Management, Tourism And Services"; ArrayList<String> domain68180502List = new ArrayList<String>(); domain68180502List.add("Accounting, Auditing And Accountability"); domain68180502List.add("Banking, Finance And Investment"); domain68180502List.add("Business And Management"); domain68180502List.add("Commercial Services"); domain68180502List.add("Marketing"); domain68180502List.add("Other Commerce, Management, Tourism And Services"); domain68180502List.add("Tourism"); domain68180502List.add("Transportation And Freight Services"); domainsMap.put(domain68180502, domain68180502List); String domain7C878FF6 = "Commercial Services And Tourism"; ArrayList<String> domain7C878FF6List = new ArrayList<String>(); domain7C878FF6List.add("Environmentally Sustainable Commercial Services And Tourism"); domain7C878FF6List.add("Financial Services"); domain7C878FF6List.add("Other Commercial Services And Tourism"); domain7C878FF6List.add("Property, Business Support Services And Trade"); domain7C878FF6List.add("Tourism"); domain7C878FF6List.add("Water And Waste Services"); domainsMap.put(domain7C878FF6, domain7C878FF6List); String domain6D2C9B0F = "Construction"; ArrayList<String> domain6D2C9B0FList = new ArrayList<String>(); domain6D2C9B0FList.add("Building Management And Services"); domain6D2C9B0FList.add("Construction Design"); domain6D2C9B0FList.add("Construction Materials Performance And Processes"); domain6D2C9B0FList.add("Construction Planning"); domain6D2C9B0FList.add("Construction Processes"); domain6D2C9B0FList.add("Environmentally Sustainable Construction"); domain6D2C9B0FList.add("Other Construction"); domainsMap.put(domain6D2C9B0F, domain6D2C9B0FList); String domain61E0947A = "Cultural Understanding"; ArrayList<String> domain61E0947AList = new ArrayList<String>(); domain61E0947AList.add("Arts And Leisure"); domain61E0947AList.add("Communication"); domain61E0947AList.add("Heritage"); domain61E0947AList.add("Other Cultural Understanding"); domain61E0947AList.add("Religion And Ethics"); domain61E0947AList.add("Understanding Past Societies"); domainsMap.put(domain61E0947A, domain61E0947AList); String domain40B1DBD0 = "Defence"; ArrayList<String> domain40B1DBD0List = new ArrayList<String>(); domain40B1DBD0List.add("Defence"); domainsMap.put(domain40B1DBD0, domain40B1DBD0List); String domain3878A21B = "Earth Sciences"; ArrayList<String> domain3878A21BList = new ArrayList<String>(); domain3878A21BList.add("Atmospheric Sciences"); domain3878A21BList.add("Geochemistry"); domain3878A21BList.add("Geology"); domain3878A21BList.add("Geophysics"); domain3878A21BList.add("Oceanography"); domain3878A21BList.add("Other Earth Sciences"); domain3878A21BList.add("Physical Geography And Environmental Geoscience"); domainsMap.put(domain3878A21B, domain3878A21BList); String domainE05FC6D = "Economic Framework"; ArrayList<String> domainE05FC6DList = new ArrayList<String>(); domainE05FC6DList.add("International Trade"); domainE05FC6DList.add("Macroeconomics"); domainE05FC6DList.add("Management And Productivity"); domainE05FC6DList.add("Measurement Standards And Calibration Services"); domainE05FC6DList.add("Microeconomics"); domainE05FC6DList.add("Other Economic Framework"); domainsMap.put(domainE05FC6D, domainE05FC6DList); String domain2BA1A102 = "Economics"; ArrayList<String> domain2BA1A102List = new ArrayList<String>(); domain2BA1A102List.add("Applied Economics"); domain2BA1A102List.add("Econometrics"); domain2BA1A102List.add("Economic Theory"); domain2BA1A102List.add("Other Economics"); domainsMap.put(domain2BA1A102, domain2BA1A102List); String domain661D8788 = "Education"; ArrayList<String> domain661D8788List = new ArrayList<String>(); domain661D8788List.add("Curriculum And Pedagogy"); domain661D8788List.add("Education Systems"); domain661D8788List.add("Other Education"); domain661D8788List.add("Specialist Studies In Education"); domainsMap.put(domain661D8788, domain661D8788List); String domain28120EDB = "Education And Training"; ArrayList<String> domain28120EDBList = new ArrayList<String>(); domain28120EDBList.add("Curriculum"); domain28120EDBList.add("Education And Training Systems"); domain28120EDBList.add("Learner And Learning"); domain28120EDBList.add("Other Education And Training"); domain28120EDBList.add("School/institution"); domain28120EDBList.add("Teaching And Instruction"); domainsMap.put(domain28120EDB, domain28120EDBList); String domain7BFC1EA8 = "Energy"; ArrayList<String> domain7BFC1EA8List = new ArrayList<String>(); domain7BFC1EA8List.add("Energy Conservation And Efficiency"); domain7BFC1EA8List.add("Energy Exploration"); domain7BFC1EA8List.add("Energy Storage, Distribution And Supply"); domain7BFC1EA8List.add("Energy Transformation"); domain7BFC1EA8List.add("Environmentally Sustainable Energy Activities"); domain7BFC1EA8List.add("Mining And Extraction Of Energy Resources"); domain7BFC1EA8List.add("Other Energy"); domain7BFC1EA8List.add("Preparation And Production Of Energy Sources"); domain7BFC1EA8List.add("Renewable Energy"); domainsMap.put(domain7BFC1EA8, domain7BFC1EA8List); String domain36DD890D = "Engineering"; ArrayList<String> domain36DD890DList = new ArrayList<String>(); domain36DD890DList.add("Aerospace Engineering"); domain36DD890DList.add("Automotive Engineering"); domain36DD890DList.add("Biomedical Engineering"); domain36DD890DList.add("Chemical Engineering"); domain36DD890DList.add("Civil Engineering"); domain36DD890DList.add("Electrical And Electronic Engineering"); domain36DD890DList.add("Environmental Engineering"); domain36DD890DList.add("Food Sciences"); domain36DD890DList.add("Geomatic Engineering"); domain36DD890DList.add("Interdisciplinary Engineering"); domain36DD890DList.add("Manufacturing Engineering"); domain36DD890DList.add("Maritime Engineering"); domain36DD890DList.add("Materials Engineering"); domain36DD890DList.add("Mechanical Engineering"); domain36DD890DList.add("Other Engineering"); domain36DD890DList.add("Resources Engineering And Extractive Metallurgy"); domainsMap.put(domain36DD890D, domain36DD890DList); String domain5E4AD9F3 = "Environment"; ArrayList<String> domain5E4AD9F3List = new ArrayList<String>(); domain5E4AD9F3List.add("Air Quality"); domain5E4AD9F3List.add("Atmosphere And Weather"); domain5E4AD9F3List.add("Climate And Climate Change"); domain5E4AD9F3List.add("Control Of Pests, Diseases And Exotic Species"); domain5E4AD9F3List.add("Ecosystem Assessment And Management"); domain5E4AD9F3List.add("Environmental And Natural Resource Evaluation"); domain5E4AD9F3List.add("Environmental Policy, Legislation And Standards"); domain5E4AD9F3List.add("Flora, Fauna And Biodiversity"); domain5E4AD9F3List.add("Land And Water Management"); domain5E4AD9F3List.add("Natural Hazards"); domain5E4AD9F3List.add("Other Environment"); domain5E4AD9F3List.add("Physical And Chemical Conditions Of Water"); domain5E4AD9F3List.add("Rehabilitation Of Degraded Environments"); domain5E4AD9F3List.add("Remnant Vegetation And Protected Conservation Areas"); domain5E4AD9F3List.add("Soils"); domainsMap.put(domain5E4AD9F3, domain5E4AD9F3List); String domain706EEB31 = "Environmental Sciences"; ArrayList<String> domain706EEB31List = new ArrayList<String>(); domain706EEB31List.add("Ecological Applications"); domain706EEB31List.add("Environmental Science And Management"); domain706EEB31List.add("Other Environmental Sciences"); domain706EEB31List.add("Soil Sciences"); domainsMap.put(domain706EEB31, domain706EEB31List); String domain7F661184 = "Health"; ArrayList<String> domain7F661184List = new ArrayList<String>(); domain7F661184List.add("Clinical Health"); domain7F661184List.add("Health And Support Services"); domain7F661184List.add("Indigenous Health"); domain7F661184List.add("Other Health"); domain7F661184List.add("Public Health"); domain7F661184List.add("Specific Population Health"); domainsMap.put(domain7F661184, domain7F661184List); String domain70C990CB = "History And Archaeology"; ArrayList<String> domain70C990CBList = new ArrayList<String>(); domain70C990CBList.add("Archaeology"); domain70C990CBList.add("Curatorial And Related Studies"); domain70C990CBList.add("Historical Studies"); domain70C990CBList.add("Other History And Archaeology"); domainsMap.put(domain70C990CB, domain70C990CBList); String domain5C85023B = "Information And Communication Services"; ArrayList<String> domain5C85023BList = new ArrayList<String>(); domain5C85023BList.add("Communication Networks And Services"); domain5C85023BList.add("Computer Software And Services"); domain5C85023BList.add("Environmentally Sustainable Information And Communication Services"); domain5C85023BList.add("Information Services"); domain5C85023BList.add("Media Services"); domain5C85023BList.add("Other Information And Communication Services"); domainsMap.put(domain5C85023B, domain5C85023BList); String domain39C88CD8 = "Information And Computing Sciences"; ArrayList<String> domain39C88CD8List = new ArrayList<String>(); domain39C88CD8List.add("Artificial Intelligence And Image Processing"); domain39C88CD8List.add("Computation Theory And Mathematics"); domain39C88CD8List.add("Computer Software"); domain39C88CD8List.add("Data Format"); domain39C88CD8List.add("Distributed Computing"); domain39C88CD8List.add("Information Systems"); domain39C88CD8List.add("Library And Information Studies"); domain39C88CD8List.add("Other Information And Computing Sciences"); domainsMap.put(domain39C88CD8, domain39C88CD8List); String domain3029EEB1 = "Language, Communication And Culture"; ArrayList<String> domain3029EEB1List = new ArrayList<String>(); domain3029EEB1List.add("Communication And Media Studies"); domain3029EEB1List.add("Cultural Studies"); domain3029EEB1List.add("Language Studies"); domain3029EEB1List.add("Linguistics"); domain3029EEB1List.add("Literary Studies"); domain3029EEB1List.add("Other Language, Communication And Culture"); domainsMap.put(domain3029EEB1, domain3029EEB1List); String domain3777C7B9 = "Law And Legal Studies"; ArrayList<String> domain3777C7B9List = new ArrayList<String>(); domain3777C7B9List.add("Law"); domain3777C7B9List.add("Maori Law"); domain3777C7B9List.add("Other Law And Legal Studies"); domainsMap.put(domain3777C7B9, domain3777C7B9List); String domainE509E47 = "Law, Politics And Community Services"; ArrayList<String> domainE509E47List = new ArrayList<String>(); domainE509E47List.add("Community Service"); domainE509E47List.add("Government And Politics"); domainE509E47List.add("International Relations"); domainE509E47List.add("Justice And The Law"); domainE509E47List.add("Other Law, Politics And Community Services"); domainE509E47List.add("Work And Institutional Development"); domainsMap.put(domainE509E47, domainE509E47List); String domain73A6AE2 = "Manufacturing"; ArrayList<String> domain73A6AE2List = new ArrayList<String>(); domain73A6AE2List.add("Agricultural Chemicals"); domain73A6AE2List.add("Basic Metal Products"); domain73A6AE2List.add("Ceramics, Glass And Industrial Mineral Products"); domain73A6AE2List.add("Communication Equipment"); domain73A6AE2List.add("Computer Hardware And Electronic Equipment"); domain73A6AE2List.add("Dairy Products"); domain73A6AE2List.add("Environmentally Sustainable Manufacturing"); domain73A6AE2List.add("Fabricated Metal Products"); domain73A6AE2List.add("Human Pharmaceutical Products"); domain73A6AE2List.add("Industrial Chemicals And Related Products"); domain73A6AE2List.add("Instrumentation"); domain73A6AE2List.add("Leather Products, Fibre Processing And Textiles"); domain73A6AE2List.add("Machinery And Equipment"); domain73A6AE2List.add("Other Manufacturing"); domain73A6AE2List.add("Processed Food Products And Beverages"); domain73A6AE2List.add("Processed Non-food Agriculture Products"); domain73A6AE2List.add("Transport Equipment"); domain73A6AE2List.add("Veterinary Pharmaceutical Products"); domain73A6AE2List.add("Wood, Wood Products And Paper"); domainsMap.put(domain73A6AE2, domain73A6AE2List); String domain76D50F79 = "Mathematical Sciences"; ArrayList<String> domain76D50F79List = new ArrayList<String>(); domain76D50F79List.add("Applied Mathematics"); domain76D50F79List.add("Mathematical Physics"); domain76D50F79List.add("Numerical And Computational Mathematics"); domain76D50F79List.add("Other Mathematical Sciences"); domain76D50F79List.add("Pure Mathematics"); domain76D50F79List.add("Statistics"); domainsMap.put(domain76D50F79, domain76D50F79List); String domain6492DF3B = "Medical And Health Sciences"; ArrayList<String> domain6492DF3BList = new ArrayList<String>(); domain6492DF3BList.add("Cardiorespiratory Medicine And Haematology"); domain6492DF3BList.add("Clinical Sciences"); domain6492DF3BList.add("Complementary And Alternative Medicine"); domain6492DF3BList.add("Dentistry"); domain6492DF3BList.add("Human Movement And Sports Science"); domain6492DF3BList.add("Immunology"); domain6492DF3BList.add("Medical Biochemistry And Metabolomics"); domain6492DF3BList.add("Medical Microbiology"); domain6492DF3BList.add("Medical Physiology"); domain6492DF3BList.add("Neurosciences"); domain6492DF3BList.add("Nursing"); domain6492DF3BList.add("Nutrition And Dietetics"); domain6492DF3BList.add("Oncology And Carcinogenesis"); domain6492DF3BList.add("Ophthalmology And Optometry"); domain6492DF3BList.add("Other Medical And Health Sciences"); domain6492DF3BList.add("Paediatrics And Reproductive Medicine"); domain6492DF3BList.add("Pharmacology And Pharmaceutical Sciences"); domain6492DF3BList.add("Public Health And Health Services"); domainsMap.put(domain6492DF3B, domain6492DF3BList); String domain3BB0BD1 = "Mineral Resources"; ArrayList<String> domain3BB0BD1List = new ArrayList<String>(); domain3BB0BD1List.add("Environmentally Sustainable Mineral Resource Activities"); domain3BB0BD1List.add("First Stage Treatment Of Ores And Minerals"); domain3BB0BD1List.add("Mineral Exploration"); domain3BB0BD1List.add("Other Mineral Resources"); domain3BB0BD1List.add("Primary Mining And Extraction Of Mineral Resources"); domainsMap.put(domain3BB0BD1, domain3BB0BD1List); String domain48F8EF0 = "Other"; ArrayList<String> domain48F8EF0List = new ArrayList<String>(); domain48F8EF0List.add("Other"); domainsMap.put(domain48F8EF0, domain48F8EF0List); String domain4C8D4A76 = "Philosophy And Religious Studies"; ArrayList<String> domain4C8D4A76List = new ArrayList<String>(); domain4C8D4A76List.add("Applied Ethics"); domain4C8D4A76List.add("History And Philosophy Of Specific Fields"); domain4C8D4A76List.add("Other Philosophy And Religious Studies"); domain4C8D4A76List.add("Philosophy"); domain4C8D4A76List.add("Religion And Religious Studies"); domainsMap.put(domain4C8D4A76, domain4C8D4A76List); String domain734A57B8 = "Physical Sciences"; ArrayList<String> domain734A57B8List = new ArrayList<String>(); domain734A57B8List.add("Astronomical And Space Sciences"); domain734A57B8List.add("Atomic, Molecular, Nuclear, Particle And Plasma Physics"); domain734A57B8List.add("Classical Physics"); domain734A57B8List.add("Condensed Matter Physics"); domain734A57B8List.add("Optical Physics"); domain734A57B8List.add("Other Physical Sciences"); domain734A57B8List.add("Quantum Physics"); domainsMap.put(domain734A57B8, domain734A57B8List); String domain15FA1AAE = "Plant Production And Plant Primary Products"; ArrayList<String> domain15FA1AAEList = new ArrayList<String>(); domain15FA1AAEList.add("Environmentally Sustainable Plant Production"); domain15FA1AAEList.add("Forestry"); domain15FA1AAEList.add("Harvesting And Packing Of Plant Products"); domain15FA1AAEList.add("Horticultural Crops"); domain15FA1AAEList.add("Industrial Crops"); domain15FA1AAEList.add("Other Plant Production And Plant Primary Products"); domain15FA1AAEList.add("Summer Grains And Oilseeds"); domain15FA1AAEList.add("Winter Grains And Oilseeds"); domainsMap.put(domain15FA1AAE, domain15FA1AAEList); String domain38E6EBF5 = "Psychology And Cognitive Sciences"; ArrayList<String> domain38E6EBF5List = new ArrayList<String>(); domain38E6EBF5List.add("Cognitive Sciences"); domain38E6EBF5List.add("Other Psychology And Cognitive Sciences"); domain38E6EBF5List.add("Psychology"); domainsMap.put(domain38E6EBF5, domain38E6EBF5List); String domain208BEFAE = "Studies In Creative Arts And Writing"; ArrayList<String> domain208BEFAEList = new ArrayList<String>(); domain208BEFAEList.add("Art Theory And Criticism"); domain208BEFAEList.add("Film, Television And Digital Media"); domain208BEFAEList.add("Journalism And Professional Writing"); domain208BEFAEList.add("Other Studies In Creative Arts And Writing"); domain208BEFAEList.add("Performing Arts And Creative Writing"); domain208BEFAEList.add("Visual Arts And Crafts"); domainsMap.put(domain208BEFAE, domain208BEFAEList); String domain69B0EA2D = "Studies In Human Society"; ArrayList<String> domain69B0EA2DList = new ArrayList<String>(); domain69B0EA2DList.add("Anthropology"); domain69B0EA2DList.add("Criminology"); domain69B0EA2DList.add("Demography"); domain69B0EA2DList.add("Human Geography"); domain69B0EA2DList.add("Other Studies In Human Society"); domain69B0EA2DList.add("Policy And Administration"); domain69B0EA2DList.add("Political Science"); domain69B0EA2DList.add("Social Work"); domain69B0EA2DList.add("Sociology"); domainsMap.put(domain69B0EA2D, domain69B0EA2DList); String domain12B9612C = "Technology"; ArrayList<String> domain12B9612CList = new ArrayList<String>(); domain12B9612CList.add("Agricultural Biotechnology"); domain12B9612CList.add("Communications Technologies"); domain12B9612CList.add("Computer Hardware"); domain12B9612CList.add("Environmental Biotechnology"); domain12B9612CList.add("Industrial Biotechnology"); domain12B9612CList.add("Medical Biotechnology"); domain12B9612CList.add("Nanotechnology"); domain12B9612CList.add("Other Technology"); domainsMap.put(domain12B9612C, domain12B9612CList); String domain49CAE8F7 = "Transport"; ArrayList<String> domain49CAE8F7List = new ArrayList<String>(); domain49CAE8F7List.add("Aerospace Transport"); domain49CAE8F7List.add("Environmentally Sustainable Transport"); domain49CAE8F7List.add("Ground Transport"); domain49CAE8F7List.add("Other Transport"); domain49CAE8F7List.add("Water Transport"); domainsMap.put(domain49CAE8F7, domain49CAE8F7List); return domainsMap; }
From source file:com.asakusafw.directio.hive.parquet.DataModelMaterializer.java
private List<Mapping> computeMapping(DataModelDescriptor descriptor, MessageType schema, DataModelMapping configuration) { List<Mapping> mappings; switch (configuration.getFieldMappingStrategy()) { case NAME:/*from w w w . j av a2s . c o m*/ mappings = computeMappingByName(descriptor, schema); break; case POSITION: mappings = computeMappingByPosition(descriptor, schema); break; default: throw new AssertionError(configuration.getFieldMappingStrategy()); } TreeMap<Integer, Mapping> propertyMap = new TreeMap<>(); for (Mapping mapping : mappings) { if (checkMapping(descriptor, mapping, configuration)) { assert mapping.source != null; assert mapping.target != null; if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format("Map Parquet column: {0}:{1} -> {2}:{3}", //$NON-NLS-1$ mapping.source.getPath()[0], mapping.source.getType(), mapping.target.getFieldName(), mapping.target.getTypeInfo())); } int index = schema.getFieldIndex(mapping.source.getPath()[0]); propertyMap.put(index, mapping); } } int lastIndex = -1; if (propertyMap.isEmpty() == false) { lastIndex = propertyMap.lastKey(); } Mapping[] results = new Mapping[lastIndex + 1]; for (Map.Entry<Integer, Mapping> entry : propertyMap.entrySet()) { results[entry.getKey()] = entry.getValue(); } return Arrays.asList(results); }
From source file:com.nubits.nubot.trading.wrappers.PeatioWrapper.java
@Override public ApiResponse getActiveOrders(CurrencyPair pair) { ApiResponse apiResponse = new ApiResponse(); ArrayList<Order> orderList = new ArrayList<Order>(); String url = apiBaseUrl;//from w w w . jav a2 s . c o m String method = API_ACTIVE_ORDERS; boolean isGet = true; TreeMap<String, String> query_args = new TreeMap<>(); /*Params * pair, default all pairs */ query_args.put("canonical_verb", "GET"); query_args.put("canonical_uri", method); query_args.put("market", pair.toString()); query_args.put("limit", "999"); //default is 10 , max is 1000 ApiResponse response = getQuery(url, method, query_args, true, isGet); if (response.isPositive()) { JSONArray httpAnswerJson = (JSONArray) response.getResponseObject(); for (Object anOrdersResponse : httpAnswerJson) { JSONObject orderResponse = (JSONObject) anOrdersResponse; Order tempOrder = parseOrder(orderResponse); if (!tempOrder.isCompleted()) //Do not add executed orders { orderList.add(tempOrder); } } apiResponse.setResponseObject(orderList); } else { apiResponse = response; } return apiResponse; }
From source file:disko.flow.analyzers.ParseSelectAnalyzer.java
public void process(AnalysisContext<TextDocument> ctx, Ports ports) throws InterruptedException { final HyperGraph graph = this.graph != null ? this.graph : ctx.getGraph(); RelationCountFactory.createCountingIndices(graph); InputPort<EntityMaintainer> entityInput = ports.getInput(EntityAnalyzer.ENTITY_CHANNEL); InputPort<Set<SentenceInterpretation>> sentenceInput = ports .getInput(ToRelOccAnalyzer.SENTENCE_INTERPRETATIONS); OutputPort<SentenceInterpretation> out = ports.getOutput(SELECTED_PARSE_CHANNEL); for (Set<SentenceInterpretation> iset = sentenceInput.take(); !sentenceInput .isEOS(iset); iset = sentenceInput.take()) { EntityMaintainer em = entityInput.take(); if (entityInput.isEOS(em)) break; HashMap<String, String> entityTypes = RelationCountFactory.getEntityTypes(em); TreeMap<Double, SentenceInterpretation> ranked = new TreeMap<Double, SentenceInterpretation>(); for (SentenceInterpretation i : iset) { ArrayList<RelationCount> relationCounts = new ArrayList<RelationCount>(); for (RelOccurrence occ : i.getRelOccs()) { if (occ.getArity() < 3) continue; List<String> components = occ.getComponents(ctx.getGraph()); relationCounts.add(//from www . j a va2s . c om RelationCountFactory.getRelationCount(entityTypes, components, occ.getPositions())); } // RelationCountFactory.getRelationCounts(entityTypes, i.getParse()); double score = computeScores(graph, relationCounts); ranked.put(score, i); } SentenceInterpretation best = ranked.get(ranked.lastKey()); out.put(best); } out.close(); }
From source file:hydrograph.ui.engine.ui.converter.TransformUiConverter.java
/** * Generate runtime properties for component. * //w w w .ja va2 s . c om * @return Map<String,String> */ @Override protected Map<String, String> getRuntimeProperties() { LOGGER.debug("Generating Runtime Properties for -{}", componentName); TreeMap<String, String> runtimeMap = null; TypeProperties typeProperties = ((TypeOperationsComponent) typeBaseComponent).getRuntimeProperties(); if (typeProperties != null) { runtimeMap = new TreeMap<>(); for (Property runtimeProperty : typeProperties.getProperty()) { runtimeMap.put(runtimeProperty.getName(), runtimeProperty.getValue()); } } return runtimeMap; }
From source file:com.nubits.nubot.trading.wrappers.BitSparkWrapper.java
public ApiResponse getLastTradesImpl(CurrencyPair pair, long startTime) { ApiResponse apiResponse = new ApiResponse(); String url = API_BASE_URL; String method = API_GET_TRADES; boolean isGet = true; TreeMap<String, String> query_args = new TreeMap<>(); ArrayList<Trade> tradeList = new ArrayList<>(); query_args.put("canonical_verb", "GET"); query_args.put("canonical_uri", method); query_args.put("market", pair.toString()); query_args.put("limit", "1000"); ApiResponse response = getQuery(url, method, query_args, true, isGet); if (response.isPositive()) { LOG.debug("A maximum of 1000 trades can be returned from the BitSpark API"); JSONArray httpAnswerJson = (JSONArray) response.getResponseObject(); for (Iterator<JSONObject> trade = httpAnswerJson.iterator(); trade.hasNext();) { Trade thisTrade = parseTrade(trade.next()); if (thisTrade.getDate().getTime() < (startTime * 1000L)) { continue; }// w ww . j a va2 s . c o m tradeList.add(thisTrade); } apiResponse.setResponseObject(tradeList); } else { apiResponse = response; } return apiResponse; }
From source file:gda.scan.ConcurrentScanChild.java
TreeMap<Integer, Scannable[]> generateDevicesToMoveByLevel(TreeMap<Integer, Scannable[]> scannableLevels, Vector<Detector> detectors) { TreeMap<Integer, Scannable[]> devicesToMoveByLevel = new TreeMap<Integer, Scannable[]>(); devicesToMoveByLevel.putAll(scannableLevels); for (Scannable detector : detectors) { Integer level = detector.getLevel(); if (devicesToMoveByLevel.containsKey(level)) { Scannable[] levelArray = devicesToMoveByLevel.get(level); levelArray = (Scannable[]) ArrayUtils.add(levelArray, detector); devicesToMoveByLevel.put(level, levelArray); } else {// w w w. ja v a 2 s . co m Scannable[] levelArray = new Scannable[] { detector }; devicesToMoveByLevel.put(level, levelArray); } } return devicesToMoveByLevel; }
From source file:org.squale.squaleweb.applicationlayer.action.export.ppt.AuditReportPPTData.java
/** * Add array of results for the application in a slide * //from ww w . j a va 2 s . com * @param slideToSet slide to set * @param where place to add results * @throws IOException if error * @throws PPTGeneratorException */ public void setApplicationQualityResults(Slide slideToSet, Rectangle where) throws IOException, PPTGeneratorException { log.info("AuditReturn - setApplicationQualityResults"); // Create map for fill table TreeMap factorsMap = new TreeMap(); for (int i = 0; i < projectReports.size(); i++) { log.info("AuditReturn - setApplicationQualityResults Project n" + i); ProjectReportDTO curProject = (ProjectReportDTO) projectReports.get(i); for (int j = 0; j < curProject.getQualityResults().size(); j++) { QualityReportDTO factor = (QualityReportDTO) curProject.getQualityResults().get(j); String factorName = WebMessages.getString(request, factor.getRule().getName()); TreeMap results = (TreeMap) factorsMap.get(factorName); if (results == null) { results = new TreeMap(); } results.put(curProject.getName(), new Float[] { new Float(factor.getMeanMark()), new Float(factor.getPreviousScore()) }); factorsMap.put(factorName, results); } } // create table and add it to the slide in function of the map previously created createApplicationResultsTable(slideToSet, where, factorsMap); log.info("AuditReturn - setApplicationQualityResults done"); }