Просмотр исходного кода

Added Kotlin as a dependencyin README

master
BinHong Lee 7 лет назад
Родитель
Сommit
fd382efe93
2 измененных файлов: 16 добавлений и 10 удалений
  1. +1
    -0
      README.md
  2. +15
    -10
      src/main/kotlin/libsys/UserFactory.kt

+ 1
- 0
README.md Просмотреть файл

@@ -12,6 +12,7 @@ API Documentations can be found [here](https://binhonglee.github.io/LibrarySyste

1. [Maven Apache](https://maven.apache.org/)
2. [Oracle JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
3. [Kotlin](https://kotlinlang.org/)

## Use



+ 15
- 10
src/main/kotlin/libsys/UserFactory.kt Просмотреть файл

@@ -193,23 +193,28 @@ class UserFactory
}
}

/**
* Deletes the given User from the class (if found)
* @param user User to be deleted
*
* @return if User deletion is successful
*/
fun deleteUser(user: User): Boolean
{
try
{
return users.remove(user)
}
catch (e: Exception)
{
return false
}
return users.remove(user)
}

fun deleteUser(i: Int): Boolean
/**
* Deletes the User with the given id from the class (if found)
* @param id id of the User to be deleted
*
* @return if User deletion is successful
*/
fun deleteUser(id: Int): Boolean
{
try
{
return users.remove(getUser(i))
return users.remove(getUser(id))
}
catch (e: Exception)
{


Загрузка…
Отмена
Сохранить