org.objectweb.medor.lib
Class BasicTupleStructure

java.lang.Object
  extended byBasicCloneable
      extended byorg.objectweb.medor.lib.BasicTupleStructure
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, TupleStructure
Direct Known Subclasses:
BasicMultivaluedField, BasicQueryTree, MedorTCQueryLeaf

public class BasicTupleStructure
extends BasicCloneable
implements TupleStructure

See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList fields
           
protected  Logger logger
           
protected  java.util.HashMap name2field
           
 
Constructor Summary
protected BasicTupleStructure()
           
  BasicTupleStructure(Field[] fields)
           
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
           
 boolean contains(Field f)
          Checks whether a given input Field is present in the current TupleStructure.
 boolean contains(java.lang.String fieldName)
          Checks whether the current TupleStructure has a field of a given name.
 Field getField(int fieldrank)
          Returns the Field of a given rank in the current TupleStructure.
 Field getField(java.lang.String fieldname)
          Returns a Field object present in this TupleStructure given its name.
 int getFieldRank(Field f)
          Returns the rank of a given Field in the current TupleStructure.
 Field[] getFields()
          Returns the array of Fields in the current TupleStructure.
 int getSize()
          Returns the size of the current TupleStructure, ie the number of Fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.api.Cloneable
clone
 

Field Detail

fields

protected java.util.ArrayList fields

name2field

protected java.util.HashMap name2field

logger

protected transient Logger logger
Constructor Detail

BasicTupleStructure

protected BasicTupleStructure()

BasicTupleStructure

public BasicTupleStructure(Field[] fields)
                    throws MedorException
Method Detail

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

getFields

public Field[] getFields()
Description copied from interface: TupleStructure
Returns the array of Fields in the current TupleStructure.

Specified by:
getFields in interface TupleStructure
Returns:
the array of Fields in the current TupleStructure.

getField

public Field getField(java.lang.String fieldname)
               throws MedorException
Description copied from interface: TupleStructure
Returns a Field object present in this TupleStructure given its name.

Specified by:
getField in interface TupleStructure
Parameters:
fieldname - the name of the searched Field
Returns:
the Field in the current TupleStructure which has the input name.
Throws:
MedorException - if no Field corresponds to the input name.

getField

public Field getField(int fieldrank)
               throws MedorException
Description copied from interface: TupleStructure
Returns the Field of a given rank in the current TupleStructure.

Specified by:
getField in interface TupleStructure
Parameters:
fieldrank - the rank of the searched Field in the current TupleStructure
Returns:
the Field in the current TupleStructure corresponding to the input rank.
Throws:
MedorException - if the input rank is too large.

getFieldRank

public int getFieldRank(Field f)
                 throws MedorException
Description copied from interface: TupleStructure
Returns the rank of a given Field in the current TupleStructure.

Specified by:
getFieldRank in interface TupleStructure
Parameters:
f - the Field for which the rank is searched.
Returns:
the rank of the input Field in the current TupleStructure.
Throws:
MedorException - if there is no such Field in the current TupleStructure.

getSize

public int getSize()
Description copied from interface: TupleStructure
Returns the size of the current TupleStructure, ie the number of Fields.

Specified by:
getSize in interface TupleStructure
Returns:
the number of Fields in the current TupleStructure.

contains

public boolean contains(Field f)
Description copied from interface: TupleStructure
Checks whether a given input Field is present in the current TupleStructure.

Specified by:
contains in interface TupleStructure
Parameters:
f - the Field for which to check whether it is present in the current TupleStructure.
Returns:
true if the Field is part of the current TupleStructure, false otherwise.

contains

public boolean contains(java.lang.String fieldName)
Description copied from interface: TupleStructure
Checks whether the current TupleStructure has a field of a given name.

Specified by:
contains in interface TupleStructure
Parameters:
fieldName - the Field name for which to check whether the current TupleStructure contains a Field.
Returns:
true if the current TupleStructure contains a Field of the input name, false otherwise.