public class CacheModel
extends java.lang.Object
The main objective of this class is to provide basic attributes and methods to deal with a cache model.
Class's attributes and methods have been declared as
protected
or
public
in order to be used by other classes which extend this
one.
Modifier and Type | Field and Description |
---|---|
protected JPEG2KCodestream |
codestream
Is an object with the codestream properties.
|
private JPEG2KComponent |
componentObj |
protected ExplicitBinDescriptor |
mainHeaderBinDescriptor
Main header data-bin.
|
protected java.util.HashMap<java.lang.Long,ExplicitBinDescriptor> |
precinctDataBins
It is a hash table that storages the length/layers of delivered data-bins.
|
private JPEG2KResolutionLevel |
rLevelObj |
protected java.util.HashMap<java.lang.Long,ExplicitBinDescriptor> |
tileHeaderDataBin |
private JPEG2KTile |
tileObj |
Constructor and Description |
---|
CacheModel()
Constructor.
|
CacheModel(JPEG2KCodestream codestream)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getDataBinLength(int classIdentifier,
long inClassIdentifier)
Returns the length of the data bin given by the
inClassIdentifier
identifier in the class classIdentifier . |
int |
getMainHeaderLength()
Returns the length of the main header data-bin.
|
int |
getPrecinctDataBinLayers(long inClassIdentifier)
Returns the number of layers of the data-bin
The returned value should be undestood as:
- a non-negative value means the number of layers of the data bin
|
int |
getPrecinctDataBinLength(long inClassIdentifier)
Returns the length of the data-bin.
|
int |
getTileHeaderDataBinLength(long inClassIdentifier)
Returns the length of tile header data-bin.
|
void |
list(java.io.PrintStream out)
Prints this Cache Model fields out to the
specified output stream.
|
void |
reset()
Sets the attributes to their initial values.
|
java.lang.String |
toString() |
void |
update(java.util.ArrayList<ModelElement> modelElement)
Updates the cache.
|
void |
update(boolean additive,
ExplicitBinDescriptor descriptor)
Updates the cache.
|
void |
update(boolean additive,
ImplicitBinDescriptor descriptor)
Updates the cache.
|
void |
update(boolean additive,
int firstTile,
int lastTile,
int firstComponent,
int lastComponent,
int firstResolutionLevel,
int lastResolutionLevel,
int firstPrecinct,
int lastPrecinct,
int numberOfLayers)
Updates the cache.
|
void |
update(boolean additive,
int classIdentifier,
long inClassIdentifier,
int numberOfBytes)
Updates the cache.
|
void |
update(boolean additive,
int classIdentifier,
long inClassIdentifier,
int numberOfLayers,
int numberOfBytes)
Updates the cache model.
|
void |
update(ModelElement modelElement)
Updates the cache.
|
protected JPEG2KCodestream codestream
protected ExplicitBinDescriptor mainHeaderBinDescriptor
protected java.util.HashMap<java.lang.Long,ExplicitBinDescriptor> precinctDataBins
protected java.util.HashMap<java.lang.Long,ExplicitBinDescriptor> tileHeaderDataBin
private JPEG2KTile tileObj
private JPEG2KComponent componentObj
private JPEG2KResolutionLevel rLevelObj
public CacheModel() throws java.lang.IllegalAccessException
java.lang.IllegalAccessException
public CacheModel(JPEG2KCodestream codestream)
codestream
- public void reset()
public final void update(boolean additive, int classIdentifier, long inClassIdentifier, int numberOfBytes)
additive
- definition in ModelElement.additive
.classIdentifier
- definition in ExplicitBinDescriptor.classIdentifier
.inClassIdentifier
- definition in ExplicitBinDescriptor.inClassIdentifier
.numberOfBytes
- definition in ExplicitBinDescriptor.numberOfBytes
.public final void update(boolean additive, int classIdentifier, long inClassIdentifier, int numberOfLayers, int numberOfBytes)
If
numberOfLayers
and
numberOfBytes
are both
-1
it means a wildcard.
additive
- definition in ModelElement.additive
.classIdentifier
- definition in ExplicitBinDescriptor.classIdentifier
.inClassIdentifier
- definition in ExplicitBinDescriptor.inClassIdentifier
.numberOfLayers
- numberOfBytes
- definition in ExplicitBinDescriptor.numberOfBytes
.public final void update(boolean additive, ExplicitBinDescriptor descriptor)
additive
- definition in ModelElement.additive
.descriptor
- public final void update(boolean additive, int firstTile, int lastTile, int firstComponent, int lastComponent, int firstResolutionLevel, int lastResolutionLevel, int firstPrecinct, int lastPrecinct, int numberOfLayers)
additive
- definition in ModelElement.additive
.firstTile
- defintion in ImplicitBinDescriptor.firstTilePos
lastTile
- defintion in ImplicitBinDescriptor.lastTilePos
firstComponent
- defintion in ImplicitBinDescriptor.firstComponentPos
lastComponent
- defintion in ImplicitBinDescriptor.lastComponentPos
firstResolutionLevel
- defintion in ImplicitBinDescriptor.firstResolutionLevelPos
lastResolutionLevel
- defintion in ImplicitBinDescriptor.lastResolutionLevelPos
firstPrecinct
- defintion in ImplicitBinDescriptor.firstPrecinctPos
lastPrecinct
- defintion in ImplicitBinDescriptor.lastPrecinctPos
numberOfLayers
- defintion in ImplicitBinDescriptor.numberOfLayers
public final void update(boolean additive, ImplicitBinDescriptor descriptor)
additive
- definition in ModelElement.additive
.descriptor
- public void update(java.util.ArrayList<ModelElement> modelElement)
modelElement
- public final void update(ModelElement modelElement)
modelElement
- public final int getDataBinLength(int classIdentifier, long inClassIdentifier)
inClassIdentifier
identifier in the class classIdentifier
.
The returne value is a non-negative value with the length of the data-bin, except for Precincts (ClassIdentifiers.PRECINCT) where a negative length means the cached information about the precinct must be read from the number of layers.
classIdentifier
- definition in JPIPMessageHeader.classIdentifier
inClassIdentifier
- definition in JPIPMessageHeader.inClassIdentifier
public final int getMainHeaderLength()
public int getPrecinctDataBinLength(long inClassIdentifier)
The returned value should be undestood as: - a non-negative value means the length of the data bin. - a negative value means the cached information about the precinct must be read from the number of layers.
inClassIdentifier
- definition in
JPIPMessageHeader.inClassIdentifier
public int getPrecinctDataBinLayers(long inClassIdentifier)
The returned value should be undestood as: - a non-negative value means the number of layers of the data bin. - a negative value means the cached information about the precinct must be read from the number of bytes.
inClassIdentifier
- public int getTileHeaderDataBinLength(long inClassIdentifier)
inClassIdentifier
- definition in
JPIPMessageHeader.inClassIdentifier
public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)