package com.turlir.converter;

import com.turlir.extractors.Interval;

import java.util.Iterator;

public class MemberConverter implements Iterator<Member> {

    private final Iterator<Interval> mParent;

    public MemberConverter(Iterator<Interval> parent) {
        mParent = parent;
    }

    @Override
    public boolean hasNext() {
        return mParent.hasNext();
    }

    @Override
    public Member next() {
        Interval now = mParent.next();
        if (now.operand()) {
            return new Value(Double.parseDouble(now.value));
        } else {
            String token = now.value;
            switch (token) {
                case "(":
                    return Parts.OS;
                case ")":
                    return Parts.CS;
                default:
                    return Parts.find(token);
            }
        }
    }
}

@@ -603,196 +603,8 @@
 ue;%0A
-            switch (token) %7B%0A                case %22(%22:%0A                    return Parts.OS;%0A                case %22)%22:%0A                    return Parts.CS;%0A                default:%0A        
     
@@ -641,22 +641,8 @@
 n);%0A
-            %7D%0A
     

fix other code