Class NamedObject
This abstract any class that has a readable name.
Namespace: ABB.Robotics.Controllers
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public abstract class NamedObject : INamedObject, IComparable
Constructors
NamedObject()
Creates a named object without a name. Name will be string.Empty.
Declaration
protected NamedObject()
NamedObject(String)
Creates a named object with the supplied name.
Declaration
protected NamedObject(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of object. |
Properties
Name
Gets the name of the obejct.
Declaration
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CompareTo(NamedObject)
Compares this object with a name for sorting.
Declaration
public int CompareTo(NamedObject obj)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | obj | Name to compare with. |
Returns
Type | Description |
---|---|
System.Int32 | See IComparer. |
CompareTo(Object)
Compares this object with a name for sorting.
Declaration
public virtual int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Name to compare with. |
Returns
Type | Description |
---|---|
System.Int32 | See IComparer. |
CompareTo(String)
Compares this object with a name for sorting.
Declaration
public int CompareTo(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name to compare with. |
Returns
Type | Description |
---|---|
System.Int32 | See IComparer. |
Equals(NamedObject)
Compares if the name of this object is equal to the name of the supplied object.
Declaration
public bool Equals(NamedObject obj)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | obj | Named object to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the names are equal. |
Equals(Object)
Merges the functionality of Equals( string ) and Equals( NamedObject ).
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if the names are equals. |
Overrides
Equals(String)
Checks if the name of the object is same as name.
Declaration
public bool Equals(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name to compare against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the objects are equal. |
GetHashCode()
Gets the hash code of the object based on the name.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code for object. |
Overrides
ToString()
Returns the string representation of this object. Shall always return same result as Name property.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The name of the object. |
Overrides
Operators
Equality(NamedObject, NamedObject)
Compares two named object for equality.
Declaration
public static bool operator ==(NamedObject no1, NamedObject no2)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | no1 | Named object 1. |
NamedObject | no2 | Named object 2. |
Returns
Type | Description |
---|---|
System.Boolean | True if the object are considered equal. |
GreaterThan(NamedObject, NamedObject)
Compares two objects.
Declaration
public static bool operator>(NamedObject no1, NamedObject no2)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | no1 | Named object 1. |
NamedObject | no2 | Named object 2. |
Returns
Type | Description |
---|---|
System.Boolean | True if no1 more then no2. |
Inequality(NamedObject, NamedObject)
Compares two named object for inequality.
Declaration
public static bool operator !=(NamedObject no1, NamedObject no2)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | no1 | Named object 1. |
NamedObject | no2 | Named object 2. |
Returns
Type | Description |
---|---|
System.Boolean | True if the object are considered inequal. |
LessThan(NamedObject, NamedObject)
Compares two objects.
Declaration
public static bool operator <(NamedObject no1, NamedObject no2)
Parameters
Type | Name | Description |
---|---|---|
NamedObject | no1 | Named object 1. |
NamedObject | no2 | Named object 2. |
Returns
Type | Description |
---|---|
System.Boolean | True if no1 less then no2 |