eventproperty.java
来自「270的linux说明」· Java 代码 · 共 109 行
JAVA
109 行
/*
Copyright (c) 2008, Intel Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/package com.intel.mobile.base;/** * This class defines the event for a change in state of an entity. * <br>EventProperties are data members of ClassObjects, InstanceObjects and Properties. * <br>Each instance of an EventProperty in the system defines an available event for the entity that is a member of. * For example all Properties have attributes of type EventProperty named <b>Changed</b>. */public class EventProperty{ // private long nativeObjRef; protected com.intel.mobile.base.Object m_Parent; // no necessary protected EventType m_eType; // no necessary /* * Constructor * @param objRef * @param eType * @param parent * */ private EventProperty(int eType, com.intel.mobile.base.Object parent) { // this.nativeObjRef = objRef; this.m_eType = EventType.getEventType(eType); this.m_Parent = parent; } /** * Add the observer to the event. * When observed conditions match the target conditions, the notify() method of the observed object is invoked. * @param observer * @return * @throws IntelMobileException */ public boolean AddObserver(Observer observer) throws IntelMobileException { return AddObserverNative(m_Parent, m_eType.GetValue(), observer); } /** * Remove the observer from the event. * @param observer * @return * @throws IntelMobileException */ public boolean RemoveObserver(Observer observer) throws IntelMobileException { return RemoveObserverNative(m_Parent, m_eType.GetValue(), observer); } /** * Justify whether this event is supported. * @param * @return * @throws IntelMobileException */ public boolean IsAvailable() throws IntelMobileException { return IsAvailableNative(m_Parent, m_eType.GetValue()); } private native boolean AddObserverNative(com.intel.mobile.base.Object parent, int type, Observer observer) throws IntelMobileException; private native boolean RemoveObserverNative(com.intel.mobile.base.Object parent, int type, Observer observer) throws IntelMobileException; private native boolean IsAvailableNative(com.intel.mobile.base.Object parent, int type) throws IntelMobileException;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?