Package cern.dip.mock

Class MockDipBrowser

  • All Implemented Interfaces:
    DipBrowser

    public class MockDipBrowser
    extends java.lang.Object
    implements DipBrowser
    • Constructor Summary

      Constructors 
      Constructor Description
      MockDipBrowser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getPublications​(java.lang.String pattern)
      Obtain a list of all publications visable in the DIP namespace.
      int getSize()
      Get the cardinality of the default field (where a primitive type is being sent).
      int getSize​(java.lang.String tag)
      Get the cardinality of the field who's name is supplied as a parameter.
      java.lang.String[] getTags​(java.lang.String pub)
      Get the fields names within the publication having the supplied publication name.
      int getType()
      Get the type of the default field (where a primitive type is being sent).
      int getType​(java.lang.String tag)
      Get the type of the field who's name is supplied as a parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockDipBrowser

        public MockDipBrowser()
    • Method Detail

      • getPublications

        public java.lang.String[] getPublications​(java.lang.String pattern)
        Description copied from interface: DipBrowser
        Obtain a list of all publications visable in the DIP namespace. If no publications are visable an empty array is returned.
        Specified by:
        getPublications in interface DipBrowser
        Parameters:
        pattern - wildcard string. * @return array of publication names.
      • getTags

        public java.lang.String[] getTags​(java.lang.String pub)
                                   throws DipException
        Description copied from interface: DipBrowser
        Get the fields names within the publication having the supplied publication name. Should always be at least one field. A primitive type will return the tag name __DIP_DEFAULT__
        Specified by:
        getTags in interface DipBrowser
        Parameters:
        pub - name of the publication we want the fields of.
        Returns:
        Array of fields within the publication.
        Throws:
        DipException - if the format discription of the publication is incorrect
      • getType

        public int getType()
                    throws DipException
        Description copied from interface: DipBrowser
        Get the type of the default field (where a primitive type is being sent). Must be called after first calling getTags() for the publication of interest.
        Specified by:
        getType in interface DipBrowser
        Returns:
        type of the primitive sent in the DipData object as defined in the DipData class
        Throws:
        DipException - if getTags() has not been previous called or the object does not hold a primitive type
        See Also:
        DipData
      • getSize

        public int getSize()
                    throws DipException
        Description copied from interface: DipBrowser
        Get the cardinality of the default field (where a primitive type is being sent). Must be called after first calling getTags() for the publication of interest. Note that a non array type will return the value 1.
        Specified by:
        getSize in interface DipBrowser
        Returns:
        cardinality of the primitive sent in the DipData object.
        Throws:
        DipException - if getTags() has not been previous called or the object does not hold a primitive type
        See Also:
        DipData
      • getType

        public int getType​(java.lang.String tag)
                    throws DipException
        Description copied from interface: DipBrowser
        Get the type of the field who's name is supplied as a parameter. Must be called after first calling getTags() for the publication of interest.
        Specified by:
        getType in interface DipBrowser
        Returns:
        type of the field sent in the DipData object as defined in the DipData class
        Throws:
        DipException - if getTags() has not been previous called or the object does not hold a complex type
        See Also:
        getTags(), DipData
      • getSize

        public int getSize​(java.lang.String tag)
                    throws DipException
        Description copied from interface: DipBrowser
        Get the cardinality of the field who's name is supplied as a parameter. Must be called after first calling getTags() for the publication of interest. Note that a non array type will return the value 1.
        Specified by:
        getSize in interface DipBrowser
        Returns:
        cardinality of the field sent in the DipData object as defined in the DipData class
        Throws:
        DipException - if getTags() has not been previous called or the object does not hold a complex type
        See Also:
        DipData