Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/bindings/javahl/src/org/tigris/subversion/javahl/BlameCallbackImpl.java  view on Meta::CPAN


        /**
         * @return Returns the date changed.
         */
        public Date getChanged()
        {
            return changed;
        }

        /**
         * @return Returns the source line content.
         */
        public String getLine()
        {
            return line;
        }


        /**
         * @return Returns the revision.
         */
        public long getRevision()
        {
            return revision;
        }

        /*
         * (non-Javadoc)
         * @see java.lang.Object#toString()
         */
        public String toString()
        {
            StringBuffer sb = new StringBuffer();
            if (revision > 0)
            {
                pad(sb, Long.toString(revision), 6);
                sb.append(' ');
            }
            else
            {
                sb.append("     - ");
            }

            if (author != null)
            {
                pad(sb, author, 10);
                sb.append(" ");
            }
            else
            {
                sb.append("         - ");
            }

            sb.append(line);

            return sb.toString();
        }

        /**
         * Left pad the input string to a given length, to simulate printf()-
         * style output. This method appends the output to the class sb member.
         * @param sb StringBuffer to append to
         * @param val the input string
         * @param len the minimum length to pad to
         */
        private void pad(StringBuffer sb, String val, int len)
        {
            int padding = len - val.length();

            for (int i = 0; i < padding; i++)
            {
                sb.append(' ');
            }

            sb.append(val);
        }

    }
}



( run in 1.288 second using v1.01-cache-2.11-cpan-39bf76dae61 )