📄 event.java
字号:
/*
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 methods to identify the type of an event, * the time it occurred and the object that originated the event. */public class Event extends EventBase{ // Constructor private Event(long objRef) { this.nativeObjRef = objRef; } // ------------- Accessor methods -------------- /** * Get the object that originated the event if it is still in scope. * The originator can be ClassObject, InstanceObject, Property and Threshold. * @return null if the originator object is out of scope * @throws IntelMobileException */ public com.intel.mobile.base.Object GetOriginator() throws IntelMobileException { return GetOriginatorNative(); } /** * Get the type of the object that originated the event. * The possible values can be "ClassObject", "InstanceObject", "Property" and "Threshold". * @return * @throws IntelMobileException */ public String GetObjectType() throws IntelMobileException { return GetObjectTypeNative(); } /** * Get the key for the object that originated the event. * <li>For ClassObject, it returns the name of the class, i.e. "NetworkAdapter"</li> * <li>For InstanceObject, it returns the instance (internal) key</li> * <li>For Property, it returns the name of the property</li> * <li>For Threshold, it returns the name of the monitored property</li> * @return * @throws IntelMobileException */ public String GetObjectKey() throws IntelMobileException { return GetObjectKeyNative(); } /** * Get the name of the device/Context type the originator object belongs to, i.e. "Battery". * In the case of Threshold it will be the type of the property being monitored. * @return * @throws IntelMobileException */ public String GetClassType() throws IntelMobileException { return GetClassTypeNative(); } /** * Get the key for the parent of the object that originated the event, if any. * <li>For ClassObject, it returns empty string</li> * <li>For InstanceObject, it returns empty string</li> * <li>For Property, it returns the (internal) key for its parent instance object</li> * <li>For Threshold, it returns the (internal) key for the instance object that the monitored property is a member of</li> * @return * @throws IntelMobileException */ public String GetParentKey() throws IntelMobileException { return GetParentKeyNative(); } /** * Get string description of the event type. * @return * @throws IntelMobileException */ public String GetTypeName() throws IntelMobileException { return GetTypeNameNative(); } /** * Get the time when the event was fired as a string. * @return * @throws IntelMobileException */ public String GetTSstring() throws IntelMobileException { return GetTSstringNative(); } /** * Get string description of the event type according to the EventType. * @param eType * @return * @throws IntelMobileException */ private native com.intel.mobile.base.Object GetOriginatorNative() throws IntelMobileException; private native String GetObjectTypeNative() throws IntelMobileException; private native String GetObjectKeyNative() throws IntelMobileException; private native String GetClassTypeNative() throws IntelMobileException; private native String GetParentKeyNative() throws IntelMobileException; private native String GetTypeNameNative() throws IntelMobileException; private native String GetTSstringNative() throws IntelMobileException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -