VariantRef Class

AMPL base type, can store a number or a string

Namespace
ampl
Assemblies
  • AMPL

Syntax

public class VariantRef : IComparable, IDisposable
class ampl.VariantRef

Fields

swigCMemOwn()
Return type:System.Boolean
protected bool swigCMemOwn

Constructors

VariantRef(System.Double)
public VariantRef(double d)
VariantRef(System.String)
public VariantRef(string s)
VariantRef(ampl.Variant)
public VariantRef(Variant other)

Methods

CompareTo(System.Object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Arguments:
  • obj (System.Object) – An object to compare with this instance.
Return type:

System.Int32

Returns:

A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes <span class=”paramref”>obj</span> in the sort order. Zero This instance occurs in the same position in the sort order as <span class=”paramref”>obj</span>. Greater than zero This instance follows <span class=”paramref”>obj</span> in the sort order.

public int CompareTo(object obj)
Dispose()
public virtual void Dispose()
Equals(System.Object)

Returns true if two Variants have the same type and value

Return type:System.Boolean
public override bool Equals(object other)
Finalize()
protected void Finalize()
GetHashCode()

Get a hash code for this variant

Return type:System.Int32
public override int GetHashCode()
ToString()

Return a string representation of this Variant

Return type:System.String
public override string ToString()

Properties

Dbl()

If the variant represents a number, gets the number. Throws exception otherwise

Return type:System.Double
public double Dbl { get; }
Str()

If the variant represents a string, gets the string. Throws exception otherwise

Return type:System.String
public string Str { get; }
Type()

Gets the type of this variant

Return type:Type
public Type Type { get; }