User - ALL STUDENTS COMPLETE THESE SECTIONS Main Class File FileSystemMain.java File User.java Semester CS367 Spring 2015 Author Thomas Whitburn CS

User - ALL STUDENTS COMPLETE THESE SECTIONS Main Class File...

This preview shows page 1 - 2 out of 2 pages.

/////////////////////////////////////////////////////////////////////////////// // ALL STUDENTS COMPLETE THESE SECTIONS // Main Class File: FileSystemMain.java // File: User.java // Semester: CS367 Spring 2015 // // Author: Thomas Whitburn // CS Login: whitburn // Lecturer's Name: Jim Skrentny // //////////////////// PAIR PROGRAMMERS COMPLETE THIS SECTION /////////////////// // // Pair Partner: Haomin Li // Email: [email protected] // CS Login: haomin // Lecturer's Name: Jim Skrentny // //////////////////////////// 80 columns wide ////////////////////////////////// import java.util.ArrayList; public class User { private String name; //name of the user. private ArrayList<SimpleFile> files;//list of files owned/created by user private ArrayList<SimpleFolder> folders;//list of folder owned by user. public User(String name) { if (name == null) throw new IllegalArgumentException(); this.name = name; this.files = new ArrayList<SimpleFile>(); this.folders = new ArrayList<SimpleFolder>(); } @Override public boolean equals(Object obj) { if (obj == null) throw new IllegalArgumentException(); if (this.name.equals(((User) obj).getName())) { return true; } else { return false; } } //returns the name of the user. public String getName() { return this.name; } //returns the list of files owned by the user.
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '08
  • MarvinSolomon
  • Lecturer, new ArrayList, Jim Skrentny, Thomas Whitburn

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture