com.gcapmedia.dab.epg.binary
Class NumericType
java.lang.Object
com.gcapmedia.dab.epg.binary.NumericType
- All Implemented Interfaces:
- Encodable
- Direct Known Subclasses:
- VersionType
public class NumericType
- extends java.lang.Object
- implements Encodable
Encode a number in a defined bitset
Constructor Summary |
NumericType(int number,
int size)
Create a new numeric type |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NumericType
public NumericType(int number,
int size)
- Create a new numeric type
- Parameters:
number
- Number to encodesize
- Number of bits to encode the number within
getNumber
public int getNumber()
- Returns:
- Returns the encoded number
getSize
public int getSize()
- Returns:
- Returns the number of bits to encode the number to
fromBytes
public static NumericType fromBytes(byte[] bytes,
int size)
- Parse the type from its byte array representation
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in interface Encodable
- Returns:
- Returns the data as bytes
- See Also:
Encodable.getBytes()
getLength
public int getLength()
- Specified by:
getLength
in interface Encodable
- Returns:
- Returns the length of this data
- See Also:
Encodable.getLength()
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
- See Also:
Object.equals(java.lang.Object)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
Copyright © 2007. All Rights Reserved.