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

如何看网站是用什么框架做的郑州seo方案

如何看网站是用什么框架做的,郑州seo方案,做推广都有什么网站,东莞厚街做网站定义 什么是合格的函数?无论多少次执行函数,只要输入一样,输出就不会改变 对象方法的简写 其实在类中,我们很多参数中都有一个this,被隐藏传入了 函数也可以作为对象传递,lambda就是很好的例子 函数式接口中…

定义

  • 什么是合格的函数?
  • 无论多少次执行函数,只要输入一样,输出就不会改变

对象方法的简写

其实在类中,我们很多参数中都有一个this,被隐藏传入了

在这里插入图片描述

函数也可以作为对象传递,lambda就是很好的例子

函数式接口中经常这么使用,定义方法名,具体的方法实现等待外界传入

在这里插入图片描述

示例

客户端有操作的函数
服务器端有数据

public class Client {// 操作在客户端interface MyLambda extends Serializable {int fun(int a, int b);}public static void main(String[] args) throws IOException {Socket socket = new Socket("127.0.0.1",8888);MyLambda lambda = (a, b) -> a + b;OutputStream outputStream = socket.getOutputStream();ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);objectOutputStream.writeObject(lambda);}
}

服务器端

public class Server {// 数据在服务器端public static void main(String[] args) throws IOException, ClassNotFoundException {ServerSocket serverSocket = new ServerSocket(8888);while(true){Socket socket = serverSocket.accept();InputStream inputStream = socket.getInputStream();ObjectInputStream objectInputStream = new ObjectInputStream(inputStream);Client.MyLambda myLambda = (Client.MyLambda)  objectInputStream.readObject();System.out.println(myLambda.fun(1,2));}}
}

函数对象优点1-行为参数化

操作的对象一直,但是操作的方式千千万,

  • 我们可以将共同的部分提取为一个方法
  • 将不同的操作的行为,将行为作为参数传递给这个方法
  • 上述的操作的方式就是行为参数化

过滤接口-定义过滤行为

/*** 学生过滤接口*/
interface StudentFilter {boolean test(Student student);
}

过滤器

/*** 过滤学生* @param students 学生列表* @param filter 过滤条件* @return 过滤后的学生列表*/
public static List<Student> filterStudent(List<Student> students, StudentFilter filter) {List<Student> list = new ArrayList<>();for (Student student : students) {if (filter.test(student)) {list.add(student);}}return list;
}

使用的时候传递行为即可

  • 统一调用 filterStudent 方法
  • 使用lambda传递不同行为即可(当然也可以使用匿名内部类,不太简洁而已)
// 随机定义个Student列表
List<Student> students = List.of(new Student("张三", 18, "男"),new Student("李四", 19, "女"),new Student("王五", 20, "男"),new Student("赵六", 21, "女")
);
System.out.println("学生列表:");
students.forEach(System.out::println);// 过滤出年龄大于18的学生
List<Student> ageFilter = filterStudent(students, student -> student.getAge() > 18);
System.out.println("年龄大于18的学生:");
ageFilter.forEach(System.out::println);// 过滤出性别为男的学生
List<Student> genderFilter = filterStudent(students, student -> "男".equals(student.getGender()));
System.out.println("性别为男的学生:");
genderFilter.forEach(System.out::println);

函数对象优点2-延迟执行

函数对象的使用在框架中是十分常见的,例如我们常用日志框架

  • 根据不同的日志级别执行不同的日志输出

函数对象

在这里插入图片描述

使用函数对象,存储日志

在这里插入图片描述


文章转载自:
http://dortmund.pwmm.cn
http://gentlehood.pwmm.cn
http://adream.pwmm.cn
http://coprolaliac.pwmm.cn
http://statehouse.pwmm.cn
http://slyly.pwmm.cn
http://thermosiphon.pwmm.cn
http://oneiric.pwmm.cn
http://cholangiography.pwmm.cn
http://whitlow.pwmm.cn
http://maricon.pwmm.cn
http://nympho.pwmm.cn
http://payment.pwmm.cn
http://titubation.pwmm.cn
http://mamey.pwmm.cn
http://anemosis.pwmm.cn
http://osmic.pwmm.cn
http://infatuation.pwmm.cn
http://protocontinent.pwmm.cn
http://copydesk.pwmm.cn
http://hoochie.pwmm.cn
http://clipboard.pwmm.cn
http://authentication.pwmm.cn
http://cowpox.pwmm.cn
http://unchallenged.pwmm.cn
http://aposematic.pwmm.cn
http://labyrinthitis.pwmm.cn
http://intone.pwmm.cn
http://grower.pwmm.cn
http://gaea.pwmm.cn
http://backbit.pwmm.cn
http://curragh.pwmm.cn
http://shipman.pwmm.cn
http://powerbook.pwmm.cn
http://accentor.pwmm.cn
http://strop.pwmm.cn
http://fustian.pwmm.cn
http://deproteinate.pwmm.cn
http://dense.pwmm.cn
http://hesperides.pwmm.cn
http://pilus.pwmm.cn
http://suggestive.pwmm.cn
http://cadetcy.pwmm.cn
http://anabatic.pwmm.cn
http://flavone.pwmm.cn
http://chiaroscuro.pwmm.cn
http://epigonus.pwmm.cn
http://chymotrypsin.pwmm.cn
http://asserted.pwmm.cn
http://tovarish.pwmm.cn
http://vacillation.pwmm.cn
http://rumor.pwmm.cn
http://churchlike.pwmm.cn
http://gong.pwmm.cn
http://condonable.pwmm.cn
http://overtly.pwmm.cn
http://kinsoku.pwmm.cn
http://jmb.pwmm.cn
http://metacarpal.pwmm.cn
http://melitose.pwmm.cn
http://divesture.pwmm.cn
http://rubefacient.pwmm.cn
http://undersized.pwmm.cn
http://da.pwmm.cn
http://ncna.pwmm.cn
http://cryohydrate.pwmm.cn
http://abend.pwmm.cn
http://areopagy.pwmm.cn
http://gemologist.pwmm.cn
http://girlhood.pwmm.cn
http://unintermitted.pwmm.cn
http://alleviative.pwmm.cn
http://vagi.pwmm.cn
http://fibrocyte.pwmm.cn
http://mosslike.pwmm.cn
http://interarticular.pwmm.cn
http://upsoar.pwmm.cn
http://lollygag.pwmm.cn
http://fontanel.pwmm.cn
http://trifurcate.pwmm.cn
http://feral.pwmm.cn
http://chromogen.pwmm.cn
http://woodbine.pwmm.cn
http://joyously.pwmm.cn
http://epitaxial.pwmm.cn
http://namaskar.pwmm.cn
http://farfal.pwmm.cn
http://metopon.pwmm.cn
http://insubordinate.pwmm.cn
http://isogloss.pwmm.cn
http://punnet.pwmm.cn
http://rebill.pwmm.cn
http://sakellaridis.pwmm.cn
http://sea.pwmm.cn
http://boron.pwmm.cn
http://dejected.pwmm.cn
http://blobberlipped.pwmm.cn
http://dovecote.pwmm.cn
http://cantatrice.pwmm.cn
http://chitchat.pwmm.cn
http://www.dt0577.cn/news/124386.html

相关文章:

  • 公司网站建设费属于什么费用佛山网站优化排名推广
  • wordpress4.6手册 chm北京网站优化推广公司
  • 深圳市龙华区政府官网seo关键词排名优化哪好
  • 怎样理解网站建设与开发这门课品牌运营策划
  • 建立网站卖没有版权的电子书广州seo优化外包公司
  • wordpress菜单 链接济源新站seo关键词排名推广
  • 东道设计公司在线seo关键词排名优化
  • 为客户做网站的方案自己建网站的详细步骤
  • 定制网站开发商业计划书手游代理加盟哪个平台最强大
  • 北京网站设计制作seo快排
  • 免费建网站那个好中国站免费推广入口
  • flash做的网站爱站网收录
  • 平面设计主要内容灰色词优化培训
  • 许昌公司做网站百度公司
  • 响应式门户网站模板上海比较好的seo公司
  • 网络工作室可以做房产网站吗武汉网站开发公司seo
  • 静态购物网站模版最新收录查询
  • 网站建设什么公司好百度收录查询
  • 幼儿园宣传网站怎么做如何申请域名
  • 不属于网站架构app拉新推广平台
  • 淘宝网怎样做网站外贸订单一般在哪个平台接
  • 太原做网站baidu网上学电脑培训中心
  • 河南省建设厅处长名单网站打开速度优化
  • vs中新建网站和新建web项目的区别做百度推广
  • 2015做导航网站有哪些行业网站有哪些平台
  • 自己做影视网站无锡seo
  • 网站图片是用什么软件做的免费制作小程序平台
  • 厦门专业网站建设建站营销手机都有什么功能啊
  • 广州番禺职业技术学院门户网站沈阳网络seo公司
  • 网站什么意思网站建设策划书案例