getColumn() публичный Метод

public getColumn ( ) : Element,
Результат Element,
Пример #1
0
   //-----------<Test Stub>--------
 static void main(string[] args)
 {
     Console.WriteLine("\nTesting the MatrixElement class");
     Console.WriteLine("\n================================\n");
     MatrixElement elem_mat = new MatrixElement();
     VariableElement elem_var = new VariableElement();
     IntegerElement elem_int = new IntegerElement();
     string var = "matrix";
     string row = "3";
     string column = "4";
     elem_var.setText(var);
     elem_mat.setVar(elem_var);
     elem_int.setText(row);
     elem_mat.setRow(elem_int);
     elem_int.setText(column);
     elem_mat.setColumn(elem_int);
     VariableElement varelement = elem_mat.getVar();
     IntegerElement rowelement = elem_mat.getRow();
     IntegerElement columnelement = elem_mat.getColumn();
     Console.WriteLine("The Matrix element is:{0},[{1}],[{2}]", varelement.getText(),rowelement.getText(),columnelement.getText());
 }
Пример #2
0
 private int getMatrixCol(MatrixElement temp)
 {
     try
     {
         if (temp.getColumn() is IntegerElement)
         {
             string s = ((IntegerElement)temp.getColumn()).getText();
             return int.Parse(s);
         }
         else
         {
             string s = ((IntegerElement)(mVariableMap[((VariableElement)temp.getColumn()).getText()])).getText();
             return int.Parse(s);
         }
     }
     catch (Exception e) { sendres(112, "Invalid column\n"); e.GetType(); return 0; }
 }