当前位置: 首页 > news >正文

深圳网站制作平台酒店网站建设方案ppt

深圳网站制作平台,酒店网站建设方案ppt,做门户网站用什么系统好,中国建设银行怎么添加卡网站1. ABS函数 ABS 函数可用于返回数字的绝对值 2. 函数用法 ABS(number) 3. 函数示例 如#xff0c;ABS(-12)和ABS(12)的返回结果均为 12。 4. 代码实战 首先我们在function包下创建math包#xff0c;在math包下创建AbsFunction类#xff0c;代码如下#xff1a; pac…1. ABS函数 ABS 函数可用于返回数字的绝对值 2. 函数用法 ABS(number) 3. 函数示例 如ABS(-12)和ABS(12)的返回结果均为 12。 4. 代码实战 首先我们在function包下创建math包在math包下创建AbsFunction类代码如下 package com.ql.util.express.self.combat.function.math;import com.ql.util.express.Operator; import com.ql.util.express.self.combat.exception.FormulaException;/*** 类描述: ABS函数** author admin* version 1.0.0* date 2023/11/23 8:57*/ public class AbsFunction extends Operator {public AbsFunction(String name) {this.name name;}Overridepublic Object executeInner(Object[] list) throws Exception {if (list.length 0) {throw new FormulaException(操作数异常);}// 取出来数据Object result list[0];if (result instanceof Integer) {int val ((Integer) result).intValue();// 调用Math函数提供的取绝对值的方法result Math.abs(val);} else if (result instanceof Double) {double val ((Double) result).doubleValue();result Math.abs(val);} else if (result instanceof Float) {double val ((Float) result).floatValue();result Math.abs(val);} else if (result instanceof Long) {long val ((Long) result).longValue();result Math.abs(val);} else if (result instanceof Short) {short val ((Short) result).shortValue();result Math.abs(val);} else {throw new FormulaException(参数数据类型异常);}return result;} } 把AbsFunction类注册到公式函数入口类中代码如下 package com.ql.util.express.self.combat.ext;import com.ql.util.express.ExpressRunner; import com.ql.util.express.IExpressResourceLoader; import com.ql.util.express.parse.NodeTypeManager; import com.ql.util.express.self.combat.function.logic.*; import com.ql.util.express.self.combat.function.math.AbsFunction;/*** 类描述: 仿简道云公式函数实战入口类** author admin* version 1.0.0* date 2023/11/21 15:29*/ public class FormulaRunner extends ExpressRunner {public FormulaRunner() {super();}public FormulaRunner(boolean isPrecise, boolean isTrace) {super(isPrecise,isTrace);}public FormulaRunner(boolean isPrecise, boolean isStrace, NodeTypeManager nodeTypeManager) {super(isPrecise,isStrace,nodeTypeManager);}public FormulaRunner(boolean isPrecise, boolean isTrace, IExpressResourceLoader iExpressResourceLoader, NodeTypeManager nodeTypeManager) {super(isPrecise,isTrace,iExpressResourceLoader,nodeTypeManager);}Overridepublic void addSystemFunctions() {// ExpressRunner 的内部系统函数super.addSystemFunctions();// 扩展公式函数this.customFunction();}/**** 自定义公式函数*/public void customFunction() {// 逻辑公式函数this.addLogicFunction();// 数学公式函数this.addMathFunction();}public void addLogicFunction() {// AND函数this.addFunction(AND,new AndFunction(AND));// IF函数this.addFunction(IF,new IfFunction(IF));// IFS函数this.addFunction(IFS,new IfsFunction(IFS));// XOR函数this.addFunction(XOR,new XorFunction(XOR));// TRUE函数this.addFunction(TRUE,new TrueFunction(TRUE));// FALSE函数this.addFunction(FALSE,new FalseFunction(FALSE));// NOT函数this.addFunction(NOT,new NotFunction(NOT));// OR函数this.addFunction(OR,new OrFunction(OR));}public void addMathFunction() {// ABS函数this.addFunction(ABS,new AbsFunction(ABS));} } 创建测试用例 package com.ql.util.express.self.combat;import com.ql.util.express.DefaultContext; import com.ql.util.express.self.combat.ext.FormulaRunner; import org.junit.Test;/*** 类描述: 实战测试类** author admin* version 1.0.0* date 2023/11/21 15:45*/ public class CombatTest {Testpublic void ABS() throws Exception{FormulaRunner formulaRunner new FormulaRunner(true,true);// 创建上下文DefaultContextString, Object context new DefaultContext();String express ABS(-4294967294);context.put(a,-11.1111);context.put(b,3.0);Object object formulaRunner.execute(express, context, null, true, true);System.out.println(object);}} 运行结果
http://www.pierceye.com/news/690262/

相关文章:

  • 网站建设预付款比例网站平台建设公司经营范围
  • 付费阅读网站代码CMS源码就可以做网站吗
  • 企业网站用视频做首页wordpress 多主题插件下载
  • 阿里巴巴网官方网站新公司在哪做网站
  • 邢台专业做网站报价做一门户网站价格
  • 中山企业手机网站建设设计方案翻译
  • 江苏省品牌专业群建设专题网站wordpress 返利 插件
  • 建设部网站官网设计排版网站
  • 企业网站建设应避免数据孤岛网站建设费入何科目
  • wordpress数据量大网站访问石家庄网站建设招商
  • 公司核名在哪个网站免费申请无限流量卡
  • 做网站和网页的目的和作用是什么山西2地又检出阳性
  • 自助网站建设推广优化策略wordpress中文采集插件
  • 网站开发及运营成本做网站 公司 个体
  • 永久免费建站地址苏州h5网站建设价钱
  • 室内设计网站网站建设中请稍后再访问
  • 十堰网站开发培训编程软件手机
  • 南京网站优化推广微网站缺点
  • 大连零基础网站建设培训哪里有固安县建设局网站
  • 怎么制作网站首页培训心得体会总结简短
  • 商务网站建设 模板长春高端品牌网站建设
  • 做网站比较便宜办公资源网
  • 公司怎么做网页网站遵义网站设计公司
  • 网站建设毕业设计yy直播回放
  • 响应式网站有哪些2017淮南网络推广报价
  • 兰州公司网站建设网站建设筹备方案
  • 租房网站建设做一个跨境电商网站
  • 网站设计制作过程容桂做pc端网站
  • 宜昌市上海中学官网seo文章外包
  • 加强普法网站建设的通知制作婚恋网站