|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Common.Cache.DataBinsCacheManagement
public class DataBinsCacheManagement
This class implements some useful method fo the maganement of a databin cache.
| Field Summary | |
|---|---|
protected CODParameters |
codParameters
Definition in JPCParameters.codParameters. |
static int |
EXPLICIT_FORM
Allowed values for the cache type. |
static int |
IMPLICIT_FORM
|
static int |
INDEX_RANGE
|
protected DataBin |
mainHeaderDataBin
Contains the main header codestream. |
static int |
NUMBER_OF_BYTES
|
static int |
NUMBER_OF_LAYERS
|
protected java.util.Map<java.lang.Long,DataBin> |
precinctsDataBins
Is a hastable contains the received data for each precinct data-bin. |
protected SIZParameters |
sizParameters
Definition in JPCParameters.sizParameters. |
protected int |
type
|
static int |
WILDCARD
Allowed values fo the cache subtype. |
| Constructor Summary | |
|---|---|
DataBinsCacheManagement()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addJPIPMessage(byte[] jpipMessageBody,
int classIdentifier,
long inClassIdentifier,
boolean completeDataBin,
long offset,
int aux)
|
void |
addJPIPMessage(JPIPMessage jpipMessage)
|
protected java.util.ArrayList<CacheDescriptor> |
explicitForm(java.util.ArrayList<java.lang.Long> relevantPrecincts,
int subType)
Gets the cache descriptor following the explicit form. |
protected java.util.ArrayList<CacheDescriptor> |
explicitForm(int subType)
Gets the cache descriptor following the explicit form. |
java.util.ArrayList<CacheDescriptor> |
getCacheDescriptor(ViewWindowField viewWindow,
int type,
int subType)
|
DataBin |
getDataBin(int classIdentifier,
long inClassIdentifier)
Returns the byte array of the data-bin idientified by
classIdentifier and the inClassIdentifier. |
byte[] |
getMainHeader()
Returns the image main header if it is available, otherwise returns null. |
java.util.ArrayList<byte[]> |
getPrecinctDataBin(long inClassIdentifier)
Returns the byte array of the data-bin idientified by
inClassIdentifier. |
java.util.Set<java.lang.Long> |
getPrecinctDataBins()
|
protected java.util.ArrayList<CacheDescriptor> |
implicitForm(java.util.ArrayList<java.lang.Long> relevantPrecincts)
Gets the cache descriptor following the implicit form. |
boolean |
isCompleteMainHeader()
|
boolean |
isInCache(ViewWindowField viewWindow)
This method is used to check if a requested window of interest can be retrieved from the data stored in the cache. |
void |
list(java.io.PrintStream out)
Prints this cache out to the specified output stream. |
private static void |
printByteStream(byte[] buffer)
Useful method for printing out a ByteStream. |
void |
reset()
Sets the attributes to its initial values. |
void |
setSIZAndCODParamters(SIZParameters sizParameters,
CODParameters codParameters)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DataBin mainHeaderDataBin
protected java.util.Map<java.lang.Long,DataBin> precinctsDataBins
protected SIZParameters sizParameters
JPCParameters.sizParameters.
protected CODParameters codParameters
JPCParameters.codParameters.
protected int type
public static final int EXPLICIT_FORM
Further information, see ISO/IEC 15444-9 sections C.8.1.2 y C.8.1.3
public static final int IMPLICIT_FORM
public static final int WILDCARD
Further information, see ISO/IEC 15444-9 sections C.8.1.2 y C.8.1.3
public static final int INDEX_RANGE
public static final int NUMBER_OF_LAYERS
public static final int NUMBER_OF_BYTES
| Constructor Detail |
|---|
public DataBinsCacheManagement()
| Method Detail |
|---|
public void setSIZAndCODParamters(SIZParameters sizParameters,
CODParameters codParameters)
public void addJPIPMessage(JPIPMessage jpipMessage)
jpipMessage -
public void addJPIPMessage(byte[] jpipMessageBody,
int classIdentifier,
long inClassIdentifier,
boolean completeDataBin,
long offset,
int aux)
jpipMessageBody - definition in JPIPMessage.messageBodyclassIdentifier - definition in CADI.Common.Cache.CacheDescriptor#ClassinClassIdentifier - definition in JPIPMessageHeader.inClassIdentifiercompleteDataBin - definition in JPIPMessageHeader.isLastByteoffset - definition in JPIPMessageHeader.msgOffsetaux - definition in JPIPMessageHeader.Aux
public DataBin getDataBin(int classIdentifier,
long inClassIdentifier)
classIdentifier and the inClassIdentifier.
If the data-bin is not in the cache, a null pointer is
returned.
classIdentifier - definition in JPIPMessageHeader.classIdentifierinClassIdentifier - definition in JPIPMessageHeader.inClassIdentifier
null pointer if
the data-bin is not in the cache.public final java.util.ArrayList<byte[]> getPrecinctDataBin(long inClassIdentifier)
inClassIdentifier. If the data-bin is not in the cache, a
null pointer is returned.
inClassIdentifier - definition in JPIPMessageHeader.inClassIdentifier
null pointer if
the data-bin is not in the cache.public final java.util.Set<java.lang.Long> getPrecinctDataBins()
public final boolean isCompleteMainHeader()
public final byte[] getMainHeader()
public void reset()
public boolean isInCache(ViewWindowField viewWindow)
viewWindow - definition in ViewWindowField.
true if the WOI can be recovered.
Otherwise, it will return false.
public java.util.ArrayList<CacheDescriptor> getCacheDescriptor(ViewWindowField viewWindow,
int type,
int subType)
viewWindow - type - subtype -
public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.
protected java.util.ArrayList<CacheDescriptor> explicitForm(java.util.ArrayList<java.lang.Long> relevantPrecincts,
int subType)
relevantPrecincts - an array list with the relevant precincts which
will be included in the cache descriptor.
protected java.util.ArrayList<CacheDescriptor> explicitForm(int subType)
protected java.util.ArrayList<CacheDescriptor> implicitForm(java.util.ArrayList<java.lang.Long> relevantPrecincts)
relevantPrecincts - an array list with the relevant precincts which
will be included in the cache descriptor.
private static void printByteStream(byte[] buffer)
buffer - the byte array to be printed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||