|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.flatfile.EntitySupport
org.apache.commons.flatfile.FieldSupport
org.apache.commons.flatfile.PadJustifyFieldSupport
org.apache.commons.flatfile.DynamicField
public class DynamicField
Dynamically-resizable field. Supports pad/justify, but only relevant when an assigned value is too small for the field AND underflow == IGNORE.
| Nested Class Summary | |
|---|---|
static class |
DynamicField.Bounds
Bounds |
| Nested classes/interfaces inherited from class org.apache.commons.flatfile.PadJustifyFieldSupport |
|---|
PadJustifyFieldSupport.Justify |
| Nested classes/interfaces inherited from class org.apache.commons.flatfile.FieldSupport |
|---|
FieldSupport.Overflow, FieldSupport.Underflow |
| Constructor Summary | |
|---|---|
DynamicField()
Create a new DynamicField. |
|
DynamicField(DynamicField.Bounds bounds)
Create a new DynamicField. |
|
| Method Summary | |
|---|---|
DynamicField |
clone()
Clone oneself. |
boolean |
equals(Object other)
|
DynamicField.Bounds |
getBounds()
Get the bounds. |
FieldSupport.Overflow |
getOverflow()
Get the overflow. |
protected int |
getPadJustifyLength()
Provide the desired target length for padding/justification actions. |
FieldSupport.Underflow |
getUnderflow()
Get the underflow. |
byte[] |
getValue()
Get the value of this Entity. |
int |
hashCode()
|
protected void |
iSetValue(byte[] value)
Protected inner setValue |
int |
length()
Get the length of this Entity. |
void |
readFrom(InputStream is)
Read up to maximumLength bytes from the specified InputStream or stop at EOF. |
void |
setBounds(DynamicField.Bounds bounds)
Set the bounds. |
void |
setOverflow(FieldSupport.Overflow overflow)
Set the overflow. |
void |
setUnderflow(FieldSupport.Underflow underflow)
Set the underflow. |
void |
setValue(byte[] b)
Implement pad/justify. |
void |
writeTo(OutputStream os)
Write value to an OutputStream. |
| Methods inherited from class org.apache.commons.flatfile.PadJustifyFieldSupport |
|---|
getJustify, getPad, setJustify, setPad |
| Methods inherited from class org.apache.commons.flatfile.FieldSupport |
|---|
dieOnExceptionRead |
| Methods inherited from class org.apache.commons.flatfile.EntitySupport |
|---|
fill, getValue, setValue |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DynamicField()
public DynamicField(DynamicField.Bounds bounds)
bounds - bounds| Method Detail |
|---|
public byte[] getValue()
public int length()
public void readFrom(InputStream is)
throws IOException
maximumLength bytes from the specified InputStream or stop at EOF. This will rarely be
what you want. Instead, consider using InputFilteringDynamicField. In the case that <
minimumLength bytes are available from is the justify and
pad options come into play.
is - the InputStream from which to read data.
IOException - on problems with I/O, duh...public void setValue(byte[] b)
setValue in interface EntitysetValue in class PadJustifyFieldSupportb - value set
public void writeTo(OutputStream os)
throws IOException
os - to write to
IOException - on errorpublic FieldSupport.Overflow getOverflow()
public void setOverflow(FieldSupport.Overflow overflow)
overflow - Overflowpublic FieldSupport.Underflow getUnderflow()
public void setUnderflow(FieldSupport.Underflow underflow)
underflow - Underflowpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectprotected int getPadJustifyLength()
getPadJustifyLength in class PadJustifyFieldSupportprotected void iSetValue(byte[] value)
value - byte[]public DynamicField clone()
clone in interface Entityclone in class EntitySupportpublic DynamicField.Bounds getBounds()
public void setBounds(DynamicField.Bounds bounds)
bounds - Bounds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||