scala match的运用
来源:互联网 发布:三国志11全人物数据 编辑:程序博客网 时间:2024/06/04 22:30
单个变量
var clusterManager: Int = arg match { case "yarn" => YARN case "yarn-client" | "yarn-cluster" => println(s"Master ${arg} is deprecated since 2.0." + " Please use master \"yarn\" with specified deploy mode instead.") YARN case m if m.startsWith("spark") => STANDALONE case m if m.startsWith("mesos") => MESOS case m if m.startsWith("local") => LOCAL case _ => println("Master must either be yarn or start with spark, mesos, local") -1 }
多个变量
(args.master, args.deployMode) match { case ("yarn-cluster", null) => deployMode = CLUSTER args.master = "yarn" case ("yarn-cluster", "client") => printErrorAndExit("Client deploy mode is not compatible with master \"yarn-cluster\"") case ("yarn-client", "cluster") => printErrorAndExit("Cluster deploy mode is not compatible with master \"yarn-client\"") case (_, mode) => args.master = "yarn" }
0 0
- scala match的运用
- scala------match
- Scala Match
- Scala的try表达式和match表达式
- scala中的match详解
- 【Scala】Scala中的match、case模式匹配
- scala学习笔记:match表达式
- Scala 模式匹配 match-case
- Scala-match case 正则用法
- Scala中的case match语法
- Scala模式匹配(match)使用
- Scala中的模式匹配match
- scala运用pinyin4j
- mongodb的聚合函数的$sort 方法运用 和$sort + $match 顺序优化。
- hdu 3081 hdu 3277 hdu 3416 Marriage Match II III IV //最大流的灵活运用
- scala基础语法-match模式匹配
- scala学习笔记:match与unapply()
- scala 学习(十八)——match
- linux权限---【600,644,700,755,711,666,777】
- 使用make编译源码,使用-j 参数的作用
- Hihocoder#1183 : 连通性一·割边与割点(连通图求割点和割边)
- ES DSL
- CV-openCV学习笔记一
- scala match的运用
- 关于IJKPlayer的静态库合并生成以及引用
- 实用的 jQuery 技巧(转)
- Pattern 和 Matcher
- STM32 Keil开发环境 SWD烧写 Win10
- python 连接mysql
- 缓冲区溢出漏洞(二):堆栈和溢出.
- 大臣的旅费 蓝桥
- poj 3617 Best Cow Line(贪心)