Skip to content

Commit 47adedd

Browse files
author
Troy Melhase
committed
Renaming test classes.
1 parent ab3c58b commit 47adedd

File tree

3 files changed

+60
-26
lines changed

3 files changed

+60
-26
lines changed

doc/features.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
The java2python package can translate any syntactically valid Java source
44
code file. The generated Python code is not guaranteed to run, nor is
5-
guaranteed to be syntatically valid Python. However, java2python works
5+
guaranteed to be syntactically valid Python. However, java2python works
66
well many cases, and in some of those, it creates perfectly usable and
77
workable Python code.
88

9-
The remainder of this page describes how Java language features are
10-
translated into Python constructs.
11-
129

1310
### General Approach
1411

@@ -75,22 +72,29 @@ Refer to the note above regarding bit shift right.
7572

7673
#### Basic Types
7774

78-
byte
79-
short
80-
char
81-
int
82-
long
83-
float
84-
double
85-
boolean
75+
The basic Java types are mapped to Python types as follows:
76+
77+
byte => int
78+
short => int
79+
char => str
80+
int => int
81+
long => long
82+
float => float
83+
double => float
84+
boolean => bool
8685

8786
#### Types, Interfaces, Enums
8887

8988
Java classes, interfaces, and enums are translated into Python classes.
9089

91-
In the case of interfaces, the strategy is configurable. By default, interfaces are translated to classes utilizing the ABCMeta class. The package includes config handlers that can translate to simple classes (inheriting from `object`), or from Zope Interfaces.
90+
In the case of interfaces, the strategy is configurable. By default,
91+
interfaces are translated to classes utilizing the ABCMeta class. The package
92+
includes config handlers that can translate to simple classes (inheriting from
93+
`object`), or from Zope Interfaces.
9294

93-
Enums are also translated via a configurable strategy. By default, enumerated values are created as class attributes with string values. The package includes a config handler to create class attributes with integer values.
95+
Enums are also translated via a configurable strategy. By default, enumerated
96+
values are created as class attributes with string values. The package
97+
includes a config handler to create class attributes with integer values.
9498

9599
#### Statements
96100

@@ -166,18 +170,18 @@ continue [Identifier]
166170

167171
##### Annotations
168172

169-
Annotation
170-
public
171-
protected
172-
private
173-
static
174-
abstract
175-
final
176-
native
177-
synchronized
178-
transient
179-
volatile
180-
strictfp
173+
Annotation
174+
public
175+
protected
176+
private
177+
static
178+
abstract
179+
final
180+
native
181+
synchronized
182+
transient
183+
volatile
184+
strictfp
181185

182186
#### The Rest
183187

File renamed without changes.

test/BasicTypes.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class BasicTypes {
2+
public static void main(String[] args) {
3+
4+
byte B = 127;
5+
System.out.println(B);
6+
7+
short S = 10240;
8+
System.out.println(S);
9+
10+
char C = 'x';
11+
System.out.println(C);
12+
13+
int I = 48;
14+
System.out.println(I);
15+
16+
17+
long L = 1234567890;
18+
System.out.println(L);
19+
20+
float F = 0.1f;
21+
System.out.println(F);
22+
23+
double D = 0.1;
24+
System.out.println(D);
25+
26+
boolean O = true;
27+
System.out.println(O ? 42 : -3);
28+
29+
}
30+
}

0 commit comments

Comments
 (0)