Bladeren bron

Added Kotlin as a dependencyin README

master
BinHong Lee 7 jaren geleden
bovenliggende
commit
fd382efe93
2 gewijzigde bestanden met toevoegingen van 16 en 10 verwijderingen
  1. +1
    -0
      README.md
  2. +15
    -10
      src/main/kotlin/libsys/UserFactory.kt

+ 1
- 0
README.md Bestand weergeven

@@ -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 Bestand weergeven

@@ -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)
{


Laden…
Annuleren
Opslaan