View Javadoc

1   /*
2    *  XNap - A P2P framework and client.
3    *
4    *  See the file AUTHORS for copyright information.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation.
9    *
10   *  This program is distributed in the hope that it will be useful,
11   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *  GNU General Public License for more details.
14   *
15   *  You should have received a copy of the GNU General Public License
16   *  along with this program; if not, write to the Free Software
17   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18   */
19  
20  package org.xnap.plugin.opennap.util;
21  
22  import org.xnap.XNap;
23  import org.xnap.util.LinkType;
24  
25  /***
26   * Provides a mapping between connection speed and common internet acces 
27   * hardware.
28   */
29  public class OpenNapLinkType 
30  {
31  
32      //--- Constant(s) ---
33  
34      public static final LinkType MODEM144 
35  		= new LinkType(XNap.tr("14.4 kbps"), 14);
36  
37      public static final LinkType MODEM288
38  		= new LinkType(XNap.tr("28.8 kbps"), 28);
39  
40      public static final LinkType MODEM336
41  		= new LinkType(XNap.tr("33.6 kbps"), 33);
42  
43      public static final LinkType MODEM567
44  		= new LinkType(XNap.tr("56.7 kbps"), 56);
45  
46      public static final LinkType ISDN64 
47  	    = new LinkType(XNap.tr("64K ISDN"), 64);
48  
49      public static final LinkType ISDN128
50  	    = new LinkType(XNap.tr("128K ISDN"), 128);
51  
52      public static final LinkType T1 = new LinkType(XNap.tr("T1"), 3000);
53  
54      public static final LinkType[] TYPES = {
55  		LinkType.UNKNOWN, MODEM144, MODEM288, MODEM336, MODEM567,
56  		ISDN64, ISDN128, LinkType.CABLE, LinkType.DSL, T1, LinkType.T3
57      };
58  
59      //--- Method(s) ---
60  
61      /*
62       * @see LinkType.getIndexOfType(int)
63       */
64      public static int getIndexOfType(int speed)
65      {
66  		return LinkType.getIndexOfType(TYPES, speed);
67      }
68  
69      /***
70       * @see LinkType#getType(int)
71       */
72      public static LinkType getType(int speed)
73      {
74  		return LinkType.getType(TYPES, speed);
75      }
76  
77  }