|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.view.ViewSupport
public abstract class ViewSupport
A helper class for View implementations that provides generic implementation for some of the methods. Methods that contain the actual logic of the view are not implemented in this class. A common implementation normally does not need to override any of the methods implemented here, their implementation is generic and should suffice. The class provides a convenience method for updateing it's children data updateChildren(Object[], Object[]). This method should be called from within the View.update(Object[], Object[]) methods in the subclasses.
Field Summary | |
---|---|
static View[] |
EMPTY_VIEW_ARRAY
|
protected Viewable |
parent
Parent viewable to this view - directly accessible by subclasses. |
Constructor Summary | |
---|---|
protected |
ViewSupport()
Constructor. |
Method Summary | |
---|---|
View |
addView(View view)
Add a view to the viewable object. |
static View[] |
addView(View[] children,
View view)
|
static void |
dumpChildViews(java.lang.String prefix,
Viewable parentViewable)
Convenience method for logging the child views of a Viewable. |
static void |
dumpUpdateParams(java.lang.String prefix,
java.lang.Object[] newData,
java.lang.Object[] oldData)
Convenience method for logging the parameters passed to the update method. |
static void |
dumpUpdateParams(java.lang.String prefix,
UniformPair<EventBean[]> result)
Convenience method for logging the parameters passed to the update method. |
static java.util.List<View> |
findDescendent(Viewable parentView,
Viewable descendentView)
Find the descendent view in the view tree under the parent view returning the list of view nodes between the parent view and the descendent view. |
static int |
findViewIndex(View[] children,
View view)
|
Viewable |
getParent()
Returns the View's parent Viewable. |
View[] |
getViews()
Returns all added views. |
boolean |
hasViews()
Test is there are any views to the Viewable. |
void |
removeAllViews()
Remove all views. |
boolean |
removeView(View view)
Remove a view. |
static View[] |
removeView(View[] children,
int index)
|
void |
setParent(Viewable parent)
Called when the View is added to a Viewable object. |
protected static void |
updateChildren(java.util.Collection<View> childViews,
EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data. |
void |
updateChildren(EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.espertech.esper.view.View |
---|
update |
Methods inherited from interface com.espertech.esper.view.EventCollection |
---|
getEventType, iterator |
Field Detail |
---|
public static final View[] EMPTY_VIEW_ARRAY
protected Viewable parent
Constructor Detail |
---|
protected ViewSupport()
Method Detail |
---|
public Viewable getParent()
View
getParent
in interface View
public void setParent(Viewable parent)
View
setParent
in interface View
parent
- is the parent that this view is a child ofpublic View addView(View view)
Viewable
addView
in interface Viewable
view
- to add
public boolean removeView(View view)
Viewable
removeView
in interface Viewable
view
- to remove
public void removeAllViews()
Viewable
removeAllViews
in interface Viewable
public View[] getViews()
Viewable
getViews
in interface Viewable
public boolean hasViews()
Viewable
hasViews
in interface Viewable
public void updateChildren(EventBean[] newData, EventBean[] oldData)
newData
- is the array of new event dataoldData
- is the array of old event dataprotected static void updateChildren(java.util.Collection<View> childViews, EventBean[] newData, EventBean[] oldData)
childViews
- is the list of child views to send the data tonewData
- is the array of new event dataoldData
- is the array of old event datapublic static void dumpUpdateParams(java.lang.String prefix, UniformPair<EventBean[]> result)
prefix
- is a prefix text to output for each lineresult
- is the data in an update callpublic static void dumpUpdateParams(java.lang.String prefix, java.lang.Object[] newData, java.lang.Object[] oldData)
prefix
- is a prefix text to output for each linenewData
- is the new data in an update calloldData
- is the old data in an update callpublic static void dumpChildViews(java.lang.String prefix, Viewable parentViewable)
prefix
- is a text to print for each view printedparentViewable
- is the parent for which the child views are displayed.public static java.util.List<View> findDescendent(Viewable parentView, Viewable descendentView)
parentView
- is the view to start searching underdescendentView
- is the view to find
public static View[] addView(View[] children, View view)
public static int findViewIndex(View[] children, View view)
public static View[] removeView(View[] children, int index)
|
© 2006-2015 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |