solar.impl
Class EventFactory

java.lang.Object
  |
  +--solar.impl.EventFactory
All Implemented Interfaces:
AduFactory

public class EventFactory
extends java.lang.Object
implements AduFactory

Event factory produces events based on their types, or by calling a particular method on particular event format.

Version:
$Id: EventFactory.java,v 1.3 2003/09/23 14:03:57 glchen Exp $
Author:
Guanling Chen

Constructor Summary
EventFactory()
           
 
Method Summary
static Event getPlainEvent(java.util.List aList)
          Return a plain event with a list of attributes.
static Event getPlainEvent(java.lang.String evt)
          Return a plain event by parsing a string.
static Event getSerializedEvent(byte[] cnt, int offset, int len)
          Return a serialized event by parsing a byte array.
static Event getSerializedEvent(java.util.List aList)
          Return a serialized event with a list of attributes.
static Event makeEvent(java.util.List aList)
          Return an event with specified attributes, using default format.
 Adu parse(byte[] bytes)
          Parse received byte array into an ADU.
 Adu parse(byte[] bytes, int offset, int len)
          Parse part of the received byte array into an ADU.
static Event parseEvent(byte[] bytes)
          Parse the byte array into a particular event, the first byte indicates the event type.
static Event parseEvent(byte[] bytes, int offset, int len)
          Parse the byte array into a particular event, the first byte indicates the event type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventFactory

public EventFactory()
Method Detail

parse

public Adu parse(byte[] bytes)
          throws ParsingException
Description copied from interface: AduFactory
Parse received byte array into an ADU.

Specified by:
parse in interface AduFactory
ParsingException

parse

public Adu parse(byte[] bytes,
                 int offset,
                 int len)
          throws ParsingException
Description copied from interface: AduFactory
Parse part of the received byte array into an ADU.

Specified by:
parse in interface AduFactory
ParsingException

makeEvent

public static Event makeEvent(java.util.List aList)
Return an event with specified attributes, using default format.


parseEvent

public static Event parseEvent(byte[] bytes)
                        throws ParsingException
Parse the byte array into a particular event, the first byte indicates the event type.

ParsingException

parseEvent

public static Event parseEvent(byte[] bytes,
                               int offset,
                               int len)
                        throws ParsingException
Parse the byte array into a particular event, the first byte indicates the event type.

ParsingException

getPlainEvent

public static Event getPlainEvent(java.lang.String evt)
                           throws ParsingException
Return a plain event by parsing a string.

ParsingException

getPlainEvent

public static Event getPlainEvent(java.util.List aList)
Return a plain event with a list of attributes.


getSerializedEvent

public static Event getSerializedEvent(byte[] cnt,
                                       int offset,
                                       int len)
                                throws ParsingException
Return a serialized event by parsing a byte array.

ParsingException

getSerializedEvent

public static Event getSerializedEvent(java.util.List aList)
Return a serialized event with a list of attributes.