Package com.alkacon.vie.shared

Examples of com.alkacon.vie.shared.I_EntityAttribute


    public List<I_EntityAttribute> getAttributes() {

        List<I_EntityAttribute> result = new ArrayList<I_EntityAttribute>();
        JsArrayString attributeNames = getAttributeNames();
        for (int i = 0; i < attributeNames.length(); i++) {
            I_EntityAttribute attribute = getAttribute(attributeNames.get(i));
            if (attribute != null) {
                result.add(attribute);
            }
        }
        return result;
View Full Code Here


    /**
     * @see com.alkacon.vie.shared.I_Entity#insertAttributeValue(java.lang.String, com.alkacon.vie.shared.I_Entity, int)
     */
    public void insertAttributeValue(String attributeName, I_Entity value, int index) {

        I_EntityAttribute attribute = getAttribute(attributeName);
        if (index < 0) {
            throw new IndexOutOfBoundsException("Index should be > 0");
        }
        if ((attribute == null) && (index > 0)) {
            throw new IndexOutOfBoundsException("Index of " + index + " to big.");
        }
        if (attribute == null) {
            setAttributeValue(attributeName, value);
        } else {
            List<I_Entity> values = attribute.getComplexValues();
            if (index > values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            if (index == values.size()) {
                addAttributeValue(attributeName, value);
View Full Code Here

    /**
     * @see com.alkacon.vie.shared.I_Entity#insertAttributeValue(java.lang.String, java.lang.String, int)
     */
    public void insertAttributeValue(String attributeName, String value, int index) {

        I_EntityAttribute attribute = getAttribute(attributeName);
        if (index < 0) {
            throw new IndexOutOfBoundsException("Index should be > 0");
        }
        if ((attribute == null) && (index > 0)) {
            throw new IndexOutOfBoundsException("Index of " + index + " to big.");
        }
        if (attribute == null) {
            setAttributeValue(attributeName, value);
        } else {
            List<String> values = attribute.getSimpleValues();
            if (index > values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            if (index == values.size()) {
                addAttributeValue(attributeName, value);
View Full Code Here

    public void removeAttributeValue(String attributeName, int index) {

        if (!hasAttribute(attributeName)) {
            return;
        }
        I_EntityAttribute attribute = getAttribute(attributeName);
        if (attribute.isSingleValue() && (index == 0)) {
            removeAttribute(attributeName);
        } else {
            removeAttributeSilent(attributeName);
            if (attribute.isSimpleValue()) {
                for (int i = 0; i < attribute.getSimpleValues().size(); i++) {
                    if (i != index) {
                        addAttributeValue(attributeName, attribute.getSimpleValues().get(i));
                    }
                }

            } else {
                for (int i = 0; i < attribute.getComplexValues().size(); i++) {
                    if (i != index) {
                        addAttributeValue(attributeName, attribute.getComplexValues().get(i));
                    }
                }
            }
        }
    }
View Full Code Here

            throw new UnsupportedOperationException("May only set native entities as values.");
        }
        if ((index == 0) && !hasAttribute(attributeName)) {
            setAttributeValue(attributeName, value);
        }
        I_EntityAttribute attribute = getAttribute(attributeName);
        if ((index == 0) && attribute.isSingleValue()) {
            setAttributeValue(attributeName, value);
        } else {
            List<I_Entity> values = attribute.getComplexValues();
            if (index >= values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            removeAttributeSilent(attributeName);
            for (int i = 0; i < values.size(); i++) {
View Full Code Here

    /**
     * @see com.alkacon.vie.shared.I_Entity#setAttributeValue(java.lang.String, java.lang.String, int)
     */
    public void setAttributeValue(String attributeName, String value, int index) {

        I_EntityAttribute attribute = getAttribute(attributeName);
        if ((attribute == null) || ((index == 0) && attribute.isSingleValue())) {
            setAttributeValue(attributeName, value);
        } else {
            List<String> values = attribute.getSimpleValues();
            if (index >= values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            removeAttributeSilent(attributeName);
            for (int i = 0; i < values.size(); i++) {
View Full Code Here

    public List<I_EntityAttribute> getAttributes() {

        List<I_EntityAttribute> result = new ArrayList<I_EntityAttribute>();
        JsArrayString attributeNames = getAttributeNames();
        for (int i = 0; i < attributeNames.length(); i++) {
            I_EntityAttribute attribute = getAttribute(attributeNames.get(i));
            if (attribute != null) {
                result.add(attribute);
            }
        }
        return result;
View Full Code Here

    /**
     * @see com.alkacon.vie.shared.I_Entity#insertAttributeValue(java.lang.String, com.alkacon.vie.shared.I_Entity, int)
     */
    public void insertAttributeValue(String attributeName, I_Entity value, int index) {

        I_EntityAttribute attribute = getAttribute(attributeName);
        if (index < 0) {
            throw new IndexOutOfBoundsException("Index should be > 0");
        }
        if ((attribute == null) && (index > 0)) {
            throw new IndexOutOfBoundsException("Index of " + index + " to big.");
        }
        if (attribute == null) {
            setAttributeValue(attributeName, value);
        } else {
            List<I_Entity> values = attribute.getComplexValues();
            if (index > values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            if (index == values.size()) {
                addAttributeValue(attributeName, value);
View Full Code Here

    /**
     * @see com.alkacon.vie.shared.I_Entity#insertAttributeValue(java.lang.String, java.lang.String, int)
     */
    public void insertAttributeValue(String attributeName, String value, int index) {

        I_EntityAttribute attribute = getAttribute(attributeName);
        if (index < 0) {
            throw new IndexOutOfBoundsException("Index should be > 0");
        }
        if ((attribute == null) && (index > 0)) {
            throw new IndexOutOfBoundsException("Index of " + index + " to big.");
        }
        if (attribute == null) {
            setAttributeValue(attributeName, value);
        } else {
            List<String> values = attribute.getSimpleValues();
            if (index > values.size()) {
                throw new IndexOutOfBoundsException("Index of " + index + " to big.");
            }
            if (index == values.size()) {
                addAttributeValue(attributeName, value);
View Full Code Here

    public void removeAttributeValue(String attributeName, int index) {

        if (!hasAttribute(attributeName)) {
            return;
        }
        I_EntityAttribute attribute = getAttribute(attributeName);
        if (attribute.isSingleValue() && (index == 0)) {
            removeAttribute(attributeName);
        } else {
            removeAttributeSilent(attributeName);
            if (attribute.isSimpleValue()) {
                for (int i = 0; i < attribute.getSimpleValues().size(); i++) {
                    if (i != index) {
                        addAttributeValue(attributeName, attribute.getSimpleValues().get(i));
                    }
                }

            } else {
                for (int i = 0; i < attribute.getComplexValues().size(); i++) {
                    if (i != index) {
                        addAttributeValue(attributeName, attribute.getComplexValues().get(i));
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.alkacon.vie.shared.I_EntityAttribute

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.