libsbmlcs.SBaseList.get C# (CSharp) Method

get() public method

public get ( uint n ) : SBase
n uint
return SBase
        public SBase get(uint n)
        {
            IntPtr cPtr = libsbmlPINVOKE.SBaseList_get(swigCPtr, n);
            SBase ret = (cPtr == IntPtr.Zero) ? null : new SBase(cPtr, false);
            return ret;
        }

Usage Example

Esempio n. 1
0
    /**
     * Returns a list of all ids from the given list of elements
     */
    public static List<string> getAllIds(SBaseList allElements)
    {
        var result = new List<string>();
        if (allElements == null || allElements.getSize() == 0)
            return result;

        for (uint i = 0; i < allElements.getSize(); ++i)
        {
            SBase current = allElements.get(i);
            if (current.isSetId() && current.getTypeCode() != libsbml.SBML_LOCAL_PARAMETER)
            {
                result.Add(current.getId());
            }
        }

        return result;
    }