1 package com.smartdevicelink.util;
\r
3 import java.util.Enumeration;
\r
4 import java.util.Vector;
\r
6 public abstract class ByteEnumer {
\r
8 protected ByteEnumer(byte value, String name) {
\r
14 private String name;
\r
16 public byte getValue() { return value; }
\r
17 public String getName() { return name; }
\r
19 public boolean equals(ByteEnumer other) {
\r
20 return name == other.getName();
\r
23 public boolean eq(ByteEnumer other) {
\r
24 return equals(other);
\r
27 public byte value() {
\r
31 public static ByteEnumer get(Vector theList, byte value) {
\r
32 Enumeration enumer = theList.elements();
\r
33 while (enumer.hasMoreElements()) {
\r
34 ByteEnumer current = (ByteEnumer)enumer.nextElement();
\r
35 if (current.getValue() == value) {
\r
42 public static ByteEnumer get(Vector theList, String name) {
\r
43 Enumeration enumer = theList.elements();
\r
44 while (enumer.hasMoreElements()) {
\r
45 ByteEnumer current = (ByteEnumer)enumer.nextElement();
\r
46 if (current.getName().equals(name)) {
\r