Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet Class Reference

Default implementation of IFieldSet. More...

Inheritance diagram for Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet:
Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet

Public Member Functions

 DefaultFieldSet (string[] values)
 Creates a DefaultFieldSet with the specified values. More...
 
 DefaultFieldSet (string[] names, string[] values)
 Creates a DefaultFieldSet with the specified names and values. More...
 
string ReadString (int index)
 Reads a field as a string. More...
 
string ReadString (string name)
 Reads a field as a string. More...
 
string ReadRawString (int index)
 Reads a field as a string. More...
 
string ReadRawString (string name)
 Reads a field as a string. More...
 
bool ReadBoolean (int index, string trueValue="true")
 Reads a field as a boolean. More...
 
bool ReadBoolean (string name, string trueValue="true")
 Reads a field as a boolean. More...
 
char ReadChar (int index)
 Reads a field as a character. More...
 
char ReadChar (string name)
 Reads a field as a character. More...
 
byte ReadByte (int index)
 Reads a field as a byte. More...
 
byte ReadByte (string name)
 Reads a field as a byte. More...
 
short ReadShort (int index)
 Reads a field as a short. More...
 
short ReadShort (string name)
 Reads a field as a short. More...
 
int ReadInt (int index)
 Reads a field as an int. More...
 
int ReadInt (string name)
 Reads a field as an int. More...
 
int ReadInt (int index, int defaultValue)
 Reads a field as an int. More...
 
int ReadInt (string name, int defaultValue)
 Reads a field as an int. More...
 
long ReadLong (int index)
 Reads a field as a long. More...
 
long ReadLong (string name)
 Reads a field as a long. More...
 
long ReadLong (int index, long defaultValue)
 Reads a field as a long. More...
 
long ReadLong (string name, long defaultValue)
 Reads a field as a long. More...
 
float ReadFloat (int index)
 Reads a field as a float. More...
 
float ReadFloat (string name)
 Reads a field as a float. More...
 
double ReadDouble (int index)
 Reads a field as a double. More...
 
double ReadDouble (string name)
 Reads a field as a double. More...
 
decimal ReadDecimal (int index)
 Reads a field as a decimal. More...
 
decimal ReadDecimal (string name)
 Reads a field as a decimal. More...
 
decimal ReadDecimal (int index, decimal defaultValue)
 Reads a field as a decimal. More...
 
decimal ReadDecimal (string name, decimal defaultValue)
 Reads a field as a decimal. More...
 
DateTime ReadDate (int index)
 Reads a field as a date. More...
 
DateTime ReadDate (string name)
 Reads a field as a date. More...
 
DateTime ReadDate (int index, DateTime defaultValue)
 Reads a field as a date. More...
 
DateTime ReadDate (string name, DateTime defaultValue)
 Reads a field as a date. More...
 
DateTime ReadDate (int index, string pattern)
 Reads a field as a date. More...
 
DateTime ReadDate (string name, string pattern)
 Reads a field as a date. More...
 
DateTime ReadDate (int index, string pattern, DateTime defaultValue)
 Reads a field as a date, using defaultValue if needed. More...
 
DateTime ReadDate (string name, string pattern, DateTime defaultValue)
 Reads a field as a date. More...
 

Properties

string[] Names [get]
 The names of the fields More...
 
string[] Values [get]
 The values of the fields More...
 
int Count [get]
 The number of fields in this field set More...
 
bool HasNames [get]
 Whether the field set has named fields More...
 
CultureInfo Culture [get, set]
 The culture to use to parse numbers and dates. More...
 
string DatePattern [get, set]
 The date pattern for formatting. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet
int Count [get]
 The number of fields in this field set. More...
 
bool HasNames [get]
 Whether the field set has named fields. More...
 
string[] Names [get]
 The names of the fields. More...
 
string[] Values [get]
 The values of the fields. More...
 

Detailed Description

Default implementation of IFieldSet.

Constructor & Destructor Documentation

Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.DefaultFieldSet ( string[]  values)

Creates a DefaultFieldSet with the specified values.

Parameters
valuesan array containing the values of the fields
Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.DefaultFieldSet ( string[]  names,
string[]  values 
)

Creates a DefaultFieldSet with the specified names and values.

Parameters
namesan array containing the names of the fields
valuesan array containing the values of the fields
Exceptions
ArgumentException if names and values do not have the same length

Member Function Documentation

bool Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadBoolean ( int  index,
string  trueValue = "true" 
)

Reads a field as a boolean.

Parameters
indexthe index of the field to read
trueValuethe literal corresponding to true (default is "true")
Returns
true if the field contains trueValue, false otherwise
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

bool Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadBoolean ( string  name,
string  trueValue = "true" 
)

Reads a field as a boolean.

Parameters
namethe name of the field to read
trueValuethe literal corresponding to true (default is "true")
Returns
true if the field contains trueValue, false otherwise
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

byte Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadByte ( int  index)

Reads a field as a byte.

Parameters
indexthe index of the field to read
Returns
the read byte
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

byte Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadByte ( string  name)

Reads a field as a byte.

Parameters
namethe name of the field to read
Returns
the read byte
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

char Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadChar ( int  index)

Reads a field as a character.

Parameters
indexthe index of the field to read
Returns
the read character
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

char Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadChar ( string  name)

