|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrebuild.graphics.tiff.Tag
public abstract class Tag
The abstract tag that will be used in TIFFs.
Field Summary | |
---|---|
protected long |
count
|
protected java.lang.Object |
data
|
protected short |
dataType
|
protected long |
value
|
Constructor Summary | |
---|---|
protected |
Tag(short tag,
short dataType,
int count,
int value,
java.lang.Object data)
Create a new Tag . |
protected |
Tag(short tag,
short dataType,
long count,
long value,
java.lang.Object data)
Create a new Tag . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determine if an Object is the same as this Tag . |
protected abstract boolean |
extraData(boolean big)
This method figures out if any extra data is exists, this method can search the data type, extra data, value, and count. |
long |
getBigCount()
Get the number of values contained in this tag. |
long |
getBigValue()
Get the left-justified value that the tag contains, any values that do not fit in a 8 byte boundary should have it's value stored in data . |
int |
getCount()
Get the number of values contained in this tag. |
short |
getDataType()
Get the data type. |
java.lang.Object |
getExtraData()
Get any extra data that the tag contains, that is any data that does not fit into 4/8 bytes. |
boolean |
getIfExtraDataExists(boolean big)
Get if the tag contains extra data. |
short |
getTagType()
Get the tag type. |
static short |
getTagTypeValue()
Get the Tag 's type. |
int |
getValue()
Get the left-justified value that the tag contains, any values that do not fit in a 4 byte boundary should have it's value stored in data . |
abstract boolean |
hasDefault()
Get if this Tag can have a default value, often defined by a parameter-less constructor. |
int |
hashCode()
|
abstract boolean |
isDefault()
Get if this Tag 's current value is the default value. |
void |
setCount(int count)
Set the number of values contained in this tag. |
void |
setCount(long count)
Set the number of values contained in this tag. |
void |
setDataType(short dataType)
Set the data type. |
protected void |
setExtraData(java.lang.Object obj)
Set any extra data that the tag should contain. |
protected abstract void |
setupForBigTIFF(boolean set)
Setup/un-setup the tag for use in BigTIFF. |
void |
setValue(int value)
Set the left-justified value that the tag contains. |
void |
setValue(long value)
Set the left-justified value that the tag contains. |
java.lang.String |
toString()
|
void |
write(Writer wr)
Write the tag to a Writer . |
void |
write(Writer wr,
int offset)
Write the tag to a Writer . |
void |
write(Writer wr,
long offset)
Write the tag to a Writer . |
void |
write(Writer wr,
long offset,
boolean big)
Write the tag to a Writer . |
void |
writeBig(Writer wr)
Write the tag to a Writer . |
abstract void |
writeData(Writer wr)
The extra data writer, if any extra data exists then this method will be called and (through internal methods) a offset to the data will be used in place of the value parameter. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected short dataType
protected long count
protected long value
protected java.lang.Object data
Constructor Detail |
---|
protected Tag(short tag, short dataType, int count, int value, java.lang.Object data)
Tag
.
tag
- The tag code for this tag.dataType
- The type of data that will be written.count
- The number of items that will be written. Note this is not the number of bytes to write but the number of items.value
- The value that this tag has. The tag must always be left justified, so if a Writer.SHORT
is to be written then it's value must be value << 16. If the tag contains any data bigger then 4 bytes then it must be set in data
and this value will be ignored.data
- Any data that does not fit in the 4 byte value
parameter.protected Tag(short tag, short dataType, long count, long value, java.lang.Object data)
Tag
.
tag
- The tag code for this tag.dataType
- The type of data that will be written.count
- The number of items that will be written. Note this is not the number of bytes to write but the number of items.value
- The value that this tag has. The tag must always be left justified, so if a Writer.SHORT
is to be written then it's value must be value << 16. If the tag contains any data bigger then 4 bytes then it must be set in data
and this value will be ignored.data
- Any data that does not fit in the 8 byte value
parameter.Method Detail |
---|
public final void write(Writer wr) throws java.io.IOException
Writer
. This should only be called if no extra data exists else the tag will not be written.
wr
- The writer to write the tag to.
java.io.IOException
- If any IO exception occurs.public final void writeBig(Writer wr) throws java.io.IOException
Writer
. This should only be called if no extra data exists else the tag will not be written.
wr
- The writer to write the tag to.
java.io.IOException
- If any IO exception occurs.public final void write(Writer wr, long offset) throws java.io.IOException
Writer
.
wr
- The writer to write the tag to.offset
- The absolute offset to write instead of the value
data. If the value
should be written then -1
should be passed here.
java.io.IOException
- If any IO exception occurs.public final void write(Writer wr, int offset) throws java.io.IOException
Writer
.
wr
- The writer to write the tag to.offset
- The absolute offset to write instead of the value
data. If the value
should be written then -1
should be passed here.
java.io.IOException
- If any IO exception occurs.public final void write(Writer wr, long offset, boolean big) throws java.io.IOException
Writer
.
wr
- The writer to write the tag to.offset
- The absolute offset to write instead of the value
data. If the value
should be written then -1
should be passed here.big
- If this is writing a BigTIFF tag.
java.io.IOException
- If any IO exception occurs.public final short getTagType()
public final short getDataType()
Writer
public void setDataType(short dataType)
dataType
- The data type to set.Writer
public final int getCount()
value
parameter, else it is in the data
parameter.
public final long getBigCount()
value
parameter, else it is in the data
parameter.
public void setCount(int count)
count
- The number of values contained in the tag.getCount
public void setCount(long count)
count
- The number of values contained in the tag.getCount
public final int getValue()
data
.
public final long getBigValue()
data
.
public void setValue(int value)
value
- The value that the tag should contains.getValue
public void setValue(long value)
value
- The value that the tag should contains.getValue
public final java.lang.Object getExtraData()
value
parameter AND the extra data, it is one or the other.
protected void setExtraData(java.lang.Object obj)
obj
- The extra data that the tag should contain.getExtraData
public final boolean getIfExtraDataExists(boolean big)
big
- true
if the tag is being written to a BigTIFF, false
if otherwise.
public abstract void writeData(Writer wr) throws java.io.IOException
value
parameter.
wr
- The writer used to write the extra data.
java.io.IOException
- If any IO exception occurs.protected abstract boolean extraData(boolean big)
big
- true
if the tag is being written to a BigTIFF, false
if otherwise.
protected abstract void setupForBigTIFF(boolean set)
set
- true
if the tag should be preped for BigTIFF, false
if otherwise.public abstract boolean hasDefault()
Tag
can have a default value, often defined by a parameter-less constructor.
true
if the Tag
has a default value, false
if otherwise. Default is false
.public abstract boolean isDefault()
Tag
's current value is the default value. This is ignored if hasDefault()
returns false
.
true
if the Tag
's value is the default value, false
if otherwise.public static short getTagTypeValue()
Tag
's type.
Tag
's type.public boolean equals(java.lang.Object obj)
Object
is the same as this Tag
.
equals
in class java.lang.Object
obj
- The Object
to compare.
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |