Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sixlegs.image.png
Class AbstractTextChunk  view AbstractTextChunk download AbstractTextChunk.java

java.lang.Object
  extended bycom.sixlegs.image.png.Chunk
      extended bycom.sixlegs.image.png.KeyValueChunk
          extended bycom.sixlegs.image.png.AbstractTextChunk
All Implemented Interfaces:
java.lang.Cloneable, TextChunk
Direct Known Subclasses:
Chunk_iTXt, Chunk_tEXt, Chunk_zTXt

abstract class AbstractTextChunk
extends KeyValueChunk
implements TextChunk


Field Summary
(package private) static int bKGD
           
(package private) static int cHRM
           
(package private) static int gAMA
           
(package private) static int gIFg
           
(package private) static int gIFx
           
(package private) static int hIST
           
(package private) static int iCCP
           
(package private) static int IDAT
           
(package private) static int IEND
           
(package private) static int IHDR
           
protected  PngImage img
           
protected  ExDataInputStream in_data
           
(package private) static int iTXt
           
protected  java.lang.String key
           
(package private)  int length
           
(package private) static int oFFs
           
(package private) static int pCAL
           
(package private) static int pHYs
           
(package private) static int PLTE
           
(package private) static int sBIT
           
(package private) static int sCAL
           
private static java.util.Hashtable special_keys
           
(package private) static int sPLT
           
(package private) static int sRGB
           
(package private) static int tEXt
           
(package private) static int tIME
           
(package private) static int tRNS
           
(package private)  int type
           
protected  java.lang.String value
           
(package private) static int zTXt
           
 
Constructor Summary
(package private) AbstractTextChunk(int type)
           
 
Method Summary
(package private)  void badLength()
           
(package private)  void badLength(int correct)
           
protected  boolean beforeIDAT()
           
(package private)  int bytesRemaining()
           
(package private)  Chunk copy()
           
 java.lang.String getChunkType()
          Returns the original chunk type of this TextChunk: "tEXt", "zTXt", or "iTXt".
protected  java.lang.String getEncoding()
           
 java.lang.String getKeyword()
          Returns the Latin-1 [ISO-8859-1] encoded keyword of this TextChunk.
abstract  java.lang.String getLanguage()
          Returns the language [RFC-1766] used by the translated keyword and the text, or null if unspecified.
 java.lang.String getText()
          Returns the text of this TextChunk.
abstract  java.lang.String getTranslatedKeyword()
          Returns a translation of the keyword into the language used by this TextChunk, or null if unspecified.
(package private)  boolean isAncillary()
           
protected abstract  boolean isCompressed()
           
(package private)  boolean isPrivate()
           
(package private)  boolean isReservedSet()
           
(package private)  boolean isSafeToCopy()
           
(package private)  boolean isUnknown()
           
protected  boolean multipleOK()
           
protected  void readData()
           
protected  java.lang.String readKey()
           
protected  java.lang.String readValue()
           
(package private) static java.lang.String repairKey(java.lang.String k)
           
private static java.lang.String repairValue(java.lang.String val)
           
(package private) static int stringToType(java.lang.String id)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
(package private) static java.lang.String typeToString(int x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

special_keys

private static java.util.Hashtable special_keys

key

protected java.lang.String key

value

protected java.lang.String value

length

int length

type

int type

img

protected PngImage img

in_data

protected ExDataInputStream in_data

IHDR

static final int IHDR
See Also:
Constant Field Values

PLTE

static final int PLTE
See Also:
Constant Field Values

IDAT

static final int IDAT
See Also:
Constant Field Values

IEND

static final int IEND
See Also:
Constant Field Values

bKGD

static final int bKGD
See Also:
Constant Field Values

cHRM

static final int cHRM
See Also:
Constant Field Values

gAMA

static final int gAMA
See Also:
Constant Field Values

hIST

static final int hIST
See Also:
Constant Field Values

pHYs

static final int pHYs
See Also:
Constant Field Values

sBIT

static final int sBIT
See Also:
Constant Field Values

tEXt

static final int tEXt
See Also:
Constant Field Values

tIME

static final int tIME
See Also:
Constant Field Values

tRNS

static final int tRNS
See Also:
Constant Field Values

zTXt

static final int zTXt
See Also:
Constant Field Values

sRGB

static final int sRGB
See Also:
Constant Field Values

sPLT

static final int sPLT
See Also:
Constant Field Values

oFFs

static final int oFFs
See Also:
Constant Field Values

sCAL

static final int sCAL
See Also:
Constant Field Values

iCCP

static final int iCCP
See Also:
Constant Field Values

pCAL

static final int pCAL
See Also:
Constant Field Values

iTXt

static final int iTXt
See Also:
Constant Field Values

gIFg

static final int gIFg
See Also:
Constant Field Values

gIFx

static final int gIFx
See Also:
Constant Field Values
Constructor Detail

AbstractTextChunk

AbstractTextChunk(int type)
Method Detail

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getKeyword

public java.lang.String getKeyword()
Description copied from interface: TextChunk
Returns the Latin-1 [ISO-8859-1] encoded keyword of this TextChunk.

Specified by:
getKeyword in interface TextChunk

getText

public java.lang.String getText()
Description copied from interface: TextChunk
Returns the text of this TextChunk.

Specified by:
getText in interface TextChunk

getTranslatedKeyword

public abstract java.lang.String getTranslatedKeyword()
Description copied from interface: TextChunk
Returns a translation of the keyword into the language used by this TextChunk, or null if unspecified.

Specified by:
getTranslatedKeyword in interface TextChunk

getLanguage

public abstract java.lang.String getLanguage()
Description copied from interface: TextChunk
Returns the language [RFC-1766] used by the translated keyword and the text, or null if unspecified.

Specified by:
getLanguage in interface TextChunk

readKey

protected java.lang.String readKey()
                            throws java.io.IOException
Overrides:
readKey in class KeyValueChunk

readValue

protected java.lang.String readValue()
                              throws java.io.IOException
Overrides:
readValue in class KeyValueChunk

repairValue

private static java.lang.String repairValue(java.lang.String val)

getChunkType

public java.lang.String getChunkType()
Description copied from interface: TextChunk
Returns the original chunk type of this TextChunk: "tEXt", "zTXt", or "iTXt".

Specified by:
getChunkType in interface TextChunk

isCompressed

protected abstract boolean isCompressed()

getEncoding

protected java.lang.String getEncoding()

readData

protected void readData()
                 throws java.io.IOException
Overrides:
readData in class Chunk

repairKey

static java.lang.String repairKey(java.lang.String k)

copy

Chunk copy()

isAncillary

boolean isAncillary()

isPrivate

final boolean isPrivate()

isReservedSet

final boolean isReservedSet()

isSafeToCopy

final boolean isSafeToCopy()

isUnknown

final boolean isUnknown()

bytesRemaining

int bytesRemaining()

multipleOK

protected boolean multipleOK()

beforeIDAT

protected boolean beforeIDAT()

typeToString

static java.lang.String typeToString(int x)

stringToType

static int stringToType(java.lang.String id)

badLength

final void badLength(int correct)
              throws PngException

badLength

final void badLength()
              throws PngException