Skip to content

Commit

Permalink
Merge pull request #209 from jaivigneshvenugopal/Collate_code
Browse files Browse the repository at this point in the history
Collate code
  • Loading branch information
jaivigneshvenugopal authored Nov 2, 2017
2 parents 04693d0 + e694736 commit bf97166
Show file tree
Hide file tree
Showing 35 changed files with 2,125 additions and 11 deletions.
1,049 changes: 1,049 additions & 0 deletions collated/main/jaivigneshvenugopal.md

Large diffs are not rendered by default.

984 changes: 984 additions & 0 deletions collated/test/jaivigneshvenugopal.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main/java/seedu/address/logic/ListObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import seedu.address.model.Model;
import seedu.address.model.person.ReadOnlyPerson;

//@@author jaivigneshvenugopal
/**
* Monitors current displayed list on person list panel.
* Obtains or updates the various lists according to the changes made to the current displayed list.
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ public interface Logic {
/** Returns an unmodifiable view of the filtered list of persons */
ObservableList<ReadOnlyPerson> getFilteredPersonList();

//@@author jaivigneshvenugopal
/** Returns an unmodifiable view of the filtered list of blacklisted persons */
ObservableList<ReadOnlyPerson> getFilteredBlacklistedPersonList();

/** Returns an unmodifiable view of the filtered list of whitelisted persons */
ObservableList<ReadOnlyPerson> getFilteredWhitelistedPersonList();
//@@author

/** Returns an unmodifiable view of the filtered list of persons with overdue debt */
ObservableList<ReadOnlyPerson> getFilteredOverduePersonList();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/logic/LogicManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public ObservableList<ReadOnlyPerson> getFilteredPersonList() {
return model.getFilteredPersonList();
}

