public class DynamicField extends PadJustifyFieldSupport
Modifier and Type | Class and Description |
---|---|
static class |
DynamicField.Bounds
Bounds
|
PadJustifyFieldSupport.Justify
FieldSupport.Overflow, FieldSupport.Underflow
DEFAULT_PAD
Constructor and Description |
---|
DynamicField()
Create a new DynamicField.
|
DynamicField(DynamicField.Bounds bounds)
Create a new DynamicField.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getJustify, getPad, setJustify, setPad
dieOnExceptionRead
fill, getValue, setValue
public DynamicField()
public DynamicField(DynamicField.Bounds bounds)
bounds
- boundspublic 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 Entity
setValue
in class PadJustifyFieldSupport
b
- value setpublic void writeTo(OutputStream os) throws IOException
os
- to write toIOException
- on errorpublic FieldSupport.Overflow getOverflow()
public void setOverflow(FieldSupport.Overflow overflow)
overflow
- Overflowpublic FieldSupport.Underflow getUnderflow()
public void setUnderflow(FieldSupport.Underflow underflow)
underflow
- Underflowprotected int getPadJustifyLength()
getPadJustifyLength
in class PadJustifyFieldSupport
protected void iSetValue(byte[] value)
value
- byte[]public DynamicField clone()
clone
in interface Entity
clone
in class EntitySupport
public DynamicField.Bounds getBounds()
public void setBounds(DynamicField.Bounds bounds)
bounds
- BoundsCopyright © 2008-2016 The Apache Software Foundation. All Rights Reserved.