Skip to content

Performs the count of how many times a given open symbol has in a text subtracted from how many closed symbols that text has.

License

Notifications You must be signed in to change notification settings

wniemiec-util-java/parser-balance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parser Balance

Performs the count of how many times a given open symbol has in a text subtracted from how many closed symbols that text has.

Coverage status Java compatibility Maven Central release License


❇ Introduction

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.

❓ How to use

  1. Add one of the options below to the pom.xml file:

Using Maven Central (recomended):

<dependency>
  <groupId>io.github.wniemiec-util-java</groupId>
  <artifactId>parser-balance</artifactId>
  <version>LATEST</version>
</dependency>

Using GitHub Packages:

<dependency>
  <groupId>wniemiec.io.java</groupId>
  <artifactId>parser-balance</artifactId>
  <version>LATEST</version>
</dependency>
  1. Run
$ mvn install
  1. 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() );

[...]

📖 Documentation

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 -

🚩 Changelog

Details about each version are documented in the releases section.

🤝 Contribute!

See the documentation on how you can contribute to the project here.

📁 Files

/

Name Type Description
dist Directory Released versions
docs Directory Documentation files
src Directory Source files