- 浏览: 104881 次
- 性别:
- 来自: 长春
文章分类
最新评论
-
chao8796:
吃的真多
方便面烹饪法 -
rmn190:
看下这个类: org.jbpm.web.JbpmThreads ...
Jbpm + Spring 配置
疯了, 完全疯了, 这语法好怪异, 呵呵。
融合了 N 多语言特色的样子, 这是要干什么啊? SUN!
在网上找了好多资料,
学习中, 更新中, 备忘录……唉!
JavaFX 数据类型:
String --> java.lang.String
Boolean --> java.lang.Boolean
Number --> java.lang.Number
Integer --> byte、short、int、long、java.math.BigInteger
用 var 声明变量:
var x:Number = 0.9;
var name:String = "John";
var y:Integer = 0;
var flag:Boolean = true;
var numbers:Number = [1, 2, 3, 4, 5];
逻辑运算符:
Java JavaFX
&& and
|| or
! not
函数:
function taxes(x) {
var t:Number = (19.0 / 100.0) * x;
return t;
}
if 语句:
if (place_your_condition_here) {
//do something
} else if (place_your_condition_here) {
//do something
} else {
//do something
}
while 语句:
while (place_your_condition_here) {
//do something
}
for 语句:
//i will take the values: 0, 1, 2, 3, 4, 5
for (i in [0..5]) {
//do something with i
}
操作过程:
operation startClock() {
do {
//do something
}
类:
class Order {
attribute order_nr: String;
attribute ordertype: Order inverse Order.products;
attribute products: Order* inverse Order.ordertype;
function getOrderNr(): String;
operation addOrder(order: Order);
}
变量基数:
?:可选(可能是null)
+:1或多个
*:0或多个
数组大小:
sizeof array
符合条件子数组:
var mynumbers = [1,2,7,3,30,15,14,6,4];
var numbers = mynumbers[n|n < 10];
结果:1 2 7 3 6 4
数组中第 N 个元素:
var mynumbers = [1,2,7,3,30,15,14,6,4];
var number_four = mynumbers[4];
结果:30
向数组中插入:
insert 10 into mynumbers; 默认在最后一个位置插入 last
insert [8,6,90] as first into mynumbers; 首
insert 122 as last into mynumbers; 尾
insert 78 before mynumbers[3]; 指定位置前
insert 11 after mynumbers[3]; 指定位置后
从一个区间获得偶数的例子:
function odd(p:Number) {
return select i from i in [1.0 ..p] where (i%2 == 0.0);
}
var result = odd(10.0);
System.out.println("Odd numbers:{result}");
function odd(p:Number) {
return foreach (i in [1.0 ..p] where (i%2 == 0.0)) i;
}
var result = odd(10.0);
System.out.println("Odd numbers:{result}");
调用 Java 对象:
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.lang.System;
var frame = new JFrame();
var button = new JButton("Press me");
frame.getContentPane().add(button);
button.addActionListener(new ActionListener() {
operation actionPerformed(event) {
System.out.println("You pressed me");
}
});
frame.pack();
frame.setVisible(true);
以上代码等价于:
Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}
数组另类用法:
var week_days = ["Mon","Tue","Wed","Thur","Fri"];
var days = [week_days, ["Sat","Sun"]];
days == ["Mon","Tue","Wed","Thur","Fri","Sat","Sun"]; // returns true
var nums = [1,2,3,4];
var numsGreaterThanTwo = nums[. > 2]; // yields [3, 4]
等价于:
numsGreaterThanTwo = nums[n|n > 2];
[] == null // yields true
sizeof null // yields 0
数组操作:
insert Expression1 [as first | as last] into Expression2
insert Expression1 before Expression2
insert Expression1 after Expression2
delete variable
delete Expression.attribute
delete variable[predicate]
delete Expression.attribute[predicate]
var x = [1,2,3];
insert 12 into x; // yields [1,2,3,12]
insert 10 as first into x; // yields [10,1,2,3,12]
var x = [1,2,3];
insert 10 after x[. == 10]; // yields [1,2,3,10]
insert 12 before x[1]; // yields [1,12,2,3,10]
insert 13 after x[. == 2]; // yields [1, 12, 2, 13, 3, 10];
insert [99,100] as last into x; // yields [10,1,2,3,12,99,100]
var x = [1,2,3];
insert 10 into x; // yields [1,2,3,10]
insert 12 before x[1]; // yields [1,12,2,3,10]
delete x[. == 12]; // yields [1,2,3,10]
delete x[. >= 3]; // yields [1,2]
insert 5 after x[. == 1]; // yields [1,5,2];
insert 13 as first into x; // yields [13, 1, 5, 2];
delete x; // yields []
操作符:
字符串:
var s = 'Hello';
var s = "Hello";
var name = 'Joe';
var s = "Hello {name}"; // s = 'Hello Joe'
var answer = true;
var s = "The answer is {if answer then "Yes" else "No"}"; // s = 'The answer is Yes'
<<关键字>>
var <<while>> = 100;
import javax.swing.JTextArea;
var textArea = new JTextArea();
textArea.<<insert>>("Hello", 0);
范围表达式:
[number1..number2]
var nums = [0..3];
System.out.println(nums == [0,1,2,3]); // prints true
var nums = [3..0];
System.out.println(nums == [3,2,1,0]); // prints true
格式化字符串, 数字, 日期:
</insert></while>expr format as directive
import java.util.Date;
100.896 format as <<%f>>; // yields '100.896000'
31.intValue() format as <<%02X>>; // yields '1F'
var d = new Date();
d format as <
if (condition1) {
System.out.println("Condition 1");
} else if (condition2) {
System.out.println("Condition2");
} else {
System.out.println("not Condition 1 or Condition 2");
}
while 语句:
var i = 0;
while (i < 10) {
if (i > 5) {
break;
}
System.out.println("i = {i}");
i += 1;
}
try 语句:
try {
throw "Hello";
} catch (s:String) {
System.out.println("caught a String: {s}");
} catch (any) {
System.out.println("caught something not a String: {any}");
} finally {
System.out.println("finally...");
}
for 语句:
for (i in [0..10]) {
System.out.println("i = {i}");
}
// print only the even numbers using a filter
for (i in [0..10] where i % 2 == 0) {
System.out.println("i = {i}");
}
// print only the odd numbers using a range expression
for (i in [1,3..10]) {
System.out.println("i = {i}");
}
// print the cartesian product
for (i in [0..10], j in [0..10]) {
System.out.println(i);
System.out.println(j);
}
throw 语句:
import java.lang.Exception;
operation foo() {
throw new Exception("this is a java exception");
}
operation bar() {
throw "just a string";
}
do 语句:
允许在后台执行一个代码块。
import java.net.URL;
import java.lang.StringBuffer;
import java.lang.System;
import java.io.InputStreamReader;
import java.io.BufferedReader;
// in the AWT EDT
var result = new StringBuffer();
do {
// now in a background thread
var url = new URL("http://www.foo.com/abc.xml");
var is = url.openStream();
var reader = new BufferedReader(new InputStreamReader(is));
var line;
while (true) {
line = reader.readLine();
if (line == null) {
break;
}
result.append(line);
result.append("\n");
}
}
// now back in the EDT
System.out.println("result = {result}");
do later:
import java.lang.System;
var saying1 = "Hello World!";
var saying2 = "Goodbye Cruel World!";
do later {
System.out.println(saying1);
}
System.out.println(saying2);
返回:
Goodbye Cruel World!
Hello World!
融合了 N 多语言特色的样子, 这是要干什么啊? SUN!
在网上找了好多资料,
学习中, 更新中, 备忘录……唉!
JavaFX 数据类型:
String --> java.lang.String
Boolean --> java.lang.Boolean
Number --> java.lang.Number
Integer --> byte、short、int、long、java.math.BigInteger
用 var 声明变量:
var x:Number = 0.9;
var name:String = "John";
var y:Integer = 0;
var flag:Boolean = true;
var numbers:Number = [1, 2, 3, 4, 5];
逻辑运算符:
Java JavaFX
&& and
|| or
! not
函数:
function taxes(x) {
var t:Number = (19.0 / 100.0) * x;
return t;
}
if 语句:
if (place_your_condition_here) {
//do something
} else if (place_your_condition_here) {
//do something
} else {
//do something
}
while 语句:
while (place_your_condition_here) {
//do something
}
for 语句:
//i will take the values: 0, 1, 2, 3, 4, 5
for (i in [0..5]) {
//do something with i
}
操作过程:
operation startClock() {
do {
//do something
}
类:
class Order {
attribute order_nr: String;
attribute ordertype: Order inverse Order.products;
attribute products: Order* inverse Order.ordertype;
function getOrderNr(): String;
operation addOrder(order: Order);
}
变量基数:
?:可选(可能是null)
+:1或多个
*:0或多个
数组大小:
sizeof array
符合条件子数组:
var mynumbers = [1,2,7,3,30,15,14,6,4];
var numbers = mynumbers[n|n < 10];
结果:1 2 7 3 6 4
数组中第 N 个元素:
var mynumbers = [1,2,7,3,30,15,14,6,4];
var number_four = mynumbers[4];
结果:30
向数组中插入:
insert 10 into mynumbers; 默认在最后一个位置插入 last
insert [8,6,90] as first into mynumbers; 首
insert 122 as last into mynumbers; 尾
insert 78 before mynumbers[3]; 指定位置前
insert 11 after mynumbers[3]; 指定位置后
从一个区间获得偶数的例子:
function odd(p:Number) {
return select i from i in [1.0 ..p] where (i%2 == 0.0);
}
var result = odd(10.0);
System.out.println("Odd numbers:{result}");
function odd(p:Number) {
return foreach (i in [1.0 ..p] where (i%2 == 0.0)) i;
}
var result = odd(10.0);
System.out.println("Odd numbers:{result}");
调用 Java 对象:
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.lang.System;
var frame = new JFrame();
var button = new JButton("Press me");
frame.getContentPane().add(button);
button.addActionListener(new ActionListener() {
operation actionPerformed(event) {
System.out.println("You pressed me");
}
});
frame.pack();
frame.setVisible(true);
以上代码等价于:
Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}
数组另类用法:
var week_days = ["Mon","Tue","Wed","Thur","Fri"];
var days = [week_days, ["Sat","Sun"]];
days == ["Mon","Tue","Wed","Thur","Fri","Sat","Sun"]; // returns true
var nums = [1,2,3,4];
var numsGreaterThanTwo = nums[. > 2]; // yields [3, 4]
等价于:
numsGreaterThanTwo = nums[n|n > 2];
[] == null // yields true
sizeof null // yields 0
数组操作:
insert Expression1 [as first | as last] into Expression2
insert Expression1 before Expression2
insert Expression1 after Expression2
delete variable
delete Expression.attribute
delete variable[predicate]
delete Expression.attribute[predicate]
var x = [1,2,3];
insert 12 into x; // yields [1,2,3,12]
insert 10 as first into x; // yields [10,1,2,3,12]
var x = [1,2,3];
insert 10 after x[. == 10]; // yields [1,2,3,10]
insert 12 before x[1]; // yields [1,12,2,3,10]
insert 13 after x[. == 2]; // yields [1, 12, 2, 13, 3, 10];
insert [99,100] as last into x; // yields [10,1,2,3,12,99,100]
var x = [1,2,3];
insert 10 into x; // yields [1,2,3,10]
insert 12 before x[1]; // yields [1,12,2,3,10]
delete x[. == 12]; // yields [1,2,3,10]
delete x[. >= 3]; // yields [1,2]
insert 5 after x[. == 1]; // yields [1,5,2];
insert 13 as first into x; // yields [13, 1, 5, 2];
delete x; // yields []
操作符:
Relational Operators | ||
== |
equality | == |
<> |
inequality | != |
< |
less than | < |
> |
greater than | > |
<= |
less than or equal | <= |
>= |
greater than or equal | >= |
Boolean Operators | ||
and |
logical and | && |
or |
logical or | || |
not |
logical negation | ! |
Arithmetic Operators | ||
+ |
addition | + |
- |
subtraction; unary negation | - |
* |
multiplication | * |
/ |
division | / |
% |
remainder | % |
+= |
add and assign | += |
-= |
subtract and assign | -= |
*= |
multiply and assign | *= |
/= |
divide and assign | /= |
%= |
remainder and assign | %= |
Other Operators | ||
sizeof |
array length | n/a |
indexof |
ordinal position | n/a |
if e1 then e2 else e3 |
conditional expression | e1 ? e2 : e3 |
select |
list comprehension | n/a |
foreach |
list comprehension | n/a |
new |
allocation | new |
op() |
function/operation call | n/a |
x.op() |
member function/operation call | x.op() |
instanceof |
type check | instanceof |
this |
self access | this |
. |
attribute access, context access | ., n/a |
bind [lazy] |
incremental [lazy] evaluation | n/a |
: |
eager initialization | n/a |
[] |
array selection | [] |
format as |
String formatting | n/a |
<<>> |
Identifier quotes | n/a |
{} |
String expression | n/a |
(expr) |
grouping | (expr) |
reverse |
reverses a list | n/a |
[number1,next..number2]<!----> |
numeric range | n/a |
字符串:
var s = 'Hello';
var s = "Hello";
var name = 'Joe';
var s = "Hello {name}"; // s = 'Hello Joe'
var answer = true;
var s = "The answer is {if answer then "Yes" else "No"}"; // s = 'The answer is Yes'
<<关键字>>
var <<while>> = 100;
import javax.swing.JTextArea;
var textArea = new JTextArea();
textArea.<<insert>>("Hello", 0);
范围表达式:
[number1..number2]
var nums = [0..3];
System.out.println(nums == [0,1,2,3]); // prints true
var nums = [3..0];
System.out.println(nums == [3,2,1,0]); // prints true
格式化字符串, 数字, 日期:
</insert></while>expr format as directive
import java.util.Date;
100.896 format as <<%f>>; // yields '100.896000'
31.intValue() format as <<%02X>>; // yields '1F'
var d = new Date();
d format as <
if (condition1) {
System.out.println("Condition 1");
} else if (condition2) {
System.out.println("Condition2");
} else {
System.out.println("not Condition 1 or Condition 2");
}
while 语句:
var i = 0;
while (i < 10) {
if (i > 5) {
break;
}
System.out.println("i = {i}");
i += 1;
}
try 语句:
try {
throw "Hello";
} catch (s:String) {
System.out.println("caught a String: {s}");
} catch (any) {
System.out.println("caught something not a String: {any}");
} finally {
System.out.println("finally...");
}
for 语句:
for (i in [0..10]) {
System.out.println("i = {i}");
}
// print only the even numbers using a filter
for (i in [0..10] where i % 2 == 0) {
System.out.println("i = {i}");
}
// print only the odd numbers using a range expression
for (i in [1,3..10]) {
System.out.println("i = {i}");
}
// print the cartesian product
for (i in [0..10], j in [0..10]) {
System.out.println(i);
System.out.println(j);
}
throw 语句:
import java.lang.Exception;
operation foo() {
throw new Exception("this is a java exception");
}
operation bar() {
throw "just a string";
}
do 语句:
允许在后台执行一个代码块。
import java.net.URL;
import java.lang.StringBuffer;
import java.lang.System;
import java.io.InputStreamReader;
import java.io.BufferedReader;
// in the AWT EDT
var result = new StringBuffer();
do {
// now in a background thread
var url = new URL("http://www.foo.com/abc.xml");
var is = url.openStream();
var reader = new BufferedReader(new InputStreamReader(is));
var line;
while (true) {
line = reader.readLine();
if (line == null) {
break;
}
result.append(line);
result.append("\n");
}
}
// now back in the EDT
System.out.println("result = {result}");
do later:
import java.lang.System;
var saying1 = "Hello World!";
var saying2 = "Goodbye Cruel World!";
do later {
System.out.println(saying1);
}
System.out.println(saying2);
返回:
Goodbye Cruel World!
Hello World!
发表评论
-
Spring Security 2.0.5 实现 Http 与 Https 切换
2009-12-05 00:04 5141<security:http entry-point ... -
Jbpm 4.2 + Spring 配置
2009-11-18 19:20 2017Spring 配置文件 <?xml version ... -
23个设计模式列表
2007-09-12 08:40 2973创建型模式... 1. ... -
转贴 学习 侯捷谈Java反射机制
2007-09-06 13:21 1874摘要 Reflection 是Java被视 ... -
Jbpm + Spring 配置
2007-08-30 12:01 4600配置问题, 苦! 以前用 spring-modules-0. ...
相关推荐
在本项目中,我们讨论的是一个使用Java编程语言与MySQL数据库进行开发的备忘录系统。这个系统的主要目标是提供一套便捷的工具,让用户能够轻松地管理他们的日常事务,包括创建、编辑、查找和删除备忘录。同时,系统...
【标题】"备忘录JAVA代码"涉及到的核心知识点主要集中在Java编程语言以及备忘录功能的实现上。Java是一种广泛使用的面向对象的编程语言,它以其"一次编写,到处运行"的特性闻名,具备强大的跨平台能力。在这个项目中...
在本项目中,"java课设--个人备忘录管理系统"是一个基于Java编程语言实现的课程设计项目,旨在提供一个方便用户记录、管理和检索个人备忘录的应用程序。这个系统通常包括用户界面、数据存储、备忘录的增删改查等功能...
备忘录和日程管理应用通常会包含文本框、按钮、日期选择器等组件,可能使用Swing或JavaFX来实现。 3. **事件处理**: - **监听器**:为了响应用户的操作(如点击按钮、选择日期),应用需要添加事件监听器。Java...
在本Java综合案例中,我们关注的是两个主要的软件组件:一个可编辑的备忘录日历程序和一个学生管理系统。这两个系统都是基于Java编程语言实现的,它们展示了Java在实际应用中的强大功能和灵活性。 首先,让我们深入...
在电子备忘录的Java基础知识综合实例中,我们主要探讨的是如何使用Java语言来构建一个图形用户界面(GUI)的应用程序。GUI是用户与计算机进行交互的重要方式,它通过按钮、文本框、菜单等可视化元素使得操作更加直观...
显示备忘录时,可以使用Java Swing或JavaFX库来构建用户界面,展示备忘录列表,并提供添加、编辑和删除功能。 闹钟功能需要处理定时任务。Java中可以使用java.util.Timer和TimerTask类来实现定时执行任务,例如在...
Java备忘录系统是一个使用Java编程语言开发的应用程序,它旨在提供一个用户友好的界面,让用户可以方便地创建、编辑和管理个人的备忘事项。这个系统的核心功能可能包括添加新备忘、删除旧备忘、修改现有备忘以及搜索...
在IT行业中,备忘录是一种常见且实用的工具,它可以帮助程序员和其他技术工作者记录和管理日常的工作任务、项目进度和重要信息。在这个名为"beiwanglu.zip_备忘录"的压缩包文件中,我们可以预见到包含了一个由Java...
此外,我们还需要一个数据结构(如ArrayList)来存储所有的备忘录实例。 为了实现时钟功能,我们需要一个定时器来定期检查是否有到达提醒时间的备忘录。Java的`java.util.Timer`和`java.util.TimerTask`类可以用来...
Java备忘录是一款基于Java开发的应用程序,它利用MySQL数据库来存储和管理用户的数据。这个程序的构建展示了Java与数据库集成的基本原理,是学习和理解Java后端开发的一个良好实践案例。 首先,Java作为一门多用途...
标题中的“电子备忘录带密码保护的JAVA记事本”指的是一个基于JAVA编程语言开发的应用程序,它具有类似于传统备忘录的功能,但增加了安全性的特性,即密码保护。这种设计使得用户能够存储敏感或私密信息,而无需担心...
【标题】:“小小工具箱-(备忘录,日历,倒计时)(java源代码)”揭示了这是一个基于Java编程语言开发的多功能小型应用。这个应用集成了三种常见且实用的功能,分别是倒计时、日历以及备忘录。开发者通过Java技术...
【Java毕业设计与课设-备忘录】项目是一份基于Java技术的综合应用实践,旨在帮助学生在毕业设计或课程设计阶段深入理解和掌握Java编程语言及其相关技术。这个资源包包含了项目部署视频、源代码以及相关的学习资料,...
【Java实现备忘录应用详解】 在IT行业中,开发一款基于Java的日志或备忘录应用是一项常见的任务,它能够帮助用户记录日常事项,管理个人事务。本篇将深入探讨如何利用Java技术来实现这样一个“每日一记”备忘录应用...
【标题】:“备忘录”涉及的技术点涵盖了图形用户界面(GUI)的元素设计、程序关闭的优雅实现、数据库管理和系统事件监听等多个方面。 【图形按钮】是用户界面设计中的重要组成部分,它允许用户通过点击来执行特定...
【Java小管家项目】是一个综合性的应用程序,旨在提供日常生活的便利服务,如备忘录、通讯录和记账本功能。这个项目的核心是利用Java编程语言来构建一个用户友好的平台,帮助用户管理他们的日常生活事务。 备忘录...
在“java_beiwanglu.rar”这个压缩包中,我们看到的是一个基于Java语言开发的抢票提醒应用,它利用了XML数据库来存储和管理用户的备忘录。XML(eXtensible Markup Language)是一种用于标记数据的语言,它结构清晰,...
1. **备忘录管理**:备忘录是系统的核心组成部分,它允许用户创建、编辑和删除备忘事项。通过这个功能,用户可以随时记录生活中的点滴,设置提醒,确保不会错过任何重要事件。备忘录通常包括标题、内容、日期和提醒...
5. **用户界面设计**:如果这是一个桌面应用,可能使用JavaFX或Swing来构建用户界面,让用户能够直观地创建、编辑和查看备忘录。如果是移动应用,可能会使用Android的布局和控件,如EditText和ListView。 6. **通知...