Performs the count of how many times a given open symbol has in a text subtracted from how many closed symbols that text has.
Parser Balance is a symbol counter, counting how many times a given open symbol has in a text subtracted from how many closed symbols that text has.
- Add one of the options below to the pom.xml file:
<dependency>
<groupId>io.github.wniemiec-util-java</groupId>
<artifactId>parser-balance</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>wniemiec.io.java</groupId>
<artifactId>parser-balance</artifactId>
<version>LATEST</version>
</dependency>
- Run
$ mvn install
- Use it
[...]
import wniemiec.io.java.Balance;
[...]
Balance cbBalance = new CurlyBracketBalance();
Balance rbBalance = new RoundBracketBalance();
String example = "{Hello (World{";
cbBalance.parse(example);
rbBalance.parse(example);
System.out.println( cbBalance.getBalance() );
System.out.println( rbBalance.getBalance() );
[...]
Property | Parameter type | Return type | Description | Default parameter value |
---|---|---|---|---|
parse | void |
void |
Analyzes a text and updates the balance | - |
increaseBalance | void |
void |
Increases the balance | - |
decreaseBalance | void |
boolean |
Decreases the balance | - |
getBalance | void |
boolean |
Gets balance value | - |
isBalanceEmpty | void |
void |
Checks whether the balance is empty | - |
alreadyIncreased | void |
boolean |
Checks whether the balance has already been increased at any time | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |