|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.ModuleSpec
This generic class is used to handle values to be used by a module for each tile and component. It uses attribute to determine which value to use. It should be extended by each module needing this feature. This class might be used for values that are only tile specific or component specific but not both.
The attributes to use are defined by a hierarchy. The hierarchy is:
Field Summary | |
protected java.lang.Object[] |
compDef
The default value for each component. |
protected java.lang.Object |
def
Default value for each tile-component |
protected int |
nComp
The number of components |
protected int |
nTiles
The number of tiles |
static byte |
SPEC_COMP_DEF
The identifier for "component default" specification |
static byte |
SPEC_DEF
The identifier for default specification |
static byte |
SPEC_TILE_COMP
The identifier for a "tile-component" specification |
static byte |
SPEC_TILE_DEF
The identifier for "tile default" specification |
static byte |
SPEC_TYPE_COMP
The identifier for a specification module that applies only to components |
static byte |
SPEC_TYPE_TILE
The identifier for a specification module that applies only to tiles |
static byte |
SPEC_TYPE_TILE_COMP
The identifier for a specification module that applies both to tiles and components |
protected int |
specType
The type of the specification module |
protected byte[][] |
specValType
The spec type for each tile-component. |
protected java.util.Hashtable |
tileCompVal
The specific value for each tile-component. |
protected java.lang.Object[] |
tileDef
The default value for each tile. |
Constructor Summary | |
ModuleSpec(int nt,
int nc,
byte type)
Constructs a 'ModuleSpec' object, initializing all the components and tiles to the 'SPEC_DEF' spec val type, for the specified number of components and tiles. |
Method Summary | |
java.lang.Object |
getCompDef(int c)
Gets default value of the specified component. |
int |
getCompDefRep(int c)
Returns a tile representative using component default value. |
java.lang.Object |
getDefault()
Gets default value for this module. |
int[] |
getDefRep()
Returns a tile-component representative using default value. |
protected java.lang.Object |
getSpec(int t,
int c)
Gets value of specified tile-component without knowing if a specific tile-component value has been previously entered. |
byte |
getSpecValType(int t,
int c)
Return the spec type of the given tile-component. |
java.lang.Object |
getTileCompVal(int t,
int c)
Gets value of specified tile-component. |
java.lang.Object |
getTileDef(int t)
Gets default value of the specified tile. |
int |
getTileDefRep(int t)
Returns a component representative using tile default value. |
boolean |
isCompSpecified(int c)
Whether or not specifications have been entered for the given component. |
boolean |
isTileCompSpecified(int t,
int c)
Whether or not a tile-component specification has been defined |
boolean |
isTileSpecified(int t)
Whether or not specifications have been entered for the given tile. |
static boolean[] |
parseIdx(java.lang.String word,
int maxIdx)
This method is responsible of parsing tile indexes set and component indexes set for an option. |
void |
setCompDef(int c,
java.lang.Object value)
Sets default value for specified component and specValType tag if allowed by its priority. |
void |
setDefault(java.lang.Object value)
Sets default value for this module |
void |
setTileCompVal(int t,
int c,
java.lang.Object value)
Sets value for specified tile-component. |
void |
setTileDef(int t,
java.lang.Object value)
Sets default value for specified tile and specValType tag if allowed by its priority. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final byte SPEC_TYPE_COMP
public static final byte SPEC_TYPE_TILE
public static final byte SPEC_TYPE_TILE_COMP
public static final byte SPEC_DEF
public static final byte SPEC_COMP_DEF
public static final byte SPEC_TILE_DEF
public static final byte SPEC_TILE_COMP
protected int specType
protected int nTiles
protected int nComp
protected byte[][] specValType
protected java.lang.Object def
protected java.lang.Object[] compDef
protected java.lang.Object[] tileDef
protected java.util.Hashtable tileCompVal
Constructor Detail |
public ModuleSpec(int nt, int nc, byte type)
nt
- The number of tilesnc
- The number of componentstype
- the type of the specification module i.e. tile specific,
component specific or both.Method Detail |
public void setDefault(java.lang.Object value)
public java.lang.Object getDefault()
public void setCompDef(int c, java.lang.Object value)
c
- Component indexpublic java.lang.Object getCompDef(int c)
c
- Component indexsetCompDef(int, java.lang.Object)
public void setTileDef(int t, java.lang.Object value)
c
- Tile index.public java.lang.Object getTileDef(int t)
t
- Tile indexsetTileDef(int, java.lang.Object)
public void setTileCompVal(int t, int c, java.lang.Object value)
t
- Tie indexc
- Component indexpublic java.lang.Object getTileCompVal(int t, int c)
t
- Tile indexc
- Component indexsetTileCompVal(int, int, java.lang.Object)
,
getSpec(int, int)
protected java.lang.Object getSpec(int t, int c)
t
- Tile indexc
- Component indexpublic byte getSpecValType(int t, int c)
t
- Tile indexc
- Component indexpublic boolean isCompSpecified(int c)
c
- Index of the componentpublic boolean isTileSpecified(int t)
t
- Index of the tilepublic boolean isTileCompSpecified(int t, int c)
t
- Tile indexc
- Component indexpublic static final boolean[] parseIdx(java.lang.String word, int maxIdx)
Example:
word
- The word to parse.maxIdx
- Maximum authorized indexpublic int[] getDefRep()
public int getTileDefRep(int t)
t
- Tile indexpublic int getCompDefRep(int c)
c
- Component index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |