psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
240 stars 45 forks source link

Why is there no abstract base class or interface for filters etc? #6

Closed MartinLiebig closed 3 years ago

MartinLiebig commented 3 years ago

Hi there,

When using filters in my own code it is a bit cumbersome, that there is not an interface or such for it. So you cannot do something like:

        HashMap<String, Filter> filterHashMap = new HashMap<>();
        for(String filterName : filterHashMap){
            Filter myFilter = filterHashMap.get(filterName);
            // Do things with each filter
        }

Are there any plans to change this?

Cheers, Martin

psambit9791 commented 3 years ago

There is no plan to introduce this as of now.

MartinLiebig commented 3 years ago

For a specific reason, or because you are busy doing other things?

Maybe i could just write it.

psambit9791 commented 3 years ago

Right now, there is a lot of other modules that needs to be implemented. The Feature List (https://github.com/psambit9791/jDSP/projects/1) shows all the modules and features that are due to be completed for release of v1.0.

MartinLiebig commented 3 years ago

Okay, thank you. Let me know if i can support you. I wrote my own java wrapper around it.

psambit9791 commented 3 years ago

HI @MartinSchmitzDo

FEATURE ENHANCEMENT ADDED

I decided to implement this feature for both types of filters that are available. For filters, JDSP will have 2 interfaces:

Thanks for pointing this out. Feature will be available in the next release: v0.5.0 on 5th October, 2020.

MartinLiebig commented 3 years ago

Hey @psambit9791 , i saw you added this with _ ? Usually class names in Java don't use any underscores. See: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Cheers, Martin

psambit9791 commented 3 years ago

Yes. I just used the underscores to make it easier for me to identify Interfaces and Abstract Classes later on.

MartinLiebig commented 3 years ago

I understand that this is something common in python, i would personally prefer usual java coding standards.