solar.impl
Class PlainAttributeRecord

java.lang.Object
  |
  +--solar.impl.AbstractAttributeRecord
        |
        +--solar.impl.PlainAttributeRecord
All Implemented Interfaces:
Adu, AttributeRecord, java.io.Serializable, SolarConstants
Direct Known Subclasses:
PlainEvent, PlainName

public class PlainAttributeRecord
extends AbstractAttributeRecord

Plain attribute record encodes string attributes in square brackets. The attribute values have to be strings. The brackets "[" and "]" thus shall not be used in attribute keys and values.

For example: [ a = [ b = 12 ], c = 33, d = [ e = [ f = 44 ] ] ]

Version:
$Id: PlainAttributeRecord.java,v 1.6 2003/10/05 15:24:39 glchen Exp $
Author:
Guanling Chen
See Also:
Serialized Form

Field Summary
private static int DELIMIT
           
private static int KEY
           
private static int VALUE
           
 
Fields inherited from class solar.impl.AbstractAttributeRecord
_attributes
 
Fields inherited from interface solar.SolarConstants
ADVERTISEMENT_SVID, ATTRIBUTE_RECORD_SVID, ATTRIBUTE_SVID, FILTER_CONFIG_SVID, FILTER_SPEC_SVID, GRAPH_SPEC_SVID, GUID_SVID, HEADER_SVID, ID_SVID, NAME_RECORD_SVID, PACK_POLICY_SVID, PIPE_SPEC_SVID, REQUEST_SVID, RPCACK_SVID
 
Constructor Summary
protected PlainAttributeRecord()
          Constructs an empty attribute record.
  PlainAttributeRecord(AttributeRecord aRec)
          Constructs an atribute record by copying from another one.
  PlainAttributeRecord(java.util.List aList)
          Constructs an atribute record with a list of attributes.
  PlainAttributeRecord(java.lang.String rec)
          Constructs an attribute record by parsing an encoded string.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determine whether two objects are equal.
private  java.util.List parsePlainAttributeRecord(java.lang.String rec)
          Parse an attribute record encoded in a string.
 byte[] toBytes()
          Return the byte array format of this ADU.
 java.lang.String toString()
          Return the string format of this ADU.
 
Methods inherited from class solar.impl.AbstractAttributeRecord
getAttribute, getAttributes, getAttributes, getKeys, getValue, getValues, getValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

private static final int KEY
See Also:
Constant Field Values

VALUE

private static final int VALUE
See Also:
Constant Field Values

DELIMIT

private static final int DELIMIT
See Also:
Constant Field Values
Constructor Detail

PlainAttributeRecord

protected PlainAttributeRecord()
Constructs an empty attribute record.


PlainAttributeRecord

public PlainAttributeRecord(java.lang.String rec)
                     throws ParsingException
Constructs an attribute record by parsing an encoded string.


PlainAttributeRecord

public PlainAttributeRecord(java.util.List aList)
Constructs an atribute record with a list of attributes.


PlainAttributeRecord

public PlainAttributeRecord(AttributeRecord aRec)
Constructs an atribute record by copying from another one.

Method Detail

parsePlainAttributeRecord

private java.util.List parsePlainAttributeRecord(java.lang.String rec)
                                          throws ParsingException
Parse an attribute record encoded in a string.

ParsingException

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: AttributeRecord
Determine whether two objects are equal.

Specified by:
equals in interface AttributeRecord
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Description copied from interface: Adu
Return the string format of this ADU.

Specified by:
toString in interface Adu
Overrides:
toString in class java.lang.Object

toBytes

public byte[] toBytes()
Description copied from interface: Adu
Return the byte array format of this ADU.