/// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(TrackJamTarget obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            if (!this._trackJam.Equals(obj._trackJam))
            {
                ivarsEqual = false;
            }

            if (this._emitterID != obj._emitterID)
            {
                ivarsEqual = false;
            }

            if (this._beamID != obj._beamID)
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<ElectronicEmissionBeamData>");
            try
            {
                sb.AppendLine("<beamDataLength type=\"byte\">" + this._beamDataLength.ToString(CultureInfo.InvariantCulture) + "</beamDataLength>");
                sb.AppendLine("<beamIDNumber type=\"byte\">" + this._beamIDNumber.ToString(CultureInfo.InvariantCulture) + "</beamIDNumber>");
                sb.AppendLine("<beamParameterIndex type=\"ushort\">" + this._beamParameterIndex.ToString(CultureInfo.InvariantCulture) + "</beamParameterIndex>");
                sb.AppendLine("<fundamentalParameterData>");
                this._fundamentalParameterData.Reflection(sb);
                sb.AppendLine("</fundamentalParameterData>");
                sb.AppendLine("<beamFunction type=\"byte\">" + this._beamFunction.ToString(CultureInfo.InvariantCulture) + "</beamFunction>");
                sb.AppendLine("<trackJamTargets type=\"byte\">" + this._trackJamTargets.Count.ToString(CultureInfo.InvariantCulture) + "</trackJamTargets>");
                sb.AppendLine("<highDensityTrackJam type=\"byte\">" + this._highDensityTrackJam.ToString(CultureInfo.InvariantCulture) + "</highDensityTrackJam>");
                sb.AppendLine("<pad4 type=\"byte\">" + this._pad4.ToString(CultureInfo.InvariantCulture) + "</pad4>");
                sb.AppendLine("<jammingModeSequence type=\"uint\">" + this._jammingModeSequence.ToString(CultureInfo.InvariantCulture) + "</jammingModeSequence>");
                for (int idx = 0; idx < this._trackJamTargets.Count; idx++)
                {
                    sb.AppendLine("<trackJamTargets" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"TrackJamTarget\">");
                    TrackJamTarget aTrackJamTarget = (TrackJamTarget)this._trackJamTargets[idx];
                    aTrackJamTarget.Reflection(sb);
                    sb.AppendLine("</trackJamTargets" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</ElectronicEmissionBeamData>");
            }
            catch (Exception e)
            {
                if (PduBase.TraceExceptions)
                {
                    Trace.WriteLine(e);
                    Trace.Flush();
                }

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }
        public virtual int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize += 1;                                                  // this._beamDataLength
            marshalSize += 1;                                                  // this._beamIDNumber
            marshalSize += 2;                                                  // this._beamParameterIndex
            marshalSize += this._fundamentalParameterData.GetMarshalledSize(); // this._fundamentalParameterData
            marshalSize += 1;                                                  // this._beamFunction
            marshalSize += 1;                                                  // this._numberOfTrackJamTargets
            marshalSize += 1;                                                  // this._highDensityTrackJam
            marshalSize += 1;                                                  // this._pad4
            marshalSize += 4;                                                  // this._jammingModeSequence
            for (int idx = 0; idx < this._trackJamTargets.Count; idx++)
            {
                TrackJamTarget listElement = (TrackJamTarget)this._trackJamTargets[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._beamDataLength     = dis.ReadUnsignedByte();
                    this._beamIDNumber       = dis.ReadUnsignedByte();
                    this._beamParameterIndex = dis.ReadUnsignedShort();
                    this._fundamentalParameterData.Unmarshal(dis);
                    this._beamFunction            = dis.ReadUnsignedByte();
                    this._numberOfTrackJamTargets = dis.ReadUnsignedByte();
                    this._highDensityTrackJam     = dis.ReadUnsignedByte();
                    this._pad4 = dis.ReadUnsignedByte();
                    this._jammingModeSequence = dis.ReadUnsignedInt();

                    for (int idx = 0; idx < this.NumberOfTrackJamTargets; idx++)
                    {
                        TrackJamTarget anX = new TrackJamTarget();
                        anX.Unmarshal(dis);
                        this._trackJamTargets.Add(anX);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedByte((byte)this._beamDataLength);
                    dos.WriteUnsignedByte((byte)this._beamIDNumber);
                    dos.WriteUnsignedShort((ushort)this._beamParameterIndex);
                    this._fundamentalParameterData.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._beamFunction);
                    dos.WriteUnsignedByte((byte)this._trackJamTargets.Count);
                    dos.WriteUnsignedByte((byte)this._highDensityTrackJam);
                    dos.WriteUnsignedByte((byte)this._pad4);
                    dos.WriteUnsignedInt((uint)this._jammingModeSequence);

                    for (int idx = 0; idx < this._trackJamTargets.Count; idx++)
                    {
                        TrackJamTarget aTrackJamTarget = (TrackJamTarget)this._trackJamTargets[idx];
                        aTrackJamTarget.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }