AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.Fields.Field Class Reference

Represents a single field in an AMPS message. More...

+ Inheritance diagram for AMPS.Client.Fields.Field:

Public Member Functions

 Field ()
 Default construntotor. More...
 
 Field (string value)
 Constructs an instance with the bytes of the specified string value. The string is interpreted as the UTF-8 representation. More...
 
 Field (byte[] buffer, int position, int length)
 Constructs an instance with the specified region of a byte buffer. Note: the bytes are not copied from the buffer. The specified buffer region is referenced by this instance. More...
 
void set (byte[] buffer, int position, int length)
 Sets the value of this instance with the specified region of a byte buffer. Note: the bytes are not copied from the buffer. The specified buffer region is referenced by this instance. More...
 
void set (byte[] buffer)
 Sets the value of this instance with the specified buffer. Note: the bytes are not copied from the buffer. The buffer is referenced by this instance. More...
 
bool isNull ()
 Indicates whether this instance's value is null. More...
 
void reset ()
 Resets the value of this instance to null. More...
 
byte byteAt (int i)
 Returns the byte at position plus index i. More...
 
override bool Equals (Object obj)
 Default implementation for Object#equals for a Field. For two Fields to be considered equal, their values must have the same length and all bytes in the value must be equal. More...
 
override int GetHashCode ()
 Gets the hash code for the Field. More...
 
Field copy ()
 Constructs a new Field and sets its value to a deep copy of this instance. More...
 
virtual void copyFrom (Field f)
 Provides a way to make this object a duplicate of f. More...
 

Public Attributes

byte[] buffer = null
 
int position = 0
 
int length = 0
 

Detailed Description

Represents a single field in an AMPS message.

Implemented with byte array and int offset and length primitives to maximize heap efficiency of cloning, reads, updates, and comparisons.

Constructor & Destructor Documentation

◆ Field() [1/3]

AMPS.Client.Fields.Field.Field ( )
inline

Default construntotor.

◆ Field() [2/3]

AMPS.Client.Fields.Field.Field ( string  value)
inline

Constructs an instance with the bytes of the specified string value. The string is interpreted as the UTF-8 representation.

Parameters
valueThe string to be converted into UTF-8 bytes.

◆ Field() [3/3]

AMPS.Client.Fields.Field.Field ( byte[]  buffer,
int  position,
int  length 
)
inline

Constructs an instance with the specified region of a byte buffer. Note: the bytes are not copied from the buffer. The specified buffer region is referenced by this instance.

Parameters
bufferThe byte buffer.
positionThe starting position of the value in the byte buffer.
lengthThe length from the starting position of the value in the byte buffer.

Member Function Documentation

◆ byteAt()

byte AMPS.Client.Fields.Field.byteAt ( int  i)
inline

Returns the byte at position plus index i.

Parameters
iThe given index.
Returns
The specified byte.

◆ copy()

Field AMPS.Client.Fields.Field.copy ( )
inline

Constructs a new Field and sets its value to a deep copy of this instance.

Returns
The new deep copy of this instance.

◆ copyFrom()

virtual void AMPS.Client.Fields.Field.copyFrom ( Field  f)
inlinevirtual

Provides a way to make this object a duplicate of f.

Parameters
fThe Field to copy from.

Reimplemented in AMPS.Client.Fields.BookmarkRangeField.

◆ Equals()

override bool AMPS.Client.Fields.Field.Equals ( Object  obj)
inline

Default implementation for Object#equals for a Field. For two Fields to be considered equal, their values must have the same length and all bytes in the value must be equal.

Parameters
objThe object to compare this with.
Returns
True if the objects are equal, otherwise false.

◆ GetHashCode()

override int AMPS.Client.Fields.Field.GetHashCode ( )
inline

Gets the hash code for the Field.

Returns
The hash code for the Field.

◆ isNull()

bool AMPS.Client.Fields.Field.isNull ( )
inline

Indicates whether this instance's value is null.

Returns
True if null, false if not.

◆ reset()

void AMPS.Client.Fields.Field.reset ( )
inline

Resets the value of this instance to null.

◆ set() [1/2]

void AMPS.Client.Fields.Field.set ( byte[]  buffer)
inline

Sets the value of this instance with the specified buffer. Note: the bytes are not copied from the buffer. The buffer is referenced by this instance.

Parameters
bufferThe byte buffer to be copied.

◆ set() [2/2]

void AMPS.Client.Fields.Field.set ( byte[]  buffer,
int  position,
int  length 
)
inline

Sets the value of this instance with the specified region of a byte buffer. Note: the bytes are not copied from the buffer. The specified buffer region is referenced by this instance.

Parameters
bufferThe byte buffer.
positionThe starting position of the value in the byte buffer.
lengthThe length from the starting position of the value in the byte buffer.

The documentation for this class was generated from the following file: