当前位置: 首页>>代码示例>>Java>>正文


Java ValueUtil.integerValueOf方法代码示例

本文整理汇总了Java中org.eclipse.ocl.pivot.utilities.ValueUtil.integerValueOf方法的典型用法代码示例。如果您正苦于以下问题:Java ValueUtil.integerValueOf方法的具体用法?Java ValueUtil.integerValueOf怎么用?Java ValueUtil.integerValueOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ocl.pivot.utilities.ValueUtil的用法示例。


在下文中一共展示了ValueUtil.integerValueOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TypeDifferentContainer

import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public boolean TypeDifferentContainer(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
	/**
	 *
	 * inv TypeDifferentContainer:
	 *   let
	 *     severity : Integer[1] = 'ArrayType::TypeDifferentContainer'.getSeverity()
	 *   in
	 *     if severity <= 0
	 *     then true
	 *     else
	 *       let result : Boolean[1] = self.type <> self
	 *       in
	 *         'ArrayType::TypeDifferentContainer'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
	 *     endif
	 */
	final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
	final /*@NonInvalid*/ IntegerValue severity_0 = ValueUtil.integerValueOf(4);//CGStringGetSeverityOperation.INSTANCE.evaluate(executor, OCCITables.STR_ArrayType_c_c_TypeDifferentContainer);
	final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, OCCITables.INT_0).booleanValue();
	/*@NonInvalid*/ boolean symbol_0;
	if (le) {
		symbol_0 = ValueUtil.TRUE_VALUE;
	}
	else {
		final /*@NonInvalid*/ DataType type = this.getType();
		final /*@NonInvalid*/ boolean result = !type.equals(this);
		final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, OCCITables.STR_ArrayType_c_c_TypeDifferentContainer, this, (Object)null, diagnostics, context, (Object)null, severity_0, result, OCCITables.INT_0).booleanValue();
		symbol_0 = logDiagnostic;
	}
	return Boolean.TRUE == symbol_0;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:36,代码来源:ArrayTypeImpl.java

示例2: UniqueVlan

