TV-Browser 2.7.5 API

tvbrowserdataservice.file
Class ProgramField

java.lang.Object
  extended by tvbrowserdataservice.file.ProgramField
All Implemented Interfaces:
Cloneable

public class ProgramField
extends Object
implements Cloneable

Author:
Til Schneider, www.murfman.de

Constructor Summary
  ProgramField()
           
protected ProgramField(Object o)
          Used for creating an instance of ProgramField to read/store the additional ProgramFrame id in.
  ProgramField(ProgramFieldType type, byte[] data)
          Deprecated. use the factory method
  ProgramField(ProgramFieldType type, int value)
          Deprecated. use the factory method
  ProgramField(ProgramFieldType type, String text)
          Deprecated. use the factory method
 
Method Summary
static boolean arraysAreEqual(byte[] array1, byte[] array2)
           
 Object clone()
           
static ProgramField create(ProgramFieldType type, byte[] data)
           
static ProgramField create(ProgramFieldType type, int value)
           
static ProgramField create(ProgramFieldType type, String text)
           
 boolean equals(Object obj)
           
 byte[] getBinaryData()
           
 String getDataAsString()
          Gets a String representation of the data value.
 int getIntData()
           
 String getTextData()
           
 int getTimeData()
           
 ProgramFieldType getType()
           
 int getTypeId()
           
 void readFromStream(InputStream stream)
           
 void removeData()
          Is used for a field in an update file that should be deleted.
 void setBinaryData(byte[] data)
           
 void setIntData(int value)
           
 void setTextData(String text)
           
 void setTimeData(int minutesAfter1970)
           
 void setType(ProgramFieldType type)
           
 void writeToStream(OutputStream stream)
           
protected  void writeToStream(OutputStream stream, boolean check)
          Writes the data to a stream.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgramField

public ProgramField()

ProgramField

protected ProgramField(Object o)
Used for creating an instance of ProgramField to read/store the additional ProgramFrame id in.

Parameters:
o - Dummy parameter.
Since:
2.2.2

ProgramField

public ProgramField(ProgramFieldType type,
                    String text)
Deprecated. use the factory method


ProgramField

public ProgramField(ProgramFieldType type,
                    byte[] data)
Deprecated. use the factory method


ProgramField

public ProgramField(ProgramFieldType type,
                    int value)
Deprecated. use the factory method

Method Detail

create

public static ProgramField create(ProgramFieldType type,
                                  String text)

create

public static ProgramField create(ProgramFieldType type,
                                  byte[] data)

create

public static ProgramField create(ProgramFieldType type,
                                  int value)

clone

public Object clone()
Overrides:
clone in class Object

getTypeId

public int getTypeId()

getType

public ProgramFieldType getType()

setType

public void setType(ProgramFieldType type)
Parameters:
type -

removeData

public void removeData()
Is used for a field in an update file that should be deleted.


getBinaryData

public byte[] getBinaryData()

setBinaryData

public void setBinaryData(byte[] data)
Parameters:
data -

getTextData

public String getTextData()

setTextData

public void setTextData(String text)

getIntData

public int getIntData()

setIntData

public void setIntData(int value)

getTimeData

public int getTimeData()

setTimeData

public void setTimeData(int minutesAfter1970)

getDataAsString

public String getDataAsString()
Gets a String representation of the data value.

Returns:
the data value as String.

readFromStream

public void readFromStream(InputStream stream)
                    throws IOException,
                           FileFormatException
Throws:
IOException
FileFormatException

writeToStream

public void writeToStream(OutputStream stream)
                   throws IOException,
                          FileFormatException
Throws:
IOException
FileFormatException

writeToStream

protected void writeToStream(OutputStream stream,
                             boolean check)
                      throws IOException,
                             FileFormatException
Writes the data to a stream.

Parameters:
stream - The stream to write on
check - If the format should be checked
Throws:
IOException - Thrown if something goes wrong.
FileFormatException - Thrown if something goes wrong.
Since:
2.2.2

arraysAreEqual

public static boolean arraysAreEqual(byte[] array1,
                                     byte[] array2)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)