Fixed JavaDoc errors to enable Java 8 build.

This commit is contained in:
Harald Kuhr
2019-08-10 00:41:36 +02:00
parent 7d2c692663
commit 9e23413456
168 changed files with 34586 additions and 34396 deletions

View File

@@ -37,7 +37,6 @@ import java.util.List;
/**
* AbstractImageSource
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/AbstractImageSource.java#1 $

View File

@@ -35,14 +35,15 @@ import java.awt.image.RGBImageFilter;
/**
* Adjusts the contrast and brightness of an image.
* <p/>
* <p>
* For brightness, the valid range is {@code -2.0,..,0.0,..,2.0}.
* A value of {@code 0.0} means no change.
* Negative values will make the pixels darker.
* Maximum negative value ({@code -2}) will make all filtered pixels black.
* Positive values will make the pixels brighter.
* Maximum positive value ({@code 2}) will make all filtered pixels white.
* <p/>
* </p>
* <p>
* For contrast, the valid range is {@code -1.0,..,0.0,..,1.0}.
* A value of {@code 0.0} means no change.
* Negative values will reduce contrast.
@@ -51,15 +52,14 @@ import java.awt.image.RGBImageFilter;
* Positive values will increase contrast.
* Maximum positive value ({@code 1}) will make all filtered pixels primary
* colors (either black, white, cyan, magenta, yellow, red, blue or green).
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
*
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/BrightnessContrastFilter.java#1 $
*
* @todo consider doing something similar to http://archives.java.sun.com/cgi-bin/wa?A2=ind0302&L=jai-interest&F=&S=&P=15947
*/
// TODO: consider doing something similar to http://archives.java.sun.com/cgi-bin/wa?A2=ind0302&L=jai-interest&F=&S=&P=15947
public class BrightnessContrastFilter extends RGBImageFilter {
// TODO: Replace with RescaleOp?
@@ -76,8 +76,9 @@ public class BrightnessContrastFilter extends RGBImageFilter {
/**
* Creates a BrightnessContrastFilter with default values
* ({@code brightness=0.3, contrast=0.3}).
* <p/>
* <p>
* This will slightly increase both brightness and contrast.
* </p>
*/
public BrightnessContrastFilter() {
this(0.3f, 0.3f);
@@ -86,14 +87,15 @@ public class BrightnessContrastFilter extends RGBImageFilter {
/**
* Creates a BrightnessContrastFilter with the given values for brightness
* and contrast.
* <p/>
* <p>
* For brightness, the valid range is {@code -2.0,..,0.0,..,2.0}.
* A value of {@code 0.0} means no change.
* Negative values will make the pixels darker.
* Maximum negative value ({@code -2}) will make all filtered pixels black.
* Positive values will make the pixels brighter.
* Maximum positive value ({@code 2}) will make all filtered pixels white.
* <p/>
* </p>
* <p>
* For contrast, the valid range is {@code -1.0,..,0.0,..,1.0}.
* A value of {@code 0.0} means no change.
* Negative values will reduce contrast.
@@ -102,6 +104,7 @@ public class BrightnessContrastFilter extends RGBImageFilter {
* Positive values will increase contrast.
* Maximum positive value ({@code 1}) will make all filtered pixels primary
* colors (either black, white, cyan, magenta, yellow, red, blue or green).
* </p>
*
* @param pBrightness adjust the brightness of the image, in the range
* {@code -2.0,..,0.0,..,2.0}.

View File

@@ -44,14 +44,16 @@ import java.util.concurrent.CopyOnWriteArrayList;
* A faster, lighter and easier way to convert an {@code Image} to a
* {@code BufferedImage} than using a {@code PixelGrabber}.
* Clients may provide progress listeners to monitor conversion progress.
* <p/>
* <p>
* Supports source image subsampling and source region extraction.
* Supports source images with 16 bit {@link ColorModel} and
* {@link DataBuffer#TYPE_USHORT} transfer type, without converting to
* 32 bit/TYPE_INT.
* <p/>
* </p>
* <p>
* NOTE: Does not support images with more than one {@code ColorModel} or
* different types of pixel data. This is not very common.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java#1 $

View File

@@ -39,7 +39,6 @@ import java.awt.image.BufferedImage;
/**
* An {@code Icon} implementation backed by a {@code BufferedImage}.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/BufferedImageIcon.java#2 $

View File

@@ -39,22 +39,24 @@ import java.util.Random;
/**
* This {@code BufferedImageOp/RasterOp} implements basic
* Floyd-Steinberg error-diffusion algorithm for dithering.
* <P/>
* <p>
* The weights used are 7/16, 3/16, 5/16 and 1/16, distributed like this:
* <!-- - -
* | |x|7|
* - - - -
* |3|5|1|
* - - -->
* <P/>
* <TABLE border="1" cellpadding="4" cellspacing="0">
* <TR><TD bgcolor="#000000">&nbsp;</TD><TD class="TableHeadingColor"
* align="center">X</TD><TD>7/16</TD></TR>
* <TR><TD>3/16</TD><TD>5/16</TD><TD>1/16</TD></TR>
* </TABLE>
* <P/>
* </p>
* <table border="1" cellpadding="4" cellspacing="0">
* <caption>Floyd-Steinberg error-diffusion weights</caption>
* <tr><td bgcolor="#000000">&nbsp;</td><td class="TableHeadingColor"
* align="center">x</td><td>7/16</td></tr>
* <tr><td>3/16</td><td>5/16</td><td>1/16</td></tr>
* </table>
* <p>
* See <A href="http://www.awprofessional.com/bookstore/product.asp?isbn=0201848406&rl=1">Computer Graphics (Foley et al.)</a>
* for more information.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -43,10 +43,11 @@ public final class GraphicsUtil {
/**
* Enables anti-aliasing in the {@code Graphics} object.
* <p/>
* <p>
* Anti-aliasing is enabled by casting to {@code Graphics2D} and setting
* the rendering hint {@code RenderingHints.KEY_ANTIALIASING} to
* {@code RenderingHints.VALUE_ANTIALIAS_ON}.
* </p>
*
* @param pGraphics the graphics object
* @throws ClassCastException if {@code pGraphics} is not an instance of
@@ -62,10 +63,11 @@ public final class GraphicsUtil {
/**
* Sets the alpha in the {@code Graphics} object.
* <p/>
* <p>
* Alpha is set by casting to {@code Graphics2D} and setting the composite
* to the rule {@code AlphaComposite.SRC_OVER} multiplied by the given
* alpha.
* </p>
*
* @param pGraphics the graphics object
* @param pAlpha the alpha level, {@code alpha} must be a floating point

View File

@@ -34,8 +34,9 @@ import java.awt.image.RGBImageFilter;
/**
* This class can convert a color image to grayscale.
* <P/>
* <p>
* Uses ITU standard conversion: (222 * Red + 707 * Green + 71 * Blue) / 1000.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
@@ -64,7 +65,7 @@ public class GrayFilter extends RGBImageFilter {
* pLow and pHigh.
*
* @param pLow float in the range 0..1
* @param pHigh float in the range 0..1 and >= pLow
* @param pHigh float in the range 0..1 and &gt;= pLow
*/
public GrayFilter(float pLow, float pHigh) {
if (pLow > pHigh) {
@@ -94,7 +95,7 @@ public class GrayFilter extends RGBImageFilter {
* range between pLow and pHigh.
*
* @param pLow integer in the range 0..255
* @param pHigh inteeger in the range 0..255 and >= pLow
* @param pHigh integer in the range 0..255 and &gt;= pLow
*/
public GrayFilter(int pLow, int pHigh) {
this(pLow / 255f, pHigh / 255f);

View File

@@ -162,11 +162,12 @@ public final class ImageUtil {
/**
* The sharpen kernel. Uses the following 3 by 3 matrix:
* <TABLE border="1" cellspacing="0">
* <TR><TD>0.0</TD><TD>-0.3</TD><TD>0.0</TD></TR>
* <TR><TD>-0.3</TD><TD>2.2</TD><TD>-0.3</TD></TR>
* <TR><TD>0.0</TD><TD>-0.3</TD><TD>0.0</TD></TR>
* </TABLE>
* <table border="1" cellspacing="0">
* <caption>Sharpen Kernel Matrix</caption>
* <tr><td>0.0</td><td>-0.3</td><td>0.0</td></tr>
* <tr><td>-0.3</td><td>2.2</td><td>-0.3</td></tr>
* <tr><td>0.0</td><td>-0.3</td><td>0.0</td></tr>
* </table>
*/
private static final Kernel SHARPEN_KERNEL = new Kernel(3, 3, SHARPEN_MATRIX);
@@ -208,9 +209,10 @@ public final class ImageUtil {
* Converts the {@code RenderedImage} to a {@code BufferedImage}.
* The new image will have the <em>same</em> {@code ColorModel},
* {@code Raster} and properties as the original image, if possible.
* <p/>
* <p>
* If the image is already a {@code BufferedImage}, it is simply returned
* and no conversion takes place.
* </p>
*
* @param pOriginal the image to convert.
*
@@ -262,9 +264,10 @@ public final class ImageUtil {
/**
* Converts the {@code RenderedImage} to a {@code BufferedImage} of the
* given type.
* <p/>
* <p>
* If the image is already a {@code BufferedImage} of the given type, it
* is simply returned and no conversion takes place.
* </p>
*
* @param pOriginal the image to convert.
* @param pType the type of buffered image
@@ -308,12 +311,14 @@ public final class ImageUtil {
* Converts the {@code BufferedImage} to a {@code BufferedImage} of the
* given type. The new image will have the same {@code ColorModel},
* {@code Raster} and properties as the original image, if possible.
* <p/>
* <p>
* If the image is already a {@code BufferedImage} of the given type, it
* is simply returned and no conversion takes place.
* <p/>
* </p>
* <p>
* This method simply invokes
* {@link #toBuffered(RenderedImage,int) toBuffered((RenderedImage) pOriginal, pType)}.
* </p>
*
* @param pOriginal the image to convert.
* @param pType the type of buffered image
@@ -333,9 +338,10 @@ public final class ImageUtil {
* Converts the {@code Image} to a {@code BufferedImage}.
* The new image will have the same {@code ColorModel}, {@code Raster} and
* properties as the original image, if possible.
* <p/>
* <p>
* If the image is already a {@code BufferedImage}, it is simply returned
* and no conversion takes place.
* </p>
*
* @param pOriginal the image to convert.
*
@@ -389,19 +395,22 @@ public final class ImageUtil {
/**
* Creates a {@code WritableRaster} for the given {@code ColorModel} and
* pixel data.
* <p/>
* <p>
* This method is optimized for the most common cases of {@code ColorModel}
* and pixel data combinations. The raster's backing {@code DataBuffer} is
* created directly from the pixel data, as this is faster and more
* resource-friendly than using
* {@code ColorModel.createCompatibleWritableRaster(w, h)}.
* <p/>
* </p>
* <p>
* For uncommon combinations, the method will fallback to using
* {@code ColorModel.createCompatibleWritableRaster(w, h)} and
* {@code WritableRaster.setDataElements(w, h, pixels)}
* <p/>
* </p>
* <p>
* Note that the {@code ColorModel} and pixel data are <em>not</em> cloned
* (in most cases).
* </p>
*
* @param pWidth the requested raster width
* @param pHeight the requested raster height
@@ -543,9 +552,10 @@ public final class ImageUtil {
* Converts the {@code Image} to a {@code BufferedImage} of the given type.
* The new image will have the same {@code ColorModel}, {@code Raster} and
* properties as the original image, if possible.
* <p/>
* <p>
* If the image is already a {@code BufferedImage} of the given type, it
* is simply returned and no conversion takes place.
* </p>
*
* @param pOriginal the image to convert.
* @param pType the type of buffered image
@@ -656,9 +666,10 @@ public final class ImageUtil {
* Rotates the image 90 degrees, clockwise (aka "rotate right"),
* counter-clockwise (aka "rotate left") or 180 degrees, depending on the
* {@code pDirection} argument.
* <p/>
* <p>
* The new image will be completely covered with pixels from the source
* image.
* </p>
*
* @param pImage the source image.
* @param pDirection the direction, must be either {@link #ROTATE_90_CW},
@@ -1067,14 +1078,16 @@ public final class ImageUtil {
/**
* Sharpens an image using a convolution matrix.
* The sharpen kernel used, is defined by the following 3 by 3 matrix:
* <TABLE border="1" cellspacing="0">
* <TR><TD>0.0</TD><TD>-0.3</TD><TD>0.0</TD></TR>
* <TR><TD>-0.3</TD><TD>2.2</TD><TD>-0.3</TD></TR>
* <TR><TD>0.0</TD><TD>-0.3</TD><TD>0.0</TD></TR>
* </TABLE>
* <P/>
* <table border="1" cellspacing="0">
* <caption>Sharpen Kernel Matrix</caption>
* <tr><td>0.0</td><td>-0.3</td><td>0.0</td></tr>
* <tr><td>-0.3</td><td>2.2</td><td>-0.3</td></tr>
* <tr><td>0.0</td><td>-0.3</td><td>0.0</td></tr>
* </table>
* <p>
* This is the same result returned as
* {@code sharpen(pOriginal, 0.3f)}.
* </p>
*
* @param pOriginal the BufferedImage to sharpen
*
@@ -1087,13 +1100,14 @@ public final class ImageUtil {
/**
* Sharpens an image using a convolution matrix.
* The sharpen kernel used, is defined by the following 3 by 3 matrix:
* <TABLE border="1" cellspacing="0">
* <TR><TD>0.0</TD><TD>-{@code pAmount}</TD><TD>0.0</TD></TR>
* <TR><TD>-{@code pAmount}</TD>
* <TD>4.0 * {@code pAmount} + 1.0</TD>
* <TD>-{@code pAmount}</TD></TR>
* <TR><TD>0.0</TD><TD>-{@code pAmount}</TD><TD>0.0</TD></TR>
* </TABLE>
* <table border="1" cellspacing="0">
* <caption>Sharpen Kernel Matrix</caption>
* <tr><td>0.0</td><td>-{@code pAmount}</td><td>0.0</td></tr>
* <tr><td>-{@code pAmount}</td>
* <td>4.0 * {@code pAmount} + 1.0</td>
* <td>-{@code pAmount}</td></tr>
* <tr><td>0.0</td><td>-{@code pAmount}</td><td>0.0</td></tr>
* </table>
*
* @param pOriginal the BufferedImage to sharpen
* @param pAmount the amount of sharpening

View File

@@ -101,32 +101,35 @@ import java.util.List;
* This class implements an adaptive palette generator to reduce images
* to a variable number of colors.
* It can also render images into fixed color pallettes.
* <p/>
* <p>
* Support for the default JVM (ordered/pattern) dither, Floyd-Steinberg like
* error-diffusion and no dither, controlled by the hints
* {@link #DITHER_DIFFUSION},
* {@link #DITHER_NONE} and
* {@link #DITHER_DEFAULT}.
* <p/>
* </p>
* <p>
* Color selection speed/accuracy can be controlled using the hints
* {@link #COLOR_SELECTION_FAST},
* {@link #COLOR_SELECTION_QUALITY} and
* {@link #COLOR_SELECTION_DEFAULT}.
* <p/>
* </p>
* <p>
* Transparency support can be controlled using the hints
* {@link #TRANSPARENCY_OPAQUE},
* {@link #TRANSPARENCY_BITMASK} and
* {@link #TRANSPARENCY_TRANSLUCENT}.
* <p/>
* <HR/>
* <p/>
* <PRE>
* </p>
* <hr>
* <p>
* <pre>
* This product includes software developed by the Apache Software Foundation.
* <p/>
*
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation. For more information on the
* Apache Software Foundation, please see <A href="http://www.apache.org/">http://www.apache.org/</A>
* </PRE>
* </pre>
* </p>
*
* @author <A href="mailto:deweese@apache.org">Thomas DeWeese</A>
* @author <A href="mailto:jun@oop-reserch.com">Jun Inamori</A>
@@ -825,8 +828,9 @@ class IndexImage {
* {@code TYPE_INT_ARGB}) to an indexed image. Generating an adaptive
* palette (8 bit) from the color data in the image, and uses default
* dither.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index and get color information from.
* @return the indexed BufferedImage. The image will be of type
@@ -870,8 +874,9 @@ class IndexImage {
* adaptive palette (8 bit) from the given palette image.
* Dithering, transparency and color selection is controlled with the
* {@code pHints}parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pPalette the Image to read color information from
@@ -905,8 +910,9 @@ class IndexImage {
* palette with the given number of colors.
* Dithering, transparency and color selection is controlled with the
* {@code pHints} parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pNumberOfColors the number of colors for the image
@@ -952,8 +958,9 @@ class IndexImage {
* {@code IndexColorModel}'s palette.
* Dithering, transparency and color selection is controlled with the
* {@code pHints} parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pColors an {@code IndexColorModel} containing the color information
@@ -1069,8 +1076,9 @@ class IndexImage {
* palette with the given number of colors.
* Dithering, transparency and color selection is controlled with the
* {@code pHints}parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pNumberOfColors the number of colors for the image
@@ -1099,8 +1107,9 @@ class IndexImage {
* {@code IndexColorModel}'s palette.
* Dithering, transparency and color selection is controlled with the
* {@code pHints}parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pColors an {@code IndexColorModel} containing the color information
@@ -1130,8 +1139,9 @@ class IndexImage {
* adaptive palette (8 bit) from the given palette image.
* Dithering, transparency and color selection is controlled with the
* {@code pHints}parameter.
* <p/>
* <p>
* The image returned is a new image, the input image is not modified.
* </p>
*
* @param pImage the BufferedImage to index
* @param pPalette the Image to read color information from

View File

@@ -33,9 +33,10 @@ package com.twelvemonkeys.image;
/**
* Inverse Colormap to provide efficient lookup of any given input color
* to the closest match to the given color map.
* <p/>
* <p>
* Based on "Efficient Inverse Color Map Computation" by Spencer W. Thomas
* in "Graphics Gems Volume II"
* in "Graphics Gems Volume II".
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author Robin Luiten (Java port)

View File

@@ -41,11 +41,11 @@ import java.awt.image.BufferedImageOp;
* This class accelerates certain graphics operations, using
* JMagick and ImageMagick, if available.
* If those libraries are not installed, this class silently does nothing.
* <p/>
* <p>
* Set the system property {@code "com.twelvemonkeys.image.accel"} to
* {@code false}, to disable, even if JMagick is installed.
* Set the system property {@code "com.twelvemonkeys.image.magick.debug"} to
* <p/>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/MagickAccelerator.java#3 $

View File

@@ -44,10 +44,11 @@ import java.awt.image.*;
/**
* Utility for converting JMagick {@code MagickImage}s to standard Java
* {@code BufferedImage}s and back.
* <p/>
* <p>
* <em>NOTE: This class is considered an implementation detail and not part of
* the public API. This class is subject to change without further notice.
* You have been warned. :-)</em>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/MagickUtil.java#4 $
@@ -100,8 +101,9 @@ public final class MagickUtil {
/**
* Converts a {@code MagickImage} to a {@code BufferedImage}.
* <p/>
* <p>
* The conversion depends on {@code pImage}'s {@code ImageType}:
* </p>
* <dl>
* <dt>{@code ImageType.BilevelType}</dt>
* <dd>{@code BufferedImage} of type {@code TYPE_BYTE_BINARY}</dd>
@@ -113,15 +115,16 @@ public final class MagickUtil {
*
* <dt>{@code ImageType.PaletteType}</dt>
* <dd>{@code BufferedImage} of type {@code TYPE_BYTE_BINARY} (for images
* with a palette of <= 16 colors) or {@code TYPE_BYTE_INDEXED}</dd>
* with a palette of &lt;= 16 colors) or {@code TYPE_BYTE_INDEXED}</dd>
* <dt>{@code ImageType.PaletteMatteType}</dt>
* <dd>{@code BufferedImage} of type {@code TYPE_BYTE_BINARY} (for images
* with a palette of <= 16 colors) or {@code TYPE_BYTE_INDEXED}</dd>
* with a palette of &lt;= 16 colors) or {@code TYPE_BYTE_INDEXED}</dd>
*
* <dt>{@code ImageType.TrueColorType}</dt>
* <dd>{@code BufferedImage} of type {@code TYPE_3BYTE_BGR}</dd>
* <dt>{@code ImageType.TrueColorPaletteType}</dt>
* <dd>{@code BufferedImage} of type {@code TYPE_4BYTE_ABGR}</dd>
* </dl>
*
* @param pImage the original {@code MagickImage}
* @return a new {@code BufferedImage}
@@ -191,24 +194,26 @@ public final class MagickUtil {
/**
* Converts a {@code BufferedImage} to a {@code MagickImage}.
* <p/>
* <p>
* The conversion depends on {@code pImage}'s {@code ColorModel}:
* </p>
* <dl>
* <dt>{@code IndexColorModel} with 1 bit b/w</dt>
* <dd>{@code MagickImage} of type {@code ImageType.BilevelType}</dd>
* <dt>{@code IndexColorModel} &gt; 1 bit,</dt>
* <dd>{@code MagickImage} of type {@code ImageType.PaletteType}
* or {@code MagickImage} of type {@code ImageType.PaletteMatteType}
* depending on <tt>ColorModel.getAlpha()</dd>
* depending on <tt>ColorModel.getAlpha()</tt></dd>
*
* <dt>{@code ColorModel.getColorSpace().getType() == ColorSpace.TYPE_GRAY}</dt>
* <dd>{@code MagickImage} of type {@code ImageType.GrayscaleType}
* or {@code MagickImage} of type {@code ImageType.GrayscaleMatteType}
* depending on <tt>ColorModel.getAlpha()</dd>
* depending on <tt>ColorModel.getAlpha()</tt></dd>
*
* <dt>{@code ColorModel.getColorSpace().getType() == ColorSpace.TYPE_RGB}</dt>
* <dd>{@code MagickImage} of type {@code ImageType.TrueColorType}
* or {@code MagickImage} of type {@code ImageType.TrueColorPaletteType}</dd>
* </dl>
*
* @param pImage the original {@code BufferedImage}
* @return a new {@code MagickImage}
@@ -432,7 +437,7 @@ public final class MagickUtil {
/**
* Converts a palette-based {@code MagickImage} to a
* {@code BufferedImage}, of type {@code TYPE_BYTE_BINARY} (for images
* with a palette of <= 16 colors) or {@code TYPE_BYTE_INDEXED}.
* with a palette of &lt;= 16 colors) or {@code TYPE_BYTE_INDEXED}.
*
* @param pImage the original {@code MagickImage}
* @param pAlpha keep alpha channel

View File

@@ -67,39 +67,42 @@ import java.awt.image.*;
* constructor, either using the
* <a href="#field_summary">filter type constants</a>, or one of the
* {@code RendereingHints}.
* <p/>
* <p>
* For fastest results, use {@link #FILTER_POINT} or {@link #FILTER_BOX}.
* In most cases, {@link #FILTER_TRIANGLE} will produce acceptable results, while
* being relatively fast.
* For higher quality output, use more sophisticated interpolation algorithms,
* like {@link #FILTER_MITCHELL} or {@link #FILTER_LANCZOS}.
* <p/>
* </p>
* <p>
* Example:
* </p>
* <blockquote><pre>
* BufferedImage image;
* <p/>
*
* //...
* <p/>
*
* ResampleOp resampler = new ResampleOp(100, 100, ResampleOp.FILTER_TRIANGLE);
* BufferedImage thumbnail = resampler.filter(image, null);
* </pre></blockquote>
* <p/>
* If your imput image is very large, it's possible to first resample using the
* <p>
* If your input image is very large, it's possible to first resample using the
* very fast {@code FILTER_POINT} algorithm, then resample to the wanted size,
* using a higher quality algorithm:
* </p>
* <blockquote><pre>
* BufferedImage verylLarge;
* <p/>
*
* //...
* <p/>
*
* int w = 300;
* int h = 200;
* <p/>
*
* BufferedImage temp = new ResampleOp(w * 2, h * 2, FILTER_POINT).filter(verylLarge, null);
* <p/>
*
* BufferedImage scaled = new ResampleOp(w, h).filter(temp, null);
* </pre></blockquote>
* <p/>
* <p>
* For maximum performance, this class will use native code, through
* <a href="http://www.yeo.id.au/jmagick/">JMagick</a>, when available.
* Otherwise, the class will silently fall back to pure Java mode.
@@ -107,7 +110,8 @@ import java.awt.image.*;
* {@code com.twelvemonkeys.image.accel} to {@code false}.
* To allow debug of the native code, set the system property
* {@code com.twelvemonkeys.image.magick.debug} to {@code true}.
* <p/>
* </p>
* <p>
* This {@code BufferedImageOp} is based on C example code found in
* <a href="http://www.acm.org/tog/GraphicsGems/">Graphics Gems III</a>,
* Filtered Image Rescaling, by Dale Schumacher (with additional improvments by
@@ -116,10 +120,12 @@ import java.awt.image.*;
* <a href="http://www.imagemagick.org/">ImageMagick</a> and
* Marco Schmidt's <a href="http://schmidt.devlib.org/jiu/">Java Imaging Utilities</a>
* (which are also adaptions of the same original code from Graphics Gems III).
* <p/>
* </p>
* <p>
* For a description of the various interpolation algorithms, see
* <em>General Filtered Image Rescaling</em> in <em>Graphics Gems III</em>,
* Academic Press, 1994.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
@@ -361,13 +367,14 @@ public class ResampleOp implements BufferedImageOp/* TODO: RasterOp */ {
* Creates a {@code ResampleOp} that will resample input images to the
* given width and height, using the interpolation filter specified by
* the given hints.
* <p>
* If using {@code RenderingHints}, the hints are mapped as follows:
* </p>
* <ul>
* <li>{@code KEY_RESAMPLE_INTERPOLATION} takes precedence over any
* standard {@code java.awt} hints, and dictates interpolation
* directly, see
* <a href="#field_summary">{@code RenderingHints} constants</a>.</li>
* <p/>
* <li>{@code KEY_INTERPOLATION} takes precedence over other hints.
* <ul>
* <li>{@link RenderingHints#VALUE_INTERPOLATION_NEAREST_NEIGHBOR} specifies
@@ -378,7 +385,6 @@ public class ResampleOp implements BufferedImageOp/* TODO: RasterOp */ {
* {@code FILTER_QUADRATIC}</li>
* </ul>
* </li>
* <p/>
* <li>{@code KEY_RENDERING} or {@code KEY_COLOR_RENDERING}
* <ul>
* <li>{@link RenderingHints#VALUE_RENDER_SPEED} specifies
@@ -388,7 +394,9 @@ public class ResampleOp implements BufferedImageOp/* TODO: RasterOp */ {
* </ul>
* </li>
* </ul>
* <p>
* Other hints have no effect on this filter.
* </p>
*
* @param width width of the re-sampled image
* @param height height of the re-sampled image

View File

@@ -34,9 +34,10 @@ import java.awt.image.ReplicateScaleFilter;
/**
* An {@code ImageFilter} class for subsampling images.
* <p/>
* <p>
* It is meant to be used in conjunction with a {@code FilteredImageSource}
* object to produce subsampled versions of existing images.
* </p>
*
* @see java.awt.image.FilteredImageSource
*

View File

@@ -30,8 +30,9 @@
/**
* Classes for image manipulation.
* <p/>
* <p>
* See the class {@link com.twelvemonkeys.image.ImageUtil}.
* </p>
*
* @version 1.0
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -218,9 +218,10 @@ abstract class AbstractCachedSeekableStream extends SeekableInputStream {
/**
* Writes a series of bytes at the current read/write position. The read/write position will be increased by
* {@code pLength}.
* <p/>
* <p>
* This implementation invokes {@link #write(int)} {@code pLength} times.
* Subclasses may override this method for performance.
* </p>
*
* @param pBuffer the bytes to write.
* @param pOffset the starting offset into the buffer.
@@ -246,9 +247,10 @@ abstract class AbstractCachedSeekableStream extends SeekableInputStream {
/**
* Writes a series of bytes at the current read/write position. The read/write position will be increased by
* {@code pLength}.
* <p/>
* <p>
* This implementation invokes {@link #read()} {@code pLength} times.
* Subclasses may override this method for performance.
* </p>
*
* @param pBuffer the bytes to write
* @param pOffset the starting offset into the buffer.
@@ -283,12 +285,14 @@ abstract class AbstractCachedSeekableStream extends SeekableInputStream {
/**
* Optionally flushes any data prior to the given position.
* <p/>
* <p>
* Attempting to perform a seek operation, and/or a read or write operation to a position equal to or before
* the flushed position may result in exceptions or undefined behaviour.
* <p/>
* </p>
* <p>
* Subclasses should override this method for performance reasons, to avoid holding on to unnecessary resources.
* This implementation does nothing.
* </p>
*
* @param pPosition the last position to flush.
*/

View File

@@ -40,7 +40,6 @@ import java.util.List;
/**
* A Reader implementation that can read from multiple sources.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -34,7 +34,6 @@ import java.io.StringReader;
/**
* EmptyReader
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -38,7 +38,6 @@ import java.io.OutputStream;
/**
* An unsynchronized {@code ByteArrayOutputStream} implementation. This version
* also has a constructor that lets you create a stream with initial content.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: FastByteArrayOutputStream.java#2 $
@@ -60,8 +59,9 @@ public final class FastByteArrayOutputStream extends ByteArrayOutputStream {
/**
* Creates a {@code ByteArrayOutputStream} with the given initial content.
* <p/>
* <p>
* Note that the buffer is not cloned, for maximum performance.
* </p>
*
* @param pBuffer initial buffer
*/
@@ -123,10 +123,11 @@ public final class FastByteArrayOutputStream extends ByteArrayOutputStream {
* Creates a {@code ByteArrayInputStream} that reads directly from this
* {@code FastByteArrayOutputStream}'s byte buffer.
* The buffer is not cloned, for maximum performance.
* <p/>
* <p>
* Note that care needs to be taken to avoid writes to
* this output stream after the input stream is created.
* Failing to do so, may result in unpredictable behaviour.
* </p>
*
* @return a new {@code ByteArrayInputStream}, reading from this stream's buffer.
*/

View File

@@ -36,8 +36,9 @@ import java.io.*;
/**
* A {@code SeekableInputStream} implementation that caches data in a temporary {@code File}.
* <p/>
* <p>
* Temporary files are created as specified in {@link File#createTempFile(String, String, java.io.File)}.
* </p>
*
* @see MemoryCacheSeekableStream
* @see FileSeekableStream

View File

@@ -37,7 +37,7 @@ import java.io.RandomAccessFile;
/**
* A {@code SeekableInputStream} implementation that uses random access directly to a {@code File}.
* <p/>
* @see FileCacheSeekableStream
* @see MemoryCacheSeekableStream
* @see RandomAccessFile

View File

@@ -37,7 +37,6 @@ import java.io.InputStreamReader;
/**
* FileSystem
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: FileSystem.java#1 $

View File

@@ -171,7 +171,6 @@ public final class FileUtil {
* {@code false}. In all other cases, an
* {@code IOExceptio}n is thrown, and the method does not return.
* @throws IOException if an i/o error occurs during copy
* @todo Test copyDir functionality!
*/
public static boolean copy(File pFromFile, File pToFile, boolean pOverWrite) throws IOException {
// Copy all directory structure

View File

@@ -41,18 +41,23 @@ import java.io.FilenameFilter;
* The mask is given as a well-known DOS filename format, with '*' and '?' as
* wildcards.
* All other characters counts as ordinary characters.
* <p/>
* <p>
* The file name masks are used as a filter input and is given to the class via
* the string array property:<br>
* <dd>{@code filenameMasksForInclusion} - Filename mask for exclusion of
* files (default if both properties are defined)
* <dd>{@code filenameMasksForExclusion} - Filename mask for exclusion of
* files.
* <p/>
* the string array property:
* </p>
* <dl>
* <dt>{@code filenameMasksForInclusion}</dt>
* <dd>Filename mask for exclusion of
* files (default if both properties are defined).</dd>
* <dt>{@code filenameMasksForExclusion}</dt>
* <dd>Filename mask for exclusion of files.</dd>
* </dl>
* <p>
* A recommended way of doing this is by referencing to the component which uses
* this class for file listing. In this way all properties are set in the same
* component and this utility component is kept in the background with only
* initial configuration necessary.
* </p>
*
* @author <a href="mailto:eirik.torske@iconmedialab.no">Eirik Torske</a>
* @see File#list(java.io.FilenameFilter) java.io.File.list

View File

@@ -48,10 +48,11 @@ import java.io.*;
* A little endian input stream reads two's complement,
* little endian integers, floating point numbers, and characters
* and returns them as Java primitive types.
* <p/>
* <p>
* The standard {@code java.io.DataInputStream} class
* which this class imitates reads big endian quantities.
* <p/>
* </p>
* <p>
* <em>Warning:
* The {@code DataInput} and {@code DataOutput} interfaces
* specifies big endian byte order in their documentation.
@@ -59,6 +60,7 @@ import java.io.*;
* implementation. However, I don't see a reason for the these interfaces to
* specify the byte order of their underlying representations.
* </em>
* </p>
*
* @see com.twelvemonkeys.io.LittleEndianRandomAccessFile
* @see java.io.DataInputStream
@@ -380,12 +382,10 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
}
/**
* See the general contract of the {@code readFully}
* method of {@code DataInput}.
* <p/>
* Bytes
* for this operation are read from the contained
* input stream.
* See the general contract of the {@code readFully} method of {@code DataInput}.
* <p>
* Bytes for this operation are read from the contained input stream.
* </p>
*
* @param pBytes the buffer into which the data is read.
* @throws EOFException if this input stream reaches the end before
@@ -398,12 +398,10 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
}
/**
* See the general contract of the {@code readFully}
* method of {@code DataInput}.
* <p/>
* Bytes
* for this operation are read from the contained
* input stream.
* See the general contract of the {@code readFully} method of {@code DataInput}.
* <p>
* Bytes for this operation are read from the contained input stream.
* </p>
*
* @param pBytes the buffer into which the data is read.
* @param pOffset the start offset of the data.
@@ -443,7 +441,6 @@ public class LittleEndianDataInputStream extends FilterInputStream implements Da
* @exception IOException if an I/O error occurs.
* @see java.io.BufferedReader#readLine()
* @see java.io.DataInputStream#readLine()
* @noinspection deprecation
*/
public String readLine() throws IOException {
DataInputStream ds = new DataInputStream(in);

View File

@@ -47,10 +47,11 @@ import java.io.*;
/**
* A little endian output stream writes primitive Java numbers
* and characters to an output stream in a little endian format.
* <p/>
* <p>
* The standard {@code java.io.DataOutputStream} class which this class
* imitates uses big endian integers.
* <p/>
* </p>
* <p>
* <em>Warning:
* The {@code DataInput} and {@code DataOutput} interfaces
* specifies big endian byte order in their documentation.
@@ -58,6 +59,7 @@ import java.io.*;
* implementation. However, I don't see a reason for the these interfaces to
* specify the byte order of their underlying representations.
* </em>
* <p>
*
* @see com.twelvemonkeys.io.LittleEndianRandomAccessFile
* @see java.io.DataOutputStream

View File

@@ -36,7 +36,7 @@ import java.nio.channels.FileChannel;
/**
* A replacement for {@link java.io.RandomAccessFile} that is capable of reading
* and writing data in little endian byte order.
* <p/>
* <p>
* <em>Warning:
* The {@code DataInput} and {@code DataOutput} interfaces
* specifies big endian byte order in their documentation.
@@ -44,6 +44,7 @@ import java.nio.channels.FileChannel;
* implementation. However, I don't see a reason for the these interfaces to
* specify the byte order of their underlying representations.
* </em>
* </p>
*
* @see com.twelvemonkeys.io.LittleEndianDataInputStream
* @see com.twelvemonkeys.io.LittleEndianDataOutputStream

View File

@@ -37,7 +37,6 @@ import java.util.List;
/**
* A {@code SeekableInputStream} implementation that caches data in memory.
* <p/>
*
* @see FileCacheSeekableStream
*

View File

@@ -35,7 +35,6 @@ import java.io.InputStream;
/**
* An {@code InputStream} that contains no bytes.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/NullInputStream.java#2 $

View File

@@ -35,7 +35,6 @@ import java.io.OutputStream;
/**
* An {@code OutputStream} implementation that works as a sink.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/NullOutputStream.java#2 $

View File

@@ -38,7 +38,6 @@ import java.io.IOException;
/**
* A data stream that is both readable and writable, much like a
* {@code RandomAccessFile}, except it may be backed by something other than a file.
* <p/>
*
* @see java.io.RandomAccessFile
*
@@ -114,8 +113,9 @@ public abstract class RandomAccessStream implements Seekable, DataInput, DataOut
/**
* Returns an input view of this {@code RandomAccessStream}.
* Invoking this method several times, will return the same object.
* <p/>
* <p>
* <em>Note that read access is NOT synchronized.</em>
* </p>
*
* @return a {@code SeekableInputStream} reading from this stream
*/
@@ -129,8 +129,9 @@ public abstract class RandomAccessStream implements Seekable, DataInput, DataOut
/**
* Returns an output view of this {@code RandomAccessStream}.
* Invoking this method several times, will return the same object.
* <p/>
* <p>
* <em>Note that write access is NOT synchronized.</em>
* </p>
*
* @return a {@code SeekableOutputStream} writing to this stream
*/

View File

@@ -34,7 +34,7 @@ import java.io.IOException;
/**
* Interface for seekable streams.
* <p/>
*
* @see SeekableInputStream
* @see SeekableOutputStream
*
@@ -55,12 +55,14 @@ public interface Seekable {
/**
* Sets the current stream position to the desired location.
* The next read will occur at this location.
* <p/>
* <p>
* An {@code IndexOutOfBoundsException} will be thrown if pPosition is smaller
* than the flushed position (as returned by {@link #getFlushedPosition()}).
* <p/>
* </p>
* <p>
* It is legal to seek past the end of the file; an {@code EOFException}
* will be thrown only if a read is performed.
* </p>
*
* @param pPosition a long containing the desired file pointer position.
*
@@ -76,25 +78,29 @@ public interface Seekable {
* Unlike a standard {@code InputStream}, all {@code Seekable}
* streams upport marking. Additionally, calls to {@code mark} and
* {@code reset} may be nested arbitrarily.
* <p/>
* <p>
* Unlike the {@code mark} methods declared by the {@code Reader} or
* {@code InputStream}
* interfaces, no {@code readLimit} parameter is used. An arbitrary amount
* of data may be read following the call to {@code mark}.
* </p>
*/
void mark();
/**
* Returns the file pointer to its previous position,
* at the time of the most recent unmatched call to mark.
* <p/>
* <p>
* Calls to reset without a corresponding call to mark will either:
* </p>
* <ul>
* <li>throw an {@code IOException}</li>
* <li>or, reset to the beginning of the stream.</li>
* </ul>
* <p>
* An {@code IOException} will be thrown if the previous marked position
* lies in the discarded portion of the stream.
* </p>
*
* @throws IOException if an I/O error occurs.
* @see java.io.InputStream#reset()
@@ -105,10 +111,11 @@ public interface Seekable {
* Discards the initial portion of the stream prior to the indicated
* postion. Attempting to seek to an offset within the flushed portion of
* the stream will result in an {@code IndexOutOfBoundsException}.
* <p/>
* <p>
* Calling {@code flushBefore} may allow classes implementing this
* interface to free up resources such as memory or disk space that are
* being used to store data from the stream.
* </p>
*
* @param pPosition a long containing the length of the file prefix that
* may be flushed.

View File

@@ -36,7 +36,7 @@ import java.util.Stack;
/**
* Abstract base class for {@code InputStream}s implementing the {@code Seekable} interface.
* <p/>
*
* @see SeekableOutputStream
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -37,7 +37,7 @@ import java.util.Stack;
/**
* Abstract base class for {@code OutputStream}s implementing the
* {@code Seekable} interface.
* <p/>
*
* @see SeekableInputStream
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -38,7 +38,6 @@ import java.io.StringReader;
/**
* StringArrayReader
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -39,7 +39,6 @@ import java.io.InputStream;
/**
* An {@code InputStream} reading up to a specified number of bytes from an
* underlying stream.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/SubStream.java#2 $

View File

@@ -38,7 +38,6 @@ import java.io.IOException;
/**
* UnixFileSystem
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/UnixFileSystem.java#1 $

View File

@@ -37,7 +37,6 @@ import java.io.IOException;
/**
* Win32File
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/Win32File.java#2 $

View File

@@ -36,7 +36,6 @@ import java.io.IOException;
/**
* WindowsFileSystem
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/Win32FileSystem.java#2 $

View File

@@ -35,10 +35,11 @@ import java.util.Arrays;
/**
* A {@code File} implementation that resolves the Windows {@code .lnk} files as symbolic links.
* <p/>
* <p>
* This class is based on example code from
* <a href="http://www.oreilly.com/catalog/swinghks/index.html">Swing Hacks</a>,
* By Joshua Marinacci, Chris Adamson (O'Reilly, ISBN: 0-596-00907-0), Hack 30.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/Win32Lnk.java#2 $
@@ -324,9 +325,10 @@ final class Win32Lnk extends File {
/**
* Converts two bytes into a short.
* <p/>
* <p>
* NOTE: this is little endian because it's for an
* Intel only OS
* </p>
*
* @ param bytes
* @ param off

View File

@@ -39,15 +39,16 @@ import java.nio.charset.Charset;
/**
* Wraps a {@code Writer} in an {@code OutputStream}.
* <p/>
* <p>
* <em>Instances of this class are not thread-safe.</em>
* <p/>
* </p>
* <p>
* <em>NOTE: This class is probably not the right way of solving your problem,
* however it might prove useful in JSPs etc.
* If possible, it's always better to use the {@code Writer}'s underlying
* {@code OutputStream}, or wrap it's native backing.
* </em>
* <p/>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/WriterOutputStream.java#2 $

View File

@@ -36,9 +36,9 @@ import java.nio.ByteBuffer;
/**
* {@code Decoder} implementation for standard base64 encoding.
* <p/>
*
* @see <a href="http://tools.ietf.org/html/rfc1421">RFC 1421</a>
* @see <a href="http://tools.ietf.org/html/rfc2045"RFC 2045</a>
* @see <a href="http://tools.ietf.org/html/rfc2045">RFC 2045</a>
*
* @see Base64Encoder
*

View File

@@ -36,9 +36,9 @@ import java.nio.ByteBuffer;
/**
* {@code Encoder} implementation for standard base64 encoding.
* <p/>
*
* @see <a href="http://tools.ietf.org/html/rfc1421">RFC 1421</a>
* @see <a href="http://tools.ietf.org/html/rfc2045"RFC 2045</a>
* @see <a href="http://tools.ietf.org/html/rfc2045">RFC 2045</a>
*
* @see Base64Decoder
*

View File

@@ -34,7 +34,6 @@ import java.io.IOException;
/**
* Thrown by {@code Decoder}s when encoded data can not be decoded.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/DecodeException.java#2 $

View File

@@ -38,9 +38,10 @@ import java.nio.ByteBuffer;
* Interface for decoders.
* A {@code Decoder} may be used with a {@code DecoderStream}, to perform
* on-the-fly decoding from an {@code InputStream}.
* <p/>
* <p>
* Important note: Decoder implementations are typically not synchronized.
* <p/>
* </p>
*
* @see Encoder
* @see DecoderStream
*

View File

@@ -36,9 +36,8 @@ import java.io.InputStream;
import java.nio.ByteBuffer;
/**
* An {@code InputStream} that provides on-the-fly decoding from an underlying
* stream.
* <p/>
* An {@code InputStream} that provides on-the-fly decoding from an underlying stream.
*
* @see EncoderStream
* @see Decoder
*

View File

@@ -38,8 +38,9 @@ import java.nio.ByteBuffer;
* Interface for encoders.
* An {@code Encoder} may be used with an {@code EncoderStream}, to perform
* on-the-fly encoding to an {@code OutputStream}.
* <p/>
* <p>
* Important note: Encoder implementations are typically not synchronized.
* </p>
*
* @see Decoder
* @see EncoderStream

View File

@@ -36,9 +36,8 @@ import java.io.OutputStream;
import java.nio.ByteBuffer;
/**
* An {@code OutputStream} that provides on-the-fly encoding to an underlying
* stream.
* <p/>
* An {@code OutputStream} that provides on-the-fly encoding to an underlying stream.
*
* @see DecoderStream
* @see Encoder
*

View File

@@ -37,30 +37,36 @@ import java.nio.ByteBuffer;
/**
* Decoder implementation for Apple PackBits run-length encoding.
* <p/>
* <small>From Wikipedia, the free encyclopedia</small><br/>
* <p>
* <small>From Wikipedia, the free encyclopedia</small>
* <br>
* PackBits is a fast, simple compression scheme for run-length encoding of
* data.
* <p/>
* </p>
* <p>
* Apple introduced the PackBits format with the release of MacPaint on the
* Macintosh computer. This compression scheme is one of the types of
* compression that can be used in TIFF-files.
* <p/>
* </p>
* <p>
* A PackBits data stream consists of packets of one byte of header followed by
* data. The header is a signed byte; the data can be signed, unsigned, or
* packed (such as MacPaint pixels).
* <p/>
* <table><tr><th>Header byte</th><th>Data</th></tr>
* </p>
* <table>
* <caption>PackBits</caption>
* <tr><th>Header byte</th><th>Data</th></tr>
* <tr><td>0 to 127</td> <td>1 + <i>n</i> literal bytes of data</td></tr>
* <tr><td>0 to -127</td> <td>One byte of data, repeated 1 - <i>n</i> times in
* the decompressed output</td></tr>
* <tr><td>-128</td> <td>No operation</td></tr></table>
* <p/>
* <tr><td>0 to -127</td> <td>One byte of data, repeated 1 - <i>n</i> times in the decompressed output</td></tr>
* <tr><td>-128</td> <td>No operation</td></tr>
* </table>
* <p>
* Note that interpreting 0 as positive or negative makes no difference in the
* output. Runs of two bytes adjacent to non-runs are typically written as
* literal data.
* <p/>
* See <a href="http://developer.apple.com/technotes/tn/tn1023.html">Understanding PackBits</a>
* </p>
*
* @see <a href="http://developer.apple.com/technotes/tn/tn1023.html">Understanding PackBits</a>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/PackBitsDecoder.java#1 $
@@ -80,10 +86,11 @@ public final class PackBitsDecoder implements Decoder {
/**
* Creates a {@code PackBitsDecoder}, with optional compatibility mode.
* <p/>
* <p>
* As some implementations of PackBits-like encoders treat {@code -128} as length of
* a compressed run, instead of a no-op, it's possible to disable no-ops for compatibility.
* Should be used with caution, even though, most known encoders never write no-ops in the compressed streams.
* </p>
*
* @param disableNoOp {@code true} if {@code -128} should be treated as a compressed run, and not a no-op
*/
@@ -93,10 +100,11 @@ public final class PackBitsDecoder implements Decoder {
/**
* Creates a {@code PackBitsDecoder}, with optional compatibility mode.
* <p/>
* <p>
* As some implementations of PackBits-like encoders treat {@code -128} as length of
* a compressed run, instead of a no-op, it's possible to disable no-ops for compatibility.
* Should be used with caution, even though, most known encoders never write no-ops in the compressed streams.
* </p>
*
* @param disableNoOp {@code true} if {@code -128} should be treated as a compressed run, and not a no-op
*/

View File

@@ -36,30 +36,36 @@ import java.nio.ByteBuffer;
/**
* Encoder implementation for Apple PackBits run-length encoding.
* <p/>
* From Wikipedia, the free encyclopedia<br/>
* <p>
* From Wikipedia, the free encyclopedia
* <br>
* PackBits is a fast, simple compression scheme for run-length encoding of
* data.
* <p/>
* </p>
* <p>
* Apple introduced the PackBits format with the release of MacPaint on the
* Macintosh computer. This compression scheme is one of the types of
* compression that can be used in TIFF-files.
* <p/>
* </p>
* <p>
* A PackBits data stream consists of packets of one byte of header followed by
* data. The header is a signed byte; the data can be signed, unsigned, or
* packed (such as MacPaint pixels).
* <p/>
* <table><tr><th>Header byte</th><th>Data</th></tr>
* </p>
* <table>
* <caption>PackBits</caption>
* <tr><th>Header byte</th><th>Data</th></tr>
* <tr><td>0 to 127</td> <td>1 + <i>n</i> literal bytes of data</td></tr>
* <tr><td>0 to -127</td> <td>One byte of data, repeated 1 - <i>n</i> times in
* the decompressed output</td></tr>
* <tr><td>-128</td> <td>No operation</td></tr></table>
* <p/>
* <tr><td>0 to -127</td> <td>One byte of data, repeated 1 - <i>n</i> times in the decompressed output</td></tr>
* <tr><td>-128</td> <td>No operation</td></tr>
* </table>
* <p>
* Note that interpreting 0 as positive or negative makes no difference in the
* output. Runs of two bytes adjacent to non-runs are typically written as
* literal data.
* <p/>
* See <a href="http://developer.apple.com/technotes/tn/tn1023.html">Understanding PackBits</a>
* </p>
*
* @see <a href="http://developer.apple.com/technotes/tn/tn1023.html">Understanding PackBits</a>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/PackBitsEncoder.java#1 $

View File

@@ -45,11 +45,12 @@ import static com.twelvemonkeys.lang.Validate.notNull;
/**
* Represents a read-only OLE2 compound document.
* <p/>
* <p>
* <!-- TODO: Consider really detaching the entries, as this is hard for users to enforce... -->
* <em>NOTE: This class is not synchronized. Accessing the document or its
* entries from different threads, will need synchronization on the document
* instance.</em>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.no">Harald Kuhr</a>
* @author last modified by $Author: haku $
@@ -99,10 +100,11 @@ public final class CompoundDocument implements AutoCloseable {
/**
* Creates a (for now) read only {@code CompoundDocument}.
* <p/>
* <p>
* <em>Warning! You must invoke {@link #close()} on the compound document
* created from this constructor when done, to avoid leaking file
* descriptors.</em>
* </p>
*
* @param file the file to read from
*
@@ -641,9 +643,10 @@ public final class CompoundDocument implements AutoCloseable {
* milliseconds since January 1, 1970.
* The time stamp parameter is assumed to be in units of
* 100 nano seconds since January 1, 1601.
* <p/>
* <p>
* If the timestamp is {@code 0L} (meaning not specified), no conversion
* is done, to behave like {@code java.io.File}.
* </p>
*
* @param pMSTime an unsigned long value representing the time stamp (in
* units of 100 nano seconds since January 1, 1601).

View File

@@ -214,8 +214,9 @@ public final class Entry implements Comparable<Entry> {
* The time is converted from its internal representation to standard Java
* representation, milliseconds since the epoch
* (00:00:00 GMT, January 1, 1970).
* <p/>
* <p>
* Note that most applications leaves this value empty ({@code 0L}).
* </p>
*
* @return A {@code long} value representing the time this entry was
* created, measured in milliseconds since the epoch
@@ -231,8 +232,9 @@ public final class Entry implements Comparable<Entry> {
* The time is converted from its internal representation to standard Java
* representation, milliseconds since the epoch
* (00:00:00 GMT, January 1, 1970).
* <p/>
* <p>
* Note that many applications leaves this value empty ({@code 0L}).
* </p>
*
* @return A {@code long} value representing the time this entry was
* last modified, measured in milliseconds since the epoch

View File

@@ -38,7 +38,6 @@ import java.util.*;
/**
* Contains mappings from file extension to mime-types and from mime-type to file-types.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/net/MIMEUtil.java#5 $

View File

@@ -102,8 +102,9 @@ public final class DOMSerializer {
/**
* Specifies wether the serializer should use indentation and optimize for
* readability.
* <p/>
* Note: This is a hint, and may be ignored by DOM implemenations.
* <p>
* Note: This is a hint, and may be ignored by DOM implementations.
* </p>
*
* @param pPrettyPrint {@code true} to enable pretty printing
*/

View File

@@ -42,8 +42,9 @@ import java.util.Map;
/**
* A utility class with some useful bean-related functions.
* <p/>
* <p>
* <em>NOTE: This class is not considered part of the public API and may be changed without notice</em>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
@@ -66,13 +67,11 @@ public final class BeanUtil {
*
* @return A string containing the value of the given property, or {@code null}
* if it can not be found.
* @todo Remove System.err's... Create new Exception? Hmm..
*/
public static Object getPropertyValue(Object pObject, String pProperty) {
//
// TODO: Remove System.err's... Create new Exception? Hmm..
// TODO: Support get(Object) method of Collections!
// Handle lists and arrays with [] (index) operator
//
if (pObject == null || pProperty == null || pProperty.length() < 1) {
return null;
@@ -535,9 +534,10 @@ public final class BeanUtil {
* a method named
* {@code set + capitalize(entry.getKey())} is called on the bean,
* with {@code entry.getValue()} as its argument.
* <p/>
* <p>
* Properties that has no matching set-method in the bean, are simply
* discarded.
* </p>
*
* @param pBean The bean to configure
* @param pMapping The mapping for the bean
@@ -560,12 +560,14 @@ public final class BeanUtil {
* a method named
* {@code set + capitalize(entry.getKey())} is called on the bean,
* with {@code entry.getValue()} as its argument.
* <p/>
* <p>
* Optionally, lisp-style names are allowed, and automatically converted
* to Java-style camel-case names.
* <p/>
* </p>
* <p>
* Properties that has no matching set-method in the bean, are simply
* discarded.
* </p>
*
* @see StringUtil#lispToCamel(String)
*

View File

@@ -35,7 +35,6 @@ import java.util.TimeZone;
/**
* A utility class with useful date manipulation methods and constants.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/DateUtil.java#1 $

View File

@@ -199,9 +199,10 @@ public final class Platform {
/**
* Enumeration of common System {@code Architecture}s.
* <p/>
* <p>
* For {@link #Unknown unknown architectures}, {@code toString()} will return
* the the same value as {@code System.getProperty("os.arch")}.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/Platform.java#1 $
@@ -228,9 +229,10 @@ public final class Platform {
/**
* Enumeration of common {@code OperatingSystem}s.
* <p/>
* <p>
* For {@link #Unknown unknown operating systems}, {@code getName()} will return
* the the same value as {@code System.getProperty("os.name")}.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/Platform.java#1 $

View File

@@ -32,9 +32,10 @@ package com.twelvemonkeys.lang;
/**
* Util class for various reflection-based operations.
* <p/>
* <p>
* <em>NOTE: This class is not considered part of the public API and may be
* changed without notice</em>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/ReflectUtil.java#1 $

View File

@@ -56,9 +56,9 @@ import java.util.regex.PatternSyntaxException;
* @author <A href="mailto:eirik.torske@twelvemonkeys.com">Eirik Torske</A>
* @author last modified by $Author: haku $
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/StringUtil.java#2 $
* @todo Consistency check: Method names, parameter sequence, Exceptions,
* return values, null-value handling and parameter names (cosmetics).
*/
// TODO: Consistency check: Method names, parameter sequence, Exceptions,
public final class StringUtil {
/**
@@ -798,10 +798,10 @@ public final class StringUtil {
* @param pPrepend The location of fill-ins, prepend (true),
* or append (false)
* @return a concatenated string.
* @todo What if source is allready longer than required length?
* @todo Consistency with cut
* @see #cut(String,int,String)
*/
// TODO: What if source is allready longer than required length?
// TODO: Consistency with cut
public static String pad(String pSource, int pRequiredLength, String pPadString, boolean pPrepend) {
if (pPadString == null || pPadString.length() == 0) {
throw new IllegalArgumentException("Pad string: \"" + pPadString + "\"");
@@ -873,10 +873,11 @@ public final class StringUtil {
* @param pString the string to convert
* @param pFormat the date format
* @return the date
* @todo cache formats?
*
* @see java.text.SimpleDateFormat
* @see java.text.SimpleDateFormat#SimpleDateFormat(String)
*/
// TODO: cache formats?
public static Date toDate(String pString, String pFormat) {
// Get the format from cache, or create new and insert
// Return new date
@@ -1203,14 +1204,15 @@ public final class StringUtil {
* hexadecimal for red, green and blue values respectively.</LI>
* <LI>{@code #AARRGGBB}, as above, with AA as alpha component.</LI>
* </UL>
* <p/>
* <p>
* Examlples: {@code toColorString(Color.red) == "#ff0000"},
* {@code toColorString(new Color(0xcc, 0xcc, 0xcc)) == "#cccccc"}.
* </p>
*
* @param pColor the color
* @return A String representation of the color on HTML/CSS form
* @todo Consider moving to ImageUtil?
*/
// TODO: Consider moving to ImageUtil?
public static String toColorString(Color pColor) {
// Not a color...
if (pColor == null) {
@@ -1237,9 +1239,10 @@ public final class StringUtil {
* Tests a string, to see if it is an number (element of <b>Z</b>).
* Valid integers are positive natural numbers (1, 2, 3, ...),
* their negatives (?1, ?2, ?3, ...) and the number zero.
* <p/>
* <p>
* Note that there is no guarantees made, that this number can be
* represented as either an int or a long.
* </p>
*
* @param pString The string to check.
* @return true if the String is a natural number.
@@ -1356,9 +1359,10 @@ public final class StringUtil {
/**
* Ensures that a string includes a given substring at a given position.
* <p/>
* <p>
* Extends the string with a given string if it is not already there.
* E.g an URL "www.vg.no", to "http://www.vg.no".
* </p>
*
* @param pSource The source string.
* @param pSubstring The substring to include.
@@ -1384,9 +1388,10 @@ public final class StringUtil {
/**
* Ensures that a string does not include a given substring at a given
* position.
* <p/>
* <p>
* Removes a given substring from a string if it is there.
* E.g an URL "http://www.vg.no", to "www.vg.no".
* </p>
*
* @param pSource The source string.
* @param pSubstring The substring to check and possibly remove.
@@ -1411,7 +1416,6 @@ public final class StringUtil {
/**
* Gets the first substring between the given string boundaries.
* <p/>
*
* @param pSource The source string.
* @param pBeginBoundaryString The string that marks the beginning.
@@ -1446,7 +1450,6 @@ public final class StringUtil {
/**
* Removes the first substring demarcated by the given string boundaries.
* <p/>
*
* @param pSource The source string.
* @param pBeginBoundaryChar The character that marks the beginning of the
@@ -1486,7 +1489,6 @@ public final class StringUtil {
/**
* Removes all substrings demarcated by the given string boundaries.
* <p/>
*
* @param pSource The source string.
* @param pBeginBoundaryChar The character that marks the beginning of the unwanted substring.
@@ -1520,13 +1522,12 @@ public final class StringUtil {
/**
* Gets the first element of a {@code String} containing string elements delimited by a given delimiter.
* <i>NB - Straightforward implementation!</i>
* <p/>
*
* @param pSource The source string.
* @param pDelimiter The delimiter used in the source string.
* @return The last string element.
* @todo This method should be re-implemented for more efficient execution.
*/
// TODO: This method should be re-implemented for more efficient execution.
public static String getFirstElement(final String pSource, final String pDelimiter) {
if (pDelimiter == null) {
throw new IllegalArgumentException("delimiter == null");
@@ -1547,7 +1548,6 @@ public final class StringUtil {
* Gets the last element of a {@code String} containing string elements
* delimited by a given delimiter.
* <i>NB - Straightforward implementation!</i>
* <p/>
*
* @param pSource The source string.
* @param pDelimiter The delimiter used in the source string.
@@ -1620,9 +1620,9 @@ public final class StringUtil {
* @param pForceDeep {@code true} to force deep {@code toString}, even
* if object overrides toString
* @return a deep string representation of the given object
* @todo Array handling (print full type and length)
* @todo Register handlers for specific toDebugString handling? :-)
*/
// TODO: Array handling (print full type and length)
// TODO: Register handlers for specific toDebugString handling? :-)
public static String deepToString(Object pObject, boolean pForceDeep, int pDepth) {
// Null is null
if (pObject == null) {
@@ -1761,11 +1761,11 @@ public final class StringUtil {
/**
* Tells whether or not the given string string matches the given regular
* expression.
* <p/>
* <p>
* An invocation of this method of the form
* <tt>matches(<i>str</i>, <i>regex</i>)</tt> yields exactly the
* same result as the expression
* <p/>
* </p>
* <blockquote><tt> {@link Pattern}.
* {@link Pattern#matches(String, CharSequence) matches}
* (<i>regex</i>, <i>str</i>)</tt></blockquote>
@@ -1785,15 +1785,18 @@ public final class StringUtil {
/**
* Replaces the first substring of the given string that matches the given
* regular expression with the given pReplacement.
* <p/>
* <p>
* An invocation of this method of the form
* <tt>replaceFirst(<i>str</i>, </tt><i>regex</i>, <i>repl</i>)</tt>
* yields exactly the same result as the expression
* <p/>
* <tt>
* replaceFirst(<i>str</i>, <i>regex</i>, <i>repl</i>)
* </tt>
* yields exactly the same result as the expression:
* </p>
* <blockquote><tt>
* {@link Pattern}.{@link Pattern#compile compile}(<i>regex</i>).
* {@link Pattern}.{@link Pattern#compile(String) compile}(<i>regex</i>).
* {@link Pattern#matcher matcher}(<i>str</i>).
* {@link java.util.regex.Matcher#replaceFirst replaceFirst}(<i>repl</i>)</tt></blockquote>
* {@link java.util.regex.Matcher#replaceFirst replaceFirst}(<i>repl</i>)
* </tt></blockquote>
*
* @param pString the string
* @param pRegex the regular expression to which this string is to be matched
@@ -1810,15 +1813,16 @@ public final class StringUtil {
/**
* Replaces each substring of this string that matches the given
* regular expression with the given pReplacement.
* <p/>
* <p>
* An invocation of this method of the form
* <tt>replaceAll(<i>str</i>, <i>pRegex</i>, <i>repl</i><)</tt>
* <tt>replaceAll(<i>str</i>, <i>pRegex</i>, <i>repl</i>)</tt>
* yields exactly the same result as the expression
* <p/>
* </p>
* <blockquote><tt>
* {@link Pattern}.{@link Pattern#compile compile}(<i>pRegex</i>).
* {@link Pattern#matcher matcher}(</tt><i>str</i>{@code ).
* {@link java.util.regex.Matcher#replaceAll replaceAll}(}<i>repl</i>{@code )}</blockquote>
* {@link Pattern}.{@link Pattern#compile(String) compile}(<i>pRegex</i>).
* {@link Pattern#matcher matcher}(<i>str</i>{@code ).
* {@link java.util.regex.Matcher#replaceAll replaceAll}(}<i>repl</i>{@code )}
* </tt></blockquote>
*
* @param pString the string
* @param pRegex the regular expression to which this string is to be matched
@@ -1834,14 +1838,15 @@ public final class StringUtil {
/**
* Splits this string around matches of the given regular expression.
* <p/>
* <p>
* The array returned by this method contains each substring of this
* string that is terminated by another substring that matches the given
* expression or is terminated by the end of the string. The substrings in
* the array are in the order in which they occur in this string. If the
* expression does not match any part of the input then the resulting array
* has just one element, namely this string.
* <p/>
* </p>
* <p>
* The {@code pLimit} parameter controls the number of times the
* pattern is applied and therefore affects the length of the resulting
* array. If the pLimit <i>n</i> is greater than zero then the pattern
@@ -1852,13 +1857,14 @@ public final class StringUtil {
* possible and the array can have any length. If <i>n</i> is zero then
* the pattern will be applied as many times as possible, the array can
* have any length, and trailing empty strings will be discarded.
* <p/>
* </p>
* <p>
* An invocation of this method of the form
* <tt>split(<i>str</i>, <i>regex</i>, <i>n</i>)</tt>
* yields the same result as the expression
* <p/>
* yields the same result as the expression:
* </p>
* <blockquote>{@link Pattern}.
* {@link Pattern#compile compile}<tt>(<i>regex</i>).
* {@link Pattern#compile(String) compile}<tt>(<i>regex</i>).
* {@link Pattern#split(CharSequence,int) split}(<i>str</i>, <i>n</i>)</tt>
* </blockquote>
*
@@ -1878,11 +1884,12 @@ public final class StringUtil {
/**
* Splits this string around matches of the given regular expression.
* <p/>
* <p>
* This method works as if by invoking the two-argument
* {@link #split(String,String,int) split} method with the given
* expression and a limit argument of zero.
* Trailing empty strings are therefore not included in the resulting array.
* </p>
*
* @param pString the string
* @param pRegex the delimiting regular expression
@@ -1901,7 +1908,7 @@ public final class StringUtil {
* from camel-style (Java in-fix) naming convention
* to Lisp-style naming convention (hyphen delimitted, all lower case).
* Other characters in the string are left untouched.
* <p/>
* <p>
* Eg.
* {@code "foo" => "foo"},
* {@code "fooBar" => "foo-bar"},
@@ -1910,6 +1917,7 @@ public final class StringUtil {
* {@code "HttpURLConnection" => "http-url-connection"}
* {@code "my45Caliber" => "my-45-caliber"}
* {@code "allready-lisp" => "allready-lisp"}
* </p>
*
* @param pString the camel-style input string
* @return the string converted to lisp-style naming convention
@@ -2040,14 +2048,14 @@ public final class StringUtil {
* from Lisp-style naming convention (hyphen delimitted, all lower case)
* to camel-style (Java in-fix) naming convention.
* Other characters in the string are left untouched.
* <p/>
* <p>
* Eg.
* {@code "foo" => "foo"},
* {@code "foo-bar" => "fooBar"},
* {@code "http-request-wrapper" => "httpRequestWrapper"}
* {@code "my-45-caliber" => "my45Caliber"}
* {@code "allreadyCamel" => "allreadyCamel"}
* <p/>
* </p>
*
* @param pString the lisp-style input string
* @return the string converted to camel-style
@@ -2064,7 +2072,7 @@ public final class StringUtil {
* from Lisp-style naming convention (hyphen delimitted, all lower case)
* to camel-style (Java in-fix) naming convention.
* Other characters in the string are left untouched.
* <p/>
* <p>
* To create a string starting with a lower case letter
* (like Java variable names, etc),
* specify the {@code pFirstUpperCase} paramter to be {@code false}.
@@ -2072,14 +2080,15 @@ public final class StringUtil {
* {@code "foo" => "foo"},
* {@code "foo-bar" => "fooBar"},
* {@code "allreadyCamel" => "allreadyCamel"}
* <p/>
* </p>
* <p>
* To create a string starting with an upper case letter
* (like Java class name, etc),
* specify the {@code pFirstUpperCase} paramter to be {@code true}.
* Eg.
* {@code "http-request-wrapper" => "HttpRequestWrapper"}
* {@code "my-45-caliber" => "My45Caliber"}
* <p/>
* {@code "my-12-monkeys" => "My12Monkeys"}
* </p>
*
* @param pString the lisp-style input string
* @param pFirstUpperCase {@code true} if the first char should be

View File

@@ -43,9 +43,10 @@ import java.util.Properties;
/**
* A utility class with some useful system-related functions.
* <p/>
* <p>
* <em>NOTE: This class is not considered part of the public API and may be
* changed without notice</em>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
@@ -200,12 +201,10 @@ public final class SystemUtil {
* @see #loadProperties(Class)
* @see java.lang.ClassLoader#getResourceAsStream
* @see java.lang.ClassLoader#getSystemResourceAsStream
*
* @todo Reconsider ever using the System ClassLoader: http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
* @todo Consider using Context Classloader instead?
*/
public static Properties loadProperties(Class pClass, String pName) throws IOException
{
// TODO: Reconsider ever using the System ClassLoader: http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
// TODO: Consider using Context Classloader instead?
public static Properties loadProperties(Class pClass, String pName) throws IOException {
// Convert to name the classloader understands
String name = !StringUtil.isEmpty(pName) ? pName : pClass.getName().replace('.', '/');

View File

@@ -36,10 +36,11 @@ import java.util.Map;
/**
* Kind of like {@code org.apache.commons.lang.Validate}. Just smarter. ;-)
* <p/>
* <p>
* Uses type parameterized return values, thus making it possible to check
* constructor arguments before
* they are passed on to {@code super} or {@code this} type constructors.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -35,7 +35,6 @@ import java.util.*;
/**
* AbstractDecoratedMap
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/AbstractDecoratedMap.java#2 $
@@ -59,9 +58,10 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
/**
* Creates a {@code Map} backed by a {@code HashMap}, containing all
* key/value mappings from the given {@code Map}.
* <p/>
* <p>
* <small>This is constructor is here to comply with the reccomendations for
* "standard" constructors in the {@code Map} interface.</small>
* </p>
*
* @see #AbstractDecoratedMap(java.util.Map, java.util.Map)
*
@@ -75,9 +75,10 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
/**
* Creates a {@code Map} backed by the given backing-{@code Map},
* containing all key/value mappings from the given contents-{@code Map}.
* <p/>
* <p>
* NOTE: The backing map is structuraly cahnged, and it should NOT be
* accessed directly, after the wrapped map is created.
* </p>
*
* @param pBacking the backing map of this map. Must be either empty, or
* the same map as {@code pContents}.
@@ -149,9 +150,10 @@ abstract class AbstractDecoratedMap<K, V> extends AbstractMap<K, V> implements M
* specified pValue. More formally, returns {@code true} if and only if
* this map contains at least one mapping to a pValue {@code v} such that
* {@code (pValue==null ? v==null : pValue.equals(v))}.
* <p/>
* <p>
* This implementation requires time linear in the map size for this
* operation.
* </p>
*
* @param pValue pValue whose presence in this map is to be tested.
* @return {@code true} if this map maps one or more keys to the

View File

@@ -32,7 +32,6 @@ package com.twelvemonkeys.util;
/**
* Abstract base class for {@code TokenIterator}s to extend.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/AbstractTokenIterator.java#1 $

View File

@@ -41,9 +41,10 @@ import java.util.*;
/**
* A {@code Map} adapter for a Java Bean.
* <p/>
* <p>
* Ruthlessly stolen from
* <a href="http://binkley.blogspot.com/2006/08/mapping-java-bean.html>Binkley's Blog</a>
* <a href="http://binkley.blogspot.com/2006/08/mapping-java-bean.html">Binkley's Blog</a>
* </p>
*/
public final class BeanMap extends AbstractMap<String, Object> implements Serializable, Cloneable {
private final Object bean;

View File

@@ -268,7 +268,7 @@ public final class CollectionUtil {
*
* @throws IllegalArgumentException if {@code pArray} is {@code null} or
* if {@code pArray} is not an array.
* @throws ArrayIndexOutOfBoundsException if {@code pStart} < 0
* @throws ArrayIndexOutOfBoundsException if {@code pStart} &lt; 0
*/
public static Object subArray(Object pArray, int pStart) {
return subArray(pArray, pStart, -1);
@@ -279,13 +279,14 @@ public final class CollectionUtil {
* If the sub array is same length as the original
* ({@code pStart == 0}), the original array will be returned.
*
* @param <T> the type of array
* @param pArray the original array
* @param pStart the start index of the original array
* @return a subset of the original array, or the original array itself,
* if {@code pStart} is 0.
*
* @throws IllegalArgumentException if {@code pArray} is {@code null}
* @throws ArrayIndexOutOfBoundsException if {@code pStart} < 0
* @throws ArrayIndexOutOfBoundsException if {@code pStart} &lt; 0
*/
public static <T> T[] subArray(T[] pArray, int pStart) {
return subArray(pArray, pStart, -1);
@@ -309,7 +310,7 @@ public final class CollectionUtil {
*
* @throws IllegalArgumentException if {@code pArray} is {@code null} or
* if {@code pArray} is not an array.
* @throws ArrayIndexOutOfBoundsException if {@code pStart} < 0
* @throws ArrayIndexOutOfBoundsException if {@code pStart} &lt; 0
*/
@SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object subArray(Object pArray, int pStart, int pLength) {
@@ -363,6 +364,7 @@ public final class CollectionUtil {
* If the sub array is same length as the original, the original array will
* be returned.
*
* @param <T> the type of array
* @param pArray the original array
* @param pStart the start index of the original array
* @param pLength the length of the new array
@@ -371,7 +373,7 @@ public final class CollectionUtil {
* negative, or greater or equal to {@code pArray.length}.
*
* @throws IllegalArgumentException if {@code pArray} is {@code null}
* @throws ArrayIndexOutOfBoundsException if {@code pStart} < 0
* @throws ArrayIndexOutOfBoundsException if {@code pStart} &lt; 0
*/
@SuppressWarnings("unchecked")
public static <T> T[] subArray(T[] pArray, int pStart, int pLength) {
@@ -424,8 +426,8 @@ public final class CollectionUtil {
* @param pArray the array to iterate
* @return a new {@link ListIterator}
* @throws IllegalArgumentException if {@code pArray} is {@code null},
* {@code pStart < 0}, or
* {@code pLength > pArray.length - pStart}
* {@code pStart &lt; 0}, or
* {@code pLength &gt; pArray.length - pStart}
*/
public static <E> ListIterator<E> iterator(final E[] pArray) {
return iterator(pArray, 0, notNull(pArray).length);
@@ -439,8 +441,8 @@ public final class CollectionUtil {
* @param pLength the number of elements to include in the iterator
* @return a new {@link ListIterator}
* @throws IllegalArgumentException if {@code pArray} is {@code null},
* {@code pStart < 0}, or
* {@code pLength > pArray.length - pStart}
* {@code pStart &lt; 0}, or
* {@code pLength &gt; pArray.length - pStart}
*/
public static <E> ListIterator<E> iterator(final E[] pArray, final int pStart, final int pLength) {
return new ArrayIterator<E>(pArray, pStart, pLength);

View File

@@ -32,7 +32,6 @@ package com.twelvemonkeys.util;
/**
* DuplicateHandler
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/DuplicateHandler.java#2 $

View File

@@ -38,10 +38,11 @@ import java.util.NoSuchElementException;
* element filtering. Each
* element is filtered against the given {@code Filter}, and only elements
* that are {@code accept}ed are returned by the {@code next} method.
* <p/>
* <p>
* The optional {@code remove} operation is implemented, but may throw
* {@code UnsupportedOperationException} if the underlying iterator does not
* support the remove operation.
* </p>
*
* @see FilterIterator.Filter
*

View File

@@ -41,7 +41,6 @@ import java.util.Map;
* if the keys used are {@code Strings}. If the keys
* used are not {@code String}s, it wil work as a normal
* {@code java.util.Map}.
* <p/>
*
* @see java.util.Map
*
@@ -61,11 +60,12 @@ public class IgnoreCaseMap<V> extends AbstractDecoratedMap<String, V> implements
* Constructs a new {@code Map} with the same key-value mappings as the
* given {@code Map}.
* The backing map will be a {@link java.util.HashMap}
* <p/>
* <p>
* NOTE: As the keys in the given map parameter will be converted to
* uppercase (if they are strings), any duplicate key/value pair where
* {@code key instanceof String && key.equalsIgnoreCase(otherKey)}
* is true, will be lost.
* </p>
*
* @param pMap the map whose mappings are to be placed in this map.
*/
@@ -76,14 +76,16 @@ public class IgnoreCaseMap<V> extends AbstractDecoratedMap<String, V> implements
/**
* Constructs a new {@code Map} with the same key-value mappings as the
* given {@code Map}.
* <p/>
* <p>
* NOTE: The backing map is structuraly cahnged, and it should NOT be
* accessed directly, after the wrapped map is created.
* <p/>
* </p>
* <p>
* NOTE: As the keys in the given map parameter will be converted to
* uppercase (if they are strings), any duplicate key/value pair where
* {@code key instanceof String && key.equalsIgnoreCase(otherKey)}
* is true, will be lost.
* </p>
*
* @param pBacking the backing map of this map. Must be either empty, or
* the same map as {@code pContents}.

View File

@@ -345,8 +345,6 @@ public class LinkedMap<K, V> extends AbstractDecoratedMap<K, V> implements Seria
}
/**
* @todo
*
* @return a copy of this map, with the same order and same key/value pairs.
*/
public Object clone() throws CloneNotSupportedException {
@@ -375,7 +373,7 @@ public class LinkedMap<K, V> extends AbstractDecoratedMap<K, V> implements Seria
* private static final int MAX_ENTRIES = 100;
*
* protected boolean removeEldestEntry(Map.Entry eldest) {
* return size() > MAX_ENTRIES;
* return size() &gt; MAX_ENTRIES;
* }
* </pre>
*

View File

@@ -39,7 +39,8 @@ import java.util.*;
* <p>
* Resembles {@code LinkedHashSet} from JDK 1.4+, but is backed by a generic
* {@code LinkedMap}, rather than implementing a particular algoritm.
* <p/>
* </p>
*
* @see LinkedMap
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -40,10 +40,11 @@ import java.util.Set;
* An (immutable) empty {@link Map}, that supports all {@code Map} operations
* without throwing exceptions (in contrast to {@link Collections#EMPTY_MAP}
* that will throw exceptions on {@code put}/{@code remove}).
* <p/>
* <p>
* NOTE: This is not a general purpose {@code Map} implementation,
* as the {@code put} and {@code putAll} methods will not modify the map.
* Instances of this class will always be an empty map.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: com/twelvemonkeys/util/NullMap.java#2 $

View File

@@ -35,8 +35,8 @@ package com.twelvemonkeys.util;
* as an int, counting seconds.
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @todo Milliseconds!
*/
// TODO: Milliseconds!
public class Time {
private int time = -1;
@@ -140,13 +140,13 @@ public class Time {
* <DD>m (or any multiple of m's)
* <DT>the minutes part (padded with 0's, if number has less digits than
* the number of m's)
* m -> 0,1,...,59,60,61,...
* mm -> 00,01,...,59,60,61,...
* m -&gt; 0,1,...,59,60,61,...
* mm -&gt; 00,01,...,59,60,61,...
* <DD>s or ss
* <DT>the seconds part (padded with 0's, if number has less digits than
* the number of s's)
* s -> 0,1,...,59
* ss -> 00,01,...,59
* s -&gt; 0,1,...,59
* ss -&gt; 00,01,...,59
* <DD>S
* <DT>all seconds (including the ones above 59)
* </DL>

View File

@@ -46,13 +46,13 @@ import java.util.Vector;
* <DD>m (or any multiple of m's)
* <DT>the minutes part (padded with 0's, if number has less digits than
* the number of m's)
* m -> 0,1,...,59,60,61,...
* mm -> 00,01,...,59,60,61,...
* m -&gt; 0,1,...,59,60,61,...
* mm -&gt; 00,01,...,59,60,61,...
* <DD>s or ss
* <DT>the seconds part (padded with 0's, if number has less digits than
* the number of s's)
* s -> 0,1,...,59
* ss -> 00,01,...,59
* s -&gt; 0,1,...,59
* ss -&gt; 00,01,...,59
* <DD>S
* <DT>all seconds (including the ones above 59)
* </DL>
@@ -60,10 +60,6 @@ import java.util.Vector;
* May not handle all cases, and formats... ;-)
* Safest is: Always delimiters between the minutes (m) and seconds (s) part.
* <P>
* TODO:
* Move to com.twelvemonkeys.text?
* Milliseconds!
* Fix bugs.
* Known bugs:
* <P>
* The last character in the formatString is not escaped, while it should be.
@@ -76,6 +72,10 @@ import java.util.Vector;
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
*/
// TODO:
// Move to com.twelvemonkeys.text?
// Milliseconds!
// Fix bugs.
public class TimeFormat extends Format {
final static String MINUTE = "m";
final static String SECOND = "s";

View File

@@ -37,8 +37,9 @@ import java.util.*;
* A {@code Map} implementation that removes (exipres) its elements after
* a given period. The map is by default backed by a {@link java.util.HashMap},
* or can be instantiated with any given {@code Map} as backing.
* <P/>
* <p>
* Notes to consider when using this map:
* </p>
* <ul>
* <li>Elements may not expire on the exact millisecond as expected.</li>
* <li>The value returned by the {@code size()} method of the map, or any of
@@ -52,14 +53,13 @@ import java.util.*;
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/TimeoutMap.java#2 $
*
* @todo Consider have this Map extend LinkedMap.. That way the removeExpired
* method only have to run from the first element, until it finds an element
* that should not expire, as elements are in insertion order.
* and next expiry time would be the time of the first element.
* @todo Consider running the removeExpiredEntries method in a separate (deamon) thread
* @todo - or document why it is not such a good idea.
*/
// TODO: Consider have this Map extend LinkedMap.. That way the removeExpired
// method only have to run from the first element, until it finds an element
// that should not expire, as elements are in insertion order.
// and next expiry time would be the time of the first element.
// TODO: Consider running the removeExpiredEntries method in a separate (deamon) thread
// TODO: - or document why it is not such a good idea.
public class TimeoutMap<K, V> extends AbstractDecoratedMap<K, V> implements ExpiringMap<K, V>, Serializable, Cloneable {
/**
* Expiry time
@@ -73,9 +73,10 @@ public class TimeoutMap<K, V> extends AbstractDecoratedMap<K, V> implements Expi
/**
* Creates a {@code TimeoutMap} with the default expiry time of 1 minute.
* This {@code TimeoutMap} will be backed by a new {@code HashMap} instance.
* <p/>
* <small>This is constructor is here to comply with the reccomendations for
* <p>
* <small>This is constructor is here to comply with the recommendations for
* "standard" constructors in the {@code Map} interface.</small>
* </p>
*
* @see #TimeoutMap(long)
*/
@@ -88,9 +89,10 @@ public class TimeoutMap<K, V> extends AbstractDecoratedMap<K, V> implements Expi
* with the default expiry time of 1 minute.
* This {@code TimeoutMap} will be backed by a new {@code HashMap} instance,
* and <em>not</em> the map passed in as a paramter.
* <p/>
* <small>This is constructor is here to comply with the reccomendations for
* <p>
* <small>This is constructor is here to comply with the recommendations for
* "standard" constructors in the {@code Map} interface.</small>
* </p>
*
* @param pContents the map whose mappings are to be placed in this map.
* May be {@code null}.
@@ -115,10 +117,11 @@ public class TimeoutMap<K, V> extends AbstractDecoratedMap<K, V> implements Expi
/**
* Creates a {@code TimeoutMap} with the given expiry time (milliseconds).
* This {@code TimeoutMap} will be backed by the given {@code Map}.
* <P/>
* <EM>Note that structurally modifying the backing map directly (not
* <p>
* <em>Note that structurally modifying the backing map directly (not
* through this map or its collection views), is not allowed, and will
* produce undeterministic exceptions.</EM>
* produce undeterministic exceptions.</em>
* </p>
*
* @param pBacking the map that will be used as backing.
* @param pContents the map whose mappings are to be placed in this map.
@@ -300,10 +303,9 @@ public class TimeoutMap<K, V> extends AbstractDecoratedMap<K, V> implements Expi
/**
* Okay, I guess this do resemble DCL...
*
* @todo Write some exhausting multi-threaded unit-tests.
*
* @param pTime now
*/
// TODO: Write some exhausting multi-threaded unit-tests.
private synchronized void removeExpiredEntriesSynced(long pTime) {
if (pTime > nextExpiryTime) {
////

View File

@@ -35,7 +35,6 @@ import java.util.Iterator;
/**
* TokenIterator, Iterator-based replacement for StringTokenizer.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/util/TokenIterator.java#1 $

View File

@@ -39,12 +39,13 @@ import java.util.Map;
/**
* The converter (singleton). Converts strings to objects and back.
* This is the entry point to the converter framework.
* <p/>
* <p>
* By default, converters for {@link com.twelvemonkeys.util.Time}, {@link Date}
* and {@link Object}
* (the {@link DefaultConverter}) are registered by this class' static
* initializer. You might remove them using the
* {@code unregisterConverter} method.
* </p>
*
* @see #registerConverter(Class, PropertyConverter)
* @see #unregisterConverter(Class)
@@ -105,12 +106,13 @@ public abstract class Converter implements PropertyConverter {
* Registers a converter for a given type.
* This converter will also be used for all subclasses, unless a more
* specific version is registered.
* </p>
* <p>
* By default, converters for {@link com.twelvemonkeys.util.Time}, {@link Date}
* and {@link Object}
* (the {@link DefaultConverter}) are registered by this class' static
* initializer. You might remove them using the
* {@code unregisterConverter} method.
* </p>
*
* @param pType the (super) type to register a converter for
* @param pConverter the converter

View File

@@ -41,9 +41,10 @@ import java.util.Locale;
/**
* Converts strings to dates and back.
* <p/>
* <p>
* <small>This class has a static cache of {@code DateFormats}, to avoid
* creation and parsing of date formats every time one is used.</small>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -38,12 +38,13 @@ import java.lang.reflect.InvocationTargetException;
/**
* Converts strings to objects and back.
* <p/>
* <p>
* This converter first tries to create an object, using the class' single
* string argument constructor ({@code &lt;type&gt;(String)}) if found,
* otherwise, an attempt to call
* the class' static {@code valueOf(String)} method. If both fails, a
* {@link ConversionException} is thrown.
* </p>
*
* @author <A href="haraldk@iconmedialab.no">Harald Kuhr</A>
* @author last modified by $Author: haku $

View File

@@ -43,9 +43,10 @@ import java.util.Map;
/**
* Converts strings to numbers and back.
* <p/>
* <p>
* <small>This class has a static cache of {@code NumberFormats}, to avoid
* creation and parsing of number formats every time one is used.</small>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -36,9 +36,10 @@ import com.twelvemonkeys.util.TimeFormat;
/**
* Converts strings to times and back.
* <p/>
* <p>
* <small>This class has a static cache of {@code TimeFormats}, to avoid creation and
* parsing of timeformats every time one is used.</small>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $

View File

@@ -40,7 +40,7 @@ import java.util.regex.PatternSyntaxException;
/**
* {@code StringTokenizer} replacement, that uses regular expressions to split
* strings into tokens.
* <p/>
*
*@see java.util.regex.Pattern for pattern syntax.
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -35,34 +35,32 @@ import java.io.PrintStream;
/**
* This class parses arbitrary strings against a wildcard string mask provided.
* The wildcard characters are '*' and '?'.
* <p/>
* <p>
* The string masks provided are treated as case sensitive.<br>
* Null-valued string masks as well as null valued strings to be parsed, will lead to rejection.
* <p/>
* <p/>
* <p/>
* </p>
* <p>
* <i>This class is custom designed for wildcard string parsing and is several times faster than the implementation based on the Jakarta Regexp package.</i>
* <p/>
* <p><hr style="height=1"><p>
* <p/>
* </p>
* <hr style="height=1">
* <p>
* This task is performed based on regular expression techniques.
* The possibilities of string generation with the well-known wildcard characters stated above,
* represent a subset of the possibilities of string generation with regular expressions.<br>
* The '*' corresponds to ([Union of all characters in the alphabet])*<br>
* The '?' corresponds to ([Union of all characters in the alphabet])<br>
* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<small>These expressions are not suited for textual representation at all, I must say. Is there any math tags included in HTML?</small>
* <p/>
* <p/>
* <p/>
* </p>
* <p>
* The complete meta-language for regular expressions are much larger.
* This fact makes it fairly straightforward to build data structures for parsing because the amount of rules of building these structures are quite limited, as stated below.
* <p/>
* <p/>
* <p/>
* </p>
* <p>
* To bring this over to mathematical terms:
* The parser ia a <b>nondeterministic finite automaton</b> (latin) representing the <b>grammar</b> which is stated by the string mask.
* The <b>language</b> accepted by this automaton is the set of all strings accepted by this automaton.<br>
* The formal automaton quintuple consists of:
* </p>
* <ol>
* <li>A finite set of <b>states</b>, depending on the wildcard string mask.
* For each character in the mask a state representing that character is created.
@@ -92,11 +90,11 @@ import java.io.PrintStream;
* Parsing faults must be reported to the author.
* </small>
* </ol>
* <p/>
* <p><hr style="height=1"><p>
* <p/>
* <hr style="height=1">
* <p>
* Examples of usage:<br>
* This example will return "Accepted!".
* </p>
* <pre>
* WildcardStringParser parser = new WildcardStringParser("*_28????.jp*");
* if (parser.parseString("gupu_280915.jpg")) {
@@ -105,12 +103,10 @@ import java.io.PrintStream;
* System.out.println("Not accepted!");
* }
* </pre>
* <p/>
* <p><hr style="height=1"><p>
* <p/>
* <hr style="height=1">
* <p>
* Theories and concepts are based on the book <i>Elements of the Theory of Computation</i>, by Harry l. Lewis and Christos H. Papadimitriou, (c) 1981 by Prentice Hall.
* <p/>
* <p/>
* </p>
*
* @author <a href="mailto:eirik.torske@iconmedialab.no">Eirik Torske</a>
* @deprecated Will probably be removed in the near future
@@ -146,7 +142,6 @@ public class WildcardStringParser {
/**
* Creates a wildcard string parser.
* <p/>
*
* @param pStringMask the wildcard string mask.
*/
@@ -156,7 +151,6 @@ public class WildcardStringParser {
/**
* Creates a wildcard string parser.
* <p/>
*
* @param pStringMask the wildcard string mask.
* @param pDebugging {@code true} will cause debug messages to be emitted to {@code System.out}.
@@ -167,7 +161,6 @@ public class WildcardStringParser {
/**
* Creates a wildcard string parser.
* <p/>
*
* @param pStringMask the wildcard string mask.
* @param pDebugging {@code true} will cause debug messages to be emitted.
@@ -313,7 +306,6 @@ public class WildcardStringParser {
/**
* Gets the string mask that was used when building the parser atomaton.
* <p/>
*
* @return the string mask used for building the parser automaton.
*/
@@ -323,7 +315,6 @@ public class WildcardStringParser {
/**
* Parses a string according to the rules stated above.
* <p/>
*
* @param pStringToParse the string to parse.
* @return {@code true} if and only if the string are accepted by the automaton.

View File

@@ -32,10 +32,11 @@ package com.twelvemonkeys.util.service;
/**
* An optional interface that may be implemented by service provider objects.
* <p/>
* <p>
* If this interface is implemented, the service provider objects will receive
* notification of registration and deregistration from the
* {@code ServiceRegistry}.
* </p>
*
* @see ServiceRegistry
*

View File

@@ -33,7 +33,7 @@ package com.twelvemonkeys.util.service;
/**
* Error thrown by the {@code ServiceRegistry} in case of a configuration
* error.
* <p/>
*
* @see ServiceRegistry
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>

View File

@@ -39,26 +39,32 @@ import java.util.*;
/**
* A registry for service provider objects.
* <p/>
* <p>
* Service providers are looked up from the classpath, under the path
* {@code META-INF/services/}&lt;full-class-name&gt;.
* <p/>
* For example:<br/>
* </p>
* <p>
* For example:
* <br>
* {@code META-INF/services/com.company.package.spi.MyService}.
* <p/>
* </p>
* <p>
* The file should contain a list of fully-qualified concrete class names,
* one per line.
* <p/>
* </p>
* <p>
* The <em>full-class-name</em> represents an interface or (typically) an
* abstract class, and is the same class used as the category for this registry.
* Note that only one instance of a concrete subclass may be registered with a
* specific category at a time.
* <p/>
* </p>
* <p>
* <small>Implementation detail: This class is a clean room implementation of
* a service registry and does not use the proprietary {@code sun.misc.Service}
* class that is referred to in the <em>JAR File specification</em>.
* This class should work on any Java platform.
* </small>
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: com/twelvemonkeys/util/service/ServiceRegistry.java#2 $
@@ -80,9 +86,10 @@ public class ServiceRegistry {
/**
* Creates a {@code ServiceRegistry} instance with a set of categories
* taken from the {@code pCategories} argument.
* <p/>
* <p>
* The categories are constant during the lifetime of the registry, and may
* not be changed after initial creation.
* </p>
*
* @param pCategories an {@code Iterator} containing
* {@code Class} objects that defines this registry's categories.
@@ -187,15 +194,17 @@ public class ServiceRegistry {
/**
* Returns an {@code Iterator} containing all providers in the given
* category.
* <p/>
* <p>
* The iterator supports removal.
* <p/>
* </p>
* <p>
* <small>
* NOTE: Removing a provider from the iterator, deregisters the current
* provider (as returned by the last invocation of {@code next()}) from
* {@code pCategory}, it does <em>not</em> remove the provider
* from other categories in the registry.
* </small>
* </p>
*
* @param pCategory the category class
* @return an {@code Iterator} containing all providers in the given
@@ -209,8 +218,9 @@ public class ServiceRegistry {
/**
* Returns an {@code Iterator} containing all categories in this registry.
* <p/>
* <p>
* The iterator does not support removal.
* </p>
*
* @return an {@code Iterator} containing all categories in this registry.
*/
@@ -221,8 +231,9 @@ public class ServiceRegistry {
/**
* Returns an {@code Iterator} containing all categories in this registry
* the given {@code pProvider} <em>may be registered with</em>.
* <p/>
* <p>
* The iterator does not support removal.
* </p>
*
* @param pProvider the provider instance
* @return an {@code Iterator} containing all categories in this registry
@@ -240,15 +251,17 @@ public class ServiceRegistry {
/**
* Returns an {@code Iterator} containing all categories in this registry
* the given {@code pProvider} <em>is currently registered with</em>.
* <p/>
* <p>
* The iterator supports removal.
* <p/>
* </p>
* <p>
* <small>
* NOTE: Removing a category from the iterator, de-registers
* {@code pProvider} from the current category (as returned by the last
* invocation of {@code next()}), it does <em>not</em> remove the category
* itself from the registry.
* </small>
* </p>
*
* @param pProvider the provider instance
* @return an {@code Iterator} containing all categories in this registry

View File

@@ -30,9 +30,10 @@
/**
* Provides a service provider registry.
* <p/>
* <p>
* This package contains a service provider registry, as specified in the
* <a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider">JAR File Specification</a>.
* </p>
*
* @see <a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider">JAR File Specification</a>
*/

View File

@@ -36,13 +36,12 @@ import java.util.Map;
/**
* BeanMapTestCase
* <p/>
* @todo Extend with BeanMap specific tests
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haku $
* @version $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/test/java/com/twelvemonkeys/util/BeanMapTestCase.java#2 $
*/
// TODO: Extend with BeanMap specific tests
public class BeanMapTest extends MapAbstractTest {
public boolean isPutAddSupported() {

View File

@@ -68,7 +68,6 @@ import java.util.Map;
/**
* Image reader for SVG document fragments.
* <p/>
*
* @author Harald Kuhr
* @author Inpspired by code from the Batik Team
@@ -255,9 +254,10 @@ public class SVGImageReader extends ImageReaderBase {
/**
* An image transcoder that stores the resulting image.
* <p/>
* <p>
* NOTE: This class includes a lot of copy and paste code from the Batik classes
* and needs major refactoring!
* </p>
*/
private class Rasterizer extends SVGAbstractTranscoder /*ImageTranscoder*/ {

View File

@@ -44,7 +44,6 @@ import static com.twelvemonkeys.imageio.util.IIOUtil.deregisterProvider;
/**
* SVGImageReaderSpi
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: SVGImageReaderSpi.java,v 1.1 2003/12/02 16:45:00 haku Exp $

View File

@@ -43,7 +43,6 @@ import static com.twelvemonkeys.imageio.plugins.wmf.WMFProviderInfo.WMF_READER_A
/**
* WMFImageReaderSpi
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: WMFImageReaderSpi.java,v 1.1 2003/12/02 16:45:00 wmhakur Exp $

View File

@@ -40,7 +40,6 @@ import java.util.Arrays;
/**
* Abstract base class for RLE decoding as specified by in the Windows BMP (aka DIB) file format.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: AbstractRLEDecoder.java#1 $

View File

@@ -231,10 +231,11 @@ abstract class DIBHeader {
/**
* OS/2 BitmapCoreHeader Version 2.
* <p/>
* <p>
* NOTE: According to the docs this header is <em>variable size</em>.
* However, it seems that the size is either 16, 40 or 64, which is covered
* (40 is the size of the normal {@link BitmapInfoHeader}, and has the same layout).
* </p>
*
* @see <a href="http://www.fileformat.info/format/os2bmp/egff.htm">OS/2 Bitmap File Format Summary</a>
*/
@@ -290,9 +291,10 @@ abstract class DIBHeader {
* Represents the DIB (Device Independent Bitmap) Windows 3.0 Bitmap Information header structure.
* This is the common format for persistent DIB structures, even if Windows
* may use the later versions at run-time.
* <p/>
* <p>
* Note: Some variations that includes the mask fields into the header size exists,
* but is no longer part of the documented spec.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: DIBHeader.java,v 1.0 25.feb.2006 00:29:44 haku Exp$

View File

@@ -48,14 +48,13 @@ import java.awt.image.*;
import java.io.File;
import java.io.IOException;
import java.nio.ByteOrder;
import java.util.*;
import java.util.List;
import java.util.*;
/**
* ImageReader for Microsoft Windows ICO (icon) format.
* 1, 4, 8 bit palette support with bitmask transparency, and 16, 24 and 32 bit
* true color support with alpha. Also supports Windows Vista PNG encoded icons.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: ICOImageReader.java,v 1.0 25.feb.2006 00:29:44 haku Exp$

View File

@@ -37,7 +37,6 @@ import java.util.List;
/**
* Directory
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: Directory.java,v 1.0 25.feb.2006 00:29:44 haku Exp$

View File

@@ -36,7 +36,6 @@ import java.util.Arrays;
/**
* Implements 4 bit RLE decoding as specified by in the Windows BMP (aka DIB) file format.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: RLE4Decoder.java#1 $

View File

@@ -36,7 +36,6 @@ import java.util.Arrays;
/**
* Implements 8 bit RLE decoding as specified by in the Windows BMP (aka DIB) file format.
* <p/>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @version $Id: RLE8Decoder.java#1 $

View File

@@ -72,12 +72,13 @@ public abstract class ImageReaderBase extends ImageReader {
/**
* Constructs an {@code ImageReader} and sets its
* {@code originatingProvider} field to the supplied value.
* <p/>
* <p> Subclasses that make use of extensions should provide a
* <p>
* Subclasses that make use of extensions should provide a
* constructor with signature {@code (ImageReaderSpi,
* Object)} in order to retrieve the extension object. If
* the extension object is unsuitable, an
* {@code IllegalArgumentException} should be thrown.
* </p>
*
* @param provider the {@code ImageReaderSpi} that is invoking this constructor, or {@code null}.
*/
@@ -205,9 +206,10 @@ public abstract class ImageReaderBase extends ImageReader {
/**
* Returns the {@code BufferedImage} to which decoded pixel data should be written.
* <p/>
* <p>
* As {@link javax.imageio.ImageReader#getDestination} but tests if the explicit destination
* image (if set) is valid according to the {@code ImageTypeSpecifier}s given in {@code types}.
* </p>
*
* @param param an {@code ImageReadParam} to be used to get
* the destination image or image type, or {@code null}.
@@ -328,9 +330,10 @@ public abstract class ImageReaderBase extends ImageReader {
* Utility method for getting the area of interest (AOI) of an image.
* The AOI is defined by the {@link javax.imageio.IIOParam#setSourceRegion(java.awt.Rectangle)}
* method.
* <p/>
* <p>
* Note: If it is possible for the reader to read the AOI directly, such a
* method should be used instead, for efficiency.
* </p>
*
* @param pImage the image to get AOI from
* @param pParam the param optionally specifying the AOI
@@ -348,12 +351,14 @@ public abstract class ImageReaderBase extends ImageReader {
* The subsampling is defined by the
* {@link javax.imageio.IIOParam#setSourceSubsampling(int, int, int, int)}
* method.
* <p/>
* <p>
* NOTE: This method does not take the subsampling offsets into
* consideration.
* <p/>
* </p>
* <p>
* Note: If it is possible for the reader to subsample directly, such a
* method should be used instead, for efficiency.
* </p>
*
* @param pImage the image to subsample
* @param pParam the param optionally specifying subsampling

View File

@@ -60,12 +60,13 @@ public abstract class ImageWriterBase extends ImageWriter {
* Constructs an {@code ImageWriter} and sets its
* {@code originatingProvider} instance variable to the
* supplied value.
* <p/>
* <p> Subclasses that make use of extensions should provide a
* <p>
* Subclasses that make use of extensions should provide a
* constructor with signature {@code (ImageWriterSpi,
* Object)} in order to retrieve the extension object. If
* the extension object is unsuitable, an
* {@code IllegalArgumentException} should be thrown.
* </p>
*
* @param provider the {@code ImageWriterSpi} that is constructing this object, or {@code null}.
*/
@@ -145,9 +146,10 @@ public abstract class ImageWriterBase extends ImageWriter {
* Utility method for getting the area of interest (AOI) of an image.
* The AOI is defined by the {@link javax.imageio.IIOParam#setSourceRegion(java.awt.Rectangle)}
* method.
* <p/>
* <p>
* Note: If it is possible for the writer to write the AOI directly, such a
* method should be used instead, for efficiency.
* </p>
*
* @param pImage the image to get AOI from
* @param pParam the param optionally specifying the AOI
@@ -165,12 +167,14 @@ public abstract class ImageWriterBase extends ImageWriter {
* The subsampling is defined by the
* {@link javax.imageio.IIOParam#setSourceSubsampling(int, int, int, int)}
* method.
* <p/>
* <p>
* NOTE: This method does not take the subsampling offsets into
* consideration.
* <p/>
* </p>
* <p>
* Note: If it is possible for the writer to subsample directly, such a
* method should be used instead, for efficiency.
* </p>
*
* @param pImage the image to subsample
* @param pParam the param optionally specifying subsampling

View File

@@ -50,10 +50,11 @@ import java.util.Properties;
/**
* A helper class for working with ICC color profiles and color spaces.
* <p />
* <p>
* Standard ICC color profiles are read from system-specific locations
* for known operating systems.
* <p />
* </p>
* <p>
* Color profiles may be configured by placing a property-file
* {@code com/twelvemonkeys/imageio/color/icc_profiles.properties}
* on the classpath, specifying the full path to the profiles.
@@ -61,8 +62,10 @@ import java.util.Properties;
* can be downloaded from
* <a href="http://www.color.org/profiles2.xalter">ICC</a>,
* <a href="http://www.adobe.com/downloads/">Adobe</a> or other places.
* <p />
* * </p>
* <p>
* Example property file:
* </p>
* <pre>
* # icc_profiles.properties
* ADOBE_RGB_1998=/path/to/Adobe RGB 1998.icc
@@ -117,9 +120,10 @@ public final class ColorSpaces {
/**
* Creates an ICC color space from the given ICC color profile.
* <p />
* <p>
* For standard Java color spaces, the built-in instance is returned.
* Otherwise, color spaces are looked up from cache and created on demand.
* </p>
*
* @param profile the ICC color profile. May not be {@code null}.
* @return an ICC color space
@@ -245,11 +249,12 @@ public final class ColorSpaces {
/**
* Tests whether an ICC color profile is known to cause problems for {@link java.awt.image.ColorConvertOp}.
* <p />
* <p>
* <em>
* Note that this method only tests if a color conversion using this profile is known to fail.
* There's no guarantee that the color conversion will succeed even if this method returns {@code false}.
* </em>
* </p>
*
* @param profile the ICC color profile. May not be {@code null}.
* @return {@code true} if known to be offending, {@code false} otherwise
@@ -277,11 +282,12 @@ public final class ColorSpaces {
/**
* Tests whether an ICC color profile is valid.
* Invalid profiles are known to cause problems for {@link java.awt.image.ColorConvertOp}.
* <p />
* <p>
* <em>
* Note that this method only tests if a color conversion using this profile is known to fail.
* There's no guarantee that the color conversion will succeed even if this method returns {@code false}.
* </em>
* </p>
*
* @param profile the ICC color profile. May not be {@code null}.
* @return {@code profile} if valid.
@@ -298,9 +304,10 @@ public final class ColorSpaces {
/**
* Returns the color space specified by the given color space constant.
* <p />
* <p>
* For standard Java color spaces, the built-in instance is returned.
* Otherwise, color spaces are looked up from cache and created on demand.
* </p>
*
* @param colorSpace the color space constant.
* @return the {@link ColorSpace} specified by the color space constant.

View File

@@ -38,9 +38,10 @@ import java.io.InputStream;
/**
* IIOInputStreamAdapter
* <p/>
* <p>
* Note: You should always wrap this stream in a {@code BufferedInputStream}.
* If not, performance may degrade significantly.
* </p>
*
* @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a>
* @author last modified by $Author: haraldk$

Some files were not shown because too many files have changed in this diff Show More