org.zkoss.lang.Objects.equals()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中org.zkoss.lang.Objects.equals()方法的一些代码示例,展示了Objects.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Objects.equals()方法的具体详情如下:
包路径:org.zkoss.lang.Objects
类名称:Objects
方法名:equals

Objects.equals介绍

[英]Tests whether two objects are equals.

It takes care of the null case. Thus, it is helpful to implement Object.equals.

Notice: it uses compareTo if BigDecimal is found. So, in this case, a.equals(b) might not be the same as Objects.equals(a, b).

If both a and b are Object[], they are compared item-by-item.
[中]测试两个对象是否相等。
它处理空的情况。因此,实现对象是有帮助的。等于。
注意:如果找到BigDecimal,则使用compareTo。因此,在这种情况下,a.equals(b)可能与对象不同。等于(a,b)。
如果a和b都是Object[],则会逐项进行比较。

代码示例

代码示例来源:origin: org.zkoss.zk/zul

  1. public String getSortDirection(Comparator<E> cmpr) {
  2. if (Objects.equals(_sorting, cmpr))
  3. return _sortDir ? "ascending" : "descending";
  4. return "natural";
  5. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the alignment: one of left, center, right, justify,
  2. * @deprecated as of release 6.0.0, use CSS instead.
  3. */
  4. public void setAlign(String align) {
  5. if (align != null && align.length() == 0)
  6. align = null;
  7. if (!Objects.equals(_align, align)) {
  8. _align = align;
  9. smartUpdate("align", _align);
  10. }
  11. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the alignment: one of top, texttop, middle, absmiddle,
  2. * bottom, absbottom, baseline, left, right and center.
  3. * @deprecated as of release 6.0.0, use CSS instead.
  4. */
  5. public void setAlign(String align) {
  6. if (align != null && align.length() == 0)
  7. align = null;
  8. if (!Objects.equals(_align, align)) {
  9. _align = align;
  10. smartUpdate("align", _align);
  11. }
  12. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the locale used to identify the format of this datebox.
  2. * <p>Default: null (i.e., {@link Locales#getCurrent}, the current locale
  3. * is assumed)
  4. * @since 5.0.7
  5. */
  6. public void setLocale(Locale locale) {
  7. if (!Objects.equals(_locale, locale)) {
  8. _locale = locale;
  9. invalidate();
  10. }
  11. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the vertical alignment of the whole row.
  2. * Allowed values: top, middle, bottom, baseline
  3. */
  4. public void setValign(String valign) {
  5. if (!Objects.equals(_valign, valign)) {
  6. _valign = valign;
  7. smartUpdate("valign", _valign);
  8. }
  9. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the label.
  2. * <p>If label is changed, the whole component is invalidate.
  3. * Thus, you want to smart-update, you have to override this method.
  4. */
  5. public void setLabel(String label) {
  6. if (label == null)
  7. label = "";
  8. if (!Objects.equals(_label, label)) {
  9. _label = label;
  10. smartUpdate("label", _label);
  11. }
  12. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Sets the text annotation font.
  3. * @param font the text annotation font.
  4. */
  5. public void setTextFont(Font font) {
  6. if (!Objects.equals(font, _textFont)) {
  7. _textFont = font;
  8. fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_FONT, font);
  9. }
  10. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Sets the value font.
  3. * @param font the value font.
  4. */
  5. public void setValueFont(Font font) {
  6. if (!Objects.equals(font, _valueFont)) {
  7. _valueFont = font;
  8. fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_FONT, font);
  9. }
  10. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Sets the style class used for the content block.
  3. */
  4. public void setContentSclass(String scls) {
  5. if (!Objects.equals(_cntscls, scls)) {
  6. _cntscls = scls;
  7. smartUpdate("contentSclass", _cntscls);
  8. }
  9. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Set the chart orientation.
  3. * @param orient vertical or horizontal (default to vertical)
  4. */
  5. public void setOrient(String orient) {
  6. if (Objects.equals(orient, _orient)) {
  7. return;
  8. }
  9. _orient = orient;
  10. smartDrawChart();
  11. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the applet class to run.
  2. */
  3. public void setCode(String code) {
  4. if (!Objects.equals(_code, code)) {
  5. _code = code;
  6. invalidate();
  7. }
  8. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the vertical spacing in pixels around an applet.
  2. * @since 5.0.3
  3. */
  4. public void setVspace(String vspace) {
  5. if (!Objects.equals(_vspace, vspace)) {
  6. _vspace = vspace;
  7. invalidate();
  8. }
  9. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the alignment of an applet according to surrounding elements.
  2. * <p>Refer to <a href="http://www.w3schools.com/tags/tag_applet.asp">HTML &lt;applet> Tag</a>for more information.
  3. * @since 5.0.3
  4. */
  5. public void setAlign(String align) {
  6. if (!Objects.equals(_align, align)) {
  7. _align = align;
  8. invalidate();
  9. }
  10. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Sets the Window Mode property of the Flash movie
  3. * for transparency, layering, and positioning in the browser.
  4. * @param wmode Possible values: window, opaque, transparent.
  5. */
  6. public void setWmode(String wmode) {
  7. if (!Objects.equals(_wmode, wmode)) {
  8. _wmode = wmode;
  9. smartUpdate("wmode", wmode);
  10. }
  11. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Sets the expected version of the Flash player.
  3. * @since 5.0.0
  4. */
  5. public void setVersion(String version) {
  6. if (!Objects.equals(_version, version)) {
  7. _version = version;
  8. smartUpdate("version", version);
  9. }
  10. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the target frame or window.
  2. * @param target the name of the frame or window to hyperlink.
  3. */
  4. public void setTarget(String target) {
  5. if (target != null && target.length() == 0)
  6. target = null;
  7. if (!Objects.equals(_auxinf != null ? _auxinf.target : null, target)) {
  8. initAuxInfo().target = target;
  9. smartUpdate("target", getTarget());
  10. }
  11. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the href.
  2. */
  3. public void setHref(String href) {
  4. if (href != null && href.length() == 0)
  5. href = null;
  6. if (!Objects.equals(_auxinf != null ? _auxinf.href : null, href)) {
  7. initAuxInfo().href = href;
  8. smartUpdate("href", new EncodedHref()); //Bug 1850895
  9. }
  10. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the format.
  2. */
  3. public void setFormat(String format) throws WrongValueException {
  4. if (!Objects.equals(_format, format)) {
  5. _format = format;
  6. smartUpdate("format", getRealFormat());
  7. smartUpdate("_value", marshall(_value));
  8. //Technically, it shall be independent of format, but it is
  9. //safer to send again (since some implementation might not good)
  10. //See also bug 2998196.
  11. }
  12. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /** Sets the horizontal alignment.
  2. * Allowed values: left,right,center,justify,char.
  3. */
  4. public void setAlign(String align) {
  5. if (!Objects.equals(getAlign(), align)) {
  6. initAuxInfo().align = align;
  7. smartUpdate("align", getAlign());
  8. }
  9. }

代码示例来源:origin: org.zkoss.zk/zul

  1. /**
  2. * Override super class to prepare the int width.
  3. */
  4. public void setWidth(String w) {
  5. if (Objects.equals(w, getWidth())) {
  6. return;
  7. }
  8. _intWidth = stringToInt(w);
  9. super.setWidth0(w); //ZK-2895: call the method which do not check vflex
  10. smartDrawChart();
  11. }

相关文章