Show / Hide Table of Contents

Class Component

A class that represents a (Spice) component/device.

Inheritance
object
ParameterSet
ParameterSetCollection
Entity
Component
Component<P>
Implements
IComponent
IEntity
IParameterSetCollection
IParameterSet
ICloneable<IEntity>
IRuleSubject
Inherited Members
Entity.LinkParameters
Entity.Name
Entity.CreateBehaviors(ISimulation)
Entity.SetParameter<P>(string, P)
ParameterSetCollection.GetParameterSet<P>()
ParameterSetCollection.TryGetParameterSet<P>(out P)
ParameterSetCollection.ParameterSets
ParameterSetCollection.TrySetParameter<P>(string, P)
ParameterSetCollection.GetProperty<P>(string)
ParameterSetCollection.TryGetProperty<P>(string, out P)
ParameterSetCollection.CreateParameterSetter<P>(string)
ParameterSetCollection.CreatePropertyGetter<P>(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: SpiceSharp.Components
Assembly: SpiceSharp.dll
Syntax
public abstract class Component : Entity, IComponent, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>, IRuleSubject

Constructors

Component(string, int)

Initializes a new instance of the Component class.

Declaration
protected Component(string name, int nodeCount)
Parameters
Type Name Description
string name

The string of the entity.

int nodeCount

The node count.

Exceptions
Type Condition
ArgumentNullException

Thrown if name is null.

Properties

Model

Gets or sets the name of the component model.

Declaration
public string Model { get; set; }
Property Value
Type Description
string

The name of the component model.

Nodes

Gets a list of all the nodes that the component is connected to.

Declaration
public IReadOnlyList<string> Nodes { get; }
Property Value
Type Description
IReadOnlyList<string>

The nodes.

Methods

Clone()

Clones the instance.

Declaration
public override IEntity Clone()
Returns
Type Description
IEntity

The cloned instance.

Overrides
Entity.Clone()

Connect(params string[])

Connects the component in the circuit.

Declaration
public IComponent Connect(params string[] nodes)
Parameters
Type Name Description
string[] nodes

The node indices.

Returns
Type Description
IComponent

The instance calling the method for chaining.

Exceptions
Type Condition
ArgumentNullException

Thrown if nodes or any of the nodes is null.

NodeMismatchException

Thrown if the number of nodes does not match the pin count of the component.

ToString()

Returns a string that represents the current entity.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
Entity.ToString()

Implements

IComponent
IEntity
IParameterSetCollection
IParameterSet
ICloneable<T>
IRuleSubject

Extension Methods

Utility.ThrowIfNull<T>(T, string)
Documentation.Pins(IComponent)
Documentation.ParameterValues<T>(IParameterSet, bool)
Documentation.Parameters(IParameterSet)
Documentation.ParameterValues<T>(IParameterSetCollection, bool)
Documentation.Parameters(IParameterSetCollection)

See Also

Entity
IComponent
IRuleSubject
In this article
Back to top Generated by DocFX