private ReferenceDB getRef(DBRecord rec) {
		long symbolID = -1;
		long addr = rec.getLongValue(ADDRESS_COL);

		RefListFlagsV0 flags = new RefListFlagsV0(rec.getByteValue(FLAGS_COL));
		RefType refType = RefTypeFactory.get(rec.getByteValue(TYPE_COL));
		byte opIndex = rec.getByteValue(OPINDEX_COL);

		SourceType source = flags.getSource();

		long offsetOrShift = 0;

		if (flags.hasSymbolID()) {
			symbolID = rec.getLongValue(SYMBOL_ID_COL);
		}
		Address from = isFrom ? address : addrMap.decodeAddress(addr);
		Address to = isFrom ? addrMap.decodeAddress(addr) : address;
		if (flags.isOffsetRef() || flags.isShiftRef()) {
			offsetOrShift = rec.getLongValue(OFFSET_COL);
			if (flags.isShiftRef()) {
				return new ShiftedReferenceDB(program, from, to, refType, opIndex, source,
					flags.isPrimary(), symbolID, (int) offsetOrShift);
			}
			return new OffsetReferenceDB(program, from, to, refType, opIndex, source,
				flags.isPrimary(), symbolID, offsetOrShift);
		}
		else if (to.isExternalAddress()) {
			return new ExternalReferenceDB(program, from, to, refType, opIndex, source);
		}
		else if (from.equals(Address.EXT_FROM_ADDRESS)) {
			return new EntryPointReferenceDB(from, to, refType, opIndex, source, flags.isPrimary(),
				symbolID);
		}
		else if (to.isStackAddress()) {
			return new StackReferenceDB(program, from, to, refType, opIndex, source,
				flags.isPrimary(), symbolID);
		}
		return new MemReferenceDB(program, from, to, refType, opIndex, source, flags.isPrimary(),
			symbolID);
	}
Construct reference list for existing record
@param rec existing refList record
@param adapter entry record storage adapter
@param addrMap address map for encoding/decoding addresses
@param program associated Program
@param cache RefList object cache
@param isFrom true for from-adapter use, false for to-adapter use
@throws IOException if database IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/references/BigRefListV0.java