Package javaflow.components.api

Examples of javaflow.components.api.Packet


    @Override
    public void execute() {
        int count = countPort.receiveContentAndDrop().intValue();
        for(int i = 0; i<count;i++){
            Packet packet = in.receive();
            packet.drop();
        }
        endNotify.createPacket(null).send();
    }
View Full Code Here


        return false;
     }

        @Override
        public void execute() {
            Packet packet;
            int level = 0;
            while((packet = inputPort.receive())!=null){
                switch (packet.getType()){
                    case START:
                        packet.drop();
                        level++;
                        break;
                    case END:
                        packet.drop();
                        level--;
                        break;
                    case NORMAL:
                        outputPort.send(packet);
                        break;
View Full Code Here


    @Override
    public void execute() {
        Set<Object> seen = new HashSet<>();
        Packet p;
        while(((p=in.receive())!=null)){
            if (seen.add(p.getContent())){
                out.send(p);
            } else {
                p.drop();
            }
        }
    }
View Full Code Here


        @Override
        public Packet next() {
            started = true;
            Packet packet = chained.get(nextIndex);
            nextIndex++;
            return packet;
        }
View Full Code Here

        this.owner = component;
    }

    @Override
    public Object receiveContentAndDrop() {
        Packet receive = receive();
        if (receive == null) {
            return null;
        } else {
            return receive.getContentAndDrop();
        }
    }
View Full Code Here

        return false;
    }

    @Override
    public void execute() {
        Packet packet;
        boolean firstPacket = true;
        while((packet = inputPort.receive())!=null){
            if (firstPacket){
                firstPacket = false;
                outputPort.createPacket(null).beStart().send();
View Full Code Here

TOP

Related Classes of javaflow.components.api.Packet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.