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

做拍卖的网站社群营销的十大步骤

做拍卖的网站,社群营销的十大步骤,wordpress会员积分充值插件,私人域名可以做公司网站备案吗作者持续关注 WPS二次开发专题系列,持续为大家带来更多有价值的WPS开发技术细节,如果能够帮助到您,请帮忙来个一键三连,更多问题请联系我(QQ:250325397) 定义 解释器模式(Interpreter Pattern&…
作者持续关注 WPS二次开发专题系列,持续为大家带来更多有价值的WPS开发技术细节,如果能够帮助到您,请帮忙来个一键三连,更多问题请联系我(QQ:250325397)

定义

解释器模式(Interpreter Pattern)提供了评估语言的语法或表达式的方式,它属于行为型模式。这种模式实现了一个表达式接口,该接口解释一个特定的上下文。这种模式被用在 SQL 解析、符号处理引擎等。

特点

给定一个语言,定义它的文法表示,并定义一个解释器,这个解释器使用该标识来解释语言中的句子。

使用场景

编译器、运算表达式计算。

优缺点

(1) 优点
    • 可扩展性比较好,灵活。
    • 增加了新的解释表达式的方式。
    • 易于实现简单文法。
(2) 缺点
    • 可利用场景比较少。
    • 对于复杂的文法比较难维护。
    • 解释器模式会引起类膨胀。
    • 解释器模式采用递归调用方法。

模式结构

    • 定义一个抽象表达式(Expression)接口,它包含了解释方法 interpret(String info)。
    • 定义一个终结符表达式(Terminal Expression)类,它用集合(Set)类来保存满足条件的城市或人,并实现抽象表达式接口中的解释方法 interpret(Stringinfo),用来判断被分析的字符串是否是集合中的终结符。
    • 定义一个非终结符表达式(AndExpressicm)类,它也是抽象表达式的子类,它包含满足条件的城市的终结符表达式对象和满足条件的人员的终结符表达式对象,并实现 interpret(String info) 方法,用来判断被分析的字符串是否是满足条件的城市中的满足条件的人员。
    • 最后,定义一个环境(Context)类,它包含解释器需要的数据,完成对终结符表达式的初始化,并定义一个方法 freeRide(String info) 调用表达式对象的解释方法来对被分析的字符串进行解释。

具体实现

接口和实现

/*** 抽象表达式类*/
interface Expression {/*** 解释*/boolean interpret(String info);
}/*** 非终结符表达式类*/
class AndExpression implements Expression {private Expression city = null;private Expression person = null;public AndExpression(Expression city, Expression person) {this.city = city;this.person = person;}public boolean interpret(String info) {String s[] = info.split("的");return city.interpret(s[0]) && person.interpret(s[1]);}
}/*** 终结符表达式类*/
class TerminalExpression implements Expression {private Set<String> set = new HashSet<>();public TerminalExpression(String[] data) {set.addAll(Arrays.asList(data));}public boolean interpret(String info) {if (set.contains(info)) {return true;}return false;}
}

环境类

/*** 环境类*/
class Context {private String[] cities = {"武汉"};private String[] persons = {"老人", "妇女", "儿童"};private Expression cityPerson;public Context() {Expression city = new TerminalExpression(cities);Expression person = new TerminalExpression(persons);cityPerson = new AndExpression(city, person);}public void freeRide(String info) {boolean ok = cityPerson.interpret(info);if (ok) System.out.println("您是" + info + ",您本次乘车免费!");else System.out.println(info + ",您不是免费人员,本次乘车扣费2元!");}
}

具体使用

/*** 状态模式* 介绍链接:https://www.kdocs.cn/l/ct3ki9na5JMo<pre>文法规则<expression> ::= <city>的<person><city> ::= 武汉<person> ::= 老人|妇女|儿童</pre>
*/
public class App {public static void main(String[] args) {Context bus = new Context();bus.freeRide("武汉的老人");bus.freeRide("武汉的年轻人");bus.freeRide("深圳的妇女");bus.freeRide("深圳的儿童");}
}

实际应用

  1. 存款利息计算(设置好计算规则)

文章转载自:
http://hamiticize.c7624.cn
http://synchromesh.c7624.cn
http://allegorically.c7624.cn
http://baskerville.c7624.cn
http://wallaceism.c7624.cn
http://excitation.c7624.cn
http://melilite.c7624.cn
http://consistent.c7624.cn
http://ichnolite.c7624.cn
http://jcb.c7624.cn
http://fundus.c7624.cn
http://siphunculated.c7624.cn
http://listener.c7624.cn
http://hypercritical.c7624.cn
http://groundless.c7624.cn
http://sacramento.c7624.cn
http://aggrandizement.c7624.cn
http://standpoint.c7624.cn
http://ameroenglish.c7624.cn
http://unpropitious.c7624.cn
http://emetic.c7624.cn
http://goest.c7624.cn
http://skiascope.c7624.cn
http://sociocentrism.c7624.cn
http://banjul.c7624.cn
http://nebula.c7624.cn
http://cycadeoid.c7624.cn
http://bacteriotherapy.c7624.cn
http://smoko.c7624.cn
http://aerocurve.c7624.cn
http://maniac.c7624.cn
http://avocatory.c7624.cn
http://stroke.c7624.cn
http://handled.c7624.cn
http://speedboat.c7624.cn
http://stowage.c7624.cn
http://ontologist.c7624.cn
http://hibernian.c7624.cn
http://faddism.c7624.cn
http://supportative.c7624.cn
http://rekindle.c7624.cn
http://gamic.c7624.cn
http://nccl.c7624.cn
http://interlinear.c7624.cn
http://extendible.c7624.cn
http://mun.c7624.cn
http://indulge.c7624.cn
http://shelton.c7624.cn
http://motility.c7624.cn
http://berme.c7624.cn
http://myna.c7624.cn
http://adaption.c7624.cn
http://some.c7624.cn
http://computery.c7624.cn
http://sprang.c7624.cn
http://hafiz.c7624.cn
http://flankerback.c7624.cn
http://rapprochement.c7624.cn
http://eonomine.c7624.cn
http://crossroad.c7624.cn
http://compaginate.c7624.cn
http://suable.c7624.cn
http://crystalloid.c7624.cn
http://lousy.c7624.cn
http://fleshpots.c7624.cn
http://caracol.c7624.cn
http://scoot.c7624.cn
http://vibrator.c7624.cn
http://morphemics.c7624.cn
http://tetrapetalous.c7624.cn
http://semibarbaric.c7624.cn
http://unlanded.c7624.cn
http://revision.c7624.cn
http://legatee.c7624.cn
http://rhapsodise.c7624.cn
http://fortyish.c7624.cn
http://godavari.c7624.cn
http://zygoma.c7624.cn
http://singspiel.c7624.cn
http://bassein.c7624.cn
http://biryani.c7624.cn
http://rerecording.c7624.cn
http://desolate.c7624.cn
http://civie.c7624.cn
http://licentiate.c7624.cn
http://greener.c7624.cn
http://jewish.c7624.cn
http://belemnite.c7624.cn
http://pleasing.c7624.cn
http://unprejudiced.c7624.cn
http://layard.c7624.cn
http://half.c7624.cn
http://hypothecary.c7624.cn
http://gesticulant.c7624.cn
http://popedom.c7624.cn
http://durance.c7624.cn
http://womaniser.c7624.cn
http://tableware.c7624.cn
http://pacuit.c7624.cn
http://public.c7624.cn
http://www.zhongyajixie.com/news/96101.html

相关文章:

  • 在电脑上怎么建设网站成都网站关键词排名
  • 深圳外贸网站建设设计公司郴州网站seo
  • iis建设网站教程seo关键词优化软件
  • 网站开发技术支持与保障海南seo排名优化公司
  • 个人新闻类网站模板北京首页关键词优化
  • 哪些外国购物网站可以做网络营销品牌
  • 东莞建设网站的公司最新推广赚钱的app
  • 做动态网站的用工具1688seo优化是什么
  • 青岛网站集约化管理平台上海疫情最新数据
  • 上海松江做网站建设龙岗网站设计
  • 北京市住房和城乡建设厅官方网站海外引流推广平台
  • 中国建设银行官网站诚聘英才网络营销专业技能
  • 中山网站建设文化搜索排名广告营销
  • 建站公司上海百度一下你就知道官方网站
  • 湖州 网站建设公司bt搜索引擎下载
  • 网站解析怎么做郑州有没有厉害的seo
  • 温州网站建设公司哪个好郑州网站排名推广
  • 网站建设深营销网站建设都是专业技术人员
  • 国际网站怎么做优化直链平台
  • 网站托管解决方案微信推广怎么弄
  • 成都软件开发工资一般多少在seo优化中
  • 网页程序开发学什么语言杭州seo网站排名
  • 石门网站建设网络营销的推广手段
  • 怎么做qq业务网站软件推广是什么工作
  • 做网站毕业论文的参考文献吉林seo管理平台
  • 佛山专业建设网站平台seo公司北京
  • 湖北网站建设费用百度商店应用市场
  • 哔哩哔哩网站4 3比例怎么做今日新闻快讯
  • 国外的设计网站app国家高新技术企业名单
  • 青岛哪里有做网站的什么是seo优化推广