PageRenderTime 116ms CodeModel.GetById 107ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/protocols/ss7/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/primitives/NumberingPlan.java

http://mobicents.googlecode.com/
Java | 97 lines | 49 code | 9 blank | 39 comment | 1 complexity | 055304056dbceea908c95e247fa6a360 MD5 | raw file
 1/*
 2 * JBoss, Home of Professional Open Source
 3 * Copyright 2011, Red Hat, Inc. and individual contributors
 4 * by the @authors tag. See the copyright.txt in the distribution for a
 5 * full listing of individual contributors.
 6 *
 7 * This is free software; you can redistribute it and/or modify it
 8 * under the terms of the GNU Lesser General Public License as
 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */
22
23package org.mobicents.protocols.ss7.map.api.primitives;
24
25/**
26 * 
27 * -- 0000 unknown
28 * -- 0001 ISDN/Telephony Numbering Plan (Rec CCITT E.164)
29 * -- 0010 spare
30 * -- 0011 data numbering plan (CCITT Rec X.121)
31 * -- 0100 telex numbering plan (CCITT Rec F.69)
32 * -- 0101 spare
33 * -- 0110 land mobile numbering plan (CCITT Rec E.212)
34 * -- 0111 spare
35 * -- 1000 national numbering plan
36 * -- 1001 private numbering plan
37 * -- 1111 reserved for extension
38 * -- all other values are reserved.
39 *
40 * @author amit bhayani
41 *
42 */
43public enum NumberingPlan {
44	
45	unknown(0), 
46	ISDN(1), 
47	spare_2(2), 
48	data(3), 
49	telex(4), 
50	spare_5(5), 
51	land_mobile(6), 
52	spare_7(7),
53	national(8),
54	private_plan(9),
55	reserved(15);
56
57	private int indicator;
58
59	private NumberingPlan(int indicator) {
60		this.indicator = indicator;
61	}
62	
63
64	public int getIndicator() {
65		return indicator;
66	}
67
68	public static NumberingPlan getInstance(int indication) {
69		switch (indication) {
70		case 0:
71			return unknown;
72		case 1:
73			return ISDN;
74		case 2:
75			return spare_2;
76		case 3:
77			return data;
78		case 4:
79			return telex;
80		case 5:
81			return spare_5;
82		case 6:
83			return land_mobile;
84		case 7:
85			return spare_7;
86		case 8:
87			return national;
88		case 9:
89			return private_plan;
90		case 15:
91			return reserved;			
92		default:
93			return null;
94		}
95	}	
96
97}