public int compareByName(HousePet housepet)
    {
        int returnValue = 0;
        
        String hp1Name = this.getName();
        String hp2Name = housepet.getName();

        /* if this HousePet's name is the same as housepet's name, defer to compareTo()
         * as tiebreaker 
         * Note: this also includes case where both HousePet's names = "**no name**" */
        if(hp1Name.equalsIgnoreCase(hp2Name))
        {
            returnValue = this.compareTo(housepet); 
        }
        
        /* first, find the shorter of the two HousePet's names, so that we know where to
         * end the FOR loop, avoiding a NullPointerException.
         * then, make a copy of both HousePet's names and convert them to uppercase, to
         * remove differences in capitalization (lowercase - uppercase = 32 for a given
         * letter).
         * compare this HousePet's capitalized name with that of housepet,
         * char by char, until arriving upon a difference in letters, at which point
         * it will be determined whether the given char in this HousePet's name has a
         * greater or lesser numerical value than the given char in housepet's name.
         * returnValue will be then assigned as either -1 or 1, and the FOR
         * loop will be exited using break statement.
         * Note: ['*' = 42, 'A' = 65, 'a' = 97]. "**NO NAME**" < name not beginning with
         * an asterisk, so will be sorted to lower indices in compareByName() */ 
        else
        {
            int hp1Len = hp1Name.length();
            int hp2Len = hp2Name.length();
            int lenDiff = hp1Len - hp2Len;
            int shortestNameLen = 0;
            String hp1Caps = hp1Name.toUpperCase();
            String hp2Caps = hp2Name.toUpperCase();
            
            if(lenDiff < 0)
            {
                shortestNameLen = hp1Len;
            }
            
            else  //if(lenDiff > 0)
            {
                shortestNameLen = hp2Len;
            }
            
            for(int i = 0; i < shortestNameLen; i++)
            {
                if(hp1Caps.charAt(i) < hp2Caps.charAt(i))
                {
                    returnValue = -1;
                    break;
                        
                }//end IF
                    
                if(hp1Caps.charAt(i) > hp2Caps.charAt(i))
                {
                    returnValue = 1;
                    break;
                        
                }//end IF
                    
            }//end FOR
                            
        }//end ELSE
                
        return returnValue;
        
    }//end compareByName()