public class MemoryAllocatedElement extends RecordingStrategiesElement implements Poolable<MemoryAllocatedElement>
| Modifier and Type | Field and Description |
|---|---|
private long |
id
Stores the id.
|
static ObjectPool<MemoryAllocatedElement> |
POOL
Defines an object pool for this class.
|
private java.lang.String |
recId
Stores the recId.
|
private long |
size
Stores the size.
|
private long |
threadId
Stores the identification of the calling thread.
|
| Constructor and Description |
|---|
MemoryAllocatedElement()
Creates a new empty instance.
|
MemoryAllocatedElement(java.lang.String recId,
long threadId,
long id,
long size)
Creates a new instance with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
If a pool is used this method is for releasing the element from the pool.
|
MemoryAllocatedElement |
create()
Creates a further instance of this instances (intended as factory method
to be executed on a prototypical instance).
|
int |
getIdentification()
Returns the unambiguous identification of the element.
|
java.lang.String |
getRecId()
Getter for the recId.
|
long |
getSize()
Getter for the size.
|
void |
process(RecorderStrategy strategy)
Hands the information of the element to the
RecorderStrategy. |
void |
read(java.io.DataInputStream in)
Reads this instance from the given input stream.
|
void |
release()
Release this element from the pool if this instance is
Poolable. |
void |
send(java.io.DataOutputStream out)
Writes this instance to the given output stream.
|
void |
setData(java.lang.String recId,
long threadId,
long id,
long size)
Setter for the recId.
|
void |
setSize(long size)
Setter for the size.
|
public static final ObjectPool<MemoryAllocatedElement> POOL
private java.lang.String recId
private long id
private long size
private long threadId
MemoryAllocatedElement()
public MemoryAllocatedElement(java.lang.String recId,
long threadId,
long id,
long size)
recId - the recIdthreadId - the identification of the calling threadid - the internal object-specific idsize - the sizepublic java.lang.String getRecId()
public void setData(java.lang.String recId,
long threadId,
long id,
long size)
recId - the recIdthreadId - the identification of the calling threadid - the internal object-specific idsize - the sizepublic long getSize()
public void setSize(long size)
size - the size to setpublic void send(java.io.DataOutputStream out)
throws java.io.IOException
send in class RecordingStrategiesElementout - the output streamjava.io.IOException - in case of any I/O error or problempublic void read(java.io.DataInputStream in)
throws java.io.IOException
read in class RecordingStrategiesElementin - the input streamjava.io.IOException - in case of any I/O error or problempublic int getIdentification()
getIdentification in class RecordingStrategiesElementpublic void process(RecorderStrategy strategy)
RecorderStrategy.process in class RecordingStrategiesElementstrategy - the RecorderStrategypublic void clear()
clear in interface Poolable<MemoryAllocatedElement>clear in class RecordingStrategiesElementpublic MemoryAllocatedElement create()
create in interface Poolable<MemoryAllocatedElement>public void release()
Poolable.release in class RecordingStrategiesElement