Class DataSource.RowHandle<T>
- java.lang.Object
-
- com.vaadin.client.data.DataSource.RowHandle<T>
-
- Type Parameters:
T
- the row type
- Direct Known Subclasses:
AbstractRemoteDataSource.RowHandleImpl
- Enclosing interface:
- DataSource<T>
public abstract static class DataSource.RowHandle<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description RowHandle()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
protected abstract boolean
equalsExplicit(Object obj)
An explicit override forObject.equals(Object)
.abstract T
getRow()
Gets the most recent representation for the row this handle represents.int
hashCode()
protected abstract int
hashCodeExplicit()
An explicit override forObject.hashCode()
.abstract void
pin()
Marks this row as pinned.abstract void
unpin()
Marks this row as unpinned.abstract void
updateRow()
Informs the DataSource that the row data represented by this RowHandle has been updated.
-
-
-
Method Detail
-
getRow
public abstract T getRow() throws IllegalStateException
Gets the most recent representation for the row this handle represents.- Returns:
- the most recent representation for the row this handle represents
- Throws:
IllegalStateException
- if this row handle isn't currently pinned- See Also:
pin()
-
pin
public abstract void pin()
Marks this row as pinned.Note: Pinning a row multiple times requires an equal amount of unpins to free the row from the "pinned" status.
Technical Note: Pinning a row makes sure that the row object for a particular set of data is always kept as up to date as the data source is able to. Since the DataSource might create a new instance of an object, object references aren't necessarily kept up-to-date. This is a technical work-around for that.
- See Also:
unpin()
-
unpin
public abstract void unpin() throws IllegalStateException
Marks this row as unpinned.Note: Pinning a row multiple times requires an equal amount of unpins to free the row from the "pinned" status.
Technical Note: Pinning a row makes sure that the row object for a particular set of data is always kept as up to date as the data source is able to. Since the DataSource might create a new instance of an object, object references aren't necessarily kept up-to-date. This is a technical work-around for that.
- Throws:
IllegalStateException
- if this row handle has not been pinned before- See Also:
pin()
-
updateRow
public abstract void updateRow()
Informs the DataSource that the row data represented by this RowHandle has been updated. DataChangeHandler for the DataSource should be informed that parts of data have been updated.- See Also:
DataChangeHandler.dataUpdated(int, int)
-
equalsExplicit
protected abstract boolean equalsExplicit(Object obj)
An explicit override forObject.equals(Object)
. This method should be functionally equivalent to a properly implemented equals method.Having a properly implemented equals method is imperative for RowHandle to function. Because Java has no mechanism to force an override of an existing method, we're defining a new method for that instead.
- Parameters:
rowHandle
- the reference object with which to compare- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCodeExplicit
protected abstract int hashCodeExplicit()
An explicit override forObject.hashCode()
. This method should be functionally equivalent to a properly implemented hashCode method.Having a properly implemented hashCode method is imperative for RowHandle to function. Because Java has no mechanism to force an override of an existing method, we're defining a new method for that instead.
- Returns:
- a hash code value for this object
-
-