diff options
author | Javen O'Neal <onealj@apache.org> | 2016-04-17 08:42:26 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-04-17 08:42:26 +0000 |
commit | d22bb45dfc0e5a736cbbf2e3defbb0923b0388ea (patch) | |
tree | 88dfda1ddf596bf896d5e4dad830e10e04593385 /src/java | |
parent | 4d4db5019cb8b870bc890c24e8e74da19099aa0d (diff) | |
download | poi-d22bb45dfc0e5a736cbbf2e3defbb0923b0388ea.tar.gz poi-d22bb45dfc0e5a736cbbf2e3defbb0923b0388ea.zip |
add comments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1739554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/hssf/util/HSSFColor.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/hssf/util/HSSFColor.java b/src/java/org/apache/poi/hssf/util/HSSFColor.java index f6af086580..ea4b3e2783 100644 --- a/src/java/org/apache/poi/hssf/util/HSSFColor.java +++ b/src/java/org/apache/poi/hssf/util/HSSFColor.java @@ -177,35 +177,49 @@ public class HSSFColor implements Color { } /** + * returns color standard palette index (0x08) * @return index to the standard palette */ public short getIndex() { + // this will be overridden by the specific color subclass return BLACK.index; } /** + * returns RGB triplet (0, 0, 0) * @return triplet representation like that in Excel */ public short [] getTriplet() { + // this will be overridden by the specific color subclass return BLACK.triplet; } - // its a hack but its a good hack - /** + * returns colon-delimited hex string "0:0:0" * @return a hex string exactly like a gnumeric triplet */ public String getHexString() { + // this will be overridden by the specific color subclass return BLACK.hexString; } + /** + * Checked type cast <tt>color</tt> to an HSSFColor. + * + * @param color the color to type cast + * @return the type casted color + * @throws IllegalArgumentException if color is null or is not an instance of HSSFColor + */ public static HSSFColor toHSSFColor(Color color) { + // FIXME: this method would be more useful if it could convert any Color to an HSSFColor + // Currently the only benefit of this method is to throw an IllegalArgumentException + // instead of a ClassCastException. if (color != null && !(color instanceof HSSFColor)) { throw new IllegalArgumentException("Only HSSFColor objects are supported"); } |