本文整理匯總了Java中com.google.common.collect.ImmutableSortedMap類的典型用法代碼示例。如果您正苦於以下問題:Java ImmutableSortedMap類的具體用法?Java ImmutableSortedMap怎麽用?Java ImmutableSortedMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ImmutableSortedMap類屬於com.google.common.collect包,在下文中一共展示了ImmutableSortedMap類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AbstractStructSchema
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
public AbstractStructSchema(
ModelType<T> type,
Iterable<ModelProperty<?>> properties,
Iterable<WeaklyTypeReferencingMethod<?, ?>> nonPropertyMethods,
Iterable<ModelSchemaAspect> aspects
) {
super(type);
ImmutableSortedMap.Builder<String, ModelProperty<?>> builder = ImmutableSortedMap.naturalOrder();
for (ModelProperty<?> property : properties) {
builder.put(property.getName(), property);
}
this.properties = builder.build();
this.nonPropertyMethods = ImmutableSet.copyOf(nonPropertyMethods);
this.aspects = Maps.uniqueIndex(aspects, new Function<ModelSchemaAspect, Class<? extends ModelSchemaAspect>>() {
@Override
public Class<? extends ModelSchemaAspect> apply(ModelSchemaAspect aspect) {
return aspect.getClass();
}
});
}
示例2: collectManagedProperties
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
private <T> ImmutableSortedMap<String, ManagedProperty<?>> collectManagedProperties(StructBindingExtractionContext<T> extractionContext, Map<String, Multimap<PropertyAccessorType, StructMethodBinding>> propertyBindings) {
ImmutableSortedMap.Builder<String, ManagedProperty<?>> managedPropertiesBuilder = ImmutableSortedMap.naturalOrder();
for (Map.Entry<String, Multimap<PropertyAccessorType, StructMethodBinding>> propertyEntry : propertyBindings.entrySet()) {
String propertyName = propertyEntry.getKey();
Multimap<PropertyAccessorType, StructMethodBinding> accessorBindings = propertyEntry.getValue();
if (isManagedProperty(extractionContext, propertyName, accessorBindings)) {
if (hasSetter(accessorBindings.keySet()) && !hasGetter(accessorBindings.keySet())) {
extractionContext.add(propertyName, "it must both have an abstract getter and a setter");
continue;
}
ModelType<?> propertyType = determineManagedPropertyType(extractionContext, propertyName, accessorBindings);
ModelSchema<?> propertySchema = schemaStore.getSchema(propertyType);
managedPropertiesBuilder.put(propertyName, createManagedProperty(extractionContext, propertyName, propertySchema, accessorBindings));
}
}
return managedPropertiesBuilder.build();
}
示例3: DefaultStructBindings
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
protected DefaultStructBindings(
StructSchema<T> publicSchema,
Iterable<? extends StructSchema<?>> declaredViewSchemas,
Iterable<? extends StructSchema<?>> implementedViewSchemas,
@Nullable StructSchema<?> delegateSchema,
Map<String, ManagedProperty<?>> managedProperties,
Iterable<StructMethodBinding> methodBindings
) {
this.publicSchema = publicSchema;
this.declaredViewSchemas = ImmutableSet.copyOf(declaredViewSchemas);
this.implementedViewSchemas = ImmutableSet.copyOf(implementedViewSchemas);
this.delegateSchema = delegateSchema;
this.managedProperties = ImmutableSortedMap.copyOf(managedProperties, Ordering.natural());
this.methodBindings = ImmutableList.copyOf(methodBindings);
}
示例4: LongPositions
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
LongPositions(Iterable<? extends Object> elements, final int bitPerLong) {
this.elements = ImmutableList.copyOf(elements);
checkArgument(bitPerLong <= BITS_IN_LONG, bitPerLong);
for (int i = 0; i < this.elements.size(); i++) {
positions.put(
this.elements.get(i),
new BitPosition(
i / bitPerLong,
i % bitPerLong));
}
this.longPositions = ImmutableSortedMap.copyOf(
Maps.transformEntries(
Multimaps.index(positions.values(), ToLongIndex.FUNCTION).asMap(),
new Maps.EntryTransformer<Integer, Collection<BitPosition>, LongSet>() {
@Override
public LongSet transformEntry(Integer key, Collection<BitPosition> position) {
return new LongSet(key, position);
}
}));
}
示例5: ScoreKBPAgainstERE
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
@Inject
ScoreKBPAgainstERE(
final Parameters params,
final Map<String, ScoringEventObserver<DocLevelEventArg, DocLevelEventArg>> scoringEventObservers,
final ResponsesAndLinkingFromEREExtractor responsesAndLinkingFromEREExtractor,
ResponsesAndLinkingFromKBPExtractorFactory responsesAndLinkingFromKBPExtractorFactory,
@DocIDsToScoreP Set<Symbol> docIdsToScore,
@KeyFileMapP Map<Symbol, File> keyFilesMap,
Predicate<DocLevelEventArg> inScopePredicate,
@PermitMissingSystemDocsP boolean permitMissingSystemDocuments) {
this.params = checkNotNull(params);
// we use a sorted map because the binding of plugins may be non-deterministic
this.scoringEventObservers = ImmutableSortedMap.copyOf(scoringEventObservers);
this.responsesAndLinkingFromEREExtractor = checkNotNull(responsesAndLinkingFromEREExtractor);
this.responsesAndLinkingFromKBPExtractorFactory = responsesAndLinkingFromKBPExtractorFactory;
this.docIDsToScore = ImmutableSet.copyOf(docIdsToScore);
this.goldDocIDToFileMap = ImmutableMap.copyOf(keyFilesMap);
this.inScopePredicate = inScopePredicate;
this.permitMissingSystemDocuments = permitMissingSystemDocuments;
}
示例6: ThriftStructMetadata
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
public ThriftStructMetadata(
String structName,
Map<String, String> idlAnnotations,
Type structType,
Type builderType,
MetadataType metadataType,
Optional<ThriftMethodInjection> builderMethod,
List<String> documentation,
List<ThriftFieldMetadata> fields,
Optional<ThriftConstructorInjection> constructorInjection,
List<ThriftMethodInjection> methodInjections)
{
this.builderType = builderType;
this.builderMethod = requireNonNull(builderMethod, "builderMethod is null");
this.structName = requireNonNull(structName, "structName is null");
this.idlAnnotations = requireNonNull(idlAnnotations, "idlAnnotations is null");
this.metadataType = requireNonNull(metadataType, "metadataType is null");
this.structType = requireNonNull(structType, "structType is null");
this.constructorInjection = requireNonNull(constructorInjection, "constructorInjection is null");
this.documentation = ImmutableList.copyOf(requireNonNull(documentation, "documentation is null"));
this.fields = ImmutableSortedMap.copyOf(uniqueIndex(requireNonNull(fields, "fields is null"), ThriftFieldMetadata::getId));
this.methodInjections = ImmutableList.copyOf(requireNonNull(methodInjections, "methodInjections is null"));
}
示例7: testParseUberphenoHead
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
@Test
public void testParseUberphenoHead() throws IOException {
final UberphenoOboParser parser = new UberphenoOboParser(uberphenoHeadFile, true);
final UberphenoOntology ontology = parser.parse();
assertEquals(
"ImmutableDirectedGraph [edgeLists={ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=2]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], id=4]], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=1]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], id=4]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=2], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=1], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=3]], outEdges=[]], ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=3]]]}, edgeCount=4]",
ontology.getGraph().toString());
assertEquals(
"[ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186], ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001]]",
ImmutableSortedSet.copyOf(ontology.getAllTermIds()).toString());
assertEquals(
"{ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001]=UberphenoTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], altTermIds=[], name=All, definition=null, comment=null, subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001]=UberphenoTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], altTermIds=[], name=mammalian phenotype, definition=null, comment=null, subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186]=UberphenoTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186], altTermIds=[], name=pigmentation phenotype, definition=null, comment=null, subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001]=UberphenoTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], altTermIds=[], name=UBERPHENO_ROOT, definition=null, comment=null, subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null], ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001]=UberphenoTerm [id=ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001], altTermIds=[], name=abnormal(ly) quality zebrafish anatomical entity, definition=null, comment=null, subsets=[], synonyms=[], obsolete=false, createdBy=null, creationDate=null]}",
ImmutableSortedMap.copyOf(ontology.getTermMap()).toString());
assertEquals(
"{1=UberphenoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=1, relationQualifier=IS_A], 2=UberphenoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=HP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=2, relationQualifier=IS_A], 3=UberphenoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=ZP], id=0000001], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001], id=3, relationQualifier=IS_A], 4=UberphenoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0001186], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=MP], id=0000001], id=4, relationQualifier=IS_A]}",
ImmutableSortedMap.copyOf(ontology.getRelationMap()).toString());
assertEquals("ImmutableTermId [prefix=ImmutableTermPrefix [value=UBERPHENO], id=00000001]",
ontology.getRootTermId().toString());
assertEquals("{date=20:01:2012 06:00}", ontology.getMetaInfo().toString());
}
示例8: ImmutableOntology
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
/**
* Constructor.
*
* @param metaInfo {@link ImmutableMap} with meta information.
* @param graph Graph to use for underlying structure.
* @param rootTermId Root node's {@link TermId}.
* @param nonObsoleteTermIds {@link Collection} of {@link TermId}s of non-obsolete terms.
* @param obsoleteTermIds {@link Collection} of {@link TermId}s of obsolete terms.
* @param termMap Mapping from {@link TermId} to <code>T</code>.
* @param relationMap Mapping from numeric edge Id to <code>R</code>.
*/
public ImmutableOntology(ImmutableSortedMap<String, String> metaInfo,
ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>> graph, TermId rootTermId,
Collection<? extends TermId> nonObsoleteTermIds, Collection<? extends TermId> obsoleteTermIds,
ImmutableMap<TermId, T> termMap, ImmutableMap<Integer, R> relationMap) {
this.metaInfo = metaInfo;
this.graph = graph;
this.rootTermId = rootTermId;
this.termMap = termMap;
this.nonObsoleteTermIds = ImmutableSet.copyOf(nonObsoleteTermIds);
this.obsoleteTermIds = ImmutableSet.copyOf(obsoleteTermIds);
this.allTermIds =
ImmutableSet.copyOf(Sets.union(this.nonObsoleteTermIds, this.obsoleteTermIds));
this.relationMap = relationMap;
this.precomputedAncestors = precomputeAncestors();
}
示例9: createWriteBufferStats
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
private WriteBufferStats createWriteBufferStats(final String cfName, final String hostname) {
return new WriteBufferStats()
{
private ImmutableSortedMap<String, String> m_tags =
ImmutableSortedMap.<String, String>naturalOrder()
.put("host", hostname)
.put("buffer", cfName)
.build();
@Override
public void saveWriteSize(int pendingWrites)
{
putInternalDataPoint("kairosdb.datastore.write_size", m_tags,
m_longDataPointFactory.createDataPoint(System.currentTimeMillis(), pendingWrites));
}
};
}
示例10: parse
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
/**
* Parse OBO file into {@link HpoOntology} object.
*
* @return {@link HpoOntology} from parsing OBO file.
* @throws IOException In case of problems with file I/O.
*/
@SuppressWarnings("unchecked")
public GoOntology parse() throws IOException {
final OboImmutableOntologyLoader<GoTerm, GoTermRelation> loader =
new OboImmutableOntologyLoader<>(oboFile, debug);
final GoOboFactory factory = new GoOboFactory();
final ImmutableOntology<GoTerm, GoTermRelation> o = loader.load(factory);
// Convert ImmutableOntology into GoOntology. The casts here are ugly and require the
// @SuppressWarnings above but this saves us one factory layer of indirection.
return new GoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
(ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
(ImmutableMap<TermId, GoTerm>) o.getTermMap(),
(ImmutableMap<Integer, GoTermRelation>) o.getRelationMap());
}
示例11: parse
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
/**
* Parse OBO file into {@link MpoOntology} object.
*
* @return {@link MpoOntology} from parsing OBO file.
* @throws IOException In case of problems with file I/O.
*/
@SuppressWarnings("unchecked")
public MpoOntology parse() throws IOException {
final OboImmutableOntologyLoader<MpoTerm, MpoTermRelation> loader =
new OboImmutableOntologyLoader<>(oboFile, debug);
final MpoOboFactory factory = new MpoOboFactory();
final ImmutableOntology<MpoTerm, MpoTermRelation> o = loader.load(factory);
// Convert ImmutableOntology into Mpontology. The casts here are ugly and require the
// @SuppressWarnings above but this saves us one factory layer of indirection.
return new MpoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
(ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
(ImmutableMap<TermId, MpoTerm>) o.getTermMap(),
(ImmutableMap<Integer, MpoTermRelation>) o.getRelationMap());
}
示例12: parse
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
/**
* Parse OBO file into {@link UberphenoOntology} object.
*
* @return {@link UberphenoOntology} from parsing OBO file.
* @throws IOException In case of problems with file I/O.
*/
@SuppressWarnings("unchecked")
@Override
public UberphenoOntology parse() throws IOException {
final OboImmutableOntologyLoader<UberphenoTerm, UberphenoTermRelation> loader =
new OboImmutableOntologyLoader<>(oboFile, debug);
final UberphenoOboFactory factory = new UberphenoOboFactory();
final ImmutableOntology<UberphenoTerm, UberphenoTermRelation> o = loader.load(factory);
// Convert ImmutableOntology into Uberphenontology. The casts here are ugly and require the
// @SuppressWarnings above but this saves us one factory layer of indirection.
return new UberphenoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
(ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
(ImmutableMap<TermId, UberphenoTerm>) o.getTermMap(),
(ImmutableMap<Integer, UberphenoTermRelation>) o.getRelationMap());
}
示例13: testParseHpoHead
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
@Test
public void testParseHpoHead() throws IOException {
final GoOboParser parser = new GoOboParser(goHeadFile, true);
final GoOntology ontology = parser.parse();
assertEquals(
"ImmutableDirectedGraph [edgeLists={ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000]=ImmutableVertexEdgeList [inEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0003674], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=1], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005575], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=2], ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008150], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=3]], outEdges=[]], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0003674]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0003674], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=1]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005575]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005575], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=2]]], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008150]=ImmutableVertexEdgeList [inEdges=[], outEdges=[ImmutableEdge [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008150], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=3]]]}, edgeCount=3]",
ontology.getGraph().toString());
assertEquals(
"[ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000004], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0003674], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005554], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005575], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0007582], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008150], ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008372]]",
ImmutableSortedSet.copyOf(ontology.getAllTermIds()).toString());
assertThat(ImmutableSortedMap.copyOf(ontology.getTermMap()).toString(),
startsWith("{ImmutableTermId"));
assertThat(ImmutableSortedMap.copyOf(ontology.getTermMap()).toString(),
endsWith("description=null, trailingModifiers=null]]]}"));
assertEquals(
"{1=GoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0003674], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=1, relationQualifier=IS_A], 2=GoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0005575], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=2, relationQualifier=IS_A], 3=GoTermRelation [source=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0008150], dest=ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000], id=3, relationQualifier=IS_A]}",
ImmutableSortedMap.copyOf(ontology.getRelationMap()).toString());
assertEquals("ImmutableTermId [prefix=ImmutableTermPrefix [value=GO], id=0000000]",
ontology.getRootTermId().toString());
assertEquals(
"{data-version=releases/2017-06-16, remark=Includes Ontology(OntologyID(OntologyIRI(<http://purl.obolibrary.org/obo/go/never_in_taxon.owl>))) [Axioms: 18 Logical Axioms: 0]}",
ontology.getMetaInfo().toString());
}
示例14: SaveAsDataPointAggregator
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
public SaveAsDataPointAggregator(DataPointGroup innerDataPointGroup)
{
m_innerDataPointGroup = innerDataPointGroup;
ImmutableSortedMap.Builder<String, String> mapBuilder = ImmutableSortedMap.<String, String>naturalOrder();
mapBuilder.putAll(m_tags);
if (m_addSavedFrom)
mapBuilder.put("saved_from", innerDataPointGroup.getName());
for (String innerTag : innerDataPointGroup.getTagNames())
{
Set<String> tagValues = innerDataPointGroup.getTagValues(innerTag);
if (m_tagsToKeep.contains(innerTag) && (tagValues.size() == 1))
mapBuilder.put(innerTag, tagValues.iterator().next());
}
m_groupTags = mapBuilder.build();
}
示例15: drawDistanceDiscounts
import com.google.common.collect.ImmutableSortedMap; //導入依賴的package包/類
/**
* Determines the discount in value for distant regions
*/
public ImmutableSortedMap<Integer, BigDecimal> drawDistanceDiscounts(MRVMWorld world, MRVMRegionsMap.Region home, UniformDistributionRNG rng) {
ImmutableSortedMap.Builder<Integer, BigDecimal> distanceDiscount = ImmutableSortedMap.naturalOrder();
distanceDiscount.put(0, BigDecimal.ONE);
int maxDistance = world.getRegionsMap().getLongestShortestPath(home);
for (int i = 1; i <= maxDistance; i++) {
double exponent = exponentFactor * i * (-1);
double gamma = Math.pow(base, exponent);
Preconditions.checkState(gamma >= 0 && gamma <= 1, "Invalid Gamma, some of the calculation parameters have unallowed values");
BigDecimal roundedGamma = BigDecimal.valueOf(gamma).setScale(5, BigDecimal.ROUND_HALF_DOWN);
distanceDiscount.put(i, roundedGamma);
}
return distanceDiscount.build();
}