1. /*
  2. * Copyright 2002,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs.cvslib;
  18. import java.util.Date;
  19. import java.util.Vector;
  20. /**
  21. * CVS Entry.
  22. *
  23. * @version $Revision: 1.8.2.4 $ $Date: 2004/03/09 17:01:40 $
  24. */
  25. class CVSEntry {
  26. private Date m_date;
  27. private String m_author;
  28. private final String m_comment;
  29. private final Vector m_files = new Vector();
  30. public CVSEntry(Date date, String author, String comment) {
  31. m_date = date;
  32. m_author = author;
  33. m_comment = comment;
  34. }
  35. public void addFile(String file, String revision) {
  36. m_files.addElement(new RCSFile(file, revision));
  37. }
  38. public void addFile(String file, String revision, String previousRevision) {
  39. m_files.addElement(new RCSFile(file, revision, previousRevision));
  40. }
  41. Date getDate() {
  42. return m_date;
  43. }
  44. void setAuthor(final String author) {
  45. m_author = author;
  46. }
  47. String getAuthor() {
  48. return m_author;
  49. }
  50. String getComment() {
  51. return m_comment;
  52. }
  53. Vector getFiles() {
  54. return m_files;
  55. }
  56. public String toString() {
  57. return getAuthor() + "\n" + getDate() + "\n" + getFiles() + "\n"
  58. + getComment();
  59. }
  60. }