本文整理了Java中org.zkoss.lang.Objects.equals()
方法的一些代码示例,展示了Objects.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Objects.equals()
方法的具体详情如下:
包路径:org.zkoss.lang.Objects
类名称: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
public String getSortDirection(Comparator<E> cmpr) {
if (Objects.equals(_sorting, cmpr))
return _sortDir ? "ascending" : "descending";
return "natural";
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the alignment: one of left, center, right, justify,
* @deprecated as of release 6.0.0, use CSS instead.
*/
public void setAlign(String align) {
if (align != null && align.length() == 0)
align = null;
if (!Objects.equals(_align, align)) {
_align = align;
smartUpdate("align", _align);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the alignment: one of top, texttop, middle, absmiddle,
* bottom, absbottom, baseline, left, right and center.
* @deprecated as of release 6.0.0, use CSS instead.
*/
public void setAlign(String align) {
if (align != null && align.length() == 0)
align = null;
if (!Objects.equals(_align, align)) {
_align = align;
smartUpdate("align", _align);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the locale used to identify the format of this datebox.
* <p>Default: null (i.e., {@link Locales#getCurrent}, the current locale
* is assumed)
* @since 5.0.7
*/
public void setLocale(Locale locale) {
if (!Objects.equals(_locale, locale)) {
_locale = locale;
invalidate();
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the vertical alignment of the whole row.
* Allowed values: top, middle, bottom, baseline
*/
public void setValign(String valign) {
if (!Objects.equals(_valign, valign)) {
_valign = valign;
smartUpdate("valign", _valign);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the label.
* <p>If label is changed, the whole component is invalidate.
* Thus, you want to smart-update, you have to override this method.
*/
public void setLabel(String label) {
if (label == null)
label = "";
if (!Objects.equals(_label, label)) {
_label = label;
smartUpdate("label", _label);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Sets the text annotation font.
* @param font the text annotation font.
*/
public void setTextFont(Font font) {
if (!Objects.equals(font, _textFont)) {
_textFont = font;
fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_FONT, font);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Sets the value font.
* @param font the value font.
*/
public void setValueFont(Font font) {
if (!Objects.equals(font, _valueFont)) {
_valueFont = font;
fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_FONT, font);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Sets the style class used for the content block.
*/
public void setContentSclass(String scls) {
if (!Objects.equals(_cntscls, scls)) {
_cntscls = scls;
smartUpdate("contentSclass", _cntscls);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Set the chart orientation.
* @param orient vertical or horizontal (default to vertical)
*/
public void setOrient(String orient) {
if (Objects.equals(orient, _orient)) {
return;
}
_orient = orient;
smartDrawChart();
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the applet class to run.
*/
public void setCode(String code) {
if (!Objects.equals(_code, code)) {
_code = code;
invalidate();
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the vertical spacing in pixels around an applet.
* @since 5.0.3
*/
public void setVspace(String vspace) {
if (!Objects.equals(_vspace, vspace)) {
_vspace = vspace;
invalidate();
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the alignment of an applet according to surrounding elements.
* <p>Refer to <a href="http://www.w3schools.com/tags/tag_applet.asp">HTML <applet> Tag</a>for more information.
* @since 5.0.3
*/
public void setAlign(String align) {
if (!Objects.equals(_align, align)) {
_align = align;
invalidate();
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Sets the Window Mode property of the Flash movie
* for transparency, layering, and positioning in the browser.
* @param wmode Possible values: window, opaque, transparent.
*/
public void setWmode(String wmode) {
if (!Objects.equals(_wmode, wmode)) {
_wmode = wmode;
smartUpdate("wmode", wmode);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Sets the expected version of the Flash player.
* @since 5.0.0
*/
public void setVersion(String version) {
if (!Objects.equals(_version, version)) {
_version = version;
smartUpdate("version", version);
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the target frame or window.
* @param target the name of the frame or window to hyperlink.
*/
public void setTarget(String target) {
if (target != null && target.length() == 0)
target = null;
if (!Objects.equals(_auxinf != null ? _auxinf.target : null, target)) {
initAuxInfo().target = target;
smartUpdate("target", getTarget());
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the href.
*/
public void setHref(String href) {
if (href != null && href.length() == 0)
href = null;
if (!Objects.equals(_auxinf != null ? _auxinf.href : null, href)) {
initAuxInfo().href = href;
smartUpdate("href", new EncodedHref()); //Bug 1850895
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the format.
*/
public void setFormat(String format) throws WrongValueException {
if (!Objects.equals(_format, format)) {
_format = format;
smartUpdate("format", getRealFormat());
smartUpdate("_value", marshall(_value));
//Technically, it shall be independent of format, but it is
//safer to send again (since some implementation might not good)
//See also bug 2998196.
}
}
代码示例来源:origin: org.zkoss.zk/zul
/** Sets the horizontal alignment.
* Allowed values: left,right,center,justify,char.
*/
public void setAlign(String align) {
if (!Objects.equals(getAlign(), align)) {
initAuxInfo().align = align;
smartUpdate("align", getAlign());
}
}
代码示例来源:origin: org.zkoss.zk/zul
/**
* Override super class to prepare the int width.
*/
public void setWidth(String w) {
if (Objects.equals(w, getWidth())) {
return;
}
_intWidth = stringToInt(w);
super.setWidth0(w); //ZK-2895: call the method which do not check vflex
smartDrawChart();
}
内容来源于网络,如有侵权,请联系作者删除!