C# 클래스 CSJ2K.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:

  • Tile and component specific attribute
  • Tile specific default attribute
  • Component main default attribute
  • Main default attribute

파일 보기 프로젝트 열기: cureos/csj2k 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
compDef System.Object[]
def System.Object
nComp int
nTiles int
specType int
specValType byte[][]
tileCompVal System.Object>.System.Collections.Generic.Dictionary
tileDef System.Object[]

공개 메소드들

메소드 설명
Clone ( ) : Object
ModuleSpec ( int nt, int nc, byte type ) : System

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.

getCompDef ( int c ) : Object

Gets default value of the specified component. If no specification have been entered for this component, returns default value.

getDefault ( ) : Object

Gets default value for this module.

getSpecValType ( int t, int c ) : byte

Return the spec type of the given tile-component.

getTileCompVal ( int t, int c ) : Object

Gets value of specified tile-component. This method calls getSpec but has a public access.

getTileDef ( int t ) : Object

Gets default value of the specified tile. If no specification has been entered, it returns the default value.

isCompSpecified ( int c ) : bool

Whether or not specifications have been entered for the given component.

isTileCompSpecified ( int t, int c ) : bool

Whether or not a tile-component specification has been defined

isTileSpecified ( int t ) : bool

Whether or not specifications have been entered for the given tile.

parseIdx ( System word, int maxIdx ) : bool[]

This method is responsible of parsing tile indexes set and component indexes set for an option. Such an argument must follow the following policy:
t<indexes set> or c<indexes set> where tile or component indexes are separated by commas or a dashes.

Example:

  • t0,3,4 means tiles with indexes 0, 3 and 4.
  • t2-4 means tiles with indexes 2,3 and 4.
    It returns a boolean array skteching which tile or component are concerned by the next parameters.

  • rotate90 ( Coord anT ) : void

    Rotate the ModuleSpec instance by 90 degrees (this modifies only tile and tile-component specifications).

    setCompDef ( int c, System value_Renamed ) : void

    Sets default value for specified component and specValType tag if allowed by its priority.

    setDefault ( System value_Renamed ) : void

    Sets default value for this module

    setTileCompVal ( int t, int c, System value_Renamed ) : void

    Sets value for specified tile-component.

    setTileDef ( int t, System value_Renamed ) : void

    Sets default value for specified tile and specValType tag if allowed by its priority.

    보호된 메소드들

    메소드 설명
    getSpec ( int t, int c ) : Object

    Gets value of specified tile-component without knowing if a specific tile-component value has been previously entered. It first check if a tile-component specific value has been entered, then if a tile specific value exist, then if a component specific value exist. If not the default value is returned.

    메소드 상세

    Clone() 공개 메소드

    public Clone ( ) : Object
    리턴 System.Object

    ModuleSpec() 공개 메소드

    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.
    public ModuleSpec ( int nt, int nc, byte type ) : System
    nt int The number of tiles /// ///
    nc int The number of components /// ///
    type byte the type of the specification module i.e. tile specific, /// component specific or both. /// ///
    리턴 System

    getCompDef() 공개 메소드

    Gets default value of the specified component. If no specification have been entered for this component, returns default value.
    public getCompDef ( int c ) : Object
    c int Component index /// ///
    리턴 System.Object

    getDefault() 공개 메소드

    Gets default value for this module.
    public getDefault ( ) : Object
    리턴 System.Object

    getSpec() 보호된 메소드

    Gets value of specified tile-component without knowing if a specific tile-component value has been previously entered. It first check if a tile-component specific value has been entered, then if a tile specific value exist, then if a component specific value exist. If not the default value is returned.
    protected getSpec ( int t, int c ) : Object
    t int Tile index /// ///
    c int Component index /// ///
    리턴 System.Object

    getSpecValType() 공개 메소드

    Return the spec type of the given tile-component.
    public getSpecValType ( int t, int c ) : byte
    t int Tile index /// ///
    c int Component index /// ///
    리턴 byte

    getTileCompVal() 공개 메소드

    Gets value of specified tile-component. This method calls getSpec but has a public access.
    public getTileCompVal ( int t, int c ) : Object
    t int Tile index /// ///
    c int Component index /// ///
    리턴 System.Object

    getTileDef() 공개 메소드

    Gets default value of the specified tile. If no specification has been entered, it returns the default value.
    public getTileDef ( int t ) : Object
    t int Tile index /// ///
    리턴 System.Object

    isCompSpecified() 공개 메소드

    Whether or not specifications have been entered for the given component.
    public isCompSpecified ( int c ) : bool
    c int Index of the component /// ///
    리턴 bool

    isTileCompSpecified() 공개 메소드

    Whether or not a tile-component specification has been defined
    public isTileCompSpecified ( int t, int c ) : bool
    t int Tile index /// ///
    c int Component index /// ///
    리턴 bool

    isTileSpecified() 공개 메소드

    Whether or not specifications have been entered for the given tile.
    public isTileSpecified ( int t ) : bool
    t int Index of the tile /// ///
    리턴 bool

    parseIdx() 공개 정적인 메소드

    This method is responsible of parsing tile indexes set and component indexes set for an option. Such an argument must follow the following policy:
    t<indexes set> or c<indexes set> where tile or component indexes are separated by commas or a dashes.

    Example:

  • t0,3,4 means tiles with indexes 0, 3 and 4.
  • t2-4 means tiles with indexes 2,3 and 4.
    It returns a boolean array skteching which tile or component are concerned by the next parameters.
  • public static parseIdx ( System word, int maxIdx ) : bool[]
    word System The word to parse. /// ///
    maxIdx int Maximum authorized index /// ///
    리턴 bool[]

    rotate90() 공개 메소드

    Rotate the ModuleSpec instance by 90 degrees (this modifies only tile and tile-component specifications).
    public rotate90 ( Coord anT ) : void
    anT Coord
    리턴 void

    setCompDef() 공개 메소드

    Sets default value for specified component and specValType tag if allowed by its priority.
    public setCompDef ( int c, System value_Renamed ) : void
    c int Component index /// ///
    value_Renamed System
    리턴 void

    setDefault() 공개 메소드

    Sets default value for this module
    public setDefault ( System value_Renamed ) : void
    value_Renamed System
    리턴 void

    setTileCompVal() 공개 메소드

    Sets value for specified tile-component.
    public setTileCompVal ( int t, int c, System value_Renamed ) : void
    t int Tie index /// ///
    c int Component index /// ///
    value_Renamed System
    리턴 void

    setTileDef() 공개 메소드

    Sets default value for specified tile and specValType tag if allowed by its priority.
    public setTileDef ( int t, System value_Renamed ) : void
    t int
    value_Renamed System
    리턴 void

    프로퍼티 상세

    compDef 보호되어 있는 프로퍼티

    The default value for each component. Null if no component specific value is defined
    protected Object[],System compDef
    리턴 System.Object[]

    def 보호되어 있는 프로퍼티

    Default value for each tile-component
    protected Object,System def
    리턴 System.Object

    nComp 보호되어 있는 프로퍼티

    The number of components
    protected int nComp
    리턴 int

    nTiles 보호되어 있는 프로퍼티

    The number of tiles
    protected int nTiles
    리턴 int

    specType 보호되어 있는 프로퍼티

    The type of the specification module
    protected int specType
    리턴 int

    specValType 보호되어 있는 프로퍼티

    The spec type for each tile-component. The first index is the tile index, the second is the component index.
    protected byte[][] specValType
    리턴 byte[][]

    tileCompVal 보호되어 있는 프로퍼티

    The specific value for each tile-component. Value of tile 16 component 3 is accessible through the hash value "t16c3". Null if no tile-component specific value is defined
    protected System.Collections.Generic.Dictionary tileCompVal
    리턴 System.Object>.System.Collections.Generic.Dictionary

    tileDef 보호되어 있는 프로퍼티

    The default value for each tile. Null if no tile specific value is defined
    protected Object[],System tileDef
    리턴 System.Object[]