计算两个单元格之间的单元格数目(同一行)

@param preRef 前一个单元格位置，例如A1
@param ref 当前单元格位置，例如A8
@return 同一行中两个单元格之间的空单元格数
439962
public static int countNullCell(String preRef, String ref) {
		// excel2007最大行数是1048576，最大列数是16384，最后一列列名是XFD
		// 数字代表列，去掉列信息
		String preXfd = StrUtil.nullToDefault(preRef, "@").replaceAll("\\d+", "");
		String xfd = StrUtil.nullToDefault(ref, "@").replaceAll("\\d+", "");

		// A表示65，@表示64，如果A算作1，那@代表0
		// 填充最大位数3
		preXfd = StrUtil.fillBefore(preXfd, CELL_FILL_CHAR, MAX_CELL_BIT);
		xfd = StrUtil.fillBefore(xfd, CELL_FILL_CHAR, MAX_CELL_BIT);

		char[] preLetter = preXfd.toCharArray();
		char[] letter = xfd.toCharArray();
		// 用字母表示则最多三位，每26个字母进一位
		int res = (letter[0] - preLetter[0]) * 26 * 26 + (letter[1] - preLetter[1]) * 26 + (letter[2] - preLetter[2]);
		return res - 1;
	}
185062
public static <T, K> List<T> move(List<T> list, K key, K ref,
			Function<T, K> keyMapper, boolean before,
			Function<T, Integer> orderGet, OrderSetter<T> orderSet, int orderGap) {
		if (key == ref)
			return null;

		// { 找到要移动的项和参考项所在位置
		int keyidx = -1;
		int refidx = -1;
		int idx = 0;

		for (T t : list) {
			K id = keyMapper.apply(t);
			if (id.equals(key))
				keyidx = idx;
			if (id.equals(ref))
				refidx = idx;

			if (keyidx != -1 && refidx != -1)
				break;

			idx++;
		}

		if (keyidx == -1 || refidx == -1)
			return null;
		// }

		// { 拿走要移动的项
		T t = list.remove(keyidx);
		if (refidx >= keyidx)
			refidx--;

		if (!before)
			refidx++;
		// }

		// 放回要移动的项
		list.add(refidx, t);

		// { 设置排序位置
		ArrayList<T> moved = new ArrayList<T>();

		int startOrder = 0;
		if (refidx > 0)
			startOrder = orderGet.apply(list.get(refidx - 1));

		for (int i = refidx + 1; i < list.size(); i++) {
			int order = orderGet.apply(list.get(i));
			if (order - startOrder >= i - refidx + 1) {
				int gap = (order - startOrder) / (i - refidx + 1);
				for (int j = refidx; j < i; j++) {
					T move = list.get(j);

					orderSet.apply(move, startOrder + (j - refidx + 1) * gap);
					moved.add(move);
				}

				return moved;
			}
		}

		for (int i = refidx; i < list.size(); i++) {
			T move = list.get(i);

			orderSet.apply(move, startOrder + (i - refidx + 1) * orderGap);
			moved.add(move);
		}

		return moved;
		// }
	}
294723
public com.google.protobuf.ByteString
      getRefererBytes() {
    java.lang.Object ref = referer_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      referer_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
467554
public static ArrayList<MtasTreeHit<?>> advanceMtasTree(int position,
      IndexInput in, long ref, long objectRefApproxOffset) throws IOException {
    ArrayList<MtasTreeHit<?>> list = new ArrayList<MtasTreeHit<?>>();
    ArrayList<MtasTreeItem> checkList = new ArrayList<MtasTreeItem>();
    AtomicBoolean isSinglePoint = new AtomicBoolean(false);
    AtomicBoolean isStoreAdditonalId = new AtomicBoolean(false);
    AtomicLong nodeRefApproxOffset = new AtomicLong(-1);
    checkList.add(getMtasTreeItem(ref, isSinglePoint, isStoreAdditonalId,
        nodeRefApproxOffset, in, objectRefApproxOffset));
    ArrayList<Long> history = new ArrayList<Long>();
    do {
      MtasTreeItem checkItem = checkList.remove(checkList.size() - 1);
      advanceMtasTree(checkItem, position, in, isSinglePoint,
          isStoreAdditonalId, objectRefApproxOffset, list, nodeRefApproxOffset,
          checkList);
      history.add(checkItem.ref);
      if (history.size() > 1000) {
        throw new IOException(
            "ADVANCE " + position + " " + checkList + "\n" + history);
      }
    } while (checkList.size() > 0);
    return list;
  }
1047330
public static String getReferencePropertyOriginalName(final String refPropertyName) {
        final int i = refPropertyName.lastIndexOf(REFERENCE_PROPERTY_SUFFIX);
        return i < 0 ? refPropertyName : refPropertyName.substring(0, i);
    }
480201
public static Object get(Object object, RefBoolean before) {
	if (!isInside()) {
	    reset();
	    setIsInside(true);
	    before.setValue(false);
	}
	else before.setValue(true);

	Map<Object, Object> list = touch(false);
	return list == null ? null : list.get(object);
    }
619964
public static List<ClassRef> findBuildableReferences(ClassRef ref) {
        List<ClassRef>  result = new ArrayList<>();
        TypeDef def = new TypeDefBuilder(ref.getDefinition())
                .accept(new TypedVisitor<ClassRefBuilder>() {
                    @Override
                    public void visit(ClassRefBuilder builder) {
                        ClassRef candidate = builder.build();
                        if (isBuildable(candidate)) {
                            result.add(candidate);
                        }
                    }
                })
                .build();
        return result;
    }
630951
public static UDPBufferFactory getRef() {
        if (null == ofInstance) {
            synchronized (UDPBufferFactory.class) {
                if (null == ofInstance) {
                    ofInstance = new UDPBufferFactory();
                }
            }
        }
        return ofInstance;
    }
2550
int removeRef()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeRef");

    int ret = NOP;

    // If this is the last reference, then the operation is unsubscribe.

    if (--_refCount == 0)
      ret = UNSUBSCRIBE;

    checkRefCount();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeRef", String.valueOf(ret) +":"+ String.valueOf(_refCount));

    return ret;
  }
