📄 timedobserver.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_06) on Sun Feb 12 23:46:48 CST 2006 -->
<TITLE>
TimedObserver
</TITLE>
<META NAME="keywords" CONTENT="net.conic.prototype.TimedObserver class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="TimedObserver";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../net/conic/prototype/package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TimedObserver.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类"><B>上一个类</B></A>
<A HREF="../../../net/conic/prototype/Try.html" title="net.conic.prototype 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/conic/prototype/TimedObserver.html" target="_top"><B>框架</B></A>
<A HREF="TimedObserver.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | <A HREF="#constructor_summary">构造函数</A> | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | <A HREF="#constructor_detail">构造函数</A> | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.conic.prototype</FONT>
<BR>
类 TimedObserver</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><B>net.conic.prototype.TimedObserver</B>
</PRE>
<DL>
<DT><B>直接已知子类:</B> <DD><A HREF="../../../net/conic/prototype/FormElementObserver.html" title="net.conic.prototype 中的类">FormElementObserver</A>, <A HREF="../../../net/conic/prototype/FormObserver.html" title="net.conic.prototype 中的类">FormObserver</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>TimedObserver</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
基于定时机制的侦听对象内容变更的抽象类,与EventObserver的区别在于前者是定时轮循时侦听Value变更并执行回调,后者是事件发生时才执行回调。
<P>
<P>
<DL>
<DT><B>版本:</B></DT>
<DD>Prototype Document Version 0.1</DD>
<DT><B>作者:</B></DT>
<DD>Chen (Email:jtjdskq@126.com) <p>主要用于监听一个对象内部内容发生变更时回调指定的方法。如需要自已实现其它方式的侦听可以参考它的子类实现情况</DD>
<DT><B>另请参见:</B><DD><A HREF="../../../net/conic/prototype/FormElementObserver.html" title="net.conic.prototype 中的类"><CODE>FormElementObserver</CODE></A>,
<A HREF="../../../net/conic/prototype/FormObserver.html" title="net.conic.prototype 中的类"><CODE>FormObserver</CODE></A></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>构造函数摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/TimedObserver.html#TimedObserver(net.conic.prototype.Object, int, net.conic.prototype.Function)">TimedObserver</A></B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> element,
int frequency,
<A HREF="../../../net/conic/prototype/Function.html" title="net.conic.prototype 中的类">Function</A> callback)</CODE>
<BR>
此初始化构造方法在子类初始化通过调用此方法做初始化</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>方法摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract <A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/TimedObserver.html#getValue()">getValue</A></B>()</CODE>
<BR>
给子类定义其关注的变更对象的值</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/TimedObserver.html#onTimerEvent()">onTimerEvent</A></B>()</CODE>
<BR>
定时执行的事件。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/TimedObserver.html#registerCallback()">registerCallback</A></B>()</CODE>
<BR>
开始定时运行,并注册指定的callback方法.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>从类 java.lang.Object 继承的方法</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>构造函数详细信息</B></FONT></TH>
</TR>
</TABLE>
<A NAME="TimedObserver(net.conic.prototype.Object, int, net.conic.prototype.Function)"><!-- --></A><H3>
TimedObserver</H3>
<PRE>
protected <B>TimedObserver</B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> element,
int frequency,
<A HREF="../../../net/conic/prototype/Function.html" title="net.conic.prototype 中的类">Function</A> callback)</PRE>
<DL>
<DD>此初始化构造方法在子类初始化通过调用此方法做初始化
<P>
<DL>
<DT><B>参数:</B><DD><CODE>element</CODE> - 被监听对象的id或者直接是对象的引用<DD><CODE>frequency</CODE> - 周期( 单位:秒)<DD><CODE>callback</CODE> - 触发时调用方法对象,以function(element,value){}的形式引入</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>方法详细信息</B></FONT></TH>
</TR>
</TABLE>
<A NAME="registerCallback()"><!-- --></A><H3>
registerCallback</H3>
<PRE>
protected void <B>registerCallback</B>()</PRE>
<DL>
<DD>开始定时运行,并注册指定的callback方法. <b>内部方法,外部建议不要使用!</b>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="onTimerEvent()"><!-- --></A><H3>
onTimerEvent</H3>
<PRE>
protected void <B>onTimerEvent</B>()</PRE>
<DL>
<DD>定时执行的事件。<b>内部方法,外部建议不要使用!</b> 内部实现主要是根据@see #getValue()返回的值与初始化时@see #getValue()出来的初始值进行比较, 如果值发现变更,则调用引入的callback方法。
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getValue()"><!-- --></A><H3>
getValue</H3>
<PRE>
protected abstract <A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> <B>getValue</B>()</PRE>
<DL>
<DD>给子类定义其关注的变更对象的值
<P>
<DD><DL>
<DT><B>返回:</B><DD>返回关注的对象的值</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../net/conic/prototype/package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/TimedObserver.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类"><B>上一个类</B></A>
<A HREF="../../../net/conic/prototype/Try.html" title="net.conic.prototype 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/conic/prototype/TimedObserver.html" target="_top"><B>框架</B></A>
<A HREF="TimedObserver.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | <A HREF="#constructor_summary">构造函数</A> | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | <A HREF="#constructor_detail">构造函数</A> | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -