ObservableArray

scalafx.collections.ObservableArray
See theObservableArray companion object
abstract class ObservableArray[V, T <: ObservableArray[V, T, D], D <: ObservableArray[D]](val delegate: D)(implicit evidence$1: ClassTag[V]) extends Builder[V, T], Observable, SFXDelegate[D]

Abstract $OA base class.

Attributes

Companion
object
Graph
Supertypes
trait Observable
trait SFXDelegate[D]
trait Builder[V, T]
trait Growable[V]
trait Clearable
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Value members

Abstract methods

def addAll(src: T): Unit

Append given observable array to the end of this array.

Append given observable array to the end of this array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

src

Elements to be appended.

Attributes

Throws
java.lang.ArrayStoreException

if element in src array could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def addAll(elems: V*): Unit

Append given elements to the end of this array.

Append given elements to the end of this array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

elems

Elements to be appended.

Attributes

Throws
java.lang.ArrayStoreException

if element in elements could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if elements is null.

def addAll(src: Array[V], srcIdx: Int, length: Int): Unit

Append portion of given regular array to the end of this array.

Append portion of given regular array to the end of this array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

length

Number of data elements to be appended.

src

Elements to be appended.

srcIdx

Start position in the src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of src array bounds.

java.lang.ArrayStoreException

if element in src array could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def addAll(src: T, srcIdx: Int, length: Int): Unit

Append portion of given regular array to the end of this array.

Append portion of given regular array to the end of this array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

length

Number of data elements to be appended.

src

Elements to be appended.

srcIdx

Start position in the src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of src array bounds.

java.lang.ArrayStoreException

if element in src array could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def copyTo(srcIdx: Int, dest: Array[V], destIdx: Int, length: Int): Unit

Copy specified portion of this observable array to dest regular array.

Copy specified portion of this observable array to dest regular array.

Value parameters

dest

Array into which the portion of this array is to be copied.

destIdx

Start position in the dest array.

length

Number of data elements to be copied.

srcIdx

Start position in this array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of either array bounds.

java.lang.ArrayStoreException

if element in this array could not be stored in dest array due to a type mismatch.

java.lang.NullPointerException

if dest is null.

def copyTo(srcIdx: Int, dest: T, destIdx: Int, length: Int): Unit

Copy specified portion of this observable array to dest observable array.

Copy specified portion of this observable array to dest observable array.

Value parameters

dest

Array into which the portion of this array is to be copied.

destIdx

Start position in the dest array.

length

Number of data elements to be copied.

srcIdx

Start position in this array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of either array bounds.

java.lang.ArrayStoreException

if element in this array could not be stored in dest array due to a type mismatch.

java.lang.NullPointerException

if dest is null.

def get(idx: Int): V

Select the element at idx in the array.

Select the element at idx in the array.

Value parameters

idx

Index of selected element.

Attributes

Returns

Element at given idx.

Throws
java.lang.ArrayIndexOutOfBoundsException

if idx does not satisfy 0 <= idx < length.

def set(idx: Int, value: V): Unit

Set the element at idx in the array to value.

Set the element at idx in the array to value.

Value parameters

idx

Index of element to be changed.

value

New value for element at idx.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if idx does not satisfy 0 <= idx < length.

def set(destIdx: Int, src: Array[V], srcIdx: Int, length: Int): Unit

Copy a portion of given regular array into this array, replacing affected contents.

Copy a portion of given regular array into this array, replacing affected contents.

Value parameters

destIdx

Start position in this array.

length

Number of data elements to be copied.

src

Array containing data to be copied.

srcIdx

Start position in src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of array bounds.

java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def set(destIdx: Int, src: T, srcIdx: Int, length: Int): Unit

Copy a portion of given observable array into this array, replacing affected contents.

Copy a portion of given observable array into this array, replacing affected contents.

Value parameters

destIdx

Start position in this array.

length

Number of data elements to be copied.

src

Array containing data to be copied.

srcIdx

Start position in src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of array bounds.

