- java.lang.Object
-
- javafx.beans.binding.SetExpression<E>
-
- javafx.beans.property.ReadOnlySetProperty<E>
-
- 参数类型
-
E-Set元素的类型
- All Implemented Interfaces:
-
Iterable<E>,Collection<E>,Set<E>,Observable,ReadOnlyProperty<ObservableSet<E>>,ObservableObjectValue<E>,ObservableSetValue<E>,ObservableValue<E>,ObservableSet<E>
- 已知直接子类:
-
ReadOnlySetPropertyBase,SetProperty
public abstract class ReadOnlySetProperty<E> extends SetExpression<E> implements ReadOnlyProperty<ObservableSet<E>>
所有readonly属性的超类包装一个ObservableSet。- 从以下版本开始:
- JavaFX 2.1
- 另请参见:
-
ObservableSet,ObservableSetValue,SetExpression,ReadOnlyProperty
-
-
Property Summary
-
Properties inherited from class javafx.beans.binding.SetExpression
empty, size
-
-
构造方法摘要
构造方法 Constructor 描述 ReadOnlySetProperty()构造函数为ReadOnlySetProperty。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 voidbindContent(ObservableSet<E> set)创建ObservableSet之间的内容绑定,即包装在这个ReadOnlySetProperty,另外ObservableSet。voidbindContentBidirectional(ObservableSet<E> set)创建一个双向内容绑定的ObservableSet,即包装在这个ReadOnlySetProperty和另一个ObservableSet。booleanequals(Object obj)指示一些其他对象是否等于此。inthashCode()返回此ReadOnlySetProperty对象的哈希码。StringtoString()返回此ReadOnlySetProperty对象的字符串表示形式。voidunbindContent(Object object)删除ObservableSet之间的内容绑定,即包含在这个ReadOnlySetProperty和另一个Object。voidunbindContentBidirectional(Object object)删除ObservableSet之间的双向内容绑定,即包含在此ReadOnlySetProperty和另一个Object。-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Methods inherited from interface javafx.beans.value.ObservableObjectValue
get
-
Methods inherited from interface javafx.collections.ObservableSet
addListener, removeListener
-
Methods inherited from interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
-
Methods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getName
-
Methods inherited from interface java.util.Set
of, of, of, of, of, of, of, of, of, of, of, of, spliterator
-
Methods inherited from class javafx.beans.binding.SetExpression
add, addAll, asString, clear, contains, containsAll, emptyProperty, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, remove, removeAll, retainAll, setExpression, size, sizeProperty, toArray, toArray
-
-
-
-
方法详细信息
-
bindContentBidirectional
public void bindContentBidirectional(ObservableSet<E> set)
创建一个双向内容绑定的ObservableSet,即包装在这个ReadOnlySetProperty,另外ObservableSet。双向内容绑定确保两个
ObservableSets的内容相同。 如果其中一个集合的内容更改,另一个内容将自动更新。- 参数
-
set-ObservableSet这个属性应该绑定 - 异常
-
NullPointerException- 如果set是null -
IllegalArgumentException- 如果set是相同的集合,这ReadOnlySetProperty指向
-
unbindContentBidirectional
public void unbindContentBidirectional(Object object)
删除ObservableSet之间的双向内容绑定,即包含在此ReadOnlySetProperty,另一个Object。- 参数
-
object- 应删除双向绑定的Object - 异常
-
NullPointerException- 如果object是null -
IllegalArgumentException- 如果object是相同的集合,这ReadOnlySetProperty指向
-
bindContent
public void bindContent(ObservableSet<E> set)
创建ObservableSet之间的内容绑定,即包含在这个ReadOnlySetProperty和另一个ObservableSet。内容绑定确保包装的内容
ObservableSets与其他集合的内容相同。 如果其他集合的内容更改,包装集将自动更新。 一旦包装的集合绑定到另一个集合,您不能直接更改它。- 参数
-
set-ObservableSet这个属性应该绑定 - 异常
-
NullPointerException- 如果set是null -
IllegalArgumentException- 如果set是这个ReadOnlySetProperty指向的相同集合
-
unbindContent
public void unbindContent(Object object)
删除ObservableSet之间的内容绑定,即包含在此ReadOnlySetProperty和另一个Object。- 参数
-
object- 应该删除绑定的Object - 异常
-
NullPointerException- 如果object是null -
IllegalArgumentException- 如果object是相同的集合,这ReadOnlySetProperty指向
-
equals
public boolean equals(Object obj)
描述从类复制:Object指示一些其他对象是否等于此。equals方法在非空对象引用上实现等价关系:- 自反性 :对于任何非空的参考值
x,x.equals(x)应该返回true。 - 它是对称的 :对于任何非空引用值
x和y,x.equals(y)应该返回true当且仅当y.equals(x)回报true。 - 传递性 :对于任何非空引用值
x,y,并z,如果x.equals(y)回报true和y.equals(z)回报true,然后x.equals(z)应该返回true。 - 它是一致的 :对于任何非空引用值
x和y,在多次调用x.equals(y)始终返回true或始终返回false,没有设置中使用的信息equals比较上的对象被修改。 - 对于任何非空的参考值
x,x.equals(null)应该返回false。
该
equals类方法Object实现对象上差别可能性最大的相等关系; 也就是说,对于任何非空参考值x和y,当且仅当x和y引用相同对象(x == y具有值true)时,该方法返回true。请注意,无论何时覆盖此方法,通常需要覆盖
hashCode方法,以便维护hashCode方法的通用合同,该方法规定相等的对象必须具有相等的哈希码。- Specified by:
-
equals在接口Collection<E> - Specified by:
-
equals在接口Set<E> - 重写:
-
equals在Object - 参数
-
obj- 与之比较的参考对象。 - 结果
-
true如果该对象与obj参数相同;false否则。 - 另请参见:
-
Object.hashCode(),HashMap
- 自反性 :对于任何非空的参考值
-
hashCode
public int hashCode()
返回此ReadOnlySetProperty对象的哈希码。- Specified by:
-
hashCode在接口Collection<E> - Specified by:
-
hashCode在接口Set<E> - 重写:
-
hashCode在Object - 结果
-
这个
ReadOnlySetProperty对象的哈希码。 - 另请参见:
-
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-
-