org.jmythapi.protocol.impl
Class MythPacket

java.lang.Object
  extended by org.jmythapi.protocol.impl.MythPacket
All Implemented Interfaces:
IVersionable, IMythPacket
Direct Known Subclasses:
ClientErrorPacket

public class MythPacket
extends Object
implements IMythPacket


Field Summary
 
Fields inherited from interface org.jmythapi.protocol.IMythPacket
DELIM
 
Constructor Summary
MythPacket(ProtocolVersion protoVersion, List<String> packetArguments)
          Creates a IMythPacket from the given argument list.
MythPacket(ProtocolVersion protoVersion, String packetString)
          Creates a IMythPacket from the given string.
MythPacket(ProtocolVersion protoVersion, String[] packetArguments)
          Creates a IMythPacket from the given argument array.
 
Method Summary
 String getPacketArg(int idx)
          Gets the packet argument value at the given position.
 List<String> getPacketArgs()
          Gets the packet arguments.
 int getPacketArgsLength()
          Gets the amount of the packet arguments.
 Date getPacketCreationTime()
          Gets the time when this packet was created.
 ProtocolVersion getVersionNr()
          Gets the protocol-version of an object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MythPacket

public MythPacket(ProtocolVersion protoVersion,
                  String packetString)
Creates a IMythPacket from the given string.

Parameters:
protoVersion - the MythTV-protocol version this packet belongs to
packetString - the packet data as String, e.g. QUERY_MEMSTATS or 1002[]:[]224[]:[]853[]:[]853

MythPacket

public MythPacket(ProtocolVersion protoVersion,
                  String[] packetArguments)
Creates a IMythPacket from the given argument array.

Parameters:
protoVersion - the MythTV-protocol version this packet belongs to
packetArguments - the packet data as Array, e.g. [QUERY_MEMSTATS] or [1002,224,853,853]

MythPacket

public MythPacket(ProtocolVersion protoVersion,
                  List<String> packetArguments)
Creates a IMythPacket from the given argument list.

Parameters:
protoVersion - the MythTV-protocol version this packet belongs to
packetArguments - the packet data as list, e.g. [QUERY_MEMSTATS] or [1002,224,853,853]
Method Detail

getPacketArgs

public List<String> getPacketArgs()
Description copied from interface: IMythPacket
Gets the packet arguments.

Specified by:
getPacketArgs in interface IMythPacket
Returns:
the packet arguments as list.

getPacketArgsLength

public int getPacketArgsLength()
Description copied from interface: IMythPacket
Gets the amount of the packet arguments.

Specified by:
getPacketArgsLength in interface IMythPacket
Returns:
the amount of arguments.

getPacketArg

public String getPacketArg(int idx)
Description copied from interface: IMythPacket
Gets the packet argument value at the given position.

Specified by:
getPacketArg in interface IMythPacket
Parameters:
idx - the position of the desired argument
Returns:
the argument value.

getPacketCreationTime

public Date getPacketCreationTime()
Description copied from interface: IMythPacket
Gets the time when this packet was created.

Specified by:
getPacketCreationTime in interface IMythPacket
Returns:
the packet creation time

toString

public String toString()
Overrides:
toString in class Object

getVersionNr

public ProtocolVersion getVersionNr()
Description copied from interface: IVersionable
Gets the protocol-version of an object.

Specified by:
getVersionNr in interface IVersionable
Returns:
the version a given object was created for.


Copyright © 2008-2013. All Rights Reserved.