本文整理了Java中java.util.LinkedHashSet.isEmpty()
方法的一些代码示例,展示了LinkedHashSet.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedHashSet.isEmpty()
方法的具体详情如下:
包路径:java.util.LinkedHashSet
类名称:LinkedHashSet
方法名:isEmpty
暂无
代码示例来源:origin: jersey/jersey
/**
* Returns true if this collector has errors.
*
* @return true if the collector has errors.
*/
public boolean hasErrors() {
return ((throwables != null) && (!throwables.isEmpty()));
}
}
代码示例来源:origin: alibaba/jvm-sandbox
/**
* 是否匹配成功
*
* @return TRUE:匹配成功;FALSE:匹配失败;
*/
public boolean isMatched() {
return !behaviorStructures.isEmpty();
}
代码示例来源:origin: apache/geode
/**
* Caller must hold the rwLock.
*
* @return true if the queue contains objects
*/
boolean internalIsEmpty() {
return this.idsAvailable.isEmpty();
}
代码示例来源:origin: apache/activemq
private void findNextLowestFrequency() {
while (lowestFrequency <= maxFrequency && frequencyList[lowestFrequency].isEmpty()) {
lowestFrequency++;
}
if (lowestFrequency > maxFrequency) {
lowestFrequency = 0;
}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public boolean isEmpty() {
return delegate.isEmpty();
}
代码示例来源:origin: jersey/jersey
/**
* This method will throw if the list of throwables associated with this collector is not empty.
*
* @throws MultiException An exception with all the throwables found in this collector.
*/
public void throwIfErrors() throws MultiException {
if (throwables == null || throwables.isEmpty()) {
return;
}
throw new MultiException(new LinkedList<>(throwables));
}
代码示例来源:origin: spotbugs/spotbugs
@Override
public String toString() {
if (children.isEmpty()) {
return "";
}
StringBuilder buf = new StringBuilder();
for (Matcher m : children) {
buf.append(m).append(" ");
}
buf.setLength(buf.length() - 1);
return buf.toString();
}
代码示例来源:origin: org.apache.maven/maven-project
private List collectRestoredListOfPatterns( List patterns,
List originalPatterns,
List originalInterpolatedPatterns )
{
LinkedHashSet collectedPatterns = new LinkedHashSet();
collectedPatterns.addAll( originalPatterns );
for ( Iterator it = patterns.iterator(); it.hasNext(); )
{
String pattern = (String) it.next();
if ( !originalInterpolatedPatterns.contains( pattern ) )
{
collectedPatterns.add( pattern );
}
}
return collectedPatterns.isEmpty() ? Collections.EMPTY_LIST
: new ArrayList( collectedPatterns );
}
代码示例来源:origin: spotbugs/spotbugs
public void forgetLastBug() {
Data d = map.get(lastBug);
if (d != null) {
d.allSource.remove(lastSourceLine);
if (d.allSource.isEmpty()) {
map.remove(lastBug);
hashes.remove(lastBug.getInstanceHash());
}
}
lastBug = null;
lastSourceLine = null;
}
代码示例来源:origin: fabric8io/docker-maven-plugin
private List<String> extractDependentImagesFor(Resolvable config) {
LinkedHashSet<String> ret = new LinkedHashSet<>(config.getDependencies());
return ret.isEmpty() ? null : new ArrayList<>(ret);
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@Nullable
public static VirtualFile getSDKSrcRoot(@NotNull Project project, @Nullable Module module) {
LinkedHashSet<VirtualFile> sources = BallerinaSdkUtil.getSourcesPathsToLookup(project, module);
if (sources.isEmpty()) {
return null;
}
return ContainerUtil.getFirstItem(sources);
}
代码示例来源:origin: org.codehaus.groovy/groovy
private static ClassNode makeSelf(ClassNode trait) {
ClassNode ret = trait;
LinkedHashSet<ClassNode> selfTypes = new LinkedHashSet<ClassNode>();
Traits.collectSelfTypes(ret, selfTypes);
if (!selfTypes.isEmpty()) {
selfTypes.add(ret);
ret = new UnionTypeClassNode(selfTypes.toArray(ClassNode.EMPTY_ARRAY));
}
return ret;
}
代码示例来源:origin: apache/activemq
private void doEviction() {
int currentlyDeleted = 0;
float target = maxCacheSize * evictionFactor;
while (currentlyDeleted < target) {
LinkedHashSet<CacheNode<Key, Value>> nodes = frequencyList[lowestFrequency];
if (nodes.isEmpty()) {
throw new IllegalStateException("Lowest frequency constraint violated!");
} else {
Iterator<CacheNode<Key, Value>> it = nodes.iterator();
while (it.hasNext() && currentlyDeleted++ < target) {
CacheNode<Key, Value> node = it.next();
it.remove();
cache.remove(node.k);
}
if (!it.hasNext()) {
findNextLowestFrequency();
}
}
}
}
代码示例来源:origin: wildfly/wildfly
/**
* Remove the given value of the given attribute name.
*
* @param name the attribute name (must not be {@code null})
* @param value the value to remove (must not be {@code null})
* @return {@code true} if the value was present, or {@code false} otherwise
*/
public boolean removeAttributeValue(final String name, final AttributeValue value) {
Assert.checkNotNullParam("name", name);
Assert.checkNotNullParam("value", value);
final LinkedHashSet<AttributeValue> set = attributes.get(name);
if (set == null) {
return false;
}
if (set.remove(value)) {
if (set.isEmpty()) {
attributes.remove(name, set);
}
return true;
}
return false;
}
代码示例来源:origin: GoogleContainerTools/jib
/**
* Returns a new {@link JibContainerBuilder} using the parameters specified on the {@link
* JavaContainerBuilder}.
*
* @return a new {@link JibContainerBuilder} using the parameters specified on the {@link
* JavaContainerBuilder}
*/
public JibContainerBuilder toContainerBuilder() {
if (mainClass == null) {
throw new IllegalStateException(
"mainClass is null on JavaContainerBuilder; specify the main class using "
+ "JavaContainerBuilder#setMainClass(String), or consider using a "
+ "jib.frontend.MainClassFinder to infer the main class");
}
if (classpath.isEmpty()) {
throw new IllegalStateException(
"Failed to construct entrypoint because no files were added to the JavaContainerBuilder");
}
jibContainerBuilder.setEntrypoint(
JavaEntrypointConstructor.makeEntrypoint(new ArrayList<>(classpath), jvmFlags, mainClass));
jibContainerBuilder.setLayers(layerConfigurationsBuilder.build().getLayerConfigurations());
return jibContainerBuilder;
}
代码示例来源:origin: redisson/redisson
/**
* {@inheritDoc}
*/
public Entry<U> extendBy(MethodDescription methodDescription, Harmonizer<U> harmonizer) {
Harmonized<U> key = this.key.extend(methodDescription.asDefined(), harmonizer);
LinkedHashSet<MethodDescription> methodDescriptions = new LinkedHashSet<MethodDescription>();
TypeDescription declaringType = methodDescription.getDeclaringType().asErasure();
boolean bridge = methodDescription.isBridge();
Visibility visibility = this.visibility;
for (MethodDescription extendedMethod : this.methodDescriptions) {
if (extendedMethod.getDeclaringType().asErasure().equals(declaringType)) {
if (extendedMethod.isBridge() ^ bridge) {
methodDescriptions.add(bridge ? extendedMethod : methodDescription);
} else {
methodDescriptions.add(methodDescription);
methodDescriptions.add(extendedMethod);
}
}
visibility = visibility.expandTo(extendedMethod.getVisibility());
}
if (methodDescriptions.isEmpty()) {
return new Resolved<U>(key, methodDescription, visibility, bridge);
} else if (methodDescriptions.size() == 1) {
return new Resolved<U>(key, methodDescriptions.iterator().next(), visibility, Resolved.NOT_MADE_VISIBLE);
} else {
return new Ambiguous<U>(key, methodDescriptions, visibility);
}
}
代码示例来源:origin: alibaba/jvm-sandbox
@Override
public MatchingResult matching(ClassStructure classStructure) {
boolean isFirst = true;
final MatchingResult result = new MatchingResult();
final LinkedHashSet<BehaviorStructure> found = new LinkedHashSet<BehaviorStructure>();
if (null == matcherArray) {
return result;
}
for (final Matcher subMatcher : matcherArray) {
final MatchingResult subResult = subMatcher.matching(classStructure);
// 只要有一次匹配失败,剩下的是取交集运算,所以肯定也没戏,就不用花这个计算了
if (!subResult.isMatched()) {
return result;
}
if (isFirst) {
found.addAll(subResult.getBehaviorStructures());
isFirst = false;
} else {
found.retainAll(subResult.getBehaviorStructures());
}
}
if (!found.isEmpty()) {
result.getBehaviorStructures().addAll(found);
}
return result;
}
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
if (names.isEmpty()) {
names.add(UniqueNameGenerator.generateUniqueName("i", usedNames));
代码示例来源:origin: hibernate/hibernate-orm
@Test
@TestForIssue( jiraKey = "HHH-10515" )
public void testNoJdbcMetadataDialectOverride() {
final StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySetting( "hibernate.temp.use_jdbc_metadata_defaults", "false" )
.applySetting( AvailableSettings.DIALECT, TestDialect.class.getName() )
.build();
JdbcEnvironment jdbcEnvironment = serviceRegistry.getService( JdbcEnvironment.class );
ExtractedDatabaseMetaData extractedDatabaseMetaData = jdbcEnvironment.getExtractedDatabaseMetaData();
assertNull( extractedDatabaseMetaData.getConnectionCatalogName() );
assertNull( extractedDatabaseMetaData.getConnectionSchemaName() );
assertTrue( extractedDatabaseMetaData.getTypeInfoSet().isEmpty() );
assertTrue( extractedDatabaseMetaData.getExtraKeywords().isEmpty() );
assertTrue( extractedDatabaseMetaData.supportsNamedParameters() );
assertFalse( extractedDatabaseMetaData.supportsRefCursors() );
assertFalse( extractedDatabaseMetaData.supportsScrollableResults() );
assertFalse( extractedDatabaseMetaData.supportsGetGeneratedKeys() );
assertFalse( extractedDatabaseMetaData.supportsBatchUpdates() );
assertFalse( extractedDatabaseMetaData.supportsDataDefinitionInTransaction() );
assertFalse( extractedDatabaseMetaData.doesDataDefinitionCauseTransactionCommit() );
assertNull( extractedDatabaseMetaData.getSqlStateType() );
assertFalse( extractedDatabaseMetaData.doesLobLocatorUpdateCopy() );
StandardServiceRegistryBuilder.destroy( serviceRegistry );
}
代码示例来源:origin: hibernate/hibernate-orm
@Test
@TestForIssue( jiraKey = "HHH-10515" )
public void testNoJdbcMetadataDefaultDialect() {
final StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySetting( "hibernate.temp.use_jdbc_metadata_defaults", "false" )
.build();
JdbcEnvironment jdbcEnvironment = serviceRegistry.getService( JdbcEnvironment.class );
ExtractedDatabaseMetaData extractedDatabaseMetaData = jdbcEnvironment.getExtractedDatabaseMetaData();
assertNull( extractedDatabaseMetaData.getConnectionCatalogName() );
assertNull( extractedDatabaseMetaData.getConnectionSchemaName() );
assertTrue( extractedDatabaseMetaData.getTypeInfoSet().isEmpty() );
assertTrue( extractedDatabaseMetaData.getExtraKeywords().isEmpty() );
assertFalse( extractedDatabaseMetaData.supportsNamedParameters() );
assertFalse( extractedDatabaseMetaData.supportsRefCursors() );
assertFalse( extractedDatabaseMetaData.supportsScrollableResults() );
assertFalse( extractedDatabaseMetaData.supportsGetGeneratedKeys() );
assertFalse( extractedDatabaseMetaData.supportsBatchUpdates() );
assertFalse( extractedDatabaseMetaData.supportsDataDefinitionInTransaction() );
assertFalse( extractedDatabaseMetaData.doesDataDefinitionCauseTransactionCommit() );
assertNull( extractedDatabaseMetaData.getSqlStateType() );
assertFalse( extractedDatabaseMetaData.doesLobLocatorUpdateCopy() );
StandardServiceRegistryBuilder.destroy( serviceRegistry );
}
内容来源于网络,如有侵权,请联系作者删除!