Added a function that creates the full name of the field (with its pointer and table indicators). Just for debugging purposes.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10381 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 12 years ago
parent 4360d22f02
commit 142905654f
  1. 17
      engine/src/blender/com/jme3/scene/plugins/blender/file/Field.java
  2. 10
      engine/src/blender/com/jme3/scene/plugins/blender/file/Structure.java

@ -277,9 +277,12 @@ class Field implements Cloneable {
} }
} }
@Override /**
public String toString() { * This method builds the full name of the field (with function, pointer and table indications).
StringBuilder result = new StringBuilder(); * @return the full name of the field
*/
public String getFullName() {
StringBuilder result = new StringBuilder();
if (function) { if (function) {
result.append('('); result.append('(');
} }
@ -295,6 +298,14 @@ class Field implements Cloneable {
if (function) { if (function) {
result.append(")()"); result.append(")()");
} }
return result.toString();
}
@Override
public String toString() {
StringBuilder result = new StringBuilder();
result.append(this.getFullName());
//insert appropriate amount of spaces to format the output corrently //insert appropriate amount of spaces to format the output corrently
int nameLength = result.length(); int nameLength = result.length();
result.append(' ');//at least one space is a must result.append(' ');//at least one space is a must

@ -216,6 +216,16 @@ public class Structure implements Cloneable {
return fields[fieldIndex].name; return fields[fieldIndex].name;
} }
/**
* This method returns the full field name of the given index.
* @param fieldIndex
* the index of the field
* @return the full field name of the given index
*/
public String getFieldFullName(int fieldIndex) {
return fields[fieldIndex].getFullName();
}
/** /**
* This method returns the field type of the given index. * This method returns the field type of the given index.
* @param fieldIndex * @param fieldIndex

Loading…
Cancel
Save