Skip to content

Commit

Permalink
add java.util.Collection and java.util.Queue to port ShrinkItArchive …
Browse files Browse the repository at this point in the history
…with version 0.12.0
  • Loading branch information
bastie committed Sep 7, 2024
1 parent 1927382 commit b4846ce
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ When working with XCode add dependency

When working with SwiftPM add dependency

.package(url: "https://github.com/bastie/JavApi4Swift.git", from: "0.11.0")
.package(url: "https://github.com/bastie/JavApi4Swift.git", from: "0.12.0")

or

.Package(url: "https://github.com/bastie/JavApi4Swift.git", .upToNextMajor(from: "0.11.0"))
.Package(url: "https://github.com/bastie/JavApi4Swift.git", .upToNextMajor(from: "0.12.0"))

## Ports

Expand All @@ -63,6 +63,10 @@ Check out these projects and learn how to use JavApi⁴Swift.

* [iban4j](https://github.com/bastie/iban4j2JavApi) is a library for generation and validation of the International Bank Account Numbers (IBAN ISO_13616) and Business Identifier Codes (BIC ISO_9362).

### 0.12.0

* [ShrinkItArchive](https://github.com/bastie/ShrinkItArchive) is a library for managing Apple ][ ShrinkIt / NuFX archives.

## Development

### include other projects
Expand Down
14 changes: 14 additions & 0 deletions Sources/JavApi/util/Collection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2024 - Sebastian Ritter <bastie@users.noreply.github.com>
* SPDX-License-Identifier: MIT
*/

extension java.util {

protocol Collection<Element> {
associatedtype Element

func clear () throws
func isEmpty () -> Bool
}
}
20 changes: 20 additions & 0 deletions Sources/JavApi/util/Queue.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: 2024 - Sebastian Ritter <bastie@users.noreply.github.com>
* SPDX-License-Identifier: MIT
*/

extension java.util {

protocol Queue<Element> : Collection {
associatedtype Element

func add (_ elem : Element) throws -> Bool
func element () throws -> Element
func offer (_ elem : Element) -> Bool
func peek () -> Element?
func poll () -> Element?
func remove () throws -> Element
}

}

0 comments on commit b4846ce

Please sign in to comment.