C# 클래스 Azavea.NijPredictivePolicing.Common.Data.FixedWidthField

Represents a column, and contains data about where that column is located in a row and what type of data it contains. This class contains some error checking, but it can be used in some very weird ways (for example, it doesn't care if columns overlap with each other). In general, it's your responsibility to use it sensibly.
파일 보기 프로젝트 열기: azavea/acs-alchemist 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ColumnName string
DefaultValue object
Description string
End int
Seeker FixedWidthPositions
Start int
Strict bool
Terminator FixedWidthTerminators
Type FixedWidthTypes

공개 메소드들

메소드 설명
FixedWidthField ( ) : System
FixedWidthField ( FixedWidthField old ) : System
FixedWidthField ( int start, int end, FixedWidthTypes type, FixedWidthPositions seeker, FixedWidthTerminators terminator ) : System
FixedWidthField ( int start, int end, FixedWidthTypes type, FixedWidthPositions seeker, FixedWidthTerminators terminator, object defaultValue, bool strict ) : System
FixedWidthField ( string columnName, string description, int length, int start ) : System
FixedWidthField ( string columnName, string description, int length, int start, FixedWidthTypes type ) : System
FixedWidthField ( string columnName, string description, int length, int start, FixedWidthTypes type, FixedWidthTerminators term ) : System
GetFieldData ( string row, int &currentPos ) : string

Gets the raw data for this field from a row and updates the current position. Does not do any parsing. Throws errors if Strict is false.

GetFieldObject ( string row, int &currentPos ) : object

Gets the parsed object for this field from a row and updates the current position, as determined by Type.

비공개 메소드들

메소드 설명
GetFieldRange ( string row, int currentPos, int &start, int &end ) : void

메소드 상세

FixedWidthField() 공개 메소드

public FixedWidthField ( ) : System
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( FixedWidthField old ) : System
old FixedWidthField
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( int start, int end, FixedWidthTypes type, FixedWidthPositions seeker, FixedWidthTerminators terminator ) : System
start int
end int
type FixedWidthTypes
seeker FixedWidthPositions
terminator FixedWidthTerminators
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( int start, int end, FixedWidthTypes type, FixedWidthPositions seeker, FixedWidthTerminators terminator, object defaultValue, bool strict ) : System
start int
end int
type FixedWidthTypes
seeker FixedWidthPositions
terminator FixedWidthTerminators
defaultValue object
strict bool
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( string columnName, string description, int length, int start ) : System
columnName string
description string
length int
start int
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( string columnName, string description, int length, int start, FixedWidthTypes type ) : System
columnName string
description string
length int
start int
type FixedWidthTypes
리턴 System

FixedWidthField() 공개 메소드

public FixedWidthField ( string columnName, string description, int length, int start, FixedWidthTypes type, FixedWidthTerminators term ) : System
columnName string
description string
length int
start int
type FixedWidthTypes
term FixedWidthTerminators
리턴 System

GetFieldData() 공개 메소드

Gets the raw data for this field from a row and updates the current position. Does not do any parsing. Throws errors if Strict is false.
public GetFieldData ( string row, int &currentPos ) : string
row string The row to read from
currentPos int The current position in the row
리턴 string

GetFieldObject() 공개 메소드

Gets the parsed object for this field from a row and updates the current position, as determined by Type.
public GetFieldObject ( string row, int &currentPos ) : object
row string The row to read from
currentPos int The current position in the row
리턴 object

프로퍼티 상세

ColumnName 공개적으로 프로퍼티

public string ColumnName
리턴 string

DefaultValue 공개적으로 프로퍼티

If we fail to retrieve a value for this field, what should we use instead? Note this isn't checked against Type, so if you set this to one type and Type to something else, it's your fault when you get type errors.
public object DefaultValue
리턴 object

Description 공개적으로 프로퍼티

public string Description
리턴 string

End 공개적으로 프로퍼티

Determines where the record ends
public int End
리턴 int

Seeker 공개적으로 프로퍼티

Determines how we interpret Start
public FixedWidthPositions Seeker
리턴 FixedWidthPositions

Start 공개적으로 프로퍼티

Determines where the record starts
public int Start
리턴 int

Strict 공개적으로 프로퍼티

If true, throws exceptions on error. If false, silently uses DefaultValue and continues.
public bool Strict
리턴 bool

Terminator 공개적으로 프로퍼티

Determines how we interpret End
public FixedWidthTerminators Terminator
리턴 FixedWidthTerminators

Type 공개적으로 프로퍼티

What type is this field?
public FixedWidthTypes Type
리턴 FixedWidthTypes