eventtype.java

来自「270的linux说明」· Java 代码 · 共 398 行

JAVA
398
字号
/*

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;/** * Present the enum type for all events. */public final class EventType{    private static int nextValue = 0;        public static final EventType eNone                 = new EventType("None");    // Property    public static final EventType eChanged              = new EventType("Changed");    // ClassObject    public static final EventType eAdded                  = new EventType("Added");    public static final EventType eRemoved               = new EventType("Removed");    // Connectivity    public static final EventType eConnected              = new EventType("Connected");    public static final EventType eDisconnected           = new EventType("Disconnected");    public static final EventType eRouteTableChanged     = new EventType("RouteTableChanged");    public static final EventType eIpAddressChanged      = new EventType("IpAddressChanged");    // InstanceObject    public static final EventType eStatusChanged         = new EventType("StatusChanged");    // LinkProtocol    public static final EventType eMediaConnected         = new EventType("MediaConnected");    public static final EventType eMediaDisconnected      = new EventType("MediaDisconnected");    // CounterThreshold    public static final EventType eThresholdReached     = new EventType("ThresholdReached");    // GaugeThreshold    public static final EventType eThresholdLow         = new EventType("ThresholdLow");    public static final EventType eThresholdHigh        = new EventType("ThresholdHigh");    // ValueThreshold    public static final EventType eThresholdEqual       = new EventType("ThresholdEqual");    public static final EventType eThresholdDiffer      = new EventType("ThresholdDiffer");    // Platform    public static final EventType eShutdownRequested    = new EventType("ShutdownRequested");    public static final EventType eShuttingDown         = new EventType("ShuttingDown");    public static final EventType eSuspendRequested     = new EventType("SuspendRequested");    public static final EventType eSuspending           = new EventType("Suspending");    public static final EventType eResumedCritically       = new EventType("ResumedCritically");    public static final EventType eResumedNormally         = new EventType("ResumedNormally");    // Power	public static final EventType eInternallyPowered        = new EventType("InternallyPowered");	public static final EventType eExternallyPowered        = new EventType("ExternallyPowered");	public static final EventType eFullyCharged         = new EventType("FullyCharged");	// Battery	public static final EventType eGoingOffline         = new EventType("GoingOffline");	public static final EventType ePoweringSystem       = new EventType("PoweringSystem");	// Bandwidth	public static final EventType eBandwidthChanged     = new EventType("BandwidthChanged");	// Unkown    public static final EventType eUnknown              = new EventType("Unknown");    // Display    public static final EventType eScreenBlanked       = new EventType("ScreenBlanked");    public static final EventType eScreenUnblanked       = new EventType("ScreenUnblanked");	// Wwan	public static final EventType eEnteringCoverage  = new EventType("EnteringCoverage");	public static final EventType eLeavingCoverage   = new EventType("LeavingCoverage");	public static final EventType eCallIncoming      = new EventType("CallIncoming");	public static final EventType eCallConnecting    = new EventType("CallConnecting");	public static final EventType eCallConnected     = new EventType("CallConnected");	public static final EventType eCallDisconnected  = new EventType("CallDisconnected");	public static final EventType eReset       = new EventType("Reset");	public static final EventType eEnteringPowerSave = new EventType("EnteringPowerSave");	public static final EventType eLeavingPowerSave  = new EventType("LeavingPowerSave");	// 802.11	public static final EventType eAssociated        = new EventType("Associated");	public static final EventType eDisassociated     = new EventType("Disassociated");	public static final EventType eStatisticsReset   = new EventType("StatisticsReset");	// Bluetooth	public static final EventType eRadioEnabled      = new EventType("RadioEnabled");	public static final EventType eRadioDisabled     = new EventType("RadioDisabled");	// Radio Adapter 	public static final EventType eHardwareRadioDisabled = new EventType("HardwareRadioDisabled");	public static final EventType eHardwareRadioEnabled  = new EventType("HardwareRadioEnabled");	public static final EventType eSoftwareRadioDisabled = new EventType("SoftwareRadioDisabled");	public static final EventType eSoftwareRadioEnabled  = new EventType("SoftwareRadioEnabled");    private int value;    private String desc;        // Constructor    private EventType(String desc)    {        this.value = nextValue;        nextValue++;                this.desc = desc;    }        /**     * Get int value of the EventType     * @return     */    public int GetValue()    {        return value;    }        /**     * Override method     * @param obj     * @return     */    public boolean equals(java.lang.Object obj)    {        if (obj instanceof EventType)        {            return value == ((EventType)obj).value;        }        return false;    }        /**     * Override method     * @return     */    public int hashCode()    {        return value;    }        /**     * Override method     * @return     */    public String toString()    {        return desc;    }        /**     * Get event type according to the int value.     * @param eType int     * @return The pre-defined object     */    public static EventType getEventType(int eType)    {		if (eType == eNone.value)		{			return eNone;		}			// Property		else if (eType == eChanged.value)		{			return eChanged;		}			// ClassObject		else if (eType == eAdded.value)		{			return eAdded;		}		else if (eType == eRemoved.value)		{			return eRemoved;		}			// Connectivity		else if (eType == eConnected.value)		{			return eConnected;		}		else if (eType == eDisconnected.value)		{			return eDisconnected;		}		else if (eType == eRouteTableChanged.value)		{			return eRouteTableChanged;		}		else if (eType == eIpAddressChanged.value)		{			return eIpAddressChanged;		}		else if (eType == eStatusChanged.value)		{			return eStatusChanged;		}			// LinkProtocol		else if (eType == eMediaConnected.value)		{			return eMediaConnected;		}		else if (eType == eMediaDisconnected.value)		{			return eMediaDisconnected;		}			// CounterThreshold		else if (eType == eThresholdReached.value)		{			return eThresholdReached;		}			// GaugeThreshold		else if (eType == eThresholdLow.value)		{			return eThresholdLow;		}		else if (eType == eThresholdHigh.value)		{			return eThresholdHigh;		}			// ValueThreshold		else if (eType == eThresholdEqual.value)		{			return eThresholdEqual;		}		else if (eType == eThresholdDiffer.value)		{			return eThresholdDiffer;		}			// Platform		else if (eType == eShutdownRequested.value)		{			return eShutdownRequested;		}		else if (eType == eShuttingDown.value)		{			return eShuttingDown;		}		else if (eType == eSuspendRequested.value)		{			return eSuspendRequested;		}		else if (eType == eSuspending.value)		{			return eSuspending;		}		else if (eType == eResumedCritically.value)		{			return eResumedCritically;		}		else if (eType == eResumedNormally.value)		{			return eResumedNormally;		}			// Power		else if (eType == eInternallyPowered.value)		{			return 	eInternallyPowered;		}		else if (eType == eExternallyPowered.value)		{			return 	eExternallyPowered;		}		else if (eType == eFullyCharged.value)		{			return eFullyCharged;		}			// Battery		else if (eType == eGoingOffline.value)		{			return eGoingOffline;		}		else if (eType == ePoweringSystem.value)		{			return ePoweringSystem;		}			// Bandwidth		else if (eType == eBandwidthChanged.value)		{			return eBandwidthChanged;		}			// Unkown		else if (eType == eUnknown.value)		{			return eUnknown;		}			// Display		else if (eType == eScreenBlanked.value)		{			return eScreenBlanked;		}		else if (eType == eScreenUnblanked.value)		{			return eScreenUnblanked;		}			// Wwan		else if (eType == eEnteringCoverage.value)		{			return eEnteringCoverage;		}		else if (eType == eLeavingCoverage.value)		{			return eLeavingCoverage;		}		else if (eType == eCallIncoming.value)		{			return eCallIncoming;		}		else if (eType == eCallConnecting.value)		{			return eCallConnecting;		}		else if (eType == eCallConnected.value)		{			return eCallConnected;		}		else if (eType == eCallDisconnected.value)		{			return eCallDisconnected;		}		else if (eType == eReset.value)		{			return eReset;		}		else if (eType == eEnteringPowerSave.value)		{			return eEnteringPowerSave;		}		else if (eType == eLeavingPowerSave.value)		{			return eLeavingPowerSave;		}			// 802.11		else if (eType == eAssociated.value)		{			return eAssociated;		}		else if (eType == eDisassociated.value)		{			return eDisassociated;		}		else if (eType == eStatisticsReset.value)		{			return eStatisticsReset;		}			// Bluetooth		else if (eType == eRadioEnabled.value)		{			return eRadioEnabled;		}		else if (eType == eRadioDisabled.value)		{			return eRadioDisabled;		}			// Radio Adapter		else if (eType == eHardwareRadioDisabled.value)		{			return eHardwareRadioDisabled;		}		else if (eType == eHardwareRadioEnabled.value)		{			return eHardwareRadioEnabled;		}		else if (eType == eSoftwareRadioDisabled.value)		{			return eSoftwareRadioDisabled;		}		else if (eType == eSoftwareRadioEnabled.value)		{			return eSoftwareRadioEnabled;		}		else		{			return eUnknown;		}		    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?