//@@author jaivigneshvenugopal
@Override
public ObservableList<ReadOnlyPerson> getFilteredBlacklistedPersonList() {
return model.getFilteredBlacklistedPersonList();
Expand All @@ -86,6 +87,7 @@ public ObservableList<ReadOnlyPerson> getFilteredBlacklistedPersonList() {
public ObservableList<ReadOnlyPerson> getFilteredWhitelistedPersonList() {
return model.getFilteredWhitelistedPersonList();
}
//@@author

@Override
public ObservableList<ReadOnlyPerson> getFilteredOverduePersonList() {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/logic/commands/BanCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.person.ReadOnlyPerson;



//@@author jaivigneshvenugopal
/**
* Adds a person identified using it's last displayed index into the blacklist.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static seedu.address.model.Model.PREDICATE_SHOW_ALL_BLACKLISTED_PERSONS;

//@@author jaivigneshvenugopal
/**
* Lists all blacklisted persons in the address book to the user.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.person.ReadOnlyPerson;

//@@author jaivigneshvenugopal
/**
* Adds a person identified using it's last displayed index into the whitelist.
* Resets person's debt to zero and sets the date repaid field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import seedu.address.model.person.ReadOnlyPerson;
import seedu.address.model.person.exceptions.PersonNotFoundException;


//@@author jaivigneshvenugopal
/**
* Removes a person identified using it's last displayed index from the blacklist.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static seedu.address.model.Model.PREDICATE_SHOW_ALL_WHITELISTED_PERSONS;

//@@author jaivigneshvenugopal
/**
* Lists all persons who have cleared their debts.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import seedu.address.logic.commands.BanCommand;
import seedu.address.logic.parser.exceptions.ParseException;

//@@author jaivigneshvenugopal
/**
* Parses input arguments and creates a new BanCommand object
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import seedu.address.logic.commands.RepaidCommand;
import seedu.address.logic.parser.exceptions.ParseException;

//@@author jaivigneshvenugopal
/**
* Parses input arguments and creates a new RepaidCommand object
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import seedu.address.logic.commands.UnbanCommand;
import seedu.address.logic.parser.exceptions.ParseException;


//@@author jaivigneshvenugopal
/**
* Parses input arguments and creates a new UnbanCommand object
*/
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/seedu/address/model/AddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void addPerson(ReadOnlyPerson p) throws DuplicatePersonException {
persons.add(newPerson);
}

//@@author jaivigneshvenugopal
/**
* Adds a person to the blacklist in the address book.
* @return ReadOnly newBlacklistedPerson
Expand Down Expand Up @@ -138,6 +139,7 @@ public ReadOnlyPerson addWhitelistedPerson(ReadOnlyPerson p) {
}
return persons.getReadOnlyPerson(index);
}
//@@author

//@@author lawwman
/**
Expand Down Expand Up @@ -221,6 +223,7 @@ public boolean removePerson(ReadOnlyPerson key) throws PersonNotFoundException {
return persons.remove(key);
}

//@@author jaivigneshvenugopal
/**
* Updates {@code key} to exclude {@code key} from the blacklist in this {@code AddressBook}.
* @return ReadOnly newUnBlacklistedPerson
Expand Down Expand Up @@ -269,6 +272,7 @@ public ReadOnlyPerson removeWhitelistedPerson(ReadOnlyPerson key) throws PersonN
}
return persons.getReadOnlyPerson(index);
}
//@@author

//@@author lawwman
/**
Expand Down Expand Up @@ -447,6 +451,7 @@ public ObservableList<ReadOnlyPerson> getPersonList() {
return persons.asObservableList();
}

//@@author jaivigneshvenugopal
@Override
public ObservableList<ReadOnlyPerson> getBlacklistedPersonList() {
return persons.asObservableBlacklist();
Expand All @@ -456,6 +461,7 @@ public ObservableList<ReadOnlyPerson> getBlacklistedPersonList() {
public ObservableList<ReadOnlyPerson> getWhitelistedPersonList() {
return persons.asObservableWhitelist();
}
//@@author

@Override
public ObservableList<ReadOnlyPerson> getOverduePersonList() {
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/seedu/address/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public interface Model {
/** {@code Predicate} that always evaluate to true */
Predicate<ReadOnlyPerson> PREDICATE_SHOW_ALL_PERSONS = unused -> true;

//@@author jaivigneshvenugopal
/** {@code Predicate} that always evaluate to true */
Predicate<ReadOnlyPerson> PREDICATE_SHOW_ALL_BLACKLISTED_PERSONS = unused -> true;

/** {@code Predicate} that always evaluate to true */
Predicate<ReadOnlyPerson> PREDICATE_SHOW_ALL_WHITELISTED_PERSONS = unused -> true;
//@@author

/** {@code Predicate} that always evaluate to true */
Predicate<ReadOnlyPerson> PREDICATE_SHOW_ALL_OVERDUE_PERSONS = unused -> true;
Expand All @@ -36,32 +38,38 @@ public interface Model {
/** Returns the AddressBook */
ReadOnlyAddressBook getAddressBook();

//@@author jaivigneshvenugopal
/** Returns the name of current displayed list */
String getCurrentListName();

/** Sets the name of current displayed list */
void setCurrentListName(String currentList);
//@@author

/** Deletes the given person. */
void deletePerson(ReadOnlyPerson target) throws PersonNotFoundException;

//@@author jaivigneshvenugopal
/** Deletes the given person from blacklist and returns the deleted person */
ReadOnlyPerson removeBlacklistedPerson(ReadOnlyPerson target) throws PersonNotFoundException;

/** Removes the given person from whitelist and returns the updated person */
ReadOnlyPerson removeWhitelistedPerson(ReadOnlyPerson target) throws PersonNotFoundException;
//@@author

/** Removes the given person from overdue list and returns the updated person */
ReadOnlyPerson removeOverdueDebtPerson(ReadOnlyPerson target) throws PersonNotFoundException;

/** Adds the given person */
void addPerson(ReadOnlyPerson person) throws DuplicatePersonException;

//@@author jaivigneshvenugopal
/** Adds the given person into blacklist and returns the added person*/
ReadOnlyPerson addBlacklistedPerson(ReadOnlyPerson person);

/** Adds the given person into whitelist and returns the added person */
ReadOnlyPerson addWhitelistedPerson(ReadOnlyPerson person);
//@@author

/** Adds the given person into overdue list and returns the added person */
ReadOnlyPerson addOverdueDebtPerson(ReadOnlyPerson person);
Expand All @@ -79,11 +87,13 @@ void updatePerson(ReadOnlyPerson target, ReadOnlyPerson editedPerson)
/** Returns an unmodifiable view of the filtered person list */
ObservableList<ReadOnlyPerson> getFilteredPersonList();

//@@author jaivigneshvenugopal
/** Returns an unmodifiable view of the blacklisted filtered person list */
ObservableList<ReadOnlyPerson> getFilteredBlacklistedPersonList();

/** Returns an unmodifiable view of the whitelisted filtered person list */
ObservableList<ReadOnlyPerson> getFilteredWhitelistedPersonList();
//@@author

/** Returns an unmodifiable view of the filtered person list with overdue debt */
ObservableList<ReadOnlyPerson> getFilteredOverduePersonList();
Expand All @@ -95,6 +105,7 @@ void updatePerson(ReadOnlyPerson target, ReadOnlyPerson editedPerson)
*/
int updateFilteredPersonList(Predicate<ReadOnlyPerson> predicate);

//@@author jaivigneshvenugopal
/**
* Updates the filter of the filtered blacklisted person list to filter by the given {@code predicate}.
* @return size of current displayed filtered list.
Expand All @@ -108,6 +119,7 @@ void updatePerson(ReadOnlyPerson target, ReadOnlyPerson editedPerson)
* @throws NullPointerException if {@code predicate} is null.
*/
int updateFilteredWhitelistedPersonList(Predicate<ReadOnlyPerson> predicate);
//@@author

/**
* Updates the filter of the filtered person list with overdue debt to filter by the given {@code predicate}.
Expand Down Expand Up @@ -145,10 +157,12 @@ void updatePerson(ReadOnlyPerson target, ReadOnlyPerson editedPerson)
*/
void logout();

//@@author jaivigneshvenugopal
/**
* Updates the list shown in Person List Panel to the requested list.
*/
void changeListTo(String listName);
//@@author

/**
* Retrieves the full list of persons.
Expand Down
17 changes: 14 additions & 3 deletions src/main/java/seedu/address/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public ReadOnlyAddressBook getAddressBook() {
return addressBook;
}

//@@author jaivigneshvenugopal
/**
* @return String value of the current displayed list
*/
Expand All @@ -115,10 +116,9 @@ public String getCurrentListName() {
*/
@Override
public void setCurrentListName(String currentList) {


this.currentList = currentList;
}
//@@author

/** Raises an event to indicate the model has changed */
private void indicateAddressBookChanged() {
Expand All @@ -134,6 +134,7 @@ public synchronized void deletePerson(ReadOnlyPerson target) throws PersonNotFou
indicateAddressBookChanged();
}

//@@author jaivigneshvenugopal
/**
* Removes a specific person from blacklist in the AddressBook.
* @param target to be removed from blacklist.
Expand Down Expand Up @@ -161,6 +162,7 @@ public synchronized ReadOnlyPerson removeWhitelistedPerson(ReadOnlyPerson target
indicateAddressBookChanged();
return whitelistedPerson;
}
//@@author

//@@author lawwman
/**
Expand All @@ -185,6 +187,7 @@ public synchronized void addPerson(ReadOnlyPerson person) throws DuplicatePerson
indicateAddressBookChanged();
}

//@@author jaivigneshvenugopal
/**
* Adds a specific person to blacklist in the AddressBook.
* @param person to be updated.
Expand Down Expand Up @@ -232,6 +235,7 @@ public synchronized ReadOnlyPerson addWhitelistedPerson(ReadOnlyPerson person) {
indicateAddressBookChanged();
return whitelistedPerson;
}
//@@author

//@@author lawwman
/**
Expand Down Expand Up @@ -280,6 +284,7 @@ public void deleteTag(Tag tag) throws PersonNotFoundException, DuplicatePersonEx
addressBook.removeTag(tag);
}

//@@author jaivigneshvenugopal
/**
* Reads the masterlist and updates the blacklist accordingly.
*/
Expand All @@ -293,6 +298,7 @@ public void syncBlacklist() {
public void syncWhitelist() {
filteredWhitelistedPersons = new FilteredList<>(this.addressBook.getWhitelistedPersonList());
}
//@@author

//@@author lawwman
/**
Expand Down Expand Up @@ -376,11 +382,12 @@ public ReadOnlyPerson deductDebtFromPerson(ReadOnlyPerson target, Debt amount) t
return repayingPerson;
}

//@@author
//@@author jaivigneshvenugopal
@Override
public void changeListTo(String listName) {
raise(new ChangeInternalListEvent(listName));
}
//@@author

@Override
public void updateDebtFromInterest(ReadOnlyPerson person, int differenceInMonths) {
Expand All @@ -407,6 +414,7 @@ public ObservableList<ReadOnlyPerson> getFilteredPersonList() {
return FXCollections.unmodifiableObservableList(filteredPersons);
}

//@@author jaivigneshvenugopal
/**
* Returns an unmodifiable view of the blacklist of {@code ReadOnlyPerson} backed by the internal list of
* {@code addressBook}
Expand All @@ -430,6 +438,7 @@ public ObservableList<ReadOnlyPerson> getFilteredWhitelistedPersonList() {
filteredWhitelistedPersons.setPredicate(currentPredicate);
return FXCollections.unmodifiableObservableList(filteredWhitelistedPersons);
}
//@@author

//@@author lawwman
/**
Expand All @@ -453,6 +462,7 @@ public int updateFilteredPersonList(Predicate<ReadOnlyPerson> predicate) {
return filteredPersons.size();
}

//@@author jaivigneshvenugopal
/**
* Filters {@code filteredBlacklistedPersons} according to given {@param predicate}
* @return size of current displayed filtered list.
Expand All @@ -476,6 +486,7 @@ public int updateFilteredWhitelistedPersonList(Predicate<ReadOnlyPerson> predica
filteredWhitelistedPersons.setPredicate(predicate);
return filteredWhitelistedPersons.size();
}
//@@author

//@@author lawwman
/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/model/ReadOnlyAddressBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public interface ReadOnlyAddressBook {
*/
ObservableList<ReadOnlyPerson> getPersonList();

//@@author jaivigneshvenugopal
/**
* Returns an unmodifiable view of the blacklisted persons list.
* This list will not contain any duplicate persons.
Expand All @@ -26,6 +27,7 @@ public interface ReadOnlyAddressBook {
* This list will not contain any duplicate persons.
*/
ObservableList<ReadOnlyPerson> getWhitelistedPersonList();
//@@author

/**
* Returns an unmodifiable view of the list of persons with overdue debt.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/seedu/address/model/person/DateRepaid.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package seedu.address.model.person;

//@@author jaivigneshvenugopal
/**
* Represents the date of when the Person was sent to the whitelist in the address book, i.e. the date
* the Person repaid his debt completely.
Expand Down
Loading

0 comments on commit bf97166

Please sign in to comment.