831537
protected boolean isVisited(PRIndirectReference ref) {
        IntHashtable refs = (IntHashtable)visited.get(ref.getReader());
        if (refs != null)
        	return refs.containsKey(ref.getNumber());
        else
        	return false;
    }
1334318
public Constituent getRef() {
    if (PTBConstituent_Type.featOkTst && ((PTBConstituent_Type)jcasType).casFeat_ref == null)
      jcasType.jcas.throwFeatMissing("ref", "de.julielab.jules.types.PTBConstituent");
    return (Constituent)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((PTBConstituent_Type)jcasType).casFeatCode_ref)));}
577625
protected boolean isPage(PRIndirectReference ref) {
        IntHashtable refs = (IntHashtable)pages2intrefs.get(ref.getReader());
        if (refs != null)
        	return refs.containsKey(ref.getNumber());
        else
        	return false;
    }
1222066
@Nullable
  public static <T> CloseableReference<T> cloneOrNull(@Nullable CloseableReference<T> ref) {
    return (ref != null) ? ref.cloneOrNull() : null;
  }
1351533
public <T> List<Key<T>> getKeysByRefs(final List<DBRef> refs) {
        final List<Key<T>> keys = new ArrayList<Key<T>>(refs.size());
        for (final DBRef ref : refs) {
            final Key<T> testKey = refToKey(ref);
            keys.add(testKey);
        }
        return keys;
    }
638971
public static Reference findPrimaryReference(List<Reference> references) {
        List<Reference> followsFrom = references.stream()
                .filter(ref -> References.FOLLOWS_FROM.equals(ref.getReferenceType())
                        && ref.getReferredTo() instanceof APMSpan)
                .collect(Collectors.toList());

        List<Reference> childOfSpan = references.stream()
                .filter(ref -> References.CHILD_OF.equals(ref.getReferenceType())
                        && ref.getReferredTo() instanceof APMSpan)
                .collect(Collectors.toList());

        List<Reference> extractedTraceState = references.stream()
                .filter(ref -> ref.getReferredTo() instanceof APMSpanBuilder)
                .collect(Collectors.toList());

        if (!extractedTraceState.isEmpty()) {
            if (extractedTraceState.size() == 1) {
                return extractedTraceState.get(0);
            }
            return null;
        }
        if (!childOfSpan.isEmpty()) {
            if (childOfSpan.size() == 1) {
                return childOfSpan.get(0);
            }
            return null;
        }
        if (followsFrom.size() == 1) {
            return followsFrom.get(0);
        }
        return null;
    }
1042666
@Override
    public Ref memberRef(Context cx, Object elem, int memberTypeFlags) {
        boolean attribute = (memberTypeFlags & Node.ATTRIBUTE_FLAG) != 0;
        boolean descendants = (memberTypeFlags & Node.DESCENDANTS_FLAG) != 0;
        if (!attribute && !descendants) {
            // Code generation would use ecma(Get|Has|Delete|Set) for
            // normal name identifiers so one ATTRIBUTE_FLAG
            // or DESCENDANTS_FLAG has to be set
            throw Kit.codeBug();
        }
        XmlNode.QName qname = lib.toNodeQName(cx, elem, attribute);
        XMLName rv = XMLName.create(qname, attribute, descendants);
        rv.initXMLObject(this);
        return rv;
    }
555535
function getRefValue (ref) {
  const thing = ref ? (ref.value ? ref.value : ref) : null
  if (thing && thing.$ref && typeof thing.$ref === 'string') {
    return thing.$ref
  }
}