@Test public void testDisplayString_ArrayFieldLocation() { Integer16DataType intDataType = new Integer16DataType(); ArrayDataType innerArray = new ArrayDataType(intDataType, 4, 4); ArrayDataType parentArray = new ArrayDataType(innerArray, 4, innerArray.getElementLength()); Address arrayAddress = addr("0100f2f0"); CreateDataCmd cmd = new CreateDataCmd(arrayAddress, true, parentArray); assertTrue(applyCmd(program, cmd)); int[] componentPath = new int[] { 17 }; String displayText = "int16 0h (int16[4][0][1])"; int index = 0; int charOffset = 0; Address subElementAddress = arrayAddress.add(20); ArrayElementFieldLocation location = new ArrayElementFieldLocation(program, subElementAddress, componentPath, displayText, index, charOffset); PreviewTableCellData data = new PreviewTableCellData(location, formatter); String preview = data.getDisplayString(); assertEquals(displayText, preview); }
public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); boolean isOffcut(); String getDisplayString(); @Override String toString(); String getHTMLDisplayString(); ProgramLocation getProgramLocation(); @Override int compareTo(PreviewTableCellData data); }
PreviewTableCellData implements Comparable<PreviewTableCellData> { public String getDisplayString() { if (displayString != null) { return displayString; } displayString = getPreview(false); return displayString; } PreviewTableCellData(ProgramLocation location, CodeUnitFormat codeUnitFormat); boolean isOffcut(); String getDisplayString(); @Override String toString(); String getHTMLDisplayString(); ProgramLocation getProgramLocation(); @Override int compareTo(PreviewTableCellData data);  }