瀏覽代碼

Added Kotlin as a dependencyin README

master
BinHong Lee 7 年之前
父節點
當前提交
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)
{


Loading…
取消
儲存