Example usage for java.util Collections unmodifiableSortedSet

List of usage examples for java.util Collections unmodifiableSortedSet

Introduction

In this page you can find the example usage for java.util Collections unmodifiableSortedSet.

Prototype

public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> s) 

Source Link

Document

Returns an unmodifiable view of the specified sorted set.

Usage

From source file:es.caib.zkib.jxpath.util.BasicTypeConverter.java

/**
 * Get an unmodifiable version of a collection.
 * @param collection to wrap//  www .ja va 2 s  .c  o  m
 * @return Collection
 */
protected Collection unmodifiableCollection(Collection collection) {
    if (collection instanceof List) {
        return Collections.unmodifiableList((List) collection);
    }
    if (collection instanceof SortedSet) {
        return Collections.unmodifiableSortedSet((SortedSet) collection);
    }
    if (collection instanceof Set) {
        return Collections.unmodifiableSet((Set) collection);
    }
    return Collections.unmodifiableCollection(collection);
}

From source file:org.glite.security.voms.admin.persistence.model.VOMSUser.java

public Set getRoles(VOMSGroup g) {

    SortedSet res = new TreeSet();

    Iterator mIter = getMappings().iterator();
    while (mIter.hasNext()) {

        VOMSMapping m = (VOMSMapping) mIter.next();
        if (m.isRoleMapping() && m.getGroup().equals(g))
            res.add(m.getRole());//from w ww  .  j av a  2  s. com
    }

    return Collections.unmodifiableSortedSet(res);
}

From source file:org.apereo.portal.portlets.portletadmin.PortletDefinitionForm.java

public SortedSet<JsonEntityBean> getCategories() {
    return Collections.unmodifiableSortedSet(categories);
}

From source file:org.eclipse.skalli.commons.Statistics.java

public SortedSet<BrowserInfo> getBrowserInfo() {
    return Collections.unmodifiableSortedSet(browsers);
}

From source file:org.eclipse.skalli.commons.Statistics.java

public SortedSet<RefererInfo> getRefererInfo() {
    return Collections.unmodifiableSortedSet(referers);
}

From source file:org.eclipse.skalli.commons.Statistics.java

public SortedSet<UsageInfo> getUsageInfo() {
    return Collections.unmodifiableSortedSet(usages);
}

From source file:org.diorite.config.impl.ConfigPropertyTemplateImpl.java

@Nullable
@Override/*from  w ww.  j a  v  a2  s.com*/
public T get(ConfigPropertyValue<T> propertyValue) {
    T rawValue = propertyValue.getRawValue();
    if (rawValue == null) {
        return null;
    }
    if (this.returnUnmodifiableCollections) {
        if (rawValue instanceof Collection) {
            if (rawValue instanceof Set) {
                if (rawValue instanceof NavigableSet) {
                    return (T) Collections.unmodifiableNavigableSet((NavigableSet<?>) rawValue);
                }
                if (rawValue instanceof SortedSet) {
                    return (T) Collections.unmodifiableSortedSet((SortedSet<?>) rawValue);
                }
                return (T) Collections.unmodifiableSet((Set<?>) rawValue);
            }
            if (rawValue instanceof List) {
                return (T) Collections.unmodifiableList((List<?>) rawValue);
            }
            return (T) Collections.unmodifiableCollection((Collection<?>) rawValue);
        } else if (rawValue instanceof Map) {
            if (rawValue instanceof NavigableMap) {
                return (T) Collections.unmodifiableNavigableMap((NavigableMap<?, ?>) rawValue);
            }
            if (rawValue instanceof SortedMap) {
                return (T) Collections.unmodifiableSortedMap((SortedMap<?, ?>) rawValue);
            }
            return (T) Collections.unmodifiableMap((Map<?, ?>) rawValue);
        }
    }
    return rawValue;
}

From source file:org.eclipse.skalli.commons.Statistics.java

public SortedSet<SearchInfo> getSearchInfo() {
    return Collections.unmodifiableSortedSet(searches);
}

From source file:org.eclipse.skalli.commons.Statistics.java

public SortedSet<ResponseTimeInfo> getResponseTimeInfo() {
    return Collections.unmodifiableSortedSet(responseTimes);
}

From source file:org.libreplan.business.orders.entities.Order.java

public SortedSet<EndDateCommunication> getEndDateCommunicationToCustomer() {
    return Collections.unmodifiableSortedSet(this.endDateCommunicationToCustomer);
}