@Override
	public Layout getLayout(BigInteger index) {
		if (index.compareTo(numIndexes) >= 0) {
			return null;
		}
		List<Field> fields = new ArrayList<Field>(factorys.length);
		for (FieldFactory factory : factorys) {
			Field field = factory.getField(index);
			if (field != null) {
				fields.add(field);
			}
		}
		if (fields.size() == 0) {
			if (factorys.length > 0) {
				FontMetrics fm = factorys[0].getMetrics();
				int height = fm.getMaxAscent() + fm.getMaxDescent();
				fields.add(
					new EmptyTextField(height, factorys[0].getStartX(), 0, factorys[0].getWidth()));
			}
			else {
				fields.add(new EmptyTextField(20, 0, 0, 10));
			}
		}
		Field[] fieldArray = new Field[fields.size()];
		fields.toArray(fieldArray);
		return new SingleRowLayout(fieldArray);
	}
Returns the total number of valid indexes.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerLayoutModel.java