summaryrefslogtreecommitdiff
path: root/android/sdl_android/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
blob: d724807d0b50f1d8aeac4e8f8961bf1a7262b328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.smartdevicelink.protocol.enums;

import java.util.Vector;

import com.smartdevicelink.util.ByteEnumer;

public class FrameType extends ByteEnumer {

	private static Vector<FrameType> theList = new Vector<FrameType>();
	public static Vector<FrameType> getList() { return theList; } 
	
	byte i = 0x00;
	
	protected FrameType(byte value, String name) {
		super(value, name);
	}
	
	public final static FrameType Control = new FrameType((byte)0x00, "Control");
	public final static FrameType Single = new FrameType((byte)0x01, "Single");
	public final static FrameType First = new FrameType((byte)0x02, "First");
	public final static FrameType Consecutive = new FrameType((byte)0x03, "Consecutive");
	
	static {
		theList.addElement(Control);
		theList.addElement(Single);
		theList.addElement(First);
		theList.addElement(Consecutive);
	}
	
	public static FrameType valueOf(byte passed) {
		return (FrameType) get(theList, passed);
	}
	
	public static FrameType[] values() {
		return theList.toArray(new FrameType[theList.size()]);
	}
}