Class ProfileDataCollection

    • Constructor Detail

      • ProfileDataCollection

        public ProfileDataCollection​(String tableName,
                                     ProfileDataCollection.Attribute[] attrs)

        Create a new profile data collection to store exported profile table state.

        Parameters:
        tableName - the name of the profile table when the profiles have been exported from or will be imported to.
        attrs - the specification of the profile table attributes.
        Throws:
        NullPointerException - is either argument is null.
    • Method Detail

      • getProfileTableName

        public String getProfileTableName()

        Get the name of rhe profile table associated with this profile data collection. For data generated from a profile export, this returns the name of the profile table the data was extracted from. For data being imported, this returns the name of the profile table the data will be imported into.

        Returns:
        the profile table name.
      • getAttributes

        public ProfileDataCollection.Attribute[] getAttributes()

        Get the profile attribute descriptions for the profile table. These attributes represent the (expected) schema of the profile table.

        Returns:
        the profile attribute descriptions.
      • setReplaceAll

        public void setReplaceAll​(boolean replaceAll)

        Set the global "create means replace" flag for profile data contained in this profile data collection. If this flag is set to true, then profile data will replace an existing profile, where present, rather than being skipped over.

        Parameters:
        replaceAll - the new value of the flag.
        See Also:
        replaceAll
      • replaceAll

        public boolean replaceAll()

        Determine if the global "create means replace" flag has been set for this profile data collection.

        Returns:
        the value of the flag.
        See Also:
        setReplaceAll(boolean)
      • addProfile

        public void addProfile​(ProfileDataCollection.Profile profile)

        Add a profile to the collection. If the profile name is null, indicating the default profile, it is added to the head of the list, otherwise the profile is appended to the end of the list.

        Parameters:
        profile - the profile to add.
        Throws:
        NullPointerException - if profile is null.
      • getProfiles

        public Iterator<ProfileDataCollection.Profile> getProfiles()

        Get an iterator over the profiles stored in this collection. If there is a default profile in the collection it will be returned first by this iterator.

        Returns:
        an iterator over the profiles stored in this collection.
      • numProfiles

        public int numProfiles()

        Get the number of profiles stored in this collection.

        Returns:
        the number of profiles stored in this collection.
      • clearProfiles

        public void clearProfiles()

        Remove all the profiles stored in this collection. The profile table name and schema are retained.

      • toString

        public String toString()

        Convert the profile data collection into a human-readable string form, including profile table name, profile table schema, profiles, and profile attributes.

        Overrides:
        toString in class Object
        Returns:
        a string form of the profile data collection.