File Source: DCCActions.java
1 /*
2 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23 package com.dmdirc.addons.dcc.actions;
24
25 import com.dmdirc.actions.interfaces.ActionMetaType;
26 import com.dmdirc.actions.interfaces.ActionType;
27
28 /**
29 * DCC actions.
30 *
31 * @author chris
32 */
/*
P/P * Method: DCCActions valueOf(String)
*
* Postconditions:
* init'ed(return_value)
*/
33 public enum DCCActions implements ActionType {
34
35 /** DCC Chat Request. */
/*
P/P * Method: com.dmdirc.addons.dcc.actions.DCCActions__static_init
*
* Postconditions:
* $VALUES == &new DCCActions[](DCCActions__static_init#12)
* DCC_CHAT_MESSAGE == &new DCCActions(DCCActions__static_init#3)
* $VALUES[2] == &new DCCActions(DCCActions__static_init#3)
* DCC_CHAT_REQUEST == &new DCCActions(DCCActions__static_init#1)
* $VALUES[0] == &new DCCActions(DCCActions__static_init#1)
* DCC_CHAT_REQUEST_SENT == &new DCCActions(DCCActions__static_init#2)
* $VALUES[1] == &new DCCActions(DCCActions__static_init#2)
* DCC_CHAT_SELFMESSAGE == &new DCCActions(DCCActions__static_init#4)
* $VALUES[3] == &new DCCActions(DCCActions__static_init#4)
* DCC_CHAT_SOCKETCLOSED == &new DCCActions(DCCActions__static_init#5)
* ...
*/
36 DCC_CHAT_REQUEST(DCCEvents.DCC_CHAT_REQUEST, "DCC Chat Requested"),
37 /** DCC Chat Request Sent. */
38 DCC_CHAT_REQUEST_SENT(DCCEvents.DCC_CHAT_REQUEST_SENT, "DCC Chat Request Sent"),
39 /** DCC Message from another person. */
40 DCC_CHAT_MESSAGE(DCCEvents.DCC_CHAT_MESSAGE, "DCC Chat Message Recieved"),
41 /** DCC Message to another person. */
42 DCC_CHAT_SELFMESSAGE(DCCEvents.DCC_CHAT_SELFMESSAGE, "DCC Chat Message Sent"),
43 /** DCC Chat Socket Closed. */
44 DCC_CHAT_SOCKETCLOSED(DCCEvents.DCC_CHAT_SOCKETCLOSED, "DCC Chat Socket Closed"),
45 /** DCC Chat Socket Opened. */
46 DCC_CHAT_SOCKETOPENED(DCCEvents.DCC_CHAT_SOCKETOPENED, "DCC Chat Socket Opened"),
47
48 /** DCC Send Socket Closed. */
49 DCC_SEND_SOCKETCLOSED(DCCEvents.DCC_SEND_SOCKETCLOSED, "DCC Send Socket Closed"),
50 /** DCC Send Socket Opened. */
51 DCC_SEND_SOCKETOPENED(DCCEvents.DCC_SEND_SOCKETOPENED, "DCC Send Socket Opened"),
52 /** DCC Send Data Transfered */
53 DCC_SEND_DATATRANSFERED(DCCEvents.DCC_SEND_DATATRANSFERED, "DCC Send Socket Closed"),
54 /** DCC Send Request. */
55 DCC_SEND_REQUEST(DCCEvents.DCC_SEND_REQUEST, "DCC Chat Requested"),
56 /** DCC Send Request Sent. */
57 DCC_SEND_REQUEST_SENT(DCCEvents.DCC_SEND_REQUEST_SENT, "DCC Chat Request Sent");
58
59 /** The type of this action. */
60 private final ActionMetaType type;
61
62 /** The name of this action. */
63 private final String name;
64
65 /**
66 * Constructs a new core action.
67 * @param type The type of this action
68 * @param name The name of this action
69 */
/*
P/P * Method: void com.dmdirc.addons.dcc.actions.DCCActions(String, int, ActionMetaType, String)
*
* Postconditions:
* this.name == name
* init'ed(this.name)
* this.type == type
* init'ed(this.type)
*/
70 DCCActions(final ActionMetaType type, final String name) {
71 this.type = type;
72 this.name = name;
73 }
74
75 /** {@inheritDoc} */
76 @Override
77 public ActionMetaType getType() {
/*
P/P * Method: ActionMetaType getType()
*
* Postconditions:
* return_value == this.type
* init'ed(return_value)
*/
78 return type;
79 }
80
81 /** {@inheritDoc} */
82 @Override
83 public String getName() {
/*
P/P * Method: String getName()
*
* Postconditions:
* return_value == this.name
* init'ed(return_value)
*/
84 return name;
85 }
86 }
SofCheck Inspector Build Version : 2.17854
| DCCActions.java |
2009-Jun-25 01:54:24 |
| DCCActions.class |
2009-Sep-02 17:04:15 |