Reads a field as a character.

Parameters
namethe name of the field to read
Returns
the read character
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( int  index)

Reads a field as a date.

Parameters
indexthe index of the field to read
Returns
the read date
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( string  name)

Reads a field as a date.

Parameters
namethe name of the field to read
Returns
the read date
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( int  index,
DateTime  defaultValue 
)

Reads a field as a date.

Parameters
indexthe index of the field to read
defaultValuethe default value if the field is blank
Returns
the read date
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( string  name,
DateTime  defaultValue 
)

Reads a field as a date.

Parameters
namethe name of the field to read
defaultValuethe default value if the field is blank
Returns
the read date
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( int  index,
string  pattern 
)

Reads a field as a date.

Parameters
indexthe index of the field to read
patternthe pattern to use to parse the date
Returns
the read date
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( string  name,
string  pattern 
)

Reads a field as a date.

Parameters
namethe name of the field to read
patternthe pattern to use to parse the date
Returns
the read date
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( int  index,
string  pattern,
DateTime  defaultValue 
)

Reads a field as a date, using defaultValue if needed.

Parameters
index
pattern
defaultValue
Returns

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

DateTime Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDate ( string  name,
string  pattern,
DateTime  defaultValue 
)

Reads a field as a date.

Parameters
namethe name of the field to read
patternthe pattern to use to parse the date
defaultValuethe default value if the field is blank
Returns
the read date
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

decimal Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDecimal ( int  index)

Reads a field as a decimal.

Parameters
indexthe index of the field to read
Returns
the read decimal
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

decimal Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDecimal ( string  name)

Reads a field as a decimal.

Parameters
namethe name of the field to read
Returns
the read decimal
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

decimal Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDecimal ( int  index,
decimal  defaultValue 
)

Reads a field as a decimal.

Parameters
indexthe index of the field to read
defaultValuethe default value if the field is blank
Returns
the read decimal
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

decimal Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDecimal ( string  name,
decimal  defaultValue 
)

Reads a field as a decimal.

Parameters
namethe name of the field to read
defaultValuethe default value if the field is blank
Returns
the read decimal
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

double Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDouble ( int  index)

Reads a field as a double.

Parameters
indexthe index of the field to read
Returns
the read double
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

double Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadDouble ( string  name)

Reads a field as a double.

Parameters
namethe name of the field to read
Returns
the read double
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

float Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadFloat ( int  index)

Reads a field as a float.

Parameters
indexthe index of the field to read
Returns
the read float
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

float Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadFloat ( string  name)

Reads a field as a float.

Parameters
namethe name of the field to read
Returns
the read float
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

int Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadInt ( int  index)

Reads a field as an int.

Parameters
indexthe index of the field to read
Returns
the read int
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

int Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadInt ( string  name)

Reads a field as an int.

Parameters
namethe name of the field to read
Returns
the read int
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

int Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadInt ( int  index,
int  defaultValue 
)

Reads a field as an int.

Parameters
indexthe index of the field to read
defaultValuethe default value if the field is blank
Returns
the read int
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

int Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadInt ( string  name,
int  defaultValue 
)

Reads a field as an int.

Parameters
namethe name of the field to read
defaultValuethe default value if the field is blank
Returns
the read int
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

long Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadLong ( int  index)

Reads a field as a long.

Parameters
indexthe index of the field to read
Returns
the read long
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

long Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadLong ( string  name)

Reads a field as a long.

Parameters
namethe name of the field to read
Returns
the read long
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

long Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadLong ( int  index,
long  defaultValue 
)

Reads a field as a long.

Parameters
indexthe index of the field to read
defaultValuethe default value if the field is blank
Returns
the read long
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

long Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadLong ( string  name,
long  defaultValue 
)

Reads a field as a long.

Parameters
namethe name of the field to read
defaultValuethe default value if the field is blank
Returns
the read long
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

string Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadRawString ( int  index)

Reads a field as a string.

Parameters
indexthe index of the field to read
Returns
the raw content of the field
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

string Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadRawString ( string  name)

Reads a field as a string.

Parameters
namethe name of the field to read
Returns
the raw content of the field
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

short Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadShort ( int  index)

Reads a field as a short.

Parameters
indexthe index of the field to read
Returns
the read short
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

short Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadShort ( string  name)

Reads a field as a short.

Parameters
namethe name of the field to read
Returns
the read short
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

string Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadString ( int  index)

Reads a field as a string.

Parameters
indexthe index of the field to read
Returns
the trimmed content of the field
Exceptions
ArgumentOutOfRangeException if the index does not correspond to a field

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

string Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.ReadString ( string  name)

Reads a field as a string.

Parameters
namethe name of the field to read
Returns
the trimmed content of the field
Exceptions
ArgumentException if no field has the given name

Implements Summer.Batch.Infrastructure.Item.File.Transform.IFieldSet.

Property Documentation

int Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.Count
get

The number of fields in this field set

CultureInfo Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.Culture
getset

The culture to use to parse numbers and dates.

string Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.DatePattern
getset

The date pattern for formatting.

bool Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.HasNames
get

Whether the field set has named fields

string [] Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.Names
get

The names of the fields

string [] Summer.Batch.Infrastructure.Item.File.Transform.DefaultFieldSet.Values
get

The values of the fields


The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Item/File/Transform/DefaultFieldSet.cs