Class SkeletonUtil


  • public class SkeletonUtil
    extends Object
    Helper methods to manipulate skeleton objects.
    • Constructor Detail

      • SkeletonUtil

        public SkeletonUtil()
    • Method Detail

      • findTuRefInSkeleton

        public static int findTuRefInSkeleton​(GenericSkeleton skel)
        Finds source reference in the skeleton.
        Parameters:
        skel - the skeleton being sought for the reference
        Returns:
        index in the list of skeleton parts for the skeleton part containing the reference
      • findTuRefInSkeleton

        public static int findTuRefInSkeleton​(GenericSkeleton skel,
                                              LocaleId locId)
        Finds either source or target reference in the skeleton. If locId is specified, then its target reference is sought for.
        Parameters:
        skel - the skeleton being sought for the reference.
        locId - the locale to search the reference for.
        Returns:
        index in the list of skeleton parts for the skeleton part containing the reference.
      • hasTuRef

        public static boolean hasTuRef​(GenericSkeleton skel)
        Determines if a given skeleton contains a source reference in it.
        Parameters:
        skel - the skeleton being sought for the reference.
        Returns:
        true if the given skeleton contains such a reference.
      • hasTuRef

        public static boolean hasTuRef​(GenericSkeleton skel,
                                       LocaleId locId)
        Determines if a given skeleton contains a target reference in a given locale.
        Parameters:
        skel - the skeleton being sought for the reference.
        locId - the locale of the target part being sought.
        Returns:
        true if the given skeleton contains such a reference.
      • replaceSkeletonPart

        public static boolean replaceSkeletonPart​(GenericSkeleton skel,
                                                  int index,
                                                  GenericSkeleton replacement)
        Replaces a part of a given skeleton with another given skeleton part.
        Parameters:
        skel - the skeleton which part is being replaced.
        index - the index of the skeleton part to be replaced.
        replacement - the given new skeleton part to replace the existing one.
        Returns:
        true if replacement succeeded.