Code Monkey home page Code Monkey logo

functionality's Introduction

Functionality

Functionality is a project recreating Java functional interfaces to provide more detailed and partial expressions. Each functional interface has a single abstract method, called the functional method for that functional interface, to which the lambda expression's parameter and return types are matched or adapted.vFunctional interfaces can provide a target type in multiple contexts, such as assignment, method invocation, or cast context:

// Assignment Context
Function1<String, byte[]> f = String::getBytes;

// Method Invocation Context
byteToIntFunction.andThen(r -> r < 30);

// Cast Context
byteToIntFunction.andThen(((IntFunction1<Boolean>) r -> r < 30).boxInput());

The interfaces in this package are supposed to represent the core of all functions as all functional interfaces in this package are connected. They are meant to take partial points of existing functions and generalize them such that they can be referenced separately from the actual interface itself.

The interfaces in this package that are annotated with @FunctionalInterface are meant as merely an aid to capture design intent and enlist the help of the compiler in identifying accidental violations of design intent. The interfaces in this package that are annotated with @InheritOnly are meant as an aid to capture that the interface should only be inherited and never used directly as a functional interface.

The functions in this package are currently broken into the following sub-projects:

Project Name Description
Functionality Represents functions (from some input(s) T1, T2, ... to some output R)
Consumability Represents consumers (from some input(s) T1, T2, ... to no output)
Operating Represents operators (from some input(s) of the same type to some output of the same type)
Predicating Represents predicates (from some input(s) T1, T2, ... to some boolean primitive)
Throwability Represents functions, consumers, operators, and predicates that may or may not throw an exception

Some functional interfaces are specialized such that the type parameters are primitives with additional type prefixes. For those that return a primitive value, the interface is prefixed with ToX where X is the primitive type. These schemes can be combined, as in ByteToLongFunction1.

License

The entire project is licensed under Mozilla Public License 2.0. This does allow use in commercial, patent, and private use provided the source is disclosed under the same license and copyright. This project does not allow use of trademarks held by ChampionAsh5357 and provides no warranty or liability for any issues that may occur by using this project.

functionality's People

Contributors

championash5357 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.