import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public boolean UniqueVlan(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
	/**
	 *
	 * inv UniqueVlan:
	 *   let severity : Integer[1] = 'Network::UniqueVlan'.getSeverity()
	 *   in
	 *     if severity <= 0
	 *     then true
	 *     else
	 *       let
	 *         result : occi::Boolean[1] = Network.allInstances()
	 *         ->isUnique(occiNetworkVlan)
	 *       in
	 *         'Network::UniqueVlan'.logDiagnostic(self, null, diagnostics, context, null, severity, result, 0)
	 *     endif
	 */
	final /*@NonInvalid*/ Executor executor = PivotUtilInternal.getExecutor(this);
	final /*@NonInvalid*/ IdResolver idResolver = executor.getIdResolver();
	final /*@NonInvalid*/ IntegerValue severity_0 = CGStringGetSeverityOperation.INSTANCE.evaluate(executor, InfrastructureTables.STR_Network_c_c_UniqueVlan);
	final /*@NonInvalid*/ boolean le = OclComparableLessThanEqualOperation.INSTANCE.evaluate(executor, severity_0, InfrastructureTables.INT_0).booleanValue();
	/*@NonInvalid*/ boolean symbol_0;
	if (le) {
		symbol_0 = ValueUtil.TRUE_VALUE;
	}
	else {
		/*@Caught*/ /*@NonNull*/ Object CAUGHT_result;
		try {
			final /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_infrastructure_c_c_Network = idResolver.getClass(InfrastructureTables.CLSSid_Network, null);
			final /*@NonInvalid*/ SetValue allInstances = ClassifierAllInstancesOperation.INSTANCE.evaluate(executor, InfrastructureTables.SET_CLSSid_Network, TYP_infrastructure_c_c_Network);
			/*@Thrown*/ SetValue.Accumulator accumulator = ValueUtil.createSetAccumulatorValue(InfrastructureTables.SET_CLSSid_Network);
			/*@NonNull*/ Iterator<Object> ITERATOR__1 = allInstances.iterator();
			/*@Thrown*/ boolean result;
			while (true) {
				if (!ITERATOR__1.hasNext()) {
					result = ValueUtil.TRUE_VALUE;
					break;
				}
				/*@NonInvalid*/ Network _1 = (Network)ITERATOR__1.next();
				/**
				 * occiNetworkVlan
				 */
				final /*@NonInvalid*/ Integer occiNetworkVlan = _1.getOcciNetworkVlan();
				final /*@NonInvalid*/ IntegerValue BOXED_occiNetworkVlan = occiNetworkVlan == null ? null : ValueUtil.integerValueOf(occiNetworkVlan);
				//
				if (accumulator.includes(BOXED_occiNetworkVlan) == ValueUtil.TRUE_VALUE) {
					result = ValueUtil.FALSE_VALUE;			// Abort after second find
					break;
				}
				else {
					accumulator.add(BOXED_occiNetworkVlan);
				}
			}
			CAUGHT_result = result;
		}
		catch (Exception e) {
			CAUGHT_result = ValueUtil.createInvalidValue(e);
		}
		final /*@NonInvalid*/ boolean logDiagnostic = CGStringLogDiagnosticOperation.INSTANCE.evaluate(executor, TypeId.BOOLEAN, InfrastructureTables.STR_Network_c_c_UniqueVlan, this, (Object)null, diagnostics, context, (Object)null, severity_0, CAUGHT_result, InfrastructureTables.INT_0).booleanValue();
		symbol_0 = logDiagnostic;
	}
	return Boolean.TRUE == symbol_0;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:68,代码来源:NetworkImpl.java

示例3: getEOppositeReference

import org.eclipse.ocl.pivot.utilities.ValueUtil; //导入方法依赖的package包/类
protected @NonNull EReference getEOppositeReference(@NonNull EReference eReference) {
	EReference eOppositeReference = eReference.getEOpposite();
	if (eOppositeReference == null) {
		EOppositeReferenceImpl eOppositeReference2 = eReference2eOppositeReference.get(eReference);
		if (eOppositeReference2 == null) {
			eOppositeReference2 = new EOppositeReferenceImpl(eReference);
			EAnnotation oppositeRole = eReference.getEAnnotation(EMOFExtendedMetaData.EMOF_PROPERTY_OPPOSITE_ROLE_NAME_ANNOTATION_SOURCE);
			if (oppositeRole != null) {
				EMap<String, String> details = oppositeRole.getDetails();
				String oppositeName = details.get(EMOFExtendedMetaData.EMOF_COMMENT_BODY);
				if (oppositeName != null) {
					eOppositeReference2.setName(oppositeName);
					String lowerValue = details.get("lower");
					IntegerValue lower = lowerValue != null ? ValueUtil.integerValueOf(lowerValue) :  PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_LOWER_VALUE;
					if (lower.isInvalid()) {
						//							logger.error("Invalid " + PROPERTY_OPPOSITE_ROLE_LOWER_KEY + " " + lower);
						lower = PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_LOWER_VALUE;
					}
					eOppositeReference2.setLowerBound(lower.intValue());
					String upperValue = details.get("upper");
					UnlimitedNaturalValue upper = upperValue != null ? ValueUtil.unlimitedNaturalValueOf(upperValue) : PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_UPPER_VALUE;
					if (upper.isInvalid()) {
						//							logger.error("Invalid " + PROPERTY_OPPOSITE_ROLE_UPPER_KEY + " " + upper);
						upper = PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_UPPER_VALUE;
					}
					eOppositeReference2.setUpperBound(upper.isUnlimited() ? -1 : upper.intValue());
					if (!upper.equals(ValueUtil.ONE_VALUE)) {
						String uniqueValue = details.get("unique");
						boolean isUnique = uniqueValue != null ? Boolean.valueOf(uniqueValue) : PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_UNIQUE;
						eOppositeReference2.setUnique(isUnique);
						String orderedValue = details.get("ordered");
						boolean isOrdered = orderedValue != null ? Boolean.valueOf(orderedValue) : PivotConstantsInternal.ANNOTATED_IMPLICIT_OPPOSITE_ORDERED;
						eOppositeReference2.setOrdered(isOrdered);
					}
				}
			}
			eReference2eOppositeReference.put(eReference, eOppositeReference2);
		}
		eOppositeReference = eOppositeReference2;
	}
	return eOppositeReference;
}
 
开发者ID:adolfosbh,项目名称:cs2as,代码行数:43,代码来源:LazyObjectManager.java


注:本文中的org.eclipse.ocl.pivot.utilities.ValueUtil.integerValueOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。