withdraw

fun withdraw(id: Int, amount: Bank.Amount): Boolean
fun withdraw(id: Int, amount: Int): Boolean

Withdraws an item with the provided id and amount.

Return

true if the item was withdrawn, does not determine if amount was matched; otherwise, false

Parameters

id

the id of the item

amount

the amount to withdraw

fun withdraw(id: Int, amount: Bank.Amount, waitFor: Callable<Boolean>): Boolean
fun withdraw(id: Int, amount: Int, waitFor: Callable<Boolean>): Boolean

Withdraws an item with the provided name and amount.

Return

the return value of waitFor if items were attempted to be withdrawn. False otherwise.

Parameters

id

the id of the item

amount

the amount to withdraw

waitFor

the condition to wait for

fun withdraw(name: String, amount: Bank.Amount): Boolean
fun withdraw(name: String, amount: Bank.Amount, waitFor: Callable<Boolean>): Boolean
fun withdraw(name: String, amount: Int): Boolean

Withdraws an item with the provided name and amount. If multiple items of the same name are present, the first one is chosen.

Return

true if the item was withdrawn, does not determine if amount was matched; otherwise, false

Parameters

name

the name of the item

amount

the amount to withdraw

fun withdraw(filter: Filter<Item>, amount: Bank.Amount): Boolean
fun withdraw(filter: Filter<Item>, amount: Bank.Amount, waitFor: Callable<Boolean>): Boolean
fun withdraw(filter: Filter<Item>, amount: Int): Boolean

Withdraws an item with the provided name and amount. If multiple items match the filter, the first one is chosen.

Return

true if the item was withdrawn, does not determine if amount was matched; otherwise, false

Parameters

filter

the filter to apply to the items in the bank

amount

the amount to withdraw

fun withdraw(name: String, amount: Int, waitFor: Callable<Boolean>): Boolean

Withdraws an item with the provided name and amount. If multiple items of the same name are present, the first one is chosen.

Return

the return value of waitFor if items were attempted to be withdrawn. False otherwise.

Parameters

name

the filter to apply to the items in the bank

amount

the amount to withdraw

waitFor

the condition to wait for

fun withdraw(filter: Filter<Item>, amount: Int, waitFor: Callable<Boolean>): Boolean

Withdraws an item with the provided name and amount. If multiple items match the filter, the first one is chosen.

Return

the return value of waitFor if items were attempted to be withdrawn. False otherwise.

Parameters

filter

the filter to apply to the items in the bank

amount

the amount to withdraw

waitFor

the condition to wait for

fun withdraw(item: Item, amount: Int): Boolean

Withdraws an item with the provided item and amount.

Return

true if the item was withdrawn, does not determine if amount was matched; otherwise, false

Parameters

item

the item instance

amount

the amount to withdraw

fun withdraw(item: Item, amount: Int, waitFor: Callable<Boolean>): Boolean

Withdraws the specified amount of the specified item and waits for the specified condition to be true.

Return

the return value of waitFor if items were attempted to be withdrawn. False otherwise.

Parameters

item

the item to withdraw

amount

the amount to withdraw

waitFor

the condition to wait for