class CasdocDemo {
public void main(String[] args) {
String str = "Hover over or click me!";
// What's the purpose of the 2nd argument?
// Interact with parseInt to see its documentation,
// or with the arguments to find out more.
int i = Integer.parseInt("six", 36);
}
}
// Any more questions?
We designed Casdoc for code-oriented documents. For example, it could be used in programming tutorials, or to improve the answers of programming forums.
We designed Casdoc for code-oriented documents. For example, it could be used in programming tutorials, or to improve the answers of programming forums.
The most commonly used number systems are positional: Each number consists of a string of digits, and the value of that number is obtained by summing the digits multipled by a base to the exponent of the digit's position (from right to left, starting at 0).
For example, a number expressed as XYZ represents the value
3*(b^0) + 2*(b^1) + 1*(b^2)
b
is called the radix. Its value is usually 10, but some other
values are commonly used, like 2 for binary numbers and 16 for hexadecimal numbers.
The most commonly used number systems are positional: Each number consists of a string of digits, and the value of that number is obtained by summing the digits multipled by a base to the exponent of the digit's position (from right to left, starting at 0).
For example, a number expressed as XYZ represents the value
3*(b^0) + 2*(b^1) + 1*(b^2)
b
is called the radix. Its value is usually 10, but some other
values are commonly used, like 2 for binary numbers and 16 for hexadecimal numbers.
The document author writes the content of the annotations in a working Java file using a special annotation language.
Some annotations can also be imported from external sources. For example, the API reference documentation of Java types and methods is automatically extracted.
The document author writes the content of the annotations in a working Java file using a special annotation language.
Some annotations can also be imported from external sources. For example, the API reference documentation of Java types and methods is automatically extracted.
Hover over a part of the code with a marker, either an underline or a bracket on the side, to see explanations of that code.
Hover over a part of the code with a marker, either an underline or a bracket on the side, to see explanations of that code.
Anything! Annotations are written in Markdown, with support for common extensions like GitHub-flavored tables. This means annotations can contain lists, tables, hyperlinks, bold and italic text, headers, etc. Even images can be inserted, but they may not be displayed nicely if they are too large.
Anything! Annotations are written in Markdown, with support for common extensions like GitHub-flavored tables. This means annotations can contain lists, tables, hyperlinks, bold and italic text, headers, etc. Even images can be inserted, but they may not be displayed nicely if they are too large.
The first argument to parseInt
is a string that represents
a number, such as "123"
. This string will be converted to its
integer value, i.e., 123
.
The string should only contain digits, and letters only if the second argument is higher than 10.
The first argument to parseInt
is a string that represents
a number, such as "123"
. This string will be converted to its
integer value, i.e., 123
.
The string should only contain digits, and letters only if the second argument is higher than 10.
If provided, the second argument to parseInt
is the
radix to use to
convert the string. The radix must be between 2 and 36.
In this case, the value of 36 means that all 10 digits and 26 letters
are valid characters.
If the radix is not provided, the default value is 10. If the radix is greater than 10, then letters (case-insensitive) are treated as digits higher than 9 (A = 10, B = 11, and so on).
If provided, the second argument to parseInt
is the
radix to use to
convert the string. The radix must be between 2 and 36.
In this case, the value of 36 means that all 10 digits and 26 letters
are valid characters.
If the radix is not provided, the default value is 10. If the radix is greater than 10, then letters (case-insensitive) are treated as digits higher than 9 (A = 10, B = 11, and so on).
Casdoc is a format for code examples that include embedded annotations. Readers only reveal annotations about the code elements they want.
Casdoc is a format for code examples that include embedded annotations. Readers only reveal annotations about the code elements they want.
The value of i
will be 36969 after its initialization.
The value of i
will be 36969 after its initialization.
like this nested annotation
like this nested annotation
We're continuing to improve the format. We're studying how programmers use documentation to look for information, and how the presentation format can help or hinder their search. As part of this research, we're exploring and implementing new strategies to help present information more effectively.
We're continuing to improve the format. We're studying how programmers use documentation to look for information, and how the presentation format can help or hinder their search. As part of this research, we're exploring and implementing new strategies to help present information more effectively.
Character.digit(char, int)
returns a
nonnegative value), except that the first character may be an
ASCII minus sign '-'
('\u002D'
) to
indicate a negative value or an ASCII plus sign '+'
('\u002B'
) to indicate a positive value. The
resulting integer value is returned.
Character.digit(char, int)
returns a
nonnegative value), except that the first character may be an
ASCII minus sign '-'
('\u002D'
) to
indicate a negative value or an ASCII plus sign '+'
('\u002B'
) to indicate a positive value. The
resulting integer value is returned.
An exception of type NumberFormatException
is
thrown if any of the following situations occurs:
null
or is a string of
length zero.
Character.MIN_RADIX
or
larger than Character.MAX_RADIX
.
'-'
('\u002D'
) or plus sign
'+'
('\u002B'
) provided that the
string is longer than length 1.
int
.
Examples:
parseInt("0", 10) returns 0 parseInt("473", 10) returns 473 parseInt("+42", 10) returns 42 parseInt("-0", 10) returns 0 parseInt("-FF", 16) returns -255 parseInt("1100110", 2) returns 102 parseInt("2147483647", 10) returns 2147483647 parseInt("-2147483648", 10) returns -2147483648 parseInt("2147483648", 10) throws a NumberFormatException parseInt("99", 8) throws a NumberFormatException parseInt("Kona", 10) throws a NumberFormatException parseInt("Kona", 27) returns 411787
s
- the String
containing the integer
representation to be parsedradix
- the radix to be used while parsing s
.NumberFormatException
- if the String
does not contain a parsable int
.String
class represents character strings. All
string literals in Java programs, such as "abc"
, are
implemented as instances of this class.
String
class represents character strings. All
string literals in Java programs, such as "abc"
, are
implemented as instances of this class.
Strings are constant; their values cannot be changed after they are created. String buffers support mutable strings. Because String objects are immutable they can be shared. For example:
String str = "abc";
is equivalent to:
char data[] = {'a', 'b', 'c'}; String str = new String(data);
Here are some more examples of how strings can be used:
System.out.println("abc"); String cde = "cde"; System.out.println("abc" + cde); String c = "abc".substring(2, 3); String d = cde.substring(1, 2);
The class String
includes methods for examining
individual characters of the sequence, for comparing strings, for
searching strings, for extracting substrings, and for creating a
copy of a string with all characters translated to uppercase or to
lowercase. Case mapping is based on the Unicode Standard version
specified by the Character
class.
The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. For additional information on string concatenation and conversion, see The Java Language Specification.
Unless otherwise noted, passing a null
argument to a constructor
or method in this class will cause a NullPointerException
to be
thrown.
A String
represents a string in the UTF-16 format
in which supplementary characters are represented by surrogate
pairs (see the section Unicode
Character Representations in the Character
class for
more information).
Index values refer to char
code units, so a supplementary
character uses two positions in a String
.
The String
class provides methods for dealing with
Unicode code points (i.e., characters), in addition to those for
dealing with Unicode code units (i.e., char
values).
Unless otherwise noted, methods for comparing Strings do not take locale
into account. The Collator
class provides methods for
finer-grain, locale-sensitive String comparison.
javac
compiler
may implement the operator with StringBuffer
, StringBuilder
,
or java.lang.invoke.StringConcatFactory
depending on the JDK version. The
implementation of string conversion is typically through the method toString
,
defined by Object
and inherited by all classes in Java.or this further nested annotation!
There's no limit to the nesting level of annotations.
or this further nested annotation!
There's no limit to the nesting level of annotations.
Contact us if you want to know more!
Contact us if you want to know more!
Creating the document is as simple as writing the annotations as comments in a Java file. A transformation tool than generates the HTML document, which is self-contained and uses client-side JavaScript and CSS scripts to display the annotations.
Creating the document is as simple as writing the annotations as comments in a Java file. A transformation tool than generates the HTML document, which is self-contained and uses client-side JavaScript and CSS scripts to display the annotations.
Pinned annotations can be moved and resized.
It's also possible to save the state of pinned annotations
by clicking on the Save State
button at the top.
Pinned annotations can be moved and resized.
It's also possible to save the state of pinned annotations
by clicking on the Save State
button at the top.
Walkthrough
feature to read important annotations.Walkthrough
feature to read important annotations.Annotations can explain any part of a document:
Annotations can explain any part of a document:
Click on the code element to pin the annotation.
Click on the code element to pin the annotation.