| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock ASĀ« |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | | |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.getTracer; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.util.AbstractSet; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final ConditionResult approximatelyEqualTo( |
| | | AttributeValue value) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final boolean contains(AttributeValue value) |
| | | { |
| | | return values.contains(value); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final AttributeType getAttributeType() |
| | | { |
| | | return attributeType; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final ConditionResult greaterThanOrEqualTo( |
| | | AttributeValue value) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final boolean isVirtual() |
| | | { |
| | | return false; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Iterator<AttributeValue> iterator() |
| | | { |
| | | return values.iterator(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final ConditionResult lessThanOrEqualTo( |
| | | AttributeValue value) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final ConditionResult matchesSubstring( |
| | | ByteString subInitial, |
| | | List<ByteString> subAny, ByteString subFinal) |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final int size() |
| | | { |
| | | return values.size(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append("Attribute("); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Set<String> getOptions() |
| | | { |
| | | return options; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Set<String> getOptions() |
| | | { |
| | | return Collections.emptySet(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Set<String> getOptions() |
| | | { |
| | | return option; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new small set using the content of the provided |
| | | * collection. |
| | | * |
| | | * @param c |
| | | * The collection whose elements are to be placed into |
| | | * this set. |
| | | */ |
| | | public SmallSet(Collection<T> c) |
| | | { |
| | | addAll(c); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new small set with the specified initial capacity. |
| | | * |
| | | * @param initialCapacity |
| | | * The initial capacity for this set. |
| | | */ |
| | | public SmallSet(int initialCapacity) |
| | | { |
| | | setInitialCapacity(initialCapacity); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public boolean hasNext() |
| | | { |
| | | return hasNext; |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public T next() |
| | | { |
| | | if (!hasNext) |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void remove() |
| | | { |
| | | if (hasNext || firstElement == null) |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean contains(Object o) |
| | | { |
| | | if (elements != null) |
| | | { |
| | | // Note: if there is one or zero values left we could stop |
| | | // using the set. However, lets assume that if the set |
| | | // was multi-valued before then it may become multi-valued |
| | | // again. |
| | | return elements.contains(o); |
| | | } |
| | | |
| | | return (firstElement != null && firstElement.equals(o)); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | * @return An iterator over the attribute values in this attribute |
| | | * builder. |
| | | */ |
| | | @Override |
| | | public Iterator<AttributeValue> iterator() |
| | | { |
| | | return values.iterator(); |