public DataType getNextDataType(DataType currentDataType, boolean stackPointers) {

		if (dataList.size() == 0) {
			return null;
		}

		DataType dataType = currentDataType;

		Pointer ptr = null;
		if (stackPointers && dataType instanceof Pointer) {
			ptr = (Pointer) dataType;
			dataType = getNextDataType(ptr.getDataType(), true);
			return ptr.newPointer(dataType);
		}

		int index = -1;
		if (dataType != null && !dataType.isEquivalent(DataType.DEFAULT)) {
			for (int i = 0; i < dataList.size(); i++) {
				DataType cycleDt = dataList.get(i);
				if (dataType.isEquivalent(cycleDt)) {
					index = i;
					break;
				}
			}
		}

		if (++index >= dataList.size()) {
			dataType = dataList.get(0);
		}
		else {
			dataType = dataList.get(index);
		}

		return dataType;
	}
Get next data-type which should be used
@param currentDataType current data type to which this cycle group is to be applied
@param stackPointers if true and currentDataType is a pointer, the pointer's 
base type will be cycled
@return next data-type
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/CycleGroup.java