All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.incubation.terminal.IContainer Maven / Gradle / Ivy

Go to download

TSL2 Framework Terminal (Console Application Framework named SIShell, providing Actions, Options, Commands, Inputs, lots of Selectors, PlatformManagement)

There is a newer version: 2.5.2
Show newest version
/*
 * File: $HeadURL$
 * Id  : $Id$
 * 
 * created by: Tom
 * created on: 23.12.2014
 * 
 * Copyright: (c) Thomas Schneider 2014, all rights reserved
 */
package de.tsl2.nano.incubation.terminal;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * interface for items having child items
 * 
 * @author Tom
 * @version $Revision$
 */
public interface IContainer extends IItem {
    I getValue(int i);

    /**
     * @return child items depending on the current context.
     */
    @SuppressWarnings("rawtypes")
    public List> getNodes(final Map context);

    /**
     * adds a child
     * 
     * @param item item
     * @return true, if successful added
     */
    > boolean add(II item);

    /**
     * removes a child
     * 
     * @param item item
     * @return true, if successful removed
     */
    > boolean remove(II item);

    /**
     * evaluates the next child node depending on the current environment
     * @param in input stream
     * @param out terminal output
     * @param env current terminal environment
     * @return normally the container itself
     */
    > II next(InputStream in, PrintStream out, Properties env);
}