@Override public Iterator<E> iterator() { return value.iterator(); } @Override
@Override public UnmodifiableIterator<E> iterator() { return Iterators.unmodifiableIterator(delegate.iterator()); }
@Override public UnmodifiableIterator<E> iterator() { return Iterators.unmodifiableIterator(delegate.iterator()); }
@Override public UnmodifiableIterator<E> iterator() { return Iterators.unmodifiableIterator(delegate.iterator()); }
void toString(final StringBuilder b) { b.append("protocol is one of ("); Iterator<Protocol> iterator = set.iterator(); if (iterator.hasNext()) { Protocol protocol = iterator.next(); b.append(protocol); while (iterator.hasNext()) { protocol = iterator.next(); b.append(", "); b.append(protocol); } } b.append(')'); }
void toString(final StringBuilder b) { b.append("encryption is one of ("); Iterator<Encryption> iterator = set.iterator(); if (iterator.hasNext()) { Encryption encryption = iterator.next(); b.append(encryption); while (iterator.hasNext()) { encryption = iterator.next(); b.append(", "); b.append(encryption); } } b.append(')'); }
void toString(final StringBuilder b) { b.append("digest is one of ("); Iterator<Digest> iterator = set.iterator(); if (iterator.hasNext()) { Digest digest = iterator.next(); b.append(digest); while (iterator.hasNext()) { digest = iterator.next(); b.append(", "); b.append(digest); } } b.append(')'); }
void toString(final StringBuilder b) { b.append("authentication is one of ("); Iterator<Authentication> iterator = set.iterator(); if (iterator.hasNext()) { Authentication authentication = iterator.next(); b.append(authentication); while (iterator.hasNext()) { authentication = iterator.next(); b.append(", "); b.append(authentication); } } b.append(')'); }
void toString(final StringBuilder b) { b.append("openssl security level is one of ("); Iterator<SecurityLevel> iterator = set.iterator(); if (iterator.hasNext()) { SecurityLevel securityLevel = iterator.next(); b.append(securityLevel); while (iterator.hasNext()) { securityLevel = iterator.next(); b.append(", "); b.append(securityLevel); } } b.append(')'); }
void toString(final StringBuilder b) { b.append("key agreement is one of ("); Iterator<KeyAgreement> iterator = set.iterator(); if (iterator.hasNext()) { KeyAgreement keyAgreement = iterator.next(); b.append(keyAgreement); while (iterator.hasNext()) { keyAgreement = iterator.next(); b.append(", "); b.append(keyAgreement); } } b.append(')'); }
private String joinEnumValues(EnumSet set) { boolean seenFirst = false; StringBuffer result = new StringBuffer(); for (Iterator iterator = set.iterator(); iterator.hasNext();) { Enum value = (Enum) iterator.next(); if (seenFirst) { result.append(','); } else { seenFirst = true; } result.append(value.name()); } return result.toString(); }
@Override public UnmodifiableIterator<E> iterator() { return Iterators.unmodifiableIterator(delegate.iterator()); }
/** * Helper method that can be used to dynamically figure out * enumeration type of given {@link EnumSet}, without having * access to its declaration. * Code is needed to work around design flaw in JDK. */ public static Class<? extends Enum<?>> findEnumType(EnumSet<?> s) { // First things first: if not empty, easy to determine if (!s.isEmpty()) { return findEnumType(s.iterator().next()); } // Otherwise need to locate using an internal field return EnumTypeLocator.instance.enumTypeFor(s); }
/** * Helper method that can be used to dynamically figure out * enumeration type of given {@link EnumSet}, without having * access to its declaration. * Code is needed to work around design flaw in JDK. */ public static Class<? extends Enum<?>> findEnumType(EnumSet<?> s) { // First things first: if not empty, easy to determine if (!s.isEmpty()) { return findEnumType(s.iterator().next()); } // Otherwise need to locate using an internal field return EnumTypeLocator.instance.enumTypeFor(s); }
/** * Helper method that can be used to dynamically figure out * enumeration type of given {@link EnumSet}, without having * access to its declaration. * Code is needed to work around design flaw in JDK. * * @since 1.5 */ public static Class<? extends Enum<?>> findEnumType(EnumSet<?> s) { // First things first: if not empty, easy to determine if (!s.isEmpty()) { return findEnumType(s.iterator().next()); } // Otherwise need to locate using an internal field return EnumTypeLocator.instance.enumTypeFor(s); }
/** * Helper method that can be used to dynamically figure out * enumeration type of given {@link EnumSet}, without having * access to its declaration. * Code is needed to work around design flaw in JDK. */ public static Class<? extends Enum<?>> findEnumType(EnumSet<?> s) { // First things first: if not empty, easy to determine if (!s.isEmpty()) { return findEnumType(s.iterator().next()); } // Otherwise need to locate using an internal field return EnumTypeLocator.instance.enumTypeFor(s); }
@Override public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException { EnumSet enset = (EnumSet) toWrite; int count = 0; out.writeInt(enset.size()); if ( enset.isEmpty() ) { //WTF only way to determine enumtype .. EnumSet compl = EnumSet.complementOf(enset); out.writeStringUTF(FSTUtil.getRealEnumClass(compl.iterator().next().getClass()).getName()); } else { for (Object element : enset) { if ( count == 0 ) { out.writeStringUTF(FSTUtil.getRealEnumClass(element.getClass()).getName()); } out.writeStringUTF(element.toString()); count++; } } }
@Override public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException { EnumSet enset = (EnumSet) toWrite; int count = 0; out.writeInt(enset.size()); if ( enset.isEmpty() ) { //WTF only way to determine enumtype .. EnumSet compl = EnumSet.complementOf(enset); out.writeClassTag(FSTUtil.getRealEnumClass(compl.iterator().next().getClass())); } else { for (Object element : enset) { if ( count == 0 ) { out.writeClassTag(FSTUtil.getRealEnumClass(element.getClass())); } out.writeObjectInternal(element, null, Enum.class); count++; } } }
private SpeedmentPredicate<ENTITY> toEntityPredicate(Predicate<E> predicate) { final EnumSet<E> valid = evaluate(predicate); switch (valid.size()) { case 0 : return new AlwaysFalsePredicate<>(this); case 1 : return new ReferenceEqualPredicate<>(this, valid.iterator().next()); default : return new ReferenceInPredicate<>(this, valid); } }
private SpeedmentPredicate<ENTITY> toEntityPredicate(Predicate<E> predicate) { final EnumSet<E> valid = evaluate(predicate); switch (valid.size()) { case 0 : return new AlwaysFalsePredicate<>(this); case 1 : return new ReferenceEqualPredicate<>(this, valid.iterator().next()); default : return new ReferenceInPredicate<>(this, valid); } }