com.mathworks.mps.client

## Class MATLABStackFrame

- java.lang.Object
- - com.mathworks.mps.client.MATLABStackFrame

- All Implemented Interfaces:
    java.io.Serializable

      public class MATLABStackFrame
      extends java.lang.Object
      implements java.io.Serializable

  Represents an element in MATLAB stack trace obtained from `MATLABException`. A `MATLABStackFrame` contains name of the MATLAB file, name of the function in the file and the line number in the file.

  NOTE: Users don't need to create an instance of this class from scratch. It will be available if a MATLAB error on server causes `MATLABException` to be thrown on the client side.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MATLABStackFrame(java.lang.String file, java.lang.String name, int line)` Construct `MATLABStackFrame` using file name, function name and line number

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Returns true if 2 `MATLABStackFrame` instances have the same file name, function name and line number
    `java.lang.String` | `getFile()` Get the complete path to MATLAB file including the extension.
    `int` | `getLine()` Get the line number in MATLAB file
    `java.lang.String` | `getName()` Get the name of MATLAB function in MATLAB file.
    `int` | `hashCode()` Return hash value for an instance of `MATLABStackFrame` instance
    `java.lang.String` | `toString()` Return string representation of an instance of `MATLABStackFrame`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MATLABStackFrame

          public MATLABStackFrame(java.lang.String file,
                                  java.lang.String name,
                                  int line)

      Construct `MATLABStackFrame` using file name, function name and line number
      Parameters:
        `file` - name of the file
        `name` - name of function in the file
        `line` - line number

  - ### Method Detail

    - #### getFile

          public java.lang.String getFile()

      Get the complete path to MATLAB file including the extension.
      Returns:
        Complete path to MATLAB file

    - #### getName

          public java.lang.String getName()

      Get the name of MATLAB function in MATLAB file. For a MATLAB file with just one function, this is same as just the file name without the extension. It will be different from the MATLAB file name if it is a sub function in a MATLAB file.
      Returns:
        Name of MATLAB function

    - #### getLine

          public int getLine()

      Get the line number in MATLAB file
      Returns:
        Line number in MATLAB file

    - #### toString

          public java.lang.String toString()

      Return string representation of an instance of `MATLABStackFrame`
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        string representation of MATLABStackFrame

    - #### equals

          public boolean equals(java.lang.Object obj)

      Returns true if 2 `MATLABStackFrame` instances have the same file name, function name and line number
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - to be compared for equality
      Returns:
        true if input `MATLABStackFrame` instance has the same file name, function name and line number

    - #### hashCode

          public int hashCode()

      Return hash value for an instance of `MATLABStackFrame` instance
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        hash value

Copyright 2010-2022 The MathWorks, Inc.