java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def setAll(elems: V*): Unit

Replace the contents of this array with the given elements.

Replace the contents of this array with the given elements.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

elems

New contents of this array.

Attributes

Throws
java.lang.ArrayStoreException

if element in elements could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if elements is null.

def setAll(src: T): Unit

Replace the contents of this array with the given observable array.

Replace the contents of this array with the given observable array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

src

Array to replace contents this array.

Attributes

Throws
java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def setAll(src: Array[V], srcIdx: Int, length: Int): Unit

Replace the contents of this array with portion of the given regular array.

Replace the contents of this array with portion of the given regular array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

length

Number of data elements to be copied.

src

Array to replace contents this array.

srcIdx

Start position in the src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of array bounds.

java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def setAll(src: T, srcIdx: Int, length: Int): Unit

Replace the contents of this array with portion of the given observable array.

Replace the contents of this array with portion of the given observable array.

Capacity is increased, if necessary, to match the new size of the data.

Value parameters

length

Number of data elements to be copied.

src

Array to replace contents this array.

srcIdx

Start position in the src array.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if copying would cause access out of array bounds.

java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

java.lang.NullPointerException

if src is null.

def toArray(dest: Array[V]): Array[V]

Write the contents of this array into the specified array, if it is large enough, or a new array if it is not.

Write the contents of this array into the specified array, if it is large enough, or a new array if it is not.

Value parameters

dest

Array into which this array will be written, if large enough to hold this array's contents. If null, this argument is ignored.

Attributes

Returns

The dest array if it is large enough to hold this array's data, or a new array, containing this array's copied contents.

Throws
java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

def toArray(srcIdx: Int, dest: Array[V], length: Int): Array[V]

Write a portion of this array's contents into the specified array, if it is large enough, or a new array if it is not.

Write a portion of this array's contents into the specified array, if it is large enough, or a new array if it is not.

Value parameters

dest

Array into which this array will be written, if large enough to hold this array's contents. If null, this argument is ignored.

length

Number of data elements to be copied.

srcIdx

Start position in this array.

Attributes

Returns

The dest array if it is large enough to hold this array's data, or a new array, containing this array's copied contents.

Throws
java.lang.ArrayStoreException

if element in src could not be stored in this array due to a type mismatch.

Concrete methods

def ++=(src: Array[V]): T

Append another array to this array.

Append another array to this array.

Value parameters

src

Array to be appended to this array.

Attributes

Returns

This array, expanded to contain the indicated array.

def ++=(src: T): T

Append another observable array to this array.

Append another observable array to this array.

Value parameters

src

Array to be appended to this array.

Attributes

Returns

This array, expanded to contain the indicated array.

override def addOne(elem: V): ObservableArray.this.type

Append new element to this ObservableArray.

Append new element to this ObservableArray.

Value parameters

elem

Element to be added to end of this array.

Attributes

Returns

This ObservableArray.

Definition Classes
def apply(idx: Int): V

Select an element by its index in the array.

Select an element by its index in the array.

Value parameters

idx

Index of selected element.

Attributes

Returns

Element at given idx.

Throws
java.lang.ArrayIndexOutOfBoundsException

if idx does not satisfy 0 <= idx < length.

override def clear(): Unit

Empty array, clearing builder contents, resizing it to zero.

Empty array, clearing builder contents, resizing it to zero.

Capacity is unchanged.

Attributes

Definition Classes
def ensureCapacity(capacity: Int): Unit

Grow array capacity if currently smaller than given capacity; do nothing otherwise.

Grow array capacity if currently smaller than given capacity; do nothing otherwise.

Value parameters

capacity

Required capacity.

Attributes

Tests whether the collection is empty.

Tests whether the collection is empty.

Attributes

Returns

true if the collection contains no elements, false otherwise.

def length: Int

Alias for size

Alias for size

Attributes

Tests whether the collection is not empty.

Tests whether the collection is not empty.

Attributes

Returns

true if the collection contains at least one element, false otherwise.

