MetaTF API

MetaTF.Parser
Class TupleField

java.lang.Object
  |
  +--MetaTF.Parser.Field
        |
        +--MetaTF.Parser.TupleField
All Implemented Interfaces:
HasFields

public class TupleField
extends Field

Tuple field

Version:
rel-1-2 ($Revision: 1.3 $, $Date: 2000/12/15 16:29:55 $),
Author:
Richard Jones
See Also:
The MetaTF Grammar, Field

Fields inherited from class MetaTF.Parser.Field
beginLine
 
Fields inherited from interface MetaTF.Parser.HasFields
cvsheader
 
Constructor Summary
(package private) TupleField()
          Allocate a new object representing a tuple
(package private) TupleField(java.lang.String name)
          Allocate a new object representing a tuple
(package private) TupleField(java.lang.String s, java.util.List fs)
          Allocate a new object representing a tuple
 
Method Summary
 java.lang.Object accept(DTDVisitor visitor, java.lang.Object data)
          Accept the visitor
 void addField(Field f)
          Add a subfield to this field
 boolean addProperty(java.lang.String type, java.lang.String field, java.lang.String property, Value value, int l)
          Add a property to this field
(package private)  void checkFields()
          Check that this field is well formed i.e.
 boolean containsField(java.lang.String s)
          Does this field contain a named subfield?
 java.lang.String dump(java.lang.String prefix)
          Dump this field
 java.util.List getFields()
           
 java.lang.String getName()
           
 int getNumNamedFields()
           
 int getTag()
          Get the tag of this field
 java.lang.String getType()
           
 boolean isTagged()
          Is this field tagged?
(package private)  Field replaceFields(java.util.Map inheritedRecords0, java.util.Map inheritedRecords, java.util.Map inheritedFields)
          Do a macro replacement of any fields that do not have properties defined locally.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleField

TupleField(java.lang.String s,
           java.util.List fs)
Allocate a new object representing a tuple
Parameters:
s - the name of the tuple
fs - the list of components of this tuple

TupleField

TupleField()
Allocate a new object representing a tuple

TupleField

TupleField(java.lang.String name)
Allocate a new object representing a tuple
Parameters:
name - the name of the tuple
Method Detail

addField

public void addField(Field f)
Description copied from class: Field
Add a subfield to this field
Overrides:
addField in class Field
Following copied from class: MetaTF.Parser.Field
Parameters:
f - the subfield

getFields

public java.util.List getFields()
Returns:
a list of the top level components of this tuple

getName

public java.lang.String getName()
Overrides:
getName in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the name of the field

replaceFields

Field replaceFields(java.util.Map inheritedRecords0,
                    java.util.Map inheritedRecords,
                    java.util.Map inheritedFields)
Description copied from class: Field
Do a macro replacement of any fields that do not have properties defined locally.
Overrides:
replaceFields in class Field
Following copied from class: MetaTF.Parser.Field
Parameters:
inheritedRecords0 - Map of records inherited from section 0
inheritedRecords - Map of records inherited from this section
inheritedFields - Map of inherited fields
Returns:
the modified field

checkFields

void checkFields()
           throws DTDException
Description copied from class: Field
Check that this field is well formed i.e. has a type and an encoding. All macro substition must be done before checkFields is called
Overrides:
checkFields in class Field
Following copied from class: MetaTF.Parser.Field
Throws:
DTDException - IF this field is not well-formed
See Also:
Field.replaceFields(java.util.Map, java.util.Map, java.util.Map)

containsField

public boolean containsField(java.lang.String s)
Description copied from class: Field
Does this field contain a named subfield?
Overrides:
containsField in class Field
Following copied from class: MetaTF.Parser.Field
Parameters:
s - the name of the subfield
Returns:
whether this field contains a subfield named s

addProperty

public boolean addProperty(java.lang.String type,
                           java.lang.String field,
                           java.lang.String property,
                           Value value,
                           int l)
                    throws DTDException
Description copied from class: Field
Add a property to this field
Overrides:
addProperty in class Field
Following copied from class: MetaTF.Parser.Field
Parameters:
type - the type
field - the name of the field. The property is only added if the field names match
property - the property
value - the value of the property
beginLine - the line in the DTD at which this property was defined
Throws:
DTDException -  

getNumNamedFields

public int getNumNamedFields()
Overrides:
getNumNamedFields in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the number of named subfields of this field

getTag

public int getTag()
           throws NoTagException
Description copied from class: Field
Get the tag of this field
Overrides:
getTag in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the tag, if any
Throws:
NoTagException - IF this field does not contain a tag

isTagged

public boolean isTagged()
Description copied from class: Field
Is this field tagged?
Overrides:
isTagged in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
whether the field is tagged

getType

public java.lang.String getType()
Overrides:
getType in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the type of the field

dump

public java.lang.String dump(java.lang.String prefix)
Description copied from class: Field
Dump this field
Overrides:
dump in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
a prettified representation of this field

accept

public java.lang.Object accept(DTDVisitor visitor,
                               java.lang.Object data)
Description copied from class: Field
Accept the visitor
Overrides:
accept in class Field

MetaTF API

Copyright © 2001 - Richard Jones     MetaTF