mirror of
https://github.com/processing/processing4.git
synced 2026-05-09 12:22:43 +02:00
Changed comments for all the web references in core
This commit is contained in:
@@ -993,13 +993,43 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
// BLEND
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from blendMode.xml )
|
||||
*
|
||||
* This is a new reference entry for Processing 2.0. It will be updated shortly.
|
||||
* Blends the pixels in the display window according to a defined mode.
|
||||
* There is a choice of the following modes to blend the source pixels (A)
|
||||
* with the ones of pixels already in the display window (B). Each pixel's
|
||||
* final color is the result of applying one of the blend modes with each
|
||||
* channel of (A) and (B) independently. The red channel is compared with
|
||||
* red, green with green, and blue with blue.<br />
|
||||
* <br />
|
||||
* BLEND - linear interpolation of colors: C = A*factor + B. This is the default.<br />
|
||||
* <br />
|
||||
* ADD - additive blending with white clip: C = min(A*factor + B, 255)<br />
|
||||
* <br />
|
||||
* SUBTRACT - subtractive blending with black clip: C = max(B - A*factor, 0)<br />
|
||||
* <br />
|
||||
* DARKEST - only the darkest color succeeds: C = min(A*factor, B)<br />
|
||||
* <br />
|
||||
* LIGHTEST - only the lightest color succeeds: C = max(A*factor, B)<br />
|
||||
* <br />
|
||||
* DIFFERENCE - subtract colors from underlying image.<br />
|
||||
* <br />
|
||||
* EXCLUSION - similar to DIFFERENCE, but less extreme.<br />
|
||||
* <br />
|
||||
* MULTIPLY - multiply the colors, result will always be darker.<br />
|
||||
* <br />
|
||||
* SCREEN - opposite multiply, uses inverse values of the colors.<br />
|
||||
* <br />
|
||||
* REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values<br />
|
||||
* <br />
|
||||
* We recommend using <b>blendMode()</b> and not the previous <b>blend()</b>
|
||||
* function. However, unlike <b>blend()</b>, the <b>blendMode()</b> function
|
||||
* does not support the following: HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE,
|
||||
* BURN. On older hardware, the LIGHTEST, DARKEST, and DIFFERENCE modes might
|
||||
* not be available as well.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref Rendering
|
||||
* @webBrief Blends the pixels in the display window according to a defined mode.
|
||||
* @param mode the blending mode to use
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -128,15 +128,14 @@ public interface PConstants {
|
||||
// useful goodness
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PI.xml )
|
||||
*
|
||||
* PI is a mathematical constant with the value 3.14159265358979323846. It
|
||||
* is the ratio of the circumference of a circle to its diameter. It is
|
||||
* useful in combination with the trigonometric functions <b>sin()</b> and
|
||||
* <b>cos()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref constants
|
||||
* @webBrief PI is a mathematical constant with the value 3.14159265358979323846.
|
||||
* @see PConstants#TWO_PI
|
||||
* @see PConstants#TAU
|
||||
* @see PConstants#HALF_PI
|
||||
@@ -145,15 +144,14 @@ public interface PConstants {
|
||||
*/
|
||||
static final float PI = (float) Math.PI;
|
||||
/**
|
||||
* ( begin auto-generated from HALF_PI.xml )
|
||||
*
|
||||
* HALF_PI is a mathematical constant with the value
|
||||
* 1.57079632679489661923. It is half the ratio of the circumference of a
|
||||
* circle to its diameter. It is useful in combination with the
|
||||
* trigonometric functions <b>sin()</b> and <b>cos()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref constants
|
||||
* @webBrief HALF_PI is a mathematical constant with the value 1.57079632679489661923.
|
||||
* @see PConstants#PI
|
||||
* @see PConstants#TWO_PI
|
||||
* @see PConstants#TAU
|
||||
@@ -162,15 +160,14 @@ public interface PConstants {
|
||||
static final float HALF_PI = (float) (Math.PI / 2.0);
|
||||
static final float THIRD_PI = (float) (Math.PI / 3.0);
|
||||
/**
|
||||
* ( begin auto-generated from QUARTER_PI.xml )
|
||||
*
|
||||
* QUARTER_PI is a mathematical constant with the value 0.7853982. It is
|
||||
* one quarter the ratio of the circumference of a circle to its diameter.
|
||||
* It is useful in combination with the trigonometric functions
|
||||
* <b>sin()</b> and <b>cos()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref constants
|
||||
* @webBrief QUARTER_PI is a mathematical constant with the value 0.7853982.
|
||||
* @see PConstants#PI
|
||||
* @see PConstants#TWO_PI
|
||||
* @see PConstants#TAU
|
||||
@@ -178,15 +175,14 @@ public interface PConstants {
|
||||
*/
|
||||
static final float QUARTER_PI = (float) (Math.PI / 4.0);
|
||||
/**
|
||||
* ( begin auto-generated from TWO_PI.xml )
|
||||
*
|
||||
* TWO_PI is a mathematical constant with the value 6.28318530717958647693.
|
||||
* It is twice the ratio of the circumference of a circle to its diameter.
|
||||
* It is useful in combination with the trigonometric functions
|
||||
* <b>sin()</b> and <b>cos()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref constants
|
||||
* @webBrief TWO_PI is a mathematical constant with the value 6.28318530717958647693.
|
||||
* @see PConstants#PI
|
||||
* @see PConstants#TAU
|
||||
* @see PConstants#HALF_PI
|
||||
@@ -194,15 +190,14 @@ public interface PConstants {
|
||||
*/
|
||||
static final float TWO_PI = (float) (2.0 * Math.PI);
|
||||
/**
|
||||
* ( begin auto-generated from TAU.xml )
|
||||
*
|
||||
* TAU is an alias for TWO_PI, a mathematical constant with the value
|
||||
* 6.28318530717958647693. It is twice the ratio of the circumference
|
||||
* of a circle to its diameter. It is useful in combination with the
|
||||
* trigonometric functions <b>sin()</b> and <b>cos()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref constants
|
||||
* @webBrief An alias for TWO_PI
|
||||
* @see PConstants#PI
|
||||
* @see PConstants#TWO_PI
|
||||
* @see PConstants#HALF_PI
|
||||
|
||||
@@ -56,6 +56,7 @@ import java.util.HashMap;
|
||||
* ^^^^^^^^^^^^^^ setWidth (width displaced by char)
|
||||
* </PRE>
|
||||
* @webref typography
|
||||
* @webBrief Grayscale bitmap font class used by Processing.
|
||||
* @see PApplet#loadFont(String)
|
||||
* @see PApplet#createFont(String, float, boolean, char[])
|
||||
* @see PGraphics#textFont(PFont)
|
||||
@@ -869,7 +870,6 @@ public class PFont implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PFont_list.xml )
|
||||
*
|
||||
* Gets a list of the fonts installed on the system. The data is returned
|
||||
* as a String array. This list provides the names of each font for input
|
||||
@@ -877,9 +877,9 @@ public class PFont implements PConstants {
|
||||
* fonts. This function is meant as a tool for programming local
|
||||
* applications and is not recommended for use in applets.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pfont
|
||||
* @webBrief Gets a list of the fonts installed on the system.
|
||||
* @usage application
|
||||
* @brief Gets a list of the fonts installed on the system
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,6 @@ import processing.awt.ShimAWT;
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage.xml )
|
||||
*
|
||||
* Datatype for storing images. Processing can display <b>.gif</b>,
|
||||
* <b>.jpg</b>, <b>.tga</b>, and <b>.png</b> images. Images may be
|
||||
@@ -51,9 +50,9 @@ import processing.awt.ShimAWT;
|
||||
* <br/> create a new image, use the <b>createImage()</b> function. Do not
|
||||
* use the syntax <b>new PImage()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref image
|
||||
* @webBrief Datatype for storing images.
|
||||
* @usage Web & Application
|
||||
* @instanceName pimg any object of type PImage
|
||||
* @see PApplet#loadImage(String)
|
||||
@@ -81,7 +80,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
public int format;
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from pixels.xml )
|
||||
*
|
||||
* Array containing the values for all the pixels in the display window.
|
||||
* These values are of the color datatype. This array is the size of the
|
||||
@@ -98,11 +96,10 @@ public class PImage implements PConstants, Cloneable {
|
||||
* Without <b>loadPixels()</b>, running the code may (or will in future
|
||||
* releases) result in a NullPointerException.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @webBrief Array containing the color of every pixel in the image.
|
||||
* @usage web_application
|
||||
* @brief Array containing the color of every pixel in the image
|
||||
*/
|
||||
public int[] pixels;
|
||||
|
||||
@@ -114,26 +111,22 @@ public class PImage implements PConstants, Cloneable {
|
||||
public int pixelHeight;
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_width.xml )
|
||||
*
|
||||
* The width of the image in units of pixels.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pimage:field
|
||||
* @webBrief The width of the image in units of pixels.
|
||||
* @usage web_application
|
||||
* @brief Image width
|
||||
*/
|
||||
public int width;
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_height.xml )
|
||||
*
|
||||
* The height of the image in units of pixels.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pimage:field
|
||||
* @webBrief The height of the image in units of pixels.
|
||||
* @usage web_application
|
||||
* @brief Image height
|
||||
*/
|
||||
public int height;
|
||||
|
||||
@@ -206,7 +199,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
* <br/> <br/>
|
||||
* To create a new image, use the <b>createImage()</b> function (do not use
|
||||
* <b>new PImage()</b>).
|
||||
* ( end auto-generated )
|
||||
* @nowebref
|
||||
* @usage web_application
|
||||
* @see PApplet#loadImage(String, String)
|
||||
@@ -384,7 +376,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_loadPixels.xml )
|
||||
*
|
||||
* Loads the pixel data for the image into its <b>pixels[]</b> array. This
|
||||
* function must always be called before reading from or writing to <b>pixels[]</b>.
|
||||
@@ -396,7 +387,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
* function in the current Processing release, this will always be subject
|
||||
* to change.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* <h3>Advanced</h3>
|
||||
* Call this when you want to mess with the pixels[] array.
|
||||
@@ -405,7 +395,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
* this should copy all data into the pixels[] array
|
||||
*
|
||||
* @webref pimage:pixels
|
||||
* @brief Loads the pixel data for the image into its pixels[] array
|
||||
* @webBrief Loads the pixel data for the image into its <b>pixels[]</b> array.
|
||||
* @usage web_application
|
||||
*/
|
||||
public void loadPixels() { // ignore
|
||||
@@ -422,7 +412,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_updatePixels.xml )
|
||||
*
|
||||
* Updates the image with the data in its <b>pixels[]</b> array. Use in
|
||||
* conjunction with <b>loadPixels()</b>. If you're only reading pixels from
|
||||
@@ -438,14 +427,13 @@ public class PImage implements PConstants, Cloneable {
|
||||
* Currently, none of the renderers use the additional parameters to
|
||||
* <b>updatePixels()</b>, however this may be implemented in the future.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* <h3>Advanced</h3>
|
||||
* Mark the pixels in this region as needing an update.
|
||||
* This is not currently used by any of the renderers, however the api
|
||||
* is structured this way in the hope of being able to use this to
|
||||
* speed things up in the future.
|
||||
* @webref pimage:pixels
|
||||
* @brief Updates the image with the data in its pixels[] array
|
||||
* @webBrief Updates the image with the data in its <b>pixels[]</b> array.
|
||||
* @usage web_application
|
||||
* @param x x-coordinate of the upper-left corner
|
||||
* @param y y-coordinate of the upper-left corner
|
||||
@@ -497,7 +485,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_resize.xml )
|
||||
*
|
||||
* Resize the image to a new width and height. To make the image scale
|
||||
* proportionally, use 0 as the value for the <b>wide</b> or <b>high</b>
|
||||
@@ -511,9 +498,8 @@ public class PImage implements PConstants, Cloneable {
|
||||
* content, first get a copy of its image data using the <b>get()</b>
|
||||
* method, and call <b>resize()</b> on the PImage that is returned.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pimage:method
|
||||
* @brief Changes the size of an image to a new width and height
|
||||
* @webBrief Resize the image to a new width and height.
|
||||
* @usage web_application
|
||||
* @param w the resized image width
|
||||
* @param h the resized image height
|
||||
@@ -550,7 +536,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_get.xml )
|
||||
*
|
||||
* Reads the color of any pixel or grabs a section of an image. If no
|
||||
* parameters are specified, the entire image is returned. Use the <b>x</b>
|
||||
@@ -571,7 +556,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
* equivalent statement to <b>get(x, y)</b> using <b>pixels[]</b> is
|
||||
* <b>pixels[y*width+x]</b>. See the reference for <b>pixels[]</b> for more information.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* <h3>Advanced</h3>
|
||||
* Returns an ARGB "color" type (a packed 32 bit int with the color.
|
||||
@@ -592,7 +576,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
* pixels[] array directly.
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @brief Reads the color of any pixel or grabs a rectangle of pixels
|
||||
* @webBrief Reads the color of any pixel or grabs a rectangle of pixels.
|
||||
* @usage web_application
|
||||
* @param x x-coordinate of the pixel
|
||||
* @param y y-coordinate of the pixel
|
||||
@@ -709,7 +693,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_set.xml )
|
||||
*
|
||||
* Changes the color of any pixel or writes an image directly into the
|
||||
* display window.<br />
|
||||
@@ -727,10 +710,9 @@ public class PImage implements PConstants, Cloneable {
|
||||
* is <b>pixels[y*width+x] = #000000</b>. See the reference for
|
||||
* <b>pixels[]</b> for more information.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @brief writes a color to any pixel or writes an image into another
|
||||
* @webBrief Writes a color to any pixel or writes an image into another
|
||||
* @usage web_application
|
||||
* @param x x-coordinate of the pixel
|
||||
* @param y y-coordinate of the pixel
|
||||
@@ -831,7 +813,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_mask.xml )
|
||||
*
|
||||
* Masks part of an image from displaying by loading another image and
|
||||
* using it as an alpha channel. This mask image should only contain
|
||||
@@ -844,7 +825,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
* same length as the target image's pixels array and should contain only
|
||||
* grayscale data of values between 0-255.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* <h3>Advanced</h3>
|
||||
*
|
||||
@@ -861,9 +841,9 @@ public class PImage implements PConstants, Cloneable {
|
||||
* performing a proper luminance-based conversion.
|
||||
*
|
||||
* @webref pimage:method
|
||||
* @webBrief Masks part of an image with another image as an alpha channel
|
||||
* @usage web_application
|
||||
* @param img image to use as the mask
|
||||
* @brief Masks part of an image with another image as an alpha channel
|
||||
*/
|
||||
public void mask(PImage img) {
|
||||
img.loadPixels();
|
||||
@@ -949,7 +929,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_filter.xml )
|
||||
*
|
||||
* Filters an image as defined by one of the following modes:<br /><br
|
||||
* />THRESHOLD - converts the image to black and white pixels depending if
|
||||
@@ -975,7 +954,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
* <br />
|
||||
* DILATE - increases the light areas with the amount defined by the level parameter
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* <h3>Advanced</h3>
|
||||
* Method to apply a variety of basic filters to this image.
|
||||
@@ -996,7 +974,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
* <A HREF="http://incubator.quasimondo.com">Mario Klingemann</A>
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @brief Converts the image to grayscale or black and white
|
||||
* @webBrief Converts the image to grayscale or black and white
|
||||
* @usage web_application
|
||||
* @param kind Either THRESHOLD, GRAY, OPAQUE, INVERT, POSTERIZE, BLUR, ERODE, or DILATE
|
||||
* @param param unique for each, see above
|
||||
@@ -1501,7 +1479,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_copy.xml )
|
||||
*
|
||||
* Copies a region of pixels from one image into another. If the source and
|
||||
* destination regions aren't the same size, it will automatically resize
|
||||
@@ -1511,10 +1488,9 @@ public class PImage implements PConstants, Cloneable {
|
||||
* <br /><br />
|
||||
* As of release 0149, this function ignores <b>imageMode()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @brief Copies the entire image
|
||||
* @webBrief Copies the entire image
|
||||
* @usage web_application
|
||||
* @param sx X coordinate of the source's upper left corner
|
||||
* @param sy Y coordinate of the source's upper left corner
|
||||
@@ -1550,13 +1526,11 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from blendColor.xml )
|
||||
*
|
||||
* Blends two color values together based on the blending mode given as the
|
||||
* <b>MODE</b> parameter. The possible modes are described in the reference
|
||||
* for the <b>blend()</b> function.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* <h3>Advanced</h3>
|
||||
* <UL>
|
||||
* <LI>REPLACE - destination colour equals colour of source pixel: C = A.
|
||||
@@ -1621,6 +1595,8 @@ public class PImage implements PConstants, Cloneable {
|
||||
* built with Processing.</P>
|
||||
*
|
||||
* @webref color:creating_reading
|
||||
* @webBrief Blends two color values together based on the blending mode given as the
|
||||
* <b>MODE</b> parameter.
|
||||
* @usage web_application
|
||||
* @param c1 the first color to blend
|
||||
* @param c2 the second color to blend
|
||||
@@ -1663,7 +1639,6 @@ public class PImage implements PConstants, Cloneable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_blend.xml )
|
||||
*
|
||||
* Blends a region of pixels into the image specified by the <b>img</b>
|
||||
* parameter. These copies utilize full alpha channel support and a choice
|
||||
@@ -1711,10 +1686,9 @@ public class PImage implements PConstants, Cloneable {
|
||||
* <br />
|
||||
* As of release 0149, this function ignores <b>imageMode()</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref image:pixels
|
||||
* @brief Copies a pixel or rectangle of pixels using different blending modes
|
||||
* @webBrief Copies a pixel or rectangle of pixels using different blending modes.
|
||||
* @param src an image variable referring to the source image
|
||||
* @param sx X coordinate of the source's upper left corner
|
||||
* @param sy Y coordinate of the source's upper left corner
|
||||
@@ -3269,7 +3243,6 @@ int testFunction(int dst, int src) {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PImage_save.xml )
|
||||
*
|
||||
* Saves the image into a file. Append a file extension to the name of
|
||||
* the file, to indicate the file format to be used: either TIFF (.tif),
|
||||
@@ -3283,7 +3256,6 @@ int testFunction(int dst, int src) {
|
||||
* program and can therefore save the file to the right place. See the
|
||||
* <b>createImage()</b> reference for more information.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* <h3>Advanced</h3>
|
||||
* Save this image to disk.
|
||||
* <p>
|
||||
@@ -3310,7 +3282,7 @@ int testFunction(int dst, int src) {
|
||||
* file with no error.
|
||||
*
|
||||
* @webref pimage:method
|
||||
* @brief Saves the image to a TIFF, TARGA, PNG, or JPEG file
|
||||
* @webBrief Saves the image to a TIFF, TARGA, PNG, or JPEG file.
|
||||
* @usage application
|
||||
* @param filename a sequence of letters and numbers
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,6 @@ import java.util.Base64;
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape.xml )
|
||||
*
|
||||
* Datatype for storing shapes. Processing can currently load and display
|
||||
* SVG (Scalable Vector Graphics) shapes. Before a shape is used, it must
|
||||
@@ -49,7 +48,6 @@ import java.util.Base64;
|
||||
* and Adobe Illustrator. It is not a full SVG implementation, but offers
|
||||
* some straightforward support for handling vector data.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* <h3>Advanced</h3>
|
||||
*
|
||||
* In-progress class to handle shape data, currently to be considered of
|
||||
@@ -78,6 +76,7 @@ import java.util.Base64;
|
||||
* the PShape interface, and the ease of loadShape() and shape().</p>
|
||||
*
|
||||
* @webref shape
|
||||
* @webBrief Datatype for storing shapes.
|
||||
* @usage Web & Application
|
||||
* @see PApplet#loadShape(String)
|
||||
* @see PApplet#createShape()
|
||||
@@ -134,26 +133,22 @@ public class PShape implements PConstants {
|
||||
"This renderer does not support %1$s for individual vertices";
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_width.xml )
|
||||
*
|
||||
* The width of the PShape document.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:field
|
||||
* @usage web_application
|
||||
* @brief Shape document width
|
||||
* @webBrief Shape document width
|
||||
* @see PShape#height
|
||||
*/
|
||||
public float width;
|
||||
/**
|
||||
* ( begin auto-generated from PShape_height.xml )
|
||||
*
|
||||
* The height of the PShape document.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:field
|
||||
* @usage web_application
|
||||
* @brief Shape document height
|
||||
* @webBrief Shape document height
|
||||
* @see PShape#width
|
||||
*/
|
||||
public float height;
|
||||
@@ -393,7 +388,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_isVisible.xml )
|
||||
*
|
||||
* Returns a boolean value "true" if the image is set to be visible,
|
||||
* "false" if not. This is modified with the <b>setVisible()</b> parameter.
|
||||
@@ -402,10 +396,9 @@ public class PShape implements PConstants {
|
||||
* created the SVG file. For instance, this parameter is controlled by
|
||||
* showing or hiding the shape in the layers palette in Adobe Illustrator.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Returns a boolean value "true" if the image is set to be visible, "false" if not
|
||||
* @webBrief Returns a boolean value "true" if the image is set to be visible, "false" if not
|
||||
* @see PShape#setVisible(boolean)
|
||||
*/
|
||||
public boolean isVisible() {
|
||||
@@ -414,7 +407,6 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_setVisible.xml )
|
||||
*
|
||||
* Sets the shape to be visible or invisible. This is determined by the
|
||||
* value of the <b>visible</b> parameter.
|
||||
@@ -423,10 +415,9 @@ public class PShape implements PConstants {
|
||||
* created the SVG file. For instance, this parameter is controlled by
|
||||
* showing or hiding the shape in the layers palette in Adobe Illustrator.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:mathod
|
||||
* @usage web_application
|
||||
* @brief Sets the shape to be visible or invisible
|
||||
* @webBrief Sets the shape to be visible or invisible
|
||||
* @param visible "false" makes the shape invisible and "true" makes it visible
|
||||
* @see PShape#isVisible()
|
||||
*/
|
||||
@@ -436,20 +427,18 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_disableStyle.xml )
|
||||
*
|
||||
* Disables the shape's style data and uses Processing's current styles.
|
||||
* Styles include attributes such as colors, stroke weight, and stroke
|
||||
* joints.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* <h3>Advanced</h3>
|
||||
* Overrides this shape's style information and uses PGraphics styles and
|
||||
* colors. Identical to ignoreStyles(true). Also disables styles for all
|
||||
* child shapes.
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Disables the shape's style data and uses Processing styles
|
||||
* @webBrief Disables the shape's style data and uses Processing styles
|
||||
* @see PShape#enableStyle()
|
||||
*/
|
||||
public void disableStyle() {
|
||||
@@ -462,17 +451,15 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_enableStyle.xml )
|
||||
*
|
||||
* Enables the shape's style data and ignores Processing's current styles.
|
||||
* Styles include attributes such as colors, stroke weight, and stroke
|
||||
* joints.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Enables the shape's style data and ignores the Processing styles
|
||||
* @webBrief Enables the shape's style data and ignores the Processing styles
|
||||
* @see PShape#disableStyle()
|
||||
*/
|
||||
public void enableStyle() {
|
||||
@@ -624,8 +611,21 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* The <b>beginContour()</b> and <b>endContour()</b> methods make it
|
||||
* possible to define shapes with other shapes cut out of them. For
|
||||
* example, the inside of a letter 'O'. These two functions are always
|
||||
* used together, you'll never use one without the other. Between them,
|
||||
* define the geometry you want to create. As you'll see when you run
|
||||
* the example above, the second smaller shape is cut out of the first
|
||||
* larger shape.<br />
|
||||
* <br />
|
||||
* The exterior shape and the interior contour must <em>wind</em> in
|
||||
* opposite directions. This means that if the points of the geometry
|
||||
* for the exterior shape are described in a clockwise order, the points
|
||||
* on the interior shape are defined in a counterclockwise order.
|
||||
*
|
||||
* @webref shape:vertex
|
||||
* @brief Starts a new contour
|
||||
* @webBrief Starts a new contour
|
||||
* @see PShape#endContour()
|
||||
*/
|
||||
public void beginContour() {
|
||||
@@ -659,8 +659,21 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* The <b>beginContour()</b> and <b>endContour()</b> methods make
|
||||
* it possible to define shapes with other shapes cut out of them.
|
||||
* For example, the inside of a letter 'O'. These two functions are
|
||||
* always used together, you'll never use one without the other.
|
||||
* Between them, define the geometry you want to create. As you'll
|
||||
* see when you run the example above, the second smaller shape is
|
||||
* cut out of the first larger shape.<br />
|
||||
* <br />
|
||||
* The exterior shape and the interior contour must <em>wind</em>
|
||||
* in opposite directions. This means that if the points of the
|
||||
* geometry for the exterior shape are described in a clockwise order,
|
||||
* the points on the interior shape are defined in a counterclockwise order.
|
||||
*
|
||||
* @webref shape:vertex
|
||||
* @brief Ends a contour
|
||||
* @webBrief Ends a contour
|
||||
* @see PShape#beginContour()
|
||||
*/
|
||||
public void endContour() {
|
||||
@@ -752,8 +765,11 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* This method is used to start a custom shape created with the <b>createShape()</b>
|
||||
* function. It's always and only used with <b>createShape()</b>.
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @brief Starts the creation of a new PShape
|
||||
* @webBrief Starts the creation of a new PShape
|
||||
* @see PApplet#endShape()
|
||||
*/
|
||||
public void beginShape() {
|
||||
@@ -767,8 +783,11 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to complete a custom shape created with the <b>createShape()</b>
|
||||
* function. It's always and only used with <b>createShape()</b>.
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @brief Finishes the creation of a new PShape
|
||||
* @webBrief Finishes the creation of a new PShape
|
||||
* @see PApplet#beginShape()
|
||||
*/
|
||||
public void endShape() {
|
||||
@@ -1974,8 +1993,10 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of children within the PShape.
|
||||
*
|
||||
* @webref
|
||||
* @brief Returns the number of children
|
||||
* @webBrief Returns the number of children
|
||||
*/
|
||||
public int getChildCount() {
|
||||
return childCount;
|
||||
@@ -1997,16 +2018,14 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_getChild.xml )
|
||||
*
|
||||
* Extracts a child shape from a parent shape. Specify the name of the
|
||||
* shape with the <b>target</b> parameter. The shape is returned as a
|
||||
* <b>PShape</b> object, or <b>null</b> is returned if there is an error.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Returns a child element of a shape as a PShape object
|
||||
* @webBrief Returns a child element of a shape as a PShape object
|
||||
* @param index the layer position of the shape to get
|
||||
* @see PShape#addChild(PShape)
|
||||
*/
|
||||
@@ -2050,8 +2069,12 @@ public class PShape implements PConstants {
|
||||
|
||||
// can't be just 'add' because that suggests additive geometry
|
||||
/**
|
||||
* Adds a child PShape to a parent PShape that is defined as a GROUP.
|
||||
* In the example, the three shapes <b>path</b>, <b>rectangle</b>,
|
||||
* and <b>circle</b> are added to a parent PShape variable named
|
||||
* <b>house</b> that is a GROUP.
|
||||
* @webref pshape:method
|
||||
* @brief Adds a new child
|
||||
* @webBrief Adds a new child
|
||||
* @param who any variable of type PShape
|
||||
* @see PShape#getChild(int)
|
||||
*/
|
||||
@@ -2220,8 +2243,13 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* The <b>getVertexCount()</b> method returns the number of vertices that
|
||||
* make up a PShape. In the above example, the value 4 is returned by the
|
||||
* <b>getVertexCount()</b> method because 4 vertices are defined in
|
||||
* <b>setup()</b>.
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @brief Returns the total number of vertices as an int
|
||||
* @webBrief Returns the total number of vertices as an int
|
||||
* @see PShape#getVertex(int)
|
||||
* @see PShape#setVertex(int, float, float)
|
||||
*/
|
||||
@@ -2234,8 +2262,14 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* The <b>getVertex()</b> method returns a PVector with the coordinates of
|
||||
* the vertex point located at the position defined by the <b>index</b>
|
||||
* parameter. This method works when shapes are created as shown in the
|
||||
* example above, but won't work properly when a shape is defined explicitly
|
||||
* (e.g. <b>createShape(RECT, 20, 20, 80, 80)</b>.
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @brief Returns the vertex at the index position
|
||||
* @webBrief Returns the vertex at the index position
|
||||
* @param index the location of the vertex
|
||||
* @see PShape#setVertex(int, float, float)
|
||||
* @see PShape#getVertexCount()
|
||||
@@ -2280,8 +2314,13 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* The <b>setVertex()</b> method defines the coordinates of the vertex point
|
||||
* located at the position defined by the <b>index</b> parameter. This method
|
||||
* works when shapes are created as shown in the example above, but won't work
|
||||
* properly when a shape is defined explicitly (e.g. <b>createShape(RECT, 20, 20, 80, 80)</b>.
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @brief Sets the vertex at the index position
|
||||
* @webBrief Sets the vertex at the index position
|
||||
* @param index the location of the vertex
|
||||
* @param x the x value for the vertex
|
||||
* @param y the y value for the vertex
|
||||
@@ -2471,7 +2510,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_setFill.xml )
|
||||
*
|
||||
* The <b>setFill()</b> method defines the fill color of a <b>PShape</b>.
|
||||
* This method is used after shapes are created or when a shape is defined explicitly
|
||||
@@ -2482,11 +2520,10 @@ public class PShape implements PConstants {
|
||||
* created, only the <b>setFill()</b> method can define a new fill value for
|
||||
* the <b>PShape</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref
|
||||
* @param fill
|
||||
* @brief Set the fill value
|
||||
* @webBrief Set the fill value
|
||||
*/
|
||||
public void setFill(int fill) {
|
||||
if (openShape) {
|
||||
@@ -2627,7 +2664,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_setStroke.xml )
|
||||
*
|
||||
* The <b>setStroke()</b> method defines the outline color of a <b>PShape</b>.
|
||||
* This method is used after shapes are created or when a shape is defined
|
||||
@@ -2638,11 +2674,10 @@ public class PShape implements PConstants {
|
||||
* However, after the shape is created, only the <b>setStroke()</b> method
|
||||
* can define a new stroke value for the <b>PShape</b>.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref
|
||||
* @param stroke
|
||||
* @brief Set the stroke value
|
||||
* @webBrief Set the stroke value
|
||||
*/
|
||||
public void setStroke(int stroke) {
|
||||
if (openShape) {
|
||||
@@ -3034,7 +3069,6 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_translate.xml )
|
||||
*
|
||||
* Specifies an amount to displace the shape. The <b>x</b> parameter
|
||||
* specifies left/right translation, the <b>y</b> parameter specifies
|
||||
@@ -3048,10 +3082,9 @@ public class PShape implements PConstants {
|
||||
* Using this method with the <b>z</b> parameter requires using the P3D
|
||||
* parameter in combination with size.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Displaces the shape
|
||||
* @webBrief Displaces the shape
|
||||
* @param x left/right translation
|
||||
* @param y up/down translation
|
||||
* @see PShape#rotate(float)
|
||||
@@ -3072,7 +3105,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_rotateX.xml )
|
||||
*
|
||||
* Rotates a shape around the x-axis the amount specified by the
|
||||
* <b>angle</b> parameter. Angles should be specified in radians (values
|
||||
@@ -3088,10 +3120,9 @@ public class PShape implements PConstants {
|
||||
* This method requires a 3D renderer. You need to use P3D as a third
|
||||
* parameter for the <b>size()</b> function as shown in the example above.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Rotates the shape around the x-axis
|
||||
* @webBrief Rotates the shape around the x-axis
|
||||
* @param angle angle of rotation specified in radians
|
||||
* @see PShape#rotate(float)
|
||||
* @see PShape#rotateY(float)
|
||||
@@ -3105,7 +3136,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_rotateY.xml )
|
||||
*
|
||||
* Rotates a shape around the y-axis the amount specified by the
|
||||
* <b>angle</b> parameter. Angles should be specified in radians (values
|
||||
@@ -3121,11 +3151,10 @@ public class PShape implements PConstants {
|
||||
* This method requires a 3D renderer. You need to use P3D as a third
|
||||
* parameter for the <b>size()</b> function as shown in the example above.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Rotates the shape around the y-axis
|
||||
* @webBrief Rotates the shape around the y-axis
|
||||
* @param angle angle of rotation specified in radians
|
||||
* @see PShape#rotate(float)
|
||||
* @see PShape#rotateX(float)
|
||||
@@ -3140,7 +3169,6 @@ public class PShape implements PConstants {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_rotateZ.xml )
|
||||
*
|
||||
* Rotates a shape around the z-axis the amount specified by the
|
||||
* <b>angle</b> parameter. Angles should be specified in radians (values
|
||||
@@ -3156,10 +3184,9 @@ public class PShape implements PConstants {
|
||||
* This method requires a 3D renderer. You need to use P3D as a third
|
||||
* parameter for the <b>size()</b> function as shown in the example above.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Rotates the shape around the z-axis
|
||||
* @webBrief Rotates the shape around the z-axis
|
||||
* @param angle angle of rotation specified in radians
|
||||
* @see PShape#rotate(float)
|
||||
* @see PShape#rotateX(float)
|
||||
@@ -3173,7 +3200,6 @@ public class PShape implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_rotate.xml )
|
||||
*
|
||||
* Rotates a shape the amount specified by the <b>angle</b> parameter.
|
||||
* Angles should be specified in radians (values from 0 to TWO_PI) or
|
||||
@@ -3187,10 +3213,9 @@ public class PShape implements PConstants {
|
||||
* <b>rotate(PI)</b>. This transformation is applied directly to the shape,
|
||||
* it's not refreshed each time <b>draw()</b> is run.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Rotates the shape
|
||||
* @webBrief Rotates the shape
|
||||
* @param angle angle of rotation specified in radians
|
||||
* @see PShape#rotateX(float)
|
||||
* @see PShape#rotateY(float)
|
||||
@@ -3224,7 +3249,6 @@ public class PShape implements PConstants {
|
||||
//
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_scale.xml )
|
||||
*
|
||||
* Increases or decreases the size of a shape by expanding and contracting
|
||||
* vertices. Shapes always scale from the relative origin of their bounding
|
||||
@@ -3238,10 +3262,9 @@ public class PShape implements PConstants {
|
||||
* Using this method with the <b>z</b> parameter requires using the P3D
|
||||
* parameter in combination with size.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @usage web_application
|
||||
* @brief Increases and decreases the size of a shape
|
||||
* @webBrief Increases and decreases the size of a shape
|
||||
* @param s percentate to scale the object
|
||||
* @see PShape#rotate(float)
|
||||
* @see PShape#translate(float, float)
|
||||
@@ -3272,14 +3295,12 @@ public class PShape implements PConstants {
|
||||
//
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PShape_resetMatrix.xml )
|
||||
*
|
||||
* Replaces the current matrix of a shape with the identity matrix. The
|
||||
* equivalent function in OpenGL is glLoadIdentity().
|
||||
*
|
||||
* ( end auto-generated )
|
||||
* @webref pshape:method
|
||||
* @brief Replaces the current matrix of a shape with the identity matrix
|
||||
* @webBrief Replaces the current matrix of a shape with the identity matrix
|
||||
* @usage web_application
|
||||
* @see PShape#rotate(float)
|
||||
* @see PShape#scale(float)
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector.xml )
|
||||
*
|
||||
* A class to describe a two or three dimensional vector. This datatype
|
||||
* stores two or three variables that are commonly used as a position,
|
||||
@@ -49,7 +48,6 @@ import java.io.Serializable;
|
||||
* <a
|
||||
* href="http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/">developer's reference.</a>
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* A class to describe a two or three dimensional vector.
|
||||
* <p>
|
||||
@@ -65,47 +63,42 @@ import java.io.Serializable;
|
||||
* Initially based on the Vector3D class by <a href="http://www.shiffman.net">Dan Shiffman</a>.
|
||||
*
|
||||
* @webref math
|
||||
* @webBrief A class to describe a two or three dimensional vector.
|
||||
*/
|
||||
public class PVector implements Serializable {
|
||||
/**
|
||||
* ( begin auto-generated from PVector_x.xml )
|
||||
*
|
||||
* The x component of the vector. This field (variable) can be used to both
|
||||
* get and set the value (see above example.)
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:field
|
||||
* @usage web_application
|
||||
* @brief The x component of the vector
|
||||
* @webBrief The x component of the vector
|
||||
*/
|
||||
public float x;
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_y.xml )
|
||||
*
|
||||
* The y component of the vector. This field (variable) can be used to both
|
||||
* get and set the value (see above example.)
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:field
|
||||
* @usage web_application
|
||||
* @brief The y component of the vector
|
||||
* @webBrief The y component of the vector
|
||||
*/
|
||||
public float y;
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_z.xml )
|
||||
*
|
||||
* The z component of the vector. This field (variable) can be used to both
|
||||
* get and set the value (see above example.)
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:field
|
||||
* @usage web_application
|
||||
* @brief The z component of the vector
|
||||
* @webBrief The z component of the vector
|
||||
*/
|
||||
public float z;
|
||||
|
||||
@@ -144,18 +137,16 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_set.xml )
|
||||
*
|
||||
* Sets the x, y, and z component of the vector using two or three separate
|
||||
* variables, the data from a PVector, or the values from a float array.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @param x the x component of the vector
|
||||
* @param y the y component of the vector
|
||||
* @param z the z component of the vector
|
||||
* @brief Set the components of the vector
|
||||
* @webBrief Set the components of the vector
|
||||
*/
|
||||
public PVector set(float x, float y, float z) {
|
||||
this.x = x;
|
||||
@@ -207,7 +198,6 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_random2D.xml )
|
||||
*
|
||||
* Make a new 2D unit vector with a random direction. If you pass in "this"
|
||||
* as an argument, it will use the PApplet's random number generator. You can
|
||||
@@ -216,7 +206,7 @@ public class PVector implements Serializable {
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @return the random PVector
|
||||
* @brief Make a new 2D unit vector with a random direction.
|
||||
* @webBrief Make a new 2D unit vector with a random direction.
|
||||
* @see PVector#random3D()
|
||||
*/
|
||||
static public PVector random2D() {
|
||||
@@ -258,7 +248,6 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_random3D.xml )
|
||||
*
|
||||
* Make a new 3D unit vector with a random direction. If you pass in "this"
|
||||
* as an argument, it will use the PApplet's random number generator. You can
|
||||
@@ -267,7 +256,7 @@ public class PVector implements Serializable {
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @return the random PVector
|
||||
* @brief Make a new 3D unit vector with a random direction.
|
||||
* @webBrief Make a new 3D unit vector with a random direction.
|
||||
* @see PVector#random2D()
|
||||
*/
|
||||
static public PVector random3D() {
|
||||
@@ -323,15 +312,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_sub.xml )
|
||||
*
|
||||
* Make a new 2D unit vector from an angle.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Make a new 2D unit vector from an angle
|
||||
* @webBrief Make a new 2D unit vector from an angle
|
||||
* @param angle the angle in radians
|
||||
* @return the new unit PVector
|
||||
*/
|
||||
@@ -357,15 +344,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_copy.xml )
|
||||
*
|
||||
* Gets a copy of the vector, returns a PVector object.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Get a copy of the vector
|
||||
* @webBrief Get a copy of the vector
|
||||
*/
|
||||
public PVector copy() {
|
||||
return new PVector(x, y, z);
|
||||
@@ -397,16 +382,14 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_mag.xml )
|
||||
*
|
||||
* Calculates the magnitude (length) of the vector and returns the result
|
||||
* as a float (this is simply the equation <em>sqrt(x*x + y*y + z*z)</em>.)
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Calculate the magnitude of the vector
|
||||
* @webBrief Calculate the magnitude of the vector
|
||||
* @return magnitude (length) of the vector
|
||||
* @see PVector#magSq()
|
||||
*/
|
||||
@@ -416,18 +399,16 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_mag.xml )
|
||||
*
|
||||
* Calculates the squared magnitude of the vector and returns the result
|
||||
* as a float (this is simply the equation <em>(x*x + y*y + z*z)</em>.)
|
||||
* Faster if the real length is not required in the
|
||||
* case of comparing vectors, etc.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Calculate the magnitude of the vector, squared
|
||||
* @webBrief Calculate the magnitude of the vector, squared
|
||||
* @return squared magnitude of the vector
|
||||
* @see PVector#mag()
|
||||
*/
|
||||
@@ -437,7 +418,6 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_add.xml )
|
||||
*
|
||||
* Adds x, y, and z components to a vector, adds one vector to another, or
|
||||
* adds two independent vectors together. The version of the method that
|
||||
@@ -445,12 +425,11 @@ public class PVector implements Serializable {
|
||||
* others have no return value -- they act directly on the vector. See the
|
||||
* examples for more context.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param v the vector to be added
|
||||
* @brief Adds x, y, and z components to a vector, one vector to another, or two independent vectors
|
||||
* @webBrief Adds x, y, and z components to a vector, one vector to another, or two independent vectors
|
||||
*/
|
||||
public PVector add(PVector v) {
|
||||
x += v.x;
|
||||
@@ -507,7 +486,6 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_sub.xml )
|
||||
*
|
||||
* Subtracts x, y, and z components from a vector, subtracts one vector
|
||||
* from another, or subtracts two independent vectors. The version of the
|
||||
@@ -515,12 +493,11 @@ public class PVector implements Serializable {
|
||||
* PVector, the others have no return value -- they act directly on the
|
||||
* vector. See the examples for more context.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param v any variable of type PVector
|
||||
* @brief Subtract x, y, and z components from a vector, one vector from another, or two independent vectors
|
||||
* @webBrief Subtract x, y, and z components from a vector, one vector from another, or two independent vectors
|
||||
*/
|
||||
public PVector sub(PVector v) {
|
||||
x -= v.x;
|
||||
@@ -577,15 +554,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_mult.xml )
|
||||
*
|
||||
* Multiplies a vector by a scalar or multiplies one vector by another.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Multiply a vector by a scalar
|
||||
* @webBrief Multiply a vector by a scalar
|
||||
* @param n the number to multiply with the vector
|
||||
*/
|
||||
public PVector mult(float n) {
|
||||
@@ -619,15 +594,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_div.xml )
|
||||
*
|
||||
* Divides a vector by a scalar or divides one vector by another.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Divide a vector by a scalar
|
||||
* @webBrief Divide a vector by a scalar
|
||||
* @param n the number by which to divide the vector
|
||||
*/
|
||||
public PVector div(float n) {
|
||||
@@ -663,17 +636,15 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_dist.xml )
|
||||
*
|
||||
* Calculates the Euclidean distance between two points (considering a
|
||||
* point as a vector object).
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param v the x, y, and z coordinates of a PVector
|
||||
* @brief Calculate the distance between two points
|
||||
* @webBrief Calculate the distance between two points
|
||||
*/
|
||||
public float dist(PVector v) {
|
||||
float dx = x - v.x;
|
||||
@@ -697,17 +668,15 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_dot.xml )
|
||||
*
|
||||
* Calculates the dot product of two vectors.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param v any variable of type PVector
|
||||
* @return the dot product
|
||||
* @brief Calculate the dot product of two vectors
|
||||
* @webBrief Calculate the dot product of two vectors
|
||||
*/
|
||||
public float dot(PVector v) {
|
||||
return x*v.x + y*v.y + z*v.z;
|
||||
@@ -734,16 +703,14 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_cross.xml )
|
||||
*
|
||||
* Calculates and returns a vector composed of the cross product between
|
||||
* two vectors.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @param v the vector to calculate the cross product
|
||||
* @brief Calculate and return the cross product
|
||||
* @webBrief Calculate and return the cross product
|
||||
*/
|
||||
public PVector cross(PVector v) {
|
||||
return cross(v, null);
|
||||
@@ -788,15 +755,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_normalize.xml )
|
||||
*
|
||||
* Normalize the vector to length 1 (make it a unit vector).
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Normalize the vector to a length of 1
|
||||
* @webBrief Normalize the vector to a length of 1
|
||||
*/
|
||||
public PVector normalize() {
|
||||
float m = mag();
|
||||
@@ -826,16 +791,14 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_limit.xml )
|
||||
*
|
||||
* Limit the magnitude of this vector to the value used for the <b>max</b> parameter.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param max the maximum magnitude for the vector
|
||||
* @brief Limit the magnitude of the vector
|
||||
* @webBrief Limit the magnitude of the vector
|
||||
*/
|
||||
public PVector limit(float max) {
|
||||
if (magSq() > max*max) {
|
||||
@@ -847,16 +810,14 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_setMag.xml )
|
||||
*
|
||||
* Set the magnitude of this vector to the value used for the <b>len</b> parameter.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param len the new length for this vector
|
||||
* @brief Set the magnitude of the vector
|
||||
* @webBrief Set the magnitude of the vector
|
||||
*/
|
||||
public PVector setMag(float len) {
|
||||
normalize();
|
||||
@@ -879,16 +840,14 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_setMag.xml )
|
||||
*
|
||||
* Calculate the angle of rotation for this vector (only 2D vectors)
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @return the angle of rotation
|
||||
* @brief Calculate the angle of rotation for this vector
|
||||
* @webBrief Calculate the angle of rotation for this vector
|
||||
*/
|
||||
public float heading() {
|
||||
float angle = (float) Math.atan2(y, x);
|
||||
@@ -903,15 +862,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_rotate.xml )
|
||||
*
|
||||
* Rotate the vector by an angle (only 2D vectors), magnitude remains the same
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Rotate the vector by an angle (2D only)
|
||||
* @webBrief Rotate the vector by an angle (2D only)
|
||||
* @param theta the angle of rotation
|
||||
*/
|
||||
public PVector rotate(float theta) {
|
||||
@@ -924,15 +881,13 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_rotate.xml )
|
||||
*
|
||||
* Linear interpolate the vector to another vector
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @brief Linear interpolate the vector to another vector
|
||||
* @webBrief Linear interpolate the vector to another vector
|
||||
* @param v the vector to lerp to
|
||||
* @param amt The amount of interpolation; some value between 0.0 (old vector) and 1.0 (new vector). 0.1 is very near the old vector; 0.5 is halfway in between.
|
||||
* @see PApplet#lerp(float, float, float)
|
||||
@@ -972,17 +927,15 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_angleBetween.xml )
|
||||
*
|
||||
* Calculates and returns the angle (in radians) between two vectors.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage web_application
|
||||
* @param v1 the x, y, and z components of a PVector
|
||||
* @param v2 the x, y, and z components of a PVector
|
||||
* @brief Calculate and return the angle between two vectors
|
||||
* @webBrief Calculate and return the angle between two vectors
|
||||
*/
|
||||
static public float angleBetween(PVector v1, PVector v2) {
|
||||
|
||||
@@ -1017,17 +970,15 @@ public class PVector implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* ( begin auto-generated from PVector_array.xml )
|
||||
*
|
||||
* Return a representation of this vector as a float array. This is only
|
||||
* for temporary use. If used in any other fashion, the contents should be
|
||||
* copied by using the <b>PVector.get()</b> method to copy into your own array.
|
||||
*
|
||||
* ( end auto-generated )
|
||||
*
|
||||
* @webref pvector:method
|
||||
* @usage: web_application
|
||||
* @brief Return a representation of the vector as a float array
|
||||
* @webBrief Return a representation of the vector as a float array
|
||||
*/
|
||||
public float[] array() {
|
||||
if (array == null) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import processing.core.PApplet;
|
||||
* A simple table class to use a String as a lookup for an float value.
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief A simple table class to use a String as a lookup for an float value.
|
||||
* @see IntDict
|
||||
* @see StringDict
|
||||
*/
|
||||
@@ -108,8 +109,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of key/value pairs
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Returns the number of key/value pairs
|
||||
* @webBrief Returns the number of key/value pairs
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -145,7 +148,7 @@ public class FloatDict {
|
||||
* Remove all entries.
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Remove all entries
|
||||
* @webBrief Remove all entries
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -259,7 +262,7 @@ public class FloatDict {
|
||||
* Return a copy of the internal keys array. This array can be modified.
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Return a copy of the internal keys array
|
||||
* @webBrief Return a copy of the internal keys array
|
||||
*/
|
||||
public String[] keyArray() {
|
||||
crop();
|
||||
@@ -281,9 +284,11 @@ public class FloatDict {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Return the internal array being used to store the values
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Return the internal array being used to store the values
|
||||
* @webBrief Return the internal array being used to store the values
|
||||
*/
|
||||
public Iterable<Float> values() {
|
||||
return new Iterable<Float>() {
|
||||
@@ -320,7 +325,7 @@ public class FloatDict {
|
||||
* Create a new array and copy each of the values into it.
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Create a new array and copy each of the values into it
|
||||
* @webBrief Create a new array and copy each of the values into it
|
||||
*/
|
||||
public float[] valueArray() {
|
||||
crop();
|
||||
@@ -346,7 +351,7 @@ public class FloatDict {
|
||||
* Return a value for the specified key.
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Return a value for the specified key
|
||||
* @webBrief Return a value for the specified key
|
||||
*/
|
||||
public float get(String key) {
|
||||
int index = index(key);
|
||||
@@ -367,8 +372,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new key/value pair or change the value of one
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Create a new key/value pair or change the value of one
|
||||
* @webBrief Create a new key/value pair or change the value of one
|
||||
*/
|
||||
public void set(String key, float amount) {
|
||||
int index = index(key);
|
||||
@@ -390,8 +397,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Check if a key is a part of the data structure
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Check if a key is a part of the data structure
|
||||
* @webBrief Check if a key is a part of the data structure
|
||||
*/
|
||||
public boolean hasKey(String key) {
|
||||
return index(key) != -1;
|
||||
@@ -399,8 +408,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Add to a value
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(String key, float amount) {
|
||||
int index = index(key);
|
||||
@@ -413,8 +424,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Subtract from a value
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(String key, float amount) {
|
||||
add(key, -amount);
|
||||
@@ -422,8 +435,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply a value
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(String key, float amount) {
|
||||
int index = index(key);
|
||||
@@ -434,8 +449,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Divide a value
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(String key, float amount) {
|
||||
int index = index(key);
|
||||
@@ -456,8 +473,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Return the smallest value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Return the smallest value
|
||||
* @webBrief Return the smallest value
|
||||
*/
|
||||
public int minIndex() {
|
||||
//checkMinMax("minIndex");
|
||||
@@ -510,8 +529,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Return the largest value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Return the largest value
|
||||
* @webBrief Return the largest value
|
||||
*/
|
||||
// The index of the entry that has the max value. Reference above is incorrect.
|
||||
public int maxIndex() {
|
||||
@@ -605,8 +626,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Remove a key/value pair
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Remove a key/value pair
|
||||
* @webBrief Remove a key/value pair
|
||||
*/
|
||||
public float remove(String key) {
|
||||
int index = index(key);
|
||||
@@ -655,7 +678,7 @@ public class FloatDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Sort the keys alphabetically
|
||||
* @webBrief Sort the keys alphabetically
|
||||
*/
|
||||
public void sortKeys() {
|
||||
sortImpl(true, false, true);
|
||||
@@ -663,8 +686,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Sort the keys alphabetically in reverse
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Sort the keys alphabetically in reverse
|
||||
* @webBrief Sort the keys alphabetically in reverse
|
||||
*/
|
||||
public void sortKeysReverse() {
|
||||
sortImpl(true, true, true);
|
||||
@@ -675,7 +700,7 @@ public class FloatDict {
|
||||
* Sort by values in descending order (largest value will be at [0]).
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Sort by values in ascending order
|
||||
* @webBrief Sort by values in ascending order
|
||||
*/
|
||||
public void sortValues() {
|
||||
sortValues(true);
|
||||
@@ -693,8 +718,10 @@ public class FloatDict {
|
||||
|
||||
|
||||
/**
|
||||
* Sort by values in descending order
|
||||
*
|
||||
* @webref floatdict:method
|
||||
* @brief Sort by values in descending order
|
||||
* @webBrief Sort by values in descending order
|
||||
*/
|
||||
public void sortValuesReverse() {
|
||||
sortValuesReverse(true);
|
||||
|
||||
@@ -18,6 +18,7 @@ import processing.core.PApplet;
|
||||
* a sorted copy, use list.copy().sort().
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief Helper class for a list of floats.
|
||||
* @see IntList
|
||||
* @see StringList
|
||||
*/
|
||||
@@ -112,7 +113,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Get the length of the list.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Get the length of the list
|
||||
* @webBrief Get the length of the list
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -136,7 +137,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Remove all entries from the list.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Remove all entries from the list
|
||||
* @webBrief Remove all entries from the list
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -147,7 +148,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Get an entry at a particular index.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Get an entry at a particular index
|
||||
* @webBrief Get an entry at a particular index
|
||||
*/
|
||||
public float get(int index) {
|
||||
if (index >= count) {
|
||||
@@ -163,7 +164,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* entries with 0s.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Set the entry at a particular index
|
||||
* @webBrief Set the entry at a particular index
|
||||
*/
|
||||
public void set(int index, float what) {
|
||||
if (index >= count) {
|
||||
@@ -197,7 +198,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Remove an element from the specified index.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Remove an element from the specified index
|
||||
* @webBrief Remove an element from the specified index
|
||||
*/
|
||||
public float remove(int index) {
|
||||
if (index < 0 || index >= count) {
|
||||
@@ -301,7 +302,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Add a new entry to the list.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Add a new entry to the list
|
||||
* @webBrief Add a new entry to the list
|
||||
*/
|
||||
public void append(float value) {
|
||||
if (count == data.length) {
|
||||
@@ -466,8 +467,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Check if a number is a part of the list
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Check if a number is a part of the list
|
||||
* @webBrief Check if a number is a part of the list
|
||||
*/
|
||||
public boolean hasValue(float value) {
|
||||
if (Float.isNaN(value)) {
|
||||
@@ -495,8 +498,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Add to a value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(int index, float amount) {
|
||||
if (index < count) {
|
||||
@@ -508,8 +513,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Subtract from a value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(int index, float amount) {
|
||||
if (index < count) {
|
||||
@@ -521,8 +528,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply a value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(int index, float amount) {
|
||||
if (index < count) {
|
||||
@@ -534,8 +543,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Divide a value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(int index, float amount) {
|
||||
if (index < count) {
|
||||
@@ -557,8 +568,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Return the smallest value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Return the smallest value
|
||||
* @webBrief Return the smallest value
|
||||
*/
|
||||
public float min() {
|
||||
checkMinMax("min");
|
||||
@@ -593,8 +606,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Return the largest value
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Return the largest value
|
||||
* @webBrief Return the largest value
|
||||
*/
|
||||
public float max() {
|
||||
checkMinMax("max");
|
||||
@@ -653,7 +668,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Sorts the array in place.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Sorts an array, lowest to highest
|
||||
* @webBrief Sorts an array, lowest to highest
|
||||
*/
|
||||
public void sort() {
|
||||
Arrays.sort(data, 0, count);
|
||||
@@ -664,7 +679,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Reverse sort, orders values from highest to lowest
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Reverse sort, orders values from highest to lowest
|
||||
* @webBrief Reverse sort, orders values from highest to lowest
|
||||
*/
|
||||
public void sortReverse() {
|
||||
new Sort() {
|
||||
@@ -728,8 +743,10 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the order of the list elements
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Reverse the order of the list elements
|
||||
* @webBrief Reverse the order of the list elements
|
||||
*/
|
||||
public void reverse() {
|
||||
int ii = count - 1;
|
||||
@@ -747,7 +764,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* obey the randomSeed() function in PApplet.
|
||||
*
|
||||
* @webref floatlist:method
|
||||
* @brief Randomize the order of the list elements
|
||||
* @webBrief Randomize the order of the list elements
|
||||
*/
|
||||
public void shuffle() {
|
||||
Random r = new Random();
|
||||
@@ -826,7 +843,7 @@ public class FloatList implements Iterable<Float> {
|
||||
* Create a new array with a copy of all the values.
|
||||
* @return an array sized by the length of the list with each of the values.
|
||||
* @webref floatlist:method
|
||||
* @brief Create a new array with a copy of all the values
|
||||
* @webBrief Create a new array with a copy of all the values
|
||||
*/
|
||||
public float[] array() {
|
||||
return array(null);
|
||||
|
||||
@@ -12,6 +12,7 @@ import processing.core.PApplet;
|
||||
* A simple class to use a String as a lookup for an int value.
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief A simple class to use a String as a lookup for an int value.
|
||||
* @see FloatDict
|
||||
* @see StringDict
|
||||
*/
|
||||
@@ -110,7 +111,7 @@ public class IntDict {
|
||||
* Returns the number of key/value pairs
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Returns the number of key/value pairs
|
||||
* @webBrief Returns the number of key/value pairs
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -144,7 +145,7 @@ public class IntDict {
|
||||
* Remove all entries.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Remove all entries
|
||||
* @webBrief Remove all entries
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -258,7 +259,7 @@ public class IntDict {
|
||||
* Return a copy of the internal keys array. This array can be modified.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Return a copy of the internal keys array
|
||||
* @webBrief Return a copy of the internal keys array
|
||||
*/
|
||||
public String[] keyArray() {
|
||||
crop();
|
||||
@@ -282,7 +283,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Return the internal array being used to store the values
|
||||
* @webBrief Return the internal array being used to store the values
|
||||
*/
|
||||
public Iterable<Integer> values() {
|
||||
return new Iterable<Integer>() {
|
||||
@@ -319,7 +320,7 @@ public class IntDict {
|
||||
* Create a new array and copy each of the values into it.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Create a new array and copy each of the values into it
|
||||
* @webBrief Create a new array and copy each of the values into it
|
||||
*/
|
||||
public int[] valueArray() {
|
||||
crop();
|
||||
@@ -347,7 +348,7 @@ public class IntDict {
|
||||
* Return a value for the specified key.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Return a value for the specified key
|
||||
* @webBrief Return a value for the specified key
|
||||
*/
|
||||
public int get(String key) {
|
||||
int index = index(key);
|
||||
@@ -369,7 +370,7 @@ public class IntDict {
|
||||
* Create a new key/value pair or change the value of one.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Create a new key/value pair or change the value of one
|
||||
* @webBrief Create a new key/value pair or change the value of one
|
||||
*/
|
||||
public void set(String key, int amount) {
|
||||
int index = index(key);
|
||||
@@ -392,7 +393,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Check if a key is a part of the data structure
|
||||
* @webBrief Check if a key is a part of the data structure
|
||||
*/
|
||||
public boolean hasKey(String key) {
|
||||
return index(key) != -1;
|
||||
@@ -403,7 +404,7 @@ public class IntDict {
|
||||
* Increase the value associated with a specific key by 1.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Increase the value of a specific key value by 1
|
||||
* @webBrief Increase the value of a specific key value by 1
|
||||
*/
|
||||
public void increment(String key) {
|
||||
add(key, 1);
|
||||
@@ -424,7 +425,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(String key, int amount) {
|
||||
int index = index(key);
|
||||
@@ -438,7 +439,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(String key, int amount) {
|
||||
add(key, -amount);
|
||||
@@ -447,7 +448,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(String key, int amount) {
|
||||
int index = index(key);
|
||||
@@ -459,7 +460,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(String key, int amount) {
|
||||
int index = index(key);
|
||||
@@ -590,7 +591,7 @@ public class IntDict {
|
||||
|
||||
/**
|
||||
* @webref intdict:method
|
||||
* @brief Remove a key/value pair
|
||||
* @webBrief Remove a key/value pair
|
||||
*/
|
||||
public int remove(String key) {
|
||||
int index = index(key);
|
||||
@@ -639,7 +640,7 @@ public class IntDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort the keys alphabetically
|
||||
* @webBrief Sort the keys alphabetically
|
||||
*/
|
||||
public void sortKeys() {
|
||||
sortImpl(true, false, true);
|
||||
@@ -650,7 +651,7 @@ public class IntDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort the keys alphabetically in reverse
|
||||
* @webBrief Sort the keys alphabetically in reverse
|
||||
*/
|
||||
public void sortKeysReverse() {
|
||||
sortImpl(true, true, true);
|
||||
@@ -661,7 +662,7 @@ public class IntDict {
|
||||
* Sort by values in ascending order. The smallest value will be at [0].
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort by values in ascending order
|
||||
* @webBrief Sort by values in ascending order
|
||||
*/
|
||||
public void sortValues() {
|
||||
sortValues(true);
|
||||
@@ -682,7 +683,7 @@ public class IntDict {
|
||||
* Sort by values in descending order. The largest value will be at [0].
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort by values in descending order
|
||||
* @webBrief Sort by values in descending order
|
||||
*/
|
||||
public void sortValuesReverse() {
|
||||
sortValuesReverse(true);
|
||||
|
||||
@@ -23,6 +23,7 @@ import processing.core.PApplet;
|
||||
* a sorted copy, use list.copy().sort().
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief Helper class for a list of ints.
|
||||
* @see FloatList
|
||||
* @see StringList
|
||||
*/
|
||||
@@ -131,7 +132,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Get the length of the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Get the length of the list
|
||||
* @webBrief Get the length of the list
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -155,7 +156,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Remove all entries from the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Remove all entries from the list
|
||||
* @webBrief Remove all entries from the list
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -166,7 +167,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Get an entry at a particular index.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Get an entry at a particular index
|
||||
* @webBrief Get an entry at a particular index
|
||||
*/
|
||||
public int get(int index) {
|
||||
if (index >= this.count) {
|
||||
@@ -182,7 +183,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* entries with 0s.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Set the entry at a particular index
|
||||
* @webBrief Set the entry at a particular index
|
||||
*/
|
||||
public void set(int index, int what) {
|
||||
if (index >= count) {
|
||||
@@ -216,7 +217,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Remove an element from the specified index
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Remove an element from the specified index
|
||||
* @webBrief Remove an element from the specified index
|
||||
*/
|
||||
public int remove(int index) {
|
||||
if (index < 0 || index >= count) {
|
||||
@@ -269,7 +270,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Add a new entry to the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Add a new entry to the list
|
||||
* @webBrief Add a new entry to the list
|
||||
*/
|
||||
public void append(int value) {
|
||||
if (count == data.length) {
|
||||
@@ -444,7 +445,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Check if a number is a part of the list
|
||||
* @webBrief Check if a number is a part of the list
|
||||
*/
|
||||
public boolean hasValue(int value) {
|
||||
// if (indexCache == null) {
|
||||
@@ -461,7 +462,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Add one to a value
|
||||
* @webBrief Add one to a value
|
||||
*/
|
||||
public void increment(int index) {
|
||||
if (count <= index) {
|
||||
@@ -480,7 +481,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -492,7 +493,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -504,7 +505,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -516,7 +517,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -539,7 +540,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Return the smallest value
|
||||
* @webBrief Return the smallest value
|
||||
*/
|
||||
public int min() {
|
||||
checkMinMax("min");
|
||||
@@ -569,7 +570,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Return the largest value
|
||||
* @webBrief Return the largest value
|
||||
*/
|
||||
public int max() {
|
||||
checkMinMax("max");
|
||||
@@ -622,7 +623,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Sorts the array in place.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Sorts the array, lowest to highest
|
||||
* @webBrief Sorts the array, lowest to highest
|
||||
*/
|
||||
public void sort() {
|
||||
Arrays.sort(data, 0, count);
|
||||
@@ -633,7 +634,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* Reverse sort, orders values from highest to lowest.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Reverse sort, orders values from highest to lowest
|
||||
* @webBrief Reverse sort, orders values from highest to lowest
|
||||
*/
|
||||
public void sortReverse() {
|
||||
new Sort() {
|
||||
@@ -676,7 +677,7 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
/**
|
||||
* @webref intlist:method
|
||||
* @brief Reverse the order of the list elements
|
||||
* @webBrief Reverse the order of the list elements
|
||||
*/
|
||||
public void reverse() {
|
||||
int ii = count - 1;
|
||||
@@ -694,7 +695,7 @@ public class IntList implements Iterable<Integer> {
|
||||
* obey the randomSeed() function in PApplet.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Randomize the order of the list elements
|
||||
* @webBrief Randomize the order of the list elements
|
||||
*/
|
||||
public void shuffle() {
|
||||
Random r = new Random();
|
||||
@@ -770,7 +771,7 @@ public class IntList implements Iterable<Integer> {
|
||||
*
|
||||
* @return an array sized by the length of the list with each of the values.
|
||||
* @webref intlist:method
|
||||
* @brief Create a new array with a copy of all the values
|
||||
* @webBrief Create a new array with a copy of all the values
|
||||
*/
|
||||
public int[] array() {
|
||||
return array(null);
|
||||
|
||||
@@ -91,6 +91,7 @@ import processing.core.PApplet;
|
||||
* @author JSON.org
|
||||
* @version 2012-11-13
|
||||
* @webref data:composite
|
||||
* @webBrief A JSONArray is an ordered sequence of values.
|
||||
* @see JSONObject
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#loadJSONArray(String)
|
||||
@@ -276,7 +277,7 @@ public class JSONArray {
|
||||
* Get the string associated with an index.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the String value associated with an index
|
||||
* @webBrief Gets the String value associated with an index
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @return A string value.
|
||||
* @throws RuntimeException If there is no string value for the index.
|
||||
@@ -311,7 +312,7 @@ public class JSONArray {
|
||||
* Get the int value associated with an index.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the int value associated with an index
|
||||
* @webBrief Gets the int value associated with an index
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @return The value.
|
||||
* @throws RuntimeException If the key is not found or if the value is not a number.
|
||||
@@ -390,7 +391,7 @@ public class JSONArray {
|
||||
* internally, so this is simply getDouble() cast to a float.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the float value associated with an index
|
||||
* @webBrief Gets the float value associated with an index
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @see JSONArray#getInt(int)
|
||||
* @see JSONArray#getString(int)
|
||||
@@ -453,7 +454,7 @@ public class JSONArray {
|
||||
* The string values "true" and "false" are converted to boolean.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the boolean value associated with an index
|
||||
* @webBrief Gets the boolean value associated with an index
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @return The truth.
|
||||
* @throws RuntimeException If there is no value for the index or if the
|
||||
@@ -499,7 +500,7 @@ public class JSONArray {
|
||||
* Get the JSONArray associated with an index.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the JSONArray associated with an index value
|
||||
* @webBrief Gets the JSONArray associated with an index value
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @return A JSONArray value.
|
||||
* @throws RuntimeException If there is no value for the index. or if the
|
||||
@@ -530,7 +531,7 @@ public class JSONArray {
|
||||
* Get the JSONObject associated with an index.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the JSONObject associated with an index value
|
||||
* @webBrief Gets the JSONObject associated with an index value
|
||||
* @param index the index value of the object to get
|
||||
* @return A JSONObject value.
|
||||
* @throws RuntimeException If there is no value for the index or if the
|
||||
@@ -561,7 +562,7 @@ public class JSONArray {
|
||||
* Get this entire array as a String array.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the entire array as an array of Strings
|
||||
* @webBrief Gets the entire array as an array of Strings
|
||||
* @see JSONArray#getIntArray()
|
||||
*/
|
||||
public String[] getStringArray() {
|
||||
@@ -577,7 +578,7 @@ public class JSONArray {
|
||||
* Get this entire array as an int array. Everything must be an int.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the entire array as array of ints
|
||||
* @webBrief Gets the entire array as array of ints
|
||||
* @see JSONArray#getStringArray()
|
||||
*/
|
||||
public int[] getIntArray() {
|
||||
@@ -698,7 +699,7 @@ public class JSONArray {
|
||||
* Append an String value. This increases the array's length by one.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Appends a value, increasing the array's length by one
|
||||
* @webBrief Appends a value, increasing the array's length by one
|
||||
* @param value a String value
|
||||
* @return this.
|
||||
* @see JSONArray#size()
|
||||
@@ -852,7 +853,7 @@ public class JSONArray {
|
||||
* it out.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Put a String value in the JSONArray
|
||||
* @webBrief Put a String value in the JSONArray
|
||||
* @param index an index value
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -873,7 +874,7 @@ public class JSONArray {
|
||||
* it out.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Put an int value in the JSONArray
|
||||
* @webBrief Put an int value in the JSONArray
|
||||
* @param index an index value
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -909,7 +910,7 @@ public class JSONArray {
|
||||
* setDouble(value).
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Put a float value in the JSONArray
|
||||
* @webBrief Put a float value in the JSONArray
|
||||
* @param index an index value
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -945,7 +946,7 @@ public class JSONArray {
|
||||
* necessary to pad it out.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Put a boolean value in the JSONArray
|
||||
* @webBrief Put a boolean value in the JSONArray
|
||||
* @param index an index value
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -974,8 +975,10 @@ public class JSONArray {
|
||||
// }
|
||||
|
||||
/**
|
||||
* Sets the JSONArray value associated with an index value
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Sets the JSONArray value associated with an index value
|
||||
* @webBrief Sets the JSONArray value associated with an index value
|
||||
* @param index the index value to target
|
||||
* @param value the value to assign
|
||||
* @see JSONArray#setJSONObject(int, JSONObject)
|
||||
@@ -988,8 +991,10 @@ public class JSONArray {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JSONObject value associated with an index value
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Sets the JSONObject value associated with an index value
|
||||
* @webBrief Sets the JSONObject value associated with an index value
|
||||
* @param index the index value to target
|
||||
* @param value the value to assign
|
||||
* @see JSONArray#setJSONArray(int, JSONArray)
|
||||
@@ -1035,7 +1040,7 @@ public class JSONArray {
|
||||
* Get the number of elements in the JSONArray, included nulls.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Gets the number of elements in the JSONArray
|
||||
* @webBrief Gets the number of elements in the JSONArray
|
||||
* @return The length (or size).
|
||||
* @see JSONArray#append(String)
|
||||
* @see JSONArray#remove(int)
|
||||
@@ -1048,6 +1053,7 @@ public class JSONArray {
|
||||
/**
|
||||
* Determine if the value is null.
|
||||
* @webref
|
||||
* @webBrief Determine if the value is null.
|
||||
* @param index must be between 0 and length() - 1
|
||||
* @return true if the value at the index is null, or if there is no value.
|
||||
*/
|
||||
@@ -1060,7 +1066,7 @@ public class JSONArray {
|
||||
* Remove an index and close the hole.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Removes an element
|
||||
* @webBrief Removes an element
|
||||
* @param index the index value of the element to be removed
|
||||
* @return The value that was associated with the index, or null if there was no value.
|
||||
* @see JSONArray#size()
|
||||
|
||||
@@ -104,6 +104,7 @@ import processing.core.PApplet;
|
||||
* @author JSON.org
|
||||
* @version 2012-12-01
|
||||
* @webref data:composite
|
||||
* @webBrief A JSONObject is an unordered collection of name/value pairs.
|
||||
* @see JSONArray
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#loadJSONArray(String)
|
||||
@@ -557,7 +558,7 @@ public class JSONObject {
|
||||
* Gets the String associated with a key
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the string value associated with a key
|
||||
* @webBrief Gets the string value associated with a key
|
||||
* @param key a key string
|
||||
* @return A string which is the value.
|
||||
* @throws RuntimeException if there is no string value for the key.
|
||||
@@ -596,7 +597,7 @@ public class JSONObject {
|
||||
* Gets the int value associated with a key
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the int value associated with a key
|
||||
* @webBrief Gets the int value associated with a key
|
||||
* @param key A key string.
|
||||
* @return The integer value.
|
||||
* @throws RuntimeException if the key is not found or if the value cannot
|
||||
@@ -678,8 +679,10 @@ public class JSONObject {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the float value associated with a key
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the float value associated with a key
|
||||
* @webBrief Gets the float value associated with a key
|
||||
* @param key a key string
|
||||
* @see JSONObject#getInt(String)
|
||||
* @see JSONObject#getString(String)
|
||||
@@ -741,7 +744,7 @@ public class JSONObject {
|
||||
* Get the boolean value associated with a key.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the boolean value associated with a key
|
||||
* @webBrief Gets the boolean value associated with a key
|
||||
* @param key a key string
|
||||
* @return The truth.
|
||||
* @throws RuntimeException if the value is not a Boolean or the String "true" or "false".
|
||||
@@ -786,7 +789,7 @@ public class JSONObject {
|
||||
* Get the JSONArray value associated with a key.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the JSONArray value associated with a key
|
||||
* @webBrief Gets the JSONArray value associated with a key
|
||||
* @param key a key string
|
||||
* @return A JSONArray which is the value, or null if not present
|
||||
* @throws RuntimeException if the value is not a JSONArray.
|
||||
@@ -810,7 +813,7 @@ public class JSONObject {
|
||||
* Get the JSONObject value associated with a key.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Gets the JSONObject value associated with a key
|
||||
* @webBrief Gets the JSONObject value associated with a key
|
||||
* @param key a key string
|
||||
* @return A JSONObject which is the value or null if not available.
|
||||
* @throws RuntimeException if the value is not a JSONObject.
|
||||
@@ -917,6 +920,8 @@ public class JSONObject {
|
||||
* no value.
|
||||
*
|
||||
* @webref
|
||||
* @webBrief Determine if the value associated with the key is null or if there is
|
||||
* no value.
|
||||
* @param key A key string.
|
||||
* @return true if there is no value associated with the key or if
|
||||
* the value is the JSONObject.NULL object.
|
||||
@@ -1157,7 +1162,7 @@ public class JSONObject {
|
||||
|
||||
/**
|
||||
* @webref jsonobject:method
|
||||
* @brief Put a key/String pair in the JSONObject
|
||||
* @webBrief Put a key/String pair in the JSONObject
|
||||
* @param key a key string
|
||||
* @param value the value to assign
|
||||
* @see JSONObject#setInt(String, int)
|
||||
@@ -1173,7 +1178,7 @@ public class JSONObject {
|
||||
* Put a key/int pair in the JSONObject.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Put a key/int pair in the JSONObject
|
||||
* @webBrief Put a key/int pair in the JSONObject
|
||||
* @param key a key string
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -1202,8 +1207,10 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a key/float pair in the JSONObject
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Put a key/float pair in the JSONObject
|
||||
* @webBrief Put a key/float pair in the JSONObject
|
||||
* @param key a key string
|
||||
* @param value the value to assign
|
||||
* @throws RuntimeException If the key is null or if the number is NaN or infinite.
|
||||
@@ -1235,7 +1242,7 @@ public class JSONObject {
|
||||
* Put a key/boolean pair in the JSONObject.
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Put a key/boolean pair in the JSONObject
|
||||
* @webBrief Put a key/boolean pair in the JSONObject
|
||||
* @param key a key string
|
||||
* @param value the value to assign
|
||||
* @return this.
|
||||
@@ -1250,8 +1257,10 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JSONObject value associated with a key
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Sets the JSONObject value associated with a key
|
||||
* @webBrief Sets the JSONObject value associated with a key
|
||||
* @param key a key string
|
||||
* @param value value to assign
|
||||
* @see JSONObject#setJSONArray(String, JSONArray)
|
||||
@@ -1263,8 +1272,10 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JSONArray value associated with a key
|
||||
*
|
||||
* @webref jsonobject:method
|
||||
* @brief Sets the JSONArray value associated with a key
|
||||
* @webBrief Sets the JSONArray value associated with a key
|
||||
* @param key a key string
|
||||
* @param value value to assign
|
||||
* @see JSONObject#setJSONObject(String, JSONObject)
|
||||
|
||||
@@ -110,7 +110,7 @@ public class LongDict {
|
||||
* Returns the number of key/value pairs
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Returns the number of key/value pairs
|
||||
* @webBrief Returns the number of key/value pairs
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -144,7 +144,7 @@ public class LongDict {
|
||||
* Remove all entries.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Remove all entries
|
||||
* @webBrief Remove all entries
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -258,7 +258,7 @@ public class LongDict {
|
||||
* Return a copy of the internal keys array. This array can be modified.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Return a copy of the internal keys array
|
||||
* @webBrief Return a copy of the internal keys array
|
||||
*/
|
||||
public String[] keyArray() {
|
||||
crop();
|
||||
@@ -281,8 +281,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Return the internal array being used to store the values
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Return the internal array being used to store the values
|
||||
* @webBrief Return the internal array being used to store the values
|
||||
*/
|
||||
public Iterable<Long> values() {
|
||||
return new Iterable<Long>() {
|
||||
@@ -319,7 +321,7 @@ public class LongDict {
|
||||
* Create a new array and copy each of the values into it.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Create a new array and copy each of the values into it
|
||||
* @webBrief Create a new array and copy each of the values into it
|
||||
*/
|
||||
public int[] valueArray() {
|
||||
crop();
|
||||
@@ -347,7 +349,7 @@ public class LongDict {
|
||||
* Return a value for the specified key.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Return a value for the specified key
|
||||
* @webBrief Return a value for the specified key
|
||||
*/
|
||||
public long get(String key) {
|
||||
int index = index(key);
|
||||
@@ -369,7 +371,7 @@ public class LongDict {
|
||||
* Create a new key/value pair or change the value of one.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Create a new key/value pair or change the value of one
|
||||
* @webBrief Create a new key/value pair or change the value of one
|
||||
*/
|
||||
public void set(String key, long amount) {
|
||||
int index = index(key);
|
||||
@@ -391,8 +393,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Check if a key is a part of the data structure
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Check if a key is a part of the data structure
|
||||
* @webBrief Check if a key is a part of the data structure
|
||||
*/
|
||||
public boolean hasKey(String key) {
|
||||
return index(key) != -1;
|
||||
@@ -403,7 +407,7 @@ public class LongDict {
|
||||
* Increase the value associated with a specific key by 1.
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Increase the value of a specific key value by 1
|
||||
* @webBrief Increase the value of a specific key value by 1
|
||||
*/
|
||||
public void increment(String key) {
|
||||
add(key, 1);
|
||||
@@ -423,8 +427,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Add to a value
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(String key, long amount) {
|
||||
int index = index(key);
|
||||
@@ -437,8 +443,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Subtract from a value
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(String key, long amount) {
|
||||
add(key, -amount);
|
||||
@@ -446,8 +454,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply a value
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(String key, long amount) {
|
||||
int index = index(key);
|
||||
@@ -458,8 +468,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Divide a value
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(String key, long amount) {
|
||||
int index = index(key);
|
||||
@@ -578,8 +590,10 @@ public class LongDict {
|
||||
|
||||
|
||||
/**
|
||||
* Remove a key/value pair
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Remove a key/value pair
|
||||
* @webBrief Remove a key/value pair
|
||||
*/
|
||||
public long remove(String key) {
|
||||
int index = index(key);
|
||||
@@ -628,7 +642,7 @@ public class LongDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort the keys alphabetically
|
||||
* @webBrief Sort the keys alphabetically
|
||||
*/
|
||||
public void sortKeys() {
|
||||
sortImpl(true, false, true);
|
||||
@@ -639,7 +653,7 @@ public class LongDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort the keys alphabetically in reverse
|
||||
* @webBrief Sort the keys alphabetically in reverse
|
||||
*/
|
||||
public void sortKeysReverse() {
|
||||
sortImpl(true, true, true);
|
||||
@@ -650,7 +664,7 @@ public class LongDict {
|
||||
* Sort by values in ascending order. The smallest value will be at [0].
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort by values in ascending order
|
||||
* @webBrief Sort by values in ascending order
|
||||
*/
|
||||
public void sortValues() {
|
||||
sortValues(true);
|
||||
@@ -671,7 +685,7 @@ public class LongDict {
|
||||
* Sort by values in descending order. The largest value will be at [0].
|
||||
*
|
||||
* @webref intdict:method
|
||||
* @brief Sort by values in descending order
|
||||
* @webBrief Sort by values in descending order
|
||||
*/
|
||||
public void sortValuesReverse() {
|
||||
sortValuesReverse(true);
|
||||
|
||||
@@ -131,7 +131,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Get the length of the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Get the length of the list
|
||||
* @webBrief Get the length of the list
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -155,7 +155,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Remove all entries from the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Remove all entries from the list
|
||||
* @webBrief Remove all entries from the list
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -166,7 +166,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Get an entry at a particular index.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Get an entry at a particular index
|
||||
* @webBrief Get an entry at a particular index
|
||||
*/
|
||||
public long get(int index) {
|
||||
if (index >= this.count) {
|
||||
@@ -182,7 +182,7 @@ public class LongList implements Iterable<Long> {
|
||||
* entries with 0s.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Set the entry at a particular index
|
||||
* @webBrief Set the entry at a particular index
|
||||
*/
|
||||
public void set(int index, int what) {
|
||||
if (index >= count) {
|
||||
@@ -216,7 +216,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Remove an element from the specified index
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Remove an element from the specified index
|
||||
* @webBrief Remove an element from the specified index
|
||||
*/
|
||||
public long remove(int index) {
|
||||
if (index < 0 || index >= count) {
|
||||
@@ -269,7 +269,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Add a new entry to the list.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Add a new entry to the list
|
||||
* @webBrief Add a new entry to the list
|
||||
*/
|
||||
public void append(long value) {
|
||||
if (count == data.length) {
|
||||
@@ -443,8 +443,10 @@ public class LongList implements Iterable<Long> {
|
||||
// }
|
||||
|
||||
/**
|
||||
* Check if a number is a part of the list
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Check if a number is a part of the list
|
||||
* @webBrief Check if a number is a part of the list
|
||||
*/
|
||||
public boolean hasValue(int value) {
|
||||
// if (indexCache == null) {
|
||||
@@ -460,8 +462,10 @@ public class LongList implements Iterable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add one to a value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Add one to a value
|
||||
* @webBrief Add one to a value
|
||||
*/
|
||||
public void increment(int index) {
|
||||
if (count <= index) {
|
||||
@@ -479,8 +483,10 @@ public class LongList implements Iterable<Long> {
|
||||
|
||||
|
||||
/**
|
||||
* Add to a value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Add to a value
|
||||
* @webBrief Add to a value
|
||||
*/
|
||||
public void add(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -491,8 +497,10 @@ public class LongList implements Iterable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract from a value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Subtract from a value
|
||||
* @webBrief Subtract from a value
|
||||
*/
|
||||
public void sub(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -503,8 +511,10 @@ public class LongList implements Iterable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiply a value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Multiply a value
|
||||
* @webBrief Multiply a value
|
||||
*/
|
||||
public void mult(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -515,8 +525,10 @@ public class LongList implements Iterable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide a value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Divide a value
|
||||
* @webBrief Divide a value
|
||||
*/
|
||||
public void div(int index, int amount) {
|
||||
if (index < count) {
|
||||
@@ -538,8 +550,10 @@ public class LongList implements Iterable<Long> {
|
||||
|
||||
|
||||
/**
|
||||
* Return the smallest value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Return the smallest value
|
||||
* @webBrief Return the smallest value
|
||||
*/
|
||||
public long min() {
|
||||
checkMinMax("min");
|
||||
@@ -568,8 +582,10 @@ public class LongList implements Iterable<Long> {
|
||||
|
||||
|
||||
/**
|
||||
* Return the largest value
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Return the largest value
|
||||
* @webBrief Return the largest value
|
||||
*/
|
||||
public long max() {
|
||||
checkMinMax("max");
|
||||
@@ -622,7 +638,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Sorts the array in place.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Sorts the array, lowest to highest
|
||||
* @webBrief Sorts the array, lowest to highest
|
||||
*/
|
||||
public void sort() {
|
||||
Arrays.sort(data, 0, count);
|
||||
@@ -633,7 +649,7 @@ public class LongList implements Iterable<Long> {
|
||||
* Reverse sort, orders values from highest to lowest.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Reverse sort, orders values from highest to lowest
|
||||
* @webBrief Reverse sort, orders values from highest to lowest
|
||||
*/
|
||||
public void sortReverse() {
|
||||
new Sort() {
|
||||
@@ -676,8 +692,10 @@ public class LongList implements Iterable<Long> {
|
||||
// }
|
||||
|
||||
/**
|
||||
* Reverse the order of the list elements
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Reverse the order of the list elements
|
||||
* @webBrief Reverse the order of the list elements
|
||||
*/
|
||||
public void reverse() {
|
||||
int ii = count - 1;
|
||||
@@ -695,7 +713,7 @@ public class LongList implements Iterable<Long> {
|
||||
* obey the randomSeed() function in PApplet.
|
||||
*
|
||||
* @webref intlist:method
|
||||
* @brief Randomize the order of the list elements
|
||||
* @webBrief Randomize the order of the list elements
|
||||
*/
|
||||
public void shuffle() {
|
||||
Random r = new Random();
|
||||
@@ -771,7 +789,7 @@ public class LongList implements Iterable<Long> {
|
||||
*
|
||||
* @return an array sized by the length of the list with each of the values.
|
||||
* @webref intlist:method
|
||||
* @brief Create a new array with a copy of all the values
|
||||
* @webBrief Create a new array with a copy of all the values
|
||||
*/
|
||||
public int[] array() {
|
||||
return array(null);
|
||||
|
||||
@@ -12,6 +12,7 @@ import processing.core.PApplet;
|
||||
* A simple table class to use a String as a lookup for another String value.
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief A simple table class to use a String as a lookup for another String value.
|
||||
* @see IntDict
|
||||
* @see FloatDict
|
||||
*/
|
||||
@@ -130,8 +131,10 @@ public class StringDict {
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of key/value pairs
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Returns the number of key/value pairs
|
||||
* @webBrief Returns the number of key/value pairs
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -165,7 +168,7 @@ public class StringDict {
|
||||
* Remove all entries.
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Remove all entries
|
||||
* @webBrief Remove all entries
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -279,7 +282,7 @@ public class StringDict {
|
||||
* Return a copy of the internal keys array. This array can be modified.
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Return a copy of the internal keys array
|
||||
* @webBrief Return a copy of the internal keys array
|
||||
*/
|
||||
public String[] keyArray() {
|
||||
crop();
|
||||
@@ -301,8 +304,10 @@ public class StringDict {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the internal array being used to store the values
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Return the internal array being used to store the values
|
||||
* @webBrief Return the internal array being used to store the values
|
||||
*/
|
||||
public Iterable<String> values() {
|
||||
return new Iterable<String>() {
|
||||
@@ -339,7 +344,7 @@ public class StringDict {
|
||||
* Create a new array and copy each of the values into it.
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Create a new array and copy each of the values into it
|
||||
* @webBrief Create a new array and copy each of the values into it
|
||||
*/
|
||||
public String[] valueArray() {
|
||||
crop();
|
||||
@@ -365,7 +370,7 @@ public class StringDict {
|
||||
* Return a value for the specified key.
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Return a value for the specified key
|
||||
* @webBrief Return a value for the specified key
|
||||
*/
|
||||
public String get(String key) {
|
||||
int index = index(key);
|
||||
@@ -382,8 +387,10 @@ public class StringDict {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new key/value pair or change the value of one
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Create a new key/value pair or change the value of one
|
||||
* @webBrief Create a new key/value pair or change the value of one
|
||||
*/
|
||||
public void set(String key, String value) {
|
||||
int index = index(key);
|
||||
@@ -411,8 +418,10 @@ public class StringDict {
|
||||
|
||||
|
||||
/**
|
||||
* Check if a key is a part of the data structure
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Check if a key is a part of the data structure
|
||||
* @webBrief Check if a key is a part of the data structure
|
||||
*/
|
||||
public boolean hasKey(String key) {
|
||||
return index(key) != -1;
|
||||
@@ -431,8 +440,10 @@ public class StringDict {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a key/value pair
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Remove a key/value pair
|
||||
* @webBrief Remove a key/value pair
|
||||
*/
|
||||
public String remove(String key) {
|
||||
int index = index(key);
|
||||
@@ -482,15 +493,17 @@ public class StringDict {
|
||||
* tie-breaker (only really possible with a key that has a case change).
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Sort the keys alphabetically
|
||||
* @webBrief Sort the keys alphabetically
|
||||
*/
|
||||
public void sortKeys() {
|
||||
sortImpl(true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the keys alphabetically in reverse
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Sort the keys alphabetically in reverse
|
||||
* @webBrief Sort the keys alphabetically in reverse
|
||||
*/
|
||||
public void sortKeysReverse() {
|
||||
sortImpl(true, true);
|
||||
@@ -501,7 +514,7 @@ public class StringDict {
|
||||
* Sort by values in descending order (largest value will be at [0]).
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Sort by values in ascending order
|
||||
* @webBrief Sort by values in ascending order
|
||||
*/
|
||||
public void sortValues() {
|
||||
sortImpl(false, false);
|
||||
@@ -509,8 +522,10 @@ public class StringDict {
|
||||
|
||||
|
||||
/**
|
||||
* Sort by values in descending order
|
||||
*
|
||||
* @webref stringdict:method
|
||||
* @brief Sort by values in descending order
|
||||
* @webBrief Sort by values in descending order
|
||||
*/
|
||||
public void sortValuesReverse() {
|
||||
sortImpl(false, true);
|
||||
|
||||
@@ -17,6 +17,7 @@ import processing.core.PApplet;
|
||||
* a sorted copy, use list.copy().sort().
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief Helper class for a list of Strings.
|
||||
* @see IntList
|
||||
* @see FloatList
|
||||
*/
|
||||
@@ -100,7 +101,7 @@ public class StringList implements Iterable<String> {
|
||||
* Get the length of the list.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Get the length of the list
|
||||
* @webBrief Get the length of the list
|
||||
*/
|
||||
public int size() {
|
||||
return count;
|
||||
@@ -124,7 +125,7 @@ public class StringList implements Iterable<String> {
|
||||
* Remove all entries from the list.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Remove all entries from the list
|
||||
* @webBrief Remove all entries from the list
|
||||
*/
|
||||
public void clear() {
|
||||
count = 0;
|
||||
@@ -135,7 +136,7 @@ public class StringList implements Iterable<String> {
|
||||
* Get an entry at a particular index.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Get an entry at a particular index
|
||||
* @webBrief Get an entry at a particular index
|
||||
*/
|
||||
public String get(int index) {
|
||||
if (index >= count) {
|
||||
@@ -151,7 +152,7 @@ public class StringList implements Iterable<String> {
|
||||
* entries with 0s.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Set an entry at a particular index
|
||||
* @webBrief Set an entry at a particular index
|
||||
*/
|
||||
public void set(int index, String what) {
|
||||
if (index >= count) {
|
||||
@@ -185,7 +186,7 @@ public class StringList implements Iterable<String> {
|
||||
* Remove an element from the specified index.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Remove an element from the specified index
|
||||
* @webBrief Remove an element from the specified index
|
||||
*/
|
||||
public String remove(int index) {
|
||||
if (index < 0 || index >= count) {
|
||||
@@ -294,7 +295,7 @@ public class StringList implements Iterable<String> {
|
||||
* Add a new entry to the list.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Add a new entry to the list
|
||||
* @webBrief Add a new entry to the list
|
||||
*/
|
||||
public void append(String value) {
|
||||
if (count == data.length) {
|
||||
@@ -467,8 +468,10 @@ public class StringList implements Iterable<String> {
|
||||
// }
|
||||
|
||||
/**
|
||||
* Check if a value is a part of the list
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Check if a value is a part of the list
|
||||
* @webBrief Check if a value is a part of the list
|
||||
*/
|
||||
public boolean hasValue(String value) {
|
||||
if (value == null) {
|
||||
@@ -492,7 +495,7 @@ public class StringList implements Iterable<String> {
|
||||
* Sorts the array in place.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Sorts the array in place
|
||||
* @webBrief Sorts the array in place
|
||||
*/
|
||||
public void sort() {
|
||||
sortImpl(false);
|
||||
@@ -503,7 +506,7 @@ public class StringList implements Iterable<String> {
|
||||
* Reverse sort, orders values from highest to lowest.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Reverse sort, orders values from highest to lowest
|
||||
* @webBrief Reverse sort, orders values from highest to lowest
|
||||
*/
|
||||
public void sortReverse() {
|
||||
sortImpl(true);
|
||||
@@ -551,8 +554,10 @@ public class StringList implements Iterable<String> {
|
||||
// }
|
||||
|
||||
/**
|
||||
* Reverse the order of the list elements
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Reverse the order of the list elements
|
||||
* @webBrief Reverse the order of the list elements
|
||||
*/
|
||||
public void reverse() {
|
||||
int ii = count - 1;
|
||||
@@ -570,7 +575,7 @@ public class StringList implements Iterable<String> {
|
||||
* obey the randomSeed() function in PApplet.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Randomize the order of the list elements
|
||||
* @webBrief Randomize the order of the list elements
|
||||
*/
|
||||
public void shuffle() {
|
||||
Random r = new Random();
|
||||
@@ -605,7 +610,7 @@ public class StringList implements Iterable<String> {
|
||||
* Make the entire list lower case.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Make the entire list lower case
|
||||
* @webBrief Make the entire list lower case
|
||||
*/
|
||||
public void lower() {
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -620,7 +625,7 @@ public class StringList implements Iterable<String> {
|
||||
* Make the entire list upper case.
|
||||
*
|
||||
* @webref stringlist:method
|
||||
* @brief Make the entire list upper case
|
||||
* @webBrief Make the entire list upper case
|
||||
*/
|
||||
public void upper() {
|
||||
for (int i = 0; i < count; i++) {
|
||||
@@ -680,7 +685,7 @@ public class StringList implements Iterable<String> {
|
||||
*
|
||||
* @return an array sized by the length of the list with each of the values.
|
||||
* @webref stringlist:method
|
||||
* @brief Create a new array with a copy of all the values
|
||||
* @webBrief Create a new array with a copy of all the values
|
||||
*/
|
||||
public String[] array() {
|
||||
return array(null);
|
||||
|
||||
@@ -56,6 +56,8 @@ import processing.core.PConstants;
|
||||
* <p>A rough "spec" for CSV can be found <a href="http://tools.ietf.org/html/rfc4180">here</a>.</p>
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief Generic class for handling tabular data, typically from a CSV, TSV, or
|
||||
* other sort of spreadsheet file.
|
||||
* @see PApplet#loadTable(String)
|
||||
* @see PApplet#saveTable(Table, String)
|
||||
* @see TableRow
|
||||
@@ -1789,8 +1791,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Adds a new column to a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Adds a new column to a table
|
||||
* @webBrief Adds a new column to a table
|
||||
* @see Table#removeColumn(String)
|
||||
*/
|
||||
public void addColumn() {
|
||||
@@ -1863,8 +1867,10 @@ public class Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a column from a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Removes a column from a table
|
||||
* @webBrief Removes a column from a table
|
||||
* @param columnName the title of the column to be removed
|
||||
* @see Table#addColumn()
|
||||
*/
|
||||
@@ -1908,8 +1914,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the number of columns in a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Gets the number of columns in a table
|
||||
* @webBrief Gets the number of columns in a table
|
||||
* @see Table#getRowCount()
|
||||
*/
|
||||
public int getColumnCount() {
|
||||
@@ -2256,8 +2264,10 @@ public class Table {
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
/**
|
||||
* Gets the number of rows in a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Gets the number of rows in a table
|
||||
* @webBrief Gets the number of rows in a table
|
||||
* @see Table#getColumnCount()
|
||||
*/
|
||||
public int getRowCount() {
|
||||
@@ -2271,8 +2281,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Removes all rows from a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Removes all rows from a table
|
||||
* @webBrief Removes all rows from a table
|
||||
* @see Table#addRow()
|
||||
* @see Table#removeRow(int)
|
||||
*/
|
||||
@@ -2314,8 +2326,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Adds a row to a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Adds a row to a table
|
||||
* @webBrief Adds a row to a table
|
||||
* @see Table#removeRow(int)
|
||||
* @see Table#clearRows()
|
||||
*/
|
||||
@@ -2437,9 +2451,11 @@ public class Table {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Removes a row from a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Removes a row from a table
|
||||
* @webBrief Removes a row from a table
|
||||
* @param row ID number of the row to remove
|
||||
* @see Table#addRow()
|
||||
* @see Table#clearRows()
|
||||
@@ -2644,8 +2660,10 @@ public class Table {
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
/**
|
||||
* Gets a row from a table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Gets a row from a table
|
||||
* @webBrief Gets a row from a table
|
||||
* @param row ID number of the row to get
|
||||
* @see Table#rows()
|
||||
* @see Table#findRow(String, int)
|
||||
@@ -2664,7 +2682,7 @@ public class Table {
|
||||
* If you want to iterate in a multi-threaded manner, don't use the iterator.
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Gets multiple rows from a table
|
||||
* @webBrief Gets multiple rows from a table
|
||||
* @see Table#getRow(int)
|
||||
* @see Table#findRow(String, int)
|
||||
* @see Table#findRows(String, int)
|
||||
@@ -3051,8 +3069,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Get an integer value from the specified row and column
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Get an integer value from the specified row and column
|
||||
* @webBrief Get an integer value from the specified row and column
|
||||
* @param row ID number of the row to reference
|
||||
* @param column ID number of the column to reference
|
||||
* @see Table#getFloat(int, int)
|
||||
@@ -3088,8 +3108,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Store an integer value in the specified row and column
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Store an integer value in the specified row and column
|
||||
* @webBrief Store an integer value in the specified row and column
|
||||
* @param row ID number of the target row
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
@@ -3232,7 +3254,7 @@ public class Table {
|
||||
* this is Float.NaN, but can be controlled with setMissingFloat().
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Get a float value from the specified row and column
|
||||
* @webBrief Get a float value from the specified row and column
|
||||
* @param row ID number of the row to reference
|
||||
* @param column ID number of the column to reference
|
||||
* @see Table#getInt(int, int)
|
||||
@@ -3269,8 +3291,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Store a float value in the specified row and column
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Store a float value in the specified row and column
|
||||
* @webBrief Store a float value in the specified row and column
|
||||
* @param row ID number of the target row
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
@@ -3465,7 +3489,7 @@ public class Table {
|
||||
* Get a String value from the table. If the row is longer than the table
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Get an String value from the specified row and column
|
||||
* @webBrief Get an String value from the specified row and column
|
||||
* @param row ID number of the row to reference
|
||||
* @param column ID number of the column to reference
|
||||
* @see Table#getInt(int, int)
|
||||
@@ -3516,8 +3540,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Store a float value in the specified row and column
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Store a String value in the specified row and column
|
||||
* @webBrief Store a String value in the specified row and column
|
||||
* @param row ID number of the target row
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
@@ -3546,8 +3572,10 @@ public class Table {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all values in the specified column
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Gets all values in the specified column
|
||||
* @webBrief Gets all values in the specified column
|
||||
* @param columnName title of the column to search
|
||||
* @see Table#getInt(int, int)
|
||||
* @see Table#getFloat(int, int)
|
||||
@@ -3688,8 +3716,10 @@ public class Table {
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
/**
|
||||
* Finds a row that contains the given value
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Finds a row that contains the given value
|
||||
* @webBrief Finds a row that contains the given value
|
||||
* @param value the value to match
|
||||
* @param column ID number of the column to search
|
||||
* @see Table#getRow(int)
|
||||
@@ -3713,8 +3743,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Finds multiple rows that contain the given value
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Finds multiple rows that contain the given value
|
||||
* @webBrief Finds multiple rows that contain the given value
|
||||
* @param value the value to match
|
||||
* @param column ID number of the column to search
|
||||
* @see Table#getRow(int)
|
||||
@@ -3741,7 +3773,7 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* @brief Finds multiple rows that contain the given value
|
||||
* @webBrief Finds multiple rows that contain the given value
|
||||
* @param value the value to match
|
||||
* @param column ID number of the column to search
|
||||
*/
|
||||
@@ -3845,8 +3877,10 @@ public class Table {
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
/**
|
||||
* Finds a row that matches the given expression
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Finds a row that matches the given expression
|
||||
* @webBrief Finds a row that matches the given expression
|
||||
* @param regexp the regular expression to match
|
||||
* @param column ID number of the column to search
|
||||
* @see Table#getRow(int)
|
||||
@@ -3870,8 +3904,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Finds multiple rows that match the given expression
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Finds multiple rows that match the given expression
|
||||
* @webBrief Finds multiple rows that match the given expression
|
||||
* @param regexp the regular expression to match
|
||||
* @param column ID number of the column to search
|
||||
* @see Table#getRow(int)
|
||||
@@ -3898,8 +3934,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Finds multiple rows that match the given expression
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Finds multiple rows that match the given expression
|
||||
* @webBrief Finds multiple rows that match the given expression
|
||||
* @param value the regular expression to match
|
||||
* @param column ID number of the column to search
|
||||
*/
|
||||
@@ -4002,7 +4040,7 @@ public class Table {
|
||||
* Remove any of the specified characters from the entire table.
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Removes characters from the table
|
||||
* @webBrief Removes characters from the table
|
||||
* @param tokens a list of individual characters to be removed
|
||||
* @see Table#trim()
|
||||
*/
|
||||
@@ -4055,8 +4093,10 @@ public class Table {
|
||||
|
||||
|
||||
/**
|
||||
* Trims whitespace from values
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Trims whitespace from values
|
||||
* @webBrief Trims whitespace from values
|
||||
* @see Table#removeTokens(String)
|
||||
*/
|
||||
public void trim() {
|
||||
@@ -4299,7 +4339,7 @@ public class Table {
|
||||
* Sorts (orders) a table based on the values in a column.
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Orders a table based on the values in a column
|
||||
* @webBrief Orders a table based on the values in a column
|
||||
* @param columnName the name of the column to sort
|
||||
* @see Table#trim()
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,14 @@ package processing.data;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
* A <b>TableRow</b> object represents a single row of data values,
|
||||
* stored in columns, from a table.<br />
|
||||
* <br />
|
||||
* Additional <b>TableRow</b> methods are documented in the
|
||||
* <a href="http://processing.github.io/processing-javadocs/core/">Processing Data Javadoc</a>.
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief represents a single row of data values, stored in columns, from a table.
|
||||
* @see Table
|
||||
* @see Table#addRow()
|
||||
* @see Table#removeRow(int)
|
||||
@@ -14,8 +21,10 @@ import java.io.PrintWriter;
|
||||
public interface TableRow {
|
||||
|
||||
/**
|
||||
* Get an String value from the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Get an String value from the specified column
|
||||
* @webBrief Get an String value from the specified column
|
||||
* @param column ID number of the column to reference
|
||||
* @see TableRow#getInt(int)
|
||||
* @see TableRow#getFloat(int)
|
||||
@@ -28,8 +37,10 @@ public interface TableRow {
|
||||
public String getString(String columnName);
|
||||
|
||||
/**
|
||||
* Get an integer value from the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Get an integer value from the specified column
|
||||
* @webBrief Get an integer value from the specified column
|
||||
* @param column ID number of the column to reference
|
||||
* @see TableRow#getFloat(int)
|
||||
* @see TableRow#getString(int)
|
||||
@@ -42,7 +53,7 @@ public interface TableRow {
|
||||
public int getInt(String columnName);
|
||||
|
||||
/**
|
||||
* @brief Get a long value from the specified column
|
||||
* @webBrief Get a long value from the specified column
|
||||
* @param column ID number of the column to reference
|
||||
* @see TableRow#getFloat(int)
|
||||
* @see TableRow#getString(int)
|
||||
@@ -56,8 +67,10 @@ public interface TableRow {
|
||||
public long getLong(String columnName);
|
||||
|
||||
/**
|
||||
* Get a float value from the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Get a float value from the specified column
|
||||
* @webBrief Get a float value from the specified column
|
||||
* @param column ID number of the column to reference
|
||||
* @see TableRow#getInt(int)
|
||||
* @see TableRow#getString(int)
|
||||
@@ -70,7 +83,7 @@ public interface TableRow {
|
||||
public float getFloat(String columnName);
|
||||
|
||||
/**
|
||||
* @brief Get a double value from the specified column
|
||||
* @webBrief Get a double value from the specified column
|
||||
* @param column ID number of the column to reference
|
||||
* @see TableRow#getInt(int)
|
||||
* @see TableRow#getString(int)
|
||||
@@ -83,8 +96,10 @@ public interface TableRow {
|
||||
public double getDouble(String columnName);
|
||||
|
||||
/**
|
||||
* Store a String value in the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Store a String value in the specified column
|
||||
* @webBrief Store a String value in the specified column
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
* @see TableRow#setInt(int, int)
|
||||
@@ -97,8 +112,10 @@ public interface TableRow {
|
||||
public void setString(String columnName, String value);
|
||||
|
||||
/**
|
||||
* Store an integer value in the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Store an integer value in the specified column
|
||||
* @webBrief Store an integer value in the specified column
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
* @see TableRow#setFloat(int, float)
|
||||
@@ -112,7 +129,7 @@ public interface TableRow {
|
||||
public void setInt(String columnName, int value);
|
||||
|
||||
/**
|
||||
* @brief Store a long value in the specified column
|
||||
* @webBrief Store a long value in the specified column
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
* @see TableRow#setFloat(int, float)
|
||||
@@ -126,8 +143,10 @@ public interface TableRow {
|
||||
public void setLong(String columnName, long value);
|
||||
|
||||
/**
|
||||
* Store a float value in the specified column
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Store a float value in the specified column
|
||||
* @webBrief Store a float value in the specified column
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
* @see TableRow#setInt(int, int)
|
||||
@@ -141,7 +160,7 @@ public interface TableRow {
|
||||
public void setFloat(String columnName, float value);
|
||||
|
||||
/**
|
||||
* @brief Store a double value in the specified column
|
||||
* @webBrief Store a double value in the specified column
|
||||
* @param column ID number of the target column
|
||||
* @param value value to assign
|
||||
* @see TableRow#setFloat(int, float)
|
||||
@@ -155,14 +174,16 @@ public interface TableRow {
|
||||
public void setDouble(String columnName, double value);
|
||||
|
||||
/**
|
||||
* Get the column count.
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Get the column count.
|
||||
* @webBrief Get the column count.
|
||||
* @return count of all columns
|
||||
*/
|
||||
public int getColumnCount();
|
||||
|
||||
/**
|
||||
* @brief Get the column type.
|
||||
* @webBrief Get the column type.
|
||||
* @param columnName title of the target column
|
||||
* @return type of the column
|
||||
*/
|
||||
@@ -174,21 +195,23 @@ public interface TableRow {
|
||||
public int getColumnType(int column);
|
||||
|
||||
/**
|
||||
* @brief Get the all column types
|
||||
* @webBrief Get the all column types
|
||||
* @return list of all column types
|
||||
*/
|
||||
public int[] getColumnTypes();
|
||||
|
||||
/**
|
||||
* Get the column title.
|
||||
*
|
||||
* @webref tablerow:method
|
||||
* @brief Get the column title.
|
||||
* @webBrief Get the column title.
|
||||
* @param column ID number of the target column
|
||||
* @return title of the column
|
||||
*/
|
||||
public String getColumnTitle(int column);
|
||||
|
||||
/**
|
||||
* @brief Get the all column titles
|
||||
* @webBrief Get the all column titles
|
||||
* @return list of all column titles
|
||||
*/
|
||||
public String[] getColumnTitles();
|
||||
|
||||
@@ -45,6 +45,8 @@ import processing.core.PApplet;
|
||||
* representing a single node of an XML tree.
|
||||
*
|
||||
* @webref data:composite
|
||||
* @webBrief This is the base class used for the Processing XML library,
|
||||
* representing a single node of an XML tree.
|
||||
* @see PApplet#loadXML(String)
|
||||
* @see PApplet#parseXML(String)
|
||||
* @see PApplet#saveXML(XML, String)
|
||||
@@ -247,8 +249,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Converts String content to an XML object
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Converts String content to an XML object
|
||||
* @webBrief Converts String content to an XML object
|
||||
* @param data the content to be parsed as XML
|
||||
* @return an XML object, or null
|
||||
* @throws SAXException
|
||||
@@ -301,7 +305,7 @@ public class XML implements Serializable {
|
||||
* element.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets a copy of the element's parent
|
||||
* @webBrief Gets a copy of the element's parent
|
||||
*/
|
||||
public XML getParent() {
|
||||
return this.parent;
|
||||
@@ -320,7 +324,7 @@ public class XML implements Serializable {
|
||||
* prefix) of the element.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the element's full name
|
||||
* @webBrief Gets the element's full name
|
||||
* @return the name, or null if the element only contains #PCDATA.
|
||||
*/
|
||||
public String getName() {
|
||||
@@ -329,8 +333,10 @@ public class XML implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the element's name
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the element's name
|
||||
* @webBrief Sets the element's name
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
Document document = node.getOwnerDocument();
|
||||
@@ -370,7 +376,7 @@ public class XML implements Serializable {
|
||||
* Returns the number of children.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Returns the element's number of children
|
||||
* @webBrief Returns the element's number of children
|
||||
* @return the count.
|
||||
*/
|
||||
public int getChildCount() {
|
||||
@@ -383,7 +389,7 @@ public class XML implements Serializable {
|
||||
* Returns a boolean of whether or not there are children.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Checks whether or not an element has any children
|
||||
* @webBrief Checks whether or not an element has any children
|
||||
*/
|
||||
public boolean hasChildren() {
|
||||
checkChildren();
|
||||
@@ -396,7 +402,7 @@ public class XML implements Serializable {
|
||||
* each child and calling getName() on each XMLElement.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Returns the names of all children as an array
|
||||
* @webBrief Returns the names of all children as an array
|
||||
*/
|
||||
public String[] listChildren() {
|
||||
// NodeList children = node.getChildNodes();
|
||||
@@ -421,7 +427,7 @@ public class XML implements Serializable {
|
||||
* Returns an array containing all the child elements.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Returns an array containing all child elements
|
||||
* @webBrief Returns an array containing all child elements
|
||||
*/
|
||||
public XML[] getChildren() {
|
||||
// NodeList children = node.getChildNodes();
|
||||
@@ -441,7 +447,7 @@ public class XML implements Serializable {
|
||||
* Quick accessor for an element at a particular index.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Returns the child element with the specified index value or path
|
||||
* @webBrief Returns the child element with the specified index value or path
|
||||
*/
|
||||
public XML getChild(int index) {
|
||||
checkChildren();
|
||||
@@ -557,8 +563,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Appends a new child to the element
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Appends a new child to the element
|
||||
* @webBrief Appends a new child to the element
|
||||
*/
|
||||
public XML addChild(String tag) {
|
||||
Document document = node.getOwnerDocument();
|
||||
@@ -586,8 +594,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Removes the specified child
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Removes the specified child
|
||||
* @webBrief Removes the specified child
|
||||
*/
|
||||
public void removeChild(XML kid) {
|
||||
node.removeChild(kid.node);
|
||||
@@ -600,7 +610,7 @@ public class XML implements Serializable {
|
||||
* If you call this and use saveXML() your original spacing will be gone.
|
||||
*
|
||||
* @nowebref
|
||||
* @brief Removes whitespace nodes
|
||||
* @webBrief Removes whitespace nodes
|
||||
*/
|
||||
public void trim() {
|
||||
try {
|
||||
@@ -674,7 +684,7 @@ public class XML implements Serializable {
|
||||
* Returns the number of attributes.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Counts the specified element's number of attributes
|
||||
* @webBrief Counts the specified element's number of attributes
|
||||
*/
|
||||
public int getAttributeCount() {
|
||||
return node.getAttributes().getLength();
|
||||
@@ -685,7 +695,7 @@ public class XML implements Serializable {
|
||||
* Get a list of the names for all of the attributes for this node.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Returns a list of names of all attributes as an array
|
||||
* @webBrief Returns a list of names of all attributes as an array
|
||||
*/
|
||||
public String[] listAttributes() {
|
||||
NamedNodeMap nnm = node.getAttributes();
|
||||
@@ -700,7 +710,7 @@ public class XML implements Serializable {
|
||||
* Returns whether an attribute exists.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Checks whether or not an element has the specified attribute
|
||||
* @webBrief Checks whether or not an element has the specified attribute
|
||||
*/
|
||||
public boolean hasAttribute(String name) {
|
||||
return (node.getAttributes().getNamedItem(name) != null);
|
||||
@@ -732,8 +742,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the content of an attribute as a String
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an attribute as a String
|
||||
* @webBrief Gets the content of an attribute as a String
|
||||
*/
|
||||
public String getString(String name) {
|
||||
return getString(name, null);
|
||||
@@ -753,8 +765,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the content of an attribute as a String
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the content of an attribute as a String
|
||||
* @webBrief Sets the content of an attribute as a String
|
||||
*/
|
||||
public void setString(String name, String value) {
|
||||
((Element) node).setAttribute(name, value);
|
||||
@@ -762,8 +776,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the content of an attribute as an int
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an attribute as an int
|
||||
* @webBrief Gets the content of an attribute as an int
|
||||
*/
|
||||
public int getInt(String name) {
|
||||
return getInt(name, 0);
|
||||
@@ -771,8 +787,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the content of an attribute as an int
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the content of an attribute as an int
|
||||
* @webBrief Sets the content of an attribute as an int
|
||||
*/
|
||||
public void setInt(String name, int value) {
|
||||
setString(name, String.valueOf(value));
|
||||
@@ -793,8 +811,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the content of an element as an int
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the content of an element as an int
|
||||
* @webBrief Sets the content of an element as an int
|
||||
*/
|
||||
public void setLong(String name, long value) {
|
||||
setString(name, String.valueOf(value));
|
||||
@@ -818,7 +838,7 @@ public class XML implements Serializable {
|
||||
* Returns the value of an attribute, or zero if not present.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an attribute as a float
|
||||
* @webBrief Gets the content of an attribute as a float
|
||||
*/
|
||||
public float getFloat(String name) {
|
||||
return getFloat(name, 0);
|
||||
@@ -839,8 +859,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the content of an attribute as a float
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the content of an attribute as a float
|
||||
* @webBrief Sets the content of an attribute as a float
|
||||
*/
|
||||
public void setFloat(String name, float value) {
|
||||
setString(name, String.valueOf(value));
|
||||
@@ -877,7 +899,7 @@ public class XML implements Serializable {
|
||||
* this method returns null.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an element
|
||||
* @webBrief Gets the content of an element
|
||||
* @return the content.
|
||||
* @see XML#getIntContent()
|
||||
* @see XML#getFloatContent()
|
||||
@@ -894,8 +916,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the content of an element as an int
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an element as an int
|
||||
* @webBrief Gets the content of an element as an int
|
||||
* @return the content.
|
||||
* @see XML#getContent()
|
||||
* @see XML#getFloatContent()
|
||||
@@ -914,8 +938,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the content of an element as a float
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets the content of an element as a float
|
||||
* @webBrief Gets the content of an element as a float
|
||||
* @return the content.
|
||||
* @see XML#getContent()
|
||||
* @see XML#getIntContent()
|
||||
@@ -966,8 +992,10 @@ public class XML implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the content of an element
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Sets the content of an element
|
||||
* @webBrief Sets the content of an element
|
||||
*/
|
||||
public void setContent(String text) {
|
||||
node.setTextContent(text);
|
||||
@@ -998,7 +1026,7 @@ public class XML implements Serializable {
|
||||
* Format this XML data as a String.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Formats XML data as a String
|
||||
* @webBrief Formats XML data as a String
|
||||
* @param indent -1 for a single line (and no declaration), >= 0 for indents and newlines
|
||||
* @return the content
|
||||
* @see XML#toString()
|
||||
@@ -1144,7 +1172,7 @@ public class XML implements Serializable {
|
||||
* Same as format(2). Use the format() function for more options.
|
||||
*
|
||||
* @webref xml:method
|
||||
* @brief Gets XML data as a String using default formatting
|
||||
* @webBrief Gets XML data as a String using default formatting
|
||||
* @return the content
|
||||
* @see XML#format(int)
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,8 @@ import java.util.HashMap;
|
||||
* http://processing.org/discourse/beta/num_1159494801.html
|
||||
*
|
||||
* @webref rendering:shaders
|
||||
* @webBrief This class encapsulates a GLSL shader program, including a vertex
|
||||
* and a fragment shader.
|
||||
*/
|
||||
public class PShader implements PConstants {
|
||||
static protected final int POINT = 0;
|
||||
@@ -382,8 +384,10 @@ public class PShader implements PConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a variable within the shader
|
||||
*
|
||||
* @webref rendering:shaders
|
||||
* @brief Sets a variable within the shader
|
||||
* @webBrief Sets a variable within the shader
|
||||
* @param name the name of the uniform variable to modify
|
||||
* @param x first component of the variable to modify
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user