org.apache.commons.flatfile
Class EntitySupport

java.lang.Object
  extended by org.apache.commons.flatfile.EntitySupport
All Implemented Interfaces:
Serializable, Cloneable, Entity
Direct Known Subclasses:
EntityCollectionSupport, FieldSupport

public abstract class EntitySupport
extends Object
implements Entity

Generic entity support stuff.

Version:
$Revision: 757266 $ $Date: 2009-03-22 17:12:27 -0500 (Sun, 22 Mar 2009) $
See Also:
Serialized Form

Constructor Summary
EntitySupport()
           
 
Method Summary
 EntitySupport clone()
          Clone oneself.
 void fill(byte b)
          Fill this entity's value with all b.
 byte[] getValue(int offset, int length)
          Get a subset of this Entity's value.
 void setValue(byte[] b, int offset, int length)
          Set this Entity's value to a subset of the specified byte[].
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.flatfile.Entity
getValue, length, readFrom, setValue, writeTo
 

Constructor Detail

EntitySupport

public EntitySupport()
Method Detail

fill

public void fill(byte b)
          throws IOException
Fill this entity's value with all b.

Specified by:
fill in interface Entity
Parameters:
b - value
Throws:
IOException - on error

clone

public EntitySupport clone()
Clone oneself.

Specified by:
clone in interface Entity
Overrides:
clone in class Object
Returns:
a deep (or otherwise "safe") copy of this Entity.

getValue

public byte[] getValue(int offset,
                       int length)
Get a subset of this Entity's value.

Specified by:
getValue in interface Entity
Parameters:
offset - to start
length - to extend
Returns:
byte[]

setValue

public void setValue(byte[] b,
                     int offset,
                     int length)
Set this Entity's value to a subset of the specified byte[].

Specified by:
setValue in interface Entity
Parameters:
b - byte[]
offset - int
length - int


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.