def onChange(op: (T, Change) => Unit): Subscription

Add a listener function to Array's changes.

Add a listener function to Array's changes.

Value parameters

op

Function that will handle this ObservableArray's modifications data, to be activated when some change is made.

Attributes

Note

This function '''will handle''' this array's modifications data. That is, it will be notified which array has been modified and which array elements have been changed.

def onChange(op: => Unit): Subscription

Add a listener function to Array's changes.

Add a listener function to Array's changes.

Value parameters

op

Function that will handle this ObservableArray's modifications data, to be activated when some change is made.

Attributes

Note

This function '''will not handle''' this array's modifications data. That is, it will be notified that an array it is associated with has changed, but not which array the which data within it was changed.

override def result(): T

Produces collection from builder.

Produces collection from builder.

Attributes

Returns

This ObservableArray.

Definition Classes
def size: Int

Retrieve length of data in this array.

Retrieve length of data in this array.

Attributes

Returns

Length of data in this array.

def toArray: Array[V]

Translate this observable array to a regular array.

Translate this observable array to a regular array.

Attributes

Returns

Regular array containing this array's contents.

def trimToSize(): Unit

Shrinks capacity to current length of data in this array.

Shrinks capacity to current length of data in this array.

Attributes

def update(idx: Int, value: V): Unit

Set the element at idx in the array to value.

Set the element at idx in the array to value.

Value parameters

idx

Index of element to be changed.

value

New value for element at idx.

Attributes

Throws
java.lang.ArrayIndexOutOfBoundsException

if idx does not satisfy 0 <= idx < length.

Inherited methods

final def ++=(xs: IterableOnce[V]): Growable.this.type

Attributes

Inherited from:
Growable
final def +=(elem: V): Growable.this.type

Attributes

Inherited from:
Growable
def addAll(xs: IterableOnce[V]): Growable.this.type

Attributes

Inherited from:
Growable
override def equals(ref: Any): Boolean

Verifies if a object is equals to this delegate.

Verifies if a object is equals to this delegate.

Value parameters

ref

Object to be compared.

Attributes

Returns

if the other object is equals to this delegate or not.

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate
override def hashCode: Int

Attributes

Returns

The delegate hashcode

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate
def knownSize: Int

Attributes

Inherited from:
Growable
def mapResult[NewTo](f: T => NewTo): Builder[A, NewTo]

Attributes

Inherited from:
Builder

Adds a no argument function as a JavaFX `InvalidationListener`. This function has no arguments because it will not handle invalidated values.

Adds a no argument function as a JavaFX `InvalidationListener`. This function has no arguments because it will not handle invalidated values.

Value parameters

op

A Function with no arguments. It will be called when value was invalidated.

Attributes

Returns

A new scalafx.event.subscriptions.Subscription to remove JavaFX InvalidationListener.

Inherited from:
Observable

Adds a function as a JavaFX `InvalidationListener`. This function has all arguments from `invalidated` method from InvalidationListener.

Adds a function as a JavaFX `InvalidationListener`. This function has all arguments from `invalidated` method from InvalidationListener.

Value parameters

op

Function that receives a ScalaFX Observable. It will be called when value was invalidated.

Attributes

Returns

A new scalafx.event.subscriptions.Subscription to remove JavaFX InvalidationListener.

Inherited from:
Observable
final def sizeHint(coll: IterableOnce[_], delta: Int): Unit

Attributes

Inherited from:
Builder

Attributes

Inherited from:
Builder

Attributes

Inherited from:
Builder
override def toString: String

Attributes

Returns

Returns the original delegate's toString() adding a [SFX] prefix.

Definition Classes
SFXDelegate -> Any
Inherited from:
SFXDelegate

Deprecated and Inherited methods

final def +=(elem1: V, elem2: V, elems: V*): Growable.this.type

Attributes

Deprecated
[Since version 2.13.0] Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
Inherited from:
Growable

Concrete fields

override val delegate: D

JavaFX object to be wrapped.

JavaFX object to be wrapped.

Attributes