java.util.LinkedHashMap Java Examples
The following examples show how to use
java.util.LinkedHashMap.
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: JobItem.java From rundeck-cli with Apache License 2.0 | 6 votes |
public Map<Object, Object> toMap() { HashMap<Object, Object> map = new LinkedHashMap<>(); map.put("id", getId()); map.put("name", getName()); if (null != getGroup()) { map.put("group", getGroup()); } map.put("project", getProject()); map.put("href", getHref()); map.put("permalink", getPermalink()); map.put("description", getDescription()); if(null!=getAverageDuration()){ map.put("averageDuration", getAverageDuration()); } return map; }
Example #2
Source File: BatchProcessingEnvImpl.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Parse the -A command line arguments so that they can be delivered to * processors with {@link javax.annotation.processing.ProcessingEnvironment#getOptions()}. In Sun's Java 6 * version of javac, unlike in the Java 5 apt tool, only the -A options are * passed to processors, not the other command line options; that behavior * is repeated here. * @param args the equivalent of the args array from the main() method. * @return a map of key to value, or key to null if there is no value for * a particular key. The "-A" is stripped from the key, so a command-line * argument like "-Afoo=bar" will result in an entry with key "foo" and * value "bar". */ private Map<String, String> parseProcessorOptions(String[] args) { Map<String, String> options = new LinkedHashMap<String, String>(); for (String arg : args) { if (!arg.startsWith("-A")) { //$NON-NLS-1$ continue; } int equals = arg.indexOf('='); if (equals == 2) { // option begins "-A=" - not valid Exception e = new IllegalArgumentException("-A option must have a key before the equals sign"); //$NON-NLS-1$ throw new AbortCompilation(null, e); } if (equals == arg.length() - 1) { // option ends with "=" - not valid options.put(arg.substring(2, equals), null); } else if (equals == -1) { // no value options.put(arg.substring(2), null); } else { // value and key options.put(arg.substring(2, equals), arg.substring(equals + 1)); } } return options; }
Example #3
Source File: JsonWebKeys.java From cxf with Apache License 2.0 | 6 votes |
public Map<KeyOperation, List<JsonWebKey>> getKeyOperationMap() { List<JsonWebKey> keys = getKeys(); if (keys == null) { return Collections.emptyMap(); } Map<KeyOperation, List<JsonWebKey>> map = new LinkedHashMap<>(); for (JsonWebKey key : keys) { List<KeyOperation> ops = key.getKeyOperation(); if (ops != null) { for (KeyOperation op : ops) { List<JsonWebKey> list = map.get(op); if (list == null) { list = new LinkedList<>(); map.put(op, list); } list.add(key); } } } return map; }
Example #4
Source File: WorkflowServiceImpl.java From alfresco-repository with GNU Lesser General Public License v3.0 | 6 votes |
private Map<String, List<String>> batchByEngineId(List<String> workflowIds) { Map<String, List<String>> workflows = new LinkedHashMap<String, List<String>>(workflowIds.size() * 2); for (String workflowId: workflowIds) { String engineId = BPMEngineRegistry.getEngineId(workflowId); List <String> engineWorkflows = workflows.get(engineId); if (engineWorkflows == null) { engineWorkflows = new LinkedList<String>(); workflows.put(engineId, engineWorkflows); } engineWorkflows.add(workflowId); } return workflows; }
Example #5
Source File: EncryptDatabasesConfiguration.java From shardingsphere with Apache License 2.0 | 6 votes |
@Override public DataSource getDataSource() { Properties props = new Properties(); props.setProperty("aes.key.value", "123456"); props.setProperty("query.with.cipher.column", "true"); EncryptColumnRuleConfiguration columnConfigAes = new EncryptColumnRuleConfiguration("user_name", "user_name", "", "user_name_plain", "name_encryptor"); EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_encryptor"); EncryptTableRuleConfiguration encryptTableRuleConfiguration = new EncryptTableRuleConfiguration("t_user", Arrays.asList(columnConfigAes, columnConfigTest)); Map<String, ShardingSphereAlgorithmConfiguration> encryptAlgorithmConfigurations = new LinkedHashMap<>(2, 1); encryptAlgorithmConfigurations.put("name_encryptor", new ShardingSphereAlgorithmConfiguration("AES", props)); encryptAlgorithmConfigurations.put("pwd_encryptor", new ShardingSphereAlgorithmConfiguration("assistedTest", props)); EncryptRuleConfiguration encryptRuleConfiguration = new EncryptRuleConfiguration(Collections.singleton(encryptTableRuleConfiguration), encryptAlgorithmConfigurations); try { return ShardingSphereDataSourceFactory.createDataSource(DataSourceUtil.createDataSource("demo_ds"), Collections.singleton(encryptRuleConfiguration), props); } catch (final SQLException ex) { ex.printStackTrace(); return null; } }
Example #6
Source File: EurekaResource.java From flair-registry with Apache License 2.0 | 6 votes |
private List<Map<String, Object>> getApplications() { List<Application> sortedApplications = getRegistry().getSortedApplications(); ArrayList<Map<String, Object>> apps = new ArrayList<>(); for (Application app : sortedApplications) { LinkedHashMap<String, Object> appData = new LinkedHashMap<>(); apps.add(appData); appData.put("name", app.getName()); List<Map<String, Object>> instances = new ArrayList<>(); for (InstanceInfo info : app.getInstances()) { Map<String, Object> instance = new HashMap<>(); instance.put("instanceId", info.getInstanceId()); instance.put("homePageUrl", info.getHomePageUrl()); instance.put("healthCheckUrl", info.getHealthCheckUrl()); instance.put("statusPageUrl", info.getStatusPageUrl()); instance.put("status", info.getStatus().name()); instance.put("metadata", info.getMetadata()); instances.add(instance); } appData.put("instances", instances); } return apps; }
Example #7
Source File: QueryRequest.java From mPaaS with Apache License 2.0 | 6 votes |
/** * 添加条件 */ @SuppressWarnings("unchecked") public QueryRequest addCondition(String column, Operator opt, Object value) { Map<Object, Object> map; if (this.conditions == null) { this.conditions = new LinkedHashMap<>(); map = new LinkedHashMap<>(16); this.conditions.put(column, map); } else { Object val = this.conditions.get(column); if (val == null) { map = new LinkedHashMap<>(); this.conditions.put(column, map); } else if (val instanceof Map) { map = (Map<Object, Object>) val; } else { map = new LinkedHashMap<>(16); this.conditions.put(column, map); map.put(Operator.eq, val); } } map.put(opt.getValue(), value); return this; }
Example #8
Source File: KeyValueOption.java From jdk8u_nashorn with GNU General Public License v2.0 | 6 votes |
private void initialize() { if (getValue() == null) { return; } map = new LinkedHashMap<>(); final StringTokenizer st = new StringTokenizer(getValue(), ","); while (st.hasMoreElements()) { final String token = st.nextToken(); final String[] keyValue = token.split(":"); if (keyValue.length == 1) { map.put(keyValue[0], ""); } else if (keyValue.length == 2) { map.put(keyValue[0], keyValue[1]); } else { throw new IllegalArgumentException(token); } } }
Example #9
Source File: ConnectionTune.java From qpid-broker-j with Apache License 2.0 | 6 votes |
@Override public Map<String,Object> getFields() { Map<String,Object> result = new LinkedHashMap<String,Object>(); if ((packing_flags & 256) != 0) { result.put("channelMax", getChannelMax()); } if ((packing_flags & 512) != 0) { result.put("maxFrameSize", getMaxFrameSize()); } if ((packing_flags & 1024) != 0) { result.put("heartbeatMin", getHeartbeatMin()); } if ((packing_flags & 2048) != 0) { result.put("heartbeatMax", getHeartbeatMax()); } return result; }
Example #10
Source File: IPv6RemoteATCommandRequestPacketTest.java From xbee-java with Mozilla Public License 2.0 | 6 votes |
/** * Test method for {@link com.digi.xbee.api.packet.thread.IPv6RemoteATCommandRequestPacket#getAPIPacketParameters()}. * * <p>Test the get API parameters but with a parameter value.</p> */ @Test public final void testGetAPIPacketParametersATCommandParameterByteArrayNonStringCmd() { // Setup the resources for the test. String command = "DL"; byte[] parameter = new byte[]{0x6D, 0x79}; IPv6RemoteATCommandRequestPacket packet = new IPv6RemoteATCommandRequestPacket(frameID, ipv6address, transmitOptions, command, parameter); String expectedDestAddr = HexUtils.prettyHexString(ipv6address.getAddress()) + " (" + ipv6address.getHostAddress() + ")"; String expectedOptions = HexUtils.prettyHexString(HexUtils.integerToHexString(transmitOptions, 1)); String expectedATCommand = HexUtils.prettyHexString(command.getBytes()) + " (" + command + ")"; String expectedATParameter = HexUtils.prettyHexString(parameter); // Call the method under test. LinkedHashMap<String, String> packetParams = packet.getAPIPacketParameters(); // Verify the result. assertThat("Packet parameters map size is not the expected one", packetParams.size(), is(equalTo(4))); assertThat("Destination IPv6 Address is not the expected one", packetParams.get("Destination address"), is(equalTo(expectedDestAddr))); assertThat("Command options are not the expected one", packetParams.get("Command options"), is(equalTo(expectedOptions))); assertThat("AT Command is not the expected one", packetParams.get("AT Command"), is(equalTo(expectedATCommand))); assertThat("AT Parameter is not the expected one", packetParams.get("Parameter"), is(equalTo(expectedATParameter))); }
Example #11
Source File: ClassPath.java From codebuff with BSD 2-Clause "Simplified" License | 6 votes |
@VisibleForTesting static ImmutableMap<File, ClassLoader> getClassPathEntries(ClassLoader classloader) { LinkedHashMap<File, ClassLoader> entries = Maps.newLinkedHashMap(); // Search parent first, since it's the order ClassLoader#loadClass() uses. ClassLoader parent = classloader.getParent(); if (parent != null) { entries.putAll(getClassPathEntries(parent)); } if (classloader instanceof URLClassLoader) { URLClassLoader urlClassLoader = (URLClassLoader) classloader; for (URL entry : urlClassLoader.getURLs()) { if (entry.getProtocol().equals("file")) { File file = new File(entry.getFile()); if (!entries.containsKey(file)) { entries.put(file, classloader); } } } } return ImmutableMap.copyOf(entries); }
Example #12
Source File: IsPojo.java From java-hamcrest with Apache License 2.0 | 6 votes |
@Override protected boolean matchesSafely(A item, Description mismatchDescription) { if (!cls().isInstance(item)) { mismatchDescription.appendText("not an instance of " + cls().getName()); return false; } final Map<String, Consumer<Description>> mismatches = new LinkedHashMap<>(); methodHandlers().forEach( (methodName, handler) -> matchMethod(item, handler).ifPresent(descriptionConsumer -> mismatches.put(methodName, descriptionConsumer))); if (!mismatches.isEmpty()) { mismatchDescription.appendText(cls().getSimpleName()).appendText(" "); DescriptionUtils.describeNestedMismatches( methodHandlers().keySet(), mismatchDescription, mismatches, IsPojo::describeMethod); return false; } return true; }
Example #13
Source File: ReaderGroupState.java From pravega with Apache License 2.0 | 6 votes |
ReaderGroupState(String scopedSynchronizerStream, Revision revision, ReaderGroupConfig config, Map<SegmentWithRange, Long> segmentsToOffsets, Map<Segment, Long> endSegments) { Exceptions.checkNotNullOrEmpty(scopedSynchronizerStream, "scopedSynchronizerStream"); Preconditions.checkNotNull(revision); Preconditions.checkNotNull(config); Exceptions.checkNotNullOrEmpty(segmentsToOffsets.entrySet(), "segmentsToOffsets"); this.scopedSynchronizerStream = scopedSynchronizerStream; this.config = config; this.revision = revision; this.checkpointState = new CheckpointState(); this.distanceToTail = new HashMap<>(); this.futureSegments = new HashMap<>(); this.assignedSegments = new HashMap<>(); this.unassignedSegments = new LinkedHashMap<>(segmentsToOffsets); this.lastReadPosition = new HashMap<>(segmentsToOffsets); this.endSegments = ImmutableMap.copyOf(endSegments); }
Example #14
Source File: AptoideUtils.java From aptoide-client-v8 with GNU General Public License v3.0 | 6 votes |
public static Map<String, String> splitQuery(URI uri) throws UnsupportedEncodingException { Map<String, String> query_pairs = new LinkedHashMap<>(); String query = uri.getQuery(); if (query != null) { String[] pairs = query.split("&"); if (pairs != null) { for (String pair : pairs) { int idx = pair.indexOf("="); if (idx > 0 && idx + 1 < pair.length()) { query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); } } } } return query_pairs; }
Example #15
Source File: ConfigProviderOSGITest.java From carbon-kernel with Apache License 2.0 | 6 votes |
@Test public void testConfigurationProvider() throws ConfigurationException { CarbonConfiguration carbonConfiguration = configProvider.getConfigurationObject( CarbonConfiguration.class); String id = carbonConfiguration.getId(); String name = carbonConfiguration.getName(); String tenant = carbonConfiguration.getTenant(); Assert.assertEquals(id, "carbon-kernel", "id should be carbon-kernel"); Assert.assertEquals(name, "WSO2 Carbon Kernel", "name should be WSO2 Carbon Kernel"); Assert.assertEquals(tenant, "default", "tenant should be default"); Map secureVaultConfiguration = (LinkedHashMap) configProvider.getConfigurationObject("wso2.securevault"); Assert.assertEquals(((LinkedHashMap) (secureVaultConfiguration.get("secretRepository"))).get("type"), "org.wso2.carbon.secvault.repository.DefaultSecretRepository", "Default secret repository would be " + "org.wso2.carbon.secvault.repository.DefaultSecretRepository"); Assert.assertEquals(((LinkedHashMap) (secureVaultConfiguration.get("masterKeyReader"))).get("type"), "org.wso2.carbon.secvault.reader.DefaultMasterKeyReader", "Default master key reader would be " + "org.wso2.carbon.secvault.reader.DefaultMasterKeyReader"); }
Example #16
Source File: OracleSyncTest.java From canal-1.1.3 with Apache License 2.0 | 6 votes |
@Test public void test01() { Dml dml = new Dml(); dml.setDestination("example"); dml.setTs(new Date().getTime()); dml.setType("INSERT"); dml.setDatabase("mytest"); dml.setTable("user"); List<Map<String, Object>> dataList = new ArrayList<>(); Map<String, Object> data = new LinkedHashMap<>(); dataList.add(data); data.put("id", 1L); data.put("name", "Eric"); data.put("role_id", 1L); data.put("c_time", new Date()); data.put("test1", "sdfasdfawe中国asfwef"); dml.setData(dataList); rdbAdapter.sync(Collections.singletonList(dml)); }
Example #17
Source File: KeyValueOption.java From hottub with GNU General Public License v2.0 | 6 votes |
private void initialize() { if (getValue() == null) { return; } map = new LinkedHashMap<>(); final StringTokenizer st = new StringTokenizer(getValue(), ","); while (st.hasMoreElements()) { final String token = st.nextToken(); final String[] keyValue = token.split(":"); if (keyValue.length == 1) { map.put(keyValue[0], ""); } else if (keyValue.length == 2) { map.put(keyValue[0], keyValue[1]); } else { throw new IllegalArgumentException(token); } } }
Example #18
Source File: SimplifyCountOverConstant.java From presto with Apache License 2.0 | 5 votes |
@Override public Result apply(AggregationNode parent, Captures captures, Context context) { ProjectNode child = captures.get(CHILD); boolean changed = false; Map<Symbol, AggregationNode.Aggregation> aggregations = new LinkedHashMap<>(parent.getAggregations()); for (Entry<Symbol, AggregationNode.Aggregation> entry : parent.getAggregations().entrySet()) { Symbol symbol = entry.getKey(); AggregationNode.Aggregation aggregation = entry.getValue(); if (isCountOverConstant(aggregation, child.getAssignments())) { changed = true; aggregations.put(symbol, new AggregationNode.Aggregation( countFunction, ImmutableList.of(), false, Optional.empty(), Optional.empty(), aggregation.getMask())); } } if (!changed) { return Result.empty(); } return Result.ofPlanNode(new AggregationNode( parent.getId(), child, aggregations, parent.getGroupingSets(), ImmutableList.of(), parent.getStep(), parent.getHashSymbol(), parent.getGroupIdSymbol())); }
Example #19
Source File: BasicJsonReader.java From xxl-tool with GNU General Public License v3.0 | 5 votes |
private Map<String, Object> parseMapInternal(String json) { Map<String, Object> map = new LinkedHashMap<String, Object>(); json = trimLeadingCharacter(trimTrailingCharacter(json, '}'), '{'); for (String pair : tokenize(json)) { String[] values = trimArrayElements(split(pair, ":")); String key = trimLeadingCharacter(trimTrailingCharacter(values[0], '"'), '"'); Object value = parseInternal(values[1]); map.put(key, value); } return map; }
Example #20
Source File: AbstractJaxRsFeatureIterator.java From netbeans with Apache License 2.0 | 5 votes |
static MethodTree createMethod(GenerationUtils genUtils,TreeMaker maker, String name , String returnType, LinkedHashMap<String,String> methodParams, String body) { ModifiersTree modifiers = maker.Modifiers(EnumSet.of(Modifier.PUBLIC)); List<VariableTree> params=new ArrayList<VariableTree>(); ModifiersTree noModifier = maker.Modifiers(Collections.<Modifier>emptySet()); for(Entry<String,String> entry: methodParams.entrySet()){ String paramName = entry.getKey(); String paramType = entry.getValue(); params.add(maker.Variable(noModifier, paramName, maker.Type(paramType), null)); } Tree returnTree ; String resultBody ; if (returnType == null) { returnTree = maker.PrimitiveType(TypeKind.VOID); resultBody = "{}"; // NOI18N } else { returnTree = maker.Type(returnType); resultBody = "{ return null; }"; // NOI18N } if ( body!= null ){ resultBody = body; } return maker.Method( maker.addModifiersAnnotation(modifiers, genUtils.createAnnotation( Override.class.getCanonicalName())), name, returnTree, Collections.<TypeParameterTree>emptyList(), params, Collections.<ExpressionTree>emptyList(), resultBody, null); }
Example #21
Source File: TestRemoveOneClauseHeuristic.java From solr-researcher with Apache License 2.0 | 5 votes |
private Map<Pattern, Analyzer> createCJKAnalyzer() { Analyzer analyzer = new CJKAnalyzer(); Map<Pattern, Analyzer> fieldAnalyzerMaps = new LinkedHashMap<Pattern, Analyzer>(); Pattern fieldPattern = Pattern.compile("cjk"); fieldAnalyzerMaps.put(fieldPattern, analyzer); return fieldAnalyzerMaps; }
Example #22
Source File: InternalWorkbook.java From lams with GNU General Public License v2.0 | 5 votes |
private InternalWorkbook() { records = new WorkbookRecordList(); boundsheets = new ArrayList<BoundSheetRecord>(); formats = new ArrayList<FormatRecord>(); hyperlinks = new ArrayList<HyperlinkRecord>(); numxfs = 0; numfonts = 0; maxformatid = -1; uses1904datewindowing = false; escherBSERecords = new ArrayList<EscherBSERecord>(); commentRecords = new LinkedHashMap<String, NameCommentRecord>(); }
Example #23
Source File: VirtualMachineScaleSetVMImpl.java From azure-libraries-for-java with MIT License | 5 votes |
@Override public Map<String, String> tags() { if (this.inner().getTags() == null) { return Collections.unmodifiableMap(new LinkedHashMap<String, String>()); } return Collections.unmodifiableMap(this.inner().getTags()); }
Example #24
Source File: TupleTypeInfo.java From cascading-flink with Apache License 2.0 | 5 votes |
public TupleTypeInfo(Fields schema) { super(Tuple.class); this.schema = schema; this.fieldIndexes = new HashMap<String, Integer>(); if(schema.isDefined()) { this.length = schema.size(); this.fieldTypes = new LinkedHashMap<String, FieldTypeInfo>(this.length); Comparator[] comps = schema.getComparators(); Class[] typeClasses = schema.getTypesClasses(); for(int i=0; i<length; i++) { String fieldName = getFieldName(i); FieldTypeInfo fieldType = getFieldTypeInfo(i, typeClasses, comps); this.fieldTypes.put(fieldName, fieldType); this.fieldIndexes.put(fieldName, i); } } else { if(schema.isUnknown()) { this.length = -1; this.fieldTypes = new LinkedHashMap<String, FieldTypeInfo>(16); this.fieldTypes.put("0", new FieldTypeInfo()); this.fieldIndexes.put("0", 0); } else { throw new IllegalArgumentException("Unsupported Fields: "+schema); } } }
Example #25
Source File: ContractAbi.java From api with Apache License 2.0 | 5 votes |
public ContractAbi(Types.ContractABI abi) { validateAbi(abi); this.messages = new LinkedHashMap<>(); this.abi = abi; this.deploy = this.createEncoded("deploy", abi.deploy); for (Types.ContractABIMethod method : abi.messages) { String name = Utils.stringCamelCase(method.name); this.messages.put(name, this.createEncoded("messages." + name, method)); } }
Example #26
Source File: DataMessageComponent.java From dawnsci with Eclipse Public License 1.0 | 5 votes |
/** * Renames a list in the DataMessageComponent * @param existing * @param name * @return true if the name replaced was already there. */ public boolean renameList(String existing, String name) { if (list==null) return false; Map<String,Serializable> map = new LinkedHashMap<String,Serializable>(1); map.putAll(list); final Serializable set = map.remove(existing); if (set instanceof IDataset) { ((IDataset)set).setName(name); } boolean replaced = map.put(name, set) != null; this.list = map; return replaced; }
Example #27
Source File: VulnerabilityServiceTest.java From pacbot with Apache License 2.0 | 5 votes |
@Test public void getVulnerabilitySummaryByAssetsTest() throws Exception { ReflectionTestUtils.setField(vulnerabilityService, "vulnTypes", "ec2,onpremserver"); when(vulnerabilityRepository.getRunningInstancesCount(anyString(), anyString())).thenReturn(10L); when(vulnerabilityRepository.getExemptedByRuleCount(anyString(), anyString())).thenReturn(1L); ResponseWithOrder responseWithOrder = new ResponseWithOrder(); List<LinkedHashMap<String, Object>> response = new ArrayList<>(); LinkedHashMap<String, Object> obj = new LinkedHashMap<>(); obj.put("assetsScanned", 5); obj.put("failed", 2); obj.put("passed", 2); response.add(obj); responseWithOrder.setResponse(response); Map<String, Object> responseMap = new HashMap<>(); responseMap.put("response", response); ResponseEntity<Object> nonCompliancePolicyRuleresponse = ResponseUtils.buildSucessResponse(responseMap); when(complianceServiceClient.getNonCompliancePolicyByRule(any(Request.class))) .thenReturn(nonCompliancePolicyRuleresponse); // when(complianceServiceClient.getRulecompliance(any(Request.class))).thenReturn(responseWithOrder); Map<String, Object> compliant = new HashMap<>(); compliant.put("S3", 2); compliant.put("S4", 2); Map<String, Object> nonCompliant = new HashMap<>(); nonCompliant.put("S3", 3); nonCompliant.put("S4", 2); nonCompliant.put("S5", 1); when(vulnerabilityRepository.getNonCompliantResourceIds(anyString())).thenReturn(new ArrayList<>()); when(vulnerabilityRepository.getCompliantHostsBySeverity(anyString())).thenReturn(compliant); when(vulnerabilityRepository.getUniqueHostBySeverity(anyString(), anyString())).thenReturn(nonCompliant); assertThat(vulnerabilityService.getVulnerabilitySummaryByAssets("ag").get(Constants.COUNT), is(20L)); }
Example #28
Source File: B3PropagatorTest.java From opentelemetry-java with Apache License 2.0 | 5 votes |
@Test public void inject_invalidContext_SingleHeader() { Map<String, String> carrier = new LinkedHashMap<>(); b3PropagatorSingleHeader.inject( withSpanContext( SpanContext.create( TraceId.getInvalid(), SpanId.getInvalid(), SAMPLED_TRACE_OPTIONS, TraceState.builder().set("foo", "bar").build()), Context.current()), carrier, setter); assertThat(carrier).hasSize(0); }
Example #29
Source File: Bounds.java From org.alloytools.alloy with Apache License 2.0 | 5 votes |
/** * Constructs new Bounds over the given universe. * * @ensures this.universe' = universe && no this.relations' && no this.intBound' * @throws NullPointerException universe = null */ public Bounds(Universe universe) { this.factory = universe.factory(); this.lowers = new LinkedHashMap<Relation,TupleSet>(); this.uppers = new LinkedHashMap<Relation,TupleSet>(); this.intbounds = new TreeSequence<TupleSet>(); this.relations = relations(lowers, uppers); this.atom2rel = new HashMap<Object,Relation>(); }
Example #30
Source File: CrushRebalanceStrategy.java From helix with Apache License 2.0 | 5 votes |
@Override public void init(String resourceName, final List<String> partitions, final LinkedHashMap<String, Integer> states, int maximumPerNode) { _resourceName = resourceName; _partitions = partitions; _replicas = countStateReplicas(states); }