javaclass

Changeset

135:901001c30474
2005-01-21 Paul Boddie raw files shortlog changelog graph Added the start of documentation.
docs/index.html (file) docs/styles.css (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docs/index.html	Fri Jan 21 17:04:41 2005 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +<?xml version="1.0" encoding="iso-8859-1"?>
     1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.6 +<head>
     1.7 +  <title>ClassFile</title>
     1.8 +  <meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" />
     1.9 +  <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles.css"
    1.10 +  rel="stylesheet" type="text/css" />
    1.11 +</head>
    1.12 +
    1.13 +<body>
    1.14 +<h1>ClassFile</h1>
    1.15 +
    1.16 +<p>The ClassFile collection of packages and utilities provides a means of
    1.17 +importing Java classes and packages directly into Python, without the need
    1.18 +for a Java virtual machine, so that the classes may be instantiated,
    1.19 +accessed, run and manipulated just like Python classes, and that the
    1.20 +resulting objects and methods can be accessed and manipulated just like
    1.21 +Python objects and methods.</p>
    1.22 +
    1.23 +<h2>Quick Example</h2>
    1.24 +
    1.25 +<p class="prompt">cd tests/</p>
    1.26 +
    1.27 +<p class="prompt">javac Value.java</p>
    1.28 +
    1.29 +<p class="prompt">../runclass.py Value</p>
    1.30 +
    1.31 +<p class="result">v.getValue() correct: 123<br />
    1.32 +v.getValue() correct: 456<br />
    1.33 +v.isPositive() correct: 1<br />
    1.34 +v.isPositive() correct: 0<br />
    1.35 +v.compare(-790) correct: -1<br />
    1.36 +v.compare(-788) correct: 1<br />
    1.37 +v.compare(-789) correct: 0<br />
    1.38 +v.getValue() == v2.getValue() correct: 0<br />
    1.39 +v2.add(-123) correct: 0<br />
    1.40 +v2.getValue() correct: 255</p>
    1.41 +
    1.42 +<p class="prompt">java Value</p>
    1.43 +
    1.44 +<p class="result">v.getValue() correct: 123<br />
    1.45 +v.getValue() correct: 456<br />
    1.46 +v.isPositive() correct: true<br />
    1.47 +v.isPositive() correct: false<br />
    1.48 +v.compare(-790) correct: -1<br />
    1.49 +v.compare(-788) correct: 1<br />
    1.50 +v.compare(-789) correct: 0<br />
    1.51 +v.getValue() == v2.getValue() correct: false<br />
    1.52 +v2.add(-123) correct: 0<br />
    1.53 +v2.getValue() correct: 255</p>
    1.54 +
    1.55 +<h2>Motivation</h2>
    1.56 +
    1.57 +<p>Pick one of the following:</p>
    1.58 +<ul>
    1.59 +  <li>The need/desire to access Java libraries from Python without firing up
    1.60 +    Java virtual machines or switching to Jython (and thereby losing access
    1.61 +    to various CPython libraries).</li>
    1.62 +  <li>Static typing for the Python environment, albeit achieved by writing
    1.63 +    Java or other appropriate languages.</li>
    1.64 +  <li>Having an open source environment from top to bottom to run Java
    1.65 +    bytecode on.</li>
    1.66 +  <li>Experimentation around import hooks, bytecode generation; observation
    1.67 +    of different runtime and type systems interacting.</li>
    1.68 +</ul>
    1.69 +</body>
    1.70 +</html>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/docs/styles.css	Fri Jan 21 17:04:41 2005 +0100
     2.3 @@ -0,0 +1,60 @@
     2.4 +body {
     2.5 +background-color: white;
     2.6 +font-size: 12pt;
     2.7 +}
     2.8 +
     2.9 +h1 {
    2.10 +color: navy;
    2.11 +font-family: sans-serif;
    2.12 +font-size: 20pt;
    2.13 +}
    2.14 +
    2.15 +h2 {
    2.16 +color: navy;
    2.17 +font-family: sans-serif;
    2.18 +font-size: 18pt;
    2.19 +}
    2.20 +
    2.21 +h3 {
    2.22 +color: navy;
    2.23 +font-family: sans-serif;
    2.24 +font-size: 16pt;
    2.25 +}
    2.26 +
    2.27 +h4 {
    2.28 +color: navy;
    2.29 +font-family: sans-serif;
    2.30 +font-size: 15pt;
    2.31 +}
    2.32 +
    2.33 +h5 {
    2.34 +color: navy;
    2.35 +font-family: sans-serif;
    2.36 +font-size: 14pt;
    2.37 +}
    2.38 +
    2.39 +ul {
    2.40 +list-style-type: disc;
    2.41 +}
    2.42 +
    2.43 +pre {
    2.44 +background-color: silver;
    2.45 +color: black;
    2.46 +}
    2.47 +
    2.48 +p.prompt {
    2.49 +font-family: fixed;
    2.50 +background-color: silver;
    2.51 +color: black;
    2.52 +}
    2.53 +
    2.54 +p.prompt:before {
    2.55 +content: "$ ";
    2.56 +}
    2.57 +
    2.58 +p.result {
    2.59 +font-family: fixed;
    2.60 +background-color: white;
    2.61 +color: black;
    2.62 +margin-left: 1em;
    2.63 +}