com.ireasoning.protocol.tl1
Class TL1Section
java.lang.Object
|
+--com.ireasoning.protocol.tl1.TL1Section
- All Implemented Interfaces:
- Serializable
- public class TL1Section
- extends Object
- implements Serializable
This class represents section in TL1 payload.
- See Also:
TL1Line
, Serialized Form
Method Summary |
TL1Field |
getField(int index)
Returns the field at the specified position in this section. |
int |
getFieldCount()
Returns the number of fileds contained in this section |
TL1Field[] |
getFields()
Returns an array of fields contained in this section. |
String |
lookupValue(String name)
Returns the value corresponding to passed name, or name itself if it has
no value. |
String |
toString()
Returns the string representation of this class |
TL1Section
public TL1Section(String section)
- Constructs a new TL1Section
- Parameters:
section
- the raw section string
getFields
public TL1Field[] getFields()
- Returns an array of fields contained in this section. Empty fileds still
counts, e.g. for "a,,b=c", getFields returns "a", "", and "b=c" fields.
getField
public TL1Field getField(int index)
- Returns the field at the specified position in this section.
- Throws:
IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= getFieldCount()).
getFieldCount
public int getFieldCount()
- Returns the number of fileds contained in this section
lookupValue
public String lookupValue(String name)
- Returns the value corresponding to passed name, or name itself if it has
no value.
For example, for section "a=b,c,d=e", lookupValue("a") returns "b"; lookupValue("c")
returns "c"; lookupValue("d") returns e; lookupValue("x") returns null.
toString
public String toString()
- Returns the string representation of this class
- Overrides:
toString
in class Object
Copyright © 2002 iReasoning Inc. All Rights Reserved.