org.jsimpledb.demo.AbstractHasSatellites Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-demo Show documentation
Show all versions of jsimpledb-demo Show documentation
JSimpleDB demonstration classes.
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.demo;
import java.util.NavigableSet;
import org.jsimpledb.JObject;
import org.jsimpledb.util.NavigableSets;
/**
* Support superclass for {@link HasSatellites} implementations.
*/
public abstract class AbstractHasSatellites> extends AbstractBody implements HasSatellites {
private final Class satelliteType;
protected AbstractHasSatellites(Class satelliteType) {
this.satelliteType = satelliteType;
}
@Override
public NavigableSet getSatellites() {
final NavigableSet satellites = this.getTransaction().queryIndex(
this.satelliteType, "parent", JObject.class).asMap().get(this);
return satellites != null ? satellites : NavigableSets.empty();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy